Commit ff68816c by 李长胜

提交客户运营项目

0 parents
Showing 103 changed files with 8600 additions and 0 deletions
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
VUE_APP_PORT = 6652
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file
{
"root": true,
"env": {
"node": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": {
"no-console": "off",
"no-unused-vars":"off",
"prettier.endOfLine": "crlf",
"endOfLine":"auto"
},
"parserOptions": {
"parser": "babel-eslint"
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/dist/*
.local
.output.js
/node_modules/**
**/*.svg
**/*.sh
/public/*
{
"printWidth": 800,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 820,
"wrap_attributes": "auto",
"proseWrap": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"jsxBracketSameLine": true,
"files.insertFinalNewline": true,
"useTabs": false,
"eslintIntegration": true,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
],
"endOfLine": "auto"
}
# subapp-blog
微前端博客子应用
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"]
};
{
"name": "scrm-sub-blog",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"prettier": "prettier --write ."
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.4.4",
"echarts": "^5.2.0",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.4",
"glsx-components": "^1.0.5",
"glsx-table": "^1.1.0",
"sha1": "^1.1.1",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"@vue/eslint-config-prettier": "^5.0.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %>
<title>微前端子应用:博客</title>
</head>
<body>
<noscript>
<strong>We're sorry but module-report doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html>
\ No newline at end of file
var express = require('express')
// var history = require('connect-history-api-fallback')
var cors = require('cors')
var app = express()
// app.use(history())
app.use(cors())
app.use(express.static('./dist'))
app.get('/', function(req, res) {
res.send('Hello jq')
})
const port = 6652
app.listen(port)
console.log(`服务已运行:\r\n http://127.0.0.1:${port}`)
<template>
<div id="app">
<!-- <h2>
报表子应用
<span class="right">{{ gs }}</span>
</h2>
<div id="nav">
<span>切换路由:</span>
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/')">报表</el-button>
<el-button type="primary" size="medium" @click="routerChange('/about')">穿梭框</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1')">表格</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">日历</el-button>
<el-button type="primary" size="medium" @click="toAppReport('3-1')">aaaa</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<span>rxjs通信方案:{{ myMsg }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:{{ myMessage }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('default')">通知父应用收到</el-button>
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div> -->
<router-view />
</div>
</template>
<script>
export default {
name: 'report-app',
props: {
msg: String,
message: String
},
data() {
return {
myMsg: '',
gs: ''
}
},
created() {
this.myMsg = this.msg
this.myMessage = this.message
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
</style>
>
/*
所有模块都定义在 modules
|-modules
|----demo.js
|----demo1.js
|----...
|-index.js ---动态对外暴露所有模块 无须手动添加
参考demo.js 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
*/
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default modules
/**
* 新增参数sign 判断接口是否需要sign签名(默认有,不必写)
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
//获取数据概览上方的数据 /rop-scrm-datahub
export function getDataOverview(params){
params.method='org.ore.api.customer.view.data'
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
//获取数据概览下方柱状图的数据
export function getDataOverviewBarMap(params){
params.method='org.ore.api.customer.view.chart'
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
/**
* 新增参数sign 判断接口是否需要sign签名(默认有,不必写)
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
export function getTableList (params){
params.method='org.ore.api.customer.base.page'
// params.sessionId="mini-a9edd006-4600-47a3-834e-d9915dd082ad-rop"
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
export function getTableDetail(params){
params.method='org.ore.api.customer.base.detail'
// params.sessionId="mini-a9edd006-4600-47a3-834e-d9915dd082ad-rop"
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
// 客户群的客户列表获取分页数据接口
export function getDetailTableList(params){
params.method='org.ore.api.customer.base.cust.page'
// params.sessionId="mini-a9edd006-4600-47a3-834e-d9915dd082ad-rop"
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
/**
* 新增参数sign 判断接口是否需要sign签名(默认有,不必写)
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
//const commonUrl='&format=json&appKey=48e5e13229b82c1b4e6e8c96151f0637&v=1.0.*×tamp=1654487354&source=sub-client-custom&sign=sdf9787dfs87987sf9879sdf87sdf'
//获取客户列表内容
// const GETCLIENTTABLELIST = params => {
// return http({
// url: '/router'+'?method=org.ore.api.customer.page',
// method: 'POST',
// data: params,
// sign: true
// })
// }
export function getTableList (params){
params.method='org.ore.api.customer.page'
// params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop"
// params.timestamp=new Date().getTime()
// +'?method=org.ore.api.customer.page'
return http({
url: '/router',
method: 'GET',
data: params,
sign: true
})
}
export function getTableDetail(params){
params.method='org.ore.api.customer.detail'
// params.sessionId="mini-e72437ba-845e-4da3-9966-0b25684d6373-rop"
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
/*获取来源字典的
*/
export function getDictionaryFun(params){
params.method='org.ore.api.common.dictdata.list'
return http({
url: '/router',
method: 'GET',
data: params,
sign: true
})
}
// export default {
// // GETCLIENTTABLELIST,
// GETLISTDEVICEFILEUNSTOCK1
// }
\ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const GETLISTDEVICEFILEUNSTOCK = params => {
return http({
url: 'base/apps',
method: 'GET',
data: params,
sign: true
})
}
const GETLISTDEVICEFILEUNSTOCK1 = params => {
return http({
url: 'base/apps',
method: 'POST',
data: params,
sign: true
})
}
export default {
GETLISTDEVICEFILEUNSTOCK,
GETLISTDEVICEFILEUNSTOCK1
}
/**
* 新增参数sign 判断接口是否需要sign签名(默认有,不必写)
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
export function getTableList (params){
params.method='datahub.api.label.querylabeltree'
// params.sessionId="mini-e617124f-7acc-493b-bf7d-bb21c5aa8ec5-rop"
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
//计算表格上面的数量
export function getTableTagNum(params){
params.method='datahub.api.label.getlabelcount'
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
// /router/datahub.api.label.addlabel/1.0.0
export function newAddTag(params){
params.method='datahub.api.label.addlabel'
return http({
url: '/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
//修改标签
export function updateTag(params){
params.method='datahub.api.label.updatelabel'
return http({
url: '/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
.left{float:left}.right{float:right}.align-right{text-align:right}
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
/**
* 根据路由匹配地址
* @param {*} data 路由数据
* @param {*} base 路由前缀
* @param {*} options 粗略的配置项
*/
function routeMatch(data, base, options = { url: 'url', name: 'name', id: 'id', permissions: 'permissions' }) {
if (!Array.isArray(data)) return []
// 主视图路由 正式项目需要区分登陆注册等
/* let userRouter = {
path: "/layout",
name: "layout",
component: () => import('@/views/layout/index.vue'),
redirect: '/index',
children: []
}; */
// 创建路由盒子
let routerBox = []
// 将菜单数据处理为一维函数 如果有多级菜单
// let menu = flattenDeep(data, 'children');
let menu = data
// 遍历处理路由
menu.forEach(item => {
if (!item[options.url]) return
let _url = item[options.url].replace(base, '')
try {
let routerItem = {
path: _url, // 路由路径名
name: item[options.name] || item[options.id], // 命名路由 用于配合菜单简洁跳转
meta: {
purview: item[options.permissions]
}, // 路由元信息 定义路由时即可携带的参数,可用来管理每个路由的按钮操作权限
component: () => import(`@/views${_url}/index.vue`) // 路由映射真实视图路径
}
routerBox.push(routerItem)
} catch (err) {
item[options.url] = '/err-404'
}
})
// 推入需要授权后等异步加载的,非服务端获取的功能性页面
// routerBox.push(...nextRouter);
let errorBox = {
path: '*',
redirect: '/err-404'
}
routerBox.push(errorBox)
return routerBox
}
export default routeMatch
/**
* 公共方法
* */
export const common = {
/**
* 获取时间对象
*/
getDateInfo: function() {
var o = new Date()
var y = o.getFullYear()
var m = o.getMonth() + 1
var d = o.getDate()
var M = m
var D = d
if (m < 10) {
M = '0' + m
}
if (d < 10) {
D = '0' + d
}
return {
y: y,
m: m,
M: M,
d: d,
D: D,
today: y + '-' + M + '-' + D
}
},
/**
* 字符串截取
*/
/**
* 截取字符串
*/
subStrByLength: function(str, length) {
var retStr = str
var len = 3
if (retStr) {
if (length) {
len = length
}
if (str.length > len) {
retStr = str.substring(0, len) + '...'
}
}
return retStr
},
/**
* 正整数
* */
checkRegExpNumber(rule, value, callback) {
var rxp = /^\+?[1-9][0-9]*$/
if (!rule.required) {
if (!value) {
callback()
}else if (!rxp.test(value)) {
return callback(new Error('只支持正整数'))
}
}
if (!value) {
return callback(new Error('请输入正整数'))
}else {
callback()
}
},
/**
* 手机号
* */
checkRegExpPhoneTel(rule, value, callback) {
var rxpPhone = /^1[3456789]\d{9}$/
var rxpTel = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
if (!rule.required) {
if (!value) {
callback()
}else if (!rxpPhone.test(value)) {
return callback(new Error('请输入正确的手机号码'))
}
}
if (!value) {
return callback(new Error('请输入手机号码或固话'))
}else if (!rxpPhone.test(value) && !rxpTel.test(value)) {
return callback(new Error('请输入正确的手机号码或固话'))
}else {
callback()
}
},
/**
* 中文英文数字下划线括号
*/
checkName(rule, value, callback) {
var rxp = /^[\u4e00-\u9fa5_a-zA-Z0-9.\\()\\()]+$/
if (!rule.required) {
if (!value) {
callback()
}else if (!rxp.test(value)) {
return callback(new Error('请输入中文英文数字下划线或括号'))
}
}
if (!value) {
return callback(new Error('请输入'))
}else {
callback()
}
}
}
// 定义一些常量
export const BACKTOP_DISTANCE = 1000;
export const Constants = {
CLIENT_STATUS :{
'0': '正常, green-text',
'1': '删除好友, red-text'
},
//性别选项
GENDER_OPTION:[
{
label: '全部',
value: null
},
{
label: '男',
value: 1
},
{
label: '女',
value: 2
},
{
label: '未知',
value: 0
}
],
SOURCE_OPTION:[
{
label: '全部',
value: 0
},
{
label: '直接导入',
value: 1
},
{
label: '扫描二维码',
value: 'first'
},
{
label: '搜索手机号',
value: 2
},
{
label: '名片分享',
value: 3
},
{
label: '群聊',
value: 4
},
{
label: '手机通讯录',
value: 5
},
{
label: '微信联系人',
value: 6
},
{
label: '来自微信的添加好友申请',
value: 7
},
{
label: '第三方应用的客户人员',
value: 8
},
{
label: '搜索邮箱',
value: 9
},
{
label: '内部成员共享',
value: 10
},
{
label: '管理员/负责人分配',
value: 11
},
{
label: '未知来源',
value: 12
}
],
// 文件大小提示语
FILESIZEMSG: '单个文件大小不能超过10M',
// 文件格式提示
FILETYPEMSG: '文件格式只支持jpg/jpeg/gif/png',
// 文件上传个数限制
FILEUPLOADLIMIT: '最多只能上传5张图片',
// 删除文件失败
// 新增成功
ADDSUCCESSMSG: '新增成功',
// 编辑成功
EDITSUCCESSMSG: '编辑成功',
// 删除成功
DELETESUCCESSMSG: '删除成功',
// 操作成功
OPERATESUCCESSMSG: '操作成功',
// 操作失败
OPERATEFAILMSG: '操作失败',
// 错误提示
ERRORMSG: '出错了,请联系管理员',
// 请选择门店
CHOSSESTOREMSG: '请选择门店',
// 缺少参数
LACKPARAMSMSG: '缺少参数',
// 付费方式 0用户续费,1后台续费
PAYWAYSTATUS: {
'0': '用户续费',
'1': '后台续费',
null: '--'
},
// 续费时长
PERIODSTATUS: {
'0': '六个月',
'1': '一年',
'2': '两年',
'3': '三年',
null: '--'
},
// 设备状态
DEVICESTATUS: {
0: '未激活',
1: '已激活',
2: '已过期'
}
}
{
"data": {
"total": 18,
"pages": 1,
"pageSize": 20,
"page": 1,
"rows": [
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-09",
"accountName": "kira",
"memo": "",
"updateTime": "2021-10-09 17:43:07",
"userName": "kira",
"type": 0,
"operator": "float",
"uid": 4192,
"phone": "",
"createTime": "2021-09-15 16:25:10",
"roleName": "cdbi",
"creater": "float",
"reviewStatus": 0,
"email": "11@can-dao.com",
"status": 1,
"createDate": "2021-09-15"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-09-15",
"accountName": "mia",
"memo": "",
"updateTime": "2021-09-15 10:17:03",
"userName": "mia",
"type": 0,
"operator": "joycechen",
"uid": 4181,
"phone": "",
"createTime": "2021-06-22 10:50:20",
"roleName": "cdbi",
"creater": "ana",
"reviewStatus": 0,
"email": "22@can-dao.com",
"status": 1,
"createDate": "2021-06-22"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-09-24",
"accountName": "royvent",
"memo": "",
"updateTime": "2021-09-24 00:14:50",
"userName": "royvent",
"type": 0,
"operator": "",
"uid": 4180,
"phone": "",
"createTime": "2021-06-15 15:12:49",
"roleName": "cdbi",
"creater": "summer",
"reviewStatus": 0,
"email": "33@can-dao.com",
"status": 1,
"createDate": "2021-06-15"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-09-02",
"accountName": "Claire",
"memo": "",
"updateTime": "2021-09-02 16:09:26",
"userName": "claireliu",
"type": 0,
"operator": "admin",
"uid": 4117,
"phone": "",
"createTime": "2021-05-18 16:39:03",
"roleName": "cdbi",
"creater": "admin",
"reviewStatus": 0,
"email": "44@can-dao.com",
"status": 1,
"createDate": "2021-05-18"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-08-25",
"accountName": "carterhuang",
"memo": "",
"updateTime": "2021-08-25 11:43:02",
"userName": "carterhuang",
"type": 0,
"operator": "定时同步钉钉用户",
"uid": 3951,
"phone": "",
"createTime": "2020-12-07 15:49:10",
"roleName": "cdbi",
"creater": "ray",
"reviewStatus": 0,
"email": "55@can-dao.com",
"status": 2,
"createDate": "2020-12-07"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-09",
"accountName": "float",
"memo": "",
"updateTime": "2021-10-09 10:25:37",
"userName": "float",
"type": 0,
"operator": "float",
"uid": 3854,
"phone": "",
"createTime": "2020-09-10 18:04:31",
"roleName": "cdbi",
"creater": "float",
"reviewStatus": 0,
"email": "66@can-dao.com",
"status": 1,
"createDate": "2020-09-10"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-09-28",
"accountName": "aiello",
"memo": "",
"updateTime": "2021-09-28 10:25:29",
"userName": "aiello",
"type": 0,
"operator": "gray",
"uid": 726,
"phone": "158****0871",
"createTime": "2020-04-27 17:29:35",
"roleName": "cdbi",
"creater": "ana",
"reviewStatus": 0,
"email": "77@can-dao.com",
"status": 1,
"createDate": "2020-04-27"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-12",
"accountName": "lily",
"memo": "IU",
"updateTime": "2021-10-12 09:59:45",
"userName": "lily",
"type": 0,
"operator": "gray",
"uid": 382,
"phone": "157****4903",
"createTime": "2019-12-03 16:08:55",
"roleName": "cdbi",
"creater": "lilyli",
"reviewStatus": 0,
"email": "88@can-dao.com",
"status": 1,
"createDate": "2019-12-03"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-09",
"accountName": "gray",
"memo": "",
"updateTime": "2021-10-09 10:15:26",
"userName": "gray",
"type": 0,
"operator": "gray",
"uid": 368,
"phone": "134****7864",
"createTime": "2019-11-19 16:22:31",
"roleName": "cdbi",
"creater": "gray",
"reviewStatus": 0,
"email": "99@can-dao.com",
"status": 1,
"createDate": "2019-11-19"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-09-23",
"accountName": "jeromezhang",
"memo": "测试",
"updateTime": "2021-09-23 17:57:16",
"userName": "jeromezhang",
"type": 0,
"operator": "jeromezhang",
"uid": 362,
"phone": "",
"createTime": "2019-11-06 23:02:10",
"roleName": "cdbi",
"creater": "jeromezhang",
"reviewStatus": 0,
"email": "00@can-dao.com",
"status": 1,
"createDate": "2019-11-06"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-09",
"accountName": "ray",
"memo": "",
"updateTime": "2021-10-09 18:19:34",
"userName": "ray",
"type": 0,
"operator": "ray",
"uid": 357,
"phone": "",
"createTime": "2019-11-01 23:25:31",
"roleName": "cdbi",
"creater": "ray",
"reviewStatus": 0,
"email": "aa@can-dao.com",
"status": 1,
"createDate": "2019-11-01"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-08",
"accountName": "slow",
"memo": "",
"updateTime": "2021-10-08 09:45:55",
"userName": "slow",
"type": 0,
"operator": "slow",
"uid": 353,
"phone": "",
"createTime": "2019-11-01 14:25:37",
"roleName": "cdbi",
"creater": "hony",
"reviewStatus": 0,
"email": "bb@can-dao.com",
"status": 1,
"createDate": "2019-11-01"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-09-17",
"accountName": "stella",
"memo": "",
"updateTime": "2021-09-17 10:50:51",
"userName": "stella",
"type": 0,
"operator": "joycechen",
"uid": 343,
"phone": "",
"createTime": "2019-10-24 14:47:13",
"roleName": "cdbi",
"creater": "tiffany",
"reviewStatus": 0,
"email": "cc@can-dao.com",
"status": 1,
"createDate": "2019-10-24"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-08-25",
"accountName": "anders",
"memo": "",
"updateTime": "2021-08-25 11:42:43",
"userName": "anders",
"type": 0,
"operator": "定时同步钉钉用户",
"uid": 340,
"phone": "",
"createTime": "2019-10-21 11:12:53",
"roleName": "cdbi",
"creater": "lincoln",
"reviewStatus": 0,
"email": "dd@can-dao.com",
"status": 2,
"createDate": "2019-10-21"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-08-25",
"accountName": "ana",
"memo": "",
"updateTime": "2021-08-25 11:42:40",
"userName": "ana用户名称",
"type": 0,
"operator": "定时同步钉钉用户",
"uid": 257,
"phone": "",
"createTime": "2019-08-15 14:47:59",
"roleName": "cdbi",
"creater": "tiffany",
"reviewStatus": 0,
"email": "anawang@can-dao.com",
"status": 2,
"createDate": "2019-08-15"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-09-26",
"accountName": "comma",
"memo": "11113123131",
"updateTime": "2021-09-26 10:30:05",
"userName": "comma",
"type": 0,
"operator": "comma",
"uid": 107,
"platformKey": "",
"phone": "138****0002",
"createTime": "2019-07-29 10:41:59",
"roleName": "cdbi",
"creater": "comma",
"reviewStatus": 0,
"email": "ee@can-dao.com",
"status": 1,
"createDate": "2019-07-29"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-08",
"accountName": "joyce",
"memo": "",
"updateTime": "2021-10-08 09:42:17",
"userName": "joyce",
"type": 0,
"operator": "joycechen",
"uid": 38,
"platformKey": "",
"phone": "",
"createTime": "2019-07-26 16:23:25",
"roleName": "cdbi",
"creater": "tiffany",
"reviewStatus": 0,
"email": "ff@can-dao.com",
"status": 1,
"createDate": "2019-07-26"
},
{
"orgNames": [
"【运营商】西贝"
],
"updateDate": "2021-10-08",
"accountName": "davis",
"memo": "",
"updateTime": "2021-10-08 11:33:21",
"userName": "davisshi",
"type": 0,
"operator": "davis",
"uid": 14,
"platformKey": "",
"phone": "",
"createTime": "2019-07-26 10:35:15",
"roleName": "cdbi",
"creater": "admin",
"reviewStatus": 0,
"email": "gg@can-dao.com",
"status": 1,
"createDate": "2019-07-26"
}
]
},
"logId": "9f883193-7a9c-4e71-b4da-e5e76818d1fe",
"msg": "操作成功",
"serverTime": 1634006857029,
"status": 1
}
\ No newline at end of file
import Vue from 'vue'
// import { Message, MessageBox, Loading } from 'element-ui';
// import moment from 'moment'
let loadingInstance = ''
export const Util = {
/**
* 校验手机号码格式
*/
checkPhone: function (mobile) {
let myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/;
return myreg.test(mobile);
},
/**
* 校验固定电话
*/
validationTel: function (tel) {
let reg = /^0[\d]{2,3}-[\d]{7,8}$/;
return reg.test(tel);
},
/**
* 是否特殊字符
*/
isSpecialLetter: function (str) {
let reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]");
return reg.test(str);
},
/**
* 获取当前时间
*/
// getCurrentDate: function () {
// let time = new Date();
// let y = time.getFullYear();
// let m = time.getMonth() + 1;
// let d = time.getDate();
// return {
// date: y + '/' + m + '/' + d
// }
// },
/**
* 获取浏览器参数
*/
getUrlParams: function (name) {
let vars = [],
hash;
let hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (let i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars[name];
},
/**
* 根据当前时间,计算往后30天的日期
*/
getAfterDate: function (day) {//计算往后day天
let date1 = new Date();
let date2 = new Date(date1);
let time = 30;
if (day) {
time = day;
}
date2.setDate(date1.getDate() + time);
let _date = date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate();
return {
date: _date,
year: date2.getFullYear(),
month: date2.getMonth() + 1,
day: date2.getDate()
};
},
/**
* 日期格式转换
*/
// dateFormate: function (str, type) {
// let txt = 'YYYY-MM-DD HH:mm:ss'
// if (!str) {
// return false;
// }
// if (type) {
// txt = type
// }
// let n = new Date(str);
// const m = moment(n).format(txt)
// return m
// },
/**
* 字段截取
*/
cutStr: function (str, num) {
if (!str) {
return ''
}
let m = 10
let n = str
if (num) {
m = num
}
if (str.length > m) {
n = str.slice(0, m) + '...'
}
return n
}
}
export const validationTel = Util.validationTel;
export const checkPhone = Util.checkPhone;
export const Validator = {
/*手机号码格式校验正则*/
PHONEREG: /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/,
/*同时包含字母和数字*/
ISNUMANDLETTERS: /^[a-zA-Z0-9]+$/,
/*特殊字符正则*/
SPECIALLETTER:new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"),
NOSPECIALLETTER:/[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]/,
/*邮箱地址格式正则*/
//EMAILREG:/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/,
EMAILREG:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
/*判断是否为中文*/
ISCHINESE:/^[\u0391-\uFFE5]+$/,
/*不能包含中文 */
ISNOCHINESE:/[^\u4e00-\u9fa5]/,
/*判断是否为英文字母*/
ISENGLISH:/^[a-zA-Z]+$/,
/*是否包含空格*/
ISHAVENULL:/^[^\s]*$/,
/*保留两位小数*/
TWODECIMAL: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
/*判断是否为正整数*/
ISDECIMAL:/^[0-9]*$/,
/**
* 账号管理-手机号码校验
*/
checkPhoneNumber:function(str){
return Validator.PHONEREG.test(str);
}
};
<template>
<div>
<el-dialog :title="title" :visible.sync="isVisible" :before-close="handleClose" :close-on-click-modal="false" :width="width" :show-close="isShowCloseBtn" class="app-dialog">
<!-- :modal-append-to-body="false"
:append-to-body="true" -->
<div class="container">
<slot></slot>
</div>
<div slot="footer">
<slot name="btn-front"></slot>
<el-button @click="handleClose">取消</el-button>
<el-button type="primary" @click="handleConfirm" :loading="btnLoading">{{ btnOkLabel }}</el-button>
<slot name="btn-behind"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'basic-dialog',
props: {
title: {
type: String,
default: ''
},
isShowCloseBtn: {
type: Boolean,
default: false
},
isVisible: {
type: Boolean,
default: false
},
btnOkLabel: {
type: String,
default: '确定'
},
width: {
type: String,
default: '580px'
},
btnLoading: {
type: Boolean,
default: false
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style lang="scss">
.app-dialog {
.el-dialog__header {
padding: 20px 20px 10px;
}
.el-dialog__footer {
padding: 15px;
background: #fff;
}
.el-dialog__body {
padding: 0;
border-top: 1px solid #eaeefb;
border-bottom: 1px solid #eaeefb;
min-height: 250px;
max-height: 636px;
overflow-y: auto;
.container {
> span {
display: block;
}
overflow-y: auto;
// max-height: 638px;
padding: 20px 20px;
}
&::-webkit-scrollbar {
width: 10px;
height: 10px;
}
/*正常情况下滑块的样式*/
&::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
&::-webkit-scrollbar-thumb {
// background-color: rgba(0, 0, 0, 0.2);
background: #e9e8ff;
border-radius: 10px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在滑块上时滑块的样式*/
// &::-webkit-scrollbar-thumb:hover {
// background-color: rgba(0, 0, 0, 0.4);
// box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
// }
/*正常时候的主干部分*/
&::-webkit-scrollbar-track {
border-radius: 10px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}
/*鼠标悬浮在滚动条上的主干部分*/
&::-webkit-scrollbar-track:hover {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.01);
}
}
}
</style>
<template>
<div>
<div class="echart" ref="myChart" :style="{ width: width, height: height }"></div>
</div>
</template>
<script>
export default {
props: {
width: {
type: String,
default: ''
},
height: {
type: String,
default: ''
},
totalData: {
type: Array,
// default: () => []
default() {
return []
}
}
},
data() {
return {
dateArray: [],
customerCount: [], //全部客户
customerRatio: [], //全部环比
entmicroCount: [], //企微客户
entmicroRatio: [] //企微客户环比
}
},
mounted() {
this.$nextTick(() => {
if (this.totalData && this.totalData.length > 0) {
this.dateArray = this.totalData.map(item => item.dateTime) //日期
this.customerCount = this.totalData.map(item => item.newCustomerCount)
this.customerRatio = this.totalData.map(item => item.customerRatio)
this.entmicroCount = this.totalData.map(item => item.newEntmicroCount)
this.entmicroRatio = this.totalData.map(item => item.entmicroRatio)
this.initChart()
}
})
},
watch: {
totalData: {
deep: true,
handler(val) {
this.dateArray = this.totalData.map(item => item.dateTime) //日期
this.customerCount = this.totalData.map(item => item.newCustomerCount)
this.customerRatio = this.totalData.map(item => item.customerRatio)
this.entmicroCount = this.totalData.map(item => item.newEntmicroCount)
this.entmicroRatio = this.totalData.map(item => item.entmicroRatio)
this.initChart()
}
}
},
methods: {
initChart() {
// 基于准备好的dom,初始化echarts实例
let myChart = this.$echarts.init(this.$refs.myChart)
// 绘制图表
myChart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
// toolbox: {
// feature: {
// dataView: { show: true, readOnly: false },
// magicType: { show: true, type: ["line", "bar"] },
// restore: { show: true },
// saveAsImage: { show: true },
// },
// },
legend: {
x: 'center',
y: 'bottom',
// bottom: "bottom",
// textStyle: {
// //图例的公用文本样式。
// fontSize: 14,
// color: "#333",
// },
itemGap: 20, //图例每项之间的间隔。横向布局时为水平间隔,纵向布局时为纵向间隔。
data: ['全部客户', '全部客户环比', '企微客户', '企微客户环比'], //图例的数据数组。
inactiveColor: '#ccc' //图例关闭时的颜色。
},
grid: {
//直角坐标系内绘图网格
bottom: '15%', //grid 组件离容器下侧的距离。
left: '1%',
right: '5%',
containLabel: true //grid 区域是否包含坐标轴的刻度标签。
},
dataZoom: [
//dataZoom 组件 用于区域缩放,从而能自由关注细节的数据信息,或者概览数据整体,或者去除离群点的影响。#bed0f7
{
bottom: '30px',
show: true,
// backgroundColor: '#ff0000',
// borderColor: '#ff0000',
height: '5%',
// borderColor: '#8FDFFE',
// backgroundColor: '#8fdffe99',
handleIcon: 'M512 512m-208 0a6.5 6.5 0 1 0 416 0 6.5 6.5 0 1 0-416 0Z M512 192C335.264 192 192 335.264 192 512c0 176.736 143.264 320 320 320s320-143.264 320-320C832 335.264 688.736 192 512 192zM512 800c-159.072 0-288-128.928-288-288 0-159.072 128.928-288 288-288s288 128.928 288 288C800 671.072 671.072 800 512 800z',
handleColor: '#bed0f7',
handleSize: 20,
handleStyle: {
borderColor: '#bed0f7',
shadowBlur: 4,
shadowOffsetX: 1,
shadowOffsetY: 1,
shadowColor: '#e5e5e5'
},
start: 0,
end: 100
},
{
type: 'inside',
start: 0,
end: 100
}
],
xAxis: [
{
type: 'category',
data: this.dateArray, //['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '单位:人',
// min: 0,
// max: 35000,
// interval: 5000,
axisLabel: {
formatter: '{value}'
},
splitLine: {
show: true //是否显示分割线
}
},
{
type: 'value',
name: '环比(%)',
// min: "-20",
// max: "20",
// interval: 10,
axisLabel: {
formatter: '{value}'
},
splitLine: {
show: true //是否显示分割线
}
}
],
series: [
{
name: '全部客户',
type: 'bar',
data: this.customerCount, //[33600, 18000, 17500, 20000, 17000, 480, 1000, 800, 520, 650, 920, 600],
label: {
show: true,
// formatter: '{b}: {c}',
color: '#666666',
position: 'top'
},
itemStyle: {
color: '#5850ff'
}
},
{
name: '全部客户环比',
type: 'line',
yAxisIndex: 1,
data: this.customerRatio, //[2.0, 2.2, -3.3, 4.5, 6.3, -10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2],
itemStyle: {
color: '#5850ff'
}
},
{
name: '企微客户',
type: 'bar',
data: this.entmicroCount, //[22000, 10000, 10000, 13000, 11500, 4000, 7000, 6500, 4500, 5500, 7000, 6000],
itemStyle: {
color: '#FE9C1C'
},
label: {
show: true,
color: '#666666',
position: 'top'
}
},
{
name: '企微客户环比',
type: 'line',
yAxisIndex: 1,
data: this.entmicroRatio, //[2.6, 2.2, 3.0, 3.8, 6.8, 10.9, 18.3, 23.0, 23.9, 16.0, 10.0, 8.2],
itemStyle: {
color: '#FE9C1C'
}
}
]
})
}
}
}
</script>
<style lang="scss" scoped></style>
<template>
<div>
<div class="echart" ref="myChart" :style="{ width: width, height: height }"></div>
</div>
</template>
<script>
export default {
props: {
width: {
type: String,
default: ''
},
height: {
type: String,
default: ''
},
entmicroAddCustomerCount: {
type: Number,
default: 0
},
entmicroNotAddCustomerCount: {
type: Number,
default: 0
}
},
mounted() {
this.initChart()
},
methods: {
initChart() {
// 基于准备好的dom,初始化echarts实例
let myChart = this.$echarts.init(this.$refs.myChart)
// 绘制图表
var option
var spirit =
'path://M 254.911 16.6565 C 253.775 16.1755 253.241 15.6256 249.786 15.0415 C 249.419 14.9556 249.052 14.8525 248.684 14.7322 C 248.017 14.3027 247.817 13.392 248.234 12.7048 C 248.301 12.5845 248.401 12.4814 248.501 12.3783 C 248.985 11.8629 249.369 11.2615 249.636 10.5915 C 249.786 10.2135 249.92 9.8011 250.053 9.37157 L 250.087 9.44029 C 250.287 9.54338 250.437 9.42311 250.571 9.21693 C 250.971 8.44376 251.238 7.58468 251.372 6.72561 C 251.439 6.4507 251.272 6.1758 251.005 6.10707 C 250.938 6.08989 250.854 6.08989 250.788 6.10707 L 250.688 6.15862 C 250.704 5.93526 250.721 5.7119 250.721 5.48854 C 250.871 2.61922 248.718 0.162258 245.93 0.00762427 C 243.143 -0.14701 240.756 2.06941 240.606 4.93873 C 240.606 5.07618 240.589 5.23081 240.606 5.36827 C 240.606 5.62599 240.622 5.90089 240.639 6.15862 L 240.522 6.10707 C 240.255 6.05553 239.988 6.24452 239.938 6.51943 C 239.921 6.58816 239.921 6.67406 239.938 6.74279 C 240.072 7.61905 240.339 8.46094 240.739 9.23411 C 240.873 9.44029 241.04 9.56056 241.223 9.45747 L 241.29 9.3372 C 241.407 9.74956 241.54 10.1447 241.674 10.5055 C 241.908 11.1756 242.275 11.7942 242.742 12.3096 C 243.377 12.8251 243.477 13.7529 242.976 14.4058 C 242.876 14.5432 242.759 14.6463 242.625 14.7322 C 241.974 15.0243 237.217 15.9693 236.466 16.5363 C 235.331 17.8764 234.496 19.4915 234.029 21.2268 C 233.929 21.5361 234.096 21.8625 234.396 21.9656 C 234.463 21.9828 234.513 22 234.58 22 L 257.481 22 C 257.748 21.8282 258.082 21.7595 257.982 21.3815 C 257.615 20.0928 256.346 18.0654 254.911 16.6565 Z'
var maxData = this.entmicroAddCustomerCount + this.entmicroNotAddCustomerCount
option = {
tooltip: {},
xAxis: {
max: maxData, // 以x轴为基准,进行象形图的重复画图,最大值为100(可调整),为了下方好处理我调整为100
splitLine: { show: false }, // x轴 轴线什么的都不需要
axisLabel: { show: false },
axisTick: { show: false },
axisLine: { show: false },
offset: 10
},
yAxis: {
data: [], // 必须给data一个[],删掉会出错,具体原因是因为x,y轴都必须存在
// 但我们在x轴重复图片,而不是y轴;但是y轴也不能展示出轴线、数据什么的
show: false
},
grid: {
top: 'bottom',
height: 100,
left: 55,
right: 155
},
series: [
{
type: 'pictorialBar', // 代表女生的图
itemStyle: {
normal: {
color: '#716AFF ' // 颜色设置为蓝色,可调整
}
},
symbol: spirit, // 象形图的svg,上面定义了
symbolMargin: '25%', // 边距
symbolSize: ['25%', '25%'], // [宽,高], 依据symbolBoundingData的值来计算的,重复次数是根据symbolMargin,symbolSize来的,例子中我已经调成10个人
symbolBoundingData: maxData, // 上面我定义成了maxData = 100,如果要保持男女一致,男方那边的symbolBoundingData与女方保持一致
data: [
{
value: this.entmicroAddCustomerCount, // x轴最大为10000,value为7000,那么女生占70%(即7个粉红人) 如果改成75等等也会进行处理,也就是75%,但下方的男生就是25
symbolClip: true, // 这个的意思是60只是我设置的maxData中的一部分,不是全部
symbolRepeat: true // 图像重复
}
],
z: 10 // 层级更高(女生的60,会显示在上层,肉眼就是粉色60%,你可以注释层级试试)
},
{
type: 'pictorialBar', // 这是控制蓝色的男生的,由于你本身的svg是蓝色,这边没有改成其他颜色,如果需要展示别的颜色,你跟上边女生那样处理
itemStyle: {
normal: {
color: '#FE9C1C' // 颜色设置为黄色,可调整
}
},
animationDuration: 0, // 展示男生图的动画延迟时间,建议你单独注释掉看看效果
symbolMargin: '25%',
symbol: spirit,
symbolSize: ['25%', '25%'], // [宽,高], 依据symbolBoundingData的值来计算的,为了显示的跟女生那边的大小一样,需要设置成一致。包括边距
symbolBoundingData: maxData, // 同上需要设置成一样的symbolBoundingData
data: [
{
value: this.entmicroNotAddCustomerCount, // value为3000,男生占30%
symbolRepeat: 'fixed'
}
],
z: 5 // 层级更低
}
]
}
option && myChart.setOption(option)
}
}
}
</script>
<style lang="scss" scoped></style>
<template>
<div class="contain">
<!-- :style="{ width: width, height: height }" -->
<div class="echart" ref="myChart" :style="{ width: width, height: height }"></div>
</div>
</template>
<script>
export default {
props: {
width: {
type: String,
// default: () => {
// return "";
// },
default: ''
},
height: {
type: String,
default: ''
},
topDataObj: {
type: Object,
default: () => {}
}
},
data() {
return {
pieData: [
{ value: 0, name: '未加企微' },
{ value: 0, name: '已加企微' }
]
}
},
mounted() {
this.$nextTick(() => {
console.log(this.topDataObj, '饼图')
this.pieData[0].value = this.topDataObj.entmicroNotAddCustomerCount
this.pieData[1].value = this.topDataObj.entmicroAddCustomerCount
this.initChart()
})
},
methods: {
initChart() {
// 基于准备好的dom,初始化echarts实例
let myChart = this.$echarts.init(this.$refs.myChart)
// 绘制图表
myChart.setOption({
/* title: {
text: '客户总数',
subtext: '已加和未加企微的所有潜客和已购买客户',
left: '20',
top: '20',
textStyle: {
},
subtextStyle: {
fontSize: '12px',
fontWeight: '400',
color: '#808080'
}
},*/
tooltip: {
trigger: 'item', //模板变量有 {a}、{b}、{c}、{d},分别表示系列名,数据名,数据值,百分比。{d}数据会根据value值计算百分比
formatter: '{b} : {c}人 ({d}%)'
},
color: ['#FE9C1C ', '#716AFF'],
// legend: {
// orient: "vertical",
// bottom: "bottom",
// },
series: [
{
name: '客户总数',
type: 'pie',
radius: '91.5px',
center: ['50%', '65%'],
stillShowZeroSum: false,
data: this.pieData,
// data: [
// { value: 3000, name: '未加企微' },
// { value: 7000, name: '已加企微' }
// ],
// emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
//下面控制显示饼状图上百分比
normal: {
// color: function (params) {
// //自定义颜色
// var colorList = [
// "#00FFFF",
// "#00FF00"
// ];
// return colorList[params.dataIndex];
// },
label: {
position: 'inner',
formatter: '{d}%',
show: true,
color: '#fff'
// formatter: "{b}:\n{c}人({d}%)",
// fontWeight: "bold",
// color:'red'
// color: ["#1296db", "#d42378"],
},
labelLine: { show: true }
}
}
// },
}
]
})
}
}
}
</script>
<style lang="scss" scoped>
.contain {
position: relative;
z-index: 9;
}
</style>
/**
* type : primary,success,default,error,danger
* size: 按钮大小,参照elementui
* id: 权限判断id
* mode:按钮类型 是a标签还是button,可选值为:button、link
*/
import { Button, Link } from 'element-ui'
// 权限校验
function judgePermissions(options) {
if (!options) {
return false
}
let _list = options.parent.permissions || []
let _o = options.props
let idx = _list.findIndex(k => k == _o.id)
// 如果没有权限,则返回空标签
if (idx < 0) {
return ''
}
if (_o.mode == 'link') {
return 'a'
}
return 'button'
}
// 获取class
function getClass(context) {
let o = context.props
let _class = []
_class.push('el-' + o.mode)
_class.push('el-' + o.mode + '--' + o.type)
if (o.size) {
_class.push('el-' + o.mode + '--' + o.size)
}
if (o.class) {
_class.push(o.class)
}
return _class
}
export default {
functional: true,
props: {
type: {
type: String,
default: 'default'
},
size: {
type: String,
default: 'medium'
},
id: {
type: [String, Number]
},
mode: {
type: String,
default: 'button'
},
class: {
type: String,
default: ''
}
},
render: function(createElement, context) {
let _props = context.props
let options = {
props: _props,
attrs: context.props,
class: getClass(context),
on: {
click: event => {
context.listeners.click('click', event)
}
}
}
return createElement(judgePermissions(context), options, context.children)
}
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-06 10:10:44
* @LastEditors: limin
* @LastEditTime: 2021-09-06 10:11:49
* @FilePath: \scrm\scrm-sub-blog\src\components\index.js
*/
import Vue from 'vue'
// 导入权限按钮
import _button from '@/components/glsx-button/index'
Vue.component('glsx-button', _button)
Vue.component('search-form', () => import('./search-form/index.vue'))
Vue.component('basic-dialog', () => import('./basic-dialog/index.vue'))
Vue.component('rule-form', () => import('./rule-form/index.vue'))
\ No newline at end of file
<template>
<div class="scrm-sub-client-container">
<!-- 有图标无数据文字情况 -->
<div class="nodata" v-if="type=='hasIconText'">
<img src="@/assets/clientDataOverview/nodata.png" alt="">
<p>暂无数据</p>
</div>
<!-- 没有图标有无数据文字 -->
<div class="nodata" v-if="type=='hasText'">
<p>暂无数据</p>
</div>
</div>
</template>
<script>
export default {
props: {
type: {
type: String,
default: ''
},
},
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container{
.nodata{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
z-index: 9;
p{
height: 22px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #000000;
line-height: 22px;
}
}
}
</style>
\ No newline at end of file
<template>
<div>
<el-form
:model="ruleForm"
:rules="rules"
:label-position="labelPosition"
:label-width="labelWidth"
:size="size"
>
<el-form-item
v-for="(item, index) in ruleData"
:key="index"
:label="item.label"
:prop="item.prop || ''"
:class="item.class"
v-show="!item.hidden"
>
<template slot-scope="scope">
<template v-if="item.type === 'input'">
<el-input
v-if="item.clickFunc"
:type="item.inputText || 'text'"
:readonly="item.readonly || false"
@click.native="item.clickFunc"
:class="item.clickFunc ? 'pointer' : ''"
:ref="item.ref"
v-model="ruleForm[item.prop]"
@input="update($event)"
>
</el-input>
<el-input
v-else
:type="item.inputText || 'text'"
:readonly="item.readonly || false"
:disabled="item.disabled || false"
v-model="ruleForm[item.prop]"
:maxlength="item.maxlength"
:minlength="item.minlength"
:placeholder="item.placeholder || '请输入' "
:show-password="item.showPassword || false"
:clearable="item.clearable"
:show-word-limit="item.showWordLimit || false"
>
</el-input>
</template>
<template v-else-if="item.type == 'select'">
<el-select
v-if="item.visibleFunc"
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false"
@change="selectChange"
@visible-change="item.visibleFunc"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
<el-select
v-else
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false"
@change="selectChange"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
</template>
<template v-else-if="item.type === 'switch'">
<el-switch
v-model="ruleForm[item.prop]"
:active-text="item.activeText || '开'"
:inactive-text="item.inactiveText || '关'"
></el-switch>
</template>
<template v-else-if="item.type === 'radio'">
<el-radio-group
@change="radioChange($event,item.prop)"
v-model="ruleForm[item.prop]"
:disabled="item.disabled"
>
{{ruleForm[item.prop]}}
<el-radio
v-for="(child,childIndex) in item.children"
:key="childIndex"
:label="childIndex"
>{{child}}</el-radio>
</el-radio-group>
<el-select
v-if="item.hasSelect"
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
@change="selectChange"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
</template>
<template v-else-if="item.type == 'customize'">
<slot
:scope="scope"
:name="item.slotName"
>
</slot>
</template>
</template>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'rule-form',
data() {
return {
// labelPosition: 'left'
}
},
props: {
// 表单数据
ruleData: {
type: Array,
default: () => {
return []
}
},
// 表单model
ruleForm: {
type: Object,
default: () => {
return {}
}
},
// 表单验证规则
rules: {
type: Object,
default: () => {
return {}
}
},
// 标签位置
labelPosition: {
type: String,
default: 'right'
},
size: {
type: String,
default: 'small'
},
labelWidth: {
type: String,
default: '100px'
}
},
mounted() {
},
methods: {
selectChange(val) {
this.$emit('selectChange', val)
},
radioChange(event, prop) {
this.$emit('radioChange', event, prop)
},
update(e) {
this.$forceUpdate()
}
}
}
</script>
<style lang="scss">
.pointer input {
cursor: pointer;
}
</style>
\ No newline at end of file
<template>
<div>
<el-form class="clearfix search-form" id="searchForm" :class="[expande ? 'expande' : 'close']" :model="formModel" :size="size" @submit.native.prevent :label-position="labelPosition" :label-width="labelWidth">
<!-- <div class="expande-button-wrap" @click="openClose">
<i class="el-icon-arrow-down"></i>
<span v-if="expande">展开</span>
<span v-else>收起</span>
</div> -->
<div class="expande-button-wrap" v-if="needShowExpande">
<div class="expande-button" @click="expandeClick" v-if="!expande">
<i class="el-icon-arrow-down"></i>
<span>展开</span>
</div>
<div class="expande-button" @click="expandeClick" v-else>
<i class="el-icon-arrow-up"></i>
<span>收起</span>
</div>
</div>
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''">
<template>
<template v-if="item.type === 'input'">
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :readonly="item.readonly || false" @keyup.enter.native="onInput"></el-input>
</template>
<template v-else-if="item.type === 'select'">
<el-select v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'">
<el-option v-for="i in item.options" :key="i[item.value] || i.value" :label="i[item.key] || i.label" :value="i[item.value] || i.value" :disabled="i.disabled"></el-option>
</el-select>
</template>
<template v-else-if="item.type === 'daterange'">
<el-date-picker v-model="formModel[item.prop]" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="item.pickerOptions || {}"></el-date-picker>
</template>
</template>
</el-form-item>
<el-form-item>
<template>
<slot name="form-slot"></slot>
</template>
</el-form-item>
<el-form-item>
<template>
<slot name="formsearch-slot"></slot>
</template>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'search-form',
props: {
formModel: {
type: Object,
default: () => {}
},
size: {
type: String,
default: 'small'
},
formList: {
type: Array,
default: () => []
},
labelPosition: {
type: String,
default: 'left'
},
labelWidth: {
type: String,
default: 'auto'
}
},
data() {
return {
expande: true,
needShowExpande: false,
FormHeight: 0
}
},
mounted() {
console.log('搜索表单')
this.$nextTick(() => {
let lineHeight = 75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
console.log('第一次searchForm高度', document.getElementById('searchForm').offsetHeight)
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
setTimeout(() => {
this.$emit('setTableHeightEvent')
}, 200)
})
var that = this
window.onresize = () => {
return (() => {
that.FormHeight = document.getElementById('searchForm').offsetHeight
// console.log(that.FormHeight, '窗口这里')
})()
}
},
watch: {
FormHeight: {
handler(val) {
let lineHeight = 75 //22
if (val > lineHeight * 2) {
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
}
}
},
methods: {
onInput(e) {
this.$emit('input', e)
},
// openClose(){
// console.log( document.getElementById('searchForm').offsetHeight);
// document.getElementById('searchForm').offsetHeight=172;
// }
expandeClick() {
console.log('expandeClick')
this.expande = !this.expande
setTimeout(() => {
this.$emit('setTableHeightEvent')
}, 200)
}
}
}
</script>
<style lang="scss">
.search-form {
padding: 18px 25px 0 0;
position: relative;
overflow: hidden;
// height: 50px;
.expande-button-wrap {
position: absolute;
right: 0;
z-index: 99;
.expande-button {
color: #5850ff;
cursor: pointer;
i {
height: 8px;
}
span {
height: 20px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
}
}
}
.el-form-item {
display: inline-block;
// float: left;
// width: calc(50% - 20px);
// max-width: 300px;//420
margin-right: 15px;
}
.el-range-editor--small.el-input__inner {
width: 215px;
}
.el-input--small .el-input__inner {
width: 215px;
}
.el-form-item__content {
// width: 100%;
}
}
.expande {
overflow: auto;
height: auto;
// padding-bottom: 22px;
}
.close {
overflow: hidden;
height: 50px;
// padding-bottom: 0;
}
</style>
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-08 16:55:43
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
const environment = process.env.NODE_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-18 11:51:29
* http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/ 冯支:http://192.168.1.74:8089
*/
// 本地环境配置
module.exports = {
title: 'scrm-sub-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
code_message_map: {}
},
// 王小龙:http://192.168.2.108:8091/rop-scrm-datahub 冯支:http://192.168.3.191:8064/rop-scrm-entmicro/
/* 开发环境的域名:http://scrm.dev.glsx.com.cn/rop-scrm-datahub
http://scrm.dev.glsx.com.cn/rop-scrm-entmicro
*/
request: {
baseURL: 'http://192.168.3.191:8064/rop-scrm-entmicro/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: 'client-sub-custom'
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
module.exports = {
title: 'scrm-sub-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
code_message_map: {}
},
request: {
baseURL: 'http://192.168.3.171:7300/mock/6136bea6ceeb5a5c2bec6950/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-07 14:38:52
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:31
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
import apis from './api'
import './public-path'
import './components'
// import 'glsx-components/dist/glsx-components.css'
import './styles/index.scss'
import { start } from '@/setup'
import glsxTable from 'glsx-table';
import { message } from './plugins/element.js'
import filters from '@/utils/filters'
import * as echarts from 'echarts'
import { Constants } from './common/constants'
import { Util } from './common/util'
import { common } from './common/common'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.use(glsxTable);
Vue.prototype.$message = message
// Vue.prototype.btn_size = 'mini'
Vue.prototype.$Constants = Constants
Vue.prototype.$Utils = Util
Vue.prototype.$Commons = common
Vue.prototype.$echarts = echarts
//过滤器统一处理预加载
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-09-14 09:34:52
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
import App from './App.vue'
import glsxTable from 'glsx-table';
import './public-path'
import './components'
import apis from './api'
import store from './store'
import './styles/index.scss'
import { VueRouter, routes as staticRoutes, getRoutes } from './router'
import { message } from './plugins/element.js'
// 初始化请求参数
import { fetchConfig } from '@/config/index'
import filters from '@/utils/filters'
import * as echarts from 'echarts'
import { Constants } from './common/constants'
import { Util } from './common/util'
import { common } from './common/common'
import { GLButton } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
Vue.use(glsxTable);
Vue.prototype.$message = message
Vue.prototype.btn_size = 'mini'
Vue.prototype.$Constants = Constants
Vue.prototype.$Utils = Util
Vue.prototype.$Commons = common
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
//过滤器统一处理预加载
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
let instance = null
let router = null
export async function bootstrap({ history, common, messenger, globalState }) {
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
}
async function singleRender() {
const { response, request, sign, secret } = await fetchConfig()
const http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: '1112223333444' } })
await _render(http, staticRoutes, '/')
}
async function qiankunRender(props = {}) {
const { response, request, sign, secret } = await fetchConfig()
const { name, id, globalState, routerBase, common } = props
const routes = getRoutes({ name, id, routesData: common.utils.deepClone(globalState.routers) })
const http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
await _render(http, routes, routerBase, globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'])
}
async function _render(http, routes, base, permissions) {
Vue.prototype.$http = http
Vue.prototype.$apis = apis
Vue.use(GLButton, { permissions })
router = new VueRouter({
base,
routes,
mode: 'history'
})
instance = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
}
// 独立运行时
if (!window.__POWERED_BY_QIANKUN__) {
singleRender()
}
export async function mount(props = {}) {
await qiankunRender(props)
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
router = null
}
export const http = params => instance.$http(params)
\ No newline at end of file
File mode changed
let BASE_URL = 'http://192.168.1.74:8089/rop-scrm-entmicro'
const TIME_OUT = 5000
if (process.env.NODE_ENV === 'development') {
// BASE_URL = '/api'
} else if (process.env.NODE_ENV === 'production') {
// BASE_URL = 'http://coderwhy.org/prod'
} else {
// BASE_URL = 'http://coderwhy.org/test'
}
export { BASE_URL, TIME_OUT }
\ No newline at end of file
import { request } from "./request"
//http://ip:port/Base URL/router?method=******&format=json&appKey=******&v=1.0.*×tamp=1654487354&source=******&sign=sdf9787dfs87987sf9879sdf87sdf&业务参数1=**** ...... &业务参数N=******
const commonUrl='&format=json&appKey=48e5e13229b82c1b4e6e8c96151f0637&v=1.0.*×tamp=1654487354&source=sub-client-custom&sign=sdf9787dfs87987sf9879sdf87sdf'
function GETCLIENTTABLELIST(){
return request({
url: '/router'+'?method=org.ore.api.customer.page'+commonUrl,
// params:{
// method:'GET',
// }
})
}
// const GETLISTDEVICEFILEUNSTOCK = params => {
// return window.$http({
// url: 'deviceInfo/listDeviceFileUnstock',
// method: 'POST',
// data: params,
// sign: true
// })
// }
export {
GETCLIENTTABLELIST
}
\ No newline at end of file
import { request } from "./request"
export function getDetail(iid) {
return request({
url: '/detail',
params: {
iid
}
})
}
export function getRecommend(){
return request({
url:'/recommend',
})
}
export class Goods {
constructor(itemInfo, columns, services) {
this.title = itemInfo.title
this.desc = itemInfo.desc
this.newPrice = itemInfo.newPrice
this.oldPrice = itemInfo.oldPrice
this.discount = itemInfo.discountDesc
this.columns = columns
this.services = services
this.realPrice = itemInfo.lowNowPrice
}
}
//这样我们就可以将三个地方的数据整合到一个对象了
// const g=new Goods()
// g.title
// g.desc
// g.
export class Shop {
constructor(shopInfo) {
this.logo = shopInfo.shopLogo;
this.name = shopInfo.name;
this.fans = shopInfo.cFans;
this.sells = shopInfo.cSells;
this.score = shopInfo.score;
this.goodsCount = shopInfo.cGoods
}
}
export class GoodsParam {
constructor(info, rule) {
//注:images可能没有值
this.image = info.images ? info.images[0] : '';
this.infos = info.set;
this.sizes = rule.tables;
}
}
import { request } from './request'
export function getHomeMultidata() {
return request({
url: '/home/multidata'
})
}
//这里也封装一下,请求 流行,新款 ,精选 的数据
export function getHomeGoods(type, page) {
return request({
url: '/home/data',
//?type=new&page=1用下面的传进来 123.207.32.32:8000/home/data?type=new&page=1
params: {
type,
page
}
})
}
/* let totalNums = []
const nums1 = [20, 11, 222] 怎么把这个数组的东西塞到上面那个数组中?
const nums2=[111,22,333] */
// 方式一(一般)
// for(let n of nums1)
// {
// totalNums.push(n)
// }
// totalNums.push(...nums1)会将nums1中的数据依次解析出来,交到totalNums中(...参数)...代表可输入多个参数
\ No newline at end of file
import axios from "axios";
// import { BASE_URL, TIME_OUT } from './config'
// import { checkStatus} from '../utils/checkStatus';
export function request(config) {
//1.创建axios的实例 "http://152.136.185.210:8000/api/w6"
const instance = axios.create({
baseURL: "http://192.168.1.74:8089/rop-scrm-entmicro",
timeout: 5000
});
// 统一设置post请求头
instance.defaults.headers.post['Content-Type'] = 'application/json'
//2.axios的拦截器
//2.1.请求拦截的作用
instance.interceptors.request.use(
config => {
//console.log(config);
//1.比如config中的一些信息不符合服务器的要求
//2.比如每次发送网络请求时,都希望在界面中显示一个请求的图标
//3.某些网络请求(比如登录(token)),比如携带一些特殊的信息
// showLoading(true);
// config.headers['Authorization'] = localStorage.getItem('token') || ''
return config;
},
err => {
// showLoading(false);
console.log('请求错误,原因:', err)
}
);
//2.2.响应拦截
instance.interceptors.response.use(
res => {
// // showLoading(false);
// const serverCode = res.data.code
// // const token = res.headers['authorization'];
// if (serverCode === 200 || res.status === 200) {
// if (serverCode !== 200) {
// // checkStatus(serverCode);
// }
// if (res.status) {
// return Promise.resolve(res);
// }
// return Promise.resolve(res.data);
// } else {
// // checkStatus(serverCode);
// return Promise.reject(res.data.message)
// }
return res.data;
},
err => {
// showLoading(false);
console.log(err);
}
);
//3.发送真正的网络请求
return instance(config);
}
import sha1 from 'sha1'
import qs from 'qs'
const secret = window.location.href.includes('dj.glsx.com.cn') ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = []) => {
delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), { arrayFormat: 'indices', encode: false, allowDots: true })
var objVal = objStr.split('&')
var realObj = {}
objVal.forEach(item => {
realObj[item.split('=')[0]] = item.split('=')[1]
})
const keys = Object.keys(realObj).sort()
var str = []
var obj = null
for (const key in realObj) {
obj = realObj[key]
if (obj === null) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
realObj[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
realObj.sign = sha1(secret + str.join('') + secret).toUpperCase()
return realObj
}
export default sign
\ No newline at end of file
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree,Row,Table,TableColumn,Dialog,Pagination,Loading,Tooltip } from 'element-ui'
Vue.use(Button)
Vue.use(ButtonGroup)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Radio)
Vue.use(RadioGroup)
Vue.use(Checkbox)
Vue.use(CheckboxGroup)
Vue.use(Switch)
Vue.use(Select)
Vue.use(Option)
Vue.use(TimePicker)
Vue.use(Col)
Vue.use(DatePicker)
Vue.use(Tree)
Vue.use(Row)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Dialog)
Vue.use(Pagination)
Vue.use(Loading)
Vue.use(Tooltip)
export const message = Message
if (window.__POWERED_BY_QIANKUN__) {
// eslint-disable-next-line no-undef
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
Vue.use(VueRouter)
// 处理重复点击同一个路由报错的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
// function getRoutes({ name, id, routesData }) {
// const routes = []
// if (routesData && name && id) {
// for (let i = 0, length = routesData.length; i < length; i += 1) {
// const element = routesData[i]
// if (element.path && element.path.includes(name) && element.meta && element.meta.id && element.meta.id.startsWith(id)) {
// const path = element.path.slice(name.length + 1)
// element.path = path
// element.component = () => import('@/views' + path + '.vue')
// routes.push(element)
// }
// }
// }
// return routes
// }
function getRoutes(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.path + '.vue') })
return routes
}, [])
}
export {
VueRouter,
routes,
getRoutes
}
const staticRoutes = Object.freeze([
{
name: 'Home',
path: '/',
meta: {},
component: resolve => require([`@/views/home/index.vue`], resolve)
},
{
name: 'About',
path: '/about',
component: resolve => require([`@/views/about/index.vue`], resolve),
meta: {}
},
{
name: 'clientDataOverview',
path: "/clientDataOverview/index",
component: resolve => require([`@/views/clientDataOverview/index.vue`], resolve),
meta: {}
},
{
name: 'clientManage',
path: "/clientManage/index",
component: resolve => require([`@/views/clientManage/index.vue`], resolve),
meta: {}
},
{
name: 'clientDetail',
path: "/clientManage/clientDetail",
component: resolve => require([`@/views/clientManage/clientDetail.vue`], resolve),
meta: {}
},
{
name: 'clientDemo',
path: "/clientManage/clientDemo",
component: resolve => require([`@/views/clientManage/demo.vue`], resolve),
meta: {}
},
{
name: 'clientGroupManage',
path: "/clientGroupManage/index",
component: resolve => require([`@/views/clientGroupManage/index.vue`], resolve),
meta: {}
},
{
name: 'clientGroupDetail',
path: "/clientGroupManage/clientGroupDetail",
component: resolve => require([`@/views/clientGroupManage/clientGroupDetail.vue`], resolve),
meta: {}
},
{
name: 'tagsManage',
path: "/tagsManage/index",
component: resolve => require([`@/views/tagsManage/index.vue`], resolve),
meta: {}
},
{
name: 'expand',
path: "/expand/index",
component: resolve => require([`@/views/expand/index.vue`], resolve),
meta: {}
},
])
export default staticRoutes
// {
// path: "/clientMassTexting",
// name: "clientMassTexting",
// meta: { title: "客户群发" },
// hidden: true,
// keepAlive: false,
// component: () => import("../views/clientMassTexting/index.vue"),
// },
// {
// path: "/clientMassTexting/addMassTexting",
// name: "addMassTexting",
// meta: { title: "新增群发" },
// hidden: true,
// keepAlive: false,
// component: () => import("../views/clientMassTexting/addMassTexting.vue"),
// },
// {
// path: "/clientMassTexting/detailMassTexting",
// name: "detailMassTexting",
// meta: { title: "群发详情" },
// hidden: true,
// keepAlive: false,
// component: () => import("../views/clientMassTexting/detailMassTexting.vue"),
// },
// {
// path: "/clientPartGroup",
// name: "clientPartGroup",
// meta: { title: "客户分群" },
// hidden: true,
// keepAlive: false,
// component: () => import("../views/clientPartGroup/index.vue"),
// },
// {
// path: "/crowdCircleImage",
// name: "crowdCircleImage",
// meta: { title: "人群圈像" },
// hidden: true,
// keepAlive: false,
// component: () => import("../views/clientPartGroup/crowdCircleImage.vue"),
// },
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:31:52
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:09
* @FilePath: \scrm\scrm-sub-blog\src\setup\index.js
*/
import { bootstrap, mount, unmount } from './qiankun'
import { start } from './single'
export { bootstrap, mount, unmount, start }
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import ElementUI from 'element-ui'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import render from './render'
Vue.use(ElementUI)
Vue.use(GLTable)
import 'glsx-components/dist/glsx-components.css'
let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) {
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
//Vue.use(GLButton, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
// { name, id, }
subscribe({ messenger })
}
export async function mount(props) {
const insts = render(props.routerBase, routes)
router = insts.router
instance = insts.vm
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
router = null
}
function subscribe({ messenger }) {
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:04:32
* @LastEditors: limin
* @LastEditTime: 2021-09-23 20:34:32
* @FilePath: \scrm\scrm-sub-blog\src\qiankun\render.js
*/
import App from '../App.vue'
import Vue from 'vue'
import store from '@/store'
import { VueRouter } from '@/router'
const render = (base, routes) => {
const router = new VueRouter({
base,
routes,
mode: 'history'
})
const vm = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
return { router, vm }
}
export default render
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:02:23
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:17
* @FilePath: \scrm\scrm-sub-blog\src\setup\single.js
*/
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: 'mini-a9edd006-4600-47a3-834e-d9915dd082ad-rop' } })
Vue.use(GLButton,GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-08-25 14:14:44
* @FilePath: \scrm\scrm-base\src\store\index.js
*/
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce(
(result, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
result.getters[moduleName] = state => state[moduleName]
result.modules[moduleName] = value.default
return result
},
{ modules: {}, getters: {} }
)
const store = new Vuex.Store(modules)
export default store
export default {
namespaced: true,
state: {
size: 10, // 分页 页大小
token: ''
},
mutations: {
// 设置分页大小
SET_PAGE_SIZE(state, data) {
state.size = data
},
// 设置token
SET_TOKEN(state, data) {
state.token = data
}
},
actions: {
// 设置分页大小
setPageSize({ commit }, data) {
commit('SET_PAGE_SIZE', data)
},
// 设置token
setToken({ commit }, data) {
commit('SET_TOKEN', data)
}
}
}
export default {
namespaced: true,
state: {},
mutations: {},
actions: {}
}
.inline-b {
display: inline-block;
}
.pull-right {
float: right;
}
.green-text {
color: #00A854;
}
.red-text {
color: rgb(255, 0, 0);
}
.blue-text{
color:$btnBlue;
&:hover{
color: #9994FF;
}
}
.pure-blue-text{
color:$btnBlue;
}
.green {
background-color: #00A854;
}
.red {
color: rgb(255, 0, 0);
}
.additional-text{
height: 22px;
font-size: 16px;
font-weight: 400;
color: #666666;
line-height: 22px;
}
.btn-blue {
height: 32px;
background: $btnBlue;
border-radius: 4px;
color: #fff;
font-size: 14px;
font-weight: 400;
color: #FFFFFF;
padding: 6px 27px;
}
// 单行省略
.ellipsis-1 {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
/* for Opera */
}
// 我这里以两行为例,该方法基本兼容市场上面所有主流浏览器。
.ellipsis-2 {
overflow: hidden;
height: 40px;
line-height: 20px;
position: relative;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*显示的行数*/
}
.ellipsis-2-text:after {
content: "...";
position: absolute;
bottom: 0;
right: 15px;
padding-left: 20px;
background: -webkit-linear-gradient(left, transparent, #fff 55%);
/*我在Safari上测试时发现透明到白色中间会有一个黑色的过渡后来我就写成-webkit-linear-gradient(left,rgba(255,255,255,0),rgba(255,255,255,1) 55%)*/
background: -o-linear-gradient(left, transparent, #fff 55%);
background: -moz-linear-gradient(left, transparent, #fff 55%);
background: linear-gradient(to right, transparent, #fff 55%);
}
.statusText {
vertical-align: middle;
}
\ No newline at end of file
@import './variables.scss';
@import './common.scss';
@import './resetelement.scss';
body {
padding: 0;
margin: 0;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
background-color: $bgColor;
// overflow: auto !important;
}
body,html{
width:100%;
height:100%;
margin:0;
padding:0;
overflow: hidden;
}
#app {
height: 100%;
overflow: auto;
}
// html, body, #app {
// width: 100%;
// height: 100%;
// }
// 默认去掉所有p元素的上下边距
p{
margin-top: 0;
margin-bottom: 0;
}
button{
border: none;
&:hover{
cursor: pointer;
}
}
// 子系统不设外边距
.scrm-sub-client-container{
padding: 20px;
}
\ No newline at end of file
.el-select {
width: 100%;
}
.el-pagination {
display: flex;
margin-top: 18px;
}
.glsx-table .el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: $btnBlue;
color: #fff;
}
.el-dialog__header .el-dialog__title {
height: 28px;
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 28px;
}
.el-dialog__footer {
.el-button+.el-button {
margin-left: 20px;
}
.el-button {
font-size: 14px;
font-weight: 400;
padding: 9px 21px;
background: $btnBlue;
border-radius: 4px;
}
.el-button:first-child {
background: #ffffff;
border-radius: 4px;
border: 1px solid #999999;
box-sizing: border-box;
font-weight: 600;
color: #999999;
&:hover{
border-color: $btnBlue;
color: $btnBlue;
}
}
.el-button:nth-child(2){
height: 32px;
background: $btnBlue;
border: 1px solid $btnBlue;
color: #fff;
border:1px solid $btnBlue;
&:hover{
background-color: $lightBtnBlue;
border:1px solid $lightBtnBlue;
}
}
.el-button:nth-child(3){
background: #ffffff;
border: 1px solid #999999;
box-sizing: border-box;
font-weight: 600;
color: #999999;
&:hover{
border-color: $btnBlue;
color: $btnBlue;
}
}
}
/deep/ .el-input__inner:focus{border-color:$borderBlue!important;}
/deep/.el-range-editor.is-active,
.el-range-editor.is-active:hover {
border-color: $borderBlue;
}
\ No newline at end of file
$bgColor:#F4F5FA;
$btnBlue:#5850ff;
$borderBlue:#5850ff;
$lightBtnBlue:#9994FF;
import { Message } from "element-ui";
import { debounce } from "./index.js";
// const error = debounce((msg, getToken) => {
// if(window.__POWERED_BY_QIANKUN__) {
// let stateRes = {
// errorMsg: msg,
// showLoading: false
// };
// if(getToken === 'removeToken') {
// stateRes.token = getToken;
// localStorage.removeItem('token');
// }
// actions.setGlobalState(stateRes);
// } else {
// if(msg) {
// Message({
// message: msg,
// type: 'error'
// });
// }
// }
// }, 1000, true);
const error=msg=>{
if(msg){
Message({
message:msg,
type:'error'
})
}
}
const checkStatus = (status, msg) => {
switch (status) {
case 400:
error(`Bad Request 错误的请求`);
break;
case 401:
error('用户没有权限(令牌、用户名、密码错误)!');
break;
case 403:
error('用户得到授权,但是访问是被禁止的。!');
break;
// 404请求不存在
case 404:
error('网络请求错误,未找到该资源!');
break;
case 405:
error('网络请求错误,请求方法未允许!');
break;
case 408:
error('网络请求超时!');
break;
case 500:
error('服务器错误,请联系管理员!');
break;
case 501:
error('网络未实现!');
break;
case 502:
error('网络错误!');
break;
case 503:
error('服务不可用,服务器暂时过载或维护!');
break;
case 504:
error('网络超时!');
break;
case 505:
error('http版本不支持该请求!');
break;
case 603:
error('尚未登录或登录已过期,请重新登录', 'removeToken');
break;
case 505:
error('http版本不支持该请求!');
break;
case 'fail':
error('网络连接错误');
break;
case 'custom':
error(`${msg}`);
break;
default:
}
}
export {
checkStatus
}
\ No newline at end of file
//过滤器
/* eslint-disable */
const overThousandFilter = (val) => {
if(typeof(val)!='number'){
return false;
}
if (val < 1000) return val;
let a = val + "";
let b = a.split("");
b.splice(-3, 0, ",");
return b.join("");
};
//来源 value值转为对应label(来源)
const toLabel=(value)=> {
if (!value) {
return
}
let sourceList=JSON.parse(window.localStorage.getItem('sourceList'));
let curElement =sourceList.find(item => {
return item.value == value
})
return curElement.label
}
export default {
overThousandFilter,
toLabel
};
export function debounce(fn, delay, triggerNow) {
var t = null;
var debounced = function(){
var _self = this,
args = arguments;
if(t){
clearTimeout(t);
}
if(triggerNow){
var exec = !t;
t = setTimeout(function(){
t = null;
}, delay);
if(exec){
// 初次进来
fn.apply(_self, args);
}
}else{
t = setTimeout(function(){
fn.apply(_self, args);
}, delay);
}
}
debounced.remove = function(){
clearTimeout(t);
t = null;
}
return debounced;
}
//正则表示式是干什么的? 字符串匹配利器(难,规则多)
export function formatDate(date, fmt) {
//1.获取年份
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
}
//2.获取
//M+ ->正则表达式一个规则
//
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
};
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + '';
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
}
}
return fmt;
};
//填补左边的零(一般返回字符串最后两位)
function padLeftZero (str) {
return ('00' + str).substr(str.length);
};
<template>
<div class="report-about">
<h4>穿梭框1</h4>
<h4 class="align-center">
<label>请打开f12查看移动数据</label>
<el-button size="medium" type="info" @click="changeMode">当前模式:{{ mode }}</el-button>
<el-button size="medium" @click="clearChecked()">清除选中</el-button>
</h4>
<div class="box">
<!-- lazy -->
<!-- :lazyFn="lazyFn" -->
<tree-transfer ref="wl-tree-transfer" filter high-light default-transfer :mode="mode" :title="title" :to_data="toData" :from_data="fromData" :filterNode="filterNode" :defaultProps="defaultProps" :defaultCheckedKeys="defaultCheckedKeys" :defaultExpandedKeys="[2, 3]" @right-check-change="rightCheckChange" @left-check-change="leftCheckChange" @removeBtn="remove" @addBtn="add" height="540px" node_key="id">
<span slot="title-right" class="my-title-right" @click="handleTitleRight">自定义内容</span>
</tree-transfer>
</div>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
mode: 'transfer', // transfer addressList
defaultProps: { label: 'name', children: 'children' },
fromData: [
{
id: 1,
pid: 0,
name: '测试左侧',
children: [
{
id: 2,
pid: 1,
name: '水电费是打发斯蒂芬斯蒂芬gas噶水电费噶地方死光光',
disabled: true,
children: []
},
{
id: 3,
pid: 1,
name: '11-3',
children: []
},
{
id: 4,
pid: 1,
name: '11-4',
children: [
{
id: 5,
pid: 4,
name: '11-5',
children: [
{
id: 111,
pid: 5,
name: '11-111'
}
]
},
{
id: 6,
pid: 4,
name: '11-6',
children: []
}
]
}
]
},
{
id: 7127,
pid: 0,
name: 'debug',
children: [
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
]
}
], // 穿梭框 - 源数据 - 树形
toData: [],
fromArray: [
{
id: '1',
name: '1',
pid: '0'
},
{
id: '2',
name: '2',
pid: '0'
},
{
id: '1-1',
name: '1-1',
pid: '1'
},
{
id: '1-2',
name: '1-2',
pid: '1'
},
{
id: '1-1-1',
name: '1-1-1',
pid: '1-1'
},
{
id: '1-1-1-1',
name: '1-1-1-1',
pid: '1-1-1'
},
{
id: '2-1',
name: '2-1',
pid: '2'
},
{
id: '2-2',
name: '2-2',
pid: '2'
}
],
toArray: [],
defaultCheckedKeys: [] // 左侧默认选中数据
}
},
created() {},
mounted() {
this.$apis.demo.GETLISTDEVICEFILEUNSTOCK({ k: 2, kdj: 5 }).then(res => {})
// 测试延迟默认选中
setTimeout(() => {
this.defaultCheckedKeys = [1]
}, 1000)
},
methods: {
// 清除选中
clearChecked() {
this.$refs['wl-tree-transfer'].clearChecked()
},
// 自定义筛选函数
filterNode(value, data, where) {
console.log(value, data, where)
if (!value) return true
return data[this.defaultProps.label].indexOf(value) !== -1
},
// 懒加载回调
lazyFn(node, resolve) {
setTimeout(() => {
resolve([
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
])
}, 500)
},
// 切换模式 现有树形穿梭框模式transfer 和通讯录模式addressList
changeMode() {
if (this.mode == 'transfer') {
this.mode = 'addressList'
} else {
this.mode = 'transfer'
}
},
// 添加按钮
add(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 移除按钮
remove(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 左侧源数据选中事件
leftCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 右侧目标数据选中事件
rightCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 自定义节点 仅树形结构支持
renderContent(h, { node, data }) {
return (
<span class="custom-tree-node">
<span>{node.label}</span>
<span>
<el-button size="mini" type="text" on-click={() => this.append(data)}>
Append
</el-button>
<el-button size="mini" type="text" on-click={() => this.remove(node, data)}>
Delete
</el-button>
</span>
</span>
)
},
// 标题自定义区点击事件
handleTitleRight() {
alert('标题自定义区点击事件')
}
},
computed: {
title() {
if (this.mode == 'transfer') {
return ['源列表', '目标列表']
} else {
return ['通讯录', '收件人', '抄送人', '密送人']
}
}
}
}
</script>
<style>
.align-center {
text-align: center;
}
.box {
width: 600px;
margin: 0 auto;
text-align: left;
}
.btn {
border: 1px solid #ebeef5;
padding: 5px 10px;
background-color: #f5f7fa;
outline: none;
}
.my-title-right {
float: right;
font-size: 12px;
cursor: pointer;
}
</style>
<template>
<div>
<div class="scrm-sub-client-container">
<h3 class="pageSubTitle">客户分层</h3>
<div class="topmsg">
<div class="leftPieEcharts">
<span class="clientTotal">{{ 10000 | overThousandFilter }}人</span>
<div class="topIcon">
<span class="top-inWechat">已加企微</span>
<span class="top-outWechat">未加企微</span>
</div>
<span class="inWechat">已加企微</span>
<span class="blueNum">{{ 7000 | overThousandFilter }}人</span>
<span class="outWechat">未加企微</span>
<span class="yellowNum">{{ 3000 | overThousandFilter }}人</span>
<!-- 引入echart组件 -->
<pie-echart width="100%" height="360px"></pie-echart>
<div class="personsMap">
<pictorial-bar width="100%" height="496px"></pictorial-bar>
</div>
</div>
<div class="itembox">
<div class="no-buy">
<div class="no-buy-total item">
<span>潜在(意向)客户数</span>
<span>{{ 70000 | overThousandFilter }}人</span>
<span>未购车且无交易行为的所有客户</span>
<span>环比:30%</span>
<i class="triangle" :class="{ active: !isNoBuyUp }"></i>
<i class="vertical-line"></i>
</div>
<div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap">
<span>已加企微客户数</span>
<span>{{ 70000 | overThousandFilter }}人</span>
<span>已加企微的潜在(意向)客户</span>
<i class="horizontal-line"></i>
</div>
<div class="outCompanyWechatNum item smallWrap">
<span>未加企微客户数</span>
<span>{{ 70000 | overThousandFilter }}人</span>
<span>未加加企微的潜在(意向)客户</span>
<button class="btn">智能短信外呼&gt;&gt;</button>
</div>
</div>
</div>
<div class="buy">
<div class="buy-total item">
<span>购买(存档)客户数</span>
<span>{{ 100000 | overThousandFilter }}人</span>
<span>已购车且有交易行为的所有客户</span>
<span>环比:30%</span>
<i class="triangle" :class="{ active: !isBuyUp }"></i>
<i class="vertical-line"></i>
</div>
<div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap">
<span>已加企微客户数</span>
<span>{{ 70000 | overThousandFilter }}人</span>
<span>已加企微的购买(存档)客户</span>
<button class="btn">企微魔方&gt;&gt;</button>
<i class="horizontal-line"></i>
</div>
<div class="outCompanyWechatNum item smallWrap">
<span>未加企微客户数</span>
<span>{{ 70000 | overThousandFilter }}人</span>
<span>未加企微的购买(存档)客户</span>
<button class="btn">智能短信外呼&gt;&gt;</button>
</div>
</div>
</div>
</div>
</div>
<div class="middlemsg">
<h3 class="pageSubTitle">客户分群</h3>
<div class="itembox">
<div class="item" v-for="(item, index) in titles" :key="index">
<p>{{ item.name }}</p>
<p>{{ item.subName }}</p>
<p>{{ item.num | overThousandFilter }}人</p>
<img :src="item.url" alt="" />
</div>
</div>
</div>
<h3 class="pageSubTitle">客户增长趋势</h3>
<div class="bottommsg">
<span class="timeDuring">2021/08/03~2021/09/03</span>
<span class="lastest">近30天</span>
<button class="btn30 optionBtn">近30天</button>
<button class="btn7 optionBtn">近7天</button>
<div class="clientAddTrend">
<div class="one1">
<span>区间统计:</span>
<span>
全部客户:
<a>{{ 10000 | overThousandFilter }}人</a>
</span>
<span>
企微客户:
<a>{{ 10000 | overThousandFilter }}人</a>
</span>
</div>
<div class="one2">
<span>
日均新增:
<a>{{ 1000 | overThousandFilter }}人</a>
</span>
<span>
日均新增:
<a>{{ 1000 | overThousandFilter }}人</a>
</span>
</div>
</div>
<multiple-echart width="100%" height="420px"></multiple-echart>
</div>
</div>
</div>
</template>
<script>
import pieEchart from '@/components/echarts/pieEchart'
import multipleEchart from '@/components/echarts/multipleEchart'
import pictorialBar from '@/components/echarts/pictorialBar'
import url1 from '../../assets/clientDataOverview/1.png'
import url2 from '../../assets/clientDataOverview/2.png'
import url3 from '../../assets/clientDataOverview/3.png'
import url4 from '../../assets/clientDataOverview/4.png'
export default {
name: 'clientManage',
components: {
pieEchart,
multipleEchart,
pictorialBar
},
// filters: { filters },
// filters: {
// overThousandFilter: function (val) {
// if (val < 1000) return val;
// let a = val + "";
// let b = a.split("");
// b.splice(-3, 0, ",");
// return b.join("");
// },
// },
data() {
return {
titles: [
{
name: '新车客户数',
subName: '购车时间3个月的客户',
num: 10,
url: url1
},
{
name: '沉默客户数',
subName: '超过180天未到店的客户',
num: 100,
url: url2
},
{
name: '车险待续保客户数',
subName: '近一个月内车险即将到期的客户',
num: 1000,
url: url3
},
{
name: '新车待首保客户数',
subName: '购车时间5~7个月内,且无保养记录的客户',
num: 10000,
url: url4
}
],
isNoBuyUp: true, //默认环比为增
isBuyUp: false
}
},
methods: {
btnClick(ptype, scope) {}
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container {
.pageSubTitle {
position: relative;
height: 20px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.topmsg {
display: flex;
.leftPieEcharts {
position: relative;
background-color: #fff;
width: 372px;
height: 496px; //470
box-sizing: border-box;
// border: 1px solid rgba(121, 121, 121, 1);
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.clientTotal {
position: absolute;
right: 20px;
top: 20px;
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
z-index: 9;
}
.topIcon {
position: absolute;
left: 125px;
top: 100px;
width: 160px;
height: 17px;
align-items: center;
font-size: 12px;
font-family: Helvetica;
color: #8c8c8c;
display: flex;
justify-content: space-between;
.top-inWechat {
position: relative;
&::before {
content: '';
position: absolute;
width: 9px;
height: 9px;
border-radius: 50%;
left: -18px;
top: 4px;
background-color: #716aff;
}
}
.top-outWechat {
position: relative;
&::before {
content: '';
position: absolute;
width: 9px;
height: 9px;
border-radius: 50%;
left: -18px;
top: 4px;
background-color: #fe9c1c;
}
}
}
.inWechat {
position: absolute;
left: 57px;
top: 365px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
z-index: 9;
}
.blueNum {
position: absolute;
left: 57px;
top: 389px;
height: 25px;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #716aff;
line-height: 25px;
z-index: 9;
}
.outWechat {
position: absolute;
right: 57px;
top: 365px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
background-color: #fff;
z-index: 9;
}
.yellowNum {
position: absolute;
right: 57px;
top: 389px;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #fe9c1c;
line-height: 25px;
}
.personsMap {
width: 468px;
position: absolute;
left: 0;
bottom: 0px;
// z-index: 9;
}
}
.itembox {
width: calc(100% - 372px);
.item {
// border: 1px solid rgba(121, 121, 121, 1);
height: 119px;
box-sizing: border-box;
}
.item.no-buy-total,
.item.buy-total {
height: 238px;
width: 50%;
position: relative;
span {
position: absolute;
&:first-child {
font-weight: bold;
height: 22px;
font-size: 16px;
color: #333333;
line-height: 22px;
top: 20px;
left: 24px;
}
&:nth-child(2) {
top: 109px;
// left: 126px;
left: 33%;
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
letter-spacing: 1px;
}
&:nth-child(3) {
top: 50px;
left: 24px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
&:nth-child(4) {
top: 160px;
// left: 136px;
left: 35.5%;
height: 22px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 22px;
}
}
.triangle {
position: absolute;
left: 50.8%;
top: 165px;
width: 0px;
height: 0px;
border-bottom: 10px solid #ff2020;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
&.active {
border-bottom: 10px solid #2cca74;
transform: rotate(180deg);
}
}
.vertical-line {
position: absolute;
width: 2px;
height: 200px;
background: #f0f0f0;
top: 20px;
right: 0;
}
}
.no-buy,
.buy {
display: flex;
margin-left: 20px;
background-color: #fff;
&:last-child {
margin-top: 20px;
}
}
.rightWrap {
width: 48%;
margin-left: 20px;
position: relative;
.smallWrap {
position: relative;
span {
position: absolute;
&:first-child {
font-weight: bold;
height: 22px;
font-size: 16px;
color: #333333;
line-height: 22px;
top: 20px;
}
&:nth-child(2) {
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
right: 20px;
top: 20px;
}
&:nth-child(3) {
top: 50px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
.btn {
position: absolute;
right: 20px;
bottom: 12px;
}
}
.inCompanyWechatNum {
// background-color: red;
// position: absolute;
width: 100%;
.horizontal-line {
position: absolute;
width: 100%;
height: 2px;
background: #f0f0f0;
bottom: 0;
right: 0;
}
}
}
}
}
.middlemsg {
.itembox {
display: flex;
width: 100%;
.item {
width: 25%;
// padding: 20px;
position: relative;
height: 160px;
border: 1px solid #fff;
background-color: #fff;
box-sizing: border-box;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// border: 1px solid rgba(121, 121, 121, 1);
&:not(:first-child) {
margin-left: 20px;
}
&:hover {
border: 1px solid #5850ff;
}
p {
position: absolute;
&:first-child {
left: 20px;
top: 20px;
height: 22px;
font-size: 16px;
font-weight: bold;
color: #333333;
line-height: 22px;
}
&:nth-child(2) {
left: 20px;
top: 46px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
&:nth-child(3) {
left: 20px;
bottom: 32px;
height: 26px;
font-size: 26px;
font-weight: 600;
color: #333333;
line-height: 26px;
}
}
img {
position: absolute;
right: 20px;
top: 20px;
}
}
}
}
.bottommsg {
width: 100%;
height: 578px;
background-color: #fff;
.timeDuring {
margin-left: 20px;
margin-top: 20px;
display: inline-block;
padding-right: 8px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
border-right: 1px solid #d9d9d9;
}
.lastest {
// margin-top: 20px;
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 8px;
}
.clientAddTrend {
width: 100%;
height: 80px;
.one1 {
margin-top: 30px;
height: 44px;
position: relative;
span {
position: absolute;
font-size: 14px;
font-weight: 400;
color: #333333;
height: 20px;
line-height: 20px;
> i {
font-weight: 500;
}
}
span:nth-child(1) {
left: 31.5%;
}
span:nth-child(2) {
left: 38.4%;
}
span:nth-child(3) {
left: 57%;
}
}
.one2 {
height: 40px;
position: relative;
span {
position: absolute;
font-size: 14px;
font-weight: 400;
color: #333333;
height: 20px;
line-height: 20px;
> a {
font-weight: 500;
}
}
span:nth-child(1) {
left: 38.4%;
}
span:nth-child(2) {
left: 57%;
}
}
}
.btn30 {
float: right;
margin: 20px 20px 0 20px;
}
.btn7 {
float: right;
margin-top: 20px;
}
.optionBtn {
width: 68px;
height: 36px;
background-color: #fff;
border-radius: 2px;
border: 1px solid #999999;
font-size: 14px;
font-weight: 400;
color: #999999;
&:hover {
cursor: pointer;
border: 1px solid #5850ff;
color: #5850ff;
}
&:focus {
border: 1px solid #5850ff;
color: #5850ff;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="scrm-sub-client-container">
<div class="modalLayer" v-show="isShowModal"></div>
<img class="tipPanel" src="@/assets/clientDataOverview/allPicture.png" alt="" v-show="isShowModal" />
<!-- <img class="arrow" src="@/assets/clientDataOverview/arrow.png" alt="" v-show="isShowModal" /> -->
<button class="knewBtn" v-show="isShowModal" @click="btnKnewClick">我知道啦</button>
<div class="bannerWrap" @click="goNextPage">
<img src="@/assets/clientDataOverview/companyBanner.png" alt="" />
</div>
<h3 class="pageSubTitle">客户分层</h3>
<div class="topmsg">
<div class="leftPieEcharts">
<span class="title">客户总数</span>
<span class="subtitle">已加和未加企微的所有潜客和已购买客户</span>
<span class="clientTotal">
{{ (topDataObj.customerCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<template v-if="isShowData">
<div class="topIcon">
<span class="top-inWechat">已加企微</span>
<span class="top-outWechat">未加企微</span>
</div>
<span class="inWechat">已加企微</span>
<span class="blueNum">{{ (topDataObj.entmicroAddCustomerCount || 0) | overThousandFilter }}人</span>
<span class="outWechat">未加企微</span>
<span class="yellowNum">{{ (topDataObj.entmicroNotAddCustomerCount || 0) | overThousandFilter }}人</span>
<!-- 引入echart组件 -->
<pie-echart width="100%" height="360px" :topDataObj="topDataObj"></pie-echart>
<div class="personsMap">
<pictorial-bar width="100%" height="496px" :entmicroAddCustomerCount="topDataObj.entmicroAddCustomerCount" :entmicroNotAddCustomerCount="topDataObj.entmicroNotAddCustomerCount"></pictorial-bar>
</div>
</template>
<no-data :type="'hasIconText'" v-if="!isShowData"></no-data>
</div>
<div class="itembox">
<div class="no-buy">
<div class="no-buy-total item">
<span>潜在(意向)客户数</span>
<span>未购车且无交易行为的所有客户</span>
<span v-if="!isEmptyObj">
{{ (topDataObj.purposeCustomerCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span v-if="!isEmptyObj">
占比:{{ topDataObj.purposePercent * 100 || 0 }}%
<i class="triangle" :class="{ active: !isNoBuyUp }" v-if="!isEmptyObj"></i>
</span>
<i class="vertical-line"></i>
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
</div>
<div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap">
<span>已加企微客户数</span>
<span>
{{ (topDataObj.purposeCustomerAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span>已加企微的潜在(意向)客户</span>
<i class="horizontal-line"></i>
</div>
<div class="outCompanyWechatNum item smallWrap">
<span>未加企微客户数</span>
<span>
{{ (topDataObj.purposeCustomerNAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span>未加企微的潜在(意向)客户</span>
<button class="btn">引流企微&nbsp;&nbsp;&gt;&gt;</button>
</div>
</div>
</div>
<div class="buy">
<div class="buy-total item">
<span>购买(存档)客户数</span>
<span>已购车且有交易行为的所有客户</span>
<span v-if="!isEmptyObj">
{{ (topDataObj.purchaseCustomerCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span v-if="!isEmptyObj">
占比:{{ topDataObj.purchasePercent * 100 || 0 }}%
<i class="triangle" :class="{ active: !isBuyUp }" v-if="!isEmptyObj"></i>
</span>
<no-data :type="'hasText'" v-if="isEmptyObj"></no-data>
<i class="vertical-line"></i>
</div>
<div class="rightWrap">
<div class="inCompanyWechatNum item smallWrap">
<span>已加企微客户数</span>
<span>
{{ (topDataObj.purchaseCustomerAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span>已加企微的购买(存档)客户</span>
<!-- <button class="btn">企微魔方&gt;&gt;</button> -->
<i class="horizontal-line"></i>
</div>
<div class="outCompanyWechatNum item smallWrap">
<span>未加企微客户数</span>
<span>
{{ (topDataObj.purchaseCustomerNAddCount || 0) | overThousandFilter }}
<span class="person-text">人</span>
</span>
<span>未加企微的购买(存档)客户</span>
<button class="btn">引流企微&nbsp;&nbsp;&gt;&gt;</button>
</div>
</div>
</div>
</div>
</div>
<div class="middlemsg">
<h3 class="pageSubTitle">客户分群</h3>
<div class="itembox">
<div class="item" v-for="(item, index) in titles" :key="index">
<p>{{ item.name }}</p>
<p>{{ item.subName }}</p>
<p>
{{ item.num | overThousandFilter }}
<span class="person-text">人</span>
</p>
<img :src="item.url" alt="" />
</div>
</div>
</div>
<h3 class="pageSubTitle">客户增长趋势</h3>
<div class="bottommsg">
<no-data :type="'hasIconText'" v-if="!isShowBarMap"></no-data>
<template v-if="isShowBarMap">
<span class="timeDuring">{{ allMapList[0].dateTime }}~{{ allMapList[allMapList.length - 1].dateTime }}</span>
<span class="lastest">近{{ timeGap }}天</span>
<button class="btn30 optionBtn" @click="clickThirty">近30天</button>
<button class="btn7 optionBtn" @click="clickSeven">近7天</button>
<div class="clientAddTrend">
<div class="one1">
<span>区间统计:</span>
<span>
全部客户:
<a>{{ bottomDataObj.customerCount | overThousandFilter }}人</a>
</span>
<span>
企微客户:
<a>{{ bottomDataObj.entmicroCustomerCount | overThousandFilter }}人</a>
</span>
</div>
<div class="one2">
<span>
日均新增:
<a>{{ bottomDataObj.dayAvergGrow | overThousandFilter }}人</a>
</span>
<span>
日均新增:
<a>{{ bottomDataObj.entmicroDayAvergGrow | overThousandFilter }}人</a>
</span>
</div>
</div>
<!-- v-if="isShowBarMap" -->
<multiple-echart width="100%" height="420px" :totalData="allMapList"></multiple-echart>
</template>
</div>
</div>
</template>
<script>
import { getDataOverview, getDataOverviewBarMap } from '@/api/modules/clientDataOverview'
import pieEchart from '@/components/echarts/pieEchart'
import multipleEchart from '@/components/echarts/multipleEchart'
import pictorialBar from '@/components/echarts/pictorialBar'
import url1 from '../../assets/clientDataOverview/1.png'
import url2 from '../../assets/clientDataOverview/2.png'
import url3 from '../../assets/clientDataOverview/3.png'
import url4 from '../../assets/clientDataOverview/4.png'
import noData from '@/components/noData/noData'
export default {
name: 'clientManage',
components: {
pieEchart,
multipleEchart,
pictorialBar,
noData
},
// filters: {
// overThousandFilter: function (val) {
// if (val < 1000) return val;
// let a = val + "";
// let b = a.split("");
// b.splice(-3, 0, ",");
// return b.join("");
// },
// },
data() {
return {
isShowModal: false,
topDataObj: {
customerCount: 0,
entmicroAddCustomerCount: 0,
entmicroNotAddCustomerCount: 0,
purposeCustomerCount: 0,
purposeCustomerAddCount: 0, //已加企微客户数
purposeCustomerNAddCount: 0,
purchaseCustomerCount: 0,
purchaseCustomerAddCount: 0,
purchaseCustomerNAddCount: 0,
newCarCustomerCount: 0,
newRenewalCustomerCount: 0,
burseholderCustomerCount: 0,
silenceCustomerCount: 0
},
titles: [
{
name: '新车客户数',
subName: '购车时间3个月的客户',
num: 0,
url: url1
},
{
name: '沉默客户数',
subName: '超过180天未到店的客户',
num: 0,
url: url2
},
{
name: '车险待续保客户数',
subName: '近一个月内车险即将到期的客户',
num: 0,
url: url3
},
{
name: '新车待首保客户数',
subName: '购车时间5~7个月内,且无保养记录的客户',
num: 0,
url: url4
}
],
isNoBuyUp: true, //默认环比为增
isBuyUp: true,
bottomDataObj: {},
allMapList: [],
isShowBarMap: false, //是否显示底部多种数据图
timeGap: 7,
sevenDayStorage: {},
thirtyDayStorage: {}
}
},
mounted() {
document.body.style.overflow = 'hidden'
},
computed: {
isEmptyObj() {
if (Object.keys(this.topDataObj).length == 0) {
return true
}
return false
},
isShowData() {
return Object.keys(this.topDataObj).length > 0 && this.topDataObj.customerCount > 0 ? true : false
}
},
created() {
this.getDataOverviewFun()
this.getDataOverviewBarMapFun()
},
methods: {
goNextPage() {
window.open('https://www.baidu.com', '_blank')
},
//获取上面的数据
getDataOverviewFun() {
// const res = await getDataOverview()
getDataOverview({})
.then(res => {
if (!res) {
return false
}
console.log('上方数据', res)
this.topDataObj = res
this.titles[0].num = res.newCarCustomerCount
this.titles[1].num = res.silenceCustomerCount
this.titles[2].num = res.needRenewalCustomerCount
this.titles[3].num = res.burseholderCustomerCount
this.isNoBuyUp = res.purposeUp
this.isBuyUp = res.purchaseUp
})
.catch(err => {
console.log('错误信息:', err)
})
},
//首次进来获取下方柱状图数据(一进来默认传7天)
async getDataOverviewBarMapFun(dayCount = 7) {
const res = await getDataOverviewBarMap({ day: dayCount })
if (!res) {
return false
}
console.log('下方数据', res)
this.bottomDataObj = res
if (dayCount == 7) {
this.sevenDayStorage = res
} else if (dayCount == 30) {
this.thirtyDayStorage = res
}
this.allMapList = res.customerGrowthTrends
console.log(this.allMapList, '数组')
this.isShowBarMap = true //第一次有数据进来,就让图表显示
},
clickThirty() {
this.timeGap = 30
if (Object.keys(this.thirtyDayStorage).length == 0) {
this.getDataOverviewBarMapFun(30) //第一次点击30天,获取数据
} else {
this.bottomDataObj = this.thirtyDayStorage
this.allMapList = this.thirtyDayStorage.customerGrowthTrends
}
},
clickSeven() {
this.timeGap = 7
if (Object.keys(this.sevenDayStorage).length == 0) {
this.getDataOverviewBarMapFun() //重新掉一遍接口
} else {
this.bottomDataObj = this.sevenDayStorage
this.allMapList = this.sevenDayStorage.customerGrowthTrends
}
},
btnKnewClick() {
this.isShowModal = false
// 允许页面滚动:
document.body.style.overflow = 'visible'
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
.person-text {
font-size: 16px !important;
}
.modalLayer {
position: fixed;
z-index: 99;
width: 100%;
height: 100%;
// top: 70px; //125px;
// right: 19.19%; //320px;
// width: 10%; //160px;
// height: 11.89%; //90px;
// border-radius: 50% / 50%;
// box-shadow: 0 0 0 2000px #000000;
background-color: #000000;
opacity: 0.79;
}
.tipPanel {
position: fixed;
z-index: 100;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
}
.knewBtn {
position: fixed;
z-index: 100;
width: 124px;
height: 40px;
// width: 7.75%;
// height: 5.28%;
left: 50%;
bottom: 18%;
transform: translateX(-50%);
font-size: 16px;
font-weight: 500;
color: #fff;
background-color: $btnBlue;
border-radius: 4px;
}
.bannerWrap {
width: 100%;
> img {
width: 100%;
// height: 146px;
//object-fit: contain; //保持图片的原始比例,最大程度展示
}
}
.pageSubTitle {
position: relative;
margin: 20px 0;
height: 20px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.topmsg {
display: flex;
.leftPieEcharts {
position: relative;
background-color: #fff;
width: 372px;
height: 496px; //470
box-sizing: border-box;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.title {
position: absolute;
left: 20px;
top: 20px;
font-weight: bold;
font-size: 16px;
color: #333333;
height: 22px;
line-height: 22px;
}
.subtitle {
position: absolute;
left: 20px;
top: 54px;
font-size: 12px;
font-weight: 400;
color: #808080;
}
.clientTotal {
position: absolute;
right: 20px;
top: 20px;
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
z-index: 9;
}
.topIcon {
position: absolute;
left: 125px;
top: 100px;
width: 160px;
height: 17px;
align-items: center;
font-size: 12px;
font-family: Helvetica;
color: #8c8c8c;
display: flex;
justify-content: space-between;
.top-inWechat {
position: relative;
&::before {
content: '';
position: absolute;
width: 9px;
height: 9px;
border-radius: 50%;
left: -18px;
top: 4px;
background-color: #716aff;
}
}
.top-outWechat {
position: relative;
&::before {
content: '';
position: absolute;
width: 9px;
height: 9px;
border-radius: 50%;
left: -18px;
top: 4px;
background-color: #fe9c1c;
}
}
}
.inWechat {
position: absolute;
left: 57px;
top: 365px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
z-index: 9;
}
.blueNum {
position: absolute;
left: 57px;
top: 389px;
height: 25px;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #716aff;
line-height: 25px;
z-index: 9;
}
.outWechat {
position: absolute;
right: 57px;
top: 365px;
height: 20px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
background-color: #fff;
z-index: 9;
}
.yellowNum {
position: absolute;
right: 57px;
top: 389px;
font-size: 18px;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
color: #fe9c1c;
line-height: 25px;
}
.personsMap {
width: 468px;
position: absolute;
left: 0;
bottom: 0px;
// z-index: 9;
}
}
.itembox {
width: calc(100% - 372px);
.item {
// border: 1px solid rgba(121, 121, 121, 1);
height: 119px;
box-sizing: border-box;
}
.item.no-buy-total,
.item.buy-total {
height: 238px;
width: 50%;
position: relative;
> span {
position: absolute;
&:first-child {
font-weight: bold;
height: 22px;
font-size: 16px;
color: #333333;
line-height: 22px;
top: 20px;
left: 24px;
}
&:nth-child(2) {
left: 24px;
top: 50px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
&:nth-child(3) {
top: 109px;
// left: 126px;
left: 33%;
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
letter-spacing: 1px;
}
&:nth-child(4) {
top: 160px;
// left: 136px;
left: 35.5%;
height: 22px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 22px;
// vertical-align: middle;
> .triangle {
// position: absolute;
// left: 51.8%;
// top: 165px;
// margin-bottom: 20px;
display: inline-block;
vertical-align: middle;
width: 0px;
height: 0px;
border-bottom: 6px solid #ff2020;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
&.active {
border-bottom: 6px solid #2cca74;
transform: rotate(180deg);
}
}
}
}
.vertical-line {
position: absolute;
width: 2px;
height: 200px;
background: #f0f0f0;
top: 20px;
right: 0;
}
}
.no-buy,
.buy {
display: flex;
margin-left: 20px;
background-color: #fff;
&:last-child {
margin-top: 20px;
}
}
.rightWrap {
width: 48%;
margin-left: 20px;
position: relative;
.smallWrap {
position: relative;
> span {
position: absolute;
&:first-child {
font-weight: bold;
height: 22px;
font-size: 16px;
color: #333333;
line-height: 22px;
top: 20px;
}
&:nth-child(2) {
height: 26px;
font-size: 26px;
font-weight: 500;
color: #333333;
line-height: 26px;
right: 20px;
top: 20px;
}
&:nth-child(3) {
top: 50px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
.btn {
position: absolute;
right: 20px;
bottom: 12px;
padding: 6px 20px;
box-sizing: border-box;
border-radius: 4px;
border: 1px solid $borderBlue;
background-color: #fff;
color: #6861ff;
font-size: 14px;
font-weight: 400;
}
}
.inCompanyWechatNum {
// background-color: red;
// position: absolute;
width: 100%;
.horizontal-line {
position: absolute;
width: 100%;
height: 2px;
background: #f0f0f0;
bottom: 0;
right: 0;
}
}
}
}
}
.middlemsg {
.itembox {
display: flex;
width: 100%;
.item {
width: 25%;
// padding: 20px;
position: relative;
height: 160px;
border: 1px solid #fff;
background-color: #fff;
box-sizing: border-box;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// border: 1px solid rgba(121, 121, 121, 1);
&:not(:first-child) {
margin-left: 20px;
}
&:hover {
border: 1px solid $borderBlue;
}
p {
position: absolute;
&:first-child {
left: 20px;
top: 20px;
height: 22px;
font-size: 16px;
font-weight: bold;
color: #333333;
line-height: 22px;
}
&:nth-child(2) {
left: 20px;
top: 46px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
&:nth-child(3) {
left: 20px;
bottom: 32px;
height: 26px;
font-size: 26px;
font-weight: 600;
color: #333333;
line-height: 26px;
}
}
img {
position: absolute;
right: 20px;
top: 20px;
}
}
}
}
.bottommsg {
position: relative;
width: 100%;
height: 578px;
background-color: #fff;
.timeDuring {
margin-left: 20px;
margin-top: 20px;
display: inline-block;
padding-right: 8px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
border-right: 1px solid #d9d9d9;
}
.lastest {
// margin-top: 20px;
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 8px;
}
.clientAddTrend {
width: 100%;
height: 80px;
.one1 {
margin-top: 30px;
height: 44px;
position: relative;
span {
position: absolute;
font-size: 14px;
font-weight: 400;
color: #333333;
height: 20px;
line-height: 20px;
> i {
font-weight: 500;
}
}
span:nth-child(1) {
left: 31.5%;
}
span:nth-child(2) {
left: 38.4%;
}
span:nth-child(3) {
left: 57%;
}
}
.one2 {
height: 40px;
position: relative;
span {
position: absolute;
font-size: 14px;
font-weight: 400;
color: #333333;
height: 20px;
line-height: 20px;
> a {
font-weight: 500;
}
}
span:nth-child(1) {
left: 38.4%;
}
span:nth-child(2) {
left: 57%;
}
}
}
.btn30 {
float: right;
margin: 20px 20px 0 20px;
}
.btn7 {
float: right;
margin-top: 20px;
}
.optionBtn {
width: 68px;
height: 36px;
background-color: #fff;
border-radius: 2px;
border: 1px solid #999999;
font-size: 14px;
font-weight: 400;
color: #999999;
&:hover {
cursor: pointer;
border: 1px solid $borderBlue;
color: $btnBlue;
}
&:focus {
border: 1px solid $borderBlue;
color: $btnBlue;
}
}
}
}
</style>
<template>
<div class="scrm-sub-client-container">
<div class="header">
<div class="vehicleGroupName">
<span>奥迪车友群</span>
</div>
<button class="backBtn" @click="goBack">返回客户群管理</button>
</div>
<div class="content">
<div class="leftWrap">
<div class="avator">
<img src="@/assets/clientDetail/defaultAvator.png" alt="" />
</div>
<p>
<span>群主</span>
<span class="ellipsis-1">{{ leftPanelList.groupHostName }}</span>
</p>
<p>
<span>群主手机</span>
<span class="ellipsis-1">{{ leftPanelList.groupHostPhone }}</span>
</p>
<p>
<span>群主邮箱</span>
<span class="ellipsis-1" :title="leftPanelList.groupHostEmail">{{ leftPanelList.groupHostEmail }}</span>
</p>
<p>
<span>群主部门</span>
<span class="ellipsis-1">{{ leftPanelList.groupHostDepart }}</span>
</p>
<p>
<span>群管理员</span>
<span class="ellipsis-1">{{ leftPanelList.groupAdmin }}</span>
</p>
<p>
<span>创建时间</span>
<span class="ellipsis-1" style="width:100%;">{{ leftPanelList.createDate }}</span>
</p>
</div>
<div class="rightWrap">
<p>
<span>客户列表</span>
<span>{{ clientGroupFormList.length || 0 }}个</span>
</p>
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientGroupFormList">
<span class="inline-b" slot="form-slot">
<!-- :size="btn_size" -->
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<!-- <basic-table ref="clientMassTable" :tableParams="tableParams" :getListApi="getListApi" :searchForm="searchForm" :hasNum="true">
<span slot="table-button" slot-scope="scope">
<el-button v-for="(j, idx) in tableParams.tableOption.btnList" :key="idx" :type="j.type || 'text'" :size="btn_size" @click="btnClick(j.pType, scope.scope)">{{ j.name }}</el-button>
</span>
</basic-table> -->
<GLTable ref="clientGroupDetail" :tableId="$route.query.id" :hasNum="true" :pageConf="pageConf" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }" :noDataImg="url">
<span slot="customerName" slot-scope="scope">
<span>{{ scope.scope.customerName }}</span>
<span class="blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span>
</span>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : '女' }}</span>
</span>
<span slot="joinScene" slot-scope="scope">
<span>{{ scope.scope.joinScene == 1 ? '直接邀请入群' : scope.scope.joinScene == 2 ? '通过邀请链接入群' : scope.scope.joinScene == 3 ? '通过扫描群二维码入群' : '' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<span @click="goDetail(scope.scope.id)" class="blue-text">详情</span>
</template>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { getTableDetail, getDetailTableList } from '@/api/modules/clientGroupManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'clientGroupDetail',
data() {
return {
url: url,
leftPanelList: {},
searchForm: {},
clientGroupFormList: [
{
type: 'daterange',
prop: 'daterange',
label: '入群时间',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
type: 'select',
prop: 'customerSex',
label: '性别',
placeholder: '请选择性别',
options: [
{
label: '全部',
value: null
},
{
label: '男',
value: 1
},
{
label: '女',
value: 2
},
{
label: '未知',
value: 0
}
]
},
{
type: 'input',
inputType: 'text',
prop: 'groupNickName',
label: '本群昵称',
placeholder: '请输入本群昵称'
},
{
type: 'input',
inputType: 'text',
prop: 'customerName',
label: '客户名称',
placeholder: '请输入客户名称'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
tableColumns: [
{
label: '本群昵称',
prop: 'groupNickName'
},
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName'
},
{
label: '手机号码',
prop: 'customerPhone'
},
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex'
},
{
label: '入群方式',
prop: 'joinScene',
addHtml: 'joinScene'
},
{
label: '入群时间',
prop: 'joinTime'
}
],
tableOption: {
width: 170,
btnList: [
// {
// name: "编辑",
// pType: "edit",
// },
// {
// name: "删除",
// pType: "delete",
// },
{
name: '详情',
pType: 'detail'
}
]
}
},
getListApi: getDetailTableList
}
},
created() {
this.getTableDetail()
},
mounted() {
this.$nextTick(() => {
this.$refs.clientGroupDetail.setTableHeightFun()
})
},
methods: {
async getTableDetail(id = this.$route.query.id) {
const res = await getTableDetail({ id: id })
console.log('获取客户群数据', res)
if (!res) {
return false
}
this.leftPanelList = res
},
goBack() {
this.$router.push({ name: 'clientGroupManage' })
},
//搜索表格
searchTable() {
this.$refs.clientGroupDetail.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {}
this.$refs.clientGroupDetail.refreshTable()
},
goDetail(id) {
this.$router.push({
name: 'clientDetail',
query: {
id: id
}
})
}
}
}
</script>
<style lang="scss" scoped>
.scrm-sub-client-container {
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.header {
display: flex;
justify-content: space-between;
align-items: center;
height: 72px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.vehicleGroupName {
margin-left: 26px;
height: 20px;
font-size: 20px;
font-weight: 500;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.backBtn {
margin-right: 20px;
height: 32px;
background: $btnBlue;
color: #fff;
border-radius: 4px;
padding: 0 20px;
border: none;
&:hover {
background-color: $lightBtnBlue;
}
}
}
.content {
display: flex;
width: 100%;
margin-top: 20px;
.leftWrap {
width: 240px;
// height: 877px;
min-height: calc(100vh - 92px);
background-color: #fff;
box-sizing: border-box;
.avator {
margin: 0 auto;
margin-top: 40px;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
img {
border-radius: 50%;
width: 100%;
height: 100%;
}
}
p {
padding-left: 20px;
position: relative;
margin-top: 20px;
span:first-child {
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
}
span:nth-child(2) {
position: absolute;
left: 100px;
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
max-width: 131px;
}
}
}
.rightWrap {
margin-left: 20px;
width: calc(100% - 260px);
box-sizing: border-box;
background-color: #fff;
padding: 20px;
> p {
height: 20px;
line-height: 20px;
margin-bottom: 10px;
span {
vertical-align: middle;
}
span:first-child {
font-size: 18px;
font-weight: 400;
color: #333333;
}
span:nth-child(2) {
margin-left: 6px;
font-size: 14px;
font-weight: 400;
color: $btnBlue;
height: 20px;
line-height: 20px;
}
}
.el-button + .el-button {
margin-left: 20px;
}
// .el-button {
// font-size: 14px;
// font-weight: 400;
// padding: 9px 21px;
// background: $btnBlue;
// border-radius: 4px;
// border: none;
// }
// .el-button:first-child {
// background: #ffffff;
// border-radius: 4px;
// border: 1px solid #999999;
// font-weight: 400;
// color: #666666;
// }
.glsx-table {
margin-top: 20px;
}
}
}
}
</style>
<template>
<div>
<div class="scrm-sub-client-container">
<p class="pageTitle">客户群管理</p>
<div class="pageContent">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientGroupFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot">
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<!-- <basic-table ref="clientGroupTable" :tableParams="tableParams" :getListApi="getListApi" :searchForm="searchForm" :hasNum="true">
<span slot="table-button" slot-scope="scope">
<el-button v-for="(j, idx) in tableParams.tableOption.btnList" :key="idx" :type="j.type || 'text'" :size="btn_size" @click="btnClick(j.pType, scope.scope)">{{ j.name }}</el-button>
</span>
</basic-table> -->
<GLTable ref="clientGroupManage" :hasNum="true" :getListApi="getListApi" :noDataImg="url" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="status" slot-scope="scope">
<!-- <span class="dot" :class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"></span> -->
<span class="statusText" :class="scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[1] : ''">{{ scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[0] : '--' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> -->
<span @click="goDetail(scope.scope.id)" class="blue-text">详情</span>
</template>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { getTableList } from '@/api/modules/clientGroupManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'clientManage',
data() {
return {
url: url,
titles: [
{ name: '客户群总数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息1' },
{ name: '新增客户群数', num: 100, rate: '+10%', isUp: true, tips: '群提示消息2' }
],
searchForm: {},
clientGroupFormList: [
{
type: 'daterange',
prop: 'daterange',
label: '创建时间',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
type: 'input',
inputType: 'text',
prop: 'custGroupName',
label: '客户群名称',
placeholder: '请输入客户群名称'
},
{
type: 'input',
inputType: 'text',
prop: 'groupHostName',
label: '群主',
placeholder: '请输入群主'
},
{
type: 'input',
inputType: 'text',
prop: 'groupAdminName',
label: '管理员',
placeholder: '请输入管理员'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
tableColumns: [
{
label: '客户群名称',
prop: 'custGroupName'
},
{
label: '当前客户数',
prop: 'totalCount'
},
{
label: '新增入群客户数',
prop: 'newCustomerCount'
},
{
label: '新增退群客户数',
prop: 'delCustomerCount'
},
{
label: '群主',
prop: 'groupHostName'
},
{
label: '管理员',
prop: 'groupAdminName'
},
{
label: '创建时间',
prop: 'addTime'
}
],
tableOption: {
width: 170,
btnList: [
// {
// name: "编辑",
// pType: "edit",
// },
// {
// name: "删除",
// pType: "delete",
// },
{
name: '详情',
pType: 'detail'
}
]
}
},
getListApi: getTableList,
setHeight: ''
}
},
methods: {
setTableHeightEvent() {
console.log('emit事件')
this.$refs.clientGroupManage.setTableHeightFun()
},
searchTable() {
this.$refs.clientGroupManage.refreshTable()
},
resetTable() {
this.searchForm = {}
this.$refs.clientGroupManage.refreshTable()
},
btnClick(ptype, scope) {},
goDetail(id) {
this.$router.push({
name: 'clientGroupDetail',
query: {
id: id
}
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
.pageTitle {
position: relative;
margin-bottom: 20px;
height: 20px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.pageContent {
padding: 6px 20px 30px;
background-color: #fff;
.el-button + .el-button {
margin-left: 20px;
}
// .el-button {
// font-size: 14px;
// font-weight: 400;
// padding: 9px 21px;
// background: $btnBlue;
// border-radius: 4px;
// border: none;
// }
// .el-button:first-child {
// background: #ffffff;
// border-radius: 4px;
// border: 1px solid #999999;
// font-weight: 400;
// color: #666666;
// }
.glsx-table {
margin-top: 20px;
}
}
}
</style>
<template>
<div class="scrm-sub-client-container">
<div class="header">
<div class="userId">
<span>客户ID:{{ leftPanelInfo.oneId }}</span>
</div>
<button class="backBtn" @click="goBack">返回客户管理</button>
</div>
<div class="content">
<div class="leftWrap">
<div class="avator">
<img :src="leftPanelInfo.avatar" alt="" v-if="leftPanelInfo.avatar" />
<img src="@/assets/clientDetail/defaultAvator.png" alt="" v-else />
</div>
<p>
<span>客户名称</span>
<span>{{ leftPanelInfo.customerName }}</span>
</p>
<p>
<span>联系电话</span>
<span>{{ leftPanelInfo.customerPhone }}</span>
</p>
<p>
<span>微信号</span>
<span>{{ leftPanelInfo.weChatId || '待完善' }}</span>
</p>
<p>
<span>性别</span>
<span>{{ leftPanelInfo.customerSex == 0 ? '未知' : leftPanelInfo.customerSex == 1 ? '男' : leftPanelInfo.customerSex == 2 ? '女' : '' }}</span>
</p>
<p>
<span>企业简称</span>
<span>{{ leftPanelInfo.corpName }}</span>
</p>
<p>
<span>职务</span>
<span>{{ leftPanelInfo.position }}</span>
</p>
<p>
<span>类型</span>
<span>{{ leftPanelInfo.type == 1 ? '微信用户' : leftPanelInfo.type == 2 ? '企微用户' : '' }}</span>
</p>
<p>
<span>是否加企微</span>
<!-- 1-是,2-否 -->
<span>{{ leftPanelInfo.isJoin == 1 ? '是' : leftPanelInfo.isJoin == 0 ? '否' : '' }}</span>
</p>
<p>
<span>添加时间</span>
<span>{{ leftPanelInfo.addTime }}</span>
</p>
<p>
<span>当前状态</span>
<span>{{ leftPanelInfo.status == 1 ? '删除' : leftPanelInfo.status == 0 ? '正常' : '' }}</span>
</p>
<p>
<span>来源</span>
<span class="ellipsis-1" :title="leftPanelInfo.addWay | toLabel">{{ leftPanelInfo.addWay | toLabel }}</span>
</p>
</div>
<div class="rightWrap">
<p><span>标签信息</span></p>
<div class="tagsWrap">
<span class="tag ellipsis-1" v-for="(item, index) in tagsList" :key="index" :title="item">{{ item }}</span>
<!-- 添加标签 仅对该客户的跟进员工可见(要有登录信息) -->
<span class="tag addTag" @click="btnClick('create')">添加</span>
</div>
<p>
<span>车辆信息</span>
<span>{{ vehicleTableData.length || 0 }}辆</span>
</p>
<!--1. 车辆信息表 -->
<el-table :data="vehicleTableData" style="width: 100%" :header-cell-style="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column prop="date" label="车架号(后6位)" align="center"></el-table-column>
<el-table-column prop="name" label="车牌号" align="center"></el-table-column>
<el-table-column prop="address" label="车辆品牌" align="center"></el-table-column>
<el-table-column prop="xi" label="车系" align="center">
<template slot-scope="scope">
<el-tooltip :content="scope.row.xi" placement="top">
<p class="showOverTooltip">{{ scope.row.xi }}</p>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="xin" label="车型" align="center"></el-table-column>
<el-table-column prop="kuan" label="年款" align="center"></el-table-column>
<el-table-column prop="ge" label="购车价格" align="center"></el-table-column>
<el-table-column prop="jian" label="购车时间" align="center"></el-table-column>
<el-table-column prop="jian1" label="保险开始时间" align="center"></el-table-column>
<el-table-column prop="jian2" label="保险到期时间" align="center"></el-table-column>
<el-table-column prop="jian3" label="最近保养时间" align="center"></el-table-column>
<div slot="empty" class="emptyBg">
<!-- <img src="@/assets/clientDataOverview/nodata.png" alt=""> -->
<div>暂无数据</div>
</div>
</el-table>
<p>
<span>员工跟进</span>
<span>{{ employTableList.length || 0 }}人</span>
</p>
<!-- <div></div> -->
<!--2. 员工跟进表 -->
<GLTable :hasNum="false" :tableData="employTableList" :hasPage="false" :tableParams="tableParams" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="addWay" slot-scope="scope">
<span>{{ scope.scope.addWay | toLabel }}</span>
</span>
<span slot="addType" slot-scope="scope">
<span>{{ scope.scope.addType == 1 ? '微信' : '企微' }}</span>
</span>
</GLTable>
<!-- <el-table :data="employTableList" style="width: 100%" :header-cell-style="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column prop="staffName" label="跟进员工" align="center"></el-table-column>
<el-table-column prop="departmentName" label="所属部门" align="center"></el-table-column>
<el-table-column prop="addTime" label="添加时间" align="center"></el-table-column>
<el-table-column prop="addWay" label="来源" align="center">
<template slot-scope="scope">
<el-tooltip :content="scope.row.addWay" placement="top">
<p class="showOverTooltip">{{ scope.row.addWay }}</p>
</el-tooltip>
</template>
</el-table-column>
<el-table-column prop="addType" label="添加类型" align="center"></el-table-column>
<el-table-column prop="remarkMobiles" label="备注手机号" align="center"></el-table-column>
<el-table-column prop="remark" label="备注" align="center"></el-table-column>
<el-table-column prop="description" label="描述" align="center"></el-table-column>
</el-table> -->
<p>
<span>所属客户群</span>
<span>{{ clientGroupTableList.length || 0 }}个</span>
</p>
<!-- <div>所属客户群表格,待定</div> -->
<!-- 3.所属客户群 -->
<el-table :data="clientGroupTableList" style="width: 100%" :header-cell-style="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<el-table-column prop="groupName" label="客户群名称" align="center"></el-table-column>
<el-table-column prop="groupHostName" label="群主" align="center"></el-table-column>
<el-table-column prop="membersNumber" label="成员数" align="center"></el-table-column>
<el-table-column prop="groupNickName" label="本群昵称" align="center"></el-table-column>
<el-table-column prop="joinTime" label="入群时间" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<span class="blue-text" @click="goDetail(scope.row.id)">详情</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
<basic-dialog class="tags" :title="tagsDialogTitle" :width="'712px'" :isVisible="tagsVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<slot>
<p class="dialogSubTitle">企业标签</p>
<div class="companyRowData" v-for="(item, index) in companyTagsList" :key="index">
<span>{{ item.name }}</span>
<div class="tagsBox">
<span v-for="(i, j) in item.arr" :key="j" class="ellipsis-1" :class="{ activeTag: i.checked }" :title="i.name" @click="checkNewTag(i.checked, j, item.arr, i.original)">{{ i.name }}</span>
</div>
</div>
<p class="dialogSubTitle">自店标签</p>
<div class="ownShopRowData" v-for="(xItem, xIndex) in ownShopTagsList" :key="xIndex">
<span>{{ xItem.name }}</span>
<div class="tagsBox">
<span v-for="(m, n) in xItem.arr" :key="n" class="ellipsis-1" :class="{ activeTag: m.checked }" :title="m.name" @click="checkNewTag(m.checked, n, xItem.arr, m.original)">{{ m.name }}</span>
</div>
</div>
<!-- <span slot="btn-behind">插槽全部替换了</span> -->
<el-button slot="btn-behind" @click="goNewTag">没找到需要的标签,创建新标签</el-button>
</slot>
</basic-dialog>
</div>
</template>
<script>
import { getTableDetail } from '@/api/modules/clientManage'
export default {
name: 'clientDetail',
data() {
return {
leftPanelInfo: {},
tagsList: ['一般', '初次沟通', '奥迪车主', '有车车主', '一线城市', '已加企微,无手机号客户', '有车一族有车一族有车一族', '一般', '初次沟通', '奥迪车主', '有车车主', '一线城市', '已加企微,无手机号客户', '有车一族有车一族有车一族', '一般', '初次沟通', '奥迪车主', '有车车主', '一线城市', '已加企微,无手机号客户', '有车一族有车一族有车一族'],
vehicleTableData: [
// {
// date: '123456',
// name: '粤B 3****1',
// address: '奥迪',
// xi: '2021款 RS 5.2.9TSportback 暗精版'
// },
],
//员工跟进
tableParams: {
listName: 'staffFollows',
// tableOption: true,
tableColumns: [
{
label: '跟进员工',
prop: 'staffName'
},
{
label: '所属部门',
prop: 'departmentName'
},
{
label: '添加时间',
prop: 'addTime'
},
{
label: '来源',
prop: 'addWay',
addHtml: 'addWay'
},
{
label: '添加类型',
prop: 'addType',
addHtml: 'addType'
},
{
label: '备注手机号',
prop: 'remarkMobiles'
},
{
label: '备注',
prop: 'remark'
},
{
label: '描述',
prop: 'description'
}
]
},
employTableList: [],
employTableTotal: 0,
clientGroupTableList: [],
//弹窗数据
tagsDialogTitle: '添加标签',
tagsVisible: false,
roleForm: {
tagsName: '',
initTagsGroup: '',
tagsList: []
},
companyTagsList: [
{
name: '标签一',
arr: [
{ name: '一般', checked: true, id: 1, original: true },
{ name: '重要', checked: false, id: 2 },
{ name: '核心', checked: false, id: 3 }
]
},
{
name: '标签二',
arr: [
{ name: '初次沟通', checked: true, id: 11, original: true },
{ name: '持续跟进', checked: false, id: 12 },
{ name: '意向车主', checked: false, id: 13 }
]
}
],
ownShopTagsList: [
{
name: '性别',
arr: [
{ name: '一般', checked: true, id: 21, original: true },
{ name: '重要', checked: false, id: 22 },
{ name: '核心', checked: true, id: 23, original: true }
]
},
{
name: '省份',
arr: [
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 }
]
}
]
}
},
created() {
this.getPageDetail()
},
methods: {
goDetail(id) {
console.log(id, '哈')
},
//记得把6去掉,仅为测试用
async getPageDetail(id = this.$route.query.id) {
const res = await getTableDetail({ oneId: id })
if (!res) {
return false
}
this.leftPanelInfo = res.info
this.employTableList = res.staffFollows || []
this.clientGroupTableList = res.customerBases || []
},
goNewTag() {
this.$router.push({ name: 'tagsManage' })
},
goBack() {
this.$router.push({ name: 'clientManage' })
},
//点击添加按钮
btnClick(pType, scope) {
console.log(pType, scope)
switch (pType) {
case 'create':
this.tagsDialogTitle = '添加标签'
this.getAllTags()
// this.handleClose();
break
case 'edit':
this.tagsDialogTitle = '编辑标签'
//调编辑的接口
}
},
getAllTags() {
this.companyTagsList = [
{
name: '标签一',
arr: [
{ name: '一般', checked: true, id: 1, original: true },
{ name: '重要', checked: false, id: 2 },
{ name: '核心', checked: false, id: 3 }
]
},
{
name: '标签二',
arr: [
{ name: '初次沟通', checked: true, id: 11, original: true },
{ name: '持续跟进', checked: false, id: 12 },
{ name: '意向车主', checked: false, id: 13 }
]
}
]
this.ownShopTagsList = [
{
name: '性别',
arr: [
{ name: '一般', checked: true, id: 21, original: true },
{ name: '重要', checked: false, id: 22 },
{ name: '核心', checked: true, id: 23, original: true }
]
},
{
name: '省份',
arr: [
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 },
{ name: '初次沟通', checked: true, id: 31, original: true },
{ name: '持续跟进', checked: false, id: 32 },
{ name: '意向车主意向车主意向车主意向车好', checked: false, id: 33 }
]
}
]
this.handleClose()
},
handleConfirm() {
this.$refs.roleForm.$children[0].validate(valid => {
if (!valid) {
return
}
if (this.roleForm.tagsList.length <= 0) {
this.$message.warning('至少要添加一个标签')
// this.$message({
// message: '警告哦,这是一条警告消息',
// type: 'warning'
// });
}
//满足条件进行提交
})
},
handleClose() {
if (this.tagsVisible) {
// && this.$refs.roleForm this.$refs.roleForm.$children[0].resetFields()
this.companyTagsList = []
this.ownShopTagsList = []
}
// this.roleForm.tagsList = [] //取消时清空新增标签
this.tagsVisible = !this.tagsVisible
},
checkNewTag(checked, j, arr, original = false) {
//需要后台告知是否后台提供选中标签的标志
if (checked && original) {
return false
}
arr.forEach((item, index) => {
if (index == j) {
item.checked = !item.checked
}
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
.header {
display: flex;
justify-content: space-between;
align-items: center;
// width: 1160px;
height: 72px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.userId {
margin-left: 26px;
height: 20px;
font-size: 20px;
font-weight: 500;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.backBtn {
margin-right: 20px;
height: 32px;
background: $btnBlue;
color: #fff;
border-radius: 4px;
padding: 0 20px;
border: none;
&:hover {
background-color: $lightBtnBlue;
}
}
}
.content {
display: flex;
width: 100%;
margin-top: 20px;
.leftWrap {
width: 240px;
min-height: calc(100vh - 92px);
background-color: #fff;
box-sizing: border-box;
.avator {
margin: 0 auto;
margin-top: 40px;
width: 60px;
height: 60px;
text-align: center;
line-height: 60px;
img {
border-radius: 50%;
width: 100%;
height: 100%;
}
}
p {
padding-left: 20px;
position: relative;
margin-top: 20px;
span:first-child {
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 500;
color: #333333;
line-height: 20px;
}
span:nth-child(2) {
position: absolute;
left: 100px;
display: inline-block;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
max-width: 140px;
}
}
}
.rightWrap {
margin-left: 20px;
width: calc(100% - 260px);
box-sizing: border-box;
background-color: #fff;
padding: 20px;
.showOverTooltip {
display: -webkit-box;
text-overflow: ellipsis;
overflow: hidden;
/*这里是2行*/
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
> p {
height: 20px;
line-height: 20px;
margin-bottom: 10px;
&:not(:first-child) {
margin-top: 40px;
}
span {
vertical-align: middle;
}
span:first-child {
font-size: 18px;
font-weight: 400;
color: #333333;
}
span:nth-child(2) {
margin-left: 6px;
font-size: 14px;
font-weight: 400;
color: $btnBlue;
height: 20px;
line-height: 20px;
}
}
.tagsWrap {
min-height: 112px;
border: 1px solid #e8e8ea;
padding: 20px 10px;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
.tag {
display: inline-block;
margin-top: 22px;
margin-right: 20px;
padding: 0 10px;
box-sizing: border-box;
min-width: 76px;
height: 26px;
line-height: 26px;
border-radius: 4px;
border: 1px solid $borderBlue;
text-align: center;
font-size: 14px;
font-weight: 400;
color: $btnBlue;
// overflow: hidden;
// white-space: nowrap;
// text-overflow: ellipsis;
max-width: 178px;
}
.addTag {
width: 68px;
height: 26px;
color: #fff;
background: $btnBlue;
border-radius: 4px;
&:hover {
cursor: pointer;
}
}
}
}
}
.tags {
/deep/.app-dialog {
.el-dialog__body {
.container {
padding: 20px 72px 20px 68px;
}
}
}
.dialogSubTitle {
margin-bottom: 10px;
height: 20px;
font-size: 14px;
font-weight: 500;
color: #717171;
line-height: 20px;
&:not(:first-child) {
margin-top: 20px;
}
}
.companyRowData,
.ownShopRowData {
display: flex;
// margin-top: 10px;
> span {
margin-right: 10px;
min-width: 82px;
height: 20px;
font-size: 14px;
font-weight: 400;
color: #717171;
line-height: 20px;
text-align: right;
}
.tagsBox {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
> span {
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
padding: 0 10px;
box-sizing: border-box;
min-width: 82px;
height: 26px;
line-height: 26px;
border-radius: 4px;
// border: 1px solid $btnBlue;
border: 1px solid #999999;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #999999;
max-width: 245px;
cursor: pointer;
}
.activeTag {
border: 1px solid $borderBlue;
color: $btnBlue;
}
}
}
}
}
</style>
<!--
* @Descripttion:
* @version: X3版本
* @Author: lily
* @Date: 2021-10-12 10:21:48
* @LastEditors: lily
* @LastEditTime: 2021-10-12 11:01:29
-->
<template>
<div class="wrapper">
<!-- 头部部分 -->
<div class="header">
<el-input v-model="input" placeholder="请输入内容"></el-input>
</div>
<!-- table部分 -->
<div class="main">
<div class="table-box">
<el-table class="table-list__box" ref="tableList" :data="dataList" :height="tableHeight" border stripe tooltip-effect="dark">
<el-table-column v-for="column in columns" :key="column.key" :prop="column.key" :label="column.label" :width="column.width" :min-width="150" sortable show-overflow-tooltip filter-placement="bottom"></el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination__wrapper">
<cd-pagination ref="pager" :total="pagination.total" :currPage="pagination.pageNow" :pageSize="pagination.pageSize"></cd-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
const columns = [
{ key: 'accountName', label: '登录账号', width: 120 },
{ key: 'phone', label: '登录手机', width: 120 },
{ key: 'userName', label: '用户名称', width: 120 },
{ key: 'email', label: '登录邮箱', width: 210 },
{ key: 'orgNames', label: '所属组织', width: 210 },
{ key: 'roleName', label: '所属角色', width: 210 },
{ key: 'memo', label: '备注', width: 120 },
{ key: 'updateTime', label: '最后操作时间' }
]
import demo from '@/common/demo.json'
export default {
name: 'clientDemo',
components: {},
data() {
return {
input: '',
columns,
dataList: [],
tableHeight: null,
pagination: {
pageNow: 1,
pageSize: 20,
pages: 0,
total: 0
}
}
},
mounted() {
setTimeout(() => {
let height = this.$refs.tableList.$el.parentElement.clientHeight
this.tableHeight = `${height}px`
console.log(this.tableHeight, 'tableHeight')
})
this.dataList = demo.data.rows.concat([])
}
}
</script>
<style lang="scss" scoped>
.wrapper {
background: #fff !important;
height: 100%;
display: flex;
flex-direction: column;
}
.header {
padding: 20px 8px;
background: #ccc;
}
.main {
flex: 1;
overflow: hidden;
}
.table-box {
height: 100%;
display: flex;
flex: auto;
flex-direction: column;
overflow: hidden;
}
</style>
<template>
<div>
<div class="scrm-sub-client-container">
<p class="pageTitle">客户管理</p>
<div class="pageContent">
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientManageFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot">
<!-- :id="tableParams.btnId" -->
<el-button plain @click="resetTable">重置</el-button>
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<GLTable ref="clientManage" :hasNum="true" :getListApi="getListApi" :searchForm="searchForm" :noDataImg="url" :pageConf="pageConf" :tableParams="tableParams" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="customerName" slot-scope="scope">
<span class="ellipsis-1" style="display:inline-block;max-width:70px;text-align:left;">{{ scope.scope.customerName }}</span>
<span class="blue-text">{{ scope.scope.type == 1 ? '@微信' : scope.scope.type == 2 ? '@企微' : '' }}</span>
</span>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : '女' }}</span>
</span>
<span slot="addWay" slot-scope="scope" style="display:inline-block;max-width:120px;text-align:left;">
<span>{{ toLabel(scope.scope.addWay) }}</span>
</span>
<span slot="isJoin" slot-scope="scope">
<span>{{ scope.scope.isJoin ? '是' : '否' }}</span>
</span>
<span slot="status" slot-scope="scope">
<!-- <span class="dot" :class="scope.scope.enableStatus ? DICTSTATUS[scope.scope.enableStatus].split(',')[1] : ''"></span> -->
<span class="statusText" :class="{ 'red-text': scope.scope.status, 'green-text': scope.scope.status == 0 }">{{ scope.scope.status ? CLIENTSTATUS[scope.scope.status].split(',')[1] : '正常' }}</span>
</span>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<!-- <auth-button :data="scope.scope"></auth-button> -->
<span @click="goDetail(scope.scope.oneId)" class="blue-text">详情</span>
</template>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { getTableList, getDictionaryFun } from '@/api/modules/clientManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'clientManage',
data() {
return {
url: url,
CLIENTSTATUS: this.$Constants.CLIENT_STATUS,
searchForm: {},
clientManageFormList: [
{
type: 'daterange',
prop: 'daterange',
label: '添加时间',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
type: 'select',
prop: 'status',
label: '当前状态',
placeholder: '请选择当前状态',
options: [
{
label: '全部',
value: null
},
{
label: '正常',
value: 0
},
{
label: '删除好友',
value: 1
}
]
},
{
type: 'select',
prop: 'isJoin',
label: '是否已加企微',
placeholder: '请选择',
options: [
{
label: '全部',
value: null
},
{
label: '是',
value: 1
},
{
label: '否',
value: 0
}
]
},
{
type: 'select',
prop: 'addWay',
label: '来源',
placeholder: '请选择当前来源',
options: [] //this.$Constants.SOURCE_OPTION
},
{
type: 'select',
prop: 'customerSex',
label: '性别',
placeholder: '请选择性别',
options: this.$Constants.GENDER_OPTION
},
{
type: 'input',
inputType: 'text',
prop: 'customerPhone',
label: '手机号',
placeholder: '请输入手机号'
},
{
type: 'input',
inputType: 'text',
prop: 'customerName',
label: '客户名称',
placeholder: '请输入客户名称'
},
{
type: 'input',
inputType: 'text',
prop: 'followStaff',
label: '跟进员工',
placeholder: '请输入跟进员工'
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'data',
// tableOption: true,
tableColumns: [
{
label: 'User_id',
prop: 'oneId'
},
{
label: '客户名称',
prop: 'customerName',
addHtml: 'customerName',
width: 180
},
{
label: '手机号',
prop: 'customerPhone'
},
{
label: '性别',
prop: 'customerSex',
addHtml: 'customerSex'
},
{
label: '跟进员工',
prop: 'followStaff'
},
{
label: '来源',
prop: 'addWay',
addHtml: 'addWay'
},
{
label: '是否加企微', //1. 加入,0.未加入
prop: 'isJoin',
addHtml: 'isJoin'
},
{
label: '当前状态',
prop: 'status',
addHtml: 'status'
},
{
label: '添加时间',
prop: 'addTime'
}
],
tableOption: {
btnList: [
// {
// name: "编辑",
// pType: "edit",
// },
// {
// name: "删除",
// pType: "delete",
// },
{
name: '详情',
pType: 'detail'
}
]
}
},
getListApi: getTableList,
sourceList: []
}
},
created() {
this.getDictionaryFun()
},
methods: {
setTableHeightEvent() {
this.$refs.clientManage.setTableHeightFun()
},
getDictionaryFun() {
getDictionaryFun({ dictType: 'add_way' }).then(res => {
if (!res) {
return
}
let data = res.map(item => {
return {
...item,
label: item.dictLabel,
value: item.dictValue
}
})
this.sourceList = data || []
if (data && data.length > 0) {
window.localStorage.setItem('sourceList', JSON.stringify(data))
}
this.$set(this.clientManageFormList[3], 'options', data)
// if (res.code == 0) {
// console.log('shuju', res)
// } else {
// this.$meesage({
// type: 'error',
// message: res.data.message
// })
// }
})
},
//来源 value值转为对应label
toLabel(value) {
if (!value) {
return
}
let curElement = this.sourceList.find(item => {
return item.value == value
})
return curElement.label
},
//搜索表格
searchTable() {
this.$refs.clientManage.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {}
this.$refs.clientManage.refreshTable()
},
goDetail(id) {
this.$router.push({
name: 'clientDetail',
query: {
id: id
}
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
.pageTitle {
margin-bottom: 20px;
position: relative;
height: 20px;
font-size: 20px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.pageContent {
padding: 6px 20px 30px;
background-color: #fff;
.el-button + .el-button {
margin-left: 20px;
}
// .el-button {
// font-size: 14px;
// font-weight: 400;
// padding: 9px 21px;
// background: $btnBlue;
// border-radius: 4px;
// border: none;
// }
// .el-button:first-child {
// background: #ffffff;
// border-radius: 4px;
// border: 1px solid #999999;
// font-weight: 400;
// color: #666666;
// }
.glsx-table {
margin-top: 20px;
}
}
}
</style>
<template>
<div class="container">
<div class="header">
<div class="userId">
<span>新车车主</span>
</div>
<el-button type="primary" icon="el-icon-arrow-left" @click="goBack"
>返回</el-button
>
</div>
<div class="content">
<div class="clientTable"><span>客户列表</span><span>(100人)</span></div>
<div class="itembox">
<div class="item" v-for="(item, index) in titles" :key="index">
<p>{{ item.name }} ({{ item.num }})</p>
</div>
</div>
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="clientFormList"
>
<span class="inline-b" slot="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>查询</el-button
>
</span>
</search-form>
<basic-table
ref="clientMassTable"
:tableParams="tableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="true"
>
<span slot="table-button" slot-scope="scope">
<el-button
v-for="(j, idx) in tableParams.tableOption.btnList"
:key="idx"
:type="j.type || 'text'"
:size="btn_size"
@click="btnClick(j.pType, scope.scope)"
>{{ j.name }}</el-button
>
</span>
</basic-table>
</div>
</div>
</template>
<script>
export default {
name: "crowdCircleImage",
data() {
return {
titles: [
{
name: "全部客户",
num: 100,
rate: "+10%",
isUp: true,
tips: "群提示消息1",
},
{
name: "已加企微客户",
num: 70,
rate: "+10%",
isUp: true,
tips: "群提示消息2",
},
{
name: "未加企微客户",
num: 30,
rate: "+10%",
isUp: true,
tips: "群提示消息2",
},
],
searchForm: {},
clientFormList: [
{
type: "daterange",
prop: "daterange",
pickerOptions: {
disabledDate(time) {
return (
time.getTime() > Date.now() ||
time.getTime() < new Date("2017-12-31").getTime()
);
},
},
},
{
type: "select",
prop: "gender",
placeholder: "请选择性别",
options: [
{
label: "全部",
value: 0,
},
{
label: "男",
value: 1,
},
{
label: "女",
value: 2,
},
{
label: "未知",
value: 3,
},
],
},
{
type: "select",
prop:"source",
placeholder: "请输入来源",
options: [
{
label: "全部",
value: 0,
},
{
label: "直接导入",
value: 1,
},
{
label: "扫描二维码",
value: 2,
},
{
label: "搜索手机号",
value: 3,
},
{
label: "名片分享",
value: 4,
},
{
label: "群聊",
value: 3,
},
{
label: "手机通讯录",
value: 3,
},
{
label: "微信联系人",
value: 3,
},
{
label: "来自微信的添加好友申请",
value: 3,
},
{
label: "第三方应用的客服人员",
value: 3,
},
{
label: "搜索邮箱",
value: 3,
},
{
label: "内部成员分享",
value: 3,
},
{
label: "管理员/负责人分配",
value: 3,
}
],
},
{
type: "input",
inputType: "text",
prop: "name3",
placeholder: "请输入客户名称",
},
],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
tableColumns: [
{
label: "User_id",
prop: "clientGroupName",
},
{
label: "客户名称",
prop: "clientName",
},
{
label: "性别",
prop: "createdDate",
},
{
label: "跟进员工",
prop: "source",
},
{
label: "来源",
prop: "gender",
},
{
label: "是否加入企微",
prop: "bbb",
},
{
label: "标签",
prop: "curState",
},
{
label: "添加时间",
prop: "time",
},
],
tableOption: {
width: 170,
btnList: [
// {
// name: "编辑",
// pType: "edit",
// },
// {
// name: "删除",
// pType: "delete",
// },
{
name: "详情",
pType: "detail",
},
],
},
},
getListApi: "",
};
},
methods: {
goBack() {
this.$router.push({ name: "clientPartGroup" });
},
},
};
</script>
<style lang="scss" scoped>
.container {
.header {
display: flex;
justify-content: space-between;
align-items: center;
}
.content {
width: 100%;
div.clientTable {
position: relative;
margin-bottom: 16px;
&::after {
position: absolute;
content: "";
height: 3px;
width: 140px;
background: #169bd5;
left: -10px;
top: 25px;
}
}
.itembox {
display: flex;
width: 100%;
text-align: center;
.item {
border: 1px solid #eee;
flex: 1;
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="container">
<h3>客户分群</h3>
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientPartFormList">
<span class="inline-b" slot="form-slot">
<!-- :id="tableParams.btnId" -->
<el-button type="primary" :size="btn_size" icon="el-icon-search" :id="tableParams.btnId" ref="searchButton">查询</el-button>
</span>
</search-form>
<basic-table ref="clientMassTable" :tableParams="tableParams" :getListApi="getListApi" :searchForm="searchForm" :hasNum="true">
<span slot="table-button" slot-scope="scope">
<el-button v-for="(j, idx) in tableParams.tableOption.btnList" :key="idx" :type="j.type || 'text'" :size="btn_size" @click="btnClick(j.pType, scope.scope)">{{ j.name }}</el-button>
</span>
</basic-table>
</div>
</template>
<script>
export default {
name: 'clientPartGroup',
data() {
return {
searchForm: {},
clientPartFormList: [
{
type: 'daterange',
prop: 'daterange',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
},
{
type: 'select',
prop: 'status',
placeholder: '请选择更新机制',
options: [
{
label: '全部',
value: null
},
{
label: '自动(每天更新)',
value: 1
},
{
label: '手动(每天更新)',
value: 1
}
]
},
{
type: 'input',
inputType: 'text',
prop: 'name3',
placeholder: '请输入客户分群名称'
}
],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '客户分群名称',
prop: 'clientGroupName'
},
{
label: '客户数',
prop: 'gender'
},
{
label: '更新机制',
prop: 'createdDate'
},
{
label: '创建人',
prop: 'source'
},
{
label: '更新时间',
prop: 'isAddWeChat'
}
],
tableOption: {
width: 170,
btnList: [
// {
// name: "编辑",
// pType: "edit",
// },
// {
// name: "删除",
// pType: "delete",
// },
{
name: '人群圈像',
pType: 'detail'
}
]
}
},
getListApi: ''
}
},
methods: {
name() {}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div class="content-wrap">
<div :class="['content', expande ? 'expande' : 'close']" ref="content">思路:1、判断当前内容是否超过三行。此处可以给每行设置一个行高line-height,渲染完后超过三倍的行高即认为是内容超过了三行。2、展示/收起状态的切换可以通过data中的参数来绑定。3、在底部使用position:absolute来绝对定位展开该在的位置。4、根据业务需求来设定好展开和收起按钮需要呆的地方。</div>
<div class="expande-button-wrap" v-if="needShowExpande">
<div class="expande-button" @click="expandeClick" v-if="!expande">
<span style="color: black">...</span>
展开
</div>
<div class="expande-button" @click="expandeClick" v-else>收起</div>
</div>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
expande: false,
needShowExpande: true
}
},
methods: {
expandeClick() {
console.log('expandeClick')
this.expande = !this.expande
}
},
mounted() {
this.$nextTick(() => {
let lineHeight = 22
if (this.$refs.content.offsetHeight > lineHeight * 3) {
this.expande = false
this.needShowExpande = true
} else {
this.expande = true
}
})
}
}
</script>
<style >
.content-wrap {
width: 300px;
height: 200px;
position: relative;
}
.content {
font-size: 14px;
color: black;
letter-spacing: 0;
line-height: 22px;
text-align: justify;
overflow: hidden;
/* display: -webkit-box; */
/* -webkit-line-clamp: 3;
-webkit-box-orient: vertical; */
/* text-overflow: ellipsis; */
}
.expande {
overflow: auto;
height: auto;
padding-bottom: 22px;
}
.close {
overflow: hidden;
height: 66px;
padding-bottom: 0;
}
.expande-button-wrap {
position: absolute;
bottom: 0;
right: 0;
height: 22px;
background: white;
}
.expande-button {
text-align: right;
vertical-align: middle;
color: #5995ef;
font-size: 14px;
line-height: 22px;
}
</style>
<template>
<div class="report-home">
HOME
<glsx-button type="danger" @click="test()" class="test555" id="1211" mode="link">权限按钮测试</glsx-button>
<glsx-button type="success" size="small" @click="test()" id="1211" class="test">权限按钮测试2</glsx-button>
<el-button class="test" @click="test()">东方网分</el-button>
</div>
</template>
<script>
export default {
name: 'home',
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
<template>
<div class="report-home">
<h2>
报表子应用
<span class="right">{{ gs }}</span>
</h2>
<div id="nav">
<span>切换路由:</span>
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/')">报表</el-button>
<el-button type="primary" size="medium" @click="routerChange('/about')">穿梭框</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1')">表格</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">日历</el-button>
<el-button type="primary" size="medium" @click="toAppReport({ path: 'sub01/changeData' })">aaaa</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<span>rxjs通信方案:{{ myMsg }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:{{ myMessage }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('default')">通知父应用收到</el-button>
</div>
<img src="../assets/logo.png" alt="" srcset="" />
</div>
</div>
</template>
<script>
export default {
name: 'report-home',
data() {
return {
myMsg: '',
gs: '',
myMessage: ''
}
},
methods: {
/**
* 路由切换
* url 路由地址
*/
routerChange(url) {
this.$router.push(url).catch(err => {
console.log(err)
})
},
/**
* 外部路由跳转
* this.$history.push(menu)
* menu 支持:1.string 视为id (每一个路由都有一个唯一id)
* 2.对象 {path:'sub1/home',id:'1-1-1'} 以id为准 跳转对应模块
* 3.对象 {path:'sub1/home'} 以path为准 跳转对应模块
* 以上三种情况都跳转到对应的模块
*/
toAppReport(menu) {
this.$history.push(menu)
},
/**
* 通知父应用变天了
* type 通信方案
*/
callParentChange(type) {
if (type === 'default') {
this.myMessage = '子应用scrm-sub-blog收到'
this.$messenger.send({
route: {
id: '3-1',
url: '/test1.html'
},
message: {
from: 'scrm-sub-blog',
token: '倘若有你,西湖一路无雨'
}
})
return
}
this.myMsg = '倘若有你,西湖一路无雨'
this.$globalState.dispatch({
from: 'scrm-sub-blog',
message: this.myMsg,
time: new Date()
})
}
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
</style>
<template>
<div class="scrm-sub-client-container">
<p class="pageTitle">标签管理</p>
<button class="addTagsBtn" @click="btnClick('create')">添加标签组</button>
<!-- <button class="addTagsBtn" @click="btnClick('edit')">修改标签组</button> -->
<span class="toptips">
<span>共有{{ numberObj.groupCount || 0 }}个标签组,{{ numberObj.bizLabelCount || 0 }}个企业标签,{{ numberObj.rcLabelCount || 0 }}个自店标签</span>
<span class="iconPanelWrap" v-if="!isFirstShow">
<img src="@/assets/tagsManage/question.png" alt="" />
<span class="tipsPanel">企业标签为全局标签,员工可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;行业标签为通过大数据算法规则生成的标签</span>
</span>
</span>
<div class="initPanel" v-if="isFirstShow">
可在企微APP端客户详情、客户跟进等模块查看和打标签,最多3000个;自店标签为企业商户自有标签,员工可在企微APP端客户跟进等模块查看和打标签,最多3000个;行业标签为通过大数据算法规则生成的标签
<img src="@/assets/tagsManage/Shape.png" alt="" />
<i class="el-icon-close" @click="closeInitPanel"></i>
</div>
<div class="pageContent">
<!-- @setTableHeightEvent="setTableHeightEvent" -->
<search-form class="searchTop border-shadow" :formModel="searchForm" :formList="clientPartFormList" @setTableHeightEvent="setTableHeightEvent">
<span class="inline-b" slot="form-slot">
<el-button @click="resetTable" plain>重置</el-button>
<!-- :id="tableParams.btnId" -->
<el-button type="primary" @click="searchTable">查询</el-button>
</span>
</search-form>
<glsx-table @setTableFinishFun="setTableFinishFun" ref="tagsManage" :hasNum="true" :getListApi="getListApi" :searchForm="searchForm" :pageConf="pageConf" :noDataImg="url" noDataText="你当前还没有添加的标签" :tableParams="tableParams" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }">
<span slot="labelGroup" slot-scope="scope">
<span>{{ scope.scope.labelGroup.name }}</span>
</span>
<span slot="labelList" slot-scope="scope">
<div id="allTagsWrap" class="allTagsWrap" :class="[expande ? 'expande' : 'close']">
<span v-for="(item, index) in scope.scope.labelList" :key="index" class="ellipsis-1 tag-box-wrap">
<el-tooltip class="item" :content="item.name" placement="top">
<span>{{ item.name }}</span>
</el-tooltip>
</span>
<div class="expande-button-wrap" v-if="needShowExpande">
<div class="expande-button" @click="expandeClick" v-if="!expande">
<i class="el-icon-arrow-down"></i>
<span>展开</span>
</div>
<div class="expande-button" @click="expandeClick" v-else>
<i class="el-icon-arrow-up"></i>
<span>收起</span>
</div>
</div>
</div>
</span>
<template slot="auth-button" slot-scope="scope">
<span @click="btnClick('edit', scope.scope)" class="blue-text" v-if="scope.scope.labelType != '行业标签'">编辑标签组</span>
</template>
<!-- <div slot="additionalContent">
<div class="additional-text">标签用于对客户进行分类,以便用户能够更好的识别客户类型</div>
<button class="btn-blue">创建标签</button>
</div> -->
</glsx-table>
</div>
<basic-dialog class="role" :title="tagDialogTitle" :width="'712px'" :isVisible="tagVisible" @confirmDialog="handleConfirm" @closeDialog="handleClose">
<slot>
<rule-form :ruleForm="tagForm" :rules="tagRules" :ruleData="tagDialogData" :labelWidth="'120px'" labelPosition="right" ref="tagForm">
<div slot="tagsGroup-type">
<el-select v-model="tagForm.initTagsGroup" placeholder="请选择" :disabled="tagDialogTitle != '添加标签组'">
<el-option v-for="item in tagsGroupList" :key="item.id" :label="item.name" :value="item.name"></el-option>
</el-select>
<span class="tagTipMsg" v-if="tagDialogTitle == '添加标签组'">企业标签和自店标签分别最多3000个</span>
<span class="tagTipMsg" v-else>
{{ tagForm.initTagsGroup }}最多3000个,已创建
<span class="pure-blue-text">{{ editTagList.length }}</span>
个
</span>
<!-- 企业标签最多3000个,已创建3个 -->
<!-- 自店标签最多3000个,已创建3个 -->
</div>
<div slot="tagsInput-type">
<div class="tagsWrap" v-if="tagDialogTitle == '编辑标签组'">
<span class="tag" :class="{ inputWrapShow: item.inputVisible }" v-for="item in editTagList" :key="item.id">
<el-input class="input-new-tag" v-if="item.inputVisible" v-model.trim="item.name" ref="saveTagInput" size="small" @blur="handleInputConfirm(item.name, item.id)" @keyup.enter.native="handleInputConfirm(item.name, item.id)"></el-input>
<el-tooltip class="item" :content="item.name" placement="top">
<span class="ellipsis-1" v-if="!item.inputVisible">{{ item.name }}</span>
</el-tooltip>
<img class="editIcon" src="@/assets/tagsManage/edit.png" @click="showInput(item.id)" alt="" v-show="!item.inputVisible" />
</span>
</div>
<!-- @blur="handleInputConfirm" -->
<div class="row-tag" v-for="(item, index) in tagForm.tagsList" :key="index">
<el-input v-model="item.name" placeholder="添加标签名称(至少添加一个标签)" maxlength="30" show-word-limit></el-input>
<span class="el-icon-circle-close" @click="deleteRow(index)"></span>
</div>
<!-- 需要后台告诉已经创建多少个标签了 -->
<div class="addtagIcon" :style="{ color: tagForm.tagsList.length >= 3000 ? '#EEE' : '' }" @click="addRow">
<i class="el-icon-circle-plus-outline"></i>
<span class="addTagText">新增标签</span>
</div>
</div>
</rule-form>
</slot>
</basic-dialog>
</div>
</template>
<script>
import { getTableList, getTableTagNum, newAddTag, updateTag } from '@/api/modules/tagsManage'
import url from '@/assets/clientDataOverview/nodata.png'
export default {
name: 'tagsManage',
data() {
var checkTagsInput = (rule, value, callBack) => {
console.log('value值为:', value, typeof value, value.length)
if (value && value.length == 0) {
return callBack(new Error('请添加标签'))
} else {
return callBack()
}
}
return {
numberObj: {},
url: url,
isFirstShow: true,
searchForm: { 'labelTreeReq.shopId': 10001001 },
clientPartFormList: [
{
type: 'select',
prop: 'labelTreeReq.labelType',
label: '标签组',
placeholder: '请选择标签组类型',
options: [
{
label: '企业标签',
value: '企业标签'
},
{
label: '自店标签',
value: '自店标签'
},
{
label: '行业标签',
value: '行业标签'
}
]
},
{
type: 'input',
inputType: 'text',
prop: 'labelTreeReq.labelGroupName',
label: '搜索',
placeholder: '请输入标签组或标签名称'
}
],
pageConf: { pageSize: 'labelTreeReq.pageSize', pageNum: 'labelTreeReq.pageNum', totalCount: 'labelGroupCount' },
tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'labelTreeRets',
tableColumns: [
{
label: '标签组',
prop: 'labelGroup',
addHtml: 'labelGroup'
},
{
label: '标签组类型',
prop: 'labelType'
},
{
label: '标签',
prop: 'labelList',
addHtml: 'labelList',
align: 'left'
}
],
tableOption: {
width: 170
}
},
getListApi: getTableList,
// 弹窗数据
tagDialogTitle: '添加标签组',
tagVisible: false,
tagForm: {
// tagsName: '',
// initTagsGroup: '',
tagsList: []
},
tagDialogData: [
{
label: '标签组名称',
prop: 'tagsName',
type: 'input',
placeholder: '添加标签组名称,最多30个字符',
maxlength: 30,
showWordLimit: true,
disabled: false
},
{
label: '标签组类型',
prop: 'initTagsGroup',
type: 'customize',
slotName: 'tagsGroup-type'
},
{
label: '标签',
prop: 'tagsList',
type: 'customize',
slotName: 'tagsInput-type'
}
],
tagRules: {
tagsName: [
{ required: true, message: '请输入名称', trigger: 'blur' },
{
validator: this.$Commons.checkName,
trigger: 'blur'
}
],
initTagsGroup: [{ required: true, message: '请选择标签组类型', trigger: 'change' }]
// tagsInputList: [
// { required: true, validator: checkTagsInput, trigger: "blur" },
// ],
// tagsList: [{ required: true, message: '至少添加一个标签', trigger: 'blur' }]
},
tagsGroupList: [
{ id: 1, name: '企业标签' },
{ id: 2, name: '自店标签' }
],
//编辑便签输入的值
editTagList: [],
tagGroupId: 0, //标签组id,编辑提交接口要用
//控制展开收起按钮
expande: true,
needShowExpande: false,
FormHeight: 0
}
},
created() {
this.getTableTagNumFun()
},
watch: {
// FormHeight: {
// handler(val) {
// let lineHeight = 50 //22
// if (val > lineHeight * 2) {
// this.expande = false
// this.needShowExpande = true
// } else {
// this.needShowExpande = false
// this.expande = true
// }
// }
// }
},
methods: {
expandeClick() {
// console.log('expandeClick')
this.expande = !this.expande
},
closeInitPanel() {
this.isFirstShow = false
setTimeout(() => {
this.$refs.tagsManage.setTableHeightFun()
}, 200)
},
setTableHeightEvent() {
this.$refs.tagsManage.setTableHeightFun()
},
setTableFinishFun(content) {
console.log('表格完成', content)
this.$nextTick(() => {
let lineHeight = 50
if (document.getElementById('allTagsWrap').offsetHeight > lineHeight * 2) {
console.log('包含该行标签的div的高度:', document.getElementById('allTagsWrap').offsetHeight)
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
})
},
getTableTagNumFun() {
getTableTagNum({ shopId: 10001001 }).then(res => {
if (!res) {
return false
}
this.numberObj = res
})
},
//搜索表格
searchTable() {
this.$refs.tagsManage.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = { 'labelTreeReq.shopId': 10001001 }
// searchForm: { 'labelTreeReq.shopId': 10001001 },
this.$refs.tagsManage.refreshTable()
},
btnClick(pType, rowData) {
console.log(pType, rowData, 'btnClick')
switch (pType) {
case 'create':
this.tagDialogTitle = '添加标签组'
this.tagForm.tagsForm = ''
this.tagForm.initTagsGroup = ''
this.$set(this.tagDialogData[0], 'disabled', false)
this.handleClose()
break
case 'edit':
this.tagDialogTitle = '编辑标签组'
this.$set(this.tagDialogData[0], 'disabled', true)
this.editEvent(rowData)
this.handleClose()
//关闭验证规则
// this.tagRules = {}
//调编辑的接口
break
}
},
//编辑触发事件
editEvent(rowData) {
// this.handleClose()
this.editTagList = rowData.labelList.map(item => {
return { ...item, inputVisible: false }
})
this.tagGroupId = rowData.labelGroup.id //标签组id
this.tagForm.tagsName = rowData.labelGroup.name //标签组名
this.tagForm.initTagsGroup = rowData.labelType //标签组类型
},
handleConfirm() {
console.log(this.$refs.tagForm.$children, 'kkk')
this.$refs.tagForm.$children[0].validate(valid => {
if (!valid) {
return
}
if (this.tagForm.tagsList.length <= 0 && this.tagDialogTitle == '添加标签组') {
this.$message.error('至少要添加一个标签')
return
}
if (this.tagDialogTitle == '添加标签组') {
this.newAddTagFun()
} else {
//修改标签(允许同时增加标签)
this.updateTagFun()
if (this.tagForm.tagsList.length > 0) {
//过滤掉没有输入值得标签输入框
this.tagForm.tagsList = this.tagForm.tagsList.filter(item => item.name != '')
this.newAddTagFun()
}
}
this.handleClose()
})
},
handleClose() {
if (!this.tagVisible && this.$refs.tagForm) {
this.$refs.tagForm.$children[0].resetFields()
console.log(this.tagForm.initTagsGroup, '7777')
}
// if (!this.tagVisible && this.tagDialogTitle == '添加标签组') {
// this.tagForm.tagsName = ''
// this.tagForm.initTagsGroup = ''
// }
//关闭时
// if (this.tagVisible) {
// this.tagForm.tagsName = ''
// this.tagForm.initTagsGroup = ''
// }
this.tagForm.tagsList = [] //取消时清空新增标签
this.tagVisible = !this.tagVisible
},
newAddTagFun() {
//满足条件进行提交
let params = {}
params['labelDTO.dataFrom'] = 'cs'
params.shopId = '10001001'
// params.staffId = '员工A'
params['labelDTO.labelGroup.name'] = this.tagForm.tagsName
params['labelDTO.labelType'] = this.tagForm.initTagsGroup
params['labelDTO.labelList'] = this.tagForm.tagsList
newAddTag(params).then(res => {
if (!res) {
return
}
this.$message.success('添加成功')
// this.tagForm.tagsName = ''
// this.tagForm.initTagsGroup = ''
// this.tagForm.tagsList = []
this.resetTable() //刷新下表格
})
},
updateTagFun() {
let param = {}
param['labelDTO.dataFrom'] = 'cs'
param['labelDTO.labelGroup.id'] = this.tagGroupId
param['labelDTO.labelGroup.name'] = this.tagForm.tagsName
param['labelDTO.labelType'] = this.tagForm.initTagsGroup
let editTagList = this.editTagList.map(item => {
return {
id: item.id,
name: item.name
}
})
param['labelDTO.labelList'] = editTagList
updateTag(param).then(res => {
if (!res) {
return
}
this.$message.success('修改成功')
this.tagForm.tagsName = ''
this.tagForm.initTagsGroup = ''
this.tagForm.tagsList = []
this.resetTable() //刷新下表格
})
},
//删除一行标签
deleteRow(index) {
this.tagForm.tagsList.splice(index, 1)
},
//添加一行标签
addRow() {
// if (this.tagForm.tagsList && this.tagForm.tagsList.length > 99) {
// this.$message.warning('不允许添加超过100个')
// return
// }
this.tagForm.tagsList.push({ name: '' })
},
showInput(id) {
// this.inputVisible = true
this.editTagList.forEach(item => {
if (item.id == id) {
item.inputVisible = true
}
})
//聚焦到输入框
this.$nextTick(_ => {
this.$refs.saveTagInput[0].focus()
})
},
handleInputConfirm(inputValue, id) {
let value = inputValue
if (String(value).length == 0) {
this.$message.warning('不能清空标签')
return
}
this.editTagList.forEach(i => {
if (i.id == id) {
i.inputVisible = false
}
})
}
}
}
</script>
<style lang="scss" scoped>
@import '@/styles/variables.scss';
@import '@/styles/resetelement.scss';
.scrm-sub-client-container {
.pageTitle {
position: relative;
margin-top: 30px;
margin-bottom: 20px;
height: 20px;
font-size: 20px;
font-weight: 700;
color: #333333;
line-height: 20px;
letter-spacing: 1px;
}
.addTagsBtn {
height: 32px;
background: $btnBlue;
border-radius: 4px;
padding: 0 20px;
color: #fff;
&:hover {
background-color: $lightBtnBlue;
}
}
.toptips {
display: inline-block;
position: relative;
margin-left: 10px;
height: 20px;
width: 340px;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
.tipsPanel {
position: absolute;
display: inline-block;
padding: 6px 10px 10px;
box-sizing: border-box;
height: 66px;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 22px;
display: none;
z-index: 100;
background: #fff;
width: 560px;
height: 82px;
right: -280px;
top: -84px;
}
.iconPanelWrap {
img {
display: inline-block;
margin-left: 20px;
vertical-align: middle;
}
&:hover {
.tipsPanel {
display: block !important;
}
}
}
}
.initPanel {
position: relative;
margin-top: 20px;
width: 616px;
min-height: 80px;
box-sizing: border-box;
background: #e6e9ff;
border: 1px solid $borderBlue;
border-radius: 4px;
padding: 10px 38px;
height: 60px;
font-size: 14px;
font-weight: 400;
color: rgba(0, 0, 0, 0.65);
line-height: 20px;
img {
position: absolute;
left: 16px;
top: 13px;
}
i {
position: absolute;
top: 14px;
right: 18px;
width: 9px;
height: 9px;
cursor: pointer;
}
}
.pageContent {
padding: 6px 20px 30px;
margin-top: 20px;
background-color: #fff;
.el-button + .el-button {
margin-left: 20px;
}
.allTagsWrap {
position: relative;
.expande-button-wrap {
position: absolute;
right: 0;
bottom: 0;
.expande-button {
color: $btnBlue;
cursor: pointer;
i {
height: 8px;
}
span {
height: 20px;
font-size: 14px;
font-weight: 400;
color: $btnBlue;
line-height: 20px;
}
}
}
}
.tag-box-wrap {
display: inline-block;
margin-right: 10px;
// margin-bottom: 10px;
padding: 0 10px;
box-sizing: border-box;
min-width: 76px;
height: 26px;
line-height: 26px;
border-radius: 4px;
border: 1px solid #999999;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #999999;
max-width: 245px;
cursor: pointer;
}
}
.role {
::v-deep .el-input--small,
.el-input__inner {
width: 423px;
}
::v-deep .container {
position: relative;
.tagTipMsg {
position: absolute;
display: inline-block;
width: 240px;
left: 200px;
top: 0;
font-size: 12px;
font-weight: 400;
color: #999999;
}
}
::v-deep .el-select > .el-input--small {
width: 190px;
}
::v-deep .el-form-item--small:nth-child(2) {
display: inline-block;
width: 310px;
position: relative;
}
.tagsWrap {
display: flex;
flex-wrap: wrap;
align-content: flex-start;
img {
display: none;
}
::v-deep .tag {
text-align: center;
display: inline-block;
padding: 0 10px;
min-width: 68px;
max-width: 200px;
margin-right: 10px;
margin-bottom: 10px;
height: 32px;
background: #ffffff;
border-radius: 2px;
border: 1px solid #e8e8ea;
position: relative;
box-sizing: border-box;
.input-new-tag {
// position: relative;
width: 100%;
}
.ellipsis-1 {
display: inline-block;
width: 100%;
font-weight: 400;
color: #666666;
font-size: 12px;
}
&:hover {
.editIcon {
display: inline-block;
cursor: pointer;
position: absolute;
top: -8px;
right: -8px;
}
}
.el-input {
max-width: 200px;
}
}
.inputWrapShow {
//显示输入框时,不显示外面框的左右边距
padding: 0 0;
}
}
.row-tag {
display: flex;
&:not(:first-child) {
margin-top: 5px;
}
align-items: center;
.el-icon-circle-close {
margin-left: 15px;
font-size: 18px;
color: #999999;
cursor: pointer;
}
}
.addtagIcon {
width: 75px;
height: 40px;
display: flex;
justify-content: space-between;
align-items: center;
color: $btnBlue;
cursor: pointer;
i {
font-size: 20px;
}
.addTagText {
font-size: 12px;
}
}
}
}
</style>
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
// const baseUrl = process.env.VUE_APP_BASE_URL;
const baseUrl = '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcss.com'
const cdn = {
css: [
`${CDN_DOMAIN}/element-ui/2.11.1/theme-chalk/index.css`
],
js: [
`${CDN_DOMAIN}/vue/2.6.10/vue.min.js`,
`${CDN_DOMAIN}/vue-router/3.0.6/vue-router.min.js`,
`${CDN_DOMAIN}/element-ui/2.11.1/index.js`,
`${CDN_DOMAIN}/vuex/3.1.1/vuex.min.js`,
`${CDN_DOMAIN}/axios/0.19.0/axios.min.js`,
// `${CDN_DOMAIN}/echarts/4.3.0-rc.1/echarts.min.js`
// `https://lib.baomitu.com/echarts/5.2.0/echarts.esm.min.js`
`https://lib.baomitu.com/echarts/5.2.0/echarts.min.js`
]
}
module.exports = {
outputDir: `../dist/${packageName}`,
publicPath: node_env ? baseUrl : '/',
assetsDir: 'static',
configureWebpack: {
resolve: {
alias: {
'@': resolve('src'),
assets: resolve('src/assets'),
views: resolve('src/views'),
components: resolve('src/components')
}
},
output: {
library: `${packageName}-[name]`,
libraryTarget: 'umd', // 把微应用打包成 umd 库格式
jsonpFunction: `webpackJsonp_${packageName}`
},
externals: {
'vue': 'Vue',
'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
'vuex': 'Vuex',
'axios': 'axios',
'echarts': 'echarts'
}
},
devServer: {
hot: true,
disableHostCheck: true,
host: process.env.VUE_APP_HOST,
port: process.env.VUE_APP_PORT,
headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
}
},
chainWebpack: config => {
config.plugin('html')
.tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.module
.rule('fonts')
.test(/.(ttf|otf|eot|woff|woff2)$/)
.use('url-loader')
.loader('url-loader')
.tap(options => {
options = {
// limit: 10000,
name: '/static/fonts/[name].[ext]'
}
return options
})
.end()
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!