From 40860ef4a79da4d4f8ffce369011c1a2450fa3c1 Mon Sep 17 00:00:00 2001 From: surprise <15810472099@163.com> Date: 星期三, 29 十一月 2023 16:51:26 +0800 Subject: [PATCH] 表格添加字段排序功能 --- src/views/datamanage/uploadmanage.vue | 105 +++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 87 insertions(+), 18 deletions(-) diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue index 4c22327..405b7fc 100644 --- a/src/views/datamanage/uploadmanage.vue +++ b/src/views/datamanage/uploadmanage.vue @@ -173,7 +173,7 @@ <el-table-column :label="$t('dataManage.dictionaryManageObj.number')" type="index" - width="50" + width="70" align="center" key="2" > @@ -182,12 +182,14 @@ prop="name" :label="$t('dataManage.vmobj.name')" align="center" + sortable key="3" /> <el-table-column prop="type" :label="$t('dataManage.vmobj.format')" align="center" + sortable key="4" /> <el-table-column @@ -195,6 +197,7 @@ prop="sizes" :label="$t('dataManage.vmobj.size')" :formatter="stateFormatSizes" + sortable align="center" key="5" /> @@ -204,18 +207,21 @@ :label="$t('dataManage.vmobj.dirName')" width="200" align="center" + sortable key="7" /> <el-table-column prop="verName" :label="$t('dataManage.vmobj.versionNumber')" align="center" + sortable key="8" /> <el-table-column prop="url" :label="$t('common.publishAddress')" align="center" + sortable key="9" /> <el-table-column @@ -223,6 +229,7 @@ prop="uname" :label="$t('common.rublisher')" align="center" + sortable key="10" /> <el-table-column @@ -230,18 +237,21 @@ prop="createName" :label="$t('common.rublisher')" align="center" + sortable key="11" /> <el-table-column prop="createTime" :label="$t('common.releaseTime')" align="center" + sortable key="12" /> <el-table-column v-if="active == 'first'" prop="createTime" :label="$t('common.publishStatus')" + sortable align="center" key="13" > @@ -259,6 +269,7 @@ <el-button v-if="active == 'second'" size="small" + type="info" plain @click="setPreviewDetails(scope.row)" @@ -697,7 +708,7 @@ <div v-loading="true" element-loading-background="rgba(0, 0, 0, 0.0) " - element-loading-text="鏁版嵁鍙戝竷涓�" + :element-loading-text="loadingText" style="margin: 0px 20px;widht:100%;height:calc(100% - 80px); " > </div> @@ -720,7 +731,8 @@ publish_deletesSjServices, publish_update, publish_insertSjService, - publish_selectSjColorTables + publish_selectSjColorTables, + publish_selectSjMissionStatus } from '../../api/api.js' import { conditions } from '../Archive/Archive'; import { method_option, nodata_Option, server_option, system_Option, type_option } from './js/layerManage'; @@ -804,8 +816,9 @@ }, { value: 1, - label: "鐩存柟鍥惧潎琛�", - }] + label: "娓愬彉棰滆壊琛�", + }], + loadingText: '鏁版嵁鍙戝竷涓�', } }, methods: { @@ -913,25 +926,32 @@ var color2 = null; var level = null; var val_data = []; - - for (var i in this.renderTypeOptions) { - if (this.renderTypeOptions[i].name == this.renderType.value) { - val_data.push(this.renderTypeOptions[i].content.levels); + var dataId = 0; + if (this.renderTypeOptions.length > 0) { + for (var i in this.renderTypeOptions) { + if (this.renderTypeOptions[i].name == this.renderType) { + val_data.push(this.renderTypeOptions[i]); + } } } + if (val_data.length > 0) { level = val_data[0]; } - if (this.colorTableType == 0) { - color1 = level; + color1 = level.content.levels; + dataId = level.data_id; } else if (this.colorTableType == 1) { - color2 = level; + color2 = level.content.levels; + dataId = level.data_id; } + + var obj = { colorTable: color1, // 鏅�氶鑹茶〃锛屽彲涓嶈 gradientColorTable: color2, dircode: this.formInline.dirid, + colorTableId: dataId, name: name, ids: std, enhanceType: this.insertLayer.enhanceType, @@ -943,20 +963,69 @@ this.loadDialogVisible = true this.insertDialogVisible = false; - + this.loadDialogVisible = false const data = await publish_insertSjService(obj); + if (data.code == 200 && data.result && data.result > 0) { + this.loadDialogVisible = true + this.getLoadingMsg(data.result); + } else { + this.$message.error("鏁版嵁鍙戝竷澶辫触") + this.getTableData(); + } - if (data.code == 200 && data.result > 0) { + + + // if (data.code == 200 && data.result > 0) { + // this.$message({ + // message: '鏁版嵁鍙戝竷鎴愬姛', + // type: 'success' + // }); + // } else { + // this.$message.error("鏁版嵁鍙戝竷澶辫触") + // } + + // + }, + async getLoadingMsg(res) { + if (!this.loadDialogVisible) return; + const data = await publish_selectSjMissionStatus({ id: res }) + + + if (data.result.status == 3) { this.$message({ message: '鏁版嵁鍙戝竷鎴愬姛', type: 'success' }); - } else { + this.loadDialogVisible = false; + this.getTableData(); + } else if (data.result.status == 5 || data.result.status == 4) { this.$message.error("鏁版嵁鍙戝竷澶辫触") + this.loadDialogVisible = false; + this.getTableData(); + } else { + if (data.result.process == 100) { + this.$message({ + message: '鏁版嵁鍙戝竷鎴愬姛', + type: 'success' + }); + this.loadDialogVisible = false; + this.getTableData(); + } else { + // this.loadingText = '鏁版嵁鍙戝竷涓紝宸插彂甯� ' + data.result.process + '%'; + this.loadingText = '鏁版嵁鍙戝竷涓�...'; + var that = this; + setTimeout(() => { + that.getLoadingMsg(res); + }, 3000); + } + } - this.loadDialogVisible = false - this.getTableData(); + + }, + + + setEnhanceTypeChange(res) { var val = this.enhanceOption.filter((res) => { if (res.value == this.insertLayer.enhanceType) { @@ -1512,7 +1581,7 @@ .loadBox { position: fixed; z-index: 2002; - background: rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.75); width: 100%; height: 100%; top: 0; -- Gitblit v1.9.3