Commit d109e9ab by 杨北旺

角色管理模块

1 parent 8ec19b30
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"env": { "env": {
"node": true "node": true
}, },
"globals": {
"AMap": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"], "extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": { "rules": {
"no-console": "off", "no-console": "off",
......
This diff could not be displayed because it is too large.
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.0.8",
"glsx-table": "^1.0.9" "glsx-table": "^1.0.9"
}, },
"devDependencies": { "devDependencies": {
...@@ -28,6 +27,7 @@ ...@@ -28,6 +27,7 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"glsx-components": "^1.0.8",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" /> <link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %> <% } %>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.8&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder"></script>
<title>微前端子应用:博客</title> <title>微前端子应用:博客</title>
</head> </head>
......
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http({
url: '/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
pictureUpload
}
\ No newline at end of file \ No newline at end of file
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const sessionId = 'mini-a8d84762-da6a-4ff7-b009-eb7fa0c80dfb-rop';
const listFollowerStaffByPage = params => {
params.method = 'cn.com.glsx.entmicro.staff.listFollowerStaffByPage'
params.sessionId = sessionId
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取跟进类型列表
const listEntFollowerType = params => {
params.method = 'cn.com.glsx.entmicro.staff.listEntFollowerType'
params.sessionId = sessionId
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 删除根据员工
const deleteFollowerStaff = params => {
params.method = 'cn.com.glsx.entmicro.staff.deleteFollowerStaff'
params.sessionId = sessionId
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 删除跟进类型
const deleteFollowerType = params => {
params.sessionId = sessionId
params.method = 'cn.com.glsx.entmicro.staff.deleteFollowerType'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询外部联系人员工
const listEntmicroStaff = params => {
params.sessionId = sessionId
params.method = 'cn.com.glsx.entmicro.staff.listEntmicroStaff'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 添加跟进员工
const saveFollowerStaff = params => {
params.sessionId = sessionId
params.method = 'cn.com.glsx.entmicro.staff.saveFollowerStaff'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 新增跟进类型
const saveFollowerType = params => {
params.sessionId = sessionId
params.method = 'cn.com.glsx.entmicro.staff.saveFollowerType'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 同步企微外部联系人
const syncEntmicroIsOutsiderStaff = params => {
params.sessionId = sessionId
params.method = 'cn.com.glsx.entmicro.staff.syncEntmicroIsOutsiderStaff'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询组织树
const listDepartmentTree = params => {
params.sessionId = sessionId
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
listFollowerStaffByPage,
listEntFollowerType,
deleteFollowerStaff,
deleteFollowerType,
listEntmicroStaff,
saveFollowerType,
saveFollowerStaff,
syncEntmicroIsOutsiderStaff,
listDepartmentTree
}
\ No newline at end of file \ No newline at end of file
...@@ -7,78 +7,55 @@ ...@@ -7,78 +7,55 @@
* @returns * @returns
*/ */
import { http } from '@/main' import { http } from '@/main'
const sessionId = 'ca5da0cc-f97f-4364-b0fd-f36cc7f93405' const roleDataList = params => {
const getAccess = params => { params.method = 'org.ore.api.role.page'
params.method = 'scrm.api.work.wechat.auth.access'
params.sessionId = sessionId
return http({ return http({
url: '/rop-scrm-wechat/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const merchantDataList = params => {
const getStatus = params => { params.method = 'cn.com.glsx.merchants.menu.findAllMerchant'
params.method = 'scrm.api.work.wechat.access.status'
params.sessionId = sessionId
return http({ return http({
url: '/rop-scrm-wechat/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getCheckStatus = params => { const roleInfoData = params => {
params.method = 'scrm.api.work.wechat.access.check.status' params.method = 'org.ore.api.role.getById'
params.sessionId = sessionId
return http({ return http({
url: '/rop-scrm-wechat/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getQrcode = params => { const roleTreeDataById = params => {
params.method = 'scrm.api.work.wechat.access.qrcode' params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByRoleId'
params.sessionId = sessionId
return http({ return http({
url: '/rop-scrm-wechat/router', url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getReportStatus = params => { const merchantRootById = params => {
params.method = 'scrm.api.work.wechat.access.report.status' params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
params.sessionId = sessionId
return http({ return http({
url: '/rop-scrm-wechat/router', url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecret = params => {
params.method = 'scrm.api.work.wechat.setting.app.secret'
params.sessionId = sessionId
return http({
url: '/rop-scrm-wechat/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
export default { export default {
getAccess, roleDataList,
getStatus, merchantDataList,
getCheckStatus, roleInfoData,
getQrcode, roleTreeDataById,
getReportStatus, merchantRootById
getSecret
} }
\ No newline at end of file \ No newline at end of file
...@@ -7,83 +7,55 @@ ...@@ -7,83 +7,55 @@
* @returns * @returns
*/ */
import { http } from '@/main' import { http } from '@/main'
const url = '/rop-scrm-entmicro/router' const findMerchantByPage = params => {
const getChart = params => { params.method = 'cn.com.glsx.merchants.menu.findMerchantByPage'
params.method = 'org.ore.api.home.view.chart'
return http({ return http({
url, url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const findAllDictData = params => {
const getSort = params => { params.method = 'cn.com.glsx.merchants.menu.findAllDictData'
params.method = 'org.ore.api.home.view.sort'
return http({ return http({
url, url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getStore = params => { const getCarbrandTree = params => {
params.method = 'org.ore.api.home.view.store.data' params.method = 'cn.com.glsx.merchants.merchantCommon.getCarbrandTree'
return http({ return http({
url, url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getShop = params => { const findMerchantDetail = params => {
params.method = 'org.ore.api.home.view.shop.data' params.method = 'cn.com.glsx.merchants.merchant.findMerchantDetail'
return http({ return http({
url, url: '/rop-merchants/router',
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
const getView = params => { const saveMerchant = params => {
params.method = 'org.ore.api.home.view.data' params.method = 'cn.com.glsx.merchants.merchant.saveMerchant'
return http({ return http({
url, url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const findLoginCount = params => {
params.method = 'org.ore.api.common.findLoginCount'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
const findMerchantInfoByMerchantNo = params => {
params.method = 'org.ore.api.common.findMerchantInfoByMerchantNo.list'
return http({
url,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true sign: true
}) })
} }
export default { export default {
getChart, findMerchantByPage,
getView, findAllDictData,
getSort, getCarbrandTree,
getShop, findMerchantDetail,
getStore, saveMerchant
findLoginCount,
findMerchantInfoByMerchantNo
} }
\ No newline at end of file \ No newline at end of file
...@@ -104,6 +104,26 @@ img { ...@@ -104,6 +104,26 @@ img {
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.10); 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;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
/*滚动条整体样式*/ /*滚动条整体样式*/
width: 6px; width: 6px;
......
<template>
<div class="btn-unselect" :class="{ 'selectd-type': typeStatus }" @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: "",
},
typeStatus: {
type: Boolean,
default: false,
}
},
data() {
return {
};
},
methods: {
tabType() {
this.typeStatus = !this.typeStatus;
this.$emit('getBtnStatus',this.typeStatus)
},
}
};
</script>
<style lang="scss" scoped>
.btn-unselect {
display: inline-block;
cursor: pointer;
position: relative;
height: 30px;
line-height: 30px;
margin-top: 6px;
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;
}
}
.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 \ 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>
import AMap from "AMap";
let map, placeSearch;
export default {
name: "map",
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: "",
address: "",
};
},
methods: {
mapInit() {
map = new AMap.Map("container", {
resizeEnable: true,
zoom: 10,
});
AMap.service(["AMap.PlaceSearch"], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
citylimit: false, //是否强制限制在设置的城市内搜索
map: map, // 展现结果的地图实例
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: "default",
});
});
// 添加列表点选监听事件
AMap.event.addListener(map, "click", this.getAddress);
AMap.event.addListener(placeSearch, "selectChanged", this.getAddress);
},
getAddress(e) {
let self = this;
let lnglat;
if (e.type == "click") {
lnglat = e.lnglat
} else {
console.log(e.selected.data.location)
let { lng, lat } = e.selected.data.location;
lnglat = [lng, lat];
}
AMap.plugin("AMap.Geocoder", () => {
const geocoder = new AMap.Geocoder();
geocoder.getAddress(lnglat, (status, result) => {
self.address = result.regeocode.formattedAddress;
});
});
},
searchAddress() {
placeSearch.search(this.input, function (status, result) {
if (status == "complete") {
// console.log(result.poiList.pois);
}
});
},
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 \ No newline at end of file
...@@ -17,7 +17,7 @@ module.exports = { ...@@ -17,7 +17,7 @@ module.exports = {
code_message_map: {} code_message_map: {}
}, },
request: { request: {
baseURL: 'http://192.168.1.254', baseURL: '/api',
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -33,5 +33,8 @@ module.exports = { ...@@ -33,5 +33,8 @@ module.exports = {
}, },
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b', secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static' cdn: 'https://www.xxx.cn/static',
headers: {
sessionId: '123'
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -12,11 +12,11 @@ let cfg = require('./conf.js') ...@@ -12,11 +12,11 @@ let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config') return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
} }
export const config = { export const config = {
......
import Vue from 'vue' 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' 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(Button)
Vue.use(ButtonGroup) Vue.use(ButtonGroup)
Vue.use(Form) Vue.use(Form)
......
...@@ -5,6 +5,12 @@ const staticRoutes = Object.freeze([{ ...@@ -5,6 +5,12 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/home/index.vue`], resolve) component: resolve => require([`@/views/home/index.vue`], resolve)
}, },
{ {
name: 'addAccount',
path: '/acount/addAccount',
meta: {},
component: resolve => require([`@/views/home/addAccount.vue`], resolve)
},
{
name: 'role', name: 'role',
path: '/role/index/index', path: '/role/index/index',
component: resolve => require([`@/views/role/index/index.vue`], resolve), component: resolve => require([`@/views/role/index/index.vue`], resolve),
...@@ -16,5 +22,11 @@ const staticRoutes = Object.freeze([{ ...@@ -16,5 +22,11 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/role/create/index.vue`], resolve), component: resolve => require([`@/views/role/create/index.vue`], resolve),
meta: {} meta: {}
}, },
{
name: 'role',
path: '/role/index/look',
component: resolve => require([`@/views/role/index/look.vue`], resolve),
meta: {}
}
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="report-home"> <div class="scrm-main">
HOME <div class="follow-form">
<GLButton type="danger" @click="test()" class="test555" id="1-1-1-1" mode="link">权限按钮测试</GLButton> <el-form :inline="true" :model="searchForm" class="follow-form-item">
<GLButton type="success" size="small" @click="test()" id="1-1-1-1" class="test">权限按钮测试2</GLButton> <el-row>
<el-button class="test" @click="test()">东方网分</el-button> <el-form-item label="是否已关联企微">
<el-select size="small" 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 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 label="账户状态">
<el-select size="small" v-model="searchForm.status" placeholder="请选择">
<el-option v-for="item in accountType" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
</el-select>
</el-form-item>
</el-row>
<el-row class="merchant-row">
<el-form-item>
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入">
<el-select size="small" v-model="searchForm.accountOrPhone" slot="prepend" 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>
<el-input size="small" v-model="searchForm.merchantName" placeholder="请输入商户名称/关联的企业微信名"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch" size="small">查询</el-button>
<el-button type="primary" @click="handleSearch" size="small" icon="el-icon-link">门店账户关联企微</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)">修改</el-button>
<el-button type="text" @click="handleAdd(scope.scope)">创建子商户/门店</el-button>
</template>
</GLTable>
</div>
</div> </div>
</template> </template>
<script> <script>
const optionsContact = [
{
value: '',
label: '全部'
},
{
value: '1',
label: '已关联'
},
{
value: '2',
label: '未关联'
}
]
export default { export default {
name: 'home', name: 'index',
data() {
return {
drawer: false,
direction: 'rtl',
searchForm: {
accountOrPhone: '1'
},
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'
},
{
label: '账户类型',
prop: 'accountTypeNames',
addHtml: 'accountTypeNames'
},
{
label: '登录账户',
prop: 'merchantLoginAccount'
},
{
label: '账户等级',
prop: 'accountLevelName',
width: '80px'
},
{
label: '上级商户',
prop: 'parentMerchant'
},
{
label: '账户状态',
prop: 'statusName',
width: '80px',
addHtml: 'statusName'
},
{
label: '联系人',
prop: 'merchantLegalPerson'
},
{
label: '手机号',
prop: 'merchantLegalPersonPhone',
width: '120px'
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0
}
},
methods: { methods: {
test() { handleLook() {},
console.log('点击了按钮') handleEdit() {},
this.$messenger.send({ message: { from: 11, message: '11111' } }) handleAdd() {},
findAllDictData(dictType) {
var params = {
dictType
}
this.$apis.store.findAllDictData(params).then(res => {
if (res) {
if (dictType == 'account_level') {
this.accountLevel = res
}
if (dictType == 'account_type') {
this.accountType = res
}
if (dictType == 'merchant_status') {
this.merchantStatus = 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> </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 {
/deep/ {
.el-form-item__content {
line-height: 1;
}
.el-select {
.el-input {
width: 110px;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="role-home-page"> <div class="role-home-page">
<div class="top_widget"> <div class="top_widget">
<el-button size="small" icon="el-icon-plus" type="primary">创建角色</el-button> <el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button>
<div class="top_select"> <div v-if="accountLevel != 4" class="top_select">
<span class="select_label">商户名称</span> <span class="select_label">商户名称</span>
<el-select size="small" v-model="merchantName" placeholder="请选择"> <el-select :filter-method="filterList" 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-option v-for="item in list" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div style="height: 20px"></div> <div class="driver_line"></div>
<div class="table_widget"> <div class="table_widget">
<el-form :inline="true" :model="searchForm" class="follow-form-item"> <el-form :inline="true" :model="searchForm" class="follow-form-item">
<el-form-item label="状态"> <el-form-item label="状态">
<el-select size="small" v-model="searchForm.status" placeholder="请选择"> <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-option v-for="item in optionData" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="角色名称"> <el-form-item label="角色名称">
<el-input size="small" v-model="searchForm.name" clearable placeholder="请输入"></el-input> <el-input size="small" v-model="searchForm.roleName" clearable placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" size="small">查询</el-button> <el-button type="primary" size="small" @click="toFindData">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams"> <GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData">
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text">查看</el-button> <el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button type="text">修改</el-button> <el-button type="text" @click="toEditPage(scope.scope)">修改</el-button>
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -40,21 +40,21 @@ export default { ...@@ -40,21 +40,21 @@ export default {
data() { data() {
return { return {
searchForm: { searchForm: {
status: '', delFlag: 2,
name: '' roleName: '',
merchantId: ''
}, },
merchantName:'',
optionData: [ optionData: [
{ {
value: '', value: 2,
label: '全部' label: '全部'
}, },
{ {
value: '1', value: 1,
label: '草稿' label: '草稿'
}, },
{ {
value: '2', value: 0,
label: '启用' label: '启用'
} }
], ],
...@@ -75,7 +75,8 @@ export default { ...@@ -75,7 +75,8 @@ export default {
}, },
{ {
label: '状态', label: '状态',
prop: 'statusName' prop: 'statusName',
width: '100px'
}, },
{ {
label: '创建时间', label: '创建时间',
...@@ -95,85 +96,83 @@ export default { ...@@ -95,85 +96,83 @@ export default {
] ]
}, },
tableData: [], tableData: [],
merchantList: [],
tableTotal: 0, tableTotal: 0,
//商户名称 accountLevel: 1,
merchantList: [] list:[]
} }
}, },
created() {
// const { session } = this.$globalState
// let accountLevel = session.accountLevel
let accountLevel = 1
if (accountLevel != 4) {
this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' })
this.getMerchantName()
}
this.accountLevel = accountLevel
},
mounted() { mounted() {
this.getMerchangName()
this.getTableData() this.getTableData()
}, },
methods: { methods: {
// 获取表格数据 // 获取表格数据
getTableData() { getTableData() {
let data = [ let { delFlag, roleName, merchantId } = this.searchForm
{ console.log(merchantId)
id: 388, let para = {
roleName: 'ddd', pageNum: this.$refs.table.page.pageNum,
roleCode: 'ROLE1634644163409687', pageSize: this.$refs.table.page.pageSize
roleDescription: '',
merchantId: 40168,
merchantName: '广联嘀加平台超级管理员(44184606)',
createdBy: null,
delFlag: 0,
statusName: '正常',
createdTime: '2021-10-19 19:49:23',
updatedBy: null,
updatedTime: '2021-10-19 19:49:23',
createdAccount: null,
updatedAccount: null,
responseList: null
},
{
id: 383,
roleName: 'dasf',
roleCode: 'ROLE1634628185568777',
roleDescription: 'adsfa',
merchantId: 40168,
merchantName: '广联嘀加平台超级管理员(44184606)',
createdBy: null,
delFlag: 0,
statusName: '正常',
createdTime: '2021-10-19 15:23:05',
updatedBy: null,
updatedTime: '2021-10-19 15:23:05',
createdAccount: null,
updatedAccount: null,
responseList: null
},
{
id: 324,
roleName: '工厂角色',
roleCode: 'ROLE1000012649',
roleDescription: '超级管理员创建的角色,分配给工厂',
merchantId: 40168,
merchantName: '广联嘀加平台超级管理员(44184606)',
createdBy: null,
delFlag: 0,
statusName: '正常',
createdTime: '2021-10-15 10:29:12',
updatedBy: null,
updatedTime: null,
createdAccount: 'DJZX',
updatedAccount: null,
responseList: null
} }
] if (delFlag < 2) {
this.tableData = data 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
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.table.setTableHeightFun() this.$refs.table.setTableHeightFun()
}) })
})
}, },
// 获取商户名称 getMerchantName() {
getMerchangName() { this.$apis.role.merchantDataList({ source: 'glsx' }).then(res => {
let data = [ this.merchantList = res
{ this.filterList()
id: 40168, })
merchantName: '广联嘀加平台超级管理员' },
// 过滤数据
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
} }
] },
this.merchantList = data // 查询
toFindData() {
this.getTableData()
},
// 去创建角色页面
toCreatePage() {
this.$router.push({ path: '/role/create/index', query: { page: 'create' } })
},
// 去查看角色页面
toLookPage(row) {
this.$router.push({ path: '/role/index/look', query: { row } })
},
// 去修改角色页面
toEditPage(row) {
this.$router.push({ path: '/role/create/index', query: { page: 'edit', row } })
} }
} }
} }
...@@ -205,9 +204,13 @@ export default { ...@@ -205,9 +204,13 @@ export default {
} }
} }
} }
.driver_line {
width: 100%;
height: 20px;
}
.table_widget { .table_widget {
width: 100%; width: 100%;
height: calc(100% - 138px); // height: calc(100% - 138px);
background: #ffffff; background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box; box-sizing: border-box;
......
<template>
<div class="role-create-page">
<div class="top_title_widget">
<span class="title">角色基本信息</span>
<span class="store_title">{{ roleInfo.merchantName }}</span>
</div>
<div class="info_widget">
<div class="info_line_wrap">
<div class="info_line_label">角色名称:</div>
<div class="infl_line_con">{{ roleInfo.roleName }}</div>
</div>
<div class="info_line_wrap">
<div class="info_line_label">角色号:</div>
<div class="infl_line_con">{{ roleInfo.roleCode }}</div>
</div>
<div class="info_line_wrap">
<div class="info_line_label">角色说明:</div>
<div class="infl_line_con">{{ roleInfo.roleDescription || '无' }}</div>
</div>
</div>
<div class="main_widget">
<div class="main_title">角色权限</div>
<div class="wrapper">
<div class="menu_line_one">
<div v-for="(item, index) in rootList" :key="index" class="line_element" :class="curRootIndex == index ? 'line_element_active' : ''" @click="selectRootItem(index)">{{ item.accounttypeName }}</div>
</div>
</div>
<div class="wrapper">
<div class="main_body">
<div class="menu_line_two">
<div v-for="(item, index) in productList" :key="index" class="line_element_two" :class="curProductIndex == index ? 'line_element_two_active' : ''" @click="selectProductItem(index)">{{ item.productName }}</div>
</div>
<div class="tree_widget">
<el-tree v-if="productList.length" :data="productList[curProductIndex].merchantProTreeResponses" :props="defaultProps"></el-tree>
<div v-if="productList.length == 0" class="no_data_icon">
<div class="nodata_wrap">
<img class="icon" src="../../../assets/img/empty.png" />
<span class="text">暂无数据</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="height: 84px"></div>
<div class="fixed_bottom">
<el-button type="primary" @click="toBack">关闭</el-button>
</div>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
rootList: [],
curRootIndex: 0,
productList: [],
curProductIndex: 0,
roleInfo: {
roleName: ''
},
defaultProps: {
children: 'children',
label: 'label'
}
}
},
created() {
let query = this.$route.query
let id = query.row.id
this.getRoleData(id)
this.getMerchantTree(id)
},
methods: {
// 获取角色信息
getRoleData(id) {
this.$apis.role.roleInfoData({ id }).then(res => {
this.roleInfo = res
})
},
// 获取商户树
getMerchantTree(id) {
this.$apis.role.roleTreeDataById({ id }).then(res => {
this.rootList = res
this.productList = this.rootList[0].products || []
})
},
selectRootItem(index) {
this.curRootIndex = index
this.productList = this.rootList[index].products || []
},
selectProductItem(index) {
this.curProductIndex = index
},
toBack() {
history.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.role-create-page {
height: 100%;
width: 100%;
}
.top_title_widget {
width: 100%;
height: 58px;
box-sizing: border-box;
padding: 0 20px;
border-bottom: 1px solid #d8d8d8;
display: flex;
align-items: center;
justify-content: space-between;
background: #ffffff;
.title {
font-size: 16px;
font-weight: 500;
color: #424242;
}
.store_title {
font-size: 14px;
font-weight: 500;
color: #333333;
}
}
.info_widget {
background: #ffffff;
height: 158px;
box-sizing: border-box;
padding: 20px 0 0 52px;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.info_line_wrap {
display: flex;
align-items: center;
margin-bottom: 24px;
.info_line_label {
width: 78px;
font-size: 14px;
font-weight: 400;
color: #333333;
text-align: right;
}
.infl_line_con {
font-size: 14px;
font-weight: 400;
color: #666666;
}
}
}
.main_widget {
margin-top: 20px;
width: 100%;
min-height: calc(100% - 300px);
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
.main_title {
width: 100%;
box-sizing: border-box;
padding: 20px;
font-size: 16px;
font-weight: 500;
color: #333333;
}
.wrapper {
box-sizing: border-box;
padding: 0 20px;
.menu_line_one {
width: 100%;
height: 36px;
background: #f4f6fc;
border-radius: 4px;
display: flex;
align-items: center;
.line_element {
// width: 180px;
padding: 0 55px;
height: 32px;
text-align: center;
line-height: 32px;
font-size: 14px;
font-weight: 400;
color: #333333;
cursor: pointer;
}
.line_element_active {
background: #ffffff;
border-radius: 2px;
color: #5850ff;
}
}
.main_body {
width: 100%;
// height: calc(100% - 36px);
background: #f4f6fc;
border-radius: 4px;
box-sizing: border-box;
padding: 10px;
.menu_line_two {
display: flex;
align-items: center;
.line_element_two {
// width: 111px;
padding: 0 38px;
height: 40px;
text-align: center;
line-height: 40px;
background: #ffffff;
border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc;
color: #37383a;
font-size: 14px;
font-weight: 400;
cursor: pointer;
}
.line_element_two_active {
color: #322ad9;
}
}
.tree_widget {
width: 100%;
// height: calc(100% - 40px);
background: #ffffff;
border-radius: 0px 4px 4px 4px;
}
.tree_widget /deep/ .el-tree-node__expand-icon {
// content: "\e6d9";
color: #5850ff;
}
.tree_widget /deep/ .el-tree-node__expand-icon.is-leaf {
color: transparent;
}
.no_data_icon {
height: 150px;
display: flex;
align-items: center;
justify-content: center;
.nodata_wrap {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.icon {
width: 64px;
height: 41px;
}
.text {
font-size: 14px;
font-weight: 400;
color: #262626;
margin-top: 10px;
}
}
}
}
}
}
.fixed_bottom {
position: fixed;
left: 0;
right: 0;
bottom: 0;
// width: calc(100% - 60px);
width: 100%;
height: 64px;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
.wrap_driver {
margin: 0 40px;
}
}
</style>
...@@ -41,7 +41,8 @@ module.exports = { ...@@ -41,7 +41,8 @@ module.exports = {
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
'vuex': 'Vuex', 'vuex': 'Vuex',
'axios': 'axios', 'axios': 'axios',
'echarts': 'echarts' 'echarts': 'echarts',
'AMap': 'AMap'
} }
}, },
devServer: { devServer: {
...@@ -51,7 +52,18 @@ module.exports = { ...@@ -51,7 +52,18 @@ module.exports = {
port: process.env.VUE_APP_PORT, port: process.env.VUE_APP_PORT,
headers: { headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头 'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
} },
proxy: {    
'/api': {        
target: 'http://rop-merchant.test.glsx.com.cn',
        
changeOrigin: true,
        
pathRewrite: {            
'^/api': '/'        
}    
},
},
}, },
chainWebpack: config => { chainWebpack: config => {
config.plugin('html') config.plugin('html')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!