|
@@ -17,9 +17,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button size="mini" @click="filterDatas">确认</el-button>
|
|
|
- <router-link to="/admin/LT-ZKYMSJWH-TJZHDYWH" style="margin:0 10px">
|
|
|
- <el-button size="mini" type="warning">添加组合字段</el-button>
|
|
|
- </router-link>
|
|
|
+ <el-button size="mini" type="warning" @click="addCombineField">添加组合字段</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</crumbs>
|
|
@@ -89,7 +87,7 @@
|
|
|
data: function () {
|
|
|
return {
|
|
|
list: [],
|
|
|
- cacheData: {},
|
|
|
+ searched:false,
|
|
|
tagType:[4],
|
|
|
currentPage: 1,
|
|
|
pageSize: 10,
|
|
@@ -105,7 +103,25 @@
|
|
|
},
|
|
|
created() {
|
|
|
this.getAllTypes();
|
|
|
- this.getDataList();
|
|
|
+ const _this=this;
|
|
|
+ setTimeout(function() {
|
|
|
+ _this.getDataList();
|
|
|
+ },100);
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ 'filter':{
|
|
|
+ handler:function(){
|
|
|
+ this.searched = false;
|
|
|
+ },
|
|
|
+ deep:true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteEnter(to, from, next){
|
|
|
+ next(vm => {
|
|
|
+ //const pm = to.param;
|
|
|
+ Object.assign(vm,to.params);
|
|
|
+ vm.inCurrentPage=to.params.currentPage;
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
moduleFormatter(item){
|
|
@@ -134,6 +150,13 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ addCombineField(){
|
|
|
+ const pam = this.searched ? {
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ filter: this.filter
|
|
|
+ } : {currentPage: this.currentPage};
|
|
|
+ this.$router.push({name: 'AddCombineFeild', params: pam});
|
|
|
+ },
|
|
|
toEditField(row,type){
|
|
|
api.getFieldDetail({id:row.id}).then((res)=>{
|
|
|
const {code,data,msg} = res.data;
|
|
@@ -168,11 +191,11 @@
|
|
|
},
|
|
|
getDataList() {
|
|
|
const param = this.getFilterItems();
|
|
|
+ this.searched = true;
|
|
|
api.getFieldList(param).then((res) => {
|
|
|
if (res.data.code == '0') {
|
|
|
const data = res.data.data;
|
|
|
this.list = data.records;
|
|
|
- this.cacheData[param.current] = data.records;
|
|
|
this.total = data.total;
|
|
|
}
|
|
|
}).catch((error) => {
|
|
@@ -181,7 +204,6 @@
|
|
|
},
|
|
|
getFilterItems() {
|
|
|
const param = Object.assign({
|
|
|
- tagTypeList:this.tagType,
|
|
|
current: this.currentPage,
|
|
|
size: this.pageSize
|
|
|
},this.filter);
|
|
@@ -192,11 +214,7 @@
|
|
|
},
|
|
|
currentChange(next) {
|
|
|
this.currentPage = next;
|
|
|
- if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
|
|
|
- this.list = this.cacheData[next];
|
|
|
- } else {
|
|
|
- this.getDataList();
|
|
|
- }
|
|
|
+ this.getDataList();
|
|
|
},
|
|
|
warning(msg,type){
|
|
|
this.$message({
|