Bladeren bron

Merge branch 'dev' of http://111.2.21.141:33001/ystl_myq/hospital-project into dev

ystl_myq 1 week geleden
bovenliggende
commit
b1509a3de1

+ 5 - 3
.vscode/settings.json

@@ -2,7 +2,7 @@
   "editor.formatOnType": true,
   "editor.formatOnSave": true,
   "[vue]": {
-    "editor.defaultFormatter": "esbenp.prettier-vscode"
+    "editor.defaultFormatter": "Vue.volar"
   },
   "editor.tabSize": 2,
   "editor.formatOnPaste": true,
@@ -27,5 +27,7 @@
   "editor.codeActionsOnSave": {
     "source.fixAll.eslint": "explicit"
   },
-  "iconify.excludes": ["el"]
-}
+  "iconify.excludes": [
+    "el"
+  ]
+}

+ 1 - 1
src/api/indexDefine.ts

@@ -26,7 +26,7 @@ export const addQuota = data => {
 };
 // 删除
 export const delQuota = id => {
-  return http.request<QuotaPage>("get", `/quota/delQuota/id=${id}`);
+  return http.request<QuotaPage>("get", `/quota/delQuota/${id}`);
 };
 // 修改
 export const postUpdateDept = data => {

+ 11 - 0
src/api/roles.ts

@@ -1,3 +1,11 @@
+/*
+ * @Author: zhanghaifeng
+ * @Date: 2024-11-04 16:39:08
+ * @LastEditors: zhanghaifeng
+ * @LastEditTime: 2024-11-07 13:56:39
+ * @Description:
+ * @FilePath: /hospital-project/src/api/roles.ts
+ */
 import { http } from "@/utils/http";
 
 type pageRole = {
@@ -30,6 +38,9 @@ export const postAddRole = data => {
 export const postUpdateRole = data => {
   return http.request<pageRole>("post", "/sysRole/updateRole", { data });
 };
+export const postUpdateRoleName = data => {
+  return http.request<pageRole>("post", "/sysRole/updateRoleName", { data });
+};
 // 查询角色下用户
 export const postPageUserByRole = data => {
   return http.request<pageRoleList>("post", "/sysRole/pageUserByRole", {

+ 5 - 1
src/api/select.ts

@@ -25,7 +25,11 @@ export const selectDictList = params => {
 export const getSelectDictListtApi = async () => {
   const { code, data } = await selectDictList({ dictType: "1" });
   if (code == 200) {
-    select.value = data;
+    data.forEach(item => {
+      if (item.dictTypeName == "指标分类") {
+        select.value.push(item);
+      }
+    });
     return data;
   }
 };

+ 3 - 1
src/store/modules/user.ts

@@ -45,10 +45,12 @@ export const useUserStore = defineStore({
       return new Promise<UserResult>((resolve, reject) => {
         getLogin(data)
           .then(data => {
-            if (data) {
+            if (data.code && data.code === 200) {
               // token超时时间
               setToken(data.data);
               resolve(data);
+            } else {
+              reject(data.msg);
             }
           })
           .catch(error => {

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

@@ -71,18 +71,20 @@ const saveDepartment = () => {
   });
 };
 const open = node => {
+  console.log(node, "-------");
   dialogVisibleAdd.value = true;
   postUserListApi();
-  postListTreeApi();
   if (node) {
     // form.leader
     form.deptName = "";
     form.deptCode = "";
     form.hospitalCode = "";
     form.leader = "";
-    form.parentCode = "";
     optiones.parentOptions = [];
     optiones.parentOptions.push(node.data);
+    form.parentCode = node.data.deptCode;
+  } else {
+    postListTreeApi();
   }
 };
 // 添加子部门数据

+ 2 - 2
src/views/background/framework/roles/components/addRole.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import { ref, reactive } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
-import { postAddRole, postUpdateRole } from "@/api/roles";
+import { postAddRole, postUpdateRole, postUpdateRoleName } from "@/api/roles";
 const emit = defineEmits(["handleClick"]);
 const dialogVisibleAdd = ref(false);
 const dialogTitle = ref("新增");
@@ -14,7 +14,7 @@ const postAddRoleApi = async () => {
   const res =
     dialogTitle.value == "新增"
       ? await postAddRole(form)
-      : await postUpdateRole(form);
+      : await postUpdateRoleName(form);
   if (res.code === 200) {
     emit("handleClick");
     ElMessage({

+ 1 - 0
src/views/evaluate/children/change/components/editMould.vue

@@ -137,6 +137,7 @@ const showStartValueValue = computed({
 // 分割————————————————————————————————————————————
 // 新建维度
 const postAddDimensionApi = async () => {
+  console.log("新建维度", formLabelAlign);
   const { code, msg } = await postAddDimension(formLabelAlign);
   if (code === 200) {
     ElMessage({

+ 27 - 28
src/views/evaluate/children/change/components/newAdd.vue

@@ -54,17 +54,18 @@ const handleSelect = index => {
   active.value = index;
 };
 const tepName = ref();
+const tepNameForm = reactive({
+  tpName: "",
+  id: ""
+});
 onMounted(() => {
-  if (route.query.tpName) {
+  if (route.query.tpName && route.query.id) {
     tepNameForm.tpName = route.query.tpName;
     tepNameForm.id = route.query.id;
   }
 });
 const tableData = ref([]);
-const tepNameForm = reactive({
-  tpName: "",
-  id: ""
-});
+
 // 新建模板
 const postAddTemplateApi = async () => {
   const res = await postAddTemplate({ ...tepNameForm });
@@ -88,14 +89,11 @@ const postAddTemplateApi = async () => {
 const eaxmCard = ref([]);
 // 获取维度
 const getListByApi = async () => {
+  console.log(tepNameForm.id, "触发getListByApi", tepNameForm);
   const obj = {
     tpId: tepNameForm.id
   };
   const { code, data, msg } = await getListBy(obj);
-  Object.assign(tepNameForm, {
-    tpName: "",
-    id: ""
-  });
   if (code === 200) {
     titleShow.value = true;
     eaxmCard.value = data;
@@ -111,10 +109,6 @@ const getAddListByApi = async id => {
     tpId: id
   };
   const { code, data, msg } = await getListBy(obj);
-  Object.assign(tepNameForm, {
-    tpName: "",
-    id: ""
-  });
   if (code === 200) {
     titleShow.value = true;
     eaxmCard.value = data;
@@ -185,13 +179,15 @@ const backChange = () => {
 };
 const save = () => {
   if (titleShow.value) {
+    console.log("触发");
+
     router.back();
     useAppStoreHook().toggleSideBar(true, "打开");
   } else {
     formRef.value.validate(valid => {
       if (valid) {
         if (tepNameForm.id) {
-          getListByApi();
+          getAddListByApi(tepNameForm.id);
         } else {
           postAddTemplateApi();
         }
@@ -234,7 +230,7 @@ const editPen = (item, order) => {
   editDrawer.value.open(item, "编辑", order);
 };
 // 删除考核维度
-const deletePen = index => {
+const deletePen = item => {
   ElMessageBox.confirm(
     "该维度删除后不可恢复,请谨慎操作!",
     "确定删除考核维度",
@@ -246,9 +242,10 @@ const deletePen = index => {
   )
     .then(async () => {
       // eaxmCard.value.splice(index, 1);
-      const { code, msg } = await getDimensionRemove(index);
+      const { code, msg } = await getDimensionRemove(item.id);
       if (code === 200) {
         getListByApi();
+        // getListByApi();
         ElMessage({
           type: "success",
           message: "删除成功"
@@ -364,7 +361,7 @@ const postUpdateApi = async (dimId, indId, order) => {
     <div class="w-[100%] flex justify-evenly">
       <div class="left-box">
         <el-text class="cursor-pointer" @click="backChange"
-          ><el-icon><ArrowLeft /></el-icon>返回</el-text
+          ><el-icon> <ArrowLeft /> </el-icon>返回</el-text
         >
       </div>
       <div class="center-box">
@@ -376,13 +373,15 @@ const postUpdateApi = async (dimId, indId, order) => {
             :class="{ 'step-success': !titleShow, 'step-error': titleShow }"
             class="w-[100px] flex justify-center items-center"
           >
-            <one v-if="titleShow" /><two2 v-else />基础信息
+            <one v-if="titleShow" />
+            <two2 v-else />基础信息
           </div>
           <div
             :class="{ 'step-success': titleShow, 'step-error': !titleShow }"
             class="w-[100px] flex justify-center items-center"
           >
-            <two v-if="titleShow" /><one1 v-else />考核指标
+            <two v-if="titleShow" />
+            <one1 v-else />考核指标
           </div>
         </div>
       </div>
@@ -437,12 +436,12 @@ const postUpdateApi = async (dimId, indId, order) => {
               <div class="card-header">
                 <span>{{ item.dimName }}({{ item.dimWeight }}%)</span>
                 <div class="float-right mr-7">
-                  <el-icon class="mr-3" @click="editPen(item, index + 1)"
-                    ><EditPen
-                  /></el-icon>
-                  <el-icon @click="deletePen(item.id)"
-                    ><Delete class="text-red-500"
-                  /></el-icon>
+                  <el-icon class="mr-3" @click="editPen(item, index + 1)">
+                    <EditPen />
+                  </el-icon>
+                  <el-icon @click="deletePen(item)">
+                    <Delete class="text-red-500" />
+                  </el-icon>
                 </div>
               </div>
             </template>
@@ -512,9 +511,9 @@ const postUpdateApi = async (dimId, indId, order) => {
               />
               <el-table-column fixed="right" label="操作">
                 <template #default="{ row }">
-                  <el-icon class="mr-3" @click="settingIndex(row)"
-                    ><Setting
-                  /></el-icon>
+                  <el-icon class="mr-3" @click="settingIndex(row)">
+                    <Setting />
+                  </el-icon>
                   <el-icon @click="deleteRow(row)">
                     <Delete class="text-red-500" />
                   </el-icon>

+ 29 - 8
src/views/indexDefine/children/define.vue

@@ -2,7 +2,7 @@
 defineOptions({
   name: "IndexChildrenDefine"
 });
-import { ref, reactive, markRaw, onMounted } from "vue";
+import { ref, reactive, markRaw, onMounted, computed } from "vue";
 import dialogVue from "./components/dialog.vue";
 import editDrawer from "./components/editDrawer.vue";
 import logDrawer from "./components/logDrawer.vue";
@@ -63,12 +63,10 @@ const getQuotaPageListApi = async () => {
 };
 getQuotaPageListApi();
 const handleSizeChange = (val: number) => {
-  console.log("a4val1111", val);
   params.params.pageSize = val;
   getQuotaPageListApi();
 };
 const handleCurrentChange = (val: number) => {
-  console.log("a4va2222222", val);
   params.params.pageNumber = val;
   getQuotaPageListApi();
 };
@@ -173,6 +171,15 @@ const postUpdateDeptApi = async (row, state) => {
     getQuotaPageListApi();
   }
 };
+
+// 更新时间返回值
+const formattedTime = time => {
+  if (time) {
+    return dayjs(time).format("YYYY-MM-DD HH:mm:ss");
+  } else {
+    return "无效日期";
+  }
+};
 </script>
 
 <template>
@@ -258,7 +265,12 @@ const postUpdateDeptApi = async (row, state) => {
       </div>
       <div class="mt-8">
         <el-table :data="params.records" style="width: 100%">
-          <el-table-column prop="id" label="指标编号" width="100" />
+          <el-table-column
+            prop="id"
+            label="指标编号"
+            width="100"
+            show-overflow-tooltip
+          />
           <el-table-column prop="name" label="指标名称" />
           <el-table-column prop="categoryName" label="指标分类" />
           <el-table-column prop="address" label="状态">
@@ -268,12 +280,21 @@ const postUpdateDeptApi = async (row, state) => {
               </el-tag>
             </template>
           </el-table-column>
-          <el-table-column prop="define" label="指标定义" />
-          <el-table-column prop="caliber" label="指标口径" />
+          <el-table-column
+            prop="define"
+            label="指标定义"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            prop="caliber"
+            label="指标口径"
+            show-overflow-tooltip
+          />
           <el-table-column prop="source" label="数据来源" />
-          <el-table-column prop="createTime" label="更新时间">
+          <el-table-column prop="updateTime" label="更新时间" sortable>
             <template #default="{ row }">
-              {{ dayjs(row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
+              {{ formattedTime(row.updateTime) }}
+              <!-- {{ dayjs(row.updateTime).format("YYYY-MM-DD HH:mm:ss") }} -->
             </template>
           </el-table-column>
           <el-table-column label="操作">

+ 27 - 9
src/views/indexDefine/children/import/index.vue

@@ -35,7 +35,8 @@ const uploadFile = async () => {
       ElMessage.success("文件上传并导入成功");
       // 重置上传状态
       // uploadShow.value = true;
-      $router.push("/IndexDefine/children/define");
+      backDefine();
+      $router.push("/indexDefine/children/define");
       tableHeaders.value = []; // 清空表头
       tableData.value = [
         { name: "" },
@@ -80,15 +81,32 @@ const handleUploadChange = (file: File) => {
       const worksheet = workbook.Sheets[firstSheetName]; // 获取第一个工作表
       const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }); // 将工作表转为 JSON
 
-      if (jsonData.length > 0) {
-        tableHeaders.value = jsonData[0]; // 表头
-        tableData.value = jsonData.slice(1).map(row => {
-          const rowData = {};
-          tableHeaders.value.forEach((header, index) => {
-            rowData[header] = row[index] !== undefined ? row[index] : null; // 填充缺失值
-          });
-          return rowData;
+      if (jsonData[0].length == 6) {
+        tableHeaders.value = [
+          "指标名称",
+          "指标定义",
+          "指标口径",
+          "指标分类",
+          "来源",
+          "状态"
+        ]; // 表头
+
+        const arr = jsonData.slice(1).map(row => {
+          if (row[0] && row[1] && row[2] && row[3]) {
+            const rowData = {};
+            tableHeaders.value.forEach((header, index) => {
+              if (row[index] && row[index].trim().length > 0) {
+                rowData[header] = row[index];
+              } else if (header == "来源") {
+                rowData[header] = "-";
+              } else if (header == "状态") {
+                rowData[header] = "草稿";
+              }
+            });
+            return rowData;
+          }
         });
+        tableData.value = arr.filter(item => item);
         ElMessage.success("文件上传成功");
         uploadShow.value = false; // 隐藏上传区域,显示数据表
       } else {

+ 0 - 1
src/views/login/index.vue

@@ -92,7 +92,6 @@ const onLogin = async (formEl: FormInstance | undefined) => {
         .catch(err => {
           loading.value = false;
           message(err, { type: "error" });
-          console.log("登录失败", err);
           return fields;
         });
     } else {

+ 11 - 11
src/views/password/index.vue

@@ -48,17 +48,17 @@ 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"
-    }
+    { required: true, message: "请输入密码", trigger: "blur" }
+    // {
+    //   validator: (rule, value, callback) => {
+    //     if (value !== passWord.value) {
+    //       callback(new Error("旧密码不正确"));
+    //     } else {
+    //       callback();
+    //     }
+    //   },
+    //   trigger: "blur"
+    // }
   ],
   newPwd: [
     { required: true, message: "请输入 6 - 14 位密码", trigger: "blur" },