Răsfoiți Sursa

物联网模块

cz 2 ani în urmă
părinte
comite
e7c2deac7e

+ 107 - 87
src/views/iot/base/equipment/index.vue

@@ -92,46 +92,19 @@ let rules = ref({
   ],
 });
 const { proxy } = getCurrentInstance();
-const selectConfig = computed(() => {
-  return [
-    {
-      label: "行业名称",
-      prop: "flowStatus",
-      data: [
-        {
-          label: "审核中",
-          value: "1",
-        },
-        {
-          label: "审核通过",
-          value: "2",
-        },
-        {
-          label: "审核不通过",
-          value: "3",
-        },
-      ],
-    },
-    {
-      label: "产品名称",
-      prop: "flowStatus",
-      data: [
-        {
-          label: "审核中",
-          value: "1",
-        },
-        {
-          label: "审核通过",
-          value: "2",
-        },
-        {
-          label: "审核不通过",
-          value: "3",
-        },
-      ],
-    },
-  ];
-});
+const selectConfig = reactive([
+  {
+    label: "行业名称",
+    prop: "flowStatus",
+    data: [],
+  },
+  {
+    label: "产品名称",
+    prop: "flowStatus",
+    data: [],
+  },
+]);
+
 const config = computed(() => {
   return [
     {
@@ -228,52 +201,61 @@ const formOption = reactive({
 });
 const byform = ref(null);
 const treeData = ref([]);
-const formConfig = computed(() => {
-  return [
-    {
-      type: "select",
-      prop: "tdaProductId",
-      label: "行业名称",
-      required: true,
-      data: [
-        {
-          name: "aaa", //title || name 是显示的字段名称
-          value: "11", //value || id 是选择的字段值
-        },
-      ],
-    },
-    {
-      type: "select",
-      prop: "productId",
-      label: "产品名称",
-      required: true,
-      data: [
-        {
-          name: "aaa", //title || name 是显示的字段名称
-          value: "11", //value || id 是选择的字段值
-        },
-      ],
-    },
-    {
-      type: "input",
-      prop: "deviceName",
-      label: "设备名称",
-      required: true,
-    },
-    {
-      type: "input",
-      prop: "nodeId",
-      label: "设备标识",
-      required: true,
-    },
-    {
-      type: "input",
-      prop: "secret",
-      label: "密钥",
-      required: true,
-    },
-  ];
-});
+const formConfig = reactive([
+  {
+    type: "select",
+    prop: "copyTdaProductId",
+    label: "行业名称",
+    required: true,
+    // isLoad: {
+    //   url: "/tdaApplication/page",
+    //   req: {
+    //     pageNum: 1,
+    //     pageSize: 9999,
+    //   },
+    //   labelKey: "appName",
+    //   labelVal: "id",
+    //   method: "post",
+    //   resUrl: "rows",
+    // },
+  },
+  {
+    type: "select",
+    prop: "tdaProductId",
+    label: "产品名称",
+    required: true,
+    data: [],
+  },
+  //  isLoad: {
+  //   url: "/tdaProduct/page",
+  //   req: {
+  //     pageNum: 1,
+  //     pageSize: 9999,
+  //   },
+  //   labelKey: "name",
+  //   labelVal: "id",
+  //   method: "post",
+  //   resUrl: "rows",
+  // },
+  {
+    type: "input",
+    prop: "deviceName",
+    label: "设备名称",
+    required: true,
+  },
+  {
+    type: "input",
+    prop: "nodeId",
+    label: "设备标识",
+    required: true,
+  },
+  {
+    type: "input",
+    prop: "secret",
+    label: "密钥",
+    required: true,
+  },
+]);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -331,7 +313,6 @@ const submitForm = () => {
   console.log(byform.value);
   byform.value.handleSubmit((valid) => {
     submitLoading.value = true;
-
     proxy.post("/tdaDevice/" + modalType.value, formData.data).then((res) => {
       ElMessage({
         message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -353,7 +334,46 @@ const getDtl = (row) => {
   });
 };
 
+const selectData = reactive({
+  tradeList: [],
+});
+const getSelect = () => {
+  proxy
+    .post("/tdaApplication/page", { pageNum: 1, pageSize: 9999 })
+    .then((message) => {
+      selectData.tradeList = message.rows;
+      formConfig[0].data = selectData.tradeList.map((x) => ({
+        title: x.appName,
+        value: x.id,
+      }));
+      // formConfig[1].data = selectData.tradeList.map((x) => ({
+      //   title: x.name,
+      //   value: x.id,
+      // }));
+    });
+};
+
+watch(
+  () => formData.data.copyTdaProductId,
+  (val, old) => {
+    if (val) {
+      proxy
+        .post("/tdaProduct/page", {
+          pageNum: 1,
+          pageSize: 9999,
+          tdaApplicationId: val,
+        })
+        .then((res) => {
+          formConfig[1].data = res.rows.map((x) => ({
+            title: x.name,
+            value: x.id,
+          }));
+        });
+    }
+  }
+);
 getList();
+getSelect();
 </script>
   
 <style lang="scss" scoped>

+ 87 - 95
src/views/iot/base/product/index.vue

@@ -75,60 +75,32 @@ let dialogVisible = ref(false);
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  tenantId: [
+  tdaApplicationId: [
     { required: true, message: "请选择行业名称", trigger: ["blur", "change"] },
   ],
-  tenantId: [
+  name: [
     { required: true, message: "请输入产品名称", trigger: ["blur", "change"] },
   ],
-  tenantId: [
+  manufacturerName: [
     { required: true, message: "请选择厂商名称", trigger: ["blur", "change"] },
   ],
-  tenantId: [
+  deviceType: [
     { required: true, message: "请选择设备类型", trigger: ["blur", "change"] },
   ],
 });
 const { proxy } = getCurrentInstance();
-const selectConfig = computed(() => {
-  return [
-    {
-      label: "行业名称",
-      prop: "flowStatus",
-      data: [
-        {
-          label: "审核中",
-          value: "1",
-        },
-        {
-          label: "审核通过",
-          value: "2",
-        },
-        {
-          label: "审核不通过",
-          value: "3",
-        },
-      ],
-    },
-    {
-      label: "厂商名称",
-      prop: "flowStatus",
-      data: [
-        {
-          label: "审核中",
-          value: "1",
-        },
-        {
-          label: "审核通过",
-          value: "2",
-        },
-        {
-          label: "审核不通过",
-          value: "3",
-        },
-      ],
-    },
-  ];
-});
+const selectConfig = reactive([
+  {
+    label: "行业名称",
+    prop: "id",
+    data: [],
+  },
+  {
+    label: "厂商名称",
+    prop: "id",
+    data: [],
+  },
+]);
 const config = computed(() => {
   return [
     {
@@ -232,56 +204,54 @@ const formOption = reactive({
 });
 const byform = ref(null);
 const treeData = ref([]);
-const formConfig = computed(() => {
-  return [
-    {
-      type: "select",
-      prop: "appId",
-      label: "行业名称",
-      required: true,
-      data: [
-        {
-          name: "aaa", //title || name 是显示的字段名称
-          value: "11", //value || id 是选择的字段值
-        },
-      ],
-    },
-    {
-      type: "input",
-      prop: "name",
-      label: "产品名称",
-      required: true,
-      itemWidth: 100,
-      itemType: "text",
-    },
-    {
-      type: "select",
-      prop: "protocolType",
-      label: "协议类型",
-      disabled: true,
-      required: true,
-    },
-    {
-      type: "select",
-      prop: "dataFormat",
-      label: "数据格式",
-      disabled: true,
-      required: true,
-    },
-    {
-      type: "select",
-      prop: "manufacturerName",
-      label: "厂商名称",
-      required: true,
-    },
-    {
-      type: "select",
-      prop: "deviceType",
-      label: "设备类型",
-      required: true,
-    },
-  ];
-});
+const formConfig = reactive([
+  {
+    type: "select",
+    prop: "tdaApplicationId",
+    label: "行业名称",
+    required: true,
+    data: [
+      {
+        name: "aaa", //title || name 是显示的字段名称
+        value: "11", //value || id 是选择的字段值
+      },
+    ],
+  },
+  {
+    type: "input",
+    prop: "name",
+    label: "产品名称",
+    required: true,
+    itemWidth: 100,
+    itemType: "text",
+  },
+  {
+    type: "select",
+    prop: "protocolType",
+    label: "协议类型",
+    disabled: true,
+    required: true,
+  },
+  {
+    type: "select",
+    prop: "dataFormat",
+    label: "数据格式",
+    disabled: true,
+    required: true,
+  },
+  {
+    type: "input",
+    prop: "manufacturerName",
+    label: "厂商名称",
+    required: true,
+  },
+  {
+    type: "input",
+    prop: "deviceType",
+    label: "设备类型",
+    required: true,
+  },
+]);
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
@@ -299,7 +269,10 @@ const getList = async (req) => {
 const openModal = () => {
   dialogVisible.value = true;
   modalType.value = "add";
-  formData.data = {};
+  formData.data = {
+    protocolType: "MQTT",
+    dataFormat: "JSON",
+  };
 };
 const selection = ref({
   data: [],
@@ -361,8 +334,27 @@ const getDtl = (row) => {
     dialogVisible.value = true;
   });
 };
+const selectData = reactive({
+  tradeList: [],
+});
+const getSelect = () => {
+  proxy
+    .post("/tdaApplication/page", { pageNum: 1, pageSize: 9999 })
+    .then((message) => {
+      selectData.tradeList = message.rows;
+      selectConfig[0].data = selectData.tradeList.map((x) => ({
+        label: x.appName,
+        value: x.id,
+      }));
+      formConfig[0].data = selectData.tradeList.map((x) => ({
+        title: x.appName,
+        value: x.id,
+      }));
+    });
+};
 
 getList();
+getSelect();
 </script>
   
 <style lang="scss" scoped>

+ 33 - 34
src/views/production/factory/farm/index.vue

@@ -72,35 +72,32 @@ const sourceList = ref({
   },
 });
 let dialogVisible = ref(false);
-let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
   name: [{ required: true, message: "请选择车间类型", trigger: "change" }],
   endPoint: [{ required: true, message: "请输入车间名称", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
-const selectConfig = computed(() => {
-  return [
-    {
-      label: "车间类型",
-      prop: "flowStatus",
-      data: [
-        {
-          label: "审核中",
-          value: "1",
-        },
-        {
-          label: "审核通过",
-          value: "2",
-        },
-        {
-          label: "审核不通过",
-          value: "3",
-        },
-      ],
-    },
-  ];
-});
+const selectConfig = reactive([
+  {
+    label: "车间类型",
+    prop: "flowStatus",
+    data: [
+      {
+        label: "审核中",
+        value: "1",
+      },
+      {
+        label: "审核通过",
+        value: "2",
+      },
+      {
+        label: "审核不通过",
+        value: "3",
+      },
+    ],
+  },
+]);
 const config = computed(() => {
   return [
     {
@@ -197,7 +194,6 @@ let formData = reactive({
   data: {
     type: "1",
   },
-  treeData: [],
 });
 const formOption = reactive({
   inline: true,
@@ -206,7 +202,6 @@ const formOption = reactive({
   rules: [],
 });
 const byform = ref(null);
-const treeData = ref([]);
 const formConfig = computed(() => {
   return [
     {
@@ -214,7 +209,17 @@ const formConfig = computed(() => {
       prop: "name",
       label: "车间类型",
       required: true,
-      data: [],
+      isLoad: {
+        url: "/tdaApplication/page",
+        req: {
+          pageNum: 1,
+          pageSize: 9999,
+        },
+        labelKey: "appName",
+        labelVal: "id",
+        method: "post",
+        resUrl: "rows",
+      },
     },
     {
       type: "input",
@@ -253,13 +258,7 @@ const openModal = () => {
   modalType.value = "add";
   formData.data = {};
 };
-const selection = ref({
-  data: [],
-});
-const select = (_selection, row) => {
-  selection.value.data = _selection;
-  console.log(_selection.length);
-};
+
 const submitForm = () => {
   console.log(byform.value);
   byform.value.handleSubmit((valid) => {
@@ -285,7 +284,7 @@ const getDtl = (row) => {
   });
 };
 
-// getList();
+getList();
 </script>
   
 <style lang="scss" scoped>

+ 388 - 385
src/views/system/dept2/index.vue

@@ -1,424 +1,427 @@
 <template>
-	<div class="dept">
-		<div class="tree">
-			<treeList
-				:data="treeListData"
-				v-model="sourceList.pagination.tenantId"
-				node-key="id"
-				@change="treeChange"
-			>
-			</treeList>
-		</div>
-		<div class="content">
-			<byTable
-				:source="sourceList.data"
-                :hidePagination="true"
-				:config="config"
-				:loading="loading"
-				highlight-current-row
-				:selectConfig="selectConfig"
-				:table-events="{
-					//element talbe事件都能传
-					select: select,
-				}"
-				:action-list="[
-					{
-						text: '添加机构',
-						action: () => openModal('add'),
-                        disabled:!sourceList.pagination.tenantId
-					},
-				]"
-				@get-list="getList"
-			>
-				<template #slotName="{ item }">
-					{{ item.createTime }}
-				</template>
-			</byTable>
-		</div>
-		<el-dialog
-			:title="modalType == 'add' ? '新增' : '编辑'"
-			v-model="dialogVisible"
-			width="500"
-			v-loading="loading"
-		>
-			<byForm
-				:formConfig="formConfig"
-				:formOption="formOption"
-				v-model="formData.data"
-				:rules="rules"
-				ref="byform"
-			>
-                <template #account>
-                    <el-input style="width:150px;margin-right: 10px;" v-model="formData.data.userName" placeholder="请输入用户名"></el-input>
-                    <el-input style="width:150px;margin-right: 10px;" v-model="formData.data.password" placeholder="密码"></el-input>
-                    <span style="color:#409EFF;cursor: pointer;" @click="newPassword">随机生成</span>
-                </template>
-			</byForm>
-			<template #footer>
-				<el-button @click="dialogVisible = false" size="large"
-					>取 消</el-button
-				>
-				<el-button
-					type="primary"
-					@click="submitForm('byform')"
-					size="large"
-					:loading="submitLoading"
-				>
-					确 定
-				</el-button>
-			</template>
-		</el-dialog>
-		<el-dialog
-			title="修改密码"
-			v-model="roomDialogVisible"
-			width="500"
-			:before-close="handleClose"
-			v-loading="loading"
-		>
-			<template #footer>
-				<el-button @click="roomDialogVisible = false" size="large"
-					>取 消</el-button
-				>
-				<el-button
-					type="primary"
-					@click="submitTree('byform')"
-					size="large"
-					:loading="submitLoading"
-				>
-					确 定
-				</el-button>
-			</template>
-		</el-dialog>
-	</div>
+  <div class="dept">
+    <div class="tree">
+      <treeList
+        :data="treeListData"
+        v-model="sourceList.pagination.tenantId"
+        node-key="id"
+        @change="treeChange"
+      >
+      </treeList>
+    </div>
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :hidePagination="true"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[
+          {
+            text: '添加机构',
+            action: () => openModal('add'),
+            disabled: !sourceList.pagination.tenantId,
+          },
+        ]"
+        @get-list="getList"
+      >
+        <template #slotName="{ item }">
+          {{ item.createTime }}
+        </template>
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '新增' : '编辑'"
+      v-model="dialogVisible"
+      width="500"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+        <template #account>
+          <el-input
+            style="width: 150px; margin-right: 10px"
+            v-model="formData.data.userName"
+            placeholder="请输入用户名"
+          ></el-input>
+          <el-input
+            style="width: 150px; margin-right: 10px"
+            v-model="formData.data.password"
+            placeholder="密码"
+          ></el-input>
+          <span style="color: #409eff; cursor: pointer" @click="newPassword"
+            >随机生成</span
+          >
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+    <el-dialog
+      title="修改密码"
+      v-model="roomDialogVisible"
+      width="500"
+      :before-close="handleClose"
+      v-loading="loading"
+    >
+      <template #footer>
+        <el-button @click="roomDialogVisible = false" size="large"
+          >取 消</el-button
+        >
+        <el-button
+          type="primary"
+          @click="submitTree('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
 </template>
   
 <script setup>
 /* eslint-disable vue/no-unused-components */
-import { ElMessage, ElMessageBox } from 'element-plus'
-import byTable from '@/components/byTable/index'
-import byForm from '@/components/byForm/index'
-import treeList from '@/components/treeList/index'
-import { computed, defineComponent, ref } from 'vue'
-const loading = ref(false)
-const submitLoading = ref(false)
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import treeList from "@/components/treeList/index";
+import { computed, defineComponent, ref } from "vue";
+const loading = ref(false);
+const submitLoading = ref(false);
 const sourceList = ref({
-	data: [],
-	pagination: {
-		total: 3,
-		pageNum: 1,
-		pageSize: 10,
-	},
-})
-let dialogVisible = ref(false)
-let modalType = ref('add')
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let modalType = ref("add");
 let rules = ref({
-	roleKey: [{ required: true, message: '请选择部门', trigger: 'blur' }],
-    nickName: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
-    userName:[{ required: true, message: '用户名不能为空', trigger: 'blur' }],
-})
-const { proxy } = getCurrentInstance()
+  roleKey: [{ required: true, message: "请选择部门", trigger: "blur" }],
+  nickName: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
+  userName: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
 const selectConfig = computed(() => {
-	return []
-})
+  return [];
+});
 const config = computed(() => {
-	return [
-		{
-			attrs: {
-				label: '机构名称',
-				prop: 'deptName',
-			},
-		},
-		{
-			attrs: {
-				label: '机构类型',
-				prop: 'userName',
-				align: 'left',
-			},
-		},
-		{
-			attrs: {
-				label: '排序',
-				prop: 'nickName',
-			},
-		},
-		{
-			attrs: {
-				label: '创建时间',
-				prop: 'remark',
-			},
-		},
-		{
-			attrs: {
-				label: '操作',
-				width: '200',
-				align: 'right',
-			},
-			// 渲染 el-button,一般用在最后一列。
-			renderHTML(row) {
-				return [
-					{
-						attrs: {
-							label: '修改',
-							type: 'primary',
-							text: true,
-						},
-						el: 'button',
-						click() {
-							getDtl(row)
-						},
-					},
-					{
-						attrs: {
-							label: '删除',
-							type: 'danger',
-							text: true,
-						},
-						el: 'button',
-						click() {
-							// 弹窗提示是否删除
-							ElMessageBox.confirm(
-								'此操作将永久删除该数据, 是否继续?',
-								'提示',
-								{
-									confirmButtonText: '确定',
-									cancelButtonText: '取消',
-									type: 'warning',
-								}
-							).then(() => {
-								// 删除
-								proxy
-									.post(
-										'/tenantUser/' + row.userId,
-										{
-											id: row.userId,
-										},
-										'delete'
-									)
-									.then((res) => {
-										ElMessage({
-											message: '删除成功',
-											type: 'success',
-										})
-										getList()
-									})
-							})
-						},
-					},
-				]
-			},
-		},
-	]
-})
+  return [
+    {
+      attrs: {
+        label: "机构名称",
+        prop: "deptName",
+      },
+    },
+    {
+      attrs: {
+        label: "机构类型",
+        prop: "userName",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "排序",
+        prop: "nickName",
+      },
+    },
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "remark",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "danger",
+              text: true,
+            },
+            el: "button",
+            click() {
+              // 弹窗提示是否删除
+              ElMessageBox.confirm(
+                "此操作将永久删除该数据, 是否继续?",
+                "提示",
+                {
+                  confirmButtonText: "确定",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                }
+              ).then(() => {
+                // 删除
+                proxy
+                  .post(
+                    "/tenantUser/" + row.userId,
+                    {
+                      id: row.userId,
+                    },
+                    "delete"
+                  )
+                  .then((res) => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
 
 let formData = reactive({
-	data: {},
-})
+  data: {},
+});
 const formOption = reactive({
-	inline: true,
-	labelWidth: 100,
-	itemWidth: 100,
-	rules: [],
-})
-const byform = ref(null)
-const treeListData = ref([])
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const byform = ref(null);
+const treeListData = ref([]);
 const formConfig = computed(() => {
-	return [
-		{
-			type: 'treeSelect',
-			prop: 'parentId',
-			label: '上级机构',
-			data: [],
-		},
-		{
-			type: 'input',
-			prop: 'deptName',
-			label: '机构名称',
-			required: true,
-			itemWidth: 50,
-			//disabled:true,
-			itemType: 'text',
-		},
-        
-		{
-			type: 'select',
-			prop: 'type',
-			label: '机构类型',
-			required: true,
-			
-			data: [
-				{
-					label: '公司',
-					id: 0,
-				},
-				{
-					label: '业务中心',
-					id: 1,
-				},
-                {
-					label: '部门',
-					id: 2,
-				},
-                {
-					label: '组',
-					id: 3,
-				},
-			],
-		},
-		{
-			type: 'select',
-			label: '负责人',
-			prop: 'leaderId',
-            itemWidth: 50,
-			isLoad: {
-				url: '/tenantUser/list?pageNum=1&pageSize=10000',
-				labelKey: 'userName',
-				labelVal: 'userId',
-				method: 'get',
-				resUrl: 'rows',
-			},
-		},
+  return [
+    {
+      type: "treeSelect",
+      prop: "parentId",
+      label: "上级机构",
+      data: [],
+    },
+    {
+      type: "input",
+      prop: "deptName",
+      label: "机构名称",
+      required: true,
+      itemWidth: 50,
+      //disabled:true,
+      itemType: "text",
+    },
+
+    {
+      type: "select",
+      prop: "type",
+      label: "机构类型",
+      required: true,
+
+      data: [
+        {
+          label: "公司",
+          id: 0,
+        },
         {
-			type: 'select',
-			label: '总监',
-			prop: 'directorId',
-            itemWidth: 50,
-			isLoad: {
-				url: '/tenantUser/list?pageNum=1&pageSize=10000',
-				labelKey: 'userName',
-				labelVal: 'userId',
-				method: 'get',
-				resUrl: 'rows',
-			},
-		},
-		{
-			type: 'input',
-			prop: 'orderNum',
-			label: '排序',
-			required: true,
-			itemWidth: 50,
-			//disabled:true,
-			itemType: 'number',
-		},
-	]
-})
+          label: "业务中心",
+          id: 1,
+        },
+        {
+          label: "部门",
+          id: 2,
+        },
+        {
+          label: "组",
+          id: 3,
+        },
+      ],
+    },
+    {
+      type: "select",
+      label: "负责人",
+      prop: "leaderId",
+      itemWidth: 50,
+      isLoad: {
+        url: "/tenantUser/list?pageNum=1&pageSize=10000",
+        labelKey: "userName",
+        labelVal: "userId",
+        method: "get",
+        resUrl: "rows",
+      },
+    },
+    {
+      type: "select",
+      label: "总监",
+      prop: "directorId",
+      itemWidth: 50,
+      isLoad: {
+        url: "/tenantUser/list?pageNum=1&pageSize=10000",
+        labelKey: "userName",
+        labelVal: "userId",
+        method: "get",
+        resUrl: "rows",
+      },
+    },
+    {
+      type: "input",
+      prop: "orderNum",
+      label: "排序",
+      required: true,
+      itemWidth: 50,
+      //disabled:true,
+      itemType: "number",
+    },
+  ];
+});
 const newPassword = () => {
-    formData.data.password = generatePassword()
-}
+  formData.data.password = generatePassword();
+};
 const generatePassword = () => {
-    var length = 12,
-      charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
-      password = "";
-    for (var i = 0, n = charset.length; i < length; ++i) {
-        password += charset.charAt(Math.floor(Math.random() * n));
-    }
-    return password;
-}
+  var length = 12,
+    charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+    password = "";
+  for (var i = 0, n = charset.length; i < length; ++i) {
+    password += charset.charAt(Math.floor(Math.random() * n));
+  }
+  return password;
+};
 
 const getTreeList = () => {
-	proxy.post('/tenantInfo/list').then((message) => {
-		message.map((item) => {
-			item.label = item.enterpriseName
-			item.id = item.tenantId
-			item.children = []
-		})
-		
-		treeListData.value = message
-		console.log(treeListData.value)
-	})
+  proxy.post("/tenantInfo/list").then((message) => {
+    message.map((item) => {
+      item.label = item.enterpriseName;
+      item.id = item.tenantId;
+      item.children = [];
+    });
 
-}
+    treeListData.value = message;
+    console.log(treeListData.value);
+  });
+};
 const getList = async (req) => {
-	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
-	loading.value = true
-	proxy
-		.get('/tenantDept/list', sourceList.value.pagination)
-		.then((message) => {
-            recursive(message.data)
-			sourceList.value.data = message.data
-            formConfig.value[0].data = message.data
-			setTimeout(() => {
-				loading.value = false
-			}, 200)
-		})
-}
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.get("/tenantDept/list", sourceList.value.pagination).then((message) => {
+    recursive(message.data);
+    sourceList.value.data = message.data;
+    formConfig.value[0].data = message.data;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
 
 const treeChange = (e) => {
-	sourceList.value.pagination.tenantId = e.id
-	getList({ tenantId: e.id })
-}
+  sourceList.value.pagination.tenantId = e.id;
+  getList({ tenantId: e.id });
+};
 
 const openModal = () => {
-	dialogVisible.value = true
-	modalType.value = 'add'
-	formData.data = {}
-}
-const TreetenantId = ref('')
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {};
+};
+const TreetenantId = ref("");
 const selection = ref({
-	data: [],
-})
+  data: [],
+});
 
 const select = (_selection, row) => {
-	selection.value.data = _selection
-	console.log(_selection.length)
-}
+  selection.value.data = _selection;
+  console.log(_selection.length);
+};
 
-const tree = ref(null)
+const tree = ref(null);
 const submitForm = () => {
-	byform.value.handleSubmit((valid) => {
-		const method = modalType.value == 'add' ? 'POST' : 'PUT'
-		console.log(method)
-		proxy
-			.post(
-				'/tenantDept',
-				{
-					...formData.data,
-					tenantId: sourceList.value.pagination.tenantId,
-				},
-				method
-			)
-			.then((res) => {
-				ElMessage({
-					message: modalType.value == 'add' ? '添加成功' : '编辑成功',
-					type: 'success',
-				})
-				dialogVisible.value = false
-				getList()
-			})
-	})
-}
+  byform.value.handleSubmit((valid) => {
+    const method = modalType.value == "add" ? "POST" : "PUT";
+    console.log(method);
+    proxy
+      .post(
+        "/tenantDept",
+        {
+          ...formData.data,
+          tenantId: sourceList.value.pagination.tenantId,
+        },
+        method
+      )
+      .then((res) => {
+        ElMessage({
+          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        getList();
+      });
+  });
+};
 
 const recursive = (data) => {
-    data.map((item) => {
-        item.label = item.deptName
-        item.id = item.deptId
-        if (item.children) {
-            recursive(item.children)
-        }
-    })
-}
-
+  data.map((item) => {
+    item.label = item.deptName;
+    item.id = item.deptId;
+    if (item.children) {
+      recursive(item.children);
+    }
+  });
+};
 
 const getDtl = (row) => {
-	formData.data = {...row}
-	modalType.value = 'edit'
-	console.log(modalType.value)
-	dialogVisible.value = true
-}
-getTreeList()
-getList()
-
+  formData.data = { ...row };
+  modalType.value = "edit";
+  console.log(modalType.value);
+  dialogVisible.value = true;
+};
+getTreeList();
+getList();
 </script>
   
 <style lang="scss" scoped>
 .dept {
-	padding: 20px;
-	display: flex;
-	justify-content: space-between;
-	.tree {
-		width: 300px;
-	}
-	.content {
-		width: calc(100% - 320px);
-	}
+  padding: 20px;
+  display: flex;
+  justify-content: space-between;
+  .tree {
+    width: 300px;
+  }
+  .content {
+    width: calc(100% - 320px);
+  }
 }
 </style>