|
@@ -33,29 +33,34 @@
|
33
|
33
|
<div class="group_item" style="align-items: baseline;margin-top: 10px">
|
34
|
34
|
<div class="lable">标签名称:</div>
|
35
|
35
|
<div class="opaArea">
|
36
|
|
- <div v-for="(m,mIdx) in moreLable" :key="m.id" class="flex">
|
37
|
|
- <el-input class="ipt_group tMar10" v-model="m.name" placeholder="请输入标签名称"></el-input>
|
|
36
|
+ <div v-for="(m,mIdx) in moreLable" :key="m.tag_id" class="flex">
|
|
37
|
+ <el-input class="ipt_group tMar10" v-model="m.tag_name" placeholder="请输入标签名称"></el-input>
|
38
|
38
|
<span v-if="moreLable&&moreLable.length>1" class="flex">
|
39
|
|
- <el-tooltip effect="light" content="删除该标签" placement="top-start">
|
|
39
|
+ <el-tooltip effect="light" content="删除该标签" placement="left">
|
40
|
40
|
<span class="minusIptGroup" @click="moreLable.splice(mIdx,1)">-</span>
|
41
|
41
|
</el-tooltip>
|
42
|
42
|
<img src="../../assets/img/upNone.png" alt="" v-if="mIdx == 0" style="width: 20px;margin: 0 8px;cursor: pointer">
|
43
|
|
- <el-tooltip effect="light" content="上移" placement="top-start">
|
|
43
|
+ <el-tooltip effect="light" content="上移" placement="left">
|
44
|
44
|
<img src="../../assets/img/up.png" alt="" v-if="mIdx > 0" @click="upClick(mIdx)" style="width: 20px;margin: 0 8px;cursor: pointer">
|
45
|
45
|
</el-tooltip>
|
46
|
46
|
<img src="../../assets/img/downNone.png" alt="" v-if="mIdx == moreLable.length-1" style="width: 20px;cursor: pointer">
|
47
|
|
- <el-tooltip effect="light" content="下移" placement="top-start">
|
|
47
|
+ <el-tooltip effect="light" content="下移" placement="left">
|
48
|
48
|
<img src="../../assets/img/down.png" alt="" v-if="mIdx < moreLable.length-1" @click="downClick(mIdx)" style="width: 20px;cursor: pointer">
|
49
|
49
|
</el-tooltip>
|
50
|
50
|
</span>
|
51
|
51
|
</div>
|
52
|
|
- <div class="addIptGroup" @click="moreLable.push({id:moreLable.length,name:''})">+ 添加标签</div>
|
|
52
|
+ <div class="addIptGroup" @click="moreLable.push({tag_id:moreLable.length,tag_name:''})">+ 添加标签</div>
|
53
|
53
|
</div>
|
54
|
54
|
</div>
|
55
|
55
|
</div>
|
56
|
56
|
<div slot="footer">
|
57
|
|
- <el-button size="mini" @click="lableGroup = false">取 消</el-button>
|
58
|
|
- <el-button size="mini" type="primary" @click="addTagGroup()">确 定</el-button>
|
|
57
|
+ <div class="flex">
|
|
58
|
+ <div class="f14 c-00B38A pointer" @click="deleTagGroup()" v-if="source == 'edit'">删除该标签组</div>
|
|
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>
|
|
62
|
+ </div>
|
|
63
|
+ </div>
|
59
|
64
|
</div>
|
60
|
65
|
</el-dialog>
|
61
|
66
|
</template>
|
|
@@ -68,11 +73,81 @@ export default {
|
68
|
73
|
return{
|
69
|
74
|
lableGroup:false,
|
70
|
75
|
groupName:'',
|
71
|
|
- moreLable:[{id:0,name:''}],//添加标签组时,新增标签的数据列表,传给后台
|
|
76
|
+ groupId:'',
|
|
77
|
+ moreLable:[{tag_id:0,tag_name:''}],//添加标签组时,新增标签的数据列表,传给后台
|
72
|
78
|
}
|
73
|
79
|
},
|
74
|
80
|
methods:{
|
|
81
|
+ deleTagGroup(){
|
|
82
|
+ this.$confirm('是否删除该标签组?', '提示', {
|
|
83
|
+ confirmButtonText: '确定',
|
|
84
|
+ cancelButtonText: '取消',
|
|
85
|
+ type: 'warning'
|
|
86
|
+ }).then(() => {
|
|
87
|
+ this.$axios.post(this.URL.BASEURL + this.URL.dele_tag_group, {
|
|
88
|
+ group_id: this.groupId
|
|
89
|
+ }).then((res) => {
|
|
90
|
+ var res = res.data
|
|
91
|
+ if (res && res.errno == 0) {
|
|
92
|
+ this.lableGroup = false
|
|
93
|
+ this.$parent.init(1)
|
|
94
|
+ }
|
|
95
|
+ this.$message({
|
|
96
|
+ message: res.err,
|
|
97
|
+ type: "warning"
|
|
98
|
+ })
|
|
99
|
+ })
|
|
100
|
+ })
|
|
101
|
+ },
|
|
102
|
+ editTagGroup(){
|
|
103
|
+ if(this.groupName==''){
|
|
104
|
+ this.$message({
|
|
105
|
+ message: '标签组名称不能为空',
|
|
106
|
+ type: "warning"
|
|
107
|
+ })
|
|
108
|
+ return false
|
|
109
|
+ }
|
|
110
|
+ this.moreLable.forEach(m=>{
|
|
111
|
+ if(m.tag_name==''){
|
|
112
|
+ this.$message({
|
|
113
|
+ message: '标签名称不能为空',
|
|
114
|
+ type: "warning"
|
|
115
|
+ })
|
|
116
|
+ return false
|
|
117
|
+ }
|
|
118
|
+ })
|
|
119
|
+ this.$axios.post(this.URL.BASEURL + this.URL.edit_tag_group, {
|
|
120
|
+ group_name: this.groupName,
|
|
121
|
+ tag_list:this.moreLable
|
|
122
|
+ }).then((res) => {
|
|
123
|
+ var res = res.data
|
|
124
|
+ if (res && res.errno == 0) {
|
|
125
|
+ this.lableGroup = false
|
|
126
|
+ this.$parent.init(1)
|
|
127
|
+ }
|
|
128
|
+ this.$message({
|
|
129
|
+ message: res.err,
|
|
130
|
+ type: "warning"
|
|
131
|
+ })
|
|
132
|
+ })
|
|
133
|
+ },
|
75
|
134
|
addTagGroup(){
|
|
135
|
+ if(this.groupName==''){
|
|
136
|
+ this.$message({
|
|
137
|
+ message: '标签组名称不能为空',
|
|
138
|
+ type: "warning"
|
|
139
|
+ })
|
|
140
|
+ return false
|
|
141
|
+ }
|
|
142
|
+ this.moreLable.forEach(m=>{
|
|
143
|
+ if(m.tag_name==''){
|
|
144
|
+ this.$message({
|
|
145
|
+ message: '标签名称不能为空',
|
|
146
|
+ type: "warning"
|
|
147
|
+ })
|
|
148
|
+ return false
|
|
149
|
+ }
|
|
150
|
+ })
|
76
|
151
|
this.$axios.post(this.URL.BASEURL + this.URL.add_tag_group, {
|
77
|
152
|
group_name: this.groupName,
|
78
|
153
|
tag_list:this.moreLable
|
|
@@ -172,7 +247,7 @@ export default {
|
172
|
247
|
align-items: center;
|
173
|
248
|
margin-top: 20px;
|
174
|
249
|
.lable{
|
175
|
|
- width: 24%;
|
|
250
|
+ width: 19%;
|
176
|
251
|
text-align: right;
|
177
|
252
|
}
|
178
|
253
|
.opaArea{
|