fix: 13662、13673、13173
This commit is contained in:
parent
5dcbf2d28f
commit
8e890e89fd
|
@ -470,8 +470,8 @@ const query = reactive({
|
|||
},
|
||||
{
|
||||
title: '接入方式',
|
||||
key: 'accessName',
|
||||
dataIndex: 'accessName',
|
||||
key: 'accessId',
|
||||
dataIndex: 'accessId',
|
||||
search: {
|
||||
type: 'select',
|
||||
options: async () => {
|
||||
|
@ -482,7 +482,7 @@ const query = reactive({
|
|||
typeList.value = [];
|
||||
typeList.value = resp.result.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
res(typeList.value);
|
||||
});
|
||||
|
|
|
@ -271,11 +271,11 @@ const columns = [
|
|||
},
|
||||
{
|
||||
title: '关联场景联动',
|
||||
dataIndex: 'sceneId',
|
||||
wdith: 250,
|
||||
dataIndex: 'scene',
|
||||
scopedSlots: true,
|
||||
search: {
|
||||
type: 'select',
|
||||
// defaultTermType: 'rule-bind-alarm',
|
||||
options: async () => {
|
||||
const res = await getScene(
|
||||
encodeQuery({
|
||||
|
@ -338,7 +338,23 @@ const map = {
|
|||
other: '其他',
|
||||
};
|
||||
const handleSearch = (e: any) => {
|
||||
params.value = e;
|
||||
const _terms = (e?.terms || []).map((item: any) => {
|
||||
item.terms = item.terms.map((i: any) => {
|
||||
if(i.column === 'scene'){
|
||||
return {
|
||||
...i,
|
||||
termType: 'rule-bind-alarm',
|
||||
column: 'id'
|
||||
}
|
||||
}
|
||||
return i
|
||||
})
|
||||
return item
|
||||
})
|
||||
params.value = {
|
||||
...e,
|
||||
terms: _terms
|
||||
}
|
||||
};
|
||||
const queryDefaultLevel = () => {
|
||||
queryLevel().then((res) => {
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
v-if="['email'].includes(notifyType)"
|
||||
style="width: calc(100% - 120px)"
|
||||
placeholder="请选择收信人"
|
||||
@change="(key, label) => onChange(source, key, false, label)"
|
||||
@change="(key, label) => onChange(source, key, label)"
|
||||
:tree-data="treeData"
|
||||
:multiple="true"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
|
@ -66,7 +66,7 @@
|
|||
style="width: calc(100% - 120px)"
|
||||
placeholder="请选择收信人"
|
||||
@change="
|
||||
(key, label) => onChange(source, key, undefined, label)
|
||||
(key, label) => onChange(source, key, label)
|
||||
"
|
||||
:tree-data="treeData"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
|
@ -102,7 +102,6 @@
|
|||
onChange(
|
||||
source,
|
||||
val,
|
||||
false,
|
||||
option?.label || option?.name,
|
||||
)
|
||||
"
|
||||
|
@ -120,7 +119,6 @@
|
|||
onChange(
|
||||
source,
|
||||
val,
|
||||
false,
|
||||
Array.isArray(val) ? val.join(',') : val,
|
||||
)
|
||||
"
|
||||
|
@ -132,7 +130,7 @@
|
|||
:value="value?.value"
|
||||
@change="
|
||||
(e) =>
|
||||
onChange(source, e.target.value, false, e.target.value)
|
||||
onChange(source, e.target.value, e.target.value)
|
||||
"
|
||||
></j-input>
|
||||
</template>
|
||||
|
@ -183,7 +181,13 @@ const triggerType = computed(() => {
|
|||
|
||||
const relationData = computed(() => {
|
||||
const item = props.value;
|
||||
if (item?.source === 'relation') {
|
||||
if(notifyType.value === 'email'){
|
||||
if(item && Array.isArray(item) && item.length){
|
||||
if(item[0].source === 'relation'){
|
||||
return item.map(i => i?.relation?.objectId)
|
||||
}
|
||||
}
|
||||
} else if (item?.source === 'relation') {
|
||||
const relation = item?.relation;
|
||||
if (relation) {
|
||||
if (relation.objectId) {
|
||||
|
@ -324,7 +328,7 @@ const getObj = (
|
|||
const onChange = (
|
||||
_source: string = 'fixed',
|
||||
_value?: string | string[],
|
||||
isRelation?: boolean,
|
||||
// isRelation?: boolean,
|
||||
_name?: string,
|
||||
) => {
|
||||
let _values: any = undefined;
|
||||
|
@ -332,17 +336,16 @@ const onChange = (
|
|||
const _names: string[] = Array.isArray(_name) ? _name : [_name || ''];
|
||||
if (Array.isArray(_value)) {
|
||||
if (props?.notify?.notifyType === 'email') {
|
||||
if (isRelation) {
|
||||
const arr = _value.map((item) => {
|
||||
const _item = labelMap.get(item);
|
||||
_names.push(_item?.name || '');
|
||||
return getObj('relation', item, _item?.relation);
|
||||
});
|
||||
_values = arr;
|
||||
} else {
|
||||
_values = getObj(_source, _value, false);
|
||||
_values = _value.map((item) => {
|
||||
return {
|
||||
source: "relation",
|
||||
relation:{
|
||||
objectType: "user",
|
||||
objectId: item
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const item = treeDataMap.get(_value)
|
||||
const _isRelation = item?.isRelation
|
||||
|
|
|
@ -149,7 +149,7 @@
|
|||
:model="form.data"
|
||||
class="basic-form permiss-form"
|
||||
>
|
||||
<j-form-item name="accessSupport" required>
|
||||
<j-form-item name="accessSupport" required v-if="isNoCommunity">
|
||||
<template #label>
|
||||
<span style="margin-right: 3px">数据权限控制</span>
|
||||
<j-tooltip title="此菜单页面数据所对应的资产类型">
|
||||
|
@ -263,7 +263,6 @@ import { FormInstance } from 'ant-design-vue';
|
|||
import { message } from 'jetlinks-ui-components';
|
||||
import ChooseIconDialog from '../components/ChooseIconDialog.vue';
|
||||
import PermissChoose from '../components/PermissChoose.vue';
|
||||
|
||||
import {
|
||||
getMenuTree_api,
|
||||
getAssetsType_api,
|
||||
|
@ -273,6 +272,7 @@ import {
|
|||
validCode_api,
|
||||
} from '@/api/system/menu';
|
||||
import { Rule } from 'ant-design-vue/lib/form';
|
||||
import { isNoCommunity } from '@/utils/utils';
|
||||
|
||||
const permission = 'system/Menu';
|
||||
// 路由
|
||||
|
|
|
@ -38,6 +38,7 @@ import {
|
|||
import { message } from 'jetlinks-ui-components';
|
||||
import { modeType } from '../typing';
|
||||
import { useDepartmentStore } from '@/store/department';
|
||||
import { onlyMessage } from '@/utils/comm';
|
||||
|
||||
const department = useDepartmentStore();
|
||||
const emits = defineEmits([
|
||||
|
@ -136,12 +137,17 @@ const save = async () => {
|
|||
// emits('refresh');
|
||||
// });
|
||||
// fix: bug#10829
|
||||
if(addKeys.length || removeKeys.length) {
|
||||
removeKeys.length && (await delOperations_api(removeKeys));
|
||||
const res = await addOperations_api(addKeys);
|
||||
if (res.success) {
|
||||
message.success('操作成功');
|
||||
emits('refresh');
|
||||
}
|
||||
} else {
|
||||
onlyMessage('请选择API接口','error')
|
||||
return
|
||||
}
|
||||
} else if (props.mode === 'appManger') {
|
||||
const removeItems = removeKeys.map((key) => ({
|
||||
id: key,
|
||||
|
|
|
@ -109,6 +109,7 @@ import {
|
|||
USER_CENTER_MENU_CODE,
|
||||
MESSAGE_SUBSCRIBE_MENU_CODE
|
||||
} from '@/utils/consts'
|
||||
import { isNoCommunity } from '@/utils/utils'
|
||||
|
||||
const emits = defineEmits(['update:selectItems']);
|
||||
const route = useRoute();
|
||||
|
@ -117,6 +118,7 @@ const props = defineProps({
|
|||
});
|
||||
const treeRef = ref();
|
||||
let { ctx: that, proxy } = getCurrentInstance();
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '菜单权限',
|
||||
|
@ -130,13 +132,16 @@ const columns = [
|
|||
key: 'action',
|
||||
width: '260px',
|
||||
},
|
||||
{
|
||||
];
|
||||
|
||||
if(isNoCommunity){
|
||||
columns.push({
|
||||
title: '数据权限',
|
||||
dataIndex: 'data',
|
||||
key: 'data',
|
||||
width: '50%',
|
||||
},
|
||||
];
|
||||
})
|
||||
}
|
||||
const tableData = ref<tableItemType[]>([]);
|
||||
|
||||
// 表头-全选
|
||||
|
|
|
@ -270,6 +270,7 @@ type modalType = '' | 'add' | 'edit' | 'reset';
|
|||
|
||||
const handleParams = (params: any) => {
|
||||
const newParams = (params?.terms as any[])?.map((item1) => {
|
||||
let arr: any[] = []
|
||||
item1.terms = item1.terms.map((item2: any) => {
|
||||
if (['telephone', 'email'].includes(item2.column)) {
|
||||
return {
|
||||
|
@ -277,8 +278,27 @@ const handleParams = (params: any) => {
|
|||
value: [item2],
|
||||
};
|
||||
}
|
||||
if (['type'].includes(item2.column) && item2.value === 'other') {
|
||||
arr = [
|
||||
{
|
||||
...item2,
|
||||
type: 'or',
|
||||
termType: 'isnull',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
...item2,
|
||||
type: 'or',
|
||||
termType: 'empty',
|
||||
value: 1,
|
||||
}
|
||||
]
|
||||
}
|
||||
return item2;
|
||||
});
|
||||
if(arr.length){
|
||||
item1.terms = [...item1.terms, ...arr]
|
||||
}
|
||||
return item1;
|
||||
});
|
||||
queryParams.value = { terms: newParams || [] };
|
||||
|
|
Loading…
Reference in New Issue