兰宝车间质量管理系统-前端
!29 修改列表打开对话框和接口请求顺序
Merge pull request !29 from ahaos/tspr
已修改21个文件
489 ■■■■■ 文件已修改
src/plugins/download.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/jsencrypt.ts 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/propTypes.ts 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/demo/demo/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/demo/tree/index.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/monitor/online/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/client/index.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/config/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dept/index.vue 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dict/data.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/dict/index.vue 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/menu/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/notice/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/oss/config.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/oss/index.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/post/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/role/index.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/tenant/index.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/tenantPackage/index.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/index.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tool/gen/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/plugins/download.ts
@@ -54,8 +54,8 @@
      }
      downloadLoadingInstance.close();
    } catch (r) {
      console.error(r)
      ElMessage.error('下载文件出现错误,请联系管理员!')
      console.error(r);
      ElMessage.error('下载文件出现错误,请联系管理员!');
      downloadLoadingInstance.close();
    }
  },
src/utils/jsencrypt.ts
@@ -1,7 +1,7 @@
import JSEncrypt from 'jsencrypt';
// 密钥对生成 http://web.chacuo.net/netrsakeypair
const publicKey = import.meta.env.VITE_APP_RSA_PUBLIC_KEY
const publicKey = import.meta.env.VITE_APP_RSA_PUBLIC_KEY;
// 前端不建议存放私钥 不建议解密数据 因为都是透明的意义不大
const privateKey = '**********';
src/utils/propTypes.ts
@@ -19,8 +19,7 @@
    return toValidableType('style', {
      type: [String, Object],
      default: undefined
    })
    });
  }
}
export { propTypes };
src/views/demo/demo/index.vue
@@ -208,25 +208,19 @@
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加测试单";
  nextTick(() => {
    reset();
  });
}
/** 修改按钮操作 */
const handleUpdate = (row?: DemoVO) => {
  loading.value = true
const handleUpdate = async (row?: DemoVO) => {
  reset();
  const _id = row?.id || ids.value[0]
  const res = await getDemo(_id);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改测试单";
  nextTick(async () => {
    reset();
    const _id = row?.id || ids.value[0]
    const res = await getDemo(_id);
    loading.value = false;
    Object.assign(form.value, res.data);
  });
}
/** 提交按钮 */
src/views/demo/tree/index.vue
@@ -201,17 +201,15 @@
/** 新增按钮操作 */
const handleAdd = (row?: TreeVO) => {
  reset();
  getTreeselect();
  if (row && row.id) {
    form.value.parentId = row.id;
  } else {
    form.value.parentId = 0;
  }
  dialog.visible = true;
  dialog.title = "添加测试树";
  nextTick(() => {
    reset();
    getTreeselect();
    if (row != null && row.id) {
      form.value.parentId = row.id;
    } else {
      form.value.parentId = 0;
    }
  });
}
/** 展开/折叠操作 */
@@ -229,20 +227,16 @@
}
/** 修改按钮操作 */
const handleUpdate = (row: TreeVO) => {
  loading.value = true;
const handleUpdate = async (row: TreeVO) => {
  reset();
  await getTreeselect();
  if (row) {
    form.value.parentId = row.id;
  }
  const res = await getTree(row.id);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改测试树";
  nextTick(async () => {
    reset();
    await getTreeselect();
    if (row != null) {
      form.value.parentId = row.id;
    }
    const res = await getTree(row.id);
    loading.value = false;
    Object.assign(form.value, res.data);
  });
}
/** 提交按钮 */
src/views/monitor/online/index.vue
@@ -95,7 +95,7 @@
const handleForceLogout = async (row: OnlineVO) => {
  await proxy?.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?');
  await forceLogout(row.tokenId);
  getList();
  await getList();
  proxy?.$modal.msgSuccess("删除成功");
}
src/views/system/client/index.vue
@@ -29,10 +29,14 @@
            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:client:add']">新增</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:client:edit']">修改</el-button>
            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:client:edit']">
              修改
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:client:remove']">删除</el-button>
            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:client:remove']">
              删除
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:client:export']">导出</el-button>
@@ -50,7 +54,7 @@
        <el-table-column label="授权类型" align="center">
          <template #default="scope">
            <div>
              <template v-for="type in scope.row.grantTypeList">
              <template v-for="(type, index) in scope.row.grantTypeList" :key="index">
                <dict-tag class="el-check-tag" :options="sys_grant_type" :value="type" />
              </template>
            </div>
@@ -80,13 +84,7 @@
        </el-table-column>
      </el-table>
      <pagination
          v-show="total>0"
          :total="total"
          v-model:page="queryParams.pageNum"
          v-model:limit="queryParams.pageSize"
          @pagination="getList"
      />
      <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
    </el-card>
    <!-- 添加或修改客户端管理对话框 -->
    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
@@ -99,18 +97,12 @@
        </el-form-item>
        <el-form-item label="授权类型" prop="grantTypeList">
          <el-select v-model="form.grantTypeList" multiple placeholder="请输入授权类型">
            <el-option
              v-for="dict in sys_grant_type"
              :key="dict.value" :label="dict.label" :value="dict.value"
            ></el-option>
            <el-option v-for="dict in sys_grant_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="设备类型" prop="deviceType">
          <el-select v-model="form.deviceType" placeholder="请输入设备类型">
            <el-option
              v-for="dict in sys_device_type"
              :key="dict.value" :label="dict.label" :value="dict.value"
            ></el-option>
            <el-option v-for="dict in sys_device_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="activeTimeout" label-width="auto">
@@ -156,8 +148,6 @@
<script setup name="Client" lang="ts">
import { listClient, getClient, delClient, addClient, updateClient, changeStatus } from '@/api/system/client';
import { ClientVO, ClientQuery, ClientForm } from '@/api/system/client/types';
import { ComponentInternalInstance } from 'vue';
import { ElForm } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_normal_disable } = toRefs<any>(proxy?.useDict("sys_normal_disable"));
@@ -173,8 +163,8 @@
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref(ElForm);
const clientFormRef = ref(ElForm);
const queryFormRef = ref<ElFormInstance>();
const clientFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
  visible: false,
@@ -248,7 +238,7 @@
/** 表单重置 */
const reset = () => {
  form.value = {...initFormData};
  clientFormRef.value.resetFields();
  clientFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
@@ -259,7 +249,7 @@
/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value.resetFields();
  queryFormRef.value?.resetFields();
  handleQuery();
}
@@ -272,30 +262,24 @@
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加客户端管理";
  nextTick(() => {
    reset();
  });
}
/** 修改按钮操作 */
const handleUpdate = (row?: ClientVO) => {
  loading.value = true
const handleUpdate = async (row?: ClientVO) => {
  reset();
  const _id = row?.id || ids.value[0]
  const res = await getClient(_id);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改客户端管理";
  nextTick(async () => {
    reset();
    const _id = row?.id || ids.value[0]
    const res = await getClient(_id);
    loading.value = false;
    Object.assign(form.value, res.data);
  });
}
/** 提交按钮 */
const submitForm = () => {
  clientFormRef.value.validate(async (valid: boolean) => {
  clientFormRef.value?.validate(async (valid: boolean) => {
    if (valid) {
      buttonLoading.value = true;
      if (form.value.id) {
src/views/system/config/index.vue
@@ -207,22 +207,18 @@
}
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加参数";
  nextTick(() => {
    reset();
  })
}
/** 修改按钮操作 */
const handleUpdate = (row?: ConfigVO) => {
const handleUpdate = async (row?: ConfigVO) => {
  reset();
  const configId = row?.configId || ids.value[0];
  const res = await getConfig(configId);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改参数";
  const configId = row?.configId || ids.value[0];
  nextTick(async () => {
    reset();
    const res = await getConfig(configId);
    form.value = res.data;
  })
}
/** 提交按钮 */
const submitForm = () => {
src/views/system/dept/index.vue
@@ -219,23 +219,7 @@
  queryFormRef.value?.resetFields();
  handleQuery()
}
/** 新增按钮操作 */
const handleAdd = (row?: DeptVO) => {
  listDept().then(res => {
    const data = proxy?.handleTree<DeptOptionsType>(res.data, "deptId");
    if (data) {
      deptOptions.value = data
      dialog.visible = true;
      dialog.title = "添加部门";
      nextTick(() => {
        reset();
        if (row && row.deptId) {
          form.value.parentId = row?.deptId;
        }
      })
    }
  })
}
/** 展开/折叠操作 */
const handleToggleExpandAll = () => {
  isExpandAll.value = !isExpandAll.value;
@@ -249,28 +233,41 @@
  })
}
/** 新增按钮操作 */
const handleAdd = async (row?: DeptVO) => {
  reset();
  const res = await listDept();
  const data = proxy?.handleTree<DeptOptionsType>(res.data, "deptId");
  if (data) {
    deptOptions.value = data
    if (row && row.deptId) {
      form.value.parentId = row?.deptId;
    }
    dialog.visible = true;
    dialog.title = "添加部门";
  }
}
/** 修改按钮操作 */
const handleUpdate = async (row: DeptVO) => {
  reset();
  const res = await getDept(row.deptId);
  form.value = res.data
  const response = await listDeptExcludeChild(row.deptId);
  const data = proxy?.handleTree<DeptOptionsType>(response.data, "deptId")
  if (data) {
    deptOptions.value = data;
    if (data.length === 0) {
      const noResultsOptions: DeptOptionsType = {
        deptId: res.data.parentId,
        deptName: res.data.parentName,
        children: []
      };
      deptOptions.value.push(noResultsOptions);
    }
  }
  dialog.visible = true;
  dialog.title = "修改部门";
  await nextTick(async () => {
    reset();
    form.value = res.data
    const response = await listDeptExcludeChild(row.deptId);
    const data = proxy?.handleTree<DeptOptionsType>(response.data, "deptId")
    if (data) {
      deptOptions.value = data;
      if (data.length === 0) {
        const noResultsOptions: DeptOptionsType = {
          deptId: res.data.parentId,
          deptName: res.data.parentName,
          children: []
        };
        deptOptions.value.push(noResultsOptions);
      }
    }
  })
}
/** 提交按钮 */
const submitForm = () => {
src/views/system/dict/data.vue
@@ -251,12 +251,10 @@
}
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  form.value.dictType = queryParams.value.dictType;
  dialog.visible = true;
  dialog.title = "添加字典数据";
  nextTick(() => {
    reset();
    form.value.dictType = queryParams.value.dictType;
  })
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DictDataVO[]) => {
@@ -265,15 +263,13 @@
  multiple.value = !selection.length;
}
/** 修改按钮操作 */
const handleUpdate = (row?: DictDataVO) => {
const handleUpdate = async (row?: DictDataVO) => {
  reset();
  const dictCode = row?.dictCode || ids.value[0];
  const res = await getData(dictCode);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改字典数据";
  nextTick(async () => {
    const res = await getData(dictCode);
    reset();
    form.value = res.data;
  })
}
/** 提交按钮 */
const submitForm = () => {
src/views/system/dict/index.vue
@@ -204,11 +204,9 @@
}
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加字典类型";
  nextTick(() => {
    reset();
  })
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: DictTypeVO[]) => {
@@ -217,16 +215,13 @@
  multiple.value = !selection.length;
}
/** 修改按钮操作 */
const handleUpdate = (row?: DictTypeVO) => {
const handleUpdate = async (row?: DictTypeVO) => {
  reset();
  const dictId = row?.dictId || ids.value[0];
  const res = await getType(dictId);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改字典类型";
  const dictId = row?.dictId || ids.value[0];
  nextTick(async () => {
    reset();
    const res = await getType(dictId);
    form.value = res.data;
  })
}
/** 提交按钮 */
const submitForm = () => {
src/views/system/menu/index.vue
@@ -356,14 +356,11 @@
}
/** 新增按钮操作 */
const handleAdd = (row?: MenuVO) => {
  reset();
  getTreeselect();
  row && row.menuId ? form.value.parentId = row.menuId : form.value.parentId = 0;
  dialog.visible = true;
  dialog.title = "添加菜单";
  getTreeselect();
  nextTick(() => {
    reset();
    row && row.menuId ? form.value.parentId = row.menuId : form.value.parentId = 0;
  })
}
/** 展开/折叠操作 */
const handleToggleExpandAll = () => {
@@ -379,17 +376,14 @@
}
/** 修改按钮操作 */
const handleUpdate = async (row: MenuVO) => {
  reset();
  await getTreeselect();
  if (row.menuId) {
    const { data } = await getMenu(row.menuId);
    form.value = data;
  }
  dialog.visible = true;
  dialog.title = "修改菜单";
  await nextTick(async () => {
    if (row.menuId) {
      const { data } = await getMenu(row.menuId);
      reset();
      form.value = data;
    }
  })
}
/** 提交按钮 */
const submitForm = () => {
src/views/system/notice/index.vue
@@ -206,22 +206,18 @@
}
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加公告";
  nextTick(() => {
    reset();
  })
}
/**修改按钮操作 */
const handleUpdate = (row?: NoticeVO) => {
const handleUpdate = async (row?: NoticeVO) => {
  reset();
  const noticeId = row?.noticeId || ids.value[0];
  const { data } = await getNotice(noticeId);
  Object.assign(form.value, data);
  dialog.visible = true;
  dialog.title = "修改公告";
  nextTick(async () => {
    const noticeId = row?.noticeId || ids.value[0];
    reset();
    const { data } = await getNotice(noticeId);
    form.value = data;
  })
}
/** 提交按钮 */
const submitForm = () => {
src/views/system/oss/config.vue
@@ -64,7 +64,7 @@
            <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
        <el-table-column label="操作" fixed="right" align="center" width="150" class-name="small-padding">
          <template #default="scope">
            <el-tooltip content="修改" placement="top">
              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:oss:edit']"></el-button>
@@ -282,24 +282,18 @@
}
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加对象存储配置";
  nextTick(() => {
    reset();
  })
}
/** 修改按钮操作 */
const handleUpdate = (row?: OssConfigVO) => {
  loading.value = true;
const handleUpdate = async (row?: OssConfigVO) => {
  reset();
  const ossConfigId = row?.ossConfigId || ids.value[0];
  const res = await getOssConfig(ossConfigId);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改对象存储配置";
  const ossConfigId = row?.ossConfigId || ids.value[0];
  nextTick(async () => {
    reset();
    const res = await getOssConfig(ossConfigId);
    loading.value = false;
    form.value = res.data;
  })
}
/** 提交按钮 */
const submitForm = () => {
@@ -313,7 +307,7 @@
      }
      proxy?.$modal.msgSuccess("新增成功");
      dialog.visible = false;
      getList();
      await getList();
    }
  });
}
@@ -323,7 +317,7 @@
  try {
    await proxy?.$modal.confirm('确认要"' + text + '""' + row.configKey + '"配置吗?');
    await changeOssConfigStatus(row.ossConfigId, row.status, row.configKey);
    getList()
    await getList()
    proxy?.$modal.msgSuccess(text + "成功");
  } catch { return } finally {
    row.status = row.status === "0" ? "1" : "0";
@@ -336,7 +330,7 @@
  await proxy?.$modal.confirm('是否确认删除OSS配置编号为"' + ossConfigIds + '"的数据项?');
  loading.value = true;
  await delOssConfig(ossConfigIds).finally(() => loading.value = false);
  getList();
  await getList();
  proxy?.$modal.msgSuccess("删除成功");
}
src/views/system/oss/index.vue
@@ -15,7 +15,7 @@
            </el-form-item>
            <el-form-item label="创建时间">
              <el-date-picker
                v-model="daterangeCreateTime"
                v-model="dateRangeCreateTime"
                value-format="YYYY-MM-DD HH:mm:ss"
                type="daterange"
                range-separator="-"
@@ -151,7 +151,7 @@
const total = ref(0);
const type = ref(0);
const previewListResource = ref(true);
const daterangeCreateTime = ref<[DateModelType, DateModelType]>(['', '']);
const dateRangeCreateTime = ref<[DateModelType, DateModelType]>(['', '']);
const dialog = reactive<DialogOption>({
  visible: false,
@@ -195,7 +195,7 @@
  loading.value = true;
  const res = await proxy?.getConfigKey("sys.oss.previewListResource");
  previewListResource.value = res?.msg === undefined ? true : res.msg === 'true';
  const response = await listOss(proxy?.addDateRange(queryParams.value, daterangeCreateTime.value, "CreateTime"));
  const response = await listOss(proxy?.addDateRange(queryParams.value, dateRangeCreateTime.value, "CreateTime"));
  ossList.value = response.rows;
  total.value = response.total;
  loading.value = false;
@@ -225,7 +225,7 @@
/** 重置按钮操作 */
function resetQuery() {
  showTable.value = false;
  daterangeCreateTime.value = ['', ''];
  dateRangeCreateTime.value = ['', ''];
  queryFormRef.value?.resetFields();
  queryParams.value.orderByColumn = defaultSort.value.prop;
  queryParams.value.isAsc = defaultSort.value.order;
@@ -288,21 +288,17 @@
}
/** 文件按钮操作 */
const handleFile = () => {
  reset();
  type.value = 0;
  dialog.visible = true;
  dialog.title = "上传文件";
  nextTick(() => {
    reset();
    type.value = 0;
  })
}
/** 图片按钮操作 */
const handleImage = () => {
  reset();
  type.value = 1;
  dialog.visible = true;
  dialog.title = "上传图片";
  nextTick(() => {
    reset();
    type.value = 1;
  })
}
/** 提交按钮 */
const submitForm = () => {
@@ -319,7 +315,7 @@
  try {
    await proxy?.$modal.confirm('确认要"' + text + '""预览列表图片"配置吗?');
    await proxy?.updateConfigByKey("sys.oss.previewListResource", preview);
    getList()
    await getList()
    proxy?.$modal.msgSuccess(text + "成功");
  } catch { return }
}
@@ -329,7 +325,7 @@
  await proxy?.$modal.confirm('是否确认删除OSS对象存储编号为"' + ossIds + '"的数据项?');
  loading.value = true;
  await delOss(ossIds).finally(() => loading.value = false);
  getList();
  await getList();
  proxy?.$modal.msgSuccess("删除成功");
}
src/views/system/post/index.vue
@@ -192,22 +192,18 @@
}
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  dialog.visible = true;
  dialog.title = "添加岗位";
  nextTick(() => {
    reset();
  })
}
/** 修改按钮操作 */
const handleUpdate = (row?: PostVO) => {
const handleUpdate = async (row?: PostVO) => {
  reset();
  const postId = row?.postId || ids.value[0];
  const res = await getPost(postId);
  Object.assign(form.value, res.data);
  dialog.visible = true;
  dialog.title = "修改岗位";
  nextTick(async () => {
    reset();
    const postId = row?.postId || ids.value[0];
    const res = await getPost(postId);
    form.value = res.data;
  })
}
/** 提交按钮 */
const submitForm = () => {
src/views/system/role/index.vue
@@ -265,12 +265,10 @@
})
const { form, queryParams, rules } = toRefs(data)
const dialog = reactive<DialogOption>({
  visible: false,
  title: ''
});
/**
 * 查询角色列表
@@ -367,34 +365,27 @@
/** 添加角色 */
const handleAdd = () => {
  reset();
  getMenuTreeselect();
  dialog.visible = true;
  dialog.title = "添加角色";
  nextTick(() => {
    reset();
    getMenuTreeselect();
  })
}
/** 修改角色 */
const handleUpdate = async (row?: RoleVO) => {
  reset();
  const roleId = row?.roleId || ids.value[0]
  const roleMenu = getRoleMenuTreeselect(roleId)
  const { data } = await getRole(roleId);
  dialog.visible = true;
  Object.assign(form.value, data);
  form.value.roleSort = Number(form.value.roleSort);
  const res = await getRoleMenuTreeselect(roleId);
  dialog.title = "修改角色";
  await nextTick(() => {
    reset();
    Object.assign(form.value, data);
    form.value.roleSort = Number(form.value.roleSort);
    nextTick(async () => {
      const res = await roleMenu;
      let checkedKeys = res.checkedKeys;
      checkedKeys.forEach((v) => {
        nextTick(() => {
          menuRef.value?.setChecked(v, true, false);
        })
      })
  dialog.visible = true;
  res.checkedKeys.forEach((v) => {
    nextTick(() => {
      menuRef.value?.setChecked(v, true, false);
    })
  })
}
/** 根据角色ID查询菜单树结构 */
const getRoleMenuTreeselect = (roleId: string | number) => {
@@ -479,18 +470,13 @@
}
/** 分配数据权限操作 */
const handleDataScope = async (row: RoleVO) => {
  const roleDeptTreeselect = getRoleDeptTreeSelect(row.roleId);
  const response = await getRole(row.roleId);
  Object.assign(form.value, response.data);
  const res = await getRoleDeptTreeSelect(row.roleId);
  openDataScope.value = true;
  dialog.title = "分配数据权限";
  await nextTick(async () => {
    const res = await roleDeptTreeselect;
    await nextTick(() => {
      if (deptRef.value) {
        deptRef.value.setCheckedKeys(res.checkedKeys);
      }
    })
  await nextTick(() => {
    deptRef.value?.setCheckedKeys(res.checkedKeys);
  })
}
/** 提交按钮(数据权限) */
src/views/system/tenant/index.vue
@@ -66,7 +66,7 @@
            <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <el-table-column width="150" label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
          <template #default="scope">
            <el-tooltip content="修改" placement="top">
              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:tenant:edit']"></el-button>
@@ -275,27 +275,21 @@
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  getTenantPackage();
  dialog.visible = true;
  dialog.title = "添加租户";
  nextTick(() => {
    reset();
    getTenantPackage();
  })
}
/** 修改按钮操作 */
const handleUpdate = (row?: TenantVO) => {
  loading.value = true;
const handleUpdate = async (row?: TenantVO) => {
  reset();
  await getTenantPackage();
  const _id = row?.id || ids.value[0];
  const res = await getTenant(_id);
  Object.assign(form.value, res.data)
  dialog.visible = true;
  dialog.title = "修改租户";
  nextTick(async () => {
    reset();
    await getTenantPackage();
    const _id = row?.id || ids.value[0];
    const res = await getTenant(_id);
    loading.value = false;
    Object.assign(form.value, res.data)
  })
}
/** 提交按钮 */
@@ -310,7 +304,7 @@
      }
      proxy?.$modal.msgSuccess("操作成功");
      dialog.visible = false;
      getList();
      await getList();
    }
  });
}
src/views/system/tenantPackage/index.vue
@@ -267,34 +267,24 @@
/** 新增按钮操作 */
const handleAdd = () => {
  reset();
  getMenuTreeselect();
  dialog.visible = true;
  dialog.title = "添加租户套餐";
  nextTick(() => {
    reset();
    getMenuTreeselect();
  });
};
/** 修改按钮操作 */
const handleUpdate = (row?: TenantPkgVO) => {
  loading.value = true;
const handleUpdate = async (row?: TenantPkgVO) => {
  reset();
  const _packageId = row?.packageId || ids.value[0];
  const response = await getTenantPackage(_packageId);
  form.value = response.data;
  const res = await getPackageMenuTreeselect(_packageId);
  dialog.visible = true;
  dialog.title = "修改租户套餐";
  nextTick(async () => {
    reset();
    const _packageId = row?.packageId || ids.value[0];
    const packageMenu = getPackageMenuTreeselect(_packageId);
    const response = await getTenantPackage(_packageId);
    loading.value = false;
    form.value = response.data;
    await nextTick(async () => {
      const res = await packageMenu;
      let checkedKeys = res.data.checkedKeys;
      checkedKeys.forEach((v) => {
        nextTick(() => {
          menuTreeRef.value?.setChecked(v, true, false);
        });
      });
  res.data.checkedKeys.forEach((v) => {
    nextTick(() => {
      menuTreeRef.value?.setChecked(v, true, false);
    });
  });
};
src/views/system/user/index.vue
@@ -154,7 +154,7 @@
    </el-row>
    <!-- 添加或修改用户配置对话框 -->
    <el-dialog :title="dialog.title" v-model="dialog.visible" width="600px" append-to-body @close="closeDialog">
    <el-dialog ref="formDialogRef" :title="dialog.title" v-model="dialog.visible" width="600px" append-to-body @close="closeDialog">
      <el-form :model="form" :rules="rules" ref="userFormRef" label-width="80px">
        <el-row>
          <el-col :span="12">
@@ -354,6 +354,7 @@
const queryFormRef = ref<ElFormInstance>();
const userFormRef = ref<ElFormInstance>();
const uploadRef = ref<ElUploadInstance>();
const formDialogRef = ref<ElDialogInstance>();
const dialog = reactive<DialogOption>({
  visible: false,
@@ -547,40 +548,35 @@
}
/** 取消按钮 */
const cancel = () => {
  reset();
  dialog.visible = false;
  reset();
}
/** 新增按钮操作 */
const handleAdd = () => {
const handleAdd = async () => {
  reset();
  const { data } = await api.getUser();
  dialog.visible = true;
  dialog.title = "新增用户";
  nextTick(async () => {
    reset();
    await initTreeData();
    const { data } = await api.getUser();
    postOptions.value = data.posts;
    roleOptions.value = data.roles;
    form.value.password = initPassword.value;
  })
  await initTreeData();
  postOptions.value = data.posts;
  roleOptions.value = data.roles;
  form.value.password = initPassword.value;
}
/** 修改按钮操作 */
const handleUpdate = (row?: UserForm) => {
const handleUpdate = async (row?: UserForm) => {
  reset();
  const userId = row?.userId || ids.value[0]
  const { data } = await api.getUser(userId)
  dialog.visible = true;
  dialog.title = "修改用户";
  nextTick(async () => {
    reset();
    await initTreeData();
    const userId = row?.userId || ids.value[0]
    const { data } = await api.getUser(userId)
    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 = "";
  })
  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 = "";
}
/** 提交按钮 */
src/views/tool/gen/index.vue
@@ -240,7 +240,7 @@
  const tableIds = row?.tableId || ids.value;
  await proxy?.$modal.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?');
  await delTable(tableIds);
  getList();
  await getList();
  proxy?.$modal.msgSuccess('删除成功');
}