diff --git a/auto-imports.d.ts b/auto-imports.d.ts index fb0c411..565902e 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -6,7 +6,6 @@ export {} declare global { const EffectScope: typeof import('vue')['EffectScope'] - const ElLoading: typeof import('element-plus/es')['ElLoading'] const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] const ElNotification: typeof import('element-plus/es')['ElNotification'] const computed: typeof import('vue')['computed'] diff --git a/components.d.ts b/components.d.ts index 47eb26d..f051fd1 100644 --- a/components.d.ts +++ b/components.d.ts @@ -32,6 +32,8 @@ declare module 'vue' { ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] + ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] + ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDialog: typeof import('element-plus/es')['ElDialog'] ElDivider: typeof import('element-plus/es')['ElDivider'] ElDrawer: typeof import('element-plus/es')['ElDrawer'] diff --git a/src/api/module/eam/device/index.ts b/src/api/module/eam/device/index.ts index e673f92..a1729d0 100644 --- a/src/api/module/eam/device/index.ts +++ b/src/api/module/eam/device/index.ts @@ -24,7 +24,7 @@ export interface IDeviceOV { id?: number name?: string categoryId: string - templateId: string + // templateId: string serialNo?: string sn: string description: string @@ -111,3 +111,10 @@ export const operantDeviceTestSheet = (type: OperantAction, params: any) => { }) } } +export const getDeviceTestSheet = (params: { deviceId: number; isLast: boolean }) => { + return eamServer({ + url: `/test-sheet/get-by-device-id`, + method: 'get', + params, + }) +} diff --git a/src/api/module/eam/device/template.ts b/src/api/module/eam/device/template.ts index 34b3dda..e983c69 100644 --- a/src/api/module/eam/device/template.ts +++ b/src/api/module/eam/device/template.ts @@ -57,6 +57,13 @@ export const updateSheetStatus = (id: string, status: number) => data: { id, status }, }) +export const getSheetDetail = (sheetId: number) => + eamServer({ + url: '/sheet-detail/get-by-sheet-id', + method: 'get', + params: { sheetId }, + }) + export const updateTestSheetStatus = (params: { id: number; deviceId: number }) => eamServer({ url: '/test-sheet/update-status', diff --git a/src/pages/deviceInfo/components/BasicInfo.vue b/src/pages/deviceInfo/components/BasicInfo.vue index 26f3abb..6ce4b14 100644 --- a/src/pages/deviceInfo/components/BasicInfo.vue +++ b/src/pages/deviceInfo/components/BasicInfo.vue @@ -59,7 +59,7 @@ /> -
+ +
+
当前固件:
+
@@ -84,15 +93,6 @@
-
-
当前固件:
- -
备注:
@@ -151,7 +151,7 @@ const emit = defineEmits(['on-save']) const paramsData: IDeviceOV = { currentFirmwareId: '', categoryId: '', - templateId: '', + // templateId: '', sn: '', serialNo: '', description: '', @@ -222,10 +222,10 @@ function validate() { return false } - if (isEmpty(params.value.templateId)) { - message.error('请选择测试模板') - return false - } + // if (isEmpty(params.value.templateId)) { + // message.error('请选择测试模板') + // return false + // } if (isEmpty(params.value.cost)) { message.error('请输入设备成本') diff --git a/src/pages/deviceInfo/components/DeliveryInfo.vue b/src/pages/deviceInfo/components/DeliveryInfo.vue index b0c3bc7..8212060 100644 --- a/src/pages/deviceInfo/components/DeliveryInfo.vue +++ b/src/pages/deviceInfo/components/DeliveryInfo.vue @@ -9,6 +9,7 @@ :options="customerList" placeholder="请选择出库流向" keyTag="id" + :disabled="action === 'view'" labelTag="name" valueTag="id" :isShowLabel="false" @@ -16,7 +17,11 @@
设备价格:
- +
@@ -26,6 +31,7 @@ type="textarea" v-model="params.description" placeholder="请输入备注" + :disabled="action === 'view'" :autosize="{ minRows: 3, maxRows: 4 }" />
diff --git a/src/pages/deviceInfo/components/TestInfo.vue b/src/pages/deviceInfo/components/TestInfo.vue index e8b5d62..62a7368 100644 --- a/src/pages/deviceInfo/components/TestInfo.vue +++ b/src/pages/deviceInfo/components/TestInfo.vue @@ -10,23 +10,22 @@ > + + + + diff --git a/src/pages/deviceInfo/info.vue b/src/pages/deviceInfo/info.vue index 6f5606c..4df6973 100644 --- a/src/pages/deviceInfo/info.vue +++ b/src/pages/deviceInfo/info.vue @@ -30,6 +30,7 @@ /> { +export function enumToKeyValueArray( + enumObj: object +): Array<{ label: string; value: number }> { return Object.keys(enumObj) .filter(key => isNaN(Number(key))) // 排除反向映射的数值键 .map(key => ({ label: key, value: enumObj[key as keyof typeof enumObj] as number, - })); -} \ No newline at end of file + })) +} diff --git a/src/pages/deviceStorage/components/data-filter.vue b/src/pages/deviceStorage/components/data-filter.vue index bfe2f8e..1167b14 100644 --- a/src/pages/deviceStorage/components/data-filter.vue +++ b/src/pages/deviceStorage/components/data-filter.vue @@ -1,5 +1,5 @@ @@ -77,8 +78,10 @@ import { getIntDictOptions } from '@/utils/dict' import { isResError } from '@/hooks/useMessage' import type { CustomerVO } from '@/api/module/eam/customer' import { statusList } from '../utils' +import { useMessage } from '@/hooks/useMessage' const locale = zhCn +const msg = useMessage() const prop = defineProps<{ customerList: Array> @@ -111,10 +114,46 @@ const checkbox = ref>({ customerId: false, }) +watch( + () => checkbox.value.startDay, + val => { + checkbox.value.endDay = val + } +) +watch( + () => checkbox.value.endDay, + val => { + checkbox.value.startDay = val + } +) + function onSearch() { + if (!validate()) return + emit('search', formatParams()) } +const placeholderMap = { + startDay: '开始时间', + endDay: '终止时间', + sn: '设备SN', + customerId: '客户', +} + +function validate() { + const keys = Object.entries(checkbox.value) + .filter(([, value]) => value) + .map(([key]) => key as FilterKeys) + + for (const element of keys) { + if (!filterData.value[element]) { + msg.error('请输入' + placeholderMap[element]) + return false + } + } + return true +} + function formatParams() { const params: Partial> = {} const keys = Object.keys(checkbox.value) as FilterKeys[] @@ -130,6 +169,23 @@ function formatParams() { return params } +function onReset() { + filterData.value = { + startDay: '', + endDay: '', + status: 3, + sn: '', + customerId: '', + } + checkbox.value = { + startDay: false, + endDay: false, + status: true, + sn: false, + customerId: false, + } +} + onMounted(() => { onSearch() }) diff --git a/src/pages/ota/upgradeTask/index.vue b/src/pages/ota/upgradeTask/index.vue index e415cee..9ee877c 100644 --- a/src/pages/ota/upgradeTask/index.vue +++ b/src/pages/ota/upgradeTask/index.vue @@ -113,7 +113,7 @@ import createTaskDlg from './components/create-task-dlg.vue' import detailsDrawer from './components/details-drawer.vue' import { isResError, useMessage } from '@/hooks/useMessage.js' import dayjs from 'dayjs' -import { useRoute} from 'vue-router' +import { useRoute } from 'vue-router' import { getTaskList } from '@/api/module/eam/device/task' const route = useRoute() const message = useMessage() @@ -180,7 +180,7 @@ const queryType = route.query.type onMounted(async () => { await loadData() addListener(socketMsgListener) - if(queryType === 'create') { + if (queryType === 'create') { addTask() } }) @@ -192,7 +192,7 @@ const detailsRef = ref(null) const tasksStatusMap = new Map() const socketMsgListener: SocketMsgListener = { - onCmdPost: function (type: string, stationId: number, data?: any, time?: string) { + onCmdPost: function (type: string, data?: any, time?: string) { if (type === 'upgrade') { const { deviceSn, taskId } = data if (!taskId || !deviceSn) return @@ -356,8 +356,6 @@ function updateTaskData() { // test(item.type, item.stationId, item.data, item.time) // } // }, 1000) - -