Commit 49730702 by yangming

reset

1 parent 849ed028
Showing 82 changed files with 4044 additions and 0 deletions
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
VUE_APP_PORT = 6658
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file
{
"root": true,
"env": {
"node": true
},
"globals": {
"AMap": 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
package-lock.json
# 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?
{
"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"]
};
\ No newline at end of file
{
"name": "account",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"cnpm": "^7.1.0",
"core-js": "^3.4.4",
"glsx-common": "^1.4.6",
"glsx-components": "^1.1.8",
"glsx-table": "^1.0.9",
"vue": "^2.6.11",
"vue-amap": "^0.5.10"
},
"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",
"element-theme-chalk": "^2.15.6",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"glsx-components": "^1.1.8",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1"
},
"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">
<meta name="referrer" content="no-referrer">
<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 = 6658
app.listen(port)
console.log(`服务已运行:\r\n http://127.0.0.1:${port}`)
<template>
<div id="app">
<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;
}
#app {
background: #F4F5FA;
padding: 0px 20px 20px 40px;
position: absolute;
box-sizing: border-box;
width: 100%;
top: 0px;
left: 0px;
overflow-y: auto;
height: 100%;
}
</style>
\ No newline at end of file
/*
所有模块都定义在 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_config } from '@/main'
const getMerchantTree = params => {
params.method = 'entmicro.api.common.findMerchantTreeByMerchantNo.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getDepartment = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const toGL = params => {
params.method = 'entmicro.api.common.relevanceEntmicro.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantInfo = params => {
params.method = 'entmicro.api.common.findMerchantInfoByMerchantNo.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getMerchantTree,
getDepartment,
toGL,
merchantInfo
}
\ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http_common } from '@/main'
const pictureUpload = params => {
params.method = "glsx.accounts.biz.common.pictureUpload"
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default {
pictureUpload
}
\ No newline at end of file
import { http } from '@/main'
var defaultPath = 'merchants.api.'
const getListApi = params => {
params.method = `${defaultPath}staff.findStaffByPage`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getAllMerchantListApi = params => {
params.method = `${defaultPath}menu.findAllMerchant`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getRoleListApi = params => {
params.method = 'merchants.api.role.list'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getAllDictApi = params => {
params.method = `${defaultPath}menu.findAllDictData`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getMerchantTreeApi = params => {
params.method = `${defaultPath}merchant.findMerchantTree`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getDetailInfoApi = params => {
params.method = `${defaultPath}staff.staffSearchRequest`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getDetailLogApi = params => {
params.method = `${defaultPath}menu.findLog`
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const addEmployeeApi = params => {
params.method = `${defaultPath}staff.saveStaff`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const updateEmployeeApi = params => {
params.method = `${defaultPath}staff.updateStaff`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const deleteEmployeeApi = params => {
params.method = `${defaultPath}staff.deleteStaff`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const exportEmployeeApi = params => {
params.method = `${defaultPath}staff.exportData`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const updateStatusApi = params => {
params.method = `${defaultPath}staff.updateStatus`
return http({
url: 'rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi, addEmployeeApi, updateEmployeeApi, deleteEmployeeApi, exportEmployeeApi, updateStatusApi }
/**
* 新增参数sign 判断接口是否需要sign签名(默认有,不必写)
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
export function getThirdTable(params) {
params.method = 'merchants.api.menu.findLog'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
// const getThirdTable =(params)=>{
// params.method = 'merchants.api.menu.findLog'
// return http({
// url: '/rop-merchants/router',
// method: 'POST',
// data: params,
// sign: true,
// })
// }
//获取功能权限树
const findMenuFunTreeByMerId = params => {
params.method = 'merchants.api.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//获取商户信息
const getFirstInfo = params => {
params.method = 'merchants.api.merchant.findMerchantDetail'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//获取上下级信息
const getSecondInfo = params => {
params.method = 'merchants.api.menu.findSubordinateRelationship'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecondTree = params => {
params.method = 'merchants.api.merchant.findMerchantTree'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecondTable = params => {
params.method = 'merchants.api.staff.findMerchantStaffList'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
// getThirdTable,
getFirstInfo,
findMenuFunTreeByMerId,
getSecondInfo,
getSecondTree,
getSecondTable
}
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const roleDataList = params => {
params.method = 'merchants.api.role.page'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantDataList = params => {
params.method = 'merchants.api.menu.findAllMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const roleInfoData = params => {
params.method = 'merchants.api.role.getById'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const roleTreeDataById = params => {
params.method = 'merchants.api.merchant.findMenuFunTreeByRoleId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantRootById = params => {
params.method = 'merchants.api.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const createRole = params => {
params.method = 'merchants.api.role.insert'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const updateRole = params => {
params.method = 'merchants.api.role.update'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const deleteRole = params => {
params.method = 'merchants.api.role.deleteById'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
roleDataList,
merchantDataList,
roleInfoData,
roleTreeDataById,
merchantRootById,
createRole,
updateRole,
deleteRole
}
\ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const findMerchantByPage = params => {
params.method = 'merchants.api.menu.findMerchantByPage'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const findAllDictData = params => {
params.method = 'merchants.api.menu.findAllDictData'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//主营品牌
const getCarbrandTree = params => {
params.method = 'merchants.api.merchantCommon.getCarbrandTree'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//详情
const findMerchantDetail = params => {
params.method = 'merchants.api.merchant.findMerchantDetail'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//下一步
const saveMerchant = params => {
params.method = 'merchants.api.merchant.saveMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const updateMerchant = params => {
params.method = 'merchants.api.merchant.updateMerchant'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const accountTypeSearchRequest = params => {
params.method = 'merchants.api.merchant.accountTypeSearchRequest'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//功能权限
const findPermissionsByMerId = params => {
params.method = 'merchants.api.merchant.findPermissionsByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//功能权限
const findMenuFunTreeByMerId = params => {
params.method = 'merchants.api.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//草稿保存
const updatePermissions = params => {
params.method = 'merchants.api.merchant.updatePermissions'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
findMerchantByPage,
findAllDictData,
getCarbrandTree,
findMerchantDetail,
saveMerchant,
updateMerchant,
findPermissionsByMerId,
findMenuFunTreeByMerId,
updatePermissions,
accountTypeSearchRequest
}
\ No newline at end of file
img {
width: 100%;
height: 100%;
vertical-align: top;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-hide-2 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.scrm-textRight {
position: relative;
text-align: right;
}
.scrm-textCenter {
text-align: center;
}
.scrm-c3 {
color: #333333;
}
.scrm-f12 {
font-size: 12px;
}
.scrm-f13 {
font-size: 13px;
}
.scrm-f14 {
font-size: 14px;
}
.scrm-f15 {
font-size: 15px;
}
.scrm-f16 {
font-size: 16px;
}
.scrm-f18 {
font-size: 18px;
}
.scrm-f20 {
font-size: 20px;
}
.scrm-f22 {
font-size: 22px;
}
.scrm-f24 {
font-size: 24px;
}
.scrm-m10 {
margin: 10px;
}
.scrm-m20 {
margin: 20px;
}
.scrm-ml10 {
margin-left: 10px;
}
.scrm-ml20 {
margin-left: 20px;
}
.scrm-mr10 {
margin-right: 10px;
}
.scrm-mr20 {
margin-right: 20px;
}
.scrm-p10 {
padding: 10px;
}
.scrm-p20 {
padding: 20px;
}
.scrm-box-f {
background: #FFFFFF;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.10);
}
.scrm-flex {
display: flex;
}
.scrm-grid {
display: grid;
}
.scrm-flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.scrm-flex-between {
display: flex;
align-items: center;
justify-content: space-between;
}
.el-checkbox:last-of-type {
margin-right: 8px;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 4px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, .3);
}
\ No newline at end of file
.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
<template>
<div disabled class="btn-unselect" :class="{ 'selectd-type': typeStatus,'no_click': stopClick }" @click="tabType">
<span class="select-type-title">{{ btnLabel }}</span
><i class="btn-icon" :class="{ 'el-icon-check': typeStatus }"></i>
</div>
</template>
<script>
export default {
name: "auto-button",
props: {
btnLabel: {
type: String,
default: "",
},
btnValue: {
type: Number,
default: 0,
},
typeStatus: {
type: Boolean,
default: false,
},
stopClick: {
type: Boolean,
default: false,
}
},
data() {
return {};
},
methods: {
tabType() {
if(this.stopClick) {
return;
}
this.typeStatus = !this.typeStatus;
this.$emit("getBtnStatus", this.typeStatus, this.btnValue);
},
},
};
</script>
<style lang="scss" scoped>
.btn-unselect {
display: inline-block;
cursor: pointer;
position: relative;
height: 30px;
line-height: 30px;
margin-top: 6px;
margin-right: 10px;
padding-right: 30px;
cursor: pointer;
font-size: 0;
-webkit-transition: 0.1s linear;
transition: 0.1s linear;
box-sizing: border-box;
&.selectd-type {
.select-type-title {
background: #5850ff;
}
}
&.no_click {
cursor: not-allowed!important;
}
.select-type-title {
display: inline-block;
padding: 0 16px;
height: 100%;
font-size: 14px;
border-radius: 2px 0 0 2px;
background-color: #d2d2d2;
color: #fff;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.btn-icon {
display: inline-block;
position: absolute;
right: 0;
top: 0;
width: 30px;
height: 28px;
line-height: 28px;
border: 1px solid #dcdfe6;
border-left: none;
border-radius: 2px 0px 0px 2px;
color: #5850ff;
font-size: 20px;
text-align: center;
}
}
</style>
\ No newline at end of file
/**
* 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'
import glsxTable from '@/components/glsx-table/index.vue'
Vue.component('glsx-button', _button)
// Vue.component('glsx-table', glsxTable)
\ No newline at end of file
<template>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: '',
address: '',
lnglat: []
}
},
methods: {
mapInit() {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 20
})
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
// 添加列表点选监听事件
map.on('click', this.getAddress)
},
searchAddress() {
let _this = this
placeSearch.search(this.input, function (status, result) {
console.log(result)
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
console.log(position)
marker = new AMap.Marker({
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.add(marker);
map.setFitView();
},
getAddress(e) {
console.log(e)
let self = this
let lnglat
if (e.type == 'click') {
lnglat = e.lnglat
} else {
let { lng, lat } = e
lnglat = [lng, lat]
}
if (marker) {
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
self.address = result.regeocode.formattedAddress
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
}
},
mounted() {
this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
position: absolute;
line-height: 20px;
bottom: -30px;
}
</style>
\ No newline at end of file
/*
* @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-06 17:38:28
*/
// 本地环境配置
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: '/api',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static',
headers: {
sessionId: '123'
}
}
\ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-06 17:38:28
*/
// 本地环境配置
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: 'https://scrm.test.glsx.com.cn',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
\ No newline at end of file
/*
* @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')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file
/*
* @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 apis from './api'
import './public-path'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
import VueAMap from "vue-amap";
import filters from './utils/filters' //新增过滤器
Vue.use(VueAMap);
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: "bd290dc27d0945959280753215ddda71", // 这里写你申请的高德地图的key
plugin: ["AMap.PlaceSearch", "AMap.Geocoder", "AMap.Geolocation"],
v: "1.4.15"
});
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount }
from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
export const http_config = params => Vue.prototype.$http_config(params)
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key]);
});
\ No newline at end of file
File mode changed
import Vue from 'vue'
import { Message, Autocomplete, Popover, Tag, Tooltip, Table, TableColumn, Steps, Step, Loading, Drawer, Pagination, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Row, Col, DatePicker, Tree } 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(Row)
Vue.use(DatePicker)
Vue.use(Tree)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Loading)
Vue.use(Drawer)
Vue.use(Pagination)
Vue.use(Steps)
Vue.use(Step)
Vue.use(Tooltip)
Vue.use(Autocomplete)
Vue.use(Tag)
Vue.use(Popover)
export const message = Message
\ No newline at end of file
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(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes
}, [])
}
export { VueRouter, routes, getRoutes }
\ No newline at end of file
const staticRoutes = Object.freeze([{
name: 'account',
path: '/account/index',
meta: {},
component: resolve => require([`@/views/account/index.vue`], resolve)
},
{
name: 'addAccount',
path: '/account/addAccount/:id',
meta: {},
component: resolve => require([`@/views/account/addAccount.vue`], resolve)
},
{
name: 'editAccount',
path: '/account/editAccount/:id',
meta: {},
component: resolve => require([`@/views/account/editAccount.vue`], resolve)
},
{
name: 'detailAccount',
path: '/account/detailAccount/:id',
meta: {},
component: resolve => require([`@/views/account/detailAccount.vue`], resolve)
},
{
name: 'role',
path: '/role/index',
component: resolve => require([`@/views/role/index.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/create/:id',
component: resolve => require([`@/views/role/create.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/look:id',
component: resolve => require([`@/views/role/look.vue`], resolve),
meta: {}
},
{
name: 'Account2EmployeeIndex',
path: '/employee/index',
meta: {},
component: resolve => require([`@/views/employee/index.vue`], resolve)
},
{
name: 'Account2EmployeeEditEmployee',
path: '/employee/editEmployee/:addOrEdit/:id',
meta: {},
component: resolve => require([`@/views/employee/editEmployee.vue`], resolve)
},
{
name: 'Account2EmployeeDetailEmployee',
path: '/employee/detailEmployee/:id',
meta: {},
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve)
},
{
name: 'baseInfo',
path: '/baseInfo/index',
meta: {},
component: resolve => require([`@/views/baseInfo/index.vue`], resolve)
},
{
name: 'relevance',
path: '/baseInfo/relevance',
meta: {},
component: resolve => require([`@/views/baseInfo/relevance.vue`], resolve)
}
])
export default staticRoutes
\ No newline at end of file
/*
* @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 GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss'
let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) {
const { response, request, sign, secret, request_common, request_config, sign_common } = await fetchConfig()
console.log(request)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
console.log(globalState)
Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: "md5", request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
Vue.prototype.$http_config = new common.Http({ response, request: request_config, sign, secret, alert: ElementUI.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)
subscribe({ messenger })
}
export async function mount(props) {
console.log('11111', 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)
})
}
\ No newline at end of file
/*
* @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
\ No newline at end of file
/*
* @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 } 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: { TGT: 'scrm-base-61a28f77-294f-4510-aa1c-6a35cff86f25-rop' } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
\ No newline at end of file
/*
* @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: {}
}
/**
* 省略多余字符,用...显示
* @param {String} value
* @param {number} len
*/
const ellipsis=(value, len)=> {
if (!value) return ''
if (value.length > len) {
return value.slice(0, len) + '...'
}
return value
}
//过滤器
/* 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!==0 && !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,
ellipsis
};
import { Message } from 'element-ui'
let util = {}
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function(sign = '-') {
let day = new Date();
day.setTime(day.getTime() - 24 * 60 * 60 * 1000);
var s = day.getFullYear() + sign + (day.getMonth() + 1) + sign + day.getDate();
return s;
}
/**
* 校验手机号码格式
*/
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);
}
/**
* 校验手机号码格式
*/
util.checkIdCard = function(code) {
var city = {
11: '北京',
12: '天津',
13: '河北',
14: '山西',
15: '内蒙古',
21: '辽宁',
22: '吉林',
23: '黑龙江',
31: '上海',
32: '江苏',
33: '浙江',
34: '安徽',
35: '福建',
36: '江西',
37: '山东',
41: '河南',
42: '湖北',
43: '湖南',
44: '广东',
45: '广西',
46: '海南',
50: '重庆',
51: '四川',
52: '贵州',
53: '云南',
54: '西藏',
61: '陕西',
62: '甘肃',
63: '青海',
64: '宁夏',
65: '新疆',
71: '台湾',
81: '香港',
82: '澳门',
91: '国外 '
}
// var tip = ''
var pass = true
// 身份证位数为15或18位
// if (![15, 18].includes(code.length)) {
if (!((code.length == 15) || (code.length == 18))) {
pass = false
} else if (!code || (code.length === 18 && !/^\d{6}(18|19|20)\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(code))) {
// tip = '身份证号格式错误'
pass = false
} else if (code.length === 15 && !/^\d{6}\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}$/i.test(code)) {
pass = false
} else if (!city[code.substr(0, 2)]) {
// tip = '地址编码错误'
pass = false
} else {
// 18位身份证需要验证最后一位校验位
if (code.length === 18) {
code = code.split('')
// ∑(ai×Wi)(mod 11)
// 加权因子
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
// 校验位
var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]
var sum = 0
var ai = 0
var wi = 0
for (var i = 0; i < 17; i++) {
ai = code[i]
wi = factor[i]
sum += ai * wi
}
// var last = parity[sum % 11]
if (parity[sum % 11] != code[17]) {
// tip = '校验位错误'
pass = false
}
}
}
return pass
}
util.deepClone = function(obj) {
// Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj
// Handle Date
if (obj instanceof Date) {
const copy = new Date()
copy.setTime(obj.getTime())
return copy
}
// Handle Array or Object
if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {}
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) {
copy[attr] = util.deepClone(obj[attr])
}
}
return copy
}
throw new Error("Unable to clone obj! Its type isn't supported.")
}
export default util
\ No newline at end of file
<template>
<div class="scrm-main">
<div class="form-header" v-if="$globalState.session.accountLevel == 1 && $globalState.session.merchantModel == 1">
<el-button type="primary" @click="handleContact" size="small" icon="el-icon-link"
>门店账户关联企微</el-button
>
</div>
<div class="follow-form">
<el-form :inline="true" :model="searchForm" class="follow-form-item" label-width="80px">
<el-row>
<el-form-item size="small" label="关联企微">
<el-select v-model="searchForm.isRelevance" placeholder="请选择">
<el-option v-for="item in optionsContact" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item class="merchant-row" size="small">
<el-input
size="small"
v-model="searchForm.merchantLoginAccount"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 1"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
@change="searchForm.merchantLoginAccount = '';searchForm.merchantLegalPersonPhone = ''"
slot="prepend"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option>
</el-select>
</el-input>
<el-input
size="small"
v-model="searchForm.merchantLegalPersonPhone"
placeholder="请输入"
v-if="searchForm.accountOrPhone == 2"
>
<el-select
size="small"
v-model="searchForm.accountOrPhone"
slot="prepend"
@change="searchForm.merchantLoginAccount = '';searchForm.merchantLegalPersonPhone = ''"
placeholder="请选择"
>
<el-option label="登录账户名" :value="1"></el-option>
<el-option label="手机号" :value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item size="small" label="账户状态">
<el-select size="small" v-model="searchForm.status" placeholder="请选择">
<el-option v-for="item in merchantStatus" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item size="small" label="账户等级">
<el-select size="small" v-model="searchForm.merchantAccountLevel" placeholder="请选择">
<el-option v-for="item in accountLevel" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
<el-form-item class="merchant-wx" size="small">
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<div slot="accountTypeNames" slot-scope="scope">
<div class="accountType-row" v-for="(item, index) in scope.scope.accountTypeNames.split(',')" :key="index">
{{ item }}
</div>
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="handleLook(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(scope.scope)" v-if="$globalState.session.merchantId != scope.scope.merchantNo">修改</el-button>
<el-button type="text" @click="handleAdd(scope.scope)" v-if="scope.scope.status == 2 && scope.scope.merchantAccountLevel != 4">创建子商户/门店</el-button>
</template>
</GLTable>
</div>
</div>
</template>
<script>
const optionsContact = [
{
value: '',
label: '全部'
},
{
value: '1',
label: '已关联'
},
{
value: '2',
label: '未关联'
}
]
export default {
name: 'index',
data() {
return {
drawer: false,
direction: 'rtl',
searchForm: {
accountOrPhone: 1,
merchantLegalPersonPhone: '',
merchantLoginAccount: ''
},
optionsContact,
accountLevel: [],
accountType: [],
merchantStatus: [],
scope: {
scope: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
tableOption: {
width: '150px'
},
mutiSelectName: 'merchant',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '商户名',
prop: 'merchantName'
},
{
label: "关联的企业微信",
prop: "entmicroName",
formatter: (cellValue) => {
return cellValue.entmicroName ? cellValue.entmicroName : "-";
},
},
{
label: '账户类型',
prop: 'accountTypeNames',
addHtml: 'accountTypeNames'
},
{
label: '登录账户',
prop: 'merchantLoginAccount'
},
{
label: '账户等级',
prop: 'accountLevelName',
width: '80px'
},
{
label: "上级商户",
prop: "parentMerchant",
formatter: (cellValue) => {
return cellValue.parentMerchant ? cellValue.parentMerchant : "-";
},
},
{
label: '账户状态',
prop: 'statusName',
width: '80px'
},
{
label: "联系人",
prop: "merchantLegalPerson",
formatter: (cellValue) => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : "-";
},
},
{
label: '手机号',
prop: 'merchantLegalPersonPhone',
width: '120px'
},
{
label: "更新时间",
prop: "updatedTime",
},
],
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0
}
},
methods: {
handleContact() {
this.$router.push('/baseInfo/relevance')
},
handleLook(scope) {
this.$router.push('/account/detailAccount/' + scope.id)
},
handleEdit(scope) {
this.$router.push('/account/editAccount/' + scope.id)
},
handleAdd(scope) {
this.$router.push('/account/addAccount/' + scope.id)
},
findAllDictData(dictType) {
var params = {
dictType
}
this.$apis.store.findAllDictData(params).then(res => {
if (res) {
if (dictType == "account_level") {
this.accountLevel = [{ dictValue: "", dictLabel: "全部" }].concat(res);
}
if (dictType == 'account_type') {
this.accountType = res
}
if (dictType == "merchant_status") {
this.merchantStatus = [{ dictValue: "", dictLabel: "全部" }].concat(res);
}
}
})
},
beforeSearchFn() {
return new Promise(resolve => {
// 调接口前,操作
resolve()
})
},
handleSearch() {
var params = {
...JSON.parse(JSON.stringify(this.searchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum
}
this.$apis.store.findMerchantByPage(params).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (res.data && res.data.length == []) {
this.$refs.table.setTableHeightFun()
}
})
}
},
mounted() {
this.handleSearch()
this.findAllDictData('account_level')
this.findAllDictData('account_type')
this.findAllDictData('merchant_status')
}
}
</script>
<style scoped lang="scss">
.follow-form {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 10px;
}
.accountType-row {
text-align: left;
position: relative;
padding-left: 15px;
&::before {
content: '';
position: absolute;
width: 6px;
height: 6px;
background: #5850ff;
border-radius: 8px;
left: 0px;
top: 7px;
}
}
.merchant-row {
margin-left: 20px;
/deep/ {
.el-form-item__content {
line-height: 1;
}
.el-select {
.el-input {
width: 110px;
}
}
}
}
.merchant-wx {
margin-left: 20px;
/deep/ {
.el-input__inner {
width: 310px;
}
}
}
</style>
<template>
<div class="bloc-info-module">
<div class="wrapper">
<div class="wrap_left">
<div class="out_box_wrap">
<div class="fixed_widget">
<div class="label_text">版本:{{ bloc.merchantModelName || '--'}}</div>
<div class="label_text dr_top">
开通门店数:
<span v-if="bloc.numberStores" class="num_text">{{ bloc.numberStores }}家</span>
<span v-else class="num_text">--</span>
</div>
<div class="label_text dr_top">门店详情</div>
</div>
<div :class="isOpen ? 'table_wrapper_open' : 'table_wrapper_close'">
<!-- <GLTable v-if="isOpen" :hasPage="false" :tableParams="tableParams" :tableData="list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></GLTable> -->
<template v-if="isOpen">
<div class="line_wrapper wrap_header">
<div class="tittle text_w">序号</div>
<div class="tittle1 text_w">门店名称</div>
<div class="tittle2 text_w">有效期</div>
</div>
<div class="line_body" :style="{height: tableHeight+ 'px'}">
<template v-if="list.length">
<div v-for="(item, index) in list" :key="index" class="line_wrapper">
<div class="tittle">{{ index + 1 }}</div>
<div class="tittle1">{{ item.merchantName }}</div>
<div class="tittle2">{{ item.date }}</div>
</div>
</template>
<template v-if="!list.length">
<div class="line_wrapper">暂无数据</div>
</template>
</div>
</template>
</div>
<div class="fixed_footer" @click="changeRightOpenStatus(isOpen)">
<i :class="isOpen ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
<span class="dr_left">{{ isOpen ? '隐藏门店详情' : '展开门店详情' }}</span>
</div>
</div>
</div>
<!-- <div class="wrap_right">
<div v-for="(item, index) in rightData" :key="index" class="out_box_wrap">
<div class="fixed_widget">
<div class="label_text">版本:{{ item.name }}</div>
<div class="label_text dr_top">
开通门店数:
<span class="num_text">{{ item.num }}家</span>
</div>
<div class="label_text dr_top">门店详情</div>
</div>
<div :class="item.open ? 'table_wrapper_open' : 'table_wrapper_close'">
<glsx-table v-if="item.open" :hasPage="false" :tableParams="tableParams" :tableData="item.list" :headerStyle="{ background: '#F4F6FC', color: '#333333', fontSize: '14px' }"></glsx-table>
</div>
<div class="fixed_footer" @click="changeRightOpenStatus(item, index)">
<i :class="item.open ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"></i>
<span class="dr_left">{{ item.open ? '隐藏门店详情' : '展开门店详情' }}</span>
</div>
</div>
</div> -->
</div>
</div>
</template>
<script>
export default {
name: '',
props: {
list: Array,
bloc: null
},
data() {
return {
curOpenIndex: 0,
tableHeight: 0,
dataList: [],
leftData: [],
rightData: [],
tableParams: {
listName: 'list',
tableColumns: [
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '有效期',
prop: 'date'
}
]
},
isOpen: false
}
},
methods: {
// changeLeftOpenStatus(item, index) {
// this.leftData[index].open = !item.open
// },
changeRightOpenStatus(isOpen) {
this.isOpen = !isOpen
},
// handlerData() {
// let arr = this.dataList
// let left = []
// let right = []
// arr.forEach((item, index) => {
// if (index % 2 == 0) {
// left.push(item)
// } else {
// right.push(item)
// }
// })
// this.leftData = left
// this.rightData = right
// console.log(left)
// console.log(right)
// }
},
mounted() {
let clientHeight = document.documentElement.clientHeight;
this.tableHeight = clientHeight - 475;
}
};
</script>
<style lang="scss" scoped>
.bloc-info-module {
box-sizing: border-box;
padding: 20px 0 0 40px;
}
.wrapper {
display: flex;
flex-wrap: wrap;
.wrap_left,
.wrap_right {
// min-width: 44.8%;
min-width: 520px;
min-height: 176px;
}
.wrap_left {
margin-right: 40px;
}
}
.out_box_wrap {
width: 100%;
min-height: 176px;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
border-radius: 10px;
border: 1px solid #e5e4ff;
margin: 0 40px 40px 0;
.fixed_widget {
width: 100%;
height: 140px;
box-sizing: border-box;
padding: 20px 0 0 20px;
.label_text {
color: #333333;
font-size: 14px;
font-weight: 400;
}
.num_text {
font-size: 14px;
font-weight: 400;
color: #5850ff;
}
.dr_top {
margin-top: 20px;
}
}
.table_wrapper_close {
height: 0;
// transition: height 0.1s ease-in-out;
}
.line_wrapper {
width: 100%;
min-height: 54px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
font-size: 14px;
border-bottom: 1px solid #dcdfe6;
.tittle {
width: 20%;
text-align: center;
color: #333333;
font-size: 14px;
}
.tittle1 {
width: 40%;
text-align: center;
color: #333333;
font-size: 14px;
word-wrap: break-word;
word-break: break-all;
overflow: hidden;
}
.tittle2 {
width: 40%;
text-align: center;
color: #333333;
font-size: 14px;
}
}
.wrap_header {
background: #f4f6fc;
}
.text_w {
font-weight: bold;
}
.line_body {
width: 100%;
overflow-y: auto;
overflow-x: hidden;
}
.line_body::-webkit-scrollbar {
height: 1px;
width: 8px;
}
.line_body::-webkit-scrollbar-thumb {
background: #e9e8ff;
border-radius: 7px;
}
.fixed_footer {
width: 100%;
height: 36px;
background: #f4f6fc;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 400;
color: #b9b8c7;
border-radius: 0px 0px 10px 10px;
cursor: pointer;
.dr_left {
margin-left: 12px;
}
}
}
// .bloc-info-module /deep/ .el-table__body-wrapper {
// height: 352px;
// overflow-y: auto;
// overflow-x: hidden;
// }
// .bloc-info-module /deep/ .el-table__body-wrapper::-webkit-scrollbar {
// height: 1px;
// width: 8px;
// }
// .bloc-info-module /deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
// background: #e9e8ff;
// border-radius: 7px;
// }
</style>
\ No newline at end of file
<template>
<div class="out_main">
<!-- <div class="base-info-index"> -->
<div class="top_widget">
<img class="sign_icon" src="../../assets/scrm_base_info_icon_one.png" />
<div class="info_widget">
<div class="title_text">
{{ blocInfo.merchantName }}
<span class="min_text">(商户号:{{ blocInfo.merchantNo }})</span>
</div>
<div class="sec_title_text dr_top_1">
<span>关联企微:{{ blocInfo.entmicroName || '--' }}</span>
<div v-if="blocInfo.entmicroName" class="auth_btn" :class="accountLevel != 4 ? 'auth_btn_cp' : ''">已授权</div>
</div>
<div v-if="accountLevel==1" class="min_text dr_top_1">所属企业:--</div>
<div v-if="accountLevel!=1" class="min_text dr_top_1">所属企业:{{ blocInfo.parentName }}</div>
<div v-if="accountLevel==4" class="min_text">企微员工:{{ blocInfo.entMicroEmployeeCount }}人</div>
</div>
</div>
<blocModule :bloc="blocInfo" :list.sync="storesList" v-if="accountLevel != 4"></blocModule>
<shopModule v-if="accountLevel == 4"></shopModule>
<!-- </div> -->
</div>
</template>
<script>
import shopModule from './shop.vue'
import blocModule from './bloc.vue'
// import { merchantInfo } from '../../api/modules/baseinfoApi'
export default {
name: 'index',
components: {
shopModule,
blocModule
},
data() {
return {
platform: 1, //1 集团 2 门店
accountLevel:1,//1-工厂;2-省代;3-市代;4-门店
blocInfo: {
merchantName: ''
},
storesList: []
}
},
created() {
//this.$globalState.accountLevel
const { session } = this.$globalState
this.platform = session.merchantModel
this.loginInfo = session
this.accountLevel = session.accountLevel
this.getBlocData()
},
methods: {
getBlocData() {
let para = {
merchantId: this.loginInfo.merchantId,
}
this.$apis.baseInfo.merchantInfo(para).then(res => {
this.blocInfo = res
this.storesList = res.stores.map(item => {
item.date = `${this.dateFormat(item.starttime, 'YYYY.MM.DD')}--${this.dateFormat(item.endtime, 'YYYY.MM.DD')}`
return item
})
})
},
dateFormat: function (dateTime, format = 'yyyy-MM-dd') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(),
HH: date.getHours(),
mm: date.getMinutes(),
ss: date.getSeconds()
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
}
}
</script>
<style lang="scss" scoped>
.out_main {
box-sizing: border-box;
height: 100%;
// margin: 0 20px 64px 40px;
background: #fff;
// box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
// min-height: calc(100vh - 144px);
}
.base-info-index {
width: 100%;
height: calc(100vh - 144px);
background: #fff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
overflow: hidden;
overflow-y: scroll;
}
.out_main::-webkit-scrollbar {
height: 1px;
width: 8px;
}
.out_main::-webkit-scrollbar-thumb {
background: #e9e8ff;
border-radius: 7px;
}
.top_widget {
width: 100%;
box-sizing: border-box;
padding: 40px 0 0 40px;
display: flex;
.sign_icon {
width: 64px;
height: 64px;
border-radius: 50%;
}
.info_widget {
margin-left: 15px;
.title_text {
color: #333333;
font-size: 16px;
font-weight: 500;
}
.min_text {
color: #999999;
font-size: 12px;
line-height: 20px;
}
.sec_title_text {
color: #333333;
font-size: 14px;
font-weight: 400;
.auth_btn {
width: 48px;
height: 20px;
text-align: center;
line-height: 20px;
border-radius: 1px;
border: 1px solid #ff6d00;
font-size: 12px;
font-weight: 400;
color: #ff6d00;
display: inline-block;
margin-left: 16px;
}
.auth_btn_cp {
border: 1px solid #5850ff;
color: #5850ff;
}
}
.dr_top_1 {
margin-top: 8px;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="shop-info-module">
<div class="wrapper">
<div class="out_wrap dr_right">
<div class="elment_widget">
<div class="top_bg_wrap">
<div class="title_text">已购产品信息</div>
<div class="desc_text">
<span>标准版有效期:</span>
<span class="spc_text">2021年1月1日-2022年1月1日</span>
</div>
</div>
<div class="bottom_wrap">
<div class="info_text">已购版本:{{platform==1?'嘀加企微管家集团版':'嘀加企微管家单店版'}}</div>
<div class="info_text dr_top">短信总条数:--</div>
<div class="info_text dr_top">外呼电话总数:--</div>
</div>
</div>
<div class="element_btn dr_top disableBtn">续费</div>
</div>
<!-- <div class="out_wrap dr_right">
<div class="elment_widget dr_right">
<div class="top_bg_wrap">
<div class="title_text">智能语音电话套餐信息</div>
<div class="desc_text">
<span>剩余外呼电话数:</span>
<span class="spc_text max_text">3000</span>
<span class="unit_text">个</span>
</div>
</div>
<div class="bottom_wrap">
<div class="info_text">已呼电话个数:2000个</div>
<div class="info_text dr_top">已购版本:嘀加智慧门店SCRM标准版-智能语音…</div>
<div class="info_text dr_top">外呼电话总数:5000个</div>
</div>
</div>
<div class="element_btn dr_top disableBtn">续费</div>
</div>
<div class="out_wrap">
<div class="elment_widget">
<div class="top_bg_wrap">
<div class="title_text">短信套餐信息</div>
<div class="desc_text">
<span>剩余短信条数:</span>
<span class="spc_text max_text">8000</span>
<span class="unit_text">条</span>
</div>
</div>
<div class="bottom_wrap">
<div class="info_text">剩余短信条数:2000条</div>
<div class="dr_top min_text">
<span>营销短信:1000条</span>
<span class="dr_left">通知:1000条</span>
</div>
<div class="info_text dr_top">已购版本:嘀加智慧门店SCRM标准版-短信套餐</div>
<div class="info_text dr_top">短信总条数:10000条-短信套餐</div>
</div>
</div>
<div class="element_btn dr_top disableBtn">续费</div>
</div> -->
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
platform:1
}
},
mounted() {
const { session } = this.$globalState
this.platform = session.merchantModel
},
methods: {}
}
</script>
<style lang="scss" scoped>
.shop-info-module {
box-sizing: border-box;
padding: 60px 0 0 40px;
}
.wrapper {
display: flex;
.dr_right {
margin-right: 30px;
}
.out_wrap {
width: 29%;
height: 298px;
.elment_widget {
width: 100%;
height: 250px;
border: 1px solid #e5e4ff;
border-radius: 10px;
.top_bg_wrap {
width: 100%;
height: 108px;
background-image: url('../../assets/scrm_base_info_icon_two.png');
background-size: 100% 108px;
box-sizing: border-box;
padding: 20px 0 0 20px;
.title_text {
color: #333;
font-size: 18px;
font-weight: 600;
}
.desc_text {
font-size: 14px;
font-weight: 400;
color: #333333;
margin-top: 28px;
.spc_text {
font-weight: 600;
color: #5850ff;
}
.max_text {
font-size: 22px;
}
.unit_text {
margin-left: 4px;
}
}
}
.bottom_wrap {
width: 100%;
height: 142px;
box-sizing: border-box;
padding: 20px 0 0 20px;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.info_text {
font-size: 14px;
font-weight: 400;
color: #666666;
}
.min_text {
font-size: 12px;
color: #666666;
}
.dr_left {
margin-left: 30px;
}
}
}
.element_btn {
width: 72px;
height: 36px;
text-align: center;
line-height: 36px;
background: #5850ff;
border-radius: 4px;
color: #fff;
font-size: 16px;
font-weight: 600;
margin: 0 auto;
cursor: pointer;
}
.disableBtn {
background: #ccc;
}
}
}
.dr_top {
margin-top: 10px !important;
}
</style>
\ No newline at end of file
<!-- 选择分页 -->
<template>
<div>
<el-popover popper-class="select-page" ref="popover" placement="bottom-start" trigger="click" v-model="popoverVisible" :disabled="targetItem.isDisabled" @show="onShowPopover" @hide="onHidePopover">
<el-input v-model="searchInput" :style="{ width: width - 32 + 'px', display: 'block' }" placeholder="输入搜索" @input="handleSearchInput"></el-input>
<el-radio-group class="select-tree" v-model="form[targetItem.name]" @change="handleChangeRadio">
<el-radio class="page-radio" :style="`width: ${width - 32}px`" :title="item.merchantName" v-for="item in currList" :key="item.id" :label="item.id">{{ item.merchantName }}</el-radio>
</el-radio-group>
<div class="btns" v-show="page.total > 5">
<el-button :size="size" :disabled="page.pageNum == 1" @click="handlePage(false)">上一页</el-button>
<span>{{ page.pageNum }}/{{ page.totalPage }}</span>
<el-button :size="size" :disabled="page.pageNum == page.totalPage" @click="handlePage(true)">下一页</el-button>
</div>
<el-input slot="reference" ref="input" v-model="form[targetItem.nameLabel]" :clearable="!targetItem.noClearable" :disabled="targetItem.isDisabled" :style="`width: ${width}px`" :class="{ rotate: popoverVisible }" suffix-icon="el-icon-arrow-down" :placeholder="'请选择' + targetItem.label" @clear="handleClear"></el-input>
</el-popover>
</div>
</template>
<script>
export default {
name: 'selectPage',
data() {
return {
size: 'small',
isExpand: false,
searchInput: '',
timer: '',
// 树状菜单显示状态
popoverVisible: false,
currList: [],
tempList: [],
allMerchantList: [],
page: {
pageSize: 5,
pageNum: 1,
total: 0,
totalPage: 0
}
}
},
props: {
// 输入框宽度
width: {
type: String,
default: '360'
},
form: {
type: Object,
default: () => {}
},
targetItem: {
type: Object,
default: () => {}
},
treeData: {
type: Array,
default: () => []
}
},
mounted() {
this.getAllMerchantList()
},
methods: {
getCurrList() {
this.currList = this.tempList.slice((this.page.pageNum - 1) * this.page.pageSize, this.page.pageNum * this.page.pageSize)
},
getAllMerchantList() {
this.$apis.employee.getAllMerchantListApi({}).then(res => {
this.allMerchantList = res
this.tempList = res
this.page.total = res.length
this.page.totalPage = Math.ceil(res.length / this.page.pageSize)
this.getCurrList()
})
},
handlePage(isNext) {
this.page.pageNum = isNext ? this.page.pageNum + 1 : this.page.pageNum - 1
this.getCurrList()
},
handleChangeRadio(val) {
this.form[this.targetItem.nameLabel] = this.currList.find(item => item.id == val).merchantName
this.$emit('handleChange', val)
this.onHidePopover()
},
// 显示时触发
onShowPopover() {
this.popoverVisible = true
},
// 隐藏时触发
onHidePopover() {
this.searchInput = ''
this.handleSearchInput(this.searchInput)
this.popoverVisible = false
},
handleClear(val) {
this.form[this.targetItem.name] = ''
this.form[this.targetItem.nameLabel] = ''
this.$emit('handleChange')
},
handleSearchInput(val) {
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(() => {
this.tempList = val ? this.allMerchantList.filter(item => new RegExp(['', ...val, ''].join('.*')).test(item.merchantName)) : this.allMerchantList
this.page.total = this.tempList.length
this.page.pageNum = 1
this.page.totalPage = Math.ceil(this.tempList.length / this.page.pageSize)
this.getCurrList()
}, 600)
}
}
}
</script>
<style>
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.page-radio {
display: block;
/* width: 320px; */
height: 36px;
line-height: 36px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.select-page {
padding-bottom: 6px;
}
.select-page .btns {
display: flex;
justify-content: space-between;
align-items: center;
}
.select-page .el-radio__input{
display: none;
}
.select-page .el-radio__label{
padding-left: 0;
}
</style>
<!-- 配置管理 -->
<template>
<div class="config-employee">
<div class="container">
<div class="MsgWrap powerlimt">
<span class="content-title">功能权限</span>
<div class="powerTreeWrap">
<div class="mainTitleWrap">
<div class="mainTitle" :class="{ activeMainTitle: currentIndex == index }" v-for="(item, index) in powerDataArray" :key="index" @click="powerTabClick(index)">
{{ item.accounttypeName || 'null' }}
</div>
</div>
<div class="content">
<div class="subTitleWrap" v-if="products.length > 0">
<div class="subTitle" :class="{ acitveSubTitle: subCurrentIndex == sindex }" v-for="(ele, sindex) in products" :key="sindex" @click="powerSubTabClick(sindex)">
{{ ele.productName }}
</div>
</div>
<div class="contentTree">
<template v-if="merchantProTreeResponses.length > 0">
<el-tree default-expand-all :data="merchantProTreeResponses" :render-content="renderContent" :props="defaultProps"></el-tree>
</template>
<div v-else class="noDataContent">
<img src="../../../assets/img/empty.png" alt="" />
<div>暂无数据</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'config',
data() {
return {
powerDataArray: [],
merchantProTreeResponses: [],
currentIndex: 0, //功能权限主标题的索引
subCurrentIndex: 0,
defaultProps: {
children: 'children',
label: 'label'
}
}
},
props: {
id: {
type: String,
default: ''
}
},
computed: {
products() {
if (!this.powerDataArray.length) {
return []
}
return this.powerDataArray[this.currentIndex].products
}
//功能树的数据
// merchantProTreeResponses() {
// if (!this.powerDataArray.length) {
// return []
// } else if (this.powerDataArray.length > 0 && this.powerDataArray[this.currentIndex].products.length == 0) {
// return []
// }
// this.$nextTick(() => {
// this.addStyle()
// })
// return this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
// }
},
mounted() {
this.getInfo()
},
methods: {
getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.id }).then(res => {
this.powerDataArray = res.accountTypeTreeResponseList || []
this.changeMerchantProTree()
})
},
changeMerchantProTree() {
if (!this.powerDataArray.length) {
return []
} else if (this.powerDataArray.length > 0 && this.powerDataArray[this.currentIndex].products.length == 0) {
return []
}
this.merchantProTreeResponses = this.powerDataArray[this.currentIndex].products[this.subCurrentIndex].merchantProTreeResponses
this.$nextTick(() => {
this.addStyle()
})
},
// 渲染树结构
renderContent(h, v) {
if (v.data.logo == 'functionValue') {
return (
<div class="custom-tree-node fun-tree-node">
<span>{v.node.label}</span>
</div>
)
} else {
return (
<div class="custom-tree-node">
<span>{v.node.label}</span>
</div>
)
}
},
addStyle() {
const nodes = document.getElementsByClassName('fun-tree-node')
for (let i = 0; i < nodes.length; i++) {
const parentNode = nodes[i].parentNode.parentNode
parentNode.style.float = 'left'
}
},
powerTabClick(index) {
this.currentIndex = index
//每次切换将subCurrentIndex置为0
this.subCurrentIndex = 0
this.changeMerchantProTree()
},
powerSubTabClick(index) {
this.subCurrentIndex = index
this.changeMerchantProTree()
},
handleClose() {
this.$router.push({
name: 'Account2EmployeeIndex'
})
}
}
}
</script>
<style lang="scss">
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
.content-title {
display: inline-block;
position: relative;
height: 48px;
background-color: #fff;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 48px;
padding-left: 20px;
}
.powerlimt {
padding-bottom: 30px;
.powerTreeWrap {
background-color: #f4f6fc;
margin: 0 20px;
border-radius: 4px;
min-height: 300px;
padding-top: 2px;
padding-left: 2px;
padding-bottom: 10px;
.mainTitleWrap {
height: 32px;
display: flex;
.mainTitle {
background-color: #f4f6fc;
height: 32px;
width: 180px;
line-height: 32px;
text-align: center;
border-radius: 2px;
cursor: pointer;
}
.activeMainTitle {
background-color: #fff;
color: #5850ff;
}
}
.content {
background-color: #fff;
margin: 20px 10px 0;
.subTitleWrap {
height: 40px;
display: flex;
background-color: #f4f6fc;
.subTitle {
background-color: #f4f6fc;
height: 40px;
width: 180px;
line-height: 40px;
text-align: center;
border-radius: 2px;
}
.acitveSubTitle {
background-color: #fff !important;
color: #5850ff;
}
}
.contentTree {
padding: 20px;
min-height: 250px;
height: 250px;
position: relative;
overflow: auto;
.noDataContent {
width: 64px;
height: 64px;
position: absolute;
left: 50%;
top: 50%;
margin-top: -32px;
margin-left: -32px;
div {
margin-top: 12px;
}
}
}
}
}
}
}
</style>
<!-- 基本信息 -->
<template>
<div class="config-employee">
<div class="container">
<p class="edit-sub-title p-rl-20">员工基本信息</p>
<el-form label-width="140px" :inline="true">
<el-form-item class="basic-info" v-for="(item, index) in detailFormData" :key="index" :label="item.label + ':'">
<span class="txt-ellipsis" style="display: inline-block; width: 100%;" :title="info[item.name] || '-'">{{ info[item.name] || '-' }}</span>
</el-form-item>
</el-form>
</div>
<div class="container">
<p class="edit-sub-title p-rl-20">可见下级商户</p>
<div class="config-mer-name">
<p class="txt-ellipsis" v-for="(item, index) in info.visibleInferiorMerName.split(',')" :key="index" :title="item">{{ item }}</p>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'info',
data() {
return {
info: {
visibleInferiorMerName: ''
},
powerDataArray: [],
detailFormData: [
{
label: '姓名',
name: 'staffName'
},
{
label: '角色名称',
name: 'roleName'
},
{
label: '登录手机号',
name: 'staffPhone'
},
{
label: '创建人',
name: 'createdAccount'
},
{
label: '职务',
name: 'staffJob'
},
{
label: '企微号',
name: 'entmicroName'
}
]
}
},
props: {
id: {
type: String,
default: ''
}
},
mounted() {
this.getInfo()
},
methods: {
getInfo() {
this.$apis.employee.getDetailInfoApi({ id: this.id }).then(res => {
this.info = res
})
}
}
}
</script>
<style>
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.config-employee .config-mer-name {
font-size: 14px;
line-height: 20px;
margin: 21px 0 0 140px;
min-height: 36px;
}
.config-employee .txt-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-wrap: break-word;
}
.config-employee .basic-info {
margin-bottom: 0;
width: 48%;
}
.config-employee .basic-info .el-form-item__content {
width: calc(100% - 140px);
}
</style>
<!-- 修改记录 -->
<template>
<div class="config-employee">
<div class="container">
<p class="edit-sub-title p-rl-20">修改记录</p>
<GLTable ref="employeeRef" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
<el-button type="text" @click="handleEdit(2, scope.scope)">修改</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</template>
</GLTable>
</div>
</div>
</template>
<script>
// import { getDetailLogApi } from '@/api/modules/employee'
export default {
name: 'record',
data() {
return {
searchForm: {},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
getListApi: this.$apis.employee.getDetailLogApi,
tableParams: {
listName: 'data',
tableColumns: [
{
label: '登录账户',
prop: 'operator',
line: 2,
formatter: cellValue => {
return cellValue.operator || '-'
}
},
{
label: '登录产品',
prop: 'productName',
line: 2,
formatter: cellValue => {
return cellValue.productName || '-'
}
},
{
label: '登录IP',
prop: 'ip',
line: 2,
formatter: cellValue => {
return cellValue.ip || '-'
}
},
{
label: '修改内容',
prop: 'module',
formatter: cellValue => {
return cellValue.module + '-' + cellValue.action
}
},
{
label: '操作人',
prop: 'userName',
line: 2,
formatter: cellValue => {
return cellValue.userName || '-'
}
},
{
label: '操作时间',
prop: 'createdTime',
width: '180px',
formatter: cellValue => {
return cellValue.createdTime || '-'
}
}
]
}
}
},
props: {
id: {
type: String,
default: ''
}
},
mounted() {},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = {
bussinessId: this.id,
moduleName: '员工模块'
}
resolve()
})
}
}
}
</script>
<style>
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<!-- 员工详情 -->
<template>
<div class="config-employee">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="基本信息" name="info">
<info :id="id"></info>
</el-tab-pane>
<el-tab-pane label="账户权限" name="config">
<config :id="id"></config>
</el-tab-pane>
<el-tab-pane label="修改记录" name="record">
<record :id="id"></record>
</el-tab-pane>
</el-tabs>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleClose">关闭</el-button>
</div>
</div>
</template>
<script>
import info from './detail/info'
import config from './detail/config'
import record from './detail/record'
export default {
name: 'detailEmployee',
data() {
return {
id: '',
activeName: 'info',
footerLeft: '0',
footerWidth: '0'
}
},
components: {
info,
config,
record
},
computed: {},
created() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.id = this.$route.params.id
},
methods: {
handleClose() {
this.$router.push({
path: '/employee/index'
})
}
}
}
</script>
<style scoped>
.config-employee {
margin-bottom: 64px;
}
.config-employee .container {
margin-top: 20px;
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
}
.config-employee .p-rl-20 {
padding: 0 20px;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-container {
margin-bottom: 84px;
}
.config-employee .footer {
position: fixed;
bottom: 0;
width: 100%;
height: 64px;
text-align: center;
line-height: 64px;
background: #ffffff;
z-index: 999;
}
.config-employee .flex {
display: flex;
justify-content: space-between;
}
.config-employee .edit-title {
font-size: 20px;
font-weight: bold;
color: #333333;
line-height: 38px;
height: 38px;
margin: 0 0;
}
.config-employee .edit-sub-title {
height: 48px;
line-height: 48px;
font-size: 16px;
color: #333333;
font-weight: 600;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.config-employee .filter-tree {
width: 360px;
max-height: 200px;
overflow: scroll;
}
.config-employee .el-checkbox:last-of-type {
margin-right: 8px;
}
.config-employee .filter-tree .el-tree-node__label {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<template>
<div class="role-home-page">
<div class="top_widget">
<el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button>
</div>
<div class="table_widget">
<div class="search_widget">
<div class="left_wrap">
<div v-if="accountLevel != 4" class="top_select">
<span class="select_label">商户名称</span>
<el-select size="small" clearable filterable v-model="searchForm.merchantId" placeholder="请选择">
<el-option v-for="item in merchantList" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select>
</div>
<div class="top_select">
<span class="select_label">状态</span>
<el-select size="small" v-model="searchForm.delFlag" placeholder="请选择">
<el-option v-for="item in optionData" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="top_select">
<span class="select_label">角色名称</span>
<el-input style="width: 76%" size="small" v-model="searchForm.roleName" clearable placeholder="请输入"></el-input>
</div>
</div>
<div class="btn_wrapper">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button type="primary" size="small" @click="toFindData">查询</el-button>
</div>
</div>
<GLTable v-if="distoryTable" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData">
<template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button type="text" @click="toEditPage(scope.scope)">修改</el-button>
<el-button v-if="scope.scope.delFlag" type="text" @click="todelete(scope.scope)">删除</el-button>
</template>
</GLTable>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
searchForm: {
delFlag: 2,
roleName: '',
merchantId: ''
},
optionData: [
{
value: 2,
label: '全部'
},
{
value: 1,
label: '草稿'
},
{
value: 0,
label: '启用'
}
],
//表格配置
layout: 'sizes, prev, pager, next, jumper, ->, total',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
tableOption: true,
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '角色名称',
prop: 'roleName'
},
{
label: '角色号',
prop: 'roleCode'
},
{
label: '状态',
prop: 'statusName',
width: '100px'
},
{
label: '创建时间',
prop: 'createdTime',
width: '160px'
},
{
label: '更新时间',
prop: 'updatedTime',
width: '160px',
formatter: val => {
if (!val.updatedTime) {
return '--'
} else {
return val.updatedTime
}
}
}
]
},
tableData: [],
merchantList: [],
tableTotal: 0,
accountLevel: 1,
list: [],
distoryTable: true
}
},
methods: {
// 获取表格数据
getTableData() {
let { delFlag, roleName, merchantId } = this.searchForm
let para = {}
console.log(merchantId)
if (!this.distoryTable) {//代表重置
para = {
pageNum: 1,
pageSize: 10
}
} else {
para = {
pageNum: this.$refs.table.page.pageNum,
pageSize: this.$refs.table.page.pageSize
}
}
if (delFlag < 2) {
para.delFlag = delFlag
}
if (roleName) {
para.roleName = roleName
}
if (merchantId) {
para.merchantId = merchantId
}
this.$apis.role.roleDataList(para).then(res => {
this.tableData = res.data
this.tableTotal = res.count
if (!res.data.length || !res) {
this.$refs.table.setTableHeightFun()
}
// this.$nextTick(() => {
// this.$refs.table.setTableHeightFun()
// })
})
},
getMerchantName() {
this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
this.merchantList = res || []
this.merchantList.unshift({
merchantName: '全部',
id: 0
})
// this.filterList()
})
},
// 过滤数据
// filterList(query = '') {
// let arr = this.merchantList.filter(item => {
// return item.merchantName.includes(query)
// })
// if (arr.length > 100) {
// this.list = arr.slice(0, 100)
// } else {
// this.list = arr
// }
// },
// 重置
reSetFindData() {
this.distoryTable = false
this.searchForm = {
delFlag: 2,
roleName: '',
merchantId: ''
}
this.getTableData()
this.$nextTick(() => {
this.distoryTable = true
})
},
// 查询
toFindData() {
this.getTableData()
},
// 去创建角色页面
toCreatePage() {
this.$router.push('/role/create')
},
// 去查看角色页面
toLookPage(row) {
this.$router.push('/role/look/' + row.id)
},
// 去修改角色页面
toEditPage(row) {
this.$router.push('/role/create/' + row.id)
},
// 去删除草稿
todelete(row) {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$apis.role.deleteRole({ id: row.id }).then(res => {
if (res) {
this.getTableData()
this.$message({
type: 'success',
message: '删除成功!'
})
}
})
})
.catch(() => {})
}
},
created() {
const { session } = this.$globalState
let accountLevel = session.accountLevel
if (accountLevel != 4) {
this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' })
this.getMerchantName()
}
this.accountLevel = accountLevel
},
mounted() {
this.getTableData()
}
}
</script>
<style lang="scss" scoped>
.role-home-page {
box-sizing: border-box;
display: flex;
flex-direction: column;
height: 100%;
}
.top_widget {
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
padding: 0 20px 20px 0;
}
.table_widget {
width: 100%;
// height: calc(100% - 138px);
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
padding: 20px;
}
.search_widget {
padding: 0 0 20px 0;
display: flex;
align-items: center;
justify-content: space-between;
.left_wrap {
display: flex;
align-items: center;
.top_select {
display: flex;
align-items: center;
margin-right: 30px;
.select_label {
font-size: 14px;
font-weight: 400;
color: #333333;
margin-right: 10px;
white-space: nowrap;
}
}
}
.btn_wrapper {
display: flex;
align-items: center;
}
}
</style>
const path = require('path')
const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const cdn = {
css: [
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`
],
js: [
`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`,
`${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`,
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`,
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`,
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`,
// 'https://webapi.amap.com/maps?v=1.3&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
]
}
module.exports = {
outputDir: `../dist/${packageName}`,
publicPath,
assetsDir: 'static',
productionSourceMap: false,
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',
'AMap': 'AMap'
}
},
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!