修改表格右下角配置

This commit is contained in:
龙运模 2024-07-10 23:25:20 +08:00
parent e3b1d2c9c8
commit 277eac69f2
5 changed files with 64 additions and 20 deletions

View File

@ -262,12 +262,12 @@
async columnSettingSave(userColumn){
this.$refs.columnSetting.isSave = true
try {
await config.columnSettingSave(this.tableName, userColumn,this.apiObj)
await config.columnSettingSave(this.tableName, userColumn,this.apiObj);
this.$message.success('保存成功')
}catch(error){
this.$message.error('保存失败')
this.$refs.columnSetting.isSave = false
}
this.$message.success('保存成功')
this.$refs.columnSetting.isSave = false
},
//
@ -330,8 +330,14 @@
})
return sums
},
configSizeChange(){
this.$refs.scTable.doLayout()
async configSizeChange() {
try {
await config.columnSettingConfigSave(this.tableName, this.config, this.apiObj);
this.$message.success('保存成功')
} catch (error) {
this.$message.error('保存失败')
}
// this.$refs.scTable.doLayout()
},
// unshiftRow
unshiftRow(row){

View File

@ -28,7 +28,7 @@ export default {
* @tableName scTable组件的props->tableName
* @column 用户配置好的列
*/
columnSettingSave: function (tableName, column,params) {
columnSettingSave: function (tableName, column ,params) {
column.forEach((item,index)=>{
item.sort = index+1;
})
@ -51,19 +51,26 @@ export default {
})
},
/**
* 获取自定义列
* 保存表格列表配置
* @tableName scTable组件的props->tableName
* @column 组件接受到的props->column
*/
columnSettingGet: function (tableName, column) {
columnSettingConfigSave: function (tableName, config, params) {
return new Promise((resolve) => {
//这里为了演示使用了session和setTimeout演示开发时应用数据请求
const userColumn = tool.session.get(tableName)
if(userColumn){
resolve(userColumn)
}else{
resolve(column)
if(!params.url || params.url==''){
resolve(false)
return
}
let data = {
table_config:config,
}
http.post(params.url, data).then(res=>{
if(res.code == 200 && res.data.column){
resolve(true)
}else{
resolve(false)
}
});
})
},
/**

View File

@ -95,7 +95,10 @@ export default {
},
selection: [],
params: {
activation_date: '',
activation_date: {
operator:'in',
value:[]
},
id:'',
active_status:'',
}

View File

@ -23,7 +23,7 @@
<el-image style="height: 80px;width: 80px;border-radius: 2px;" fit="cover" :src="form.logo"></el-image>
</el-form-item>
<el-form-item label="证件照" prop="doc_attach">
<el-image v-for="item in form.doc_attach" :key="item" style="height: 80px;width: 80px;border-radius: 2px;" fit="cover" :src="item.doc_url"></el-image>
<el-image v-for="item in form.doc_attach" :key="item" style="height: 80px;width: 80px;border-radius: 2px;margin: 0 5px 5px 0" fit="cover" :src="item.doc_url"></el-image>
</el-form-item>
</el-form>
<template #footer>

View File

@ -4,11 +4,29 @@
<div class="searchMain">
<div class="searchItem">
<label class="name">时间</label>
<el-date-picker class="input" type="datetimerange" :size="size" v-model="date" :popper-options="{ placement: 'bottom-start' }" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" clearable></el-date-picker>
<el-date-picker class="input" type="daterange" :size="size" v-model="params.date" :popper-options="{ placement: 'bottom-start' }" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" clearable></el-date-picker>
</div>
<div class="searchItem">
<label class="name">业务端</label>
<el-select class="input" :size="size" v-model="params.id" @visible-change="getCompanyList" placeholder="请选择业务" filterable clearable>
<el-option v-for="item in setMap.name" :key="item" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</div>
<div class="searchItem">
<label class="name">操作功能</label>
<el-select class="input" :size="size" v-model="params.id" @visible-change="getCompanyList" placeholder="请选择功能" filterable clearable>
<el-option v-for="item in setMap.name" :key="item" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</div>
<div class="searchItem">
<label class="name">操作日志</label>
<el-select class="input" :size="size" v-model="params.id" @visible-change="getCompanyList" placeholder="请选择日志" filterable clearable>
<el-option v-for="item in setMap.name" :key="item" :label="item.full_name" :value="item.id"></el-option>
</el-select>
</div>
<div class="searchItem searchBtn">
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight">重置</el-button>
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
</div>
</div>
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow @row-click="rowClick">
@ -33,6 +51,9 @@
data() {
return {
size:"small",
setMap:{
name:[]
},
infoDrawer: false,
date: [],
@ -40,14 +61,21 @@
apiObj: this.$API.system.log.list,
column:[]
},
search: {
keyword: ""
params: {
date:"",
id: "",
}
}
},
methods: {
getCompanyList(e){
if(!e) return
},
upSearch(){
this.$refs.table.upData(this.params);
},
reset(){
this.$refs.table.reload();
},
rowClick(row){
this.infoDrawer = true