From 4a72c05b1284ecbb7eda32b5ee4194f366534b47 Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Fri, 17 Mar 2023 09:59:46 +0800 Subject: [PATCH 1/9] fix: bug#10482 10490 10444 10443 --- src/components/AMapComponent/index.vue | 3 +-- .../Category/components/modifyModal/index.vue | 8 ++++---- src/views/device/Category/index.vue | 1 + src/views/device/Product/Save/index.vue | 1 + src/views/device/Product/index.vue | 16 ++++++++++++++-- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/components/AMapComponent/index.vue b/src/components/AMapComponent/index.vue index 03e9befd..250b3930 100644 --- a/src/components/AMapComponent/index.vue +++ b/src/components/AMapComponent/index.vue @@ -26,11 +26,10 @@ interface AMapProps { class?: string; AMapUI?: string | boolean; } -const amapKey = localStorage.getItem('amap_key') || 'a0415acfc35af15f10221bfa5a6850b4'; +const amapKey = localStorage.getItem('amap_key') initAMapApiLoader({ key: amapKey || '', - securityJsCode: 'cae6108ec3dd222f946d1a7237c78be0', }); const props = defineProps({ diff --git a/src/views/device/Category/components/modifyModal/index.vue b/src/views/device/Category/components/modifyModal/index.vue index 8d947d74..c9e55b48 100644 --- a/src/views/device/Category/components/modifyModal/index.vue +++ b/src/views/device/Category/components/modifyModal/index.vue @@ -118,20 +118,20 @@ const submitData = async () => { if (props.isChild === 1) { addParams.value = { ...formModel.value, - sortIndex: - childArr.value[childArr.value.length - 1].sortIndex + 1, + // sortIndex: + // childArr.value[childArr.value.length - 1].sortIndex + 1, parentId: addObj.value.id, }; } else if (props.isChild === 2) { addParams.value = { parentId: addObj.value.id, ...formModel.value, - sortIndex: 1, + // sortIndex: 1, }; } else if (props.isChild === 3) { addParams.value = { ...formModel.value, - sortIndex: arr.value[arr.value.length - 1].sortIndex + 1, + // sortIndex: arr.value[arr.value.length - 1].sortIndex + 1, }; } const res = await saveTree(addParams.value); diff --git a/src/views/device/Category/index.vue b/src/views/device/Category/index.vue index 6d91cdc9..64ed3cb2 100644 --- a/src/views/device/Category/index.vue +++ b/src/views/device/Category/index.vue @@ -220,6 +220,7 @@ const table = reactive({ title: '说明', dataIndex: 'description', key: 'description', + ellipsis: true, width: 700, }, { diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue index 03a22ac5..ac8cab7a 100644 --- a/src/views/device/Product/Save/index.vue +++ b/src/views/device/Product/Save/index.vue @@ -334,6 +334,7 @@ const submitData = () => { formRef.value .validate() .then(async () => { + console.log(form); // 新增 if (props.isAdd === 1) { if (form.id === '') { diff --git a/src/views/device/Product/index.vue b/src/views/device/Product/index.vue index 72424a42..d684a3b2 100644 --- a/src/views/device/Product/index.vue +++ b/src/views/device/Product/index.vue @@ -103,7 +103,7 @@ ...item.tooltip, }" @click="item.onClick" - :hasPermission="'device/Product:' + item.key" + :hasPermission="item.key ==='view' ? true : 'device/Product:' + item.key" > Date: Fri, 17 Mar 2023 10:11:30 +0800 Subject: [PATCH 2/9] =?UTF-8?q?update:=20=E4=BC=98=E5=8C=96=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E8=81=94=E5=8A=A8=E8=87=AA=E9=80=82=E5=BA=94=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- .../rule-engine/Scene/Save/components/Terms/index.less | 1 + yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8e4954cc..e01c7da6 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.5", + "jetlinks-ui-components": "^1.0.4", "js-cookie": "^3.0.1", "less": "^4.1.3", "less-loader": "^11.1.0", diff --git a/src/views/rule-engine/Scene/Save/components/Terms/index.less b/src/views/rule-engine/Scene/Save/components/Terms/index.less index fa3c7b43..07663aac 100644 --- a/src/views/rule-engine/Scene/Save/components/Terms/index.less +++ b/src/views/rule-engine/Scene/Save/components/Terms/index.less @@ -194,6 +194,7 @@ .button-delete { + .deleteBtn(); } } diff --git a/yarn.lock b/yarn.lock index 8d75e7bc..651ae021 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3698,10 +3698,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.5: - version "1.0.5" - resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#4f136aac4cc6aa6f4c6515b9f54b70cd9f254419" - integrity sha512-K5U2xwhZYSmkMUsWFcqnCh4NxFM+HDfcQurmcDMQTr0/1fkG4LPqhETN0HmurLcnJAu7C4Ks1HRZJRlGqBCxAw== +jetlinks-ui-components@^1.0.4: + version "1.0.4" + resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.4.tgz#cd080b2d8320c7a03ed20f4c4c22e9a5c920a3c8" + integrity sha512-8xzDFH6jSGNrkbCMb+/FL/g9vB0c2GdsDq6QPUzgKFwzPiS+cPbpSxL0RNHez9MF7/NSSuY8wL4VaujiVXTpfg== dependencies: "@vueuse/core" "^9.12.0" ant-design-vue "^3.2.15" From 7a0796668f9442aabe88ffd4a6eb7a1e084e32a6 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Fri, 17 Mar 2023 11:29:21 +0800 Subject: [PATCH 3/9] fix: bug#10196 --- src/views/media/Device/Channel/Save.vue | 9 ++++- src/views/notice/Config/SyncUser/index.vue | 45 +++++++++++++--------- 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/views/media/Device/Channel/Save.vue b/src/views/media/Device/Channel/Save.vue index f5196dfd..76bbfe01 100644 --- a/src/views/media/Device/Channel/Save.vue +++ b/src/views/media/Device/Channel/Save.vue @@ -317,9 +317,14 @@ watch( () => _vis.value, (val) => { if (!val) { - formRef.value.resetFields(); + formRef.value?.resetFields(); // resetFields没有生效 // 以下字段非表单所填, 重置字段需手动置空 - formData.value.id = undefined; + Object.keys(formData.value).forEach((key: string) => { + if (key === 'id') formData.value.id = undefined; + else if (key === 'deviceId') + formData.value.deviceId = route.query.id; + else formData.value[key] = ''; + }); } }, ); diff --git a/src/views/notice/Config/SyncUser/index.vue b/src/views/notice/Config/SyncUser/index.vue index d8a8c1b9..289f27cf 100644 --- a/src/views/notice/Config/SyncUser/index.vue +++ b/src/views/notice/Config/SyncUser/index.vue @@ -271,21 +271,31 @@ const getActions = ( /** * 自动绑定 */ -const handleAutoBind = () => { - const arr = dataSource.value - .filter((item: any) => item.userId && item.status.value === 'error') - .map((i: any) => { - return { - userId: i.userId, - providerName: i.userName, - thirdPartyUserId: i.thirdPartyUserId, - }; - }); +const handleAutoBind = async () => { + await getTableData([ + { + column: `id$user-third$${props.data.type}_${props.data.provider}$not`, + }, + ]); + const params = dataSource.value + .filter((f: any) => f.userId && f.status.value === 'error') + .map((m: any) => ({ + userId: m.userId, + providerName: m.thirdPartyUserName, + thirdPartyUserId: m.thirdPartyUserId, + })); - configApi.dingTalkBindUser(arr, props.data.id).then(() => { - message.success('操作成功'); - getTableData(); - }); + if (props.data.type === 'dingTalk') { + configApi.dingTalkBindUser(params, props.data.id).then(() => { + message.success('操作成功'); + getTableData(); + }); + } else if (props.data.type === 'weixin') { + configApi.weChatBindUser(params, props.data.id).then(() => { + message.success('操作成功'); + getTableData(); + }); + } }; /** @@ -335,9 +345,9 @@ const getAllUsers = async (terms?: any) => { */ const dataSource = ref([]); const tableLoading = ref(false); -const getTableData = () => { +const getTableData = (terms?: any) => { tableLoading.value = true; - Promise.all([getDeptUsers(), getBindUsers(), getAllUsers()]) + Promise.all([getDeptUsers(), getBindUsers(), getAllUsers(terms)]) .then((res) => { dataSource.value = []; const [deptUsers, bindUsers, unBindUsers] = res; @@ -359,7 +369,7 @@ const getTableData = () => { thirdPartyUserId: deptUser.id, thirdPartyUserName: deptUser.name, bindId: bindUser?.id, - userId: bindUser?.userId, + userId: unBindUser?.id, userName: unBindUser ? `${unBindUser.name}(${unBindUser.username})` : bindUser?.providerName, @@ -420,7 +430,6 @@ const handleBind = (row: any) => { getAllUsers([ { column: `id$user-third$${props.data.type}_${props.data.provider}$not`, - // value: props.data.id, }, ]); }; From 404506a37f5821ad4afbd7c5606b6dd07bb3ed8b Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Fri, 17 Mar 2023 11:33:21 +0800 Subject: [PATCH 4/9] fix: #bug10506 10509 10512 --- src/components/PermissionButton/index.vue | 2 +- src/views/device/Product/Save/index.vue | 11 ++++++++--- src/views/device/Product/index.vue | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/PermissionButton/index.vue b/src/components/PermissionButton/index.vue index a6f2b56c..8ef32c2e 100644 --- a/src/components/PermissionButton/index.vue +++ b/src/components/PermissionButton/index.vue @@ -40,7 +40,7 @@ - + diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue index ac8cab7a..f0803d2c 100644 --- a/src/views/device/Product/Save/index.vue +++ b/src/views/device/Product/Save/index.vue @@ -49,7 +49,7 @@ @@ -149,6 +149,7 @@ import { Form } from 'ant-design-vue'; import { getImage } from '@/utils/comm.ts'; import { message } from 'ant-design-vue'; import DialogTips from '../DialogTips/index.vue'; +import { useProductStore } from '@/store/product'; import { filterTreeSelectNode, filterSelectNode } from '@/utils/comm'; import { FILE_UPLOAD } from '@/api/comm'; import { isInput } from '@/utils/regular'; @@ -159,7 +160,7 @@ import { CheckOutlined, DeleteOutlined, } from '@ant-design/icons-vue'; - +const productStore = useProductStore(); const emit = defineEmits(['success']); const props = defineProps({ title: { @@ -178,6 +179,7 @@ const visible = ref(false); const logoLoading = ref(false); const formRef = ref(); const disabled = ref(false); +const idDisabled = ref(false); const useForm = Form.useForm; const _selectedRowKeys = ref([]); const photoValue = ref('/images/device-product.png'); @@ -296,6 +298,7 @@ watch( */ const show = (data: any) => { if (props.isAdd === 2) { + productStore.refresh(data.id); form.name = data.name; form.classifiedId = data.classifiedId; form.classifiedName = data.classifiedName; @@ -303,7 +306,8 @@ const show = (data: any) => { form.deviceType = data.deviceType.value; form.describe = form.describe; form.id = data.id; - disabled.value = true; + disabled.value = productStore.current?.accessId ? true : false; + idDisabled.value = true; } else if (props.isAdd === 1) { form.name = ''; form.classifiedId = ''; @@ -313,6 +317,7 @@ const show = (data: any) => { form.describe = undefined; form.id = undefined; disabled.value = false; + disabled.vlaue = false; } visible.value = true; }; diff --git a/src/views/device/Product/index.vue b/src/views/device/Product/index.vue index d684a3b2..0d69d77c 100644 --- a/src/views/device/Product/index.vue +++ b/src/views/device/Product/index.vue @@ -395,7 +395,7 @@ const beforeUpload = (file: any) => { } return true; } catch { - message.error('请上传json格式文件'); + // message.error('请上传json格式文件'); } return true; }; From c4d33d56e33a44c8c79f653a61096dc80492888e Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Fri, 17 Mar 2023 11:48:56 +0800 Subject: [PATCH 5/9] =?UTF-8?q?fix:=20bug#10196=E3=80=8110500=E3=80=811052?= =?UTF-8?q?4=E3=80=8110525?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/media/Device/Save/index.vue | 2 +- src/views/media/Device/const.ts | 2 +- src/views/media/Device/index.vue | 18 ++++++++++++---- src/views/media/SplitScreen/tree.vue | 30 ++++++++++++++------------- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/views/media/Device/Save/index.vue b/src/views/media/Device/Save/index.vue index b1d63fb7..c5334cb9 100644 --- a/src/views/media/Device/Save/index.vue +++ b/src/views/media/Device/Save/index.vue @@ -53,7 +53,7 @@ > diff --git a/src/views/media/Device/const.ts b/src/views/media/Device/const.ts index 1d2ccc69..4af7b2ec 100644 --- a/src/views/media/Device/const.ts +++ b/src/views/media/Device/const.ts @@ -1,6 +1,6 @@ export const PROVIDER_OPTIONS = [ - { label: '固定地址', value: 'fixed-media' }, { label: 'GB/T28181', value: 'gb28181-2016' }, + { label: '固定地址', value: 'fixed-media' }, ] export const streamMode = [ { label: 'UDP', value: 'UDP' }, diff --git a/src/views/media/Device/index.vue b/src/views/media/Device/index.vue index ac0c47dd..3dd5dab0 100644 --- a/src/views/media/Device/index.vue +++ b/src/views/media/Device/index.vue @@ -78,7 +78,12 @@ ...item.tooltip, }" @click="item.onClick" - :hasPermission="'media/Device:' + item.key" + :hasPermission=" + 'media/Device:' + + (item.key !== 'updateChannel' + ? item.key + : 'update') + " > @@ -318,7 +326,7 @@ const getActions = ( }, }, { - key: 'view', // updateChannel + key: 'updateChannel', text: '更新通道', tooltip: { title: @@ -366,6 +374,8 @@ const getActions = ( icon: 'DeleteOutlined', }, ]; - return actions; + return data.provider === 'fixed-media' + ? actions.filter((f: any) => f.key !== 'updateChannel') + : actions; }; diff --git a/src/views/media/SplitScreen/tree.vue b/src/views/media/SplitScreen/tree.vue index 86398634..6dbaecb9 100644 --- a/src/views/media/SplitScreen/tree.vue +++ b/src/views/media/SplitScreen/tree.vue @@ -43,8 +43,8 @@ interface DataNode { /** * 点击节点 - * @param _ - * @param param1 + * @param _ + * @param param1 */ const onSelect = (_: any, { node }: any) => { emit('onSelect', { dId: node.deviceId, cId: node.channelId }); @@ -68,23 +68,25 @@ const treeData = ref([]); const getDeviceList = async () => { const res = await cascadeApi.getMediaTree({ paging: false }); if (res.success) { - treeData.value = res.result.map((m: any) => { - const extra: any = {}; - extra.isLeaf = isLeaf(m); - return { - ...m, - ...extra, - }; - }); + treeData.value = res.result + .sort((a: any, b: any) => a.createTime - b.createTime) + .map((m: any) => { + const extra: any = {}; + extra.isLeaf = isLeaf(m); + return { + ...m, + ...extra, + }; + }); } }; getDeviceList(); /** * 更新数据 - * @param list - * @param key - * @param children + * @param list + * @param key + * @param children */ const updateTreeData = ( list: DataNode[], @@ -146,7 +148,7 @@ const getChildren = (key: any, params: any): Promise => { /** * 异步加载子节点数据 - * @param param0 + * @param param0 */ const onLoadData = ({ key, children }: any): Promise => { return new Promise(async (resolve) => { From f45cc4da6181f3045fd4a55b98a4565a50f73a67 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Fri, 17 Mar 2023 11:51:02 +0800 Subject: [PATCH 6/9] =?UTF-8?q?fix:=20bug#10532=E3=80=8110531=E3=80=811053?= =?UTF-8?q?0=E3=80=8110527?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ViewDialog.vue | 2 - src/views/system/Basis/index.vue | 47 +++++++++---------- src/views/system/Role/index.vue | 33 ++++++------- 3 files changed, 35 insertions(+), 47 deletions(-) diff --git a/src/views/account/NotificationRecord/components/ViewDialog.vue b/src/views/account/NotificationRecord/components/ViewDialog.vue index bfc12862..953fe14e 100644 --- a/src/views/account/NotificationRecord/components/ViewDialog.vue +++ b/src/views/account/NotificationRecord/components/ViewDialog.vue @@ -91,8 +91,6 @@ const getLevelLabel = (id: number) => { .label { background-color: #fafafa; } - .value { - } } } diff --git a/src/views/system/Basis/index.vue b/src/views/system/Basis/index.vue index 825cc761..1d234219 100644 --- a/src/views/system/Basis/index.vue +++ b/src/views/system/Basis/index.vue @@ -3,7 +3,7 @@
@@ -73,9 +73,7 @@ @change=" uploader.handleChangeLogo " - :accept=" - uploader.imageTypes.toString() - " + :accept="uploader.imageTypes" > -
支持jpg,png
+
+ 支持jpg,png,jfif,pjp,pjpeg,jpeg +
@@ -163,9 +163,7 @@ @change=" uploader.changeIconUpload " - :accept=" - uploader.imageTypes.toString() - " + :accept="uploader.iconTypes" > - +
diff --git a/src/views/media/Device/Channel/Live/index.vue b/src/views/media/Device/Channel/Live/index.vue index 49bf12ed..53856333 100644 --- a/src/views/media/Device/Channel/Live/index.vue +++ b/src/views/media/Device/Channel/Live/index.vue @@ -25,7 +25,7 @@
刷新
重置
- + Date: Fri, 17 Mar 2023 14:32:43 +0800 Subject: [PATCH 9/9] =?UTF-8?q?fix:=20bug#10532=E3=80=8110531=E3=80=811053?= =?UTF-8?q?0=E3=80=8110527=E3=80=8110534=E3=80=8110529?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/system.ts | 13 ++++++++-- src/views/system/Basis/index.vue | 44 ++++++++++++-------------------- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/store/system.ts b/src/store/system.ts index e4d37681..4f3e63f7 100644 --- a/src/store/system.ts +++ b/src/store/system.ts @@ -1,14 +1,17 @@ import { defineStore } from 'pinia'; import { systemVersion } from '@/api/comm' import { useMenuStore } from './menu' +import { getDetails_api } from '@/api/system/basis'; export const useSystem = defineStore('system', { state: () => ({ - isCommunity: false + isCommunity: false, + configInfo: [] as any[] }), actions: { getSystemVersion(): Promise { - return new Promise(async(res, rej) => { + this.getSystemConfig(); + return new Promise(async (res, rej) => { const resp = await systemVersion() if (resp.success && resp.result) { const isCommunity = resp.result.edition === 'community' @@ -19,6 +22,12 @@ export const useSystem = defineStore('system', { res(menuData) } }) + }, + getSystemConfig() { + const params = ['front', 'amap', 'paths']; + getDetails_api(params).then(({ status, result }: any) => { + this.configInfo = status === 200 ? [...result] : []; + }) } } }) \ No newline at end of file diff --git a/src/views/system/Basis/index.vue b/src/views/system/Basis/index.vue index 1d234219..a680c581 100644 --- a/src/views/system/Basis/index.vue +++ b/src/views/system/Basis/index.vue @@ -292,6 +292,7 @@ import { LocalStore } from '@/utils/comm'; import { save_api, getDetails_api } from '@/api/system/basis'; import { usePermissionStore } from '@/store/permission'; +import { useSystem } from '@/store/system'; const action = `${BASE_API_PATH}/file/static`; const headers = { [TOKEN_KEY]: LocalStore.get(TOKEN_KEY) }; @@ -302,9 +303,9 @@ const form = reactive({ headerTheme: 'light', apiKey: '', 'base-path': `${window.location.origin}/api`, - logo: '/public/logo.png', - ico: '/public/favicon.ico', - backgroud: '/public/images/login.png', + logo: '', + ico: '', + backgroud: '', }, rulesFrom: { title: [ @@ -337,31 +338,18 @@ const form = reactive({ iconLoading: false, // 页签加载状态 saveLoading: false, getDetails: () => { - const params = ['front', 'amap', 'paths']; - getDetails_api(params).then((resp: any) => { - const basis = resp.result?.filter( - (item: any) => item.scope === 'front', - ); - const api = resp.result?.filter( - (item: any) => item.scope === 'amap', - ); - const basePath = resp.result?.filter( - (item: any) => item.scope === 'paths', - ); - form.formValue = { - ...basis[0].properties, - apiKey: api[0].properties.apiKey, - 'base-path': basePath[0].properties['base-path'], - logo: form.formValue.logo || '/public/logo.png', - ico: form.formValue.ico || '/public/favicon.ico', - backgroud: - form.formValue.backgroud || '/public/images/login.png', - }; - // localStorage.setItem( - // SystemConst.AMAP_KEY, - // api[0].properties.apiKey, - // ); - }); + const configInfo = useSystem().$state.configInfo; + const basis = configInfo.find((item: any) => item.scope === 'front'); + const api = configInfo.find((item: any) => item.scope === 'amap'); + const basePath = configInfo.find((item: any) => item.scope === 'paths'); + form.formValue = { + ...basis.properties, + apiKey: api.properties.apiKey, + 'base-path': basePath.properties['base-path'], + logo: basis.properties.logo || '/public/logo.png', + ico: basis.properties.ico || '/public/favicon.ico', + backgroud: basis.properties.backgroud || '/public/images/login.png', + }; }, clickSave: () => { const hasPermission = usePermissionStore().hasPermission;