Kaynağa Gözat

fix: bug fixed

haifeng.zhang 1 hafta önce
ebeveyn
işleme
d0a0b0d7cb

+ 1 - 0
src/router/modules/password.ts

@@ -2,6 +2,7 @@
 import server from "@/assets/icon-png/menuList/server.svg";
 export default {
   path: "/password",
+  redirect: "/password/change",
   meta: {
     title: "账号与密码",
     // 是否在主菜单显示父级路由 仅支持mixNav

+ 1 - 0
src/routerList/password.ts

@@ -2,6 +2,7 @@
 import server from "@/assets/icon-png/menuList/server.svg";
 export default {
   path: "/password",
+  redirect: "/password/change",
   meta: {
     title: "账号与密码",
     // 是否在主菜单显示父级路由 仅支持mixNav

+ 7 - 1
src/utils/http/index.ts

@@ -13,6 +13,7 @@ import { stringify } from "qs";
 import NProgress from "../progress";
 import { getToken, formatToken } from "@/utils/auth";
 import { useUserStoreHook } from "@/store/modules/user";
+import { message } from "@/utils/message";
 // 相关配置请参考:www.axios-js.com/zh-cn/docs/#axios-request-config-1
 const defaultConfig: AxiosRequestConfig = {
   // 请求超时时间
@@ -125,8 +126,12 @@ class PureHttp {
         const $config = response.config;
         // 关闭进度条动画
         NProgress.done();
-        // 优先判断post/get等方法是否传入回调,否则执行初始化设置等回调
+        // 统一返回接口报错信息
+        if (response.data.code && response.data.code !== 200) {
+          message(response.data.msg, { type: "error" });
+        }
         if (typeof $config.beforeResponseCallback === "function") {
+          // 优先判断post/get等方法是否传入回调,否则执行初始化设置等回调
           $config.beforeResponseCallback(response);
           return response.data;
         }
@@ -141,6 +146,7 @@ class PureHttp {
         $error.isCancelRequest = Axios.isCancel($error);
         // 关闭进度条动画
         NProgress.done();
+        message($error, { type: "error" });
         // 所有的响应异常 区分来源为取消请求/非取消请求
         return Promise.reject($error);
       }

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

@@ -20,12 +20,17 @@ const optiones = reactive({
 });
 // 添加
 const postAddDeptApi = async () => {
-  const { code } = await postAddDept(form);
+  const { code } = await postAddDept({
+    ...form,
+    parentCode: form.parentCode || 0
+  });
   if (code === 200) {
     ElMessage({
       message: "添加成功",
       type: "success"
     });
+    emit("handleClick");
+    handleClose();
   }
 };
 // 上级部门
@@ -65,8 +70,6 @@ const saveDepartment = () => {
   formRef.value.validate(valid => {
     if (valid) {
       postAddDeptApi();
-      emit("handleClick");
-      handleClose();
     }
   });
 };

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

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { ref, reactive } from "vue";
+import { ref, reactive, defineEmits } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import type { DrawerProps, FormItemProps, FormProps } from "element-plus";
 import { postUpdateDept, postListTree } from "@/api/department";
@@ -7,6 +7,7 @@ import { postUserList } from "@/api/userSetting";
 import { encryption } from "@/utils/encrypt";
 // const itemLabelPosition = ref<FormItemProps["labelPosition"]>("");
 const drawer = ref(false);
+const emit = defineEmits(["handleClick"]);
 const disabledValue = ref(true);
 const formRef = ref();
 const direction = ref<DrawerProps["direction"]>("rtl");
@@ -67,6 +68,7 @@ const postUpdateDeptApi = async () => {
       message: "保存成功",
       type: "success"
     });
+    emit("handleClick");
   }
 };
 function confirmClick() {
@@ -193,7 +195,7 @@ const timer = ref("");
         >
         <div v-else>
           <el-button @click="cancelClick">取消</el-button>
-          <el-button type="primary" @click="confirmClick">确认</el-button>
+          <el-button type="primary" @click="confirmClick">保存</el-button>
         </div>
       </template>
     </el-drawer>

+ 22 - 5
src/views/background/framework/proson/prosonDepartment.vue

@@ -3,7 +3,7 @@ defineOptions({
   // name 作为一种规范最好必须写上并且和路由的name保持一致
   name: "prosonDepartment"
 });
-import { ref, reactive, watch } from "vue";
+import { ref, reactive, watch, nextTick } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import { Search } from "@element-plus/icons-vue";
 import prosonEditDrawer from "./components/prosonEditDrawer.vue";
@@ -14,6 +14,8 @@ import changeRole from "./components/changeRole.vue";
 import { postListTree, postDelDept } from "@/api/department";
 import { postOrganizationUserPage, getDeleteUserApi } from "@/api/userSetting";
 import UserPageTable from "@/components/UserPageTable/index.vue";
+import { Plus } from "@element-plus/icons-vue";
+
 // 添加部门
 const newDepartmentRef = ref(null);
 const newDepartmentShow = ref(false);
@@ -53,7 +55,13 @@ const postListTreeApi = async () => {
   const { code, data } = await postListTree();
   if (code == 200) {
     console.log(data);
+    if (data && data.length) {
+      data[0].id = 1;
+    }
     dataTree.value = data;
+    nextTick(() => {
+      handleNodeClick(dataTree.value[0]);
+    });
   }
 };
 postListTreeApi();
@@ -173,6 +181,7 @@ watch(realName, val => {
     <prosonEditDrawer
       ref="prosonEditDrawerRef"
       v-model="prosonEditDrawerShow"
+      @handleClick="postListTreeApi"
     />
     <!-- 添加部门 -->
     <newDepartment
@@ -216,7 +225,9 @@ watch(realName, val => {
             <span>{{ node.label }}</span>
             <el-dropdown trigger="click" @click.stop>
               <span>
-                <el-icon><Operation /></el-icon>
+                <el-icon>
+                  <Operation />
+                </el-icon>
               </span>
               <template #dropdown>
                 <el-dropdown-menu class="setting">
@@ -253,8 +264,9 @@ watch(realName, val => {
           class="w-full mt-4"
           type="primary"
           plain
+          :icon="Plus"
           @click="addDepartment"
-          >添加部门</el-button
+          >新增部门</el-button
         >
       </Auth>
     </div>
@@ -268,11 +280,15 @@ watch(realName, val => {
         <template #actions="{ row }">
           <Auth :value="['编辑成员']">
             <el-dropdown trigger="click" class="mr-2">
-              <el-icon @click="personDetails(row)"><View /></el-icon>
+              <el-icon @click="personDetails(row)">
+                <View />
+              </el-icon>
             </el-dropdown>
           </Auth>
           <el-dropdown trigger="click">
-            <el-icon><Operation /></el-icon>
+            <el-icon>
+              <Operation />
+            </el-icon>
             <template #dropdown>
               <el-dropdown-menu class="setting">
                 <Auth :value="['删除成员']">
@@ -309,6 +325,7 @@ watch(realName, val => {
   height: 100%;
   padding: 10px 20px;
 }
+
 // ::v-deep .el-dropdown {
 //   line-height: 1;
 // }

+ 1 - 1
src/views/background/framework/users/components/addUsers.vue

@@ -135,7 +135,7 @@ defineExpose({
         <el-form-item label="用户组编号">
           <el-input v-model="form.hospitalCode" placeholder="请输入" />
         </el-form-item>
-        <el-form-item label="用户组负责人">
+        <el-form-item v-if="dialogTitle !== '新建用户组'" label="用户组负责人">
           <el-select v-model="form.leaderCode" placeholder="请选择">
             <el-option
               v-for="(item, index) in rolesList.list"

+ 1 - 1
src/views/background/framework/users/components/editPerson.vue

@@ -117,7 +117,7 @@ const timer = ref("");
         </div>
       </template>
       <template #footer>
-        <el-button v-if="editShow" type="warning" @click="editClick"
+        <el-button v-if="editShow" type="primary" @click="editClick"
           >编辑</el-button
         >
         <div v-else>

+ 2 - 2
src/views/login/index.vue

@@ -44,8 +44,8 @@ const { title, toggleSideBar } = useNav();
 const ruleForm = reactive({
   // username: "",
   // password: ""
-  username: "admin",
-  password: "123456"
+  username: "",
+  password: ""
 });
 const handleBlur = () => {
   // @ts-ignore

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

@@ -118,7 +118,7 @@ const rules = {
         />
       </el-form-item>
       <el-form-item label="">
-        <el-button type="primary" @click="UpdatePasswordApi()">提交</el-button>
+        <el-button type="primary" @click="UpdatePasswordApi">提交</el-button>
       </el-form-item>
     </el-form>
   </div>