Commit 06d943e3 authored by Mac's avatar Mac

标签处理

parent 2a921c99
......@@ -20,7 +20,7 @@ export default {
</script>
<style>
@import url("//at.alicdn.com/t/font_2077629_yt6s3mpdrdj.css");
@import url("//at.alicdn.com/t/font_2077629_ltga4el15kc.css");
.q-scrollarea__thumb {
z-index: 999999 !important;
}
......
......@@ -318,6 +318,18 @@ export function SetSynvEduEmployee(data) {
})
}
/**
* 初始化同步企业微信标签
*
*/
export function setSyncWeChatLable(data) {
return request({
url: '/QYWeChat/SetSyncWeChatLable',
method: 'post',
data
})
}
......
......@@ -18,6 +18,11 @@
<template v-slot:top="props">
<div class="col-2 q-table__title"></div>
<q-space />
<q-btn color="accent" style="float:right;margin-right:10px;" size="sm" class="q-mr-md"
@click="synchronisation()">
<i class="iconfont icon-tongbu"></i>
<div style="margin-left: 5px;">同步企业微信标签</div>
</q-btn>
<q-btn color="accent" style="float:right;margin-right:0;" size="sm" class="q-mr-md" icon="add"
label="添加标签组" @click="EditCategory()"></q-btn>
</template>
......@@ -36,22 +41,25 @@
<q-td :props="props">
<div style="display: flex;flex-wrap: wrap;max-width: 1200px;">
<div v-for="(x,y) in props.row.ChildList" :key='y' style="margin: 5px;">
<q-btn-group >
<q-btn-dropdown auto-close rounded :label="x.Name" split>
<!-- dropdown content goes here -->
<q-list padding style="width: 100px;display: flex;align-items: center;background-color: #3FC4FF;justify-content: center;">
<!-- <q-btn flat style="color: #3FC4FF" icon="edit" @click="getParent(x,2)" size="xs" />
<q-btn-group>
<q-btn-dropdown auto-close rounded :label="x.Name" split>
<!-- dropdown content goes here -->
<q-list padding
style="width: 100px;display: flex;align-items: center;background-color: #3FC4FF;justify-content: center;">
<!-- <q-btn flat style="color: #3FC4FF" icon="edit" @click="getParent(x,2)" size="xs" />
<q-btn flat style="color: #FF0080" icon="delete" @click="goDetailed(x)" size="xs"/> -->
<q-btn flat style="color: white" icon="edit" @click="getParent(x,2)" size="xs" />
<q-btn flat style="color: white" icon="delete" @click="goDetailed(x)" size="xs"/>
</q-list>
</q-btn-dropdown>
</q-btn-group>
<q-btn flat style="color: white" icon="edit" @click="getParent(x,2)"
size="xs" />
<q-btn flat style="color: white" icon="delete" @click="goDetailed(x)"
size="xs" />
</q-list>
</q-btn-dropdown>
</q-btn-group>
</div>
<q-btn flat size="sm" icon="add" style="font-weight:400;color: #3FC4FF;margin-top: 10px;"
label="添加标签" @click="getParent(props.row,3)" />
label="添加标签" @click="getParent(props.row,3)" />
</div>
</q-td>
......@@ -92,12 +100,12 @@
<div class="col row wrap q-mr-lg q-col-gutter-md" v-for="(x,y) in addMsg.ChildList" :key='y'
style="margin-top: 0px;">
<div class="col-7">
<q-input filled clearable standout="bg-primary text-white" v-model="x.Name" label="输入标签名称"
maxlength="20" />
<q-input filled clearable standout="bg-primary text-white" v-model="x.Name"
label="输入标签名称" maxlength="20" />
</div>
<div class="col-3">
<q-input filled standout="bg-primary text-white" v-model="x.Sort" label="输入排序" maxlength="20"
type="number" />
<q-input filled standout="bg-primary text-white" v-model="x.Sort" label="输入排序"
maxlength="20" type="number" />
</div>
<div class="col-2">
<q-btn flat icon="delete" color="negative" class="q-mr-xs" label=""
......@@ -112,7 +120,7 @@
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="isShow = false" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="submit()" :loading="btnloading"/>
<q-btn color="accent" class="q-mr-md" label="确定" @click="submit()" :loading="btnloading" />
</q-card-actions>
</q-card>
</q-dialog>
......@@ -125,7 +133,7 @@
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none" style="margin-top: 15px;padding: 20px;" >
<q-card-section class="q-pt-none" style="margin-top: 15px;padding: 20px;">
<q-input filled clearable standout="bg-primary text-white" v-model="addMsg.Name" label="标签组名称"
:rules="[val => !!val || '请输入分组名称']" ref="eName" />
......@@ -136,7 +144,7 @@
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="isParent = false" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="submitParent()" :loading="btnloading"/>
<q-btn color="accent" class="q-mr-md" label="确定" @click="submitParent()" :loading="btnloading" />
</q-card-actions>
</q-card>
</q-dialog>
......@@ -147,14 +155,19 @@
import {
getWeChatLableList,
setWeChatLable,
delWeChatLable
delWeChatLable,
setSyncWeChatLable
} from '../../api/system/wechat';
import {
Loading,
QSpinnerPie
} from 'quasar'
const addobj = {
Id: 0,
ParentId: 0,
Name: '',
Sort: 1,
ChildList: [{Name: '',Sort: 0, }],
ChildList: [{ Name: '', Sort: 1, }],
}
export default {
meta: {
......@@ -200,7 +213,8 @@
],
addMsg: Object.assign({}, addobj),
edittype:1,
edittype: 1,
isalladopt: true,
}
},
......@@ -261,10 +275,10 @@
//新增修改课程系列
EditCategory() {
this.addMsg = Object.assign({}, addobj)
this.addMsg.ChildList=[{Name: '',Sort: 0, }]
this.addMsg.ChildList = [{ Name: '', Sort: 1, }]
this.isShow = true;
},
isChildList(){
isChildList() {
let isName = false;
let issort = false;
if (this.addMsg.ChildList.length > 0) {
......@@ -274,6 +288,7 @@
return
}
if (x.Sort == '') {
console.log(x.Sort)
issort = true;
return
}
......@@ -285,6 +300,7 @@
message: `请填写标签名称`,
position: 'top'
})
this.isalladopt = false
return
}
if (issort == true) {
......@@ -293,45 +309,49 @@
message: `请填写标签排序`,
position: 'top'
})
this.isalladopt = false
return
}
},
submit() {
this.isalladopt = true
this.$refs.Name.validate();
this.$refs.Sort.validate();
this.isChildList()
if (!this.$refs.Name.hasError && !this.$refs.Sort.hasError) {
this.setlable(this.addMsg)
if (this.isalladopt == true) {
this.setlable(this.addMsg)
}
}
},
submitParent(){
this.$refs.eName.validate();
this.$refs.eSort.validate();
if (!this.$refs.eName.hasError && !this.$refs.eSort.hasError) {
let msg
if(this.edittype ==1){
msg ={
Id:this.addMsg.Id,
Name:this.addMsg.Name,
Sort:this.addMsg.Sort,
}
}else {
msg ={
Name:this.addMsg.Name,
Sort:this.addMsg.Sort,
Id:this.addMsg.Id,
ParentId:this.addMsg.ParentId,
}
}
this.setlable(msg)
submitParent() {
this.$refs.eName.validate();
this.$refs.eSort.validate();
if (!this.$refs.eName.hasError && !this.$refs.eSort.hasError) {
let msg
if (this.edittype == 1) {
msg = {
Id: this.addMsg.Id,
Name: this.addMsg.Name,
Sort: this.addMsg.Sort,
}
} else {
msg = {
Name: this.addMsg.Name,
Sort: this.addMsg.Sort,
Id: this.addMsg.Id,
ParentId: this.addMsg.ParentId,
}
}
this.setlable(msg)
}
},
setlable(msg) {
this.btnloading = true
......@@ -352,29 +372,51 @@
}
})
},
getParent(row,type) {
if(type==1){
getParent(row, type) {
if (type == 1) {
this.addMsg = JSON.parse(JSON.stringify(row))
}else if(type==2){
this.addMsg={
ParentId:row.ParentId,
Name:row.Name,
Id:row.Id,
Sort:row.Sort,
} else if (type == 2) {
this.addMsg = {
ParentId: row.ParentId,
Name: row.Name,
Id: row.Id,
Sort: row.Sort,
}
}else{
this.addMsg={
ParentId:row.Id,
Name:'',
Id:0,
Sort:'0',
} else {
this.addMsg = {
ParentId: row.Id,
Name: '',
Id: 0,
Sort: '1',
}
}
this.isParent = true;
this.edittype=type
this.edittype = type
},
synchronisation() {//同步
Loading.show({
message: '数据正在同步中,请稍后进入企业微信查看',
spinner: QSpinnerPie
})
setSyncWeChatLable({}).then(res => {
if (res.Code == 1) {
that.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
Loading.hide()
}
})
.catch(err => {
Loading.hide()
})
},
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment