diff --git a/src/api/device-boot/Business.ts b/src/api/device-boot/Business.ts index dda0bd32..27c0f989 100644 --- a/src/api/device-boot/Business.ts +++ b/src/api/device-boot/Business.ts @@ -134,6 +134,22 @@ export function selectUserList(data: any) { data }) } +//获取用户 +export function selectUserAssessMentList(data: any) { + return createAxios({ + url: '/supervision-boot/userReport/selectUserAssessMentList', + method: 'post', + data + }) +} +//绑定用户 +export function bindAssessmentId(data: any) { + return createAxios({ + url: '/supervision-boot/userReport/bindAssessmentId', + method: 'get', + params: data + }) +} //查询列表 export function getStatusManageList(data: any) { return createAxios({ diff --git a/src/components/PreviewFile/index.vue b/src/components/PreviewFile/index.vue index 414467ce..886ac96d 100644 --- a/src/components/PreviewFile/index.vue +++ b/src/components/PreviewFile/index.vue @@ -7,7 +7,7 @@ :options="excelOptions" /> - + -
- -
- - - - - - \ No newline at end of file + + + + diff --git a/src/utils/request.ts b/src/utils/request.ts index b62fb0f8..26a7acc8 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,326 +1,327 @@ -import type { AxiosRequestConfig, Method } from 'axios' -import axios from 'axios' -import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus' -import { refreshToken } from '@/api/user-boot/user' -import router from '@/router/index' -import { useAdminInfo } from '@/stores/adminInfo' -import { debounce } from 'lodash-es'; -let loginExpireTimer:any = null -window.requests = [] -window.tokenRefreshing = false -const pendingMap = new Map() -const loadingInstance: LoadingInstance = { - target: null, - count: 0 -} -const VITE_FLAG = import.meta.env.VITE_NAME == 'removeMode' -// console.log('🚀 ~ import.meta.env.VITE_NAME:', import.meta.env.VITE_NAME) -/** - * 根据运行环境获取基础请求URL - */ -export const getUrl = (): string => { - return '/api' -} -function removeBeforeSecondSlash(str: string) { - // 找到第一个斜杠的位置 - const firstSlashIndex = str.indexOf('/') - if (firstSlashIndex === -1) { - // 如果没有斜杠,返回原字符串 - return str - } - // 从第一个斜杠之后开始找第二个斜杠 - const secondSlashIndex = str.indexOf('/', firstSlashIndex + 1) - if (secondSlashIndex === -1) { - // 如果只有一个斜杠,返回原字符串 - return str - } - // 返回第二个斜杠及之后的内容 - return str.substring(secondSlashIndex) -} -/** - * 创建`Axios` - * 默认开启`reductDataFormat(简洁响应)`,返回类型为`ApiPromise` - * 关闭`reductDataFormat`,返回类型则为`AxiosPromise` - */ -function createAxios>( - axiosConfig: AxiosRequestConfig, - options: Options = {}, - loading: LoadingOptions = {} -): T { - const adminInfo = useAdminInfo() - - const Axios = axios.create({ - baseURL: getUrl(), - timeout: 1000 * 60 * 5, - headers: {}, - responseType: 'json' - }) - - options = Object.assign( - { - CancelDuplicateRequest: true, // 是否开启取消重复请求, 默认为 true - loading: false, // 是否开启loading层效果, 默认为false - reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true - showErrorMessage: true, // 是否开启接口错误信息展示,默认为true - showCodeMessage: true, // 是否开启code不为1时的信息提示, 默认为true - showSuccessMessage: false, // 是否开启code为1时的信息提示, 默认为false - anotherToken: '' // 当前请求使用另外的用户token - }, - options - ) - - // 请求拦截 - Axios.interceptors.request.use( - async (config: any) => { - //嵌入去除所有请求头 - if (VITE_FLAG) { - config.url = await removeBeforeSecondSlash(config.url) - } - - // 取消重复请求 - - if ( - !( - config.url == '/system-boot/file/upload' || - config.url == '/harmonic-boot/grid/getAssessOverview' || - config.url == '/system-boot/file/getFileVO' || - config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData' - ) - ) - removePending(config) - - options.CancelDuplicateRequest && addPending(config) - // 创建loading实例 - if (options.loading) { - loadingInstance.count++ - if (loadingInstance.count === 1) { - loadingInstance.target = ElLoading.service(loading) - } - } - // 自动携带token - if (config.headers) { - const token = adminInfo.getToken() - if (token) { - ;(config.headers as anyObj).Authorization = token - } else { - config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw==' - } - } - if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') { - config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw==' - } - - return config - }, - error => { - return Promise.reject(error) - } - ) - - // 响应拦截 - Axios.interceptors.response.use( - response => { - removePending(response.config) - options.loading && closeLoading(options) // 关闭loading - - if ( - response.data.code === 'A0000' || - response.data.type === 'application/json' || - Array.isArray(response.data) || - response.data.size || - response.config.url == '/harmonic-boot/exportmodel/exportModelJB' || - response.config.url == '/system-boot/file/download' || - response.config.url == '/harmonic-boot/powerStatistics/exportExcelListTemplate' || - response.config.url == '/harmonic-boot/powerStatistics/exportExcelRangTemplate' - // || - // response.data.type === 'application/octet-stream' || - // response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' - ) { - return options.reductDataFormat ? response.data : response - } else if (response.data.code == 'A0202') { - if (!window.tokenRefreshing) { - window.tokenRefreshing = true - - return refreshToken() - .then(res => { - adminInfo.setToken(res.data.access_token, 'auth') - window.requests.forEach(cb => cb(res.data.access_token)) - window.requests = [] - - return Axios(response.config) - }) - .catch(err => { - adminInfo.removeToken() - router.push({ name: 'login' }) - return Promise.reject(err) - }) - .finally(() => { - window.tokenRefreshing = false - }) - } else { - return new Promise(resolve => { - // 用函数形式将 resolve 存入,等待刷新后再执行 - window.requests.push((token: string) => { - response.headers.Authorization = `${token}` - resolve(Axios(response.config)) - }) - }) - } - } else if (response.data.code == 'A0024' || response.data.code == 'null') { - // // 登录失效 - // 清除上一次的定时器 - if (loginExpireTimer) { - clearTimeout(loginExpireTimer) - } - loginExpireTimer = setTimeout(() => { - ElNotification({ - type: 'error', - message: response.data.message - }) - adminInfo.removeToken() - router.push({ name: 'login' }) - loginExpireTimer = null // 执行后清空定时器 - }, 100) // 可根据实际情况调整延迟时间 - return Promise.reject(response.data) - } else { - if (options.showCodeMessage) { - ElNotification({ - type: 'error', - message: response.data.message || '未知错误' - }) - } - return Promise.reject(response.data) - } - }, - error => { - error.config && removePending(error.config) - options.loading && closeLoading(options) // 关闭loading - return Promise.reject(error) // 错误继续返回给到具体页面 - } - ) - return Axios(axiosConfig) as T -} - -export default createAxios - -/** - * 关闭Loading层实例 - */ -function closeLoading(options: Options) { - if (options.loading && loadingInstance.count > 0) loadingInstance.count-- - if (loadingInstance.count === 0) { - loadingInstance.target.close() - loadingInstance.target = null - } -} - -/** - * 储存每个请求的唯一cancel回调, 以此为标识 - */ -function addPending(config: AxiosRequestConfig) { - const pendingKey = getPendingKey(config) - config.cancelToken = - config.cancelToken || - new axios.CancelToken(cancel => { - if (!pendingMap.has(pendingKey)) { - pendingMap.set(pendingKey, cancel) - } - }) -} - -/** - * 删除重复的请求 - */ -function removePending(config: AxiosRequestConfig) { - const pendingKey = getPendingKey(config) - if (pendingMap.has(pendingKey)) { - const cancelToken = pendingMap.get(pendingKey) - cancelToken(pendingKey) - pendingMap.delete(pendingKey) - } -} - -/** - * 生成每个请求的唯一key - */ -function getPendingKey(config: AxiosRequestConfig) { - let { data } = config - const { url, method, params, headers } = config - if (typeof data === 'string') data = JSON.parse(data) // response里面返回的config.data是个字符串对象 - return [ - url, - method, - headers && (headers as anyObj).Authorization ? (headers as anyObj).Authorization : '', - headers && (headers as anyObj)['ba-user-token'] ? (headers as anyObj)['ba-user-token'] : '', - JSON.stringify(params), - JSON.stringify(data) - ].join('&') -} - -/** - * 根据请求方法组装请求数据/参数 - */ -export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) { - if (method == 'GET') { - return { - params: data - } - } else if (method == 'POST') { - if (paramsPOST) { - return { params: data } - } else { - return { data: data } - } - } -} -// 适配器, 用于适配不同的请求方式 -export function baseRequest(url, value = {}, method = 'post', options = {}) { - url = sysConfig.API_URL + url - if (method === 'post') { - return service.post(url, value, options) - } else if (method === 'get') { - return service.get(url, { params: value, ...options }) - } else if (method === 'formdata') { - // form-data表单提交的方式 - return service.post(url, qs.stringify(value), { - headers: { - 'Content-Type': 'multipart/form-data' - }, - ...options - }) - } else { - // 其他请求方式,例如:put、delete - return service({ - method: method, - url: url, - data: value, - ...options - }) - } -} -// 模块内的请求, 会自动加上模块的前缀 -export const moduleRequest = - moduleUrl => - (url, ...arg) => { - return baseRequest(moduleUrl + url, ...arg) - } - -interface LoadingInstance { - target: any - count: number -} - -interface Options { - // 是否开启取消重复请求, 默认为 true - CancelDuplicateRequest?: boolean - // 是否开启loading层效果, 默认为false - loading?: boolean - // 是否开启简洁的数据结构响应, 默认为true - reductDataFormat?: boolean - // 是否开启code不为A0000时的信息提示, 默认为true - showCodeMessage?: boolean - // 是否开启code为0时的信息提示, 默认为false - showSuccessMessage?: boolean - // 当前请求使用另外的用户token - anotherToken?: string -} +import type { AxiosRequestConfig, Method } from 'axios' +import axios from 'axios' +import { ElLoading, ElNotification, type LoadingOptions } from 'element-plus' +import { refreshToken } from '@/api/user-boot/user' +import router from '@/router/index' +import { useAdminInfo } from '@/stores/adminInfo' +import { debounce } from 'lodash-es' +let loginExpireTimer: any = null +window.requests = [] +window.tokenRefreshing = false +const pendingMap = new Map() +const loadingInstance: LoadingInstance = { + target: null, + count: 0 +} +const VITE_FLAG = import.meta.env.VITE_NAME == 'removeMode' +// console.log('🚀 ~ import.meta.env.VITE_NAME:', import.meta.env.VITE_NAME) +/** + * 根据运行环境获取基础请求URL + */ +export const getUrl = (): string => { + return '/api' +} +function removeBeforeSecondSlash(str: string) { + // 找到第一个斜杠的位置 + const firstSlashIndex = str.indexOf('/') + if (firstSlashIndex === -1) { + // 如果没有斜杠,返回原字符串 + return str + } + // 从第一个斜杠之后开始找第二个斜杠 + const secondSlashIndex = str.indexOf('/', firstSlashIndex + 1) + if (secondSlashIndex === -1) { + // 如果只有一个斜杠,返回原字符串 + return str + } + // 返回第二个斜杠及之后的内容 + return str.substring(secondSlashIndex) +} +/** + * 创建`Axios` + * 默认开启`reductDataFormat(简洁响应)`,返回类型为`ApiPromise` + * 关闭`reductDataFormat`,返回类型则为`AxiosPromise` + */ +function createAxios>( + axiosConfig: AxiosRequestConfig, + options: Options = {}, + loading: LoadingOptions = {} +): T { + const adminInfo = useAdminInfo() + + const Axios = axios.create({ + baseURL: getUrl(), + timeout: 1000 * 60 * 5, + headers: {}, + responseType: 'json' + }) + + options = Object.assign( + { + CancelDuplicateRequest: true, // 是否开启取消重复请求, 默认为 true + loading: false, // 是否开启loading层效果, 默认为false + reductDataFormat: true, // 是否开启简洁的数据结构响应, 默认为true + showErrorMessage: true, // 是否开启接口错误信息展示,默认为true + showCodeMessage: true, // 是否开启code不为1时的信息提示, 默认为true + showSuccessMessage: false, // 是否开启code为1时的信息提示, 默认为false + anotherToken: '' // 当前请求使用另外的用户token + }, + options + ) + + // 请求拦截 + Axios.interceptors.request.use( + async (config: any) => { + //嵌入去除所有请求头 + if (VITE_FLAG) { + config.url = await removeBeforeSecondSlash(config.url) + } + + // 取消重复请求 + + if ( + !( + config.url == '/system-boot/file/upload' || + config.url == '/harmonic-boot/grid/getAssessOverview' || + config.url == '/system-boot/file/getFileVO' || + config.url == '/harmonic-boot/gridDiagram/getGridDiagramAreaData' || + config.url == '/supervision-boot/userReport/bindAssessmentId' + ) + ) + removePending(config) + + options.CancelDuplicateRequest && addPending(config) + // 创建loading实例 + if (options.loading) { + loadingInstance.count++ + if (loadingInstance.count === 1) { + loadingInstance.target = ElLoading.service(loading) + } + } + // 自动携带token + if (config.headers) { + const token = adminInfo.getToken() + if (token) { + ;(config.headers as anyObj).Authorization = token + } else { + config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw==' + } + } + if (config.url == '/user-boot/user/generateSm2Key' || config.url == '/pqs-auth/oauth/token') { + config.headers.Authorization = 'Basic bmpjbnRlc3Q6bmpjbnBxcw==' + } + + return config + }, + error => { + return Promise.reject(error) + } + ) + + // 响应拦截 + Axios.interceptors.response.use( + response => { + removePending(response.config) + options.loading && closeLoading(options) // 关闭loading + + if ( + response.data.code === 'A0000' || + response.data.type === 'application/json' || + Array.isArray(response.data) || + response.data.size || + response.config.url == '/harmonic-boot/exportmodel/exportModelJB' || + response.config.url == '/system-boot/file/download' || + response.config.url == '/harmonic-boot/powerStatistics/exportExcelListTemplate' || + response.config.url == '/harmonic-boot/powerStatistics/exportExcelRangTemplate' + // || + // response.data.type === 'application/octet-stream' || + // response.data.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ) { + return options.reductDataFormat ? response.data : response + } else if (response.data.code == 'A0202') { + if (!window.tokenRefreshing) { + window.tokenRefreshing = true + + return refreshToken() + .then(res => { + adminInfo.setToken(res.data.access_token, 'auth') + window.requests.forEach(cb => cb(res.data.access_token)) + window.requests = [] + + return Axios(response.config) + }) + .catch(err => { + adminInfo.removeToken() + router.push({ name: 'login' }) + return Promise.reject(err) + }) + .finally(() => { + window.tokenRefreshing = false + }) + } else { + return new Promise(resolve => { + // 用函数形式将 resolve 存入,等待刷新后再执行 + window.requests.push((token: string) => { + response.headers.Authorization = `${token}` + resolve(Axios(response.config)) + }) + }) + } + } else if (response.data.code == 'A0024' || response.data.code == 'null') { + // // 登录失效 + // 清除上一次的定时器 + if (loginExpireTimer) { + clearTimeout(loginExpireTimer) + } + loginExpireTimer = setTimeout(() => { + ElNotification({ + type: 'error', + message: response.data.message + }) + adminInfo.removeToken() + router.push({ name: 'login' }) + loginExpireTimer = null // 执行后清空定时器 + }, 100) // 可根据实际情况调整延迟时间 + return Promise.reject(response.data) + } else { + if (options.showCodeMessage) { + ElNotification({ + type: 'error', + message: response.data.message || '未知错误' + }) + } + return Promise.reject(response.data) + } + }, + error => { + error.config && removePending(error.config) + options.loading && closeLoading(options) // 关闭loading + return Promise.reject(error) // 错误继续返回给到具体页面 + } + ) + return Axios(axiosConfig) as T +} + +export default createAxios + +/** + * 关闭Loading层实例 + */ +function closeLoading(options: Options) { + if (options.loading && loadingInstance.count > 0) loadingInstance.count-- + if (loadingInstance.count === 0) { + loadingInstance.target.close() + loadingInstance.target = null + } +} + +/** + * 储存每个请求的唯一cancel回调, 以此为标识 + */ +function addPending(config: AxiosRequestConfig) { + const pendingKey = getPendingKey(config) + config.cancelToken = + config.cancelToken || + new axios.CancelToken(cancel => { + if (!pendingMap.has(pendingKey)) { + pendingMap.set(pendingKey, cancel) + } + }) +} + +/** + * 删除重复的请求 + */ +function removePending(config: AxiosRequestConfig) { + const pendingKey = getPendingKey(config) + if (pendingMap.has(pendingKey)) { + const cancelToken = pendingMap.get(pendingKey) + cancelToken(pendingKey) + pendingMap.delete(pendingKey) + } +} + +/** + * 生成每个请求的唯一key + */ +function getPendingKey(config: AxiosRequestConfig) { + let { data } = config + const { url, method, params, headers } = config + if (typeof data === 'string') data = JSON.parse(data) // response里面返回的config.data是个字符串对象 + return [ + url, + method, + headers && (headers as anyObj).Authorization ? (headers as anyObj).Authorization : '', + headers && (headers as anyObj)['ba-user-token'] ? (headers as anyObj)['ba-user-token'] : '', + JSON.stringify(params), + JSON.stringify(data) + ].join('&') +} + +/** + * 根据请求方法组装请求数据/参数 + */ +export function requestPayload(method: Method, data: anyObj, paramsPOST: boolean) { + if (method == 'GET') { + return { + params: data + } + } else if (method == 'POST') { + if (paramsPOST) { + return { params: data } + } else { + return { data: data } + } + } +} +// 适配器, 用于适配不同的请求方式 +export function baseRequest(url, value = {}, method = 'post', options = {}) { + url = sysConfig.API_URL + url + if (method === 'post') { + return service.post(url, value, options) + } else if (method === 'get') { + return service.get(url, { params: value, ...options }) + } else if (method === 'formdata') { + // form-data表单提交的方式 + return service.post(url, qs.stringify(value), { + headers: { + 'Content-Type': 'multipart/form-data' + }, + ...options + }) + } else { + // 其他请求方式,例如:put、delete + return service({ + method: method, + url: url, + data: value, + ...options + }) + } +} +// 模块内的请求, 会自动加上模块的前缀 +export const moduleRequest = + moduleUrl => + (url, ...arg) => { + return baseRequest(moduleUrl + url, ...arg) + } + +interface LoadingInstance { + target: any + count: number +} + +interface Options { + // 是否开启取消重复请求, 默认为 true + CancelDuplicateRequest?: boolean + // 是否开启loading层效果, 默认为false + loading?: boolean + // 是否开启简洁的数据结构响应, 默认为true + reductDataFormat?: boolean + // 是否开启code不为A0000时的信息提示, 默认为true + showCodeMessage?: boolean + // 是否开启code为0时的信息提示, 默认为false + showSuccessMessage?: boolean + // 当前请求使用另外的用户token + anotherToken?: string +} diff --git a/src/views/pqs/business/terminal/FrontManagement/index.vue b/src/views/pqs/business/terminal/FrontManagement/index.vue index a7088b58..5870cdbf 100644 --- a/src/views/pqs/business/terminal/FrontManagement/index.vue +++ b/src/views/pqs/business/terminal/FrontManagement/index.vue @@ -218,6 +218,7 @@ import { ElMessage, ElMessageBox } from 'element-plus' import { ElButton } from 'element-plus' import { mainHeight } from '@/utils/layout' import Bind from './bind.vue' +const VITE_FLAG = import.meta.env.VITE_NAME == 'hainan' defineOptions({ name: 'BusinessAdministrator/TerminalManagement/FrontManagement' }) @@ -332,29 +333,32 @@ const tableStore = new TableStore({ formData.value = JSON.parse(JSON.stringify(row)) } }, - // { - // name: 'edit', - // title: '重启', - // type: 'warning', - // icon: 'el-icon-Delete', - // render: 'confirmButton', - // popconfirm: { - // confirmButtonText: '确认', - // cancelButtonText: '取消', - // confirmButtonType: 'warning', - // title: '确定重启吗?' - // }, - // click: row => { - // askRestartProcess({ - // deviceRebootType: null, - // nodeId: row.id, - // processNo: 1 - // }).then(res => { - // ElMessage.success('重启成功') - // tableStore.index() - // }) - // } - // }, + { + name: 'edit', + title: '重启', + type: 'warning', + icon: 'el-icon-Delete', + render: 'confirmButton', + disabled: row => { + return VITE_FLAG + }, + popconfirm: { + confirmButtonText: '确认', + cancelButtonText: '取消', + confirmButtonType: 'warning', + title: '确定重启吗?' + }, + click: row => { + askRestartProcess({ + deviceRebootType: null, + nodeId: row.id, + processNo: 1 + }).then(res => { + ElMessage.success('重启成功') + tableStore.index() + }) + } + }, { name: 'del', diff --git a/src/views/pqs/database/algorithm/components/addTree.vue b/src/views/pqs/database/algorithm/components/addTree.vue index 45c6156d..6fcfbf0d 100644 --- a/src/views/pqs/database/algorithm/components/addTree.vue +++ b/src/views/pqs/database/algorithm/components/addTree.vue @@ -1,96 +1,96 @@ - - + + diff --git a/src/views/pqs/database/algorithm/components/form.vue b/src/views/pqs/database/algorithm/components/form.vue index 7057d1b2..fc791a62 100644 --- a/src/views/pqs/database/algorithm/components/form.vue +++ b/src/views/pqs/database/algorithm/components/form.vue @@ -1,190 +1,190 @@ - - + + diff --git a/src/views/pqs/database/algorithm/index.vue b/src/views/pqs/database/algorithm/index.vue index 057da940..fd5ee1fd 100644 --- a/src/views/pqs/database/algorithm/index.vue +++ b/src/views/pqs/database/algorithm/index.vue @@ -1,346 +1,59 @@ + - diff --git a/src/views/pqs/database/algorithm/list.vue b/src/views/pqs/database/algorithm/list.vue new file mode 100644 index 00000000..daeebe22 --- /dev/null +++ b/src/views/pqs/database/algorithm/list.vue @@ -0,0 +1,359 @@ + + + diff --git a/src/views/pqs/database/algorithm/overview.vue b/src/views/pqs/database/algorithm/overview.vue new file mode 100644 index 00000000..3e60b064 --- /dev/null +++ b/src/views/pqs/database/algorithm/overview.vue @@ -0,0 +1,196 @@ + + + diff --git a/src/views/pqs/harmonicMonitoring/monitoringPoint/online/statisticalReport/index.vue b/src/views/pqs/harmonicMonitoring/monitoringPoint/online/statisticalReport/index.vue index f2d0504e..7d3cf0c8 100644 --- a/src/views/pqs/harmonicMonitoring/monitoringPoint/online/statisticalReport/index.vue +++ b/src/views/pqs/harmonicMonitoring/monitoringPoint/online/statisticalReport/index.vue @@ -105,6 +105,7 @@ const loading = ref(false) provide('tableStore', tableStore) onMounted(() => { + TableHeaderRef.value.setTheDate(4) const dom = document.getElementById('navigation-splitpanes') if (dom) { size.value = Math.round((180 / dom.offsetHeight) * 120) @@ -116,7 +117,7 @@ getTemplateByDept({ id: dictData.state.area[0].id }) Template.value = res.data[0] reportForm.value = res.data[0]?.reportForm showTree.value = true - tableStore.index() + TableHeaderRef.value.onComSearch() }) .catch((err: any) => { showTree.value = true diff --git a/src/views/pqs/qualityInspeection/panorama/components/details/point.vue b/src/views/pqs/qualityInspeection/panorama/components/details/point.vue index 502f169f..b59eda95 100644 --- a/src/views/pqs/qualityInspeection/panorama/components/details/point.vue +++ b/src/views/pqs/qualityInspeection/panorama/components/details/point.vue @@ -35,7 +35,7 @@
- + @@ -453,7 +471,7 @@ import { Link, View } from '@element-plus/icons-vue' import PreviewFile from '@/components/PreviewFile/index.vue' import { getByDeptDevLine } from '@/api/supervision-boot/interfere/index' import { addOrUpdateFile, getFileById } from '@/api/supervision-boot/interfere/index' -import {download}from '@/utils/fileDownload' +import { download } from '@/utils/fileDownload' defineOptions({ name: 'BpmUserReportDetail' }) const { query } = useRoute() // 查询参数 @@ -478,6 +496,7 @@ const openFile = (name: any) => { } const netInReportList: any = ref([]) const governReportList: any = ref([]) +const simulationReportList: any = ref([]) //用户性质数组 const userTypeList = reactive([ { @@ -730,7 +749,14 @@ const getProviteData = async () => { } }) } - + if (detailData.value.simulationReport.length > 0) { + simulationReportList.value = [] + detailData.value.simulationReport.forEach((item: any) => { + if (item != null) { + getFileNamePath(item, 'simulationReport') + } + }) + } // 调用关联终端接口 getByDeptDevLine({ id: detailData.value.orgId }).then(res => { devIdList.value = res.data.filter((item: any) => item.devId == detailData.value.devId) @@ -744,7 +770,7 @@ const getFileNamePath = async (val: any, pathName: any) => { if (pathName == 'feasibilityReport' && proviteData.value.feasibilityReport) { proviteData.value.feasibilityReport = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -752,7 +778,7 @@ const getFileNamePath = async (val: any, pathName: any) => { else if (pathName == 'preliminaryDesignDescription' && proviteData.value.preliminaryDesignDescription) { proviteData.value.preliminaryDesignDescription = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -760,7 +786,7 @@ const getFileNamePath = async (val: any, pathName: any) => { else if (pathName == 'predictionEvaluationReport' && proviteData.value.predictionEvaluationReport) { proviteData.value.predictionEvaluationReport = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -771,7 +797,7 @@ const getFileNamePath = async (val: any, pathName: any) => { ) { proviteData.value.predictionEvaluationReviewOpinions = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -779,7 +805,7 @@ const getFileNamePath = async (val: any, pathName: any) => { else if (pathName == 'substationMainWiringDiagram' && proviteData.value.substationMainWiringDiagram) { proviteData.value.substationMainWiringDiagram = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -787,7 +813,7 @@ const getFileNamePath = async (val: any, pathName: any) => { else if (pathName == 'sensitiveDevices' && proviteData.value.sensitiveDevices) { proviteData.value.sensitiveDevices = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -795,7 +821,7 @@ const getFileNamePath = async (val: any, pathName: any) => { else if (pathName == 'antiInterferenceReport' && proviteData.value.antiInterferenceReport) { proviteData.value.antiInterferenceReport = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -803,7 +829,7 @@ const getFileNamePath = async (val: any, pathName: any) => { else if (pathName == 'powerQualityReport' && proviteData.value.powerQualityReport) { proviteData.value.powerQualityReport = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -811,7 +837,7 @@ const getFileNamePath = async (val: any, pathName: any) => { else if (pathName == 'additionalAttachments' && proviteData.value.additionalAttachments) { proviteData.value.additionalAttachments = { name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url } } @@ -819,7 +845,7 @@ const getFileNamePath = async (val: any, pathName: any) => { if (pathName == 'netInReport') { netInReportList.value.push({ name: res.data.fileName, - keyName: res.data.name, + keyName: res.data.name, url: res.data.url }) } else if (pathName == 'governReport') { @@ -828,6 +854,12 @@ const getFileNamePath = async (val: any, pathName: any) => { keyName: res.data.name, url: res.data.url }) + } else if (pathName == 'simulationReport') { + simulationReportList.value.push({ + name: res.data.fileName, + keyName: res.data.name, + url: res.data.url + }) } } }) diff --git a/src/views/pqs/supervise/terminal/components/monitorLedgerTable.vue b/src/views/pqs/supervise/terminal/components/monitorLedgerTable.vue index 6f9136b5..31a2e8ec 100644 --- a/src/views/pqs/supervise/terminal/components/monitorLedgerTable.vue +++ b/src/views/pqs/supervise/terminal/components/monitorLedgerTable.vue @@ -15,11 +15,65 @@ + + + + + + + + + + + + + + +