shish 2 سال پیش
والد
کامیت
022d30bff9
2فایلهای تغییر یافته به همراه10 افزوده شده و 17 حذف شده
  1. 3 5
      pt/src/views/cp/cp-class.vue
  2. 7 12
      pt/src/views/cp/list.vue

+ 3 - 5
pt/src/views/cp/cp-class.vue

@@ -70,11 +70,9 @@ export default {
 		handleClick(tab, e) {
 			this.app.refresh({ type: this.tabIndex });
 		},
-		getCpList(data) {
-			let query = {};
-			query.catId = data.id
-			query.tabName = data.name
-			this.$router.push({ path: '/item-cat-relate/list', query });
+		getCpList(info) {
+			let query = {classId:info.id,className:info.name};
+			this.$router.push({ path: '/cp/list', query });
 		},
 		onLoad({ ctx, app }) {
 			this.app = app;

+ 7 - 12
pt/src/views/cp/list.vue

@@ -42,7 +42,7 @@
 			</template>
 
 			<template #slot-cp-class="{scope}">
-				<el-select size="mini" v-model="currentCpClassId" placeholder="请选分类" style="width:150px;margin-right:10px;" @change="getCpClass">
+				<el-select size="mini" v-model="currentCpClassId" placeholder="请选分类" style="width:150px;margin-right:10px;" @change="getCpClass" clearable>
 					<el-option v-for="item in cpClassData" :key="item.value" :label="item.name" :value="item.id"> </el-option>
 				</el-select>				
 			</template>
@@ -131,12 +131,8 @@ export default {
 		},
 		onLoad({ ctx, app }) {
 			this.app = app;
-			if (this.$route.query.catId) {
-				this.catId = this.$route.query.catId;
-				if (this.$route.query.name != '') {
-					this.tabsData[0].text = this.$route.query.tabName;
-					this.$forceUpdate();
-				}
+			if (this.$route.query.classId) {
+				this.currentCpClassId = this.$route.query.classId
 			}
 			ctx.service(this.$service.cp)
 				.set('table', {
@@ -224,12 +220,11 @@ export default {
 					['flex1', 'pagination'],
 				])
 				.done();
-				app.refresh({ classStyle:this.classStyle,classId:this.currentCpClassId })
-
-				this.$service.cpClass.getMenu().then(res=>{
-					this.cpClassData = res.list ? res.list : []
-				})
+			app.refresh({ classStyle:this.classStyle,classId:this.currentCpClassId })
 
+			this.$service.cpClass.getMenu().then(res=>{
+				this.cpClassData = res.list ? res.list : []
+			})
 		},
 		showSort(e) {
 			this.sort.status = true;