Browse Source

feat: 短剧组推广 - 短剧组 - 创建组接口联调

zhengxy 2 years ago
parent
commit
5c54eb6aac

+ 2 - 1
project/src/components/manage/playletManageV2/dialog/groupDialog.vue

@@ -97,6 +97,7 @@ export default {
97 97
     handleInitData() {
98 98
       this.loading = false
99 99
       this.form.name = ''
100
+      this.form.selectedPlayletList = []
100 101
 
101 102
       if (this.selectedPlayletListFromProps) { // 如果外部传入数据有值 => 回显当前已选短剧列表
102 103
         this.form.selectedPlayletList = [
@@ -120,7 +121,7 @@ export default {
120 121
         const { data: res = {} } = await this.$axios.post(url, params)
121 122
         if (res && res.errno == 0) {
122 123
           this.$message.success('操作成功')
123
-          this.$emit('confirm')
124
+          this.$emit('confirm', { isEdit: !!this.group_id })
124 125
         } else if (res.errno != 4002) {
125 126
           this.$message.warning(res.err || '操作失败')
126 127
         }

+ 13 - 1
project/src/components/manage/playletManageV2/dialog/selectPlayletDialog.vue

@@ -272,7 +272,19 @@ export default {
272 272
       }
273 273
     },
274 274
     handleCancel() {
275
-      this.$emit('cancel')
275
+      if (!this.form.selectedPlayletList || !this.form.selectedPlayletList.length) {
276
+        this.$emit('cancel')
277
+      } else {
278
+        this.$confirm('当前已选剧集未保存, 确定关闭吗?', '提示', {
279
+          confirmButtonText: '确定',
280
+          cancelButtonText: '取消',
281
+          type: 'warning'
282
+        }).then(() => {
283
+          this.$emit('cancel')
284
+        }).catch(() => {
285
+          console.log('取消')
286
+        });
287
+      }
276 288
     },
277 289
   },
278 290
 };

+ 8 - 1
project/src/components/manage/playletManageV2/playletGroup.vue

@@ -28,6 +28,7 @@
28 28
 
29 29
     <groupDialog
30 30
       :dialogVisible="groupDialogVisible"
31
+      :group_id="currentGroupId"
31 32
       @confirm="onConfirmGroupDialog"
32 33
       @cancel="onCancelGroupDialog"
33 34
     />
@@ -57,6 +58,7 @@ export default {
57 58
       groupList: [],
58 59
 
59 60
       groupDialogVisible: false,
61
+      currentGroupId: '',
60 62
     }
61 63
   },
62 64
   created () {
@@ -102,6 +104,7 @@ export default {
102 104
     },
103 105
     // 监听点击“创建组”
104 106
     onClickCreateGroup() {
107
+      this.currentGroupId = ''
105 108
       this.groupDialogVisible = true
106 109
     },
107 110
     // 监听点击“编辑组”
@@ -109,7 +112,11 @@ export default {
109 112
       console.log('onClickEditGroup row => ', row)
110 113
       this.groupDialogVisible = true
111 114
     },
112
-    onConfirmGroupDialog() {
115
+    onConfirmGroupDialog({ isEdit }) {
116
+      if (!isEdit){
117
+        this.pagination.page = 1
118
+      }
119
+      this.handleGetGroupList()
113 120
       this.groupDialogVisible = false
114 121
     },
115 122
     onCancelGroupDialog() {