From 668e346e5e071badc43890ea7fff2218667c1c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E7=A3=8A?= <45566618@qq.com> Date: Thu, 27 Mar 2025 14:13:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?tplink=E9=A1=B9=E7=9B=AE=E3=80=81=E5=88=86?= =?UTF-8?q?=E7=BB=84=E5=90=8C=E6=AD=A5=E6=9C=BA=E6=9E=84=E5=92=8C=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/tplink/project/ProjectInfo.data.ts | 10 ++--- src/views/iot/tplink/region/RegionInfo.api.ts | 17 ++++--- .../iot/tplink/region/RegionInfo.data.ts | 34 +++++++++----- .../tplink/region/components/RegionForm.vue | 45 +++++++++++++++++-- .../region/components/RegionInfoDrawer.vue | 37 +++++++++++++-- .../region/components/RegionLeftTree.vue | 12 +++++ src/views/iot/tplink/region/index.vue | 1 + 7 files changed, 129 insertions(+), 27 deletions(-) diff --git a/src/views/iot/tplink/project/ProjectInfo.data.ts b/src/views/iot/tplink/project/ProjectInfo.data.ts index 0c6aac0..b4cb545 100644 --- a/src/views/iot/tplink/project/ProjectInfo.data.ts +++ b/src/views/iot/tplink/project/ProjectInfo.data.ts @@ -16,7 +16,7 @@ export const columns: BasicColumn[] = [ { title: '机构名称', align: 'center', - dataIndex: 'institutionalId_dictText', + dataIndex: 'institutionId_dictText', }, { title: '创建时间', @@ -56,10 +56,10 @@ export const columns: BasicColumn[] = [ export const searchFormSchema: FormSchema[] = [ { label: '机构', - field: 'institutionalId', + field: 'institutionId', component: 'JDictSelectTag', componentProps: { - dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc', + dictCode: 'nu_admin_institution_area,inst_name,id,org_category = 1 order by inst_name asc', placeholder: '请选择机构', }, }, @@ -104,10 +104,10 @@ export const formSchema: FormSchema[] = [ }, { label: '机构名称', - field: 'institutionalId', + field: 'institutionId', component: 'JDictSelectTag', componentProps: { - dictCode: 'sys_depart,depart_name,id,org_category = 1 order by depart_name asc', + dictCode: 'nu_admin_institution_area,inst_name,id,org_category = 1 order by inst_name asc', placeholder: '请选择机构', }, }, diff --git a/src/views/iot/tplink/region/RegionInfo.api.ts b/src/views/iot/tplink/region/RegionInfo.api.ts index 90b396d..5c1eac3 100644 --- a/src/views/iot/tplink/region/RegionInfo.api.ts +++ b/src/views/iot/tplink/region/RegionInfo.api.ts @@ -11,6 +11,7 @@ enum Api { add = '/iot/regionInfo/add', edit = '/iot/regionInfo/edit', delete = '/iot/regionInfo/delete', + queryChildrenByParentId = '/admin/institutionArea/queryChildrenByParentId', } @@ -21,7 +22,7 @@ enum Api { export const queryProjectTreeSync = (params?) => defHttp.get({ url: Api.queryProjectTreeSync, params }); /** - * 获取区域树列表 + * 获取分组树列表 * @param params */ export const queryRegionTreeSync = (params?) => defHttp.get({ url: Api.queryRegionTreeSync, params }); @@ -33,17 +34,23 @@ export const queryRegionTreeSync = (params?) => defHttp.get({ url: Api.queryRegi export const syncProject = (params?) => defHttp.get({ url: Api.syncProject, params }); /** - * 同步区域 + * 同步分组 * @param params */ export const syncRegionChildren = (params?) => defHttp.get({ url: Api.syncRegionChildren, params }); /** - * 同步子区域 + * 同步子分组 * @param params */ export const syncRegion = (params?) => defHttp.get({ url: Api.syncRegion, params }); +/** + * 通过parentId获取区域列表 + * @param params + */ +export const queryArea = (params?) => defHttp.get({ url: Api.queryChildrenByParentId, params }); + /** * 列表接口 * @param params @@ -57,7 +64,7 @@ export const list = (params) => defHttp.get({ url: Api.list, params }); export const sync = (params) => defHttp.get({ url: Api.sync, params }); /** - * 保存或者更新区域 + * 保存或者更新分组 * @param params */ export const saveOrUpdateRegion = (params, isUpdate) => { @@ -66,7 +73,7 @@ export const saveOrUpdateRegion = (params, isUpdate) => { }; /** - * 删除区域 + * 删除分组 */ export const deleteRegion = (params,handleSuccess) => { return defHttp.post({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => { diff --git a/src/views/iot/tplink/region/RegionInfo.data.ts b/src/views/iot/tplink/region/RegionInfo.data.ts index 2d62dcb..43666f4 100644 --- a/src/views/iot/tplink/region/RegionInfo.data.ts +++ b/src/views/iot/tplink/region/RegionInfo.data.ts @@ -4,17 +4,17 @@ import {FormSchema} from '/@/components/Table'; //列表数据 export const columns: BasicColumn[] = [ { - title: '区域序号', + title: '分组序号', align: "center", dataIndex: 'regionId' }, { - title: '区域名称', + title: '分组名称', align: "center", dataIndex: 'regionName' }, { - title: '区域层级', + title: '分组层级', align: "center", dataIndex: 'regionLevel' }, @@ -24,7 +24,7 @@ export const columns: BasicColumn[] = [ dataIndex: 'parentName' }, { - title: '机构名称', + title: '项目名称', align: "center", dataIndex: 'projectName' }, @@ -34,7 +34,7 @@ export const columns: BasicColumn[] = [ dataIndex: 'updateTime' }, { - title: '区域次序', + title: '分组次序', align: "center", dataIndex: 'sort' }, @@ -42,7 +42,7 @@ export const columns: BasicColumn[] = [ export const searchFormSchema: FormSchema[] = [ { - label: '机构', + label: '项目', field: 'projectId', component: 'JDictSelectTag', componentProps: { @@ -67,6 +67,12 @@ export const formSchema: FormSchema[] = [ component: 'Input', show: false, }, + { + label: '', + field: 'institutionId', + component: 'Input', + show: false, + }, { label: '', field: 'parentId', @@ -74,18 +80,24 @@ export const formSchema: FormSchema[] = [ show: false, }, { - label: '区域序号', + label: '分组序号', field: 'regionId', component: 'Input', dynamicDisabled: true }, { - label: '区域名称', + label: '分组名称', field: 'regionName', component: 'Input', }, { - label: '区域层级', + label: '区域名称', + field: 'areaId', + component: 'Input', + slot: 'areaSelect' + }, + { + label: '分组层级', field: 'regionLevel', component: 'Input', dynamicDisabled: true @@ -97,7 +109,7 @@ export const formSchema: FormSchema[] = [ dynamicDisabled: true }, { - label: '机构名称', + label: '项目名称', field: 'projectName', component: 'Input', dynamicDisabled: ({model})=>{ @@ -115,7 +127,7 @@ export const formSchema: FormSchema[] = [ dynamicDisabled: true }, { - label: '区域次序', + label: '分组次序', field: 'sort', component: 'Input', dynamicDisabled: true diff --git a/src/views/iot/tplink/region/components/RegionForm.vue b/src/views/iot/tplink/region/components/RegionForm.vue index f64f2c0..53055f4 100644 --- a/src/views/iot/tplink/region/components/RegionForm.vue +++ b/src/views/iot/tplink/region/components/RegionForm.vue @@ -1,6 +1,17 @@