Commit e0e43ea6 by wangql

4.5.0代码往4.5.1上合并

2 parents 18a01b8f 5903a2ba
Showing 54 changed files with 1900 additions and 872 deletions
......@@ -29,7 +29,12 @@ module.exports = {
after: true
}
],
'block-spacing': [2, 'always'],
eqeqeq: 'off',
// 'no-eval': ['error', { allowIndirect: false }], // default is false
'no-eval': 'off', // default is false
// allow async-await
'generator-star-spacing': 'off',
// 'block-spacing': [2, 'always'],
'brace-style': [
2,
'1tbs',
......@@ -96,7 +101,8 @@ module.exports = {
],
semi: [2, 'never'],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
// 'space-before-function-paren': [2, 'never'],
'space-before-function-paren': 0,
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [
......
......@@ -4,6 +4,6 @@
[Gitee](https://gitee.com/fairyever/d2-admin-start-kit)
分支号 dev_v4.4.0 本来用来开发审核以及报表功能版本, wangql_dev_v4.4.0 已开发部分对应需求,未往 dev_v4.4.0 版本合并,因此目前 dev_v4.4.0 分支无用
分支号 dev_v4.5.1 用来开发转化加 V4.5.0 功能需求
分支号 dev_v4.5.2 用来新建菜单对应现在的虚拟对公账户功能,以前的菜单保留以防万一
从 develop 分支号 dev_v4.4.0 本来用来开发审核以及报表功能版本, wangql_dev_v4.4.0 已开发部分对应需求,未往 dev_v4.4.0 版本合并,因此目前 dev_v4.4.0 分支无用
从 develop 拉分支号 dev_v4.5.1 用来开发转化加 V4.5.0 功能需求
从 dev_v4.5.0 拉分支号 dev_v4.5.2 用来新建菜单对应现在的虚拟对公账户功能,以前的菜单保留以防万一
No preview for this file type
......@@ -4938,6 +4938,22 @@
"safer-buffer": "^2.1.0"
}
},
"echarts": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.3.2.tgz",
"integrity": "sha512-LWCt7ohOKdJqyiBJ0OGBmE9szLdfA9sGcsMEi+GGoc6+Xo75C+BkcT/6NNGRHAWtnQl2fNow05AQjznpap28TQ==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.3.1"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
},
"editorconfig": {
"version": "0.15.3",
"resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-0.15.3.tgz",
......@@ -16005,6 +16021,21 @@
"dev": true
}
}
},
"zrender": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.3.1.tgz",
"integrity": "sha512-7olqIjy0gWfznKr6vgfnGBk7y4UtdMvdwFmK92vVQsQeDPyzkHW1OlrLEKg6GHz1W5ePf0FeN1q2vkl/HFqhXw==",
"requires": {
"tslib": "2.3.0"
},
"dependencies": {
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
}
}
}
}
}
......@@ -17,6 +17,7 @@
"better-scroll": "^1.15.2",
"dayjs": "^1.8.12",
"default-passive-events": "^2.0.0",
"echarts": "^5.3.2",
"element-ui": "^2.13.1",
"file-saver": "^2.0.5",
"flex.css": "^1.1.7",
......@@ -35,7 +36,7 @@
"vue": "^2.6.10",
"vue-i18n": "^8.14.0",
"vue-qr": "^2.5.0",
"vue-router": "^3.0.3",
"vue-router": "3.0.5",
"vuex": "^3.0.1",
"xlsx": "^0.16.9"
},
......
import request from './request'
const path = 'dj.api.'
// const path = 'dj.api.'
const path2 = 'dj.api.smartcarlife.'
export function getTodayInvite(data) {
......
......@@ -15,12 +15,24 @@ export function registerYseMerchantApi(data) {
return request(data, 'post')
}
// 注册线下商户_新版 registerYseMerchantApiNew
export function registerYseMerchantApiNew(data) {
data.method = `${djPath}yseMerchantOffline.registerNew`
return request(data, 'post')
}
// 注册线下商户-存草稿
export function draftYseMerchantApi(data) {
data.method = `${djPath}yseMerchantOffline.saveDrafts`
return request(data, 'post')
}
// 注册线下商户-存草稿_新版
export function draftYseMerchantApiNew(data) {
data.method = `${djPath}yseMerchantOffline.saveDraftsNew`
return request(data, 'post')
}
// 获取商户虚拟对公账户详情
export function getDetailApi(data) {
data.method = `${djPath}yseMerchantOffline.getDetail`
......@@ -38,3 +50,20 @@ export function getMerchantPageSearch(data) {
data.method = `${path}page.search`
return request(data, 'post')
}
// 下载账户合同
export function downloadContract(data) {
data.method = `${path}yseMerchantOffline.downSign`
return request(data, 'post')
}
// 获取省市区信息
export function getAreaInfoApi(data) {
data.method = `${djPath}yseMerchantOffline.getAreaInfo`
return request(data, 'post')
}
// 根据开户支行编号查询区域信息
export function getAreaInfoByOpenAccBankTypeApi(data) {
data.method = `${djPath}yseMerchantOffline.getAreaInfoByOpenAccBankType`
return request(data, 'post')
}
......@@ -25,22 +25,18 @@ const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
* mock - url = params.method
* 调后端接口 - url = ''
*/
const url = params.method // ''
const url = params.method
// console.log(url)
/**
* 调后端接口,请使用以下代码。
*/
var reqData =
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
method === RequestMethods.POST
? {
// baseURL: process.env.VUE_APP_API + '?method=' + params.method,
baseURL: '/',
data: sign(params, noSignAttr)
}
: {
params: sign(params, noSignAttr)
}
console.log(method === RequestMethods.POST)
console.log(url)
? { baseURL: '/', data: sign(params, noSignAttr) }
: { params: sign(params, noSignAttr) }
// console.log(method === RequestMethods.POST)
// console.log(url)
return axios({
url,
method,
......
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-07 16:30:53
*/
import request from './request'
import RequestMethods from './request.methods'
export const BASE_DATA_URL = 'fims.configuration.from.conftype'
const path = 'dj.api.'
// 获取商品分类列表
export function getProductType(data) {
data.method = `${path}goods.type.list`
return request(data)
}
// 获取渠道列表
export function getChannelType(data) {
data.method = `${path}channel.type.list`
return request(data)
}
// 图片上传
export function uploadImg(data) {
data.method = `${path}common.uploadImg`
return request(data, RequestMethods.POST, ['file'])
}
// 图片识别
export function imgRecognitionApi(data) {
data.method = `${path}common.ocr.recognition`
return request(data, RequestMethods.POST)
}
// 银行列表
export function getBankListApi(data) {
data.method = `${path}yseBankInfo.bankList`
return request(data, RequestMethods.POST)
}
// 银行列表-支行
export function getYseBankListApi(data) {
data.method = `${path}yseBankInfo.listWithPage`
return request(data, RequestMethods.POST)
}
// 给指定号码发送验证码
export function sendToSmsCodeApi(data) {
data.method = `${path}smartcarlife.sms.sendSmsCode`
return request(data, RequestMethods.POST)
}
// 获取配置列表
export function commonConfigApi(data) {
data.method = `${path}common.config.list`
return request(data, RequestMethods.POST)
}
/*
* @Author: limin
* @Date: 2019-08-26 18:02:55
* @Last Modified by: chenwq
* @Last Modified time: 2021-06-07 16:30:53
*/
import request from './request'
import RequestMethods from './request.methods'
export const BASE_DATA_URL = 'fims.configuration.from.conftype'
const path = 'dj.api.'
// 获取商品分类列表
export function getProductType(data) {
data.method = `${path}goods.type.list`
return request(data)
}
// 获取渠道列表
export function getChannelType(data) {
data.method = `${path}channel.type.list`
return request(data)
}
// 图片上传
export function uploadImg(data) {
data.method = `${path}common.uploadImg`
return request(data, RequestMethods.POST, ['file'])
}
// 图片识别
export function imgRecognitionApi(data) {
data.method = `${path}common.ocr.recognition`
return request(data, RequestMethods.POST)
}
// 银行列表
export function getBankListApi(data) {
data.method = `${path}yseBankInfo.bankList`
return request(data, RequestMethods.POST)
}
// 银行列表-支行
export function getYseBankListApi(data) {
data.method = `${path}yseBankInfo.listWithPage`
return request(data, RequestMethods.POST)
}
// 给指定号码发送验证码
export function sendToSmsCodeApi(data) {
data.method = `${path}smartcarlife.sms.sendSmsCode`
return request(data, RequestMethods.POST)
}
// 获取配置列表
export function commonConfigApi(data) {
data.method = `${path}common.config.list`
return request(data, RequestMethods.POST)
}
......@@ -328,7 +328,7 @@ export function limitPrice(
regRule
) {
var reg = {
priceReg: /^\d[\d\.]*$/,
priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/
}
regRule = regRule || 'priceReg'
......
// 将该代码定义为一个js文件
const resize = {
bind(el, binding) {
let width = ''
let height = ''
function isResize() {
const style = document.defaultView.getComputedStyle(el)
if (width !== style.width || height !== style.height) {
binding.value()
}
width = style.width
height = style.height
}
el._vueSetInterval_ = setInterval(isResize, 300)
},
unbind(el) {
clearInterval(el._vueSetInterval_)
}
}
export default resize
// import Vue from 'vue'
import { Message, MessageBox, Loading } from 'element-ui'
import moment from 'moment'
let loadingInstance = ''
......@@ -121,7 +120,7 @@ export const Util = {
* 只能输入英文字母和数字,不能输入中文
*/
validationInput: function(str) {
const reg = /[^\w\.\/]/gi
const reg = /[^\w\.\/]/gi // eslint-disable-line
return reg.test(str)
},
......@@ -140,7 +139,7 @@ export const Util = {
},
/**
* 获取浏览器参数
* 获取浏览器参数
*/
getUrlParams: function(name) {
const vars = []
......
<template>
<el-dialog id="baseDialog"
top="30vh"
:close-on-click-modal="true"
:close-on-press-escape="true"
:title="dialogConfig.title"
:width="dialogConfig.width"
:visible.sync="visible"
:show-close="config.showClose"
:append-to-body="config.appendToBody">
<slot></slot>
<div slot="footer"
v-if="config.isShowFooter">
<el-button type="danger"
@click="confirmBtn">
{{config.confirm_name}}
</el-button>
<el-button @click="visible = false">
{{ config.cancel_name }}
</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'baseDialog',
props: {
dialogConfig: {
required: false,
type: Object,
default: function () {
return {
title: '提示',
width: '480px'
}
}
},
config: {
required: false,
type: Object,
default: function () {
return {
showClose: true,
appendToBody: false, // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
isShowFooter: true,
cancel_name: '取 消',
confirm_name: '确 定'
}
}
},
isShow: {
// 弹窗是否展示
type: Boolean,
default: false
}
// width: {
// //弹窗宽度
// type: String,
// default: '',
// },
// cancel_name: {
// //取消按钮名称
// type: String,
// default: '取 消',
// },
// confirm_name: {
// //确定按钮名称
// type: String,
// default: '确 定',
// },
// isShowFooter: {
// //是否自定底部
// type: Boolean,
// default: true,
// },
// closeClick: {
// type: Boolean,
// default: false,
// },
// appendToBody: {
// // 是否将自身插入至 body 元素,有嵌套的弹窗时一定要设置
// type: Boolean,
// default: false,
// },
},
data() {
return {}
},
computed: {
visible: {
get() {
return this.isShow
},
set(val) {
this.$emit('update:isShow', false)
}
}
},
methods: {
confirmBtn() {
// 触发保存
this.$emit('handleClick')
}
},
created() {
// console.log('baseDialog')
},
mounted() { }
}
</script>
<style scoped lang="scss">
::v-deep .el-dialog {
// height: 90vh;
border-radius: 6px;
// padding: 0;
overflow: hidden;
.el-dialog__header {
// box-shadow: 0px 0px 5px 0px rgba(136, 152, 157, 0.3);
border-bottom: solid 1px #e6e6e6;
border-radius: 6px 6px 0px 0px;
padding: 18px 20px 18px 25px;
.el-dialog__title {
// color: #212121;
color: #333333;
font-family: PingFangSC-Medium;
font-size: 20px;
font-weight: 600;
// font-weight: 16px;
}
.el-dialog__close {
color: #666;
font-weight: 600;
font-size: 20px;
}
}
.el-dialog__body {
box-sizing: border-box;
// padding-left: 25px;
padding: 15px 20px 30px;
color: #333;
max-height: calc(100% - 121px);
// height: calc(100% - 121px);
}
.roleTitle {
margin-right: 40px;
}
}
</style>
export default {
name: 'AuthButton',
props: {
label: {
type: String,
default: ''
},
size: {
type: String,
default: 'mini'
},
// type: {
// type: String,
// default: 'text'
// },
category: {
type: String,
default: 'operation'
},
loading: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: null
},
accept: {
type: String,
default: null
},
mapping: {
type: Object,
default: null
},
showBtnIds: {
type: Array,
default: []
},
data: Object
},
functional: true, // 开启函数化组件
render: (h, ctx) => {
const _this = ctx.parent // 获取 vue this 实例
// console.log(ctx);
/**
* 获取传入参数
* category 非必填 button 类别 暂时两种 1 表格操作:operation ,2 Button 按钮: action 默认 operation ----- route 中不标明 视为默认值 operation
* data 点击按钮时 需要得到的参数 比如 table 中的 当前行数据 row
* mapping 非必填 但: 当列表中的操作选项 根据 某个字段 变化的话 必填 且 必须 注明 field: 字段名
* label 当传入label 字段时 标识明确指定渲染该label 的按钮
* size 按钮样式,默认mini
* showBtnIds 按需显示按钮
*/
const {
category,
data,
mapping,
label,
size,
showBtnIds
} = ctx.props
let curBtns = []
/**
* 判断一个按钮(btn)是否存在与当前行(data) 的映射关系(mapping)中
* @param {*} btn
*/
const filter = btn => mapping ? mapping[data[mapping['field']]].includes(btn.label) : true
const $store = _this.$store.getters['d2admin/auth/curBtns']
if (!$store) return h('div')
if (label) { // 指定label
const __item = $store.find(btn => (btn.label === label) && filter(btn))
__item && curBtns.push(__item)
} else {
/**
* 拿到当前模块(页面) 所拥有按钮列表 过滤type属性 与 映射关系 返回需要显示的按钮列表
*/
curBtns = $store.filter(btn => {
if (category === 'operation') {
return (btn.category === 'operation' || !btn.category) && filter(btn)
} else if (!category) { // 未指定类别
return !btn.category && filter(btn)
}
return (btn.category === category) && filter(btn)
})
}
if (curBtns.length === 0) return h('div')
const __aBtns = []
/**
* 循环最终显示的按钮列表
* 并渲染到页面
*/
curBtns = showBtnIds.length ? curBtns.filter(item => showBtnIds.includes(item.authId)) : curBtns
curBtns.forEach(btn => {
// var judgeRes = data ? (data.yqMerchantId === _this.$store.state.d2admin.user.info.detail.merchantId) : true
// var isShow = !btn.judgeShow ? true : judgeRes
// if ((btn.category === 'Button') || (data && isShow)) {
__aBtns.push(h('el-button', {
props: {
type: btn.type || (btn.category === 'Button' ? '' : 'text'),
icon: btn.icon ? `el-icon-${btn.icon}` : '',
size: size,
disabled: btn.ruleObj ? (btn.ruleObj.hasOwnProperty('disabledStatusList') ? btn.ruleObj.disabledStatusList.includes(data[btn.ruleObj.attr]) : false) : false
},
style: {
color: btn.color
},
on: {
click: (e) => btn.handle && _this[btn.handle](data, e)
}
}, [btn.ruleObj ? btn.ruleObj.rule[data[btn.ruleObj.attr]] : btn.label]))
// }
})
return h('span', {}, [...__aBtns, ctx.children])
}
}
export default {
name: 'AuthButton',
props: {
label: {
type: String,
default: ''
},
size: {
type: String,
default: 'mini'
},
// type: {
// type: String,
// default: 'text'
// },
category: {
type: String,
default: 'operation'
},
loading: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
id: {
type: String,
default: null
},
accept: {
type: String,
default: null
},
mapping: {
type: Object,
default: null
},
showBtnIds: {
type: Array,
// props类型为Object/Array 使用函数方法解决
default: () => []
},
data: Object
},
functional: true, // 开启函数化组件
render: (h, ctx) => {
const _this = ctx.parent // 获取 vue this 实例
// console.log(ctx);
/**
* 获取传入参数
* category 非必填 button 类别 暂时两种 1 表格操作:operation ,2 Button 按钮: action 默认 operation ----- route 中不标明 视为默认值 operation
* data 点击按钮时 需要得到的参数 比如 table 中的 当前行数据 row
* mapping 非必填 但: 当列表中的操作选项 根据 某个字段 变化的话 必填 且 必须 注明 field: 字段名
* label 当传入label 字段时 标识明确指定渲染该label 的按钮
* size 按钮样式,默认mini
* showBtnIds 按需显示按钮
*/
const { category, data, mapping, label, size, showBtnIds } = ctx.props
let curBtns = []
/**
* 判断一个按钮(btn)是否存在与当前行(data) 的映射关系(mapping)中
* @param {*} btn
*/
const filter = btn =>
mapping ? mapping[data[mapping['field']]].includes(btn.label) : true
const $store = _this.$store.getters['d2admin/auth/curBtns']
if (!$store) return h('div')
if (label) {
// 指定label
const __item = $store.find(btn => btn.label === label && filter(btn))
__item && curBtns.push(__item)
} else {
/**
* 拿到当前模块(页面) 所拥有按钮列表 过滤type属性 与 映射关系 返回需要显示的按钮列表
*/
curBtns = $store.filter(btn => {
if (category === 'operation') {
return (btn.category === 'operation' || !btn.category) && filter(btn)
} else if (!category) {
// 未指定类别
return !btn.category && filter(btn)
}
return btn.category === category && filter(btn)
})
}
if (curBtns.length === 0) return h('div')
const __aBtns = []
/**
* 循环最终显示的按钮列表
* 并渲染到页面
*/
curBtns = showBtnIds.length
? curBtns.filter(item => showBtnIds.includes(item.authId))
: curBtns
curBtns.forEach(btn => {
// var judgeRes = data ? (data.yqMerchantId === _this.$store.state.d2admin.user.info.detail.merchantId) : true
// var isShow = !btn.judgeShow ? true : judgeRes
// if ((btn.category === 'Button') || (data && isShow)) {
__aBtns.push(
h(
'el-button',
{
props: {
type: btn.type || (btn.category === 'Button' ? '' : 'text'),
icon: btn.icon ? `el-icon-${btn.icon}` : '',
size: size,
disabled: btn.ruleObj
? btn.ruleObj.hasOwnProperty('disabledStatusList')
? btn.ruleObj.disabledStatusList.includes(
data[btn.ruleObj.attr]
)
: false
: false
},
style: {
color: btn.color
},
on: {
click: e => btn.handle && _this[btn.handle](data, e)
}
},
[btn.ruleObj ? btn.ruleObj.rule[data[btn.ruleObj.attr]] : btn.label]
)
)
// }
})
return h('span', {}, [...__aBtns, ctx.children])
}
}
<template>
<div class="d2-container-full">
<!-- <el-scrollbar> -->
<div v-if="$slots.header" class="d2-container-full__header" ref="header" :class="this.active?'active':'close'">
<slot name="header" />
<d2-header-switch />
</div>
<div class="d2-container-full__body" ref="body">
<slot />
</div>
<div v-if="$slots.footer" class="d2-container-full__footer" ref="footer">
<slot name="footer" />
</div>
<!-- </el-scrollbar> -->
</div>
</template>
<script>
import scroll from './mixins/normal'
export default {
name: 'd2-container-full',
mixins: [scroll],
components: {
// d2HeaderSwitch: () => import('./d2-header-switch.vue')
},
data() {
return {
oHeaderStyle: {
padding: '20px 20px 0 20px'
}
}
},
computed: {
active() {
return this.$store.state.d2admin.tsearch.active
}
},
mounted() {
// 增加滚动事件监听
this.addScrollListener()
},
beforeDestroy() {
// 移除滚动事件监听
this.removeScrollListener()
}
}
</script>
<style lang="scss">
.d2-container-full {
.d2-container-full__header {
position: relative;
transition: all .2s ease;
&.close{
height: 0;
padding: 0 20px !important;
form{
opacity: 0;
}
border-bottom-color:rgba(0,0,0,0) !important;
}
.el-form-item{
margin-bottom: 4px;
}
}
}
//滚动条的宽度
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
//滚动条的滑块
::-webkit-scrollbar-thumb {
background-color: #a1a3a9;
border-radius: 3px;
}
</style>
<template>
<div class="d2-container-full">
<!-- <el-scrollbar> -->
<div v-if="$slots.header"
class="d2-container-full__header"
ref="header"
:class="this.active?'active':'close'">
<slot name="header" />
<d2-header-switch />
</div>
<div class="d2-container-full__body"
ref="body">
<slot />
</div>
<div v-if="$slots.footer"
class="d2-container-full__footer"
ref="footer">
<slot name="footer" />
</div>
<!-- </el-scrollbar> -->
</div>
</template>
<script>
import scroll from './mixins/normal'
export default {
name: 'd2-container-full',
mixins: [scroll],
components: {
d2HeaderSwitch: () => import('./d2-header-switch.vue')
},
data() {
return {
oHeaderStyle: {
padding: '20px 20px 0 20px'
}
}
},
computed: {
active() {
return this.$store.state.d2admin.tsearch.active
}
},
mounted() {
// 增加滚动事件监听
this.addScrollListener()
},
beforeDestroy() {
// 移除滚动事件监听
this.removeScrollListener()
}
}
</script>
<style lang="scss">
.d2-container-full {
.d2-container-full__header {
position: relative;
transition: all 0.2s ease;
&.close {
height: 0;
padding: 0 20px !important;
form {
opacity: 0;
}
border-bottom-color: rgba(0, 0, 0, 0) !important;
}
.el-form-item {
margin-bottom: 4px;
}
}
}
//滚动条的宽度
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
//滚动条的滑块
::-webkit-scrollbar-thumb {
background-color: #a1a3a9;
border-radius: 3px;
}
</style>
<template>
<div
v-if="show"
class="d2-header-switch"
:class="{ 'd2-header-switch--active': isActive }"
@click="handleClick">
<d2-el-icon :name="name"/>
<li :class="$store.state.d2admin.tsearch.active?'fa fa-compress':'fa fa-expand'"></li>
</div>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
data() {
return {
isActive: false,
path: ''
}
},
computed: {
show() {
return true
},
name() {
return this.$store.state.d2admin.tsearch.active ? 'top-right' : 'bottom-left'
}
},
mounted() {
setTimeout(() => (this.isActive = true), 0)
},
methods: {
...mapMutations('d2admin/tsearch', ['toggle']),
// 点击按钮的时候跳转到源代码
handleClick() {
this.toggle()
}
}
}
</script>
<style lang="scss" scoped>
.d2-header-switch {
$borderRadius: 30px;
$paddingLR: 30px;
$paddingTB: 2px;
$fontSize: 12px;
$rightOuter: $paddingLR / 2;
opacity: 0;
position: absolute;
z-index: 2019;
right: 20%;
bottom: -17px;
font-size: $fontSize;
line-height: $fontSize;
font-weight: bold;
border-radius: 0 0 $borderRadius $borderRadius;
padding: $paddingTB $paddingLR;
background-color: rgba(#fff, 1);
border: 1px solid #DCDFE6;
border-top: none;
color: #606266;
transition: all .3s;
@extend %unable-select;
&.d2-header-switch--active {
opacity: 1;
}
}
</style>
<template>
<div v-if="show"
class="d2-header-switch"
:class="{ 'd2-header-switch--active': isActive }"
@click="handleClick">
<d2-el-icon :name="name" />
<li :class="$store.state.d2admin.tsearch.active?'fa fa-compress':'fa fa-expand'"></li>
</div>
</template>
<script>
import { mapMutations } from 'vuex'
export default {
data() {
return {
isActive: false,
path: ''
}
},
computed: {
show() {
return true
},
name() {
return this.$store.state.d2admin.tsearch.active ? 'top-right' : 'bottom-left'
}
},
mounted() {
setTimeout(() => (this.isActive = true), 0)
},
methods: {
...mapMutations('d2admin/tsearch', ['toggle']),
// 点击按钮的时候跳转到源代码
handleClick() {
this.toggle()
}
}
}
</script>
<style lang="scss" scoped>
.d2-header-switch {
$borderRadius: 30px;
$paddingLR: 30px;
$paddingTB: 2px;
$fontSize: 12px;
$rightOuter: $paddingLR / 2;
opacity: 0;
position: absolute;
z-index: 2000;
right: 20%;
bottom: -17px;
font-size: $fontSize;
line-height: $fontSize;
font-weight: bold;
border-radius: 0 0 $borderRadius $borderRadius;
padding: $paddingTB $paddingLR;
background-color: rgba(#fff, 1);
border: 1px solid #dcdfe6;
border-top: none;
color: #606266;
transition: all 0.3s;
@extend %unable-select;
&.d2-header-switch--active {
opacity: 1;
}
}
</style>
......@@ -24,7 +24,7 @@
v-model="proInfo.goodsCode"
placeholder="请选择一款作为升级商品"
value-key="goodsCode"
filterable="true"
filterable
@change="handleChangeGood">
<el-option v-for="item in proList"
:key="item.goodsCode"
......
import Vue from 'vue'
import d2Container from './d2-container'
import authButton from './d2-auth/d2-auth-btn.js'
// 注意 有些组件使用异步加载会有影响
Vue.component('d2-container', d2Container)
Vue.component('d2-icon', () => import('./d2-icon'))
Vue.component('d2-el-icon', () => import('./d2-el-icon'))
Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue'))
Vue.component('d2-table-header', () => import('./d2-table-header/index.vue'))
Vue.component('d2-table', () => import('./d2-table/index.vue'))
Vue.component('d2-dialog', () => import('./d2-dialog/index.vue'))
Vue.component('d2-form', () => import('./d2-form/index.vue'))
Vue.component('d2-search', () => import('./d2-search/index.vue'))
Vue.component('relateStoreDialog', () => import('./d2-form/relateStoreDialog.vue'))
Vue.component([authButton.name], authButton)
import Vue from 'vue'
import d2Container from './d2-container'
import authButton from './d2-auth/d2-auth-btn.js'
// 注意 有些组件使用异步加载会有影响
Vue.component('d2-container', d2Container)
Vue.component('d2-icon', () => import('./d2-icon'))
Vue.component('d2-el-icon', () => import('./d2-el-icon'))
Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue'))
Vue.component('d2-table-header', () => import('./d2-table-header/index.vue'))
Vue.component('d2-table', () => import('./d2-table/index.vue'))
Vue.component('d2-dialog', () => import('./d2-dialog/index.vue'))
Vue.component('d2-form', () => import('./d2-form/index.vue'))
Vue.component('d2-search', () => import('./d2-search/index.vue'))
Vue.component('relateStoreDialog', () =>
import('./d2-form/relateStoreDialog.vue')
)
// Vue.component([authButton.name], authButton)
Vue.component(authButton.name, authButton)
......@@ -9,18 +9,12 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>-->
<div
v-popover:popover-personal
class="d2-mr personal-wrap"
>
<span
v-if="show"
class="btn-text"
>{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span>
<span
class="btn-text out-txt"
@click="clear"
>退出</span>
<div v-popover:popover-personal
class="d2-mr personal-wrap">
<span v-if="show"
class="btn-text">{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span>
<span class="btn-text out-txt"
@click="clear">退出</span>
<!-- <el-popover ref="popover-personal" placement="bottom-end" v-model="userVisible" trigger="manual">
<i slot="reference" :class="['arrow-icon', 'el-icon-arrow-down', userVisible ? 'drOpen' : '']" @click="handleAccountClose"></i>
<el-popover popper-class="accout-panel" placement="left-end" :visible-arrow="false" v-model="accountPanelVisible" trigger="manual">
......@@ -38,7 +32,7 @@
<script>
import { mapActions } from 'vuex'
import PersonalPanel from '../personal-panel'
// import PersonalPanel from '../personal-panel'
export default {
data() {
return {
......@@ -47,11 +41,14 @@ export default {
userVisible: false,
accountInfo: {
accountList: []
},
info: {
}
}
},
components: {
PersonalPanel
// PersonalPanel
},
mounted() {
this.show = false
......@@ -76,8 +73,8 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
const reload = async() => {
}).then(async () => {
const reload = async () => {
localStorage.clear()
await this.logout()
window.location.reload()
......@@ -100,7 +97,7 @@ export default {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
}).then(async () => {
this.$router.push('/login')
await this.logout()
await this.$StoreReset.call(this.$store) // 重置 store
......@@ -124,7 +121,7 @@ export default {
cursor: pointer;
}
.el-icon-arrow-down {
transition: all .2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.personal-wrap .arrow-icon.drOpen {
transform: rotate(-180deg);
......
......@@ -31,7 +31,7 @@ Vue.use(d2Admin)
Vue.prototype.notice = notice
const isProd = process.env.NODE_ENV === 'production'
console.log(isProd)
// console.log(isProd)
if (!isProd) {
Vue.config.devtools = true
}
......@@ -44,6 +44,8 @@ axios({
method: 'get'
}).then(({ data }) => {
baseConfig = data
// 先本地切换到测试环境接口
// data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
new Vue({
router,
store,
......
......@@ -56,7 +56,6 @@ service.interceptors.request.use(
config => {
return new Promise(async resolve => {
await store.commit('d2admin/loading/set', true)
// const uuid = util.cookies.get('uuid')
// 如果请求链接不在排除列表 (排除列表: 登录 基础数据) 并且cookie 过期(判断是否长时间未操作)
// if (!LogExternals.some(u => u === url || (params && u === params.method)) && !uuid) {
......@@ -70,7 +69,38 @@ service.interceptors.request.use(
// })
// }
// config.url = baseConfig.axios.baseURL + config.url
config.url = baseConfig.axios.baseURL
// console.log(config.data.method.includes('dj.api.common.uploadImg'))
// console.log(config)
// console.log(Object.prototype.toString.call(config.data))
// console.log(config.data.method)
if (process.env.NODE_ENV == 'development') {
// 处理图片开发环境没用的问题
const type = Object.prototype.toString.call(config.data)
const methodList = [
'dj.api.common.uploadImg',
'dj.api.common.ocr.recognition',
'dj.api.smartcarlife.sms.sendSmsCode'
]
if (
type == '[object Object]' &&
methodList.includes(config.data.method)
) {
config.url = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
} else {
config.url = baseConfig.axios.baseURL
}
} else {
config.url = baseConfig.axios.baseURL
}
// if (config.params && config.params.method.includes('common.uploadImg')) {
// config.url = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// } else {
// config.url = baseConfig.axios.baseURL
// }
// config.url = baseConfig.axios.baseURL
// config.timeout = baseConfig.axios.timeout
resolve(config)
})
......
import Vue from 'vue'
import VueRouter from 'vue-router'
// 进度条
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import store from '@/store/index'
import util from '@/libs/util.js'
// 路由数据
import routes from './routes'
const originalPush = VueRouter.prototype.push // 解决连续点击路由异常问题 limin
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location) && originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
// 导出路由 在 main.js 里使用
const router = new VueRouter({
routes
})
const setCurrent = path => {
return new Promise(async resolve => {
path !== '/login' && await store.dispatch('d2admin/page/currentSet', path)
resolve()
})
}
/**
* 路由拦截
* 权限验证
*/
router.beforeEach(async(to, from, next) => {
const source = store.state.d2admin.auth.source
// 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
// await store.dispatch('d2admin/page/isLoaded')
// 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198
// await store.dispatch('d2admin/size/isLoaded')
// 设置当前页 下次登录 默认打开此页面
await setCurrent(to.fullPath)
// 进度条
NProgress.start()
// 关闭搜索面板
store.commit('d2admin/search/set', false)
if (from.name === null && to.path !== '/login' && !source) { // 页面刷新 动态路由会失效 初始化路由与左侧菜单栏
await store.dispatch('d2admin/auth/init')
await store.dispatch('d2admin/account/load')
next(to.path)
} else {
if (store.state.d2admin.user.info) { // sessionstorage 用户存在继续当前路由 不存在 跳转登录 防止页面关闭还可以打开页面
next()
} else {
if (to.path === '/login') { // 如果是登录页面路径,就直接next()
next()
} else { // 不然就跳转到登录;
await store.dispatch('d2admin/account/logout')
next('/login')
}
}
}
})
router.afterEach(to => {
// 进度条
NProgress.done()
// 多页控制 打开新的页面
store.dispatch('d2admin/page/open', to)
// 更改标题
util.title(to.meta.title)
// 保存当前页面meta信息
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta)
})
export const ResetRouter = () => new VueRouter({
routes
})
export default router
import Vue from 'vue'
import VueRouter from 'vue-router'
// 进度条
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import store from '@/store/index'
import util from '@/libs/util.js'
// 路由数据
import routes from './routes'
const originalPush = VueRouter.prototype.push // 解决连续点击路由异常问题 limin
VueRouter.prototype.push = function push(location, onResolve, onReject) {
// 解决Uncaught (in promise) 控制台报错问题
// console.log(onResolve)
// console.log(onReject)
if (onResolve || onReject) {
return originalPush.call(this, location, onResolve, onReject)
}
// return originalPush.call(this, location).catch(err => err)
return (
originalPush.call(this, location) &&
originalPush.call(this, location).catch(err => err)
)
}
Vue.use(VueRouter)
// 导出路由 在 main.js 里使用
const router = new VueRouter({
routes
})
const setCurrent = path => {
return new Promise(async resolve => {
path !== '/login' && (await store.dispatch('d2admin/page/currentSet', path))
resolve()
})
}
/**
* 路由拦截
* 权限验证
*/
router.beforeEach(async (to, from, next) => {
const source = store.state.d2admin.auth.source
// 确认已经加载多标签页数据 https://github.com/d2-projects/d2-admin/issues/201
// await store.dispatch('d2admin/page/isLoaded')
// 确认已经加载组件尺寸设置 https://github.com/d2-projects/d2-admin/issues/198
// await store.dispatch('d2admin/size/isLoaded')
// 设置当前页 下次登录 默认打开此页面
await setCurrent(to.fullPath)
// 进度条
NProgress.start()
// 关闭搜索面板
store.commit('d2admin/search/set', false)
if (from.name === null && to.path !== '/login' && !source) {
// 页面刷新 动态路由会失效 初始化路由与左侧菜单栏
await store.dispatch('d2admin/auth/init')
await store.dispatch('d2admin/account/load')
next(to.path)
} else {
if (store.state.d2admin.user.info) {
// sessionstorage 用户存在继续当前路由 不存在 跳转登录 防止页面关闭还可以打开页面
next()
} else {
if (to.path === '/login') {
// 如果是登录页面路径,就直接next()
next()
} else {
// 不然就跳转到登录;
await store.dispatch('d2admin/account/logout')
next('/login')
}
}
}
})
router.afterEach(to => {
// 进度条
NProgress.done()
// 多页控制 打开新的页面
store.dispatch('d2admin/page/open', to)
// 更改标题
util.title(to.meta.title)
// 保存当前页面meta信息
store.dispatch('d2admin/auth/setCurrentPageMeta', to.meta)
})
export const ResetRouter = () =>
new VueRouter({
routes
})
export default router
......@@ -795,6 +795,54 @@ export const resources = {
activePath: '/accountList'
},
component: _import('systemConfig/account/applyAccount')
},
'90610': {
path: '/accountList_new',
name: 'accountList_new',
meta: {
title: '新虚拟对公账户',
authId: '90610',
parentId: '906',
cache: false
},
auth: [
{
authId: '9061001',
parentId: '90610',
label: '申请虚拟对公账户',
handle: 'handleApply',
ruleObj: {
attr: 'accountStatus',
rule: {
1: '申请虚拟对公账户',
2: '申请虚拟对公账户',
3: '账户详情',
4: '申请虚拟对公账户'
},
disabledStatusList: [2]
},
addRoutePath: [
{
authId: '90611',
name: '申请虚拟对账账户',
parentId: '90610'
}
]
}
],
component: _import('systemConfig/accountNew/accountList')
},
'90611': {
path: '/applyAccount_new',
name: 'applyAccount_new',
meta: {
title: '申请虚拟对账账户',
authId: '90611',
parentId: '90610',
cache: false,
activePath: '/accountList_new'
},
component: _import('systemConfig/accountNew/applyAccount')
}
// '90602': {
// path: '/serviceStore',
......
......@@ -11,7 +11,7 @@ Vue.prototype.$StoreReset = function() {
Vue.use(Vuex)
const isProd = process.env.NODE_ENV === 'production'
console.log(isProd)
// console.log(isProd)
if (!isProd) {
Vue.config.devtools = true
}
......
import util from '@/libs/util.js'
import { AccountLogin, getAuths, getUserInfo } from '@api/sys.account'
import { SUPPER_ADMIN } from '@/common/constants'
// import { SUPPER_ADMIN } from '@/common/constants'
import { localRoutes } from '@/router/routes'
import md5 from 'js-md5'
export default {
......@@ -21,31 +21,44 @@ export default {
password: md5(p.password).toLowerCase()
}
// 开始请求登录接口
AccountLogin(params).then(async(accountInfo = {}) => {
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
// 整个系统依赖这两个数据进行校验和存储
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
// util.cookies.set('uuid', accountInfo.loginName)
if (accountInfo.accountList.length > 1) {
resolve({ isMutiAccount: true, accountInfo: accountInfo, userInfo: {} })
} else {
util.cookies.set('token', accountInfo.sessionId)
getUserInfo({}).then(async userInfo => {
userInfo.beSuper = userInfo.loginAccount.isAdmin == 1
userInfo.detail = userInfo.merchant
Object.keys(userInfo.loginAccount).forEach(item => {
if (userInfo.loginAccount[item] && !userInfo.detail[item]) {
userInfo.detail[item] = userInfo.loginAccount[item]
}
AccountLogin(params)
.then(async (accountInfo = {}) => {
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
// 整个系统依赖这两个数据进行校验和存储
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复
// token 代表用户当前登录状态 建议在网络请求中携带 token
// 如有必要 token 需要定时更新,默认保存一天
// util.cookies.set('uuid', accountInfo.loginName)
if (accountInfo.accountList.length > 1) {
resolve({
isMutiAccount: true,
accountInfo: accountInfo,
userInfo: {}
})
userInfo.merchantAccountLevel = userInfo.detail.merchantAccountLevel
await dispatch('getAuth', { userInfo: userInfo, accountInfo: accountInfo })
resolve({ isMutiAccount: false, accountInfo: accountInfo, userInfo: userInfo })
})
}
})
} else {
util.cookies.set('token', accountInfo.sessionId)
getUserInfo({}).then(async userInfo => {
userInfo.beSuper = userInfo.loginAccount.isAdmin == 1
userInfo.detail = userInfo.merchant
Object.keys(userInfo.loginAccount).forEach(item => {
if (userInfo.loginAccount[item] && !userInfo.detail[item]) {
userInfo.detail[item] = userInfo.loginAccount[item]
}
})
userInfo.merchantAccountLevel =
userInfo.detail.merchantAccountLevel
await dispatch('getAuth', {
userInfo: userInfo,
accountInfo: accountInfo
})
resolve({
isMutiAccount: false,
accountInfo: accountInfo,
userInfo: userInfo
})
})
}
})
.catch(err => {
console.log('err: ', err)
reject(err)
......@@ -66,24 +79,27 @@ export default {
routeAll.splice(routeAll.findIndex(item => item.authId === '907'), 1)
routeAll.unshift(indexPage)
if (userInfo.detail.accountType !== 7) {
!res.map(i => i.authId).includes('907') && res.unshift({
authId: '907',
name: '总览',
parentId: '1'
})
!res.map(i => i.authId).includes('907') &&
res.unshift({
authId: '907',
name: '总览',
parentId: '1'
})
}
var tempAuths = []
var targetRoutes = (res.beSuper) ? routeAll : res.map(i => i.authId)
routeAll.map(i => i.authId).forEach((item, index) => {
targetRoutes.includes(item) && tempAuths.push(routeAll[index])
if (routeAll[index].hasOwnProperty('addRoutePath')) {
routeAll[index].addRoutePath.forEach(k => {
if (!tempAuths.map(m => m.authId).includes(k.authId)) {
tempAuths.push(k)
}
})
}
})
var targetRoutes = res.beSuper ? routeAll : res.map(i => i.authId)
routeAll
.map(i => i.authId)
.forEach((item, index) => {
targetRoutes.includes(item) && tempAuths.push(routeAll[index])
if (routeAll[index].hasOwnProperty('addRoutePath')) {
routeAll[index].addRoutePath.forEach(k => {
if (!tempAuths.map(m => m.authId).includes(k.authId)) {
tempAuths.push(k)
}
})
}
})
// const authes = (+accountInfo.roleType === SUPPER_ADMIN) ?
// util.permision.flatten(Object.values(localRoutes))
// .map(obj => ({ authId: obj.authId, parentId: obj.parentId })) :
......@@ -94,7 +110,11 @@ export default {
// 初始化权限
await dispatch('d2admin/auth/init', null, { root: true })
// // 设置 vuex 用户信息
await dispatch('d2admin/user/set', { info: userInfo, accountInfo }, { root: true })
await dispatch(
'd2admin/user/set',
{ info: userInfo, accountInfo },
{ root: true }
)
// // 用户登录后从持久化数据加载一系列的设置
await dispatch('load')
// 结束
......
......@@ -5,17 +5,14 @@
* @Last Modified time: 2020-11-15 10:22:06
*/
import {
getChannelType,
getProductType
} from '@/api/sys.base'
import {
BaseData
} from '@/common/constants'
const map = {
[BaseData.channelType]: getChannelType,
[BaseData.productType]: getProductType
}
import { getChannelType, getProductType } from '@/api/sys.base'
// import {
// BaseData
// } from '@/common/constants'
// const map = {
// [BaseData.channelType]: getChannelType,
// [BaseData.productType]: getProductType
// }
export default {
namespaced: true,
state: {
......@@ -30,31 +27,23 @@ export default {
* 每次登录会强制 初始化
* @param {*} param0
*/
init({
state,
dispatch,
commit
}) {
init({ state, dispatch, commit }) {
return new Promise(async resolve => {
Promise.all([
getChannelType({}),
getProductType({})
]).then(async([channelType, productType]) => {
state.channelType = channelType.slice(0, 2)
state.productType = productType
await dispatch('save2db', {
name: '',
value: state
})
resolve(state)
})
Promise.all([getChannelType({}), getProductType({})]).then(
async([channelType, productType]) => {
state.channelType = channelType.slice(0, 2)
state.productType = productType
await dispatch('save2db', {
name: '',
value: state
})
resolve(state)
}
)
})
},
// 重置
clear({
state,
dispatch
}) {
clear({ state, dispatch }) {
return new Promise(async resolve => {
state.channelType = []
state.productType = []
......@@ -72,14 +61,13 @@ export default {
* @param {*} param0
* @param {*} name 名称 state 中的任意一个 强烈建议 使用 @/common/constants/BaseData 中的常量 便于灵活修改
*/
get({
state,
dispatch
}, name) {
get({ state, dispatch }, name) {
return new Promise(async resolve => {
let __data = state[name]
if (__data) {
__data = await dispatch('getFromdb', `base.${name}`) || await dispatch('getFromAjax', name)
__data =
(await dispatch('getFromdb', `base.${name}`)) ||
(await dispatch('getFromAjax', name))
state[name] = __data
await dispatch('save2db', {
name,
......@@ -89,13 +77,7 @@ export default {
resolve(__data)
})
},
set({
state,
dispatch
}, {
name,
value
}) {
set({ state, dispatch }, { name, value }) {
return new Promise(async resolve => {
state[name] = value
await dispatch('save2db', {
......@@ -111,13 +93,11 @@ export default {
* 内存 -> 前端持久化数据库 -> 后台接口
* @param {*} param0
*/
load({
state,
dispatch
}) {
load({ state, dispatch }) {
return new Promise(async resolve => {
if (state.channelType.length === 0) {
state = await dispatch('getFromdb', 'base') || await dispatch('init')
state =
(await dispatch('getFromdb', 'base')) || (await dispatch('init'))
}
const { channelType, productType } = state
resolve({ channelType, productType })
......@@ -128,17 +108,19 @@ export default {
* @param {*} param0
* @param {*} path 数据 路径
*/
getFromdb({
dispatch
}, path) {
getFromdb({ dispatch }, path) {
return new Promise(async resolve => {
const value = await dispatch('d2admin/db/get', {
dbName: 'database',
path,
user: false
}, {
root: true
})
const value = await dispatch(
'd2admin/db/get',
{
dbName: 'database',
path,
user: false
},
{
root: true
}
)
resolve(value)
})
},
......@@ -148,21 +130,20 @@ export default {
* @param {*} param0
* @param {*} param1 value 需要持久化的数据 path 需要持久化的数据路径
*/
save2db({
dispatch
}, {
value,
name
}) {
save2db({ dispatch }, { value, name }) {
return new Promise(async resolve => {
await dispatch('d2admin/db/set', {
dbName: 'database',
path: name ? `base.${name}` : 'base',
value,
user: false
}, {
root: true
})
await dispatch(
'd2admin/db/set',
{
dbName: 'database',
path: name ? `base.${name}` : 'base',
value,
user: false
},
{
root: true
}
)
resolve(value)
})
},
......@@ -171,19 +152,13 @@ export default {
* @param {*} param0
* @param {*} name @/common/constants/BaseData 中的常量
*/
getFromAjax({
state,
dispatch,
commit
}, name) {
getFromAjax({ state, dispatch, commit }, name) {
return new Promise(async resolve => {
// const value = await map[name]({ [TYPE_NAME]: Object.values(BaseData).find(data => data.KEY === name).TYPE })
resolve()
})
},
async reset({
dispatch
}) {
async reset({ dispatch }) {
await dispatch('clear')
}
}
......
import util from '@/libs/util.js'
export default {
namespaced: true,
mutations: {
/**
* @description 显示版本信息
* @param {Object} state state
*/
versionShow() {
util.log.capsule(process.env.VUE_APP_TITLE, `v${process.env.VUE_APP_VERSION}`)
console.log('广联赛讯 http://www.glsx.com.cn')
}
}
}
import util from '@/libs/util.js'
export default {
namespaced: true,
mutations: {
/**
* @description 显示版本信息
* @param {Object} state state
*/
versionShow() {
util.log.capsule(
process.env.VUE_APP_TITLE,
`v${process.env.VUE_APP_VERSION}`
)
console.log('广联赛讯 http://www.glsx.com.cn')
}
}
}
......@@ -19,12 +19,9 @@
<el-radio-button label="2">4S店</el-radio-button>
<el-radio-button label="7">服务商</el-radio-button>
<el-radio-button label="6">园区店</el-radio-button>
<!-- <el-radio-button label="2"
@click.native.prevent="clickMerchantType('2')">4S店</el-radio-button>
<el-radio-button label="7"
@click.native.prevent="clickMerchantType('7')">服务商</el-radio-button>
<el-radio-button label="6"
@click.native.prevent="clickMerchantType('6')">园区店</el-radio-button> -->
<!-- <el-radio-button label="2" @click.native.prevent="clickMerchantType('2')">4S店</el-radio-button>
<el-radio-button label="7" @click.native.prevent="clickMerchantType('7')">服务商</el-radio-button>
<el-radio-button label="6" @click.native.prevent="clickMerchantType('6')">园区店</el-radio-button> -->
</el-radio-group>
</el-form-item>
<el-form-item label="选择商户:"
......@@ -43,7 +40,7 @@
multiple-limit="10"
filterable
style="width:400px">
<el-option v-for="(item, index) in baseData.merchantList"
<el-option v-for="item in baseData.merchantList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId"></el-option>
......@@ -86,7 +83,9 @@
</template>
<script>
import { BaseData, rangePickerOptions } from '@/common/constants.js'
import {
// BaseData,
rangePickerOptions} from '@/common/constants.js'
import dayjs from 'dayjs'
import * as api from '@api/finance'
import { getMerchantPageSearch } from '@api/publicAccount'
......
......@@ -423,9 +423,9 @@ import {
orderTypeList
} from '@/common/constants.js'
import downloadAccountDialog from './downloadAccountDialog'
import * as echarts from 'echarts'
export default {
name: 'financeList',
components: {
downloadAccountDialog
},
......@@ -679,10 +679,7 @@ export default {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== '全部'
this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部'
) {
const temp = {}
temp[this.showFormData[index].optionId] = ''
......
<!-- 商品管理 -->
<template>
<d2-container class="commodity">
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
class="show-search"
:searchForm="searchForm"
:formData="showFormData"
>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:searchForm="searchForm"
:formData="showFormData">
<!-- <p>
<el-input
size="small"
......@@ -22,84 +18,60 @@
</p> -->
</d2-search>
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
<el-button :id="tableParams.btnId"
size="small"
type="primary">查询</el-button>
<el-button size="small"
@click="handleReset">重置</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button
category="Button"
style="{display: inline-block}"
showBtnIds="['9030201']"
></auth-button>
<auth-button category="Button"
style="{display: inline-block}"
:showBtnIds="['9030201']"></auth-button>
</span>
<auth-button
category="Button"
style="{display: inline-block}"
showBtnIds="['9030202']"
></auth-button>
<auth-button category="Button"
style="{display: inline-block}"
:showBtnIds="['9030202']"></auth-button>
</d2-table-header>
<d2-table
ref="commodityTable"
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
>
<img
slot="img"
slot-scope="scope"
class="pro-img"
:src="scope.scope.goodsInfo.thumbUrl"
/>
<template
v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope"
>
<el-button
type="text"
size="mini"
style="margin-right: 10px;"
@click="handleCommodityDetail(scope.scope)"
>查看</el-button>
<auth-button
:data="scope.scope"
></auth-button>
<d2-table ref="commodityTable"
:hasNum="false"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn">
<img slot="img"
slot-scope="scope"
class="pro-img"
:src="scope.scope.goodsInfo.thumbUrl" />
<template v-if="Object.keys(scope.scope).includes('upgradeGoodsList')"
slot="auth-button"
slot-scope="scope">
<el-button type="text"
size="mini"
style="margin-right: 10px;"
@click="handleCommodityDetail(scope.scope)">查看</el-button>
<auth-button :data="scope.scope"></auth-button>
</template>
</d2-table>
</div>
<d2-dialog
:title="detailData ? detailData.goodsInfo.goodsName : ''"
:className="storeDetail"
:isVisible.sync="detailVisible"
:showClose="showClose"
noCancel="true"
@closeDialog="handleDetailClose"
@confirmDialog="handleDetailClose"
>
<store-detail
v-if="detailVisible"
:detailData="detailData"
></store-detail>
<d2-dialog v-if="detailVisible"
:title="detailData ? detailData.goodsInfo.goodsName : ''"
:className="storeDetail"
:isVisible.sync="detailVisible"
:showClose="showClose"
noCancel="true"
@closeDialog="handleDetailClose"
@confirmDialog="handleDetailClose">
<store-detail :detailData="detailData"></store-detail>
</d2-dialog>
<!-- 查看面板 -->
<drawer-detail
v-if="drawerDetailVisible"
:drawerDetailVisible="drawerDetailVisible"
:commodityInfoId="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose"
></drawer-detail>
<drawer-detail v-if="drawerDetailVisible"
:drawerDetailVisible="drawerDetailVisible"
:commodityInfoId="commodityDetailInfoId"
@handleDrawerClose="handleDrawerClose"></drawer-detail>
</d2-container>
</template>
......
<!-- 发券宝 -->
<template>
<d2-container class="coupons">
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
class="show-search"
:searchForm="parentSearchForm"
:formData="showFormData"
>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:searchForm="parentSearchForm"
:formData="showFormData">
</d2-search>
<div class="up-btns">
<el-button
size="small"
type="primary"
@click="handleSearch"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
<el-button size="small"
type="primary"
@click="handleSearch">查询</el-button>
<el-button size="small"
@click="handleReset">重置</el-button>
</div>
</div>
<div
class="d2-container-content"
style="position: positive;"
>
<div class="d2-container-content"
style="position: positive;">
<span style="position: absolute; right: 41px; top: 42px; z-index: 999;">
<auth-button
:showBtnIds="activeName === 'storeList' ? ['9030601', '9030605'] : ['9030605']"
category="Button"
></auth-button>
<auth-button :showBtnIds="activeName === 'storeList' ? ['9030601', '9030605'] : ['9030605']"
category="Button"></auth-button>
</span>
<el-tabs
v-model="activeName"
type="card"
@tab-click="handleSearch"
>
<el-tab-pane
label="店面列表"
name="storeList"
>
<store-list
ref="storeList"
:parentSearchForm="parentSearchForm"
></store-list>
<el-tabs v-model="activeName"
type="card"
@tab-click="handleSearch">
<el-tab-pane label="店面列表"
name="storeList">
<store-list ref="storeList"
:parentSearchForm="parentSearchForm"></store-list>
</el-tab-pane>
<el-tab-pane
label="领用明细"
name="couponsDetail"
>
<coupons-detail
ref="couponsDetail"
:parentSearchForm="parentSearchForm"
></coupons-detail>
<el-tab-pane label="领用明细"
name="couponsDetail">
<coupons-detail ref="couponsDetail"
:parentSearchForm="parentSearchForm"></coupons-detail>
</el-tab-pane>
</el-tabs>
</div>
<edit-coupons-dialog
:couponsVisible="couponsVisible"
@couponClose="couponClose"
></edit-coupons-dialog>
<edit-coupons-dialog :couponsVisible="couponsVisible"
@couponClose="couponClose"></edit-coupons-dialog>
</d2-container>
</template>
......
<!-- 产品管理 -->
<template>
<d2-container class="product">
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
class="show-search"
:searchForm="searchForm"
:formData="showFormData"
>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:searchForm="searchForm"
:formData="showFormData">
<!-- <p>
<el-input
size="small"
......@@ -22,50 +18,36 @@
</p> -->
</d2-search>
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>查询</el-button>
<el-button
size="small"
@click="handleReset"
>重置</el-button>
<el-button :id="tableParams.btnId"
size="small"
type="primary">查询</el-button>
<el-button size="small"
@click="handleReset">重置</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button
category="Button"
style="{display: inline-block}"
showBtnIds="['9030101']"
></auth-button>
<auth-button category="Button"
style="{display: inline-block}"
showBtnIds="['9030101']"></auth-button>
</span>
<auth-button
category="Button"
style="{display: inline-block}"
showBtnIds="['9030103']"
></auth-button>
<auth-button category="Button"
style="{display: inline-block}"
showBtnIds="['9030103']"></auth-button>
</d2-table-header>
<d2-table
ref="productTable"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
>
<img
slot="img"
slot-scope="scope"
class="pro-img"
:src="scope.scope.thumbUrl"
/>
<auth-button
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
></auth-button>
<d2-table ref="productTable"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn">
<img slot="img"
slot-scope="scope"
class="pro-img"
:src="scope.scope.thumbUrl" />
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope"></auth-button>
</d2-table>
</div>
</d2-container>
......
const incomeProductOption = {
color: ['rgba(9,71,198,0.8)', 'rgba(255,178,25,1)', 'rgba(255,178,25,0.8)', 'rgba(0,157,255,1)', 'rgba(0,157,255,0.8)', 'rgba(0,157,255,0.6)', 'rgba(0,228,115,1)', 'rgba(0,228,115,0.8)'],
color: [
'rgba(9,71,198,0.8)',
'rgba(255,178,25,1)',
'rgba(255,178,25,0.8)',
'rgba(0,157,255,1)',
'rgba(0,157,255,0.8)',
'rgba(0,157,255,0.6)',
'rgba(0,228,115,1)',
'rgba(0,228,115,0.8)'
],
title: {
text: '累计收入\n555555元',
top: '50%',
......@@ -14,8 +23,10 @@ const incomeProductOption = {
},
tooltip: {
trigger: 'item',
formatter: (params) => {
return `${insertTooltipBr(params.name)} : ${params.value}(${params.percent}%)`
formatter: params => {
return `${insertTooltipBr(params.name)} : ${params.value}(${
params.percent
}%)`
},
position: [10, 10]
},
......@@ -57,24 +68,33 @@ const incomeProductOption = {
}
]
}
function insertBr(text) {
if (text.length <= 8) {
return text
} else if (text.length > 8 && text.length <= 16) {
return text = `${text.slice(0, 8)}\n${text.slice(8)}\n`
} else if (text.length > 16 && text.length <= 24) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16)}\n`
} else if (text.length > 24 && text.length <= 30) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16, 24)}\n${text.slice(24)}\n`
} else if (text.length > 30) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16, 24)}\n${text.slice(24, 30)}\n${text.slice(30)}\n`
}
}
// function insertBr(text) {
// if (text.length <= 8) {
// return text
// } else if (text.length > 8 && text.length <= 16) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8)}\n`)
// } else if (text.length > 16 && text.length <= 24) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16
// )}\n`)
// } else if (text.length > 24 && text.length <= 30) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16,
// 24
// )}\n${text.slice(24)}\n`)
// } else if (text.length > 30) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16,
// 24
// )}\n${text.slice(24, 30)}\n${text.slice(30)}\n`)
// }
// }
function insertTooltipBr(text) {
if (text.length <= 30) {
return text
} else if (text.length > 30) {
return text = `${text.slice(0, 30)}</br>${text.slice(30)}`
text = `${text.slice(0, 30)}</br>${text.slice(30)}`
return text
}
}
export default incomeProductOption
const storeFlowOption = {
color: ['rgba(9,71,198,1)', 'rgba(9,71,198,0.8)', 'rgba(9,71,198,0.6)', 'rgba(9,71,198,0.4)', 'rgba(9,71,198,0.3)'],
color: [
'rgba(9,71,198,1)',
'rgba(9,71,198,0.8)',
'rgba(9,71,198,0.6)',
'rgba(9,71,198,0.4)',
'rgba(9,71,198,0.3)'
],
tooltip: {
trigger: 'item',
// formatter: '{a} <br/>{b} : {c} ({d}%)',
formatter: (params) => {
return `${insertTooltipBr(params.name)} : ${params.value}(${params.percent}%)`
formatter: params => {
return `${insertTooltipBr(params.name)} : ${params.value}(${
params.percent
}%)`
},
position: [10, 10]
},
......@@ -51,12 +58,10 @@ const storeFlowOption = {
{
value: 335,
name: '直接访问'
},
{
value: 335,
name: '直接访问'
},
{
value: 335,
......@@ -77,25 +82,34 @@ const storeFlowOption = {
]
}
function insertBr(text) {
if (text.length <= 8) {
return text
} else if (text.length > 8 && text.length <= 16) {
return text = `${text.slice(0, 8)}\n${text.slice(8)}\n`
} else if (text.length > 16 && text.length <= 24) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16)}\n`
} else if (text.length > 24 && text.length <= 30) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16, 24)}\n${text.slice(24)}\n`
} else if (text.length > 30) {
return text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(16, 24)}\n${text.slice(24, 30)}\n${text.slice(30)}\n`
}
}
// function insertBr(text) {
// if (text.length <= 8) {
// return text
// } else if (text.length > 8 && text.length <= 16) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8)}\n`)
// } else if (text.length > 16 && text.length <= 24) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16
// )}\n`)
// } else if (text.length > 24 && text.length <= 30) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16,
// 24
// )}\n${text.slice(24)}\n`)
// } else if (text.length > 30) {
// return (text = `${text.slice(0, 8)}\n${text.slice(8, 16)}\n${text.slice(
// 16,
// 24
// )}\n${text.slice(24, 30)}\n${text.slice(30)}\n`)
// }
// }
function insertTooltipBr(text) {
if (text.length <= 30) {
return text
} else if (text.length > 30) {
return text = `${text.slice(0, 30)}</br>${text.slice(30)}`
text = `${text.slice(0, 30)}</br>${text.slice(30)}`
return text
}
}
......
<!-- 虚拟对账账户 -->
<template>
<d2-container class="account-list">
<div class="header"
slot="header">
<d2-search ref="showSearch"
:searchForm="searchForm"
:formData="showFormData">
<!-- :slot-scope="item" -->
<template slot="channelType">
<el-cascader style="width: 50%;"
:options="merchantLevelOptions[nameToOption[searchForm.channelType]]"
:props="{ checkStrictly: true, value: 'id', label: 'merchantName' }"
:show-all-levels="false"
v-model="merchantLevelVal"
clearable
filterable></el-cascader>
</template>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">查询</el-button>
<el-button size="small"
@click="handleReset">重置</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table ref="merchantTable"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope"></auth-button>
</d2-table>
</div>
<!-- width="70%"
title="申请虚拟对公账户详情"
btnOkLabel="确定"
v-if="accountDetailVisible"
@confirmDialog="handleDetailClose"
noCancel="true" -->
<!-- v-if="accountDetailVisible" -->
<baseDialog :isShow.sync="accountDetailVisible"
:config="dialogConfig.setting"
:dialogConfig="dialogConfig.config"
@closeDialog="handleDetailClose">
<!-- <span>test</span> -->
<account-detail v-if="accountDetailVisible"
:accountDetailVisible="accountDetailVisible"
:merchantRow="merchantRow"></account-detail>
</baseDialog>
<!-- <d2-dialog
title="申请虚拟对公账户详情"
:isVisible.sync="accountDetailVisible"
width="70%"
btnOkLabel="确定"
noCancel="true"
@confirmDialog="handleDetailClose"
@closeDialog="handleDetailClose"
>
<account-detail
:accountDetailVisible="accountDetailVisible"
:merchantRow="merchantRow"
></account-detail>
</d2-dialog> -->
</d2-container>
</template>
<script>
import _ from 'lodash'
import { Util } from '@/common/util'
import { getListApi, getMerchantLevelApi } from '@api/publicAccount'
import { mapActions } from 'vuex'
import accountDetail from './accountDetail'
import { BaseData, merchantStoreServiceList } from '@/common/constants.js'
import baseDialog from '@/components/baseDialog/baseDialog'
export default {
name: 'accountList',
data() {
return {
// 账户详情
accountDetailVisible: false,
merchantRow: {},
nameToOption: {
1: 'dj',
2: 'gh'
},
merchantLevelOptions: {
dj: [],
gh: []
},
// 搜索
merchantLevelVal: [],
searchForm: {
merchantType: '',
channelType: '',
merchantName: '',
accountStatus: '',
merchantId: ''
},
searchFormSearch: {},
showFormData: [{
label: '商户分类',
name: 'merchantType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'merchantStoreServiceList'
}, {
label: '渠道',
name: 'channelType',
addHtml: 'channelType',
type: 'select',
width: '50%',
optionList: [],
optionId: 'value',
optionLabel: 'name',
optionsName: 'channelTypeList',
changeAttr: (value, targetItem) => {
this.merchantLevelVal = []
}
}, {
label: '商户名称',
name: 'merchantName',
type: 'input',
isClear: true,
placeholder: '请输入4S店/服务商名称',
keyFn: this.keyDowmGetList
}, {
label: '账户状态',
name: 'accountStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'statusList'
}, {
label: '商户号',
name: 'merchantId',
type: 'input',
inputType: 'number',
maxlength: '9',
isClear: true,
placeholder: '请输入4S店/服务商商务号',
keyFn: this.keyDowmGetList
}],
// 表格
getListApi: getListApi,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '名称',
prop: 'merchantName'
}, {
label: '编号',
prop: 'merchantId'
}, {
label: '商户分类',
prop: 'merchantType',
formatter: (cellValue) => {
// var item = this.baseData.merchantStoreServiceList.find(item => item.confId === cellValue.merchantType)
return cellValue.merchantType === 7 ? '服务商' : '4S店'
}
}, {
label: '渠道',
prop: '',
formatter: cellValue => {
return cellValue.channelType === 1 ? '嘀加' : '广汇'
}
}, {
label: '账户状态',
prop: 'accountStatus',
formatter: (cellValue) => {
return this.baseData.statusList.find(item => item.confId === cellValue.accountStatus).confLabel
}
}, {
label: '最近更新时间',
prop: 'updatedDate',
formatter: (cellValue) => {
return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss')
}
}]
},
baseData: {
channelTypeList: [],
statusList: [{
confId: 1,
confLabel: '未申请'
}, {
confId: 2,
confLabel: '审核中'
}, {
confId: 3,
confLabel: '生效'
}, {
confId: 4,
confLabel: '失败'
}],
merchantStoreServiceList: merchantStoreServiceList
},
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '720px',
btnList: [
// { name: '取消', type: 'cancel' },
// { name: '前往', type: 'confirm' }
]
},
config: {
title: '查看详情',
width: '720px'
}
}
}
},
components: {
accountDetail,
baseDialog
},
mounted() {
this.getBaseData()
// 1-嘀加;2-广汇
this.getMerchantLevel(1)
this.getMerchantLevel(2)
// console.log(this.merchantLevelOptions)
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
getMerchantLevel(channelType) {
// channelType:1-嘀加;2-广汇
getMerchantLevelApi({ channelType: channelType }).then(res => {
// this.merchantLevelOptions[this.nameToOption[channelType]] = JSON.parse(res)
this.merchantLevelOptions[this.nameToOption[channelType]] = res
})
},
// 账户状态不同,会有不同的操作
// 1/4 - 待申请/失败(编辑);2 - 审核中(置灰); 3 - 生效中(详情)
handleApply(cellValue) {
// 查看详情
if (cellValue.accountStatus === 3) {
this.merchantRow = cellValue
this.handleDetailClose()
return true
}
// 编辑
this.close({ tagName: '/applyAccount_new' })
this.$router.push({
name: 'applyAccount_new',
params: cellValue
})
},
handleReset() {
this.searchForm = {
merchantType: '',
channelType: '',
merchantName: '',
accountStatus: '',
merchantId: ''
}
this.merchantLevelVal = []
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = _.cloneDeep(this.searchForm)
this.searchFormSearch.merchantTypeList = this.searchForm.merchantType ? [this.searchForm.merchantType] : [2, 7]
this.searchFormSearch.merchantId = this.searchForm.merchantId ? this.searchForm.merchantId : this.merchantLevelVal[this.merchantLevelVal.length - 1]
delete this.searchFormSearch.merchantType
resolve()
})
},
keyDowmGetList() {
this.$refs.merchantTable.refreshTable()
},
handleDetailClose() {
// console.log('visible')
this.accountDetailVisible = !this.accountDetailVisible
}
}
}
</script>
<style>
.el-cascader-panel .el-cascader-menu {
width: 260px;
}
</style>
<!-- 编辑表单组件 -->
<template>
<d2-container>
<el-form ref="editForm"
class="editForm d2-container-content"
:model="editForm"
:rules="formRules"
:label-width="labelWidth"
v-loading="$store.state.d2admin.loading.value">
<!-- <p name="title"
class="edit-title">{{title}}</p> -->
<slot name="failMessage"></slot>
<div v-for="(item, index) in formList"
:key="index"
:style="{...item.style}">
<p v-if="item.isTitle"
class="edit-title"
style="margin-bottom:22px">{{item.titleName}}</p>
<el-form-item v-if="(item.showAttrList ? item.showAttrList.includes(currentPage) : true) && (item.showForsettlement ? item.showForsettlement.includes(settlementPage) : true) && (item.showForContractType ? item.showForContractType.includes(contractTypePage) : true)"
:prop="item.name"
:label="typeof item.label === 'object' ? (item.label[currentPage] || item.label[settlementPage] || item.label[contractTypePage] + ':') : (item.label ? item.label + ':' : '')"
:id="item.name"
:label-width="item.label ? labelWidth : '0px'"
:rules="item.showAttrList ? (item.showAttrList.includes(currentPage) ? item.rules : []) : item.rules"
class="dis-in-block is-required"
:style="{'margin-bottom': !item.type ? '0px' : '22px'}">
<el-input v-if="item.type === 'input'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
:placeholder="typeof item.placeholder === 'object' ? (item.placeholder[currentPage] || item.placeholder[settlementPage]): (item.placeholder || ('请输入' + item.label))"
:maxlength="item.maxlength || 80"
:style="{'width': item.width || formDefaultWidth}"
:disabled="item.isDisabled"
clearable
@blur="blur($event,item)"
@input="input($event,item)">
<i slot="suffix"
class="suffix">{{item.unit}}</i>
</el-input>
<!-- 选择框 -->
<el-select v-else-if="item.type === 'select'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
:clearable="item.isClear"
:placeholder="typeof item.placeholder === 'object' ? (item.placeholder[currentPage] || item.placeholder[settlementPage]): (item.placeholder || '请选择' + item.label)"
@change="item.hanleSelectChange($event, item)"
filterable
:style="{'width': item.width || formDefaultWidth}"
:disabled="item.isDisabled">
<el-option v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]">
</el-option>
</el-select>
<!-- 选择框 - 远程搜索 -->
<el-select v-else-if="item.type === 'filterSelect'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
filterable
remote
:allow-create="item.noAllowCreate || false"
:placeholder="typeof item.placeholder === 'object' ? (item.placeholder[currentPage] || item.placeholder[settlementPage]): (item.placeholder || '请选择' + item.label)"
:remote-method="(query) => item.remoteMethod(query, item)"
@change="item.hanleSelectChange($event, item)"
:style="{'width': item.width || formDefaultWidth}"
clearable>
<el-option v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]">
</el-option>
</el-select>
<!-- 单选框 -->
<el-radio-group v-else-if="item.type === 'radio'"
:id="item.name"
:size="item.size || 'mini'"
v-model="editForm[item.name]"
@change="change($event,item)">
<el-radio v-for="(subItem, subIdx) in item.radioOptList"
:key="subIdx"
:label="subItem.value">
{{subItem.label}}
<el-tooltip content="线下签约确定提交后,请联系银盛工作人员人工审核"
v-if="item.name == 'contractType' && subIdx == 0"
placement="top">
<i class="el-icon-question"
@click.native.prevent="stop"
style="color: #606266;"></i>
</el-tooltip>
</el-radio>
</el-radio-group>
<!-- 时间 -->
<el-date-picker v-else-if="item.type === 'datePicker'"
:id="item.name"
v-model="editForm[item.name]"
:size="item.size || 'mini'"
:type="item.datePickerType || 'date'"
:clearable="item.isClear || false"
:placeholder="'请选择' + (item.placeholder || item.label)"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="change($event,item)">
</el-date-picker>
<slot v-else
:name="item.slotName"
:scope="item"></slot>
<span v-show="item.itemSuffix"
:style="{...item.itemSuffixStyle}">{{item.itemSuffix}}</span>
</el-form-item>
</div>
<el-form-item style="margin-top: 20px;">
<el-button type="primary"
@click="handleConfirm">确定</el-button>
<el-button @click="handleDraft">存草稿</el-button>
<el-button @click="handleCancel">取消</el-button>
</el-form-item>
</el-form>
</d2-container>
</template>
<script>
export default {
name: 'editForm',
data() {
return {
labelWidth: '170px',
formDefaultWidth: '350px'
}
},
props: {
title: {
type: String,
default: '编辑'
},
// 标记字段,用于显示/隐藏某些表单项
currentPage: {
type: String,
default: ''
},
// 标记字段,用于显示/隐藏结算方式对应的项
settlementPage: {
type: [String, Number],
default: ''
},
// 标记字段,用于显示/隐藏签约方式对应的项
contractTypePage: {
type: [String, Number],
default: ''
},
// 表单规则
formRules: {
type: Object,
default: () => { }
},
// 绑定的表单值
editForm: {
type: Object,
default: () => { }
},
// 表单列表
formList: {
type: Array,
default: () => []
}
},
mounted() { },
methods: {
stop() {
console.log('stop')
},
// selectAddAttr(value, targetItem) { }
// 处理属性没有对应事件的情况
input(event, item) {
// console.log(event)
// input($event,item)
// console.log(item)
item.handleInput && item.handleInput(event, item)
},
blur(event, item) {
item.handleBlur && item.handleBlur(event, item)
},
change(event, item) {
item.handleChange && item.handleChange(event, item)
},
jumpScroll(idName) {
document.getElementById(idName).scrollIntoView(event)
// document.getElementById(idName).scrollIntoView(event, item)
},
// 确认
handleConfirm() {
this.$refs.editForm.validate((valid, opt) => {
var hasError = Object.keys(opt)
if (!valid) {
this.jumpScroll(hasError[0])
return false
}
this.$emit('handleConfirm')
})
},
// 存草稿
handleDraft() {
this.$emit('handleDraft')
},
// 取消
handleCancel() {
this.$emit('handleCancel')
}
}
}
</script>
<style scoped>
.d2-container-content {
margin-top: 0 !important;
}
</style>
<!-- 图片上传 -->
<template>
<div class="gl-upload-img"
v-if="show">
<el-upload action=""
list-type="picture-card"
accept=".jpg,.png"
:auto-upload="false"
:show-file-list="false"
:disabled="!!picObj[formObj[attrName]].url"
:on-change="e => handleChange(e, formObj[attrName], formObj)"
:on-preview="e => handlePreview(e, formObj[attrName])"
:on-remove="e => handleRemove(e, formObj[attrName])">
<span class="img-btn">
<img v-if="picObj[formObj[attrName]].url"
:src='picObj[formObj[attrName]].url'
class="rectImg">
<span class="img-btns">
<span class="btn-item">
<i @click.stop='handleRemove(formObj[attrName], formObj)'
class="el-icon-delete"></i>
<i @click.stop="handleImgLook"
class="el-icon-zoom-in"></i>
</span>
</span>
</span>
<i v-if="!picObj[formObj[attrName]].url && formObj.useDefaultImg"
class="el-icon-plus avatar-uploader-icon"
style="color: #8c939d;"></i>
<img v-if="!picObj[formObj[attrName]].url && !formObj.useDefaultImg"
:src='examplePicUrl'
class="rectImg">
</el-upload>
<span v-if="txtDescript">{{txtDescript}}</span>
<p v-show="!picObj[formObj[attrName]].url"
slot="errorTips"
class="car-error-txt">请上传{{txtDescript}}</p>
<el-dialog :visible.sync="lookImgVisible">
<img width="100%"
:src="picObj[formObj[attrName]].url"
alt="图片">
</el-dialog>
</div>
</template>
<script>
export default {
name: 'glUploadImg',
data() {
return {
examplePicUrl: '',
lookImgVisible: false
}
},
props: {
// 表单对象
formObj: {
type: Object,
default: () => { }
},
// 标记拿绑定哪个属性
attrName: {
type: String,
default: 'slotName'
},
// 图片绑定的属性
picObj: {
type: Object,
default: () => { }
},
// 文字说明
txtDescript: {
type: String,
default: ''
},
// 显示/隐藏
show: {
type: Boolean,
default: true
}
},
mounted() {
this.examplePicUrl = './account/' + this.formObj[this.attrName] + '.png'
// console.log(this.picObj[this.formObj[this.attrName]])
// console.log(this.formObj[this.attrName])
},
methods: {
handleImgLook() {
this.lookImgVisible = !this.lookImgVisible
},
handleChange(file, attrName, targetItem) {
if (!(file.size / 1024 / 1024 < 1)) {
this.$message.error('请上传小于1M的图片')
return false
}
this.$emit('handleImgChange', { file: file, attrName: attrName, targetItem: targetItem })
},
handlePreview() { },
handleRemove(attrName, targetItem) {
this.$emit('handleImgRemove', { attrName: attrName, targetItem: targetItem })
}
}
}
</script>
<style>
.gl-upload-img .disabled .el-upload--picture-card {
display: none;
}
.gl-upload-img .el-upload--picture-card {
width: 140px;
height: 92px;
line-height: 98px;
}
.gl-upload-img .rectImg {
width: 137px;
height: 90px;
}
.gl-upload-img .img-btn {
display: inline-block;
position: relative;
}
.img-btn .img-btns {
display: none;
position: absolute;
width: 140px;
height: 92px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
background: rgba(0, 0, 0, 0.5);
}
.img-btn .img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.img-btn .img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.img-btn:hover .img-btns {
display: block;
}
.gl-upload-img .el-upload--picture-card i {
color: #fff;
}
.gl-upload-img .car-error-txt {
font-size: 12px;
line-height: 6px;
margin: 0 0;
}
</style>
......@@ -9,9 +9,11 @@ const resolve = dir => require('path').join(__dirname, dir)
process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
const isDev = process.env.NODE_ENV !== 'development'
// 基础路径 注意发布之前要先修改这里
// const publicPath = '/dj-carlife-web/'
const publicPath = ''
const publicPath = '/dj-carlife-web/'
// const publicPath = ''
// const CDN_DOMAIN = 'https://cdn.bootcss.com'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/dj-carlife-web'
const cdn = {
......@@ -41,20 +43,22 @@ module.exports = {
lintOnSave: false,
devServer: {
// publicPath, // 和 publicPath 保持一致
proxy: {
'/rop-dj-smartcarlife': {
target: 'http://dj.test.glsx.com.cn',
changeOrigin: true,
ws: true,
pathRewrite: {
'^/rop-dj-smartcarlife': '/rop-dj-smartcarlife/router'
},
onProxyReq: function(proxyReq, req, res) {
console.log(`原路径:${req.originalUrl}`)
console.log(`代理路径:${req.url}`)
}
}
}
https: false
// proxy: {
// 'rop-dj-smartcarlife': {
// target: 'http://dj.glsx.com.cn/rop-dj-smartcarlife/router',
// // target: 'http://baidu.com',
// changeOrigin: true,
// ws: true,
// // pathRewrite: {
// // '^/rop-dj-smartcarlife': '/rop-dj-smartcarlife/router'
// // },
// onProxyReq: function(proxyReq, req, res) {
// console.log(`原路径:${req.originalUrl}`)
// console.log(`代理路径:${req.url}`)
// }
// }
// }
},
css: {
loaderOptions: {
......@@ -66,24 +70,27 @@ module.exports = {
},
configureWebpack: config => {
config.externals = {
vue: 'Vue',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
'js-cookie': 'Cookies',
nprogress: 'NProgress',
echarts: 'echarts',
lodash: '_',
'ua-parser-js': 'UAParser',
qs: 'Qs'
// 'element-ui': 'ELEMENT',
// 'vue-i18n':'vue-i18n',
// 'better-scroll': 'BScroll',
// 'core-js': 'core-js'
if (isDev) {
config.externals = {
vue: 'Vue',
// 'element-ui': 'ELEMENT',
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
'js-cookie': 'Cookies',
nprogress: 'NProgress',
echarts: 'echarts',
lodash: '_',
// 'vue-i18n':'vue-i18n',
'ua-parser-js': 'UAParser',
// 'better-scroll': 'BScroll',
qs: 'Qs'
// 'core-js': 'core-js'
}
}
// 非开发环境
if (process.env.NODE_ENV !== 'development') {
if (isDev) {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
config.optimization.minimizer[0].options.terserOptions.compress.drop_console = true
config.optimization.minimizer[0].options.terserOptions.compress.drop_debugger = true
......@@ -168,11 +175,15 @@ module.exports = {
config.resolve.alias
.set('@', resolve('src'))
.set('@api', resolve('src/api'))
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
if (isDev) {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
}
// if (process.env.NODE_ENV === 'development') {
// config
// .plugin('webpack-bundle-analyzer')
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!