fix: 修改用户管理的类型展示问题;修改网络组件的集群控制;

* fix: 15017

* fix: 修改bug(13663、15022、13672)

* fix: 修改操作栏的距离

* fix: bug#15019

* fix: 修改菜单配置

* fix: 修改网络组件的集群控制

* fix: 修改用户管理的类型展示问题
This commit is contained in:
XieYongHong 2023-06-06 15:40:37 +08:00 committed by GitHub
parent 820ca7330e
commit 099c6fa32a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 156 additions and 139 deletions

View File

@ -219,7 +219,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 150,
width: 60,
scopedSlots: true,
},
];

View File

@ -189,7 +189,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 150,
width: 60,
scopedSlots: true,
},
];

View File

@ -191,7 +191,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 200,
width: 160,
scopedSlots: true,
},
];

View File

@ -230,7 +230,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 200,
width: 160,
scopedSlots: true,
},
];

View File

@ -166,7 +166,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 200,
width: 120,
scopedSlots: true,
},
];

View File

@ -268,7 +268,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 250,
width: 200,
scopedSlots: true,
},
];

View File

@ -588,7 +588,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 250,
width: 200,
scopedSlots: true,
},
];

View File

@ -77,13 +77,14 @@
/>
</template>
</Guide>
<FullPage v-if="flowData.length !== 0">
<LineChart
v-if="flowData.length !== 0"
:showX="true"
:showY="true"
style="min-height: 490px"
:chartData="flowData"
/>
</FullPage>
<div class="empty-body" v-else>
<j-empty :image="Empty.PRESENTED_IMAGE_SIMPLE" />
</div>

View File

@ -142,7 +142,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 250,
width: 120,
scopedSlots: true,
},
];

View File

@ -118,6 +118,7 @@ const columns = [
dataIndex: 'createTime',
key: 'createTime',
scopedSlots: true,
width: 200,
search: {
type: 'date',
},
@ -126,6 +127,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 60,
scopedSlots: true,
},
];

View File

@ -114,7 +114,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 200,
width: 80,
scopedSlots: true,
},
];

View File

@ -207,7 +207,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 200,
width: 100,
scopedSlots: true,
},
];

View File

@ -41,7 +41,7 @@
/>
</j-form-item>
</j-col>
<j-col :span="24">
<j-col :span="24" v-if="isNoCommunity">
<j-form-item
name="shareCluster"
:rules="Rules.shareCluster"
@ -1139,6 +1139,7 @@ import { cloneDeep } from 'lodash-es';
import type { FormData2Type, FormDataType } from '../type';
import { Store } from 'jetlinks-store';
import LocalAddressSelect from './LocalAddressSelect.vue';
import { isNoCommunity } from '@/utils/utils';
const route = useRoute();
const NetworkType = route.query.type as string;
@ -1441,7 +1442,9 @@ onMounted(() => {
getSupports();
getCertificates();
getResourcesCurrent();
if(isNoCommunity){
getResourcesClusters();
}
getDetail();
});

View File

@ -263,7 +263,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 200,
width: 120,
scopedSlots: true,
},
];

View File

@ -279,7 +279,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 250,
width: 200,
scopedSlots: true,
},
];

View File

@ -233,7 +233,7 @@ const columns = [
title: '配置名称',
dataIndex: 'name',
key: 'name',
width: 100,
ellipsis: true,
search: {
type: 'string',
},
@ -280,7 +280,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 250,
width: 200,
scopedSlots: true,
},
];

View File

@ -229,6 +229,7 @@ const columns = [
title: '模板名称',
dataIndex: 'name',
key: 'name',
ellipsis: true,
search: {
type: 'string',
},
@ -273,7 +274,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 250,
width: 200,
scopedSlots: true,
},
];

View File

@ -327,7 +327,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 150,
width: 120,
scopedSlots: true,
},
];

View File

@ -226,7 +226,7 @@ const columns = [
title: '操作',
key: 'action',
fixed: 'right',
width: 250,
width: 150,
scopedSlots: true,
},
];

View File

@ -244,7 +244,8 @@ const save = async (step?: number) => {
operation: typeData.data,
selector: addModel.selector,
selectorValues: addModel.selectorValues,
productId: addModel.productId
productId: addModel.productId,
source: 'fixed'
}
emit('save', data, _options)
formItemContext.onFieldChange()

View File

@ -62,7 +62,8 @@ const check = async (): Promise<boolean> => {
let hasProperties = false
if (metadata.properties.length) {
if (deviceTrigger.operation?.readProperties && deviceTrigger.operation?.readProperties.length) {
hasProperties = metadata.properties.every((item: any) => deviceTrigger.operation!.readProperties!.includes(item.id))
// hasProperties = metadata.properties.every((item: any) => deviceTrigger.operation!.readProperties!.includes(item.id))
hasProperties = deviceTrigger.operation!.readProperties.every(_id => metadata.properties.some((item: any) => item.id === _id))
} else if (deviceTrigger.operation?.writeProperties && Object.keys(deviceTrigger.operation?.writeProperties).length) {
const key = Object.keys(deviceTrigger.operation?.writeProperties)[0]
hasProperties = metadata.properties.some((item: any) => key ===item.id)

View File

@ -125,7 +125,8 @@ const checkDeviceDelete = async () => {
if (item!.selectorValues && metadata?.tags?.length) {
const values = (item!.selectorValues?.[0]?.value as any).map((item: any) => item.column)
const tagKeys = new Set(values)
hasAllTags = metadata?.tags?.every((item: any) => tagKeys.has(item.id))
hasAllTags = [...tagKeys.values()].every((_key) => metadata?.tags.some((item: any) => item.id === _key))
// hasAllTags = metadata?.tags?.every((item: any) => tagKeys.has(item.id))
}
if (!hasAllTags) {
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.selectorValues = undefined

View File

@ -1,5 +1,5 @@
<template>
<div :class='["actions-terms-warp", isFirst ? "first-children" : ""]'>
<div :class='WarpClass'>
<div class='actions-terms-title'>
{{ isFirst ? '当' : '否则' }}
</div>
@ -30,6 +30,8 @@
<div class='actions-terms-list-content'>
<template v-if='showWhen'>
<j-scrollbar>
<div style="display: flex; padding-top: 10px;">
<WhenItem
v-for='(item, index) in whenData'
:key='item.key'
@ -40,13 +42,18 @@
:branchName='name'
:data='item'
/>
</div>
</j-scrollbar>
</template>
<span v-else class='when-add' @click='addWhen' :style='{ padding: isFirst ? "16px 0" : 0 }'>
<div v-else style="display: flex; padding-top: 10px;">
<span class='when-add' @click='addWhen' :style='{ padding: isFirst ? "16px 0" : 0 }'>
<AIcon type='PlusCircleOutlined' style='padding: 4px' />
添加过滤条件
</span>
</div>
</div>
</div>
<div class='actions-branches'>
<j-form-item
:name='["branches", name, "then"]'
@ -109,6 +116,14 @@ const whenData = computed(() => {
return props.data.when
})
const WarpClass = computed(() => {
return {
'actions-terms-warp': true,
'first-children': props.isFirst,
'terms-items': (FormModel.value.branches?.length || 0) > 0
}
})
const onDelete = () => {
if (FormModel.value.branches?.length == 2) {
FormModel.value.branches?.splice(props.name, 1, null)

View File

@ -1,18 +1,4 @@
<template>
<div
class='terms-params-content'
@mouseover='mouseover'
@mouseout='mouseout'
>
<j-popconfirm
title='确认删除?'
:overlayStyle='{minWidth: "180px"}'
@confirm='onDelete'
>
<div v-show='showDelete' class='terms-params-delete'>
<AIcon type='CloseOutlined' />
</div>
</j-popconfirm>
<j-form-item
:name='["branches", branchName, "when", whenName, "terms", props.name]'
:rules='rules'
@ -27,7 +13,6 @@
:branchName='branchName'
/>
</j-form-item>
</div>
</template>
<script setup lang='ts' name='TermsItem'>
@ -114,50 +99,6 @@ const rules = [
}
]
const showDelete = ref(false)
const termsData = computed(() => {
return props.data.terms
})
const mouseover = () => {
if (props.showDeleteBtn){
showDelete.value = true
}
}
const mouseout = () => {
if (props.showDeleteBtn){
showDelete.value = false
}
}
const onDelete = () => {
formModel.value.branches?.[props.branchName]?.when?.splice(props.whenName, 1)
formModel.value.options!.when[props.branchName].terms.splice(props.whenName, 1)
}
const addTerms = () => {
const terms = {
type: 'and',
terms: [
{
column: undefined,
value: {
source: 'fixed',
value: undefined
},
termType: undefined,
key: `params_${randomString()}`,
type: 'and',
}
],
key: `terms_${randomString()}`
}
formModel.value.branches?.[props.branchName]?.when?.[props.whenName].terms?.push(terms)
formModel.value.options!.when[props.branchName].terms[props.whenName].terms.push(['','eq','','and'])
}
</script>
<style scoped>

View File

@ -12,6 +12,20 @@
@select='typeChange'
/>
</div>
<div
class='terms-params-content'
@mouseover='mouseover'
@mouseout='mouseout'
>
<j-popconfirm
title='确认删除?'
:overlayStyle='{minWidth: "180px"}'
@confirm='onDelete'
>
<div v-show='showDelete' class='terms-params-delete'>
<AIcon type='CloseOutlined' />
</div>
</j-popconfirm>
<TermsItem
v-for='(item, index) in termsData'
:key='item.key'
@ -23,6 +37,7 @@
:isLast='index === termsData.length -1'
:data='item'
/>
</div>
<div class='terms-group-add' @click='addWhen' v-if='isLast'>
<div class='terms-content'>
<AIcon type='PlusOutlined' />
@ -80,6 +95,20 @@ const props = defineProps({
}
})
const showDelete = ref(false)
const mouseover = () => {
if (props.showDeleteBtn){
showDelete.value = true
}
}
const mouseout = () => {
if (props.showDeleteBtn){
showDelete.value = false
}
}
const termsData = computed(() => {
return props.data.terms
})
@ -88,6 +117,11 @@ const typeChange = (e: any) => {
formModel.value.options!.when[props.name].terms[props.name].termType = e.label
}
const onDelete = () => {
formModel.value.branches?.[props.branchName]?.when?.splice(props.name, 1)
formModel.value.options!.when[props.branchName].terms.splice(props.name, 1)
}
const addWhen = () => {
const terms = {
type: 'and',

View File

@ -56,6 +56,10 @@
margin-bottom: 0;
}
&.terms-items:last-child {
margin-bottom: 24px;
}
.when-add-button {
.add-button();
}
@ -96,11 +100,7 @@
}
.actions-terms-list-content {
display: flex;
padding-top: 10px;
overflow-x: auto;
overflow-y: visible;
row-gap: 16px;
}
}

View File

@ -231,7 +231,7 @@ const columns = [
dataIndex: 'action',
key: 'action',
scopedSlots: true,
width: '200px',
width: '160px',
fixed: 'right',
},
];

View File

@ -173,7 +173,7 @@
}}</span>
</template>
<template #action="slotProps">
<j-space :size="16">
<j-space>
<PermissionButton
v-for="i in table.getActions(slotProps, 'table')"
:hasPermission="i.permission"
@ -338,6 +338,7 @@ const columns = [
dataIndex: 'action',
key: 'action',
fixed: 'right',
width: 150,
scopedSlots: true,
},
];
@ -584,6 +585,7 @@ const table = {
refresh: () => {
nextTick(() => {
tableRef.value.reload();
table.cancelSelect()
});
},
};

View File

@ -192,6 +192,7 @@
v-for="i in table.getActions(slotProps, 'table')"
:hasPermission="i.permission"
type="link"
:key="i.key"
:tooltip="i?.tooltip"
:pop-confirm="i.popConfirm"
@click="i.onClick"
@ -321,6 +322,7 @@ const columns = [
dataIndex: 'action',
key: 'action',
fixed: 'right',
width: 100,
scopedSlots: true,
},
];
@ -576,6 +578,7 @@ const table = {
refresh: () => {
nextTick(() => {
tableRef.value.reload();
table.cancelSelect()
});
},
addConfirm: () => {

View File

@ -147,7 +147,7 @@ const columns = [
dataIndex: 'action',
key: 'action',
scopedSlots: true,
width: '200px',
width: 80,
},
];
//

View File

@ -71,7 +71,8 @@ import {
getMaxDepth,
mergeArr,
findAllParentsAndChildren,
handleSorts
handleSorts,
handleSortsArr
} from './utils';
import BaseMenu from '@/views/init-home/data/baseMenu';
import type { AntTreeNodeDropEvent } from 'ant-design-vue/es/tree';
@ -214,7 +215,7 @@ onMounted(() => {
);
//
treeData.value = handleSorts(AllMenu);
treeData.value = handleSortsArr(AllMenu);
}
});
});

View File

@ -60,9 +60,7 @@ export const mergeArr = (oldData: Array<any>, newData: Array<any>) => {
(child) => child.code === oldChild.code,
);
if (index !== -1) {
mergedChildren.push(
mergeItem(oldChild, newChildren[index]),
);
mergedChildren.push(mergeItem(oldChild, newChildren[index]));
newChildren.splice(index, 1);
} else {
//防止重复code系统已经选中的code不能再从old中添加
@ -71,13 +69,14 @@ export const mergeArr = (oldData: Array<any>, newData: Array<any>) => {
}
}
}
return {
...oldItem,
children: mergedChildren.concat(newChildren),
};
}
return oldItem;
return oldItem
};
for (const newItem of newData) {
@ -102,7 +101,7 @@ export const mergeArr = (oldData: Array<any>, newData: Array<any>) => {
}
}
return mergedData;
return mergedData
};
/**
@ -322,3 +321,13 @@ export const handleSorts = (node: any[]) => {
return item
})
}
export const handleSortsArr = (node: any[]) => {
if (!node) return []
return node.sort((a, b) => a.sortIndex - b.sortIndex).map((item) => {
if (item.children) {
item.children = handleSortsArr(item.children)
}
return item
})
}

View File

@ -162,7 +162,7 @@ const columns = [
key: 'action',
fixed: 'right',
scopedSlots: true,
width: 200,
width: 150,
},
];
const queryParams = ref({ terms: [] });

View File

@ -204,7 +204,7 @@ const columns = [
title: '操作',
dataIndex: 'action',
key: 'action',
width: '200px',
width: 120,
fixed: 'right',
scopedSlots: true,
},

View File

@ -146,6 +146,7 @@ const columns = [
dataIndex: 'action',
key: 'action',
scopedSlots: true,
width: 100,
},
];
const queryParams = ref({});

View File

@ -117,7 +117,7 @@ const columns = [
title: '操作',
dataIndex: 'action',
key: 'action',
width: 200,
width: 120,
fixed: 'right',
scopedSlots: true,
},

View File

@ -32,7 +32,7 @@
</PermissionButton>
</template>
<template #type="slotProps">
{{ slotProps.type.name }}
{{ slotProps.type?.name }}
</template>
<template #status="slotProps">
<BadgeStatus
@ -220,6 +220,7 @@ const columns = [
dataIndex: 'action',
key: 'action',
fixed: 'right',
width: 150,
scopedSlots: true,
},
];