From 1dc0722b6513191170c888f8f6647e09f3bf23e5 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Thu, 18 May 2023 10:29:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20bug#13639=E3=80=8113188?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/views/link/AccessConfig/Detail/index.vue | 27 +++++++++++++++++++ .../components/AccessCard/index.vue | 5 ++-- .../AccessConfig/components/Cloud/Ctwing.vue | 10 +++++++ .../AccessConfig/components/Cloud/OneNet.vue | 10 +++++++ .../AccessConfig/components/Cloud/index.vue | 6 +++++ .../AccessConfig/components/Media/GB28181.vue | 2 +- .../AccessConfig/components/Network/index.vue | 12 ++++++++- .../AccessConfig/components/Plugin/index.vue | 11 +++++++- src/views/system/Basis/index.vue | 15 +++++++++-- yarn.lock | 8 +++--- 11 files changed, 96 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 1adb91ab..ff972c4b 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.15", + "jetlinks-ui-components": "^1.0.16", "js-cookie": "^3.0.1", "less": "^4.1.3", "less-loader": "^11.1.0", diff --git a/src/views/link/AccessConfig/Detail/index.vue b/src/views/link/AccessConfig/Detail/index.vue index bfc01002..06b9e5c5 100644 --- a/src/views/link/AccessConfig/Detail/index.vue +++ b/src/views/link/AccessConfig/Detail/index.vue @@ -16,11 +16,13 @@ @@ -28,21 +30,25 @@ @@ -63,6 +69,7 @@ import Cloud from '../components/Cloud/index.vue'; import Plugin from '../components/Plugin/index.vue' import { getProviders, detail } from '@/api/link/accessConfig'; import { accessConfigTypeFilter } from '@/utils/setting'; +import { queryProductList } from '@/api/device/product'; const route = useRoute(); const id = route.params.id as string; @@ -73,6 +80,7 @@ const loading = ref(true); const provider = ref({}); const data = ref({}); const showType: any = ref(''); +const bindProduct = ref(false) const goProviders = (param: any) => { showType.value = param.type; @@ -188,8 +196,27 @@ const queryProviders = async () => { } }; +/** + * 检查是否被产品使用 + */ +const checkBindProduct = async (_id: string) => { + const resp = await queryProductList({ + paging: false, + terms: [{ + column: 'accessId', + termType: 'eq', + value: _id + }] + }) + console.log(resp.success && resp.result?.total) + if (resp.success && resp.result?.total) { + bindProduct.value = true + } +} + const getProvidersData = async () => { if (id !== ':id') { + checkBindProduct(id) getProviders().then((response: any) => { if (response.status === 200) { const _data = response.result || []; diff --git a/src/views/link/AccessConfig/components/AccessCard/index.vue b/src/views/link/AccessConfig/components/AccessCard/index.vue index a8304fb2..95ab9a3c 100644 --- a/src/views/link/AccessConfig/components/AccessCard/index.vue +++ b/src/views/link/AccessConfig/components/AccessCard/index.vue @@ -22,13 +22,12 @@ }} - + diff --git a/src/views/link/AccessConfig/components/Cloud/Ctwing.vue b/src/views/link/AccessConfig/components/Cloud/Ctwing.vue index 147aba15..a03d5888 100644 --- a/src/views/link/AccessConfig/components/Cloud/Ctwing.vue +++ b/src/views/link/AccessConfig/components/Cloud/Ctwing.vue @@ -177,6 +177,7 @@ @search="procotolSearch" /> @@ -352,6 +354,10 @@ const props = defineProps({ type: Object, default: () => {}, }, + bindProduct: { + type: Boolean, + default: false + } }); const formRef1 = ref(); @@ -368,6 +374,10 @@ const formData = ref({ description: '', }); +const showAddBtn = computed(() => { + return route.query.view === 'false' && !props.bindProduct +}) + const current = ref(0); const stepCurrent = ref(0); const steps = ref(['接入配置', '消息协议', '完成']); diff --git a/src/views/link/AccessConfig/components/Cloud/OneNet.vue b/src/views/link/AccessConfig/components/Cloud/OneNet.vue index 6e06e45f..479a41a9 100644 --- a/src/views/link/AccessConfig/components/Cloud/OneNet.vue +++ b/src/views/link/AccessConfig/components/Cloud/OneNet.vue @@ -260,6 +260,7 @@ @search="procotolSearch" /> @@ -434,6 +436,10 @@ const props = defineProps({ type: Object, default: () => {}, }, + bindProduct: { + type: Boolean, + default: false + } }); const route = useRoute(); @@ -462,6 +468,10 @@ const procotolList: any = ref([]); const allProcotolList = ref([]); const procotolCurrent: any = ref(''); +const showAddBtn = computed(() => { + return route.query.view === 'false' && !props.bindProduct +}) + const procotolChange = (id: string) => { procotolCurrent.value = id; }; diff --git a/src/views/link/AccessConfig/components/Cloud/index.vue b/src/views/link/AccessConfig/components/Cloud/index.vue index f1f4658a..4ed73d08 100644 --- a/src/views/link/AccessConfig/components/Cloud/index.vue +++ b/src/views/link/AccessConfig/components/Cloud/index.vue @@ -3,11 +3,13 @@ @@ -26,6 +28,10 @@ const props = defineProps({ type: Object, default: () => {}, }, + bindProduct: { + type: Boolean, + default: false + } }); const channel = props.provider.channel; diff --git a/src/views/link/AccessConfig/components/Media/GB28181.vue b/src/views/link/AccessConfig/components/Media/GB28181.vue index 20251b43..e5d0c744 100644 --- a/src/views/link/AccessConfig/components/Media/GB28181.vue +++ b/src/views/link/AccessConfig/components/Media/GB28181.vue @@ -530,7 +530,7 @@ const props = defineProps({ data: { type: Object, default: () => {}, - }, + } }); const route = useRoute(); diff --git a/src/views/link/AccessConfig/components/Network/index.vue b/src/views/link/AccessConfig/components/Network/index.vue index d35822b4..a34494a7 100644 --- a/src/views/link/AccessConfig/components/Network/index.vue +++ b/src/views/link/AccessConfig/components/Network/index.vue @@ -17,6 +17,7 @@ @search="networkSearch" /> @@ -352,6 +354,10 @@ const props = defineProps({ type: Object, default: () => {}, }, + bindProduct: { + type: Boolean, + default: false + } }); const clientHeight = document.body.clientHeight; @@ -396,6 +402,10 @@ const { resetFields, validate, validateInfos } = useForm( }), ); +const showAddBtn = computed(() => { + return route.query.view === 'false' && !props.bindProduct +}) + const queryNetworkList = async (id: string, include: string, data = {}) => { const resp = await getNetworkList( NetworkTypeMapping.get(id), diff --git a/src/views/link/AccessConfig/components/Plugin/index.vue b/src/views/link/AccessConfig/components/Plugin/index.vue index de06dd8a..9363a5fa 100644 --- a/src/views/link/AccessConfig/components/Plugin/index.vue +++ b/src/views/link/AccessConfig/components/Plugin/index.vue @@ -14,6 +14,7 @@ @search="pluginSearch" /> @@ -185,6 +186,10 @@ const props = defineProps({ type: Object, default: () => {}, }, + bindProduct: { + type: Boolean, + default: false + } }); const route = useRoute(); @@ -220,6 +225,10 @@ const queryPlugin = (params = {}) => { }) } +const showAddBtn = computed(() => { + return route.query.view === 'false' && !props.bindProduct +}) + const getRules = (item: any) => { let typeName = '输入' let rules: any[] = [] diff --git a/src/views/system/Basis/index.vue b/src/views/system/Basis/index.vue index b2cd5929..4a2dde94 100644 --- a/src/views/system/Basis/index.vue +++ b/src/views/system/Basis/index.vue @@ -48,7 +48,18 @@ base-path - + + + + + 系统后台访问的url。 + + + 格式:{http/https}: //{前端所在服务器IP地址}:{前端暴露的服务端口}/api + + + + diff --git a/yarn.lock b/yarn.lock index 9567fb16..35c00ff5 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.15: - version "1.0.15" - resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.15.tgz#fa007e685ead81ed0eb81250c5ecd3909f8b223d" - integrity sha512-ydgWz4Ee80V57yWnudRuGJASnuQULpbLAczY0NRybsVgLNf88N4FGqAug3XKBtsLn8xkPwNDlSLBCEs9baLv5Q== +jetlinks-ui-components@^1.0.16: + version "1.0.16" + resolved "https://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.16.tgz#bdb65385a30a121065322e5156c13080c8328080" + integrity sha512-R3oE8tpXW4oaNSCeGXRK++paNJiHYDO89Id3YqzIVX6/bWMItOWrEU6JT4iPA9uYkPTfsYHxnG5qZRloLnpiZw== dependencies: "@vueuse/core" "^9.12.0" "@vueuse/router" "^9.13.0"