Commit 2da4b7b9 by 前端

Merge branch 'dev_v4.9.0' into 'develop'

Dev v4.9.0

See merge request !30
2 parents 3de2f569 5e4bf7f3
[defaults]
url = 'http://sentry.glsx.com.cn'
org = sentry
project = dj-car-life-system
[auth]
token = 2d992c92b53b40b9869313a353c037d1208ee8bfcc1d418eaec1777f846401b6
auth.token=45d2be625091494b9a0de35af25bb273c0a471650575471096d60dd61f6995e6
defaults.url = http://sentry.glsx.com.cn
defaults.org = sentry
defaults.project =dj-carlife-web
......@@ -65,7 +65,6 @@
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"hard-source-webpack-plugin": "^0.13.1",
"html-webpack-plugin": "4",
"sass": "^1.18.0",
"sass-loader": "^7.1.0",
"script-loader": "^0.7.2",
......
......@@ -67,3 +67,9 @@ export function getAreaInfoByOpenAccBankTypeApi(data) {
data.method = `${djPath}yseMerchantOffline.getAreaInfoByOpenAccBankType`
return request(data, 'post')
}
// 分账规则历史记录
export function getHistoryRecord(data) {
data.method = `${djPath}smartcarlife.divisionRuleEffectRecord.getHistoryRecord`
return request(data, 'post')
}
......@@ -9,17 +9,22 @@ import axios from '@/plugin/axios'
import sign from './sign'
import RequestMethods from './request.methods'
import util from '@/libs/util.js'
import { baseConfig } from '@/main'
const request = (
params = {},
method = RequestMethods.GET,
noSignAttr = [],
options
) => {
// console.log(baseConfig)
// params.source = 'glsx'
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params.appKey = window.location.href.includes('dj.glsx.com.cn')
? 'd7ffc3346fc9a45bccaaa35300d59022'
: '48e5e13229b82c1b4e6e8c96151f0637'
params.appKey = baseConfig?.axios?.appkey
// clg
// console.log(params.appKey)
// params.appKey = window.location.href.includes('dj.glsx.com.cn')
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// : '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime()
params.v = '1.0.0'
params.format = 'json'
......
......@@ -6,13 +6,21 @@
*/
import sha1 from 'sha1'
import qs from 'qs'
const secret = window.location.href.includes('dj.glsx.com.cn')
? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
// const secret = !window.location.href.includes('dj.glsx.com.cn')
// ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
// : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
import { baseConfig } from '@/main'
// // 等后面再处理
// console.log(baseConfig)
// // const secret =
// // window.location.href.includes('dj.glsx.com.cn') ||
// // window.location.href.includes('dj.beta.glsx.com.cn')
// // ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
// // : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = []) => {
// console.log(baseConfig)
// 写里面取值解决一开始导入就被确定值导致后面无法改动
const secret = baseConfig?.axios?.secret
// console.log(secret)
delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), {
arrayFormat: 'indices',
......
/* eslint-disable */
require('script-loader!file-saver')
require('./Blob')
require('script-loader!xlsx/dist/xlsx.core.min')
// import * as XLSX from 'xlsx' // 数据导出导入所需要的依赖
// require('script-loader!xlsx/dist/xlsx.core.min')
import * as XLSX from 'xlsx' // 数据导出导入所需要的依赖
function generateArray(table) {
var out = []
var rows = table.querySelectorAll('tr')
......
......@@ -9,8 +9,18 @@
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>-->
<div v-popover:popover-personal
class="d2-mr personal-wrap">
<div class="d2-mr personal-wrap">
<!-- <el-popover ref="popover1"
placement="top-start"
width="400"
trigger="hover">
<div v-for="(item,index) in dowloadList"
:key="index">{{item.labelText}}</div>
<span slot="reference">
<i class="el-icon-bell tipsIcon"></i>
</span>
</el-popover> -->
<span v-if="show"
class="btn-text">{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span>
<span class="btn-text out-txt"
......@@ -31,7 +41,7 @@
</template>
<script>
import { mapActions } from 'vuex'
import { mapActions, mapState, mapMutations } from 'vuex'
// import PersonalPanel from '../personal-panel'
export default {
data() {
......@@ -47,6 +57,14 @@ export default {
}
}
},
computed: {
tempCountPlusTempCount2() {
return 2
},
...mapState({
'dowloadList': (state) => state.d2admin.user
})
},
components: {
// PersonalPanel
},
......@@ -54,10 +72,22 @@ export default {
this.show = false
this.$event.$on('e-password-dialog', res => (this.passVisible = res))
this.getInfo()
const list = [
{
name: 'xxx店订单补录2022-02-04test',
ifSuccess: false,
id: 1,
status: 'loading',
type: 'upload',
labelText: '导入成功10条, 导入失败1条'
}
]
this.setDownloadList(list)
},
methods: {
...mapActions('d2admin/user', ['load', 'loadAcocunt']),
...mapActions('d2admin/account', ['logout']),
...mapMutations('d2admin/user', ['setDownloadList']),
handleChangeAccount() {
this.accountPanelVisible = !this.accountPanelVisible
},
......@@ -126,6 +156,9 @@ export default {
.personal-wrap .arrow-icon.drOpen {
transform: rotate(-180deg);
}
.tipsIcon {
font-size: 12px;
}
.el-popover {
padding: 12px 0 !important;
// max-width: 10em;
......
// Vue
import Vue from 'vue'
import axios from 'axios'
// import axios from 'axios'
// import i18n from './i18n'
import App from './App'
// 核心插件
......@@ -20,22 +20,18 @@ import router from './router'
import 'default-passive-events'
import notice from '@/common/notice'
import 'element-ui/lib/theme-chalk/index.css'
import ElementUI from 'element-ui'
// d2Admin 已导入
// import ElementUI from 'element-ui'
// Vue.use(ElementUI)
// import menuHeader from '@/menu/header'
// import menuAside from '@/menu/aside'
// import { frameInRoutes } from '@/router/routes'
// import Vue2OrgTree from 'vue2-org-tree'
Vue.use(chaining)
Vue.use(ElementUI)
// import VRM from 'vue-role-manager'
// Vue.use(VRM, {
// router,
// redirect: '403',
// enabled: false
// })
// 核心插件
Vue.use(d2Admin)
Vue.use(chaining)
Vue.prototype.notice = notice
const isProd = process.env.NODE_ENV === 'production'
......@@ -48,7 +44,7 @@ if (!isProd) {
process.env.NODE_ENV === 'production' &&
Sentry.init({
Vue,
dsn: 'http://c130dfd99792456ca835ca54680a8bbf@sentry.glsx.com.cn/14',
dsn: 'https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24',
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [
new BrowserTracing({
......@@ -64,25 +60,31 @@ process.env.NODE_ENV === 'production' &&
})
// console.log(test)
// Vue.use(D2Crud)
var baseConfig = ''
axios({
// baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config-test',
baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config',
// baseURL:
// 'http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config',
// 'http://config-center-front.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config',
method: 'get'
}).then(res => {
const { data, status, code } = res
// const { status, code } = res.data
// console.log(res)
if (code == '200' || status == '200') {
baseConfig = data
var baseConfig = {
axios: {
appkey: 'd7ffc3346fc9a45bccaaa35300d59022',
secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
}
}
// 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
fetch(
'http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config'
)
.then(
response => {
// 处理http响应
return response.json()
},
error => {
// 处理错误
console.log(error)
}
console.log(baseConfig)
// baseConfig = data.data
// 先本地切换到测试环境接口
// data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
)
.then(response => {
// console.log(response)
const { code, data } = response
code == '200' && (baseConfig = data)
// console.log('data', data)
new Vue({
router,
store,
......@@ -117,6 +119,64 @@ axios({
},
mounted() {}
}).$mount('#app')
})
})
// axios({
// // baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config-test',
// // baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config',
// baseURL:
// 'http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config',
// method: 'get'
// // }).then(({ data }) => {
// }).then(({ data }) => {
// // console.log(data)
// // let {data} = res
// console.log(data)
// baseConfig = data
// // 新配置中心写法
// const { data: config, code } = data
// code == '200' && (baseConfig = config)
// // console.log(data)
// // // debugger
// console.log(baseConfig)
// // baseConfig = data.data
// // 先本地切换到测试环境接口
// // data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// new Vue({
// router,
// store,
// // i18n,
// render: h => {
// // data.axios.baseURL =
// // 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// Vue.prototype.baseConfig = data
// return h(App)
// },
// // created () {
// // 处理路由 得到每一级的路由设置
// // this.$store.commit('d2admin/page/init', frameInRoutes)
// // 设置顶栏菜单 (暂时不需要)
// // this.$store.commit('d2admin/menu/headerSet', menuHeader)
// // 设置侧边栏菜单 (TODO 进行过滤)
// // this.$store.commit('d2admin/menu/asideSet', menuAside)
// // 初始化菜单搜索功能
// // this.$store.commit('d2admin/search/init', menuHeader)
// // },
// created() {
// // 系统配置
// Vue.config.devtools = true
// // 展示系统信息
// this.$store.commit('d2admin/releases/versionShow')
// // 用户登录后从数据库加载一系列的设置
// this.$store.dispatch('d2admin/account/load')
// // 获取并记录用户 UA
// this.$store.commit('d2admin/ua/get')
// // 初始化全屏监听
// this.$store.dispatch('d2admin/fullscreen/listen')
// },
// mounted() {}
// }).$mount('#app')
// })
export { baseConfig }
......@@ -715,12 +715,12 @@ export const resources = {
}
]
},
// {
// authId: '9060304',
// parentId: '90603',
// label: '分账',
// handle: 'handleAccount'
// },
{
authId: '9060304',
parentId: '90603',
label: '历史记录',
handle: 'handleRecord'
},
{
authId: '9060305',
parentId: '90603',
......
......@@ -30,7 +30,7 @@ export default {
init({ state, dispatch, commit }) {
return new Promise(async resolve => {
Promise.all([getChannelType({}), getProductType({})]).then(
async([channelType, productType]) => {
async ([channelType, productType]) => {
state.channelType = channelType.slice(0, 2)
state.productType = productType
await dispatch('save2db', {
......@@ -40,6 +40,7 @@ export default {
resolve(state)
}
)
resolve()
})
},
// 重置
......
const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info`
const ACCOUNT_SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-account`
const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${
process.env.VUE_APP_VERSION
}-info`
const ACCOUNT_SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${
process.env.VUE_APP_VERSION
}-account`
export default {
namespaced: true,
......@@ -27,6 +31,27 @@ export default {
**/
info: {
detail: {}
},
/** 异步下载excel列表 */
dowloadList: [
{
name: 'xxx店订单补录2022-02-04test',
ifSuccess: false,
id: 1,
status: 'loading',
type: 'upload',
labelText: '导入成功0条, 导入失败1条'
}
]
},
mutations: {
/**
* @description 修改下载记录
* @param {Object} state state
*/
setDownloadList(state, params) {
state.dowloadList = params
console.log(state)
}
},
actions: {
......@@ -35,16 +60,16 @@ export default {
* @param {Object} context
* @param {*} info info
*/
set({
state,
dispatch
}, { info, accountInfo }) {
set({ state, dispatch }, { info, accountInfo }) {
return new Promise(async resolve => {
// store 赋值
state.info = info
state.accountInfo = accountInfo
sessionStorage.setItem(SESSION_NAME, escape(JSON.stringify(info)))
sessionStorage.setItem(ACCOUNT_SESSION_NAME, escape(JSON.stringify(accountInfo)))
sessionStorage.setItem(
ACCOUNT_SESSION_NAME,
escape(JSON.stringify(accountInfo))
)
resolve()
})
},
......@@ -52,29 +77,23 @@ export default {
* @description 从数据库取用户数据
* @param {Object} context
*/
load({
state,
dispatch
}) {
load({ state, dispatch }) {
return new Promise(async resolve => {
state.info = JSON.parse(unescape(sessionStorage.getItem(SESSION_NAME)))
resolve(state.info)
})
},
loadAcocunt({
state,
dispatch
}) {
loadAcocunt({ state, dispatch }) {
return new Promise(async resolve => {
state.accountInfo = JSON.parse(unescape(sessionStorage.getItem(ACCOUNT_SESSION_NAME)))
state.accountInfo = JSON.parse(
unescape(sessionStorage.getItem(ACCOUNT_SESSION_NAME))
)
resolve(state.accountInfo)
})
},
clear({
state
}) {
clear({ state }) {
return new Promise(async resolve => {
state.info = null
sessionStorage.removeItem(SESSION_NAME)
......@@ -82,9 +101,7 @@ export default {
resolve()
})
},
reset({
dispatch
}) {
reset({ dispatch }) {
dispatch('clear')
}
}
......
......@@ -681,7 +681,8 @@ export default {
},
{
label: '交易参考号',
name: 'tradeNo'
// name: 'tradeNo'
name: 'outTradeNo'
}
],
handleSelectChange: value => {
......
......@@ -33,7 +33,8 @@
effect="dark"
content="存在多笔销售订单,请与门店确认并点击退库此订单。"
placement="right">
<span class="el-icon-info"></span>
<span class="el-icon-info"
style="font-size: 18px;"></span>
</el-tooltip>
<div>
<span
......@@ -117,7 +118,8 @@
<el-tooltip effect="dark"
content="请选择项目号对应出库产品提交出库。"
placement="right">
<span class="el-icon-info"></span>
<span class="el-icon-info"
style="font-size: 18px;"></span>
</el-tooltip>
<span>销售订单号:{{erpOrderResponse_orderNo}}</span>
</div>
......@@ -202,12 +204,19 @@
<div class="footer_btn">
<span
v-if="['2', '5'].includes(orderInfo.order.outboundStatus) && orderInfo.erpOrderResponse && jurisdictionBtn">
<el-tooltip effect="dark"
v-if="orderInfo.order.outboundStatus == '5'"
:content="errContent"
placement="right">
<span class="el-icon-warning"
style="color:red;font-size: 20px;"></span>
</el-tooltip>
<span class="captchaMsg"
v-if="orderInfo.order.outboundStatus == '5'">
出库失败,请重新出库!</span>
<el-button type="primary"
@click="handleConfirm"
:loading="$store.state.d2admin.loading.value">确认出库</el-button>
<p class="captchaMsg"
v-if="orderInfo.order.outboundStatus == '5'">
出库失败,请重新出库!失败原因:{{orderInfo.order.outboundMsg}}</p>
</span>
<span v-else-if="orderInfo.order.outboundStatus == '3' && orderInfo.erpOrderResponse">
<el-button type="primary">出库中...</el-button>
......@@ -245,7 +254,8 @@ export default {
goodsList: [], // 替换产品下拉框
selectedOptions: [],
btnOkLabel: '确认出库',
Util: Util
Util: Util,
errContent: '失败原因:'
}
},
......@@ -314,6 +324,7 @@ export default {
}
})
this.objList.unshift({ optionId: '-1', optionLabel: '空' })
this.errContent = this.errContent + this.orderInfo.order.outboundMsg
})
},
......@@ -339,8 +350,10 @@ export default {
params.orderCode = this.orderInfo.order.orderCode
params.merchantId = this.orderInfo.order.merchantId
getErpOrderDetail(params).then(res => {
console.log(res)
this.getInfo(this.orderInfoId)
}).catch(err => {
console.log(err)
this.getInfo(this.orderInfoId)
})
},
......
......@@ -451,6 +451,7 @@ export default {
if (this.userInfo.beSuper) {
this.isBeSuper = true
getParkStore({}).then(res => {
if (typeof res === 'object') {
res.unshift({
merchantNo: '',
merchantName: '全部'
......@@ -460,16 +461,21 @@ export default {
})
this.parkServiceList = res
this.id = this.parkServiceList[0].merchantId
}
resolve()
})
} else if (this.userInfo.detail.accountType === 7) {
this.isBeSuper = true
getPartnerYqListApi({}).then(res => {
if (typeof res === 'object') {
res.unshift({
yqMerchantId: '',
yqMerchantName: '全部'
})
this.parkServiceList = res
}
resolve()
})
} else {
......
......@@ -3,56 +3,47 @@
<dialog-reg :isVisible="registerDialogVisible" />
<div class="page-login--layer page-login--layer-area">
<ul class="circles">
<li
v-for="n in 10"
:key="n"
></li>
<li v-for="n in 10"
:key="n"></li>
</ul>
</div>
<div
class="page-login--layer page-login--layer-time"
flex="main:center cross:center"
>{{time}}</div>
<div class="page-login--layer page-login--layer-time"
flex="main:center cross:center">{{time}}</div>
<div class="page-login--layer">
<div
class="page-login--content"
flex="dir:top main:justify cross:stretch box:justify"
>
<div class="page-login--content"
flex="dir:top main:justify cross:stretch box:justify">
<div class="page-login--content-header">
<p class="page-login--content-header-motto"></p>
</div>
<div
class="page-login--content-main"
flex="dir:top main:center cross:center"
>
<div class="page-login--content-main"
flex="dir:top main:center cross:center">
<!-- form -->
<div class="page-login--form-box" @click="handleReturnLogin">
<div class="page-login--form" v-show="!isMutiAccount">
<div class="page-login--form-box"
@click="handleReturnLogin">
<div class="page-login--form"
v-show="!isMutiAccount">
<div class="form-left">
<el-form
ref="loginForm"
<el-form ref="loginForm"
label-position="top"
:rules="rules"
:model="formLogin"
size="default"
>
size="default">
<div class="title-wrap">
<!-- <span class="form-title">{{systemName}}</span> -->
<span class="form-title">
<img src="./image/title.png" alt="D+智享车生活"/>
<img src="./image/title.png"
alt="D+智享车生活" />
</span>
<span class="form-sub">{{systemSubName}}</span>
</div>
<div class="input-wrap">
<el-form-item prop="userName">
<el-input
type="text"
<el-input type="text"
v-on:keyup.native.13="submit"
v-model="formLogin.userName"
placeholder="用户名"
clearable
v-focus
>
v-focus>
<!-- <d2-el-icon
slot="prepend"
name="user"
......@@ -60,13 +51,11 @@
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
<el-input type="password"
v-model="formLogin.password"
v-on:keyup.native.13="submit"
clearable
placeholder="密码"
>
placeholder="密码">
<!-- <d2-el-icon
slot="prepend"
name="key"
......@@ -74,19 +63,15 @@
</el-input>
</el-form-item>
<el-form-item class="form-action">
<el-button
@click="submit"
<el-button @click="submit"
type="primary"
:loading="$store.state.d2admin.loading.value"
class="button-login"
:style="{'width': hasReg ? '' : '100%' }"
>登录</el-button>
<el-button
v-if="hasReg"
:style="{'width': hasReg ? '' : '100%' }">登录</el-button>
<el-button v-if="hasReg"
@click.prevent="registerDialogVisible = true"
plain
class="button-reg"
>注册</el-button>
class="button-reg">注册</el-button>
</el-form-item>
</div>
</el-form>
......@@ -96,16 +81,22 @@
<div class="img-bg"></div>
</div>
</div>
<div class="page-login--muti-form" v-show="isMutiAccount">
<div class="page-login--muti-form"
v-show="isMutiAccount">
<div class="muti-title">请选择登陆商户号</div>
<div class="muti-form-box">
<div class="muti-merchant-item" v-for="(item, index) in accountInfo.accountList" :key="index" @click.stop.prevent="handleSelectAccount(index)">
<div class="muti-merchant-item"
v-for="(item, index) in accountInfo.accountList"
:key="index"
@click.stop.prevent="handleSelectAccount(index)">
<i class="muti-dot"></i>
<div class="muti-merchant-info">
<p class="muti-merchant-name">{{ item.merchantName }}</p>
<p class="muti-merchant-code">商户编号:{{ item.merchantNo }}</p>
</div>
<p class="muti-merchant-level">{{ baseData.accountLevelList.find(k => +k.confId == item.accountLevel).confName }}</p>
<p class="muti-merchant-level">
{{ baseData.accountLevelList.find(k => +k.confId == item.accountLevel).confName }}
</p>
<i class="muti-arrow el-icon-arrow-right"></i>
</div>
</div>
......@@ -225,7 +216,7 @@ export default {
}
})
userInfo.merchantAccountLevel = userInfo.detail.merchantAccountLevel
this.getAuth({ userInfo: userInfo, accountInfo: this.accountInfo }).then(async() => {
this.getAuth({ userInfo: userInfo, accountInfo: this.accountInfo }).then(async () => {
const _current = userInfo.detail.accountType !== 7 ? await this.current() : '/onlineAccountList'
await this.initBaseData()
this.$router.replace(this.$route.query.redirect || _current)
......@@ -244,7 +235,7 @@ export default {
// 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码
this.login(_p)
.then(async({ isMutiAccount, accountInfo, userInfo }) => {
.then(async ({ isMutiAccount, accountInfo, userInfo }) => {
if (isMutiAccount) {
this.isMutiAccount = isMutiAccount
this.accountInfo = accountInfo
......@@ -387,9 +378,9 @@ export default {
.muti-dot {
width: 12px;
height: 12px;
background-color: #2A58AD;
background-color: #2a58ad;
margin: 4px 6px 0 0;
transform: scale(.5);
transform: scale(0.5);
border-radius: 100%;
}
.muti-merchant-info {
......@@ -463,7 +454,7 @@ export default {
width: 280px;
height: 52px;
}
.form-title img{
.form-title img {
width: 100%;
height: 100%;
}
......@@ -502,7 +493,13 @@ export default {
.button-login {
// background-color: #3D6FE4 !important;
// color: #FFF;
background-image: linear-gradient(148deg, #0BCDFE 0%, #36B2E6 28%, #0947C6 100%, #0947C6 100%);
background-image: linear-gradient(
148deg,
#0bcdfe 0%,
#36b2e6 28%,
#0947c6 100%,
#0947c6 100%
);
letter-spacing: 2px;
float: left;
border: none;
......
<!-- 历史财务规则 -->
<template>
<div class="account-detail"
ref="accountDetail">
<!-- v-resize="resetTableHeight"
:ref="'resize' + index" -->
<div v-if="formArray&&formArray.length">
<div v-for="(formItem,index) in formArray"
v-resize="resetTableHeight"
:ref="'resize' + index"
:key="index">
<p class="edit-sub-title "
:class="{'sub-border':!formItem.show}">
<span class="label">
<span>{{formItem.formatEffectStartDate}}</span>
<span v-if="formItem.formatEffectStartDate"> - </span>
<span
:class="{'labelColor':!formItem.formatEffectEndDate}">{{formItem.formatEffectStartDate?formItem.formatEffectEndDate?formItem.formatEffectEndDate:'生效中':'待生效'}}</span>
</span>
<span class="updatedInfo">
操作人: {{formItem.updatedBy}} 操作时间: {{formItem.formatUpdatedDate}}
</span>
<span class="collapse"
@click="collapseItem(index)">
<i :class="{'move':!formItem.show}"
class="arrow el-icon-arrow-down"></i>
{{formItem.show?'收起':'展开'}} </span>
</p>
<el-collapse-transition>
<viewDetail :isGetDetail='false'
v-if="formItem.show"
:merchantInfo="formItem"
:viewDetailVisible="formItem.show"></viewDetail>
</el-collapse-transition>
</div>
</div>
<div v-else
class="nothingtips">
<img style="height: 109px; width: 109px;"
src="../images/empty.png" />
<p class="title">暂无财务规则</p>
<p class="tips">快去设置看看~ </p>
</div>
</div>
</template>
<script>
import dayjs from 'dayjs'
import { getHistoryRecord } from '@api/publicAccount'
import viewDetail from './viewDetail'
import resize from '@/common/resize'
export default {
name: 'financialRulesDetail',
// 在vue自定义指令中添加该指令
directives: {
resize
},
components: {
// Collapse
viewDetail
},
props: {
accountDetailVisible: {
type: Boolean,
default: false
},
merchantId: {
type: [String, Number],
default: '44209883'
},
merchantRow: {
type: Object,
default: () => { }
}
},
data() {
return {
formArray: []
}
},
watch: {
accountDetailVisible(newVal) {
if (newVal) {
this.merchantId = this.merchantRow.merchantId
// this.getDetail()
}
}
},
mounted() {
this.getDetail()
},
methods: {
collapseItem(SelectIndex) {
// return
this.formArray.forEach((element, index) => {
if (SelectIndex == index) {
element.show = !element.show
} else {
element.show = false
}
})
},
getDetail() {
getHistoryRecord({ merchantId: this.merchantId }).then(res => {
console.log(res)
// dayjs(this.summaryDate).startOf('month').format('YYYY-MM-DD')
// const timeLabele = {
// }
// let financialRulesList = res
// 财务规则有三个模式 待生效 生效中 历史
// 根据effectEndDate 和 effectStartDate
this.formArray = res.map((item) => {
const format = 'YYYY/MM/DD HH:mm'
item.merchant = item?.divisionRule?.realityDivisionMerchant
item = Object.assign(item, item.settleRule, item.divisionRule)
item.formatEffectEndDate = item.effectEndDate ? dayjs(item.effectEndDate).format(format) : ''
item.formatEffectStartDate = item.effectStartDate ? dayjs(item.effectStartDate).format(format) : ''
item.formatUpdatedDate = dayjs(item.createdDate).format(format)
item.show = false
return item
})
})
},
resetTableHeight() {
function getClientHeight() {
let clientHeight = 0
if (document.body.clientHeight && document.documentElement.clientHeight) {
clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
} else {
clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
}
return clientHeight
}
const windowHeight = getClientHeight() - 221
const that = this
// const list = ['resize0', 'resize1', 'resize2', 'resize3']
const listHeight = this.formArray.reduce((num, item, index) => {
// console.log(that.$refs[item])
num = num + (that.$refs[`resize${index}`][0].offsetHeight) || 0
return num
}, 0)
// console.log(listHeight)
const height = windowHeight > listHeight ? listHeight : windowHeight
// console.log(height + 'height')
this.$refs.accountDetail.style.height = height + 'px'
// console.log(this.$refs.resize0[0].offsetHeight)
}
}
}
</script>
<style scoped lang="scss">
.account-detail {
// height: 400px;
height: calc(100vh - 200px);
padding-right: 15px;
overflow-y: scroll;
overflow-x: hidden;
}
.edit-sub-title {
padding: 17px 0;
margin: 0;
display: flex;
justify-content: space-between;
font-size: 14px;
&::before {
top: 50%;
transform: translateY(-50%);
}
.label {
padding-left: 8px;
width: 37%;
}
.labelColor {
color: #0947c6;
}
.updatedInfo {
width: 40%;
text-align: left;
}
.collapse {
padding-right: 20px;
color: #0947c6;
cursor: pointer;
.arrow {
transition: all 1s;
}
.move {
transform: rotate(-180deg);
}
}
}
.sub-border {
animation: border-delay 1s forwards;
}
@keyframes border-delay {
0% {
/* opacity: 0; */
/* right: -100%; */
}
100% {
border-bottom: 1px solid #d8d8d8;
}
}
.account-detail .detail-img {
width: 180px;
height: 104px;
margin-right: 40px;
transition: width 0.3s;
border-radius: 4px;
overflow: hidden;
cursor: pointer;
margin-right: 100px;
}
// .account-detail .detail-img:hover {
// margin-right: 0px;
// width: 90%;
// height: 90%;
// }
// .account-detail .detail-img:hover + .imageLabel {
// width: 90%;
// }
.itemContainer {
padding: 30px 0;
background: #f4f6fc;
border-radius: 2px;
}
.imageContainer {
// style="display: inline-block;"
// max-height: 50%;
position: relative;
max-width: 50%;
box-sizing: border-box;
display: inline-block;
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
}
.imageLabel {
line-height: 14px;
width: 137px;
// width: 50%;
text-align: center;
color: #999999;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
}
.img-btns {
display: none;
position: absolute;
width: 180px;
height: 104px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
cursor: pointer;
background: rgba(0, 0, 0, 0.5);
}
.img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.imageContainer:hover .img-btns {
display: block;
}
/* .transition-box {
margin-bottom: 10px;
width: 200px;
height: 100px;
border-radius: 4px;
background-color: #409eff;
text-align: center;
color: #fff;
padding: 40px 20px;
box-sizing: border-box;
margin-right: 20px;
} */
.link {
color: blue;
cursor: pointer;
// /* 鼠标样式*/
}
.link:link {
color: #06f;
text-decoration: none;
// /* 未访问的链接 */
}
.link:visited {
color: #999;
text-decoration: line-through;
// /* 已访问的链接 */
}
.link:hover {
color: #f00;
//* 鼠标移动到链接上 */
text-decoration: underline;
}
.link:active {
// /* 选定的链接 */
color: #f0f;
}
.nothingtips {
// align-items: center;
text-align: center;
font-size: 16px;
padding-top: 40px;
.title {
font-size: 20px;
color: #666;
margin: 16px 0;
}
.tips {
font-size: 12px;
color: #999;
}
}
</style>
......@@ -111,11 +111,15 @@
:disabled="true">配置管理</el-tab-pane>
</el-tabs>
</d2-dialog>
<!-- <division-rule
:divisionRuleVisible="divisionRuleVisible"
:merchantInfo="merchantInfo"
@handleRuleClose="handleRuleClose"
></division-rule> -->
<baseDialog :isShow.sync="financialRulesDetailVisible"
:config="dialogConfig.setting"
:dialogConfig="dialogConfig.config"
@closeDialog="handleDetailClose">
<financialRulesDetail v-if="financialRulesDetailVisible"
:merchantId="merchantInfo.merchantId"
:accountDetailVisible="financialRulesDetailVisible">
</financialRulesDetail>
</baseDialog>
</d2-container>
</template>
......@@ -123,7 +127,8 @@
import { Util } from '@/common/util'
import _ from 'lodash'
import viewDetail from './viewDetail'
// import divisionRule from './divisionRule'
import financialRulesDetail from './financialRulesDetail'
import baseDialog from '@/components/baseDialog/baseDialog'
import { getList, deleteMerchant, serviceGetMerchantList, addServiceMerchant, getPartnerByYq } from '@api/merchant'
import { mapActions } from 'vuex'
import { getParkStore } from '@api/editCustomer'
......@@ -131,9 +136,31 @@ import { BaseData, userTypeList, ghUserTypeList, merchantClassifyList } from '@/
import relateStoreMerDialog from './components/relateStoreMerDialog'
export default {
name: 'merchantManage',
components: {
viewDetail,
relateStoreMerDialog,
financialRulesDetail,
baseDialog
// divisionRule
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
financialRulesDetailVisible: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '900px',
btnList: [
]
},
config: {
title: '查看详情',
width: '900px'
}
},
searchForm: {
merchantType: '',
channelType: '',
......@@ -185,7 +212,9 @@ export default {
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableOption: {
width: '200px'
},
tableColumns: [{
label: '导流方编号',
prop: 'merchantId',
......@@ -268,7 +297,8 @@ export default {
formatter: (cellValue) => {
return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss')
}
}]
}
]
},
// 关联门店
storeSearchForm: {
......@@ -287,9 +317,7 @@ export default {
storeApi: serviceGetMerchantList,
sourcePage: 'serviceStore',
storeSelected: [],
// 分账
// divisionRuleVisible: false,
// merchantInfo: {},
// 查看详情
detailActiveName: 'first',
viewDetailVisible: false,
......@@ -309,12 +337,6 @@ export default {
}
},
components: {
viewDetail,
relateStoreMerDialog
// divisionRule
},
mounted() {
this.userInfo.beSuper && getParkStore({}).then(res => {
res.forEach(item => {
......@@ -334,6 +356,9 @@ export default {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
},
handleDetailClose() {
this.financialRulesDetailVisible = false
},
keyDowmGetList() {
this.$refs.merchantTable.refreshTable()
},
......@@ -440,14 +465,14 @@ export default {
this.viewDetailData = _.cloneDeep(row)
this.handleViewClose()
},
// 分账
// handleAccount(row) {
// this.merchantInfo = row
// this.handleRuleClose()
// },
// handleRuleClose() {
// this.divisionRuleVisible = !this.divisionRuleVisible
// },
// 历史记录
handleRecord(row) {
this.merchantInfo = row
this.handleRuleClose()
},
handleRuleClose() {
this.financialRulesDetailVisible = !this.financialRulesDetailVisible
},
// 删除
handleDelete(row) {
this.$confirm('是否要进行删除操作?', '提示', {
......
......@@ -143,10 +143,7 @@
<p class="desc-title">POS机扫码获取订单信息</p>
<div class="txt-box"
v-if="merchantInfo.goodsOrder">
<!-- <img
class="middle"
src="./images/code.png"
/> -->
<vue-qr class="middle"
:margin="0"
width="134"
......@@ -291,14 +288,14 @@
<script>
import { mapActions } from 'vuex'
import vueQr from 'vue-qr'
// import vueQr from 'vue-qr'
import { limitPrice } from '@/common/constants'
import { moneyValidApi, getWsUrlApi } from '@api/merchant'
import vue2OrgTree from 'vue2-org-tree'
export default {
name: 'stepThree',
components: {
vueQr,
// vueQr,
vue2OrgTree
},
data() {
......
......@@ -36,7 +36,8 @@
class="blue">{{merchantInfo.marketingCostPartnerMerchant ? merchantInfo.marketingCostPartnerMerchant.merchantName : ''}}{{merchantInfo.marketingCostPartnerMerchant ? ( '(' + merchantInfo.marketingCostPartnerMerchant.merchantId + ')') : ''}}:</span>
{{divisionList.marketingCostPartnerMerchant.join(',')}}
</p>
<p v-show="divisionList.realityShopMerchantName.length">
<!-- v-show="divisionList.realityShopMerchantName.length" -->
<p>
<span
class="blue">{{divisionForm.realityShopMerchantName}}:</span>{{divisionList.realityShopMerchantName.join(',')}}
</p>
......@@ -61,7 +62,8 @@
<tr>
<th>商户编号:{{merchantInfo.merchantId}}</th>
<th class="ellipsis w-298"
:title="merchantInfo.merchantName">商户名称:{{merchantInfo.merchantName}}</th>
:title="$$(merchantInfo.merchant,'merchantName')">
商户名称:{{$$(merchantInfo.merchant,'merchantName')}}</th>
<th class="w-140">联系人:{{merchantInfo.merchant ? merchantInfo.merchant.contactName : ''}}
</th>
<th>联系电话:{{merchantInfo.merchant ? merchantInfo.merchant.phone : ''}}</th>
......@@ -73,10 +75,10 @@
<tr>
<td>登录账户:{{merchantInfo.merchant ? merchantInfo.merchant.accountName : ''}}</td>
<td>
商户类型:{{baseData[merchantInfo.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][merchantInfo.userType]}}
商户类型:{{baseData[$$(merchantInfo.merchant,'channelType') === 2 ? 'ghUserTypeList' : 'userTypeList'][merchantInfo.merchant.userType]}}
</td>
<td>
商户分类:{{merchantInfo.merchantType ? baseData.merchantClassifyList.find(item => item.confId === merchantInfo.merchantType).confLabel : ''}}
商户分类:{{$$(merchantInfo.merchant,'merchantType') ? baseData.merchantClassifyList.find(item => item.confId === merchantInfo.merchant.merchantType).confLabel : ''}}
</td>
<td class="dateContainer noPddingRight">入驻日期:
<el-date-picker v-model="needTransformObj.entryDate"
......@@ -90,7 +92,8 @@
</el-date-picker>
<div>{{needTransformObj.entryDate}}</div>
<div class="date">
<div class="date"
v-if="isGetDetail">
<div class="dateBtn"
@click="chooseDate">编辑</div>
</div>
......@@ -138,9 +141,8 @@
<td>创建时间:{{needTransformObj.yqCreatedDate}}</td>
</tr>
</table>
<div v-show="merchantInfo.partnerMerchants">
<!-- <div v-show="merchantInfo.partnerMerchants"> -->
<p class="edit-sub-title m-t-10">关联的服务商基础信息</p>
<table cellpadding='0'
cellspacing='0'
style="border-width: 0px 0px 1px 1px;">
......@@ -244,11 +246,11 @@
</table>
</div>
</div>
</div>
<!-- </div> -->
</template>
<script>
import { Util } from '@/common/util'
import { Util, deepClone } from '@/common/util'
import { getAccountRule, getDivisionRuleApi, entrydateUpdate } from '@api/merchant'
// deductChargeFlagObj
import { userType, ghUserType, merchantClassifyList, partnerDeductChargeFlagObj, shop4sDeductChargeFlagObj } from '@/common/constants'
......@@ -262,6 +264,10 @@ export default {
merchantInfo: {
type: Object,
default: () => { }
},
isGetDetail: {
type: Boolean,
default: true
}
},
data() {
......@@ -378,12 +384,33 @@ export default {
},
mounted() {
console.log(this.isGetDetail)
this.setNeedTransformObj()
if (this.isGetDetail) {
this.getDetail()
} else {
this.setAccountRule(this.merchantInfo.settleRule)
this.setDivisionRule(deepClone(this.merchantInfo.divisionRule))
// const res = Object.assign(this.merchantInfo.settleRule, this.merchantInfo.divisionRule)
// this.setDivisionRule(res)
}
},
methods: {
getDetail() {
// console.log(this.merchantInfo)
console.log(this.merchantInfo)
// console.log(Util.dateFormate(this.merchantInfo.merchant.entryDate, 'YYYY-MM-DD'))
getDivisionRuleApi({ merchantId: this.merchantInfo.merchantId }).then(res => {
// console.log(res)
// this.hasDivision = !!res
this.setDivisionRule(res)
})
getAccountRule({ 'merchantId': this.merchantInfo.merchantId }).then(res => {
this.setAccountRule(res)
})
},
setNeedTransformObj() {
this.needTransformObj = {
addr: this.merchantInfo.merchant ? ((this.merchantInfo.merchant.provinceName || '') + (this.merchantInfo.merchant.cityName || '') + (this.merchantInfo.merchant.areaName || '') + (this.merchantInfo.merchant.address || '')) : '',
createdDate: this.merchantInfo.merchant ? (this.merchantInfo.merchant.createdDate ? Util.dateFormate(this.merchantInfo.merchant.createdDate, 'YYYY-MM-DD HH:mm:ss') : '') : '',
......@@ -393,11 +420,11 @@ export default {
parentCreatedDate: this.merchantInfo.singlePartnerMerchant ? (this.merchantInfo.singlePartnerMerchant.createdDate ? Util.dateFormate(this.merchantInfo.singlePartnerMerchant.createdDate, 'YYYY-MM-DD HH:mm:ss') : '') : '',
entryDate: this.merchantInfo.merchant ? (this.merchantInfo.merchant.entryDate ? Util.dateFormate(this.merchantInfo.merchant.entryDate, 'YYYY-MM-DD') : '') : ''
}
// console.log(Util.dateFormate(this.merchantInfo.merchant.entryDate, 'YYYY-MM-DD'))
getDivisionRuleApi({ merchantId: this.merchantInfo.merchantId }).then(res => {
// console.log(res)
this.hasDivision = !!res
},
setDivisionRule(res) {
this.hasDivision = res ?? ''
this.divisionForm = res || {}
console.log(this.divisionForm)
Object.assign(this.form, res)
var flagList = Object.keys(this.flagTodivisionObj)
......@@ -415,12 +442,13 @@ export default {
// console.log(numToDivisionList[res[item]])
numToDivisionList[res[item]] && this.divisionList[numToDivisionList[res[item]]].push(this.flagTodivisionObj[item])
})
})
getAccountRule({ 'merchantId': this.merchantInfo.merchantId }).then(res => {
},
setAccountRule(res) {
Object.assign(this.merchantInfo, res)
// console.log(res)
// console.log(this.settleRuleList)
if (res) {
this.settleRuleList = res.goodsTypeSettleRuleList
this.settleRuleList = deepClone(res.goodsTypeSettleRuleList)
// console.log(res.goodsTypeSettleRuleList)
this.merchantInfo.deductChargeFlag = res.deductChargeFlag
this.settleRuleList.unshift({
goodsTypeName: '全部',
......@@ -429,9 +457,8 @@ export default {
partnerProfitPer: res.partnerProfitPer
})
}
})
// console.log(this.settleRuleList)
},
chooseDate() {
this.$refs.datePicker.focus()
},
......
......@@ -2,21 +2,25 @@ const VueFilenameInjector = require('./tools/vue-filename-injector')
const ThemeColorReplacer = require('webpack-theme-color-replacer')
const forElementUI = require('webpack-theme-color-replacer/forElementUI')
const HardPlugin = require('hard-source-webpack-plugin') // 使用缓存,优化启动速度
// const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
const SentryWebpackPlugin = require('@sentry/webpack-plugin')
// const CopyDir = require('./plugins/copyDir')
// const AsyncRomveDir = require('./plugins/removeDir')
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
const CopyDir = require('./plugins/copyDir')
const AsyncRomveDir = require('./plugins/removeDir')
const { resolve: assets } = require('path')
const os = require('os')
/**
* 获取当前机器的ip地址
*/
function getIpAddress() {
var ifaces = os.networkInterfaces()
for (var dev in ifaces) {
const iface = ifaces[dev]
for (let i = 0; i < iface.length; i++) {
const { family, address, internal } = iface[i]
if (family === 'IPv4' && address !== '127.0.0.1' && !internal) {
return address
}
......@@ -25,20 +29,21 @@ function getIpAddress() {
}
// 拼接路径
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 CDN_DOMAIN = 'https://cdn.bootcss.com'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/dj-carlife-web'
const cdn = {
css: [
// `${CDN_DOMAIN}/element-ui/2.15.0/theme-chalk/index.css`,
`${CDN_DOMAIN}/nprogress.min.css`
],
css: [`${CDN_DOMAIN}/nprogress.min.css`, `${CDN_DOMAIN}/element-ui.min.css`],
js: [
`${CDN_DOMAIN}/vue.min.js`,
`${CDN_DOMAIN}/vue-router.min.js`,
......@@ -49,16 +54,20 @@ const cdn = {
`${CDN_DOMAIN}/echarts.min.js`,
`${CDN_DOMAIN}/lodash.min.js`,
`${CDN_DOMAIN}/qs.min.js`,
`${CDN_DOMAIN}/ua-parser.min.js`
// `${CDN_DOMAIN}/element-ui/2.15.0/index.js`,
// `${CDN_DOMAIN}/core-js/2.6.9/core.min.js`,
// `${CDN_DOMAIN}/vue-i18n/8.14.0/vue-i18n.esm.js`,
`${CDN_DOMAIN}/ua-parser.min.js`,
`${CDN_DOMAIN}/html2canvas.min.js`,
`${CDN_DOMAIN}/element-ui.min.js`,
`${CDN_DOMAIN}/better-scroll.min.js`,
`${CDN_DOMAIN}/dayjs.min.js`,
`${CDN_DOMAIN}/vue-qr.js`,
`${CDN_DOMAIN}/xlsx.min.js`
// `${CDN_DOMAIN}/flex.css`
]
}
module.exports = {
publicPath, // 根据你的实际情况更改这里
// outputDir: 'copyDirTarget',
lintOnSave: false,
outputDir: 'copyDirTarget',
lintOnSave: true,
devServer: {
// publicPath, // 和 publicPath 保持一致
https: false,
......@@ -74,6 +83,7 @@ module.exports = {
},
configureWebpack: config => {
if (isDev) {
// if (!isDev) {
config.externals = {
vue: 'Vue',
'vue-router': 'VueRouter',
......@@ -84,13 +94,27 @@ module.exports = {
echarts: 'echarts',
lodash: '_',
'ua-parser-js': 'UAParser',
qs: 'Qs'
// 'element-ui': 'ELEMENT',
// 'vue-i18n':'vue-i18n',
qs: 'Qs',
// 'flex.css': 'flex.css',
html2canvas: 'html2canvas',
'element-ui': 'ELEMENT',
dayjs: 'dayjs',
'vue-qr': 'vue-qr',
// 'better-scroll': 'BScroll',
// 'core-js': 'core-js'
xlsx: 'XLSX',
BScroll: 'better-scroll'
// xlsx: 'xlsx'
// 'XLSX': 'xlsx'
// xlsx: 'XLSX'
}
}
// html2canvas: 'html2canvas',
// 'element-ui': 'ELEMENT',
// 'better-scroll': 'BScroll',
// xlsx: 'xlsx',
// 'vue-qr': 'vue-qr',
// dayjs: 'dayjs',
// 'flex.css': 'flex.css'
// 非开发环境
if (isDev) {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
......@@ -101,6 +125,7 @@ module.exports = {
]
}
// console.log(config)
// const Plugins = [
// new MiniCssExtractPlugin({
// // Options similar to the same options in webpackOptions.output
......@@ -109,6 +134,7 @@ module.exports = {
// chunkFilename: devMode ? 'css/[id].css' : 'css/[id].[hash].css',
// })]
// config.plugins = [...config.plugins, ...Plugins]
const plugins = []
plugins.push(
new HardPlugin({
......@@ -116,27 +142,34 @@ module.exports = {
// 解决报错问题
test: /mini-css-extract-plugin[\\/]dist[\\/]loader/
})
)
if (isDev) {
plugins.push(new CopyDir())
// new AsyncRomveDir()
// new SpeedMeasurePlugin(),
// new CopyDir() // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// new CopyDir(), // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// new AsyncRomveDir()
)
}
config.plugins = [...config.plugins, ...plugins]
// sentry 配置
// process.env.NODE_ENV === 'production' &&
// Object.assign(config, {
// plugins: [
// ...config.plugins,
// new SentryWebpackPlugin({
// // webpack specific configuration
// release: '0.0.1',
// include: './dist', // 需要上传到sentry服务器的资源目录,会自动匹配js 以及map文件
// ignore: ['node_modules', 'vue.config.js'], // 忽略文件目录,当然我们在inlcude中制定了文件路径,这个忽略目录可以不加
// configFile: '.sentryclirc',
// urlPrefix: '~/dj-carlife-web/'
// })
// ]
// })
process.env.NODE_ENV === 'production' &&
Object.assign(config, {
plugins: [
...config.plugins,
new SentryWebpackPlugin({
// webpack specific configuration
release: '0.0.1',
include: './dist', // 需要上传到sentry服务器的资源目录,会自动匹配js 以及map文件
ignore: ['node_modules', 'vue.config.js'], // 忽略文件目录,当然我们在inlcude中制定了文件路径,这个忽略目录可以不加
configFile: '.sentryclirc',
urlPrefix: '~/dj-carlife-web/'
})
]
})
},
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack: config => {
/**
......@@ -146,6 +179,9 @@ module.exports = {
* 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的
*/
config.plugins.delete('prefetch').delete('preload')
// config
// .plugin('webpack-bundle-analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
// 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559
config.resolve.symlinks(true)
config.plugin('theme-color-replacer').use(ThemeColorReplacer, [
......@@ -204,7 +240,9 @@ module.exports = {
config.resolve.alias
.set('@', resolve('src'))
.set('@api', resolve('src/api'))
if (isDev) {
// if (!isDev) {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!