Bläddra i källkod

fix: 更新组件

fan 2 år sedan
förälder
incheckning
b1367c95b2

+ 4 - 0
src/api/biz/README.md

@@ -12,3 +12,7 @@
     - vitalsHistoryApi 历史体征数据
   - bed 预约排床
     - scheduledMemoApi 排床备忘录
+  - visit 今日就诊
+  - engineer 工程师端
+    - bedApi 床位管理
+    - dialysisDeviceApi 透析设备

+ 69 - 0
src/api/biz/engineer/bedApi.ts

@@ -0,0 +1,69 @@
+import { defHttp } from '/@/utils/http/axios';
+import { setParams } from '/@/utils/index';
+
+enum Api {
+  engineerBedQueryPage = '/device/bed/query/page',
+  engineerBedDetail = '/device/bed/detail',
+  engineerBedAdd = '/device/bed/add',
+  engineerBedEdit = '/device/bed/edit',
+  engineerBedRemove = '/device/bed/removeByIds',
+}
+
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 根据条件查询病床列表,权限 - device:dialysisDevice:query
+ * @method: POST
+ */
+
+export const engineerBedQueryPage = (params?: object) => {
+  return defHttp.post({ url: Api.engineerBedQueryPage, params: setParams(params) });
+};
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 根据id查询病床详细信息,权限 - device:dialysisDevice:query
+ * @method: GET
+ * @param:  id 病床主键id
+ */
+export const engineerBedDetail = (id: string) => {
+  return defHttp.get({ url: Api.engineerBedDetail + '/' + id });
+};
+
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 添加病床,权限 - device:dialysisDevice:add
+ * @method: POST
+ * @return:
+ *       0 添加失败
+ *       1 添加成功
+ */
+export const engineerBedAdd = (params?: object) => {
+  return defHttp.post({ url: Api.engineerBedAdd, params: params });
+};
+
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 通过主键id编辑病床,权限 - device:dialysisDevice:edit
+ * @method: POST
+ * @return:
+ *       0 编辑失败
+ *       1 编辑成功
+ */
+export const engineerBedEdit = (params?: object) => {
+  return defHttp.post({ url: Api.engineerBedEdit, params: params });
+};
+
+/**
+ * @description: 删除,权限 - device:dialysisDevice:remove
+ * @method: POST
+ */
+export const engineerBedRemove = (params: Array<string | number>) => {
+  return defHttp.post({ url: Api.engineerBedRemove, params: params });
+};

+ 69 - 0
src/api/biz/engineer/dialysisDeviceApi.ts

@@ -0,0 +1,69 @@
+import { defHttp } from '/@/utils/http/axios';
+import { setParams } from '/@/utils/index';
+
+enum Api {
+  engineerDialysisDeviceQueryPage = '/device/dialysisDevice/query/page',
+  engineerDialysisDeviceDetail = '/device/dialysisDevice/detail',
+  engineerDialysisDeviceAdd = '/device/dialysisDevice/add',
+  engineerDialysisDeviceEdit = '/device/dialysisDevice/edit',
+  engineerDialysisDeviceRemove = '/device/dialysisDevice/removeByIds',
+}
+
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 根据条件查询病床列表,权限 - device:dialysisDevice:query
+ * @method: POST
+ */
+
+export const engineerDialysisDeviceQueryPage = (params?: object) => {
+  return defHttp.post({ url: Api.engineerDialysisDeviceQueryPage, params: setParams(params) });
+};
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 根据id查询病床详细信息,权限 - device:dialysisDevice:query
+ * @method: GET
+ * @param:  id 病床主键id
+ */
+export const engineerDialysisDeviceDetail = (id: string) => {
+  return defHttp.get({ url: Api.engineerDialysisDeviceDetail + '/' + id });
+};
+
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 添加病床,权限 - device:dialysisDevice:add
+ * @method: POST
+ * @return:
+ *       0 添加失败
+ *       1 添加成功
+ */
+export const engineerDialysisDeviceAdd = (params?: object) => {
+  return defHttp.post({ url: Api.engineerDialysisDeviceAdd, params: params });
+};
+
+/**
+ *
+ * @author fan
+ * @date  2023/06/30 17:39
+ * @description: 通过主键id编辑病床,权限 - device:dialysisDevice:edit
+ * @method: POST
+ * @return:
+ *       0 编辑失败
+ *       1 编辑成功
+ */
+export const engineerDialysisDeviceEdit = (params?: object) => {
+  return defHttp.post({ url: Api.engineerDialysisDeviceEdit, params: params });
+};
+
+/**
+ * @description: 删除,权限 - device:dialysisDevice:remove
+ * @method: POST
+ */
+export const engineerDialysisDeviceRemove = (params: Array<string | number>) => {
+  return defHttp.post({ url: Api.engineerDialysisDeviceRemove, params: params });
+};

+ 1 - 0
src/components/XTCard/index.ts

@@ -1,3 +1,4 @@
 export { default as XTCard } from './src/XTCard.vue';
 export { default as DescCard } from './src/DescCard.vue';
 export { default as DescMultiCard } from './src/DescMultiCard.vue';
+export { default as SimpleCard } from './src/SimpleCard.vue';

+ 131 - 0
src/components/XTCard/src/SimpleCard.vue

@@ -0,0 +1,131 @@
+<template>
+  <div class="card">
+    <div class="card-head" v-if="showHead">
+      <div class="card-head_label"> {{ title }}</div>
+      <div class="flex card-head_value">
+        <slot name="headRight" />
+        <i :class="['iconfont', icon]" v-if="icon" @click="handleIcon" />
+      </div>
+    </div>
+    <div class="card-body" />
+  </div>
+</template>
+
+<script setup lang="ts">
+  interface Props {
+    id?: string;
+    // 标题
+    title: string;
+    // 是否显示head 部分
+    showHead?: boolean;
+    // icon
+    icon?: string | unknown;
+    iconType?: string;
+    // 每行宽度
+    wrapSpan?: number;
+    type?: string;
+    right?: {
+      show: boolean;
+      date?: string;
+      doctor?: string;
+      edit?: boolean;
+      delete?: boolean;
+      span?: number;
+    };
+    // 数据集
+    data: Array<{
+      filed?: string;
+      label: string;
+      value?: string;
+      span?: number | unknown;
+      dict?: boolean | unknown;
+      dictName?: string | unknown;
+      dictField?: string | unknown;
+      hidden?: boolean | unknown;
+      tags?:
+        | Array<{
+            id: string;
+            label: string;
+            type: string | 'warning' | 'error' | 'success' | 'primary' | 'muted';
+            fontColor: string;
+            bgColor: string;
+          }>
+        | unknown
+        | any;
+    }>;
+  }
+  const props = withDefaults(defineProps<Props>(), {
+    title: '标题',
+    showHead: true,
+    wrapSpan: 6,
+    type: '',
+    data: () => [],
+    right: () => {
+      return {
+        show: false,
+        span: 4,
+        edit: true,
+        delete: false,
+      };
+    },
+  });
+  const emit = defineEmits(['icon']);
+
+  function handleIcon() {
+    const info = { id: props.id, type: props.type, action: props.iconType || 'icon' };
+    emit('icon', info);
+  }
+</script>
+
+<style lang="less" scoped>
+  .card {
+    border-radius: 4px;
+    border: 1px solid #efefef;
+    background-color: #fff;
+
+    &-head {
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      height: 56px;
+      background: #f6f8fa;
+      box-shadow: 0 1px 0 0 #efefef;
+      border-radius: 3px 3px 0 0;
+      padding: 0 20px;
+
+      &_label {
+        font-size: 18px;
+        font-weight: 600;
+        color: #000a18;
+      }
+
+      &_value {
+        & .iconfont {
+          display: block;
+          margin-right: 16px;
+          background: #fff;
+          border-radius: 50%;
+          width: 32px;
+          height: 32px;
+          text-align: center;
+          line-height: 32px;
+          cursor: pointer;
+
+          &:last-child {
+            margin-right: 0;
+          }
+
+          &:hover {
+            color: #0075ff;
+          }
+        }
+      }
+    }
+
+    &-body {
+      display: flex;
+      align-items: center;
+      padding: 20px 20px 0;
+    }
+  }
+</style>

+ 1 - 1
src/components/XTTab/src/XTTab.vue

@@ -10,7 +10,7 @@
         v-for="item in data"
         :key="item.key"
         @click="handleClick(item)"
-        :style="{ width: width + 'px' }"
+        :style="{ minWidth: width + 'px' }"
       >
         <div
           v-if="item.prefixColor"

+ 1 - 1
src/components/XTUpload/src/XTUpload.vue

@@ -133,7 +133,7 @@
         () => props.value,
         (value = []) => {
           fileList.value = isArray(value) ? value : [];
-          console.log('🚀 ~ file: XTUpload.vue:80 ~ setup ~ fileList.value :', fileList.value);
+          // console.log('🚀 ~ file: XTUpload.vue:80 ~ setup ~ fileList.value :', fileList.value);
         },
         { immediate: true },
       );

+ 7 - 0
src/design/index.less

@@ -185,3 +185,10 @@ span {
 .ant-back-top {
   right: 30px !important;
 }
+
+.table-avatar {
+  display: inline-flex;
+  width: 28px;
+  height: 28px;
+  border-radius: 50%;
+}

+ 5 - 1
src/utils/http/axios/index.ts

@@ -77,11 +77,15 @@ const transform: AxiosTransform = {
       const expired = parseInt(userStore.getExpiresIn) - now <= 0;
       console.log('🚀 ~ file: index.ts:78 ~ transformResponseHook: ~ expired:', expired);
       if (expired) {
-        const res = await userStore.refreshToken();
+        const res = await userStore.refreshToken;
         if (res?.access_token) {
+          console.log('🚀 ~ file: index.ts:82 ~ transformResponseHook: ~ expired res:', res);
           const retryRequest = new AxiosRetry();
           // @ts-ignore
           retryRequest.retryRefresh(res, options);
+        } else {
+          userStore.setToken(undefined);
+          userStore.logout(true);
         }
       } else {
         userStore.setToken(undefined);

+ 44 - 44
src/views/README.md

@@ -1,49 +1,49 @@
-
 base 基本页面
 
-monitor 系统监控
-  logLogin    登录日志
-  logOper     操作日志
-  job         定时任务
-  server      系统监控
-  front       前端依赖
-  druid       连接监控
-
-tool 基础工具
-  num         编号策略
-  oss        文件管理
-  gen         代码生成
-  bpmn        流程管理
-  print       打印管理
-  butted      设备对接
-
-sys 系统管理
-  dict        字典管理
-  setting     系统配置
-  menu        菜单管理
-  dept        部门管理
-  user        用户管理
-  position    岗位管理
-  role        角色管理
-  portal      门户管理
-  args        参数管理
-  constant    常量管理
-  notice      系统通知
-
-bus 业务组件
-  info
-    hospital  医院设置
-    article   宣教管理
-    supplies  耗材管理
-    bed       床位管理
-    ward      病区管理
-  xxx
-    xxx
-    xxx
-
+- monitor 系统监控
+
+  - logLogin 登录日志
+  - logOper 操作日志
+  - job 定时任务
+  - server 系统监控
+  - front 前端依赖
+  - druid 连接监控
+
+- tool 基础工
+
+  - num 编号策略
+  - oss 文件管理
+  - gen 代码生成
+  - bpmn 流程管理
+  - print 打印管理
+  - butted 设备对接
+
+- sys 系统管理
+
+  - dict 字典管理
+  - setting 系统配置
+  - menu 菜单管理
+  - dept 部门管理
+  - user 用户管理
+  - position 岗位管理
+  - role 角色管理
+  - portal 门户管理
+  - args 参数管理
+  - constant 常量管理
+  - notice 系统通知
+
+- bus 业务组件
+  - info
+    - hospital 医院设置
+    - article 宣教管理
+    - supplies 耗材管理
+    - bed 床位管理
+    - ward 病区管理
+  - xxx
+    - xxx
+    - xxx
+- demo 组件样例
 
 # api
 
-api 统一前缀: 
-  sys  系统接口
-  biz  业务接口
+api 统一前缀: sys 系统接口 biz 业务接口