Commit fa4c939b by 张立顺

theme-color-replacer 写法修改

1 parent 5172dd5f
Showing 139 changed files with 2400 additions and 1967 deletions
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
node: true node: true
}, },
'extends': [ extends: [
'plugin:vue/essential', 'plugin:vue/essential',
'@vue/prettier' '@vue/prettier'
], ],
rules: { rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}, },
parserOptions: { parserOptions: {
parser: 'babel-eslint' parser: 'babel-eslint'
} }
} }
module.exports = { module.exports = {
root: true, root: true,
parserOptions: { parserOptions: {
parser: '@babel/eslint-parser' // parser: '@babel/eslint-parser'
ecmaVersion: 2020,
}, },
env: { env: {
browser: true browser: true,
}, },
extends: [ extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevent // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevent
...@@ -12,23 +13,27 @@ module.exports = { ...@@ -12,23 +13,27 @@ module.exports = {
// `plugin:vue/recommended` for stricter rules. // `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential', 'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md // https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard' 'standard',
'plugin:vue/strongly-recommended',
'@vue/standard',
// '@vue/typescript/recommended'
], ],
// required to lint *.vue files // required to lint *.vue files
plugins: ['vue'], plugins: ['vue'],
globals: { globals: {
NODE_ENV: false, NODE_ENV: false,
_: false, _: false,
echarts: false echarts: false,
}, },
rules: { rules: {
'arrow-spacing': [ 'arrow-spacing': [
2, 2,
{ {
before: true, before: true,
after: true after: true,
} },
], ],
'no-var': 'off',
eqeqeq: 'off', eqeqeq: 'off',
// 'no-eval': ['error', { allowIndirect: false }], // default is false // 'no-eval': ['error', { allowIndirect: false }], // default is false
'no-eval': 'off', // default is false 'no-eval': 'off', // default is false
...@@ -39,16 +44,16 @@ module.exports = { ...@@ -39,16 +44,16 @@ module.exports = {
2, 2,
'1tbs', '1tbs',
{ {
allowSingleLine: true allowSingleLine: true,
} },
], ],
'comma-dangle': [2, 'never'], 'comma-dangle': [2, 'never'],
'comma-spacing': [ 'comma-spacing': [
2, 2,
{ {
before: false, before: false,
after: true after: true,
} },
], ],
'comma-style': [2, 'last'], 'comma-style': [2, 'last'],
curly: [2, 'multi-line'], curly: [2, 'multi-line'],
...@@ -57,29 +62,29 @@ module.exports = { ...@@ -57,29 +62,29 @@ module.exports = {
2, 2,
2, 2,
{ {
SwitchCase: 1 SwitchCase: 1,
} },
], ],
'key-spacing': [ 'key-spacing': [
2, 2,
{ {
beforeColon: false, beforeColon: false,
afterColon: true afterColon: true,
} },
], ],
'keyword-spacing': [ 'keyword-spacing': [
2, 2,
{ {
before: true, before: true,
after: true after: true,
} },
], ],
'new-cap': [ 'new-cap': [
2, 2,
{ {
newIsCap: true, newIsCap: true,
capIsNew: false capIsNew: false,
} },
], ],
'no-extra-parens': [2, 'functions'], 'no-extra-parens': [2, 'functions'],
'no-floating-decimal': 2, 'no-floating-decimal': 2,
...@@ -87,8 +92,8 @@ module.exports = { ...@@ -87,8 +92,8 @@ module.exports = {
'no-multiple-empty-lines': [ 'no-multiple-empty-lines': [
2, 2,
{ {
max: 1 max: 1,
} },
], ],
'no-trailing-spaces': 2, 'no-trailing-spaces': 2,
quotes: [ quotes: [
...@@ -96,8 +101,8 @@ module.exports = { ...@@ -96,8 +101,8 @@ module.exports = {
'single', 'single',
{ {
avoidEscape: true, avoidEscape: true,
allowTemplateLiterals: true allowTemplateLiterals: true,
} },
], ],
semi: [2, 'never'], semi: [2, 'never'],
'space-before-blocks': [2, 'always'], 'space-before-blocks': [2, 'always'],
...@@ -109,10 +114,10 @@ module.exports = { ...@@ -109,10 +114,10 @@ module.exports = {
2, 2,
{ {
words: true, words: true,
nonwords: false nonwords: false,
} },
], ],
'spaced-comment': [2, 'always'], 'spaced-comment': [2, 'always'],
'prefer-const': 2 'prefer-const': 2,
} },
} }
No preview for this file type
This diff could not be displayed because it is too large.
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
"eslint-plugin-import": "^2.25.3", "eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0", "eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^7.0.0",
"jest": "^27.1.0", "jest": "^27.1.0",
"postcss": "^8.4.16", "postcss": "^8.4.16",
"postcss-loader": "^7.0.1", "postcss-loader": "^7.0.1",
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<script> <script>
export default { export default {
name: 'app', name: 'App',
created() { created() {
// console.log(abcd.efg) // console.log(abcd.efg)
......
...@@ -7,5 +7,5 @@ const req = require.context('./icons', false, /\.svg$/) ...@@ -7,5 +7,5 @@ const req = require.context('./icons', false, /\.svg$/)
const iconMap = requireAll(req) const iconMap = requireAll(req)
// console.log("iconMap",iconMap); // console.log("iconMap",iconMap);
// e.slice(3) 老写法 // e.slice(3) 老写法
Vue.prototype.$IconSvg = iconMap.map(e =>e.split('/')[1].split('.')[0] ) Vue.prototype.$IconSvg = iconMap.map(e => e.split('/')[1].split('.')[0])
// Vue.prototype.$IconSvg = iconMap.map(e =>console.log(e.default)) // Vue.prototype.$IconSvg = iconMap.map(e =>console.log(e.default))
...@@ -16,7 +16,7 @@ export const Util = { ...@@ -16,7 +16,7 @@ export const Util = {
* confirmButtonColor 确认按钮颜色 * confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色 * cancelButtonColor 取消按钮颜色
*/ */
msg: function(options) { msg: function (options) {
MessageBox({ MessageBox({
title: options.title || '', title: options.title || '',
type: options.type || 'error', type: options.type || 'error',
...@@ -28,7 +28,7 @@ export const Util = { ...@@ -28,7 +28,7 @@ export const Util = {
confirmButtonColor: options.confirmButtonColor || '#1989fa', confirmButtonColor: options.confirmButtonColor || '#1989fa',
cancelButtonColor: options.cancelButtonColor || '#000', cancelButtonColor: options.cancelButtonColor || '#000',
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
callback: function(action, done) { callback: function (action, done) {
if (action == 'confirm') { if (action == 'confirm') {
if (options.success) { if (options.success) {
options.success(done) options.success(done)
...@@ -37,7 +37,7 @@ export const Util = { ...@@ -37,7 +37,7 @@ export const Util = {
console.log(done) console.log(done)
// done() // done()
} }
} },
}) })
/* Vue.$vux.alert.show({ /* Vue.$vux.alert.show({
...@@ -55,55 +55,56 @@ export const Util = { ...@@ -55,55 +55,56 @@ export const Util = {
/** /**
* 提示框 * 提示框
*/ */
Info: function(options) { Info: function (options) {
Message({ Message({
message: options.message || '提示', message: options.message || '提示',
type: options.type || 'error', type: options.type || 'error',
duration: options.time || 2000, duration: options.time || 2000,
onClose: options.onClose || '' onClose: options.onClose || '',
}) })
}, },
/** /**
* 轻提示 * 轻提示
*/ */
Tips: function(options) { Tips: function (options) {
Message({ Message({
message: options.message || '提示', message: options.message || '提示',
duration: options.duration || 3000, duration: options.duration || 3000,
type: options.type || 'text', type: options.type || 'text',
icon: options.icon || '' icon: options.icon || '',
}) })
}, },
/** /**
* loading * loading
*/ */
loading: function(message) { loading: function (message) {
loadingInstance = Loading.service({ loadingInstance = Loading.service({
text: message || '加载中...' text: message || '加载中...',
}) })
}, },
/** /**
* 关闭loading * 关闭loading
*/ */
closeLoading: function() { closeLoading: function () {
loadingInstance.close() loadingInstance.close()
}, },
/** /**
* 校验手机号码格式 * 校验手机号码格式
*/ */
checkPhone: function(mobile) { checkPhone: function (mobile) {
const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/ const myreg =
/^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile) return myreg.test(mobile)
}, },
/** /**
* 校验固定电话 * 校验固定电话
*/ */
validationTel: function(tel) { validationTel: function (tel) {
const reg = /^0[\d]{2,3}-[\d]{7,8}$/ const reg = /^0[\d]{2,3}-[\d]{7,8}$/
return reg.test(tel) return reg.test(tel)
}, },
...@@ -111,7 +112,7 @@ export const Util = { ...@@ -111,7 +112,7 @@ export const Util = {
/** /**
* 是否特殊字符 * 是否特殊字符
*/ */
isSpecialLetter: function(str) { isSpecialLetter: function (str) {
const reg = new RegExp( const reg = new RegExp(
"[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]" "[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"
) )
...@@ -121,7 +122,7 @@ export const Util = { ...@@ -121,7 +122,7 @@ export const Util = {
/** /**
* 只能输入英文字母和数字,不能输入中文 * 只能输入英文字母和数字,不能输入中文
*/ */
validationInput: function(str) { validationInput: function (str) {
const reg = /[^\w\.\/]/gi // eslint-disable-line const reg = /[^\w\.\/]/gi // eslint-disable-line
return reg.test(str) return reg.test(str)
}, },
...@@ -129,21 +130,21 @@ export const Util = { ...@@ -129,21 +130,21 @@ export const Util = {
/** /**
* 获取当前时间 * 获取当前时间
*/ */
getCurrentDate: function() { getCurrentDate: function () {
const time = new Date() const time = new Date()
const y = time.getFullYear() const y = time.getFullYear()
const m = time.getMonth() + 1 const m = time.getMonth() + 1
const d = time.getDate() const d = time.getDate()
return { return {
date: y + '/' + m + '/' + d date: y + '/' + m + '/' + d,
} }
}, },
/** /**
* 获取浏览器参数 * 获取浏览器参数
*/ */
getUrlParams: function(name) { getUrlParams: function (name) {
const vars = [] const vars = []
let hash let hash
const oParams = {} const oParams = {}
...@@ -166,7 +167,7 @@ export const Util = { ...@@ -166,7 +167,7 @@ export const Util = {
/** /**
* 根据当前时间,计算往后30天的日期 * 根据当前时间,计算往后30天的日期
*/ */
getAfterDate: function(day) { getAfterDate: function (day) {
const date1 = new Date() const date1 = new Date()
const date2 = new Date(date1) const date2 = new Date(date1)
let time = 30 let time = 30
...@@ -182,14 +183,14 @@ export const Util = { ...@@ -182,14 +183,14 @@ export const Util = {
date: _date, date: _date,
year: date2.getFullYear(), year: date2.getFullYear(),
month: date2.getMonth() + 1, month: date2.getMonth() + 1,
day: date2.getDate() day: date2.getDate(),
} }
}, },
/** /**
* 日期格式转换 * 日期格式转换
*/ */
dateFormate: function(str, type) { dateFormate: function (str, type) {
let txt = 'YYYY-MM-DD' let txt = 'YYYY-MM-DD'
if (type) { if (type) {
txt = type txt = type
...@@ -201,7 +202,7 @@ export const Util = { ...@@ -201,7 +202,7 @@ export const Util = {
/** /**
* 字段截取 * 字段截取
*/ */
cutStr: function(str, num) { cutStr: function (str, num) {
if (!str) { if (!str) {
return '' return ''
} }
...@@ -224,7 +225,7 @@ export const Util = { ...@@ -224,7 +225,7 @@ export const Util = {
* console.log(bar===foo) false * console.log(bar===foo) false
* @param {*} obj * @param {*} obj
*/ */
deepClone: function(obj) { deepClone: function (obj) {
// Handle the 3 simple types, and null or undefined or function // Handle the 3 simple types, and null or undefined or function
if (obj == null || typeof obj !== 'object') return obj if (obj == null || typeof obj !== 'object') return obj
// Handle Date // Handle Date
...@@ -237,7 +238,7 @@ export const Util = { ...@@ -237,7 +238,7 @@ export const Util = {
if ((obj instanceof Array) | (obj instanceof Object)) { if ((obj instanceof Array) | (obj instanceof Object)) {
const copy = obj instanceof Array ? [] : {} const copy = obj instanceof Array ? [] : {}
for (var attr in obj) { for (var attr in obj) {
if (obj.hasOwnProperty(attr)) { if (Object.prototype.hasOwnProperty.call(attr)) {
copy[attr] = Util.deepClone(obj[attr]) copy[attr] = Util.deepClone(obj[attr])
} }
} }
...@@ -250,7 +251,7 @@ export const Util = { ...@@ -250,7 +251,7 @@ export const Util = {
* url下载文件 * url下载文件
* *
*/ */
downLoadFile: function(url) { downLoadFile: function (url) {
// console.log(row) // console.log(row)
// return // return
const Temp = document.createElement('a') const Temp = document.createElement('a')
...@@ -268,7 +269,7 @@ export const Util = { ...@@ -268,7 +269,7 @@ export const Util = {
* @param {Object} type: 默认不传 ==>全部小写;传1 ==>全部大写;传2 ==>首字母大写 * @param {Object} type: 默认不传 ==>全部小写;传1 ==>全部大写;传2 ==>首字母大写
* 将json的key值进行大小写转换 * 将json的key值进行大小写转换
*/ */
jsonKeysToCase: function(json, type) { jsonKeysToCase: function (json, type) {
if (typeof json == 'object') { if (typeof json == 'object') {
var tempJson = JSON.parse(JSON.stringify(json)) var tempJson = JSON.parse(JSON.stringify(json))
toCase(tempJson) toCase(tempJson)
...@@ -280,7 +281,7 @@ export const Util = { ...@@ -280,7 +281,7 @@ export const Util = {
function toCase(json) { function toCase(json) {
if (typeof json == 'object') { if (typeof json == 'object') {
if (Array.isArray(json)) { if (Array.isArray(json)) {
json.forEach(function(item) { json.forEach(function (item) {
toCase(item) toCase(item)
}) })
} else { } else {
...@@ -314,9 +315,9 @@ export const Util = { ...@@ -314,9 +315,9 @@ export const Util = {
}, },
// 判断字段为空时显示 // 判断字段为空时显示
fieldShow: function(field, show) { fieldShow: function (field, show) {
return field || show return field || show
} },
} }
export const showModal = Util.msg export const showModal = Util.msg
......
<template> <template>
<el-dialog id="baseDialog" <el-dialog
top="30vh" id="baseDialog"
:close-on-click-modal="true" top="30vh"
:close-on-press-escape="true" :close-on-click-modal="true"
:title="dialogConfig.title" :close-on-press-escape="true"
:width="dialogConfig.width" :title="dialogConfig.title"
:visible.sync="visible" :width="dialogConfig.width"
:show-close="config.showClose" :visible.sync="visible"
class="noborder" :show-close="config.showClose"
:append-to-body="config.appendToBody"> class="noborder"
<slot></slot> :append-to-body="config.appendToBody"
<div slot="footer" >
v-if="config.isShowFooter"> <slot />
<el-button type="primary" <div
@click="confirmBtn"> slot="footer"
{{config.confirm_name}} v-if="config.isShowFooter"
>
<el-button
type="primary"
@click="confirmBtn"
>
{{ config.confirm_name }}
</el-button> </el-button>
<el-button @click="visible = false"> <el-button @click="visible = false">
{{ config.cancel_name }} {{ config.cancel_name }}
</el-button> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
export default { export default {
name: 'baseDialog', name: 'BaseDialog',
props: { props: {
dialogConfig: { dialogConfig: {
required: false, required: false,
......
...@@ -64,7 +64,7 @@ export default { ...@@ -64,7 +64,7 @@ export default {
* @param {*} btn * @param {*} btn
*/ */
const filter = btn => const filter = btn =>
mapping ? mapping[data[mapping['field']]].includes(btn.label) : true mapping ? mapping[data[mapping.field]].includes(btn.label) : true
const $store = _this.$store.getters['d2admin/auth/curBtns'] const $store = _this.$store.getters['d2admin/auth/curBtns']
if (!$store) return h('div') if (!$store) return h('div')
if (label) { if (label) {
......
<template> <template>
<div class="d2-container-card-bs"> <div class="d2-container-card-bs">
<div v-if="$slots.header" class="d2-container-card-bs__header" ref="header"> <div
<slot name="header"/> v-if="$slots.header"
</div> class="d2-container-card-bs__header"
<div class="d2-container-card-bs__body" ref="wrapper"> ref="header"
<div class="d2-container-card-bs__body-wrapper-inner"> >
<div class="d2-container-card-bs__body-card"> <slot name="header" />
<slot/> </div>
</div> <div
</div> class="d2-container-card-bs__body"
</div> ref="wrapper"
<div v-if="$slots.footer" class="d2-container-card-bs__footer" ref="footer"> >
<slot name="footer"/> <div class="d2-container-card-bs__body-wrapper-inner">
</div> <div class="d2-container-card-bs__body-card">
</div> <slot />
</template> </div>
</div>
<script> </div>
import bs from './mixins/bs' <div
export default { v-if="$slots.footer"
name: 'd2-container-card-bs', class="d2-container-card-bs__footer"
mixins: [ ref="footer"
bs >
] <slot name="footer" />
} </div>
</script> </div>
</template>
<script>
import bs from './mixins/bs'
export default {
name: 'D2ContainerCardBs',
mixins: [
bs
]
}
</script>
<template> <template>
<div class="d2-container-card"> <div class="d2-container-card">
<div v-if="$slots.header" class="d2-container-card__header" ref="header"> <div
<slot name="header"/> v-if="$slots.header"
</div> class="d2-container-card__header"
<div class="d2-container-card__body" ref="body"> ref="header"
<div class="d2-container-card__body-card"> >
<slot/> <slot name="header" />
</div> </div>
</div> <div
<div v-if="$slots.footer" class="d2-container-card__footer" ref="footer"> class="d2-container-card__body"
<slot name="footer"/> ref="body"
</div> >
</div> <div class="d2-container-card__body-card">
</template> <slot />
</div>
<script> </div>
import scroll from './mixins/normal' <div
export default { v-if="$slots.footer"
name: 'd2-container-card', class="d2-container-card__footer"
mixins: [ ref="footer"
scroll >
], <slot name="footer" />
mounted() { </div>
// 增加滚动事件监听 </div>
this.addScrollListener() </template>
},
beforeDestroy() { <script>
// 移除滚动事件监听 import scroll from './mixins/normal'
this.removeScrollListener() export default {
} name: 'D2ContainerCard',
} mixins: [
</script> scroll
],
mounted() {
// 增加滚动事件监听
this.addScrollListener()
},
beforeDestroy() {
// 移除滚动事件监听
this.removeScrollListener()
}
}
</script>
<template> <template>
<div class="d2-container-full-bs"> <div class="d2-container-full-bs">
<div v-if="$slots.header" class="d2-container-full-bs__header" ref="header"> <div
<slot name="header"/> v-if="$slots.header"
</div> class="d2-container-full-bs__header"
<div class="d2-container-full-bs__body" ref="wrapper"> ref="header"
<div class="d2-container-full-bs__body-wrapper-inner"> >
<slot/> <slot name="header" />
</div> </div>
</div> <div
<div v-if="$slots.footer" class="d2-container-full-bs__footer" ref="footer"> class="d2-container-full-bs__body"
<slot name="footer"/> ref="wrapper"
</div> >
</div> <div class="d2-container-full-bs__body-wrapper-inner">
</template> <slot />
</div>
<script> </div>
import bs from './mixins/bs' <div
export default { v-if="$slots.footer"
name: 'd2-container-card-bs', class="d2-container-full-bs__footer"
mixins: [ ref="footer"
bs >
] <slot name="footer" />
} </div>
</script> </div>
</template>
<script>
import bs from './mixins/bs'
export default {
name: 'D2ContainerCardBs',
mixins: [
bs
]
}
</script>
<template> <template>
<div class="d2-container-full"> <div class="d2-container-full">
<!-- <el-scrollbar> --> <!-- <el-scrollbar> -->
<div v-if="$slots.header" <div
class="d2-container-full__header" v-if="$slots.header"
ref="header" class="d2-container-full__header"
:class="this.active?'active':'close'"> ref="header"
:class="this.active?'active':'close'"
>
<slot name="header" /> <slot name="header" />
<d2-header-switch /> <d2-header-switch />
</div> </div>
<div class="d2-container-full__body" <div
ref="body"> class="d2-container-full__body"
ref="body"
>
<slot /> <slot />
</div> </div>
<div v-if="$slots.footer" <div
class="d2-container-full__footer" v-if="$slots.footer"
ref="footer"> class="d2-container-full__footer"
ref="footer"
>
<slot name="footer" /> <slot name="footer" />
</div> </div>
<!-- </el-scrollbar> --> <!-- </el-scrollbar> -->
...@@ -24,7 +30,7 @@ ...@@ -24,7 +30,7 @@
<script> <script>
import scroll from './mixins/normal' import scroll from './mixins/normal'
export default { export default {
name: 'd2-container-full', name: 'D2ContainerFull',
mixins: [scroll], mixins: [scroll],
components: { components: {
d2HeaderSwitch: () => import('./d2-header-switch.vue') d2HeaderSwitch: () => import('./d2-header-switch.vue')
......
<template> <template>
<div class="d2-container-ghost-bs"> <div class="d2-container-ghost-bs">
<div v-if="$slots.header" class="d2-container-ghost-bs__header" ref="header"> <div
<slot name="header"/> v-if="$slots.header"
</div> class="d2-container-ghost-bs__header"
<div class="d2-container-ghost-bs__body" ref="wrapper"> ref="header"
<div> >
<slot/> <slot name="header" />
</div> </div>
</div> <div
<div v-if="$slots.footer" class="d2-container-ghost-bs__footer" ref="footer"> class="d2-container-ghost-bs__body"
<slot name="footer"/> ref="wrapper"
</div> >
</div> <div>
</template> <slot />
</div>
<script> </div>
import bs from './mixins/bs' <div
export default { v-if="$slots.footer"
name: 'd2-container-card-bs', class="d2-container-ghost-bs__footer"
mixins: [ ref="footer"
bs >
] <slot name="footer" />
} </div>
</script> </div>
</template>
<script>
import bs from './mixins/bs'
export default {
name: 'D2ContainerCardBs',
mixins: [
bs
]
}
</script>
<template> <template>
<div class="d2-container-ghost"> <div class="d2-container-ghost">
<div v-if="$slots.header" class="d2-container-ghost__header" ref="header"> <div
<slot name="header"/> v-if="$slots.header"
</div> class="d2-container-ghost__header"
<div class="d2-container-ghost__body" ref="body"> ref="header"
<slot/> >
</div> <slot name="header" />
<div v-if="$slots.footer" class="d2-container-ghost__footer" ref="footer"> </div>
<slot name="footer"/> <div
</div> class="d2-container-ghost__body"
</div> ref="body"
</template> >
<slot />
<script> </div>
import scroll from './mixins/normal' <div
export default { v-if="$slots.footer"
name: 'd2-container-ghost', class="d2-container-ghost__footer"
mixins: [ ref="footer"
scroll >
], <slot name="footer" />
mounted() { </div>
// 增加滚动事件监听 </div>
this.addScrollListener() </template>
},
beforeDestroy() { <script>
// 移除滚动事件监听 import scroll from './mixins/normal'
this.removeScrollListener() export default {
} name: 'D2ContainerGhost',
} mixins: [
</script> scroll
],
mounted() {
// 增加滚动事件监听
this.addScrollListener()
},
beforeDestroy() {
// 移除滚动事件监听
this.removeScrollListener()
}
}
</script>
<template> <template>
<div v-if="show" <div
class="d2-header-switch" v-if="show"
:class="{ 'd2-header-switch--active': isActive }" class="d2-header-switch"
@click="handleClick"> :class="{ 'd2-header-switch--active': isActive }"
@click="handleClick"
>
<d2-el-icon :name="name" /> <d2-el-icon :name="name" />
<li :class="$store.state.d2admin.tsearch.active?'fa fa-compress':'fa fa-expand'"></li> <li :class="$store.state.d2admin.tsearch.active?'fa fa-compress':'fa fa-expand'" />
</div> </div>
</template> </template>
......
<template> <template>
<div <div
v-if="show" v-if="show"
class="d2-source" class="d2-source"
:class="{ 'd2-source--active': isActive }" :class="{ 'd2-source--active': isActive }"
@click="handleClick"> @click="handleClick"
<d2-icon name="code"/> 本页源码 >
</div> <d2-icon name="code" /> 本页源码
</template> </div>
</template>
<script>
export default { <script>
data() { export default {
return { data() {
isActive: false, return {
path: '' isActive: false,
} path: ''
}, }
computed: { },
show() { computed: {
return process.env.VUE_APP_BUILD_MODE === 'TRAVIS' || process.env.NODE_ENV === 'development' show() {
} return process.env.VUE_APP_BUILD_MODE === 'TRAVIS' || process.env.NODE_ENV === 'development'
}, }
watch: { },
$route: { watch: {
handler(to) { $route: {
this.path = _.get(_.last(to.matched), 'components.default.__source') handler(to) {
}, this.path = _.get(_.last(to.matched), 'components.default.__source')
immediate: true },
} immediate: true
}, }
mounted() { },
// 一秒后显示按钮 mounted() {
setTimeout(() => { // 一秒后显示按钮
this.isActive = true setTimeout(() => {
}, 500) this.isActive = true
}, }, 500)
methods: { },
// 点击按钮的时候跳转到源代码 methods: {
handleClick() { // 点击按钮的时候跳转到源代码
this.$open(`${process.env.VUE_APP_REPO}/blob/master/${this.path}`) handleClick() {
} this.$open(`${process.env.VUE_APP_REPO}/blob/master/${this.path}`)
} }
} }
</script> }
</script>
<style lang="scss" scoped>
.d2-source { <style lang="scss" scoped>
$borderRadius: 4px; .d2-source {
$paddingLR: 15px; $borderRadius: 4px;
$paddingTB: 7px; $paddingLR: 15px;
$fontSize: 12px; $paddingTB: 7px;
$rightOuter: $paddingLR / 2; $fontSize: 12px;
opacity: 0; $rightOuter: $paddingLR / 2;
position: fixed; opacity: 0;
z-index: 9999; position: fixed;
right: - $borderRadius - $rightOuter; z-index: 9999;
bottom: 20px; right: - $borderRadius - $rightOuter;
font-size: $fontSize; bottom: 20px;
line-height: $fontSize; font-size: $fontSize;
font-weight: bold; line-height: $fontSize;
border-radius: $borderRadius; font-weight: bold;
padding: $paddingTB $paddingLR; border-radius: $borderRadius;
padding-right: $borderRadius + $paddingLR; padding: $paddingTB $paddingLR;
background-color: rgba(#000, .7); padding-right: $borderRadius + $paddingLR;
border: 1px solid #000; background-color: rgba(#000, .7);
color: #FFF; border: 1px solid #000;
transition: all .3s; color: #FFF;
@extend %unable-select; transition: all .3s;
&.d2-source--active { @extend %unable-select;
opacity: 1; &.d2-source--active {
} opacity: 1;
&:hover { }
right: - $borderRadius; &:hover {
background-color: rgba(#000, .9); right: - $borderRadius;
} background-color: rgba(#000, .9);
} }
</style> }
</style>
// 组件 // 组件
import d2ContainerFull from './components/d2-container-full.vue' import d2ContainerFull from './components/d2-container-full.vue'
import d2ContainerFullBs from './components/d2-container-full-bs.vue' import d2ContainerFullBs from './components/d2-container-full-bs.vue'
import d2ContainerGhost from './components/d2-container-ghost.vue' import d2ContainerGhost from './components/d2-container-ghost.vue'
import d2ContainerGhostBs from './components/d2-container-ghost-bs.vue' import d2ContainerGhostBs from './components/d2-container-ghost-bs.vue'
import d2ContainerCard from './components/d2-container-card.vue' import d2ContainerCard from './components/d2-container-card.vue'
import d2ContainerCardBs from './components/d2-container-card-bs.vue' import d2ContainerCardBs from './components/d2-container-card-bs.vue'
// import d2Source from './components/d2-source.vue' // import d2Source from './components/d2-source.vue'
export default { export default {
name: 'd2-container', name: 'd2-container',
props: { props: {
// 容器样式 // 容器样式
type: { type: {
type: String, type: String,
required: false, required: false,
default: 'full' default: 'full'
}, },
// 滚动优化 // 滚动优化
betterScroll: { betterScroll: {
type: Boolean, type: Boolean,
required: false, required: false,
default: false default: false
} }
}, },
computed: { computed: {
// 始终返回渲染组件 // 始终返回渲染组件
component() { component() {
if (this.type === 'card' && !this.betterScroll) return d2ContainerCard if (this.type === 'card' && !this.betterScroll) return d2ContainerCard
if (this.type === 'card' && this.betterScroll) return d2ContainerCardBs if (this.type === 'card' && this.betterScroll) return d2ContainerCardBs
if (this.type === 'ghost' && !this.betterScroll) return d2ContainerGhost if (this.type === 'ghost' && !this.betterScroll) return d2ContainerGhost
if (this.type === 'ghost' && this.betterScroll) return d2ContainerGhostBs if (this.type === 'ghost' && this.betterScroll) return d2ContainerGhostBs
if (this.type === 'full' && !this.betterScroll) return d2ContainerFull if (this.type === 'full' && !this.betterScroll) return d2ContainerFull
if (this.type === 'full' && this.betterScroll) return d2ContainerFullBs if (this.type === 'full' && this.betterScroll) return d2ContainerFullBs
else { else {
return 'div' return 'div'
} }
} }
}, },
render(h) { render(h) {
const slots = [ this.$slots.default ] const slots = [this.$slots.default]
if (this.$slots.header) slots.push(h('template', { slot: 'header' }, [ this.$slots.header ])) if (this.$slots.header) slots.push(h('template', { slot: 'header' }, [this.$slots.header]))
if (this.$slots.footer) slots.push(h('template', { slot: 'footer' }, [ this.$slots.footer ])) if (this.$slots.footer) slots.push(h('template', { slot: 'footer' }, [this.$slots.footer]))
return h('div', { return h('div', {
ref: 'container', ref: 'container',
class: 'container-component' class: 'container-component'
}, [ }, [
h(this.component, { h(this.component, {
ref: 'component', ref: 'component',
props: this.$attrs, props: this.$attrs,
on: { on: {
scroll: e => this.$emit('scroll', e) scroll: e => this.$emit('scroll', e)
} }
}, slots) }, slots)
// h(d2Source) // h(d2Source)
]) ])
}, },
methods: { methods: {
// 返回顶部 // 返回顶部
scrollToTop() { scrollToTop() {
this.$refs.component.scrollToTop() this.$refs.component.scrollToTop()
// 如果开启了 better scroll 还需要手动触发一遍 scroll 事件 // 如果开启了 better scroll 还需要手动触发一遍 scroll 事件
const bs = this.$refs.component.BS const bs = this.$refs.component.BS
if (bs) this.$refs.component.scroll() if (bs) this.$refs.component.scroll()
}, },
// 用法同原生方法 scrollBy // 用法同原生方法 scrollBy
scrollBy(x = 0, y = 0, time = 300) { scrollBy(x = 0, y = 0, time = 300) {
if (this.betterScroll) { if (this.betterScroll) {
const bs = this.$refs.component.BS const bs = this.$refs.component.BS
if (bs) { if (bs) {
bs.scrollBy(-x, -y, time) bs.scrollBy(-x, -y, time)
// 手动触发一遍 scroll 事件 // 手动触发一遍 scroll 事件
this.$refs.component.scroll() this.$refs.component.scroll()
} }
} else { } else {
this.$refs.component.$refs.body.scrollBy(x, y) this.$refs.component.$refs.body.scrollBy(x, y)
} }
}, },
// 用法同原生方法 scrollTo // 用法同原生方法 scrollTo
scrollTo(x = 0, y = 0, time = 300) { scrollTo(x = 0, y = 0, time = 300) {
if (this.betterScroll) { if (this.betterScroll) {
const bs = this.$refs.component.BS const bs = this.$refs.component.BS
if (bs) { if (bs) {
bs.scrollTo(-x, -y, time) bs.scrollTo(-x, -y, time)
// 手动触发一遍 scroll 事件 // 手动触发一遍 scroll 事件
this.$refs.component.scroll() this.$refs.component.scroll()
} }
} else { } else {
this.$refs.component.$refs.body.scrollTo(x, y) this.$refs.component.$refs.body.scrollTo(x, y)
} }
}, },
// 用法同原生方法 scrollTop // 用法同原生方法 scrollTop
scrollTop(top = 0, time = 300) { scrollTop(top = 0, time = 300) {
if (this.betterScroll) { if (this.betterScroll) {
const bs = this.$refs.component.BS const bs = this.$refs.component.BS
if (bs) { if (bs) {
bs.scrollTo(bs.x, -top, time) bs.scrollTo(bs.x, -top, time)
// 手动触发一遍 scroll 事件 // 手动触发一遍 scroll 事件
this.$refs.component.scroll() this.$refs.component.scroll()
} }
} else { } else {
this.$refs.component.$refs.body.scrollTop = top this.$refs.component.$refs.body.scrollTop = top
} }
} }
} }
} }
<!-- 弹窗 --> <!-- 弹窗 -->
<template> <template>
<div> <div>
<el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="isVisible" :visible.sync="isVisible"
:show-close="showClose" :show-close="showClose"
:before-close="handleClose" :before-close="handleClose"
:close-on-click-modal="false" :close-on-click-modal="false"
:width="width" :width="width"
> >
<span slot="title"> <span slot="title">
{{title}} {{ title }}
<span class="dialog-sub-title"> <span class="dialog-sub-title">
<slot name="sub-title"></slot> <slot name="sub-title" />
</span> </span>
</span> </span>
<slot></slot> <slot />
<div slot="footer"> <div slot="footer">
<slot name="btn-start"></slot> <slot name="btn-start" />
<el-button <el-button
type="primary" type="primary"
@click="handleConfirm" @click="handleConfirm"
:loading="$store.state.d2admin.loading.value" :loading="$store.state.d2admin.loading.value"
>{{btnOkLabel}}</el-button> >
<el-button {{ btnOkLabel }}
v-if="!noCancel" </el-button>
@click="handleClose" <el-button
>取消</el-button> v-if="!noCancel"
<slot name="btn-middle"></slot> @click="handleClose"
</div> >
</el-dialog> 取消
</div> </el-button>
</template> <slot name="btn-middle" />
</div>
<script> </el-dialog>
export default { </div>
name: 'd2-dialog', </template>
data() {
return { <script>
} export default {
}, name: 'D2Dialog',
props: { data() {
title: { return {
type: String, }
default: '' },
}, props: {
isVisible: { title: {
type: Boolean, type: String,
default: false default: ''
}, },
showClose: { isVisible: {
type: Boolean, type: Boolean,
default: true default: false
}, },
btnOkLabel: { showClose: {
type: String, type: Boolean,
default: '确定' default: true
}, },
noCancel: { btnOkLabel: {
type: Boolean, type: String,
default: false default: '确定'
}, },
width: { noCancel: {
type: String, type: Boolean,
default: '580px' default: false
} },
}, width: {
type: String,
methods: { default: '580px'
handleClose() { }
this.$emit('closeDialog') },
},
handleConfirm() { methods: {
this.$emit('confirmDialog') handleClose() {
} this.$emit('closeDialog')
} },
} handleConfirm() {
this.$emit('confirmDialog')
</script> }
<style scoped> }
.dialog-sub-title { }
font-size: 12px;
color: #666666; </script>
} <style scoped>
</style> .dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
<template> <template>
<i :class="`el-icon-${name}`" aria-hidden="true"></i> <i
</template> :class="`el-icon-${name}`"
aria-hidden="true"
<script> />
export default { </template>
name: 'd2-el-icon',
props: { <script>
name: { export default {
type: String, name: 'D2ElIcon',
required: false, props: {
default: '' name: {
} type: String,
} required: false,
} default: ''
</script> }
}
}
</script>
<!-- 编辑商品弹窗 --> <!-- 编辑商品弹窗 -->
<template> <template>
<d2-dialog title="添加绑定升级商品" <d2-dialog
:isVisible.sync="relateProVisible" title="添加绑定升级商品"
btnOkLabel="关联" :is-visible.sync="relateProVisible"
width="950px" btn-ok-label="关联"
@confirmDialog="handleRelateProConfirm" width="950px"
@closeDialog="handleRelateProClose" @confirmDialog="handleRelateProConfirm"
class="relatePro"> @closeDialog="handleRelateProClose"
class="relatePro"
>
<div class="relateProDialog flex"> <div class="relateProDialog flex">
<img v-show="proInfo.thumbUrl" <img
:src="proInfo.thumbUrl" /> v-show="proInfo.thumbUrl"
<img v-show="!proInfo.thumbUrl" :src="proInfo.thumbUrl"
src="./image/no-choice.png" /> >
<el-form :model="proInfo" <img
:rules="rules" v-show="!proInfo.thumbUrl"
label-width="110px" src="./image/no-choice.png"
ref="proRuleForm1" >
style="width: calc(100% - 180px);"> <el-form
:model="proInfo"
:rules="rules"
label-width="110px"
ref="proRuleForm1"
style="width: calc(100% - 180px);"
>
<div class="w-50"> <div class="w-50">
<el-form-item label="选择产品" <el-form-item
prop="goodsCode"> label="选择产品"
<el-select style="width: 98%;" prop="goodsCode"
v-model="proInfo.goodsCode" >
placeholder="请选择一款作为升级商品" <el-select
value-key="goodsCode" style="width: 98%;"
filterable v-model="proInfo.goodsCode"
@change="handleChangeGood"> placeholder="请选择一款作为升级商品"
<el-option v-for="item in proList" value-key="goodsCode"
:key="item.goodsCode" filterable
:label="item.goodsName" @change="handleChangeGood"
:value="item.goodsCode" >
:disabled="item.disabled"></el-option> <el-option
v-for="item in proList"
:key="item.goodsCode"
:label="item.goodsName"
:value="item.goodsCode"
:disabled="item.disabled"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item label="分类"> <el-form-item label="分类">
<el-input disabled <el-input
placeholder="分类" disabled
:value="proInfo.goodsTypeName" placeholder="分类"
class="dis-in-block"></el-input> :value="proInfo.goodsTypeName"
class="dis-in-block"
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50" />
</div>
<div class="w-50"> <div class="w-50">
<el-form-item label="编号"> <el-form-item label="编号">
<el-input disabled <el-input
placeholder="编号" disabled
:value="proInfo.sapCode" placeholder="编号"
class="dis-in-block"></el-input> :value="proInfo.sapCode"
class="dis-in-block"
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item label="产品成本" <el-form-item
prop="shopPrice"> label="产品成本"
<el-input v-model="proInfo.shopPrice" prop="shopPrice"
placeholder="请输入建议产品成本" >
class="dis-in-block" <el-input
@input="handleShopPrice" v-model="proInfo.shopPrice"
@blur="handleShopPriceBlur"> placeholder="请输入建议产品成本"
<i slot="suffix" class="dis-in-block"
class="suffix">元</i> @input="handleShopPrice"
@blur="handleShopPriceBlur"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item label="建议升级价格" <el-form-item
prop="upgradePrice"> label="建议升级价格"
<el-input v-model="proInfo.upgradePrice" prop="upgradePrice"
placeholder="请输入建议升级价格" >
class="dis-in-block" <el-input
@input="handleUpgradePrice"> v-model="proInfo.upgradePrice"
<i slot="suffix" placeholder="请输入建议升级价格"
class="suffix">元</i> class="dis-in-block"
@input="handleUpgradePrice"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50"> <div class="w-50">
<el-form-item label="商品最低价" <el-form-item
prop="shopMinPrice"> label="商品最低价"
<el-input v-model="proInfo.shopMinPrice" prop="shopMinPrice"
placeholder="请输入商品最低价" >
class="dis-in-block" <el-input
@input="handleShopMinPrice"> v-model="proInfo.shopMinPrice"
<i slot="suffix" placeholder="请输入商品最低价"
class="suffix">元</i> class="dis-in-block"
@input="handleShopMinPrice"
>
<i
slot="suffix"
class="suffix"
>元</i>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="w-50" <div
v-show="warrantyProList.includes(proInfo.goodsType)"> class="w-50"
<el-form-item label="质保年限" v-show="warrantyProList.includes(proInfo.goodsType)"
prop="warrantyPeriod"> >
<el-select style="width: 98%;" <el-form-item
:class="{ 'select-suffix': !!proInfo.warrantyPeriod }" label="质保年限"
v-model="proInfo.warrantyPeriod"> prop="warrantyPeriod"
<el-option v-for="item in warrantyPeriodList" >
:key="item.confId" <el-select
:label="item.confLabel" style="width: 98%;"
:value="item.confId"></el-option> :class="{ 'select-suffix': !!proInfo.warrantyPeriod }"
v-model="proInfo.warrantyPeriod"
>
<el-option
v-for="item in warrantyPeriodList"
:key="item.confId"
:label="item.confLabel"
:value="item.confId"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
...@@ -112,7 +155,7 @@ ...@@ -112,7 +155,7 @@
import _ from 'lodash' import _ from 'lodash'
import { limitPrice } from '@/common/constants' import { limitPrice } from '@/common/constants'
export default { export default {
name: 'relateProDialog', name: 'RelateProDialog',
data() { data() {
return { return {
goodVal: {}, goodVal: {},
......
<template> <template>
<svg aria-hidden="true"> <svg aria-hidden="true">
<use :xlink:href="icon"></use> <use :xlink:href="icon" />
</svg> </svg>
</template> </template>
<script> <script>
export default { export default {
name: 'd2-icon-svg', name: 'D2IconSvg',
props: { props: {
name: { name: {
type: String, type: String,
required: true required: true
} }
}, },
computed: { computed: {
icon() { icon() {
return `#d2-${this.name}` return `#d2-${this.name}`
} }
} }
} }
</script> </script>
<template> <template>
<i class="fa" :class="`fa-${name}`" aria-hidden="true"></i> <i
</template> class="fa"
:class="`fa-${name}`"
<script> aria-hidden="true"
import './font-awesome-4.7.0/css/font-awesome.min.css' />
export default { </template>
name: 'd2-icon',
props: { <script>
name: { import './font-awesome-4.7.0/css/font-awesome.min.css'
type: String, export default {
required: false, name: 'D2Icon',
default: 'font-awesome' props: {
} name: {
} type: String,
} required: false,
</script> default: 'font-awesome'
}
}
}
</script>
<template> <template>
<el-row class="table-header"> <el-row class="table-header">
<el-col :span="leftSpan"> <el-col :span="leftSpan">
<span v-text="title"></span> <span v-text="title" />
<slot name="left"></slot> <slot name="left" />
</el-col> </el-col>
<el-col :span="24 - leftSpan"> <el-col :span="24 - leftSpan">
<slot></slot> <slot />
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
<script> <script>
export default { export default {
name: 'd2-teble-header', name: 'D2TebleHeader',
props: { props: {
title: { title: {
type: String, type: String,
......
<!-- 表格头部搜索 --> <!-- 表格头部搜索 -->
<template> <template>
<el-popover <el-popover
placement="bottom" placement="bottom"
title="" title=""
width="150" width="150"
trigger="click" trigger="click"
v-model="isPopoverVisible" v-model="isPopoverVisible"
> >
<block> <block>
<p class="flex"> <p class="flex">
<el-checkbox <el-checkbox
:indeterminate="isIndeterminate" :indeterminate="isIndeterminate"
v-model="checkAll" v-model="checkAll"
@change="handleCheckAllChange" @change="handleCheckAllChange"
>全选</el-checkbox> >
<el-button 全选
@click="handleConfirm" </el-checkbox>
type="text" <el-button
>确定</el-button> @click="handleConfirm"
</p> type="text"
<el-checkbox-group >
v-model="checkedList" 确定
@change="handleCheckedChange" </el-button>
> </p>
<el-checkbox <el-checkbox-group
v-for="item in baseData[optionConfig.searchItemName]" v-model="checkedList"
:label="item[optionConfig.optionId]" @change="handleCheckedChange"
:key="item[optionConfig.optionId]" >
@change="handleCheckedChange" <el-checkbox
>{{item[optionConfig.optionLabel]}}</el-checkbox> v-for="item in baseData[optionConfig.searchItemName]"
</el-checkbox-group> :label="item[optionConfig.optionId]"
</block> :key="item[optionConfig.optionId]"
<img @change="handleCheckedChange"
slot="reference" >
class="head-search" {{ item[optionConfig.optionLabel] }}
src="./image/search.png" </el-checkbox>
@click="handleOpen" </el-checkbox-group>
/> </block>
</el-popover> <img
</template> slot="reference"
class="head-search"
<script> src="./image/search.png"
import _ from 'lodash' @click="handleOpen"
export default { >
name: 'TableHeadSearch', </el-popover>
data() { </template>
return {
isPopoverVisible: false, <script>
checkAll: false, import _ from 'lodash'
checkedList: [], export default {
isIndeterminate: false name: 'TableHeadSearch',
} data() {
}, return {
isPopoverVisible: false,
props: { checkAll: false,
// 原来的model值 checkedList: [],
searchForm: { isIndeterminate: false
type: Array, }
default: () => { } },
},
optionConfig: { props: {
type: Object, // 原来的model值
default: () => { } searchForm: {
}, type: Array,
// 多选列表 default: () => { }
// optionList: { },
// type: Array, optionConfig: {
// default: () => [] type: Object,
// }, default: () => { }
// 多选列表Obj },
baseData: { // 多选列表
type: Object, // optionList: {
default: () => { } // type: Array,
} // default: () => []
}, // },
// 多选列表Obj
methods: { baseData: {
handleOpen() { type: Object,
this.checkedList = _.cloneDeep(this.searchForm[this.optionConfig.searchItemName]) default: () => { }
this.handleCheckedChange(this.checkedList) }
this.$nextTick() },
},
methods: {
handleCheckedChange(value) { handleOpen() {
const checkedCount = value.length this.checkedList = _.cloneDeep(this.searchForm[this.optionConfig.searchItemName])
this.checkAll = checkedCount === this.baseData[this.optionConfig.searchItemName].length this.handleCheckedChange(this.checkedList)
this.isIndeterminate = checkedCount > 0 && checkedCount < this.baseData[this.optionConfig.searchItemName].length this.$nextTick()
}, },
handleCheckAllChange(val) { handleCheckedChange(value) {
this.checkedList = val ? this.baseData[this.optionConfig.searchItemName].map(item => item[this.optionConfig.optionId]) : [] const checkedCount = value.length
this.isIndeterminate = false this.checkAll = checkedCount === this.baseData[this.optionConfig.searchItemName].length
}, this.isIndeterminate = checkedCount > 0 && checkedCount < this.baseData[this.optionConfig.searchItemName].length
},
handleConfirm() {
this.isPopoverVisible = false handleCheckAllChange(val) {
this.$emit('handleTableHeadChange', { searchItemName: this.optionConfig.searchItemName, checkedList: this.checkedList }) this.checkedList = val ? this.baseData[this.optionConfig.searchItemName].map(item => item[this.optionConfig.optionId]) : []
} this.isIndeterminate = false
} },
}
handleConfirm() {
</script> this.isPopoverVisible = false
<style scoped> this.$emit('handleTableHeadChange', { searchItemName: this.optionConfig.searchItemName, checkedList: this.checkedList })
.flex { }
justify-content: space-between; }
} }
.head-search {
width: 12px; </script>
height: 12px; <style scoped>
} .flex {
</style> justify-content: space-between;
}
.head-search {
width: 12px;
height: 12px;
}
</style>
<!-- 表格+分页 --> <!-- 表格+分页 -->
<template> <template>
<div class="d2-table"> <div class="d2-table">
<el-table :ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'" <el-table
:data="getListApi ? data : tableData" :ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'"
:row-key="tableParams.mutiSelectUniqueKey || ''" :data="getListApi ? data : tableData"
v-loading="loading" :row-key="tableParams.mutiSelectUniqueKey || ''"
border v-loading="loading"
:highlight-current-row="true" border
@sort-change="sortChange" :highlight-current-row="true"
@selection-change="handleSelect" @sort-change="sortChange"
:tree-props="{children: 'upgradeGoodsList'}"> @selection-change="handleSelect"
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName" :tree-props="{children: 'upgradeGoodsList'}"
type="selection" >
width="55" <el-table-column
:reserve-selection="true"> v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
</el-table-column> type="selection"
<el-table-column v-if="hasNum" width="55"
align="center" :reserve-selection="true"
width="60px" />
label="序号" <el-table-column
type='index' v-if="hasNum"
:index="index=>index+(pagination.currentPage - 1) * pagination.pageSize + 1"> align="center"
</el-table-column> width="60px"
<el-table-column v-for="(item, index) in tableParams.tableColumns" label="序号"
:key="index" type="index"
:label="item.label" :index="index=>index+(pagination.currentPage - 1) * pagination.pageSize + 1"
:prop="item.prop" />
:width="item.width" <el-table-column
:min-width="item.minWidth" v-for="(item, index) in tableParams.tableColumns"
:align="item.align||'center'" :key="index"
:sortable="item.sortable"> :label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align||'center'"
:sortable="item.sortable"
>
<template slot="header"> <template slot="header">
<span>{{item.label}}</span> <span>{{ item.label }}</span>
<table-head-search v-if="item.optionConfig" <table-head-search
:searchForm="headSearchForm" v-if="item.optionConfig"
:optionConfig="item.optionConfig" :search-form="headSearchForm"
:baseData="baseData" :option-config="item.optionConfig"
@handleTableHeadChange="handleTableHeadChange"></table-head-search> :base-data="baseData"
@handleTableHeadChange="handleTableHeadChange"
/>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
<slot v-if="item.addHtml" <slot
:name="item.addHtml" v-if="item.addHtml"
:scope="scope.row" :name="item.addHtml"
:prop="item.prop" :scope="scope.row"
:width="item.width"></slot> :prop="item.prop"
:width="item.width"
/>
<template v-else-if="item.tagLabel"> <template v-else-if="item.tagLabel">
<el-tag v-if="!item.tagName" <el-tag
:type="tableParams.tag.type[scope.row[item.prop]]" v-if="!item.tagName"
v-text="tableParams.tag.label[scope.row[item.prop]]"> :type="tableParams.tag.type[scope.row[item.prop]]"
</el-tag> v-text="tableParams.tag.label[scope.row[item.prop]]"
<el-tag v-else />
:type="tableParams[item.tagName].type[scope.row[item.prop]]" <el-tag
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"></el-tag> v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"
/>
</template> </template>
<template v-else-if="item.formatter"> <template v-else-if="item.formatter">
<span v-if="item.html" <span
v-html="item.formatter(scope.row)"></span> v-if="item.html"
v-html="item.formatter(scope.row)"
/>
<template v-if="!item.html"> <template v-if="!item.html">
<span :class="item.className?item.className(scope.row):''"></span> <span :class="item.className?item.className(scope.row):''" />
<span v-text="item.formatter(scope.row)"></span> <span v-text="item.formatter(scope.row)" />
</template> </template>
</template> </template>
<template v-else-if="getListApi"> <template v-else-if="getListApi">
<span v-if="item.prefix">{{item.prefix}}</span> <span v-if="item.prefix">{{ item.prefix }}</span>
<span <span
v-if="item.parentProp">{{scope.row[item.parentProp] ? scope.row[item.parentProp][item.prop] : ''}}</span> v-if="item.parentProp"
<span v-else>{{scope.row[item.prop]}}</span> >{{ scope.row[item.parentProp] ? scope.row[item.parentProp][item.prop] : '' }}</span>
<span v-else>{{ scope.row[item.prop] }}</span>
</template> </template>
<template v-else> <template v-else>
<span v-text="tableData[scope.$index][item.prop]"></span> <span v-text="tableData[scope.$index][item.prop]" />
</template> </template>
<template v-if="item.addSymbol"> <template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span> <span v-text="item.addSymbol" />
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="tableParams.tableOption" <el-table-column
label="操作" v-if="tableParams.tableOption"
fixed="right" label="操作"
:align="tableParams.tableOption.align||'center'" fixed="right"
:width="tableParams.tableOption.width||'auto'"> :align="tableParams.tableOption.align||'center'"
:width="tableParams.tableOption.width||'auto'"
>
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="auth-button" <slot
:scope="scope.row"></slot> name="auth-button"
<slot name="auth-button-other" :scope="scope.row"
:scope="scope.row"></slot> />
<slot
name="auth-button-other"
:scope="scope.row"
/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination v-if="hasPage" <el-pagination
background v-if="hasPage"
@size-change="handleSizeChange" background
@current-change="handleCurrentChange" @size-change="handleSizeChange"
:current-page="page.currentPage" @current-change="handleCurrentChange"
:page-sizes="[10,20,30,40]" :current-page="page.currentPage"
:page-size="page.pageSize" :page-sizes="[10,20,30,40]"
:total="getListApi ? total : tableTotal" :page-size="page.pageSize"
:layout="layout"> :total="getListApi ? total : tableTotal"
</el-pagination> :layout="layout"
/>
</div> </div>
</template> </template>
<script> <script>
import TableHeadSearch from './TableHeadSearch' import TableHeadSearch from './TableHeadSearch'
export default { export default {
name: 'd2-table', name: 'D2Table',
data() { data() {
return { return {
loading: false, loading: false,
......
...@@ -4,16 +4,16 @@ import d2Container from './d2-container' ...@@ -4,16 +4,16 @@ import d2Container from './d2-container'
import authButton from './d2-auth/d2-auth-btn.js' import authButton from './d2-auth/d2-auth-btn.js'
// 注意 有些组件使用异步加载会有影响 // 注意 有些组件使用异步加载会有影响
Vue.component('d2-container', d2Container) Vue.component('D2Container', d2Container)
Vue.component('d2-icon', () => import('./d2-icon')) Vue.component('D2Icon', () => import('./d2-icon'))
Vue.component('d2-el-icon', () => import('./d2-el-icon')) Vue.component('D2ElIcon', () => import('./d2-el-icon'))
Vue.component('d2-icon-svg', () => import('./d2-icon-svg/index.vue')) Vue.component('D2IconSvg', () => import('./d2-icon-svg/index.vue'))
Vue.component('d2-table-header', () => import('./d2-table-header/index.vue')) Vue.component('D2TableHeader', () => import('./d2-table-header/index.vue'))
Vue.component('d2-table', () => import('./d2-table/index.vue')) Vue.component('D2Table', () => import('./d2-table/index.vue'))
Vue.component('d2-dialog', () => import('./d2-dialog/index.vue')) Vue.component('D2Dialog', () => import('./d2-dialog/index.vue'))
Vue.component('d2-form', () => import('./d2-form/index.vue')) Vue.component('D2Form', () => import('./d2-form/index.vue'))
Vue.component('d2-search', () => import('./d2-search/index.vue')) Vue.component('D2Search', () => import('./d2-search/index.vue'))
Vue.component('relateStoreDialog', () => Vue.component('RelateStoreDialog', () =>
import('./d2-form/relateStoreDialog.vue') import('./d2-form/relateStoreDialog.vue')
) )
// Vue.component([authButton.name], authButton) // Vue.component([authButton.name], authButton)
......
<template> <template>
<div <div
class="d2-contentmenu-list" class="d2-contentmenu-list"
@click="rowClick"> @click="rowClick"
<div >
v-for="item in menulist" <div
:key="item.value" v-for="item in menulist"
:data-value="item.value" :key="item.value"
class="d2-contentmenu-item" :data-value="item.value"
flex="cross:center main:center"> class="d2-contentmenu-item"
<d2-el-icon flex="cross:center main:center"
v-if="item.icon" >
:name="item.icon"/> <d2-el-icon
<div v-if="item.icon"
class="d2-contentmenu-item-title" :name="item.icon"
flex-box="1" />
v-text="item.title"> <div
</div> class="d2-contentmenu-item-title"
</div> flex-box="1"
</div> v-text="item.title"
</template> />
</div>
<script> </div>
export default { </template>
name: 'd2-contextmenu-list',
props: { <script>
menulist: { export default {
type: Array, name: 'D2ContextmenuList',
default: () => [] props: {
} menulist: {
}, type: Array,
methods: { default: () => []
rowClick(event) { }
let target = event.target },
while (!target.dataset.value) { methods: {
target = target.parentNode rowClick(event) {
} let target = event.target
this.$emit('rowClick', target.dataset.value) while (!target.dataset.value) {
} target = target.parentNode
} }
} this.$emit('rowClick', target.dataset.value)
</script> }
}
<style lang="scss"> }
.d2-contentmenu-list { </script>
.d2-contentmenu-item {
padding: 8px 20px 8px 15px; <style lang="scss">
margin: 0; .d2-contentmenu-list {
font-size: 14px; .d2-contentmenu-item {
color: #606266; padding: 8px 20px 8px 15px;
cursor: pointer; margin: 0;
&:hover { font-size: 14px;
background: #ecf5ff; color: #606266;
color: #66b1ff; cursor: pointer;
} &:hover {
.d2-contentmenu-item-title { background: #ecf5ff;
margin-left: 10px; color: #66b1ff;
} }
} .d2-contentmenu-item-title {
} margin-left: 10px;
</style> }
}
}
</style>
<template> <template>
<div <div
class="d2-contextmenu" class="d2-contextmenu"
v-show="flag" v-show="flag"
:style="style"> :style="style"
<slot/> >
</div> <slot />
</template> </div>
</template>
<script>
export default { <script>
name: 'd2-contextmenu', export default {
props: { name: 'D2Contextmenu',
visible: { props: {
type: Boolean, visible: {
default: false type: Boolean,
}, default: false
x: { },
type: Number, x: {
default: 0 type: Number,
}, default: 0
y: { },
type: Number, y: {
default: 0 type: Number,
} default: 0
}, }
computed: { },
flag: { computed: {
get() { flag: {
if (this.visible) { get() {
// 注册全局监听事件 [ 目前只考虑鼠标解除触发 ] if (this.visible) {
window.addEventListener('mousedown', this.watchContextmenu) // 注册全局监听事件 [ 目前只考虑鼠标解除触发 ]
} window.addEventListener('mousedown', this.watchContextmenu)
return this.visible }
}, return this.visible
set(newVal) { },
this.$emit('update:visible', newVal) set(newVal) {
} this.$emit('update:visible', newVal)
}, }
style() { },
return { style() {
left: this.x + 'px', return {
top: this.y + 'px', left: this.x + 'px',
display: this.visible ? 'block' : 'none ' top: this.y + 'px',
} display: this.visible ? 'block' : 'none '
} }
}, }
methods: { },
watchContextmenu(event) { methods: {
if (!this.$el.contains(event.target) || event.button !== 0) this.flag = false watchContextmenu(event) {
window.removeEventListener('mousedown', this.watchContextmenu) if (!this.$el.contains(event.target) || event.button !== 0) this.flag = false
} window.removeEventListener('mousedown', this.watchContextmenu)
}, }
mounted() { },
// 将菜单放置到body下 mounted() {
document.querySelector('body').appendChild(this.$el) // 将菜单放置到body下
} document.querySelector('body').appendChild(this.$el)
} }
</script> }
</script>
<style>
.d2-contextmenu { <style>
position: absolute; .d2-contextmenu {
padding: 5px 0; position: absolute;
z-index: 2019; padding: 5px 0;
background: #FFF; z-index: 2019;
border: 1px solid #cfd7e5; background: #FFF;
border-radius: 4px; border: 1px solid #cfd7e5;
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1); border-radius: 4px;
} box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
</style> }
</style>
<template> <template>
<!-- <svg t="1492500959545" @click="click" class="hamburger" :class="{'is-active':isActive}" viewBox="0 0 1024 1024" <!-- <svg t="1492500959545" @click="click" class="hamburger" :class="{'is-active':isActive}" viewBox="0 0 1024 1024"
version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1691" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"> version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1691" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
<path d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z" <path d="M966.8023 568.849776 57.196677 568.849776c-31.397081 0-56.850799-25.452695-56.850799-56.850799l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 543.397081 998.200404 568.849776 966.8023 568.849776z"
p-id="1692"></path> p-id="1692"></path>
<path d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z" <path d="M966.8023 881.527125 57.196677 881.527125c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.849776 56.850799-56.849776l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.849776l0 0C1023.653099 856.07443 998.200404 881.527125 966.8023 881.527125z"
p-id="1693"></path> p-id="1693"></path>
<path d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z" <path d="M966.8023 256.17345 57.196677 256.17345c-31.397081 0-56.850799-25.452695-56.850799-56.849776l0 0c0-31.397081 25.452695-56.850799 56.850799-56.850799l909.605623 0c31.397081 0 56.849776 25.452695 56.849776 56.850799l0 0C1023.653099 230.720755 998.200404 256.17345 966.8023 256.17345z"
p-id="1694"></path> p-id="1694"></path>
</svg> --> </svg> -->
<div @click="click" class="hamburger" :class="{'is-active':isActive}"> <div
<d2-el-icon name="s-fold" /> @click="click"
</div> class="hamburger"
</template> :class="{'is-active':isActive}"
>
<script> <d2-el-icon name="s-fold" />
export default { </div>
name: 'hamburger', </template>
props: {
isActive: { <script>
type: Boolean, export default {
default: false name: 'Hamburger',
}, props: {
onClick: { isActive: {
type: Function, type: Boolean,
default: null default: false
} },
}, onClick: {
methods: { type: Function,
click() { default: null
this.onClick && this.onClick() }
} },
} methods: {
} click() {
</script> this.onClick && this.onClick()
}
<style scoped lang="scss"> }
.hamburger { }
height: 50px; </script>
cursor: pointer;
transition: .38s; <style scoped lang="scss">
transform-origin: 50% 50%; .hamburger {
i{ height: 50px;
line-height: 50px; cursor: pointer;
font-size: 14px; transition: .38s;
} transform-origin: 50% 50%;
} i{
.hamburger.is-active { line-height: 50px;
transform: rotate(180deg); font-size: 14px;
} }
</style> }
.hamburger.is-active {
transform: rotate(180deg);
}
</style>
<template> <template>
<el-color-picker <el-color-picker
class="btn-text can-hover" class="btn-text can-hover"
:value="value" :value="value"
:predefine="predefine" :predefine="predefine"
size="mini" size="mini"
@change="set"/> @change="set"
</template> />
</template>
<script>
import { mapState, mapActions } from 'vuex' <script>
import { mapState, mapActions } from 'vuex'
export default {
name: 'd2-header-color', export default {
data() { name: 'D2HeaderColor',
return { data() {
predefine: [ return {
'#FF0000', '#008000', '#0000FF' predefine: [
] '#FF0000', '#008000', '#0000FF'
} ]
}, }
computed: { },
...mapState('d2admin', { computed: {
value: state => state.color.value, ...mapState('d2admin', {
listTheme: state => state.theme.list value: state => state.color.value,
}) listTheme: state => state.theme.list
}, })
watch: { },
value(value) { watch: {
this.set(value) value(value) {
} this.set(value)
}, }
mounted() { },
this.predefine = [...this.predefine, ...this.listTheme.map(theme => theme.color)] mounted() {
}, this.predefine = [...this.predefine, ...this.listTheme.map(theme => theme.color)]
methods: { },
...mapActions('d2admin/color', [ methods: {
'set' ...mapActions('d2admin/color', [
]) 'set'
} ])
} }
</script> }
</script>
<template> <template>
<div class="header-datetime"></div> <div class="header-datetime" />
</template> </template>
<script> <script>
...@@ -7,7 +7,7 @@ import dayjs from 'dayjs' ...@@ -7,7 +7,7 @@ import dayjs from 'dayjs'
const sFormat = 'YYYY年MM月DD日' const sFormat = 'YYYY年MM月DD日'
const WEEK = ['天', '一', '二', '三', '四', '五', '六'] const WEEK = ['天', '一', '二', '三', '四', '五', '六']
export default { export default {
name: 'd2-header-datetime', name: 'D2HeaderDatetime',
data() { data() {
return { return {
timeInterval: null, timeInterval: null,
......
<template> <template>
<el-tooltip <el-tooltip
effect="dark" effect="dark"
:content="active ? '退出全屏' : '全屏'" :content="active ? '退出全屏' : '全屏'"
placement="bottom"> placement="bottom"
<el-button class="d2-mr btn-text can-hover" type="text" @click="toggle"> >
<d2-el-icon v-if="active" name="aim"/> <el-button
<d2-el-icon v-else name="full-screen" style="font-size: 16px"/> class="d2-mr btn-text can-hover"
</el-button> type="text"
</el-tooltip> @click="toggle"
</template> >
<d2-el-icon
<script> v-if="active"
import { mapState, mapActions } from 'vuex' name="aim"
export default { />
computed: { <d2-el-icon
...mapState('d2admin/fullscreen', [ v-else
'active' name="full-screen"
]) style="font-size: 16px"
}, />
methods: { </el-button>
...mapActions('d2admin/fullscreen', [ </el-tooltip>
'toggle' </template>
])
} <script>
} import { mapState, mapActions } from 'vuex'
</script> export default {
computed: {
...mapState('d2admin/fullscreen', [
'active'
])
},
methods: {
...mapActions('d2admin/fullscreen', [
'toggle'
])
}
}
</script>
...@@ -2,17 +2,27 @@ ...@@ -2,17 +2,27 @@
<el-dropdown <el-dropdown
placement="bottom" placement="bottom"
size="small" size="small"
@command="onChangeLocale"> @command="onChangeLocale"
<el-button class="d2-mr btn-text can-hover" type="text"> >
<d2-icon name="language" style="font-size: 16px;"/> <el-button
class="d2-mr btn-text can-hover"
type="text"
>
<d2-icon
name="language"
style="font-size: 16px;"
/>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item <el-dropdown-item
v-for="(language, index) in $languages" v-for="(language, index) in $languages"
:key="index" :key="index"
:command="language.value"> :command="language.value"
<d2-icon :name="$i18n.locale === language.value ? 'dot-circle-o' : 'circle-o'" class="d2-mr-5"/> >
<d2-icon
:name="$i18n.locale === language.value ? 'dot-circle-o' : 'circle-o'"
class="d2-mr-5"
/>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
......
<template> <template>
<el-tooltip <el-tooltip
effect="dark" effect="dark"
:content="tooltipContent" :content="tooltipContent"
placement="bottom"> placement="bottom"
<el-button >
class="d2-ml-0 d2-mr btn-text can-hover" <el-button
type="text" class="d2-ml-0 d2-mr btn-text can-hover"
@click="handleClick"> type="text"
<el-badge @click="handleClick"
v-if="logLength > 0" >
:max="99" <el-badge
:value="logLengthError" v-if="logLength > 0"
:is-dot="logLengthError === 0"> :max="99"
<d2-icon :value="logLengthError"
:name="logLengthError === 0 ? 'dot-circle-o' : 'bug'" :is-dot="logLengthError === 0"
style="font-size: 20px"/> >
</el-badge> <d2-icon
<d2-icon :name="logLengthError === 0 ? 'dot-circle-o' : 'bug'"
v-else style="font-size: 20px"
name="dot-circle-o" />
style="font-size: 20px"/> </el-badge>
</el-button> <d2-icon
</el-tooltip> v-else
</template> name="dot-circle-o"
style="font-size: 20px"
<script> />
import { mapGetters, mapMutations } from 'vuex' </el-button>
export default { </el-tooltip>
computed: { </template>
...mapGetters('d2admin', {
logLength: 'log/length', <script>
logLengthError: 'log/lengthError' import { mapGetters, mapMutations } from 'vuex'
}), export default {
tooltipContent() { computed: {
return this.logLength === 0 ...mapGetters('d2admin', {
? '没有日志或异常' logLength: 'log/length',
: `${this.logLength} 条日志${this.logLengthError > 0 logLengthError: 'log/lengthError'
? ` | 包含 ${this.logLengthError} 个异常` }),
: ''}` tooltipContent() {
} return this.logLength === 0
}, ? '没有日志或异常'
methods: { : `${this.logLength} 条日志${this.logLengthError > 0
...mapMutations('d2admin/log', [ ? ` | 包含 ${this.logLengthError} 个异常`
'clean' : ''}`
]), }
handleClick() { },
this.$router.push({ methods: {
name: 'log' ...mapMutations('d2admin/log', [
}) 'clean'
} ]),
} handleClick() {
} this.$router.push({
</script> name: 'log'
})
}
}
}
</script>
<template> <template>
<el-button class="d2-mr btn-text can-hover" type="text" @click="handleClick"> <el-button
<d2-el-icon name="search" style="font-size: 18px;"/> class="d2-mr btn-text can-hover"
</el-button> type="text"
</template> @click="handleClick"
>
<script> <d2-el-icon
export default { name="search"
methods: { style="font-size: 18px;"
handleClick() { />
this.$emit('click') </el-button>
} </template>
}
} <script>
</script> export default {
methods: {
handleClick() {
this.$emit('click')
}
}
}
</script>
<template> <template>
<el-dropdown placement="bottom" size="small" @command="handleChange"> <el-dropdown
<el-button class="d2-mr btn-text can-hover" type="text"> placement="bottom"
<d2-icon name="font" style="font-size: 16px;"/> size="small"
</el-button> @command="handleChange"
<el-dropdown-menu slot="dropdown"> >
<el-dropdown-item v-for="item in options" :key="item.value" :command="item.value"> <el-button
<d2-icon :name="iconName(item.value)" class="d2-mr-5"/> class="d2-mr btn-text can-hover"
</el-dropdown-item> type="text"
</el-dropdown-menu> >
</el-dropdown> <d2-icon
</template> name="font"
style="font-size: 16px;"
<script> />
import { mapState, mapMutations, mapActions } from 'vuex' </el-button>
export default { <el-dropdown-menu slot="dropdown">
name: 'd2-header-size', <el-dropdown-item
data() { v-for="item in options"
return { :key="item.value"
options: [ :command="item.value"
{ label: '大', value: 'default' }, >
{ label: '中', value: 'medium' }, <d2-icon
{ label: '小', value: 'small' }, :name="iconName(item.value)"
{ label: '最小', value: 'mini' } class="d2-mr-5"
] />
} </el-dropdown-item>
}, </el-dropdown-menu>
computed: { </el-dropdown>
...mapState('d2admin/size', [ </template>
'value'
]) <script>
}, import { mapState, mapMutations, mapActions } from 'vuex'
methods: { export default {
...mapMutations({ name: 'D2HeaderSize',
pageKeepAliveClean: 'd2admin/page/keepAliveClean' data() {
}), return {
...mapActions({ options: [
sizeSet: 'd2admin/size/set' { label: '大', value: 'default' },
}), { label: '中', value: 'medium' },
handleChange(value) { { label: '小', value: 'small' },
this.sizeSet(value) { label: '最小', value: 'mini' }
// this.$notify({ ]
// title: '提示', }
// dangerouslyUseHTMLString: true, },
// message: '已更新页面内 <b>组件</b> 的 <b>默认尺寸</b><br/>例如按钮大小,<b>非字号</b>', computed: {
// type: 'success' ...mapState('d2admin/size', [
// }) 'value'
}, ])
iconName(name) { },
return name === this.value ? 'dot-circle-o' : 'circle-o' methods: {
} ...mapMutations({
} pageKeepAliveClean: 'd2admin/page/keepAliveClean'
} }),
</script> ...mapActions({
sizeSet: 'd2admin/size/set'
}),
handleChange(value) {
this.sizeSet(value)
// this.$notify({
// title: '提示',
// dangerouslyUseHTMLString: true,
// message: '已更新页面内 <b>组件</b> 的 <b>默认尺寸</b><br/>例如按钮大小,<b>非字号</b>',
// type: 'success'
// })
},
iconName(name) {
return name === this.value ? 'dot-circle-o' : 'circle-o'
}
}
}
</script>
<template> <template>
<el-table <el-table
:data="list" :data="list"
v-bind="table"> v-bind="table"
<el-table-column >
prop="title" <el-table-column
prop="title"
align="center"
width="160"
/>
<el-table-column
label="预览"
width="120"
>
<div
slot-scope="scope"
class="theme-preview"
:style="{
backgroundImage: `url(${$baseUrl}${scope.row.preview})`
}"
/>
</el-table-column>
<el-table-column
prop="address"
align="center" align="center"
width="160"/> >
<el-table-column <template slot-scope="scope">
label="预览" <el-button
width="120"> v-if="activeName === scope.row.name"
<div type="primary"
slot-scope="scope" icon="el-icon-check"
class="theme-preview" class="btn-active-success"
:style="{
backgroundImage: `url(${$baseUrl}${scope.row.preview})`
}">
</div>
</el-table-column>
<el-table-column
prop="address"
align="center">
<template slot-scope="scope">
<el-button
v-if="activeName === scope.row.name"
type="primary"
icon="el-icon-check"
class="btn-active-success"
round>
已激活
</el-button>
<el-button
v-else
round round
@click="handleSelectTheme(scope.row)"> >
使用 已激活
</el-button> </el-button>
</template> <el-button
</el-table-column> v-else
</el-table> round
</template> @click="handleSelectTheme(scope.row)"
>
<script> 使用
import { mapState, mapActions } from 'vuex' </el-button>
export default { </template>
name: 'd2-theme-list', </el-table-column>
data() { </el-table>
return { </template>
table: {
showHeader: false, <script>
border: true import { mapState, mapActions } from 'vuex'
} export default {
} name: 'D2ThemeList',
}, data() {
computed: { return {
...mapState('d2admin/theme', [ table: {
'list', showHeader: false,
'activeName' border: true
]) }
}, }
methods: { },
...mapActions('d2admin/theme', [ computed: {
'set' ...mapState('d2admin/theme', [
]), 'list',
...mapActions('d2admin/color', { setColor: 'set' }), 'activeName'
handleSelectTheme(row) { ])
const { name, color } = row },
this.set(name) methods: {
this.setColor(color) ...mapActions('d2admin/theme', [
} 'set'
} ]),
} ...mapActions('d2admin/color', { setColor: 'set' }),
</script> handleSelectTheme(row) {
const { name, color } = row
<style lang="scss" scoped> this.set(name)
.theme-preview { this.setColor(color)
height: 50px; }
width: 100px; }
border-radius: 4px; }
background-size: cover; </script>
border: 1px solid $color-border-1;
} <style lang="scss" scoped>
</style> .theme-preview {
<style lang="scss"> height: 50px;
.btn-active-success{ width: 100px;
&:hover{ border-radius: 4px;
background-color: "#67C23A" !important; background-size: cover;
} border: 1px solid $color-border-1;
} }
</style> </style>
<style lang="scss">
.btn-active-success{
&:hover{
background-color: "#67C23A" !important;
}
}
</style>
<template> <template>
<div> <div>
<el-tooltip <el-tooltip
effect="dark" effect="dark"
content="主题" content="主题"
placement="bottom"> placement="bottom"
<el-button >
class="d2-ml-0 d2-mr btn-text can-hover" <el-button
type="text" class="d2-ml-0 d2-mr btn-text can-hover"
@click="dialogVisible = true"> type="text"
<d2-el-icon @click="dialogVisible = true"
name="magic-stick" >
style="font-size: 18px"/> <d2-el-icon
</el-button> name="magic-stick"
</el-tooltip> style="font-size: 18px"
<el-dialog />
title="主题" </el-button>
width="600px" </el-tooltip>
:visible.sync="dialogVisible" <el-dialog
:append-to-body="true"> title="主题"
<d2-theme-list style="margin-top: -25px;"/> width="600px"
</el-dialog> :visible.sync="dialogVisible"
</div> :append-to-body="true"
</template> >
<d2-theme-list style="margin-top: -25px;" />
<script> </el-dialog>
import themeList from './components/d2-theme-list' </div>
export default { </template>
components: {
'd2-theme-list': themeList <script>
}, import themeList from './components/d2-theme-list'
data() { export default {
return { components: {
dialogVisible: false 'd2-theme-list': themeList
} },
} data() {
} return {
</script> dialogVisible: false
}
}
}
</script>
<template> <template>
<div> <div>
<div class="d2-mr personal-wrap"> <div class="d2-mr personal-wrap">
<el-popover ref="popover1" <el-popover
placement="top-start" ref="popover1"
width="400" placement="top-start"
@show="redPotShow = false" width="400"
popper-class="popper" @show="redPotShow = false"
v-model="visible" popper-class="popper"
trigger="hover"> v-model="visible"
<p class="title">导出和导出任务</p> trigger="hover"
<p class="tips"> 导出和导出任务加载完成后将自动进行下载,加载过程中不要离开系统,否则将导致任务自动清空</p> >
<div v-for="(item,index) in dowloadList" <p class="title">
:key="index" 导出和导出任务
class="downloadSty"> </p>
<span class="one-line-ellipsis downName">{{item.name}}</span> <p class="tips">
<span class="downLabel"> {{item.labelText}}</span> 导出和导出任务加载完成后将自动进行下载,加载过程中不要离开系统,否则将导致任务自动清空
</p>
<div
v-for="(item,index) in dowloadList"
:key="index"
class="downloadSty"
>
<span class="one-line-ellipsis downName">{{ item.name }}</span>
<span class="downLabel"> {{ item.labelText }}</span>
</div> </div>
<div v-for="(item,index) in updateList" <div
:key="index+'a'" v-for="(item,index) in updateList"
class="updateListClass"> :key="index+'a'"
class="updateListClass"
>
<div v-if="item.progress!= 100"> <div v-if="item.progress!= 100">
<p>{{item.name}}</p> <p>{{ item.name }}</p>
<el-progress :percentage="item.progress?item.progress:2"></el-progress> <el-progress :percentage="item.progress?item.progress:2" />
</div> </div>
<div v-else> <div v-else>
<p>{{item.name||''}}</p> <p>{{ item.name||'' }}</p>
<p>成功{{item.succNum}}条<span v-if="item.failNum">,失败{{item.failNum}}条</span></p> <p>成功{{ item.succNum }}条<span v-if="item.failNum">,失败{{ item.failNum }}条</span></p>
</div> </div>
</div> </div>
<!-- @click="test" --> <!-- @click="test" -->
<span slot="reference"> <span slot="reference">
<i class="el-icon-bell tipsIcon " <i
:class="{'redPot':redPotShow }"></i> class="el-icon-bell tipsIcon "
:class="{'redPot':redPotShow }"
/>
</span> </span>
</el-popover> </el-popover>
<span v-if="show" <span
class="btn-text">{{info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录'}}</span> v-if="show"
<span class="btn-text out-txt" class="btn-text"
@click="clear">退出</span> >{{ info && info.detail ? (info.detail.userType == 2 ? `${info.detail.userName}` : '管理员') : '未登录' }}</span>
<span
class="btn-text out-txt"
@click="clear"
>退出</span>
</div> </div>
</div> </div>
</template> </template>
...@@ -78,8 +93,8 @@ export default { ...@@ -78,8 +93,8 @@ export default {
}, },
computed: { computed: {
...mapState({ ...mapState({
'dowloadList': (state) => state.d2admin.user.dowloadList, dowloadList: (state) => state.d2admin.user.dowloadList,
'updateList': (state) => state.d2admin.user.updateList updateList: (state) => state.d2admin.user.updateList
}) })
}, },
watch: { watch: {
......
// 创建 el-menu-item // 创建 el-menu-item
export function elMenuItem(createElement, menu) { export function elMenuItem(createElement, menu) {
return createElement('el-menu-item', { props: { index: menu.path } }, [ return createElement('el-menu-item', { props: { index: menu.path } }, [
...menu.icon ? [ ...menu.icon
createElement('i', { attrs: { class: `el-icon-${menu.icon}` } }) ? [
] : [], createElement('i', { attrs: { class: `el-icon-${menu.icon}` } })
]
: [],
...menu.icon === undefined & !menu.iconSvg ? [ ...menu.icon === undefined & !menu.iconSvg ? [
// createElement('img', { attrs: { src: './menuIcon/' + menu.path.slice(1) + '.png' } }) // createElement('img', { attrs: { src: './menuIcon/' + menu.path.slice(1) + '.png' } })
// public 文件需要使用绝对路径引入 // public 文件需要使用绝对路径引入
createElement('img', { attrs: { src: `${process.env.VUE_APP_PUBLIC_PATH}/menuIcon/` + menu.path.slice(1) + '.png' } }) createElement('img', { attrs: { src: `${process.env.VUE_APP_PUBLIC_PATH}/menuIcon/` + menu.path.slice(1) + '.png' } })
] : [], ] : [],
...menu.iconSvg ? [ ...menu.iconSvg
createElement('d2-icon-svg', { props: { name: menu.iconSvg } }) ? [
] : [], createElement('d2-icon-svg', { props: { name: menu.iconSvg } })
]
: [],
createElement('span', { slot: 'title' }, menu.title || '未命名菜单') createElement('span', { slot: 'title' }, menu.title || '未命名菜单')
]) ])
} }
...@@ -19,17 +23,21 @@ export function elMenuItem(createElement, menu) { ...@@ -19,17 +23,21 @@ export function elMenuItem(createElement, menu) {
// 创建 el-submenu // 创建 el-submenu
export function elSubmenu(createElement, menu) { export function elSubmenu(createElement, menu) {
return createElement('el-submenu', { props: { index: menu.path } }, [ return createElement('el-submenu', { props: { index: menu.path } }, [
...menu.icon ? [ ...menu.icon
createElement('i', { slot: 'title', attrs: { class: `el-icon-${menu.icon}` } }) ? [
] : [], createElement('i', { slot: 'title', attrs: { class: `el-icon-${menu.icon}` } })
]
: [],
...menu.icon === undefined & !menu.iconSvg ? [ ...menu.icon === undefined & !menu.iconSvg ? [
// createElement('img', { slot: 'title', attrs: { src: './menuIcon/' + menu.path.slice(1) + '.png' } }) // createElement('img', { slot: 'title', attrs: { src: './menuIcon/' + menu.path.slice(1) + '.png' } })
// public 文件需要使用绝对路径引入 // public 文件需要使用绝对路径引入
createElement('img', { slot: 'title', attrs: { src: `${process.env.VUE_APP_PUBLIC_PATH}/menuIcon/` + menu.path.slice(1) + '.png' } }) createElement('img', { slot: 'title', attrs: { src: `${process.env.VUE_APP_PUBLIC_PATH}/menuIcon/` + menu.path.slice(1) + '.png' } })
] : [], ] : [],
...menu.iconSvg ? [ ...menu.iconSvg
createElement('d2-icon-svg', { slot: 'title', props: { name: menu.iconSvg } }) ? [
] : [], createElement('d2-icon-svg', { slot: 'title', props: { name: menu.iconSvg } })
]
: [],
createElement('span', { slot: 'title' }, menu.title || '未命名菜单'), createElement('span', { slot: 'title' }, menu.title || '未命名菜单'),
...menu.children.map((child, childIndex) => child.sideHidden ? '' : (child.children === undefined ? elMenuItem : elSubmenu).call(this, createElement, child)) ...menu.children.map((child, childIndex) => child.sideHidden ? '' : (child.children === undefined ? elMenuItem : elSubmenu).call(this, createElement, child))
]) ])
......
import { mapState } from 'vuex' import { mapState } from 'vuex'
import menuMixin from '../mixin/menu' import menuMixin from '../mixin/menu'
import { elMenuItem, elSubmenu } from '../libs/util.menu' import { elMenuItem, elSubmenu } from '../libs/util.menu'
export default { export default {
name: 'd2-layout-header-aside-menu-header', name: 'd2-layout-header-aside-menu-header',
mixins: [ mixins: [
menuMixin menuMixin
], ],
render(createElement) { render(createElement) {
return createElement('div', { return createElement('div', {
attrs: { flex: 'cross:center' }, attrs: { flex: 'cross:center' },
class: { 'd2-theme-header-menu': true, 'is-scrollable': this.isScroll }, class: { 'd2-theme-header-menu': true, 'is-scrollable': this.isScroll },
ref: 'page' ref: 'page'
}, [ }, [
createElement('div', { createElement('div', {
attrs: { class: 'd2-theme-header-menu__content', flex: '', 'flex-box': '1' }, attrs: { class: 'd2-theme-header-menu__content', flex: '', 'flex-box': '1' },
ref: 'content' ref: 'content'
}, [ }, [
createElement('div', { createElement('div', {
attrs: { class: 'd2-theme-header-menu__scroll', 'flex-box': '0' }, attrs: { class: 'd2-theme-header-menu__scroll', 'flex-box': '0' },
style: { transform: `translateX(${this.currentTranslateX}px)` }, style: { transform: `translateX(${this.currentTranslateX}px)` },
ref: 'scroll' ref: 'scroll'
}, [ }, [
createElement('el-menu', { createElement('el-menu', {
props: { mode: 'horizontal', defaultActive: this.active }, props: { mode: 'horizontal', defaultActive: this.active },
on: { select: this.handleMenuSelect } on: { select: this.handleMenuSelect }
}, this.header.map(menu => (menu.children === undefined ? elMenuItem : elSubmenu).call(this, createElement, menu))) }, this.header.map(menu => (menu.children === undefined ? elMenuItem : elSubmenu).call(this, createElement, menu)))
]) ])
]), ]),
...this.isScroll ? [ ...this.isScroll
createElement('div', { ? [
attrs: { class: 'd2-theme-header-menu__prev', flex: 'main:center cross:center', 'flex-box': '0' }, createElement('div', {
on: { click: () => this.scroll('left') } attrs: { class: 'd2-theme-header-menu__prev', flex: 'main:center cross:center', 'flex-box': '0' },
}, [ on: { click: () => this.scroll('left') }
createElement('i', { attrs: { class: 'el-icon-arrow-left' } }) }, [
]), createElement('i', { attrs: { class: 'el-icon-arrow-left' } })
createElement('div', { ]),
attrs: { class: 'd2-theme-header-menu__next', flex: 'main:center cross:center', 'flex-box': '0' }, createElement('div', {
on: { click: () => this.scroll('right') } attrs: { class: 'd2-theme-header-menu__next', flex: 'main:center cross:center', 'flex-box': '0' },
}, [ on: { click: () => this.scroll('right') }
createElement('i', { attrs: { class: 'el-icon-arrow-right' } }) }, [
]) createElement('i', { attrs: { class: 'el-icon-arrow-right' } })
] : [] ])
]) ]
}, : []
computed: { ])
...mapState('d2admin/menu', [ },
'header' computed: {
]) ...mapState('d2admin/menu', [
}, 'header'
data() { ])
return { },
active: '', data() {
isScroll: false, return {
scrollWidth: 0, active: '',
contentWidth: 0, isScroll: false,
currentTranslateX: 0, scrollWidth: 0,
throttledCheckScroll: null contentWidth: 0,
} currentTranslateX: 0,
}, throttledCheckScroll: null
watch: { }
'$route.matched': { },
handler(val) { watch: {
this.active = val[val.length - 1].path '$route.matched': {
}, handler(val) {
immediate: true this.active = val[val.length - 1].path
} },
}, immediate: true
methods: { }
scroll(direction) { },
if (direction === 'left') { methods: {
// 向右滚动 scroll(direction) {
this.currentTranslateX = 0 if (direction === 'left') {
} else { // 向右滚动
// 向左滚动 this.currentTranslateX = 0
if (this.contentWidth * 2 - this.currentTranslateX <= this.scrollWidth) { } else {
this.currentTranslateX -= this.contentWidth // 向左滚动
} else { if (this.contentWidth * 2 - this.currentTranslateX <= this.scrollWidth) {
this.currentTranslateX = this.contentWidth - this.scrollWidth this.currentTranslateX -= this.contentWidth
} } else {
} this.currentTranslateX = this.contentWidth - this.scrollWidth
}, }
checkScroll() { }
let contentWidth = this.$refs.content.clientWidth },
let scrollWidth = this.$refs.scroll.clientWidth checkScroll() {
if (this.isScroll) { let contentWidth = this.$refs.content.clientWidth
// 页面依旧允许滚动的情况,需要更新width let scrollWidth = this.$refs.scroll.clientWidth
if (this.contentWidth - this.scrollWidth === this.currentTranslateX) { if (this.isScroll) {
// currentTranslateX 也需要相应变化【在右端到头的情况时】 // 页面依旧允许滚动的情况,需要更新width
this.currentTranslateX = contentWidth - scrollWidth if (this.contentWidth - this.scrollWidth === this.currentTranslateX) {
// 快速的滑动依旧存在判断和计算时对应的contentWidth变成正数,所以需要限制一下 // currentTranslateX 也需要相应变化【在右端到头的情况时】
if (this.currentTranslateX > 0) { this.currentTranslateX = contentWidth - scrollWidth
this.currentTranslateX = 0 // 快速的滑动依旧存在判断和计算时对应的contentWidth变成正数,所以需要限制一下
} if (this.currentTranslateX > 0) {
} this.currentTranslateX = 0
// 更新元素数据 }
this.contentWidth = contentWidth }
this.scrollWidth = scrollWidth // 更新元素数据
// 判断何时滚动消失: 当scroll > content this.contentWidth = contentWidth
if (contentWidth > scrollWidth) { this.scrollWidth = scrollWidth
this.isScroll = false // 判断何时滚动消失: 当scroll > content
} if (contentWidth > scrollWidth) {
} this.isScroll = false
// 判断何时滚动出现: 当scroll < content }
if (!this.isScroll && contentWidth < scrollWidth) { }
this.isScroll = true // 判断何时滚动出现: 当scroll < content
// 注意,当isScroll变为true,对应的元素盒子大小会发生变化 if (!this.isScroll && contentWidth < scrollWidth) {
this.$nextTick(() => { this.isScroll = true
contentWidth = this.$refs.content.clientWidth // 注意,当isScroll变为true,对应的元素盒子大小会发生变化
scrollWidth = this.$refs.scroll.clientWidth this.$nextTick(() => {
this.contentWidth = contentWidth contentWidth = this.$refs.content.clientWidth
this.scrollWidth = scrollWidth scrollWidth = this.$refs.scroll.clientWidth
this.currentTranslateX = 0 this.contentWidth = contentWidth
}) this.scrollWidth = scrollWidth
} this.currentTranslateX = 0
} })
}, }
mounted() { }
// 初始化判断 },
// 默认判断父元素和子元素的大小,以确定初始情况是否显示滚动 mounted() {
window.addEventListener('load', this.checkScroll) // 初始化判断
// 全局窗口变化监听,判断父元素和子元素的大小,从而控制isScroll的开关 // 默认判断父元素和子元素的大小,以确定初始情况是否显示滚动
this.throttledCheckScroll = _.throttle(this.checkScroll, 300) window.addEventListener('load', this.checkScroll)
window.addEventListener('resize', this.throttledCheckScroll) // 全局窗口变化监听,判断父元素和子元素的大小,从而控制isScroll的开关
}, this.throttledCheckScroll = _.throttle(this.checkScroll, 300)
beforeDestroy() { window.addEventListener('resize', this.throttledCheckScroll)
// 取消监听 },
window.removeEventListener('resize', this.throttledCheckScroll) beforeDestroy() {
window.removeEventListener('load', this.checkScroll) // 取消监听
} window.removeEventListener('resize', this.throttledCheckScroll)
} window.removeEventListener('load', this.checkScroll)
}
}
import { mapState } from 'vuex' import { mapState } from 'vuex'
import menuMixin from '../mixin/menu' import menuMixin from '../mixin/menu'
import { elMenuItem, elSubmenu } from '../libs/util.menu' import { elMenuItem, elSubmenu } from '../libs/util.menu'
import BScroll from 'better-scroll' import BScroll from 'better-scroll'
export default { export default {
name: 'd2-layout-header-aside-menu-side', name: 'd2-layout-header-aside-menu-side',
mixins: [ mixins: [
menuMixin menuMixin
], ],
render(createElement) { render(createElement) {
return createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-side' } }, [ return createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-side' } }, [
createElement('el-menu', { createElement('el-menu', {
props: { collapse: this.asideCollapse, uniqueOpened: true, defaultActive: this.active }, props: { collapse: this.asideCollapse, uniqueOpened: true, defaultActive: this.active },
ref: 'menu', ref: 'menu',
on: { select: this.handleMenuSelect } on: { select: this.handleMenuSelect }
}, this.aside.map(menu => ((menu.children === undefined || menu.children.every(i => i.sideHidden === true)) ? elMenuItem : elSubmenu).call(this, createElement, menu))), }, this.aside.map(menu => ((menu.children === undefined || menu.children.every(i => i.sideHidden === true)) ? elMenuItem : elSubmenu).call(this, createElement, menu))),
...this.aside.length === 0 && !this.asideCollapse ? [ ...this.aside.length === 0 && !this.asideCollapse
createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-empty', flex: 'dir:top main:center cross:center' } }, [ ? [
createElement('d2-icon', { props: { name: 'inbox' } }), createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-empty', flex: 'dir:top main:center cross:center' } }, [
createElement('span', {}, '没有侧栏菜单') createElement('d2-icon', { props: { name: 'inbox' } }),
]) createElement('span', {}, '没有侧栏菜单')
] : [] ])
]) ]
}, : []
data() { ])
return { },
active: '', data() {
asideHeight: 300, return {
BS: null active: '',
} asideHeight: 300,
}, BS: null
computed: { }
...mapState('d2admin/menu', [ },
'aside', computed: {
'asideCollapse' ...mapState('d2admin/menu', [
]) 'aside',
}, 'asideCollapse'
watch: { ])
// 折叠和展开菜单的时候销毁 better scroll },
asideCollapse(val) { watch: {
this.scrollDestroy() // 折叠和展开菜单的时候销毁 better scroll
setTimeout(() => { asideCollapse(val) {
this.scrollInit() this.scrollDestroy()
}, 500) setTimeout(() => {
}, this.scrollInit()
// 监听路由 控制侧边栏激活状态 }, 500)
'$route.matched': { },
handler(val) { // 监听路由 控制侧边栏激活状态
this.active = val[val.length - 1].meta.hasOwnProperty('activePath') ? val[val.length - 1].meta.activePath : val[val.length - 1].path '$route.matched': {
}, handler(val) {
immediate: true this.active = val[val.length - 1].meta.hasOwnProperty('activePath') ? val[val.length - 1].meta.activePath : val[val.length - 1].path
} },
}, immediate: true
mounted() { }
this.scrollInit() },
}, mounted() {
beforeDestroy() { this.scrollInit()
this.scrollDestroy() },
}, beforeDestroy() {
methods: { this.scrollDestroy()
scrollInit() { },
this.BS = new BScroll(this.$el, { methods: {
mouseWheel: true, scrollInit() {
click: true this.BS = new BScroll(this.$el, {
// 如果你愿意可以打开显示滚动条 mouseWheel: true,
// scrollbar: { click: true
// fade: true, // 如果你愿意可以打开显示滚动条
// interactive: false // scrollbar: {
// } // fade: true,
}) // interactive: false
}, // }
scrollDestroy() { })
// https://github.com/d2-projects/d2-admin/issues/75 },
try { scrollDestroy() {
this.BS.destroy() // https://github.com/d2-projects/d2-admin/issues/75
} catch (e) { try {
delete this.BS this.BS.destroy()
this.BS = null } catch (e) {
} delete this.BS
} this.BS = null
} }
} }
}
}
<template> <template>
<div class="d2-panel-search-item" :class="hoverMode ? 'can-hover' : ''" flex> <div
<div class="d2-panel-search-item__icon" flex-box="0"> class="d2-panel-search-item"
<div class="d2-panel-search-item__icon-box" flex="main:center cross:center"> :class="hoverMode ? 'can-hover' : ''"
<d2-el-icon v-if="item.icon" :name="item.icon"/> flex
<!-- <d2-icon-svg v-else-if="item.iconSvg" :name="item.iconSvg"/> >
<d2-icon v-else name="file-o"/> --> <div
</div> class="d2-panel-search-item__icon"
</div> flex-box="0"
<div class="d2-panel-search-item__info" flex-box="1" flex="dir:top"> >
<div class="d2-panel-search-item__info-title" flex-box="1" flex="cross:center"> <div
<span></span> class="d2-panel-search-item__icon-box"
</div> flex="main:center cross:center"
<div class="d2-panel-search-item__info-fullTitle" flex-box="0"> >
<span></span> <d2-el-icon
</div> v-if="item.icon"
<div class="d2-panel-search-item__info-path" flex-box="0"> :name="item.icon"
<span></span> />
</div> <!-- <d2-icon-svg v-else-if="item.iconSvg" :name="item.iconSvg"/>
</div> <d2-icon v-else name="file-o"/> -->
</div> </div>
</template> </div>
<div
<script> class="d2-panel-search-item__info"
export default { flex-box="1"
props: { flex="dir:top"
item: { >
default: () => ({}) <div
}, class="d2-panel-search-item__info-title"
hoverMode: { flex-box="1"
default: false flex="cross:center"
} >
} <span />
} </div>
</script> <div
class="d2-panel-search-item__info-fullTitle"
<style lang="scss" scoped> flex-box="0"
.d2-panel-search-item { >
height: 64px; <span />
margin: 0px -20px; </div>
&.can-hover { <div
@extend %unable-select; class="d2-panel-search-item__info-path"
margin: 0px; flex-box="0"
&:hover { >
background-color: #F5F7FA; <span />
.d2-panel-search-item__icon { </div>
.d2-panel-search-item__icon-box { </div>
i { </div>
font-size: 24px; </template>
color: $color-primary;
} <script>
} export default {
} props: {
.d2-panel-search-item__info { item: {
.d2-panel-search-item__info-title { default: () => ({})
color: $color-text-main; },
} hoverMode: {
.d2-panel-search-item__info-fullTitle { default: false
color: $color-text-normal; }
} }
.d2-panel-search-item__info-path { }
color: $color-text-normal; </script>
}
} <style lang="scss" scoped>
} .d2-panel-search-item {
} height: 64px;
.d2-panel-search-item__icon { margin: 0px -20px;
width: 64px; &.can-hover {
.d2-panel-search-item__icon-box { @extend %unable-select;
height: 64px; margin: 0px;
width: 64px; &:hover {
border-right: 1px solid $color-border-3; background-color: #F5F7FA;
i { .d2-panel-search-item__icon {
font-size: 20px; .d2-panel-search-item__icon-box {
color: $color-text-sub; i {
} font-size: 24px;
svg { color: $color-primary;
height: 20px; }
width: 20px; }
} }
} .d2-panel-search-item__info {
} .d2-panel-search-item__info-title {
.d2-panel-search-item__info { color: $color-text-main;
margin-left: 10px; }
.d2-panel-search-item__info-title { .d2-panel-search-item__info-fullTitle {
font-size: 16px; color: $color-text-normal;
line-height: 16px; }
font-weight: bold; .d2-panel-search-item__info-path {
color: $color-text-normal; color: $color-text-normal;
} }
.d2-panel-search-item__info-fullTitle { }
font-size: 10px; }
line-height: 14px; }
color: $color-text-placehoder; .d2-panel-search-item__icon {
} width: 64px;
.d2-panel-search-item__info-path { .d2-panel-search-item__icon-box {
margin-bottom: 4px; height: 64px;
font-size: 10px; width: 64px;
line-height: 14px; border-right: 1px solid $color-border-3;
color: $color-text-placehoder; i {
} font-size: 20px;
} color: $color-text-sub;
} }
</style> svg {
height: 20px;
width: 20px;
}
}
}
.d2-panel-search-item__info {
margin-left: 10px;
.d2-panel-search-item__info-title {
font-size: 16px;
line-height: 16px;
font-weight: bold;
color: $color-text-normal;
}
.d2-panel-search-item__info-fullTitle {
font-size: 10px;
line-height: 14px;
color: $color-text-placehoder;
}
.d2-panel-search-item__info-path {
margin-bottom: 4px;
font-size: 10px;
line-height: 14px;
color: $color-text-placehoder;
}
}
}
</style>
...@@ -51,19 +51,34 @@ ...@@ -51,19 +51,34 @@
清空本地缓存 清空本地缓存
</div> </div>
</div>--> </div>-->
<div class="panel-item" @click="handleChangeAccount"> <div
<el-button type="text" :disabled="accountInfo.accountList.length == 1"> class="panel-item"
<i class="i el-icon-sort"></i>{{user && user.merchantAccountLevel ? (user.merchantAccountLevel == 4 ? `${user.detail.userName}` : '管理员') : '未登录'}} @click="handleChangeAccount"
>
<el-button
type="text"
:disabled="accountInfo.accountList.length == 1"
>
<i class="i el-icon-sort" />{{ user && user.merchantAccountLevel ? (user.merchantAccountLevel == 4 ? `${user.detail.userName}` : '管理员') : '未登录' }}
</el-button> </el-button>
</div> </div>
<div class="panel-item" @click="clear"> <div
class="panel-item"
@click="clear"
>
<el-button type="text"> <el-button type="text">
<i class="i el-icon-switch-button"></i>退出账户 <i class="i el-icon-switch-button" />退出账户
</el-button> </el-button>
</div> </div>
</div> </div>
<personal-dialog :visible="personalVisible" :user="info" /> <personal-dialog
<password-dialog :visible="passwordVisible" :user="info" /> :visible="personalVisible"
:user="info"
/>
<password-dialog
:visible="passwordVisible"
:user="info"
/>
</div> </div>
</template> </template>
......
<!-- 详情弹框 --> <!-- 详情弹框 -->
<template> <template>
<div class="password-detail"> <div class="password-detail">
<el-dialog <el-dialog
title="修改密码" title="修改密码"
:visible.sync="visible" :visible.sync="visible"
:before-close="handleClose" :before-close="handleClose"
:append-to-body="true" :append-to-body="true"
:close-on-click-modal="false" :close-on-click-modal="false"
width="600px" width="600px"
> >
<el-form label-width="120px" v-if="info" :model="info" :rules="rules" ref="passwordForm"> <el-form
<el-form-item label="用户名:" prop="userName"> label-width="120px"
<el-input disabled="disabled" v-model="info.userName"></el-input> v-if="info"
</el-form-item> :model="info"
<el-form-item label="原密码:" prop="oldPassword"> :rules="rules"
<el-input type="password" maxlength="12" :show-password="true" v-model="info.oldPassword" /> ref="passwordForm"
</el-form-item> >
<el-form-item label="新密码:" prop="newPassword"> <el-form-item
<el-input type="password" maxlength="12" :show-password="true" v-model="info.newPassword" /> label="用户名:"
</el-form-item> prop="userName"
<el-form-item label="确认密码:" prop="confirm"> >
<el-input type="password" maxlength="12" :show-password="true" v-model="info.confirm" /> <el-input
</el-form-item> disabled="disabled"
</el-form> v-model="info.userName"
<div slot="footer" class="dialog-footer"> />
<el-button type="primary" @click="submit">保 存</el-button> </el-form-item>
<el-button @click="handleClose">取 消</el-button> <el-form-item
</div> label="原密码:"
</el-dialog> prop="oldPassword"
</div> >
</template> <el-input
type="password"
<script> maxlength="12"
import { ModifyPassword } from '@api/sys.account' :show-password="true"
export default { v-model="info.oldPassword"
name: 'PasswordDialog', />
components: {}, </el-form-item>
data() { <el-form-item
return { label="新密码:"
rules: Object.freeze({ prop="newPassword"
oldPassword: [ >
{ required: true, message: '请输入旧密码', trigger: ['blur'] } <el-input
], type="password"
newPassword: [ maxlength="12"
{ required: true, :show-password="true"
validator: (rule, value, callback) => { v-model="info.newPassword"
if (!value) { />
callback(new Error('请输入新密码')) </el-form-item>
} else { <el-form-item
if (this.info.confirm) { label="确认密码:"
this.$refs.passwordForm.validateField('confirm') prop="confirm"
} >
callback() <el-input
} type="password"
}, maxlength="12"
trigger: 'blur' :show-password="true"
} v-model="info.confirm"
], />
confirm: [ </el-form-item>
{ required: true, </el-form>
validator: (rule, value, callback) => { <div
if (!value) { slot="footer"
callback(new Error('请再次输入新密码')) class="dialog-footer"
} else if (value !== this.info.newPassword) { >
callback(new Error('两次新密码不一致!')) <el-button
} else { type="primary"
callback() @click="submit"
} >
}, 保 存
trigger: 'blur' </el-button>
} <el-button @click="handleClose">
] 取 消
}) </el-button>
} </div>
}, </el-dialog>
props: { </div>
visible: { </template>
type: Boolean,
default: false <script>
}, import { ModifyPassword } from '@api/sys.account'
user: Object export default {
}, name: 'PasswordDialog',
computed: { components: {},
info() { data() {
return this.user return {
} rules: Object.freeze({
}, oldPassword: [
methods: { { required: true, message: '请输入旧密码', trigger: ['blur'] }
// 修改密码 ],
submit() { newPassword: [
this.$refs.passwordForm.validate(async valid => { {
if (valid) { required: true,
const { userId, oldPassword, newPassword } = this.info validator: (rule, value, callback) => {
const result = await ModifyPassword({ userId, oldPassword, newPassword }) if (!value) {
const { operateStatus } = result callback(new Error('请输入新密码'))
if (operateStatus) { } else {
this.emit(true) if (this.info.confirm) {
return this.$refs.passwordForm.validateField('confirm')
} }
this.$message.error('修改密码失败') callback()
} }
}) },
}, trigger: 'blur'
handleClose() { }
this.emit(false) ],
}, confirm: [
emit(is2Login) { {
this.$event.$emit('e-ps-close', is2Login) required: true,
this.$refs.passwordForm.validateField() validator: (rule, value, callback) => {
} if (!value) {
} callback(new Error('请再次输入新密码'))
} } else if (value !== this.info.newPassword) {
</script> callback(new Error('两次新密码不一致!'))
} else {
callback()
}
},
trigger: 'blur'
}
]
})
}
},
props: {
visible: {
type: Boolean,
default: false
},
user: Object
},
computed: {
info() {
return this.user
}
},
methods: {
// 修改密码
submit() {
this.$refs.passwordForm.validate(async valid => {
if (valid) {
const { userId, oldPassword, newPassword } = this.info
const result = await ModifyPassword({ userId, oldPassword, newPassword })
const { operateStatus } = result
if (operateStatus) {
this.emit(true)
return
}
this.$message.error('修改密码失败')
}
})
},
handleClose() {
this.emit(false)
},
emit(is2Login) {
this.$event.$emit('e-ps-close', is2Login)
this.$refs.passwordForm.validateField()
}
}
}
</script>
<!-- 详情弹框 --> <!-- 详情弹框 -->
<template> <template>
<div class="personal-detail"> <div class="personal-detail">
<el-dialog <el-dialog
title="个人信息" title="个人信息"
:visible.sync="visible" :visible.sync="visible"
:before-close="handleClose" :before-close="handleClose"
:append-to-body="true" :append-to-body="true"
:close-on-click-modal="false" :close-on-click-modal="false"
width="600px" width="600px"
> >
<el-form v-if="user" label-width="120px" :model="user"> <el-form
<el-form-item label="用户名:" prop="loginName"> v-if="user"
<el-input disabled v-model="user.loginName"></el-input> label-width="120px"
</el-form-item> :model="user"
<el-form-item label="姓名:" prop="userName"> >
<el-input disabled v-model="user.userName"></el-input> <el-form-item
</el-form-item> label="用户名:"
<el-form-item label="联系方式:" prop="mobile"> prop="loginName"
<el-input disabled v-model="user.mobile"></el-input> >
</el-form-item> <el-input
<el-form-item label="所属公司:" prop="companyName"> disabled
<el-input disabled v-model="user.companyName"></el-input> v-model="user.loginName"
</el-form-item> />
<el-form-item label="部门:" prop="departName"> </el-form-item>
<el-input disabled v-model="user.departName"></el-input> <el-form-item
</el-form-item> label="姓名:"
<el-form-item label="职务:" prop="postName"> prop="userName"
<el-input disabled v-model="user.postName"></el-input> >
</el-form-item> <el-input
</el-form> disabled
<div slot="footer" class="dialog-footer"> v-model="user.userName"
<!-- <el-button type="primary" @click="personDialogVisible = false">确 定</el-button> --> />
<el-button @click="handleClose">确 定</el-button> </el-form-item>
</div> <el-form-item
</el-dialog> label="联系方式:"
</div> prop="mobile"
</template> >
<el-input
<script> disabled
// import { ctMethods, request } from '@/api' v-model="user.mobile"
export default { />
name: 'personalDialog', </el-form-item>
props: { <el-form-item
visible: { label="所属公司:"
type: Boolean, prop="companyName"
default: false >
}, <el-input
user: Object disabled
}, v-model="user.companyName"
methods: { />
handleClose() { </el-form-item>
this.$event.$emit('e-pd-close') <el-form-item
} label="部门:"
} prop="departName"
} >
</script> <el-input
disabled
v-model="user.departName"
/>
</el-form-item>
<el-form-item
label="职务:"
prop="postName"
>
<el-input
disabled
v-model="user.postName"
/>
</el-form-item>
</el-form>
<div
slot="footer"
class="dialog-footer"
>
<!-- <el-button type="primary" @click="personDialogVisible = false">确 定</el-button> -->
<el-button @click="handleClose">
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
// import { ctMethods, request } from '@/api'
export default {
name: 'PersonalDialog',
props: {
visible: {
type: Boolean,
default: false
},
user: Object
},
methods: {
handleClose() {
this.$event.$emit('e-pd-close')
}
}
}
</script>
<template> <template>
<div class="d2-layout-header-aside-group" <div
:style="styleLayoutMainGroup" class="d2-layout-header-aside-group"
:class="{grayMode: grayActive}"> :style="styleLayoutMainGroup"
:class="{grayMode: grayActive}"
>
<!-- 半透明遮罩 --> <!-- 半透明遮罩 -->
<div class="d2-layout-header-aside-mask"></div> <div class="d2-layout-header-aside-mask" />
<!-- 主体内容 --> <!-- 主体内容 -->
<div class="d2-layout-header-aside-content" <div
flex="dir:top"> class="d2-layout-header-aside-content"
flex="dir:top"
>
<!-- 顶栏 --> <!-- 顶栏 -->
<div class="d2-theme-header" <div
:style="{ class="d2-theme-header"
:style="{
opacity: this.searchActive ? 0.5 : 1 opacity: this.searchActive ? 0.5 : 1
}" }"
flex-box="0" flex-box="0"
flex> flex
<div class="logo-group d2-theme-header-logo" >
:class="asideCollapse ? 'logo-only' : 'logo-all'" <div
flex-box="0"> class="logo-group d2-theme-header-logo"
<img v-if="asideCollapse" :class="asideCollapse ? 'logo-only' : 'logo-all'"
src="../../assets/icon-only.png"> flex-box="0"
<img v-else >
src="../../assets/all.png"> <img
v-if="asideCollapse"
src="../../assets/icon-only.png"
>
<img
v-else
src="../../assets/all.png"
>
<!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> --> <!-- <img style="width: 32px; height: 32px;" src="../../assets/icon-only.png"> -->
</div> </div>
<p v-if="show" <p
class="d2-header-name">{{info ? info.detail.merchantName : ''}}</p> v-if="show"
class="d2-header-name"
>
{{ info ? info.detail.merchantName : '' }}
</p>
<!-- <hamburger :onClick="handleToggleAside" :isActive="asideCollapse" flex-box="0" class="toggle-aside-btn"></hamburger> <!-- <hamburger :onClick="handleToggleAside" :isActive="asideCollapse" flex-box="0" class="toggle-aside-btn"></hamburger>
<span class="header-title">{{headerTitle}}</span> --> <span class="header-title">{{headerTitle}}</span> -->
<d2-menu-header flex-box="1" /> <d2-menu-header flex-box="1" />
<!-- 顶栏右侧 --> <!-- 顶栏右侧 -->
<div class="d2-header-right" <div
flex-box="0"> class="d2-header-right"
flex-box="0"
>
<!-- <d2-header-datetime /> --> <!-- <d2-header-datetime /> -->
<!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" --> <!-- 如果你只想在开发环境显示这个按钮请添加 v-if="$env === 'development'" -->
<!-- <d2-header-search @click="handleSearchClick"/> --> <!-- <d2-header-search @click="handleSearchClick"/> -->
...@@ -43,64 +61,87 @@ ...@@ -43,64 +61,87 @@
<d2-header-user /> <d2-header-user />
</div> </div>
</div> </div>
<div class="d2-theme-header" <div
style="height: 40px; font-size: 14px; border-top: 1px solid #F0F2F5;" class="d2-theme-header"
flex-box="0" style="height: 40px; font-size: 14px; border-top: 1px solid #F0F2F5;"
flex> flex-box="0"
<div class="logo-group d2-theme-header-logo" flex
style="height: 1px; margin-top: -1px;" >
:class="asideCollapse ? 'logo-only' : 'logo-all'" <div
flex-box="0"> class="logo-group d2-theme-header-logo"
</div> style="height: 1px; margin-top: -1px;"
<hamburger :onClick="handleToggleAside" :class="asideCollapse ? 'logo-only' : 'logo-all'"
:isActive="asideCollapse" flex-box="0"
flex-box="0" />
class="toggle-aside-btn"></hamburger> <hamburger
<span class="header-title">{{headerTitle}}</span> :on-click="handleToggleAside"
:is-active="asideCollapse"
flex-box="0"
class="toggle-aside-btn"
/>
<span class="header-title">{{ headerTitle }}</span>
</div> </div>
<!-- 下面 主体 --> <!-- 下面 主体 -->
<div class="d2-theme-container" <div
flex-box="1" class="d2-theme-container"
flex> flex-box="1"
flex
>
<!-- 主体 侧边栏 --> <!-- 主体 侧边栏 -->
<div flex-box="0" <div
ref="aside" flex-box="0"
class="d2-theme-container-aside" ref="aside"
:style="{ class="d2-theme-container-aside"
:style="{
width: asideCollapse ? asideWidthCollapse : asideWidth, width: asideCollapse ? asideWidthCollapse : asideWidth,
opacity: this.searchActive ? 0.5 : 1 opacity: this.searchActive ? 0.5 : 1
}"> }"
>
<d2-menu-side /> <d2-menu-side />
</div> </div>
<!-- 主体 --> <!-- 主体 -->
<div class="d2-theme-container-main" <div
:class="this.searchActive ? 'is-search' : ''" class="d2-theme-container-main"
flex-box="1" :class="this.searchActive ? 'is-search' : ''"
flex> flex-box="1"
flex
>
<!-- 搜索 --> <!-- 搜索 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="searchActive" <div
class="d2-theme-container-main-layer" v-if="searchActive"
flex> class="d2-theme-container-main-layer"
<d2-panel-search ref="panelSearch" flex
@close="searchPanelClose" /> >
<d2-panel-search
ref="panelSearch"
@close="searchPanelClose"
/>
</div> </div>
</transition> </transition>
<!-- 内容 --> <!-- 内容 -->
<transition name="fade-scale"> <transition name="fade-scale">
<div v-if="!searchActive" <div
class="d2-theme-container-main-layer" v-if="!searchActive"
flex="dir:top"> class="d2-theme-container-main-layer"
flex="dir:top"
>
<!-- tab --> <!-- tab -->
<div class="d2-theme-container-main-header" <div
flex-box="0"> class="d2-theme-container-main-header"
flex-box="0"
>
<!-- <d2-tabs/> --> <!-- <d2-tabs/> -->
</div> </div>
<!-- 页面 --> <!-- 页面 -->
<div class="d2-theme-container-main-body" <div
flex-box="1"> class="d2-theme-container-main-body"
<transition :name="transitionActive ? 'el-fade-in' : '' " flex-box="1"
mode="out-in"> >
<transition
:name="transitionActive ? 'el-fade-in' : '' "
mode="out-in"
>
<keep-alive :include="keepAlive"> <keep-alive :include="keepAlive">
<router-view /> <router-view />
</keep-alive> </keep-alive>
...@@ -132,7 +173,7 @@ import { mapState, mapGetters, mapActions } from 'vuex' ...@@ -132,7 +173,7 @@ import { mapState, mapGetters, mapActions } from 'vuex'
import mixinSearch from './mixins/search' import mixinSearch from './mixins/search'
import { localRoutes } from '@/router/routes' import { localRoutes } from '@/router/routes'
export default { export default {
name: 'd2-layout-header-aside', name: 'D2LayoutHeaderAside',
mixins: [ mixins: [
mixinSearch mixinSearch
], ],
...@@ -193,9 +234,11 @@ export default { ...@@ -193,9 +234,11 @@ export default {
*/ */
styleLayoutMainGroup() { styleLayoutMainGroup() {
return { return {
...this.themeActiveSetting.backgroundImage ? { ...this.themeActiveSetting.backgroundImage
backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')` ? {
} : {} backgroundImage: `url('${this.$baseUrl}${this.themeActiveSetting.backgroundImage}')`
}
: {}
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!