From 58757f7943b74576d36b539e02426c4d5662010a Mon Sep 17 00:00:00 2001 From: xbx <1827135378@qq.com> Date: Wed, 29 Nov 2023 18:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E5=86=99=E5=AF=BC=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 4 +- src/mixins/JeecgListMixin.js | 32 +++++++ src/router/index.js | 2 +- .../rms/FurnitureList/RmsFurnitureList.vue | 51 ++++++++++- .../rms/InstrumentList/RmsInstrumentList.vue | 87 ++++++++++++++++++- .../rms/IntangibleList/RmsIntangibleList.vue | 54 +++++++++++- .../rms/LocationList/RmsLocationList.vue | 27 +++++- 8 files changed, 245 insertions(+), 14 deletions(-) diff --git a/.env.development b/.env.development index 4f94849..23d1373 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ NODE_ENV=development -VUE_APP_API_BASE_URL=http://localhost:8888/jeecg-boot +VUE_APP_API_BASE_URL=http://82.157.76.162:8888/jeecg-boot VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview diff --git a/.env.production b/.env.production index 5e82bea..eb82cdf 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,4 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=http://localhost:8888/jeecg-boot -VUE_APP_CAS_BASE_URL=http://localhost:8888/cas +VUE_APP_API_BASE_URL=http://82.157.76.162:8888/jeecg-boot +VUE_APP_CAS_BASE_URL=http://82.157.76.162:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index 2a09ddf..884271c 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -297,6 +297,38 @@ export const JeecgListMixin = { } }) }, + // 重写导出方法 + ExportData(fileName, TimestampData) { + console.log("传入的时间戳"+TimestampData) + if (!fileName || typeof fileName != "string") { + fileName = "导出文件" + } + let param = this.getQueryParams(); + if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { + param['selections'] = this.selectedRowKeys.join(",") + } + param['timestamp'] = TimestampData + console.log("导出参数", param) + downFile(this.url.exportXlsUrl, param).then((data) => { + if (!data) { + this.$message.warning("文件下载失败") + return + } + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls') + } else { + let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' })) + let link = document.createElement('a') + link.style.display = 'none' + link.href = url + link.setAttribute('download', fileName + '.xls') + document.body.appendChild(link) + link.click() + document.body.removeChild(link); //下载完成移除元素 + window.URL.revokeObjectURL(url); //释放掉blob对象 + } + }) + }, /* 导入 */ handleImportExcel(info){ this.loading = true; diff --git a/src/router/index.js b/src/router/index.js index bdbe374..8c52b3c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,7 +5,7 @@ import { constantRouterMap } from '@/config/router.config' Vue.use(Router) export default new Router({ - mode: 'history', + mode: 'hash', base: process.env.BASE_URL, scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap diff --git a/src/views/rms/FurnitureList/RmsFurnitureList.vue b/src/views/rms/FurnitureList/RmsFurnitureList.vue index 4b89eee..0ba8b9a 100644 --- a/src/views/rms/FurnitureList/RmsFurnitureList.vue +++ b/src/views/rms/FurnitureList/RmsFurnitureList.vue @@ -11,7 +11,7 @@ - @@ -33,9 +33,24 @@ @change="handleImportExcel"> 导入 + 历史数据 + + + - + 删除 @@ -239,9 +254,12 @@ export default { exportXlsUrl: "/rms/rmsFurniture/exportXls", importExcelUrl: "rms/rmsFurniture/importExcel", userUrl: "/sys/user/queryUserComponentData?column=createTime&order=desc&field=id,,username,realname,sex,phone,orgCodeTxt&pageNo=1&pageSize=100", + timestampUrl: "/rms/rmsFurniture/getTimestamp", }, UserList: {}, + historyModalVisible: false, // 控制历史数据模态框的显示与隐藏 + historyData: [] // 历史数据数组,用于存储所有历史数据 } }, created() { @@ -253,6 +271,17 @@ export default { }, }, methods: { + showHistoryModal() { + getAction(this.url.timestampUrl).then(res => { + console.log(res) + this.historyData = res; + }) + + this.historyModalVisible = true; // 显示历史数据模态框 + }, + closeHistoryModal() { + this.historyModalVisible = false; // 关闭历史数据模态框 + }, //获取用户信息 getUserInfo() { getAction(this.url.userUrl).then(res => { @@ -279,4 +308,20 @@ export default { \ No newline at end of file diff --git a/src/views/rms/InstrumentList/RmsInstrumentList.vue b/src/views/rms/InstrumentList/RmsInstrumentList.vue index 7420186..a73b074 100644 --- a/src/views/rms/InstrumentList/RmsInstrumentList.vue +++ b/src/views/rms/InstrumentList/RmsInstrumentList.vue @@ -10,7 +10,7 @@ - @@ -25,11 +25,30 @@
新增 + 导出 导入 + 历史数据 + + + + + 删除 @@ -211,8 +230,11 @@ export default { exportXlsUrl: "/rms/rmsInstrument/exportXls", importExcelUrl: "rms/rmsInstrument/importExcel", userUrl: "/sys/user/queryUserComponentData?column=createTime&order=desc&field=id,,username,realname,sex,phone,orgCodeTxt&pageNo=1&pageSize=100", + timestampUrl: "/rms/rmsInstrument/getTimestamp", }, UserList: {}, + historyModalVisible: false, // 控制历史数据模态框的显示与隐藏 + historyData: [] // 历史数据数组,用于存储所有历史数据 } }, created() { @@ -224,6 +246,53 @@ export default { }, }, methods: { + // ExportInstrumentData(fileName, TimestampData) { + // console.log(TimestampData) + // if (!fileName || typeof fileName != "string") { + // fileName = "导出文件" + // } + // let param = this.getQueryParams(); + // if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { + // param['selections'] = this.selectedRowKeys.join(",") + // } + // param['timestamp'] = TimestampData.timestamp + // console.log("导出参数", param) + // downFile(this.url.exportXlsUrl, param).then((data) => { + // if (!data) { + // this.$message.warning("文件下载失败") + // return + // } + // if (typeof window.navigator.msSaveBlob !== 'undefined') { + // window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls') + // } else { + // let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' })) + // let link = document.createElement('a') + // link.style.display = 'none' + // link.href = url + // link.setAttribute('download', fileName + '.xls') + // document.body.appendChild(link) + // link.click() + // document.body.removeChild(link); //下载完成移除元素 + // window.URL.revokeObjectURL(url); //释放掉blob对象 + // } + // }) + // }, + showHistoryModal() { + getAction(this.url.timestampUrl).then(res => { + console.log(res) + this.historyData = res; + }) + + this.historyModalVisible = true; // 显示历史数据模态框 + }, + closeHistoryModal() { + this.historyModalVisible = false; // 关闭历史数据模态框 + }, + // AddDataInstrument() { + // getAction("/rms/rmsIntangible/addDataInstrument").then(res => { + // console.log(res) + // }) + // }, //获取用户信息 getUserInfo() { getAction(this.url.userUrl).then(res => { @@ -250,4 +319,20 @@ export default { \ No newline at end of file diff --git a/src/views/rms/IntangibleList/RmsIntangibleList.vue b/src/views/rms/IntangibleList/RmsIntangibleList.vue index 7c16370..ddda297 100644 --- a/src/views/rms/IntangibleList/RmsIntangibleList.vue +++ b/src/views/rms/IntangibleList/RmsIntangibleList.vue @@ -10,7 +10,7 @@ - @@ -34,9 +34,23 @@ @change="handleImportExcel"> 导入 + 历史数据 + + + - + 删除 @@ -267,9 +281,12 @@ export default { exportXlsUrl: "/rms/rmsIntangible/exportXls", importExcelUrl: "rms/rmsIntangible/importExcel", userUrl: "/sys/user/queryUserComponentData?column=createTime&order=desc&field=id,,username,realname,sex,phone,orgCodeTxt&pageNo=1&pageSize=100", + timestampUrl: "/rms/rmsIntangible/getTimestamp", }, UserList: {}, + historyModalVisible: false, // 控制历史数据模态框的显示与隐藏 + historyData: [] // 历史数据数组,用于存储所有历史数据 } }, created() { @@ -286,6 +303,16 @@ export default { // console.log(res) // }); // }, + showHistoryModal() { + getAction(this.url.timestampUrl).then(res => { + console.log(res) + this.historyData = res; + }) + this.historyModalVisible = true; // 显示历史数据模态框 + }, + closeHistoryModal() { + this.historyModalVisible = false; // 关闭历史数据模态框 + }, //获取用户信息 getUserInfo() { getAction(this.url.userUrl).then(res => { @@ -316,4 +343,23 @@ export default { \ No newline at end of file + +.modal-content { + max-height: 400px; + /* 设置最大高度,根据需要进行调整 */ + overflow-y: auto; + /* 添加垂直滚动条 */ +} + +.container { + display: flex; + align-items: center; +} + +.left { + flex: 1; +} + +.right { + margin-left: 10px; +} \ No newline at end of file diff --git a/src/views/rms/LocationList/RmsLocationList.vue b/src/views/rms/LocationList/RmsLocationList.vue index d366167..e64152b 100644 --- a/src/views/rms/LocationList/RmsLocationList.vue +++ b/src/views/rms/LocationList/RmsLocationList.vue @@ -4,7 +4,7 @@
- + @@ -70,7 +70,8 @@ export default { { title: '排序号', align: "center", - dataIndex: 'sortNumber' + dataIndex: 'sortNumber', + sorter: true }, { title: '操作', @@ -81,6 +82,10 @@ export default { scopedSlots: { customRender: 'action' } } ], + isorter: { + column: 'sortNumber', + order: 'asc' + }, url: { list: "/rms/rmsLocation/list", delete: "/rms/rmsLocation/delete", @@ -99,6 +104,24 @@ export default { }, }, methods: { + // 重写底层JeecgListMixin.js的方法 + // 如果有自定义默认排序必须重写此方法,才能解决重置排序的问题 + handleTableChange(pagination, filters, sorter) { + //分页、排序、筛选变化时触发 + console.log(pagination) + if (Object.keys(sorter).length > 0) { + this.isorter.column = sorter.field; + this.isorter.order = "ascend" == sorter.order ? "asc" : "desc" + // update-begin--Author:ciei  Date:20230504 for:重置排序 + if (sorter.order === undefined) { + this.isorter.column = 'sortNumber'; + this.isorter.order = 'asc'; + } + // update-end--Author:ciei  Date:20230504 for:重置排序 + } + this.ipagination = pagination; + this.loadData(); + }, onSelect(selectedRowKeys) { //将其切分为字符串 selectedRowKeys = selectedRowKeys.join(',')