Commit 02afc4d3 by 杨明

fixed

1 parent 6c22c1b2
Showing 71 changed files with 2842 additions and 599 deletions
...@@ -5,16 +5,19 @@ ...@@ -5,16 +5,19 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint",
"build:test": "vue-cli-service build --mode test"
}, },
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.9",
"glsx-components": "^1.2.8", "glsx-components": "^1.4.7",
"glsx-table": "^1.0.9", "glsx-table": "^1.0.9",
"vue-draggable-resizable": "^2.3.0" "vue-draggable-resizable": "^2.3.0",
"vuedraggable": "^2.24.3",
"xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
...@@ -26,7 +29,6 @@ ...@@ -26,7 +29,6 @@
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1", "babel-plugin-component": "^1.1.1",
"babel-plugin-transform-remove-console": "^6.9.4",
"element-theme-chalk": "^2.15.6", "element-theme-chalk": "^2.15.6",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
......
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
} }
}, },
created() { created() {
document.onkeydown = function () { document.onkeydown = function() {
var evt = window.event || arguments[0] var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) { if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
} }
#app { #app {
background: #f4f5fa; background: #f4f5fa;
padding: 0px 20px 20px 40px; padding: 0px 20px 20px 20px;
position: absolute; position: absolute;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http,http_tag } from '@/main' import { http, http_tag } from '@/main'
let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop' let session = 'mini-c38a80dd-cf48-4491-8933-fb2eb57fb4ca-rop'
const getListApi = params => { const getListApi = params => {
params.method = 'entmicro.api.staff.listFollowerStaffByPage' params.method = 'entmicro.api.staff.listFollowerStaffByPage'
...@@ -38,6 +38,15 @@ const querylabeltree = params => { ...@@ -38,6 +38,15 @@ const querylabeltree = params => {
sign: true sign: true
}) })
} }
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http_tag({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const deleteChannelCodeBill = params => { const deleteChannelCodeBill = params => {
params.method = 'entmicro.api.code.deleteChannelCodeBill' params.method = 'entmicro.api.code.deleteChannelCodeBill'
params.sessionId = session params.sessionId = session
...@@ -112,6 +121,7 @@ const detailChannelCode = params => { ...@@ -112,6 +121,7 @@ const detailChannelCode = params => {
const listChannelCodeByPage = params => { const listChannelCodeByPage = params => {
params.method = 'entmicro.api.code.listChannelCodeByPage' params.method = 'entmicro.api.code.listChannelCodeByPage'
params.sessionId = session params.sessionId = session
console.log(http)
return http({ return http({
url: '/rop-scrm-entmicro/router', url: '/rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
...@@ -186,5 +196,6 @@ export default { ...@@ -186,5 +196,6 @@ export default {
updateChannelCodeBill, updateChannelCodeBill,
listChannelCodeBill, listChannelCodeBill,
getCustomer, getCustomer,
getChannelCodeStaffList getChannelCodeStaffList,
queryCrowdtree
} }
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* @param {*} params * @param {*} params
* @returns * @returns
*/ */
import { http_common } from '@/main' import { http_common, http } from '@/main'
const pictureUpload = params => { const pictureUpload = params => {
params.method = "glsx.accounts.biz.common.pictureUpload" params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({ return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload', url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST', method: 'POST',
...@@ -17,6 +17,42 @@ const pictureUpload = params => { ...@@ -17,6 +17,42 @@ const pictureUpload = params => {
noSignAttr: ['file'] noSignAttr: ['file']
}) })
} }
// const pictureUpload = params => {
// params.method = 'scrm.api.equity.common.upload.common.multiple'
// return http({
// url: 'rop-scrm-equity/router',
// data: params,
// sign: true,
// noSignAttr: ['file']
// })
// }
const getUploadFileToken = params => {
params.method = 'glsx.accounts.biz.common.getUploadFileToken'
return http_common({
url: 'http://qcdidicb.glsx.com.cn:7060/router',
method: 'get',
data: params
})
}
const checkAndListFragmentDetail = params => {
params.method = 'glsx.accounts.biz.common.checkAndListFragmentDetail'
return http_common({
url: 'http://qcdidicb.glsx.com.cn:7060/router',
method: 'get',
data: params
})
}
const uploadFileWithFileInfo = params => {
params.method = 'glsx.accounts.biz.common.uploadFileWithFileInfo'
return http_common({
url: 'http://qcdidicb.glsx.com.cn:7060/router',
method: 'get',
data: params
})
}
export default { export default {
pictureUpload pictureUpload,
getUploadFileToken,
checkAndListFragmentDetail,
uploadFileWithFileInfo
} }
...@@ -172,6 +172,16 @@ const customerPage = params => { ...@@ -172,6 +172,16 @@ const customerPage = params => {
sign: true sign: true
}) })
} }
const findMerchantInfoByMerchantNo = params => {
params.method = 'entmicro.api.common.findMerchantInfoByMerchantNo.list'
params.sessionId = session
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
getCoupon, getCoupon,
getMerchant, getMerchant,
...@@ -189,5 +199,6 @@ export default { ...@@ -189,5 +199,6 @@ export default {
updateConfig, updateConfig,
findConfig, findConfig,
addConfig, addConfig,
customerPage customerPage,
findMerchantInfoByMerchantNo
} }
...@@ -28,8 +28,30 @@ const downloadModel = params => { ...@@ -28,8 +28,30 @@ const downloadModel = params => {
sign: true sign: true
}) })
} }
const merchantConfig = params => {
params.method = 'entmicro.api.datacube.merchant.config'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const datacubeUpload = params => {
params.method = 'entmicro.api.datacube.upload'
params.sessionId = session
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const importsRecord = params => { const importsRecord = params => {
params.method = 'entmicro.api.imports.record.page' params.method = 'entmicro.api.datacube.log.page'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
...@@ -38,8 +60,8 @@ const importsRecord = params => { ...@@ -38,8 +60,8 @@ const importsRecord = params => {
sign: true sign: true
}) })
} }
const importsRecordSearch = params => { const datacubeNotice = params => {
params.method = 'entmicro.api.imports.record.search' params.method = 'entmicro.api.datacube.notice.pc'
params.sessionId = session params.sessionId = session
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
...@@ -48,6 +70,7 @@ const importsRecordSearch = params => { ...@@ -48,6 +70,7 @@ const importsRecordSearch = params => {
sign: true sign: true
}) })
} }
const importsCount = params => { const importsCount = params => {
params.method = 'entmicro.api.imports.count' params.method = 'entmicro.api.imports.count'
params.sessionId = session params.sessionId = session
...@@ -77,12 +100,24 @@ const findLoginCount = params => { ...@@ -77,12 +100,24 @@ const findLoginCount = params => {
sign: true sign: true
}) })
} }
const queryCrowdTree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
importsUpload, importsUpload,
downloadModel, downloadModel,
importsRecord, importsRecord,
importsRecordSearch,
importsCount, importsCount,
importsKey, importsKey,
findLoginCount findLoginCount,
datacubeUpload,
merchantConfig,
datacubeNotice,
queryCrowdTree
} }
import { http } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
//权益卡
const getCard = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//权益卡
const merchant = params => {
params.method = 'scrm.api.equity.open.card.price.list.by.merchantid'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//是否开通权益
const merchantOpen = params => {
params.method = 'scrm.api.equity.service.merchant.config.get'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
//优惠券
const getCoupon = params => {
params.method = 'scrm.api.boutiquecoupon.coupon.page'
return http({
url: '/rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//套餐
const getPackage = params => {
params.method = 'scrm.api.equity.package.info.list.with.page'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchant = params => {
params.method = 'scrm.api.coupon.list.merchant'
return http({
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
})
}
//秒杀活动
const getActivity = params => {
params.method = 'scrm.api.shopmall.activity.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
// params.method = 'marketing.api.material.page'
params.method = 'marketing.api.material.sop.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//模板列表
const templatePage = params => {
params.method = `${path}template.page.search`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板保存
const templateSave = params => {
params.method = `${path}template.save`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板更新
const templateUpdate = params => {
params.method = `${path}template.update`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
//模板创建人
const createdNameList = params => {
params.method = `${path}template.created.name.list`
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getCard,
merchant,
getActivity,
getPackage,
getMerchant,
getCoupon,
merchantOpen,
getGroupListApi,
getMaterialListApi,
templatePage,
createdNameList,
templateUpdate,
templateSave
}
...@@ -101,7 +101,7 @@ img { ...@@ -101,7 +101,7 @@ img {
.scrm-box-f { .scrm-box-f {
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); // box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
} }
.scrm-flex { .scrm-flex {
...@@ -173,11 +173,6 @@ img { ...@@ -173,11 +173,6 @@ img {
.el-message-box--center { .el-message-box--center {
padding: 0px; padding: 0px;
} }
.count-item-question {
width: 14px;
height: 14px;
display: inline-block;
}
.el-message--info { .el-message--info {
height: 40px; height: 40px;
background: #e6e9ff; background: #e6e9ff;
...@@ -190,3 +185,6 @@ img { ...@@ -190,3 +185,6 @@ img {
color: #5850ff; color: #5850ff;
font-size: 16px; font-size: 16px;
} }
.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none !important;
}

644 Bytes | W: | H:

527 Bytes | W: | H:

src/assets/img/question.png
src/assets/img/question.png
src/assets/img/question.png
src/assets/img/question.png
  • 2-up
  • Swipe
  • Onion skin
import GLCombiForm from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLCombiForm.install = function(Vue) {
Vue.component(GLCombiForm.name, GLCombiForm)
}
// 默认导出组件
export default GLCombiForm
\ No newline at end of file \ No newline at end of file
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
import GLSearch from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearch.install = function(Vue) {
Vue.component(GLSearch.name, GLSearch)
}
// 默认导出组件
export default GLSearch
\ No newline at end of file \ No newline at end of file
<!-- <content> -->
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
<el-button type="warning" @click="toggleShow(1)">显示代码</el-button>
```js {mixin:true}
{
data() {
return {
demo1: true,
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods:{
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
},
//gl-search 方法
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div v-if="demo1">
```vue
<template>
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
</template>
<script>
import {GLSearch, GLSearchItem} from 'glsx-components'
// 全局引入一次css即可
import 'glsx-components/dist/glsx-components.css'
export default {
data() {
return {
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods: {
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
</script>
```
</div>
<!-- </content> -->
<template>
<div class="gl-search" id="gl-search" :class="{ transTo: !expand }">
<div class="search-list">
<!-- 默认插槽 -->
<slot></slot>
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div>
<div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
</div>
<div class="gl-operate">
<div class="operate">
<el-button size="small" type="primary" @click="handleOk">查询</el-button>
<el-button size="small" @click="handleRest">重置</el-button>
<el-button type="text" size="small" @click="expandFn" v-if="hasExpand">
<span>{{ !expand ? '展开' : '收起' }}</span>
<i class="expand" :class="classIcon"></i>
</el-button>
<!-- <i class="el-icon-arrow-down expand"></i> -->
<!-- <i class="el-icon-arrow-up"></i> -->
</div>
</div>
</div>
</template>
<script>
export default {
name: 'GLSearch',
props: {},
data() {
return {
// input: '',
expand: false,
itemNum: 0,
time: null,
hasExpand: false
}
},
created() {},
mounted() {
this.getItemNum()
// 判断宽度按,是否显示展开收起
this.getClientWith()
window.addEventListener('resize', this.getClientWith, false)
},
computed: {
classIcon() {
return !this.expand ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
}
},
methods: {
// 展开收起
expandFn() {
this.expand = !this.expand
},
// 获取item 输入框 的个数
getItemNum() {
const items = document.getElementById('gl-search').getElementsByClassName('search-item').length
this.itemNum = items
},
// 判断是否有展开收起标志
ifHasExpand(nowCol) {
if (this.itemNum > nowCol) {
return true
}
return false
},
// 监听函数
getClientWith() {
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
const clientWidth = document.documentElement.clientWidth
// console.log('clientWidth: ', clientWidth)
if (clientWidth <= 800) {
// 1列
this.hasExpand = this.ifHasExpand(1)
} else if (clientWidth <= 1440 && clientWidth > 800) {
// 2列
this.hasExpand = this.ifHasExpand(2)
} else if (clientWidth <= 1720 && clientWidth > 1440) {
// 3列
this.hasExpand = this.ifHasExpand(3)
} else {
// 4列
this.hasExpand = this.ifHasExpand(4)
}
}, 300)
},
handleOk() {
// 点击确定的回调
this.$emit('onOk')
},
handleRest() {
// 点击重置的回调
this.$emit('onRest')
}
},
components: {},
watch: {},
beforeDestroy() {
window.removeEventListener('resize', this.getClientWith, false)
this.time = null
}
}
</script>
<style lang="scss">
.gl-search {
&.transTo {
height: 52px;
}
display: flex;
justify-content: space-between;
overflow: hidden;
// @media screen and (max-width: 1062px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1062px) and (max-width: 1440px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1440px) and (max-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
.search-list {
.search-item {
width: 100%;
}
}
.search-list {
flex: 1;
display: flex;
flex-wrap: wrap;
.search-item {
// flex: 1;
// padding-right: 12px;
margin-bottom: 20px;
min-width: 276px;
display: flex;
align-items: center;
box-sizing: border-box;
.name {
width: 112px;
text-align: right;
font-size: 14px;
font-weight: 400;
color: #666;
}
.input {
flex: 1;
// width:100%;
}
.el-input {
width: 100%;
}
.el-select {
width: 100%;
}
.el-date-editor {
width: 100%;
}
}
}
.gl-operate {
display: flex;
align-items: flex-end;
.operate {
text-align: left;
width: 190px;
margin-bottom: 20px;
.expand {
font-size: 14px;
}
.el-button + .el-button {
margin-left: 8px;
}
}
}
}
</style>
import GLSearchItem from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearchItem.install = function(Vue) {
Vue.component(GLSearchItem.name, GLSearchItem)
}
// 默认导出组件
export default GLSearchItem
\ No newline at end of file \ No newline at end of file
<template>
<div :style="{ 'padding-right': spacer + 'px' }" class="search-item">
<div class="name">
<!-- {{ label }} -->
<!-- name 插槽 -->
<slot name="name"></slot>
</div>
<div class="input">
<!-- 默认插槽 -->
<slot></slot>
<!-- <el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input> -->
</div>
</div>
</template>
<script>
export default {
name: 'GLSearchItem',
props: {
// 每个项间隙
spacer: {
type: Number,
default: 12
}
},
data () {
return {}
},
created () {},
mounted () {},
computed: {},
methods: {},
components: {},
watch: {}
}
</script>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-05-24 18:18:53
* @LastEditors: huyue
* @LastEditTime: 2022-06-14 18:21:41
-->
<template>
<div>
<GLDialog title="人群筛选" :hasFooter="true" :visible.sync="crowdVisible" mode="big">
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">
人群列表
</div>
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="人群名称" style="margin-bottom: 0" size="small">
<el-input :size="size" v-model.trim="searchForm.keyword" @keyup.enter.native="search" clearable placeholder="请输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label style="margin-bottom: 0;margin-left:10px" size="small">
<el-button type="primary" :size="size" @click="search">搜索</el-button>
</el-form-item>
</el-form>
<div class="table-content">
<GLTable v-loading="loading" ref="crowdTable" :tableData="tableData" @refreshTable="getCrowdList" :tableTotal="tableTotal" :layout="layout" :tableParams="crowdTableParams" :hasNum="true" :pageConf="pageConf" :noDataImg="url" @selectionTable="handleSelectionTable" @row-click="rowClick"></GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选</div>
<div class="member-name">人群({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag, idx)">
{{ tag.crowdName }}
</el-tag>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button style="width: 68px;" size="small" @click="crowdVisible = false">取 消</el-button>
<el-button style="width: 68px;" size="small" type="primary" @click.native="handleConfirm">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
// import url from '@/assets/empty.png'
export default {
name: 'SelectCrowd',
data() {
return {
url: 0,
crowdVisible: false,
searchForm: { keyword: '' },
innerTags: [],
inner: [],
tableCrowdData: [
{
name: 'asda'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
crowdTableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
// 多选ref的名称
mutiSelectName: 'crowdlist',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName'
},
{
label: '人群描述',
prop: 'crowdDesc',
width: '200',
line: 1
},
{
label: '人数',
prop: 'total'
}
]
}
}
},
methods: {
init(val) {
this.inner = this.$common.utils.deepClone(val)
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
this.$nextTick(() => {
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList()
})
},
// this.$refs.crowdTable.tableHeightValues = '250'
getCrowdList(page = { pageNum: 1, pageSize: 10 }) {
this.$refs.crowdTable.page = page
var params = {
req: {
keyword: this.searchForm.keyword,
merchantId: this.$globalState.session.merchantId,
crowdType: 3,
filterType: 2,
pageSize: page.pageSize,
pageNum: page.pageNum
}
}
this.$apis.channel.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
// console.log(this.inner)
// console.log(this.tableData)
// this.tableData.forEach(item => {
// this.inner.forEach((itm, index) => {
// if (itm.crowdId == item.crowdId) {
// this.rowClick(item)
// }
// })
// })
this.recoverySelected()
})
},
// selectionTable(val) {
// this.innerTags = []
// for (let i = 0; i < val.length; i++) {
// const tagArr = this.innerTags.map(item => item.crowdId + '')
// console.log(tagArr)
// if (!tagArr.includes(val[i].crowdId)) {
// this.innerTags.push(val[i])
// }
// console.log(this.innerTags)
// }
// },
// 选择/取消
handleSelectionTable(val) {
var list = JSON.parse(JSON.stringify(this.innerTags))
this.innerTags = []
val.forEach(item => {
if (this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
list.forEach(item => {
if (this.tableData.findIndex(k => k.crowdId == item.crowdId) == '-1' && this.innerTags.findIndex(k => k.crowdId == item.crowdId) == '-1') {
this.innerTags.push(item)
}
})
},
// 恢复选择
addSelected() {
this.$nextTick(() => {
var list = JSON.parse(JSON.stringify(this.innerTags))
if (list && list.length) {
list.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], true)
}
})
}
})
},
recoverySelected() {
// 翻页,去掉已选项
var selectedData = this.$refs.crowdTable.mutiSelectArr.crowdlist
var deleteList = []
this.addSelected()
if (selectedData) {
selectedData.forEach(item => {
if (this.innerTags.findIndex(subItem => subItem.crowdId == item.crowdId) == -1) {
deleteList.push(item)
}
})
this.deleteSelected(deleteList)
}
},
// 删除选中
deleteSelected(deleteList) {
this.$nextTick(() => {
deleteList.forEach(row => {
var idx = this.tableData.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[idx], false)
}
})
})
},
remove(item) {
var idx = this.innerTags.findIndex(k => k.crowdId == item.crowdId)
this.innerTags.splice(idx, 1)
if (this.tableData.map(k => k.crowdId).includes(item.crowdId)) {
var i = this.tableData.findIndex(k => k.crowdId == item.crowdId)
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(this.tableData[i])
}
},
rowClick(row) {
this.$refs.crowdTable.$refs.crowdlistMutiTable.toggleRowSelection(row)
},
search() {
this.getCrowdList({ pageNum: 1, pageSize: 10 })
},
handleConfirm() {
// console.log(this.innerTags)
this.$emit('crowdData', this.innerTags)
this.crowdVisible = false
this.searchForm = { keyword: {} }
}
}
}
</script>
<style lang="scss" scoped>
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-weight: 500;
}
}
.member-left {
width: 800px;
.member-content {
border: 1px solid #eee;
padding-bottom: 20px;
/deep/ {
.el-table {
// height: 40vh;
overflow-y: auto;
}
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 500px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 286px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
width: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
background: #fafbfe !important;
}
/deep/ {
.el-dialog__title {
font-weight: 600;
}
.el-dialog__header {
padding: 20px;
}
.el-dialog__headerbtn {
height: 30px;
.el-dialog__close {
width: 24px;
height: 24px;
}
}
.el-pagination {
padding-left: 20px;
border-top: 1px solid #e8e8ea;
padding-top: 16px;
}
.el-table:before {
display: none;
}
}
</style>
<template> <template>
<div class="square-main" v-loading="loading"> <div class="square-main" v-loading="loading">
<el-dialog title="选择跟进专员" :visible.sync="dialogVisible" width="50%" :before-close="handleClose"> <GLDialog title="选择跟进专员" :hasFooter="true" :visible.sync="dialogVisible">
<el-form :inline="true" :model="tableSearchForm"> <el-form :inline="true" :model="tableSearchForm">
<el-form-item size="small" label="员工"> <el-form-item size="small" label="员工">
<el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input> <el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small"> <el-form-item size="small" class="emp-form-btn">
<el-button type="primary" @click="handleSearch">查询</el-button> <el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
<el-button size="small" @click="handleCancel">取 消</el-button> <el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button>
</span> </span>
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import util from '@/utils/util' import util from '@/utils/util'
export default { export default {
name: 'selectEmp', name: 'selectEmp',
...@@ -61,7 +62,7 @@ export default { ...@@ -61,7 +62,7 @@ export default {
}, },
methods: { methods: {
jumpUrl() { jumpUrl() {
util.openUrl(location.origin + '/home/followUp/index') util.openUrl(location.origin + '/settings/followUp/index')
}, },
getFollower() { getFollower() {
var params = { var params = {
...@@ -100,11 +101,11 @@ export default { ...@@ -100,11 +101,11 @@ export default {
handleClose() { handleClose() {
this.handleCancel() this.handleCancel()
}, },
handleCancel: utils.debounce(function () { handleCancel: utils.debounce(function() {
this.dialogVisible = false this.dialogVisible = false
this.$refs.table.$refs.salelistMutiTable.clearSelection() this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, 300), }, 300),
handleSelect: utils.debounce(function () { handleSelect: utils.debounce(function() {
this.loading = true this.loading = true
let selectEmp = this.selectEmp.map(item => { let selectEmp = this.selectEmp.map(item => {
return { return {
...@@ -127,8 +128,11 @@ export default { ...@@ -127,8 +128,11 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.emp-form-btn {
margin-left: 20px;
}
.dialog-jump { .dialog-jump {
color: #5850FF; color: #5850ff;
float: left; float: left;
line-height: 24px; line-height: 24px;
text-decoration: underline; text-decoration: underline;
......
<template> <template>
<div class="tag-main"> <div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose"> <GLDialog bigTitle="选择标签" :hasFooter="true" :visible.sync="dialogVisible" mode="big">
<div class="tag-panel"> <div class="tag-panel">
<div class="tag-panel-select"> <div class="tag-panel-select">
<div class="tag-title">预选标签</div> <div class="tag-title">预选标签</div>
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input> <el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button> <el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div> </div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }"> <div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading">
<div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index"> <div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span> <span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox> <el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox>
<div style="margin: 15px 0"></div> <div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-show="item.checked"> <el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-if="item.checked">
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox> <el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
...@@ -39,10 +39,12 @@ ...@@ -39,10 +39,12 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a>
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="handleClose">
取 消
</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span> </span>
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -53,38 +55,14 @@ export default { ...@@ -53,38 +55,14 @@ export default {
name: 'activityModel', name: 'activityModel',
data() { data() {
return { return {
loading: false,
heightBox: 200, heightBox: 200,
dialogVisible: false, dialogVisible: false,
labelGroupName: '', labelGroupName: '',
selectNum: 0, selectNum: 0,
searchStatus: false, searchStatus: false,
labelTreeRetSelect: [], labelTreeRetSelect: [],
labelTreeRets: [ labelTreeRets: []
{
labelGroup: { id: '109', name: '湖口123' },
labelList: [
{ id: '372', name: '12345678' },
{ id: '371', name: '7654321' },
{ id: '370', name: '1234567' }
],
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
},
{
labelGroup: { id: '65', name: '自店标签111' },
labelList: [
{ id: '179', name: '标签44' },
{ id: '178', name: '标签33' },
{ id: '176', name: '标签1112' }
],
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
]
} }
}, },
watch: { watch: {
...@@ -113,6 +91,7 @@ export default { ...@@ -113,6 +91,7 @@ export default {
this.querylabeltree() this.querylabeltree()
}, },
querylabeltree(selectItem) { querylabeltree(selectItem) {
this.loading = true
this.$apis.channel this.$apis.channel
.querylabeltree({ .querylabeltree({
labelTreeReq: { labelTreeReq: {
...@@ -150,19 +129,14 @@ export default { ...@@ -150,19 +129,14 @@ export default {
} }
}) })
}) })
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (itm.labelGroup.id == item.labelGroup.id) {
item.tagChecked = utils.deepClone(itm.tagChecked)
}
})
})
this.labelTreeRets.forEach((item, index) => { this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => { this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index) this.handleCheckedChange(item.tagChecked, index, 1)
}) })
}) })
this.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets) this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
})
} else { } else {
this.labelTreeRets = res.labelTreeRets.map(item => { this.labelTreeRets = res.labelTreeRets.map(item => {
return { return {
...@@ -194,14 +168,27 @@ export default { ...@@ -194,14 +168,27 @@ export default {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets) this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
} }
} }
this.$nextTick(() => {
this.loading = false
})
}) })
}, },
remove(item, idx) { handleClose() {
item.tagChecked.splice(idx, 1) this.labelTreeRetSelect = []
this.dialogVisible = false
},
remove(items, idx) {
items.tagChecked.splice(idx, 1)
this.labelTreeRets.forEach(item => { this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => { this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) { if (item.labelGroup.id == itm.labelGroup.id) {
item.tagChecked = utils.deepClone(itm.tagChecked) let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
} }
if (item.tagChecked.length == 0) { if (item.tagChecked.length == 0) {
this.$nextTick(() => { this.$nextTick(() => {
...@@ -210,10 +197,9 @@ export default { ...@@ -210,10 +197,9 @@ export default {
} }
}) })
}) })
this.labelTreeRets.forEach((item, index) => { this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => { this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index) this.handleCheckedChange(item.tagChecked, index, 1)
}) })
}) })
}, },
......
<template> <template>
<div class="square-main"> <div class="square-main">
<el-dialog title="选择活动" :visible.sync="dialogVisible" width="1088px" :before-close="handleClose"> <el-dialog title="选择活动" :visible.sync="dialogVisible" width="1088px" :before-close="handleClose">
<div class="model-panel"> <div class="model-panel" v-loading="loading">
<div class="model-panel-tab"> <div class="model-panel-tab">
<label>活动类型:</label> <label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card"> <el-tabs v-model="activeName" @tab-click="handleClick" type="card">
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
<el-tab-pane label="权益套餐" name="4"></el-tab-pane> <el-tab-pane label="权益套餐" name="4"></el-tab-pane>
<el-tab-pane label="商城券" name="2"></el-tab-pane> <el-tab-pane label="商城券" name="2"></el-tab-pane>
<el-tab-pane label="秒杀活动" name="5"></el-tab-pane> <el-tab-pane label="秒杀活动" name="5"></el-tab-pane>
<!-- <el-tab-pane label="无忧服务" name="6" v-if="openFlag"></el-tab-pane> --> <el-tab-pane label="无忧服务" name="6" v-if="openFlag"></el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading"> <div class="model-item-panel" v-if="modelList.length > 0">
<div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)"> <div class="model-item" :class="{ checked: selectItem == item }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div class="model-item-title" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div> <div class="model-item-title" :title="item.equityName" v-show="activeName == 3">{{ item.equityName }}</div>
<div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div> <div class="model-item-title" :title="item.couponName" v-show="activeName == 2">{{ item.couponName }}</div>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
<div class="model-item-content model-item-weight" v-show="activeName == 6"> <div class="model-item-content model-item-weight" v-show="activeName == 6">
赠送天数: 赠送天数:
<span>{{ effectiveType == 2 ? item.effectiveDay + '天' : '永久有效' }}</span> <span>{{ item.effectiveType == 2 ? item.effectivedDay + '天' : '永久有效' }}</span>
</div> </div>
<div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div> <div class="model-item-content" v-show="activeName == 4 || activeName == 5"></div>
<div class="model-item-content model-item-contents" v-show="activeName == 4"> <div class="model-item-content model-item-contents" v-show="activeName == 4">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<img src="@/assets/img/empty.png" /> <img src="@/assets/img/empty.png" />
<div class="empty-item">暂无数据</div> <div class="empty-item">暂无数据</div>
</div> </div>
<el-pagination v-if="activeName != 3" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[12, 24, 36, 48]" :page-size="pageSize" :total="tableTotal" layout="total, sizes, prev, pager, next, jumper"></el-pagination> <el-pagination v-if="activeName != 3 && activeName != 6" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[12, 24, 36, 48]" :page-size="pageSize" :total="tableTotal" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
...@@ -171,6 +171,7 @@ export default { ...@@ -171,6 +171,7 @@ export default {
} }
if (this.activeName == 2) { if (this.activeName == 2) {
params.discountTypes = [2, 3, 4] params.discountTypes = [2, 3, 4]
params.directionalFlag = 1 // 1所有人可用2定向礼包专用3关联优惠券
params.validType = 'valid' params.validType = 'valid'
} }
if (this.activeName == 5) { if (this.activeName == 5) {
...@@ -195,12 +196,16 @@ export default { ...@@ -195,12 +196,16 @@ export default {
}) })
}, },
merchantOpen() { merchantOpen() {
this.$apis.marketing.merchantOpen({ merchantId: this.$globalState.session.merchantId }).then(res => { let channel = null
if (location.host == 'scrm.cgacar.com') {
channel = 2
}
this.$apis.marketing.merchantOpen({ merchantId: this.$globalState.session.merchantId, channel }).then(res => {
this.openFlag = res.openFlag this.openFlag = res.openFlag
}) })
}, },
init() { init() {
// this.merchantOpen() this.merchantOpen()
this.couponMenu = false this.couponMenu = false
this.activityMenu = false this.activityMenu = false
this.memberMenu = false this.memberMenu = false
......
...@@ -88,30 +88,6 @@ export default { ...@@ -88,30 +88,6 @@ export default {
document.removeEventListener('selectionchange', this.selectHandler) document.removeEventListener('selectionchange', this.selectHandler)
}, },
methods: { methods: {
textareaRange() {
var el = this.$refs.wTextareaContent
var range = document.createRange()
//返回用户当前的选区
var sel = el.document.parentWindow.getSelection()
//获取当前光标位置
var offset = sel.focusOffset
//div当前内容
var content = el.innerHTML //添加换行符\n
el.innerHTML = content.slice(0, offset) + '\n\n' + content.slice(offset) //设置光标为当前位置
range.setStart(el.childNodes[0], offset + 1)
//使得选区(光标)开始与结束位置重叠
range.collapse(true)
//移除现有其他的选区
sel.removeAllRanges()
//加入光标的选区
sel.addRange(range)
},
textareaKeydown(event) {
if (event.keyCode == 13) {
console.log(11111111)
this.textareaRange()
}
},
updateData(text) { updateData(text) {
this.$emit('input', text) this.$emit('input', text)
}, },
...@@ -134,6 +110,50 @@ export default { ...@@ -134,6 +110,50 @@ export default {
// 处理后需要调用 addTag() 或者 addLink() 将内容传回来 // 处理后需要调用 addTag() 或者 addLink() 将内容传回来
this.$emit('add', type) this.$emit('add', type)
}, },
textareaKeydown(event) {
if (event.keyCode == 13) {
this.insertHtml('<br>')
let nn = document.createElement('br')
document.querySelector('.w-textarea_input').appendChild(nn)
return false
}
},
/*换行*/
insertHtml(html) {
var sel, range
if (window.getSelection) {
// IE9 或 非IE浏览器
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
// Range.createContextualFragment() would be useful here but is
// non-standard and not supported in all browsers (IE9, for one)
var el = document.createElement('div')
el.innerHTML = html
var frag = document.createDocumentFragment(),
node,
lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
// Preserve the selection
if (lastNode) {
range = range.cloneRange()
range.setStartAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
} else if (document.selection && document.selection.type != 'Control') {
// IE < 9
document.selection.createRange().pasteHTML(html)
}
this.currentText = document.querySelector('.w-textarea_input').innerHTML
this.$emit('updateText', this.currentText)
},
addTag(text) { addTag(text) {
// 创建模版标签 // 创建模版标签
let node = document.createElement(this.tag) let node = document.createElement(this.tag)
...@@ -244,15 +264,18 @@ export default { ...@@ -244,15 +264,18 @@ export default {
} }
let htm = target.innerHTML let htm = target.innerHTML
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '') const cutImg = htm
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) { .replace(/<img src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<wise.+?(?:<\/wise>)/g, '@昵称')
.replace(/<br>/g, '\n')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1] let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]` return `[${s}]`
}) })
console.log(replaceImg)
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600) this.currentText = replaceImg.substring(0, 600)
console.log(this.currentText)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
placeCaretAtEnd(el) { placeCaretAtEnd(el) {
...@@ -278,14 +301,18 @@ export default { ...@@ -278,14 +301,18 @@ export default {
let htm = target.innerHTML let htm = target.innerHTML
console.log(htm) console.log(htm)
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
const cutImg = htm.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '') const cutImg = htm
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) { .replace(/<img src="https:\/\/img01.glsx.com.cn\/weapp\/resource\/saas\/scrm\/emoji\//g, '')
.replace(/<wise.+?(?:<\/wise>)/g, '@昵称')
.replace(/<br>/g, '\n')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
let s = list[parseInt(str.split('.')[0]) - 1] let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]` return `[${s}]`
}) })
let Textnode = document.createElement('div') let Textnode = document.createElement('div')
Textnode.innerHTML = replaceImg Textnode.innerHTML = replaceImg
this.currentText = Textnode.innerText.substring(0, 600) this.currentText = replaceImg.substring(0, 600)
console.log(this.currentText)
this.$emit('updateText', this.currentText) this.$emit('updateText', this.currentText)
}, },
handleDelete(e) { handleDelete(e) {
...@@ -319,8 +346,9 @@ export default { ...@@ -319,8 +346,9 @@ export default {
} }
}, },
getGuid() { getGuid() {
return 1
// 生成随机ID // 生成随机ID
return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}` // return `r${new Date().getTime()}d${Math.ceil(Math.random() * 1000)}`
}, },
selectHandler() { selectHandler() {
// 监听选定文本的变动 // 监听选定文本的变动
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<span v-else>{{ item.name }}</span> <span v-else>{{ item.name }}</span>
<input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" /> <input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" /> <input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<el-link v-else-if="item.type == 'nickname' || item.type == 'acivity'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link> <el-link v-else-if="item.type == 'nickname' || item.type == 'acivity' || item.type == 'material'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
</div> </div>
</div> </div>
</div> </div>
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
</div> </div>
</div> </div>
<ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel> <ActivityModel ref="activity" @selectActivity="selectActivity"></ActivityModel>
<!-- <material-model v-if="isMaterialVisible" :isMaterialVisible.sync="isMaterialVisible" @handleMaterialConfirm="handleMaterialConfirm" @handleMaterialClose="handleMaterialClose"></material-model> -->
</div> </div>
</template> </template>
<script> <script>
...@@ -77,6 +78,7 @@ const ATT_TYPE = { ...@@ -77,6 +78,7 @@ const ATT_TYPE = {
} }
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
import ActivityModel from './activityModel' import ActivityModel from './activityModel'
// import materialModel from './materialModel'
import Emotion from './emotionWords' import Emotion from './emotionWords'
import wTextarea from './tag-textarea' import wTextarea from './tag-textarea'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
...@@ -84,6 +86,7 @@ export default { ...@@ -84,6 +86,7 @@ export default {
name: 'WelcomeWords', name: 'WelcomeWords',
components: { components: {
ActivityModel, ActivityModel,
// materialModel,
Emotion, Emotion,
wTextarea wTextarea
}, },
...@@ -92,6 +95,7 @@ export default { ...@@ -92,6 +95,7 @@ export default {
return { return {
loading: false, loading: false,
emotionStatus: false, emotionStatus: false,
isMaterialVisible: false,
btnList: [ btnList: [
{ {
id: 1, id: 1,
...@@ -113,6 +117,12 @@ export default { ...@@ -113,6 +117,12 @@ export default {
type: 'nickname', type: 'nickname',
funName: 'nickname' funName: 'nickname'
}, },
// {
// id: 5,
// name: '素材',
// type: 'material',
// funName: 'material'
// },
{ {
id: 4, id: 4,
name: '活动', name: '活动',
...@@ -229,11 +239,33 @@ export default { ...@@ -229,11 +239,33 @@ export default {
}) })
} }
}, },
// 素材
handleMaterialConfirm(val) {
console.log(val)
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
// objectType 对象类型(1朋友圈模板-单图文,2朋友圈模板-多图文,3朋友圈模板-文字+视频,4朋友圈模板-文字,5优惠券-商城券,6活动-权益卡使用,7活动-权益套餐,8活动-秒杀活动,10-素材)
this.editForm.object = JSON.parse(JSON.stringify(val))
this.editRule.eventContent[0].required = true
this.editForm.pushChannelType = ''
this.previewList = [
{
attContent: val,
additionalType: val.additionalType
}
]
this.handleMaterialClose()
},
handleMaterialClose() {
this.isMaterialVisible = !this.isMaterialVisible
},
handleFun(name) { handleFun(name) {
if (name == 'nickname') { if (name == 'nickname') {
this.$refs.textContent.addTag('@昵称') this.$refs.textContent.addTag('@昵称')
} else if (name == 'activity') { } else if (name == 'activity') {
this.$refs.activity.init() this.$refs.activity.init()
} else if (name == 'material') {
this.handleMaterialClose()
} }
}, },
close(index) { close(index) {
...@@ -241,6 +273,7 @@ export default { ...@@ -241,6 +273,7 @@ export default {
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
}, },
textInput(val) { textInput(val) {
val = val.replace(/&nbsp;/g, '')
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) { if (hasText) {
this.$set(this.previewList, 0, { this.$set(this.previewList, 0, {
...@@ -276,35 +309,7 @@ export default { ...@@ -276,35 +309,7 @@ export default {
} }
} }
}, },
insertHtmlAtCaret(html) { changeInput: utils.debounce(function() {
var sel, range, frag
if (window.getSelection) {
sel = window.getSelection()
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0)
range.deleteContents()
var el = document.createElement('span')
el.innerHTML = '<span contenteditable="false" class="nickname">@昵称<i class="el-icon-error"></i></span>'
// var el = document.createElement('div')
// el.innerHTML = html
frag = document.createDocumentFragment()
var node
var lastNode
while ((node = el.firstChild)) {
lastNode = frag.appendChild(node)
}
range.insertNode(frag)
if (lastNode) {
range = range.cloneRange()
range.setEndAfter(lastNode)
range.collapse(true)
sel.removeAllRanges()
sel.addRange(range)
}
}
}
},
changeInput: utils.debounce(function () {
console.log(document.getElementById('editor').childNodes) console.log(document.getElementById('editor').childNodes)
var allNodes = document.getElementById('editor').childNodes var allNodes = document.getElementById('editor').childNodes
var str = '' var str = ''
...@@ -323,8 +328,8 @@ export default { ...@@ -323,8 +328,8 @@ export default {
this.previewList = val this.previewList = val
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1) const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>') let attContent = obj.attContent.replace(/\[@昵称\]/g, '<wise id="1" contenteditable="false">@昵称</wise>')
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) { const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '') let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1 let index = parseInt(list.indexOf(word)) + 1
......
...@@ -12,12 +12,31 @@ module.exports = { ...@@ -12,12 +12,31 @@ 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',
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'http://192.168.1.254', baseURL: 'http://scrm.dev.glsx.com.cn',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request_tag: {
baseURL: 'http://ismv.branch.glsx.com.cn',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
request_common: {
baseURL: 'https://qcdidicb.glsx.net:7060',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -31,7 +50,13 @@ module.exports = { ...@@ -31,7 +50,13 @@ module.exports = {
format: 'json', format: 'json',
source: '' source: ''
}, },
sign_common: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static' cdn: 'https://www.xxx.cn/static'
} }
\ No newline at end of file \ No newline at end of file
...@@ -12,12 +12,13 @@ let cfg = require('./conf.js') ...@@ -12,12 +12,13 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
return new Http({request: { timeout: 100000}}).get(' https://oss-config.test.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config') return new Http({ request: { timeout: 100000 } }).get('https://oss-config.test.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
// return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
...@@ -11,13 +11,17 @@ import Vue from 'vue' ...@@ -11,13 +11,17 @@ import Vue from 'vue'
import apis from './api' import apis from './api'
import './public-path' import './public-path'
import './components' import './components'
import filters from './utils/filters'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
//过滤器统一处理预加载
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
start() start()
export { bootstrap, mount, unmount } export { bootstrap, mount, unmount } from '@/setup'
from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params) export const http_common = params => Vue.prototype.$http_common(params)
export const http_tag = params => Vue.prototype.$http_tag(params) export const http_tag = params => Vue.prototype.$http_tag(params)
const ATT_TYPE = {
TEXT: 1,
IMAGE: 2,
VEDIO: 3,
URL: 4,
MINIPROGRAM: 5,
FILE: 6,
ACTIVITY: 7,
MATERIAL: 10
}
export default {
data() {
return {
btnList: [
{
name: '表情',
funcName: '',
type: 'expression',
limitSize: 10
},
{
name: '图片',
funcName: '',
type: 'img',
// togetherItem: [ATT_TYPE.TEXT], //只允许文本和图片
// limitSize: 10, //限制图片大小
// limitNum: 2, //限制图片数量
// limitWidth: 10000, //限制单张图片宽度
// limitHeight: 10000,//限制单张图片高度
// Isdraggable: true, //图片拖拽
uploadApi: this.$apis.common.pictureUpload
},
{
name: '昵称',
type: 'nickname',
funName: 'nickname'
},
{
name: '活动',
type: 'activity',
funName: 'activity',
funParams: [
{
itemName: '权益卡试用',
itemValue: 3,
itemType: 'card',
getInterfaceApi: this.$apis.welcomeword.getCard,
params: {
tryAble: 1,
merchantId: this.$globalState.session.merchantId
}
},
{
itemName: '权益套餐',
itemValue: 4,
itemType: 'package',
getInterfaceApi: this.$apis.welcomeword.getPackage,
params: {}
},
{
itemName: '商城券',
itemValue: 2,
itemType: 'coupon',
getInterfaceApi: this.$apis.welcomeword.getMerchant,
params: {
discountTypes: [2, 3, 4],
directionalFlag: 1, // 1所有人可用2定向礼包专用3关联优惠券
validType: 'valid'
}
},
{
itemName: '秒杀活动',
itemValue: 5,
itemType: 'activity',
getInterfaceApi: this.$apis.welcomeword.getActivity,
params: {
activityStatus: 2,
currentPage: 1
}
},
{
itemName: '无忧服务',
itemValue: 6,
itemType: 'merchant',
getInterfaceApi: this.$apis.welcomeword.merchant,
merchantOpen: {
merchantOpenApi: this.$apis.welcomeword.merchantOpen,
params: {
merchantId: this.$globalState.session.merchantId
}
},
params: {
merchantId: this.$globalState.session.merchantId
}
}
]
},
{
name: '素材',
type: 'material',
funName: 'material',
groupListApi: this.$apis.welcomeword.getGroupListApi,
materialListApi: this.$apis.welcomeword.getMaterialListApi
//videoNo: true
// pdfNo: true
}
]
}
}
}
const staticRoutes = Object.freeze([{ const staticRoutes = Object.freeze([
{
name: 'channel', name: 'channel',
path: '/channel/index', path: '/channel/index',
component: resolve => require([`@/views/channel/index.vue`], resolve), component: resolve => require([`@/views/channel/index.vue`], resolve),
meta: {}, meta: {}
}, { },
{
name: 'channel', name: 'channel',
path: '/channel/store/:id/:codeUuid/:codeState', path: '/channel/store/:id/:codeUuid/:codeState',
component: resolve => require([`@/views/channel/store.vue`], resolve), component: resolve => require([`@/views/channel/store.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'addCode', name: 'addCode',
path: '/channel/addCode/:id/:codeUuid', path: '/channel/addCode/:id/:codeUuid',
component: resolve => require([`@/views/channel/addCode.vue`], resolve), component: resolve => require([`@/views/channel/addCode.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'poster', name: 'poster',
path: '/channel/poster/:id', path: '/channel/poster/:id',
component: resolve => require([`@/views/channel/poster.vue`], resolve), component: resolve => require([`@/views/channel/poster.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'square', name: 'square',
path: '/square/index', path: '/square/index',
component: resolve => require([`@/views/square/index.vue`], resolve), component: resolve => require([`@/views/square/index.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'import', name: 'import',
path: '/square/import', path: '/square/import',
component: resolve => require([`@/views/square/import.vue`], resolve), component: resolve => require([`@/views/square/import.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'customDetail', name: 'customDetail',
path: '/square/customDetail', path: '/square/customDetail',
component: resolve => require([`@/views/square/customDetail.vue`], resolve), component: resolve => require([`@/views/square/customDetail.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'importResult', name: 'importResult',
path: '/square/importResult/:id', path: '/square/importResult/:id',
component: resolve => require([`@/views/square/importResult.vue`], resolve), component: resolve => require([`@/views/square/importResult.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'drainage', name: 'drainage',
path: '/square/drainage', path: '/square/drainage',
component: resolve => require([`@/views/square/drainage.vue`], resolve), component: resolve => require([`@/views/square/drainage.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'market', name: 'market',
path: '/market/index', path: '/market/index',
component: resolve => require([`@/views/market/index.vue`], resolve), component: resolve => require([`@/views/market/index.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'config', name: 'config',
path: '/market/config', path: '/market/config',
component: resolve => require([`@/views/market/config.vue`], resolve), component: resolve => require([`@/views/market/config.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'configDetail', name: 'configDetail',
path: '/market/configDetail/:id?', path: '/market/configDetail/:id?',
component: resolve => require([`@/views/market/configDetail.vue`], resolve), component: resolve => require([`@/views/market/configDetail.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'effect', name: 'effect',
path: '/market/effect/:id?', path: '/market/effect/:id?',
component: resolve => require([`@/views/market/effect.vue`], resolve), component: resolve => require([`@/views/market/effect.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'overview', name: 'overview',
path: '/overview/index', path: '/overview/index',
component: resolve => require([`@/views/overview/index.vue`], resolve), component: resolve => require([`@/views/overview/index.vue`], resolve),
meta: {} meta: {}
}, { },
{
name: 'friends', name: 'friends',
path: '/friends/index/:id', path: '/friends/index/:id',
component: resolve => require([`@/views/friends/index.vue`], resolve), component: resolve => require([`@/views/friends/index.vue`], resolve),
meta: { permissions: ['新增'] } meta: { permissions: ['新增'] }
}]) }
])
export default staticRoutes export default staticRoutes
...@@ -2,14 +2,18 @@ import Vue from 'vue' ...@@ -2,14 +2,18 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js' // import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLTable, GLButton, GLFooter } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLTable, GLButton, GLFooter, GLCombiForm, GLDialog, GLFull } from 'glsx-components' //权限按钮 (根据权限动态创建)
import GLEditor from 'glsx-components/src/packages/Editor' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GLCombiForm)
Vue.use(GLDialog)
Vue.use(GLFull)
// import GLTable from '@/components/glsx-table/index' // import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable) Vue.component('GLEditor', GLEditor)
// import 'glsx-components/src/theme/theme.scss' // import 'glsx-components/src/theme/theme.scss'
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss' import '@/assets/css/common.scss'
...@@ -17,14 +21,14 @@ let routes = [] ...@@ -17,14 +21,14 @@ let routes = []
let router = null let router = null
let instance = null let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) { export async function bootstrap({ name, id, history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, request_common, sign_common, request_tag } = await fetchConfig() const { response, request, sign, secret, request_common, sign_common, request_tag } = 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
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_tag = new common.Http({ response, request: request_tag, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http_tag = new common.Http({ response, request: request_tag, sign, secret, alert: ElementUI.Message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } }) Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData) routes = getRoutes(routesData)
subscribe({ messenger }) subscribe({ messenger })
......
...@@ -18,7 +18,7 @@ const render = (base, routes) => { ...@@ -18,7 +18,7 @@ const render = (base, routes) => {
mode: 'history' mode: 'history'
}) })
router.afterEach(() => { router.afterEach(() => {
document.querySelector("#app").scrollTop = 0; document.querySelector('#app').scrollTop = 0
}) })
const vm = new Vue({ const vm = new Vue({
router, router,
......
export default { export default {
namespaced: true, namespaced: true,
state: { state: {
importData: { importData: {},
uploadInfo: null
}
}, },
mutations: { mutations: {
SET_IMPORT(state, data) { SET_IMPORT(state, data) {
state.importData = data state.importData = data
}, },
SET_UPLOAD_INFO(state, data) {
state.uploadInfo = data
}
}, },
actions: { actions: {
setImport({ commit }, data) { setImport({ commit }, data) {
commit('SET_IMPORT', data) commit('SET_IMPORT', data)
}, },
setUploadInfo({ commit }, data) {
commit('SET_UPLOAD_INFO', data)
}
} }
} }
import { isFunction } from './fns' import { isFunction } from './fns'
export function matchesSelectorToParentElements (el, selector, baseNode) { export function matchesSelectorToParentElements(el, selector, baseNode) {
let node = el let node = el
const matchesSelectorFunc = [ const matchesSelectorFunc = ['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'].find(func => isFunction(node[func]))
'matches',
'webkitMatchesSelector',
'mozMatchesSelector',
'msMatchesSelector',
'oMatchesSelector'
].find(func => isFunction(node[func]))
if (!isFunction(node[matchesSelectorFunc])) return false if (!isFunction(node[matchesSelectorFunc])) return false
...@@ -22,16 +16,13 @@ export function matchesSelectorToParentElements (el, selector, baseNode) { ...@@ -22,16 +16,13 @@ export function matchesSelectorToParentElements (el, selector, baseNode) {
return false return false
} }
export function getComputedSize ($el) { export function getComputedSize($el) {
const style = window.getComputedStyle($el) const style = window.getComputedStyle($el)
return [ return [parseFloat(style.getPropertyValue('width'), 10), parseFloat(style.getPropertyValue('height'), 10)]
parseFloat(style.getPropertyValue('width'), 10),
parseFloat(style.getPropertyValue('height'), 10)
]
} }
export function addEvent (el, event, handler) { export function addEvent(el, event, handler) {
if (!el) { if (!el) {
return return
} }
...@@ -44,7 +35,7 @@ export function addEvent (el, event, handler) { ...@@ -44,7 +35,7 @@ export function addEvent (el, event, handler) {
} }
} }
export function removeEvent (el, event, handler) { export function removeEvent(el, event, handler) {
if (!el) { if (!el) {
return return
} }
......
...@@ -13,6 +13,6 @@ const emoji = [ ...@@ -13,6 +13,6 @@ const emoji = [
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'], ['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'], ['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'], ['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹'], ['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
] ]
export default emoji export default emoji
//过滤器
/* eslint-disable */
const overThousandFilter = val => {
if (typeof val != 'number') {
return 0
}
if (val < 1000) return val
let a = val + ''
let b = a.split('')
b.splice(-3, 0, ',')
return b.join('')
}
export default {
overThousandFilter
}
export function isFunction (func) { export function isFunction(func) {
return (typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]') return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'
} }
export function snapToGrid (grid, pendingX, pendingY, scale = 1) { export function snapToGrid(grid, pendingX, pendingY, scale = 1) {
const [scaleX, scaleY] = typeof scale === 'number' ? [scale, scale] : scale const [scaleX, scaleY] = typeof scale === 'number' ? [scale, scale] : scale
const x = Math.round((pendingX / scaleX) / grid[0]) * grid[0] const x = Math.round(pendingX / scaleX / grid[0]) * grid[0]
const y = Math.round((pendingY / scaleY) / grid[1]) * grid[1] const y = Math.round(pendingY / scaleY / grid[1]) * grid[1]
return [x, y] return [x, y]
} }
export function getSize (el) { export function getSize(el) {
const rect = el.getBoundingClientRect() const rect = el.getBoundingClientRect()
return [ return [parseInt(rect.width), parseInt(rect.height)]
parseInt(rect.width),
parseInt(rect.height)
]
} }
export function computeWidth (parentWidth, left, right) { export function computeWidth(parentWidth, left, right) {
return parentWidth - left - right return parentWidth - left - right
} }
export function computeHeight (parentHeight, top, bottom) { export function computeHeight(parentHeight, top, bottom) {
return parentHeight - top - bottom return parentHeight - top - bottom
} }
export function restrictToBounds (value, min, max) { export function restrictToBounds(value, min, max) {
if (min !== null && value < min) { if (min !== null && value < min) {
return min return min
} }
......
/*
* JavaScript MD5
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/* global define */
;(function ($) {
'use strict'
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safeAdd (x, y) {
var lsw = (x & 0xffff) + (y & 0xffff)
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
return (msw << 16) | (lsw & 0xffff)
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bitRotateLeft (num, cnt) {
return (num << cnt) | (num >>> (32 - cnt))
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5cmn (q, a, b, x, s, t) {
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b)
}
function md5ff (a, b, c, d, x, s, t) {
return md5cmn((b & c) | (~b & d), a, b, x, s, t)
}
function md5gg (a, b, c, d, x, s, t) {
return md5cmn((b & d) | (c & ~d), a, b, x, s, t)
}
function md5hh (a, b, c, d, x, s, t) {
return md5cmn(b ^ c ^ d, a, b, x, s, t)
}
function md5ii (a, b, c, d, x, s, t) {
return md5cmn(c ^ (b | ~d), a, b, x, s, t)
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binlMD5 (x, len) {
/* append padding */
x[len >> 5] |= 0x80 << (len % 32)
x[((len + 64) >>> 9 << 4) + 14] = len
var i
var olda
var oldb
var oldc
var oldd
var a = 1732584193
var b = -271733879
var c = -1732584194
var d = 271733878
for (i = 0; i < x.length; i += 16) {
olda = a
oldb = b
oldc = c
oldd = d
a = md5ff(a, b, c, d, x[i], 7, -680876936)
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586)
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819)
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330)
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897)
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426)
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341)
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983)
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416)
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417)
c = md5ff(c, d, a, b, x[i + 10], 17, -42063)
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162)
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682)
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101)
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290)
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329)
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510)
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632)
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713)
b = md5gg(b, c, d, a, x[i], 20, -373897302)
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691)
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083)
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335)
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848)
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438)
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690)
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961)
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501)
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467)
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784)
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473)
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734)
a = md5hh(a, b, c, d, x[i + 5], 4, -378558)
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463)
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562)
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556)
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060)
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353)
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632)
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640)
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174)
d = md5hh(d, a, b, c, x[i], 11, -358537222)
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979)
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189)
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487)
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835)
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520)
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651)
a = md5ii(a, b, c, d, x[i], 6, -198630844)
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415)
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905)
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055)
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571)
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606)
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523)
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799)
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359)
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744)
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380)
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649)
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070)
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379)
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259)
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551)
a = safeAdd(a, olda)
b = safeAdd(b, oldb)
c = safeAdd(c, oldc)
d = safeAdd(d, oldd)
}
return [a, b, c, d]
}
/*
* Convert an array of little-endian words to a string
*/
function binl2rstr (input) {
var i
var output = ''
var length32 = input.length * 32
for (i = 0; i < length32; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff)
}
return output
}
/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl (input) {
var i
var output = []
output[(input.length >> 2) - 1] = undefined
for (i = 0; i < output.length; i += 1) {
output[i] = 0
}
var length8 = input.length * 8
for (i = 0; i < length8; i += 8) {
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32)
}
return output
}
/*
* Calculate the MD5 of a raw string
*/
function rstrMD5 (s) {
return binl2rstr(binlMD5(rstr2binl(s), s.length * 8))
}
/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstrHMACMD5 (key, data) {
var i
var bkey = rstr2binl(key)
var ipad = []
var opad = []
var hash
ipad[15] = opad[15] = undefined
if (bkey.length > 16) {
bkey = binlMD5(bkey, key.length * 8)
}
for (i = 0; i < 16; i += 1) {
ipad[i] = bkey[i] ^ 0x36363636
opad[i] = bkey[i] ^ 0x5c5c5c5c
}
hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8)
return binl2rstr(binlMD5(opad.concat(hash), 512 + 128))
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex (input) {
var hexTab = '0123456789abcdef'
var output = ''
var x
var i
for (i = 0; i < input.length; i += 1) {
x = input.charCodeAt(i)
output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f)
}
return output
}
/*
* Encode a string as utf-8
*/
function str2rstrUTF8 (input) {
return unescape(encodeURIComponent(input))
}
/*
* Take string arguments and return either raw or hex encoded strings
*/
function rawMD5 (s) {
return rstrMD5(str2rstrUTF8(s))
}
function hexMD5 (s) {
return rstr2hex(rawMD5(s))
}
function rawHMACMD5 (k, d) {
return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d))
}
function hexHMACMD5 (k, d) {
return rstr2hex(rawHMACMD5(k, d))
}
function md5 (string, key, raw) {
if (!key) {
if (!raw) {
return hexMD5(string)
}
return rawMD5(string)
}
if (!raw) {
return hexHMACMD5(key, string)
}
return rawHMACMD5(key, string)
}
if (typeof define === 'function' && define.amd) {
define(function () {
return md5
})
} else if (typeof module === 'object' && module.exports) {
module.exports = md5
} else {
$.md5 = md5
}
})(this)
import MD5 from 'js-md5'
const sign = (params, noSignAttr = []) => {
delete params.sign
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const keys = Object.keys(params).sort()
var str = []
// for (const key in params) {
// if (typeof params[key] === 'object') params[key] = JSON.stringify(params[key])
// }
var obj = null
for (const key in params) {
obj = params[key]
if (obj === null || obj === undefined) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
params[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + params[e])
})
params.sign = MD5(secret + str.join('') + secret)
return params
}
export default sign
(function(factory){if(typeof exports==="object"){module.exports=factory()}else if(typeof define==="function"&&define.amd){define(factory)}else{var glob;try{glob=window}catch(e){glob=self}glob.SparkMD5=factory()}})(function(undefined){"use strict";var add32=function(a,b){return a+b&4294967295},hex_chr=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function cmn(q,a,b,x,s,t){a=add32(add32(a,q),add32(x,t));return add32(a<<s|a>>>32-s,b)}function md5cycle(x,k){var a=x[0],b=x[1],c=x[2],d=x[3];a+=(b&c|~b&d)+k[0]-680876936|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[1]-389564586|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[2]+606105819|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[3]-1044525330|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[4]-176418897|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[5]+1200080426|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[6]-1473231341|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[7]-45705983|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[8]+1770035416|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[9]-1958414417|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[10]-42063|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[11]-1990404162|0;b=(b<<22|b>>>10)+c|0;a+=(b&c|~b&d)+k[12]+1804603682|0;a=(a<<7|a>>>25)+b|0;d+=(a&b|~a&c)+k[13]-40341101|0;d=(d<<12|d>>>20)+a|0;c+=(d&a|~d&b)+k[14]-1502002290|0;c=(c<<17|c>>>15)+d|0;b+=(c&d|~c&a)+k[15]+1236535329|0;b=(b<<22|b>>>10)+c|0;a+=(b&d|c&~d)+k[1]-165796510|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[6]-1069501632|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[11]+643717713|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[0]-373897302|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[5]-701558691|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[10]+38016083|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[15]-660478335|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[4]-405537848|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[9]+568446438|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[14]-1019803690|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[3]-187363961|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[8]+1163531501|0;b=(b<<20|b>>>12)+c|0;a+=(b&d|c&~d)+k[13]-1444681467|0;a=(a<<5|a>>>27)+b|0;d+=(a&c|b&~c)+k[2]-51403784|0;d=(d<<9|d>>>23)+a|0;c+=(d&b|a&~b)+k[7]+1735328473|0;c=(c<<14|c>>>18)+d|0;b+=(c&a|d&~a)+k[12]-1926607734|0;b=(b<<20|b>>>12)+c|0;a+=(b^c^d)+k[5]-378558|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[8]-2022574463|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[11]+1839030562|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[14]-35309556|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[1]-1530992060|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[4]+1272893353|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[7]-155497632|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[10]-1094730640|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[13]+681279174|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[0]-358537222|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[3]-722521979|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[6]+76029189|0;b=(b<<23|b>>>9)+c|0;a+=(b^c^d)+k[9]-640364487|0;a=(a<<4|a>>>28)+b|0;d+=(a^b^c)+k[12]-421815835|0;d=(d<<11|d>>>21)+a|0;c+=(d^a^b)+k[15]+530742520|0;c=(c<<16|c>>>16)+d|0;b+=(c^d^a)+k[2]-995338651|0;b=(b<<23|b>>>9)+c|0;a+=(c^(b|~d))+k[0]-198630844|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[7]+1126891415|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[14]-1416354905|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[5]-57434055|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[12]+1700485571|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[3]-1894986606|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[10]-1051523|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[1]-2054922799|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[8]+1873313359|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[15]-30611744|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[6]-1560198380|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[13]+1309151649|0;b=(b<<21|b>>>11)+c|0;a+=(c^(b|~d))+k[4]-145523070|0;a=(a<<6|a>>>26)+b|0;d+=(b^(a|~c))+k[11]-1120210379|0;d=(d<<10|d>>>22)+a|0;c+=(a^(d|~b))+k[2]+718787259|0;c=(c<<15|c>>>17)+d|0;b+=(d^(c|~a))+k[9]-343485551|0;b=(b<<21|b>>>11)+c|0;x[0]=a+x[0]|0;x[1]=b+x[1]|0;x[2]=c+x[2]|0;x[3]=d+x[3]|0}function md5blk(s){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=s.charCodeAt(i)+(s.charCodeAt(i+1)<<8)+(s.charCodeAt(i+2)<<16)+(s.charCodeAt(i+3)<<24)}return md5blks}function md5blk_array(a){var md5blks=[],i;for(i=0;i<64;i+=4){md5blks[i>>2]=a[i]+(a[i+1]<<8)+(a[i+2]<<16)+(a[i+3]<<24)}return md5blks}function md51(s){var n=s.length,state=[1732584193,-271733879,-1732584194,271733878],i,length,tail,tmp,lo,hi;for(i=64;i<=n;i+=64){md5cycle(state,md5blk(s.substring(i-64,i)))}s=s.substring(i-64);length=s.length;tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<length;i+=1){tail[i>>2]|=s.charCodeAt(i)<<(i%4<<3)}tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(state,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=n*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(state,tail);return state}function md51_array(a){var n=a.length,state=[1732584193,-271733879,-1732584194,271733878],i,length,tail,tmp,lo,hi;for(i=64;i<=n;i+=64){md5cycle(state,md5blk_array(a.subarray(i-64,i)))}a=i-64<n?a.subarray(i-64):new Uint8Array(0);length=a.length;tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(i=0;i<length;i+=1){tail[i>>2]|=a[i]<<(i%4<<3)}tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(state,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=n*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(state,tail);return state}function rhex(n){var s="",j;for(j=0;j<4;j+=1){s+=hex_chr[n>>j*8+4&15]+hex_chr[n>>j*8&15]}return s}function hex(x){var i;for(i=0;i<x.length;i+=1){x[i]=rhex(x[i])}return x.join("")}if(hex(md51("hello"))!=="5d41402abc4b2a76b9719d911017c592"){add32=function(x,y){var lsw=(x&65535)+(y&65535),msw=(x>>16)+(y>>16)+(lsw>>16);return msw<<16|lsw&65535}}if(typeof ArrayBuffer!=="undefined"&&!ArrayBuffer.prototype.slice){(function(){function clamp(val,length){val=val|0||0;if(val<0){return Math.max(val+length,0)}return Math.min(val,length)}ArrayBuffer.prototype.slice=function(from,to){var length=this.byteLength,begin=clamp(from,length),end=length,num,target,targetArray,sourceArray;if(to!==undefined){end=clamp(to,length)}if(begin>end){return new ArrayBuffer(0)}num=end-begin;target=new ArrayBuffer(num);targetArray=new Uint8Array(target);sourceArray=new Uint8Array(this,begin,num);targetArray.set(sourceArray);return target}})()}function toUtf8(str){if(/[\u0080-\uFFFF]/.test(str)){str=unescape(encodeURIComponent(str))}return str}function utf8Str2ArrayBuffer(str,returnUInt8Array){var length=str.length,buff=new ArrayBuffer(length),arr=new Uint8Array(buff),i;for(i=0;i<length;i+=1){arr[i]=str.charCodeAt(i)}return returnUInt8Array?arr:buff}function arrayBuffer2Utf8Str(buff){return String.fromCharCode.apply(null,new Uint8Array(buff))}function concatenateArrayBuffers(first,second,returnUInt8Array){var result=new Uint8Array(first.byteLength+second.byteLength);result.set(new Uint8Array(first));result.set(new Uint8Array(second),first.byteLength);return returnUInt8Array?result:result.buffer}function hexToBinaryString(hex){var bytes=[],length=hex.length,x;for(x=0;x<length-1;x+=2){bytes.push(parseInt(hex.substr(x,2),16))}return String.fromCharCode.apply(String,bytes)}function SparkMD5(){this.reset()}SparkMD5.prototype.append=function(str){this.appendBinary(toUtf8(str));return this};SparkMD5.prototype.appendBinary=function(contents){this._buff+=contents;this._length+=contents.length;var length=this._buff.length,i;for(i=64;i<=length;i+=64){md5cycle(this._hash,md5blk(this._buff.substring(i-64,i)))}this._buff=this._buff.substring(i-64);return this};SparkMD5.prototype.end=function(raw){var buff=this._buff,length=buff.length,i,tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ret;for(i=0;i<length;i+=1){tail[i>>2]|=buff.charCodeAt(i)<<(i%4<<3)}this._finish(tail,length);ret=hex(this._hash);if(raw){ret=hexToBinaryString(ret)}this.reset();return ret};SparkMD5.prototype.reset=function(){this._buff="";this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};SparkMD5.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}};SparkMD5.prototype.setState=function(state){this._buff=state.buff;this._length=state.length;this._hash=state.hash;return this};SparkMD5.prototype.destroy=function(){delete this._hash;delete this._buff;delete this._length};SparkMD5.prototype._finish=function(tail,length){var i=length,tmp,lo,hi;tail[i>>2]|=128<<(i%4<<3);if(i>55){md5cycle(this._hash,tail);for(i=0;i<16;i+=1){tail[i]=0}}tmp=this._length*8;tmp=tmp.toString(16).match(/(.*?)(.{0,8})$/);lo=parseInt(tmp[2],16);hi=parseInt(tmp[1],16)||0;tail[14]=lo;tail[15]=hi;md5cycle(this._hash,tail)};SparkMD5.hash=function(str,raw){return SparkMD5.hashBinary(toUtf8(str),raw)};SparkMD5.hashBinary=function(content,raw){var hash=md51(content),ret=hex(hash);return raw?hexToBinaryString(ret):ret};SparkMD5.ArrayBuffer=function(){this.reset()};SparkMD5.ArrayBuffer.prototype.append=function(arr){var buff=concatenateArrayBuffers(this._buff.buffer,arr,true),length=buff.length,i;this._length+=arr.byteLength;for(i=64;i<=length;i+=64){md5cycle(this._hash,md5blk_array(buff.subarray(i-64,i)))}this._buff=i-64<length?new Uint8Array(buff.buffer.slice(i-64)):new Uint8Array(0);return this};SparkMD5.ArrayBuffer.prototype.end=function(raw){var buff=this._buff,length=buff.length,tail=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i,ret;for(i=0;i<length;i+=1){tail[i>>2]|=buff[i]<<(i%4<<3)}this._finish(tail,length);ret=hex(this._hash);if(raw){ret=hexToBinaryString(ret)}this.reset();return ret};SparkMD5.ArrayBuffer.prototype.reset=function(){this._buff=new Uint8Array(0);this._length=0;this._hash=[1732584193,-271733879,-1732584194,271733878];return this};SparkMD5.ArrayBuffer.prototype.getState=function(){var state=SparkMD5.prototype.getState.call(this);state.buff=arrayBuffer2Utf8Str(state.buff);return state};SparkMD5.ArrayBuffer.prototype.setState=function(state){state.buff=utf8Str2ArrayBuffer(state.buff,true);return SparkMD5.prototype.setState.call(this,state)};SparkMD5.ArrayBuffer.prototype.destroy=SparkMD5.prototype.destroy;SparkMD5.ArrayBuffer.prototype._finish=SparkMD5.prototype._finish;SparkMD5.ArrayBuffer.hash=function(arr,raw){var hash=md51_array(new Uint8Array(arr)),ret=hex(hash);return raw?hexToBinaryString(ret):ret};return SparkMD5});
import MD5 from 'md5'
var w = {}
let uploadInfo = {}
let that = {}
const options = {
showprocess: true,
action: '',
tips: '',
size: 2,
url: '',
success: ''
}
that.config = {
id: '',
token: '',
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
url: 'http://qcdidicb.glsx.com.cn:7060/router',
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
}
/**
* 参数序列化
*/
uploadInfo.formRequestData = function(data) {
var _sendstr = null
if (data) {
_sendstr = ''
for (var i in data) {
_sendstr += (_sendstr ? '&' : '') + i + '=' + encodeURIComponent(data[i])
}
}
return _sendstr
}
/**
* 检查文件是否上传
*/
/**
* 文件切片
*/
uploadInfo.fileSlice = function(oParams) {
if (!oParams) {
return false
}
var o = options
var file = oParams.file
var cellBlod = []
var cell = Number(o.size) * 1024 * 1024 //单个分片的大小
var size = oParams.size //文件大小
var num = Math.ceil(size / cell) //计算分片的个数
if (num == 1) {
cellBlod.push(file)
} else {
for (var i = 0; i < num; i++) {
var s = i * cell
var e = (i + 1) * cell
var m = ''
if (file.slice) {
m = file.slice(s, e)
}
//兼容firefox
if (file.mozSlice) {
m = file.mozSlice(s, e)
}
// 兼容webkit
if (file.webkitSlice) {
m = file.webkitSlice(s, e)
}
cellBlod.push(m)
}
}
return cellBlod
}
/**
* 获取文件类型
*/
uploadInfo.getFileType = function(file) {
if (!file) {
return false
}
var arr = file.split('.')
return arr[arr.length - 1]
}
/**
* arrbuffer转换成base64
*/
uploadInfo.transformArrayBufferToBase64 = function(buffer) {
var binary = ''
var bytes = new Uint8Array(buffer)
for (var len = bytes.byteLength, i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i])
}
return window.btoa(binary)
}
/**
* 生成签名
*/
uploadInfo.createSign = function(params) {
var secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
var noSignAttr = []
delete params.sign
noSignAttr.push('refreshTable')
var keys = Object.keys(params).sort()
var str = []
var obj = null
for (const key in params) {
obj = params[key]
if (obj === null || obj === undefined) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
params[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + params[e])
})
params.sign = MD5(secret + str.join('') + secret)
return params
}
/**
* 获取参数
*/
uploadInfo.getParams = function(index, oInfo) {
var o = that.options
var k = that.config
var oParams = {}
var len = w.list.length
var size = Number(o.size * 1024 * 1024)
// console.log(o.size)
// console.log(w);
// console.log('个数:' + w.list.length);
// console.log('当前个数' + index)
if (len > 1 && index == len - 1) {
size = w.fileSize - o.size * 1024 * 1024 * (w.list.length - 2)
}
//只有一个分片
if (w.list.length == 1) {
size = w.fileSize
}
var spark = new MD5()
spark.append(oInfo)
oParams.app_key = k.app_key
oParams.v = k.v
oParams.timestamp = new Date().getTime()
oParams.format = k.format
oParams.source = '2323242323'
oParams.method = 'glsx.accounts.biz.common.uploadFileWithFileInfo'
oParams.token = w.token
oParams.number = index + 1
oParams.fileType = w.fileType
oParams.fileName = w.fileName
oParams.fileSize = w.fileSize
oParams.fileFragmentSize = size
oParams.fileUpSum = w.list.length
oParams.fileMD5 = w.fileMD5
oParams.fragmentMD5 = spark.end()
// for (let k in m) {
// oParams.append(k, m[k]);
// }
return uploadInfo.createSign(oParams)
}
export default uploadInfo
import { Message } from 'element-ui' import { Message } from 'element-ui'
let util = {} let util = {}
util.cloneText = function (message) { util.cloneText = function(message) {
let input = document.createElement('input') let input = document.createElement('input')
input.value = message input.value = message
document.body.appendChild(input) document.body.appendChild(input)
...@@ -9,95 +9,107 @@ util.cloneText = function (message) { ...@@ -9,95 +9,107 @@ util.cloneText = function (message) {
document.body.removeChild(input) document.body.removeChild(input)
Message.success('复制成功') Message.success('复制成功')
} }
util.getBeforeDate = function (sign = '-') { util.getBeforeDate = function(sign = '-') {
let day = new Date(); let day = new Date()
let month = day.getMonth() + 1; let month = day.getMonth() + 1
let date = day.getDate(); let date = day.getDate()
if (month < 10) month = '0' + month; if (month < 10) month = '0' + month
if (date < 10) date = '0' + date; if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date; var s = day.getFullYear() + sign + month + sign + date
return s; return s
} }
util.getBeforeMonth = function (days) { util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1; let month = new Date().getMonth() + 1
let year = new Date().getFullYear(); let year = new Date().getFullYear()
let arr = new Array(); let arr = new Array()
for (let i = 0; i < days; i++) { for (let i = 0; i < days; i++) {
if (month <= 0) { if (month <= 0) {
year = year - 1; year = year - 1
month = month + 12; month = month + 12
} }
if (month < 10) month = '0' + month; if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月' arr[i] = year + '年' + month + '月'
month-- month--
} }
return arr; return arr
} }
/** /**
* 格式化时间 * 格式化时间
* @param {Array} time * @param {Array} time
*/ */
util.formatTime = function (time) { util.formatTime = function(time) {
return { return {
startTime: time ? time[0] + ' ' + '00:00:00' : '', startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : '' endTime: time ? time[1] + ' ' + '23:59:59' : ''
} }
} }
util.tringToDate = function (dateStr, separator) { util.tringToDate = function(dateStr, separator) {
if (!separator) { if (!separator) {
separator = "-"; separator = '-'
} }
var dateArr = dateStr.split(separator); var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0]); var year = parseInt(dateArr[0])
var month; var month
//处理月份为04这样的情况 //处理月份为04这样的情况
if (dateArr[1].indexOf("0") == 0) { if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1)); month = parseInt(dateArr[1].substring(1))
} else { } else {
month = parseInt(dateArr[1]); month = parseInt(dateArr[1])
} }
var day = parseInt(dateArr[2]); var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day); var date = new Date(year, month - 1, day)
return date; return date
} }
util.getDay = function (num, str = '-') { util.getDay = function(num, str = '-') {
var today = new Date(); var today = new Date()
var nowTime = today.getTime(); var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num; var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms)); today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear(); var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString(); var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth; if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString(); var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay; if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay; return oYear + str + oMoth + str + oDay
} }
util.openUrl = function (url) { util.openUrl = function(url) {
const link = document.createElement('a') const link = document.createElement('a')
link.href = url link.href = url
link.target = '_blank' link.target = '_blank'
link.rel = 'opener' link.rel = 'opener'
link.click() link.click()
} }
util.downloadIamge = function (imgsrc, name = new Date().getTime()) { util.downloadUrl = function(url) {
const link = document.createElement('a')
link.href = url
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
util.getArrayIsSubset = (arr2, arr1) => {
return arr1.every(item => {
return arr2.includes(item)
})
}
util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名 //下载图片地址和图片名
var image = new Image(); var image = new Image()
// 解决跨域 Canvas 污染问题 // 解决跨域 Canvas 污染问题
image.setAttribute("crossOrigin", "anonymous"); image.setAttribute('crossOrigin', 'anonymous')
image.onload = function () { image.onload = function() {
var canvas = document.createElement("canvas"); var canvas = document.createElement('canvas')
canvas.width = image.width; canvas.width = image.width
canvas.height = image.height; canvas.height = image.height
var context = canvas.getContext("2d"); var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height); context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL("image/png"); //得到图片的base64编码数据 var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement("a"); // 生成一个a元素 var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent("click"); // 创建一个单击事件 var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || "photo"; // 设置图片名称 a.download = name || 'photo' // 设置图片名称
a.href = url; // 将生成的URL设置为a.href属性 a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event); // 触发a的单击事件 a.dispatchEvent(event) // 触发a的单击事件
}; }
image.src = imgsrc; image.src = imgsrc
} }
export default util export default util
...@@ -79,15 +79,16 @@ ...@@ -79,15 +79,16 @@
<el-switch v-model="autoWelcome" active-color="#5850FF" inactive-color="#999999"></el-switch> <el-switch v-model="autoWelcome" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div> </div>
<div class="welcome-box" v-show="autoWelcome"> <div class="welcome-box" v-show="autoWelcome">
<welcome-words :eventBus="eventBus" ref="welcome"></welcome-words> <!-- <welcome-words :eventBus="eventBus" ref="welcome"></welcome-words> -->
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
</div> </div>
</div> </div>
</div> </div>
<GLFooter <GLFooter>
>
<el-button type="primary" @click="handleSave">提交</el-button> <el-button type="primary" @click="handleSave">提交</el-button>
<el-button @click="goback">取消</el-button> <el-button @click="goback">取消</el-button>
</GLFooter> </GLFooter>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisible = false" type="warning" content="当前有内容信息未保存,是否继续返回?" :visible.sync="dialogVisible" mode="small"></GLDialog>
<select-emp @selectTable="selectTable" ref="selectEmpForm"></select-emp> <select-emp @selectTable="selectTable" ref="selectEmpForm"></select-emp>
<select-tag ref="selectTagForm" @tagSelected="tagSelected"></select-tag> <select-tag ref="selectTagForm" @tagSelected="tagSelected"></select-tag>
</div> </div>
...@@ -95,16 +96,16 @@ ...@@ -95,16 +96,16 @@
<script> <script>
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import Vue from 'vue'
import selectEmp from '@/components/selectEmp' import selectEmp from '@/components/selectEmp'
import selectTag from '@/components/selectTag' import selectTag from '@/components/selectTag'
import welcomeWords from '@/components/welcome/welcomeWords.vue' import word from '@/mixins/word'
export default { export default {
mixins: [word],
name: 'addCode', name: 'addCode',
components: { welcomeWords, selectEmp, selectTag }, components: { selectEmp, selectTag },
data() { data() {
return { return {
eventBus: new Vue(), dialogVisible: false,
addCodeForm: { addCodeForm: {
codeName: '', codeName: '',
codeRemark: '', codeRemark: '',
...@@ -164,17 +165,14 @@ export default { ...@@ -164,17 +165,14 @@ export default {
}) })
}) })
if (this.editStatus || (this.$refs.welcome.previewList.length > 0 && !this.codeId)) { if (this.editStatus || (this.$refs.welcome.previewList.length > 0 && !this.codeId)) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', { this.dialogVisible = true
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push('/channel/index')
})
} else { } else {
this.$router.push('/channel/index') this.$router.push('/channel/index')
} }
}, },
handleSure() {
this.$router.push('/channel/index')
},
removeTag(item, idx, index) { removeTag(item, idx, index) {
item.labelList.splice(idx, 1) item.labelList.splice(idx, 1)
if (item.labelList.length == 0) { if (item.labelList.length == 0) {
...@@ -202,7 +200,7 @@ export default { ...@@ -202,7 +200,7 @@ export default {
tagSelected(item) { tagSelected(item) {
this.tagging = item this.tagging = item
}, },
handleSave: utils.debounce(function () { handleSave: utils.debounce(function() {
if (this.staffInfo.length == 0) { if (this.staffInfo.length == 0) {
this.staffStatus = true this.staffStatus = true
return return
...@@ -245,6 +243,8 @@ export default { ...@@ -245,6 +243,8 @@ export default {
if (item.attType == 1) { if (item.attType == 1) {
item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称') item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称')
item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]') item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
} }
return item return item
}) })
...@@ -294,7 +294,7 @@ export default { ...@@ -294,7 +294,7 @@ export default {
this.previewListStart = this.$common.utils.deepClone(this.$refs.welcome.previewList) this.previewListStart = this.$common.utils.deepClone(this.$refs.welcome.previewList)
}) })
}) })
}, }
// resize() { // resize() {
// this.footerLeft = document.querySelector('.base-container-right').offsetLeft // this.footerLeft = document.querySelector('.base-container-right').offsetLeft
// this.footerWidth = document.documentElement.clientWidth - this.footerLeft // this.footerWidth = document.documentElement.clientWidth - this.footerLeft
...@@ -315,7 +315,7 @@ export default { ...@@ -315,7 +315,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main-welcome { .channel-main-welcome {
margin: 20px 0px 60px; margin: 20px 0px 16px;
.welcome-panel { .welcome-panel {
margin: 10px; margin: 10px;
padding: 0px 20px 20px; padding: 0px 20px 20px;
......
...@@ -4,20 +4,7 @@ ...@@ -4,20 +4,7 @@
<GLButton type="primary" size="small" icon="el-icon-add" @click="handleAddCode" fn="新增活码">新建渠道活码</GLButton> <GLButton type="primary" size="small" icon="el-icon-add" @click="handleAddCode" fn="新增活码">新建渠道活码</GLButton>
</div> </div>
<div class="form-panel scrm-box-f"> <div class="form-panel scrm-box-f">
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item"> <GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<el-row>
<el-form-item size="small" label="渠道名称或备注">
<el-input size="small" v-model="tableSearchForm.codeNameAndRemark" placeholder="请输入渠道名称或备注"></el-input>
</el-form-item>
<el-form-item size="small" label="关联专员" style="margin-left: 20px">
<el-input size="small" v-model="tableSearchForm.staffName" placeholder="请输入关联专员"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable v-loading="loading" ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams"> <GLTable v-loading="loading" ref="table" @refreshTable="handleSearch" :searchForm="tableSearchForm" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="到店咨询客户数据">数据</GLButton> <GLButton type="text" @click="handleDetail(scope.scope)" fn="到店咨询客户数据">数据</GLButton>
...@@ -34,22 +21,22 @@ ...@@ -34,22 +21,22 @@
<div v-else>0</div> <div v-else>0</div>
</div> </div>
<div slot="staffInfo" slot-scope="scope"> <div slot="staffInfo" slot-scope="scope">
<el-popover trigger="hover" placement="top" v-if="scope.scope.staffName.split(',').length > 3"> <el-popover trigger="hover" placement="top" v-if="staffNameSplit(scope.scope.staffName).length > 3">
<div class="accountType-row" v-for="(item, index) in scope.scope.staffName.split(',')" :key="index"> <div class="accountType-row" v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
<GLTitle :content="item" textLength="4"></GLTitle> <GLTitle :content="item" textLength="4"></GLTitle>
</div> </div>
<div slot="reference" class="name-wrapper"> <div slot="reference" class="name-wrapper">
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-show="index < 4"> <div v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index" v-show="index < 4">
<div class="accountType-row"> <div class="accountType-row">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
<span v-if="index == 3 && scope.scope.staffName.split(',').length > 3">{{ '...(' + scope.scope.staffName.split(',').length + ')' }}</span> <span v-if="index == 3 && staffNameSplit(scope.scope.staffName).length > 3">{{ '...(' + staffNameSplit(scope.scope.staffName).length + ')' }}</span>
<GLTitle :content="item" textLength="4" v-else></GLTitle> <GLTitle :content="item" textLength="4" v-else></GLTitle>
</div> </div>
</div> </div>
</div> </div>
</el-popover> </el-popover>
<div v-for="(item, index) in scope.scope.staffName.split(',')" :key="index" v-else> <div v-for="(item, index) in staffNameSplit(scope.scope.staffName)" :key="index" v-else>
<div class="accountType-row"> <div class="accountType-row">
<i class="el-icon-user-solid"></i> <i class="el-icon-user-solid"></i>
<GLTitle :content="item" textLength="4"></GLTitle> <GLTitle :content="item" textLength="4"></GLTitle>
...@@ -90,6 +77,7 @@ ...@@ -90,6 +77,7 @@
</div> </div>
</GLTable> </GLTable>
</div> </div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisibleDel = false" type="error" content="是否删除?" :visible.sync="dialogVisibleDel" mode="small"></GLDialog>
<emp-detail ref="empDetailForm"></emp-detail> <emp-detail ref="empDetailForm"></emp-detail>
</div> </div>
</template> </template>
...@@ -102,8 +90,27 @@ export default { ...@@ -102,8 +90,27 @@ export default {
name: 'channelList', name: 'channelList',
data() { data() {
return { return {
dialogVisibleDel: false,
selectItem: '',
loading: false, loading: false,
tableSearchForm: {}, tableSearchForm: {
staffName: '',
codeNameAndRemark: ''
},
searchFormData: [
{
label: '渠道名称或备注',
name: 'codeNameAndRemark',
type: 'input',
placeholder: '请输入渠道名称或备注'
},
{
label: '关联专员',
name: 'staffName',
type: 'input',
placeholder: '请输入关联专员'
}
],
tableData: [], tableData: [],
tableParams: { tableParams: {
listName: 'data', listName: 'data',
...@@ -117,13 +124,13 @@ export default { ...@@ -117,13 +124,13 @@ export default {
{ {
label: '今日新增客户数', label: '今日新增客户数',
prop: 'yesterdayNum', prop: 'yesterdayNum',
width: '120px', width: '130px',
addHtml: 'yesterdayNum' addHtml: 'yesterdayNum'
}, },
{ {
label: '总新增客户数', label: '总新增客户数',
prop: 'totalNum', prop: 'totalNum',
width: '150px', width: '120px',
addHtml: 'totalNum' addHtml: 'totalNum'
}, },
{ {
...@@ -147,12 +154,12 @@ export default { ...@@ -147,12 +154,12 @@ export default {
{ {
label: '创建时间', label: '创建时间',
prop: 'createdTime', prop: 'createdTime',
width: '160px' width: '180px'
}, },
{ {
label: '操作', label: '操作',
prop: 'optionBtns', prop: 'optionBtns',
width: '140px', width: '220px',
addHtml: 'optionBtns', addHtml: 'optionBtns',
fixed: 'right' fixed: 'right'
} }
...@@ -164,6 +171,9 @@ export default { ...@@ -164,6 +171,9 @@ export default {
} }
}, },
methods: { methods: {
staffNameSplit(name) {
return name ? name.split(',') : ''
},
handleDetail(scope) { handleDetail(scope) {
this.$router.push('/channel/store/' + scope.id + '/' + scope.codeUuid + '/' + scope.codeState) this.$router.push('/channel/store/' + scope.id + '/' + scope.codeUuid + '/' + scope.codeState)
}, },
...@@ -208,18 +218,13 @@ export default { ...@@ -208,18 +218,13 @@ export default {
}) })
.catch(() => {}) .catch(() => {})
}, },
handleDelete(scope) { handleSure() {
this.$confirm('是否删除?', '提示', { const { id, codeUuid, configId } = this.selectItem
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$apis.channel this.$apis.channel
.deleteChannelCode({ .deleteChannelCode({
id: scope.id, id,
codeUuid: scope.codeUuid, codeUuid,
configId: scope.configId configId
}) })
.then(res => { .then(res => {
if (res) { if (res) {
...@@ -230,8 +235,11 @@ export default { ...@@ -230,8 +235,11 @@ export default {
} }
this.handleSearch() this.handleSearch()
}) })
}) this.dialogVisibleDel = false
.catch(() => {}) },
handleDelete(scope) {
this.dialogVisibleDel = true
this.selectItem = scope
}, },
listChannelCodeByPage() { listChannelCodeByPage() {
const params = { const params = {
......
...@@ -156,7 +156,7 @@ export default { ...@@ -156,7 +156,7 @@ export default {
this.codeSearch() this.codeSearch()
}, },
handleTab() { handleTab() {
this.createTime = []; this.createTime = []
this.trendType = this.timeRadio this.trendType = this.timeRadio
this.createTime = '' this.createTime = ''
this.endTime = '' this.endTime = ''
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<el-button type="primary" @click="handleSearch">查询</el-button> <el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- <GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> -->
<GLTable v-loading="loading" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"> <GLTable v-loading="loading" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable">
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button> <el-button type="text" @click="handleDetail(scope.scope)">详情</el-button>
...@@ -32,9 +33,9 @@ ...@@ -32,9 +33,9 @@
</template> </template>
<template slot="customerName" slot-scope="scope"> <template slot="customerName" slot-scope="scope">
<div class="form-row"> <div class="form-row">
<img :src="scope.scope.avatar" v-if="scope.scope.avatar"> <img :src="scope.scope.avatar" v-if="scope.scope.avatar" />
{{ scope.scope.customerName }} {{ scope.scope.customerName }}
<span style="color: #5850ff">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span> <span style="color: #5850ff">{{ scope.scope.type == 1 ? '@微信' : '@企微' }}</span>
</div> </div>
</template> </template>
</GLTable> </GLTable>
...@@ -71,6 +72,70 @@ export default { ...@@ -71,6 +72,70 @@ export default {
} }
], ],
tableSearchForm: {}, tableSearchForm: {},
searchFormData: [
{
label: '客户名称',
name: 'codeNameAndRemark',
type: 'input',
placeholder: '请输入客户名称'
},
{
label: '状态',
name: 'imStatus',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '正常'
},
{
value: '-1',
label: '删除好友'
}
]
},
{
label: '跟进员工',
name: 'imStatus',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '正常'
},
{
value: '-1',
label: '删除好友'
}
]
},
{
label: '添加时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: { tableParams: {
listName: 'data', listName: 'data',
...@@ -89,22 +154,22 @@ export default { ...@@ -89,22 +154,22 @@ export default {
console.log(cellValue) console.log(cellValue)
return cellValue.customerSex == 1 ? '男' : '女' return cellValue.customerSex == 1 ? '男' : '女'
}, },
width: '80px', width: '80px'
}, },
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
addHtml: 'status', addHtml: 'status',
width: '80px', width: '80px'
}, },
{ {
label: '跟进员工', label: '跟进员工',
prop: 'followStaff', prop: 'followStaff',
width: '80px', width: '80px'
}, },
{ {
label: '添加时间', label: '添加时间',
prop: 'addTime', prop: 'addTime'
}, },
{ {
label: '操作', label: '操作',
...@@ -168,7 +233,7 @@ export default { ...@@ -168,7 +233,7 @@ export default {
this.createTime = [] this.createTime = []
this.pStatus = null this.pStatus = null
this.staffIds = null this.staffIds = null
this.timeStatus = true; this.timeStatus = true
if (value == 'day' && !day) { if (value == 'day' && !day) {
this.createTime = [util.getDay(0), util.getDay(0)] this.createTime = [util.getDay(0), util.getDay(0)]
this.timeStatus = false this.timeStatus = false
...@@ -221,7 +286,7 @@ export default { ...@@ -221,7 +286,7 @@ export default {
handleDetail(scope) { handleDetail(scope) {
this.$history.push('/custom/clientManage/clientDetail?id=' + scope.oneId) this.$history.push('/custom/clientManage/clientDetail?id=' + scope.oneId)
}, },
handleCancel: utils.debounce(function () { handleCancel: utils.debounce(function() {
this.dialogVisible = false this.dialogVisible = false
}, 300) }, 300)
} }
...@@ -238,7 +303,8 @@ export default { ...@@ -238,7 +303,8 @@ export default {
} }
.emp-form { .emp-form {
/deep/ { /deep/ {
.el-date-editor,.el-input { .el-date-editor,
.el-input {
width: 215px; width: 215px;
} }
} }
......
<template> <template>
<div class="square-main"> <div class="square-main">
<el-dialog title="选择渠道" :visible.sync="dialogVisible" width="70%" :before-close="handleCancel"> <GLDialog title="选择渠道" :visible.sync="dialogVisible" @onOk="handleSelect" @onCancel="handleCancel" mode="big">
<div class="square-tabel"> <div class="square-tabel">
<div class="square-tabel-select"> <div class="square-tabel-select">
<GLTable ref="table" :hasPage="false" :tableData="tableData" :tableTotal="tableTotal" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"></GLTable> <GLTable ref="table" :hasPage="false" :tableData="tableData" :tableTotal="tableTotal" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"></GLTable>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<div class="selected-panel"> <div class="selected-panel">
<div class="selected-item" v-for="(item, index) in selectedList" :key="index"> <div class="selected-item" v-for="(item, index) in selectedList" :key="index">
<div :title="item.codeName"> <div :title="item.codeName">
<span :style="{ background: colorList[index]}"></span> <span :style="{ background: colorList[index] }"></span>
{{ item.codeName }} {{ item.codeName }}
</div> </div>
<img src="@/assets/img/channel/del.png" @click="delTag(item)" /> <img src="@/assets/img/channel/del.png" @click="delTag(item)" />
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<el-button size="small" @click="handleCancel">取 消</el-button> <el-button size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span> </span>
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -104,7 +104,7 @@ export default { ...@@ -104,7 +104,7 @@ export default {
this.dialogVisible = false this.dialogVisible = false
this.$refs.table.$refs.salelistMutiTable.clearSelection() this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, },
handleSelect: utils.debounce(function () { handleSelect: utils.debounce(function() {
if (this.selectedList.length == 0) { if (this.selectedList.length == 0) {
this.$message.error('请选择渠道') this.$message.error('请选择渠道')
return return
......
<template> <template>
<div class="channel-main"> <div class="channel-main">
{{aaa}}
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="渠道码列表" name="first"></el-tab-pane> <el-tab-pane label="渠道码列表" name="first"></el-tab-pane>
<el-tab-pane label="数据统计" name="second"></el-tab-pane> <el-tab-pane label="数据统计" name="second"></el-tab-pane>
...@@ -26,7 +25,7 @@ export default { ...@@ -26,7 +25,7 @@ export default {
}, },
methods: { methods: {
jumpWx() { jumpWx() {
this.$history.push('/home/enterpriseWechat/index') this.$history.push('/settings/enterpriseWechat/index')
}, },
wxTips() { wxTips() {
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST']) const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
......
<template> <template>
<div class="channel-main scrm-box-f" v-loading="loading"> <div class="channel-main scrm-box-f" v-loading="loading">
<div class="channel-header">
<el-button type="primary" size="small" @click="goBack">返回</el-button>
</div>
<div class="poster-body"> <div class="poster-body">
<div class="poster-item" @click="setPoster(item)" @mouseenter="item.show = true" @mouseleave="item.show = false" v-for="(item, index) in posterList" :key="index"> <div class="poster-item" @click="setPoster(item)" @mouseenter="item.show = true" @mouseleave="item.show = false" v-for="(item, index) in posterList" :key="index">
<div class="poster-del" v-show="item.show" @click.stop="handleDelete(item.id)"> <div class="poster-del" v-show="item.show" @click.stop="handleDelete(item.id)">
...@@ -10,7 +7,7 @@ ...@@ -10,7 +7,7 @@
</div> </div>
<div class="poster-item-box" v-loading="item.loadingImg"> <div class="poster-item-box" v-loading="item.loadingImg">
<img <img
:src="item.thumbnailUrl?item.thumbnailUrl:item.autoUrl" :src="item.thumbnailUrl ? item.thumbnailUrl : item.autoUrl"
class="poster-image" class="poster-image"
v-if="item.imgWidth" v-if="item.imgWidth"
:style="{ :style="{
...@@ -36,7 +33,7 @@ ...@@ -36,7 +33,7 @@
</div> </div>
</div> </div>
</div> </div>
<el-dialog v-loading="loadingDrag" title="创建活码海报" :visible.sync="dialogVisible" width="50%" :before-close="handleClose"> <GLDialog @onOk="savePoster" @onCancel="dialogVisible = false" v-loading="loadingDrag" title="创建活码海报" :visible.sync="dialogVisible">
<div class="poster-draggable-title">拖动活码可调整活码位置</div> <div class="poster-draggable-title">拖动活码可调整活码位置</div>
<div class="poster-draggable"> <div class="poster-draggable">
<div <div
...@@ -66,11 +63,11 @@ ...@@ -66,11 +63,11 @@
></vue-draggable-resizable> ></vue-draggable-resizable>
</div> </div>
</div> </div>
<span slot="footer" class="dialog-footer"> <!-- <span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="savePoster">确 定</el-button> <el-button size="small" type="primary" @click="savePoster">确 定</el-button>
</span> </span> -->
</el-dialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -179,7 +176,7 @@ export default { ...@@ -179,7 +176,7 @@ export default {
} else { } else {
self.loading = false self.loading = false
} }
self.$refs.file.value = ''; self.$refs.file.value = ''
}) })
} }
} }
...@@ -232,13 +229,13 @@ export default { ...@@ -232,13 +229,13 @@ export default {
listChannelCodeBill.forEach(item => { listChannelCodeBill.forEach(item => {
item.show = false item.show = false
item.loadingImg = true item.loadingImg = true
let backUrl = item.thumbnailUrl?item.thumbnailUrl: item.autoUrl let backUrl = item.thumbnailUrl ? item.thumbnailUrl : item.autoUrl
this.backUrl = backUrl this.backUrl = backUrl
let img = new Image() let img = new Image()
img.src = backUrl img.src = backUrl
this.loadingImg = true this.loadingImg = true
this.loadingDrag = false this.loadingDrag = false
img.onload = function () { img.onload = function() {
if (img.width > img.height) { if (img.width > img.height) {
item.imgWidth = 280 item.imgWidth = 280
item.imgHeight = (img.height * 280) / img.width item.imgHeight = (img.height * 280) / img.width
...@@ -256,7 +253,7 @@ export default { ...@@ -256,7 +253,7 @@ export default {
let img = new Image() let img = new Image()
img.src = img_url img.src = img_url
let self = this let self = this
img.onload = function () { img.onload = function() {
self.dragHeight = (img.height * 375) / img.width self.dragHeight = (img.height * 375) / img.width
self.dialogVisible = true self.dialogVisible = true
self.loading = false self.loading = false
......
<template> <template>
<div class="channel-main scrm-box-f"> <div class="channel-main scrm-box-f">
<div><el-button type="primary" size="small" @click="goback">返回</el-button></div>
<div class="detail-form"> <div class="detail-form">
<el-form :model="detailCodeForm" label-width="120px"> <el-form :model="detailCodeForm" label-width="120px">
<el-row> <el-row>
...@@ -34,7 +33,7 @@ ...@@ -34,7 +33,7 @@
<div class="count-panel"> <div class="count-panel">
<div class="count-panel-item"> <div class="count-panel-item">
<div class="count-item-title">今日新增客户</div> <div class="count-item-title">今日新增客户</div>
<div class="count-item-num" @click="handleEmpDetail(detailCodeForm,'day')" v-if="detailCodeForm.yesTodayAddCount">{{ detailCodeForm.yesTodayAddCount }}人</div> <div class="count-item-num" @click="handleEmpDetail(detailCodeForm, 'day')" v-if="detailCodeForm.yesTodayAddCount">{{ detailCodeForm.yesTodayAddCount }}人</div>
<div class="count-item-num2" v-else>0人</div> <div class="count-item-num2" v-else>0人</div>
<img src="@/assets/img/channel/count3.png" class="count-item-icon" /> <img src="@/assets/img/channel/count3.png" class="count-item-icon" />
</div> </div>
...@@ -51,7 +50,7 @@ ...@@ -51,7 +50,7 @@
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" /> <img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover> </el-popover>
</div> </div>
<div class="count-item-num" @click="handleEmpDetail(detailCodeForm,'status')" v-if="detailCodeForm.newlyKeepCount">{{ detailCodeForm.newlyKeepCount }}人</div> <div class="count-item-num" @click="handleEmpDetail(detailCodeForm, 'status')" v-if="detailCodeForm.newlyKeepCount">{{ detailCodeForm.newlyKeepCount }}人</div>
<div class="count-item-num2" v-else>0人</div> <div class="count-item-num2" v-else>0人</div>
<img src="@/assets/img/channel/count1.png" class="count-item-icon" /> <img src="@/assets/img/channel/count1.png" class="count-item-icon" />
</div> </div>
...@@ -73,11 +72,11 @@ ...@@ -73,11 +72,11 @@
</GLTable> </GLTable>
<GLTable v-show="activeName == 2" @refreshTable="listStaff" :layout="layout" :tableTotal="tableTotal" ref="memberTabel" :tableData="getMemberApi" :tableParams="tableMemberParams" :pageConf="pageMemberConf" :hasNum="false"> <GLTable v-show="activeName == 2" @refreshTable="listStaff" :layout="layout" :tableTotal="tableTotal" ref="memberTabel" :tableData="getMemberApi" :tableParams="tableMemberParams" :pageConf="pageMemberConf" :hasNum="false">
<div slot="newlyCount" slot-scope="scope"> <div slot="newlyCount" slot-scope="scope">
<div class="link-dialog" @click="handleEmpDetail(scope.scope,'staffIds')" v-if="scope.scope.newlyCount">{{ scope.scope.newlyCount }}</div> <div class="link-dialog" @click="handleEmpDetail(scope.scope, 'staffIds')" v-if="scope.scope.newlyCount">{{ scope.scope.newlyCount }}</div>
<div v-else>0</div> <div v-else>0</div>
</div> </div>
<div slot="newlyKeepCount" slot-scope="scope"> <div slot="newlyKeepCount" slot-scope="scope">
<div class="link-dialog" @click="handleEmpDetail(scope.scope,'statusAndStaffIds')" v-if="scope.scope.newlyKeepCount">{{ scope.scope.newlyKeepCount }}</div> <div class="link-dialog" @click="handleEmpDetail(scope.scope, 'statusAndStaffIds')" v-if="scope.scope.newlyKeepCount">{{ scope.scope.newlyKeepCount }}</div>
<div v-else>0</div> <div v-else>0</div>
</div> </div>
</GLTable> </GLTable>
...@@ -155,8 +154,8 @@ export default { ...@@ -155,8 +154,8 @@ export default {
goback() { goback() {
this.$router.push('/channel/index') this.$router.push('/channel/index')
}, },
handleEmpDetail(scope,status,day) { handleEmpDetail(scope, status, day) {
this.$refs.empDetailForm.init(scope,status,day) this.$refs.empDetailForm.init(scope, status, day)
}, },
detailChannelCode(id, codeUuid) { detailChannelCode(id, codeUuid) {
let param = { let param = {
......
...@@ -164,18 +164,11 @@ ...@@ -164,18 +164,11 @@
</div> </div>
</div> </div>
</div> </div>
<div <GLFooter v-if="(editStatus && !configType) || configType">
v-if="(editStatus && !configType) || configType"
class="footer-panel"
:style="{
left: footerLeft + 'px',
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleSave" v-if="!configType">确定</el-button> <el-button type="primary" @click="handleSave" v-if="!configType">确定</el-button>
<el-button type="primary" @click="goback" v-if="configType">返回</el-button> <el-button type="primary" @click="goback" v-if="configType">返回</el-button>
<el-button @click="handleCancel" v-if="!configType">取消</el-button> <el-button @click="handleCancel" v-if="!configType">取消</el-button>
</div> </GLFooter>
<select-emp @selectTable="selectTable" ref="selectEmpForm"></select-emp> <select-emp @selectTable="selectTable" ref="selectEmpForm"></select-emp>
</div> </div>
</template> </template>
...@@ -351,7 +344,10 @@ export default { ...@@ -351,7 +344,10 @@ export default {
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
} }
.drainage-wrap { .drainage-wrap {
margin-bottom: 20px; margin-bottom: 16px;
&:nth-child(2) {
min-height: calc(100vh - 490px);
}
.drainage-title { .drainage-title {
padding-left: 20px; padding-left: 20px;
font-size: 16px; font-size: 16px;
......
...@@ -96,6 +96,10 @@ ...@@ -96,6 +96,10 @@
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" /> <img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent }}</span> <span>{{ item.attContent }}</span>
</div> </div>
<div v-else-if="item.attType == 6">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ JSON.parse(item.attContent).fileName }}</span>
</div>
<div v-else-if="item.attType == 7"> <div v-else-if="item.attType == 7">
<img src="@/assets/img/guestCustom/icon-applet.png" alt="" /> <img src="@/assets/img/guestCustom/icon-applet.png" alt="" />
<span>{{ item.attContent.marketingName }}</span> <span>{{ item.attContent.marketingName }}</span>
...@@ -149,7 +153,7 @@ export default { ...@@ -149,7 +153,7 @@ export default {
}, },
watch: { watch: {
'addForm.content': { 'addForm.content': {
handler: function () { handler: function() {
this.content = [] this.content = []
let str = this.addForm.content let str = this.addForm.content
let num = 70 let num = 70
...@@ -185,7 +189,7 @@ export default { ...@@ -185,7 +189,7 @@ export default {
deep: true deep: true
}, },
tagging: { tagging: {
handler: function () { handler: function() {
this.taggingLength = 0 this.taggingLength = 0
this.tagging.forEach(item => { this.tagging.forEach(item => {
this.taggingLength += item.labelList.length this.taggingLength += item.labelList.length
...@@ -217,9 +221,10 @@ export default { ...@@ -217,9 +221,10 @@ export default {
this.autoWelcome = res.autoWelcome ? true : false this.autoWelcome = res.autoWelcome ? true : false
const previewList = res.dracScrmWelcomeConfigDTOS.map(item => { const previewList = res.dracScrmWelcomeConfigDTOS.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent) if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
if (item.attType == 1) item.attContent = item.attContent.replaceAll('[@昵称]', '<span style="color:#5850FF">@昵称</span>') if (item.attType == 1) item.attContent = item.attContent.replaceAll('[@昵称]', '<span style="color:#5850FF">@昵称</span>').replaceAll(/\n/g, '<br>')
return item return item
}) })
console.log(previewList)
this.welcomeInfo = previewList this.welcomeInfo = previewList
const tagging = eval(res.tagging) const tagging = eval(res.tagging)
const taggingList = tagging.map(item => { const taggingList = tagging.map(item => {
...@@ -254,7 +259,7 @@ export default { ...@@ -254,7 +259,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main-welcome { .channel-main-welcome {
margin: 20px 0px 60px; margin: 20px 0px 16px;
.chanel-form-title { .chanel-form-title {
padding-left: 20px; padding-left: 20px;
font-size: 16px; font-size: 16px;
......
...@@ -25,6 +25,13 @@ ...@@ -25,6 +25,13 @@
<el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button> <el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button>
</div> </div>
</GLTable> </GLTable>
<GLDialog title="提示" :hasFooter="true" :content="messageContent" :visible.sync="dialogVisible" mode="small">
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="dialogVisible = false">
确定
</el-button>
</span>
</GLDialog>
</div> </div>
</div> </div>
</template> </template>
...@@ -36,7 +43,9 @@ export default { ...@@ -36,7 +43,9 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
messageContent: '',
tableSearchForm: {}, tableSearchForm: {},
dialogVisible: false,
tableData: [], tableData: [],
optionstatus: [ optionstatus: [
{ {
...@@ -88,7 +97,8 @@ export default { ...@@ -88,7 +97,8 @@ export default {
}, },
methods: { methods: {
handleDetail(scope) { handleDetail(scope) {
this.$alert(scope.content, { center: true }) this.dialogVisible = true
this.messageContent = scope.content
}, },
handleSearch() { handleSearch() {
this.listChannelCodeByPage() this.listChannelCodeByPage()
......
...@@ -4,36 +4,35 @@ ...@@ -4,36 +4,35 @@
<el-tab-pane label="营销配置" name="first"></el-tab-pane> <el-tab-pane label="营销配置" name="first"></el-tab-pane>
<el-tab-pane label="客户列表" name="second"></el-tab-pane> <el-tab-pane label="客户列表" name="second"></el-tab-pane>
</el-tabs> </el-tabs>
<component :is="activeName == 'first'?configInfo:customList"></component> <component :is="activeName == 'first' ? configInfo : customList"></component>
<GLFooter <!-- <GLFooter>
>
<el-button type="primary" @click="goback">返回</el-button> <el-button type="primary" @click="goback">返回</el-button>
</GLFooter> </GLFooter> -->
</div> </div>
</template> </template>
<script> <script>
import configInfo from "./components/configInfo"; import configInfo from './components/configInfo'
import customList from "./components/customList"; import customList from './components/customList'
export default { export default {
name: "config", name: 'config',
components: { components: {
configInfo, configInfo,
customList, customList
}, },
data() { data() {
return { return {
activeName: "first", activeName: 'first',
customList: 'customList', customList: 'customList',
configInfo: 'configInfo' configInfo: 'configInfo'
}; }
}, },
methods: { methods: {
goback() { goback() {
this.$router.push('/market/index') this.$router.push('/market/index')
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main { .channel-main {
......
...@@ -14,26 +14,10 @@ ...@@ -14,26 +14,10 @@
</div> </div>
<div class="square-tabel scrm-box-f"> <div class="square-tabel scrm-box-f">
<div class="square-tabel-form"> <div class="square-tabel-form">
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item"> <GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<el-form-item size="small" label="添加时间">
<el-date-picker :picker-options="pickerOptions" v-model="createTime" type="daterange" value-format="yyyy/MM/dd" start-placeholder="开始时间" end-placeholder="结束时间"></el-date-picker>
</el-form-item>
<el-form-item size="small" label="状态">
<el-select v-model="tableSearchForm.imStatus" placeholder="请选择">
<el-option v-for="item in optionstatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="营销名称">
<el-input v-model="tableSearchForm.imName" placeholder="请输入营销名称"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="查看配置">查看配置</GLButton> <GLButton type="text" @click="handleDetail(scope.scope)" fn="智能营销配置">查看配置</GLButton>
<!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> --> <!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div> </div>
</GLTable> </GLTable>
...@@ -47,7 +31,32 @@ export default { ...@@ -47,7 +31,32 @@ export default {
name: 'marketing', name: 'marketing',
data() { data() {
return { return {
optionstatus: [ tableSearchForm: {
imName: '',
imStatus: '',
createTime: ''
},
searchFormData: [
{
label: '添加时间',
name: 'createTime',
type: 'datePicker',
placeholder: '',
isClear: true,
pickerOptions: {
disabledDate: time => {
return time.getTime() > Date.now()
}
}
},
{
label: '状态',
name: 'imStatus',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{ {
value: '', value: '',
label: '全部' label: '全部'
...@@ -60,6 +69,14 @@ export default { ...@@ -60,6 +69,14 @@ export default {
value: '3', value: '3',
label: '已完成' label: '已完成'
} }
]
},
{
label: '营销名称',
name: 'imName',
type: 'input',
placeholder: '请输入营销名称'
}
], ],
pickerOptions: { pickerOptions: {
disabledDate: time => { disabledDate: time => {
...@@ -68,7 +85,6 @@ export default { ...@@ -68,7 +85,6 @@ export default {
}, },
createTime: '', createTime: '',
dialogVisible: true, dialogVisible: true,
tableSearchForm: {},
getListApi: this.$apis.marketing.findAllByPage, getListApi: this.$apis.marketing.findAllByPage,
tableParams: { tableParams: {
listName: 'data', listName: 'data',
...@@ -95,7 +111,7 @@ export default { ...@@ -95,7 +111,7 @@ export default {
{ {
label: '创建人', label: '创建人',
prop: 'createdName', prop: 'createdName',
width: '300px' width: '220px'
}, },
{ {
label: '操作', label: '操作',
...@@ -115,25 +131,34 @@ export default { ...@@ -115,25 +131,34 @@ export default {
} }
}, },
watch: { watch: {
createTime(value) { // createTime(value) {
if (value) { // if (value) {
this.tableSearchForm.beginTime = value[0] // this.tableSearchForm.beginTime = value[0]
this.tableSearchForm.endTime = value[1] // this.tableSearchForm.endTime = value[1]
} else { // } else {
delete this.tableSearchForm.beginTime // delete this.tableSearchForm.beginTime
delete this.tableSearchForm.endTime // delete this.tableSearchForm.endTime
} // }
} // }
}, },
methods: { methods: {
handleSearch() { handleSearch() {
this.$refs.employeeRef.refreshTable() this.$refs.employeeRef.refreshTable()
}, },
handleReset() { handleReset() {
this.createTime = []
this.tableSearchForm = {} this.tableSearchForm = {}
this.$refs.employeeRef.refreshTable() this.$refs.employeeRef.refreshTable()
}, },
beforeSearchFn() {
return new Promise(resolve => {
if (this.tableSearchForm.createTime) {
this.tableSearchForm.beginTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/-/g, '/')
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
}
// delete this.tableSearchForm.createTime
resolve()
})
},
handleImport() {}, handleImport() {},
addConfig() { addConfig() {
this.$router.push('/market/config') this.$router.push('/market/config')
...@@ -154,11 +179,6 @@ export default { ...@@ -154,11 +179,6 @@ export default {
margin: 0px 20px 0px 10px; margin: 0px 20px 0px 10px;
color: #666666; color: #666666;
} }
.count-item-question {
width: 14px;
height: 14px;
display: inline-block;
}
img { img {
width: 14px; width: 14px;
height: 14px; height: 14px;
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</div> </div>
</div> </div>
<div class="form-tips">共可输入500字,70字內(含70字)计一条,超过70字,按70字/条计费。</div> <div class="form-tips">共可输入500字,70字內(含70字)计一条,超过70字,按70字/条计费。</div>
<div class="form-tips">提示:当前短信已有{{ addForm.content.length }}字,按{{content.length}}条短信发送且计费。</div> <div class="form-tips">提示:当前短信已有{{ addForm.content.length }}字,按{{ content.length }}条短信发送且计费。</div>
</el-form-item> </el-form-item>
<el-form-item label="审核通知人:">短信内容审核结果会通过企微消息的形式发送给设置的员工,员工可以及时跟进。</el-form-item> <el-form-item label="审核通知人:">短信内容审核结果会通过企微消息的形式发送给设置的员工,员工可以及时跟进。</el-form-item>
<el-form-item label="自动打标签"> <el-form-item label="自动打标签">
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<img src="@/assets/img/marketing/phone.png" /> <img src="@/assets/img/marketing/phone.png" />
<div class="preview-content"> <div class="preview-content">
<div class="preview-info"> <div class="preview-info">
<div class="preview-text text" v-for="(item,index) in content" :key="index">{{ item }}</div> <div class="preview-text text" v-for="(item, index) in content" :key="index">{{ item }}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -189,7 +189,7 @@ export default { ...@@ -189,7 +189,7 @@ export default {
}, },
watch: { watch: {
'addForm.content': { 'addForm.content': {
handler: function () { handler: function() {
this.content = [] this.content = []
let str = this.addForm.content let str = this.addForm.content
let num = 70 let num = 70
...@@ -331,7 +331,7 @@ export default { ...@@ -331,7 +331,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.resize(); this.resize()
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.resize() this.resize()
}) })
......
...@@ -60,12 +60,12 @@ export default { ...@@ -60,12 +60,12 @@ export default {
}, },
dataZoom: [ dataZoom: [
{ {
startValue: lengthC-29, startValue: lengthC - 29,
endValue: lengthC endValue: lengthC
}, },
{ {
type: 'inside', type: 'inside',
startValue: lengthC-29, startValue: lengthC - 29,
endValue: lengthC endValue: lengthC
} }
], ],
......
...@@ -18,27 +18,19 @@ ...@@ -18,27 +18,19 @@
</div> </div>
</div> </div>
</div> </div>
<el-form :inline="true" :model="tableSearchForm" class="follow-form-item" label-width="80px"> <GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<el-row>
<el-form-item size="small" label="电话号码">
<el-input size="small" v-model="tableSearchForm.phone" placeholder="请输入电话号码"></el-input>
</el-form-item>
<el-form-item size="small" label="发送状态">
<el-select v-model="tableSearchForm.status" placeholder="请选择">
<el-option v-for="item in optionstatus" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button @click="handleReset">重置</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="optionBtns" slot-scope="scope"> <div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button> <el-button type="text" @click="handleDetail(scope.scope)">短信内容</el-button>
</div> </div>
</GLTable> </GLTable>
<GLDialog title="提示" :hasFooter="true" :content="messageContent" :visible.sync="dialogVisible" mode="small">
<span slot="footer" class="dialog-footer">
<el-button size="small" type="primary" @click="dialogVisible = false">
确定
</el-button>
</span>
</GLDialog>
</div> </div>
</template> </template>
...@@ -51,8 +43,10 @@ export default { ...@@ -51,8 +43,10 @@ export default {
}, },
data() { data() {
return { return {
messageContent: '',
totalCount: 0, totalCount: 0,
percentage: 0, percentage: 0,
dialogVisible: false,
optionstatus: [ optionstatus: [
{ {
value: '', value: '',
...@@ -67,7 +61,40 @@ export default { ...@@ -67,7 +61,40 @@ export default {
label: '已发送' label: '已发送'
} }
], ],
tableSearchForm: {}, tableSearchForm: {
phone: '',
status: null
},
searchFormData: [
{
label: '电话号码',
name: 'phone',
type: 'input',
placeholder: '请输入电话号码'
},
{
label: '状态',
name: 'status',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '0',
label: '未发送'
},
{
value: '1',
label: '已发送'
}
]
}
],
getListApi: this.$apis.overview.findAllMessageByPage, getListApi: this.$apis.overview.findAllMessageByPage,
tableParams: { tableParams: {
listName: 'data', listName: 'data',
...@@ -120,7 +147,8 @@ export default { ...@@ -120,7 +147,8 @@ export default {
this.$refs.employeeRef.refreshTable() this.$refs.employeeRef.refreshTable()
}, },
handleDetail(scope) { handleDetail(scope) {
this.$alert(scope.content, { center: true }) this.dialogVisible = true
this.messageContent = scope.content
} }
}, },
mounted() { mounted() {
......
...@@ -124,9 +124,9 @@ export default { ...@@ -124,9 +124,9 @@ export default {
this.$router.push('/square/import') this.$router.push('/square/import')
}, },
viewChart() { viewChart() {
this.loading = true; this.loading = true
this.$apis.overview.viewChart({}).then(res => { this.$apis.overview.viewChart({}).then(res => {
this.loading = false; this.loading = false
this.entMicroCount = res.entMicroCount this.entMicroCount = res.entMicroCount
this.totalCount = res.totalCount this.totalCount = res.totalCount
this.$refs.customerForm.getChart(res.trendItemList) this.$refs.customerForm.getChart(res.trendItemList)
...@@ -155,7 +155,7 @@ export default { ...@@ -155,7 +155,7 @@ export default {
} }
} }
.store-panel { .store-panel {
margin: 20px auto; margin: 16px auto;
padding: 20px; padding: 20px;
display: flex; display: flex;
.store-panel-item { .store-panel-item {
...@@ -258,7 +258,7 @@ export default { ...@@ -258,7 +258,7 @@ export default {
} }
} }
.statistics-main { .statistics-main {
margin-top: 20px; margin-top: 16px;
.statistics-title { .statistics-title {
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
......
<template> <template>
<div class="square-main" v-loading="loading"> <div class="square-main">
<el-dialog title="选择跟进专员" :visible.sync="dialogVisible" width="50%" :before-close="handleClose"> <el-dialog
<el-form :inline="true" :model="tableSearchForm"> title="选择跟进专员"
:visible.sync="dialogVisible"
width="50%"
:before-close="handleClose"
>
<el-form :inline="true" :model="tableSearchForm" label-width="80px">
<el-form-item size="small" label="员工"> <el-form-item size="small" label="员工">
<el-input v-model="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input> <el-input v-model="tableSearchForm.name" placeholder="请输入员工姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item size="small"> <el-form-item size="small" style="float: right">
<el-button type="primary" @click="handleSearch">查询</el-button> <el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<GLTable v-if="dialogVisible" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch" @selectionTable="selectionTable"></GLTable> <GLTable
ref="employeeRef"
:getListApi="getListApi"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
:hasNum="false"
>
</GLTable>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleCancel">取 消</el-button> <el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button> <el-button size="small" type="primary" @click="dialogVisible = false"
>确 定</el-button
>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default { export default {
name: 'selectEmp', name: "selectEmp",
data() { data() {
return { return {
loading: false,
dialogVisible: false, dialogVisible: false,
tableSearchForm: {}, tableSearchForm: {},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, getListApi: this.$apis.channel.getListApi,
tableParams: { tableParams: {
listName: 'data', listName: "data",
tableOption: false, tableOption: false,
// 行数据的key otherOptions: {
mutiSelectUniqueKey: 'id', label: "启用开关",
// 多选ref的名称 },
mutiSelectName: 'salelist',
tableColumns: [ tableColumns: [
{ {
label: '姓名', label: "姓名",
prop: 'staffName' prop: "staffName",
}, },
{ {
label: '部门', label: "部门",
prop: 'departmentName' prop: "entmicroName",
}, },
{ {
label: '跟进专员类型', label: "测试专员类型",
prop: 'followerTypeName' prop: "roleName",
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
selectItem: [],
selectEmp: []
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/home/followUp/index')
}, },
getFollower() { ],
var params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum
}
this.$apis.channel.getFollower(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
this.tableData.forEach(item => {
this.selectEmp.forEach((itm, index) => {
if (itm.staffId == item.relationId) {
this.$refs.table.$refs.salelistMutiTable.toggleRowSelection(item)
this.selectEmp.splice(index, 1)
}
})
})
})
}, },
init(item) { pageConf: { pageSize: "pageSize", pageNum: "pageNum", totalCount: "count" },
this.tableSearchForm = {} baseData: {
this.selectEmp = JSON.parse(JSON.stringify(item)) allMerchantList: [],
this.dialogVisible = true roleList: [],
this.$nextTick(() => { staffStatusList: [],
this.$refs.table.page.pageNum = 1
this.getFollower()
})
}, },
handleSearch() { };
this.getFollower()
}, },
selectionTable(val) { methods: {
this.selectItem = val init() {
this.dialogVisible = true;
}, },
handleClose() {
this.handleCancel()
}, },
handleCancel: utils.debounce(function () { };
this.dialogVisible = false
this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, 300),
handleSelect: utils.debounce(function () {
this.loading = true
let selectEmp = this.selectEmp.map(item => {
return {
relationId: item.staffId,
staffName: item.staffName
}
})
const selectItem = this.selectItem.concat(selectEmp)
if (selectItem.length == 0) {
this.$message.error('请选择员工')
return
}
this.loading = false
this.dialogVisible = false
this.$emit('selectTable', this.selectItem.concat(selectEmp))
this.$refs.table.$refs.salelistMutiTable.clearSelection()
}, 300)
}
}
</script> </script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850FF;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.square-main {
/deep/ {
.el-table {
height: 40vh;
overflow-y: auto;
}
.el-table::before {
left: 0;
bottom: 0;
width: 100%;
height: 0px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<style lang="scss" scoped></style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="import-main">
<div class="upload-process">
<div class="upload-process-item" v-for="(item, index) in process" :key="item">
<div class="process-item-label" :style="{ width: textNum * 20 + 'px' }">
<label>*</label>
{{ item.templateName }}:
</div>
<div class="process-item-info">
<div class="process-item-size">
<img src="@/assets/img/Excel.png" alt="" />
文件大小:{{ item.size }}M
</div>
<div class="process-item-name">{{ item.fileName }}</div>
<div class="process-item-num">
<el-progress :show-text="false" :stroke-width="6" :percentage="item.percentage" :color="item.percentage != 100 ? '#5850FF' : '#2CCA74'"></el-progress>
<div class="process-num-status" v-if="item.percentage > 0 && item.percentage < 100">上传中</div>
<div class="process-num-status process-refresh" v-if="item.percentage == 0 && !dialogVisible" @click="refresh(index)">
重试
<i class="el-icon-refresh-right"></i>
</div>
<div class="process-num-status process-refresh" v-if="item.percentage == 0 && dialogVisible">
等待上传
</div>
<div class="process-num-status" v-if="item.percentage == 100"><i class="el-icon-success"></i></div>
</div>
</div>
</div>
</div>
<GLDialog @onOk="handleSure" @onCancel="handleCancel" title="提示" :visible.sync="dialogVisible" mode="small">
<div class="dialog-body">
<div class="dialog-tips-icon"><i class="el-icon-warning"></i></div>
<div class="dialog-tips-text">点击继续将开始上传数据文件</div>
<div class="dialog-tips-text">
<span>期间请勿关闭页面</span>
,是否继续吗?
</div>
</div>
<!-- <div slot="footer" class="dialog-footer">
<el-button size="small" @click="handleCancel">
取 消
</el-button>
<el-button size="small" type="primary" @click="handleSure">确 定</el-button>
</div> -->
</GLDialog>
<div class="loading-containner" v-if="processLoading"></div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
export default {
name: 'step-second',
props: {},
data() {
return {
textNum: 0,
processLoading: false,
resultNum: 0,
dialogVisible: false,
setInter: [],
process: [{ percentage: 0 }, { percentage: 0 }, { percentage: 0 }],
uploadItem: ''
}
},
mounted() {},
beforeDestroy() {
this.setInter.forEach(item => {
item && clearInterval(item)
})
},
methods: {
handleSure: utils.debounce(function() {
this.fileUpload()
this.dialogVisible = false
}, 300),
handleCancel() {
this.$emit('excelCancel')
this.dialogVisible = false
},
handleClose() {
this.handleCancel()
},
startUpload(info) {
this.uploadItem = info
const fileList = info.fileList
this.process = fileList.map(p => {
this.textNum = this.textNum > p.templateName.length ? this.textNum : p.templateName.length + 1
return {
percentage: 0,
fileName: p.fileName,
templateName: p.templateName,
size: p.size.toFixed(2)
}
})
console.log(info)
this.dialogVisible = true
},
async refresh(index) {
this.processLoading = true
this.process[index].percentage = 0
this.setInter[index] = setInterval(this.addProcess(index), 300)
try {
this.uploadItem.fileList[index].fileUrl = await this.$apis.common.pictureUpload({ file: this.uploadItem.fileList[index].fileInfo })
this.resultNum++
this.process[index].percentage = 100
clearInterval(this.setInter[index])
if (this.resultNum == this.process.length) {
this.datacubeUpload()
}
} catch (e) {
this.processLoading = false
this.process[index].percentage = 0
clearInterval(this.setInter[index])
}
},
datacubeUpload() {
this.processLoading = false
const fileList = this.uploadItem.fileList.map(item => {
return {
templateName: item.templateName,
fileName: item.fileName,
fileUrl: item.fileUrl,
templateUrl: item.templateUrl,
BusinessTypeId: item.BusinessTypeId,
businessTypeName: item.businessTypeName
}
})
let params = { fileList, createdStaffId: this.$globalState.session.id, remarks: this.uploadItem.remarks, staffIdList: this.uploadItem.staffIdList }
this.$apis.square.datacubeUpload(params).then(res => {
if (res) {
this.$emit('handleSuccess')
}
})
},
fileUpload() {
this.process.forEach(p => {
p.percentage = Math.random() * 30
})
this.resultNum = 0
this.processLoading = true
this.uploadItem.fileList.forEach(async (item, index) => {
this.$set(this.setInter, index, setInterval(this.addProcess(index), 300))
try {
this.uploadItem.fileList[index].fileUrl = await this.$apis.common.pictureUpload({ file: item.fileInfo })
this.process[index].percentage = 100
this.resultNum++
clearInterval(this.setInter[index])
if (this.resultNum == this.process.length) {
this.datacubeUpload()
}
} catch (e) {
this.processLoading = false
this.process[index].percentage = 0
clearInterval(this.setInter[index])
}
// setTimeout(() => {
// clearInterval(this.setInter)
// this.$emit('handleSuccess')
// }, 1000)
// }
// this.$apis.common
// .pictureUpload({ file: item.fileInfo })
// .then(res => {
// resultNum++
// item.fileUrl = res
// this.process[index].percentage = 100
// })
// .catch(() => {
// this.process[index].percentage = 0
// })
})
// this.uploadItem.fileList = this.uploadItem.fileList.filter(item => item.fileUrl)
// this.uploadItem.createdStaffId = this.$globalState.session.id
// this.$apis.square
// .datacubeUpload(this.uploadItem)
// .then(res => {
// if (res) {
// const result = res.failFile
// let resultNum = 0
// result.forEach((item, index) => {
// if (item.uploadSuccess == 0) {
// this.process[index].percentage = 100
// resultNum++
// } else {
// this.process[index].percentage = 0
// }
// })
// if (resultNum == result.length) {
// setTimeout(() => {
// clearInterval(this.setInter)
// this.$emit('handleSuccess')
// }, 1000)
// }
// }
// })
// .catch(() => {
// this.process.forEach(p => {
// p.percentage = 0
// })
// })
},
addProcess(index) {
this.process[index].percentage = this.process[index].percentage > 90 ? this.process[index].percentage : this.process[index].percentage + Math.random() * 5
}
}
}
</script>
<style lang="scss" scoped>
.loading-containner {
top: 0px;
left: 0px;
position: fixed;
width: 100%;
background: rgba(255, 255, 255, 0.1);
z-index: 5000;
height: 100%;
}
.import-main {
margin: 60px auto 0px;
width: 92%;
.upload-process {
&-item {
display: flex;
margin-bottom: 20px;
width: 40vw;
.process-item-label {
font-size: 14px;
font-weight: 400;
color: #333333;
min-width: 120px;
line-height: 20px;
text-align: right;
label {
color: #eb4e4e;
}
}
.process-item-info {
flex: 1;
}
.process-item-size {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
img {
width: 24px;
}
}
.process-item-name {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 22px;
margin-top: 6px;
}
.process-item-num {
margin-top: 8px;
display: flex;
align-items: center;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
line-height: 22px;
/deep/ .el-progress {
flex: 1;
margin-right: 6px;
}
.process-num-status {
width: 60px;
&.process-refresh {
cursor: pointer;
}
i {
color: #2cca74;
font-size: 14px;
&.el-icon-refresh-right {
color: #8c8c8c;
}
}
}
}
}
}
.dialog-body {
text-align: center;
margin: 10px 0px;
.dialog-tips-icon {
margin-bottom: 12px;
i {
color: #5850ff;
font-size: 32px;
}
}
.dialog-tips-text {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
span {
color: #eb4e4e;
}
}
}
.dialog-footer {
text-align: center;
}
}
</style>
<template>
<div class="import-main">
<div class="import-success">
<div class="import-success-image">
<i class="el-icon-success"></i>
</div>
<div class="import-success-desc">上传完成</div>
<div class="import-success-content">数据中心已成功接收到数据,数据处理完毕后将发送企微通知。</div>
<div class="import-success-content">届时请回到【引流获客】-【企微魔方】查看分析结果</div>
</div>
</div>
</template>
<script>
export default {
name: 'step-third',
props: {},
data() {
return {}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.import-main {
padding: 30px;
width: 80%;
margin: 0 auto;
border: 1px solid #e8e8ea;
}
.import-success {
text-align: center;
.el-icon-success {
font-size: 60px;
color: #2cca74;
}
&-desc {
font-size: 24px;
font-weight: 500;
color: #333333;
line-height: 32px;
margin: 20px 0px 10px;
}
&-content {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
opacity: 0.45;
}
}
</style>
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
<el-switch :disabled="!editStatus" v-model="autoWelcome" active-color="#5850FF" inactive-color="#999999"></el-switch> <el-switch :disabled="!editStatus" v-model="autoWelcome" active-color="#5850FF" inactive-color="#999999"></el-switch>
</div> </div>
<div class="welcome-box" v-show="editStatus && autoWelcome"> <div class="welcome-box" v-show="editStatus && autoWelcome">
<welcome-words :eventBus="eventBus" ref="welcome"></welcome-words> <GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
</div> </div>
<div class="welcome-box" v-show="!editStatus && autoWelcome"> <div class="welcome-box" v-show="!editStatus && autoWelcome">
<div class="welcome-box-contaner"> <div class="welcome-box-contaner">
...@@ -207,8 +207,7 @@ ...@@ -207,8 +207,7 @@
</div> </div>
</div> </div>
</div> </div>
<GLFooter <GLFooter>
>
<el-button type="primary" @click="handleSave" v-if="editStatus">提交</el-button> <el-button type="primary" @click="handleSave" v-if="editStatus">提交</el-button>
<el-button @click="goback">取消</el-button> <el-button @click="goback">取消</el-button>
</GLFooter> </GLFooter>
...@@ -276,13 +275,14 @@ ...@@ -276,13 +275,14 @@
</div> </div>
</div> </div>
</div> </div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisibleTips = false" type="warning" content="当前有内容信息未保存,是否继续返回?" :visible.sync="dialogVisibleTips" mode="small"></GLDialog>
</div> </div>
</template> </template>
<script> <script>
import Vue from 'vue' import Vue from 'vue'
import word from '@/mixins/word'
import { utils } from 'glsx-common' import { utils } from 'glsx-common'
import welcomeWords from '@/components/welcome/welcomeWords.vue'
import selectEmp from '@/components/selectEmp' import selectEmp from '@/components/selectEmp'
import selectTag from '@/components/selectTag' import selectTag from '@/components/selectTag'
import messageModel from '../market/components/messageModel' import messageModel from '../market/components/messageModel'
...@@ -294,16 +294,17 @@ const validateTime = (rule, value, callback) => { ...@@ -294,16 +294,17 @@ const validateTime = (rule, value, callback) => {
} }
} }
export default { export default {
mixins: [word],
name: 'drainage', name: 'drainage',
components: { components: {
selectEmp, selectEmp,
selectTag, selectTag,
messageModel, messageModel
welcomeWords
}, },
data() { data() {
return { return {
welcomeInfo: [], welcomeInfo: [],
dialogVisibleTips: false,
eventBus: new Vue(), eventBus: new Vue(),
autoWelcome: true, autoWelcome: true,
editStatus: false, editStatus: false,
...@@ -339,7 +340,7 @@ export default { ...@@ -339,7 +340,7 @@ export default {
}, },
watch: { watch: {
'addForm.content': { 'addForm.content': {
handler: function () { handler: function() {
this.content = [] this.content = []
if (this.addForm.content) { if (this.addForm.content) {
let str = this.addForm.content let str = this.addForm.content
...@@ -353,7 +354,7 @@ export default { ...@@ -353,7 +354,7 @@ export default {
} }
}, },
'addForm.tagging': { 'addForm.tagging': {
handler: function () { handler: function() {
this.taggingLength = 0 this.taggingLength = 0
if (this.addForm.tagging) { if (this.addForm.tagging) {
this.addForm.tagging.forEach(item => { this.addForm.tagging.forEach(item => {
...@@ -442,17 +443,14 @@ export default { ...@@ -442,17 +443,14 @@ export default {
this.saveStatus = true this.saveStatus = true
} }
if (this.saveStatus) { if (this.saveStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', { this.dialogVisibleTips = true
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.go(-1)
})
} else { } else {
this.$router.go(-1) this.$router.go(-1)
} }
}, },
handleSure() {
this.$router.go(-1)
},
//开关 //开关
handleSwitch() { handleSwitch() {
let params = { let params = {
...@@ -511,6 +509,8 @@ export default { ...@@ -511,6 +509,8 @@ export default {
console.log(item.attContent) console.log(item.attContent)
item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称') item.attContent = item.attContent.replaceAll('[@昵称]', '@昵称')
item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]') item.attContent = item.attContent.replaceAll('@昵称', '[@昵称]')
} else if (item.attType == 7 && item.attContent) {
item.attContent = JSON.stringify(item.attContent)
} }
return item return item
}) })
...@@ -587,7 +587,7 @@ export default { ...@@ -587,7 +587,7 @@ export default {
}) })
} }
}) })
}, }
}, },
mounted() { mounted() {
this.findConfig() this.findConfig()
...@@ -597,7 +597,7 @@ export default { ...@@ -597,7 +597,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.channel-main-welcome { .channel-main-welcome {
margin: 20px 0px 60px; margin: 20px 0px 16px;
.chanel-form-title { .chanel-form-title {
padding-left: 20px; padding-left: 20px;
font-size: 16px; font-size: 16px;
......
...@@ -7,15 +7,9 @@ ...@@ -7,15 +7,9 @@
<div class="contact-us-about">联系我们</div> <div class="contact-us-about">联系我们</div>
</div> --> </div> -->
<div class="squre-success-image"><i class="el-icon-success"></i></div> <div class="squre-success-image"><i class="el-icon-success"></i></div>
<div class="squre-success-tips">数据处理完成</div> <div class="squre-success-tips">提交成功</div>
<div class="squre-success-content">所提交的数据已经过加密,并安全存储专属加密区。</div> <div class="squre-success-content">所提交的数据已经过加密,并安全存储专属加密区。</div>
<div class="squre-success-content">针对导入的结果有疑问请扫码联系我们,我们将为您提供专业答疑和营销推荐。</div> <div class="squre-success-content">针对导入的结果有疑问请扫码联系我们,我们将为您提供专业答疑和营销推荐。</div>
<div class="squre-tips" v-if="!importData.errorNum">
<i class="el-icon-warning"></i>
本次导入共有{{ importData.errorNum }}条异常数据,请点击
<a :href="importData.errorDataUrl">下载</a>
获取明细
</div>
<div class="squre-success-footer"> <div class="squre-success-footer">
<div class="squre-success-item"> <div class="squre-success-item">
<div class="success-item-title">本次导入总客户数</div> <div class="success-item-title">本次导入总客户数</div>
...@@ -30,6 +24,12 @@ ...@@ -30,6 +24,12 @@
<div class="success-item-num">{{ detailInfo.entmicroNumber }}/{{ detailInfo.importNumber }}</div> <div class="success-item-num">{{ detailInfo.entmicroNumber }}/{{ detailInfo.importNumber }}</div>
</div> </div>
</div> </div>
<div class="squre-tips" v-if="importData.errorNum">
<i class="el-icon-warning"></i>
本次导入共有{{ importData.errorNum }}条异常数据,请点击
<a :href="importData.errorDataUrl">下载</a>
获取明细
</div>
</div> </div>
<div class="custom-title">客户分群营销</div> <div class="custom-title">客户分群营销</div>
<div class="custom-wrap"> <div class="custom-wrap">
...@@ -178,10 +178,6 @@ export default { ...@@ -178,10 +178,6 @@ export default {
width: 33.33%; width: 33.33%;
text-align: center; text-align: center;
margin: 20px auto; margin: 20px auto;
border-right: 1px solid rgba(0, 0, 0, 0.09);
&:last-child {
border: none;
}
.success-item-title { .success-item-title {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
...@@ -198,14 +194,11 @@ export default { ...@@ -198,14 +194,11 @@ export default {
} }
.squre-tips { .squre-tips {
width: 400px; padding: 20px;
margin: 10px auto;
text-align: center;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #424242; color: #424242;
line-height: 36px; line-height: 28px;
border-top: 1px solid rgba(0, 0, 0, 0.09);
a { a {
cursor: pointer; cursor: pointer;
text-decoration: underline; text-decoration: underline;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!