|
@@ -5,7 +5,7 @@
|
5
|
5
|
:append-to-body="true"
|
6
|
6
|
class="addLable_dialog"
|
7
|
7
|
width="40%">
|
8
|
|
- <div class="groupCon">
|
|
8
|
+ <div class="groupCon" v-loading="loading">
|
9
|
9
|
<div class="group_item">
|
10
|
10
|
<div class="lable">标签组名称:</div>
|
11
|
11
|
<div class="opaArea">
|
|
@@ -57,8 +57,8 @@
|
57
|
57
|
<div class="flex">
|
58
|
58
|
<div class="f14 c-00B38A pointer" @click="deleTagGroup()" v-if="source == 'edit'">删除该标签组</div>
|
59
|
59
|
<div class="lMarauto">
|
60
|
|
- <el-button size="mini" @click="lableGroup = false">取 消</el-button>
|
61
|
|
- <el-button size="mini" type="primary" @click="source == 'add' ? addTagGroup() : editTagGroup()">确 定</el-button>
|
|
60
|
+ <el-button :disabled="loading" size="mini" @click="lableGroup = false">取 消</el-button>
|
|
61
|
+ <el-button :disabled="loading" size="mini" type="primary" @click="source == 'add' ? addTagGroup() : editTagGroup()">确 定</el-button>
|
62
|
62
|
</div>
|
63
|
63
|
</div>
|
64
|
64
|
</div>
|
|
@@ -72,6 +72,7 @@ export default {
|
72
|
72
|
data(){
|
73
|
73
|
return{
|
74
|
74
|
lableGroup:false,
|
|
75
|
+ loading:false,
|
75
|
76
|
groupName:'',
|
76
|
77
|
groupId:'',
|
77
|
78
|
moreLable:[{tag_id:0,tag_name:''}],//添加标签组时,新增标签的数据列表,传给后台
|
|
@@ -84,6 +85,7 @@ export default {
|
84
|
85
|
cancelButtonText: '取消',
|
85
|
86
|
type: 'warning'
|
86
|
87
|
}).then(() => {
|
|
88
|
+ this.loading = true
|
87
|
89
|
this.$axios.post(this.URL.BASEURL + this.URL.dele_tag_group, {
|
88
|
90
|
group_id: this.groupId
|
89
|
91
|
}).then((res) => {
|
|
@@ -96,6 +98,13 @@ export default {
|
96
|
98
|
message: res.err,
|
97
|
99
|
type: "warning"
|
98
|
100
|
})
|
|
101
|
+ this.loading = false
|
|
102
|
+ }).catch(err=>{
|
|
103
|
+ this.$message({
|
|
104
|
+ message: '服务故障,请稍候再试',
|
|
105
|
+ type: "warning"
|
|
106
|
+ })
|
|
107
|
+ this.loading = false
|
99
|
108
|
})
|
100
|
109
|
})
|
101
|
110
|
},
|
|
@@ -107,17 +116,24 @@ export default {
|
107
|
116
|
})
|
108
|
117
|
return false
|
109
|
118
|
}
|
|
119
|
+ let tagFlag=false
|
110
|
120
|
this.moreLable.forEach(m=>{
|
111
|
121
|
if(m.tag_name==''){
|
112
|
122
|
this.$message({
|
113
|
123
|
message: '标签名称不能为空',
|
114
|
124
|
type: "warning"
|
115
|
125
|
})
|
|
126
|
+ tagFlag = true
|
116
|
127
|
return false
|
117
|
128
|
}
|
118
|
129
|
})
|
|
130
|
+ if(tagFlag){
|
|
131
|
+ return false
|
|
132
|
+ }
|
|
133
|
+ this.loading = true
|
119
|
134
|
this.$axios.post(this.URL.BASEURL + this.URL.edit_tag_group, {
|
120
|
135
|
group_name: this.groupName,
|
|
136
|
+ // group_id: this.groupId,
|
121
|
137
|
tag_list:this.moreLable
|
122
|
138
|
}).then((res) => {
|
123
|
139
|
var res = res.data
|
|
@@ -129,9 +145,16 @@ export default {
|
129
|
145
|
message: res.err,
|
130
|
146
|
type: "warning"
|
131
|
147
|
})
|
|
148
|
+ this.loading = false
|
|
149
|
+ }).catch(err=>{
|
|
150
|
+ this.$message({
|
|
151
|
+ message: '服务故障,请稍候再试',
|
|
152
|
+ type: "warning"
|
|
153
|
+ })
|
|
154
|
+ this.loading = false
|
132
|
155
|
})
|
133
|
156
|
},
|
134
|
|
- addTagGroup(){
|
|
157
|
+ addTagGroup(){ //
|
135
|
158
|
if(this.groupName==''){
|
136
|
159
|
this.$message({
|
137
|
160
|
message: '标签组名称不能为空',
|
|
@@ -139,15 +162,21 @@ export default {
|
139
|
162
|
})
|
140
|
163
|
return false
|
141
|
164
|
}
|
|
165
|
+ let tagFlag=false
|
142
|
166
|
this.moreLable.forEach(m=>{
|
143
|
167
|
if(m.tag_name==''){
|
144
|
168
|
this.$message({
|
145
|
169
|
message: '标签名称不能为空',
|
146
|
170
|
type: "warning"
|
147
|
171
|
})
|
|
172
|
+ tagFlag = true
|
148
|
173
|
return false
|
149
|
174
|
}
|
150
|
175
|
})
|
|
176
|
+ if(tagFlag){
|
|
177
|
+ return false
|
|
178
|
+ }
|
|
179
|
+ this.loading = true
|
151
|
180
|
this.$axios.post(this.URL.BASEURL + this.URL.add_tag_group, {
|
152
|
181
|
group_name: this.groupName,
|
153
|
182
|
tag_list:this.moreLable
|
|
@@ -161,6 +190,13 @@ export default {
|
161
|
190
|
message: res.err,
|
162
|
191
|
type: "warning"
|
163
|
192
|
})
|
|
193
|
+ this.loading = false
|
|
194
|
+ }).catch(err=>{
|
|
195
|
+ this.$message({
|
|
196
|
+ message: '服务故障,请稍候再试',
|
|
197
|
+ type: "warning"
|
|
198
|
+ })
|
|
199
|
+ this.loading = false
|
164
|
200
|
})
|
165
|
201
|
},
|
166
|
202
|
// 上移
|