From 94e0e9ff2e40c191b62b320c3b81a64da6b9d9a2 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Fri, 17 Mar 2023 15:44:15 +0800 Subject: [PATCH 1/3] fix: bug#10404 --- src/views/media/Cascade/index.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/views/media/Cascade/index.vue b/src/views/media/Cascade/index.vue index 341f7f3c..94b0abd1 100644 --- a/src/views/media/Cascade/index.vue +++ b/src/views/media/Cascade/index.vue @@ -241,13 +241,17 @@ const handleSearch = (e: any) => { * 处理表格数据 * @param params */ -const lastValueFrom = async (params: any) => { - const res = await CascadeApi.list(params); - res.result.data.forEach(async (item: any) => { - const resp = await CascadeApi.queryBindChannel(item.id, {}); - item.count = resp.result.total; +const lastValueFrom = (params: any) => { + return new Promise(async (resolve) => { + const res = await CascadeApi.list(params); + res.result.data.forEach(async (item: any) => { + const resp = await CascadeApi.queryBindChannel(item.id, {}); + item.count = resp.result.total; + }); + setTimeout(() => { + resolve(res); + }, 1000); }); - return res; }; /** From 34bff0ecb40981ce1eec6b48b1422e1b24585df1 Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Fri, 17 Mar 2023 15:48:50 +0800 Subject: [PATCH 2/3] fix: bug#10505 10443 --- src/components/PermissionButton/index.vue | 4 +- src/store/product.ts | 4 ++ src/views/device/Category/index.vue | 3 +- .../Product/Detail/DeviceAccess/index.vue | 53 +++++++++++-------- src/views/device/Product/Detail/index.vue | 1 + src/views/device/Product/index.vue | 2 +- 6 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/components/PermissionButton/index.vue b/src/components/PermissionButton/index.vue index 8ef32c2e..44733152 100644 --- a/src/components/PermissionButton/index.vue +++ b/src/components/PermissionButton/index.vue @@ -83,7 +83,7 @@ const props = defineProps({ type: Object as PropType, }, hasPermission: { - type: String || Array, + type: String || Array || Boolean, }, style: { type: Object as PropType @@ -96,7 +96,7 @@ const props = defineProps({ const permissionStore = usePermissionStore() const isPermission = computed(() => { - if (!props.hasPermission) { + if (!props.hasPermission || props.hasPermission === true) { return true } return permissionStore.hasPermission(props.hasPermission) diff --git a/src/store/product.ts b/src/store/product.ts index 0cf68527..7c23a80c 100644 --- a/src/store/product.ts +++ b/src/store/product.ts @@ -29,5 +29,9 @@ export const useProductStore = defineStore({ setTabActiveKey(key: string) { this.tabActiveKey = key }, + reSet(){ + this.current = {} as ProductItem + this.detail = {} as ProductItem + } } }) \ No newline at end of file diff --git a/src/views/device/Category/index.vue b/src/views/device/Category/index.vue index 64ed3cb2..9018bc36 100644 --- a/src/views/device/Category/index.vue +++ b/src/views/device/Category/index.vue @@ -76,6 +76,7 @@ import type { ActionsType } from '@/components/Table/index.vue'; import ModifyModal from './components/modifyModal/index.vue'; import type { TableColumnType, TableProps } from 'ant-design-vue'; import { message } from 'ant-design-vue'; +const expandedRowKeys = ref([]); const tableRef = ref>({}); const modifyRef = ref(); const dataSource = ref([]); @@ -126,7 +127,7 @@ let params = ref(); * 搜索 */ const handleSearch = (e: any) => { - params.value = e + params.value = e; }; /** * 操作栏按钮 diff --git a/src/views/device/Product/Detail/DeviceAccess/index.vue b/src/views/device/Product/Detail/DeviceAccess/index.vue index 5f8d872d..5925057d 100644 --- a/src/views/device/Product/Detail/DeviceAccess/index.vue +++ b/src/views/device/Product/Detail/DeviceAccess/index.vue @@ -589,6 +589,7 @@ const search = (e: any) => { }; }; +const stepsRef = reactive({current:0}) //引导页数据 const steps = [ { @@ -673,19 +674,19 @@ const driver = new Driver({ nextBtnText: '下一步', prevBtnText: '上一步', onNext: () => { - // ref.current = ref.current + 1; + stepsRef.current = stepsRef.current + 1; }, onPrevious: () => { - // ref.current = ref.current - 1; + stepsRef.current = stepsRef.current - 1; }, onReset: () => { - // if (ref.current !== 3) { - // guide({ - // name: 'guide', - // content: 'skip', - // }); - // } - // ref.current = 0; + if (stepsRef.current !== 3) { + guide({ + name: 'guide', + content: 'skip', + }); + } + stepsRef.current = 0; }, }); @@ -695,16 +696,20 @@ const driver1 = new Driver({ closeBtnText: '不再提示', nextBtnText: '下一步', prevBtnText: '上一步', - onNext: () => {}, - onPrevious: () => {}, + onNext: () => { + stepsRef.current = stepsRef.current + 1; + }, + onPrevious: () => { + stepsRef.current = stepsRef.current - 1; + }, onReset: () => { - // if (ref.current !== 4) { - // // guide({ - // // name: 'guide', - // // content: 'skip', - // // }); - // } - // ref.current = 0; + if (stepsRef.current !== 4) { + guide({ + name: 'guide', + content: 'skip', + }); + } + stepsRef.current = 0; }, }); @@ -969,9 +974,11 @@ const submitData = async () => { productStore.current = { ...res.result }; access.value = res.result; message.success('操作成功!'); + getData(); } visible.value = false; queryParams.value = {}; + }); } } else { @@ -1085,11 +1092,11 @@ const add = () => { /** * 初始化 */ -watchEffect(() => { - if (productStore.current?.accessId) { - getData(); - } -}); +// watchEffect(() => { +// if (productStore.current?.accessId) { +// getData(); +// } +// }); \ No newline at end of file diff --git a/src/views/Northbound/DuerOS/Detail/command/index.vue b/src/views/Northbound/DuerOS/Detail/command/index.vue index efd19ebc..fc2ec36c 100644 --- a/src/views/Northbound/DuerOS/Detail/command/index.vue +++ b/src/views/Northbound/DuerOS/Detail/command/index.vue @@ -1,76 +1,156 @@ \ No newline at end of file diff --git a/src/views/Northbound/DuerOS/Detail/index.vue b/src/views/Northbound/DuerOS/Detail/index.vue index 36894c24..46d2d739 100644 --- a/src/views/Northbound/DuerOS/Detail/index.vue +++ b/src/views/Northbound/DuerOS/Detail/index.vue @@ -171,7 +171,8 @@ > 保存 @@ -626,12 +631,11 @@ const saveBtn = async () => { loading.value = true; const resp = await savePatch(data).finally(() => { loading.value = false; - }) + }); if (resp.status === 200) { message.success('操作成功!'); formRef.value.resetFields(); menuStory.jumpPage('Northbound/DuerOS'); - } } }) diff --git a/src/views/Northbound/DuerOS/index.vue b/src/views/Northbound/DuerOS/index.vue index 7d4b4f02..c9e735d9 100644 --- a/src/views/Northbound/DuerOS/index.vue +++ b/src/views/Northbound/DuerOS/index.vue @@ -27,11 +27,12 @@