|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- {{listStyle}}
|
|
|
<div style="width: 100%;height: 40px;">
|
|
|
<div style="margin: 0 12px;float: left;">
|
|
|
<el-button
|
|
@@ -27,6 +26,29 @@
|
|
|
@queryTable="getList"
|
|
|
></right-toolbar>
|
|
|
</div>
|
|
|
+ <div style="margin-right:10px;float: right">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="mini"
|
|
|
+ @click="feedback('搜索')"
|
|
|
+ >搜索</el-button>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="feedback('重置')"
|
|
|
+ size="mini"
|
|
|
+ >重置</el-button>
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ plain
|
|
|
+ icon="el-icon-search"
|
|
|
+ @click="feedback('展开')"
|
|
|
+ size="mini"
|
|
|
+ >展开</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
@@ -36,7 +58,7 @@
|
|
|
>
|
|
|
<el-table-column type="selection" width="55" align="center"/>
|
|
|
<el-table-column
|
|
|
- v-for="(item,index) in setRowList"
|
|
|
+ v-for="(item,index) in queryList.columnList"
|
|
|
:key="index"
|
|
|
:prop="item.label"
|
|
|
:label="item.name"
|
|
@@ -127,14 +149,9 @@
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="showSetting = false">取 消</el-button>
|
|
|
<el-button @click="delRow" type="danger">重 置</el-button>
|
|
|
- <el-button type="primary" @click="save()">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="save">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
-<!-- {{listStyle}}-->
|
|
|
- <br>
|
|
|
- {{queryList.columnList}}
|
|
|
- <br>
|
|
|
- {{setRowList}}
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -143,10 +160,9 @@ import { addSet, resetModule } from "@/api/system/set";
|
|
|
import Cookies from "js-cookie";
|
|
|
export default {
|
|
|
name: 'listComponent',
|
|
|
- props: ['tableData', 'listStyle','queryList','customButton','arrow'],
|
|
|
+ props: ['tableData', 'listStyle','queryList','customButton','arrow','setRowList'],
|
|
|
data() {
|
|
|
return {
|
|
|
- setRowList:this.queryList.columnList,
|
|
|
showSetting: false,
|
|
|
allCheck: false,
|
|
|
}
|
|
@@ -158,7 +174,7 @@ export default {
|
|
|
// }
|
|
|
queryList: function (newValue,oldValue) {
|
|
|
console.log(newValue,oldValue)
|
|
|
- this.setRowList = newValue.columnList
|
|
|
+ this.queryList.columnList = newValue.columnList
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
@@ -168,24 +184,24 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
initData(){
|
|
|
- this.setRowList = this.queryList.columnList
|
|
|
- console.log(this.setRowList)
|
|
|
+ this.queryList.columnList = this.queryList.columnList
|
|
|
+ console.log(this.queryList.columnList)
|
|
|
},
|
|
|
//行号设置
|
|
|
rowClassName({row, rowIndex}) {
|
|
|
- console.log(row,rowIndex)
|
|
|
+ // console.log(row,rowIndex)
|
|
|
//把每一行的索引放进row.id
|
|
|
row.fLineNumber = rowIndex+1;
|
|
|
- console.log(row.fLineNumber)
|
|
|
+ // console.log(row.fLineNumber)
|
|
|
},
|
|
|
//列设置全选
|
|
|
allChecked() {
|
|
|
if (this.allCheck == true) {
|
|
|
- this.setRowList.map((e) => {
|
|
|
+ this.queryList.columnList.map((e) => {
|
|
|
return (e.checked = 0);
|
|
|
});
|
|
|
} else {
|
|
|
- this.setRowList.map((e) => {
|
|
|
+ this.queryList.columnList.map((e) => {
|
|
|
return (e.checked = 1);
|
|
|
});
|
|
|
}
|
|
@@ -201,15 +217,16 @@ export default {
|
|
|
//保存列设置
|
|
|
save() {
|
|
|
this.showSetting = false;
|
|
|
- this.data = {
|
|
|
+ let data = {
|
|
|
tableName: this.queryList.tableName,
|
|
|
userId: Cookies.get("userName"),
|
|
|
- sysTableSetList: this.setRowList,
|
|
|
+ sysTableSetList: this.queryList.columnList,
|
|
|
};
|
|
|
- addSet(this.data).then((res) => {
|
|
|
+ addSet(data).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
+ console.log(res)
|
|
|
this.showSetting = false;
|
|
|
- this.getRowList = this.setRowList.filter((e) => e.checked == 0);
|
|
|
+ this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -222,7 +239,7 @@ export default {
|
|
|
resetModule(this.data).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
this.showSetting = false;
|
|
|
- this.setRowList = this.listStyle;
|
|
|
+ this.queryList.columnList = this.listStyle;
|
|
|
console.log(this.getRowList)
|
|
|
}
|
|
|
});
|
|
@@ -234,6 +251,10 @@ export default {
|
|
|
getList(){
|
|
|
this.$emit('getList')
|
|
|
},
|
|
|
+ //搜索、重置、展开
|
|
|
+ feedback(res){
|
|
|
+ this.$emit('feedback',res)
|
|
|
+ },
|
|
|
//所有按钮
|
|
|
buttonList(row){
|
|
|
this.$emit('buttonList', row)
|