重写导入,添加历史数据功能
This commit is contained in:
parent
5de4da51ff
commit
58757f7943
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :xl="5" :lg="7" :md="8" :sm="24">
|
||||
<a-auto-complete v-model="queryParam.recipient" :dataSource="UserdataSource" style="width: 200px"
|
||||
<a-auto-complete v-model="queryParam.recipient" :dataSource="UserdataSource"
|
||||
placeholder="请选择领用人" @select="onSelect" @search="onSearch" @change="onChange" />
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
@ -33,9 +33,24 @@
|
|||
@change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
|
||||
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
|
||||
<div class="modal-content">
|
||||
<!-- 在这里显示历史数据 -->
|
||||
<div v-for="TimestampData in historyData" :key="TimestampData.id" class="container">
|
||||
<div class="left">
|
||||
<p style="font-size: 17px;">{{ TimestampData }}</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a-button type="primary" icon="download"
|
||||
@click="ExportData('家具信息表', TimestampData)">导出</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 高级查询区域 -->
|
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
|
||||
@handleSuperQuery="handleSuperQuery"></j-super-query>
|
||||
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"
|
||||
@handleSuperQuery="handleSuperQuery"></j-super-query> -->
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
|
||||
|
@ -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 {
|
|||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
.modal-content {
|
||||
max-height: 400px; /* 设置最大高度,根据需要进行调整 */
|
||||
overflow-y: auto; /* 添加垂直滚动条 */
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
|
@ -10,7 +10,7 @@
|
|||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :xl="5" :lg="7" :md="8" :sm="24">
|
||||
<a-auto-complete v-model="queryParam.recipient" :dataSource="UserdataSource" style="width: 200px"
|
||||
<a-auto-complete v-model="queryParam.recipient" :dataSource="UserdataSource"
|
||||
placeholder="请选择领用人" @select="onSelect" @search="onSearch" @change="onChange" />
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
@ -25,11 +25,30 @@
|
|||
<!-- 操作按钮区域 -->
|
||||
<div class="table-operator">
|
||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
|
||||
<!-- <a-button @click="AddDataInstrument()" type="primary" icon="plus">导数据</a-button> -->
|
||||
<a-button type="primary" icon="download" @click="handleExportXls('仪器信息表')">导出</a-button>
|
||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
|
||||
@change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
|
||||
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
|
||||
<div class="modal-content">
|
||||
<!-- 在这里显示历史数据 -->
|
||||
<div v-for="TimestampData in historyData" :key="TimestampData.id" class="container">
|
||||
<div class="left">
|
||||
<p style="font-size: 17px;">{{ TimestampData }}</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a-button type="primary" icon="download"
|
||||
@click="ExportData('仪器信息表', TimestampData)">导出</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 高级查询区域 -->
|
||||
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"
|
||||
@handleSuperQuery="handleSuperQuery"></j-super-query> -->
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
|
||||
|
@ -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 {
|
|||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
.modal-content {
|
||||
max-height: 400px; /* 设置最大高度,根据需要进行调整 */
|
||||
overflow-y: auto; /* 添加垂直滚动条 */
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
|
@ -10,7 +10,7 @@
|
|||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
<a-col :xl="5" :lg="7" :md="8" :sm="24">
|
||||
<a-auto-complete v-model="queryParam.recipient" :dataSource="UserdataSource" style="width: 200px"
|
||||
<a-auto-complete v-model="queryParam.recipient" :dataSource="UserdataSource"
|
||||
placeholder="请选择领用人" @select="onSelect" @search="onSearch" @change="onChange" />
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
@ -34,9 +34,23 @@
|
|||
@change="handleImportExcel">
|
||||
<a-button type="primary" icon="import">导入</a-button>
|
||||
</a-upload>
|
||||
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
|
||||
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
|
||||
<div class="modal-content">
|
||||
<!-- 在这里显示历史数据 -->
|
||||
<div v-for="TimestampData in historyData" :key="TimestampData.id" class="container">
|
||||
<div class="left">
|
||||
<p style="font-size: 17px;">{{ TimestampData }}</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
<a-button type="primary" icon="download" @click="ExportData('无形资产信息表', TimestampData)">导出</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 高级查询区域 -->
|
||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
|
||||
@handleSuperQuery="handleSuperQuery"></j-super-query>
|
||||
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"
|
||||
@handleSuperQuery="handleSuperQuery"></j-super-query> -->
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
|
||||
|
@ -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 {
|
|||
</script>
|
||||
<style scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
</style>
|
||||
|
||||
.modal-content {
|
||||
max-height: 400px;
|
||||
/* 设置最大高度,根据需要进行调整 */
|
||||
overflow-y: auto;
|
||||
/* 添加垂直滚动条 */
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 10px;
|
||||
}</style>
|
|
@ -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(',')
|
||||
|
|
Loading…
Reference in New Issue