tangning пре 8 месеци
родитељ
комит
417a056ac7
3 измењених фајлова са 188 додато и 3 уклоњено
  1. 2 2
      index.html
  2. 1 1
      src/router/routes/bf/dashboard.ts
  3. 185 0
      src/views/empower/differenceList.vue

+ 2 - 2
index.html

@@ -9,8 +9,8 @@
       content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
     />
     <title><%= title %></title>
-    <link rel="icon" href="/favicon.ico" />
-    
+    <!-- <link rel="icon" href="/favicon.ico" /> -->
+    <link rel="apple-touch-icon" sizes="180x180" href="//4dkk.4dage.com/FDKKIMG/icon/kankan_icon180.png">
   </head>
 
   <body>

+ 1 - 1
src/router/routes/bf/dashboard.ts

@@ -21,7 +21,7 @@ const dashboard: AppRouteModule = {
       component: () => import('/@/views/case/list.vue'),
       meta: {
         // affix: true,
-        title: t('routes.dashboard.analysis'),
+        title: '案件管理',
       },
     },
   ],

+ 185 - 0
src/views/empower/differenceList.vue

@@ -0,0 +1,185 @@
+<template>
+  <PageWrapper contentClass="testPageWrapper">
+    <BasicTable @register="registerTable">
+      <template #action="{ record }">
+        <TableAction
+          :actions="[
+            {
+              label: '差分账号授权',
+              ifShow: getCheckPerm('difference-Add'),
+              onClick: handleAuthorize.bind(null, record),
+            },
+            {
+              label: '授权记录',
+              ifShow: getCheckPerm('difference-loglist'),
+              onClick: handleLogList.bind(null, record, 'edit'),
+            },
+          ]"
+        />
+      </template>
+    </BasicTable>
+    <AddModal @register="register" @update="reload" />
+    <logListModal @register="registerlogLis" @update="reload" />
+  </PageWrapper>
+</template>
+<script lang="ts">
+  import { defineComponent, h, ref } from 'vue';
+  import { BasicTable, useTable, FormProps, TableAction } from '/@/components/Table';
+  import { PageWrapper } from '/@/components/Page';
+  import { rtkDeviceList, rtkDevicedel, rtkAccountdel } from '/@/api/rtk';
+  import { useModal } from '/@/components/Modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
+  import AddModal from './modal/difference/AddModal.vue';
+  import logListModal from './modal/difference/logListModal.vue';
+  import { useMessage } from '/@/hooks/web/useMessage';
+  import { usePermissionStore } from '/@/store/modules/permission';
+  import { rtkdeviceColumns } from './data';
+  export default defineComponent({
+    components: {
+      BasicTable,
+      AddModal,
+      logListModal,
+      PageWrapper,
+      TableAction,
+    },
+    setup() {
+      const { t } = useI18n();
+      const activeKey = ref(0);
+      const { createMessage, createConfirm } = useMessage();
+      const permissionStore = usePermissionStore();
+      const { getCheckPerm } = permissionStore;
+      const [register, { openModal }] = useModal();
+      const [registerlogLis, { openModal: openlogLisModal }] = useModal();
+
+      const searchForm: Partial<FormProps> = {
+        labelWidth: 100,
+        autoSubmitOnEnter: true,
+        schemas: [
+          {
+            field: 'cameraSn',
+            label: '相机Sn',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'rtkSnCode',
+            label: '板卡SN号',
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+          {
+            field: 'sgRtkSn',
+            label: '深光rtk插件SN号',
+            labelWidth: 140,
+            component: 'Input',
+            colProps: {
+              xl: 8,
+              xxl: 8,
+            },
+          },
+        ],
+      };
+      const [registerTable, { reload }] = useTable({
+        api: rtkDeviceList,
+        title: 'RTK设备列表',
+        columns: rtkdeviceColumns,
+        useSearchForm: true,
+        showIndexColumn: false,
+        formConfig: searchForm,
+        showTableSetting: true,
+        searchInfo: {
+          accountType: 2,
+        },
+        fetchSetting: {
+          pageField: 'pageNum',
+          sizeField: 'pageSize',
+          listField: 'list',
+          totalField: 'total',
+        },
+        actionColumn: {
+          width: 180,
+          title: '操作',
+          dataIndex: 'action',
+          slots: { customRender: 'action' },
+        },
+        rowKey: 'id',
+        canResize: false,
+      });
+      async function handleDelete(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', '确定要删除吗?'),
+          onOk: async () => {
+            let apiUrl = activeKey.value == 0 ? rtkDevicedel : rtkAccountdel;
+            await apiUrl({ id: record.id });
+            reload();
+            createMessage.success(t('common.optSuccess'));
+          },
+        });
+      }
+      function handleCopy(str: string) {
+        copyTextToClipboard(str);
+        createMessage.success('复制成功');
+      }
+      function changeTable(val: number) {
+        activeKey.value = val;
+        // reload();
+      }
+      function handleActive(record) {
+        createConfirm({
+          iconType: 'warning',
+          title: () => h('span', '温馨提示'),
+          content: () => h('span', `确定要${record.status ? '禁用' : '激活'}吗?`),
+          onOk: async () => {
+            await activation({ id: record.id, status: record.status ? 0 : 1 });
+            reload();
+            createMessage.success(t('common.optSuccess'));
+          },
+        });
+      }
+      function handleAuthorize(record) {
+        openModal(true, record);
+      }
+      function handleLogList(record) {
+        openlogLisModal(true, record);
+      }
+      function handleEdit(record = {}) {
+        openModal(true, {
+          ...record,
+          accountType: record.rtkType == 0 ? 0 : record.accountType,
+          authorizeTime: `${record.authorizeTime || '10'}_${record.authorizeTimeUnit || '1'}`,
+        });
+      }
+      function handleuserEdit(record = {}) {
+        openModal1(true, {
+          ...record,
+        });
+      }
+      return {
+        activeKey,
+        registerTable,
+        openlogLisModal,
+        handleAuthorize,
+        handleLogList,
+        handleCopy,
+        handleDelete,
+        reload,
+        register,
+        registerlogLis,
+        handleActive,
+        getCheckPerm,
+        handleEdit,
+        handleuserEdit,
+        changeTable,
+      };
+    },
+  });
+</script>