Commit 5c248f3c by cwq0219

merge

2 parents 2b6dc20a 18ec2e71
......@@ -5906,6 +5906,7 @@
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/glsx-components/-/glsx-components-1.0.8.tgz",
"integrity": "sha512-xfXyyglEZ1IUtaYp+WrTzjwsvNgIo9AfnBCDCfgHL9uFYUD63vedUzJMnSMy7RHAHUJ+u5Fic6mhpPLGc54jSQ==",
"dev": true,
"requires": {
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
......@@ -5916,12 +5917,14 @@
"core-js": {
"version": "3.18.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.3.tgz",
"integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw=="
"integrity": "sha512-tReEhtMReZaPFVw7dajMx0vlsz3oOb8ajgPoHVYGxr8ErnZ6PcYEvvmjGmXlfpnxpkYSdOQttjB+MvVbCGfvLw==",
"dev": true
},
"element-ui": {
"version": "2.15.6",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.6.tgz",
"integrity": "sha512-rcYXEKd/j2G0AgficAOk1Zd1AsnHRkhmrK4yLHmNOiimU2JfsywgfKUjMoFuT6pQx0luhovj8lFjpE4Fnt58Iw==",
"dev": true,
"requires": {
"async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0",
......@@ -11513,6 +11516,21 @@
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true
},
"uppercamelcase": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha1-Mk2YprOvx+iolT4QZBUJsOTiP5c=",
"requires": {
"camelcase": "^1.2.1"
},
"dependencies": {
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
}
}
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
......@@ -11666,7 +11684,16 @@
"vue": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/vue/-/vue-2.6.11.tgz",
"integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ=="
"integrity": "sha512-VfPwgcGABbGAue9+sfrD4PuwFar7gPb1yl1UK1MwXoQPAw0BKSqWfoYCT/ThFrdEVWoI51dBuyCoiNU9bZDZxQ==",
"dev": true
},
"vue-amap": {
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/vue-amap/-/vue-amap-0.5.10.tgz",
"integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==",
"requires": {
"uppercamelcase": "^1.1.0"
}
},
"vue-cli-plugin-element": {
"version": "1.0.1",
......
......@@ -12,7 +12,8 @@
"core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6",
"glsx-common": "^1.4.6",
"glsx-table": "^1.0.9"
"glsx-table": "^1.0.9",
"vue-amap": "^0.5.10"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
......
......@@ -6,46 +6,46 @@
* @param {*} params
* @returns
*/
import { http } from '@/main'
import { http_config } from '@/main'
const getMerchantTree = params => {
params.method = 'org.ore.api.common.findMerchantTreeByMerchantNo.list'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'org.ore.api.common.findMerchantTreeByMerchantNo.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getDepartment = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const toGL = params => {
params.method = 'org.ore.api.common.relevanceEntmicro.list'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'org.ore.api.common.relevanceEntmicro.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const merchantInfo = params => {
params.method = 'org.ore.api.common.findMerchantInfoByMerchantNo.list'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
params.method = 'org.ore.api.common.findMerchantInfoByMerchantNo.list'
return http_config({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getMerchantTree,
getDepartment,
toGL,
merchantInfo
getMerchantTree,
getDepartment,
toGL,
merchantInfo
}
\ No newline at end of file
......@@ -6,11 +6,10 @@
* @param {*} params
* @returns
*/
import { http } from '@/main'
import { http_common } from '@/main'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http({
url: '/router',
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true
......
/**
* 新增参数sign 判断接口是否需要sign签名(默认有,不必写)
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
export function getThirdTable(params) {
params.method = 'cn.com.glsx.merchants.menu.findLog'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
// const getThirdTable =(params)=>{
// params.method = 'cn.com.glsx.merchants.menu.findLog'
// return http({
// url: '/rop-merchants/router',
// method: 'POST',
// data: params,
// sign: true,
// })
// }
//获取功能权限树
const findMenuFunTreeByMerId = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMenuFunTreeByMerId'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//获取商户信息
const getFirstInfo = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantDetail'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
//获取上下级信息
const getSecondInfo = params => {
params.method = 'cn.com.glsx.merchants.menu.findSubordinateRelationship'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecondTree = params => {
params.method = 'cn.com.glsx.merchants.merchant.findMerchantTree'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
const getSecondTable = params => {
params.method = 'cn.com.glsx.merchants.staff.findMerchantStaffList'
return http({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
// getThirdTable,
getFirstInfo,
findMenuFunTreeByMerId,
getSecondInfo,
getSecondTree,
getSecondTable
}
<template>
<div disabled class="btn-unselect" :class="{ 'selectd-type': typeStatus }" @click="tabType">
<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>
......@@ -64,6 +64,9 @@ export default {
background: #5850ff;
}
}
&.no_click {
cursor: not-allowed!important;
}
.select-type-title {
display: inline-block;
padding: 0 16px;
......
......@@ -11,7 +11,6 @@
</template>
<script>
import AMap from "AMap";
let map, placeSearch;
export default {
name: "map",
......@@ -26,6 +25,7 @@ export default {
return {
input: "",
address: "",
lnglat: [],
};
},
......@@ -61,6 +61,7 @@ export default {
AMap.plugin("AMap.Geocoder", () => {
const geocoder = new AMap.Geocoder();
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat;
self.address = result.regeocode.formattedAddress;
});
});
......@@ -75,7 +76,7 @@ export default {
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress();
},
}
},
mounted() {
......
......@@ -12,12 +12,12 @@ 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/616d443d1072f92988f05a04/setting/config')
// 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) {
......
......@@ -12,9 +12,20 @@ import apis from './api'
import './public-path'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
import VueAMap from "vue-amap";
Vue.use(VueAMap);
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: "bd290dc27d0945959280753215ddda71", // 这里写你申请的高德地图的key
plugin: ["AMap.Autocomplete", "AMap.Geocoder", "AMap.Geolocation"],
v: "1.4.15",
uiVersion: "1.1"
});
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount }
from '@/setup'
export const http = params => Vue.prototype.$http(params)
\ No newline at end of file
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)
\ No newline at end of file
const staticRoutes = Object.freeze([
{
const staticRoutes = Object.freeze([{
name: 'account',
path: '/account/index',
meta: {},
......@@ -7,44 +6,38 @@ const staticRoutes = Object.freeze([
},
{
name: 'addAccount',
path: '/account/addAccount',
path: '/account/addAccount/:id',
meta: {},
component: resolve => require([`@/views/account/addAccount.vue`], resolve)
},
{
name: 'editAccount',
path: '/account/editAccount',
path: '/account/editAccount/:id',
meta: {},
component: resolve => require([`@/views/account/editAccount.vue`], resolve)
},
{
name: 'role',
path: '/role/index/index',
component: resolve => require([`@/views/role/index/index.vue`], resolve),
meta: {}
name: 'detailAccount',
path: '/account/detailAccount/:id',
meta: {},
component: resolve => require([`@/views/account/detailAccount.vue`], resolve)
},
{
name: 'role',
path: '/role/create/index',
component: resolve => require([`@/views/role/create/index.vue`], resolve),
path: '/role/index',
component: resolve => require([`@/views/role/index.vue`], resolve),
meta: {}
},
{
name: 'role',
path: '/role/index/look',
component: resolve => require([`@/views/role/index/look.vue`], resolve),
path: '/role/create/:id',
component: resolve => require([`@/views/role/create.vue`], resolve),
meta: {}
},
{
name: 'baseInfo',
path: '/baseInfo/index',
component: resolve => require([`@/views/baseInfo/index.vue`], resolve),
meta: {}
},
{
name: 'baseInfo',
path: '/baseInfo/relevance',
component: resolve => require([`@/views/baseInfo/relevance.vue`], resolve),
name: 'role',
path: '/role/look:id',
component: resolve => require([`@/views/role/look.vue`], resolve),
meta: {}
},
{
......@@ -66,4 +59,4 @@ const staticRoutes = Object.freeze([
component: resolve => require([`@/views/employee/detailEmployee.vue`], resolve)
}
])
export default staticRoutes
export default staticRoutes
\ No newline at end of file
......@@ -13,14 +13,16 @@ let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) {
const { response, request, sign, secret } = await fetchConfig(globalState.configSwitch)
const { response, request, sign, secret, request_common, request_config } = await fetchConfig(globalState.configSwitch)
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: { token: globalState.session.token } })
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, request: request_common, sign, 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)
......
......@@ -15,9 +15,9 @@ import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: '1112223333444' } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
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-57a2c9a4-42bd-4821-8af0-02e98a473594-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
......@@ -10,9 +10,23 @@ util.cloneText = function(message) {
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;
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.checkisCard = function(card) {
let myreg = /^(^\d{15}$)|(^\d{17}([0-9]|X)$)/;
return myreg.test(card);
}
export default util
\ No newline at end of file
......@@ -44,6 +44,9 @@ export default {
},
accountlevel: {
type: Number
},
roleType:{
type:Boolean
}
},
......@@ -81,10 +84,11 @@ export default {
// 获取当前的所有权限
findMenuFunTreeByMerId() {
let params = {
accountlevel: 4,
parentId: 41380,
id: 41588
accountlevel: this.accountlevel,
parentId: this.parentId,
id: this.pId
}
console.log(params);
this.$apis.store.findMenuFunTreeByMerId(params).then(res => {
this.tabMenu = res.map(item => {
console.log(item)
......@@ -237,6 +241,7 @@ export default {
getSelectInfo() {
this.accountTypes = this.tabMenu.map(item => {
let products = []
let productList = []
item.productsArr.forEach(itm => {
const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : []
console.log(checkedNodes)
......@@ -261,28 +266,45 @@ export default {
})
}
console.log(menuIdList, functionIdList, functionValueIdLists, list)
products.push({
productId: itm.productId,
functionIds: functionIdList,
functionValue: list,
menuIds: menuIdList
})
if(this.roleType){
productList.push({
productId: itm.productId,
functionIdList: functionIdList,
// functionValue: list,
menuIdList: menuIdList
})
}else{
products.push({
productId: itm.productId,
functionIds: functionIdList,
functionValue: list,
menuIds: menuIdList
})
}
})
return {
accounttypeId: item.accounttypeId,
products
}
if(this.roleType){
return {
accounttypeId: item.accounttypeId,
productList
}
}else{
return {
accounttypeId: item.accounttypeId,
products
}
}
})
console.log(this.accountTypes)
return this.accountTypes
}
},
mounted() {
this.findMenuFunTreeByMerId()
this.findPermissionsByMerId()
// this.findPermissionsByMerId()
}
}
</script>
</script>
<style scoped lang="scss">
.account-body {
......@@ -346,4 +368,4 @@ export default {
}
}
}
</style>
</style>
\ No newline at end of file
......@@ -20,7 +20,7 @@
<div class="tittle1 text_w">门店名称</div>
<div class="tittle2 text_w">有效期</div>
</div>
<div class="line_body">
<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>
......@@ -66,9 +66,16 @@
<script>
export default {
name: '',
props: {
list: Array,
bloc: null
},
data() {
return {
curOpenIndex: 0,
tableHeight: 0,
dataList: [],
leftData: [],
rightData: [],
......@@ -88,10 +95,7 @@ export default {
isOpen: false
}
},
props: {
list: Array,
bloc: null
},
methods: {
// changeLeftOpenStatus(item, index) {
// this.leftData[index].open = !item.open
......@@ -116,9 +120,14 @@ export default {
// console.log(right)
// }
},
mounted() {}
}
</script>
mounted() {
let clientHeight = document.documentElement.clientHeight;
this.tableHeight = clientHeight - 475;
}
};
</script>
<style lang="scss" scoped>
.bloc-info-module {
box-sizing: border-box;
......@@ -167,10 +176,6 @@ export default {
height: 0;
// transition: height 0.1s ease-in-out;
}
.table_wrapper_open {
height: 378px;
// transition: height 0.1s ease-in-out;
}
.line_wrapper {
width: 100%;
min-height: 54px;
......@@ -211,7 +216,6 @@ export default {
}
.line_body {
width: 100%;
height: 324px;
overflow-y: auto;
overflow-x: hidden;
}
......
......@@ -40,9 +40,12 @@
</div>
</div>
<div style="height: 64px"></div>
<div class="fixed-footer">
<div class="fixed-footer" :style="{
left: footerLeft + 'px',
width: footerWidth + 'px',
}">
<div :style="{ width: customWidth + 'px' }" class="btn-custom" @click="closeCurRouter">取消</div>
<div style="width: 40px"></div>
<div style="width: 20px"></div>
<div :style="{ width: customWidth + 'px' }" ref="btnWidth" class="btn-custom pruple" @click="handleMutiGL">确定关联({{ dataList.length }})</div>
</div>
</div>
......@@ -51,6 +54,7 @@
<script>
export default {
name: '',
data() {
return {
departmentList: [],
......@@ -89,11 +93,7 @@ export default {
selectedDepartment: ''
}
},
created() {
this.getDepartmentList()
this.getMerchantList()
},
mounted() {},
methods: {
// 设置底部按钮宽度
setBtnWidth() {
......@@ -270,9 +270,20 @@ export default {
return arr1
}
},
created() {
this.getDepartmentList()
this.getMerchantList()
},
mounted() {
this.footerLeft = document.querySelector(".base-container-right").offsetLeft;
this.footerWidth = document.documentElement.clientWidth - this.footerLeft;
}
}
</script>
};
</script>
<style lang="scss" scoped>
.gl-page {
box-sizing: border-box;
......@@ -319,7 +330,7 @@ export default {
}
.tbale-wrapper {
width: 100%;
height: 590px;
min-height: 200px;
background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
box-sizing: border-box;
......@@ -358,7 +369,7 @@ export default {
border-radius: 4px;
cursor: pointer;
text-align: center;
padding: 8px 0;
padding: 12px 0;
}
.pruple {
background: #5850ff;
......
......@@ -29,44 +29,13 @@
</div>
</el-form-item>
</el-form>
<div class="new_wrap">
<div class="root_menu_line">
<div v-for="(item, index) in rootList" :key="index" class="menu_item" :class="curRootIndex == index ? 'menu_item_active' : ''" @click="selectRootItem(index)">
{{ item.accounttypeName }}
</div>
</div>
</div>
<div class="product_line_wrap">
<div class="label_title">选择产品</div>
<div class="product_con">
<el-checkbox v-for="(item, index) in productList" :key="index" :false-label="item.productId" :true-label="item" @change="selectProductItem">
<div class="check_text">{{ item.productName }}</div>
</el-checkbox>
</div>
</div>
<div class="product_root_wrap">
<div class="label_title">请选择产品权限</div>
</div>
<div class="product_root_content_wrap">
<div class="content_menu_line">
<div v-for="(item, index) in storeList" :key="index" class="menu_line_item" :class="curMenuIndex == index ? 'menu_line_item_active' : ''" @click="selectMenuItem(index)">{{ item.productName }}</div>
</div>
<div class="content_menu_con">
<el-tree v-if="treeDataList.length" :data="treeDataList" :props="defaultProps"></el-tree>
<div v-if="treeDataList.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>
<SelectProduct ref="productFrom" :roleType="true" :parentId="41712" :accountlevel="2" :pId="41713"></SelectProduct>
</div>
<div style="height: 84px"></div>
<div class="fixed_bottom">
<el-button v-if="pageType == 'create'" type="primary">草稿</el-button>
<el-button v-if="pageType == 'create'" type="primary" @click="toCreateRole(1)">草稿</el-button>
<div class="wrap_driver">
<el-button type="primary" @click="toCreateRole">确定</el-button>
<el-button type="primary" @click="toCreateRole(0)">确定</el-button>
</div>
<el-button type="primary" @click="toBack">取消</el-button>
</div>
......@@ -74,11 +43,13 @@
</template>
<script>
import AutoButton from '../../../components/auto-button/index.vue'
import AutoButton from '../../components/auto-button/index.vue'
import SelectProduct from '../account/components/selectProduct.vue'
export default {
name: '',
components: {
AutoButton
AutoButton,
SelectProduct
},
data() {
return {
......@@ -94,9 +65,6 @@ export default {
},
rootList: [],
curRootIndex: 0,
productList: [],
storeList: [],
curMenuIndex: 0,
pageName: '新增角色',
roleInfo: null,
pageType: 'create',
......@@ -108,15 +76,16 @@ export default {
}
},
created() {
let query = this.$route.query
this.pageType = query.page
if (query.page == 'create') {
let id = Number(this.$route.params.id);
if (!id) {
this.pageName = '新增角色'
this.pageType ='create'
this.getMerchantName()
} else {
this.pageName = '修改角色'
let role = query.row
this.getRoleData(role.id)
this.pageType ='edit'
this.getRoleData(id)
this.editId = id
}
},
methods: {
......@@ -127,7 +96,8 @@ export default {
this.ruleForm = {
merchantName: res.merchantName,
roleName: res.roleName,
roleDesc: res.roleDescription
roleDesc: res.roleDescription,
merchantId:res.merchantId
}
this.getMerchantTree(id, res.responseList)
})
......@@ -170,8 +140,6 @@ export default {
return item
})
})
this.rootList = []
this.productList = []
},
// 选择商户权限
selectCurAccount(item, index) {
......@@ -185,68 +153,55 @@ export default {
})
this.rootList = arr
}
this.productList = this.rootList[0].products || []
},
// 选择产品的值
selectProductItem(val) {
console.log(val)
this.curMenuIndex = 0
if (typeof val === 'number') {
let arr = this.storeList.filter(el => {
return val != el.productId
})
this.storeList = arr
} else {
this.storeList.push(val)
}
},
selectRootItem(index) {
this.curRootIndex = index
this.productList = []
this.storeList = []
this.productList = this.rootList[index].products || []
},
// 产品筛选显示-隐藏
selectMenuItem(index) {
this.curMenuIndex = index
this.treeDataList = this.storeList[index].merchantProTreeResponses
},
// 确定按钮---处理参数---提交数据
toCreateRole() {
// 确定按钮---处理参数---提交数据---创建为0---草稿为1
toCreateRole(delFlag) {
let { merchantId, roleDesc, roleName } = this.ruleForm
if(!merchantId){
this.$message.error("请选择所属商户");
return
}
if(!roleName){
this.$message.error("请输入角色名称");
return
}
if (this.$refs.productFrom.getSelectInfo().length == 0) {
this.$message.error("请选择产品");
return;
}
let accountTypes = JSON.stringify(this.$refs.productFrom.getSelectInfo())
let para = {
merchantId: merchantId,
roleName: roleName,
roleDescription: roleDesc,
accounttypeId: 0,
'check[29]': 44,
delFlag: 0,
requestList: []
delFlag,
requestList: accountTypes,
}
if(this.pageType=='edit'){
para.id = this.editId
this.updateRole(para)
}else{
this.insertRole(para)
}
console.log(this.ruleForm)
console.log(para)
// if(this.pageType=='edit'){
// this.updateRole(para)
// }else{
// this.insertRole(para)
// }
},
insertRole(para) {
this.$apis.role.roleInfoData(para).then(res => {
this.$apis.role.createRole(para).then(res => {
if (res) {
history.go(-1)
this.toBack()
}
})
},
updateRole(para) {
this.$apis.role.updateRole(para).then(res => {
if (res) {
history.go(-1)
this.toBack()
}
})
},
toBack() {
history.go(-1)
this.$router.push("/role/index");
}
}
}
......@@ -276,130 +231,6 @@ export default {
padding: 32px 0;
background: #ffffff;
}
.new_wrap {
box-sizing: border-box;
width: 100%;
padding: 0 22px;
}
.root_menu_line {
height: 36px;
background: #f4f6fc;
border-radius: 4px;
display: flex;
align-items: center;
.menu_item {
width: 180px;
height: 32px;
text-align: center;
line-height: 32px;
color: #333333;
font-size: 14px;
margin-right: 2px;
background: #f4f6fc;
cursor: pointer;
border-radius: 2px;
}
.menu_item_active {
color: #5850ff;
background: #ffffff;
}
}
.product_line_wrap {
margin-top: 25px;
display: flex;
align-items: center;
.label_title {
box-sizing: border-box;
width: 100px;
font-size: 14px;
font-weight: 500;
color: #333333;
text-align: right;
padding: 0 12px 0 0;
}
.product_con {
display: flex;
align-items: center;
/deep/ .el-checkbox {
display: flex;
align-items: center;
}
.check_text {
max-width: 140px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}
.product_root_wrap {
margin-top: 30px;
.label_title {
font-size: 14px;
font-weight: 500;
color: #333333;
padding-left: 30px;
}
}
.product_root_content_wrap {
// width: 100%;
box-sizing: border-box;
background: #f4f6fc;
border-radius: 4px;
margin: 0 20px;
margin-top: 10px;
padding: 0 10px;
.content_menu_line {
height: 50px;
width: 100%;
box-sizing: border-box;
padding-top: 10px;
display: flex;
.menu_line_item {
// width: 112px;
padding: 0 38px;
height: 40px;
text-align: center;
line-height: 40px;
color: #666666;
font-size: 14px;
border-radius: 4px 4px 0px 0px;
cursor: pointer;
}
.menu_line_item_active {
color: #322ad9;
background: #ffffff;
}
}
.content_menu_con {
// height: 100%;
min-height: 380px;
background: #ffffff;
border-radius: 0px 4px 4px 4px;
}
.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;
......@@ -423,44 +254,6 @@ export default {
.wrap {
margin-right: 15px;
}
// height: 40px;
}
// .root_wrap {
// display: flex;
// min-width: 80px;
// .root_name {
// padding: 0 16px;
// height: 30px;
// border-radius: 4px 0 0 4px;
// font-size: 14px;
// font-weight: 400;
// color: #ffffff;
// line-height: 30px;
// background: #d2d2d2;
// cursor: pointer;
// border: 1px solid #d2d2d2;
// }
// .root_icon {
// width: 30px;
// height: 30px;
// border: 1px solid #d2d2d2;
// border-left: none;
// border-radius: 0 4px 4px 0;
// cursor: pointer;
// }
// .show-icon {
// display: none;
// }
// }
// .root_wrap:hover > .root_name {
// background: #999999;
// border: 1px solid #999999;
// }
// .root_wrap:hover > .root_icon > .show-icon {
// display: block;
// text-align: center;
// line-height: 30px;
// font-size: 20px;
// color: #d2d2d2;
// }
</style>
......@@ -2,28 +2,29 @@
<div class="role-home-page">
<div class="top_widget">
<el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button>
<div v-if="accountLevel != 4" class="top_select">
<span class="select_label">商户名称</span>
<el-select :filter-method="filterList" size="small" clearable filterable v-model="searchForm.merchantId" placeholder="请选择">
<el-option v-for="item in list" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="driver_line"></div>
<div class="table_widget">
<el-form :inline="true" :model="searchForm" class="follow-form-item">
<el-form-item label="状态">
<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>
</el-form-item>
<el-form-item label="角色名称">
<el-input size="small" v-model="searchForm.roleName" clearable placeholder="请输入"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="toFindData">查询</el-button>
</el-form-item>
</el-form>
<div class="search_widget">
<div class="left_wrap">
<div v-if="accountLevel != 4" class="top_select">
<span class="select_label">商户名称</span>
<el-select :filter-method="filterList" size="small" clearable filterable v-model="searchForm.merchantId" placeholder="请选择">
<el-option v-for="item in list" :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>
<el-button type="primary" size="small" @click="toFindData">查询</el-button>
</div>
<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">
<el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
......@@ -100,7 +101,7 @@ export default {
merchantList: [],
tableTotal: 0,
accountLevel: 1,
list:[]
list: []
}
},
created() {
......@@ -137,9 +138,12 @@ export default {
this.$apis.role.roleDataList(para).then(res => {
this.tableData = res.data
this.tableTotal = res.count
this.$nextTick(() => {
if (!res.data.length) {
this.$refs.table.setTableHeightFun()
})
}
// this.$nextTick(() => {
// this.$refs.table.setTableHeightFun()
// })
})
},
getMerchantName() {
......@@ -165,20 +169,41 @@ export default {
},
// 去创建角色页面
toCreatePage() {
this.$router.push({ path: '/role/create/index', query: { page: 'create' } })
this.$router.push("/role/create/"+0);
},
// 去查看角色页面
toLookPage(row) {
this.$router.push({ path: '/role/index/look', query: { row } })
this.$router.push("/role/look/"+row.id);
},
// 去修改角色页面
toEditPage(row) {
this.$router.push({ path: '/role/create/index', query: { page: 'edit', row } })
this.$router.push("/role/create/"+row.id);
},
// 去删除草稿
todelete(row){
console.log(row);
},
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(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
}
}
}
</script>
......@@ -191,27 +216,10 @@ export default {
}
.top_widget {
width: 100%;
height: 78px;
display: flex;
align-items: center;
justify-content: space-between;
background: #ffffff;
box-sizing: border-box;
padding: 0 20px;
.top_select {
display: flex;
align-items: center;
.select_label {
font-size: 14px;
font-weight: 400;
color: #333333;
margin-right: 10px;
}
}
}
.driver_line {
width: 100%;
height: 20px;
padding: 0 20px 20px 0;
}
.table_widget {
width: 100%;
......@@ -221,4 +229,25 @@ export default {
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;
}
}
}
}
</style>
......@@ -34,7 +34,7 @@
<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" />
<img class="icon" src="../../assets/img/empty.png" />
<span class="text">暂无数据</span>
</div>
</div>
......@@ -68,8 +68,7 @@ export default {
}
},
created() {
let query = this.$route.query
let id = query.row.id
let id = this.$route.params.id;
this.getRoleData(id)
this.getMerchantTree(id)
},
......
......@@ -52,18 +52,7 @@ module.exports = {
port: process.env.VUE_APP_PORT,
headers: {
'Access-Control-Allow-Origin': '*' // 主应用获取子应用时跨域响应头
},
proxy: {    
'/api': {        
target: 'http://rop-merchant.test.glsx.com.cn',
        
changeOrigin: true,
        
pathRewrite: {            
'^/api': '/'        
}    
},
},
}
},
chainWebpack: config => {
config.plugin('html')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!