Przeglądaj źródła

fix(bugs): 优化

tangning 2 lat temu
rodzic
commit
3c135d7abc

+ 1 - 1
src/store/modules/permission.ts

@@ -219,7 +219,7 @@ export const usePermissionStore = defineStore({
           break;
       }
 
-      routes.push(ERROR_LOG_ROUTE);
+      // routes.push(ERROR_LOG_ROUTE);
       patchHomeAffix(routes);
       return routes;
     },

+ 2 - 2
src/views/account/product/data.tsx

@@ -15,7 +15,7 @@ export const columns:  BasicColumn[] = [
     dataIndex: 'sceneName',
     width: 150,
     customRender: ({ record }) => {
-      return <a href={record.url}>{record.sceneName}</a>
+      return <a href={record.thumb} target="_blank">{record.sceneName}</a>
     },
   },
   {
@@ -171,7 +171,7 @@ export const cameraScene: BasicColumn[] = [
     dataIndex: 'name',
     width: 150,
     customRender: ({ record }) => {
-      return <a href={record.url}>{record.name}</a>
+      return <a href={record.thumb} target="_blank">{record.name}</a>
       // return record.name ? h('span', record.name) : '-';
     },
   },

+ 9 - 5
src/views/staff/detailsModal.vue

@@ -50,7 +50,7 @@
           component: 'Input',
           label: '姓名',
           colProps: {
-            span: 22,
+            span: 18,
           },
           componentProps: {
             maxLength: 15,
@@ -84,7 +84,7 @@
             validateTrigger: 'blur',
           },
           colProps: {
-            span: 22,
+            span: 18,
           },
           defaultValue: 8,
           componentProps: {
@@ -106,17 +106,17 @@
             span: 18,
           },
           componentProps:{
-            autocomplete:'off',
+            autoComplete:'off',
           }
         },
         {
           field: 'password',
           component: 'StrengthMeter',
-          label: t('routes.staff.password'),
+          label: '密码',
           required: true,
           colProps: { span: 18 },
           componentProps:{
-            autocomplete:'off',
+            autoComplete:'off',
           }
         },
         {
@@ -169,6 +169,10 @@
             },
           },
           {
+            field: 'password',
+            ifShow:data.id ? false:true,
+          },
+          {
             field: 'companyId',
             componentProps: {
               disabled: data.id ? (data.roleId != 2 ? true : false) : false,

+ 37 - 13
src/views/staff/list.vue

@@ -48,17 +48,18 @@
   </div>
 </template>
 <script lang="ts">
-  import { defineComponent, computed, onMounted, ref } from 'vue';
+  import { defineComponent, computed, onMounted, ref, h } from 'vue';
   import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useModal } from '/@/components/Modal';
   import { uploadApi } from '/@/api/sys/upload';
   import SetpaswordModal from './setpaswordModal.vue';
   import DetailsModal from './detailsModal.vue';
+import { Switch } from 'ant-design-vue';
   // import DelListModal from './delListModal.vue';
   import { Alert } from 'ant-design-vue';
   // import { h } from 'vue';
-  import { ListApi, delApi, preDelApi, getNumByStaff } from '/@/api/staff/list';
+  import { ListApi, delApi, preDelApi, updateApi, getNumByStaff } from '/@/api/staff/list';
   import { useI18n } from '/@/hooks/web/useI18n';
   // import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
   import { RoleEnum } from '/@/enums/roleEnum';
@@ -95,17 +96,12 @@
       });
 
       const columns: BasicColumn[] = [
-        {
-          title: 'ID',
-          dataIndex: 'id',
-          fixed: 'left',
-          width: 60,
-        },
-        {
-          title: t('routes.staff.userId'),
-          dataIndex: 'userName',
-          width: 150,
-        },
+        // {
+        //   title: 'ID',
+        //   dataIndex: 'id',
+        //   fixed: 'left',
+        //   width: 60,
+        // },
         // {
         //   title: t('routes.staff.deptName'),
         //   dataIndex: 'companyName',
@@ -121,6 +117,11 @@
           dataIndex: 'nickName',
           width: 120,
         },
+        {
+          title: t('routes.staff.userId'),
+          dataIndex: 'userName',
+          width: 150,
+        },
         // {
         //   title: '手机',
         //   dataIndex: 'phone',
@@ -143,7 +144,30 @@
           dataIndex: 'createTime',
           slots: { customRender: 'createTime' },
           width: 130,
+        },{
+        title: '状态',
+        dataIndex: 'status',
+        width: 80,
+        customRender: ({ record }) => {
+          if (!Reflect.has(record, 'status')) {
+            record.pendingStatus = false;
+          }
+          return h(Switch, {
+            checked: record.status == 1 ? true : false,
+            checkedChildren: '启用',
+            unCheckedChildren: '禁用',
+            loading: false,
+            onChange: async (checked: boolean) => {
+              record.pendingStatus = true;
+              const newStatus = checked?1:0;
+              await updateApi({...record,status:newStatus});
+              Reflect.set(record, 'status', checked);
+              createMessage.success(t('common.optSuccess'));
+              reload()
+            },
+          });
         },
+      },
         {
           title: '操作',
           dataIndex: '',