lxf 1 rok temu
rodzic
commit
26cf074226

+ 41 - 46
src/views/system/dept2/index.vue

@@ -46,9 +46,9 @@
         </el-table-column>
         <el-table-column :label="$t('common.operation')" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
-            <el-button link type="primary" @click="getDtl(scope.row)">{{$t('common.edit')}}</el-button>
-            <el-button link type="primary" @click="handleAdd(scope.row)">{{$t('common.add')}}</el-button>
-            <el-button v-if="scope.row.parentId != 0" link type="primary" @click="listDelete(scope.row)">{{$t('common.delete')}}</el-button>
+            <el-button link type="primary" @click="getDtl(scope.row)">{{ $t("common.edit") }}</el-button>
+            <el-button link type="primary" @click="handleAdd(scope.row)">{{ $t("common.add") }}</el-button>
+            <el-button v-if="scope.row.parentId != 0" link type="primary" @click="listDelete(scope.row)">{{ $t("common.delete") }}</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -58,18 +58,18 @@
         <template #account>
           <el-input style="width: 150px; margin-right: 10px" v-model="formData.data.userName" :placeholder="$t('dept.pleaseEnterTheUsername')"></el-input>
           <el-input style="width: 150px; margin-right: 10px" v-model="formData.data.password" :placeholder="$t('dept.pleaseEnterThePassword')"></el-input>
-          <span style="color: #409eff; cursor: pointer" @click="newPassword">{{$t('dept.randomGeneration')}}</span>
+          <span style="color: #409eff; cursor: pointer" @click="newPassword">{{ $t("dept.randomGeneration") }}</span>
         </template>
       </byForm>
       <template #footer>
-        <el-button @click="dialogVisible = false" size="large">{{$t('common.cancel')}}</el-button>
-        <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">{{$t('common.confirm')}}</el-button>
+        <el-button @click="dialogVisible = false" size="large">{{ $t("common.cancel") }}</el-button>
+        <el-button type="primary" @click="submitForm('byform')" size="large" :loading="submitLoading">{{ $t("common.confirm") }}</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">{{$t('common.cancel')}}</el-button>
-        <el-button type="primary" @click="submitTree('byform')" size="large" :loading="submitLoading">{{$t('common.confirm')}}</el-button>
+        <el-button @click="roomDialogVisible = false" size="large">{{ $t("common.cancel") }}</el-button>
+        <el-button type="primary" @click="submitTree('byform')" size="large" :loading="submitLoading">{{ $t("common.confirm") }}</el-button>
       </template>
     </el-dialog>
   </div>
@@ -96,10 +96,10 @@ const { proxy } = getCurrentInstance();
 let dialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  parentId: [{ required: true, message: proxy.t('dept.pleaseSelectTheParentDept'), trigger: "blur" }],
-  orderNum: [{ required: true, message: proxy.t('dept.serialNumberCannotBeEmpty'), trigger: "blur" }],
-  deptName: [{ required: true, message: proxy.t('dept.deptNameCannotBeEmpty'), trigger: "blur" }],
-  type: [{ required: true, message: proxy.t('dept.deptTypeCannotBeEmpty'), trigger: "change" }],
+  parentId: [{ required: true, message: proxy.t("dept.pleaseSelectTheParentDept"), trigger: "blur" }],
+  orderNum: [{ required: true, message: proxy.t("dept.serialNumberCannotBeEmpty"), trigger: "blur" }],
+  deptName: [{ required: true, message: proxy.t("dept.deptNameCannotBeEmpty"), trigger: "blur" }],
+  type: [{ required: true, message: proxy.t("dept.deptTypeCannotBeEmpty"), trigger: "change" }],
 });
 
 const selectConfig = computed(() => {
@@ -109,13 +109,13 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: proxy.t('dept.deptName'),
+        label: proxy.t("dept.deptName"),
         prop: "deptName",
       },
     },
     {
       attrs: {
-        label: proxy.t('dept.deptType'),
+        label: proxy.t("dept.deptType"),
         prop: "type",
         align: "left",
       },
@@ -126,19 +126,19 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: proxy.t('common.serialNumber'),
+        label: proxy.t("common.serialNumber"),
         prop: "nickName",
       },
     },
     {
       attrs: {
-        label: proxy.t('common.createTime'),
+        label: proxy.t("common.createTime"),
         prop: "createTime",
       },
     },
     {
       attrs: {
-        label: proxy.t('common.operation'),
+        label: proxy.t("common.operation"),
         width: "200",
         align: "right",
       },
@@ -147,7 +147,7 @@ const config = computed(() => {
         return [
           {
             attrs: {
-              label: proxy.t('common.edit'),
+              label: proxy.t("common.edit"),
               type: "primary",
               text: true,
             },
@@ -158,7 +158,7 @@ const config = computed(() => {
           },
           {
             attrs: {
-              label: proxy.t('common.delete'),
+              label: proxy.t("common.delete"),
               type: "danger",
               text: true,
             },
@@ -189,13 +189,13 @@ const formConfig = computed(() => {
     {
       type: "treeSelect",
       prop: "parentId",
-      label: proxy.t('dept.parentDept'),
+      label: proxy.t("dept.parentDept"),
       data: [],
     },
     {
       type: "input",
       prop: "deptName",
-      label: proxy.t('dept.deptName'),
+      label: proxy.t("dept.deptName"),
       required: true,
       itemWidth: 50,
       //disabled:true,
@@ -204,37 +204,37 @@ const formConfig = computed(() => {
     {
       type: "select",
       prop: "type",
-      label: proxy.t('dept.deptType'),
+      label: proxy.t("dept.deptType"),
       required: true,
       data: [
         {
-          label: proxy.t('dept.company'),
+          label: proxy.t("dept.company"),
           value: 0,
         },
         {
-          label: proxy.t('dept.businessCenter'),
+          label: proxy.t("dept.businessCenter"),
           value: 1,
         },
         {
-          label: proxy.t('dept.department'),
+          label: proxy.t("dept.department"),
           value: 2,
         },
         {
-          label: proxy.t('dept.group'),
+          label: proxy.t("dept.group"),
           value: 3,
         },
       ],
     },
     {
       type: "select",
-      label: proxy.t('dept.deptManager'),
+      label: proxy.t("dept.deptManager"),
       prop: "leaderId",
       itemWidth: 50,
       data: [],
     },
     {
       type: "select",
-      label: proxy.t('dept.deptDirector'),
+      label: proxy.t("dept.deptDirector"),
       prop: "directorId",
       itemWidth: 50,
       data: [],
@@ -242,7 +242,7 @@ const formConfig = computed(() => {
     {
       type: "input",
       prop: "orderNum",
-      label: proxy.t('common.serialNumber'),
+      label: proxy.t("common.serialNumber"),
       required: true,
       itemWidth: 50,
       //disabled:true,
@@ -343,7 +343,7 @@ const submitForm = () => {
       )
       .then((res) => {
         ElMessage({
-          message: modalType.value == "add" ? proxy.t('common.addSuccess') : proxy.t('common.editSuccess'),
+          message: modalType.value == "add" ? proxy.t("common.addSuccess") : proxy.t("common.editSuccess"),
           type: "success",
         });
         dialogVisible.value = false;
@@ -366,15 +366,15 @@ const recursive = (data) => {
 
 const listDelete = (row) => {
   // 弹窗提示是否删除
-  ElMessageBox.confirm(proxy.t('common.thisOperationWillPermanentlyDeleteTheData'),proxy.t('common.prompt'), {
-    confirmButtonText: proxy.t('common.confirm'),
-    cancelButtonText: proxy.t('common.cancel'),
+  ElMessageBox.confirm(proxy.t("common.thisOperationWillPermanentlyDeleteTheData"), proxy.t("common.prompt"), {
+    confirmButtonText: proxy.t("common.confirm"),
+    cancelButtonText: proxy.t("common.cancel"),
     type: "warning",
   }).then(() => {
     // 删除
     proxy.post("/tenantDept/" + row.deptId, {}, "delete").then((res) => {
       ElMessage({
-        message: proxy.t('common.deleteSuccess'),
+        message: proxy.t("common.deleteSuccess"),
         type: "success",
       });
       getList();
@@ -382,18 +382,14 @@ const listDelete = (row) => {
   });
 };
 const showType = (type) => {
-  return type == 0 ? 
-    proxy.t('dept.company') : type == 1 ? 
-    proxy.t('dept.businessCenter') : type == 2 ? 
-    proxy.t('dept.department') : 
-    proxy.t('dept.group');
+  return type == 0 ? proxy.t("dept.company") : type == 1 ? proxy.t("dept.businessCenter") : type == 2 ? proxy.t("dept.department") : proxy.t("dept.group");
 };
 const getDtl = (row) => {
   formData.data = { ...row };
   sourceList.value.pagination.tenantId = row.tenantId;
-  getUserList()
+  getUserList();
   modalType.value = "edit";
-  
+
   dialogVisible.value = true;
 };
 
@@ -410,13 +406,11 @@ const getUserList = () => {
         item.id = item.userId;
       });
       message.rows.unshift({
-        label:'无',
-        id:'',
-      })
+        label: "无",
+        id: "",
+      });
       formConfig.value[3].data = message.rows;
       formConfig.value[4].data = message.rows;
-      
-      
     });
 };
 getUserList();
@@ -429,6 +423,7 @@ getList();
   padding: 20px;
   display: flex;
   justify-content: space-between;
+  background-color: white;
   .tree {
     width: 300px;
   }

+ 34 - 45
src/views/system/feedback/index.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="feedback">
-    
     <div class="content">
       <byTable
         :source="sourceList.data"
@@ -27,9 +26,7 @@
       </byTable>
     </div>
     <el-dialog :title="modalType == 'add' ? '添加反馈' : '编辑反馈'" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
-      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform">
-        
-      </byForm>
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="byform"> </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>
@@ -72,10 +69,10 @@ const validatePass = (rule, value, callback) => {
   }
 };
 let rules = ref({
-  name: [{ required: true, message: '请填写姓名' }],
-	companyName: [{ required: true, message: '请填写公司名称' }],
-	contactInformation: [{ required: true, message: '请填写联系方式' }],
-	problemStatement: [{ required: true, message: '请填写备注' }],
+  name: [{ required: true, message: "请填写姓名" }],
+  companyName: [{ required: true, message: "请填写公司名称" }],
+  contactInformation: [{ required: true, message: "请填写联系方式" }],
+  problemStatement: [{ required: true, message: "请填写备注" }],
 });
 
 const userId = ref("");
@@ -138,7 +135,6 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              
               getDtl(row);
             },
           },
@@ -228,8 +224,6 @@ const formConfig = computed(() => {
       required: true,
       itemType: "textarea",
     },
-
-    
   ];
 });
 const newPassword = () => {
@@ -262,28 +256,28 @@ const getList = async (req) => {
 
 //递归获取路由数据,初始化
 const getRouterData = (data) => {
-	data.forEach((item) => {
-		item.label = item.meta.title
-    item.id = item.meta.title
-		if (item.children && item.children.length > 0) {
-			getRouterData(item.children)
-		}
-	})
-}
+  data.forEach((item) => {
+    item.label = item.meta.title;
+    item.id = item.meta.title;
+    if (item.children && item.children.length > 0) {
+      getRouterData(item.children);
+    }
+  });
+};
 
 const getRouter = () => {
-	proxy.get('getRouters', {}).then((res) => {
-    console.log(res.data)
-		getRouterData(res.data)
-		for (let i = 0; i < res.data.length; i++) {
-			const element = res.data[i]
-			if (element.type == 2) {
-				formConfig.value[1].data = element.children
-			}
-		}
-	})
-}
-getRouter()
+  proxy.get("getRouters", {}).then((res) => {
+    console.log(res.data);
+    getRouterData(res.data);
+    for (let i = 0; i < res.data.length; i++) {
+      const element = res.data[i];
+      if (element.type == 2) {
+        formConfig.value[1].data = element.children;
+      }
+    }
+  });
+};
+getRouter();
 
 const openModal = () => {
   dialogVisible.value = true;
@@ -305,13 +299,10 @@ const tree = ref(null);
 const submitForm = () => {
   byform.value.handleSubmit((valid) => {
     proxy
-      .post(
-        "/problemFeedback/" + modalType.value,
-        {
-          ...formData.data,
-          tenantId: sourceList.value.pagination.tenantId,
-        },
-      )
+      .post("/problemFeedback/" + modalType.value, {
+        ...formData.data,
+        tenantId: sourceList.value.pagination.tenantId,
+      })
       .then((res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -362,10 +353,10 @@ const submitPassword = (password1) => {
 };
 
 const getDtl = (row) => {
-  formData.data = { ...row};
-    modalType.value = "edit";
-    console.log(modalType.value);
-    dialogVisible.value = true;
+  formData.data = { ...row };
+  modalType.value = "edit";
+  console.log(modalType.value);
+  dialogVisible.value = true;
 };
 getList();
 </script>
@@ -375,9 +366,7 @@ getList();
   padding: 20px;
   display: flex;
   justify-content: space-between;
-
-  
-
+  background-color: white;
   .content {
     width: 100%;
   }

+ 239 - 272
src/views/system/langConfig/index.vue

@@ -1,311 +1,278 @@
 <template>
-	<div class="langConfig">
-		<div class="content">
-			<byTable
-				:source="sourceList.data"
-				:pagination="sourceList.pagination"
-				:config="config"
-				:loading="loading"
-				highlight-current-row
-				:selectConfig="selectConfig"
-				searchKey="userName"
-				: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-if="dialogVisible"
-			v-model="dialogVisible"
-			width="500"
-			v-loading="loading"
-		>
-			<byForm
-				:formConfig="formConfig"
-				:formOption="formOption"
-				v-model="formData.data"
-				
-				ref="byform"
-			>
-			</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>
-	</div>
+  <div class="langConfig">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        searchKey="userName"
+        :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-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loading">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" ref="byform"> </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>
+  </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,
-		type:'web'
-	},
-})
-let dialogVisible = ref(false)
-let modalType = ref('add')
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    type: "web",
+  },
+});
+let dialogVisible = ref(false);
+let modalType = ref("add");
 const validatePass = (rule, value, callback) => {
-	if (!formData.data.password && modalType.value == 'add') {
-		callback(new Error('请输入账号和密码'))
-	} else {
-		callback()
-	}
-}
-let rules = ref({
-
-	
-})
+  if (!formData.data.password && modalType.value == "add") {
+    callback(new Error("请输入账号和密码"));
+  } else {
+    callback();
+  }
+};
+let rules = ref({});
 
-const userId = ref('')
-const { proxy } = getCurrentInstance()
-const password = ref('')
+const userId = ref("");
+const { proxy } = getCurrentInstance();
+const password = ref("");
 const selectConfig = computed(() => {
-	return [
-		{
-			label: "选择系统",
-			prop: "type",
-			data: [
-				{
-					label:'web',
-					id:'web'
-				},
-				{
-					label:'app',
-					id:'app'
-				}
-			],
-		},
-	]
-})
+  return [
+    {
+      label: "选择系统",
+      prop: "type",
+      data: [
+        {
+          label: "web",
+          id: "web",
+        },
+        {
+          label: "app",
+          id: "app",
+        },
+      ],
+    },
+  ];
+});
 const config = computed(() => {
-	return [
-		{
-			attrs: {
-				label: '中文名称',
-				prop: 'value',
-			},
-		},
+  return [
+    {
+      attrs: {
+        label: "中文名称",
+        prop: "value",
+      },
+    },
 
-		{
-			attrs: {
-				label: '英文名称',
-				prop: 'enText',
-			},
-		},
-		{
-			attrs: {
-				label: '对象索引',
-				prop: 'key',
-				align: 'left',
-			},
-		},
-		{
-			attrs: {
-				label: '操作',
-				width: '200',
-				align: 'right',
-			},
-			// 渲染 el-button,一般用在最后一列。
-			renderHTML(row) {
-				return [
-					{
-						attrs: {
-							label: '修改',
-							type: 'primary',
-							text: true,
-						},
-						el: 'button',
-						click() {
-							getDtl(row)
-						},
-					},
-				]
-			},
-		},
-	]
-})
+    {
+      attrs: {
+        label: "英文名称",
+        prop: "enText",
+      },
+    },
+    {
+      attrs: {
+        label: "对象索引",
+        prop: "key",
+        align: "left",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "200",
+        align: "right",
+      },
+      // 渲染 el-button,一般用在最后一列。
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "修改",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              getDtl(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
 
 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: 'input',
-			prop: 'value',
-			label: '中文名称',
-			required: true,
-			itemType: 'text',
-			disabled:true,
-		},
-		{
-			type: 'input',
-			prop: 'enText',
-			label: '英文名称',
-			required: true,
-			itemType: 'text',
-		},
-	]
-})
+  return [
+    {
+      type: "input",
+      prop: "value",
+      label: "中文名称",
+      required: true,
+      itemType: "text",
+      disabled: true,
+    },
+    {
+      type: "input",
+      prop: "enText",
+      label: "英文名称",
+      required: true,
+      itemType: "text",
+    },
+  ];
+});
 
 //根据resurl获取数据
 const getFormat = (formatStr, props) => {
   if (!formatStr) return props;
-  return formatStr
-    .split(".")
-    .reduce((total, cur) => (!total ? "" : total[cur]), props);
+  return formatStr.split(".").reduce((total, cur) => (!total ? "" : total[cur]), props);
 };
 
-const submitData = ref('')
+const submitData = ref("");
 
 const getList = async (req) => {
-	sourceList.value.pagination = { ...sourceList.value.pagination, ...req }
-	console.log(sourceList.value.pagination.type)
-	loading.value = true
-	proxy
-		.get('/open/multilingual/getJson', {})
-		.then((message) => {
-			if (message.data) {
-				submitData.value = JSON.parse(message.data)
-				const res = JSON.parse(message.data)
-				console.log(res)
-				const tableData = getAllKeys(res.app.cn)
-				console.log(tableData)
-				//根据key获取res里其他语言的值
-				for (let i = 0; i < tableData.length; i++) {
-					const element = tableData[i];
-					element.enText = getFormat(element.key,res.app.en)
-				}
-				sourceList.value.data = tableData
-			}
-			loading.value = false
-			// proxy.post('/open/multilingual/setJson',{configValue:JSON.stringify(res)}).then((message) => {
-			// })
-		})
-}
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  console.log(sourceList.value.pagination.type);
+  loading.value = true;
+  proxy.get("/open/multilingual/getJson", {}).then((message) => {
+    if (message.data) {
+      submitData.value = JSON.parse(message.data);
+      const res = JSON.parse(message.data);
+      console.log(res);
+      const tableData = getAllKeys(res.app.cn);
+      console.log(tableData);
+      //根据key获取res里其他语言的值
+      for (let i = 0; i < tableData.length; i++) {
+        const element = tableData[i];
+        element.enText = getFormat(element.key, res.app.en);
+      }
+      sourceList.value.data = tableData;
+    }
+    loading.value = false;
+    // proxy.post('/open/multilingual/setJson',{configValue:JSON.stringify(res)}).then((message) => {
+    // })
+  });
+};
 //递归对象所有对象,将不是对象的属性放入数组,数组为对象类型,记录所有父级的key以数组方式存储
 const getAllKeys = (obj) => {
-	let result = []
-	const getKeys = (obj, parentKey) => {
-		Object.keys(obj).forEach((key) => {
-			if (typeof obj[key] === 'object') {
-				getKeys(obj[key], parentKey ? `${parentKey}.${key}` : key)
-			} else {
-				result.push({
-					key: parentKey ? `${parentKey}.${key}` : key,
-					value: obj[key],
-				})
-			}
-		})
-	}
-	getKeys(obj)
-	return result
-
-}
+  let result = [];
+  const getKeys = (obj, parentKey) => {
+    Object.keys(obj).forEach((key) => {
+      if (typeof obj[key] === "object") {
+        getKeys(obj[key], parentKey ? `${parentKey}.${key}` : key);
+      } else {
+        result.push({
+          key: parentKey ? `${parentKey}.${key}` : key,
+          value: obj[key],
+        });
+      }
+    });
+  };
+  getKeys(obj);
+  return result;
+};
 
 const treeChange = (e) => {
-	console.log(e)
-	sourceList.value.pagination.tenantId = e.id
-	getList({ tenantId: e.id })
-	getUserList()
-	getDept()
-}
+  console.log(e);
+  sourceList.value.pagination.tenantId = e.id;
+  getList({ tenantId: e.id });
+  getUserList();
+  getDept();
+};
 
 const openModal = () => {
-	dialogVisible.value = true
-	modalType.value = 'add'
-	formData.data = {
-		userType: 1,
-	}
-}
+  dialogVisible.value = true;
+  modalType.value = "add";
+  formData.data = {
+    userType: 1,
+  };
+};
 
-const tree = ref(null)
+const tree = ref(null);
 const submitForm = () => {
-	byform.value.handleSubmit((valid) => {
-		console.log(formData.data)
-		//根据key修改submitData里的值
-		const key = formData.data.key
-		const value = formData.data.value
-		const enText = formData.data.enText
-		const keyArr = key.split('.')
-		let obj = submitData.value.app.en
-		for (let i = 0; i < keyArr.length; i++) {
-			const element = keyArr[i]
-			if (i == keyArr.length - 1) {
-				obj[element] = enText
-			} else {
-				obj = obj[element]
-			}
-		}
-		proxy.post('/open/multilingual/setJson',{configValue:JSON.stringify(submitData.value)}).then((message) => {
-			console.log(message)
-			dialogVisible.value = false
-			getList()
-		})
-	})
-}
+  byform.value.handleSubmit((valid) => {
+    console.log(formData.data);
+    //根据key修改submitData里的值
+    const key = formData.data.key;
+    const value = formData.data.value;
+    const enText = formData.data.enText;
+    const keyArr = key.split(".");
+    let obj = submitData.value.app.en;
+    for (let i = 0; i < keyArr.length; i++) {
+      const element = keyArr[i];
+      if (i == keyArr.length - 1) {
+        obj[element] = enText;
+      } else {
+        obj = obj[element];
+      }
+    }
+    proxy.post("/open/multilingual/setJson", { configValue: JSON.stringify(submitData.value) }).then((message) => {
+      console.log(message);
+      dialogVisible.value = false;
+      getList();
+    });
+  });
+};
 
 const getDtl = (row) => {
-	formData.data = { ...row}
-	modalType.value = 'edit'
-	dialogVisible.value = true
-	
-}
-getList()
+  formData.data = { ...row };
+  modalType.value = "edit";
+  dialogVisible.value = true;
+};
+getList();
 </script>
 
 <style lang="scss" scoped>
 .langConfig {
-	padding: 20px;
-	display: flex;
-	justify-content: space-between;
-
-	.content {
-		width: 100%;
-	}
+  padding: 20px;
+  display: flex;
+  justify-content: space-between;
+  background-color: white;
+  .content {
+    width: 100%;
+  }
 }
 </style>

+ 1 - 0
src/views/system/role2/index.vue

@@ -327,6 +327,7 @@ getList();
   padding: 20px;
   display: flex;
   justify-content: space-between;
+  background-color: white;
   .tree {
     width: 300px;
   }

+ 7 - 6
src/views/system/user2/index.vue

@@ -121,16 +121,17 @@ const config = computed(() => {
       render(userType) {
         return userType == 1 ? "是" : "否";
       },
-    },{
+    },
+    {
       attrs: {
         label: "角色",
         prop: "sysRoleList",
       },
       render(sysRoleList) {
-        return sysRoleList.map((item) => item.roleName).join(",")
+        return sysRoleList.map((item) => item.roleName).join(",");
       },
     },
-    
+
     {
       attrs: {
         label: "手机号",
@@ -160,12 +161,12 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              console.log(row)
+              console.log(row);
               userId.value = row.userId;
               roomDialogVisible.value = true;
             },
           },
-          
+
           {
             attrs: {
               label: "修改",
@@ -473,7 +474,7 @@ getList();
   padding: 20px;
   display: flex;
   justify-content: space-between;
-
+  background-color: white;
   .tree {
     width: 300px;
   }