Commit beee0f63 by 前端

Merge branch 'kuangyq_dev_v2.0.0' into 'v2.0.0'

Kuangyq dev v2.0.0

See merge request !17
2 parents e167aa26 12799a45
...@@ -832,9 +832,15 @@ ...@@ -832,9 +832,15 @@
} }
}, },
"@babel/runtime-corejs3": { "@babel/runtime-corejs3": {
<<<<<<< HEAD
"version": "7.17.7",
"resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.17.7.tgz",
"integrity": "sha512-TvliGJjhxis5m7xIMvlXH/xG8Oa/LK0SCUCyfKD6nLi42n5fB4WibDJ0g9trmmBB6hwpMNx+Lzbxy9/4gpMaVw==",
=======
"version": "7.17.2", "version": "7.17.2",
"resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.17.2.tgz", "resolved": "https://registry.npmmirror.com/@babel/runtime-corejs3/-/runtime-corejs3-7.17.2.tgz",
"integrity": "sha512-NcKtr2epxfIrNM4VOmPKO46TvDMCBhgi2CrSHaEarrz+Plk2K5r9QemmOFTGpZaoKnWoGH5MO+CzeRsih/Fcgg==", "integrity": "sha512-NcKtr2epxfIrNM4VOmPKO46TvDMCBhgi2CrSHaEarrz+Plk2K5r9QemmOFTGpZaoKnWoGH5MO+CzeRsih/Fcgg==",
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
"requires": { "requires": {
"core-js-pure": "^3.20.2", "core-js-pure": "^3.20.2",
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
...@@ -842,7 +848,11 @@ ...@@ -842,7 +848,11 @@
"dependencies": { "dependencies": {
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.9", "version": "0.13.9",
<<<<<<< HEAD
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
=======
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
} }
} }
...@@ -3519,7 +3529,11 @@ ...@@ -3519,7 +3529,11 @@
}, },
"core-js-pure": { "core-js-pure": {
"version": "3.21.1", "version": "3.21.1",
<<<<<<< HEAD
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz",
=======
"resolved": "https://registry.npmmirror.com/core-js-pure/-/core-js-pure-3.21.1.tgz", "resolved": "https://registry.npmmirror.com/core-js-pure/-/core-js-pure-3.21.1.tgz",
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
"integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ==" "integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ=="
}, },
"core-util-is": { "core-util-is": {
...@@ -12054,7 +12068,11 @@ ...@@ -12054,7 +12068,11 @@
}, },
"wangeditor": { "wangeditor": {
"version": "4.7.12", "version": "4.7.12",
<<<<<<< HEAD
"resolved": "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.12.tgz",
=======
"resolved": "https://registry.npmmirror.com/wangeditor/-/wangeditor-4.7.12.tgz", "resolved": "https://registry.npmmirror.com/wangeditor/-/wangeditor-4.7.12.tgz",
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
"integrity": "sha512-5KOIpQ0+idKvDTkjZOp7RHYXA97FyJ9mjwy+zQUdMUCqZItlEXzvVOYtOlHkJr/HcbwgIz/7f/trGFggZK5X4g==", "integrity": "sha512-5KOIpQ0+idKvDTkjZOp7RHYXA97FyJ9mjwy+zQUdMUCqZItlEXzvVOYtOlHkJr/HcbwgIz/7f/trGFggZK5X4g==",
"requires": { "requires": {
"@babel/runtime": "^7.11.2", "@babel/runtime": "^7.11.2",
...@@ -12063,21 +12081,35 @@ ...@@ -12063,21 +12081,35 @@
}, },
"dependencies": { "dependencies": {
"@babel/runtime": { "@babel/runtime": {
<<<<<<< HEAD
"version": "7.17.7",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.7.tgz",
"integrity": "sha512-L6rvG9GDxaLgFjg41K+5Yv9OMrU98sWe+Ykmc6FDJW/+vYZMhdOMKkISgzptMaERHvS2Y2lw9MDRm2gHhlQQoA==",
=======
"version": "7.17.2", "version": "7.17.2",
"resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.17.2.tgz", "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.17.2.tgz",
"integrity": "sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==", "integrity": "sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==",
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
} }
}, },
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.9", "version": "0.13.9",
<<<<<<< HEAD
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
=======
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", "resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
}, },
"tslib": { "tslib": {
"version": "2.3.1", "version": "2.3.1",
<<<<<<< HEAD
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
=======
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.1.tgz", "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.1.tgz",
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
} }
} }
......
import { http } from '@/main'
const defaultPath = 'marketing.api.material.'
//获取素材组列表
const getMaterialList = params => {
params.method = `${defaultPath}group.list`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//删除素材组列表
const deleteMaterialList = params => {
params.method = `${defaultPath}group.delete`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//素材组详情
const materialGroupDetail = params => {
params.method = `${defaultPath}group.detail`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材组创建
const addMaterialGroup = params => {
params.method = `${defaultPath}group.insert`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材组编辑
const editMaterialGroup = params => {
params.method = `${defaultPath}group.update`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//素材删除
const materialDelete = params => {
params.method = `${defaultPath}delete`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//素材详情
const materialDetail = params => {
params.method = `${defaultPath}detail`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材列表
const materialList = params => {
params.method = `${defaultPath}page`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材创建
const materialInsert = params => {
params.method = `${defaultPath}insert`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材编辑
const materialEdit = params => {
params.method = `${defaultPath}update`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 素材详情阅读人员明细
const readDetailPage = params => {
params.method = `${defaultPath}customerReadDetailPage`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
// 素材详情数据概览
const dataOverview = params => {
params.method = `${defaultPath}dataOverview`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
// 素材详情阅读人员明细
const sendDetailPage = params => {
params.method = `${defaultPath}employeeSendDetailPage`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
const findAllDictData = params => {
params.method = 'merchants.api.menu.findAllDictData'
return http({
url: 'http://rop-merchant.dev.glsx.com.cn/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getMaterialList,
deleteMaterialList,
materialGroupDetail,
addMaterialGroup,
materialDelete,
materialDetail,
materialList,
materialEdit,
materialInsert,
editMaterialGroup,
readDetailPage,
dataOverview,
sendDetailPage,
findAllDictData
}
\ No newline at end of file \ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span> <span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'"> <div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)"> <el-input :placeholder="item.placeholder || '请输入' + item.label" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span> <span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span> <span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input> </el-input>
......
...@@ -12,7 +12,7 @@ module.exports = { ...@@ -12,7 +12,7 @@ module.exports = {
response: { response: {
data_key: 'data', data_key: 'data',
message_key: 'message', message_key: 'message',
code_key: 'code', code_key: ['code', 'returnCode'],
code_success_value: '0', code_success_value: '0',
errId_logout_value: '21', errId_logout_value: '21',
code_message_map: {} code_message_map: {}
...@@ -21,6 +21,34 @@ module.exports = { ...@@ -21,6 +21,34 @@ module.exports = {
// baseURL: 'http://scrm.test.glsx.com.cn/', // baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/', // baseURL: 'http://192.168.2.42:8064/',
baseURL: 'http://scrm.dev.glsx.com.cn/', baseURL: 'http://scrm.dev.glsx.com.cn/',
<<<<<<< HEAD
// baseURL: 'http://192.168.1.78:8065/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request2: {
// baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
baseURL: 'http://ismv.branch.glsx.com.cn/',
// baseURL: 'http://192.168.1.78:8065/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request_common: {
// baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
baseURL: 'http://didicb.glsx.com.cn/',
// baseURL: 'http://192.168.1.78:8065/',
=======
>>>>>>> e167aa26c7dfce32bd8ee294ac3a9ce110d8b8fa
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -40,6 +68,12 @@ module.exports = { ...@@ -40,6 +68,12 @@ module.exports = {
format: 'json', format: 'json',
source: '' source: ''
}, },
sign_common: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: 'glsx'
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static' cdn: 'https://www.xxx.cn/static'
......
...@@ -267,7 +267,11 @@ const staticRoutes = Object.freeze([{ ...@@ -267,7 +267,11 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/material/materialDetail.vue`], resolve), component: resolve => require([`@/views/material/materialDetail.vue`], resolve),
meta: {} meta: {}
}, },
//朋友圈营销 {
name: 'addMaterial',
path: '/material/addMaterial',
component: resolve => require([`@/views/material/addMaterial.vue`], resolve),
},
{ {
name: 'friendGroup', name: 'friendGroup',
path: '/friendGroup/index', path: '/friendGroup/index',
......
...@@ -15,7 +15,7 @@ Vue.use(ElementUI) ...@@ -15,7 +15,7 @@ Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request2, sign, secret, sign_common, request_common } = await fetchConfig() const { response, request, request2, sign, secret, sign_common, request_common } = await fetchConfig(false)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -195,7 +195,11 @@ export default { ...@@ -195,7 +195,11 @@ export default {
}) })
}, },
merchantOpen() { merchantOpen() {
this.$apis.customerTransform.merchantOpen({ merchantId: this.$globalState.session.merchantId }).then(res => { let channel = null
if (location.host == 'scrm.cgacar.com') {
channel = 2
}
this.$apis.customerTransform.merchantOpen({ merchantId: this.$globalState.session.merchantId, channel }).then(res => {
this.openFlag = res.openFlag this.openFlag = res.openFlag
}) })
}, },
......
<template> <template>
<div class="container"> <div class="container">
<el-form ref=" " :model="materialAddForm" label-width="146px" :rules="materialAddFormRules"> <el-form ref="materialAddForm" :model="materialAddForm" label-width="146px" :rules="materialAddFormRules">
<div class="creat-material"> <div class="creat-material">
<h4>{{ title }}</h4> <h4>{{ title }}</h4>
<el-divider></el-divider> <el-divider></el-divider>
<el-form-item label="选择素材组:" prop="selectMaterialGroup"> <el-form-item v-if="routeInfo.addOrEdit == 1" label="选择素材组:" prop="selectMaterialGroup">
<el-select v-model="materialAddForm.selectMaterialGroup" placeholder="请选择" :size="size"> <el-select v-model="materialAddForm.groupId" placeholder="全部" :size="size">
<el-option label="区域一" value="shanghai"></el-option> <el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
<el-option label="区域二" value="beijing"></el-option> </el-select>
</el-form-item>
<el-form-item v-else label="选择素材组:">
<el-select v-model="materialAddForm.groupName" placeholder="全部" :size="size" disabled>
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="素材名称:" prop="materialName"> <el-form-item label="素材名称:" prop="materialName">
<el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入内容"></el-input> <el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入素材名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="素材类型:" prop="materialType"> <el-form-item label="素材类型:" prop="materialType">
<el-radio-group v-model="materialAddForm.materialType" @change="radioChange"> <el-radio-group v-model="materialAddForm.materialType" @change="radioChange">
<el-radio :label="1">PDF文件</el-radio> <el-radio :label="1">PDF文件</el-radio>
<el-radio :label="2">自定义链接</el-radio> <!-- <el-radio :label="2">自定义链接</el-radio> -->
<el-radio :label="3">图文</el-radio> <el-radio :label="3">图文</el-radio>
</el-radio-group> </el-radio-group>
<!-- 选择PDF --> <!-- 选择PDF -->
<div v-show="materialAddForm.materialType == 1"> <div v-show="materialAddForm.materialType == 1">
<el-upload action="https://jsonplaceholder.typicode.com/posts/" accept=".pdf" show-file-list :on-remove="handleRemove" :on-success="handleSuccess" :on-error="handleError" :limit="1" :on-exceed="handleExceed" :file-list="fileList"> <div class="pdf-show">
<el-button type="info" icon="el-icon-plus" :size="size">上传PDF文件</el-button> <input type="file" style="opacity: 0" accept=".pdf" @change="e => handlePdfChange(e)" />
<span>支持10M以内的文件</span> <el-button icon="el-icon-plus" :size="size">选择文件</el-button>
</el-upload> </div>
<div v-if="pdfUrl">{{ pdfUrl }}</div>
</div> </div>
<!-- 选择自定义链接 --> <!-- 选择自定义链接 -->
<div v-show="materialAddForm.materialType == 2"> <!-- <div v-show="materialAddForm.materialType == 2">
<el-form :model="linkForm" :rules="linkRules" ref="linkForm" label-width="100px"> <el-form :model="linkForm" :rules="linkRules" ref="linkForm" label-width="100px">
<el-form-item label="链接地址" prop="link"> <el-form-item label="链接地址" prop="link">
<el-input v-model="linkForm.link" placeholder="请填写跳转链接" maxlength="150" show-word-limit></el-input> <el-input v-model="linkForm.link" placeholder="请填写跳转链接" maxlength="150" show-word-limit></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div> -->
<!-- 选择图文 --> <!-- 选择图文 -->
<div v-show="materialAddForm.materialType == 3"> <div v-show="materialAddForm.materialType == 3">
<textBox></textBox> <textBox @change="writeChange" ref="textBox"></textBox>
</div> </div>
<div class="space"></div>
</el-form-item> </el-form-item>
</div> </div>
<div class="track"> <div class="track">
<h4>追踪设置</h4> <h4>追踪设置</h4>
<el-divider></el-divider> <el-divider></el-divider>
<el-form-item label="业务类型:" prop="applicationType"> <el-form-item prop="businessType">
<el-checkbox-group v-model="materialAddForm.applicationType"> <span slot="label">
<el-checkbox v-for="(value, index) in businessTypes" :key="index" :label="index">{{ value }}</el-checkbox> <span>
业务类型
<el-popover placement="top-start" width="200" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<img slot="reference" src="@/assets/question.png" alt="" />
</el-popover>
:
</span>
</span>
<el-checkbox-group v-model="materialAddForm.businessType">
<el-checkbox v-for="value in businessTypes" :key="value.dictValue" :label="value.dictValue">{{ value.dictLabel }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="动态通知:" prop="notification"> <el-form-item prop="isNotifySender">
<el-radio v-model="materialAddForm.notification">客户打开素材链接时通知发送人</el-radio> <span slot="label">
<span>
动态通知
<el-popover placement="top-start" width="200" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<img slot="reference" src="@/assets/question.png" alt="" />
</el-popover>
:
</span>
</span>
<el-checkbox v-model="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">客户打开素材链接时通知发送人</el-checkbox>
<span class="track-tips track-info">(客户不包括本商户的员工)</span> <span class="track-tips track-info">(客户不包括本商户的员工)</span>
</el-form-item> </el-form-item>
<el-form-item label="行为标签:" prop="behaviorTag"> <el-form-item prop="tagJson">
<span slot="label">
<span>
行为标签
<el-popover placement="top-start" width="200" trigger="hover" content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
<img slot="reference" src="@/assets/question.png" alt="" />
</el-popover>
:
</span>
</span>
<span class="track-behavior">客户打开素材/链接时通知发送人</span> <span class="track-behavior">客户打开素材/链接时通知发送人</span>
<span class="track-tips">(最多支持3个标签)</span> <span class="track-tips track-info">(最多支持3个标签)</span>
<!-- 选择标签展示 --> <!-- 选择标签展示 -->
<div> <div>
<span></span> <el-button :size="size" @click="openLabel">
<el-button :size="size">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
选择标签 选择标签
</el-button> </el-button>
</div> </div>
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag>
</span>
</div>
<div class="space"></div>
</el-form-item> </el-form-item>
</div> </div>
<div class="share"> <div class="share">
...@@ -84,43 +122,74 @@ ...@@ -84,43 +122,74 @@
</div> </div>
<el-divider></el-divider> <el-divider></el-divider>
<div class="share-desc" v-show="descVisible"> <div class="share-desc" v-show="descVisible">
<div class="share-desc-left">
<el-form-item label="分享标题:"> <el-form-item label="分享标题:">
<el-input v-model="materialAddForm.title" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义标题"></el-input> <el-input v-model="materialAddForm.materialTitle" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义标题"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述:"> <el-form-item label="描述:">
<el-input type="textarea" v-model="materialAddForm.desc" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义描述"></el-input> <el-input type="textarea" v-model="materialAddForm.description" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="封面:"> <el-form-item label="封面:">
<el-upload class="avatar-uploader" accept=".jpg, .jpeg, png" action="https://jsonplaceholder.typicode.com/posts/" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"> <div class="img-div">
<img v-if="imageUrl" :src="materialAddForm.imageUrl" class="avatar" /> <div class="put-img" v-show="materialAddForm.titleUrl">
<div v-else class="avatar-uploader-desc"> <img :src="materialAddForm.titleUrl" alt="" />
<div class="mask" v-if="materialAddForm.titleUrl">
<h3>
<el-popover
placement="top"
trigger="click">
<div>
<img class="img-plus" :src="materialAddForm.titleUrl" alt="">
</div>
<img slot="reference" src="@/assets/material/view.png" alt="" />
</el-popover>
<img src="@/assets/material/dele.png" alt="" @click="deleteImg" />
</h3>
</div>
</div>
<div class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i> <i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div> <div class="avatar-uploader-desc-word">上传照片</div>
<input type="file" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" />
</div>
<div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div>
</div> </div>
</el-upload>
<span>查看效果></span>
</el-form-item> </el-form-item>
</div> </div>
<div class="share-desc-right" v-show="phoneVisible">
<div class="share-desc-right-box">
<img class="share-desc-right-box-phone" src="@/assets/material/phone.png" alt="" />
<div class="content-show">
<div>
<div class="content-title">{{ materialAddForm.materialTitle }}</div>
<div class="content-word">{{ materialAddForm.description }}</div>
</div>
<div class="content-show-img" v-show="materialAddForm.titleUrl">
<img :src="materialAddForm.titleUrl" alt="" />
</div>
</div>
</div>
</div> </div>
<div class="material-bottom">
<el-form-item>
<div class="btns">
<el-button @click="onSave" :size="size">存草稿</el-button>
<el-button :size="size" @click="handleSubmit" type="primary">确定</el-button>
<el-button :size="size" @click="handleCancel" type="primary">取消</el-button>
</div> </div>
</el-form-item>
</div> </div>
</el-form> </el-form>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :dialogVisible="dialogVisible"></SelectLabel>
<GLFooter>
<el-button @click="onSave">存草稿</el-button>
<el-button @click="handleCancel" class="btn-cancle">取消</el-button>
<el-button @click="handleSubmit" type="primary">确定</el-button>
</GLFooter>
</div> </div>
</template> </template>
<script> <script>
import textBox from '@/views/material/components/textBox' import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable'
export default { export default {
name: 'addMaterialForm', name: 'addMaterialForm',
components: { components: {
textBox textBox,
SelectLabel
}, },
data() { data() {
return { return {
...@@ -129,33 +198,39 @@ export default { ...@@ -129,33 +198,39 @@ export default {
1: '创建营销素材', 1: '创建营销素材',
2: '编辑营销素材' 2: '编辑营销素材'
}, },
routeInfo: {},
dialogVisible: false,
tagging: [],
urlSrc: '',
pdfUrl: '',
textBoxContent: '',
materialAddForm: { materialAddForm: {
selectMaterialGroup: '', groupId: '',
groupName: '',
materialName: '', materialName: '',
materialType: '', materialType: '',
applicationType: [], materialUrl: '',
notification: '', businessType: [],
behaviorTag: [], isNotifySender: false,
title: '', tagJson: [],
desc: '', materialTitle: '',
imageUrl: '' description: '',
}, titleUrl: ''
// 素材类型--链接
linkForm: {
link: ''
}, },
fileList: [], groupCounter: [],
// 分享设置显示 // 分享设置显示
descVisible: false, descVisible: false,
businessTypes: ['整车/新车', '保养', '维修', '车险', '二手车', '改装', '汽车金融', '零配件/精品', '通用(节假日等关怀素材)'], // 手机显示
phoneVisible: false,
businessTypes: [],
materialAddFormRules: { materialAddFormRules: {
selectMaterialGroup: [{ required: true, message: '请选择素材组', trigger: 'change' }], selectMaterialGroup: [{ required: true, message: '请选择素材组', trigger: 'change' }],
materialName: [ materialName: [
{ required: true, message: '请输入素材名称', trigger: 'change' }, { required: true, message: '请输入素材名称', trigger: 'change' },
{ max: 5, message: '素材名称长度不能超过30', trigger: 'blur' } { max: 30, message: '素材名称长度不能超过30', trigger: 'blur' }
], ],
materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }], materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }],
applicationType: [{ required: true, message: '请选择业务类型', trigger: 'change' }] businessType: [{ required: true, message: '请选择业务类型', trigger: 'change' }]
}, },
linkRules: { linkRules: {
link: [ link: [
...@@ -167,32 +242,223 @@ export default { ...@@ -167,32 +242,223 @@ export default {
}, },
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
console.log(this.routeInfo, '1111')
this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : ''
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
// this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.materialInsert()
this.getMaterialList()
this.findAllDictData('business_type')
}, },
methods: { methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.materialAddForm))
params.businessType = params.businessType.toString()
return params
},
// 获取素材详情
getMaterialInfo() {
var params = {}
params.id = this.routeInfo.id
this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res
if (this.materialAddForm.businessType) {
const businessTypeArr = this.materialAddForm.businessType.split(',')
this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item))
} else {
this.materialAddForm.businessType = []
}
if (this.materialAddForm.materialType == 3) {
this.materialAddForm.materialUrl = decodeURIComponent(this.materialAddForm.materialUrl)
this.$refs.textBox.setEdit(this.materialAddForm.materialUrl)
} else if (this.materialAddForm.materialType == 1) {
this.pdfUrl = this.materialAddForm.materialUrl
}
if (this.materialAddForm.tagJson) {
this.taggingList = eval(this.materialAddForm.tagJson)
this.tagging = this.taggingList.map(item => {
return {
labelGroup: {
id: item.groupId,
name: item.groupName
},
labelList: [
{
id: item.labelId,
name: item.labelName
}
],
labelType: item.groupType
}
})
}
if (res.isNotifySender == 0) {
this.materialAddForm.isNotifySender = true
} else {
this.materialAddForm.isNotifySender = false
}
})
},
// 获取全部素材组
getMaterialList() {
this.$apis.material.getMaterialList({}).then(res => {
console.log(res, 'datadata')
this.groupCounter = res
})
},
// 创建素材组
materialInsert() {
var params = {}
params.isDefault = 0
this.$apis.material.addMaterialGroup(params).then(res => {
if (res) {
this.getMaterialList()
}
})
},
// 获取所有业务类型
findAllDictData(dictType) {
var params = {
dictType
}
this.$apis.material.findAllDictData(params).then(res => {
if (res) {
if (dictType == 'business_type') {
this.businessTypes = res
}
}
})
},
// 素材类型切换 // 素材类型切换
radioChange(value) { radioChange(value) {
console.log(value) console.log(value)
this.materialAddForm.materialType = value this.materialAddForm.materialType = value
}, },
// 素材类型上传PDF,移除 // 是否通知
handleRemove() {}, notifyChange() {
// 素材类型上传PDF,上传成功 this.materialAddForm.isNotifySender = !this.materialAddForm.isNotifySender
handleSuccess() {}, },
// 素材类型上传PDF,上传失败 // 上传PDF
handleError() {}, handlePdfChange(e) {
// 素材类型上传PDF,超出限制 console.log(e)
handleExceed() {}, var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认10MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传PDF大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.pdfUrl = res
}
})
}
},
// 上传图片
handleImgChange(e) {
var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 1
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
this.materialAddForm.titleUrl = res
}
})
}
},
// 存草稿 // 存草稿
onSave() {}, onSave() {
this.$refs.materialAddForm.validate(valid => {
if (valid) {
var params = this.getParams()
params.status = 1
params.isNotifySender = -1
params.tagJson = JSON.stringify(this.taggingList)
if (this.materialAddForm.isNotifySender) {
params.isNotifySender = 0
}
if (params.materialType == 1) {
params.materialUrl = this.pdfUrl
} else if (params.materialType == 3) {
this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent
}
let material
if (params.id) {
material = 'materialEdit'
} else {
material = 'materialInsert'
}
this.$apis.material[material](params).then(res => {
if (res) {
this.$message({
message: '保存成功',
type: 'success'
})
this.$router.push({
path: '/material/index'
})
}
return
})
} else {
return false
}
})
},
// 提交 // 提交
handleSubmit() { handleSubmit() {
this.$refs.materialAddform.validate(valid => { this.$refs.materialAddForm.validate(valid => {
console.log(this.textBoxContent, 'text');
if (valid) { if (valid) {
alert('submit!') var params = this.getParams()
params.status = 0
params.isNotifySender = -1
params.tagJson = JSON.stringify(this.taggingList)
if (this.materialAddForm.isNotifySender) {
params.isNotifySender = 0
}
if (params.materialType == 1) {
params.materialUrl = this.pdfUrl
} else if (params.materialType == 3) {
this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent
}
let material
if (params.id) {
material = 'materialEdit'
} else {
material = 'materialInsert'
}
this.$apis.material[material](params).then(res => {
if (res) {
this.$message({
message: '创建成功',
type: 'success'
})
this.$router.push({
path: '/material/index'
})
}
})
} else { } else {
console.log('error submit!!')
return false return false
} }
}) })
...@@ -204,12 +470,113 @@ export default { ...@@ -204,12 +470,113 @@ export default {
// 分享设置展示 // 分享设置展示
shareContainerShow() { shareContainerShow() {
this.descVisible = !this.descVisible this.descVisible = !this.descVisible
},
// 获取富文本框内容
writeChange(val) {
this.textBoxContent = val
},
// 打开标签
openLabel() {
this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init(this.tagging)
},
handleSelect(val) {
this.isUpdate = true
this.tagging = val
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
console.log(this.taggingList)
console.log(val, '1')
console.log(this.tagging, '2')
},
// 删除标签
removeTag(tag, idx1, idx) {
console.log(tag, 'tag')
// this.tagging.splice(idx, 1)
tag.labelList.splice(idx1, 1)
if (tag.labelList.length == 0) {
this.tagging.splice(idx, 1)
// this.taggingList.splice(idx, 1)
}
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
this.isUpdate = true
// this.$refs.selectLabel.init(this.tagging)
},
// 删除上传图片
deleteImg() {
this.materialAddForm.titleUrl = ''
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px 5px 0px 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 450px;
display: flex;
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
margin-bottom: 5px;
// background: #fff !important;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.creat-material, .creat-material,
.track, .track,
.share, .share,
...@@ -235,6 +602,9 @@ export default { ...@@ -235,6 +602,9 @@ export default {
} }
} }
} }
.space {
margin-bottom: 32px;
}
.track { .track {
&-tips { &-tips {
...@@ -242,7 +612,7 @@ export default { ...@@ -242,7 +612,7 @@ export default {
color: #999999; color: #999999;
} }
&-info { &-info {
margin-left: -28px; margin-left: 8px;
} }
&-behavior { &-behavior {
color: #606266; color: #606266;
...@@ -279,16 +649,6 @@ export default { ...@@ -279,16 +649,6 @@ export default {
margin-left: 0; margin-left: 0;
} }
} }
.btns {
.el-button {
padding: 10px 24px;
margin-left: 20px;
&:nth-child(1) {
margin-left: 0;
padding: 10px 17px;
}
}
}
} }
.el-input--small, .el-input--small,
...@@ -296,40 +656,164 @@ export default { ...@@ -296,40 +656,164 @@ export default {
.el-select--small { .el-select--small {
width: 411px; width: 411px;
} }
.btn-cancle {
.avatar-uploader, border-color: #5850ff;
.el-upload { color: #5850ff;
border: 1px dashed #d9d9d9; }
.put-img,
.avatar-uploader-desc,
.view-phone {
float: left;
margin-right: 8px;
.task {
width: 104px;
height: 104px; height: 104px;
border-radius: 10px;
}
}
.put-img {
width: 104px; width: 104px;
border-radius: 6px; height: 104px;
cursor: pointer; border-radius: 10px;
display: inline-block;
position: relative; position: relative;
overflow: hidden; img {
width: 104px;
height: 104px;
}
.mask {
position: absolute;
background: rgba(101, 101, 101, 0.6);
color: #ffffff;
opacity: 0;
top: 0;
right: 0;
width: 100%;
height: 100%;
border-radius: 10px;
h3 {
text-align: center;
margin-top: 30%;
margin-left: 2px;
img {
width: 16px;
height: 16px;
}
:last-child {
padding-left: 12px;
}
}
}
} }
.avatar-uploader, .tag-show {
.el-upload:hover { margin-right: 8px;
border: 1px dashed rgba(0, 0, 0, 0.15);
} }
.avatar-uploader-desc { .put-img:hover .mask {
opacity: 1;
}
.pdf-show {
display: inline-flex;
position: relative;
width: 109px;
height: 32px;
input {
position: absolute; position: absolute;
top: 50%; top: 0;
left: 50%; left: 0;
transform: translate(-50%, -50%); width: 100% !important;
height: 100%;
}
}
.avatar-uploader-desc {
width: 104px;
height: 104px;
border-radius: 4px;
border: 1px dashed rgba(0, 0, 0, 0.15);
position: relative;
&-icon { &-icon {
font-size: 24px; width: 16px;
color: #8c939d; height: 16px;
position: absolute;
top: 28px;
left: 44px;
} }
&-word { &-word {
width: 78px; position: absolute;
height: 22px; top: 58px;
font-size: 14px; left: 24px;
color: #666666; color: #666666;
} }
input {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
}
.view-phone {
margin-top: 75px;
color: #5850ff;
} }
.avatar { .avatar {
width: 178px; width: 178px;
height: 178px; height: 178px;
display: block; display: block;
} }
.share-desc {
padding-bottom: 30px;
display: flex;
justify-content: space-between;
&-right-box {
margin-right: 20px;
width: 290px;
height: 566px;
position: relative;
&-phone {
width: 290px;
height: 566px;
}
.content-show {
width: 150px;
height: 52px;
padding: 10px 10px;
box-sizing: border-box;
position: absolute;
top: 375px;
left: 79px;
display: flex;
justify-content: space-between;
&-img {
width: 30px;
height: 30px;
img {
width: 30px;
height: 30px;
}
}
.content-title {
max-width: 100px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
font-size: 10px;
margin-bottom: 4px;
}
.content-word {
max-width: 100px;
font-size: 8px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
word-wrap: break-word;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
}
.img-plus {
width: 200px;
height: 200px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div> <div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="!dialogVisible"> <el-dialog :title="title" :visible.sync="dialogVisible" width="720px" :before-close="!dialogVisible">
<el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="120px" :rules="materialGroupAddRules"> <el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="110px" :rules="materialGroupAddRules">
<el-form-item label="分组名称:" prop="groupName"> <el-form-item label="分组名称:" prop="materialGroupName">
<el-input v-model="materialGroupAddForm.groupName" maxlength="8" show-word-limit></el-input> <el-input v-model="materialGroupAddForm.materialGroupName" maxlength="8" show-word-limit :size="size" placeholder="请输入分组名称" style="width: 567px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="业务类型:" prop="businessType"> <el-form-item label="业务类型:" prop="businessType">
<el-checkbox-group v-model="materialGroupAddForm.businessType" @change="handleCheckChange"> <el-checkbox-group class="checkbox-group" :max="3" v-model="materialGroupAddForm.businessType">
<el-checkbox v-for="value in businessTypes" :key="value" :label="value">{{ value }}</el-checkbox> <el-checkbox v-for="item in businessTypes" :key="item.id" :label="item.dictLabel"></el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<span class="tips">添加业务类型,该素材组里面的所有素材均会添加此业务类型</span>
</el-form> </el-form>
<span>添加业务类型,该素材组里面的所有素材均会添加此业务类型</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button> <el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确定创建</el-button> <el-button type="primary" @click="submitForm">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -23,17 +23,24 @@ ...@@ -23,17 +23,24 @@
<script> <script>
export default { export default {
name: 'addMaterialGroupDia', name: 'addMaterialGroupDia',
props: {
eventBus: Object,
businessTypes: {
type: Array
}
},
data() { data() {
return { return {
title: '新增素材组', title: '创建素材组',
dialogVisible: false, dialogVisible: false,
materialGroupAddForm: { materialGroupAddForm: {
groupName: '', id: '',
materialGroupName: '',
businessType: [] businessType: []
}, },
businessTypes: ['整车/新车','保养','维修','车险','二手车','改装','汽车金融','零配件/精品','通用(节假日等关怀素材)'], groupCounter: [],
materialGroupAddRules: { materialGroupAddRules: {
groupName: [ materialGroupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' }, { required: true, message: '请输入分组名称', trigger: 'blur' },
{ max: 16, message: '分组名称最长为8个字', trigger: 'blur' } { max: 16, message: '分组名称最长为8个字', trigger: 'blur' }
] ]
...@@ -41,30 +48,85 @@ export default { ...@@ -41,30 +48,85 @@ export default {
} }
}, },
methods: { methods: {
init(value) { init(addOrEdit, value, group) {
// console.log(value, '~~~~'); // this.findAllDictData('business_type')
if (value == 1) { console.log(value, '123')
this.dialogVisible = true
this.materialGroupAddForm = { this.materialGroupAddForm = {
groupName: '', materialGroupName: '',
businessType: [] businessType: []
} }
this.groupCounter = group
if (addOrEdit == 2) {
this.title = '编辑素材组'
if (!value) {
this.materialGroupAddForm.materialGroupName = '新车素材组'
return
} }
this.dialogVisible = true var params = {}
params.id = value.id
this.$apis.material.materialGroupDetail(params).then(res => {
console.log(res, '---')
this.materialGroupAddForm = res
if (res.businessType) {
this.materialGroupAddForm.businessType = this.materialGroupAddForm.businessType.split(',')
} else {
this.materialGroupAddForm.businessType = []
}
})
}
// Object.assign(this.materialGroupAddForm, value)
},
// 获取所有业务类型
findAllDictData(dictType) {
var params = {
dictType
}
this.$apis.material.findAllDictData(params).then(res => {
if (res) {
if (dictType == 'business_type') {
this.businessTypes = res
}
}
})
}, },
// 创建 // 创建
submitForm() { submitForm() {
this.$refs.materialGroupAddForm.validate((valid) => { console.log(this.materialGroupAddForm)
this.$refs.materialGroupAddForm.validate(valid => {
if (valid) { if (valid) {
this.$emit('addMaterialGroup', this.materialGroupAddForm) // 判断是创建还是编辑
if (this.materialGroupAddForm.id) {
this.eventBus.$emit('editMaterialGroup', this.materialGroupAddForm)
this.dialogVisible = false
return
}
// 判断素材组名称是否重复
var groupName = []
this.groupCounter.forEach(item => {
groupName.push(item.materialGroupName)
})
var idx = groupName.indexOf(this.materialGroupAddForm.materialGroupName)
if (idx != -1) {
this.$message({
message: '素材组名称不能重复',
type: 'warning'
})
return
}
this.eventBus.$emit('addMaterialGroup', this.materialGroupAddForm)
this.dialogVisible = false this.dialogVisible = false
} else { } else {
alert('请输入分组名称') this.$message({
return false; message: '请输入素材组名称',
type: 'warning'
})
return false
} }
}); })
}, },
handleCheckChange(val) { handleCheckChange(val) {
console.log(val); console.log(val)
this.materialGroupAddForm.businessType = val this.materialGroupAddForm.businessType = val
// console.log(this.materialGroupAddForm); // console.log(this.materialGroupAddForm);
} }
...@@ -72,5 +134,22 @@ export default { ...@@ -72,5 +134,22 @@ export default {
} }
</script> </script>
<style> <style lang="scss" scope>
.checkbox-group {
width: 567px;
box-sizing: border-box;
background: #f5f5f5;
padding: 16px 0 0 16px;
.el-checkbox {
width: 140px;
margin: 0;
padding: 0;
}
}
.tips {
font-size: 12px;
color: #666666;
display: block;
margin: -10px 0 0 110px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="introduct">
<el-dialog title="功能介绍" :visible.sync="introductionDialog" width="1080px" :before-close="handleClose">
<p>营销素材——将业务资料、经典案例、活动等以链接、PDF形式上传在营销素材库中,企业成员可在企业微信聊天侧边栏或者嘀加企微管家工作台中,一键发给客户,支持雷达追踪,并将客户的阅读等关键行为记录到客户动态中,并给客户打上指定标签。</p>
<h3>我的优势</h3>
<p class="list">1、门店可以为不同的业务部门提供不同的营销素材,规范营销内容;</p>
<p class="list">2、员工能便捷的在企业微信聊天侧边栏及嘀加企微管家工作台上直接使用营销素材,避免自己设计素材的烦恼;</p>
<p class="list">3、捕获客户对素材的交互行为并主动通知员工,获取客户的兴趣点,为业务转化提供参考依据。</p>
<!-- <div class="img_div"> -->
<img class="img_div" src="@/assets/material/introduction.png" alt="">
<!-- </div> -->
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleClose">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'functionIntroduc',
props: {
introductionDialog: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: this.introductionDialog
}
},
methods: {
handleClose() {
this.$emit('closeIntroductDia', this.dialogVisible);
}
}
}
</script>
<style>
.img_div {
height: 334px;
/* margin: 0 20px; */
}
p {
margin: 0 0 20px 32px;
}
h3 {
font-size: 17px;
margin: 0 0 16px 32px;
}
.list {
margin: 0 0 20px 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="material-group">
<div class="all-group">
<div>全部素材组 ({{ groupCounter.length }})</div>
<div>
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">新建</el-button>
</div>
</div>
<ul>
<li v-for="(item, index) in groupCounter" :key="index" @click="handleGroup(item)">
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle">
<div class="group-name">{{ item.materialGroupName }}</div>
<el-popover placement="right" trigger="hover">
<div>
<ul>
<li @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</li>
<li @click="handleAddGroup(2,item)">修改</li>
<li @click="handleDeleteGroup(item.id)" v-if="item.isDefault == -1">删除</li>
</ul>
</div>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
</li>
</ul>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'materialGroup',
props: { eventBus: Object },
data() {
return {
// 素材组数量
groupCounter: [],
materialGroup: {
id: "",
materialGroupName: "",
orderValue: "",
isDefault: ""
}
}
},
mounted() {
this.eventBus.$on('addMaterialGroup', data => {
data.businessType = data.businessType.toString()
this.$apis.material.addMaterialGroup(data).then(res => {
if (res) {
this.getMaterialList()
}
})
})
this.eventBus.$on('editMaterialGroup', data => {
data.businessType = data.businessType.toString()
this.$apis.material.editMaterialGroup(data).then(res => {
if (res) {
this.getMaterialList()
}
})
})
this.materialInsert()
this.getMaterialList()
},
methods: {
// 创建素材组
materialInsert() {
var params = {}
params.isDefault = 0
this.$apis.material.addMaterialGroup(params).then(res => {
if (res) {
this.getMaterialList()
}
})
},
// 获取全部素材组
getMaterialList() {
this.$apis.material.getMaterialList({}).then(res => {
console.log(res);
this.groupCounter = res
})
},
// 点击素材组获取素材
handleGroup(item) {
var params = {}
params.groupId = item.id
params.pageNum = 1
params.pageSize = 10
this.$emit('getList', params, item)
},
// 打开1-新增, 2-编辑 素材组弹框
handleAddGroup(addOrEdit, value) {
console.log(addOrEdit, value)
this.$emit('openAddDialog', addOrEdit, value, this.groupCounter)
},
// 素材组置顶
handleStick(row) {
console.log(row, 'orderFlagorderFlag');
var params = {}
params.id = row.id
// 置顶
if (!row.orderTime) {
var date = new Date()
var stickDate = dayjs(date).format('YYYY-MM-DD HH:mm:ss')
params.orderTime = stickDate
params.orderFlag = true
console.log(params);
this.secondConfirm('提示', '确定置顶该素材组吗?', 'material', 'editMaterialGroup', params)
return
}
// 取消置顶
params.orderFlag = false
this.secondConfirm('提示', '确定取消置顶该素材组吗?', 'material', 'editMaterialGroup', params)
},
// 素材组删除
handleDeleteGroup(rowId) {
this.secondConfirm('提示', '删除素材组,该素材组下的所有素材均会被删除,请谨慎操作', 'material', 'deleteMaterialList', { id: rowId })
},
// 二次确认
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.getMaterialList()
}
})
}
}
})
},
}
}
</script>
<style lang="scss">
.el-popover {
min-width: 80px;
&:hover {
cursor: pointer
}
}
.material-group {
.all-group {
font-size: 16px;
font-weight: 600;
padding: 24px 16px 0 16px;
display: flex;
justify-content: space-between;
.el-button {
margin-top: -13px;
}
}
ul {
li {
text-align: left;
padding: 18px 16px 16px 18px;
i {
font-size: 16px;
padding-top: 6px;
position: absolute;
right: 16px;
transform:rotate(90deg);
}
}
}
}
ul {
padding: 0;
text-align: center;
margin-block-start: 0;
margin-block-end: 0;
li {
list-style: none;
padding: 5px;
position: relative;
&:hover {
color: #5850FF;
}
}
}
.add_btn {
color: #5850FF;
}
.group-name {
display: inline-flex;
margin-left: 8px;
}
</style>
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
<div> <div>
<glsx-combi-form ref="readPerDetailFormRef" :formObj="searchForm" :formData="readPerDetailFormData" :inline="true"> <glsx-combi-form ref="readPerDetailFormRef" :formObj="searchForm" :formData="readPerDetailFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro"> <span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button> <el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable ref="readPerDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="readPerDetailTableData" :pageConf="pageConf" :tableTotal="tableTotal"> <GLTable ref="readPerDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
</GLTable> </GLTable>
</div> </div>
</template> </template>
...@@ -15,33 +15,50 @@ ...@@ -15,33 +15,50 @@
import url from "@/assets/empty.png" import url from "@/assets/empty.png"
export default { export default {
name: 'readPerDetail', name: 'readPerDetail',
props: ['materialId'],
data() { data() {
return { return {
url, url,
searchForm: { searchForm: {
staffName: '' customerName: '',
customerPhone: '',
staffName: '',
materialId: this.materialId,
}, },
getListApi: this.$apis.material.readDetailPage,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
readPerDetailFormData: [ readPerDetailFormData: [
{ {
label: '客户名称:', label: '名称:',
name: 'cunstormName', name: 'customerName',
maxlength: 10, maxlength: 10,
type: 'input',
placeholder: '请输入名称'
},{
label: '客户手机号:',
name: 'customerPhone',
placeholder: '请输入客户手机号',
type: 'input' type: 'input'
}, },
{ {
label: '发送人:', label: '发送人:',
name: 'staffName', name: 'staffName',
maxlength: 10, maxlength: 10,
placeholder: '请输入发送人',
type: 'input' type: 'input'
} }
], ],
tableParams: { tableParams: {
listName: 'list', listName: 'data',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '客户名称', label: '客户名称',
prop: 'cunstormName' prop: 'customerName'
},
{
label: '电话号码',
prop: 'customerPhone'
}, },
{ {
label: '发送人', label: '发送人',
...@@ -49,11 +66,11 @@ export default { ...@@ -49,11 +66,11 @@ export default {
}, },
{ {
label: '所属企微成员', label: '所属企微成员',
prop: 'resdTimes' prop: 'departName'
}, },
{ {
label: '阅读次数', label: '阅读次数',
prop: 'readTimes' prop: 'readNumber'
}, },
{ {
label: '首次阅读时间', label: '首次阅读时间',
...@@ -66,6 +83,22 @@ export default { ...@@ -66,6 +83,22 @@ export default {
] ]
} }
} }
},
methods: {
// 搜索
handleSearch() {
this.$refs.readPerDetailRef.refreshTable()
},
// 重置
handleReset() {
this.searchForm = {
customerName: '',
customerPhone: '',
staffName: '',
materialId: this.materialId
}
this.handleSearch()
},
} }
} }
</script> </script>
......
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容" clearable @keydown.enter.native="handleSearch"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset">重置</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }">
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click="item.checked = !item.checked">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
{{ item.labelGroup.name }}
<el-tag :size="size">{{ item.labelType }}</el-tag>
<el-radio-group class="tag-group" v-model="item.tagChecked" v-show="item.checked">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio>
<div slot="content">{{ itm.name }}</div>
</el-tooltip>
</div>
</el-radio-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRets">
<el-tag :title="item.tagChecked.name" v-if="item.tagChecked" type="info" class="tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)">
{{ item.tagChecked.name }}
</el-tag>
</template>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'activityModel',
data() {
return {
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRets: []
}
},
watch: {
labelTreeRets: {
handler() {
this.selectNum = 0
this.labelTreeRets.forEach(item => {
if (item.tagChecked) {
this.selectNum++
}
})
},
deep: true
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) {
console.log(item, '23232');
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
console.log(selectItem, '-----')
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName,
edition: this.$globalState.session.merchantModel
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
console.log(res.labelTreeRets)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelId = item.labelList[0].id
let index = tag.labelList.findIndex(iem => iem.id == labelId)
console.log(index)
// tag.tagChecked = item.tagChecked
tag.tagChecked = tag.labelList[index]
}
})
})
console.log(this.labelTreeRets)
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
}
})
},
remove(item, idx) {
item.tagChecked = null
},
//选中
handleSelect() {
if (this.selectNum > 3) {
this.$message({
message: '最多选择三个标签',
type: 'warning'
})
return
}
this.dialogVisible = false
let labelTreeRets = this.labelTreeRets
.map(item => {
if (item.tagChecked) {
return {
labelGroup: item.labelGroup,
labelType: item.labelType,
labelList: [item.tagChecked]
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
handleReset() {
this.labelGroupName = ''
this.querylabeltree()
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
max-width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 26px;
display: flex;
flex-wrap: wrap;
.radio-tag {
display: inline-block;
width: 50%;
.el-radio {
margin: 8px 0;
display: inline-flex;
align-items: center;
/deep/.el-radio__inner{
box-shadow: none !important;
}
/deep/.el-radio__label {
display: inline-block;
max-width: 120px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
}
}
}
.checkbox-group-box {
overflow: auto;
.checkbox-box {
cursor: pointer;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
/deep/ {
.el-tag {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba($color: #5850ff, $alpha: 0.1);
}
}
}
}
.tag-selected-box {
min-height: 200px;
}
</style>
...@@ -2,53 +2,57 @@ ...@@ -2,53 +2,57 @@
<div> <div>
<glsx-combi-form ref="staffSendFormRef" :formObj="searchForm" :formData="staffSendFormData" :inline="true"> <glsx-combi-form ref="staffSendFormRef" :formObj="searchForm" :formData="staffSendFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro"> <span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button> <el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="staffSendTableData" :pageConf="pageConf" :tableTotal="tableTotal"> <GLTable ref="staffSendDetailRef" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams"></GLTable>
</GLTable>
</div> </div>
</template> </template>
<script> <script>
import url from "@/assets/empty.png" import url from '@/assets/empty.png'
export default { export default {
name: 'staffSendDetail', name: 'staffSendDetail',
props: ['materialId'],
data() { data() {
return { return {
url, url,
searchForm: { searchForm: {
staffName: '' materialId: this.$route.query.id,
employeeName: ''
}, },
staffSendFormData: [ staffSendFormData: [
{ {
label: '姓名:', label: '',
name: 'staffName', name: 'employeeName',
type: 'input' type: 'input',
placeholder: '请输入姓名',
prefixIcon: 'el-icon-search'
} }
], ],
getListApi: this.$apis.material.sendDetailPage,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: { tableParams: {
listName: 'list', listName: 'data',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '姓名', label: '姓名',
prop: 'staffName' prop: 'employeeName'
}, },
{ {
label: '发送次数', label: '发送次数',
prop: 'sendTimes', prop: 'sendNumber',
sortable: true sortable: true
}, },
{ {
label: '阅读次数', label: '阅读次数',
prop: 'resdTimes', prop: 'readNumber',
sortable: true sortable: true
}, },
{ {
label: '阅读人数', label: '阅读人数',
prop: 'readPer' prop: 'readPeopleNumber'
}, },
{ {
label: '打开率', label: '打开率',
...@@ -57,10 +61,23 @@ export default { ...@@ -57,10 +61,23 @@ export default {
] ]
} }
} }
},
methods: {
// 搜索
handleSearch() {
this.$refs.staffSendDetailRef.refreshTable()
},
// 重置
handleReset() {
this.searchForm = {
staffName: '',
materialId: this.$route.query.id,
}
this.handleSearch()
}
} }
} }
</script> </script>
<style lang="" scoped> <style lang="" scoped>
</style> </style>
...@@ -5,42 +5,80 @@ ...@@ -5,42 +5,80 @@
</template> </template>
<script> <script>
// import E from 'wangeditor' import E from 'wangeditor'
export default { export default {
name: 'textBox', name: 'textBox',
data() { data() {
return { return {
editor: '',
content: '', content: '',
editorOption: {}, editorOption: {}
} }
}, },
mounted() { mounted() {
// this.getEdit() this.getEdit()
}, },
methods: { methods: {
// getEdit() { getEdit() {
// var editor = new E('#div-demo') const _this = this;
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400
this.editor.config.width = 500
this.editor.config.uploadVideoServer = '/api/upload-video'
this.editor.config.excludeMenus = ['code']
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
console.log(resultFiles)
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// editor.config.uploadImgShowBase64 = true // 上传图片,返回结果,将图片插入到编辑器中
// editor.config.showMenuTooltips = true
// editor.config.menuTooltipPosition = 'down'
// editor.config.height = 400
// editor.config.uploadVideoServer = '/api/upload-video'
// editor.config.excludeMenus = [
// 'code'
// ]
// editor.create() }
// } }
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
}
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
#div-demo { #div-demo {
margin-top: 40px; margin: 16px 300px 0 0;
} }
.el-form .editor{ .el-form .editor {
margin-top: 20px; margin-top: 20px;
} }
.myQuillEditor { .myQuillEditor {
...@@ -48,3 +86,8 @@ export default { ...@@ -48,3 +86,8 @@ export default {
height: 200px; height: 200px;
} }
</style> </style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -5,85 +5,81 @@ ...@@ -5,85 +5,81 @@
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
创建营销素材 创建营销素材
</el-button> </el-button>
<span>功能介绍<i class="el-icon-arrow-right"></i></span> <span @click="showIntroductionDialog">
功能介绍
<i class="el-icon-arrow-right"></i>
</span>
</div> </div>
<div class="container"> <div class="container">
<div class="search-form"> <div class="search-form">
<glsx-combi-form ref="materialFormRef1" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData1" :inline="true"> <glsx-combi-form ref="materialFormRef1" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData1" :inline="true"></glsx-combi-form>
</glsx-combi-form>
<glsx-combi-form ref="materialFormRef2" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData2" :inline="true"> <glsx-combi-form ref="materialFormRef2" :isEdit="isEdit" :formObj="searchForm" :formData="materialFormData2" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro"> <span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button> <el-button type="primary" :size="size" @click="getListApi">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button> <el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="tabelList"> <div class="tabelList">
<el-row> <el-row :style="{ height: boxHeight }">
<el-col :span="5"> <el-col :span="5">
<div class="left"> <div class="left" :style="{ height: boxHeight }">
<el-button class="add-group" type="primary" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">创建素材组</el-button> <MaterialGroup @openAddDialog="addDialogShow" :eventBus="eventBus" @getList="getList"></MaterialGroup>
<div class="all-group">全部素材组 ({{ groupCounter.length }})</div>
<ul>
<!-- <li class="all-group">全部素材组({{ groupCounter.length }})</li> -->
<li>
新车素材组(默认)
<el-popover placement="right" width="20" trigger="hover">
<el-button-group>
<el-button type="text" @click="handleStick">置顶</el-button>
<el-button type="text" @click="handleAddGroup(2)">修改</el-button>
<el-button type="text" @click="handleDeleteGroup">删除</el-button>
</el-button-group>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
</li>
<li v-for="(item, index) in groupCounter" :key="index">
{{ item.groupName }}
<el-popover placement="left" width="400" trigger="hover">
<el-button-group>
<el-button type="text" @click="handleStick">置顶</el-button>
<el-button type="text" @click="handleAddGroup(2)">修改</el-button>
<el-button type="text" @click="handleDeleteGroup">删除</el-button>
</el-button-group>
<i slot="reference" class="el-icon-s-tools"></i>
</el-popover>
</li>
</ul>
</div> </div>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="19">
<div class="right"> <div class="right" :style="{ height: boxHeight }">
<div class="groupTitle">新车素材组 (共{{ materialTableData.length }}条数据)</div> <div class="groupTitle">{{ materialGroupName ? materialGroupName : '默认素材分组' }}(共{{ tableTotal }}条数据)</div>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange"> <GLTable ref="materialRef" :noDataImg="url" @refreshTable="getListApi" :layout="layout" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList">
<!-- 素材内容 --> <!-- 素材内容 -->
<div slot="materialContent"> <div slot="materialContentRpcResponse" slot-scope="scope" style="text-align: center">
<!-- 素材内容为自定义文本 --> <!-- 素材为PDF -->
<div v-if="materialTableData.materialType === '图文'"> <span v-if="scope.scope.materialType == 1" class="material-content">
<div>素材标题</div> <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 16">
<div>放置图片</div> <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
</div> </el-tooltip>
<!-- 素材内容为PDF --> <!-- <img src="@/assets/material/pdf.png" alt=""> -->
<div v-if="materialTableData.materialType === 'PDF'"> <span>{{ scope.scope.materialContentRpcResponse.materialName }}.png</span>
<div>素材标题</div> </span>
<div>PDF图片 pdf文件名.pdf</div> <!-- 素材为自定义链接 -->
</div> <span v-if="scope.scope.materialType == 2"></span>
<!-- 素材内容链接 --> <!-- 图文 -->
<div v-if="materialTableData.materialType === '自定义链接'"> <span v-if="scope.scope.materialType == 3" class="material-content">
<div>素材标题</div> <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 16">
<span>{{ scope.scope.materialContentRpcResponse.materialName }}</span>
</el-tooltip>
<el-popover
placement="top"
trigger="click">
<div> <div>
<div>图片</div> <img class="img-plus" src="@/assets/material/car.png" alt="">
<div>链接</div>
</div>
</div> </div>
<img slot="reference" src="@/assets/material/car.png" alt="">
</el-popover>
</span>
</div> </div>
<!-- 状态 --> <!-- 状态 -->
<div slot="status"></div> <div slot="status" slot-scope="scope">
<span v-if="scope.scope.status == 0">启用</span>
<span v-if="scope.scope.status == -1">禁用</span>
<span v-if="scope.scope.status == 1">存草稿</span>
</div>
<!-- 类型 -->
<div slot="materialType" slot-scope="scope">
<span v-if="scope.scope.materialType == 1">pdf</span>
<span v-if="scope.scope.materialType == 2">自定义链接</span>
<span v-if="scope.scope.materialType == 3">图文</span>
</div>
<span slot="auth-button" slot-scope="scope"> <span slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button> <el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
<el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button> <el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button>
<el-button type="text">更多</el-button> <el-popover placement="right" trigger="click">
<!-- <el-button type="text" @click="handleForbid(scope)">禁用</el-button> --> <ul>
<!-- <el-button type="text" @click="handleDelete(scope)">删除</el-button> --> <li @click="handleForbid(scope.scope)">{{ scope.scope.status == 0 ? '禁用' : '启用' }}</li>
<li @click="handleDelete(scope.scope)">删除</li>
</ul>
<el-button type="text" slot="reference" class="btn-more">更多</el-button>
</el-popover>
</span> </span>
</GLTable> </GLTable>
</div> </div>
...@@ -91,90 +87,101 @@ ...@@ -91,90 +87,101 @@
</el-row> </el-row>
</div> </div>
</div> </div>
<AddMaterialGroupDia ref="addMaterialGroup" :dialogVisible="materialGroupDialog" @addMaterialGroup="addGroup"></AddMaterialGroupDia> <AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
</div> </div>
</template> </template>
<script> <script>
const iconUrl =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAFoTx1HAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADqADAAQAAAABAAAADgAAAAC98Dn6AAAB7klEQVQoFVVSQUhUURQ9981sVFyYRRHuFFq1CGlZC3etnBlMRhMXQwhtCqIQJBA3gSSi1EpkNqkjCjOjm1YWuGojBVO7Fi0K2qQLF6H453bO+/ODLvz37z333PvOu+8BtImCf0K56J8VYKLoC9HRMlnwRxaRgB0kOHDDz5gl/0hZBaaFwGl3H65j577nygV/ITCM71pinRo1GiF4zm8jqzkr5dEtluiTJZ9zx8fYTEBmbP5D/tSY3wnaRUwB0rbdsAH5SYK3sW2l4r1/jnFIsUMElmsNmxdB7JGsUnGUWvQz+XkHXtXqNsxx/KL/Zg+oS5xxi8A2T8SqNe0az3NANyfVJD4N5ripZDTDrc1da8kn/i1QxGya4eq4Kl8aui7hblRLUd/JXCSxxXarBJ9T8fuYFLsztiqTv4NjXUTh2rZteEhiP8OKiiIez3+CFoWubdXtpUDe1XAbmJEfQLxpRxFPRz7T1ccz6BFkl6okRzHFOJ5ccbnkr8l5LF8mrl5Pnv5gJksJjmlD/wclv9121ClxeqthH4TJQh5fLhIMaa7LOrRuIk2la89lfO29ghuU/69IHBatqIZfOhgWv2OXhUIOi/FCnDpoZuYqaCaYpYJ5gvf+m6pInUE9Y5NRhoPCdGl80fscyFK1aqfCZH8B0rPa9foo7e4AAAAASUVORK5CYII='
import Vue from 'vue'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia' import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia'
import MaterialGroup from '@/views/material/components/materialGroup'
import FunctionIntroduc from '@/views/material/components/functionIntroduc'
export default { export default {
name: 'materialList', name: 'materialList',
components: { components: {
AddMaterialGroupDia AddMaterialGroupDia,
MaterialGroup,
FunctionIntroduc
}, },
data() { data() {
return { return {
url, url,
eventBus: new Vue(),
searchForm: { searchForm: {
applicationType: '', groupId: '',
materialType: '', materialType: '',
businessType: '',
status: '', status: '',
materialName: '' materialName: ''
}, },
materialTableData: [ pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
{ layout: 'sizes, prev, pager, next, jumper, ->, total',
id: 123, materialTableData: [],
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 100,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 124,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 6,
readPer: 100,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 125,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 112,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
},
{
id: 126,
materialContent: '内容',
status: '正常',
materialType: '类型',
sendTimes: 5,
readPer: 30,
effect_readPer: 50,
updateTime: '2016-12-03 22:09:36'
}
],
materialGroupDialog: false, materialGroupDialog: false,
// 素材组 introductionDialog: false,
groupCounter: [], boxHeight: '',
businessTypes: [],
materialGroupName: '',
materialFormData1: [ materialFormData1: [
{ {
label: '业务类型:', label: '业务类型:',
name: 'applicationType', name: 'businessType',
type: 'select', type: 'select',
placeholder: '全部' placeholder: '全部',
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'dictValue'
}, },
{ {
label: '素材类型:', label: '素材类型:',
name: 'materialType', name: 'materialType',
type: 'select', type: 'select',
placeholder: '全部类型' placeholder: '全部',
optionList: [
{
optionId: 1,
optionLabel: 'pdf'
},
// {
// optionId: 2,
// optionLabel: '自定义链接'
// },
{
optionId: 3,
optionLabel: '图文'
}
],
optionId: 'optionId',
optionLabel: 'optionLabel',
optionsName: 'optionLabel'
}, },
{ {
label: '状态:', label: '状态:',
name: 'status', name: 'status',
type: 'select', type: 'select',
placeholder: '全部(不包括删除)' placeholder: '全部',
optionList: [
{
optionId: 0,
optionLabel: '启用'
},
{
optionId: -1,
optionLabel: '禁用'
},
{
optionId: 2,
optionLabel: '草稿'
}
],
optionId: 'optionId',
optionLabel: 'optionLabel',
optionsName: 'optionLabel'
} }
], ],
materialFormData2: [ materialFormData2: [
...@@ -182,59 +189,149 @@ export default { ...@@ -182,59 +189,149 @@ export default {
label: '素材名称:', label: '素材名称:',
name: 'materialName', name: 'materialName',
type: 'input', type: 'input',
placeholder: '输入素材关键字' placeholder: '请输入素材名称'
} }
], ],
tableParams: { tableParams: {
listName: 'list', listName: 'data',
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '素材内容', label: '素材内容',
prop: 'materialContent', prop: 'materialContentRpcResponse',
addHtml: 'materialContent' addHtml: 'materialContentRpcResponse',
width: 240
}, },
{ {
label: '状态', label: '状态',
prop: 'status' prop: 'status',
// addHtml: 'status' addHtml: 'status'
}, },
{ {
label: '类型', label: '类型',
prop: 'materialType' prop: 'materialType',
addHtml: 'materialType'
}, },
{ {
label: '发送次数', label: '发送次数',
prop: 'sendTimes', prop: 'sendNum',
sortable: true sortable: true,
width: 150,
renderHeader: (h, { column, $index }) => {
return h(
'div',
{
style: {
display: 'inline-flex',
'align-items': 'center'
}
}, },
[
'发送次数',
h(
'el-popover',
{ {
label: '阅读人数', attrs: {
prop: 'readPer', placement: 'top-start',
sortable: true width: '240',
trigger: 'hover',
content: '用户购买活动商品的总销售额。'
}
},
[
h('img', {
style: {
width: '14px',
height: '14px',
'margin-left': '4px'
},
attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
)
}
}, },
{ {
label: '有效阅读人数', label: '阅读人数',
prop: 'effect_readPer', prop: 'readNum',
width: 150,
sortable: true, sortable: true,
width: '160px' renderHeader: (h, { column, $index }) => {
return h(
'div',
{
style: {
display: 'inline-flex',
'align-items': 'center'
}
},
[
'阅读人数',
h(
'el-popover',
{
attrs: {
placement: 'top-start',
width: '240',
trigger: 'hover',
content: '用户购买活动商品的总销售额。'
}
},
[
h('img', {
style: {
width: '14px',
height: '14px',
'margin-left': '4px'
},
attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
)
}
}, },
{ {
label: '更新时间', label: '更新时间',
prop: 'updateTime', prop: 'updatedTime',
width: 180,
sortable: true sortable: true
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableTotal: 4 tableTotal: 4
} }
}, },
mounted() {
let clientHeight = document.documentElement.clientHeight
let offTop = document.querySelector('.tabelList').offsetTop
this.boxHeight = clientHeight - offTop - 20 + 'px'
this.findAllDictData('business_type')
this.firstCome()
this.getListApi()
console.log(this.$refs.materialRef, '12312');
},
methods: { methods: {
// 搜索 // 判断是否第一次进入
handleSearch() { firstCome() {
this.$refs.materialRef.refreshTable() if (!window.sessionStorage.getItem('firstLogin')) {
this.introductionDialog = true
window.sessionStorage.setItem('firstLogin', 'true')
}
}, },
// 搜索
// handleSearch() {
// this.$refs.materialRef.refreshTable()
// },
// 重置 // 重置
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
...@@ -243,72 +340,53 @@ export default { ...@@ -243,72 +340,53 @@ export default {
status: '', status: '',
materialName: '' materialName: ''
} }
this.handleSearch() this.getListApi()
},
// 获取所有业务类型
findAllDictData(dictType) {
var params = {
dictType
}
this.$apis.material.findAllDictData(params).then(res => {
if (res) {
this.businessTypes = res
this.materialFormData1[0].optionList = res
console.log(this.businessTypes)
}
})
},
// 新增或编辑素材弹框打开
addDialogShow(addOrEdit, value, group) {
this.materialGroupDialog = true
this.$refs.addMaterialGroup.init(addOrEdit, value, group)
}, },
// 素材详情 // 素材详情
handleDetail(scope) { handleDetail(scope) {
console.log(scope.id) console.log(scope.id)
// this.$router.push('/material/materialDetail/' + scope.id)
this.$router.push({ this.$router.push({
path: '/material/materialDetail', path: '/material/materialDetail',
query: scope.id query: {
id: scope.id
}
}) })
}, },
// 素材禁用 // 素材禁用&启用
handleForbid() { handleForbid(scope) {
this.$confirm('禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', '提示', { console.log(scope)
distinguishCancelAndClose: true, var params = {}
confirmButtonText: '确定禁用', params.id = scope.id
cancelButtonText: '取消' if (scope.status == 0) {
}) params.status = -1
.then(() => { this.secondConfirm('提示', '禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', 'material', 'materialEdit', params )
this.$message({ } else {
type: 'info', params.status = 0
message: '禁用成功' this.secondConfirm('提示', '启用素材,确定启用此素材?', 'material', 'materialEdit', params )
}) }
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消禁用'
})
})
}, },
// 素材删除 // 素材删除
handleDelete() { handleDelete(scope) {
this.$confirm('删除素材,所有已经发送给客户的素材链接均会失效,是否继续删除?', '提示', { this.secondConfirm('提示', '删除素材,所有已经发送给客户的素材链接均会失效,是否继续删除?', 'material', 'materialDelete', { id: scope.id })
distinguishCancelAndClose: true,
confirmButtonText: '确定删除',
cancelButtonText: '取消'
})
.then(() => {
this.$message({
type: 'info',
message: '删除成功'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 打开1-新增, 2-编辑 素材组弹框
handleAddGroup(addOrEdit, value) {
console.log(addOrEdit, value)
this.materialGroupDialog = true
this.$refs.addMaterialGroup.init(addOrEdit)
},
// 新增或编辑素材组
addGroup(value) {
this.groupCounter.push(value)
console.log(this.groupCounter, '-----')
}, },
// 素材组置顶
handleStick() {},
// 素材组删除
handleDeleteGroup() {},
// 1-新增素材,2-编辑素材 // 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) { addMaterial(addOrEdit, scope) {
console.log(addOrEdit, scope) console.log(addOrEdit, scope)
...@@ -329,28 +407,11 @@ export default { ...@@ -329,28 +407,11 @@ export default {
var fieldName = sort.prop var fieldName = sort.prop
var sortingType = sort.order var sortingType = sort.order
//如果字段名称为“创建时间”,将“创建时间”转换为时间戳,才能进行大小比较 //如果字段名称为“创建时间”,将“创建时间”转换为时间戳,才能进行大小比较
// if(fieldName=="createTime"){ if (fieldName == 'updatedTime') {
// this.tableData2.map(item => { this.materialTableData.map(item => {
// item.createTime = this.$moment(item.createTime).valueOf() item.updatedTime = this.$moment(item.updatedTime).valueOf()
// }) })
// 次数排序
if (sort.column.label === '发送次数') {
this.handleSort(sortingType, fieldName)
}
// 阅读人数排序
if (sort.column.label === '阅读人数') {
this.handleSort(sortingType, fieldName)
}
// 有效阅读人数排序
if (sort.column.label === '有效阅读人数') {
this.handleSort(sortingType, fieldName)
} }
},
// 排序规则
handleSort(sortingType, fieldName) {
//按照降序排序 //按照降序排序
if (sortingType == 'descending') { if (sortingType == 'descending') {
this.materialTableData = this.materialTableData.sort((a, b) => b[fieldName] - a[fieldName]) this.materialTableData = this.materialTableData.sort((a, b) => b[fieldName] - a[fieldName])
...@@ -359,6 +420,58 @@ export default { ...@@ -359,6 +420,58 @@ export default {
else { else {
this.materialTableData = this.materialTableData.sort((a, b) => a[fieldName] - b[fieldName]) this.materialTableData = this.materialTableData.sort((a, b) => a[fieldName] - b[fieldName])
} }
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
getListApi() {
var params = this.getParams()
params.pageSize = this.$refs.materialRef.page.pageSize,
params.pageNum = this.$refs.materialRef.page.pageNum
this.$apis.material.materialList(params).then(res => {
this.materialTableData = res.data
this.tableTotal = res.count
})
},
// 点击素材组获取素材组素材
getList(params, item) {
console.log(item, '7758')
this.materialGroupName = item.materialGroupName
this.searchForm.groupId = item.id
this.$apis.material.materialList(params).then(res => {
this.materialTableData = res.data
})
// this.handleSearch()
},
// 功能介绍弹框
showIntroductionDialog() {
this.introductionDialog = true
},
closeIntroductDia(val) {
this.introductionDialog = false
},
// 二次确认
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.getListApi()
}
})
}
}
})
} }
} }
} }
...@@ -376,28 +489,11 @@ export default { ...@@ -376,28 +489,11 @@ export default {
span { span {
margin-left: 16px; margin-left: 16px;
font-size: 16px; font-size: 16px;
color: #5850FF; color: #5850ff;
}
}
}
ul {
li {
list-style: none;
}
}
.group-frame {
width: 72px;
height: 106px;
background: #FFFFFF;
ul {
margin: 0 8px;
padding-top: 1px;
text-align: center;
li {
margin: 15px 0;
} }
} }
} }
.container { .container {
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
...@@ -410,27 +506,8 @@ ul { ...@@ -410,27 +506,8 @@ ul {
.left { .left {
height: 100%; height: 100%;
position: relative; position: relative;
border-right: 1px solid #E8E8EA; overflow: auto;
.add-group { border-right: 1px solid #e8e8ea;
margin: 20px 0 16px 16px;
}
.all-group {
font-size: 16px;
font-weight: 600;
margin: 0 0 19px 16px;
}
ul {
li {
margin: 0 0 22px 18px;
position: relative;
i {
font-size: 16px;
position: absolute;
right: 16px;
transform:rotate(90deg);
}
}
}
} }
.right { .right {
.groupTitle { .groupTitle {
...@@ -443,4 +520,27 @@ ul { ...@@ -443,4 +520,27 @@ ul {
} }
} }
} }
.btn-more {
margin-left: 10px;
}
.material-content {
display: flex;
align-items: center;
justify-content: space-between;
.hide-content {
display: inline-block;
max-width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
img {
width: 36px;
height: 36px;
}
}
.img-plus {
width: 200px;
height: 200px;
}
</style>> </style>>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div> <div>
<div class="materialDetail"> <div class="materialDetail">
<span class="materialDetail-title top-title">素材详情</span> <div class="materialDetail-title">
<el-divider></el-divider> 素材详情
<div class="matrial-detail">
<div class="matrial-detail-left">
<span class="materialDetail-title">我是素材名称我是素材名称</span>
<span class="matrial-detail-left-pre">预览</span>
</div>
<div @click="detailShowVisible" class="matrial-detail-unfold"> <div @click="detailShowVisible" class="matrial-detail-unfold">
<span v-if="!detailVisible"> <span v-if="detailVisible">
展开 展开
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</span> </span>
...@@ -19,59 +14,124 @@ ...@@ -19,59 +14,124 @@
</span> </span>
</div> </div>
</div> </div>
<div v-show="detailVisible" class="materialDetail-desc"> <div class="matrial-detail-containner">
<el-descriptions> <div :class="{ 'materialDetail-desc': true, 'materialDetail-expand': !detailVisible }">
<el-descriptions-item label="素材地址:">kooriookwehrhdfvssdgdfhtykyuirami</el-descriptions-item> <div class="matrial-detail">
<el-descriptions-item label="创建时间:">18100000000</el-descriptions-item> <div class="matrial-detail-left">
<el-descriptions-item label="素材组:">苏州市</el-descriptions-item> <span class="materialDetail-title-sub">{{ detailInfo.materialName }}</span>
<el-descriptions-item label="素材类型:">苏州市</el-descriptions-item> <span class="matrial-detail-left-pre" @click="visibleImg = true">预览</span>
<el-descriptions-item label="业务类型:">苏州市</el-descriptions-item> </div>
<el-descriptions-item label="动态通知:">苏州市</el-descriptions-item> </div>
<el-descriptions-item label="行为标签:">苏州市</el-descriptions-item> <div class="materialDetail-desc-item" v-if="detailInfo.materialType == 1">
<el-descriptions-item label="素材内容:"> <div class="materialDetail-item-name" v-if="detailInfo.materialType == 1">素材地址:</div>
<div>这里显示素材内容</div> {{ detailInfo.materialUrl }}
</el-descriptions-item> <span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span>
<el-descriptions-item label="分享设置:"> </div>
<div>这里显示分享内容</div> <div class="materialDetail-desc-row">
</el-descriptions-item> <div class="materialDetail-desc-col">
</el-descriptions> <div class="materialDetail-desc-item">
</div> <div class="materialDetail-item-name">创建时间:</div>
</div> {{ detailInfo.createdTime }}
<div class="summarization"> </div>
<div class="countTime"> <div class="materialDetail-desc-item">
<span class="materialDetail-title top-title">数据概览</span> <div class="materialDetail-item-name">
</div> <label>*</label>
<el-divider></el-divider> 素材类型:
</div>
{{ detailInfo.materialType }}
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">动态通知:</div>
<span v-if="detailInfo.isNotifySender == -1">否</span>
<span v-if="detailInfo.isNotifySender == 0">是</span>
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">素材内容:</div>
<div class="content-item">
<div class="content-item-text">
<div class="content-item-title">{{ detailInfo.materialName }}</div>
<div class="content-item-desc" v-if="detailInfo.materialType == 3" v-html="detailInfo.materialUrl"></div>
</div>
<div class="content-item-image">
<img src="@/assets/material/car.png" alt="" v-if="detailInfo.materialType == 3" />
<img src="@/assets/material/pdf.png" alt="" v-if="detailInfo.materialType == 1" />
</div>
</div>
</div>
</div>
<div class="materialDetail-desc-col">
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">
<label>*</label>
素材组:
</div>
{{ detailInfo.groupName }}
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">
<label>*</label>
业务类型:
</div>
{{ detailInfo.businessType }}
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">行为标签:</div>
<span v-if="detailInfo.tagJson.length">
<el-tag type="info" v-for="item in detailInfo.tagJson" :key="item">{{ item.labelName }}</el-tag>
</span>
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">分享设置:</div>
<div class="content-item">
<div class="content-item-text">
<div class="content-item-title">{{ detailInfo.materialTitle ? detailInfo.materialTitle : '分享标题内容' }}</div>
<div class="content-item-desc">{{ detailInfo.description }}</div>
</div>
<div class="content-item-image">
<div> <div>
<img :src="detailInfo.titleUrl" alt="" v-if="detailInfo.titleUrl" />
<img src="@/assets/material/pdf.png" alt="" v-else />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="summarization-containner">
<div class="summarization-containner-title">数据概览</div>
<div class="summarization-containner-box">
<div class="summarization-time">
<span>统计时间:</span> <span>统计时间:</span>
<el-date-picker v-model="value1" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :size="size"></el-date-picker> <el-date-picker v-model="selectTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :size="size"></el-date-picker>
<el-button type="primary" :size="size">确定</el-button> <el-button type="primary" :size="size" @click="pickDate">确定</el-button>
</div> </div>
<div class="dataList"> <div class="dataList">
<div> <div class="dataList-item">
<h5>总发送人数</h5> <div class="dataList-item-title">总发送人数</div>
<p>44</p> <h2>{{ overviewInfo.totalPeopleSend }}</h2>
<h5>今日:**</h5> <div class="dataList-item-num">今日:{{ overviewInfo.todayPeopleSend }}</div>
</div> </div>
<div> <div class="dataList-item">
<h5>总发送次数</h5> <div class="dataList-item-title">总发送次数</div>
<p>44</p> <h2>{{ overviewInfo.totalNumberSend }}</h2>
<h5>今日:**</h5> <div class="dataList-item-num">今日:{{ overviewInfo.todayNumberSend }}</div>
</div> </div>
<div> <div class="dataList-item">
<h5>总阅读人数</h5> <div class="dataList-item-title">总阅读人数(内部员工除外)</div>
<p>44</p> <h2>{{ overviewInfo.totalPeopleRead }}</h2>
<h5>今日:**</h5> <div class="dataList-item-num">今日:{{ overviewInfo.todayPeopleRead }}</div>
</div> </div>
<div> <div class="dataList-item">
<h5>总阅读次数</h5> <div class="dataList-item-title">总阅读次数(内部员工除外)</div>
<p>44</p> <h2>{{ overviewInfo.totalNumberRead }}</h2>
<h5>今日:**</h5> <div class="dataList-item-num">今日:{{ overviewInfo.todayNumberRead }}</div>
</div> </div>
<div> <div class="dataList-item">
<h5>打开率</h5> <div class="dataList-item-title">打开率</div>
<p>44</p> <h2>{{ overviewInfo.openRate }}%</h2>
<h5>今日:**</h5>
</div> </div>
</div> </div>
<div class="detailTable"> <div class="detailTable">
...@@ -79,16 +139,34 @@ ...@@ -79,16 +139,34 @@
<el-tab-pane label="员工发送明细" name="staffSendDetail"></el-tab-pane> <el-tab-pane label="员工发送明细" name="staffSendDetail"></el-tab-pane>
<el-tab-pane label="阅读人员明细" name="readPerDetail"></el-tab-pane> <el-tab-pane label="阅读人员明细" name="readPerDetail"></el-tab-pane>
</el-tabs> </el-tabs>
<staffSendDetail v-if="activeName == 'staffSendDetail'"></staffSendDetail> <staffSendDetail v-if="activeName == 'staffSendDetail'" :materialId="routerInfo.id"></staffSendDetail>
<readPerDetail v-if="activeName == 'readPerDetail'"></readPerDetail> <readPerDetail v-if="activeName == 'readPerDetail'" :materialId="routerInfo.id"></readPerDetail>
</div>
</div> </div>
</div> </div>
<el-dialog :visible.sync="visibleImg" width="500px" :before-close="handleClose">
<div slot="title" class="phone-view">
<img class="img-phone" src="@/assets/phone.png" alt="" />
<div class="phone-content">
<h4 class="phone-content-title">{{ detailInfo.materialName }}</h4>
<div class="phone-content-word" v-if="detailInfo.materialType == 3" v-html="detailInfo.materialUrl"></div>
<div class="phone-content-word">活动时间:2022年3月17日 8:00-23:00</div>
<div>
<img src="@/assets/material/car.png" alt="" />
</div>
</div>
</div>
</el-dialog>
<GLFooter>
<el-button @click="goback" type="primary">返回</el-button>
</GLFooter>
</div> </div>
</template> </template>
<script> <script>
import staffSendDetail from './components/staffSendDetail.vue' import staffSendDetail from './components/staffSendDetail.vue'
import readPerDetail from './components/readPerDetail.vue' import readPerDetail from './components/readPerDetail.vue'
import dayjs from 'dayjs'
export default { export default {
name: 'materialDetail', name: 'materialDetail',
components: { components: {
...@@ -98,12 +176,67 @@ export default { ...@@ -98,12 +176,67 @@ export default {
data() { data() {
return { return {
activeName: 'staffSendDetail', activeName: 'staffSendDetail',
detailVisible: true detailVisible: true,
visibleImg: false,
selectTime: [],
routerInfo: '',
detailInfo: {},
overviewInfo: {}
} }
}, },
mounted() {
this.routerInfo = this.$route.query
this.getMaterialdetail()
this.getDataOverview()
},
methods: { methods: {
// 获取素材详情
getMaterialdetail() {
var params = {}
params.id = this.routerInfo.id
this.$apis.material.materialDetail(params).then(res => {
console.log(res, 'dhakfh')
this.detailInfo = res
if (this.detailInfo.tagJson) {
this.detailInfo.tagJson = eval(this.detailInfo.tagJson)
} else {
this.detailInfo.tagJson = []
}
if (this.detailInfo.materialType == 3) {
this.detailInfo.materialUrl = decodeURIComponent(this.detailInfo.materialUrl)
}
})
},
// 获取数据概览
getDataOverview() {
var params = {}
params.materialId = this.routerInfo.id
this.$apis.material.dataOverview(params).then(res => {
// console.log(res);
this.overviewInfo = res
})
},
// 时间筛选数据概览
pickDate() {
var params = {}
params.materialId = this.routerInfo.id
if (this.selectTime && this.selectTime.length) {
var startTime = dayjs(this.selectTime[0]).format('YYYY-MM-DD HH:mm:ss')
var endTime = dayjs(this.selectTime[1]).format('YYYY-MM-DD HH:mm:ss')
params.startTime = startTime
params.endTime = endTime
}
this.$apis.material.dataOverview(params).then(res => {
this.overviewInfo = res
})
},
handleClick() {},
detailShowVisible() { detailShowVisible() {
this.detailVisible = !this.detailVisible this.detailVisible = !this.detailVisible
},
goback() {
this.$router.go(-1)
} }
} }
} }
...@@ -111,40 +244,160 @@ export default { ...@@ -111,40 +244,160 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.materialDetail, .materialDetail,
.summarization { .summarization-containner {
background-color: #fff; background-color: #fff;
&:nth-child(2) {
margin-bottom: 80px;
}
} }
.matrial-detail-unfold {
.matrial-detail { cursor: pointer;
font-size: 12px;
font-weight: 400;
color: #5850ff;
line-height: 17px;
}
.materialDetail-desc {
height: 0px;
overflow: hidden;
transition: all 0.3s ease-in;
&.materialDetail-expand {
height: 230px !important;
}
.materialDetail-desc-row {
display: flex;
.materialDetail-desc-col {
width: 40%;
}
}
.materialDetail-desc-item {
margin-bottom: 10px;
font-size: 14px;
color: #333333;
line-height: 20px;
display: flex;
.content-item {
box-sizing: border-box;
width: 321px;
height: 117px;
background: #f5f5f5;
border-radius: 2px;
padding: 15px;
display: flex;
&-image {
width: 85px;
height: 85px;
}
&-text {
font-size: 14px;
flex: 1;
.content-item-title {
color: #333333;
max-width: 210px;
overflow: hidden;
text-overflow: ellipsis;
line-height: 20px;
margin-bottom: 6px;
}
.content-item-desc {
color: #999999;
line-height: 20px;
max-width: 210px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
word-wrap: break-word;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
}
}
.materialDetail-item-name {
color: #666666;
width: 100px;
text-align: right;
label {
color: #fa5555;
}
}
}
}
.matrial-detail-containner {
padding: 30px;
.matrial-detail {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin: 33px 0 0 42px;
.matrial-detail-left { .matrial-detail-left {
padding-bottom: 16px; padding-bottom: 16px;
&-pre { &-pre {
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
color: #5850FF; color: #5850ff;
font-weight: 600; font-weight: 600;
cursor: pointer;
} }
} }
&-unfold { &-unfold {
margin-right: 23px; margin-right: 23px;
font-size: 12px; font-size: 12px;
color: #5850FF; color: #5850ff;
}
} }
} }
.summarization {
.summarization-containner {
margin-top: 20px; margin-top: 20px;
&-title {
font-weight: 600;
padding-left: 20px;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #dcdfe6;
}
&-box {
padding: 20px;
.summarization-time {
/deep/ .el-date-editor {
margin: 0px 30px 10px 5px;
width: 410px;
}
}
.detailTable {
/deep/ .el-tabs__nav-wrap::after {
height: 0px;
}
}
}
.dataList { .dataList {
margin: 16px 20px 20px 20px; margin: 20px 0px;
display: flex; display: grid;
justify-content: space-around; grid-template-columns: repeat(5, 20%);
div { &-item {
width: 212px; margin-right: 20px;
height: 128px; background: #f9fafc;
background-color: #ccc; border-radius: 4px;
margin-right: 10px; padding: 10px 20px;
&-title {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 21px;
}
h2 {
height: 26px;
font-size: 26px;
font-weight: bold;
color: #333333;
line-height: 30px;
margin: 10px 0px;
}
&-num {
font-size: 16px;
font-weight: 400;
color: #666666;
line-height: 21px;
}
} }
:last-child { :last-child {
margin-right: 0; margin-right: 0;
...@@ -153,12 +406,64 @@ export default { ...@@ -153,12 +406,64 @@ export default {
} }
.materialDetail-title { .materialDetail-title {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 20px;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #dcdfe6;
font-weight: 600;
}
.materialDetail-title-sub {
font-size: 16px; font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 20px;
font-weight: 600; font-weight: 600;
color: rgba(0, 0, 0, 0.85); padding-left: 20px;
} }
.top-title { .top-title {
display: inline-block; display: inline-block;
margin: 17px 0 0 20px; margin: 17px 0 0 20px;
} }
.item-name-info {
font-size: 14px;
color: #999999;
line-height: 20px;
}
.phone-view {
height: 600px;
position: relative;
.img-phone {
height: 500px;
width: 312px;
position: absolute;
top: 10%;
left: 25%;
}
.phone-content {
position: absolute;
top: 20%;
left: 30%;
&-title {
width: 100%;
height: 30px;
border-bottom: 1px solid #ccc;
color: #333;
}
&-word {
color: #666;
}
}
}
.content-item-image {
img {
width: 85px;
height: 85px;
}
}
.el-tag {
margin-right: 4px;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!