|
@@ -1,18 +1,47 @@
|
|
|
<template>
|
|
|
<div class="data-table" :style="{ marginTop: marginTop }">
|
|
|
- <div :style="dataTableContentStyle" v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="data-table-content">
|
|
|
+ <div
|
|
|
+ :style="dataTableContentStyle"
|
|
|
+ v-loading="loading"
|
|
|
+ element-loading-text="拼命加载中"
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
+ class="data-table-content"
|
|
|
+ >
|
|
|
<div v-if="isBtn" class="data-table-btn flex-end">
|
|
|
- <el-button size="small" @click="handleAdd" plain type="primary">新增</el-button>
|
|
|
+ <el-button size="small" @click="handleAdd" plain type="primary"
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<template v-if="tableData.length">
|
|
|
<div>
|
|
|
- <el-table v-el-table-infinite-scroll="load" :data="filteredTableData" :summary-method="getSummaries" :span-method="tableSpanMethod" stripe :show-summary="showSummary" border ref="table" :height="tableHeight ? tableHeight : (minHeight - 8 + 'vh')" class="table infinite-list" style="width: 100%; overflow: auto" @select="selectHandler">
|
|
|
+ <el-table
|
|
|
+ v-el-table-infinite-scroll="load"
|
|
|
+ :data="filteredTableData"
|
|
|
+ :summary-method="getSummaries"
|
|
|
+ :span-method="tableSpanMethod"
|
|
|
+ stripe
|
|
|
+ :show-summary="showSummary"
|
|
|
+ border
|
|
|
+ ref="table"
|
|
|
+ :height="tableHeight ? tableHeight : minHeight - 8 + 'vh'"
|
|
|
+ class="table infinite-list"
|
|
|
+ style="width: 100%; overflow: auto"
|
|
|
+ @select="selectHandler"
|
|
|
+ >
|
|
|
<el-table-column
|
|
|
v-if="selectionEnable"
|
|
|
type="selection"
|
|
|
width="35"
|
|
|
/>
|
|
|
- <el-table-column v-for="(item, index) in tableColsCopy" :sortable="item.needSort ? true : false" :key="index" :prop="item.columnName" :label="item.columnLabel" :show-overflow-tooltip="showOverflowTooltip">
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in tableColsCopy"
|
|
|
+ :sortable="item.needSort ? true : false"
|
|
|
+ :key="index"
|
|
|
+ :prop="item.columnName"
|
|
|
+ :label="item.columnLabel"
|
|
|
+ :show-overflow-tooltip="showOverflowTooltip"
|
|
|
+ >
|
|
|
<template #header>
|
|
|
<span class="colTips">
|
|
|
<el-tooltip :content="item.columnDescribe" placement="top">
|
|
@@ -20,18 +49,38 @@
|
|
|
</el-tooltip>
|
|
|
</span>
|
|
|
<span v-if="item.needFilters">
|
|
|
- <el-popover placement="bottom" trigger="click" @show="popoverShowHandler(item.columnName)" @hide="popoverHideHandler">
|
|
|
- <i slot="reference" :class="[
|
|
|
+ <el-popover
|
|
|
+ placement="bottom"
|
|
|
+ trigger="click"
|
|
|
+ @show="popoverShowHandler(item.columnName)"
|
|
|
+ @hide="popoverHideHandler"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ slot="reference"
|
|
|
+ :class="[
|
|
|
'filter-arrow',
|
|
|
'el-icon-arrow-down',
|
|
|
arrowClass(item.columnName),
|
|
|
- ]" />
|
|
|
+ ]"
|
|
|
+ />
|
|
|
<el-form>
|
|
|
<el-form-item :label="item.columnLabel">
|
|
|
- <el-select v-model="filterValues[item.columnName]" size="small" placeholder="筛选" default-first-option filterable clearable>
|
|
|
- <el-option v-for="(option, optionIndex) in tableDataFilters[
|
|
|
+ <el-select
|
|
|
+ v-model="filterValues[item.columnName]"
|
|
|
+ size="small"
|
|
|
+ placeholder="筛选"
|
|
|
+ default-first-option
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(option, optionIndex) in tableDataFilters[
|
|
|
item.columnName
|
|
|
- ]" :key="option.value + optionIndex" :value="option.value" :label="option.text" />
|
|
|
+ ]"
|
|
|
+ :key="option.value + optionIndex"
|
|
|
+ :value="option.value"
|
|
|
+ :label="option.text"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
@@ -44,10 +93,52 @@
|
|
|
<div class="hd-td">
|
|
|
<div class="hd-tr">
|
|
|
<!-- <el-button class="hrefBtn" type="text" @click="handleHerf(scope.row)" size="small">跳转</el-button> -->
|
|
|
- <el-button type="text" @click="handleEdit(scope.row)" size="small" class="rmScs">编辑</el-button>
|
|
|
- <el-button class="rmSc" type="text" @click="handleRemove(scope.row)" size="small">删除</el-button>
|
|
|
- <el-button class="rmScs" v-if="withColumnSet" type="text" size="small" @click="handleColumnSet(scope.row)">列设置</el-button>
|
|
|
- <el-button class="rmScs" v-if="withItemSet" type="text" size="small" @click="handleItemSet(scope.row)">数据项</el-button>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ @click="handleEdit(scope.row)"
|
|
|
+ size="small"
|
|
|
+ class="rmScs"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="rmSc"
|
|
|
+ type="text"
|
|
|
+ @click="handleRemove(scope.row)"
|
|
|
+ size="small"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="rmScs"
|
|
|
+ v-if="withColumnSet"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handleColumnSet(scope.row)"
|
|
|
+ >列设置</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="rmScs"
|
|
|
+ v-if="withItemSet"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handleItemSet(scope.row)"
|
|
|
+ >数据项</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="rmScser"
|
|
|
+ v-if="withlodSet"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handlelodSet(scope.row)"
|
|
|
+ >航站设置</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ class="rmScser"
|
|
|
+ v-if="withnodeSet"
|
|
|
+ type="text"
|
|
|
+ size="small"
|
|
|
+ @click="handlenodeSet(scope.row)"
|
|
|
+ >节点设置</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -66,16 +157,38 @@
|
|
|
<div class="dialog-content">
|
|
|
<div class="title">{{ tableTitle }}</div>
|
|
|
<div class="content">
|
|
|
- <el-form ref="ruleForm" :model="tableForm" :label-width="labelWidth">
|
|
|
+ <el-form
|
|
|
+ ref="ruleForm"
|
|
|
+ :model="tableForm"
|
|
|
+ :label-width="labelWidth"
|
|
|
+ >
|
|
|
<el-row :gutter="20">
|
|
|
- <el-col v-for="(item, index) in tableColsCopy" :key="index" :span="rows">
|
|
|
+ <el-col
|
|
|
+ v-for="(item, index) in tableColsCopy"
|
|
|
+ :key="index"
|
|
|
+ :span="rows"
|
|
|
+ >
|
|
|
<el-form-item :label="item.columnLabel">
|
|
|
- <template v-if="
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
item.listqueryTemplateID ||
|
|
|
item.listqueryTemplateID == 0
|
|
|
- ">
|
|
|
- <el-select size="small" clearable style="width: 100%" v-model="tableForm[item.columnName]" @change="changeSelect(item.columnName)" placeholder="请选择">
|
|
|
- <el-option v-for="item in tableOptions[item.columnName]" :key="item.v" :label="item.k" :value="item.v">
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="tableForm[item.columnName]"
|
|
|
+ @change="changeSelect(item.columnName)"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in tableOptions[item.columnName]"
|
|
|
+ :key="item.v"
|
|
|
+ :label="item.k"
|
|
|
+ :value="item.v"
|
|
|
+ >
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
@@ -83,7 +196,11 @@
|
|
|
<el-input size="small" :rows="1" type="textarea" v-model="tableForm[item.columnName]"></el-input>
|
|
|
</template> -->
|
|
|
<template v-else>
|
|
|
- <el-input size="small" v-model="tableForm[item.columnName]" @change="inputChangeHandler(item.columnName)"></el-input>
|
|
|
+ <el-input
|
|
|
+ size="small"
|
|
|
+ v-model="tableForm[item.columnName]"
|
|
|
+ @change="inputChangeHandler(item.columnName)"
|
|
|
+ ></el-input>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -91,7 +208,13 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="foot right t30">
|
|
|
- <el-button size="medium" @click="handleOk" class="r24" type="primary">确定</el-button>
|
|
|
+ <el-button
|
|
|
+ size="medium"
|
|
|
+ @click="handleOk"
|
|
|
+ class="r24"
|
|
|
+ type="primary"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
<el-button @click="flag = false" size="medium">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -100,11 +223,20 @@
|
|
|
<div class="airportInfoDialog">
|
|
|
<div class="title del-title">删除</div>
|
|
|
<div class="content del-content">
|
|
|
- <span class="el-icon-error error r10"></span>您是否确认删除<span class="error l10">{{ rmTitle }}</span>
|
|
|
+ <span class="el-icon-error error r10"></span>您是否确认删除<span
|
|
|
+ class="error l10"
|
|
|
+ >{{ rmTitle }}</span
|
|
|
+ >
|
|
|
?
|
|
|
</div>
|
|
|
<div class="foot right Delfoot t30">
|
|
|
- <el-button size="medium" class="r24" @click="tableRemove" type="danger">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ size="medium"
|
|
|
+ class="r24"
|
|
|
+ @click="tableRemove"
|
|
|
+ type="danger"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
<el-button size="medium" @click="rmFlag = false">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -123,20 +255,20 @@ export default {
|
|
|
props: {
|
|
|
isDialog: {
|
|
|
type: Boolean,
|
|
|
- default: true
|
|
|
+ default: true,
|
|
|
},
|
|
|
//接口ID
|
|
|
dataId: {
|
|
|
type: [String, Number],
|
|
|
- default: ''
|
|
|
+ default: "",
|
|
|
},
|
|
|
editId: {
|
|
|
type: [String, Number],
|
|
|
- default: ''
|
|
|
+ default: "",
|
|
|
},
|
|
|
dataContent: {
|
|
|
type: Object,
|
|
|
- default: () => ({})
|
|
|
+ default: () => ({}),
|
|
|
},
|
|
|
//弹框宽度
|
|
|
width: {
|
|
@@ -156,7 +288,7 @@ export default {
|
|
|
//表格高度
|
|
|
tableHeight: {
|
|
|
type: [String, Number],
|
|
|
- default: 0
|
|
|
+ default: 0,
|
|
|
},
|
|
|
minHeight: {
|
|
|
type: Number,
|
|
@@ -170,46 +302,56 @@ export default {
|
|
|
// 是否显示合计行
|
|
|
showSummary: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
+ default: false,
|
|
|
},
|
|
|
marginTop: {
|
|
|
type: String,
|
|
|
- default: '20px'
|
|
|
+ default: "20px",
|
|
|
},
|
|
|
// 是否可选中行
|
|
|
selectionEnable: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
+ default: false,
|
|
|
},
|
|
|
// 懒加载
|
|
|
withLazyLoad: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
+ default: false,
|
|
|
},
|
|
|
// 不换行,溢出隐藏
|
|
|
showOverflowTooltip: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
+ default: false,
|
|
|
},
|
|
|
// 表格-操作-列设置按钮显示
|
|
|
withColumnSet: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
+ default: false,
|
|
|
},
|
|
|
// 表格-操作-项设置按钮显示
|
|
|
withItemSet: {
|
|
|
type: Boolean,
|
|
|
- default: false
|
|
|
- }
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ // 表格-操作-项设置按钮显示
|
|
|
+ withlodSet: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
+ // 表格-操作-节点按钮显示
|
|
|
+ withnodeSet: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false,
|
|
|
+ },
|
|
|
},
|
|
|
components: { Dialog, NoData },
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
flag: false,
|
|
|
serviceId: null,
|
|
|
rmFlag: false,
|
|
|
- rowTitle: '',
|
|
|
+ rowTitle: "",
|
|
|
tableCols: [], //表头数据
|
|
|
tableData: [], //表格数据
|
|
|
tableColsCopy: [], //表头数据缓存
|
|
@@ -227,22 +369,22 @@ export default {
|
|
|
tableObj: {}, //增/删/改数据缓存
|
|
|
tableOptions: {}, //弹框-下来数据缓存
|
|
|
tableArrs: [], //重组table-表头下拉
|
|
|
- proAll: false //重组时-所有请求是否都完成
|
|
|
+ proAll: false, //重组时-所有请求是否都完成
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
dataTableContentStyle() {
|
|
|
- const style = {}
|
|
|
+ const style = {};
|
|
|
if (this.minHeight) {
|
|
|
- style['min-height'] = this.minHeight
|
|
|
+ style["min-height"] = this.minHeight;
|
|
|
}
|
|
|
if (this.tableHeight) {
|
|
|
- style['height'] = this.tableHeight
|
|
|
+ style["height"] = this.tableHeight;
|
|
|
}
|
|
|
- return style
|
|
|
+ return style;
|
|
|
},
|
|
|
//设置表头-下拉-箭头样式
|
|
|
- arrowClass () {
|
|
|
+ arrowClass() {
|
|
|
return function (prop) {
|
|
|
let classString = "";
|
|
|
if (this.colShowFilter === prop) {
|
|
@@ -259,7 +401,7 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
//设置表头-下拉-选中数据
|
|
|
- filteredTableData () {
|
|
|
+ filteredTableData() {
|
|
|
return this.tableData.filter((item) => {
|
|
|
let flag = true;
|
|
|
Object.entries(this.filterValues).forEach(([key, value]) => {
|
|
@@ -271,42 +413,41 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
- // watch: {
|
|
|
- // proAll: {
|
|
|
- // handler (val) {
|
|
|
- // if (val) {
|
|
|
- // setTimeout(() => {
|
|
|
- // this.setTable()
|
|
|
- // }, 200);
|
|
|
- // }
|
|
|
- // },
|
|
|
- // deep: true
|
|
|
- // }
|
|
|
- // },
|
|
|
- mounted () {
|
|
|
+ watch: {
|
|
|
+ dataContent: {
|
|
|
+ handler(val) {
|
|
|
+ if (val) {
|
|
|
+ this.getQuery();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
this.getQuery();
|
|
|
},
|
|
|
updated() {
|
|
|
- this.$refs['table']?.doLayout()
|
|
|
+ this.$refs["table"]?.doLayout();
|
|
|
},
|
|
|
methods: {
|
|
|
- load(){
|
|
|
- console.log('分页')
|
|
|
+ load() {
|
|
|
+ console.log("分页");
|
|
|
},
|
|
|
- changeSelect(data){
|
|
|
- if (this.tableForm[data] === '') {
|
|
|
- this.tableForm[data] = null
|
|
|
+ changeSelect(data) {
|
|
|
+ if (this.tableForm[data] === "") {
|
|
|
+ this.tableForm[data] = null;
|
|
|
}
|
|
|
- this.tableForm[this.tableOptions[data][0].setvalue] = this.tableForm[data];
|
|
|
+ this.tableForm[this.tableOptions[data][0].setvalue] =
|
|
|
+ this.tableForm[data];
|
|
|
// console.log(this.tableForm)
|
|
|
},
|
|
|
inputChangeHandler(data) {
|
|
|
- if (this.tableForm[data] === '') {
|
|
|
- this.tableForm[data] = null
|
|
|
+ if (this.tableForm[data] === "") {
|
|
|
+ this.tableForm[data] = null;
|
|
|
}
|
|
|
},
|
|
|
//获取表格数据
|
|
|
- async getQuery () {
|
|
|
+ async getQuery() {
|
|
|
try {
|
|
|
this.loading = true;
|
|
|
const { code, returnData } = await Query({
|
|
@@ -314,9 +455,11 @@ export default {
|
|
|
dataContent: Object.values(this.dataContent),
|
|
|
});
|
|
|
if (code == 0) {
|
|
|
- const titleColumn = returnData.columnSet.find(item => item.needShow === 1)
|
|
|
+ const titleColumn = returnData.columnSet.find(
|
|
|
+ (item) => item.needShow === 1
|
|
|
+ );
|
|
|
if (titleColumn) {
|
|
|
- this.rowTitle = titleColumn.columnName
|
|
|
+ this.rowTitle = titleColumn.columnName;
|
|
|
}
|
|
|
this.tableData = returnData.listValues;
|
|
|
this.tableCols = returnData.columnSet;
|
|
@@ -335,12 +478,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//表格-增/删/改
|
|
|
- async generalDataReception (data) {
|
|
|
+ async generalDataReception(data) {
|
|
|
try {
|
|
|
data = {
|
|
|
...data,
|
|
|
- ...this.dataContent
|
|
|
- }
|
|
|
+ ...this.dataContent,
|
|
|
+ };
|
|
|
const { code, message } = await GeneralDataReception({
|
|
|
serviceId: this.serviceId,
|
|
|
dataContent: JSON.stringify(data),
|
|
@@ -369,50 +512,54 @@ export default {
|
|
|
},
|
|
|
// 表格勾选
|
|
|
toggleRowSelection(row, isSelected) {
|
|
|
- this.$refs['table'].toggleRowSelection(row, isSelected)
|
|
|
+ this.$refs["table"].toggleRowSelection(row, isSelected);
|
|
|
},
|
|
|
// 表格初始勾选
|
|
|
selectTableRows(tableData, selectFlagName) {
|
|
|
- tableData.forEach(row => {
|
|
|
- this.$refs['table'].toggleRowSelection(row, !!row[selectFlagName])
|
|
|
- })
|
|
|
+ tableData.forEach((row) => {
|
|
|
+ this.$refs["table"].toggleRowSelection(row, !!row[selectFlagName]);
|
|
|
+ });
|
|
|
},
|
|
|
//初始化表格
|
|
|
- initTableData () {
|
|
|
+ initTableData() {
|
|
|
this.tableColsCopy = this.tableCols.filter((item) => item.needShow);
|
|
|
// console.log(this.tableColsCopy)
|
|
|
this.tableDataCopy = _.cloneDeep(this.tableData);
|
|
|
const datas = _.cloneDeep(this.tableColsCopy);
|
|
|
- const reqUts = []
|
|
|
+ const reqUts = [];
|
|
|
datas.forEach(async (item) => {
|
|
|
this.tableDataFilters[item.columnName] = [];
|
|
|
if (item.needGroup) {
|
|
|
this.tableGroups.push(item.columnName);
|
|
|
}
|
|
|
if (item.listqueryTemplateID || item.listqueryTemplateID == 0) {
|
|
|
- this.tableArrs.push(item.columnName)
|
|
|
+ this.tableArrs.push(item.columnName);
|
|
|
// const reqUt = this.getSelectData(item.listqueryTemplateID)
|
|
|
// reqUts.push(reqUt)
|
|
|
- this.tableOptions[item.columnName] = await this.getSelectData(item.listqueryTemplateID)
|
|
|
+ this.tableOptions[item.columnName] = await this.getSelectData(
|
|
|
+ item.listqueryTemplateID
|
|
|
+ );
|
|
|
// console.log(this.tableOptions[item.columnName])
|
|
|
}
|
|
|
// this.filterValues[item.columnName] = ''
|
|
|
});
|
|
|
setTableFilters(this.tableData, this.tableDataFilters);
|
|
|
this.tableGroup(this.tableData);
|
|
|
- this.selectTableRows(this.tableData, 'DeployID')
|
|
|
+ this.selectTableRows(this.tableData, "DeployID");
|
|
|
// this.getSelectDataAll(reqUts)
|
|
|
},
|
|
|
//获取所有获取弹框-下拉数据-请求状态
|
|
|
- getSelectDataAll (reqUts) {
|
|
|
- Promise.all(reqUts).then(res => {
|
|
|
- this.proAll = true
|
|
|
- }).catch(err => {
|
|
|
- this.proAll = false
|
|
|
- })
|
|
|
+ getSelectDataAll(reqUts) {
|
|
|
+ Promise.all(reqUts)
|
|
|
+ .then((res) => {
|
|
|
+ this.proAll = true;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.proAll = false;
|
|
|
+ });
|
|
|
},
|
|
|
//获取弹框-下拉数据
|
|
|
- async getSelectData (id) {
|
|
|
+ async getSelectData(id) {
|
|
|
const { code, returnData } = await Query({
|
|
|
id,
|
|
|
dataContent: [],
|
|
@@ -424,26 +571,26 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//重组table-显示名称
|
|
|
- setTable () {
|
|
|
- this.tableArrs.forEach(item => {
|
|
|
- this.tableOptions[item].forEach(p => {
|
|
|
- this.tableDataCopy.forEach(msg => {
|
|
|
+ setTable() {
|
|
|
+ this.tableArrs.forEach((item) => {
|
|
|
+ this.tableOptions[item].forEach((p) => {
|
|
|
+ this.tableDataCopy.forEach((msg) => {
|
|
|
if (msg[item] == p.v) {
|
|
|
- msg[item] = p.k
|
|
|
+ msg[item] = p.k;
|
|
|
}
|
|
|
- })
|
|
|
- this.tableDataFilters[item].forEach(cap => {
|
|
|
+ });
|
|
|
+ this.tableDataFilters[item].forEach((cap) => {
|
|
|
if (cap.value == p.v) {
|
|
|
- cap.text = p.k
|
|
|
- cap.value = p.k
|
|
|
+ cap.text = p.k;
|
|
|
+ cap.value = p.k;
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
- this.tableData = this.tableDataCopy
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.tableData = this.tableDataCopy;
|
|
|
},
|
|
|
//分组
|
|
|
- tableGroup (tableData) {
|
|
|
+ tableGroup(tableData) {
|
|
|
const spanArr = [];
|
|
|
let pos = 0;
|
|
|
let ifYj = this.tableGroups[0];
|
|
@@ -463,14 +610,14 @@ export default {
|
|
|
this.spanArr = spanArr;
|
|
|
this.pos = pos;
|
|
|
},
|
|
|
- popoverShowHandler (prop) {
|
|
|
+ popoverShowHandler(prop) {
|
|
|
this.colShowFilter = prop;
|
|
|
},
|
|
|
- popoverHideHandler () {
|
|
|
+ popoverHideHandler() {
|
|
|
this.colShowFilter = "";
|
|
|
},
|
|
|
//分组
|
|
|
- tableSpanMethod ({ row, column, rowIndex, columnIndex }) {
|
|
|
+ tableSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
if (this.tableGroups.includes(column["property"])) {
|
|
|
const _row = this.spanArr[rowIndex];
|
|
|
const _col = _row > 0 ? 1 : 0;
|
|
@@ -481,7 +628,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//合计
|
|
|
- getSummaries (param) {
|
|
|
+ getSummaries(param) {
|
|
|
const { columns, data } = param;
|
|
|
const sums = [];
|
|
|
columns.forEach((column, index) => {
|
|
@@ -505,72 +652,74 @@ export default {
|
|
|
return sums;
|
|
|
},
|
|
|
//弹框-确定
|
|
|
- handleOk () {
|
|
|
+ handleOk() {
|
|
|
this.submitClickHandler();
|
|
|
},
|
|
|
//滚动
|
|
|
- tableLoad () {
|
|
|
+ tableLoad() {
|
|
|
console.log("d");
|
|
|
},
|
|
|
//表格-新增
|
|
|
- handleAdd () {
|
|
|
+ handleAdd() {
|
|
|
// this.flag = true;
|
|
|
// this.tableType = "add";
|
|
|
// this.tableTitle = "新增";
|
|
|
// this.tableForm = {};
|
|
|
- if(this.isDialog ){
|
|
|
+ if (this.isDialog) {
|
|
|
this.flag = true;
|
|
|
this.tableType = "add";
|
|
|
this.tableTitle = "新增";
|
|
|
this.tableForm = {};
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
this.$emit("handleAdd");
|
|
|
}
|
|
|
|
|
|
// console.log(this.tableOptions);
|
|
|
},
|
|
|
//表格-编辑
|
|
|
- async handleEdit (row) {
|
|
|
- if(this.isDialog) {
|
|
|
+ async handleEdit(row) {
|
|
|
+ if (this.isDialog) {
|
|
|
if (this.editId) {
|
|
|
- let data = await this.queryOriginRow(this.editId, row.queryTemplateColumnSetID)
|
|
|
- this.tableForm = JSON.parse(JSON.stringify(data))
|
|
|
+ let data = await this.queryOriginRow(
|
|
|
+ this.editId,
|
|
|
+ row.queryTemplateColumnSetID
|
|
|
+ );
|
|
|
+ this.tableForm = JSON.parse(JSON.stringify(data));
|
|
|
// this.tableForm =this.tableForm;
|
|
|
// Object.entries(tableForm).forEach(([key, value]) => {
|
|
|
// this.tableForm[key] = value
|
|
|
// })
|
|
|
} else {
|
|
|
- this.tableForm = JSON.parse(JSON.stringify(row));
|
|
|
+ this.tableForm = JSON.parse(JSON.stringify(row));
|
|
|
}
|
|
|
this.flag = true;
|
|
|
this.tableType = "edit";
|
|
|
this.tableTitle = "编辑";
|
|
|
- } else{
|
|
|
- this.$emit("handleEdit",row);
|
|
|
+ } else {
|
|
|
+ this.$emit("handleEdit", row);
|
|
|
}
|
|
|
},
|
|
|
async queryOriginRow(editId, queryTemplateColumnSetID) {
|
|
|
try {
|
|
|
const { code, returnData } = await Query({
|
|
|
id: editId,
|
|
|
- dataContent: [queryTemplateColumnSetID]
|
|
|
- })
|
|
|
+ dataContent: [queryTemplateColumnSetID],
|
|
|
+ });
|
|
|
if (Number(code) === 0) {
|
|
|
- return returnData.listValues[0]
|
|
|
+ return returnData.listValues[0];
|
|
|
} else {
|
|
|
- this.$message.error("失败")
|
|
|
+ this.$message.error("失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.log(error)
|
|
|
+ console.log(error);
|
|
|
}
|
|
|
},
|
|
|
//表格-跳转
|
|
|
- handleHerf(row){
|
|
|
- alert('跳转')
|
|
|
+ handleHerf(row) {
|
|
|
+ alert("跳转");
|
|
|
},
|
|
|
// 新增/编辑-确认
|
|
|
- submitClickHandler () {
|
|
|
+ submitClickHandler() {
|
|
|
this.$refs["ruleForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.tableType == "add") {
|
|
@@ -585,39 +734,57 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//表格-删除
|
|
|
- handleRemove (row) {
|
|
|
+ handleRemove(row) {
|
|
|
this.rmFlag = true;
|
|
|
// this.rmTitle = row.className || row.username || row.serviceName || row.queryTemplateName;
|
|
|
- this.rmTitle = row[this.rowTitle]
|
|
|
+ this.rmTitle = row[this.rowTitle];
|
|
|
this.tableObj = row;
|
|
|
},
|
|
|
//表格-删除-确认
|
|
|
- tableRemove () {
|
|
|
+ tableRemove() {
|
|
|
this.tableObj.event = 3;
|
|
|
this.generalDataReception(this.tableObj);
|
|
|
},
|
|
|
// 表格-跳转列设置页
|
|
|
handleColumnSet(row) {
|
|
|
this.$router.push({
|
|
|
- path: '/systemSettings/queryTemplateChild',
|
|
|
+ path: "/systemSettings/queryTemplateChild",
|
|
|
query: {
|
|
|
- queryTemplateID: row.queryTemplateID
|
|
|
- }
|
|
|
- })
|
|
|
+ queryTemplateID: row.queryTemplateID,
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
// 表格-跳转数据项设置页
|
|
|
handleItemSet(row) {
|
|
|
this.$router.push({
|
|
|
- path: '/systemSettings/datastructureChild',
|
|
|
+ path: "/systemSettings/datastructureChild",
|
|
|
query: {
|
|
|
- dataStructureID: row.dataStructureID
|
|
|
- }
|
|
|
- })
|
|
|
+ dataStructureID: row.dataStructureID,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 表格-跳转航站设置页
|
|
|
+ handlelodSet(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/BasicsData/airportInfoChild",
|
|
|
+ query: {
|
|
|
+ dataStructureID: row.dataStructureID,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 表格-节点置页
|
|
|
+ handlenodeSet(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/BasicsData/deployNodeChild",
|
|
|
+ query: {
|
|
|
+ dataStructureID: row.dataStructureID,
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
// 表格-选中行
|
|
|
selectHandler(selection, row) {
|
|
|
- this.$emit('selection-change', selection, row)
|
|
|
- }
|
|
|
+ this.$emit("selection-change", selection, row);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -648,8 +815,8 @@ export default {
|
|
|
font-weight: bold;
|
|
|
color: #101116;
|
|
|
> .el-checkbox {
|
|
|
- display: none;
|
|
|
- }
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
}
|
|
|
.has-gutter {
|
|
|
tr {
|
|
@@ -693,6 +860,20 @@ export default {
|
|
|
color: #2d67e3;
|
|
|
}
|
|
|
}
|
|
|
+ .rmScser {
|
|
|
+ width: 60px;
|
|
|
+ height: 24px;
|
|
|
+ border-color: #9ebbf7;
|
|
|
+ box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
|
|
|
+ border-radius: 4px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ float: left;
|
|
|
+ span {
|
|
|
+ color: #2d67e3;
|
|
|
+ }
|
|
|
+ }
|
|
|
.rmSc {
|
|
|
width: 48px;
|
|
|
height: 24px;
|
|
@@ -710,7 +891,7 @@ export default {
|
|
|
.hrefBtn {
|
|
|
width: 48px;
|
|
|
height: 24px;
|
|
|
- background: #6F81BC;
|
|
|
+ background: #6f81bc;
|
|
|
box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.06);
|
|
|
border-radius: 4px;
|
|
|
display: flex;
|
|
@@ -729,7 +910,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.hd-td {
|
|
|
- .hd-tr{
|
|
|
+ .hd-tr {
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
flex-direction: row;
|