Commit 06d943e3 authored by Mac's avatar Mac

标签处理

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