From 743f5b3fd700dcd20563860eec9b7055e729d8e4 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Mon, 5 Jun 2023 18:29:46 +0800 Subject: [PATCH 001/228] fix: 15017 --- src/views/rule-engine/Scene/Save/Device/AddModal.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/rule-engine/Scene/Save/Device/AddModal.vue b/src/views/rule-engine/Scene/Save/Device/AddModal.vue index 9f06c747..3abcd91d 100644 --- a/src/views/rule-engine/Scene/Save/Device/AddModal.vue +++ b/src/views/rule-engine/Scene/Save/Device/AddModal.vue @@ -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() From c42a5139d5f5d11e89926b18649794ef737b1da2 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 6 Jun 2023 13:32:13 +0800 Subject: [PATCH 002/228] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9bug(13663?= =?UTF-8?q?=E3=80=8115022=E3=80=8113672)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scene/Save/Device/CheckItem.vue | 3 ++- .../Scene/Save/action/ListItem/CheckItem.vue | 3 ++- src/views/system/Department/device/index.vue | 1 + src/views/system/Department/product/index.vue | 2 ++ src/views/system/Menu/Setting/utils.ts | 20 ++++++++----------- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/Device/CheckItem.vue b/src/views/rule-engine/Scene/Save/Device/CheckItem.vue index 4738b54b..eb4562b6 100644 --- a/src/views/rule-engine/Scene/Save/Device/CheckItem.vue +++ b/src/views/rule-engine/Scene/Save/Device/CheckItem.vue @@ -62,7 +62,8 @@ const check = async (): Promise => { 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) diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue b/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue index 7c7b6d89..6f28a886 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/CheckItem.vue @@ -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 diff --git a/src/views/system/Department/device/index.vue b/src/views/system/Department/device/index.vue index cf245c32..524756b8 100644 --- a/src/views/system/Department/device/index.vue +++ b/src/views/system/Department/device/index.vue @@ -584,6 +584,7 @@ const table = { refresh: () => { nextTick(() => { tableRef.value.reload(); + table.cancelSelect() }); }, }; diff --git a/src/views/system/Department/product/index.vue b/src/views/system/Department/product/index.vue index c6136df2..85d3dca8 100644 --- a/src/views/system/Department/product/index.vue +++ b/src/views/system/Department/product/index.vue @@ -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" @@ -576,6 +577,7 @@ const table = { refresh: () => { nextTick(() => { tableRef.value.reload(); + table.cancelSelect() }); }, addConfirm: () => { diff --git a/src/views/system/Menu/Setting/utils.ts b/src/views/system/Menu/Setting/utils.ts index e1be234f..f67a9848 100644 --- a/src/views/system/Menu/Setting/utils.ts +++ b/src/views/system/Menu/Setting/utils.ts @@ -39,7 +39,7 @@ export const mergeArr = (oldData: Array, newData: Array) => { return newItem; } - if(oldItem && newItem){ + if (oldItem && newItem) { oldItem.sortIndex = newItem?.sortIndex } @@ -60,9 +60,7 @@ export const mergeArr = (oldData: Array, newData: Array) => { (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, newData: Array) => { } } } + return { ...oldItem, children: mergedChildren.concat(newChildren), }; } - return oldItem; + return oldItem }; for (const newItem of newData) { @@ -102,7 +101,7 @@ export const mergeArr = (oldData: Array, newData: Array) => { } } - return mergedData; + return mergedData }; /** @@ -312,12 +311,9 @@ export const getNodeDepth = (node: any) => { export const handleSorts = (node: any[]) => { if (!node) return [] - return node.map((item, index) => { - if (item.index !== index) { - item.sortIndex = index - if (item.children) { - item.children = handleSorts(item.children).sort((a, b) => a.sortIndex - b.sortIndex) - } + return node.sort((a, b) => a.sortIndex - b.sortIndex).map((item) => { + if (item.children) { + item.children = handleSorts(item.children) } return item }) From b1a7188a482ff2b8fc6bf80cbc624a1f951a18bc Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 6 Jun 2023 14:04:03 +0800 Subject: [PATCH 003/228] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=A0=8F=E7=9A=84=E8=B7=9D=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Log/Access/index.vue | 2 +- src/views/Log/System/index.vue | 2 +- src/views/Northbound/AliCloud/index.vue | 2 +- src/views/Northbound/DuerOS/index.vue | 2 +- src/views/device/Firmware/index.vue | 2 +- src/views/edge/Resource/index.vue | 2 +- src/views/iot-card/CardManagement/index.vue | 2 +- src/views/iot-card/Dashboard/index.vue | 15 ++++++++------- src/views/iot-card/Platform/index.vue | 2 +- src/views/iot-card/Recharge/index.vue | 2 ++ src/views/link/Certificate/index.vue | 2 +- src/views/link/Protocol/index.vue | 2 +- src/views/link/Type/index.vue | 2 +- src/views/media/Device/index.vue | 2 +- src/views/notice/Config/index.vue | 4 ++-- src/views/notice/Template/index.vue | 3 ++- .../rule-engine/Alarm/Configuration/index.vue | 2 +- src/views/rule-engine/Instance/index.vue | 2 +- src/views/system/DataSource/index.vue | 2 +- src/views/system/Department/device/index.vue | 3 ++- src/views/system/Department/product/index.vue | 1 + src/views/system/Department/user/index.vue | 2 +- src/views/system/Menu/index.vue | 2 +- src/views/system/Permission/index.vue | 2 +- src/views/system/Relationship/index.vue | 1 + src/views/system/Role/index.vue | 2 +- src/views/system/User/index.vue | 1 + 27 files changed, 38 insertions(+), 30 deletions(-) diff --git a/src/views/Log/Access/index.vue b/src/views/Log/Access/index.vue index 021b7365..2820b324 100644 --- a/src/views/Log/Access/index.vue +++ b/src/views/Log/Access/index.vue @@ -219,7 +219,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 150, + width: 60, scopedSlots: true, }, ]; diff --git a/src/views/Log/System/index.vue b/src/views/Log/System/index.vue index b5b763db..d8b7ba2a 100644 --- a/src/views/Log/System/index.vue +++ b/src/views/Log/System/index.vue @@ -189,7 +189,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 150, + width: 60, scopedSlots: true, }, ]; diff --git a/src/views/Northbound/AliCloud/index.vue b/src/views/Northbound/AliCloud/index.vue index 1bdcd457..d7100fb0 100644 --- a/src/views/Northbound/AliCloud/index.vue +++ b/src/views/Northbound/AliCloud/index.vue @@ -191,7 +191,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 200, + width: 160, scopedSlots: true, }, ]; diff --git a/src/views/Northbound/DuerOS/index.vue b/src/views/Northbound/DuerOS/index.vue index 409a476d..b66fe390 100644 --- a/src/views/Northbound/DuerOS/index.vue +++ b/src/views/Northbound/DuerOS/index.vue @@ -230,7 +230,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 200, + width: 160, scopedSlots: true, }, ]; diff --git a/src/views/device/Firmware/index.vue b/src/views/device/Firmware/index.vue index 82018a52..ddacf508 100644 --- a/src/views/device/Firmware/index.vue +++ b/src/views/device/Firmware/index.vue @@ -166,7 +166,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 200, + width: 120, scopedSlots: true, }, ]; diff --git a/src/views/edge/Resource/index.vue b/src/views/edge/Resource/index.vue index 7420cb31..6dae0323 100644 --- a/src/views/edge/Resource/index.vue +++ b/src/views/edge/Resource/index.vue @@ -268,7 +268,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 250, + width: 200, scopedSlots: true, }, ]; diff --git a/src/views/iot-card/CardManagement/index.vue b/src/views/iot-card/CardManagement/index.vue index d87cebaa..1bd9f37f 100644 --- a/src/views/iot-card/CardManagement/index.vue +++ b/src/views/iot-card/CardManagement/index.vue @@ -588,7 +588,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 250, + width: 200, scopedSlots: true, }, ]; diff --git a/src/views/iot-card/Dashboard/index.vue b/src/views/iot-card/Dashboard/index.vue index cbd390eb..6dae491d 100644 --- a/src/views/iot-card/Dashboard/index.vue +++ b/src/views/iot-card/Dashboard/index.vue @@ -77,13 +77,14 @@ /> - + + +
diff --git a/src/views/iot-card/Platform/index.vue b/src/views/iot-card/Platform/index.vue index ea4fee15..028f28bd 100644 --- a/src/views/iot-card/Platform/index.vue +++ b/src/views/iot-card/Platform/index.vue @@ -142,7 +142,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 250, + width: 120, scopedSlots: true, }, ]; diff --git a/src/views/iot-card/Recharge/index.vue b/src/views/iot-card/Recharge/index.vue index 12233f1e..c645b954 100644 --- a/src/views/iot-card/Recharge/index.vue +++ b/src/views/iot-card/Recharge/index.vue @@ -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, }, ]; diff --git a/src/views/link/Certificate/index.vue b/src/views/link/Certificate/index.vue index 1314f8f4..70778eee 100644 --- a/src/views/link/Certificate/index.vue +++ b/src/views/link/Certificate/index.vue @@ -114,7 +114,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 200, + width: 80, scopedSlots: true, }, ]; diff --git a/src/views/link/Protocol/index.vue b/src/views/link/Protocol/index.vue index 5d269bc2..90bc6052 100644 --- a/src/views/link/Protocol/index.vue +++ b/src/views/link/Protocol/index.vue @@ -207,7 +207,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 200, + width: 100, scopedSlots: true, }, ]; diff --git a/src/views/link/Type/index.vue b/src/views/link/Type/index.vue index 3da7f5ca..1e44ba7a 100644 --- a/src/views/link/Type/index.vue +++ b/src/views/link/Type/index.vue @@ -263,7 +263,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 200, + width: 120, scopedSlots: true, }, ]; diff --git a/src/views/media/Device/index.vue b/src/views/media/Device/index.vue index babfdb64..83e34e37 100644 --- a/src/views/media/Device/index.vue +++ b/src/views/media/Device/index.vue @@ -279,7 +279,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 250, + width: 200, scopedSlots: true, }, ]; diff --git a/src/views/notice/Config/index.vue b/src/views/notice/Config/index.vue index 4dc979e2..cf1edf88 100644 --- a/src/views/notice/Config/index.vue +++ b/src/views/notice/Config/index.vue @@ -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, }, ]; diff --git a/src/views/notice/Template/index.vue b/src/views/notice/Template/index.vue index 11c560b1..728fb2f4 100644 --- a/src/views/notice/Template/index.vue +++ b/src/views/notice/Template/index.vue @@ -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, }, ]; diff --git a/src/views/rule-engine/Alarm/Configuration/index.vue b/src/views/rule-engine/Alarm/Configuration/index.vue index c6ad66b1..06c37c94 100644 --- a/src/views/rule-engine/Alarm/Configuration/index.vue +++ b/src/views/rule-engine/Alarm/Configuration/index.vue @@ -327,7 +327,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 150, + width: 120, scopedSlots: true, }, ]; diff --git a/src/views/rule-engine/Instance/index.vue b/src/views/rule-engine/Instance/index.vue index 1fe94e7b..c9f20d02 100644 --- a/src/views/rule-engine/Instance/index.vue +++ b/src/views/rule-engine/Instance/index.vue @@ -226,7 +226,7 @@ const columns = [ title: '操作', key: 'action', fixed: 'right', - width: 250, + width: 150, scopedSlots: true, }, ]; diff --git a/src/views/system/DataSource/index.vue b/src/views/system/DataSource/index.vue index e7068e31..eb443ff0 100644 --- a/src/views/system/DataSource/index.vue +++ b/src/views/system/DataSource/index.vue @@ -231,7 +231,7 @@ const columns = [ dataIndex: 'action', key: 'action', scopedSlots: true, - width: '200px', + width: '160px', fixed: 'right', }, ]; diff --git a/src/views/system/Department/device/index.vue b/src/views/system/Department/device/index.vue index 524756b8..ebd8c583 100644 --- a/src/views/system/Department/device/index.vue +++ b/src/views/system/Department/device/index.vue @@ -173,7 +173,7 @@ }} diff --git a/src/views/system/Apply/Save/components/ApplyList/index.vue b/src/views/system/Apply/Save/components/ApplyList/index.vue new file mode 100644 index 00000000..341012d1 --- /dev/null +++ b/src/views/system/Apply/Save/components/ApplyList/index.vue @@ -0,0 +1,141 @@ + + + + + \ No newline at end of file diff --git a/src/views/system/Apply/Save/components/Does.vue b/src/views/system/Apply/Save/components/Does.vue index 8f792a25..5b288e92 100644 --- a/src/views/system/Apply/Save/components/Does.vue +++ b/src/views/system/Apply/Save/components/Does.vue @@ -156,6 +156,9 @@
4、单点登录
通过第三方平台账号登录到物联网平台。
+
+ 暂未开发 +
diff --git a/src/views/system/Apply/Save/components/EditForm.vue b/src/views/system/Apply/Save/components/EditForm.vue index 08252e98..a6a41ac6 100644 --- a/src/views/system/Apply/Save/components/EditForm.vue +++ b/src/views/system/Apply/Save/components/EditForm.vue @@ -36,59 +36,7 @@ }, ]" > - - -
- -

内部独立应用

-
-
- -
- -

内部集成应用

-
-
- -
- -

微信网站应用

-
-
- -
- -

钉钉企业内部应用

-
-
- -
- -

第三方应用

-
-
-
+ - + - + (); const form = reactive({ data: { ...initForm }, - integrationModesISO: [] as string[], // 接入方式镜像 折叠面板使用 + // integrationModesISO: [] as string[], // 接入方式镜像 折叠面板使用 roleIdList: [] as optionsType, // 角色列表 orgIdList: [] as dictType, // 组织列表 @@ -1622,7 +1573,7 @@ const joinOptions = computed(() => { value: 'apiClient', }, ]; - else if (form.data.provider === 'wechat-webapp') + else if (form.data.provider === 'wechat-webapp' || form.data.provider === 'wechat-miniapp') return [ { label: '单点登录', @@ -1697,9 +1648,9 @@ function init() { } emit('changeApplyType', n); if (routeQuery.id) return; - if (n === 'wechat-webapp' || n === 'dingtalk-ent-app') { + if (['wechat-webapp', 'dingtalk-ent-app', 'wechat-miniapp'].includes(n)) { form.data.integrationModes = ['ssoClient']; - form.integrationModesISO = ['ssoClient']; + // form.integrationModesISO = ['ssoClient']; } else form.data.integrationModes = []; }, { immediate: true }, @@ -1711,7 +1662,7 @@ function init() { if (!n.includes(key)) form.errorNumInfo[key].clear(); }); - form.integrationModesISO = [...n]; + // form.integrationModesISO = [...n]; }, ); } @@ -1888,31 +1839,31 @@ function getErrorNum( } } -const imageTypes = ref(['image/jpg', 'image/png', 'image/jpeg']); -const beforeLogoUpload = (file: any) => { - const isType: any = imageTypes.value.includes(file.type); - if (!isType) { - message.error(`请上传.jpg.png格式的图片`); - return false; - } - const isSize = file.size / 1024 / 1024 < 4; - if (!isSize) { - message.error(`图片大小必须小于${4}M`); - } - return isType && isSize; -}; -function changeBackUpload(info: UploadChangeParam>) { - if (info.file.status === 'uploading') { - form.uploadLoading = true; - } else if (info.file.status === 'done') { - info.file.url = info.file.response?.result; - form.uploadLoading = false; - form.data.logoUrl = info.file.response?.result; - } else if (info.file.status === 'error') { - form.uploadLoading = false; - message.error('logo上传失败,请稍后再试'); - } -} +// const imageTypes = ref(['image/jpg', 'image/png', 'image/jpeg']); +// const beforeLogoUpload = (file: any) => { +// const isType: any = imageTypes.value.includes(file.type); +// if (!isType) { +// message.error(`请上传.jpg.png格式的图片`); +// return false; +// } +// const isSize = file.size / 1024 / 1024 < 4; +// if (!isSize) { +// message.error(`图片大小必须小于${4}M`); +// } +// return isType && isSize; +// }; +// function changeBackUpload(info: UploadChangeParam>) { +// if (info.file.status === 'uploading') { +// form.uploadLoading = true; +// } else if (info.file.status === 'done') { +// info.file.url = info.file.response?.result; +// form.uploadLoading = false; +// form.data.logoUrl = info.file.response?.result; +// } else if (info.file.status === 'error') { +// form.uploadLoading = false; +// message.error('logo上传失败,请稍后再试'); +// } +// } function clearNullProp(obj: object) { if (typeof obj !== 'object') return; @@ -1962,59 +1913,20 @@ const validateIP = (_rule: Rule, value: string) => { :deep(.ant-form-item-control) { .ant-form-item-control-input-content { display: flex; - .ant-upload-select-picture-card { - width: auto; - height: auto; - max-width: 150px; - max-height: 150px; + // .ant-upload-select-picture-card { + // width: auto; + // height: auto; + // max-width: 150px; + // max-height: 150px; - > .ant-upload { - height: 150px; - } - } + // > .ant-upload { + // height: 150px; + // } + // } } } } - .radio-container { - .ant-radio-button-wrapper { - height: 120px; - width: 120px; - padding: 0 15px; - box-sizing: content-box; - margin-right: 20px; - color: #000; - &.ant-radio-button-wrapper-disabled { - opacity: 0.5; - } - - &.ant-radio-button-wrapper-checked { - background-color: #fff; - border: 1px solid #1d39c4; - opacity: 1; - } - - > :last-child { - width: 100%; - height: 100%; - display: flex; - align-items: center; - justify-content: center; - - > div { - width: 100%; - text-align: center; - } - :deep(.ant-image) { - width: 64px; - height: 64px; - } - p { - margin: 0; - } - } - } - } :deep(.ant-collapse-header) { > span { position: relative; diff --git a/src/views/system/Apply/Save/typing.d.ts b/src/views/system/Apply/Save/typing.d.ts index ec9644f4..63d3d7dc 100644 --- a/src/views/system/Apply/Save/typing.d.ts +++ b/src/views/system/Apply/Save/typing.d.ts @@ -3,6 +3,7 @@ export type applyType = 'internal-standalone' | 'internal-integrated' | 'dingtalk-ent-app' | 'third-party' + | 'wechat-miniapp' export type dictType = { id: string; name: string; @@ -20,6 +21,7 @@ export type formType = { id?:string, name: string; provider: applyType; + logoUrl: string, integrationModes: string[]; config?: string; description: string; diff --git a/src/views/system/Apply/index.vue b/src/views/system/Apply/index.vue index cba40b5d..00591657 100644 --- a/src/views/system/Apply/index.vue +++ b/src/views/system/Apply/index.vue @@ -226,6 +226,10 @@ const typeOptions = [ label: '第三方应用', value: 'third-party', }, + { + label: '小程序应用', + value: 'wechat-miniapp', + }, ]; const columns = [ { diff --git a/yarn.lock b/yarn.lock index e262de8b..358a767f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3825,8 +3825,8 @@ jetlinks-store@^0.0.3: jetlinks-ui-components@^1.0.22: version "1.0.22" - resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.22.tgz#37e49fe435d8eccd82fc4d8e94980a98aaac1922" - integrity sha512-iI7g2ui4pSuunkyPBWkscSZeUJfJURsj5Tmbfbc04wOhQh3GA6N3gKEDIvavFWHhFk1y/6EITyOYIZT4Wf3rdg== + resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.22.tgz#1b7c3d632b5c1b55a4ce59fb010c48edb402c657" + integrity sha512-U19VTSmxCgz1ybNY3QhPRaTM9CVvq1nYJOMc+Y8rc2FnzQ9B7k1Xk/fmJZvdt7lqlcDL3xO0zXkIVdAdapG3GA== dependencies: "@vueuse/core" "^9.12.0" "@vueuse/router" "^9.13.0" From 49ff08f502b907ba6d78829f460db2134672a07b Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Fri, 9 Jun 2023 17:31:38 +0800 Subject: [PATCH 021/228] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/Instance/Detail/Running/index.vue | 2 + src/views/device/Instance/Detail/index.vue | 4 +- src/views/device/Instance/Import/file.vue | 86 ++++++++++++------- 3 files changed, 58 insertions(+), 34 deletions(-) diff --git a/src/views/device/Instance/Detail/Running/index.vue b/src/views/device/Instance/Detail/Running/index.vue index b545d157..62768441 100644 --- a/src/views/device/Instance/Detail/Running/index.vue +++ b/src/views/device/Instance/Detail/Running/index.vue @@ -117,8 +117,10 @@ const tabChange = (key: string) => { .property-box { display: flex; overflow: hidden; + min-height: 100%; .property-box-left { width: 200px; + min-height: 100%; } .property-box-right { flex: 1; diff --git a/src/views/device/Instance/Detail/index.vue b/src/views/device/Instance/Detail/index.vue index 99e05645..5404a2c1 100644 --- a/src/views/device/Instance/Detail/index.vue +++ b/src/views/device/Instance/Detail/index.vue @@ -98,13 +98,13 @@ /> - +
- +
diff --git a/src/views/device/Instance/Import/file.vue b/src/views/device/Instance/Import/file.vue index 1b0cdc8c..f164870e 100644 --- a/src/views/device/Instance/Import/file.vue +++ b/src/views/device/Instance/Import/file.vue @@ -1,7 +1,7 @@ @@ -105,6 +123,10 @@ const beforeUpload = (_file: any) => { return (isCsv && fileType !== 'xlsx') || (isXlsx && fileType !== 'csv'); }; +const handleDrop = () => { + +} + const submitData = async (fileUrl: string) => { if (!!fileUrl) { count.value = 0; @@ -140,7 +162,7 @@ const submitData = async (fileUrl: string) => { const uploadChange = async (info: Record) => { disabled.value = true - console.log(info.file) + // console.log(info.file) if (info.file.status === 'done') { const resp: any = info.file.response || { result: '' }; await submitData(resp?.result || ''); From 43aa4bc16e13b2b6e6ccc7e396cbfcb3b68dec17 Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Fri, 9 Jun 2023 17:54:00 +0800 Subject: [PATCH 022/228] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E4=BF=9D=E5=AD=98ico=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: fix:15071 * feat: fix#15077 * feat: 修复组织管理树搜索 * Revert "feat: fix:15071" This reverts commit 7a8340d3e8047ddf5ac3e08bf6e1e1f65d4a26e1. * fix: 修改告警配置卡顿 * fix: 产品新增分类搜索 * fix: string错误 * fix: 优化标签title,ico * fix: 优化标签保存ico回显 --- src/api/data-collect/channel.ts | 2 +- src/api/system/basis.ts | 2 ++ src/store/system.ts | 16 +++++++++++++++- src/views/device/Product/Save/index.vue | 6 +++--- src/views/system/Basis/index.vue | 15 +++++++++------ src/views/user/Login/index.vue | 15 +++------------ 6 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/api/data-collect/channel.ts b/src/api/data-collect/channel.ts index 08bbbd8c..f255032e 100644 --- a/src/api/data-collect/channel.ts +++ b/src/api/data-collect/channel.ts @@ -13,7 +13,7 @@ export const update = (id: string, data: any) => export const getProviders = () => server.get(`/gateway/device/providers`); -export const queryOptionsList = (type: strimg) => +export const queryOptionsList = (type: string) => server.get(`/data-collect/opc/${type}`); export const validateField = (data: any) => diff --git a/src/api/system/basis.ts b/src/api/system/basis.ts index ea3677ec..267093fe 100644 --- a/src/api/system/basis.ts +++ b/src/api/system/basis.ts @@ -4,3 +4,5 @@ import server from '@/utils/request'; export const save_api = (data: any) => server.post(`/system/config/scope/_save`, data) // 获取详情 export const getDetails_api = (data: any) => server.post(`/system/config/scopes`, data) + +export const settingDetail = (scopes: string) => server.get(`/system/config/${scopes}`) diff --git a/src/store/system.ts b/src/store/system.ts index d5065be0..024daa98 100644 --- a/src/store/system.ts +++ b/src/store/system.ts @@ -1,7 +1,7 @@ import { defineStore } from 'pinia'; import { systemVersion } from '@/api/comm' import { useMenuStore } from './menu' -import { getDetails_api } from '@/api/system/basis'; +import {getDetails_api, settingDetail} from '@/api/system/basis'; import type { ConfigInfoType } from '@/views/system/Basis/typing'; import { LocalStore } from '@/utils/comm' import { SystemConst } from '@/utils/consts' @@ -33,12 +33,26 @@ export const useSystem = defineStore('system', { } }) }, + async getFront () { + const res = await settingDetail('front') + if (res.success) { + const ico: any = document.querySelector('link[rel="icon"]'); + ico.href = res.result.ico; + document.title = res.result.title || ''; + } + }, async getSystemConfig() { const params = ['front', 'amap', 'paths']; const { status, result } = await getDetails_api(params); if (status === 200) { params.forEach((key: string) => { this.configInfo[key] = { ...result.find((item: any) => item.scope === key)?.properties } + if (key === 'front') { + const data = result.find((item: any) => item.scope === key).properties + const ico: any = document.querySelector('link[rel="icon"]'); + ico.href = data.ico; + document.title = data.title || ''; + } }) } } diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue index bc41dcdf..5f05f4ff 100644 --- a/src/views/device/Product/Save/index.vue +++ b/src/views/device/Product/Save/index.vue @@ -73,7 +73,7 @@ children: 'children', }" :filterTreeNode=" - (v, option) => filterSelectNode(v, option) + (v, option) => filterSelectNode(v, option, 'name') " > @@ -164,13 +164,13 @@ const deviceList = ref([ label: '网关子设备', value: 'childrenDevice', iconUrl: getImage('/device-type-2.png'), - tooltip: '能挂载子设备与平台进行通信的设备', + tooltip: '作为网关的子设备,有网关代理连接到物联网平台', }, { label: '网关设备', value: 'gateway', iconUrl: getImage('/device/device-type-3.png'), - tooltip: '作为网关的子设备,有网关代理连接到物联网平台', + tooltip: '能挂载子设备与平台进行通信的设备', }, ]); diff --git a/src/views/system/Basis/index.vue b/src/views/system/Basis/index.vue index 4a2dde94..19b12fee 100644 --- a/src/views/system/Basis/index.vue +++ b/src/views/system/Basis/index.vue @@ -337,6 +337,8 @@ import { settingDetail } from '@/api/login'; const action = `${BASE_API_PATH}/file/static`; const headers = { [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) }; const formRef = ref(); +const system = useSystem(); + const form = reactive({ formValue: { title: '', @@ -378,10 +380,10 @@ const form = reactive({ iconLoading: false, // 页签加载状态 saveLoading: false, getDetails: async () => { - const system = useSystem(); - await system.getSystemConfig(); - await settingDetail('front'); - const configInfo = system.$state.configInfo; + + // await system.getSystemConfig(); + // await settingDetail('front'); + const configInfo = system.configInfo; form.formValue = { title: configInfo.front?.title, headerTheme: configInfo.front?.headerTheme, @@ -422,10 +424,11 @@ const form = reactive({ ]; save_api(params) - .then((resp) => { + .then(async (resp) => { if (resp.status === 200) { message.success('保存成功'); - form.getDetails(); + await system.getSystemConfig() + await form.getDetails(); } }) .finally(() => (form.saveLoading = false)); diff --git a/src/views/user/Login/index.vue b/src/views/user/Login/index.vue index 4e563dc3..b98d58a3 100644 --- a/src/views/user/Login/index.vue +++ b/src/views/user/Login/index.vue @@ -172,11 +172,13 @@ import { settingDetail, userDetail } from '@/api/login' import { useUserInfo } from '@/store/userInfo'; +import { useSystem } from '@/store/system' import { LocalStore } from '@/utils/comm'; import { BASE_API_PATH, TOKEN_KEY, Version_Code } from '@/utils/variable'; import { SystemConst } from '@/utils/consts'; const store = useUserInfo(); +const systemStore = useSystem(); const router = useRouter(); const bgImage = getImage('/logo.png'); const viewLogo = getImage('/view-logo.png'); @@ -310,18 +312,7 @@ const getOpen = () => { } } }); - settingDetail('front').then((res: any) => { - if (res.status === 200) { - const ico: any = document.querySelector('link[rel="icon"]'); - ico.href = res.result.ico; - basis.value = res.result; - if (res.result.title) { - document.title = res.result.title; - } else { - document.title = ''; - } - } - }); + systemStore.getFront() }; const handleClickOther = (item: any) => { From c8751bb8ad5751ef331af8664b3c225ca0659ad5 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 13 Jun 2023 09:40:36 +0800 Subject: [PATCH 023/228] =?UTF-8?q?feat:=20=E5=BA=94=E7=94=A8=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=92=8C=E7=89=A9=E6=A8=A1=E5=9E=8B=E6=98=A0=E5=B0=84?= =?UTF-8?q?2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/api/device/instance.ts | 8 +- src/api/system/apply.ts | 2 +- .../Instance/Detail/MetadataMap/index.ts | 3 + .../Instance/Detail/MetadataMap/index.vue | 240 ++++++++++++++++++ .../device/Instance/Detail/Running/index.vue | 7 +- src/views/device/Instance/Detail/index.vue | 11 + .../Product/Detail/MetadataMap/index.vue | 6 +- .../dialogs/ProductChooseDialog.vue | 26 +- src/views/init-home/Basic/index.vue | 17 +- .../Apply/Save/components/ApplyList/index.vue | 49 +--- .../system/Apply/Save/components/EditForm.vue | 111 +++----- src/views/system/Apply/Save/typing.d.ts | 3 +- .../system/Apply/componenets/MenuDialog.vue | 82 +++--- src/views/system/Apply/index.vue | 113 ++++++--- yarn.lock | 8 +- 16 files changed, 469 insertions(+), 219 deletions(-) create mode 100644 src/views/device/Instance/Detail/MetadataMap/index.ts create mode 100644 src/views/device/Instance/Detail/MetadataMap/index.vue diff --git a/package.json b/package.json index 4a724bb0..a3b5070b 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.22", + "jetlinks-ui-components": "^1.0.23", "js-cookie": "^3.0.1", "less": "^4.1.3", "less-loader": "^11.1.0", diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index 838d9529..5b3d3ace 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -576,14 +576,16 @@ export const getDeviceNumber = (data?:any) => server.post('/device-insta /** * 导入映射设备 * @param productId - * @param data + * @param data/ */ export const importDeviceByPlugin = (productId: string, data: any[]) => server.post(`/device/instance/plugin/${productId}/import`, data) -export const metadateMapById = (productId: string, data: ant[]) => server.patch(`/device/metadata/mapping/product/${productId}`, data) +export const metadateMapById = (type: 'device' | 'product', productId: string, data: any[]) => server.patch(`/device/metadata/mapping/${type}/${productId}`, data) -export const getMetadateMapById = (productId: string) => server.get(`/device/metadata/mapping/product/${productId}`) +export const getMetadateMapById = (type: 'device' | 'product', productId: string) => server.get(`/device/metadata/mapping/${type}/${productId}`) export const getInkingDevices = (data: string[]) => server.post('/plugin/mapping/device/_all', data) +export const getProtocolMetadata = (id: string, transport: string) => server.get(`/protocol/${id}/${transport}/metadata`) + diff --git a/src/api/system/apply.ts b/src/api/system/apply.ts index 374a997b..a85424d1 100644 --- a/src/api/system/apply.ts +++ b/src/api/system/apply.ts @@ -8,7 +8,7 @@ export const changeApplyStatus_api = (id: string, data: any) => server.put(`/app // 删除应用 export const delApply_api = (id: string) => server.remove(`/application/${id}`) - +export const queryType = () => server.get(`/application/providers`) // 获取组织列表 export const getDepartmentList_api = (params: any) => server.get(`/organization/_all/tree`, params); diff --git a/src/views/device/Instance/Detail/MetadataMap/index.ts b/src/views/device/Instance/Detail/MetadataMap/index.ts new file mode 100644 index 00000000..19a39952 --- /dev/null +++ b/src/views/device/Instance/Detail/MetadataMap/index.ts @@ -0,0 +1,3 @@ +import Index from './index.vue' + +export default Index \ No newline at end of file diff --git a/src/views/device/Instance/Detail/MetadataMap/index.vue b/src/views/device/Instance/Detail/MetadataMap/index.vue new file mode 100644 index 00000000..d317f0e5 --- /dev/null +++ b/src/views/device/Instance/Detail/MetadataMap/index.vue @@ -0,0 +1,240 @@ + + + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Running/index.vue b/src/views/device/Instance/Detail/Running/index.vue index 62768441..afd0186c 100644 --- a/src/views/device/Instance/Detail/Running/index.vue +++ b/src/views/device/Instance/Detail/Running/index.vue @@ -10,7 +10,7 @@ /> { min-height: 100%; .property-box-left { width: 200px; - min-height: 100%; + + // :deep(.jet-tabs) { + // height: 100%; + // } } .property-box-right { flex: 1; diff --git a/src/views/device/Instance/Detail/index.vue b/src/views/device/Instance/Detail/index.vue index 5404a2c1..2de10591 100644 --- a/src/views/device/Instance/Detail/index.vue +++ b/src/views/device/Instance/Detail/index.vue @@ -114,6 +114,7 @@ import { useInstanceStore } from '@/store/instance'; import Info from './Info/index.vue'; import Running from './Running/index.vue'; import Metadata from '../../components/Metadata/index.vue'; +import MetadataMap from './MetadataMap/index.vue'; import ChildDevice from './ChildDevice/index.vue'; import Diagnose from './Diagnose/index.vue'; import Function from './Function/index.vue'; @@ -179,6 +180,7 @@ const tabs = { EdgeMap, Parsing, Log, + MetadataMap }; const getStatus = (id: string) => { @@ -254,6 +256,15 @@ const getDetail = () => { tab: '边缘端映射', }); } + + if ( + instanceStore.current?.features?.find( + (item: any) => item?.id === 'diffMetadataSameProduct', + ) && + !keys.includes('MetadataMap') + ) { + list.value.push({ key: 'MetadataMap', tab: '物模型映射'}); + } }; const initPage = async (newId: any) => { diff --git a/src/views/device/Product/Detail/MetadataMap/index.vue b/src/views/device/Product/Detail/MetadataMap/index.vue index 9b0eb9ee..dfde220f 100644 --- a/src/views/device/Product/Detail/MetadataMap/index.vue +++ b/src/views/device/Product/Detail/MetadataMap/index.vue @@ -118,7 +118,7 @@ const selectedPluginKeys = computed(() => { const getMetadataMapData = () => { return new Promise(resolve => { - getMetadateMapById(productDetail.value?.id).then(res => { + getMetadateMapById('product', productDetail.value?.id).then(res => { if (res.success) { resolve(res.result?.filter(item => item.customMapping)?.map(item => { return { @@ -168,7 +168,7 @@ const getPluginMetadata = (): Promise<{ properties: any[]}> => { queryPluginAccessDetail(productDetail.value?.accessId!).then(async res => { if (res.success) { const _channelId = (res.result as any)!.channelId - const pluginRes = await getPluginData('product', productDetail.value?.accessId, productDetail.value?.id).catch(() => ({ success: false, result: {}})) + const pluginRes = await getPluginData('product', productDetail.value?.accessId || '', productDetail.value?.id).catch(() => ({ success: false, result: {}})) const resp = await getProductByPluginId(_channelId).catch(() => ({ success: false, result: []})) if (resp.success) { const _item = (resp.result as any[])?.find((item: any) => item.id === (pluginRes?.result as any)?.externalId) @@ -182,7 +182,7 @@ const getPluginMetadata = (): Promise<{ properties: any[]}> => { } const pluginChange = async (value: any, id: string) => { - const res = await metadateMapById(productDetail.value?.id, [{ + const res = await metadateMapById('product', productDetail.value?.id, [{ metadataType: 'property', metadataId: value.id, originalId: id diff --git a/src/views/home/components/dialogs/ProductChooseDialog.vue b/src/views/home/components/dialogs/ProductChooseDialog.vue index a4d1ac08..528d4a4a 100644 --- a/src/views/home/components/dialogs/ProductChooseDialog.vue +++ b/src/views/home/components/dialogs/ProductChooseDialog.vue @@ -5,20 +5,21 @@ width="700px" @ok="confirm" @cancel="emits('update:visible', false)" - :filter-option="filterOption" :maskClosable="false" class="access-method-dialog-container" > - + @@ -35,13 +36,10 @@ const props = defineProps<{ visible: boolean; }>(); -const confirm = () => { - emits('confirm', form.value.productId); - emits('update:visible', false); -}; +const formRef = ref() -const form = ref({ - productId: '', +const form = reactive({ + productId: undefined, }); const productList = ref<[productItem] | []>([]); @@ -56,10 +54,14 @@ const getOptions = () => { }); }; -const filterOption = (input: string, option: any) => { - return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0; -}; getOptions(); + +const confirm = () => { + formRef.value?.validate().then(() => { + emits('confirm', form.productId); + emits('update:visible', false); + }) +}; \ No newline at end of file diff --git a/src/views/account/Center/components/Subscribe/components/Unsubscribe.vue b/src/views/account/Center/components/Subscribe/components/Unsubscribe.vue new file mode 100644 index 00000000..266a7301 --- /dev/null +++ b/src/views/account/Center/components/Subscribe/components/Unsubscribe.vue @@ -0,0 +1,66 @@ + + + + + \ No newline at end of file diff --git a/src/views/account/Center/components/Subscribe/index.vue b/src/views/account/Center/components/Subscribe/index.vue index 11dca2d6..0e267408 100644 --- a/src/views/account/Center/components/Subscribe/index.vue +++ b/src/views/account/Center/components/Subscribe/index.vue @@ -1,227 +1,164 @@ @@ -54,7 +54,7 @@ @@ -141,7 +141,7 @@ @@ -289,9 +289,9 @@ const form = ref({ headerTheme: 'light', apikey: '', basePath: `${window.location.origin}/api`, - logo: getImage('/logo.png'), - ico: getImage('/favicon.ico'), - background: getImage('/login.png'), + logo: '/logo.png', + ico: '/favicon.ico', + background: '/images/login.png', }); const rulesFrom = ref({ title: [ diff --git a/src/views/system/Apply/componenets/MenuDialog.vue b/src/views/system/Apply/componenets/MenuDialog.vue index e2c18f2f..7743afc3 100644 --- a/src/views/system/Apply/componenets/MenuDialog.vue +++ b/src/views/system/Apply/componenets/MenuDialog.vue @@ -70,7 +70,6 @@ const handleOk = async () => { ...form.checkedMenu, ...form.half, ]); - console.log(items) if (form.checkedSystem) { if (items && items.length !== 0) { loading.value = true; diff --git a/src/views/system/NoticeRule/components/Auth/index.vue b/src/views/system/NoticeRule/components/Auth/index.vue index 994060da..b32077de 100644 --- a/src/views/system/NoticeRule/components/Auth/index.vue +++ b/src/views/system/NoticeRule/components/Auth/index.vue @@ -12,19 +12,28 @@ \ No newline at end of file diff --git a/src/views/system/NoticeRule/components/Detail/index.vue b/src/views/system/NoticeRule/components/Detail/index.vue index 4d795377..267ca01c 100644 --- a/src/views/system/NoticeRule/components/Detail/index.vue +++ b/src/views/system/NoticeRule/components/Detail/index.vue @@ -1,12 +1,24 @@ diff --git a/src/views/account/Center/components/EditInfo/index.vue b/src/views/account/Center/components/EditInfo/index.vue index 4501df86..0e4e16ed 100644 --- a/src/views/account/Center/components/EditInfo/index.vue +++ b/src/views/account/Center/components/EditInfo/index.vue @@ -101,6 +101,7 @@ diff --git a/src/views/account/Center/components/StationMessage/components/NotificationSubscription/components/EditDialog.vue b/src/views/account/Center/components/StationMessage/components/NotificationSubscription/components/EditDialog.vue deleted file mode 100644 index ae2b02dd..00000000 --- a/src/views/account/Center/components/StationMessage/components/NotificationSubscription/components/EditDialog.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - - - diff --git a/src/views/account/Center/components/StationMessage/components/NotificationSubscription/index.vue b/src/views/account/Center/components/StationMessage/components/NotificationSubscription/index.vue deleted file mode 100644 index 5aa4ec56..00000000 --- a/src/views/account/Center/components/StationMessage/components/NotificationSubscription/index.vue +++ /dev/null @@ -1,203 +0,0 @@ - - - - - diff --git a/src/views/account/Center/components/StationMessage/components/NotificationSubscription/typing.d.ts b/src/views/account/Center/components/StationMessage/components/NotificationSubscription/typing.d.ts deleted file mode 100644 index cafbfcdb..00000000 --- a/src/views/account/Center/components/StationMessage/components/NotificationSubscription/typing.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -export type rowType = { - id?: string; - locale: string; - state: { text: string, value: "enabled" | 'disabled' }; - subscribeName: string; - subscriber: string; - subscriberType: string; - topicConfig: { alarmConfigId?: string, alarmConfigName?: string }; - alarmConfigId: string; - alarmConfigName: stirng; - topicName: string; - topicProvider: string| undefined; - notice?:any[] -} \ No newline at end of file diff --git a/src/views/account/Center/components/StationMessage/index.vue b/src/views/account/Center/components/StationMessage/index.vue index b3cea35b..a13a92c3 100644 --- a/src/views/account/Center/components/StationMessage/index.vue +++ b/src/views/account/Center/components/StationMessage/index.vue @@ -1,29 +1,59 @@ \ No newline at end of file diff --git a/src/views/account/Center/components/Subscribe/components/Item.vue b/src/views/account/Center/components/Subscribe/components/Item.vue index e5b2ae6b..8a2f1334 100644 --- a/src/views/account/Center/components/Subscribe/components/Item.vue +++ b/src/views/account/Center/components/Subscribe/components/Item.vue @@ -18,49 +18,85 @@ @@ -87,6 +104,19 @@ import Detail from './components/Detail/index.vue'; import EditInfo from './components/EditInfo/index.vue'; import EditPassword from './components/EditPassword/index.vue'; import { useUserInfo } from '@/store/userInfo'; +import UploadAvatar from './components/UploadAvatar/index.vue'; +import { updateMeInfo_api } from '@/api/account/center'; +import { onlyMessage } from '@/utils/comm'; +import { useRouterParams } from '@/utils/hooks/useParams'; + +const imageTypes = reactive([ + 'image/jpeg', + 'image/png', + 'image/jpg', + 'image/jfif', + 'image/pjp', + 'image/pjpeg', +]); const user = useUserInfo(); @@ -117,23 +147,59 @@ const tabs = { StationMessage, }; -const activeKey = ref('HomeView'); +const router = useRouterParams() + +// const activeKey = ref('HomeView'); const visible = ref(false); const editInfoVisible = ref(false); const editPasswordVisible = ref(false); const onActivated = (_key: KeyType) => { - activeKey.value = _key; + user.tabKey = _key; }; +const _org = computed(() => { + return user.userInfos?.orgList + ?.map((item: any) => { + return item?.name; + }) + .join(','); +}); + +const _role = computed(() => { + return user.userInfos?.roleList + ?.map((item: any) => { + return item?.name; + }) + .join(','); +}); + const onSave = () => { - user.getUserInfo() - editInfoVisible.value = false -} + user.getUserInfo(); + editInfoVisible.value = false; +}; const onPasswordSave = () => { - editPasswordVisible.value = false -} + editPasswordVisible.value = false; +}; + +const onAvatarChange = (url: string) => { + updateMeInfo_api({ + ...user.userInfos, + avatar: url, + }).then((resp) => { + if (resp.status === 200) { + onlyMessage('操作成功', 'success'); + user.getUserInfo(); + } + }); +}; + +watchEffect(() => { + if(router.params.value?.tabKey) { + user.tabKey = router.params.value?.tabKey + } +}) \ No newline at end of file diff --git a/src/views/system/NoticeRule/components/Save/components/VariableDefinitions.vue b/src/views/system/NoticeRule/components/Save/components/VariableDefinitions.vue index fd6bad08..009facab 100644 --- a/src/views/system/NoticeRule/components/Save/components/VariableDefinitions.vue +++ b/src/views/system/NoticeRule/components/Save/components/VariableDefinitions.vue @@ -72,7 +72,6 @@ const formRef = ref(); const modelRef = reactive({}); watchEffect(() => { - console.log(props.notify, '123') Object.assign(modelRef, props?.value); }); diff --git a/src/views/system/NoticeRule/components/Save/components/variableItem/BuildIn.vue b/src/views/system/NoticeRule/components/Save/components/variableItem/BuildIn.vue index 452d8797..30c99981 100644 --- a/src/views/system/NoticeRule/components/Save/components/variableItem/BuildIn.vue +++ b/src/views/system/NoticeRule/components/Save/components/variableItem/BuildIn.vue @@ -110,7 +110,13 @@ watch( if (v === 'upper') { queryConfigVariables(props.providerId).then(resp => { if (resp.status === 200) { - builtInList.value = (resp.result as any[]).map(item => { + // 避免数据id相同,去重 + const _set = new Set((resp.result as any[]).map(item => item?.id)) + const arr = [..._set.values()].map(item => { + const _arr = (resp.result as any[]).reverse() + return _arr.find(i => i.id === item) + }) + builtInList.value = arr.map(item => { return { ...item, id: 'detail.' + item.id // 为了方便传到后端 diff --git a/src/views/system/NoticeRule/components/Save/components/variableItem/Tag.vue b/src/views/system/NoticeRule/components/Save/components/variableItem/Tag.vue index 16821b5a..eec560ab 100644 --- a/src/views/system/NoticeRule/components/Save/components/variableItem/Tag.vue +++ b/src/views/system/NoticeRule/components/Save/components/variableItem/Tag.vue @@ -43,7 +43,7 @@ watch( ); watch( - () => props.notify.notifierId, + () => props.notify.channelConfiguration?.notifierId, (newVal) => { if (newVal) { getDepartment(newVal); diff --git a/src/views/system/NoticeRule/components/Save/index.vue b/src/views/system/NoticeRule/components/Save/index.vue index 80239cf7..ce5b5243 100644 --- a/src/views/system/NoticeRule/components/Save/index.vue +++ b/src/views/system/NoticeRule/components/Save/index.vue @@ -52,7 +52,7 @@ v-if="current !== stepList.length - 1" >下一步 - 确认 + 确认 @@ -87,6 +87,10 @@ const props = defineProps({ type: Object, default: () => {}, }, + loading: { + type: Boolean, + default: false + } }); const stepList = [ diff --git a/src/views/system/NoticeRule/data.ts b/src/views/system/NoticeRule/data.ts index 3c25eb33..f7b99a7c 100644 --- a/src/views/system/NoticeRule/data.ts +++ b/src/views/system/NoticeRule/data.ts @@ -6,11 +6,11 @@ iconMap.set('notifier-weixin', getImage('/notice/wechat.png')); iconMap.set('notifier-email', getImage('/notice/email.png')); iconMap.set('notifier-voice', getImage('/notice/voice.png')); iconMap.set('notifier-sms', getImage('/notice/sms.png')); -iconMap.set('inside-mail', getImage('/notice/sms.png')); +iconMap.set('inside-mail', getImage('/notice/inside-mail.png')); const noticeType = new Map(); -noticeType.set('notifier-dingTalk', 'dingtalk'); -noticeType.set('notifier-weixin', 'wechat'); +noticeType.set('notifier-dingTalk', 'dingTalk'); +noticeType.set('notifier-weixin', 'weixin'); noticeType.set('notifier-email', 'email'); noticeType.set('notifier-voice', 'voice'); noticeType.set('notifier-sms', 'sms'); @@ -23,4 +23,11 @@ variableMap.set('notifier-email', 'sendTo'); variableMap.set('notifier-voice', 'calledNumber'); variableMap.set('notifier-sms', 'phoneNumber'); -export { iconMap, noticeType, variableMap } \ No newline at end of file +const _variableMap = new Map(); +_variableMap.set('dingTalk', 'userIdList'); +_variableMap.set('weixin', 'toUser'); +_variableMap.set('email', 'sendTo'); +_variableMap.set('voice', 'calledNumber'); +_variableMap.set('sms', 'phoneNumber'); + +export { iconMap, noticeType, variableMap, _variableMap } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 6d07e061..47b6d532 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3823,10 +3823,10 @@ jetlinks-store@^0.0.3: resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz" integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q== -jetlinks-ui-components@^1.0.23: - version "1.0.23" - resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.23.tgz#029f45a61316e3bf3b4c75959d41d7d76068fcbe" - integrity sha512-6OGDn8/kAmjlHMoeIp5B4L6EeucbqKFxqnYys4MqmtEvco/d5Pr8rzmJEav6bZmGkN21YWNHpwkhX3yrQt2F+g== +jetlinks-ui-components@^1.0.24: + version "1.0.24" + resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.24.tgz#97580bed720526b50b3244440c7ae16d3d0a26c0" + integrity sha512-7ccv/eu9moZZFzCRuBa8Pe4NLd/knDARWwJaivH+qgkPSIIdij0Wax27zFwoRqivsDzbOAs2iRButcwSNvR9AQ== dependencies: "@vueuse/core" "^9.12.0" "@vueuse/router" "^9.13.0" @@ -3834,6 +3834,7 @@ jetlinks-ui-components@^1.0.23: colorpicker-v3 "^2.10.2" lodash-es "^4.17.21" monaco-editor "^0.35.0" + vuedraggable "^4.1.0" js-cookie@^3.0.1: version "3.0.1" @@ -6162,6 +6163,11 @@ socks@^2.6.2: ip "^2.0.0" smart-buffer "^4.2.0" +sortablejs@1.14.0: + version "1.14.0" + resolved "http://registry.jetlinks.cn/sortablejs/-/sortablejs-1.14.0.tgz#6d2e17ccbdb25f464734df621d4f35d4ab35b3d8" + integrity sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w== + source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz" @@ -7048,6 +7054,13 @@ vue@^3.2.37, vue@^3.2.45: "@vue/server-renderer" "3.2.45" "@vue/shared" "3.2.45" +vuedraggable@^4.1.0: + version "4.1.0" + resolved "http://registry.jetlinks.cn/vuedraggable/-/vuedraggable-4.1.0.tgz#edece68adb8a4d9e06accff9dfc9040e66852270" + integrity sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww== + dependencies: + sortablejs "1.14.0" + walk-up-path@^1.0.0: version "1.0.0" resolved "https://registry.jetlinks.cn/walk-up-path/-/walk-up-path-1.0.0.tgz" From 71ffdc13fe27f01f7b4e235485eb84cebb228e65 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 20 Jun 2023 18:27:15 +0800 Subject: [PATCH 028/228] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/menu.ts | 9 +--- src/utils/consts.ts | 4 -- .../components/NotificationRecord/index.vue | 6 ++- src/views/account/Center/index.vue | 35 ++++++++------ src/views/init-home/Menu/index.vue | 4 +- src/views/init-home/data/baseMenu.ts | 26 +---------- src/views/system/Menu/Setting/index.vue | 5 +- src/views/system/Menu/index.vue | 4 +- .../NoticeRule/components/Item/index.vue | 4 +- .../system/Role/Detail/Permiss/index.vue | 5 +- .../Role/Detail/components/PermissTree.vue | 46 +++++++++---------- 11 files changed, 61 insertions(+), 87 deletions(-) diff --git a/src/store/menu.ts b/src/store/menu.ts index 25b357b9..d1d8f8c4 100644 --- a/src/store/menu.ts +++ b/src/store/menu.ts @@ -6,7 +6,7 @@ import { usePermissionStore } from './permission' import router from '@/router' import { onlyMessage } from '@/utils/comm' // import { AccountMenu, NotificationRecordCode, NotificationSubscriptionCode } from '@/router/menu' -import { MESSAGE_SUBSCRIBE_MENU_CODE, USER_CENTER_MENU_CODE } from '@/utils/consts' +import { USER_CENTER_MENU_CODE } from '@/utils/consts' import {isNoCommunity} from "@/utils/utils"; const defaultOwnParams = [ @@ -109,11 +109,6 @@ export const useMenuStore = defineStore({ permission.permissions = {} const { menusData, silderMenus } = filterAsyncRouter(resultData) - // 是否存在通知订阅 - // const hasMessageSub = resultData.some((item: { code: string }) => item.code === MESSAGE_SUBSCRIBE_MENU_CODE) - // if (!hasMessageSub) { - // AccountMenu.children = AccountMenu.children.filter((item: { code: string }) => ![NotificationSubscriptionCode, NotificationRecordCode].includes(item.code) ) - // } this.menus = findCodeRoute([...resultData]) // AccountMenu Object.keys(this.menus).forEach((item) => { const _item = this.menus[item] @@ -130,7 +125,7 @@ export const useMenuStore = defineStore({ } }) // menusData.push(AccountMenu) - this.siderMenus = silderMenus.filter((item: { name: string }) => ![USER_CENTER_MENU_CODE, MESSAGE_SUBSCRIBE_MENU_CODE].includes(item.name)) + this.siderMenus = silderMenus.filter((item: { name: string }) => ![USER_CENTER_MENU_CODE].includes(item.name)) res(menusData) } }) diff --git a/src/utils/consts.ts b/src/utils/consts.ts index 04458dd8..419fa06e 100644 --- a/src/utils/consts.ts +++ b/src/utils/consts.ts @@ -1,5 +1,3 @@ -import { MESSAGE_SUBSCRIBE_MENU_DATA } from '@/views/init-home/data/baseMenu' - /** * 状态颜色 */ @@ -52,5 +50,3 @@ export const SystemConst = { export const USER_CENTER_MENU_CODE = 'account-center' export const USER_CENTER_MENU_BUTTON_CODE = 'user-center-passwd-update' -export const MESSAGE_SUBSCRIBE_MENU_CODE = 'message-subscribe' -export const MESSAGE_SUBSCRIBE_MENU_BUTTON_CODE = 'message-subscribe-view' diff --git a/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue b/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue index 2a074cd2..70b18209 100644 --- a/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue +++ b/src/views/account/Center/components/StationMessage/components/NotificationRecord/index.vue @@ -18,7 +18,7 @@ :defaultParams="defaultParams" > - - - 配置 - + @@ -63,12 +60,17 @@ import {cloneDeep} from "lodash"; import {useProductStore} from "store/product"; import {useInstanceStore} from "store/instance"; import {getMetadataConfig, getMetadataDeviceConfig} from "@/api/device/product"; +import ModelButton from '@/views/device/components/Metadata/Base/components/ModelButton.vue' import {omit} from "lodash-es"; const props = defineProps({ value: { type: Object, default: () => ({}) + }, + type: { + type: String, + default: undefined } }) @@ -90,7 +92,7 @@ const config = ref([]) const configValue = ref(props.value?.expands) const showMetrics = computed(() => { - return ['int', 'long', 'float', 'double', 'string', 'boolean', 'date'].includes(props.value?.valueType?.type as any) + return ['int', 'long', 'float', 'double', 'string', 'boolean', 'date'].includes(props.type as any) }) const columns = ref([ @@ -114,15 +116,14 @@ const columns = ref([ const getConfig = async () => { const record = props.value const id = type === 'product' ? productStore.current?.id : deviceStore.current.id - console.log(record.id, id, record.valueType) - if(!record.id || !id || !record.valueType.type) return + if(!record.id || !id || !record.type) return const params: any = { deviceId: id, metadata: { id: record.id, type: 'property', - dataType: record.valueType.type, + dataType: record.type, }, } @@ -162,17 +163,12 @@ const confirm = () => { if (metrics) { expands.metrics = metrics } - console.log(expands) emit('update:value', { ...props.value, - expands: { - ...(props.value.expands || {}), - ...expands - } + ...expands }) resolve(true) } catch (err) { - console.log(err) reject(false) } }) @@ -180,18 +176,16 @@ const confirm = () => { const visibleChange = (e: boolean) => { if (e) { - configValue.value = omit(props.value?.expands, ['source', 'type', 'metrics', 'required']) + configValue.value = omit(props.value, ['source', 'type', 'metrics', 'required']) getConfig() } } const cancel = () => { - console.log(props.value) myValue.value = cloneDeep(props.value) } watch(() => props.value, () => { - console.log(props.value) myValue.value = cloneDeep(props.value) }, {immediate: true, deep: true}) diff --git a/src/views/device/components/Metadata/Base/components/Source.vue b/src/views/device/components/Metadata/Base/components/Source.vue index 0ac411f9..d072b385 100644 --- a/src/views/device/components/Metadata/Base/components/Source.vue +++ b/src/views/device/components/Metadata/Base/components/Source.vue @@ -8,31 +8,32 @@ :disabled="disabled" > - - - - - - + + + + + + \ No newline at end of file diff --git a/src/views/rule-engine/Alarm/Configuration/index.vue b/src/views/rule-engine/Alarm/Configuration/index.vue index 650621a8..0549c110 100644 --- a/src/views/rule-engine/Alarm/Configuration/index.vue +++ b/src/views/rule-engine/Alarm/Configuration/index.vue @@ -184,6 +184,7 @@ + diff --git a/src/views/device/Instance/Detail/ChildDevice/index.vue b/src/views/device/Instance/Detail/ChildDevice/index.vue index 4134e939..9b7d580f 100644 --- a/src/views/device/Instance/Detail/ChildDevice/index.vue +++ b/src/views/device/Instance/Detail/ChildDevice/index.vue @@ -105,14 +105,14 @@ - + @@ -186,4 +266,4 @@ onMounted(() => { } } } - \ No newline at end of file + diff --git a/src/views/device/Instance/Detail/EdgeMap/index.vue b/src/views/device/Instance/Detail/EdgeMap/index.vue index c788901b..b914f14e 100644 --- a/src/views/device/Instance/Detail/EdgeMap/index.vue +++ b/src/views/device/Instance/Detail/EdgeMap/index.vue @@ -22,6 +22,10 @@ - + + \ No newline at end of file diff --git a/src/views/account/Center/components/Subscribe/components/Detail.vue b/src/views/account/Center/components/Subscribe/components/Detail.vue index fa609948..1f36280f 100644 --- a/src/views/account/Center/components/Subscribe/components/Detail.vue +++ b/src/views/account/Center/components/Subscribe/components/Detail.vue @@ -1,16 +1,16 @@