Commit f2507b68 by cwq0219

Merge branch 'v1.0.2' of http://192.168.3.233:8090/saas/scrm-micro-marketing into v1.0.2

2 parents b02050f7 085db1d3
...@@ -56,6 +56,16 @@ const listDepartmentTree = params => { ...@@ -56,6 +56,16 @@ const listDepartmentTree = params => {
}) })
} }
const findLordGroup = params => {
params.method = 'entmicro.api.staff.findLordGroup'
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const querylabeltree = params => { const querylabeltree = params => {
params.method = 'scrm.api.datahub.label.querylabeltree' params.method = 'scrm.api.datahub.label.querylabeltree'
return http({ return http({
...@@ -220,6 +230,87 @@ const nameVaild = params => { ...@@ -220,6 +230,87 @@ const nameVaild = params => {
sign: true sign: true
}) })
} }
const getStatus = params => {
params.method = 'scrm.api.work.wechat.access.status'
return http({
url: '/rop-scrm-wechat/router',
method: 'POST',
data: params,
sign: true
})
}
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const templateDetail = params => {
params.method = `${path}template.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const groupDetailUpdate = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
const followerType = params => {
params.method = 'entmicro.api.staff.listEntFollowerType'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
customerList, customerList,
customerGroupList, customerGroupList,
...@@ -242,5 +333,14 @@ export default { ...@@ -242,5 +333,14 @@ export default {
getCoupon, getCoupon,
getPackage, getPackage,
getActivity, getActivity,
nameVaild nameVaild,
getStatus,
templatePage,
templateSave,
templateUpdate,
createdNameList,
templateDetail,
groupDetailUpdate,
findLordGroup,
followerType
} }
...@@ -13,11 +13,11 @@ import { Http } from 'glsx-common' ...@@ -13,11 +13,11 @@ import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function (isEnv = true) {
// console.log(1111111) // console.log(1111111)
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
//return window.fetch('https://', {}).then(res => res.json()) //return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' }) // request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config') return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
......
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹'],
]
export default emoji
\ No newline at end of file \ No newline at end of file
...@@ -162,6 +162,7 @@ ...@@ -162,6 +162,7 @@
:btnList="btnList" :btnList="btnList"
:eventBus="eventBus" :eventBus="eventBus"
></WelcomeWords> ></WelcomeWords>
<div v-show="attachmentShow" class="el-form-item__error">{{attachmentText}}</div>
</el-form-item> </el-form-item>
<el-form-item label="发送时间" prop="sendType"> <el-form-item label="发送时间" prop="sendType">
<el-radio-group v-model="basicForm.sendType"> <el-radio-group v-model="basicForm.sendType">
...@@ -197,12 +198,13 @@ ...@@ -197,12 +198,13 @@
</div> </div>
<glsx-dialog <glsx-dialog
:title="'选择成员'" :title="'选择成员'"
:width="'712px'" :width="'1142px'"
:isVisible="membersVisible" :isVisible="membersVisible"
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible" @closeDialog="membersVisible = !membersVisible"
> >
<SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> <!-- <SelectMembers islord="false" :selectData="selectData" ref="membersForm"></SelectMembers> -->
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"></SelectMember>
</glsx-dialog> </glsx-dialog>
</div> </div>
<div <div
...@@ -221,15 +223,16 @@ ...@@ -221,15 +223,16 @@
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import emoji from '@/utils/emo'
import WelcomeWords from './components/welcomeWords.vue' import WelcomeWords from './components/welcomeWords.vue'
import SelectMembers from './components/selectMembers.vue' import SelectMember from './components/selectMember.vue'
import Preview from './components/preview.vue' import Preview from './components/preview.vue'
import SelectLabel from './components/selectLabel.vue' import SelectLabel from './components/selectLabel.vue'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
components: { components: {
WelcomeWords, WelcomeWords,
SelectMembers, SelectMember,
Preview, Preview,
SelectLabel SelectLabel
}, },
...@@ -239,7 +242,7 @@ export default { ...@@ -239,7 +242,7 @@ export default {
if (userList && userList.length != 0) { if (userList && userList.length != 0) {
callback() callback()
} else { } else {
callback(new Error('请选择默认成员')) callback(new Error('请选择群发账号'))
} }
} }
const validatorAttachment = (rule, value, callback) => { const validatorAttachment = (rule, value, callback) => {
...@@ -303,6 +306,12 @@ export default { ...@@ -303,6 +306,12 @@ export default {
name: '活动', name: '活动',
type: 'acivity', type: 'acivity',
funName: 'activity' funName: 'activity'
},
{
id: 5,
name: '模板',
type: 'nickname',
funName: 'message'
} }
], ],
basicForm: { basicForm: {
...@@ -312,16 +321,18 @@ export default { ...@@ -312,16 +321,18 @@ export default {
chat: [] chat: []
} }
}, },
attachmentShow: false,
attachmentText: '',
basicRules: { basicRules: {
userList: [ userList: [
// { required: true, message: '请选择群发账号', trigger: 'blur' }, // { required: true, message: '请选择群发账号', trigger: 'blur' },
{ validator: validatorUser, trigger: 'change' } { validator: validatorUser, trigger: 'change' }
], ],
selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }], selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
attachmentList: [ // attachmentList: [
// { required: true, message: '请输入入群欢迎语' }, // // { required: true, message: '请输入入群欢迎语' },
{ validator: validatorAttachment, trigger: 'change' } // { validator: validatorAttachment, trigger: 'change' }
], // ],
sendType: [ sendType: [
{ required: true, message: '请选择发送时间', trigger: 'change' }, { required: true, message: '请选择发送时间', trigger: 'change' },
{ validator: validatorSendType, trigger: 'change' } { validator: validatorSendType, trigger: 'change' }
...@@ -348,7 +359,9 @@ export default { ...@@ -348,7 +359,9 @@ export default {
selectableRange: '00:00:00 - 23:59:59' selectableRange: '00:00:00 - 23:59:59'
}, },
editStatus: false, editStatus: false,
firstFlag: true firstFlag: true,
footerLeft: 40,
footerWidth: 500
} }
}, },
watch: { watch: {
...@@ -390,7 +403,8 @@ export default { ...@@ -390,7 +403,8 @@ export default {
}, },
// 成员弹窗 // 成员弹窗
handleConfirm() { handleConfirm() {
if (this.$refs.membersForm.innerTags.length != 0) { console.log(this.$refs.membersForm.innerTags)
if (this.$refs.membersForm.innerTags.length) {
this.basicForm.userList = this.$refs.membersForm.innerTags this.basicForm.userList = this.$refs.membersForm.innerTags
this.openMembers() this.openMembers()
this.isUpdate = true this.isUpdate = true
...@@ -410,159 +424,55 @@ export default { ...@@ -410,159 +424,55 @@ export default {
}, },
openLabel() { openLabel() {
this.dialogVisible = !this.dialogVisible this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init()
}, },
handleSubmit() { handleSubmit() {
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
this.attachmentShow = true
const previewList = this.$refs.welcome.previewList
if (previewList.length != 0) {
this.basicForm.attachmentList = previewList
}
if (this.basicForm.attachmentList && this.basicForm.attachmentList.length) {
if (this.basicForm.attachmentList.length > 9) {
this.attachmentText = '附件不可超过9个'
} else {
this.attachmentText = ''
this.attachmentShow = false
}
} else {
this.attachmentText = '请输入群发内容'
}
this.$refs.groupForm.validate(v => { this.$refs.groupForm.validate(v => {
if (v) { if (v) {
const params = this.getSiftMembers() const params = this.getSiftMembers()
params.type = 1 params.type = 1
if (this.basicForm.condition.chat.length && this.basicForm.condition.chat.length > 100) { // if (this.basicForm.condition.chat && this.basicForm.condition.chat.length && this.basicForm.condition.chat.length > 100) {
this.$message({ // this.$message({
type: 'error', // type: 'error',
message: '所在群聊不可超过100个' // message: '所在群聊不可超过100个'
}) // })
return false // return false
} // }
// params.attachmentList = this.basicForm.attachmentList // params.attachmentList = this.basicForm.attachmentList
params.sendType = this.basicForm.sendType params.sendType = this.basicForm.sendType
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const attachmentList = previewList.map(item => { const attachmentList = previewList.map(item => {
if (item.attType == 1) { if (item.attType == 1) {
const list = [ const list = emoji.flat(Infinity)
'微笑', const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
'撇嘴', const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
'色', let s = list[parseInt(str.split('.')[0]) - 1]
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = item.attContent.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]` return `[${s}]`
}) })
item.attContent = replaceImg.substring(0, 600) item.attContent = replaceImg.substring(0, 600)
// item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
} else if (item.attType == 7) { } else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent) item.attContent = JSON.stringify(item.attContent)
} }
return item return item
}) })
console.log(params)
params.attachmentList = attachmentList params.attachmentList = attachmentList
// const params = {
// type: 1,
// attachmentList: this.basicForm.attachmentList,
// selectType: this.basicForm.selectType,
// sendType: this.basicForm.sendType
// }
// params.userList = this.basicForm.userList.map(item => {
// return {
// staffId: item.staffId,
// staffName: item.staffName
// }
// })
if (params.sendType == 2) { if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
} }
...@@ -642,8 +552,10 @@ export default { ...@@ -642,8 +552,10 @@ export default {
} }
} }
if (this.basicForm.condition.date) { if (this.basicForm.condition.date) {
let endTime = new Date(this.basicForm.condition.date[1])
endTime = endTime.setDate(endTime.getDate() + 1)
params.condition.sTime = dayjs(this.basicForm.condition.date[0]).format('YYYY-MM-DD') params.condition.sTime = dayjs(this.basicForm.condition.date[0]).format('YYYY-MM-DD')
params.condition.eTime = dayjs(this.basicForm.condition.date[1]).format('YYYY-MM-DD') params.condition.eTime = dayjs(endTime).format('YYYY-MM-DD')
} }
params.userList = this.basicForm.userList.map(item => { params.userList = this.basicForm.userList.map(item => {
return { return {
...@@ -869,6 +781,9 @@ export default { ...@@ -869,6 +781,9 @@ export default {
.el-loading-spinner { .el-loading-spinner {
transform: translateY(8px); transform: translateY(8px);
} }
.el-scrollbar {
padding-bottom: 10px;
}
} }
.group-content { .group-content {
padding: 22px 0 20px 20px; padding: 22px 0 20px 20px;
......
...@@ -14,7 +14,12 @@ ...@@ -14,7 +14,12 @@
label-width="120px" label-width="120px"
> >
<el-form-item label="群发名称" prop="massName"> <el-form-item label="群发名称" prop="massName">
<el-input v-model="basicForm.massName" placeholder="群发名称仅内部可见" maxlength="10"></el-input> <el-input
v-model="basicForm.massName"
:size="size"
placeholder="群发名称仅内部可见"
maxlength="10"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="userList"> <el-form-item prop="userList">
<label slot="label" class="required">选择群主</label> <label slot="label" class="required">选择群主</label>
...@@ -35,19 +40,11 @@ ...@@ -35,19 +40,11 @@
:key="idx" :key="idx"
closable closable
:disable-transitions="false" :disable-transitions="false"
@close="remove(tag)" @close="remove(tag, idx)"
> >
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
{{ tag.staffName }} {{ tag.staffName }}
</el-tag> </el-tag>
<!-- <el-tag
v-for="(tag, idx) in basicForm.userList"
:key="idx"
closable
:disable-transitions="false"
@close="remove(tag)"
>{{ tag.staffName }}</el-tag>
<el-input size="small" style="outline: none; border: none"></el-input>-->
</div> </div>
</div> </div>
<div class="form-tips">群主收到通知后,可选择他管理的客户群并群发该内容。</div> <div class="form-tips">群主收到通知后,可选择他管理的客户群并群发该内容。</div>
...@@ -65,6 +62,7 @@ ...@@ -65,6 +62,7 @@
:btnList="btnList" :btnList="btnList"
:eventBus="eventBus" :eventBus="eventBus"
></WelcomeWords> ></WelcomeWords>
<div v-show="attachmentShow" class="el-form-item__error">{{attachmentText}}</div>
</el-form-item> </el-form-item>
<el-form-item label="发送时间" prop="sendType"> <el-form-item label="发送时间" prop="sendType">
<el-radio-group v-model="basicForm.sendType"> <el-radio-group v-model="basicForm.sendType">
...@@ -110,27 +108,28 @@ ...@@ -110,27 +108,28 @@
<el-button @click="handleCancel">取消</el-button> <el-button @click="handleCancel">取消</el-button>
</div> </div>
<glsx-dialog <glsx-dialog
:title="'选择成员'" :title="'选择群主'"
:width="'712px'" :width="'1142px'"
:isVisible="membersVisible" :isVisible="membersVisible"
@confirmDialog="handleConfirm" @confirmDialog="handleConfirm"
@closeDialog="membersVisible = !membersVisible" @closeDialog="membersVisible = !membersVisible"
> >
<SelectMembers ref="membersForm" islord="true"></SelectMembers> <SelectLord ref="membersForm" islord="true" v-if="membersVisible" :selectData="selectData"></SelectLord>
</glsx-dialog> </glsx-dialog>
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import emoji from '@/utils/emo'
import WelcomeWords from './components/welcomeWords.vue' import WelcomeWords from './components/welcomeWords.vue'
import SelectMembers from './components/selectMembers.vue' import SelectLord from './components/selectLord.vue'
import Preview from './components/preview.vue' import Preview from './components/preview.vue'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
components: { components: {
WelcomeWords, WelcomeWords,
SelectMembers, SelectLord,
Preview Preview
}, },
data() { data() {
...@@ -139,7 +138,7 @@ export default { ...@@ -139,7 +138,7 @@ export default {
if (userList && userList.length != 0) { if (userList && userList.length != 0) {
callback() callback()
} else { } else {
callback(new Error('请选择默认成员')) callback(new Error('请选择群主'))
} }
} }
const validatorAttachment = (rule, value, callback) => { const validatorAttachment = (rule, value, callback) => {
...@@ -208,9 +207,17 @@ export default { ...@@ -208,9 +207,17 @@ export default {
name: '活动', name: '活动',
type: 'acivity', type: 'acivity',
funName: 'activity' funName: 'activity'
},
{
id: 5,
name: '模板',
type: 'nickname',
funName: 'message'
} }
], ],
basicForm: {}, basicForm: {},
attachmentShow: false,
attachmentText: '',
basicRules: { basicRules: {
userList: [ userList: [
// { required: true, message: '请选择群发账号', trigger: 'blur' }, // { required: true, message: '请选择群发账号', trigger: 'blur' },
...@@ -220,10 +227,10 @@ export default { ...@@ -220,10 +227,10 @@ export default {
{ required: true, message: '请输入群聊名称', trigger: 'blur' } { required: true, message: '请输入群聊名称', trigger: 'blur' }
// { validator: nameVaild, trigger: 'blur' } // { validator: nameVaild, trigger: 'blur' }
], ],
attachmentList: [ // attachmentList: [
// { required: true, message: '请输入入群欢迎语' }, // // { required: true, message: '请输入入群欢迎语' },
{ validator: validatorAttachment, trigger: 'change' } // { validator: validatorAttachment, trigger: 'change' }
], // ],
sendType: [ sendType: [
{ required: true, message: '请选择发送时间', trigger: 'change' }, { required: true, message: '请选择发送时间', trigger: 'change' },
{ validator: validatorSendType, trigger: 'change' } { validator: validatorSendType, trigger: 'change' }
...@@ -241,9 +248,10 @@ export default { ...@@ -241,9 +248,10 @@ export default {
timeOptions: { timeOptions: {
selectableRange: '00:00:00 - 23:59:59' selectableRange: '00:00:00 - 23:59:59'
}, },
footerLeft: 0, footerLeft: 200,
footerWidth: 0, footerWidth: 200,
editStatus: false editStatus: false,
selectData: []
} }
}, },
watch: { watch: {
...@@ -294,178 +302,95 @@ export default { ...@@ -294,178 +302,95 @@ export default {
// }) // })
} else { } else {
this.basicForm.userList = this.$refs.membersForm.innerTags this.basicForm.userList = this.$refs.membersForm.innerTags
this.selectData = this.basicForm.userList
this.openMembers() this.openMembers()
} }
}, },
remove(val) { remove(val, idx) {
this.$refs.membersForm.remove(val) if (this.$refs.membersForm) {
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags) this.$refs.membersForm.remove(val)
this.key = new Date() this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.key = new Date()
} else {
this.basicForm.userList.splice(idx, 1)
this.selectData = this.basicForm.userList
this.key = new Date()
}
}, },
handleSubmit() { handleSubmit() {
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
this.$refs.groupForm.validate(v => { this.attachmentShow = true
const params = { const previewList = this.$refs.welcome.previewList
type: 2, if (previewList.length != 0) {
// attachmentList: this.basicForm.attachmentList, this.basicForm.attachmentList = previewList
sendType: this.basicForm.sendType, }
massName: this.basicForm.massName if (this.basicForm.attachmentList && this.basicForm.attachmentList.length) {
if (this.basicForm.attachmentList.length > 9) {
this.attachmentText = '附件不可超过9个'
} else {
this.attachmentText = ''
this.attachmentShow = false
} }
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList } else {
const attachmentList = previewList.map(item => { this.attachmentText = '请输入群发内容'
if (item.attType == 1) { }
const list = [ this.$refs.groupForm.validate(v => {
'微笑', if (v) {
'撇嘴', const params = {
'色', type: 2,
'发呆', sendType: this.basicForm.sendType,
'得意', massName: this.basicForm.massName
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = item.attContent.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]`
})
item.attContent = replaceImg
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
} }
return item const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
}) const attachmentList = previewList.map(item => {
params.attachmentList = attachmentList if (item.attType == 1) {
params.userList = this.basicForm.userList.map(item => { const list = emoji.flat(Infinity)
return { const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
staffId: item.staffId, const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
staffName: item.staffName let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
item.attContent = replaceImg.substring(0, 600)
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
return item
})
params.attachmentList = attachmentList
params.userList = this.basicForm.userList.map(item => {
return {
staffId: item.id,
staffName: item.staffName
}
})
if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
} }
}) this.addLoading = true
if (params.sendType == 2) { this.$apis.customerTransform.insert(params).then(res => {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate if (res.code == '-1') {
this.$message({
type: 'error',
message: res.message
})
// this.$router.push('/customerTransform/index')
} else if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!'
})
// this.$router.push('/customerTransform/index')
} else {
this.$message({
type: 'error',
message: res.message
})
}
this.addLoading = false
this.$router.push('/customerTransform/index')
})
} }
this.addLoading = true
this.$apis.customerTransform.insert(params).then(res => {
if (res.code == '-1') {
this.$message({
type: 'error',
message: res.message
})
// this.$router.push('/customerTransform/index')
} else if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!'
})
// this.$router.push('/customerTransform/index')
} else {
this.$message({
type: 'error',
message: res.message
})
}
this.addLoading = false
this.$router.push('/customerTransform/index')
})
}) })
} }
}) })
...@@ -603,7 +528,12 @@ export default { ...@@ -603,7 +528,12 @@ export default {
padding-left: 0; padding-left: 0;
width: 100px; width: 100px;
} }
/deep/.el-loading-spinner { /deep/ {
transform: translateY(8px); .el-loading-spinner {
transform: translateY(8px);
}
.el-scrollbar {
padding-bottom: 10px;
}
} }
</style> </style>
<template> <template>
<div class="ly-emotion" > <div class="ly-emotion">
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
export default { export default {
name: 'ly-emotion', name: 'ly-emotion',
mounted () { mounted() {
const name = this.$el.innerHTML const name = this.$el.innerHTML
const list = ['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴', '睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过', '酷', '冷汗', '抓狂', '吐', '偷笑', '可爱', '白眼', '傲慢', '饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂', '疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见', '擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠', '鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀', '西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰', '凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀', '足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强', '弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你', 'NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈', '磕头', '回头', '跳绳', '挥手', '激动', '街舞', '献吻', '左太极', '右太极'] const list = emoji.flat(Infinity)
let index = list.indexOf(name) let index = parseInt(list.indexOf(name)) + 1
let imgHTML = `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">` if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
let imgHTML = `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
this.$nextTick(() => { this.$nextTick(() => {
this.$el.innerHTML = imgHTML this.$el.innerHTML = imgHTML
}) })
}, }
} }
</script> </script>
<style scoped> <style scoped>
.ly-emotion { .ly-emotion {
display: inline-block display: inline-block;
} }
.ly-static-emotion { .ly-static-emotion {
width: 24px; width: 24px;
......
...@@ -2,13 +2,19 @@ ...@@ -2,13 +2,19 @@
<div> <div>
<div class="emotion-box" :style="{ height: height + 'px' }"> <div class="emotion-box" :style="{ height: height + 'px' }">
<div class="emotion-box-line" v-for="(line, i) in list" :key="i"> <div class="emotion-box-line" v-for="(line, i) in list" :key="i">
<emotion class="emotion-item" v-for="(item, i) in line" :key="i" @click.native="clickHandler(item)">{{ item }}</emotion> <emotion
class="emotion-item"
v-for="(item, i) in line"
:key="i"
@click.native="clickHandler(item)"
>{{ item }}</emotion>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
import Emotion from './Emotion' import Emotion from './Emotion'
export default { export default {
props: { props: {
...@@ -19,19 +25,7 @@ export default { ...@@ -19,19 +25,7 @@ export default {
}, },
data() { data() {
return { return {
list: [ list: emoji
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '挥手', '激动', '街舞', '左太极', '右太极']
]
} }
}, },
methods: { methods: {
...@@ -64,9 +58,13 @@ export default { ...@@ -64,9 +58,13 @@ export default {
flex: 1; flex: 1;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
line-height: 23px;
/deep/ { /deep/ {
img { img {
width: 24px; width: 24px;
-webkit-user-select: none;
cursor: default;
pointer-events: none;
} }
} }
} }
......
<template>
<div class="square-main">
<el-dialog title="选择模板" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="model-panel">
<el-form
:inline="true"
class="message-form"
:model="searchForm"
ref="searchForm"
label-width="80px"
>
<el-form-item label="模板标题">
<el-input v-model="searchForm.title" :size="size" placeholder="请输入模板名称搜索"></el-input>
</el-form-item>
<el-form-item label="创建者">
<el-select v-model="searchForm.createdBy" :size="size" placeholder="全部">
<el-option
v-for="item in createdList"
:key="item.id"
:label="item.createdName"
:value="item.createdBy"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
<el-form-item style="float: right;margin-right: 0;">
<el-button :size="size" icon="el-icon-plus" @click="createModel">新增模板</el-button>
</el-form-item>
</el-form>
<!-- <div class="model-panel-tab">
<label>模板类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
<el-tab-pane label="售前" name="1"></el-tab-pane>
<el-tab-pane label="售中" name="2"></el-tab-pane>
<el-tab-pane label="售后" name="3"></el-tab-pane>
</el-tabs>
</div>-->
<div class="model-item-panel" v-if="modelList.length>0" v-loading="loading">
<div class="model-item" v-for="(item, index) in modelList" :key="index">
<div class="model-item-radio">
<el-radio v-model="messageRadio" :label="item"></el-radio>
</div>
<div class="model-item-title">
<div class="model-title-h1">{{ item.title }}</div>
<div class="model-title-h2">{{ item.content }}</div>
</div>
<div class="model-item-content">
<div class="model-content">创建人:巴拉巴拉</div>
<div class="model-content">创建日期:{{ item.createdTime }}</div>
</div>
<div class="model-item-btn">
<el-button
v-if="item.createdBy == 59"
type="text"
:size="size"
@click="editModel(item.id)"
>编辑</el-button>
</div>
</div>
</div>
<div class="model-item-panel" v-else v-loading="loading">
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-sizes="[10, 20, 30, 40]"
:page-size="pageSize"
:total="tableTotal"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="selectModelItem">确 定</el-button>
</span>
</el-dialog>
<el-dialog
:title="modelTitle"
:visible.sync="createVisible"
width="30%"
:before-close="handleCreateClose"
>
<el-form
:model="templateForm"
:rules="templateRules"
ref="templateForm"
label-width="100px"
class="templateForm"
>
<el-form-item label="标题" prop="title">
<el-input
v-model="templateForm.title"
maxlength="10"
show-word-limit
placeholder="输入10个字以内的标题,如活动促销"
></el-input>
</el-form-item>
<el-form-item label="内容说明" prop="content">
<el-input
type="textarea"
v-model="templateForm.content"
maxlength="600"
:rows="7"
show-word-limit
placeholder="输入不超过600字内的文字说明"
></el-input>
</el-form-item>
</el-form>
<div class="template-footer">
<el-button size="small" @click="createVisible = false">取 消</el-button>
<el-button size="small" type="primary" :loading="createLoading" @click="handleCreate">立即创建</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'MessageModel',
data() {
return {
dialogVisible: false,
createVisible: false,
loading: false,
activeName: '1',
messageRadio: {},
modelList: [
// {
// title: '121',
// content: 'jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开jlkjl就离开家离开家离开',
// createdTime: '2022-01-04'
// }
],
pageNum: 1,
pageSize: 10,
tableTotal: 0,
searchForm: {},
templateForm: {},
templateRules: {
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
content: [{ required: true, message: '请输入标题', trigger: 'blur' }]
},
createLoading: false,
createdList: [],
modelTitle: '创建群发模板'
}
},
mounted() {
console.log(this.$globalState)
},
methods: {
init() {
this.messageRadio = {}
this.dialogVisible = true
this.dracImMessage()
this.getCreatedList()
},
selectModelItem() {
this.dialogVisible = false
this.$emit('selectItem', this.messageRadio)
},
handleClick() {
this.dracImMessage()
},
search() {
this.dracImMessage(this.searchForm)
},
dracImMessage(searcher) {
this.loading = true
let params = {
pageSize: this.pageSize,
pageNum: this.pageNum
}
if (searcher) {
params.title = searcher.title
params.createdBy = searcher.createdBy
}
this.$apis.customerTransform.templatePage(params).then(res => {
console.log(res)
if (res) {
this.modelList = res.data
this.tableTotal = res.count
}
this.loading = false
})
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`)
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
},
createModel() {
this.createVisible = true
},
handleCreate() {
this.$refs.templateForm.validate(valid => {
if (valid) {
console.log(this.templateForm)
this.createLoading = true
const params = {
title: this.templateForm.title,
content: this.templateForm.content
}
let api = 'templateSave'
if (this.templateForm.id) {
api = 'templateUpdate'
params.id = this.templateForm.id
}
console.log(params)
this.$apis.customerTransform[api](params).then(res => {
console.log(res)
this.createLoading = false
if (res) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.createVisible = false
this.dracImMessage()
}
})
}
})
},
editModel(id) {
this.createVisible = true
this.modelTitle = '编辑群发模板'
this.getTemplateDetail(id)
},
getCreatedList() {
this.$apis.customerTransform.createdNameList({}).then(res => {
this.createdList = res
})
},
getTemplateDetail(id) {
this.$apis.customerTransform.templateDetail({ id }).then(res => {
console.log(res)
if (res) {
this.templateForm = res
}
})
}
}
}
</script>
<style lang="scss" scoped>
.model-panel {
padding: 0 20px;
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
}
}
}
.model-item-panel {
max-height: 400px;
overflow: auto;
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
.model-item {
display: flex;
padding: 20px;
border-bottom: 1px solid #e9e9e9;
&-radio {
width: 60px;
/deep/ {
.el-radio__input {
margin-top: 10px;
}
.el-radio__label {
display: none;
}
}
}
&-content {
width: 210px;
.model-content {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
&-title {
flex: 1;
.model-title-h1 {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
.model-title-h2 {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
max-width: 658px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
&-btn {
width: 30px;
height: 40px;
}
}
}
}
.message-form .el-form-item {
margin-bottom: 0 !important;
}
/deep/ .el-pager {
height: 30px;
}
.el-pagination {
margin-top: 21px;
}
.templateForm {
padding: 0 20px;
/deep/ {
.el-textarea__inner {
background-color: #fff;
}
.el-textarea .el-input__count {
background-color: #fff;
}
}
}
.template-footer {
text-align: center;
border-top: 1px solid #e6e6e6;
padding-top: 16px;
margin-bottom: -14px;
}
/deep/ {
.el-dialog__body {
padding: 30px 0;
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
export default { export default {
name: 'Preview', name: 'Preview',
props: { eventBus: Object }, props: { eventBus: Object },
...@@ -56,117 +57,16 @@ export default { ...@@ -56,117 +57,16 @@ export default {
previewList(val) { previewList(val) {
if (val.length && val[0].attType == 1) { if (val.length && val[0].attType == 1) {
const attContent = val[0].attContent const attContent = val[0].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA5]{1,3}]/gi, function(res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = [ const list = emoji.flat(Infinity)
'微笑', let index = parseInt(list.indexOf(word)) + 1
'撇嘴', if (index < 10) {
'色', index = '00' + index
'发呆', } else if (index >= 10 && index < 100) {
'得意', index = '0' + index
'流泪', }
'害羞', return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(word)
return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">`
}) })
val[0].attContent = htm val[0].attContent = htm
} }
...@@ -224,6 +124,11 @@ export default { ...@@ -224,6 +124,11 @@ export default {
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
word-wrap: break-word; word-wrap: break-word;
display: flex;
img {
width: 20px;
height: 20px;
}
} }
.text { .text {
font-size: 16px; font-size: 16px;
......
<template>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
预选
<span>共456个群聊,56个群主成员</span>
</div>
<div class="member-content">
<el-form
:inline="true"
class="member-form"
label-width="110px"
:model="searchForm"
@submit.native.prevent
>
<el-form-item label="所在门店/部门" style="margin-bottom: 0;">
<el-popover
ref="popover"
placement="bottom"
width="215"
trigger="click"
v-model="popoverVisible"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
class="select-tree"
:data="treeData"
:props="defaultProps"
default-expand-all
@node-click="handleNodeClick"
></el-tree>
<el-input
v-model="searchForm.department"
slot="reference"
:size="size"
readonly
placeholder="请选择所在门店/部门"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
@keyup.enter.native="search"
></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0;">
<el-input
:size="size"
v-model.trim="searchForm.lordName"
@keyup.enter.native="search"
clearable
placeholder="请输入姓名搜索"
></el-input>
</el-form-item>
<el-form-item label="跟进专员类型" style="margin-bottom: 0;">
<el-select
v-model="searchForm.followerId"
style="width: 215px;"
:size="size"
placeholder="请选择"
>
<el-option
v-for="item in followTypeList"
:key="item.id"
:label="item.followName"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item label style="margin-bottom: 0;">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px;">
<GLTable
v-loading="loading"
ref="empTable"
:tableData="tableEmpData"
:tableParams="tableParams"
:hasNum="false"
:hasPage="false"
:noDataImg="url"
@selectionTable="selectionTable"
@row-click="rowClick"
>
<div slot="staffName" slot-scope="scope">
<span>{{scope.scope.staffName}}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{scope.scope.staffTitle}}</span>
</div>
</GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">成员名称({{innerTags.length}}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag
v-for="(tag, idx) in innerTags"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(tag)"
>
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectLord',
props: ['selectData'],
data() {
return {
url: url,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerTypeName'
},
{
label: '群数量',
prop: 'chatCount'
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: [],
followTypeList: []
}
},
mounted() {
this.getFindLordGroup({}, true)
this.getFollowerType()
this.listDepartmentTree()
},
methods: {
selectionTable(val) {
this.innerTags = val
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
getFindLordGroup(params, isFirst) {
this.$apis.customerTransform.findLordGroup(params).then(res => {
this.loading = false
if (res) {
this.tableEmpData = res
if (isFirst && this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
listDepartmentTree() {
const params = { addChildrensFlag: true }
params.islord = true
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.treeData = res
})
},
handleNodeClick(data) {
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.getFindLordGroup(this.searchForm)
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
getFollowerType() {
this.$apis.customerTransform.followerType({}).then(res => {
this.followTypeList = res
})
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
<template>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
预选
<span>仅筛选有外部客户联系人的成员</span>
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="所在门店/部门" style="margin-bottom: 0;">
<el-popover
ref="popover"
placement="bottom"
width="215"
trigger="click"
v-model="popoverVisible"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
class="select-tree"
:data="treeData"
:props="defaultProps"
default-expand-all
@node-click="handleNodeClick"
></el-tree>
<el-input
v-model="searchForm.department"
slot="reference"
:size="size"
readonly
placeholder="请选择所在门店/部门"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
@keyup.enter.native="search"
></el-input>
</el-popover>
</el-form-item>
<el-form-item label="姓名" style="margin-bottom: 0;">
<el-input
:size="size"
v-model.trim="searchForm.name"
@keyup.enter.native="search"
clearable
placeholder="请输入姓名搜索"
></el-input>
</el-form-item>
<!-- <el-form-item>
<el-checkbox v-model="searchForm.checked">仅看跟进专员</el-checkbox>
</el-form-item>-->
<el-form-item style="margin-bottom: 0;">
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px;">
<GLTable
v-loading="loading"
ref="empTable"
:tableData="tableEmpData"
:tableParams="tableParams"
:hasNum="false"
:hasPage="false"
:noDataImg="url"
@selectionTable="selectionTable"
@row-click="rowClick"
>
<div slot="staffName" slot-scope="scope">
<span>{{scope.scope.staffName}}</span>
<span class="staff-title">{{scope.scope.staffTitle}}</span>
</div>
</GLTable>
</div>
</div>
<div class="member-checked">
<el-checkbox v-model="checked" @change="checkChange">仅看跟进专员</el-checkbox>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">成员名称({{innerTags.length}}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag
v-for="(tag, idx) in innerTags"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(tag)"
>
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectMember',
props: ['selectData'],
data() {
return {
url: url,
searchForm: {},
checked: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'departmentName'
},
popoverVisible: false,
loading: false,
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerName'
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: []
}
},
mounted() {
this.listDepartmentTree(false)
},
methods: {
selectionTable(val) {
console.log(val)
this.innerTags = val
// this.$emit('selectTable', val)
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
listDepartmentTree(isHavCustomer) {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isHavCustomer = isHavCustomer
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
this.tableEmpData = this.getEmployee(res)
this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res)
this.treeData = res
this.tableEmpData.length ? (this.$refs.empTable.tableHeightValues = '250px') : this.$refs.empTable.setTableHeightFun()
if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
handleNodeClick(data) {
console.log(data)
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.tableEmpData = []
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
// this.loading = true
console.log(keyword, data, this.tableEmpData)
if (data instanceof Array) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else if (data instanceof Object) {
if (data.entmicroStaffResponses) {
if (keyword) {
data.entmicroStaffResponses.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.tableEmpData.concat(data.entmicroStaffResponses)
}
}
if (data.children) {
data.children.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
if (keyword) {
if (j.staffName.indexOf(keyword) != -1) {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
} else {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
})
}
})
}
}
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
checkChange(val) {
console.log(val)
this.searchForm = {}
this.listDepartmentTree(val)
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
<!-- 树形搜索 -->
<template>
<div>
<el-popover
ref="popover"
placement="bottom-start"
trigger="click"
v-model="popoverVisible"
:disabled="targetItem.isDisabled"
@show="onShowPopover"
@hide="onHidePopover"
>
<el-tree
ref="tree"
class="select-tree"
highlight-current
default-expand-all
node-key="id"
:expand-on-click-node="isExpand"
:style="`min-width: ${treeWidth}`"
:data="treeData"
:current-node-key="form[targetItem.name]"
:props="defaultProps"
:filter-node-method="handleFilterNode"
@current-change="handleNodeClick"
></el-tree>
<el-input
slot="reference"
ref="input"
v-model="form[targetItem.nameLabel]"
clearable
:disabled="targetItem.isDisabled"
:style="`width: ${width}px`"
:class="{ 'rotate': popoverVisible }"
suffix-icon="el-icon-arrow-down"
:placeholder="'请选择' + targetItem.label"
@change="handleClear"
></el-input>
</el-popover>
</div>
</template>
<script>
export default {
name: 'SelectTree',
data() {
return {
isExpand: false,
// 树状菜单显示状态
popoverVisible: false,
treeWidth: 'auto'
}
},
props: {
// 输入框宽度
width: String,
form: {
type: Object,
default: () => {}
},
targetItem: {
type: Object,
default: () => {}
},
treeData: {
type: Array,
default: () => []
},
defaultProps: {
type: Object,
default: () => ({
parent: 'parentId',
value: 'id',
label: 'menuName',
children: 'childlist'
})
}
},
watch: {
form(val) {
if (this.form[this.targetItem.name]) {
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
}
},
created() {
// 获取输入框宽度同步至树状菜单宽度
this.$nextTick(() => {
this.treeWidth = `${(this.width || this.$refs.input.$refs.input.clientWidth) - 24}px`
})
},
mounted() {
if (this.form[this.targetItem.name]) {
// console.log(this.treeData)
// console.log(this.form)
this.form[this.targetItem.nameLabel] = this.queryTree(this.treeData, this.form[this.targetItem.name])
this.$nextTick().then(() => {
this.$refs.tree.setCheckedKeys([this.form[this.targetItem.name]])
})
}
},
methods: {
// 显示时触发
onShowPopover() {
this.popoverVisible = true
this.$refs.tree.filter(false)
},
// 隐藏时触发
onHidePopover() {
this.popoverVisible = false
},
// 树节点过滤方法
handleFilterNode(query, data) {
if (!query) return true
return data[this.defaultProps.label].indexOf(query) !== -1
},
handleNodeClick(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
this.onHidePopover()
},
handleClear(val) {
this.$emit('selected', { val: val, targetItem: this.targetItem, formName: this.targetItem.formName })
window.event.stopPropagation()
},
// 搜索树状数据中的 ID
queryTree(tree, id) {
let stark = []
stark = stark.concat(tree)
while (stark.length) {
const temp = stark.shift()
if (temp[this.defaultProps.children]) {
stark = stark.concat(temp[this.defaultProps.children])
}
if (temp[this.defaultProps.value] === id) {
return temp[this.defaultProps.label]
}
}
return
}
}
}
</script>
<style>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
</template> </template>
<script> <script>
import emoji from '@/utils/emo'
export default { export default {
name: 'wTextarea', name: 'wTextarea',
data() { data() {
...@@ -228,121 +229,16 @@ export default { ...@@ -228,121 +229,16 @@ export default {
this.updateData(target.innerHTML) this.updateData(target.innerHTML)
} }
let htm = target.innerHTML let htm = target.innerHTML
const list = [ const list = emoji.flat(Infinity)
'微笑', const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
'撇嘴', const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
'色', let s = list[parseInt(str.split('.')[0]) - 1]
'发呆',
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = htm.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]` return `[${s}]`
}) })
console.log(replaceImg)
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
placeCaretAtEnd(el) { placeCaretAtEnd(el) {
...@@ -366,121 +262,16 @@ export default { ...@@ -366,121 +262,16 @@ export default {
// 即时更新数据 // 即时更新数据
this.updateData(target.innerHTML) this.updateData(target.innerHTML)
let htm = target.innerHTML let htm = target.innerHTML
const list = [ console.log(htm)
'微笑', const list = emoji.flat(Infinity)
'撇嘴', const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
'色', const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
'发呆', let s = list[parseInt(str.split('.')[0]) - 1]
'得意',
'流泪',
'害羞',
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
const cutImg = htm.replaceAll('<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/', '')
const replaceImg = cutImg.replace(/(\d){1,2}.gif">/g, function(str) {
let s = list[str.split('.')[0]]
return `[${s}]` return `[${s}]`
}) })
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText this.currentText = Textnode.innerText.substring(0, 600)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
handleDelete(e) { handleDelete(e) {
...@@ -582,6 +373,7 @@ $textColor: #666; ...@@ -582,6 +373,7 @@ $textColor: #666;
position: relative; position: relative;
&_input { &_input {
width: 100%; width: 100%;
height: 200px;
min-height: 100px; min-height: 100px;
box-sizing: border-box; box-sizing: border-box;
padding: 10px; padding: 10px;
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
</div> </div>
</div> </div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel> <ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<MessageModel ref="message" @selectItem="selectMessage"></MessageModel>
</div> </div>
</template> </template>
<script> <script>
...@@ -105,8 +106,9 @@ const ATT_TYPE = { ...@@ -105,8 +106,9 @@ const ATT_TYPE = {
FILE: 6, FILE: 6,
ACTIVITY: 7 ACTIVITY: 7
} }
// import E from 'wangeditor' import emoji from '@/utils/emo'
import ActivityModel from './activityModel' import ActivityModel from './activityModel'
import MessageModel from './messageModel'
import Emotion from './emotionWords' import Emotion from './emotionWords'
import wTextarea from './tag-textarea' import wTextarea from './tag-textarea'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
...@@ -115,7 +117,8 @@ export default { ...@@ -115,7 +117,8 @@ export default {
components: { components: {
ActivityModel, ActivityModel,
Emotion, Emotion,
wTextarea wTextarea,
MessageModel
}, },
props: { eventBus: Object, btnList: Array, form: String }, props: { eventBus: Object, btnList: Array, form: String },
data() { data() {
...@@ -182,115 +185,14 @@ export default { ...@@ -182,115 +185,14 @@ export default {
}, },
handleEmotion(i) { handleEmotion(i) {
this.emotionStatus = false this.emotionStatus = false
const list = [ const list = emoji.flat(Infinity)
'微笑', let index = list.indexOf(i) + 1
'撇嘴', if (index < 10) {
'色', index = '00' + index
'发呆', } else if (index >= 10 && index < 100) {
'得意', index = '0' + index
'流泪', }
'害羞', this.$refs.textContent.addImg(`https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png`)
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(i)
this.$refs.textContent.addImg(`https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif`)
}, },
updateText(val) { updateText(val) {
this.textInput(val) this.textInput(val)
...@@ -362,6 +264,8 @@ export default { ...@@ -362,6 +264,8 @@ export default {
this.$refs.textContent.addTag('@昵称') this.$refs.textContent.addTag('@昵称')
} else if (name == 'activity') { } else if (name == 'activity') {
this.$refs.activity.init() this.$refs.activity.init()
} else if (name == 'message') {
this.$refs.message.init()
} }
}, },
close(index) { close(index) {
...@@ -370,16 +274,20 @@ export default { ...@@ -370,16 +274,20 @@ export default {
}, },
textInput(val) { textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) { if (val) {
this.$set(this.previewList, 0, { if (hasText) {
attContent: val, this.$set(this.previewList, 0, {
attType: ATT_TYPE.TEXT attContent: val,
}) attType: ATT_TYPE.TEXT
})
} else {
this.previewList.unshift({
attContent: val,
attType: ATT_TYPE.TEXT
})
}
} else { } else {
this.previewList.unshift({ this.previewList.splice(0)
attContent: val,
attType: ATT_TYPE.TEXT
})
} }
}, },
selectActivity(val) { selectActivity(val) {
...@@ -404,6 +312,16 @@ export default { ...@@ -404,6 +312,16 @@ export default {
} }
} }
}, },
selectMessage(val) {
console.log(val)
const content = val.content
this.updateText(content)
this.textValue = content
// this.previewList[0] = {
// attContent: content,
// attType: ATT_TYPE.TEXT
// }
},
insertHtmlAtCaret(html) { insertHtmlAtCaret(html) {
var sel, range, frag var sel, range, frag
if (window.getSelection) { if (window.getSelection) {
...@@ -445,122 +363,21 @@ export default { ...@@ -445,122 +363,21 @@ export default {
this.textInput(str) this.textInput(str)
}, 300), }, 300),
updateList(val) { updateList(val) {
console.log(val)
this.previewList = val this.previewList = val
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1) const obj = val.find(item => item.attType == 1)
// let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>') let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
let attContent = obj.attContent const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
const htm = attContent.replace(/\[[\u4E00-\u9FA5]{1,3}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = [ const list = emoji.flat(Infinity)
'微笑', let index = parseInt(list.indexOf(word)) + 1
'撇嘴', if (index < 10) {
'色', index = '00' + index
'发呆', } else if (index >= 10 && index < 100) {
'得意', index = '0' + index
'流泪', }
'害羞', return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
'闭嘴',
'睡',
'大哭',
'尴尬',
'发怒',
'调皮',
'呲牙',
'惊讶',
'难过',
'酷',
'冷汗',
'抓狂',
'吐',
'偷笑',
'可爱',
'白眼',
'傲慢',
'饥饿',
'困',
'惊恐',
'流汗',
'憨笑',
'大兵',
'奋斗',
'咒骂',
'疑问',
'嘘',
'晕',
'折磨',
'衰',
'骷髅',
'敲打',
'再见',
'擦汗',
'抠鼻',
'鼓掌',
'糗大了',
'坏笑',
'左哼哼',
'右哼哼',
'哈欠',
'鄙视',
'委屈',
'快哭了',
'阴险',
'亲亲',
'吓',
'可怜',
'菜刀',
'西瓜',
'啤酒',
'篮球',
'乒乓',
'咖啡',
'饭',
'猪头',
'玫瑰',
'凋谢',
'示爱',
'爱心',
'心碎',
'蛋糕',
'闪电',
'炸弹',
'刀',
'足球',
'瓢虫',
'便便',
'月亮',
'太阳',
'礼物',
'拥抱',
'强',
'弱',
'握手',
'胜利',
'抱拳',
'勾引',
'拳头',
'差劲',
'爱你',
'NO',
'OK',
'爱情',
'飞吻',
'跳跳',
'发抖',
'怄火',
'转圈',
'磕头',
'回头',
'跳绳',
'挥手',
'激动',
'街舞',
'献吻',
'左太极',
'右太极'
]
let index = list.indexOf(word)
return `<img src="https://res.wx.qq.com/mpres/htmledition/images/icon/emotion/${index}.gif">`
}) })
document.querySelector('.w-textarea_input').focus() document.querySelector('.w-textarea_input').focus()
setTimeout(() => { setTimeout(() => {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<div class="group-detail-container"> <div class="group-detail-container">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="search-btns"> <span slot="footer" class="search-btns">
<el-button :size="size" @click="update">更新</el-button>
<el-button :size="size" @click="handleReset">重置</el-button> <el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span> </span>
...@@ -185,6 +186,15 @@ export default { ...@@ -185,6 +186,15 @@ export default {
this.$apis.customerTransform.customerDetail({ id }).then(res => { this.$apis.customerTransform.customerDetail({ id }).then(res => {
this.searchFormData[1].optionList = res.userList this.searchFormData[1].optionList = res.userList
}) })
},
update() {
const id = this.$route.params.id
this.$apis.customerTransform.groupDetailUpdate({ id }).then(res => {
console.log(res)
if (res) {
this.handleSearch()
}
})
} }
} }
} }
......
...@@ -152,7 +152,9 @@ export default { ...@@ -152,7 +152,9 @@ export default {
customerlist: [], customerlist: [],
basicInfo: {}, basicInfo: {},
eventBus: new Vue(), eventBus: new Vue(),
isDisabled: false isDisabled: false,
footerLeft: 0,
footerWidth: 0
} }
}, },
mounted() { mounted() {
......
...@@ -256,6 +256,12 @@ export default { ...@@ -256,6 +256,12 @@ export default {
if (pathArr[2] == 'addCustomerGroup' || pathArr[2] == 'detaiCustomeGroup') vm.activeIndex = 2 if (pathArr[2] == 'addCustomerGroup' || pathArr[2] == 'detaiCustomeGroup') vm.activeIndex = 2
}) })
}, },
mounted() {
this.wxTips()
},
beforeDestroy() {
this.$message.closeAll()
},
methods: { methods: {
switchMenu(val) { switchMenu(val) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -313,6 +319,31 @@ export default { ...@@ -313,6 +319,31 @@ export default {
default: default:
console.log(11) console.log(11)
} }
},
jumpWx() {
this.$history.push('/home/enterpriseWechat/index')
},
wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menu.forEach(item => {
if (!item.children) {
return
}
item.children.forEach(itm => {
if (itm.path == '/enterpriseWechat/index') {
this.$apis.customerTransform.getStatus({}).then(res => {
if (res.status == 'SUCCESS') {
const h = this.$createElement
this.$message({
showClose: true,
duration: 0,
message: h('p', null, [h('span', null, '此功能需完成【企业微信授权】后方可使用! '), h('span', { on: { click: this.jumpWx }, style: { marginRight: '150px', cursor: 'pointer', color: '#5850ff' } }, ['企业微信授权 ', h('i', { class: 'el-icon-d-arrow-right' }, '')])])
})
}
})
}
})
})
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!