Commit 4299affc by 怪兽?别跑

接口调试

1 parent 40248e56
<template> <template>
<div> <div>
<el-form-item :label="lableOne" required style="margin-right: 200px !important" :error="templateInfo"> <el-form-item :label="lableOne" required style="margin-right: 200px !important;" :error="templateInfo">
<div v-if="showModle" style="margin-bottom: 10px"> <div v-if="showModle" style="margin-bottom: 10px;">
<el-button type="primary" @click="welcomVisible = true">从模板库中选择</el-button> <el-button type="primary" @click="welcomVisible = true">从模板库中选择</el-button>
</div> </div>
<TextareaExtend <TextareaExtend
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
placeholder="请输入" placeholder="请输入"
:autosize="{ minRows: 5, maxRows: 20 }" :autosize="{ minRows: 5, maxRows: 20 }"
clearable clearable
:autofocus="true" :autofocus="false"
@input="changeInfo" /> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<template #label> <template #label>
...@@ -28,16 +28,18 @@ ...@@ -28,16 +28,18 @@
</template> </template>
<div> <div>
<div> <div>
<div style="text-align: left" class="flex"> <div style="text-align: left;" class="flex">
<el-popover <el-popover
trigger="hover" trigger="hover"
:content="'最多添加' + maxlength + '个' + fontType + ',如需修改请删除已有' + fontType + '后重新尝试'" :content="'最多添加' + maxlength + '个' + fontType + ',如需修改请删除已有' + fontType + '后重新尝试'"
placement="top-start" placement="top-start"
:disabled="talkList.length < maxlength"> :disabled="talkList.length < maxlength"
>
<template #reference> <template #reference>
<el-dropdown <el-dropdown
@command="moveGroup" @command="moveGroup"
:disabled="talkList.length > maxlength || talkList.length === maxlength"> :disabled="talkList.length > maxlength || talkList.length === maxlength"
>
<el-button type="primary">+ {{ '新建' + fontType }}</el-button> <el-button type="primary">+ {{ '新建' + fontType }}</el-button>
<template #dropdown> <template #dropdown>
<el-dropdown-menu trigger="click"> <el-dropdown-menu trigger="click">
...@@ -74,12 +76,14 @@ ...@@ -74,12 +76,14 @@
trigger="hover" trigger="hover"
:content="'最多添加' + maxlength + '个' + fontType + ',如需修改请删除已有' + fontType + '后重新尝试'" :content="'最多添加' + maxlength + '个' + fontType + ',如需修改请删除已有' + fontType + '后重新尝试'"
placement="top-start" placement="top-start"
:disabled="talkList.length < maxlength"> :disabled="talkList.length < maxlength"
>
<template #reference> <template #reference>
<div class="ml20"> <div class="ml20">
<el-button <el-button
@click="choseCenter" @click="choseCenter"
:disabled="talkList.length > maxlength || talkList.length === maxlength"> :disabled="talkList.length > maxlength || talkList.length === maxlength"
>
从素材中心选择 从素材中心选择
</el-button> </el-button>
</div> </div>
...@@ -90,7 +94,7 @@ ...@@ -90,7 +94,7 @@
</div> </div>
</el-form-item> </el-form-item>
<div style="margin-top: 10px; margin-left: 150px" v-show="talkList.length"> <div style="margin-top: 10px; margin-left: 150px;" v-show="talkList.length">
<DragTable :tableData2="talkList" @setData="setData" @getEdit="getEdit" :dargAble="[2].includes(moduleType)" /> <DragTable :tableData2="talkList" @setData="setData" @getEdit="getEdit" :dargAble="[2].includes(moduleType)" />
</div> </div>
<!-- <el-col :span="8" class="g-card" style="margin-top: 20px; padding: 20px;" v-if="showPhone"> <!-- <el-col :span="8" class="g-card" style="margin-top: 20px; padding: 20px;" v-if="showPhone">
...@@ -105,7 +109,8 @@ ...@@ -105,7 +109,8 @@
@dialogClose="dialogClose" @dialogClose="dialogClose"
:materialTalkList="talkList" :materialTalkList="talkList"
:moduleType="moduleType" :moduleType="moduleType"
:maxlength="maxlength" /> :maxlength="maxlength"
/>
<!-- 模板库 --> <!-- 模板库 -->
<el-dialog <el-dialog
:title="otherType === 2 ? '选择群发模板' : '选择欢迎语模板'" :title="otherType === 2 ? '选择群发模板' : '选择欢迎语模板'"
...@@ -113,7 +118,8 @@ ...@@ -113,7 +118,8 @@
width="60%" width="60%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
v-if="welcomVisible"> v-if="welcomVisible"
>
<TemplateLibrary @changeObj="changeObj" :isGroup="otherType === 2" /> <TemplateLibrary @changeObj="changeObj" :isGroup="otherType === 2" />
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
...@@ -130,27 +136,29 @@ ...@@ -130,27 +136,29 @@
:tplType="tplType" :tplType="tplType"
:moduleType="moduleType" :moduleType="moduleType"
:maxlength="maxlength" :maxlength="maxlength"
:noApplets="otherType === 3" /> :noApplets="otherType === 3"
/>
<SelectUser <SelectUser
:defaultValues="selectedUserList" :defaultValues="selectedUserList"
v-model:visible="dialogVisibleSelectUser" v-model:visible="dialogVisibleSelectUser"
title="选择使用员工" title="选择使用员工"
@success="selectedUser"></SelectUser> @success="selectedUser"
></SelectUser>
</div> </div>
</template> </template>
<script> <script>
import PreviewInPhone from '@/components/ContentCenter/PreviewInPhone' import PreviewInPhone from '@/components/ContentCenter/PreviewInPhone'
import { getTree } from '@/api/material' import { getTree } from '@/api/material'
import { lexicalAdd, lexicalDetail } from '@/api/contentCenter/scriptCenter' import { lexicalAdd, lexicalDetail } from '@/api/contentCenter/scriptCenter'
import { templateAdd, templateDetail } from '@/api/contentCenter/modleCenter' import { templateAdd, templateDetail } from '@/api/contentCenter/modleCenter'
import DragTable from '@/components/DragTable' import DragTable from '@/components/DragTable'
import MaterialCenter from '@/components/ContentCenter/MaterialCenter' import MaterialCenter from '@/components/ContentCenter/MaterialCenter'
import { string } from 'clipboard' import { string } from 'clipboard'
import { getPosterInfo } from '@/api/material/poster' import { getPosterInfo } from '@/api/material/poster'
import TemplateLibrary from '@/components/ContentCenter/TemplateLibrary' import TemplateLibrary from '@/components/ContentCenter/TemplateLibrary'
import MessageContentForm from '@/components/MessageContentForm' import MessageContentForm from '@/components/MessageContentForm'
export default { export default {
name: 'add-material', name: 'add-material',
components: { components: {
PreviewInPhone, PreviewInPhone,
...@@ -158,7 +166,7 @@ export default { ...@@ -158,7 +166,7 @@ export default {
MaterialCenter, MaterialCenter,
getPosterInfo, getPosterInfo,
TemplateLibrary, TemplateLibrary,
MessageContentForm, MessageContentForm
}, },
data() { data() {
return { return {
...@@ -178,22 +186,22 @@ export default { ...@@ -178,22 +186,22 @@ export default {
children: 'children', children: 'children',
label: 'name', label: 'name',
value: 'id', value: 'id',
emitPath: false, emitPath: false
}, },
mobForm: { mobForm: {
welcomeMsg: '', welcomeMsg: '',
materialMsgList: [], materialMsgList: [],
userIds: '', userIds: '',
userNames: '', userNames: ''
}, },
form: { form: {
weMaterialImgAoList: [], weMaterialImgAoList: []
}, },
talkForm: {}, // 话术表单 talkForm: {}, // 话术表单
treeData: [{}], // 树 treeData: [{}], // 树
talkRules: Object.freeze({ talkRules: Object.freeze({
categoryId: [{ required: true, message: '不能为空', trigger: 'change' }], categoryId: [{ required: true, message: '不能为空', trigger: 'change' }],
talkTitle: [{ required: true, message: '不能为空', trigger: 'blur' }], talkTitle: [{ required: true, message: '不能为空', trigger: 'blur' }]
}), }),
type: undefined, type: undefined,
dialogVisible: false, // 新建素材表格对话框显隐 dialogVisible: false, // 新建素材表格对话框显隐
...@@ -206,7 +214,7 @@ export default { ...@@ -206,7 +214,7 @@ export default {
welcomVisible: false, welcomVisible: false,
fontType: '', fontType: '',
maxlength: 9, maxlength: 9,
libraryLoading: false, libraryLoading: false
} }
}, },
props: { props: {
...@@ -215,82 +223,88 @@ export default { ...@@ -215,82 +223,88 @@ export default {
default: () => { default: () => {
return { return {
templateInfo: '', templateInfo: '',
attachments: [], attachments: []
}
} }
},
}, },
// 最多上传的素材数 // 最多上传的素材数
maxlengthTwo: { maxlengthTwo: {
type: Number, type: Number,
default: 9, default: 9
}, },
// 查询会话详情的id // 查询会话详情的id
talkId: { talkId: {
type: string, type: string,
default: null, default: null
}, },
// 查询模板中心详情的id // 查询模板中心详情的id
modelId: { modelId: {
type: string, type: string,
default: null, default: null
}, },
// 话术类形 0企业话术1客服话术 // 话术类形 0企业话术1客服话术
talkType: { talkType: {
type: string, type: string,
default: null, default: null
}, },
// 1欢迎语 2群发 3sop // 1欢迎语 2群发 3sop
templateType: { templateType: {
type: Number, type: Number,
default: 1, default: 1
}, },
// 1:活码欢迎语;2:员工欢迎语;3:入群欢迎语 // 1:活码欢迎语;2:员工欢迎语;3:入群欢迎语
tplType: { tplType: {
type: String, type: String,
default: null, default: null
}, },
// 模块类型 1:素材;2:话术;3:模板;4:其他模块 // 模块类型 1:素材;2:话术;3:模板;4:其他模块
moduleType: { moduleType: {
type: Number, type: Number,
default: 4, default: 4
}, },
// 是否为欢迎语模板 // 是否为欢迎语模板
iswelcom: { iswelcom: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// 是否显示模板库 // 是否显示模板库
showModle: { showModle: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
// 1.员工活码;2:企微营销;3:企业动态;4:门店活码 // 1.员工活码;2:企微营销;3:企业动态;4:门店活码
otherType: { otherType: {
type: Number, type: Number,
default: null, default: null
}, },
// 是否显示手机 // 是否显示手机
showPhone: { showPhone: {
type: Boolean, type: Boolean,
default: true, default: true
}, },
// 直播链接 // 直播链接
liveUrl: { liveUrl: {
type: String, type: String,
default: null, default: null
}, },
// 是否显示提交取消按钮 // 是否显示提交取消按钮
showFooter: { showFooter: {
type: Boolean, type: Boolean,
default: true, default: true
}, }
}, },
watch: { watch: {
talkForm: {
handler(val) {
this.changeInfo(val.templateInfo)
},
deep: true
},
maxlengthTwo: { maxlengthTwo: {
handler(val) { handler(val) {
this.maxlength = val this.maxlength = val
}, },
immediate: true, immediate: true
}, },
baseData(val) { baseData(val) {
if (val.templateInfo) { if (val.templateInfo) {
...@@ -310,7 +324,7 @@ export default { ...@@ -310,7 +324,7 @@ export default {
this.getDeatil(val) this.getDeatil(val)
} }
}, },
immediate: true, immediate: true
}, },
modelId: { modelId: {
handler(val) { handler(val) {
...@@ -318,8 +332,8 @@ export default { ...@@ -318,8 +332,8 @@ export default {
this.getTelDeatil(val) this.getTelDeatil(val)
} }
}, },
immediate: true, immediate: true
}, }
}, },
methods: { methods: {
changeInfo(val) { changeInfo(val) {
...@@ -477,7 +491,7 @@ export default { ...@@ -477,7 +491,7 @@ export default {
arr = this.talkForm.userIds.split(',').map((dd, index) => { arr = this.talkForm.userIds.split(',').map((dd, index) => {
return { return {
userId: dd, userId: dd,
name: this.talkForm.userNames.split(',')[index], name: this.talkForm.userNames.split(',')[index]
} }
}) })
} }
...@@ -490,7 +504,7 @@ export default { ...@@ -490,7 +504,7 @@ export default {
arr = this.talkForm.userIds.split(',').map((dd, index) => { arr = this.talkForm.userIds.split(',').map((dd, index) => {
return { return {
userId: dd, userId: dd,
name: this.talkForm.userNames.split(',')[index], name: this.talkForm.userNames.split(',')[index]
} }
}) })
} }
...@@ -505,7 +519,7 @@ export default { ...@@ -505,7 +519,7 @@ export default {
names.push(d.name) names.push(d.name)
return { return {
userId: d.userId, userId: d.userId,
name: d.name, name: d.name
} }
}) })
this.users = selectedUserList this.users = selectedUserList
...@@ -584,8 +598,8 @@ export default { ...@@ -584,8 +598,8 @@ export default {
parentId: '0', parentId: '0',
hasParent: false, hasParent: false,
hasChildren: true, hasChildren: true,
children: data || [], children: data || []
}, }
] ]
}) })
}, },
...@@ -794,7 +808,7 @@ export default { ...@@ -794,7 +808,7 @@ export default {
this.dealOtherModleType(talkForm) this.dealOtherModleType(talkForm)
} }
this.$emit('update', talkForm) this.$emit('update', talkForm)
}, }
}, },
mounted() { mounted() {
if (this.$route.query.categoryId) { if (this.$route.query.categoryId) {
...@@ -820,12 +834,12 @@ export default { ...@@ -820,12 +834,12 @@ export default {
} else { } else {
this.fontType = '素材' this.fontType = '素材'
} }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .ql-editor { ::v-deep .ql-editor {
min-height: 200px; min-height: 200px;
.ql-container { .ql-container {
.ql-snow { .ql-snow {
...@@ -834,31 +848,31 @@ export default { ...@@ -834,31 +848,31 @@ export default {
} }
} }
} }
} }
::v-deep .el-button.is-disabled { ::v-deep .el-button.is-disabled {
color: var(--font-white, #fff); color: var(--font-white, #fff);
background-color: var(--bg-black-8); background-color: var(--bg-black-8);
border-color: #cccccc; border-color: #cccccc;
} }
::v-deep.el-dropdown [disabled] { ::v-deep.el-dropdown [disabled] {
color: var(--font-white, #fff); color: var(--font-white, #fff);
background-color: var(--bg-black-8); background-color: var(--bg-black-8);
border-color: #cccccc; border-color: #cccccc;
} }
.footer { .footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.footerColor { .footerColor {
font-weight: 500; font-weight: 500;
font-size: 18px; font-size: 18px;
color: var(--color); color: var(--color);
margin: 0 4px; margin: 0 4px;
} }
.radius { .radius {
border-radius: 4px; border-radius: 4px;
} }
.boxClass { .boxClass {
padding: 20px 10px 0 0; padding: 20px 10px 0 0;
} }
</style> </style>
...@@ -196,6 +196,9 @@ ...@@ -196,6 +196,9 @@
return return
} }
this.loading = true this.loading = true
if (this.form.attachments == null) {
this.form.attachments = []
}
this.form.attachments.unshift({ this.form.attachments.unshift({
content: this.templateInfo, content: this.templateInfo,
msgType: 'text' msgType: 'text'
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
@click=" @click="
$router.push({ $router.push({
path: 'detail', path: 'detail',
query: { id: row.id } query: { linkId: row.linkId, id: row.id }
}) })
" "
> >
......
...@@ -73,18 +73,20 @@ ...@@ -73,18 +73,20 @@
userNames: '', userNames: '',
dialogVisible: false, dialogVisible: false,
userArray: [], userArray: [],
list: [] list: [],
tableSearch: {}
} }
}, },
components: { components: {
SearchTitle SearchTitle
}, },
created() { created() {
this.query.linkId = this.$route.query.id this.query.linkId = this.$route.query.linkId
}, },
methods: { methods: {
getData(data) { getData(data) {
this.query.linkId = this.$route.query.id this.tableSearch = data
this.query.linkId = this.$route.query.linkId
getCustomerInLink(Object.assign({}, this.query, data)).then((res) => { getCustomerInLink(Object.assign({}, this.query, data)).then((res) => {
this.list = res.rows this.list = res.rows
this.total = res.total this.total = res.total
...@@ -109,6 +111,11 @@ ...@@ -109,6 +111,11 @@
return obj.userId return obj.userId
}) })
.join(',') .join(',')
this.query.pageNum = 1
getCustomerInLink(Object.assign({}, this.query, this.tableSearch)).then((res) => {
this.list = res.rows
this.total = res.total
})
} }
}, },
created() {} created() {}
......
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
} }
}, },
created() { created() {
this.id = this.$route.query.id this.id = this.$route.query.linkId
this.getTabTotalFn() this.getTabTotalFn()
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!