Commit ff68816c by 李长胜

提交客户运营项目

0 parents
Showing 103 changed files with 4725 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: '已过期'
}
}
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">
<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>
<!--
* @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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!