|
@@ -1,44 +1,76 @@
|
|
<template>
|
|
<template>
|
|
- <div>
|
|
|
|
- <BasicTable @register="registerTable">
|
|
|
|
- <template #toolbar>
|
|
|
|
- <a-button type="primary" @click="handleEdit" v-if="getCheckPerm('rtk-add')"
|
|
|
|
- >新增</a-button
|
|
|
|
- >
|
|
|
|
- </template>
|
|
|
|
- <template #copy="{ record }">
|
|
|
|
- <a @click="handleCopy(record.authorizeKey)">
|
|
|
|
- {{ record.authorizeKey }}
|
|
|
|
- </a>
|
|
|
|
- </template>
|
|
|
|
- <template #action="{ record }">
|
|
|
|
- <TableAction
|
|
|
|
- :actions="[
|
|
|
|
- //{
|
|
|
|
- // label: record.status ? '取消激活' : '激活',
|
|
|
|
- // ifShow: getCheckPerm('rtk-activation'),
|
|
|
|
- // onClick: handleActive.bind(null, record),
|
|
|
|
- //},
|
|
|
|
- {
|
|
|
|
- label: '编辑',
|
|
|
|
- ifShow: getCheckPerm('rtk-updata'),
|
|
|
|
- onClick: handleEdit.bind(null, record),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '删除',
|
|
|
|
- color: 'error',
|
|
|
|
- ifShow: getCheckPerm('rtk-delete'),
|
|
|
|
- onClick: handleDelete.bind(null, record),
|
|
|
|
- },
|
|
|
|
- ]"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- </BasicTable>
|
|
|
|
- <AddModal @register="register" @update="reload" />
|
|
|
|
|
|
+ <PageWrapper contentClass="testPageWrapper">
|
|
|
|
+ <template #footer>
|
|
|
|
+ <a-tabs v-model:activeKey="activeKey" @change="changeTable">
|
|
|
|
+ <a-tab-pane :key="0" tab="RTK设备管理" />
|
|
|
|
+ <a-tab-pane :key="1" tab="差分账号管理" />
|
|
|
|
+ <a-tab-pane :key="2" tab="账号使用日志" />
|
|
|
|
+ </a-tabs>
|
|
|
|
+ </template>
|
|
|
|
+ <div>
|
|
|
|
+ <BasicTable key="registerTable" v-show="activeKey == 0" @register="registerTable">
|
|
|
|
+ <template #toolbar>
|
|
|
|
+ <a-button type="primary" @click="handleEdit" v-if="getCheckPerm('rtk-add')"
|
|
|
|
+ >新增RTK</a-button
|
|
|
|
+ >
|
|
|
|
+ <a-button type="primary" @click="handleExport(3)" v-if="getCheckPerm('rtk-add')"
|
|
|
|
+ >批量导入</a-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ <template #action="{ record }">
|
|
|
|
+ <TableAction
|
|
|
|
+ :actions="[
|
|
|
|
+ {
|
|
|
|
+ label: '编辑',
|
|
|
|
+ ifShow: getCheckPerm('rtk-updata'),
|
|
|
|
+ onClick: handleEdit.bind(null, record),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '删除',
|
|
|
|
+ color: 'error',
|
|
|
|
+ ifShow: getCheckPerm('rtk-delete'),
|
|
|
|
+ onClick: handleDelete.bind(null, record),
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ </BasicTable>
|
|
|
|
+ <BasicTable key="registeruserTable" v-show="activeKey == 1" @register="registeruserTable">
|
|
|
|
+ <template #toolbar>
|
|
|
|
+ <a-button type="primary" @click="handleuserEdit" v-if="getCheckPerm('rtk-add')"
|
|
|
|
+ >新增账户</a-button
|
|
|
|
+ >
|
|
|
|
+ <a-button type="primary" @click="handleExport(4)" v-if="getCheckPerm('rtk-add')"
|
|
|
|
+ >批量导入</a-button
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ <template #action="{ record }">
|
|
|
|
+ <TableAction
|
|
|
|
+ :actions="[
|
|
|
|
+ {
|
|
|
|
+ label: '编辑',
|
|
|
|
+ ifShow: getCheckPerm('rtk-updata'),
|
|
|
|
+ onClick: handleuserEdit.bind(null, record),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '删除',
|
|
|
|
+ color: 'error',
|
|
|
|
+ ifShow: getCheckPerm('rtk-delete'),
|
|
|
|
+ onClick: handleDelete.bind(null, record),
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ </BasicTable>
|
|
|
|
+ <BasicTable v-show="activeKey == 2" @register="registerlogTable" />
|
|
|
|
+ <AddModal @register="register" @update="reload" />
|
|
|
|
+ <AdduserModal @register="registeruser" @update="reload" />
|
|
|
|
+ <batchPutModal @register="registerPut" @reload="reload" />
|
|
</div>
|
|
</div>
|
|
|
|
+ </PageWrapper>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
- import { defineComponent, h } from 'vue';
|
|
|
|
|
|
+ import { defineComponent, h, ref } from 'vue';
|
|
import {
|
|
import {
|
|
BasicTable,
|
|
BasicTable,
|
|
useTable,
|
|
useTable,
|
|
@@ -47,112 +79,47 @@
|
|
TableImg,
|
|
TableImg,
|
|
FormProps,
|
|
FormProps,
|
|
} from '/@/components/Table';
|
|
} from '/@/components/Table';
|
|
- import { rtkInfoList, rtkdelOrEdit, activation } from '/@/api/product';
|
|
|
|
|
|
+ import { PageWrapper } from '/@/components/Page';
|
|
|
|
+ import {
|
|
|
|
+ rtkDeviceList,
|
|
|
|
+ rtkDevicedel,
|
|
|
|
+ rtkAccountList,
|
|
|
|
+ rtkAccountdel,
|
|
|
|
+ rtkUseLogList,
|
|
|
|
+ } from '/@/api/rtk';
|
|
import { useModal } from '/@/components/Modal';
|
|
import { useModal } from '/@/components/Modal';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
import { copyTextToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
import AddModal from './AddModal.vue';
|
|
import AddModal from './AddModal.vue';
|
|
|
|
+ import batchPutModal from './batchPutModal.vue';
|
|
|
|
+ import AdduserModal from './AdduserModal.vue';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
import { incrementUseTypeList } from '/@/api/account';
|
|
import { incrementUseTypeList } from '/@/api/account';
|
|
|
|
+ import { rtkdeviceColumns, rtkuserColumns, rtklogColumns, rtkusersearchForm, rtklogsearchForm, rtksearchForm } from './data';
|
|
|
|
+ import { Tabs } from 'ant-design-vue';
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
components: {
|
|
components: {
|
|
BasicTable,
|
|
BasicTable,
|
|
AddModal,
|
|
AddModal,
|
|
|
|
+ AdduserModal,
|
|
|
|
+ batchPutModal,
|
|
TableAction,
|
|
TableAction,
|
|
TableImg,
|
|
TableImg,
|
|
|
|
+ PageWrapper,
|
|
|
|
+ [Tabs.name]: Tabs,
|
|
|
|
+ [Tabs.TabPane.name]: Tabs.TabPane,
|
|
},
|
|
},
|
|
setup() {
|
|
setup() {
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
|
|
+ const activeKey = ref(0);
|
|
const { createMessage, createConfirm } = useMessage();
|
|
const { createMessage, createConfirm } = useMessage();
|
|
const permissionStore = usePermissionStore();
|
|
const permissionStore = usePermissionStore();
|
|
const { getCheckPerm } = permissionStore;
|
|
const { getCheckPerm } = permissionStore;
|
|
const [register, { openModal }] = useModal();
|
|
const [register, { openModal }] = useModal();
|
|
- const columns: BasicColumn[] = [
|
|
|
|
- {
|
|
|
|
- title: '相机sn',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'cameraSnCode',
|
|
|
|
- width: 100,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '板卡类型',
|
|
|
|
- dataIndex: 'rtkType',
|
|
|
|
- ellipsis: true,
|
|
|
|
- width: 120,
|
|
|
|
- customRender: ({ record }) => {
|
|
|
|
- let obj = {
|
|
|
|
- 0: '千寻板卡千寻账号',
|
|
|
|
- 1: '千寻板卡移动账号',
|
|
|
|
- 2: '北云板卡移动账号',
|
|
|
|
- };
|
|
|
|
- return obj[record.rtkType] || '-';
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '板卡sn号',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'rtkSnCode',
|
|
|
|
- width: 150,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '深光rtk插件sn',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'sgRtkSn',
|
|
|
|
- width: 120,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '运营商',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'operator',
|
|
|
|
- width: 120,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: 'IP地址',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'ipAddr',
|
|
|
|
- width: 100,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '挂载点',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'mountPoint',
|
|
|
|
- width: 120,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '端口',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'port',
|
|
|
|
- width: 50,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '用户名称',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'userName',
|
|
|
|
- width: 120,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '创建人',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'createNickName',
|
|
|
|
- width: 100,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '创建时间',
|
|
|
|
- ellipsis: true,
|
|
|
|
- dataIndex: 'createTime',
|
|
|
|
- width: 160,
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: 'RTK使用状态',
|
|
|
|
- dataIndex: 'status',
|
|
|
|
- ellipsis: true,
|
|
|
|
- width: 120,
|
|
|
|
- customRender: ({ record }) => {
|
|
|
|
- return '正常';
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
|
|
+ const [registeruser, { openModal: openModal1 }] = useModal();
|
|
|
|
+ const [registerPut, { openModal: openModalPut }] = useModal();
|
|
|
|
+
|
|
const searchForm: Partial<FormProps> = {
|
|
const searchForm: Partial<FormProps> = {
|
|
labelWidth: 100,
|
|
labelWidth: 100,
|
|
autoSubmitOnEnter: true,
|
|
autoSubmitOnEnter: true,
|
|
@@ -168,7 +135,7 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
field: 'rtkSnCode',
|
|
field: 'rtkSnCode',
|
|
- label: '板卡sn号',
|
|
|
|
|
|
+ label: '板卡SN号',
|
|
component: 'Input',
|
|
component: 'Input',
|
|
colProps: {
|
|
colProps: {
|
|
xl: 8,
|
|
xl: 8,
|
|
@@ -195,7 +162,7 @@
|
|
},
|
|
},
|
|
{
|
|
{
|
|
field: 'sgRtkSn',
|
|
field: 'sgRtkSn',
|
|
- label: '深光rtk插件sn',
|
|
|
|
|
|
+ label: '深光rtk插件SN号',
|
|
component: 'Input',
|
|
component: 'Input',
|
|
colProps: {
|
|
colProps: {
|
|
xl: 8,
|
|
xl: 8,
|
|
@@ -204,13 +171,13 @@
|
|
},
|
|
},
|
|
],
|
|
],
|
|
};
|
|
};
|
|
- const [registerTable, { reload }] = useTable({
|
|
|
|
- api: rtkInfoList,
|
|
|
|
- title: 'rtk列表',
|
|
|
|
- columns: columns,
|
|
|
|
|
|
+ const [registerTable, { reload: reload0 }] = useTable({
|
|
|
|
+ api: rtkDeviceList,
|
|
|
|
+ title: 'rtk设备列表',
|
|
|
|
+ columns: rtkdeviceColumns,
|
|
useSearchForm: true,
|
|
useSearchForm: true,
|
|
- showIndexColumn: true,
|
|
|
|
- formConfig: searchForm,
|
|
|
|
|
|
+ showIndexColumn: false,
|
|
|
|
+ formConfig: rtksearchForm,
|
|
showTableSetting: true,
|
|
showTableSetting: true,
|
|
fetchSetting: {
|
|
fetchSetting: {
|
|
pageField: 'pageNum',
|
|
pageField: 'pageNum',
|
|
@@ -225,7 +192,47 @@
|
|
slots: { customRender: 'action' },
|
|
slots: { customRender: 'action' },
|
|
},
|
|
},
|
|
rowKey: 'id',
|
|
rowKey: 'id',
|
|
- canResize: true,
|
|
|
|
|
|
+ canResize: false,
|
|
|
|
+ });
|
|
|
|
+ const [registeruserTable, { reload: reload1 }] = useTable({
|
|
|
|
+ api: rtkAccountList,
|
|
|
|
+ title: '差分账号管理',
|
|
|
|
+ columns: rtkuserColumns,
|
|
|
|
+ useSearchForm: true,
|
|
|
|
+ showIndexColumn: false,
|
|
|
|
+ formConfig: rtkusersearchForm,
|
|
|
|
+ showTableSetting: true,
|
|
|
|
+ fetchSetting: {
|
|
|
|
+ pageField: 'pageNum',
|
|
|
|
+ sizeField: 'pageSize',
|
|
|
|
+ listField: 'list',
|
|
|
|
+ totalField: 'total',
|
|
|
|
+ },
|
|
|
|
+ actionColumn: {
|
|
|
|
+ width: 160,
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'action',
|
|
|
|
+ slots: { customRender: 'action' },
|
|
|
|
+ },
|
|
|
|
+ rowKey: 'id',
|
|
|
|
+ canResize: false,
|
|
|
|
+ });
|
|
|
|
+ const [registerlogTable, { reload: reload2 }] = useTable({
|
|
|
|
+ api: rtkUseLogList,
|
|
|
|
+ title: '账号使用日志',
|
|
|
|
+ columns: rtklogColumns,
|
|
|
|
+ useSearchForm: true,
|
|
|
|
+ showIndexColumn: false,
|
|
|
|
+ formConfig: rtklogsearchForm,
|
|
|
|
+ showTableSetting: true,
|
|
|
|
+ fetchSetting: {
|
|
|
|
+ pageField: 'pageNum',
|
|
|
|
+ sizeField: 'pageSize',
|
|
|
|
+ listField: 'list',
|
|
|
|
+ totalField: 'total',
|
|
|
|
+ },
|
|
|
|
+ rowKey: 'id',
|
|
|
|
+ canResize: false,
|
|
});
|
|
});
|
|
async function handleDelete(record) {
|
|
async function handleDelete(record) {
|
|
createConfirm({
|
|
createConfirm({
|
|
@@ -233,16 +240,30 @@
|
|
title: () => h('span', '温馨提示'),
|
|
title: () => h('span', '温馨提示'),
|
|
content: () => h('span', '确定要删除吗?'),
|
|
content: () => h('span', '确定要删除吗?'),
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
- await rtkdelOrEdit({ id: record.id });
|
|
|
|
|
|
+ let apiUrl = activeKey.value == 0 ? rtkDevicedel : rtkAccountdel;
|
|
|
|
+ await apiUrl({ id: record.id });
|
|
reload();
|
|
reload();
|
|
createMessage.success(t('common.optSuccess'));
|
|
createMessage.success(t('common.optSuccess'));
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
function handleCopy(str: string) {
|
|
function handleCopy(str: string) {
|
|
- copyTextToClipboard(str)
|
|
|
|
|
|
+ copyTextToClipboard(str);
|
|
createMessage.success('复制成功');
|
|
createMessage.success('复制成功');
|
|
}
|
|
}
|
|
|
|
+ function changeTable(val: number) {
|
|
|
|
+ activeKey.value = val;
|
|
|
|
+ // reload();
|
|
|
|
+ }
|
|
|
|
+ function reload() {
|
|
|
|
+ if (activeKey.value == 0) {
|
|
|
|
+ reload0();
|
|
|
|
+ } else if (activeKey.value == 1) {
|
|
|
|
+ reload1();
|
|
|
|
+ } else {
|
|
|
|
+ reload2();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
function handleActive(record) {
|
|
function handleActive(record) {
|
|
createConfirm({
|
|
createConfirm({
|
|
iconType: 'warning',
|
|
iconType: 'warning',
|
|
@@ -255,21 +276,39 @@
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ function handleExport(type) {
|
|
|
|
+ openModalPut(true, {
|
|
|
|
+ type,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
function handleEdit(record = {}) {
|
|
function handleEdit(record = {}) {
|
|
openModal(true, {
|
|
openModal(true, {
|
|
...record,
|
|
...record,
|
|
authorizeTime: `${record.authorizeTime || '10'}_${record.authorizeTimeUnit || '1'}`,
|
|
authorizeTime: `${record.authorizeTime || '10'}_${record.authorizeTimeUnit || '1'}`,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ function handleuserEdit(record = {}) {
|
|
|
|
+ openModal1(true, {
|
|
|
|
+ ...record,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
return {
|
|
return {
|
|
|
|
+ activeKey,
|
|
registerTable,
|
|
registerTable,
|
|
|
|
+ registeruser,
|
|
|
|
+ registeruserTable,
|
|
|
|
+ registerlogTable,
|
|
|
|
+ handleExport,
|
|
handleCopy,
|
|
handleCopy,
|
|
handleDelete,
|
|
handleDelete,
|
|
reload,
|
|
reload,
|
|
register,
|
|
register,
|
|
|
|
+ registerPut,
|
|
handleActive,
|
|
handleActive,
|
|
getCheckPerm,
|
|
getCheckPerm,
|
|
handleEdit,
|
|
handleEdit,
|
|
|
|
+ handleuserEdit,
|
|
|
|
+ changeTable,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
});
|
|
});
|