Hwf 2 месяцев назад
Родитель
Сommit
6e3f3a828f

+ 11 - 0
src/api/dataManagement/dataManagement.ts

@@ -46,3 +46,14 @@ export function addDataManagerInfo(queryParams) {
     data: queryParams.data
   });
 }
+
+// 数据管理列表-新增数据
+export function importDataManagerInfo(tableId, filename) {
+  return request({
+    url: `/api/dataManager/import_data/${tableId}`,
+    method: 'post',
+    data: {
+      filename: filename
+    }
+  });
+}

+ 45 - 18
src/components/DataImport/index.vue

@@ -19,7 +19,7 @@
         <el-upload
           ref="fileUploadRef"
           multiple
-          :action="uploadFileUrl"
+          :action="baseUrl + uploadFileUrl"
           :before-upload="handleBeforeUpload"
           :file-list="fileList"
           :limit="limit"
@@ -46,21 +46,29 @@ import { propTypes } from '@/utils/propTypes';
 import { v1 as uuidv1 } from 'uuid';
 import axios from 'axios';
 import { dataImport } from '@/api/PreventionResponsible';
+import { getToken } from '@/utils/auth';
 
+const baseUrl = import.meta.env.VITE_APP_BASE_API;
+const downLoadApi = import.meta.env.VITE_APP_BASE_DOWNLOAD_API;
 const props = defineProps({
   modelValue: Boolean,
   // 数量限制
-  limit: propTypes.number.def(20),
+  limit: propTypes.number.def(1),
   // 大小限制(MB)
   fileSize: propTypes.number.def(100),
   fileType: propTypes.array.def(['xls', 'xlsx']),
   stepsText: String,
   url: String,
-  fileName: String
+  customUrl: Boolean,
+  fileName: String,
+  uploadFileUrl: {
+    type: String,
+    default: '#'
+  }
 });
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const emits = defineEmits(['update:modelValue']);
+const emits = defineEmits(['update:modelValue', 'success']);
 const dialogVisible = computed({
   get() {
     return props.modelValue;
@@ -73,9 +81,6 @@ const dialogVisible = computed({
 const number = ref(0);
 const uploadList = ref<any[]>([]);
 
-const baseUrl = import.meta.env.VITE_APP_BASE_API;
-const downLoadApi = import.meta.env.VITE_APP_BASE_DOWNLOAD_API;
-const uploadFileUrl = ref(baseUrl + '/resource/oss/upload'); // 上传文件服务器地址
 const headers = ref(globalHeaders());
 
 const fileList = ref<any[]>([]);
@@ -91,10 +96,6 @@ watch(
   { deep: true, immediate: true }
 );
 
-// 进入导入界面
-const handleImport = () => {
-
-};
 // 上传前校检格式和大小
 const handleBeforeUpload = (file: any) => {
   // 校检文件类型
@@ -132,11 +133,11 @@ const handleUploadError = () => {
 
 const uploadFile = async ({ data, file }) => {
   // data是上传时附带的额外参数,file是文件
-  let url = baseUrl + '/file/upload/uploadfile'; //上传文件接口
+  let url = props.uploadFileUrl === '#' ? baseUrl + '/file/upload/uploadfile' : props.uploadFileUrl; //上传文件接口
   try {
     // 如果文件大于等于5MB,分片上传
     data.file = file;
-    const res = await uploadByPieces(url, data);
+    const res = props.uploadFileUrl === '#' ? await uploadByPieces(url, data) : await customUpload(url, data);
     // 分片上传后操作
     return res;
   } catch (e) {
@@ -166,7 +167,8 @@ const uploadByPieces = async (url, { fileName, file }) => {
         data,
         params,
         headers: {
-          'Content-Type': 'multipart/form-data'
+          'Content-Type': 'multipart/form-data',
+          'Authorization': 'Bearer ' + getToken()
         }
       })
         .then((res) => {
@@ -199,13 +201,31 @@ const uploadByPieces = async (url, { fileName, file }) => {
     res.originalName = file.name;
     const res2 = await dataImport({
       filename: res.filename,
-      file_name_desc: res.originalName,
-    })
+      file_name_desc: res.originalName
+    });
     return res;
   } catch (e) {
     return e;
   }
 };
+const customUpload = async (url, { fileName, file }) => {
+  // const formData = new FormData();
+  // formData.append('file', file);
+  await axios
+    .post(props.uploadFileUrl, file, {
+      headers: {
+        'Content-Type': 'application/octet-stream' // 或文件具体类型(如 image/jpeg)
+      },
+      maxBodyLength: Infinity, // 允许上传大文件[7](@ref)
+      responseType: 'json' // 后端返回 JSON 格式响应
+    })
+    .then((res) => {
+      return res.data;
+    })
+    .catch((err) => {
+      return err;
+    });
+};
 const mergeChunks = async (identifier: string, filename: string) => {
   try {
     const response = await axios.post(baseUrl + '/file/upload/mergefile', null, {
@@ -213,6 +233,9 @@ const mergeChunks = async (identifier: string, filename: string) => {
         identifier: identifier,
         filename: filename,
         chunkstar: 0 // 假设所有分片的开始序号为0
+      },
+      headers: {
+        'Authorization': 'Bearer ' + getToken()
       }
     });
 
@@ -223,7 +246,7 @@ const mergeChunks = async (identifier: string, filename: string) => {
 };
 // 上传成功回调
 const handleUploadSuccess = (res: any, file: UploadFile) => {
-  if (res.code === 200) {
+  if (res && res.code === 200) {
     uploadList.value.push({
       name: res.originalName,
       url: res.filename
@@ -254,7 +277,11 @@ const uploadedSuccessfully = () => {
 // 下载模板
 const handleDownload = () => {
   if (!props.url) return false;
-  download2(baseUrl + downLoadApi + props.url, props.fileName);
+  let downLoadUrl = baseUrl + downLoadApi + props.url;
+  if (props.customUrl) {
+    downLoadUrl = props.url;
+  }
+  download2(downLoadUrl, props.fileName);
 };
 </script>
 

+ 3 - 0
src/components/FileUpload/index.vue

@@ -231,6 +231,9 @@ const mergeChunks = async (identifier: string, filename: string) => {
         identifier: identifier,
         filename: filename,
         chunkstar: 0 // 假设所有分片的开始序号为0
+      },
+      headers: {
+        'Authorization': 'Bearer ' + getToken()
       }
     });
 

+ 1 - 4
src/views/comprehensiveGuarantee/materialReserves/materialsDistributionAdd.vue

@@ -8,7 +8,7 @@
       <div class="common-dialog-box">
         <div class="text-box">
           <div class="text1">调度目的:</div>
-          <el-input v-model="dispatch_purpose" class="text2" type="textarea" autosize placeholder="请输入" :style="{ width: '500px' }" />
+          <el-input v-model="dispatch_purpose" type="textarea" autosize placeholder="请输入" :style="{ width: '500px' }" />
         </div>
         <el-form ref="formRef" :model="detailData" style="width: 100%">
           <el-table :data="detailData.detail" border :height="height">
@@ -189,9 +189,6 @@ onUnmounted(() => {
     font-size: 18px;
     font-weight: bold;
   }
-  .text2 {
-    font-size: 18px;
-  }
 }
 .el-form-item {
   margin: 18px 0;

+ 306 - 0
src/views/dataManagement/DataImport.vue

@@ -0,0 +1,306 @@
+<template>
+  <el-dialog v-model="dialogVisible" title="批量导入" width="780px" destroy-on-close append-to-body @close="handleClose">
+    <div class="describe-content">
+      <div class="title">操作说明:</div>
+      <div class="step-container">
+        <el-steps direction="vertical">
+          <el-step status="process" title="首先点击“模板下载,下载录入模板”。" />
+          <el-step status="process" :title="'在模板空白处中填写' + stepsText + '。'" />
+          <el-step status="process" title="通过点击“导入按钮,浏览选择导入文件”,完成导入。" />
+          <el-step
+            status="process"
+            :title="'导入成功,对于系统中没有的' + stepsText + ',进行新增操作对于原本系统已存在的' + stepsText + ',进行信息合并操作。'"
+          />
+        </el-steps>
+      </div>
+    </div>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-upload
+          ref="fileUploadRef"
+          multiple
+          action="#"
+          :before-upload="handleBeforeUpload"
+          :file-list="fileList"
+          :limit="limit"
+          :on-error="handleUploadError"
+          :on-exceed="handleExceed"
+          :on-success="handleUploadSuccess"
+          :show-file-list="false"
+          :headers="headers"
+          :http-request="uploadFile"
+          class="upload-file-uploader"
+        >
+          <el-button type="primary" :icon="Upload">导入</el-button>
+        </el-upload>
+        <el-button type="primary" :icon="Download" style="margin-left: 16px" @click="handleDownload">模板下载</el-button>
+      </div>
+    </template>
+  </el-dialog>
+</template>
+
+<script lang="ts" setup name="DataImport">
+import { Upload, Download } from '@element-plus/icons-vue';
+import { download2, globalHeaders } from '@/utils/request';
+import { propTypes } from '@/utils/propTypes';
+import { v1 as uuidv1 } from 'uuid';
+import axios from 'axios';
+import { getToken } from '@/utils/auth';
+import { importDataManagerInfo } from '@/api/dataManagement/dataManagement';
+
+const baseUrl = import.meta.env.VITE_APP_BASE_API;
+const props = defineProps({
+  modelValue: Boolean,
+  // 数量限制
+  limit: propTypes.number.def(1),
+  // 大小限制(MB)
+  fileSize: propTypes.number.def(100),
+  fileType: propTypes.array.def(['xls', 'xlsx']),
+  stepsText: String,
+  url: String,
+  fileName: String,
+  dataType: String
+});
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const emits = defineEmits(['update:modelValue', 'success']);
+const dialogVisible = computed({
+  get() {
+    return props.modelValue;
+  },
+  set(newValue) {
+    emits('update:modelValue', newValue);
+  }
+});
+
+const handleClose = () => {
+  debugger
+  emits('update:modelValue', false);
+};
+const number = ref(0);
+const uploadList = ref<any[]>([]);
+
+const headers = ref(globalHeaders());
+
+const fileList = ref<any[]>([]);
+const fileUploadRef = ref<ElUploadInstance>();
+// 隐藏清空数据
+watch(
+  () => props.modelValue,
+  async (val) => {
+    if (!val) {
+      fileList.value = [];
+    }
+  },
+  { deep: true, immediate: true }
+);
+
+// 进入导入界面
+const handleImport = () => {};
+// 上传前校检格式和大小
+const handleBeforeUpload = (file: any) => {
+  // 校检文件类型
+  if (props.fileType.length) {
+    const fileName = file.name.split('.');
+    const fileExt = fileName[fileName.length - 1];
+    const isTypeOk = props.fileType.indexOf(fileExt) >= 0;
+    if (!isTypeOk) {
+      proxy?.$modal.msgError(`文件格式不正确, 请上传${props.fileType.join('/')}格式文件!`);
+      return false;
+    }
+  }
+  // 校检文件大小
+  if (props.fileSize) {
+    const isLt = file.size / 1024 / 1024 < props.fileSize;
+    if (!isLt) {
+      proxy?.$modal.msgError(`上传文件大小不能超过 ${props.fileSize} MB!`);
+      return false;
+    }
+  }
+  proxy?.$modal.loading('正在上传文件,请稍候...');
+  number.value++;
+  return true;
+};
+
+// 文件个数超出
+const handleExceed = () => {
+  proxy?.$modal.msgError(`上传文件数量不能超过 ${props.limit} 个!`);
+};
+
+// 上传失败
+const handleUploadError = () => {
+  proxy?.$modal.msgError('上传文件失败');
+};
+
+const uploadFile = async ({ data, file }) => {
+  // data是上传时附带的额外参数,file是文件
+  let url = baseUrl + '/file/upload/uploadfile'; //上传文件接口
+  try {
+    // 如果文件大于等于5MB,分片上传
+    data.file = file;
+    const res = await uploadByPieces(url, data);
+    // 分片上传后操作
+    return res;
+  } catch (e) {
+    return e;
+  }
+};
+//分片上传
+const uploadByPieces = async (url, { fileName, file }) => {
+  // 上传过程中用到的变量
+  const chunkSize = 5 * 1024 * 1024; // 5MB一片
+  const chunkCount = Math.ceil(file.size / chunkSize); // 总片数
+  // 获取当前chunk数据
+  const identifier = uuidv1();
+  const getChunkInfo = (file, index) => {
+    let start = index * chunkSize;
+    let end = Math.min(file.size, start + chunkSize);
+    let chunknumber = file.slice(start, end);
+    const fileName = file.name;
+    return { chunknumber, fileName };
+  };
+  // 分片上传接口
+  const uploadChunk = (data, params) => {
+    return new Promise((resolve, reject) => {
+      axios({
+        url,
+        method: 'post',
+        data,
+        params,
+        headers: {
+          'Content-Type': 'multipart/form-data',
+          'Authorization': 'Bearer ' + getToken()
+        }
+      })
+        .then((res) => {
+          return resolve(res.data);
+        })
+        .catch((err) => {
+          return reject(err);
+        });
+    });
+  };
+  // 针对单个文件进行chunk上传
+  const readChunk = (index) => {
+    const { chunknumber } = getChunkInfo(file, index);
+    let fetchForm = new FormData();
+    fetchForm.append('file', chunknumber);
+    return uploadChunk(fetchForm, {
+      chunknumber: index,
+      identifier: identifier
+    });
+  };
+  // 针对每个文件进行chunk处理
+  const promiseList = [];
+  try {
+    for (let index = 0; index < chunkCount; ++index) {
+      promiseList.push(readChunk(index));
+    }
+    await Promise.all(promiseList);
+    // 文件分片上传完成后,调用合并接口
+
+    const res = await mergeChunks(identifier, file.name);
+    res.originalName = file.name;
+    const res2 = await importDataManagerInfo(props.dataType, res.filename);
+    // const res3 = await customUpload(identifier, file.name);
+    return res;
+  } catch (e) {
+    return e;
+  }
+};
+const mergeChunks = async (identifier: string, filename: string) => {
+  try {
+    const response = await axios.post(baseUrl + '/file/upload/mergefile', null, {
+      params: {
+        identifier: identifier,
+        filename: filename,
+        chunkstar: 0 // 假设所有分片的开始序号为0
+      },
+      headers: {
+        'Authorization': 'Bearer ' + getToken()
+      }
+    });
+
+    return response.data;
+  } catch (error) {
+    throw new Error('合并请求失败');
+  }
+};
+// 上传成功回调
+const handleUploadSuccess = (res: any, file: UploadFile) => {
+  if (res && res.code === 200) {
+    uploadList.value.push({
+      name: res.originalName,
+      url: res.filename
+    });
+    uploadedSuccessfully();
+    proxy.$modal.msgSuccess('导入成功');
+    emits('update:modelValue', false);
+    emits('success');
+  } else {
+    number.value--;
+    proxy?.$modal.closeLoading();
+    proxy?.$modal.msgError(res.msg);
+    fileUploadRef.value?.handleRemove(file);
+    uploadedSuccessfully();
+    proxy.$modal.msgError('导入失败');
+  }
+};
+
+// 上传结束处理
+const uploadedSuccessfully = () => {
+  if (number.value > 0 && uploadList.value.length === number.value) {
+    fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value);
+    uploadList.value = [];
+    number.value = 0;
+    proxy?.$modal.closeLoading();
+  }
+};
+
+// 下载模板
+const handleDownload = () => {
+  if (!props.url) return false;
+  let downLoadUrl = baseUrl + props.url;
+  download2(downLoadUrl, props.fileName);
+};
+</script>
+
+<style lang="scss" scoped>
+.title {
+  font-size: 18px;
+  line-height: 36px;
+  margin-bottom: 10px;
+  color: rgba(0, 0, 0, 0.85);
+}
+.step-container {
+  width: 700px;
+  height: 180px;
+  :deep(.el-step) {
+    .el-step__icon.is-text {
+      border-color: #a8abb2;
+      color: rgba(0, 0, 0, 0.85);
+    }
+    .el-step__title.is-process {
+      font-size: 16px;
+      color: rgba(0, 0, 0, 0.85);
+      font-weight: normal;
+    }
+  }
+}
+.upload-file-list .el-upload-list__item {
+  line-height: 22px;
+  margin-bottom: 10px;
+  position: relative;
+  padding: 3px 5px;
+}
+
+.upload-file-list .ele-upload-list__item-content {
+  display: flex;
+  align-items: center;
+  color: inherit;
+}
+
+.ele-upload-list__item-content-action .el-link {
+  margin-right: 10px;
+}
+</style>

+ 36 - 10
src/views/dataManagement/index.vue

@@ -52,19 +52,23 @@
       :detail-data="dataManagementViewState.data"
       @on-cancel="handleCancel"
     />
-    <DataImport v-model="showImportDialog" :url="importUrl" :file-name="importUrl" :steps-text="fileName" />
+    <DataImport
+      v-model="showImportDialog"
+      :url="importUrl"
+      :data-type="queryParams.dataType"
+      :file-name="fileName + '模板.xlsx'"
+      :steps-text="fileName"
+      @success="getList"
+    />
   </div>
 </template>
 
 <script lang="ts" setup>
 import ViewDataManagement from './ViewDataManagement.vue';
 import AddDataManagement from './AddDataManagement.vue';
-import {
-  deleteDataManagerInfo,
-  getDataManagerDataList,
-  getDataManagerInfo,
-  getDataManagerList
-} from '@/api/dataManagement/dataManagement';
+import DataImport from './DataImport.vue';
+import { deleteDataManagerInfo, getDataManagerDataList, getDataManagerInfo, getDataManagerList } from '@/api/dataManagement/dataManagement';
+import { parseTime } from '@/utils/ruoyi';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const queryParams = reactive({
@@ -72,6 +76,7 @@ const queryParams = reactive({
   page: 1,
   pageSize: 10
 });
+const baseUrl = import.meta.env.VITE_APP_BASE_API;
 let loading = ref(false);
 const total = ref(0); // 总条目数
 const type = ref([]);
@@ -137,12 +142,31 @@ const removeItem = (item) => {
 const onDataTypeChange = () => {
   const index = type.value.findIndex((row) => row.value === queryParams.dataType);
   if (index !== -1) {
-    importUrl.value = type.value[index].layer_name + '.xlsx';
+    importUrl.value = '/api/dataManager/generate_import_template/' + queryParams.dataType;
     fileName.value = type.value[index].layer_name;
   }
   queryParams.page = 1;
   getList();
 };
+const parseTableTime = () => {
+  if (tableHeader.value.length > 0 && tableData.value.length > 0) return;
+  tableHeader.value.forEach((row) => {
+    let pattern = '';
+    if (row.data_type === 'datetime') {
+      pattern = '{y}-{m}-{d} {h}:{i}:{s}';
+    } else if (row.data_type === 'date') {
+      pattern = '{y}-{m}-{d}';
+    }
+
+    if (pattern) {
+      tableData.value.forEach((item) => {
+        if (item[row.column_name]) {
+          item[row.column_name] = parseTime(item[row.column_name], pattern);
+        }
+      });
+    }
+  });
+};
 
 // 获取表格数据
 const getList = async () => {
@@ -150,11 +174,13 @@ const getList = async () => {
   tableHeader.value = [];
   getDataManagerInfo(queryParams.dataType).then((res) => {
     tableHeader.value = res.data.columns;
+    parseTableTime();
   });
   getDataManagerDataList(queryParams.dataType, { page: queryParams.page, pageSize: queryParams.pageSize })
     .then((res) => {
       tableData.value = res.data;
       total.value = res.total;
+      parseTableTime();
     })
     .finally(() => {
       loading.value = false;
@@ -164,9 +190,9 @@ const getList = async () => {
 const loadData = () => {
   getDataManagerList().then((res) => {
     type.value = res.data;
-    importUrl.value = type.value[0].layer_name + '.xlsx';
-    fileName.value = type.value[0].layer_name;
     queryParams.dataType = type.value[0].id;
+    importUrl.value = '/api/dataManager/generate_import_template/' + queryParams.dataType;
+    fileName.value = type.value[0].layer_name;
     getList();
   });
 };

+ 7 - 4
src/views/duty/eventing/StatisticalAnalysis.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog title="统计分析" ref="formDialogRef" :model-value="visible" width="750px" append-to-body>
+  <el-dialog title="统计分析" ref="formDialogRef" v-model="visible" width="750px" destroy-on-close append-to-body @before-close="handleClose">
     <div style="font-size: 16px; font-weight: bold; margin: 10px 0">事件统计报表</div>
     <el-table :data="eventCasualtiesList">
       <el-table-column label="行政区划" align="center" prop="area_name" />
@@ -31,8 +31,8 @@
       <el-table-column label="已完成" align="center" prop="complete_num" />
       <el-table-column label="任务完成率" align="center" prop="complete_rate">
         <template #default="{ row }">
-        {{ row.complete_rate === 0 ? row.complete_rate : `${row.complete_rate}%` }}
-      </template>
+          {{ row.complete_rate === 0 ? row.complete_rate : `${row.complete_rate}%` }}
+        </template>
       </el-table-column>
       <template #append>
         <tr class="summary-row">
@@ -67,7 +67,10 @@ const visible = computed({
     emits('update:modelValue', newValue);
   }
 });
-
+const handleClose = () => {
+  debugger
+  emits('update:modelValue', false);
+};
 const eventCasualtiesList = ref([]);
 const eventTaskList = ref([]);
 // 计算合计的方法

+ 1 - 1
src/views/duty/eventing/eventDetails.vue

@@ -181,7 +181,7 @@
       :event-id="eventId"
       @update:model-value="fetchEventDetail"
     />
-    <StatisticalAnalysis v-if="showAnalysis" v-model="showAnalysis" :event-id="eventId" />
+    <StatisticalAnalysis v-model="showAnalysis" :event-id="eventId" />
   </div>
 </template>
 

+ 10 - 45
src/views/setting/PreventionResponsible/index.vue

@@ -95,6 +95,13 @@
           </el-col>
         </el-row>
       </div>
+      <DataImport
+        v-model="uploadShow"
+        url="619a7308-3ad4-11f0-8387-fa163e4bf12e.xlsx"
+        file-name="三防责任人模板.xlsx"
+        steps-text="三防责任人"
+        @success="getList"
+      />
       <DataImportDetail v-model="showUploadDetails" v-if="showUploadDetails" />
       <detail v-if="detailState.show" :id="detailState.id" @close="handledetailClose"></detail>
       <add v-if="addState.show" @close="handleAddClose" @refresh="getList"></add>
@@ -104,24 +111,16 @@
 </template>
 
 <script setup lang="ts">
-import api from '@/api/system/user';
 import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
 import { deleteData, getRegionalTree, getRegionalTree3, getTableList } from '@/api/PreventionResponsible/index';
 import { DeptVO } from '@/api/system/dept/types';
-import { RoleVO } from '@/api/system/role/types';
-import { PostQuery, PostVO } from '@/api/system/post/types';
 import { treeselect } from '@/api/system/dept';
-import { download2, globalHeaders } from '@/utils/request';
-import { to } from 'await-to-js';
-import { optionselect } from '@/api/system/post';
+import { download2 } from '@/utils/request';
 import detail from '@/views/setting/PreventionResponsible/detail.vue';
 import add from '@/views/setting/PreventionResponsible/add.vue';
 import Edit from '@/views/setting/PreventionResponsible/Edit.vue';
-import { reactive, ref } from 'vue';
-import { deleteMaterialRoot } from '@/api/comprehensiveGuarantee/materialReserveManagement/warehouseManagement';
-import { ElButton } from 'element-plus';
+import DataImport from '@/components/DataImport/index.vue';
 
-const router = useRouter();
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const userList = ref<UserVO[]>();
 const loading = ref(true);
@@ -130,12 +129,9 @@ const ids = ref<Array<number | string>>([]);
 const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
-const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
 const deptName = ref('');
 const deptOptions = ref<DeptVO[]>([]);
-const initPassword = ref<string>('');
-const postOptions = ref<PostVO[]>([]);
-const roleOptions = ref<RoleVO[]>([]);
+
 // const treeData = ref({});
 const treeData: Tree[] = ref([]);
 // 列显隐信息
@@ -381,34 +377,6 @@ const cancel = () => {
   reset();
 };
 
-/** 新增按钮操作 */
-// const handleAdd = async () => {
-//   reset();
-//   const { data } = await api.getUser();
-//   dialog.visible = true;
-//   dialog.title = '新增用户';
-//   await initTreeData();
-//   postOptions.value = data.posts;
-//   roleOptions.value = data.roles;
-//   // form.value.password = initPassword.value.toString();
-// };
-
-// /** 修改按钮操作 */
-// const handleUpdate = async (row?: UserForm) => {
-//   reset();
-//   const userId = row?.userId || ids.value[0];
-//   const { data } = await api.getUser(userId);
-//   dialog.visible = true;
-//   dialog.title = '修改用户';
-//   await initTreeData();
-//   Object.assign(form.value, data.user);
-//   postOptions.value = data.posts;
-//   roleOptions.value = data.roles;
-//   form.value.postIds = data.postIds;
-//   form.value.roleIds = data.roleIds;
-//   form.value.password = '';
-// };
-
 // 导入
 let uploadShow = ref(false);
 const handleUpload = () => {
@@ -420,9 +388,6 @@ const handleShowUploadDetails = () => {
 };
 onMounted(() => {
   getList(); // 初始化列表数据
-  proxy?.getConfigKey('sys.user.initPassword').then((response) => {
-    initPassword.value = response.data;
-  });
   getRegionalTree3().then((res) => {
     treeData.value = res.data;
   })