|
|
@ -1,8 +1,8 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container" v-loading="state.loading"> |
|
|
|
<!-- 查询头部 --> |
|
|
|
<el-card class="search-container" v-if="!props.hideSearch"> |
|
|
|
<el-form :inline="true"> |
|
|
|
<el-card class="search-container" v-if="!(props.hideSearch && props.hideSetColums)"> |
|
|
|
<el-form :inline="true" v-if="!props.hideSearch"> |
|
|
|
<el-form-item |
|
|
|
v-auth="props.apiName + state.searchBtnOptions['search'].auth" |
|
|
|
v-for="(item,index) in props.searchOptions" |
|
|
@ -31,6 +31,7 @@ |
|
|
|
end-placeholder="结束时间" |
|
|
|
format="YYYY-MM-DD HH:mm:ss" |
|
|
|
value-format="YYYY-MM-DD HH:mm:ss" |
|
|
|
style="width:370px" |
|
|
|
/> |
|
|
|
<!-- 选择框 --> |
|
|
|
<el-select |
|
|
@ -69,7 +70,16 @@ |
|
|
|
v-auth="btn.sAuth || props.apiName + btn.auth" |
|
|
|
:type="btn.type" |
|
|
|
@click="searchRightBtnHandle(btn)" |
|
|
|
style="margin-right: 10px" |
|
|
|
>{{btn.label}}</el-button> |
|
|
|
<!-- 字段设置 --> |
|
|
|
<setColumsPop |
|
|
|
style="margin-left: auto;" |
|
|
|
:localTableColumnsName="state.localTableColumnsName" |
|
|
|
:initTableColums="state.initTableColums" |
|
|
|
:tableColumns="getTableColumns()" |
|
|
|
v-if="!props.hideSetColums" |
|
|
|
></setColumsPop> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
<!-- 头部详情 --> |
|
|
@ -158,7 +168,8 @@ |
|
|
|
import { ElMessageBox, ElMessage,ElTable, ElTableColumn } from 'element-plus' |
|
|
|
import elTable from '@/components/elTable/index.vue' |
|
|
|
import elPager from '@/components/elPager/index.vue' |
|
|
|
import { getPageParamsForFilter } from '@/utils/common/index' |
|
|
|
import setColumsPop from '@/components/setColumsPop/index.vue' |
|
|
|
import { getPageParamsForFilter,getLocalTableColumnsName } from '@/utils/common/index' |
|
|
|
import { downloadByData } from '@/utils/download' |
|
|
|
import importPop from '@/components/importPop/index.vue' |
|
|
|
import apiEditPop from '@/components/apiEditPop/index.vue' |
|
|
@ -205,6 +216,9 @@ |
|
|
|
stage_tableData:[], |
|
|
|
// 暂存更改的行数(用于保留校验更改行数) |
|
|
|
stage_indexs:[], |
|
|
|
//初始化表头,未从缓存获取之前 |
|
|
|
initTableColums:[], |
|
|
|
localTableColumnsName:null, |
|
|
|
//tabel内部表单验证 |
|
|
|
tableFormRulesData:null, |
|
|
|
}) |
|
|
@ -323,11 +337,24 @@ |
|
|
|
// {prop:'releaseEdition',ruleValue:'2024121901'}, |
|
|
|
] |
|
|
|
}, |
|
|
|
// 隐藏字段设置 |
|
|
|
hideSetColums:{ |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 获取表头 |
|
|
|
function getTableColumns(){ |
|
|
|
return props.tableColumns || apiTableColumns[props.apiName] |
|
|
|
state.localTableColumnsName = getLocalTableColumnsName(useRoute().name) |
|
|
|
if(props.apiType == 'detailApi'){ |
|
|
|
state.localTableColumnsName = getLocalTableColumnsName(props.apiName+'Detail') |
|
|
|
} |
|
|
|
let _local = JSON.parse(localStorage.getItem(state.localTableColumnsName)) |
|
|
|
state.initTableColums = props.tableColumns || apiTableColumns[props.apiName] |
|
|
|
let _list = _local && _local != null && _local != undefined ? _local : JSON.parse(JSON.stringify(state.initTableColums)) |
|
|
|
return _list |
|
|
|
// return props.tableColumns || apiTableColumns[props.apiName] |
|
|
|
} |
|
|
|
|
|
|
|
const emits = defineEmits([ |
|
|
|