|
@@ -170,8 +170,8 @@ export default {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
- getDataList() {
|
|
|
- const param = this.getFilterItems();
|
|
|
+ getDataList(isTurnPage) {
|
|
|
+ const param = this.getFilterItems(isTurnPage);
|
|
|
this.searched = true;
|
|
|
api.getTagList(param).then((res) => {
|
|
|
const list = res.data.data.records
|
|
@@ -236,14 +236,18 @@ export default {
|
|
|
},
|
|
|
currentChange(next) {
|
|
|
this.currentPage = next;
|
|
|
- this.getDataList();
|
|
|
+ this.getDataList(true);
|
|
|
// if (this.cacheData[next]) { //如果已请求过该页数据,则使用缓存不重复请求
|
|
|
// this.list = this.cacheData[next];
|
|
|
// } else {
|
|
|
// this.getDataList();
|
|
|
// }
|
|
|
},
|
|
|
- getFilterItems() {
|
|
|
+ getFilterItems(isTurnPage) {
|
|
|
+ //翻页时筛选条件没点确定则清空
|
|
|
+ if(isTurnPage&&!this.searched){
|
|
|
+ this.clearFilter();
|
|
|
+ };
|
|
|
const param = {
|
|
|
tagTypeList: this.filter.tagType[0] && this.filter.tagType|| this.tagTypesList,
|
|
|
current: this.currentPage,
|
|
@@ -275,17 +279,20 @@ export default {
|
|
|
resolve();
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
+ clearFilter(){
|
|
|
+ this.filter={
|
|
|
+ tagType: [], //标签类型
|
|
|
+ tagAdscription: '', //标签归属
|
|
|
+ tagSysName: '', //标签系统名称
|
|
|
+ };
|
|
|
+ },
|
|
|
showDelDialog(id,type){
|
|
|
this.showConfirmDialog('是否删除该标签组?',()=>{
|
|
|
api.deleteTagGroup({ids:id,type:type}).then((res)=>{
|
|
|
if(res.data.code=='0'){
|
|
|
if(!this.searched){
|
|
|
//未点确认时清空搜索条件
|
|
|
- this.filter={
|
|
|
- tagType: [], //标签类型
|
|
|
- tagAdscription: '', //标签归属
|
|
|
- tagSysName: '', //标签系统名称
|
|
|
- };
|
|
|
+ this.clearFilter();
|
|
|
}
|
|
|
if(this.list.length==1){
|
|
|
//当前在最后一页且只有一条数据时,删除后跳到前一页
|