diff --git a/src/api/index.ts b/src/api/index.ts index 98a3fa6..5a11d44 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,5 +1,5 @@ import axios from 'axios' -// import qs from 'qs' +import qs from 'qs' import { ElLoading, ElMessage } from 'element-plus' import router from '@/router/index' import useUserStore from '@/store/modules/user' @@ -41,10 +41,11 @@ request.headers.token = userStore.token } // 是否将 POST 请求参数进行字符串化处理 - // if (request.method === 'get') { - // if (request.params?.deptIds) { - // request.params.deptIds = qs.stringify(request.params.deptIds, { indices: false }) - // } + // if (request.method === 'post') { + // if (request.params?.rfids) { + // console.log(qs.stringify(request.params.rfids, { indices: 'repeat' }), 'qs.stringify(request.params.rfids, { indices: \'repeat\' })') + // request.params.rfids = qs.stringify(request.params.rfids, { indices: 'repeat' }) + // } // } return request }, diff --git a/src/api/index.ts b/src/api/index.ts index 98a3fa6..5a11d44 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,5 +1,5 @@ import axios from 'axios' -// import qs from 'qs' +import qs from 'qs' import { ElLoading, ElMessage } from 'element-plus' import router from '@/router/index' import useUserStore from '@/store/modules/user' @@ -41,10 +41,11 @@ request.headers.token = userStore.token } // 是否将 POST 请求参数进行字符串化处理 - // if (request.method === 'get') { - // if (request.params?.deptIds) { - // request.params.deptIds = qs.stringify(request.params.deptIds, { indices: false }) - // } + // if (request.method === 'post') { + // if (request.params?.rfids) { + // console.log(qs.stringify(request.params.rfids, { indices: 'repeat' }), 'qs.stringify(request.params.rfids, { indices: \'repeat\' })') + // request.params.rfids = qs.stringify(request.params.rfids, { indices: 'repeat' }) + // } // } return request }, diff --git a/src/api/system/label.ts b/src/api/system/label.ts index 94ac38b..1aac7dc 100644 --- a/src/api/system/label.ts +++ b/src/api/system/label.ts @@ -1,4 +1,4 @@ -// import qs from 'qs' +import qs from 'qs' import request from '../index' // 列表 @@ -23,8 +23,15 @@ return request({ url: '/system/rfid/export', method: 'post', - data, + params: data, responseType: 'blob', + // paramsSerializer: () => qs.stringify(params, { arrayFormat: 'repeat' }), + // paramsSerializer: (params) => { + // return qs.stringify(params, { indices: false }) + // }, + paramsSerializer: { + serialize: params => qs.stringify(params, { arrayFormat: 'repeat' }), + }, }) } // 批量导入 diff --git a/src/api/index.ts b/src/api/index.ts index 98a3fa6..5a11d44 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,5 +1,5 @@ import axios from 'axios' -// import qs from 'qs' +import qs from 'qs' import { ElLoading, ElMessage } from 'element-plus' import router from '@/router/index' import useUserStore from '@/store/modules/user' @@ -41,10 +41,11 @@ request.headers.token = userStore.token } // 是否将 POST 请求参数进行字符串化处理 - // if (request.method === 'get') { - // if (request.params?.deptIds) { - // request.params.deptIds = qs.stringify(request.params.deptIds, { indices: false }) - // } + // if (request.method === 'post') { + // if (request.params?.rfids) { + // console.log(qs.stringify(request.params.rfids, { indices: 'repeat' }), 'qs.stringify(request.params.rfids, { indices: \'repeat\' })') + // request.params.rfids = qs.stringify(request.params.rfids, { indices: 'repeat' }) + // } // } return request }, diff --git a/src/api/system/label.ts b/src/api/system/label.ts index 94ac38b..1aac7dc 100644 --- a/src/api/system/label.ts +++ b/src/api/system/label.ts @@ -1,4 +1,4 @@ -// import qs from 'qs' +import qs from 'qs' import request from '../index' // 列表 @@ -23,8 +23,15 @@ return request({ url: '/system/rfid/export', method: 'post', - data, + params: data, responseType: 'blob', + // paramsSerializer: () => qs.stringify(params, { arrayFormat: 'repeat' }), + // paramsSerializer: (params) => { + // return qs.stringify(params, { indices: false }) + // }, + paramsSerializer: { + serialize: params => qs.stringify(params, { arrayFormat: 'repeat' }), + }, }) } // 批量导入 diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue index 2a321b6..c4984bf 100644 --- a/src/views/system/notice/noteList.vue +++ b/src/views/system/notice/noteList.vue @@ -14,6 +14,7 @@ // import { exportFile } from '@/utils/exportUtils' const noticeTime = ref() const { proxy } = getCurrentInstance() as any +const $route = useRoute() const searchQuery = reactive({ noticeNo: '', // 编号 noticePublisher: '', // 发布人 @@ -190,6 +191,16 @@ } onMounted(() => { getNoticeList() + console.log($route.query) + // 从工作台跳转过来需要展示对应弹窗 + if ($route.query.statusName) { + getNoticeeApi({ ...searchQuery, limit: 99999 }).then((res) => { + const data = res.data.rows.filter((item: any) => item.id === $route.query.id) + if (data.length) { + detail(data[0]) + } + }) + } }) diff --git a/src/api/index.ts b/src/api/index.ts index 98a3fa6..5a11d44 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,5 +1,5 @@ import axios from 'axios' -// import qs from 'qs' +import qs from 'qs' import { ElLoading, ElMessage } from 'element-plus' import router from '@/router/index' import useUserStore from '@/store/modules/user' @@ -41,10 +41,11 @@ request.headers.token = userStore.token } // 是否将 POST 请求参数进行字符串化处理 - // if (request.method === 'get') { - // if (request.params?.deptIds) { - // request.params.deptIds = qs.stringify(request.params.deptIds, { indices: false }) - // } + // if (request.method === 'post') { + // if (request.params?.rfids) { + // console.log(qs.stringify(request.params.rfids, { indices: 'repeat' }), 'qs.stringify(request.params.rfids, { indices: \'repeat\' })') + // request.params.rfids = qs.stringify(request.params.rfids, { indices: 'repeat' }) + // } // } return request }, diff --git a/src/api/system/label.ts b/src/api/system/label.ts index 94ac38b..1aac7dc 100644 --- a/src/api/system/label.ts +++ b/src/api/system/label.ts @@ -1,4 +1,4 @@ -// import qs from 'qs' +import qs from 'qs' import request from '../index' // 列表 @@ -23,8 +23,15 @@ return request({ url: '/system/rfid/export', method: 'post', - data, + params: data, responseType: 'blob', + // paramsSerializer: () => qs.stringify(params, { arrayFormat: 'repeat' }), + // paramsSerializer: (params) => { + // return qs.stringify(params, { indices: false }) + // }, + paramsSerializer: { + serialize: params => qs.stringify(params, { arrayFormat: 'repeat' }), + }, }) } // 批量导入 diff --git a/src/views/system/notice/noteList.vue b/src/views/system/notice/noteList.vue index 2a321b6..c4984bf 100644 --- a/src/views/system/notice/noteList.vue +++ b/src/views/system/notice/noteList.vue @@ -14,6 +14,7 @@ // import { exportFile } from '@/utils/exportUtils' const noticeTime = ref() const { proxy } = getCurrentInstance() as any +const $route = useRoute() const searchQuery = reactive({ noticeNo: '', // 编号 noticePublisher: '', // 发布人 @@ -190,6 +191,16 @@ } onMounted(() => { getNoticeList() + console.log($route.query) + // 从工作台跳转过来需要展示对应弹窗 + if ($route.query.statusName) { + getNoticeeApi({ ...searchQuery, limit: 99999 }).then((res) => { + const data = res.data.rows.filter((item: any) => item.id === $route.query.id) + if (data.length) { + detail(data[0]) + } + }) + } }) diff --git a/src/views/tested/device/model/components/edit.vue b/src/views/tested/device/model/components/edit.vue index 9e163b4..86765f3 100644 --- a/src/views/tested/device/model/components/edit.vue +++ b/src/views/tested/device/model/components/edit.vue @@ -42,10 +42,10 @@ }) // 表单 // 设备名称验证规则 const checkCycle = (rule: any, value: any, callback: any) => { - if (value === '') { + if (String(value) === '') { callback(new Error('检定周期必填且为有效数字')) } - else if (value.includes('-') || value.includes('+') || value.includes('.') || value === '0') { + else if (String(value).includes('-') || String(value).includes('+') || String(value).includes('.') || String(value) === '0') { callback(new Error('检定周期必须为有效正整数')) } else {