diff --git a/src/api/link/protocol.ts b/src/api/link/protocol.ts index b77a782a..c0b3b35d 100644 --- a/src/api/link/protocol.ts +++ b/src/api/link/protocol.ts @@ -3,15 +3,13 @@ import { BASE_API_PATH } from '@/utils/variable'; export const PROTOCOL_UPLOAD = `${BASE_API_PATH}/file/upload`; -export const detail = (id: string) => server.get(`/gateway/device/${id}`); +export const save = (data: Object) => server.post(`/protocol`, data); -export const save = (data: Object) => server.post(`/gateway/device`, data); - -export const update = (data: Object) => server.patch(`/gateway/device`, data); +export const update = (data: Object) => server.patch(`/protocol`, data); export const list = (data: Object) => server.post(`/protocol/_query`, data); -export const remove = (id: string) => server.remove(`/gateway/device/${id}`); +export const remove = (id: string) => server.remove(`/protocol/${id}`); export const querySystemApi = (data: Object) => server.post(`/system/config/scopes`, data); diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index 8d349c7a..ce47069b 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -63,7 +63,7 @@ const iconKeys = [ 'HistoryOutlined', 'ToolOutlined', 'FileOutlined', - 'LikeOutlined' + 'LikeOutlined', ] const Icon = (props: {type: string}) => { diff --git a/src/views/Log/Access/index.vue b/src/views/Log/Access/index.vue index 48679537..d8d80a1a 100644 --- a/src/views/Log/Access/index.vue +++ b/src/views/Log/Access/index.vue @@ -144,7 +144,7 @@ const columns = [ search: { type: 'string', }, - // width: 200, + ellipsis: true, }, { title: '请求方法', diff --git a/src/views/device/Firmware/Task/Detail/index.vue b/src/views/device/Firmware/Task/Detail/index.vue index dc4f4d29..ef8d17e4 100644 --- a/src/views/device/Firmware/Task/Detail/index.vue +++ b/src/views/device/Firmware/Task/Detail/index.vue @@ -17,19 +17,21 @@
-
- + - 批量重试 - + 批量重试 +
@@ -85,37 +87,27 @@ {{ slotProps.progress }}% @@ -129,7 +121,6 @@ import { taskById, history, historyCount, - queryProduct, startTask, startOneTask, } from '@/api/device/firmware'; @@ -138,8 +129,8 @@ import { getImage } from '@/utils/comm'; import moment from 'moment'; import { cloneDeep } from 'lodash-es'; import Save from './Save.vue'; + const tableRef = ref>({}); -const router = useRouter(); const route = useRoute(); const params = ref>({}); const taskId = route.params?.id as string; @@ -286,7 +277,7 @@ const getActions = (data: Partial>): ActionsType[] => { } const Actions = [ { - key: 'eye', + key: 'view', text: '查看', tooltip: { title: '查看', @@ -297,25 +288,23 @@ const getActions = (data: Partial>): ActionsType[] => { }, }, { - key: 'try', + key: 'update', text: '重试', tooltip: { title: '重试', }, icon: 'RedoOutlined', - onClick: async () => { - handlTry(data.id); + popConfirm: { + title: `确认重试?`, + onConfirm: async () => { + handlTry(data.id); + }, }, }, ]; return Actions; }; -const handlAdd = () => { - current.value = {}; - visible.value = true; -}; - const handlEye = (data: string) => { current.value = data || ''; visible.value = true; @@ -434,4 +423,8 @@ const handleSearch = (e: any) => { } } } +.state-button { + margin-top: -5px; + margin-right: -12px; +} diff --git a/src/views/device/Firmware/Task/index.vue b/src/views/device/Firmware/Task/index.vue index 42e65021..5c60d08d 100644 --- a/src/views/device/Firmware/Task/index.vue +++ b/src/views/device/Firmware/Task/index.vue @@ -13,9 +13,14 @@ :params="params" > @@ -79,7 +74,6 @@ import type { FormDataType } from './type'; const menuStory = useMenuStore(); const tableRef = ref>({}); -const router = useRouter(); const params = ref>({}); const productOptions = ref([]); @@ -174,7 +168,7 @@ const getActions = (data: Partial>): ActionsType[] => { } return [ { - key: 'FileTextOutlined', + key: 'view', text: '升级任务', tooltip: { title: '升级任务', @@ -185,7 +179,7 @@ const getActions = (data: Partial>): ActionsType[] => { }, }, { - key: 'edit', + key: 'update', text: '编辑', tooltip: { title: '编辑', @@ -211,7 +205,7 @@ const getActions = (data: Partial>): ActionsType[] => { ]; }; -const handlUpdate = (data: FormDataType) => { +const handlUpdate = (data: Partial>) => { menuStory.jumpPage( 'device/Firmware/Task', {}, @@ -226,7 +220,7 @@ const handlAdd = () => { current.value = {}; visible.value = true; }; -const handlEdit = (data: FormDataType) => { +const handlEdit = (data: Partial>) => { current.value = _.cloneDeep(data); visible.value = true; }; diff --git a/src/views/link/AccessConfig/Detail/index.vue b/src/views/link/AccessConfig/Detail/index.vue index 1c8ee150..a4554e90 100644 --- a/src/views/link/AccessConfig/Detail/index.vue +++ b/src/views/link/AccessConfig/Detail/index.vue @@ -98,7 +98,13 @@ const getTypeList = (result: Record) => { edge.push(item); } else { item.type = 'network'; - network.push(item); + // network.push(item); + /** + * 插件设备接入 暂时不开发 todo + */ + if (item.id !== 'plugin_gateway' || item.name !== '插件设备接入') { + network.push(item); + } } }); @@ -135,6 +141,10 @@ const queryProviders = async () => { const resp = await getProviders(); if (resp.status === 200) { dataSource.value = getTypeList(resp.result); + // dataSource.value = getTypeList(resp.result)[0].list.filter( + // (item) => item.name !== '插件设备接入', + // ); + console.log(111, dataSource.value); } }; diff --git a/src/views/link/AccessConfig/index.vue b/src/views/link/AccessConfig/index.vue index b6c35571..0f75d961 100644 --- a/src/views/link/AccessConfig/index.vue +++ b/src/views/link/AccessConfig/index.vue @@ -12,7 +12,7 @@ sorts: [{ name: 'createTime', order: 'desc' }], }" gridColumn="2" - gridColumns="[2]" + :gridColumns="[1, 2]" :params="params" > @@ -62,9 +57,10 @@ import type { ActionsType } from '@/components/Table/index'; import { query, remove } from '@/api/link/certificate'; import { message } from 'ant-design-vue'; +import { useMenuStore } from 'store/menu'; +const menuStory = useMenuStore(); const tableRef = ref>({}); -const router = useRouter(); const params = ref>({}); const columns = [ @@ -119,7 +115,7 @@ const getActions = (data: Partial>): ActionsType[] => { } return [ { - key: 'eye', + key: 'view', text: '查看', tooltip: { title: '查看', @@ -130,7 +126,7 @@ const getActions = (data: Partial>): ActionsType[] => { }, }, { - key: 'edit', + key: 'update', text: '编辑', tooltip: { title: '编辑', @@ -157,24 +153,19 @@ const getActions = (data: Partial>): ActionsType[] => { }; const handlAdd = () => { - router.push({ - path: `/iot/link/certificate/detail/:id`, - query: { view: false }, - }); + menuStory.jumpPage( + `link/Certificate/Detail`, + { id: ':id' }, + { view: false }, + ); }; const handlEye = (id: string) => { - router.push({ - path: `/iot/link/certificate/detail/${id}`, - query: { view: true }, - }); + menuStory.jumpPage(`link/Certificate/Detail`, { id }, { view: true }); }; const handlEdit = (id: string) => { - router.push({ - path: `/iot/link/certificate/detail/${id}`, - query: { view: false }, - }); + menuStory.jumpPage(`link/Certificate/Detail`, { id }, { view: false }); }; const handlDelete = async (id: string) => { diff --git a/src/views/link/DashBoard/components/Cpu.vue b/src/views/link/DashBoard/components/Cpu.vue index 0dd9da8f..6f62f3e5 100644 --- a/src/views/link/DashBoard/components/Cpu.vue +++ b/src/views/link/DashBoard/components/Cpu.vue @@ -10,7 +10,9 @@ format="YYYY-MM-DD HH:mm:ss" v-model="data.time" > - + @@ -50,8 +53,8 @@ import { } from './tool.ts'; const chartRef = ref>({}); - const loading = ref(false); +const empty = ref(false); const data = ref({ type: 'hour', time: [null, null], @@ -140,6 +143,7 @@ const handleCpuOptions = (optionsData, xAxis) => { : typeDataLine, }; myChart.setOption(options); + xAxis.length === 0 && (empty.value = true); window.addEventListener('resize', function () { myChart.resize(); }); @@ -186,4 +190,7 @@ watch( margin-top: 8px; } } +.empty { + height: 300px; +} diff --git a/src/views/link/DashBoard/components/Jvm.vue b/src/views/link/DashBoard/components/Jvm.vue index f876e0ae..44671b76 100644 --- a/src/views/link/DashBoard/components/Jvm.vue +++ b/src/views/link/DashBoard/components/Jvm.vue @@ -10,7 +10,9 @@ format="YYYY-MM-DD HH:mm:ss" v-model="data.time" > - + @@ -50,7 +53,7 @@ import { } from './tool.ts'; const chartRef = ref>({}); - +const empty = ref(false); const loading = ref(false); const data = ref({ type: 'hour', @@ -144,6 +147,7 @@ const handleJVMOptions = (optionsData, xAxis) => { : typeDataLine, }; myChart.setOption(options); + xAxis.length === 0 && (empty.value = true); window.addEventListener('resize', function () { myChart.resize(); }); @@ -190,4 +194,7 @@ watch( margin-top: 8px; } } +.empty { + height: 300px; +} diff --git a/src/views/link/DashBoard/components/Network.vue b/src/views/link/DashBoard/components/Network.vue index 2db01cc6..46188f4f 100644 --- a/src/views/link/DashBoard/components/Network.vue +++ b/src/views/link/DashBoard/components/Network.vue @@ -43,12 +43,12 @@
+
-
@@ -67,10 +67,8 @@ import moment from 'moment'; import * as echarts from 'echarts'; const chartRef = ref>({}); - -const flag = ref(true); +const empty = ref(false); const loading = ref(false); -const myChart = ref(null); const data = ref({ type: 'bytesRead', time: { @@ -163,6 +161,7 @@ const handleNetworkOptions = (optionsData, xAxis) => { : typeDataLine, }; myChart.setOption(options); + // xAxis.length === 0 && (empty.value = true); window.addEventListener('resize', function () { myChart.resize(); }); @@ -216,4 +215,7 @@ watch( display: flex; align-items: center; } +.empty { + height: 300px; +} diff --git a/src/views/link/Protocol/Save/index.vue b/src/views/link/Protocol/Save/index.vue index d4ad2ccb..1d73657d 100644 --- a/src/views/link/Protocol/Save/index.vue +++ b/src/views/link/Protocol/Save/index.vue @@ -1,13 +1,9 @@