diff --git a/hx-ai-intelligent/public/bulbLogo/组 22394.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22394.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22394.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22394.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22394@2x.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22394@2x.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22394@2x.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22394@2x.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22396.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22396.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22396.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22396.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22396@2x.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22396@2x.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22396@2x.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22396@2x.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22400.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22400.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22400.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22400.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22400@2x.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22400@2x.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22400@2x.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22400@2x.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22419.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22419.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22419.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22419.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22419@2x.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22419@2x.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22419@2x.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22419@2x.png diff --git a/hx-ai-intelligent/public/bulbLogo/组 22549.png b/hx-ai-intelligent/public/asset/image/bulbLogo/22549.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/组 22549.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/22549.png diff --git a/hx-ai-intelligent/public/bulbLogo/bgsquare.png b/hx-ai-intelligent/public/asset/image/bulbLogo/bgsquare.png similarity index 100% rename from hx-ai-intelligent/public/bulbLogo/bgsquare.png rename to hx-ai-intelligent/public/asset/image/bulbLogo/bgsquare.png diff --git a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue index 5bae907..517ed66 100644 --- a/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue +++ b/hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue @@ -4,25 +4,25 @@
- +
- +
- +
- +
- +
- +
- +
@@ -40,8 +40,7 @@ placement="right" :drawerStyle="{ background: 'rgba(0, 0, 0, 1)', opacity: 0.8 }" :closable="false" - id="Odrawer" - > + id="Odrawer">
@@ -57,8 +56,7 @@ v-for="(button, index) in buttons" :key="index" :class="{ btn: true, selected: button === selectedButton }" - @click="selectButton(button)" - > + @click="selectButton(button)"> {{ button.label }}
@@ -71,8 +69,7 @@ type="checkbox" class="custom-checkbox" v-model="selectAllCheckbox" - @change="toggleAllSelection" - /> + @change="toggleAllSelection" /> 全选 @@ -83,8 +80,7 @@ v-for="(button2, index) in buttons2" :key="index" :class="{ btn: true, selected: button2.selected }" - @click="toggleSelection(button2)" - > + @click="toggleSelection(button2)"> {{ button2.label }} @@ -100,8 +96,7 @@ v-for="(button3, index) in controlbutton" :key="index" :class="{ btn: true, selected: button3.label === selectedButton3 }" - @click="selectButton3(button3)" - > + @click="selectButton3(button3)"> {{ button3.label }} @@ -118,8 +113,7 @@ v-for="(button4, index) in controlscenebuttons" :key="index" :class="{ btn: true, selected: button4.label === selectedButton4 }" - @click="selectButton4(button4)" - > + @click="selectButton4(button4)"> {{ button4.label }} @@ -147,7 +141,7 @@ @@ -176,8 +170,7 @@ + @click="handleRowClick(row.id, row.name, row.age)"> {{ row.key }} {{ row.data }} {{ row.planname }} @@ -199,8 +192,7 @@ height: '792px', maxHeight: '792px', boxSizing: 'borderBox', - }" - > + }">
@@ -208,13 +200,8 @@
-   -   + 站厅照明 1区
@@ -236,24 +223,13 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 控制模式 - 手动 - 自动
@@ -273,25 +249,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 亮度 - 100lux - 30lux
@@ -311,25 +276,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 控制场景 - 手动 - 自动 @@ -349,25 +303,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 色温 - 4000k - 3800k @@ -375,13 +318,8 @@
-   -   + 站厅照明 1区
@@ -403,24 +341,13 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 控制模式 - 手动 - 自动
@@ -440,25 +367,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 亮度 - 100lux - 30lux @@ -478,25 +394,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 控制场景 - 手动 - 自动 @@ -516,25 +421,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 色温 - 4000k - 3800k @@ -542,13 +436,8 @@
-   -   + 站厅照明 1区
@@ -570,24 +459,13 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 控制模式 - 手动 - 自动
@@ -607,25 +485,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 亮度 - 100lux - 30lux @@ -645,25 +512,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 控制场景 - 手动 - 自动 @@ -683,25 +539,14 @@ color: rgba(255, 255, 255, 1); font-size: 14px; font-weight: 400; - " - > + "> 色温 - 4000k - 3800k @@ -732,776 +577,768 @@ diff --git a/hx-ai-intelligent/vite.config.ts b/hx-ai-intelligent/vite.config.ts index 2494632..7372520 100644 --- a/hx-ai-intelligent/vite.config.ts +++ b/hx-ai-intelligent/vite.config.ts @@ -12,7 +12,7 @@ const proxy = { changeOrigin: true, }, '/carbon-smart': { - target: 'http://123.60.103.97:8224', + target: 'http://192.168.112.144:8224', changeOrigin: true, rewrite: (path) => path.replace(/^\/carbon-smart/, ''), }, diff --git a/hx-op/src/api/origanizemanage.ts b/hx-op/src/api/origanizemanage.ts index 90a6d9e..e24c073 100644 --- a/hx-op/src/api/origanizemanage.ts +++ b/hx-op/src/api/origanizemanage.ts @@ -10,4 +10,5 @@ export enum enterPrise { freeze = `${BASE_URL}/admin/org/freeze`, getCode = `${BASE_URL}/admin/org/getCode`, queryRootAc = `${BASE_URL}/admin/org/queryRootAc`, + permissionTree = `${BASE_URL}/api/dept/permissionTree`, } diff --git a/hx-op/src/view/organizationManage/enterpriseManage/config.ts b/hx-op/src/view/organizationManage/enterpriseManage/config.ts index 8ff215f..b3363e2 100644 --- a/hx-op/src/view/organizationManage/enterpriseManage/config.ts +++ b/hx-op/src/view/organizationManage/enterpriseManage/config.ts @@ -9,7 +9,13 @@ import { enterPrise } from '/@/api/origanizemanage'; type status = 'NORMAL' | 'FREEZE'; export const formConfig = [ { - field: 'projectId', + field: 'orgId', + label: '企业ID', + component: 'NsInput', + show: false, + }, + { + field: 'orgCode', label: '组织ID', component: 'NsInput', componentProps: { @@ -18,29 +24,21 @@ export const formConfig = [ rules: [ { required: true, - message: '请输入组织编号', - trigger: 'blur', }, ], }, { - field: 'jituanname', + field: 'orgName', label: '企业名称', component: 'NsInput', componentProps: { - placeholder: '请输入企业名称', + placeholder: '请输入', maxLength: 20, }, - rules: [ - { - required: true, - message: '请输入企业名称', - trigger: 'blur', - }, - ], + rules: [{ required: true }], }, { - field: 'jituanname', + field: 'cliqueName', label: '集团名称', component: 'NsInput', componentProps: { @@ -52,10 +50,11 @@ export const formConfig = [ field: 'cityName', label: '省市区', component: 'NsCascader', + fieldMap: ['province', 'city', 'county'], componentProps: { placeholder: '请选择', api: enterPrise.getArea, - fieldNames: { label: 'regionName', value: 'regionCode' }, + fieldNames: { label: 'regionName', value: 'regionName' }, showSearch: true, }, rules: [ @@ -104,11 +103,24 @@ export const formConfig = [ message: '请输入联系电话', trigger: 'blur', }, + { + pattern: /^1[3-9]\d{9}$/, + message: '请输入正确的联系电话', + trigger: 'blur', + }, ], }, ]; -export const tableConfig = (visible) => { +export const tableConfig = ({ + visible, + formData, + opType, + getOrgRandomCode, + borderVisible, + serviceVisible, + server: { getTree }, +}: any) => { return { // title: '企业管理', api: enterPrise.list, @@ -118,6 +130,9 @@ export const tableConfig = (visible) => { name: 'RoleTypeAdd', type: 'primary', handle: () => { + formData.value = {}; + opType.value = 'add'; + getOrgRandomCode && getOrgRandomCode(); visible.value = true; }, }, @@ -135,15 +150,19 @@ export const tableConfig = (visible) => { }, { title: '组织ID', - dataIndex: 'projectId', + dataIndex: 'orgCode', }, { title: '集团名称', dataIndex: 'cliqueName', + textNumber: 8, + textEllipsis: true, }, { title: '组织名称', dataIndex: 'orgName', + textNumber: 8, + textEllipsis: true, }, { title: '状态', @@ -157,12 +176,16 @@ export const tableConfig = (visible) => { dataIndex: 'area', customRender: ({ record }) => { const { province = '', city = '', county = '' } = record; - return `${province}/${city}/${county}`; + const result = [province, city]; + county && result.push(county); + return result.join('/'); }, }, { title: '地址', dataIndex: 'address', + textNumber: 8, + textEllipsis: true, }, { title: '联系人', @@ -181,12 +204,11 @@ export const tableConfig = (visible) => { label: '编辑', name: 'RoleTypeEdit', handle: (record: any) => { - console.log(record, 'record'); + const { province, city, county } = record; formData.value = record; - opMap.type = 'edit'; - opMap.fuc = (formData: any) => { - Object.assign(mockData.value.filter((item) => item.id === record.id)[0], formData); - }; + formData.value.cityName = [province, city]; + county && formData.value.cityName.push(county); + opType.value = 'edit'; visible.value = true; }, }, @@ -201,6 +223,8 @@ export const tableConfig = (visible) => { label: '服务', handle: (record: any) => { console.log(record, 'record'); + const { projectId } = record; + getTree({ projectId: 'beijingDQ' }); serviceVisible.value = true; }, }, @@ -278,28 +302,19 @@ export const tableConfig = (visible) => { formConfig: { schemas: [ { - field: 'zuzhibianhao', + field: 'orgCode', label: '组织ID', component: 'NsInput', - componentProps: { - maxLength: 20, - }, }, { - field: 'jituanname', + field: 'cliqueName', label: '集团名称', component: 'NsInput', - componentProps: { - maxLength: 20, - }, }, { - field: 'zuzhiname', + field: 'orgName', label: '组织名称', component: 'NsInput', - componentProps: { - maxLength: 20, - }, }, { field: 'status', diff --git a/hx-op/src/view/organizationManage/enterpriseManage/index.vue b/hx-op/src/view/organizationManage/enterpriseManage/index.vue index 9f8aa3f..16e8124 100644 --- a/hx-op/src/view/organizationManage/enterpriseManage/index.vue +++ b/hx-op/src/view/organizationManage/enterpriseManage/index.vue @@ -5,54 +5,38 @@ - - 新增 - 新增子集新增 + 新增子集 - + - - + - - - - 取消 - 确定 - + + @@ -85,52 +69,114 @@ const serviceVisible = ref(false); const treeAddVisible = ref(false); const formSchema = formConfig; + const opType = ref('add'); + const calMap = { + add: enterPrise.save, + edit: enterPrise.edit, + }; + const comApi = computed(() => { + return calMap[opType.value as keyof typeof calMap]; + }); const tableConfig = computed(() => { - return insertConfig(visible); + return insertConfig({ + visible, + formData, + opType, + getOrgRandomCode, + borderVisible, + serviceVisible, + server: { + getTree, + }, + }); }); const getOrgRandomCode = () => { http.post(enterPrise.getCode).then((res) => { - formData.value.projectId = res.data; + formData.value.orgCode = res.data; }); }; getOrgRandomCode(); - // drawer form - const opMap: any = { - type: 'add', - fuc: () => {}, - record: {}, + const onClose = () => { + visible.value = false; + borderVisible.value = false; + serviceVisible.value = false; }; - watch(checkedKeys, () => { - console.log('checkedKeys', checkedKeys.value); + // 企业表单drawer + const addDrawerConfig = ref({ + width: '520', + visible: visible, + footerStyle: { textAlign: 'right' }, + destroyOnClose: true, + onClose: onClose, }); - const handleSelect = (selectedKeys: any, info: any) => { - console.log(selectedKeys, 'selectedKeys'); - console.log(info, 'info'); + const formDisabled = computed(() => { + return formRef.value?.validateResult; + }); + + //企业表单数据操作 + const operateForm = () => { + formRef.value?.triggerSubmit().then((res) => { + console.log(formData.value, 'formData.value'); + http.post(comApi.value, res).then(() => { + NsMessage.success('操作成功'); + visible.value = false; + mainRef.value?.nsTableRef.reload(); + }); + }); }; + // 服务操作逻辑区域 + const serverOK = () => { + serviceVisible.value = false; + }; const ServiceSelect = (selectedKeys: any, info: any) => { console.log(selectedKeys, 'selectedKeys'); console.log(info, 'info'); }; - const onClose = () => { - visible.value = false; - borderVisible.value = false; - serviceVisible.value = false; + const serverTree = ref({ + checkable: true, + onSelect: ServiceSelect, + defaultExpandAll: true, + treeData: treeData, + fieldNames: { children: 'menus', title: 'label', key: 'code' }, + }); + + const getTree = (params) => { + http.post(enterPrise.permissionTree, params).then((res) => { + treeData.value = res.data.data; + }); }; - const addDrawerConfig = ref({ - width: '520', - visible: visible, + // 开通服务模块drawer + const serverDrawer = ref({ + width: '450', + visible: serviceVisible, footerStyle: { textAlign: 'right' }, - destroyOnClose: true, - onClose: onClose, + ok: serverOK, + cancel: onClose, }); + // drawer form + const opMap: any = { + type: 'add', + fuc: () => {}, + record: {}, + }; + + watch(checkedKeys, () => { + console.log('checkedKeys', checkedKeys.value); + }); + + const handleSelect = (selectedKeys: any, info: any) => { + console.log(selectedKeys, 'selectedKeys'); + console.log(info, 'info'); + }; + const borderAdd = () => { treeAddVisible.value = true; treeAdd.value?.toggle(); @@ -140,18 +186,6 @@ treeAddVisible.value = true; }; - const onEdit = () => { - formRef.value?.triggerSubmit().then(() => { - console.log(formData.value, 'formData.value'); - opMap.fuc && opMap.fuc(formData.value); - visible.value = false; - }); - }; - - const Sure = () => { - serviceVisible.value = false; - }; - const editTree = (title: any, key: any) => { console.log(title, 'title'); console.log(key, 'key'); diff --git a/lib/util/http/axios.ts b/lib/util/http/axios.ts index 792fdfb..e66a843 100644 --- a/lib/util/http/axios.ts +++ b/lib/util/http/axios.ts @@ -74,7 +74,7 @@ export class NSAxios { } return config; }, undefined); - const errCodeArr = [13, 1, 3005]; + const errCodeMap = new Map([ [13, ''], [1, ''], @@ -91,7 +91,7 @@ export class NSAxios { NsMessage.error({ content: msg, key: this.errorMsgKey, - onClose: JSON.parse(errCodeMap.get(code)!), + onClose: errCodeMap.get(code) && JSON.parse(errCodeMap.get(code)!)(), }); return Promise.reject(res); }