Commit c30a9c2d by xinla

Merge branch 'front_end_dev_2.0' of https://gitee.com/LinkWeChat/link-wechat into front_end_dev_2.0

2 parents c2c7d4cc 466aba7b
......@@ -133,7 +133,6 @@
<el-table-column prop="materialUrl" label="小程序AppID"></el-table-column>
</template>
<el-table-column prop="num" label="发送次数"></el-table-column>
<el-table-column prop="updateTime" label="最近更新时间"></el-table-column>
</el-table>
......
......@@ -14,6 +14,10 @@ export default {
type: String,
default: '选择标签'
},
// selected: {
// type: Array,
// default: () => [],
// },
// "标签分组类型(1:客户标签;2:群标签)"
type: {
type: String,
......@@ -156,7 +160,13 @@ export default {
</div>
</el-dialog>
</template>
<style>
.el-tag.el-tag--info {
background-color: #f4f4f5;
border-color: #e9e9eb;
color: #909399;
}
</style>
<style lang="scss" scoped>
.user-list {
.el-row {
......
......@@ -86,6 +86,32 @@
created () { },
mounted () { },
methods: {
treeFormat (list) {
let dealOptions = []
list.forEach(one => {
let findIndex = list.findIndex(item => {
return item.id === one.parentId
})
if ((!one.parentId && one.parentId !== 0 && one.parentId !== false) || findIndex === -1) {
dealOptions.push(one)
} else {
if (!list[findIndex].children) {
list[findIndex].children = []
list[findIndex].children.push(one)
} else {
list[findIndex].children.push(one)
}
}
})
return dealOptions
},
setData () {
if (this.$refs.tree) this.$refs.tree.setCheckedKeys([])
this.userList.forEach(dd => {
this.$refs.tree.setCheckedKeys([dd.userId])
})
this.$forceUpdate()
},
loadNode (node, resolve) {
if (node.level === 0) {
if (!Array.isArray(this.defaultValues) ||
......@@ -98,7 +124,7 @@
// element.key = createUniqueString()
// })
let _data = this.handleTree(data)
resolve(_data)
resolve(this.treeFormat(_data))
// api.getList({ department: _data[0].id }).then(({ rows, total }) => {
// _data && rows.unshift(..._data);
// resolve(rows);
......@@ -112,6 +138,8 @@
// })
node.data.children && rows.push(...node.data.children)
resolve(rows)
console.log(222)
this.setData()
}
)
}
......@@ -129,10 +157,10 @@
handleCheckChange (data, checked, indeterminate) {
// console.log(arguments)
if (checked) {
if (this.isSigleSelect) {
// 单选情况
this.$refs.tree.setCheckedKeys([data.userId])
}
// if (this.isSigleSelect) {
// // 单选情况
// this.$refs.tree.setCheckedKeys([data.userId])
// }
if (this.isOnlyLeaf) {
if (data.userId && !data.isParty) {
this.userList.push(data)
......@@ -146,6 +174,7 @@
let index = this.userList.findIndex(i => i.userId === data.userId)
index > -1 && this.userList.splice(index, 1)
}
this.setData()
// console.log(data, checked, indeterminate);
},
// 确 定
......@@ -160,6 +189,7 @@
index > -1 && this.userList.splice(index, 1)
let order = this.defaultValues.findIndex(i => i.userId === key)
order > -1 && this.defaultValues.splice(order, 1)
this.setData()
},
},
}
......
......@@ -265,11 +265,11 @@
onSelectUser () {
this.selectedUserList = []
let arr = []
if (this.form.users) {
arr = this.form.users.map((dd) => {
if (this.form.userIds) {
arr = this.form.userIds.split(',').map((dd, index) => {
return {
userId: dd.useUserId,
name: dd.useUserName
userId: dd,
name: this.form.userNames.split(',')[index]
}
})
}
......
......@@ -222,7 +222,7 @@
upload(this.toFormData(obj))
.then((res) => {
if (res.code === 200) {
this.msgSuccess('导入成功!')
this.msgSuccess(res.msg)
this.form = {
file: {},
customerSeasTags: [],
......
......@@ -246,6 +246,10 @@
},
created () {
let id = this.$route.query.id
let groupId = this.$route.query.groupId
if (groupId) {
this.baseForm.qrGroupId = groupId
}
this.getCodeCategoryList()
if (id) {
this.title = '编辑'
......@@ -463,28 +467,6 @@
}
this.codeForm.qrType = base.type
this.codeForm.qrRuleType = base.ruleType
// if (this.codeForm.qrRuleType === 1) {
// let obj = {
// type: 1,
// userIds: this.codeForm.weEmpleCodeUseScops.map(dd => dd.businessId)
// }
// this.codeForm.qrUserInfos = [obj]
// } else {
// this.codeForm.qrUserInfos = []
// this.codeForm.empleCodeRosterDto.forEach(fff => {
// let obj = {
// type: fff.type,
// beginTime: fff.startDate,
// endTime: fff.endDate,
// userIds: fff.weEmpleCodeUseScops.map(dd => dd.businessId),
// workCycle: fff.weekday
// }
// this.codeForm.qrUserInfos.push(obj)
// })
// }
if (base.ruleType === 1) {
let arr = []
base.qrUserInfos[0].weQrUserList.forEach(dd => {
......@@ -508,13 +490,12 @@
weEmpleCodeUseScops: dd.weQrUserList.map(ff => { return { businessId: ff.userId, businessName: ff.userName } })
}
arr.push(obj)
console.log(obj)
})
this.codeForm.empleCodeRosterDto = arr
}
this.materialData = {
welcomeMsg: base.qrAttachments ? base.qrAttachments[0].content : '',
materialMsgList: base.qrAttachments ? base.qrAttachments.slice(1) : []
materialMsgList: base.qrAttachments ? this.setEditList(base.qrAttachments.slice(1)) : []
}
// this.materialData.materialMsgList.forEach(ddd => {
// ddd.msgType = Number(ddd.msgType)
......@@ -522,7 +503,37 @@
this.loading = false
})
},
setEditList (list) {
let arr = []
if (list && list.length) {
list.forEach(dd => {
if (dd.msgType === 'image') {
let obj = {
msgType: '0',
materialUrl: dd.picUrl
}
arr.push(obj)
} else if (dd.msgType === 'link') {
let ob = {
msgType: '7',
materialName: dd.title,
content: dd.linkUrl
}
arr.push(ob)
} else if (dd.msgType === 'miniprogram') {
let ff = {
msgType: '8',
materialUrl: dd.appId,
materialName: dd.title,
coverUrl: dd.picUrl,
content: dd.linkUrl
}
arr.push(ff)
}
})
}
return arr
},
// 获取活码分组
getCodeCategoryList () {
getCodeCategoryList({ mediaType: 6 }).then(res => {
......@@ -621,14 +632,46 @@
tagName: d.name,
}))
},
resetData (list) {
let arr = []
if (list && list.length) {
list.forEach(dd => {
if (dd.msgType === '0') {
let obj = {
msgType: 'image',
picUrl: dd.materialUrl
}
arr.push(obj)
} else if (dd.msgType === '7') {
let ob = {
msgType: 'link',
title: dd.materialName,
linkUrl: dd.content
}
arr.push(ob)
} else if (dd.msgType === '8') {
let ff = {
msgType: 'miniprogram',
appId: dd.materialUrl,
title: dd.materialName,
picUrl: dd.coverUrl,
linkUrl: dd.content
}
arr.push(ff)
}
})
}
return arr
},
submit (data) {
let list = this.resetData(data.materialMsgList)
let myObj = {
attachments: [{
content: data.welcomeMsg,
msgType: 'text'
}]
}
myObj.attachments.push(...data.materialMsgList)
myObj.attachments.push(...list)
if (this.codeForm.qrRuleType === 1) {
let obj = {
type: 0,
......
......@@ -243,7 +243,7 @@
this.form = res.data
if (this.form.qrAttachments && this.form.qrAttachments.length) {
this.form.welcomeMsg = this.form.qrAttachments[0].content
this.form.materialMsgList = this.form.qrAttachments.slice(1)
this.form.materialMsgList = this.setEditList(this.form.qrAttachments.slice(1))
}
this.form.qrUserInfos.forEach(dd => {
if (dd.workCycle) {
......@@ -256,6 +256,37 @@
this.setTime(7)
})
},
setEditList (list) {
let arr = []
if (list && list.length) {
list.forEach(dd => {
if (dd.msgType === 'image') {
let obj = {
msgType: '0',
materialUrl: dd.picUrl
}
arr.push(obj)
} else if (dd.msgType === 'link') {
let ob = {
msgType: '7',
materialName: dd.title,
content: dd.linkUrl
}
arr.push(ob)
} else if (dd.msgType === 'miniprogram') {
let ff = {
msgType: '8',
materialUrl: dd.appId,
materialName: dd.title,
coverUrl: dd.picUrl,
content: dd.linkUrl
}
arr.push(ff)
}
})
}
return arr
},
getList () {
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
......
......@@ -300,7 +300,7 @@
this.search()
},
goRoute (path, id) {
this.$router.push({ path: path, query: { id } })
this.$router.push({ path: path, query: { id, groupId: this.query.groupId } })
},
// 多选框选中数据
handleSelectionChange (selection) {
......
......@@ -79,6 +79,8 @@
pageSize: 10,
welcomeMsg: undefined,
welcomeMsgTplType: 1,
orderByColumn: 'create_time',
isAsc: 'desc'
},
loading: false,
total: 0,
......
......@@ -42,6 +42,8 @@
</el-table-column>
<el-table-column label="发送时间" align="center" prop="sendTime" width="180">
</el-table-column>
<el-table-column label="最近更新时间" align="center" prop="createTime" width="180">
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<!-- v-hasPermi="['enterpriseWechat:view']" -->
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!