Преглед на файлове

fix: 修改指标库以及密码修改和考核管理

username преди 1 седмица
родител
ревизия
a5120ba21f

+ 1 - 1
.vscode/settings.json

@@ -7,7 +7,7 @@
   "editor.tabSize": 2,
   "editor.formatOnPaste": true,
   "editor.guides.bracketPairs": "active",
-  "files.autoSave": "afterDelay",
+  "files.autoSave": "off",
   "git.confirmSync": false,
   "workbench.startupEditor": "newUntitledFile",
   "editor.suggestSelection": "first",

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

@@ -30,6 +30,7 @@ const handleNodeClick = (data: any, userType: string) => {
   }
   postOrganizationUserPageApi();
 };
+const loading = ref(true);
 const postOrganizationUserPageApi = async () => {
   if ($route.name == "users") {
     tableData.params.organizationType = "group";
@@ -41,6 +42,7 @@ const postOrganizationUserPageApi = async () => {
   if (code == 200) {
     tableData.list = data.records;
     tableData.total = data.totalRow;
+    loading.value = false;
   } else {
     ElMessage.error(msg);
   }
@@ -87,6 +89,7 @@ const getTime = day => {
     </div>
     <el-table
       v-if="(tableData.params.organizationType = 'dept')"
+      v-loading="loading"
       :data="tableData.list"
       style="width: 100%"
     >

+ 3 - 3
src/router/utils.ts

@@ -43,9 +43,9 @@ const muenList = [
   password
 ];
 const btnList = ref([]);
-getMenuListForUser().then(({ data }) => {
-  console.log("dataqqqqAAA", data);
-});
+// getMenuListForUser().then(({ data }) => {
+//   console.log("dataqqqqAAA", data);
+// });
 // ------------------------------------
 const IFrame = () => import("@/layout/frameView.vue");
 // https://cn.vitejs.dev/guide/features.html#glob-import

+ 1 - 7
src/views/background/framework/proson/components/addPerson.vue

@@ -40,11 +40,6 @@ const postDeptUserAddApi = async () => {
     });
     postOrganizationUserPage.value();
     dialogVisibleAdd.value = false;
-  } else {
-    ElMessage({
-      message: msg,
-      type: "error"
-    });
   }
 };
 // 部门树
@@ -57,7 +52,6 @@ const postListTreeApi = async () => {
 };
 // 添加部门保存
 const saveDepartment = () => {
-  console.log("保存");
   formRef.value.validate(valid => {
     if (valid) {
       postDeptUserAddApi();
@@ -127,7 +121,7 @@ defineExpose({
 
 <template>
   <div>
-    <el-dialog v-model="dialogVisibleAdd" title="添加员" width="500">
+    <el-dialog v-model="dialogVisibleAdd" title="添加员" width="500">
       <el-form
         ref="formRef"
         :model="form"

+ 11 - 11
src/views/background/framework/proson/components/newDepartment.vue

@@ -45,16 +45,16 @@ const userList = ref({
   username: "",
   password: ""
 });
-const postUserListApi = async () => {
-  // @ts-ignore
-  userList.value.username = encryption(localStorage.getItem("rolesName"));
-  // @ts-ignore
-  userList.value.password = encryption(localStorage.getItem("password"));
-  const { code, data } = await postUserList(userList.value);
-  if (code === 200) {
-    optiones.leaderOptions = data;
-  }
-};
+// const postUserListApi = async () => {
+//   // @ts-ignore
+//   userList.value.username = encryption(localStorage.getItem("rolesName"));
+//   // @ts-ignore
+//   userList.value.password = encryption(localStorage.getItem("password"));
+//   const { code, data } = await postUserList(userList.value);
+//   if (code === 200) {
+//     optiones.leaderOptions = data;
+//   }
+// };
 const handleClose = () => {
   formRef.value.clearValidate(); // 清除验证错误
   formRef.value.resetFields(); // 重置表单字段
@@ -76,7 +76,7 @@ const saveDepartment = () => {
 const open = node => {
   console.log(node, "-------");
   dialogVisibleAdd.value = true;
-  postUserListApi();
+  // postUserListApi();
   if (node) {
     // form.leader
     form.deptName = "";

+ 1 - 1
src/views/background/framework/proson/components/personDetailsDrawer.vue

@@ -150,7 +150,7 @@ const rules = reactive({
       :before-close="handleClose"
     >
       <template #header>
-        <h4>员详情</h4>
+        <h4>员详情</h4>
       </template>
       <template #default>
         <div>

+ 4 - 4
src/views/background/framework/proson/components/prosonEditDrawer.vue

@@ -30,10 +30,10 @@ const userList = ref({
   deptCode: ""
 });
 const postUserListApi = async () => {
-  // @ts-ignore
-  userList.value.username = encryption(localStorage.getItem("rolesName"));
-  // @ts-ignore
-  userList.value.password = encryption(localStorage.getItem("password"));
+  // // @ts-ignore
+  // userList.value.username = encryption(localStorage.getItem("rolesName"));
+  // // @ts-ignore
+  // userList.value.password = encryption(localStorage.getItem("password"));
   userList.value.deptCode = formLabelAlign.deptCode;
   const { code, data } = await postUserList(userList.value);
   if (code === 200) {

+ 2 - 2
src/views/background/framework/proson/prosonDepartment.vue

@@ -114,7 +114,7 @@ const deleteDepartment = node => {
 // 添加成员弹窗
 const AddPerson = () => {
   // postOrganizationUserPageApi
-  console.log("添加成员");
+
   addPersonDrawerRef.value.open(
     deptList.value,
     UserTable.value.postOrganizationUserPageApi
@@ -274,7 +274,7 @@ watch(realName, val => {
       <UserPageTable ref="UserTable">
         <template #add-button>
           <Auth :value="['添加成员']">
-            <el-button type="primary" @click="AddPerson">新建员</el-button>
+            <el-button type="primary" @click="AddPerson">新建员</el-button>
           </Auth>
         </template>
         <template #actions="{ row }">

+ 88 - 59
src/views/evaluate/children/change/manage/addExam.vue

@@ -30,9 +30,10 @@ const form = reactive({
   cycle: "月度",
   cycleValue: "",
   assessmentType: null,
-  assessmentObjectList: [
+  listArr: [
     {
       assessmentObjectId: "",
+      idList: [],
       assessmentObjectName: "",
       assessmentModelId: "",
       assessmentModelName: ""
@@ -61,12 +62,25 @@ const handleClose = () => {
   //     // catch error
   //   });
 };
+const arrList = ref([]); // 考核对象与模版设置
+const transformArrayFormat = data => {
+  return data
+    .map(item => {
+      return item.idList.map((id, index) => {
+        return {
+          assessmentObjectId: item.assessmentObjectId[index],
+          assessmentObjectName: item.assessmentObjectName[index],
+          assessmentModelId: item.assessmentModelId,
+          assessmentModelName: item.assessmentModelName
+        };
+      });
+    })
+    .flat();
+};
 // 添加部门保存
 const saveDepartment = async () => {
   form.cycleValue = dayjs(form.cycleValue).format(format.value);
-  //
-  console.log("form", dayjs(form.cycleValue).format(format.value));
-  console.log(form, "获取的数据");
+  form.assessmentObjectList = transformArrayFormat(form.listArr);
   const { code, msg } = await postAddAssessment(form);
   if (code === 200) {
     ElMessage({
@@ -86,8 +100,9 @@ const open = (item: any, index: string) => {
     cycle: "月度",
     cycleValue: "",
     assessmentType: null,
-    assessmentObjectList: [
+    listArr: [
       {
+        idList: [],
         assessmentObjectId: null,
         assessmentObjectName: null,
         assessmentModelId: null,
@@ -101,16 +116,18 @@ const open = (item: any, index: string) => {
   dialogVisibleAdd.value = true;
 };
 const addNew = () => {
-  form.assessmentObjectList.push({
+  form.listArr.push({
     assessmentObjectId: "",
+    idList: [],
     assessmentObjectName: "",
     assessmentModelId: "",
     assessmentModelName: ""
   });
+  arrList.value.push([]);
   // form.assessmentObjectList.left.push({ value: "" });
 };
 const deleteItem = (index: any) => {
-  form.assessmentObjectList.splice(index, 1);
+  form.listArr.splice(index, 1);
   // form.assessmentObjectList.right.splice(index, 1);
 };
 // 单选
@@ -119,9 +136,7 @@ const quarterValue = ref(true);
 const format = ref<any>("YYYY-MM");
 const pickerType = ref<any>("month");
 const handleRegionChange = (value: any) => {
-  console.log(value);
   timeType.value = value;
-  console.log("111", form.cycleValue);
   switch (value) {
     case "年度":
       form.cycleValue = "";
@@ -200,57 +215,76 @@ const templateparams = reactive({
   pageSize: 100
 });
 const resTmp = ref([]);
-// const postListTreeWithUserApi = async () => {
-//   const res = await postListTreeWithUser();
 
-//   console.log("人员", res.data);
-//   console.log("人员", transformData(res.data));
-//   treeDept.value = [];
-//   let aa = res.data;
-//   treeDept.value = transformData(aa);
-// };
+// 医疗 -- 部门负责人
+const selectRefs = ref();
+const handChange = index => {
+  const arr = treeDeptList.value.filter(item => {
+    return form.listArr[index].idList.includes(item.userCode);
+  });
+  form.listArr[index].assessmentObjectId = arr.map(item => item.userCode);
+  form.listArr[index].assessmentObjectName = arr.map(item => item.realName);
+};
+
 const assessmentTypeRef = ref();
 const handleRreeSelect = index => {
-  const node = assessmentTypeRef.value[index].getCheckedNodes();
-  form.assessmentObjectList[index].assessmentObjectName =
-    node[node.length - 1].deptName;
+  const arr = assessmentTypeRef.value[index].getCheckedNodes().filter(item => {
+    return item.children.length == 0;
+  });
+  form.listArr[index].assessmentObjectId = arr.map(item => item.value);
+  form.listArr[index].assessmentObjectName = arr.map(item => item.label);
 };
 const handleSelect = index => {
-  // console.log(index,'form.assessmentObjectList',form.assessmentObjectList[index].am);
-  form.assessmentObjectList[index].assessmentModelName =
-    form.assessmentObjectList[index].am.tpName;
-  form.assessmentObjectList[index].assessmentModelId =
-    form.assessmentObjectList[index].am.id;
-  // resTmp.value.map(item => {
-  //   console.log(item);
-  //   if (item.id == node) {
-  //     form.assessmentObjectList.assessmentModelName = item.tpName;
-  //   }
-  // });
+  form.listArr[index].assessmentModelName = form.listArr[index].am.tpName;
+  form.listArr[index].assessmentModelId = form.listArr[index].am.id;
 };
 const aaaa = a => {
   console.log(a);
 };
 // 考核类型
 const dpetTree = ref();
+// 转换函数 --- 部门
+const convertDepartmentDataRecursive = data => {
+  return data.map(department => {
+    const { deptCode, deptName, childrenRes } = department;
+    return {
+      value: deptCode,
+      label: deptName,
+      children:
+        childrenRes.length > 0
+          ? childrenRes.map(child => convertDepartmentDataRecursive([child])[0])
+          : []
+    };
+  });
+};
+// 转换函数 --- 人员
+const convertDepartmentDataRecursive_Person = data => {
+  return data.map(department => {
+    const { userNameNew, userCodeNew, children } = department;
+    return {
+      value: userCodeNew,
+      label: userNameNew,
+      children:
+        children.length > 0
+          ? children.map(
+              child => convertDepartmentDataRecursive_Person([child])[0]
+            )
+          : []
+    };
+  });
+};
+const treeDeptListOkay = ref([]);
 const assessmentTypeApi = async value => {
   // 人员,医疗组,负责人
   const { data, code } = await getTemplateInfoList(templateparams);
   resTmp.value = data.records;
-  console.log(value);
-  // treeDept
-  //   postUserList,
-  // postOrganizationUserPage,
-  // getLeaderList
-  const password = localStorage.getItem("password");
-  const rolesName = localStorage.getItem("rolesName");
   switch (value) {
     case 0:
       postListTreeWithUserApi();
       break;
     case 1:
       const { data, code } = await postListTree();
-      dpetTree.value = data;
+      dpetTree.value = convertDepartmentDataRecursive(data);
       break;
     case 2:
       const yiliao = await postOrganizationUserPage({
@@ -270,6 +304,7 @@ const monthTime = ref("");
 defineExpose({
   open
 });
+const idList = ref([]);
 </script>
 
 <template>
@@ -386,51 +421,45 @@ defineExpose({
             <div class="w-1/3">
               <el-form
                 label-position="top"
-                :model="form.assessmentObjectList"
+                :model="form.listArr"
                 :rules="formLeftRules"
               >
                 <el-form-item label="被考核对象" prop="left">
                   <div
-                    v-for="(item, index) in form.assessmentObjectList"
+                    v-for="(item, index) in form.listArr"
                     :key="index"
                     class="w-full mt-1"
                   >
                     <el-tree-select
                       v-if="form.assessmentType === 0"
                       ref="assessmentTypeRef"
-                      v-model="item.assessmentObjectId"
-                      :data="treeDept"
+                      v-model="item.idList"
+                      multiple
+                      :data="convertDepartmentDataRecursive_Person(treeDept)"
                       :render-after-expand="false"
                       show-checkbox
-                      :props="{
-                        label: 'userNameNew',
-                        value: 'userCodeNew',
-                        children: 'children'
-                      }"
                       style="width: 180px"
                       @check-change="handleRreeSelect(index)"
                     />
                     <el-tree-select
                       v-if="form.assessmentType === 1"
                       ref="assessmentTypeRef"
-                      v-model="item.assessmentObjectId"
+                      v-model="item.idList"
                       :data="dpetTree"
-                      :render-after-expand="false"
                       show-checkbox
-                      :props="{
-                        label: 'deptName',
-                        value: 'deptCode',
-                        children: 'childrenRes'
-                      }"
+                      multiple
                       style="width: 180px"
+                      :render-after-expand="false"
                       @check-change="handleRreeSelect(index)"
                     />
                     <el-select
                       v-if="
                         form.assessmentType != 0 && form.assessmentType != 1
                       "
-                      v-model="item.assessmentObjectId"
-                      @change="handChange"
+                      ref="selectRefs"
+                      v-model="item.idList"
+                      multiple
+                      @change="handChange(index)"
                     >
                       <el-option
                         v-for="(it, id) in treeDeptList"
@@ -446,12 +475,12 @@ defineExpose({
             <div class="w-1/2 ml-7">
               <el-form
                 label-position="top"
-                :model="form.assessmentObjectList"
+                :model="form.listArr"
                 :rules="formRightRules"
               >
                 <el-form-item label="考核模板" prop="right">
                   <div
-                    v-for="(item, index) in form.assessmentObjectList"
+                    v-for="(item, index) in form.listArr"
                     :key="index"
                     class="w-full flex mt-1"
                   >

+ 29 - 4
src/views/evaluate/children/change/mould/manageObject.vue

@@ -66,12 +66,16 @@ const initParams = reactive({
   Indexlist: [],
   tmpList: []
 });
+const state = reactive({
+  tableType: 0
+});
 onMounted(() => {
   console.log("dsafa", messageData.value);
   Object.assign(messageData.value, $props.message);
   initParams.params.assessmentId = $props.message.id;
   initParams.objParams.assessmentId = $props.message.id;
   initParams.indexParams.assessmentId = $props.message.id;
+  state.tableType = $props.message.assessmentType;
   getAssessmentQuotaDetailsApi();
   getTemplateInfoListApi();
   postListTreeWithUserApi();
@@ -199,7 +203,6 @@ const getAssessmentObjectDetailsApi = async () => {
     objList.value = data.records;
     initParams.total = data.totalRow;
   }
-  console.log("考核对象", data);
 };
 const handleSizeChange = (val: number) => {
   initParams.objParams.pageSize = val;
@@ -332,9 +335,30 @@ const editClosedEvent = ({ row, column }) => {
           @selection-change="changeSelection"
         >
           <el-table-column type="selection" width="55" />
-          <el-table-column prop="realName" label="人员" width="100" />
-          <el-table-column prop="userName" label="工号" width="180" />
-          <el-table-column prop="deptName" label="科室" width="180" />
+          <el-table-column
+            v-if="state.tableType == 1 || state.tableType == 2"
+            prop="realName"
+            label="人员"
+            width="100"
+          />
+          <el-table-column
+            v-if="state.tableType == 3"
+            prop="assessmentObjectName"
+            label="医疗组"
+            width="100"
+          />
+          <el-table-column
+            v-if="state.tableType == 1 || state.tableType == 2"
+            prop="userName"
+            label="工号"
+            width="180"
+          />
+          <el-table-column
+            v-if="state.tableType != 3"
+            prop="deptName"
+            label="科室"
+            width="180"
+          />
           <el-table-column
             prop="assessmentModelName"
             label="考核模板"
@@ -450,6 +474,7 @@ const editClosedEvent = ({ row, column }) => {
           <el-table-column prop="finalValue" label="完成值" width="180" />
           <el-table-column prop="score" label="得分" width="180" />
           <el-table-column prop="updateTime" label="更新时间" width="150" sortable>
+          <el-table-column prop="updateTime" label="更新时间" width="150" sortable>
             <template #default="{ row }">
               {{ dayjs(row.updateTime).format("YYYY-MM-DD HH:mm:ss") }}
             </template>

+ 107 - 8
src/views/evaluate/children/change/mould/message.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, reactive, nextTick, onMounted } from "vue";
+import { ref, reactive, nextTick, onMounted, onActivated } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { Calendar } from "@element-plus/icons-vue";
 import { getAssessmentDetails } from "@/api/assessment";
@@ -8,6 +8,12 @@ import { postAddAssessment, updateAssessment } from "@/api/assessment";
 import { postListTreeWithUser } from "@/api/department";
 import { getTemplateInfoList } from "@/api/templateInfo";
 import ElPicker from "@/components/ELPicker/index.vue";
+// 人员,医疗组,负责人
+import {
+  postUserList,
+  postOrganizationUserPage,
+  getLeaderList
+} from "@/api/userSetting";
 const $emit = defineEmits(["addHandClick"]);
 const $props = defineProps({
   id: {
@@ -17,9 +23,7 @@ const $props = defineProps({
 const params = reactive({
   id: $props.id
 });
-onMounted(() => {
-  console.log("onMountedsdada", $props.id);
-});
+
 const dialogVisibleAdd = ref(false);
 const btn = ref(true);
 const btnShow = () => {
@@ -78,8 +82,6 @@ const quarterValue = ref(true);
 const format = ref<any>("YYYY-MM");
 const pickerType = ref<any>("month");
 const handleRegionChange = (value: any) => {
-  console.log(value);
-  // form.date1 = "";
   timeType.value = value;
   switch (value) {
     case "年度":
@@ -144,7 +146,6 @@ const monthOne = item => {
       break;
   }
   form.cycleValue = `${yearTime.value}年${item}`;
-  console.log(start, end);
   // return `从 ${start} 到 ${end}`; // 设置时间区间
 };
 // 部门人员与考核模板数据
@@ -159,9 +160,59 @@ const postListTreeWithUserApi = async () => {
   const { data, code } = await getTemplateInfoList(templateparams);
   resTmp.value = data.records;
   treeDept.value = [];
-  console.log("1111", res.data);
   treeDept.value = transformData(res.data);
 };
+const treeDept_person = ref([]);
+
+const transformData_person = (
+  data,
+  newDeptCodeKey = "userCodeNew",
+  newDeptNameKey = "userNameNew"
+) => {
+  return data.map(item => {
+    const newItem = { ...item };
+    newItem.children = [
+      ...(newItem.childrenUserRes || []).map(child => ({
+        ...child
+      }))
+    ];
+    delete newItem.childrenUserRes;
+    delete newItem.childrenRes;
+
+    // 重命名属性
+    newItem.children = newItem.children.map(child => {
+      const newChild = { ...child };
+      newChild.userNameNew = child.realName;
+      newChild.userCodeNew = child.userCode;
+      return newChild;
+    });
+
+    // 递归处理子节点
+    if (newItem.children && newItem.children.length) {
+      newItem.children = transformData_person(
+        newItem.children,
+        newDeptCodeKey,
+        newDeptNameKey
+      );
+    }
+    return newItem;
+  });
+};
+// 获取人员的数据
+const getPersonList = async () => {
+  const res = await postListTreeWithUser();
+  let treeList = res.data.map(item => {
+    return {
+      childrenRes: item.childrenRes,
+      childrenUserRes: item.childrenUserRes,
+      userCodeNew: item.deptCode,
+      userNameNew: item.deptName
+    };
+  });
+  treeDept_person.value = transformData_person(treeList);
+  console.log(treeDept_person.value, "人员获取的值");
+};
+
 postListTreeWithUserApi();
 function transformData(arr) {
   return arr.map(item => {
@@ -181,10 +232,25 @@ function transformData(arr) {
   });
 }
 // 详情
+const treeDeptList = ref([]);
 const getAssessmentDetailsApi = async () => {
   const { data, code, msg } = await getAssessmentDetails({ id: params.id });
   if (code === 200) {
     Object.assign(form, data);
+    console.log(form, "获取的值");
+    if (form.assessmentType === 1) {
+      postListTreeWithUserApi();
+    } else if (form.assessmentType === 0) {
+      getPersonList();
+    } else if (form.assessmentType === 2) {
+      const yiliao = await postOrganizationUserPage({
+        organizationType: "group",
+        pageNumber: 1,
+        pageSize: 1000
+      });
+      treeDeptList.value = yiliao.data.records;
+      console.log("获取的医疗组的值", treeDeptList.value);
+    }
   } else {
     ElMessage.error(msg);
   }
@@ -200,6 +266,9 @@ const updateAssessmentApi = async () => {
     ElMessage.error(msg);
   }
 };
+onMounted(() => {
+  console.log("onMountedsdada", $props.id);
+});
 </script>
 
 <template>
@@ -330,6 +399,7 @@ const updateAssessmentApi = async () => {
                   class="w-full mt-1"
                 >
                   <el-tree-select
+                    v-if="form.assessmentType === 1"
                     v-model="item.assessmentObjectId"
                     :data="treeDept"
                     :render-after-expand="false"
@@ -342,6 +412,35 @@ const updateAssessmentApi = async () => {
                     }"
                     style="width: 180px"
                   />
+                  <!-- 员工多个 -->
+                  <el-tree-select
+                    v-if="form.assessmentType === 0"
+                    v-model="item.assessmentObjectId"
+                    :data="treeDept_person"
+                    :render-after-expand="false"
+                    show-checkbox
+                    disabled
+                    style="width: 180px"
+                    :props="{
+                      label: 'userNameNew',
+                      value: 'userCodeNew',
+                      children: 'children'
+                    }"
+                  />
+
+                  <!-- 医疗组,负责人 -->
+                  <el-select
+                    v-if="form.assessmentType != 0 && form.assessmentType != 1"
+                    v-model="item.assessmentObjectId"
+                    disabled
+                  >
+                    <el-option
+                      v-for="(it, id) in treeDeptList"
+                      :key="id"
+                      :label="it.realName"
+                      :value="it.userCode"
+                    />
+                  </el-select>
                 </div>
               </el-form-item>
             </el-form>

+ 15 - 4
src/views/indexDefine/children/components/dialog.vue

@@ -61,8 +61,9 @@ const rules = reactive({
   source: [{ required: true, message: "来源", trigger: "blur" }],
   statue: [{ required: true, message: "请填写选择状态", trigger: "blur" }]
 });
-const close = () => {
+const close = (formEl: FormInstance | undefined) => {
   visible.value = false;
+  formEl.resetFields();
   emit("closeDialog");
 };
 const save = () => {
@@ -85,10 +86,20 @@ const open = () => {
 defineExpose({
   open
 });
+const handleClose = (done: () => void) => {
+  close(ruleFormRef.value);
+  done();
+};
 </script>
 
 <template>
-  <el-dialog v-model="visible" title="新建指标" width="480">
+  <el-dialog
+    v-model="visible"
+    title="新建指标"
+    width="480"
+    :close-on-click-modal="false"
+    :before-close="handleClose"
+  >
     <div class="m-auto w-full">
       <el-form
         ref="ruleFormRef"
@@ -151,7 +162,7 @@ defineExpose({
         <el-form-item label="状态" prop="statue">
           <el-select v-model="form.statue" placeholder="请选择">
             <el-option label="草稿" value="0" />
-            <el-option label="发布" value="1" />
+            <el-option label="上架" value="1" />
             <el-option label="下架" value="2" />
           </el-select>
         </el-form-item>
@@ -159,7 +170,7 @@ defineExpose({
     </div>
     <template #footer>
       <div class="dialog-footer">
-        <el-button @click="close">取消</el-button>
+        <el-button @click="close(ruleFormRef)">取消</el-button>
         <el-button type="primary" @click="save">保存</el-button>
       </div>
     </template>

+ 31 - 13
src/views/indexDefine/children/define.vue

@@ -28,11 +28,11 @@ onMounted(() => {
 const options = [
   {
     value: "0",
-    label: "草稿"
+    label: "草 稿"
   },
   {
     value: "1",
-    label: "已发布"
+    label: "已上架"
   },
   {
     value: "2",
@@ -96,12 +96,10 @@ const delQuotaApi = async row => {
   }
 };
 const setDelete = row => {
-  console.log(row);
   ElMessageBox.confirm("指标删除后无法恢复", "确定要删除这项指标吗", {
     confirmButtonText: "确认",
     cancelButtonText: "取消",
-    type: "warning",
-    icon: markRaw(Delete)
+    type: "warning"
   })
     .then(() => {
       delQuotaApi(row);
@@ -271,8 +269,12 @@ const formattedTime = time => {
             width="100"
             show-overflow-tooltip
           />
-          <el-table-column prop="name" label="指标名称" />
-          <el-table-column prop="categoryName" label="指标分类" />
+          <el-table-column prop="name" label="指标名称" show-overflow-tooltip />
+          <el-table-column
+            prop="categoryName"
+            label="指标分类"
+            show-overflow-tooltip
+          />
           <el-table-column prop="address" label="状态">
             <template #default="{ row }">
               <el-tag :type="getStateType(row.statue)">
@@ -290,7 +292,11 @@ const formattedTime = time => {
             label="指标口径"
             show-overflow-tooltip
           />
-          <el-table-column prop="source" label="数据来源" />
+          <el-table-column
+            prop="source"
+            label="数据来源"
+            show-overflow-tooltip
+          />
           <el-table-column prop="updateTime" label="更新时间" sortable>
             <template #default="{ row }">
               {{ formattedTime(row.updateTime) }}
@@ -306,14 +312,18 @@ const formattedTime = time => {
                     class="el-dropdown-link navbar-bg-hover select-none pt-1"
                   >
                     <!-- <el-text type="primary" @click="setEdit(row)">编辑</el-text>-->
-                    <el-icon @click="setEdit(row)"><Edit /></el-icon>
+                    <el-icon @click="setEdit(row)">
+                      <Edit />
+                    </el-icon>
                   </span>
                 </el-dropdown>
               </Auth>
               <el-dropdown class="ml-2" trigger="click">
                 <span class="el-dropdown-link navbar-bg-hover select-none pt-1">
                   <!--<el-text type="primary">更多</el-text>-->
-                  <el-icon><More /></el-icon>
+                  <el-icon>
+                    <More />
+                  </el-icon>
                 </span>
                 <template #dropdown>
                   <el-dropdown-menu class="setting">
@@ -322,10 +332,16 @@ const formattedTime = time => {
                         <el-text type="danger">删除</el-text>
                       </el-dropdown-item>
                     </Auth>
-                    <el-dropdown-item @click="release(row)">
+                    <el-dropdown-item
+                      v-if="row.statue != 1"
+                      @click="release(row)"
+                    >
                       发布
                     </el-dropdown-item>
-                    <el-dropdown-item @click="offShelf(row)">
+                    <el-dropdown-item
+                      v-if="row.statue != 2"
+                      @click="offShelf(row)"
+                    >
                       下架
                     </el-dropdown-item>
                     <el-dropdown-item @click="logs(row)">
@@ -374,7 +390,9 @@ const formattedTime = time => {
 }
 
 ::v-deep .el-table .el-table__header th {
-  background-color: #f2f3f5; /* 设置背景色 */
+  background-color: #f2f3f5;
+
+  /* 设置背景色 */
 }
 
 ::v-deep .el-table .el-table__cell {

+ 4 - 7
src/views/login/index.vue

@@ -47,7 +47,7 @@ const ruleForm = reactive({
 });
 const handleBlur = () => {
   // @ts-ignore
-  localStorage.setItem("password", ruleForm.password);
+  // localStorage.setItem("password", ruleForm.password);
   // @ts-ignore
   localStorage.setItem("rolesName", ruleForm.username);
 };
@@ -81,15 +81,10 @@ const onLogin = async (formEl: FormInstance | undefined) => {
             });
             // router.push("/");
             console.log("登录成功", res);
-          } else {
-            loading.value = false;
-            // @ts-ignore
-            message(res.msg, { type: "error" });
           }
         })
         .catch(err => {
           loading.value = false;
-          message(err, { type: "error" });
           return fields;
         });
     } else {
@@ -210,6 +205,8 @@ onBeforeUnmount(() => {
 }
 
 :deep(.el-input__prefix) {
-  font-size: 20px; /* 设置图标大小 */
+  font-size: 20px;
+
+  /* 设置图标大小 */
 }
 </style>

+ 18 - 29
src/views/password/index.vue

@@ -14,12 +14,11 @@ const formLabelAlign = reactive({
   newPwd: "",
   reNewPwd: ""
 });
-const passWord = ref("");
-passWord.value = localStorage.getItem("password");
+// const passWord = ref("");
+// passWord.value = localStorage.getItem("password");
 formLabelAlign.name = localStorage.getItem("userName");
 const UpdatePasswordApi = async () => {
   formRef.value.validate(async (valid: boolean) => {
-    console.log(valid);
     if (valid) {
       const { code } = await postUpdatePassword(formLabelAlign);
       if (code === 200) {
@@ -27,19 +26,19 @@ const UpdatePasswordApi = async () => {
           message: "修改成功",
           type: "success"
         });
-        ElMessageBox.confirm("密码已修改请重新登录", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          localStorage.clear();
-          router.push("/login");
-        });
+        // ElMessageBox.confirm("密码已修改请重新登录", {
+        //   confirmButtonText: "确定",
+        //   cancelButtonText: "取消",
+        //   type: "warning"
+        // }).then(() => {
+        //   localStorage.clear();
+        //   router.push("/login");
+        // });
       } else {
-        ElMessage({
-          message: "修改失败",
-          type: "error"
-        });
+        // ElMessage({
+        //   message: "修改失败",
+        //   type: "error"
+        // });
       }
     } else {
       return;
@@ -47,19 +46,7 @@ const UpdatePasswordApi = async () => {
   });
 };
 const rules = {
-  oldPwd: [
-    { required: true, message: "请输入密码", trigger: "blur" }
-    // {
-    //   validator: (rule, value, callback) => {
-    //     if (value !== passWord.value) {
-    //       callback(new Error("旧密码不正确"));
-    //     } else {
-    //       callback();
-    //     }
-    //   },
-    //   trigger: "blur"
-    // }
-  ],
+  oldPwd: [{ required: true, message: "请输入密码", trigger: "blur" }],
   newPwd: [
     { required: true, message: "请输入 6 - 14 位密码", trigger: "blur" },
     {
@@ -101,13 +88,14 @@ const rules = {
         <el-input v-model="formLabelAlign.name" disabled />
       </el-form-item>
       <el-form-item label="旧密码" prop="oldPwd">
-        <el-input v-model="formLabelAlign.oldPwd" />
+        <el-input v-model="formLabelAlign.oldPwd" placeholder="请输入密码" />
       </el-form-item>
       <el-form-item label="新密码" prop="newPwd">
         <el-input
           v-model="formLabelAlign.newPwd"
           type="password"
           show-password
+          placeholder="请输入 6 - 14 位密码"
         />
       </el-form-item>
       <el-form-item label="再次输入密码" prop="reNewPwd">
@@ -115,6 +103,7 @@ const rules = {
           v-model="formLabelAlign.reNewPwd"
           type="password"
           show-password
+          placeholder="请输入 6 - 14 位密码"
         />
       </el-form-item>
       <el-form-item label="">