From 9968af2ecd9c255fae4e5ebbdbd35de3a23bd2ca Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Tue, 31 Jan 2023 15:24:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/deviceManage/index.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/views/system/deviceManage/index.vue b/src/views/system/deviceManage/index.vue index b9551597b..b046d2ab1 100644 --- a/src/views/system/deviceManage/index.vue +++ b/src/views/system/deviceManage/index.vue @@ -17,7 +17,7 @@ import EditConfigGateway from './editConfigGateway'; import EditConfig from './editConfig'; import EditConfigScreen from './editConfigScreen'; import EditConfigIbp from './editConfigIbp'; -import { getSessionStorage } from '@/utils/auth'; +import { getAllBackProjectConfig } from '@/api/projectConfig'; import ConstConfig from '@/scripts/ConstConfig'; export default { name: 'DeviceManage', @@ -39,7 +39,8 @@ export default { }, // projectCode:'', deviceTypeList:ConstConfig.ConstSelect.projectDeviceTypeList, - projectList: ConstConfig.ConstSelect.projectList, + // ConstConfig.ConstSelect.projectList + projectList: [], queryForm: { labelWidth: '120px', reset: true, @@ -60,7 +61,7 @@ export default { type: 'select', label: '所属项目', config: { - data: ConstConfig.ConstSelect.projectList + data: [] } } } @@ -125,8 +126,17 @@ export default { currentModel: {} }; }, - created() { - // this.projectCode = getSessionStorage('project') || ''; + mounted() { + getAllBackProjectConfig().then(response => { + const projectList = []; + const data = response.data; + data.forEach(element => { + projectList.push({label:element.name, value: element.code}); + }); + this.projectList = projectList; + this.queryForm.queryObject.projectCode.config.data = projectList; + }); + }, methods: { beforeQuery(params) {