From 4395408f68df62a09b5b2ff2cef28a2b9c81aa3b Mon Sep 17 00:00:00 2001 From: fks-xuxinyue <2822784518@qq.com> Date: Thu, 8 Aug 2024 15:13:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/carbonEmissionFactorLibrary.ts | 9 +- .../src/router/carbonEmissionManage.ts | 3 + .../carbonAssets/carbonAssetsDetail/index.vue | 7 +- .../carbonEmissionFactorLibrary/index.vue | 71 ++- .../energyConsumption/index.vue | 560 +++++++++++++++------ .../carbonInventoryCheck/config.ts | 9 +- .../carbonInventoryCheck/fillInPage/index.vue | 90 ++-- .../carbonInventoryCheck/index.vue | 13 +- .../carbonPlanning/category/categoryDeatil.vue | 43 +- 9 files changed, 569 insertions(+), 236 deletions(-) diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts index c9b0f97..349d256 100644 --- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts +++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts @@ -8,6 +8,8 @@ export enum carbonEmissionFactorLibrary { getCarbonFactorTree = '/carbon-smart/api/carbon/emission/type/getCarbonFactorTree', creat = '/carbon-smart/api/carbon/emission/type/creatOrUpdate', delTreeNode = '/carbon-smart/api/carbon/emission/type/del', + move = '/carbon-smart/api/carbon/emission/type/move', + excel = '/carbon-smart/api/carbon/emission/factor/excel', // 单位管理 dictionaryUnitManagement = '/carbon-smart/client/dict/dictionaryUnitManagement', findOutermost = '/carbon-smart/client/dict/findOutermost', @@ -15,7 +17,7 @@ export enum carbonEmissionFactorLibrary { updateDictionary = '/carbon-smart/client/dict/updateDictionary', delDictionary = '/carbon-smart/client/dict/delDictionary', } -// 碳排管理-碳排统计接口 +// 碳排管理-能耗统计接口 export enum energyConsumption { getDicList = '/carbon-smart/client/dict/list', pageList = '/carbon-smart/api/carbon/stats/pageList', @@ -23,6 +25,7 @@ export enum energyConsumption { creat = '/carbon-smart/api/carbon/stats/creat', update = '/carbon-smart/api/carbon/stats/update', del = '/carbon-smart/api/carbon/stats/del', + voucherDownloadList = '/carbon-smart/api/carbon/stats/voucherDownloadList', } // 碳排管理-碳排速算接口 export enum quickCalculation { @@ -55,6 +58,7 @@ export enum carbonInventoryCheck { findUnitById = '/carbon-smart/api/carbon/inventory/findById', getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList', updateTable = '/carbon-smart/api/carbon/inventory/details/update', + voucherDownloadList = '/carbon-smart/api/carbon/inventory/details/voucherDownloadList', // 排放统计接口 emissionStatistic = '/carbon-smart/api/carbon/inventory/emissionStatistic', // 碳排流向 @@ -75,6 +79,7 @@ export enum uploadPic { uploadfiles = '/carbon-smart/api/common/file/uploadfiles', select = '/carbon-smart/api/common/file/select', uploadfile = '/carbon-smart/api/common/file/uploadfile', + download = '/carbon-smart/api/common/file/download', } // 碳规划 export enum carbonPlanning { @@ -90,4 +95,6 @@ export enum carbonPlanning { detailedStatisticalDataChart = '/carbon-smart/api/carbon/planning/detailedStatisticalDataChart', batchOrUpdate = '/carbon-smart/api/carbon/planning/batchOrUpdate', addNodes = '/carbon-smart/api/carbon/planning/addNodes', + benchmarkSetting = '/carbon-smart/api/carbon/planning/benchmarkSetting', + benchmarkSubmit = '/carbon-smart/api/carbon/planning/benchmarkSubmit', } diff --git a/hx-ai-intelligent/src/router/carbonEmissionManage.ts b/hx-ai-intelligent/src/router/carbonEmissionManage.ts index 9adcfc0..b0034fa 100644 --- a/hx-ai-intelligent/src/router/carbonEmissionManage.ts +++ b/hx-ai-intelligent/src/router/carbonEmissionManage.ts @@ -40,6 +40,9 @@ const equipment = { meta: { title: '碳排因子库', keepAlive: false, + operates: [ + { title: '碳排因子库导入', code: 'carbonEmissionFactorLibraryImport' }, + ], // backApi: [], }, }, diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue index 1a63a0c..4a3fef0 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue @@ -290,7 +290,7 @@ getDictList(); visible.value = true; formState.value.id = record.id; - fetch(uploadPic.select, { bizId: record.id, bizTpye: 1 }).then((res) => { + fetch(uploadPic.select, { bizId: record.id, bizType: 1 }).then((res) => { fileList.value = res.data.map((item) => ({ uid: item.id.toString(), // 使用文件的id作为唯一标识 name: item.fileName, // 文件名 @@ -424,9 +424,6 @@ }); fileList.value = newFileList; }; - const uploadQuery = ref({ - bizTpye: 1, - }); const onSubmit = () => { formRef.value .validate() @@ -445,7 +442,7 @@ fileList.value.forEach((file) => { formData.value.append('files', file.originFileObj); }); - formData.value.append('bizTpye', 1); + formData.value.append('bizType', 1); formData.value.append('bizId', res.data.id); fetch(uploadPic.uploadfiles, formData.value) .then((res) => { diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue index ba32d72..a571d30 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue @@ -62,9 +62,17 @@ 编辑 新增子节点 - 上移 - 下移 - 删除 + 上移 + 下移 + 删除 @@ -228,6 +236,7 @@ TreeProps, } from 'ant-design-vue/es/tree'; import { log } from 'node:console'; + import { or } from '@vueuse/core'; defineOptions({ name: 'OrderListIndex' }); const orgId = ref(''); @@ -253,7 +262,7 @@ const disabled = ref(false); const treeNodeAdd = ref(false); const operationTree = ref('新增'); - const showOperation = ref(false); + // const showOperation = ref(false); const opMap: any = ref({ type: 'add', @@ -442,8 +451,15 @@ editTreeNode.value.type = 'update'; addTreeNode.value = data.emissionName; }; + const moveNode = (data, type: opType) => { + const flag = type === 'up'; + http.post(carbonEmissionFactorLibrary.move, { ...data, isUp: flag }).then(() => { + getOrgTree(); + NsMessage.success('操作成功'); + }); + }; // 删除树节点 - const deleteTreeNode = () => { + const deleteTreeNode = (data) => { Modal.confirm({ title: '警告', icon: createVNode(ExclamationCircleOutlined), @@ -452,10 +468,12 @@ okType: 'primary', cancelText: '取消', onOk() { - http.post(carbonEmissionFactorLibrary.delTreeNode, editTreeNode.value).then(() => { - getOrgTree(); - NsMessage.success('操作成功'); - }); + http + .post(carbonEmissionFactorLibrary.delTreeNode, { orgId: orgId.value, id: data.id }) + .then(() => { + getOrgTree(); + NsMessage.success('操作成功'); + }); }, onCancel() { console.log('Cancel'); @@ -511,7 +529,7 @@ const editTreeNode = ref({}); const onSelect = (selectedKeys: string[], info: any) => { if (info.selected) { - showOperation.value = true; + // showOperation.value = true; editTreeNode.value = { id: info.selectedNodes[0].id, level: info.selectedNodes[0].level, @@ -519,6 +537,8 @@ sortNumber: info.selectedNodes[0].sortNumber, parentEmissionId: info.selectedNodes[0].parentEmissionId, }; + } else { + editTreeNode.value = {}; } }; @@ -573,6 +593,15 @@ opMap.value.fuc && opMap.value.fuc({ ...formData.value }); }); }; + const doWnload = (url: any) => { + const a = document.createElement('a'); + document.body.appendChild(a); + a.href = encodeURI(url); + //设置下载的文件名 + // a.download = fileName.value; + //触发a标签的点击事件,进行下载 + a.click(); + }; const tableConfig = ref({ title: '数据库', api: carbonEmissionFactorLibrary.getTableList, @@ -609,13 +638,26 @@ { label: '导入', type: 'primary', - name: 'userImport', - handle: () => {}, + name: 'carbonEmissionFactorLibraryImport', + extra: { + api: carbonEmissionFactorLibrary.excel, // 导入接口名 + title: '设备信息', // 弹窗title + templateName: 'whiteListUser', // 所使用的文件名称 + indexName: '设备id', // 匹配类型字段 + message: [ + { label: '1、若必填项未填写,则不能进行导入操作' }, + { label: `2、当重复时,则更新数据。` }, + { label: '3、数据将从模版的第五行进行导入。' }, + { label: '4、文件导入勿超过5MB。' }, + ], + }, }, { label: '导出', type: 'primary', - name: 'userExports', + handle: () => { + doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx'); + }, }, { label: '批量删除', @@ -687,6 +729,7 @@ { title: '参考文献', dataIndex: 'bibliography', + ellipsis: true, }, { title: '引用数量', @@ -917,7 +960,7 @@ } else { canSelect.value = false; } - fetch(carbonEmissionFactorLibrary.findOutermost).then((res) => { + fetch(carbonEmissionFactorLibrary.findOutermost, { grp: 'MEASUREMENT_UNIT' }).then((res) => { groupData.value = res.data; }); addUnitTitle.value = '新增单位'; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue index 210669c..368a56e 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue @@ -27,7 +27,11 @@ --> - + - - + + + +
+ + + + +
\ No newline at end of file + diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts index f396774..3574b58 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/config.ts @@ -8,13 +8,14 @@ export const voucherColumns = [ }, { title: '日期', - dataIndex: 'age', - key: 'age', + dataIndex: 'updateTime', + key: 'updateTime', + ellipsis: true, }, { title: '文件名称', - dataIndex: 'address', - key: 'address 1', + dataIndex: 'fileName', + key: 'fileName', ellipsis: true, }, ]; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue index 151d401..457306a 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue @@ -275,6 +275,7 @@ @@ -320,8 +321,9 @@ @@ -353,6 +355,7 @@ energyConsumption, carbonEmissionFactorLibrary, carbonInventoryCheck, + uploadPic, } from '/@/api/carbonEmissionFactorLibrary'; import { group } from '/@/api/deviceManage'; import { debug, log } from 'node:console'; @@ -844,6 +847,9 @@ // 点击凭证弹出框 const openVoucher = ref(false); const downLoadVoucher = () => { + fetch(carbonInventoryCheck.voucherDownloadList, { bizType: 2 }).then((res) => { + voucherData.value = res.data + }); openVoucher.value = true; }; const selectedRowKeys = ref([]); @@ -851,29 +857,7 @@ selectedRowKeys.value = selectedKeys; }; - const voucherData = [ - { - key: '1', - name: 'John Brown', - age: 32, - address: 'New York No. 1 Lake Park, New York No. 1 Lake Park', - tags: ['nice', 'developer'], - }, - { - key: '2', - name: 'Jim Green', - age: 42, - address: 'London No. 2 Lake Park, London No. 2 Lake Park', - tags: ['loser'], - }, - { - key: '3', - name: 'Joe Black', - age: 32, - address: 'Sidney No. 1 Lake Park, Sidney No. 1 Lake Park', - tags: ['cool', 'teacher'], - }, - ]; + const voucherData = ref([]); const onCloseVoucher = () => { openVoucher.value = false; }; @@ -909,6 +893,14 @@ editFormState.value.collectionNode = record.carbonSource; editFormState.value.factorId = record.factorId; selectedRowKeysEdit.value = [record.factorId]; + fetch(uploadPic.select, { bizId: record.id, bizType: 2 }).then((res) => { + fileList.value = res.data.map((item) => ({ + uid: item.id.toString(), // 使用文件的id作为唯一标识 + name: item.fileName, // 文件名 + status: 'done', // 设置默认状态为已完成 + url: item.filePath, // 文件的URL,这里假设用示例的URL格式 + })); + }); editData.value = true; }; const getNewTable = () => { @@ -946,23 +938,35 @@ }, ); }; + const selectNode = (value) => { + debugger; + }; // 上传附件 + const fileList = ref([]); + const beforeUpload: UploadProps['beforeUpload'] = (file) => { + return false; + }; const handleChange = (info: UploadChangeParam) => { + fileList.value = [...info.fileList]; if (info.file.status !== 'uploading') { console.log(info.file, info.fileList); } if (info.file.status === 'done') { - message.success(`${info.file.name} file uploaded successfully`); + message.success(`${info.file.name} 文件上传成功`); } else if (info.file.status === 'error') { - message.error(`${info.file.name} file upload failed.`); + message.error(`${info.file.name} 文件上传失败`); } }; - - const fileList = ref([]); - const headers = { - authorization: 'authorization-text', + const handleFileRemove = (file) => { + const newFileList = []; + fileList.value.forEach((item) => { + if (item.uid !== file.uid) { + newFileList.push(item); + } + }); + fileList.value = newFileList; }; - // 编辑数据提交 + // 数据提交; const submitEditData = () => { editFormRef.value .validate() @@ -978,8 +982,26 @@ editFormState.value.collectionNode = editFormState.value.collectionNode.value; } fetch(carbonInventoryCheck.updateTable, editFormState.value).then((res) => { - editData.value = false; - getPFYTableList(getTableId.value); + if (fileList.value.length !== 0) { + const formData = ref(new FormData()); + fileList.value.forEach((file) => { + formData.value.append('files', file.originFileObj); + }); + formData.value.append('bizType', 2); + formData.value.append('bizId', editFormState.value.id); + fetch(uploadPic.uploadfiles, formData.value) + .then((res) => { + message.success('操作成功!'); + editData.value = false; + getPFYTableList(getTableId.value); + }) + .catch((error) => { + console.log('error', error); + }); + } else { + editData.value = false; + getPFYTableList(getTableId.value); + } }); }) .catch((error) => { diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue index ef39680..a8e3dd6 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue @@ -5,7 +5,12 @@
- +
年度 月度 @@ -81,7 +86,9 @@ return year === Number(formState.value.reportYear) ? false : true; } }; - const selectChange = (value) => {}; + const selectChange = (value) => { + formState.value.reportScope = ''; + }; // 定义form表单的必填 const rules: Record = { reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }], diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue index 234403e..05e7b7c 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue @@ -74,9 +74,7 @@
- - 批量设置 - + 批量设置 基准值设置 @@ -137,20 +135,13 @@ :columns="drawerColumns" :data-source="newTableData" bordered - rowKey="id" + :rowKey="(record, index) => index" :rowSelection="{ selectedRowKeys: selectedRowKeysSet, onChange: onSelectionChangeSet, type: 'radio', }" :pagination="false"> - diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue index f49bd40..a39353a 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue @@ -102,7 +102,7 @@ - + @@ -281,7 +281,7 @@ type: 'primary', handle: () => { visible.value = true; - getNewTable(); + // getNewTable(); }, }, ], @@ -384,7 +384,7 @@ // 点击新增按钮 const addNewData = () => { visible.value = true; - getNewTable(); + // getNewTable(); }; // 获取新增页面的列表 const selectedRowKeys = ref([]); @@ -404,6 +404,11 @@ newTableData.value = res.data.records; }); }; + const selectData = ref(); + const keyChange = () => { + queryData.value.emissionSources = selectData.value; + getNewTable(); + }; // 点击编辑按钮 const editData = (record) => { selectedRowKeys.value = [record.factorId]; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue index 457306a..c85cfb3 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue @@ -291,6 +291,7 @@ @@ -848,7 +849,7 @@ const openVoucher = ref(false); const downLoadVoucher = () => { fetch(carbonInventoryCheck.voucherDownloadList, { bizType: 2 }).then((res) => { - voucherData.value = res.data + voucherData.value = res.data; }); openVoucher.value = true; }; @@ -898,6 +899,7 @@ uid: item.id.toString(), // 使用文件的id作为唯一标识 name: item.fileName, // 文件名 status: 'done', // 设置默认状态为已完成 + type: 'done', url: item.filePath, // 文件的URL,这里假设用示例的URL格式 })); }); @@ -909,6 +911,10 @@ total.value = res.data.total; }); }; + const searchKey = () => { + queryData.value.emissionSources = editFormState.value.emissionFactors; + getNewTable(); + }; // 数据来源选择框改变 const canEdit = ref(false); const automatic = ref(false); @@ -957,7 +963,9 @@ message.error(`${info.file.name} 文件上传失败`); } }; + const delIds = ref([]); const handleFileRemove = (file) => { + delIds.value.push(file.uid); const newFileList = []; fileList.value.forEach((item) => { if (item.uid !== file.uid) { @@ -985,14 +993,20 @@ if (fileList.value.length !== 0) { const formData = ref(new FormData()); fileList.value.forEach((file) => { - formData.value.append('files', file.originFileObj); + if (file.type !== 'done') { + formData.value.append('files', file.originFileObj); + } }); formData.value.append('bizType', 2); formData.value.append('bizId', editFormState.value.id); + delIds.value.forEach((item) => { + formData.value.append('deleteList', item); + }); fetch(uploadPic.uploadfiles, formData.value) .then((res) => { message.success('操作成功!'); editData.value = false; + delIds.value = []; getPFYTableList(getTableId.value); }) .catch((error) => { @@ -1000,6 +1014,7 @@ }); } else { editData.value = false; + delIds.value = []; getPFYTableList(getTableId.value); } }); @@ -1010,6 +1025,7 @@ }; const onCloseEditData = () => { editData.value = false; + delIds.value = []; editFormState.value = { orgId: orgId.value, }; diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue index efa4496..6d2d2d1 100644 --- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue +++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue @@ -48,7 +48,12 @@
- +
@@ -159,7 +164,7 @@ }; const getMonthPillarData = () => { fetch(carbonPlanning.electricityUsageBackThen, getPillarQuery.value).then((res) => { - xAxisData.value = res.data.year; + xAxisData.value = res.data.yearMonth; referenceValue.value = res.data.referenceValue; budget.value = res.data.budget; actualUsage.value = res.data.actualUsage; @@ -286,6 +291,7 @@ type: props.tabId, year: selectYearValue.value.format('YYYY'), yearAndMonth: 'year', + yearMonth: selectMonthValue.value.format('YYYY-DD'), }); const ballValue = ref(); const getBallData = () => { @@ -447,7 +453,7 @@ fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then((res) => { data.value = res.data; res.data.forEach((item) => { - treeCheckedKeys.value.push((item.itemizeId).toString()); + treeCheckedKeys.value.push(item.itemizeId.toString()); }); }); }; @@ -460,7 +466,9 @@ }); const changeMonth = () => { monthQueryParams.value.yearMonth = selectMonthValue.value; + getBallQuery.value.yearMonth = selectMonthValue.value; getMonthData(); + getBallData(); }; const getMonthData = () => { fetch(carbonPlanning.searchListByMonth, monthQueryParams.value).then((res) => { diff --git a/lib/util/xlsx-util.ts b/lib/util/xlsx-util.ts index 83a459b..1c2086b 100644 --- a/lib/util/xlsx-util.ts +++ b/lib/util/xlsx-util.ts @@ -1,10 +1,9 @@ - - import { utils, write } from 'xlsx'; import { dateUtil } from '/nerv-lib/util/date-util'; import { NsMessage } from '/nerv-lib/component/message'; import axios from 'axios'; import { createVNode, h, render as vueRender } from 'vue'; +import { Cookies } from '/nerv-lib/util/cookie'; import { NsXlsxImport } from '/nerv-lib/component/xlsx'; import { NsModal } from '/nerv-lib/component/modal'; @@ -126,7 +125,9 @@ export const importFile = ( }); formData.append('file', event); axios - .post(api, formData) + .post(api, formData, { + headers: { token: Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) }, + }) .then((res) => { if (res) { NsMessage.success('导入成功', 1, () => {