From be73e1692ebe367d45a0d6459402a5a3ac7edf81 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期五, 08 九月 2023 16:48:20 +0800 Subject: [PATCH] 出图接口对接调试 --- src/views/export/exportList.vue | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 210 insertions(+), 2 deletions(-) diff --git a/src/views/export/exportList.vue b/src/views/export/exportList.vue index 7f12222..2010a69 100644 --- a/src/views/export/exportList.vue +++ b/src/views/export/exportList.vue @@ -12,6 +12,71 @@ <Close /> </el-icon> </div> + <div class="exportContent spatialTable"> + <div style="height:calc(100% - 130px) ; width: calc(100% - 25px); background: red; position: absolute;"> + <el-table + ref="singleTable" + :data="exportable" + height="100%" + @selection-change="handleSelectionChange" + > + <el-table-column + type="index" + width="100" + label="搴忓彿" + > + </el-table-column> + <el-table-column + property="descr" + label="鏍囬" + > </el-table-column> + <el-table-column + property="name" + label="鏂囦欢鍚嶇О" + > </el-table-column> + <el-table-column + property="createName" + label="鍑哄浘浜�" + > + </el-table-column> + <el-table-column + property="createTime" + :formatter="formatTime" + label="鏃ユ湡" + > + </el-table-column> + + <el-table-column + label="鎿嶄綔" + width="120" + > + <template #default="scope"> + <el-button + link + type="primary" + size="small" + @click.stop="downloadMap(scope.$index, scope.row)" + >涓嬭浇</el-button> + + </template> + </el-table-column> + </el-table> + + <div class="pagination_box"> + <el-pagination + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="listdata.pageIndex" + :page-sizes="[10, 20, 50, 100]" + :page-size="listdata.pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="listdata.count" + > + </el-pagination> + </div> + </div> + + </div> </div> </template> @@ -26,19 +91,73 @@ } from "vue"; import { User, Lock } from "@element-plus/icons-vue"; import { useStore } from "vuex"; // 寮曞叆useStore 鏂规硶 - +import { exportSelectByPage } from "@/api/api"; +import moment from "moment"; +import { getToken } from "@/utils/auth"; const store = useStore(); // 璇ユ柟娉曠敤浜庤繑鍥瀞tore 瀹炰緥 const emits = defineEmits(["SETspatialClose"]); +const listdata = ref({ + pageIndex: 1, + pageSize: 10, + count: 0, +}); +const exportable = ref([]); +const handleSizeChange = (val) => { + listdata.value.pageIndex = 1; + listdata.value.pageSize = val; + getTableData(); +}; +const downloadMap = (index, rows) => { + var guid = rows.guid; + var token = "?token=" + getToken(); + var a = document.createElement("a"); // 鍒涘缓涓�涓猘鏍囩鍏冪礌 + a.style.display = "none"; // 璁剧疆鍏冪礌涓嶅彲瑙� + a.href = config.BASE_URL + "/export/downloadFile" + token + "&guid=" + guid; + document.body.appendChild(a); // 鍔犲叆 + a.click(); // 瑙﹀彂鐐瑰嚮,涓嬭浇 + document.body.removeChild(a); // 閲婃斁 +}; +const handleCurrentChange = (val) => { + listdata.value.pageIndex = val; + getTableData(); +}; +const setListDataStart = () => { + listdata.value = { + pageIndex: 1, + pageSize: 10, + count: 0, + }; + getTableData(); +}; +const formatTime = (row, column) => { + let date = row[column.property]; + if (date === undefined || date === null) { + return ""; + } + return moment(parseInt(date)).format("YYYY-MM-DD HH:mm:ss"); +}; +const handleSelectionChange = () => {}; +const getTableData = async () => { + const data = await exportSelectByPage(listdata.value); + + exportable.value = data.result; + + listdata.value.count = data.count; +}; + const setSpatialClose = () => { store.state.setExportList = false; }; +onMounted((res) => { + setListDataStart(); +}); </script> <style lang="less" scoped> .exportBox { width: 800px; height: 400px; - display: flex; + position: absolute; bottom: 10px; right: 50px; @@ -58,5 +177,94 @@ font-size: 16px; } } + .exportContent { + width: 100%; + height: calc(100% - 60px); + padding: 5px; + position: absolute; + .pagination_box { + width: 100%; + display: flex; + justify-content: center; + margin-top: 10px; + } + } + .spatialTable { + margin-top: 10px; + width: 100%; + height: calc(100% - 35px); + position: relative; + + .el-table /deep/ .el-table__header-wrapper tr th { + background-color: rgba(38, 47, 71, 1) !important; + color: #d6e4ff; + } + // 淇敼姣忚鏍峰紡锛� + .el-table /deep/ .el-table__row { + background-color: rgba(38, 47, 71, 1) !important; + color: #d6e4ff; + } + .el-table /deep/ .el-table__body tr.current-row > td { + background-color: rgba(38, 47, 71, 1) !important; + } + .el-table /deep/ .el-table__body tr:hover > td { + background-color: rgba(38, 47, 71, 1) !important; + } + // 淇敼琛ㄦ牸姣忚杈规鐨勬牱寮忥細 + .el-table /deep/ td, + .el-table /deep/ th.is-leaf { + // border-bottom: 1px solid #409eff; + // border-right: 1px solid #409eff; + } + .el-table /deep/ .el-table__cell { + padding: 8px 0; + } + // 璁剧疆琛ㄦ牸姣忚鐨勯珮搴︼細 + .el-table /deep/ .el-table__header tr, + .el-table /deep/ .el-table__header th { + height: 50px; + } + .el-table__body tr, + .el-table__body td { + height: 50px; + padding: 0; + } + // 璁剧疆琛ㄦ牸杈规棰滆壊锛� + + .el-table--border::after, + .el-table--group::after { + width: 0; + } + .el-table::before { + height: 0; + } + } + /deep/.el-pagination button { + background: transparent; + color: #d6e4ff; + } + /deep/.el-pager li { + background: transparent; + color: #d6e4ff; + } + /deep/.el-pager li.is-active { + color: #409eff; + } + /deep/.el-pagination__total { + color: #d6e4ff; + } + /deep/.el-pagination__goto { + color: #d6e4ff; + } + /deep/.el-pagination__classifier { + color: #d6e4ff; + } + /deep/.el-input.is-disabled .el-input__wrapper { + background: transparent !important; + color: #d6e4ff; + } + /deep/.el-input.is-disabled .el-input__inner { + color: #d6e4ff !important; + } } </style> \ No newline at end of file -- Gitblit v1.9.3