Commit 961f44d4 by 胡悦

init

0 parents
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
node: true,
es6: true
},
extends: 'eslint:recommended',
// required to lint *.vue files
plugins: [
'html'
],
// check if imports actually resolve
'settings': {
'import/resolver': {
'webpack': {
'config': 'build/webpack.base.conf.js'
}
}
},
// add your custom rules here
// it is base on https://github.com/vuejs/eslint-config-vue
rules: {
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
'after': true
}],
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}],
'camelcase': [0, {
'properties': 'always'
}],
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': [2, 'allow-null'],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
'afterColon': true
}],
'keyword-spacing': [2, {
'before': true,
'after': true
}],
'new-cap': [2, {
'newIsCap': true,
'capIsNew': false
}],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 2,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [2, {
'allowLoop': false,
'allowSwitch': false
}],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'max': 1
}],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [2, {
'defaultAssignment': false
}],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [2, {
'vars': 'all',
'args': 'none'
}],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
}],
'operator-linebreak': [2, 'after', {
'overrides': {
'?': 'before',
':': 'before'
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],
'semi-spacing': [2, {
'before': false,
'after': true
}],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [2, {
'words': true,
'nonwords': false
}],
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', {
objectsInObjects: false
}],
'array-bracket-spacing': [2, 'never']
}
}
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# glsx-micro-system-child
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This diff could not be displayed because it is too large.
{
"name": "glsx-micro-system-child",
"version": "0.1.0",
"private": true,
"port": 10200,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.20.0",
"core-js": "^3.6.5",
"element-ui": "^2.13.2",
"vue": "^2.6.11",
"vue-router": "^3.4.6",
"vuex": "^3.5.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"sass-loader": "^10.0.3",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="glsx-sub-system"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div
id="glsx-system-sub"
class="glsx-system-sub"
>
<!-- <div id="nav">
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link> |
<router-link to="/user">user</router-link> |
<router-link to="/role">role</router-link> |
<router-link to="/orginizaManage">orginizaManage</router-link> |
<router-link to="/menuManage">menuManage</router-link> |
<router-link to="/dictionaryManage">dictionaryManage</router-link> |
<router-link to="/dictionaryData">dictionaryData</router-link> |
<router-link to="/workLog">workLog</router-link>
<p>a链接跳转到主项目/其他子项目的页面,页面会刷新,效果不好<a href="/about">parent About</a></p>
<p v-if="isQiankun">
主项目把router传给子项目,子项目用这个router来跳转
<span @click="goToPage('/about')">parent About</span>
<span @click="goToPage('/app-vue-history/about')">app-vue-history About</span>
</p>
</div> -->
<keep-alive>
<router-view />
</keep-alive>
</div>
</template>
<script>
import { mapMutations } from 'vuex';
export default {
data() {
return {
isQiankun: window.__POWERED_BY_QIANKUN__,
}
},
methods: {
...mapMutations(['updateBaseURL']),
goToPage(path) {
this.$root.parentRouter.push(path);
}
},
created() {
}
}
</script>
<style>
#glsx-system-sub {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/* text-align: center; */
color: #2c3e50;
/* height: 800px; */
/* overflow-y: auto; */
}
/* .glsx-system-sub #nav {
padding: 30px;
} */
.glsx-system-sub #nav a {
font-weight: bold;
color: #2c3e50;
}
.glsx-system-sub #nav a.router-link-exact-active {
color: #42b983;
}
/* .glsx-system-sub span {
font-weight: bold;
color: #2c3e50;
cursor: pointer;
margin: 0 15px;
text-decoration: underline;
} */
</style>
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:before-close="handleClose"
:close-on-click-modal="false"
:width="width"
class="app-dialog"
>
<div class="container">
<slot></slot>
</div>
<div slot="footer">
<slot name="btn-front"></slot>
<el-button @click="handleClose">取消</el-button>
<el-button
type="primary"
@click="handleConfirm"
>{{btnOkLabel}}</el-button>
<slot name="btn-behind"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'basic-dialog',
props: {
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
btnOkLabel: {
type: String,
default: '确定'
},
width: {
type: String,
default: '580px'
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style lang="scss">
.app-dialog {
.el-dialog__header {
padding: 20px;
}
.el-dialog__footer {
padding: 10px;
background: #fff;
}
.el-dialog__body {
padding: 0;
border-top: 1px solid #eaeefb;
border-bottom: 1px solid #eaeefb;
min-height: 250px;
max-height: 500px;
overflow-y: auto;
.container {
> span {
display: block;
}
overflow-y: auto;
padding: 20px 20px;
}
}
}
</style>
<!-- 表格+分页 -->
<template>
<div class="d2-table">
<el-table
:ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'"
:data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading"
:border="tableParams.border || false"
:highlight-current-row="true"
:stripe="tableParams.stripe || true"
:size="tableParams.size || 'mini'"
@sort-change="sortChange"
@selection-change="handleSelect"
:header-cell-style="{background:'#f5f7fa'}"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey"
type="selection"
width="55"
:reserve-selection="true"
>
</el-table-column>
<el-table-column
v-if="hasNum"
align="center"
width="70px"
:label="tableParams.numName || '序号'"
type='index'
:index="index=>index+(page.pageNumber - 1) * page.pageSize + 1"
></el-table-column>
<el-table-column
v-for="(item, index) in tableParams.tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align||'center'"
:sortable="item.sortable"
>
<template slot-scope="scope">
<slot
v-if="item.addHtml"
:name="item.addHtml"
:scope="scope.row"
:prop="item.prop"
:width="item.width"
></slot>
<template v-else-if="item.tagLabel">
<el-tag
v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]"
>
</el-tag>
<el-tag
v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"
></el-tag>
</template>
<template v-else-if="item.formatter">
<span v-text="item.formatter(scope.row)"></span>
</template>
<template v-else-if="getListApi">
<span v-text="data[scope.$index][item.prop]"></span>
</template>
<template v-else>
<span v-text="tableData[scope.$index][item.prop]"></span>
</template>
</template>
</el-table-column>
<el-table-column
v-if="tableParams.tableOption"
label="操作"
:align="tableParams.tableOption.align||'center'"
:width="tableParams.tableOption.width||'200'"
fixed="right"
>
<!-- <template>
<el-button
v-for="(j, idx) in tableParams.tableOption"
:key="idx"
:type="j.type"
size="mini"
>{{j.name}}</el-button>
</template> -->
<template slot-scope="scope">
<slot
name="table-button"
:scope="scope.row"
></slot>
</template>
</el-table-column>
</el-table>
<el-pagination
v-if="!tableParams.hasPage && hasPage"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageNumber"
:page-sizes="[10,20,30,40]"
:page-size="page.pageSize"
:total="getListApi ? total : tableTotal"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
</div>
</template>
<script>
export default {
name: 'basic-table',
data() {
return {
loading: false,
oldValue: {},
data: [],
page: {
pageSize: 10,
pageNumber: 1
},
total: 10,
// 排序
sortColum: '',
sort: '',
// pagination: {},
// 多选数组
mutiSelectArr: {}
}
},
props: {
// 搜索条件
searchForm: {
type: Object,
default: () => { }
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => [
// {
// id: 1,
// account: '胡悦',
// username: 'jkjk',
// departmentName: '平台研发中心',
// phoneNumber: '1546861321',
// enablesStatus: 1,
// createDate: '2013556'
// }
]
},
tableTotal: {
type: Number,
default: 10
},
// 获取列表接口
getListApi: {
type: Function,
default: null
},
// 搜索前操作
beforeSearchFn: {
type: Function,
default: () => {
return new Promise((resolve, reject) => {
resolve()
})
}
},
// 分页,默认有
hasPage: {
type: Boolean,
default: true
},
// 序号,默认有
hasNum: {
type: Boolean,
default: true
},
tableParams: {
type: Object,
default: () => {
return {
// 多选-判断来自哪个页面
// mutiSelectName: {
// type: String,
// default: ''
// },
// 多选-唯一标识
// mutiSelectUniqueKey: {
// type: String,
// default: ''
// },
// 搜索按钮id;new Date().getTime() + parseInt(Math.random() * 1000)
// btnId: {
// type: String,
// default: ''
// },
// 后端返回列表参数名
listName: {
type: String,
default: ''
},
// 标签-默认标签名为tag;若有多个,那么需要在表格栏的列中加“tagName”
// tag: {
// type: Array,
// default: () => []
// },
// 表格操作,默认没有
// tableOption: {
// type: Object,
// default: null
// },
// 表格栏
tableColumns: {
type: Array,
default: () => []
}
}
}
}
},
watch: {
},
mounted() {
const btn = document.getElementById(this.tableParams.btnId)
// this.tableData = [
// {
// id: 1,
// account: '胡悦',
// username: 'jkjk',
// departmentName: '平台研发中心',
// phoneNumber: '1546861321',
// enablesStatus: 1,
// createDate: '2013556'
// }
// ]
btn && btn.addEventListener('click', this.refreshEmit)
this.getListApi && this.refreshTable()
},
methods: {
// 排序
sortChange({ column, prop, order }) {
this.sortColum = order ? prop : ''
this.sort = order
this.refreshTable()
},
// 多选
handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val
},
// 清空多选
clearMutiSelect() {
this.mutiSelectArr[this.tableParams.mutiSelectName] = []
this.$refs[this.tableParams.mutiSelectName + 'MutiTable'].clearSelection()
},
// 发布事件,以期查询条件改变后,页面图表需要刷新
refreshEmit() {
this.$emit('searchChange')
this.refreshTable()
},
refreshTable(clearMuti = true) {
this.beforeSearchFn().then(res => {
// 清空多选
clearMuti && this.clearMutiSelect()
this.loading = true
console.log(this.searchForm)
var params = {
...this.page,
...this.searchForm
}
if (this.sort) {
params.sortColum = this.sortColum
params.sort = this.sort === 'descending' ? 1 : 0
}
this.getListApi(params).then(res => {
var data = res.data
this.data = data[this.tableParams.listName]
this.total = data.totalElements
this.loading = false
}).catch(() => {
this.loading = false
})
})
},
// 页码
handleSizeChange(value) {
this.page.pageSize = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
},
handleCurrentChange(value) {
this.page.pageNumber = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
}
}
}
</script>
<style>
.el-table thead {
color: #909399;
font-weight: 500;
}
</style>
import Vue from 'vue'
// 注意 有些组件使用异步加载会有影响
Vue.component('basic-table', () => import('./basic-table/index.vue'))
Vue.component('search-form', () => import('./search-form/index.vue'))
Vue.component('sticky-table', () => import('./sticky-table/index.vue'))
Vue.component('basic-dialog', () => import('./basic-dialog/index.vue'))
Vue.component('rule-form', () => import('./rule-form/index.vue'))
<template>
<div>
<el-form
:model="ruleForm"
:rules="rules"
:label-position="labelPosition"
:label-width="labelWidth"
:size="size"
>
<el-form-item
v-for="(item, index) in ruleData"
:key="index"
:label="item.label"
:prop="item.prop || ''"
:class="item.class"
v-show="!item.hidden"
>
<template slot-scope="scope">
<template v-if="item.type === 'input'">
<el-input
v-if="item.clickFunc"
:type="item.inputText || 'text'"
:readonly="item.readonly || false"
@click.native="item.clickFunc"
:class="item.clickFunc ? 'pointer' : ''"
:ref="item.ref"
v-model="ruleForm[item.prop]"
@input="update($event)"
>
</el-input>
<el-input
v-else
:type="item.inputText || 'text'"
:readonly="item.readonly || false"
:disabled="item.disabled || false"
v-model="ruleForm[item.prop]"
:maxlength="item.maxlength"
:minlength="item.minlength"
:show-password="item.showPassword || false"
:clearable="item.clearable"
:show-word-limit="item.showWordLimit || false"
>
</el-input>
</template>
<template v-else-if="item.type == 'select'">
<el-select
v-if="item.visibleFunc"
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false"
@change="selectChange"
@visible-change="item.visibleFunc"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
<el-select
v-else
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
:filterable="item.filterable || false"
@change="selectChange"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
</template>
<template v-else-if="item.type === 'switch'">
<el-switch
v-model="ruleForm[item.prop]"
:active-text="item.activeText || '开'"
:inactive-text="item.inactiveText || '关'"
></el-switch>
</template>
<template v-else-if="item.type === 'radio'">
<el-radio-group
@change="radioChange($event,item.prop)"
v-model="ruleForm[item.prop]"
:disabled="item.disabled"
>
{{ruleForm[item.prop]}}
<el-radio
v-for="(child,childIndex) in item.children"
:key="childIndex"
:label="childIndex"
>{{child}}</el-radio>
</el-radio-group>
<el-select
v-if="item.hasSelect"
v-model="ruleForm[item.prop]"
:placeholder="item.placeholder || '请选择'"
@change="selectChange"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
</template>
<template v-else-if="item.type == 'customize'">
<slot
:scope="scope"
:name="item.slotName"
>
</slot>
</template>
</template>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'rule-form',
data() {
return {
// labelPosition: 'left'
}
},
props: {
// 表单数据
ruleData: {
type: Array,
default: () => {
return []
}
},
// 表单model
ruleForm: {
type: Object,
default: () => {
return {}
}
},
// 表单验证规则
rules: {
type: Object,
default: () => {
return {}
}
},
// 标签位置
labelPosition: {
type: String,
default: 'right'
},
size: {
type: String,
default: 'small'
},
labelWidth: {
type: String,
default: '100px'
}
},
mounted() {
},
methods: {
selectChange(val) {
this.$emit('selectChange', val)
},
radioChange(event, prop) {
this.$emit('radioChange', event, prop)
},
update(e) {
this.$forceUpdate()
}
}
}
</script>
<style lang="scss">
.pointer input {
cursor: pointer;
}
</style>
\ No newline at end of file
<template>
<div>
<el-form
class="clearfix search-form"
:model="formModel"
:inline="true"
:size="size"
>
<el-form-item
v-for="(item, index) in formList"
:key="index"
:label="item.label || ''"
>
<template>
<template v-if="item.type === 'input'">
<el-input
v-model="formModel[item.prop]"
:type="item.inputType || 'text'"
:placeholder="item.placeholder || '请输入'"
:readonly="item.readonly || false"
></el-input>
</template>
<template v-else-if="item.type === 'select'">
<el-select
v-model="formModel[item.prop]"
:placeholder="item.placeholder || '请选择'"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
</template>
<template v-else-if="item.type === 'daterange'">
<el-date-picker
v-model="formModel[item.prop]"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="item.pickerOptions || {}"
>
</el-date-picker>
</template>
<template v-else-if="item.type === 'selectDate'">
<el-select
:style="item.selectStyle || 'width: 100px;'"
v-model="formModel[item.prop]"
:placeholder="item.placeholder || '请选择'"
>
<el-option
v-for="i in item.options"
:key="i[item.value] || i.value"
:label="i[item.key] || i.label"
:value="i[item.value] || i.value"
:disabled="i.disabled"
>
</el-option>
</el-select>
<el-date-picker
v-model="formModel[item.dateModel]"
:type="item.dateType || date"
placeholder="选择日期"
>
</el-date-picker>
</template>
</template>
</el-form-item>
<el-form-item>
<template
name="form-slot"
slot-scope="scope"
>
<slot :scope="scope">
</slot>
</template>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'search-form',
props: {
formModel: {
type: Object,
default: () => { }
},
size: {
type: String,
default: 'small'
},
formList: {
type: Array,
default: () => []
}
}
}
</script>
<style lang="scss">
.search-form {
padding: 20px 20px 0;
.el-form-item {
display: inline-block;
// float: left;
// width: 50%;
max-width: 420px;
margin-right: 18px;
}
.el-form-item__content {
// width: 100%;
}
}
</style>
\ No newline at end of file
<template>
<div>
<basic-table
class="head-table"
v-show="showHead"
ref="headTable"
:tableParams="headTableParams"
>
</basic-table>
<basic-table
ref="addStoreTable"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
>
</basic-table>
</div>
</template>
<script>
export default {
name: 'sticky-table',
props: {
tableParams: {
type: Object,
default: () => {
return {
// 多选-判断来自哪个页面
// mutiSelectName: {
// type: String,
// default: ''
// },
// 多选-唯一标识
// mutiSelectUniqueKey: {
// type: String,
// default: ''
// },
// 搜索按钮id;new Date().getTime() + parseInt(Math.random() * 1000)
// btnId: {
// type: String,
// default: ''
// },
// 后端返回列表参数名
listName: {
type: String,
default: ''
},
// 标签-默认标签名为tag;若有多个,那么需要在表格栏的列中加“tagName”
// tag: {
// type: Array,
// default: () => []
// },
// 表格操作,默认没有
// tableOption: {
// type: Object,
// default: null
// },
// 表格栏
tableColumns: {
type: Array,
default: () => []
}
}
}
},
headTableParams: {
type: Object
},
// 获取列表接口
getListApi: {
type: Function,
default: null
},
// 搜索条件
searchForm: {
type: Object,
default: () => { }
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
tableTotal: {
type: Number,
default: 10
}
},
data() {
return {
showHead: false,
scrollTop: 0,
headTableHeight: 0,
tableOffset: {
top: 0,
height: 0
}
}
},
watch: {
scrollTop(val, oldVal) {
if (val > this.tableOffset.top - this.headTableHeight) {
this.showHead = true
} else {
this.showHead = false
}
}
},
mounted() {
window.addEventListener('scroll', () => {
this.scrollTop = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset
// console.log(this.scrollTop)
})
setTimeout(() => {
this.$refs.headTable.$children[0].bodyWrapper.setAttribute('style', 'display: none')
console.log(this.$refs.addStoreTable, this.$refs.addStoreTable.$el.offsetTop)
this.tableOffset.top = this.$refs.addStoreTable.$el.offsetTop
this.tableOffset.height = this.$refs.addStoreTable.$el.offsetHeight
this.headTableHeight = this.$refs.headTable.$el.offsetHeight
}, 1000)
}
}
</script>
<style scoped>
.head-table {
position: sticky;
top: 0;
z-index: 1;
}
</style>
\ No newline at end of file
// import store from '@/store/index'
// let BASE_URL = store.state.baseURL
// const MOCK_CONFIG_URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
// const env = process.env.NODE_ENV
// https://oss-config.test.glsx.com.cn/mock/5f8fda237ec90706c0f89d05/service
// http://192.168.0.63:8880
const API = {
getMockConfig() {
console.log(MOCK_CONFIG_URL)
return MOCK_CONFIG_URL + '/e-shield-trialrun_config'
},
LOGIN_ACTION: '/login_action'
}
const COMMON_API = {
PROVINCE_LIST: '/publiccenter/basic/province/list'
}
const SPECIALSHOP_API = {
SHOP_SEARCH: '/trialdrive/specialshop/search'
}
const MENU_API = {
MENU_SEARCH: '/usercenter/menu/search',
MENU_CHILDREN: '/usercenter/menu/children',
MENU_ADD: '/usercenter/menu/add',
MENU_EDIT: '/usercenter/menu/edit',
MENU_DELETE: '/usercenter/menu/delete',
MENU_INFO: '/usercenter/menu/info',
MENU_PERMTREE: '/usercenter/menu/permtree'
}
const WORKLOG_API = {
WORKLOG_SEARCH: '/loggincenter/loggin/search',
WORKLOG_EXPORT: '/loggincenter/loggin/export'
}
export { API, WORKLOG_API, MENU_API, COMMON_API, SPECIALSHOP_API }
function emptyAction() {
// 警告:提示当前使用的是空 Action
console.warn("Current execute action is empty!");
}
class Actions {
// 默认值为空 Action
actions = {
onGlobalStateChange: emptyAction,
setGlobalState: emptyAction
};
/**
* 设置 actions
*/
setActions(actions) {
this.actions = actions;
}
/**
* 映射
*/
onGlobalStateChange(...args) {
return this.actions.onGlobalStateChange(...args);
}
/**
* 映射
*/
setGlobalState(...args) {
return this.actions.setGlobalState(...args);
}
}
const actions = new Actions();
export default actions;
\ No newline at end of file
if (window.__POWERED_BY_QIANKUN__) {
// 动态设置 webpack publicPath,防止资源加载出错
// eslint-disable-next-line no-undef
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
\ No newline at end of file
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueRouter from "vue-router";
import App from './App.vue'
import routes from "./routes";
import store from './store'
import '@/styles/index.scss'
import '@/components'
import './core/public-path';
import { Common } from '@/utils/common.js'
import Constants from '@/utils/constants.js'
import actions from '@/core/actions';
// import axios from 'axios'
Vue.prototype.btn_size = 'mini'
Vue.prototype.$Common = Common
Vue.prototype.$Constants = Constants
Vue.use(VueRouter);
Vue.use(ElementUI)
Vue.config.productionTip = false;
let router = null;
let instance = null;
function render({ data = {} , container } = {}) {
router = new VueRouter({
base: window.__POWERED_BY_QIANKUN__ ? '/trialRun' : '/',
routes,
});
store.state.baseURL = data.baseURL;
instance = new Vue({
router,
store,
data(){
return {
parentRouter: data.router,
parentVuex: data.store
}
},
render: h => h(App),
}).$mount(container ? container.querySelector('#glsx-sub-system') : '#glsx-sub-system');
router.beforeEach((to, from, next)=>{
const metaTitle = to.meta.title;
const thisBreadCrumb = data.store.getters.curBreadCrumb;
if(metaTitle) {
if(thisBreadCrumb) {
let nextChildren = {};
nextChildren = {
active: true,
menuName: metaTitle,
path: '/trialRun#' + to.path,
params: to.params
};
thisBreadCrumb.children.children = nextChildren;
}
} else {
thisBreadCrumb.children.children = '';
}
data.store.dispatch('menu/setBreadCrumb', thisBreadCrumb);
next();
})
}
if (!window.__POWERED_BY_QIANKUN__) {
render();
}
export async function bootstrap() {
console.log('vue app bootstraped');
}
export async function mount(props) {
console.log('props from main framework', props.data);
actions.setActions(props);
render(props);
props.setGlobalState({
})
}
export async function unmount() {
instance.$destroy();
instance.$el.innerHTML = "";
instance = null;
router = null;
}
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'specialShop',
component: () => import('../views/specialShop/index.vue')
},
{
path: '/menuManage',
name: 'MenuManage',
component: () => import('../views/menuManage/index.vue')
},
{
path: '/workLog',
name: 'workLog',
component: () => import('../views/workLog/index.vue')
},
{
path: '/todo',
name: 'toDo',
component: () => import('../views/toDo/index.vue')
},
{
path: '/vehicleManage',
name: 'vehicleManage',
component: () => import('../views/vehicleManage/index.vue')
},
{
path: '/reportManage',
name: 'reportManage',
component: () => import('../views/reportManage/index.vue')
},
{
path: '/specialShop',
name: 'specialShop',
meta: {title: '新增特约店'},
component: () => import('../views/specialShop/index.vue')
},
{
path: '/specialShop/addShop',
name: 'addShop',
component: () => import('../views/specialShop/addShop/index.vue')
}
]
export default routes
import { COMMON_API } from '@/config/config'
import request from '@/services/request'
// 获取用户列表
function getProvinceList (params) {
const url = COMMON_API.PROVINCE_LIST
return request(params, url)
}
export { getProvinceList }
import { MENU_API } from '@/config/config'
import request from '@/services/request'
// 获取菜单列表
function getMenuList (params) {
const url = MENU_API.MENU_SEARCH
return request(params, url)
}
// 根据菜单根节点获取子节点
function getMenuChildren (params) {
const url = MENU_API.MENU_CHILDREN
return request(params, url)
}
// 添加菜单
function addMenu (params) {
const url = MENU_API.MENU_ADD
return request(params, url, 'post')
}
// 编辑菜单
function editMenu (params) {
const url = MENU_API.MENU_EDIT
return request(params, url, 'post')
}
// 删除菜单
function deleteMenu (params) {
const url = MENU_API.MENU_DELETE
return request(params, url)
}
// 获取菜单列表
function menuInfo (params) {
const url = MENU_API.MENU_INFO
return request(params, url)
}
// 获取上级菜单
function getPermtree (params) {
const url = MENU_API.MENU_PERMTREE
return request(params, url)
}
export { getMenuList, getMenuChildren, addMenu, editMenu, menuInfo, deleteMenu, getPermtree }
import HTTP from '@/utils/http'
const axiosHttp = new HTTP()
function request (data = {} , url, method = 'GET') {
return new Promise((resolve, reject) => {
var reqMethod = method.toLocaleLowerCase() === 'get' ? 'axiosGet' : 'axiosPost'
axiosHttp[reqMethod]({
url: url,
data: data,
success(data) {
resolve(data)
},
error(error) {
reject(error)
}
})
})
}
export default request
import { SPECIALSHOP_API } from '@/config/config'
import request from '@/services/request'
// 获取用户列表
function getList (params) {
const url = SPECIALSHOP_API.SHOP_SEARCH
return request(params, url)
}
export { getList }
import { WORKLOG_API } from '@/config/config'
import request from '@/services/request'
// 获取用户列表
function getWorkLogList (params) {
const url = WORKLOG_API.WORKLOG_SEARCH
return request(params, url)
}
// 导出日志
function exportWorkLog (params) {
const url = WORKLOG_API.WORKLOG_EXPORT
return request(params, url)
}
export { getWorkLogList, exportWorkLog }
import Vue from 'vue';
import Vuex from 'vuex';
import state from './state';
import mutations from './mutations';
Vue.use(Vuex);
const store = new Vuex.Store({
state,
mutations
})
export default store;
\ No newline at end of file
export default {
//更新全局baseURL
updateBaseURL(state, newBaseURL) {
state.baseURL = newBaseURL;
}
}
const state = {
baseURL: '',
token: '', // 令牌
loginStatus: false, // 是否登录
userInfo: {
username: '', // 用户名
phoneNumber: '', // 手机号
tenantId: '', // 租户id
superiorId: '', // 上级id
account: '', // 登录名
email: '',
gender: '',
position: ''
}
}
try {
} catch(e) {}
export default state;
\ No newline at end of file
.pull-right {
float: right;
}
.pull-left {
float: left;
}
.table-btn {
margin-bottom: 20px;
}
.searchTop {
margin-bottom: 30px;
}
.border-shadow {
border: 1px solid rgb(235, 235, 235);
border-image: initial;
border-radius: 3px;
transition: all 0.2s ease 0s;
}
.border-shadow:hover {
box-shadow: rgba(232, 237, 250, 0.6) 0px 0px 8px 0px,
rgba(232, 237, 250, 0.5) 0px 2px 4px 0px;
}
.system-container {
padding: 0 0 0 10px;
margin: 20px 24px;
background-color: #ffffff;
overflow: hidden;
.user-tree {
margin-top: 20px;
padding: 10px;
// float: left;
display: inline-block;
width: 200px;
overflow-x: auto;
.user-tree-top {
height: 30px;
}
}
.container {
padding: 20px 10px 0px 20px;
width: 100%;
}
.user-container {
padding: 20px 10px 0px 20px;
// float: left;
display: inline-block;
vertical-align: top;
width: calc(100% - 260px);
}
}
.el-tree {
margin-top: 20px;
}
// 状态
.dot {
display: inline-block;
width: 7px;
height: 7px;
border-radius: 5px;
vertical-align: middle;
margin-right: 2px;
}
.green-text {
color: #00A854;
}
.red-text {
color: rgb(255, 0, 0);
}
.green {
background-color: #00A854;
}
.gray {
background-color: #BFBFBF;
}
.blue {
background-color: rgb(0, 81, 255);
}
.red {
background-color: rgb(255, 0, 0);
}
.yellow {
background-color: rgb(217, 255, 0);
}
.orange {
background-color: rgb(255, 145, 0);
}
.statusText {
vertical-align: middle;
}
\ No newline at end of file
@import './common.scss';
@import './reset.scss';
body {
overflow: hidden;
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
html {
height: 100%;
box-sizing: border-box;
}
#app {
height: 100%;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
hr {
height: 1px;
border: 0px;
background-color: #e7eaec
}
a,
a:focus,
a:hover {
cursor: pointer;
color: inherit;
outline: none;
text-decoration: none;
}
div:focus {
outline: none;
}
a:focus,
a:active {
outline: none;
}
a,
a:focus,
a:hover {
cursor: pointer;
color: inherit;
text-decoration: none;
}
.clearfix {
zoom: 1;
&:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
}
//main-container全局样式
.app-main {
overflow: auto;
}
.app-container {
padding: 20px;
}
\ No newline at end of file
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
background-color: #409EFF;
color: #ffffff;
}
.el-radio-group {
line-height: 32px;
vertical-align: text-top;
}
.el-select {
width: 100%;
}
\ No newline at end of file
import actions from '@/core/actions';
import Vue from 'vue';
import { Message } from 'element-ui';
import { debounce } from 'utils/tools';
const error = debounce((msg, getToken) => {
if(window.__POWERED_BY_QIANKUN__) {
let stateRes = {
errorMsg: msg,
showLoading: false
};
if(getToken === 'removeToken') {
stateRes.token = getToken;
localStorage.removeItem('token');
}
actions.setGlobalState(stateRes);
} else {
if(msg) {
Message({
message: msg,
type: 'error'
});
}
}
}, 1000, true);
const showLoading = (status) => {
if(window.__POWERED_BY_QIANKUN__) {
actions.setGlobalState({
token: localStorage.getItem('token') || '',
errorMsg: '',
showLoading: status
})
}
}
const checkStatus = (status, msg) => {
switch (status) {
case 400:
error(`Bad Request 错误的请求`);
break;
case 401:
error('用户没有权限(令牌、用户名、密码错误)!');
break;
case 403:
error('用户得到授权,但是访问是被禁止的。!');
break;
// 404请求不存在
case 404:
error('网络请求错误,未找到该资源!');
break;
case 405:
error('网络请求错误,请求方法未允许!');
break;
case 408:
error('网络请求超时!');
break;
case 500:
error('服务器错误,请联系管理员!');
break;
case 501:
error('网络未实现!');
break;
case 502:
error('网络错误!');
break;
case 503:
error('服务不可用,服务器暂时过载或维护!');
break;
case 504:
error('网络超时!');
break;
case 505:
error('http版本不支持该请求!');
break;
case 603:
error('尚未登录或登录已过期,请重新登录', 'removeToken');
break;
case 505:
error('http版本不支持该请求!');
break;
case 'fail':
error('网络连接错误');
break;
case 'custom':
error(`${msg}`);
break;
default:
}
}
export {
checkStatus,
showLoading
}
\ No newline at end of file
import axios from 'axios'
export const Common = {
// 提示框
confirmDialog: (tipData) => {
tipData.that.$confirm(tipData.tipText, tipData.tipTitle, {
confirmButtonText: tipData.confirmButtonText || '确定',
cancelButtonText: tipData.cancelButtonText || '取消',
type: tipData.type,
showCancelButton: tipData.showCancelButton
}).then(() => {
tipData.callBack ? tipData.callBack() : ''
}).catch(() => {
tipData.errorCallBack ? tipData.errorCallBack() : ''
})
},
/**
* 导出excel
* */
exportExcel: function (options) {
if (!options) {
return false
}
console.log(options.data)
axios({
method: options.method || 'POST',
url: options.url,
params: options.data,
responseType: 'blob',
headers: {
Authorization: localStorage.getItem('token') || ''
}
}).then(response => {
if (!response) {
return
}
let url = window.URL.createObjectURL(new Blob([response.data], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
}))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', options.fileName || 'excel.xlsx')
document.body.appendChild(link)
link.click()
if (options.success) {
(options.success)()
}
}).catch((error) => {
if (options.errorFunc) {
(options.errorFunc)(error)
}
})
},
/**
* 正整数
* */
checkRegExpNumber(rule, value, callback) {
var rxp = /^\+?[1-9][0-9]*$/
if (!rule.required) {
if (!value) {
callback()
}else if (!rxp.test(value)) {
return callback(new Error('只支持正整数'))
}
}
if (!value) {
return callback(new Error('请输入正整数'))
}else {
callback()
}
},
/**
* 手机号
* */
checkRegExpPhoneTel(rule, value, callback) {
var rxpPhone = /^1[345789]\d{9}$/
var rxpTel = /^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/
if (!rule.required) {
if (!value) {
callback()
}else if (!rxpPhone.test(value)) {
return callback(new Error('请输入正确的手机号码'))
}
}
if (!value) {
return callback(new Error('请输入手机号码或固话'))
}else if (!rxpPhone.test(value) && !rxpTel.test(value)) {
return callback(new Error('请输入正确的手机号码或固话'))
}else {
callback()
}
},
/**
* 中文英文数字下划线括号
*/
checkName(rule, value, callback) {
var rxp = /^[\u4e00-\u9fa5_a-zA-Z0-9.\\()\\()]+$/
if (!rule.required) {
if (!value) {
callback()
}else if (!rxp.test(value)) {
return callback(new Error('请输入中文英文数字下划线或括号'))
}
}
if (!value) {
return callback(new Error('请输入'))
}else {
callback()
}
}
}
const Constants = {
// 用户状态
USER_STATUS: {
'1': '正常, green',
'2': '停用, red'
},
// 角色数据权限
ROLE_AUTH: {
'0': '本人',
'1': '本人及下属',
'2': '本人部门',
'3': '本部门及下级部门',
'4': '全部'
},
// 租户可见度
ROLE_VISIBLE: {
0: '共享',
1: '仅系统管理员',
2: '可见租户'
},
// 菜单类型
MENU_TYPE: {
1: '目录'
},
MENU_OTYPE: {
2: '菜单',
3: '按钮'
},
MENU_NAME: {
1: '目录',
2: '菜单',
3: '按钮'
},
// 菜单状态
MENU_STATUS: {
1: '正常, green',
2: '不显示, gray'
},
// 组织状态
ORGINIZA_STATUS: {
'1': '正常',
'2': '停用'
},
// 字典状态
DICT_STATUS: {
'1': '启用, green',
'2': '停用, red'
},
// 日志操作状态
WORKLOG_STATUS: {
'0': '成功, green-text',
'-1': '失败, red-text'
}
}
export default Constants
import axios from 'axios'
import store from '@/store'
import { checkStatus, showLoading } from './checkStatus'
const instance = axios.create({ // 创建axios实例,在这里可以设置请求的默认配置
timeout: 60000, // 设置超时时间60s
retry: 3,
retryDelay: 1000
})
// 统一设置post请求头
instance.defaults.headers.post['Content-Type'] = 'application/json'
/** 添加请求拦截器 **/
instance.interceptors.request.use(config => {
config.headers['Authorization'] = localStorage.getItem('token') || ''
showLoading(true)
return config
}, error => {
console.log('请求错误,原因:', error)
showLoading(false)
return Promise.reject(error)
})
/** 添加响应拦截器 **/
instance.interceptors.response.use(response => {
showLoading(false)
const serverCode = response.data.code,
token = response.headers['authorization']
if (token || token === '') {
localStorage.setItem('token', token)
}
if (serverCode === 200 || response.status === 200) {
if (serverCode !== 200) {
checkStatus(serverCode)
}
if (response.status) {
return Promise.resolve(response)
}
return Promise.resolve(response.data)
} else {
checkStatus(serverCode)
return Promise.reject(response.data.message)
}
}, error => {
showLoading(false)
const errRes = error.response
if (errRes) {
const { data, config, status, statusText } = errRes
checkStatus(status)
console.log(`${config.url} 接口请求出错,状态码${status}`)
return Promise.reject(error)
} else {
checkStatus('fail')
console.log('http request fail 请求失败')
return Promise.reject(new Error('请求失败'))
}
// 超时处理
var config = error.config
if (!config || !config.retry) return Promise.reject(error)
// 设置用于跟踪重试次数的变量
config.__retryCount = config.__retryCount || 0
// 检查我们是否已将重试总数最大化
if (config.__retryCount >= config.retry) {
// 错误拒绝
return Promise.reject(error)
}
// 增加重试次数
config.__retryCount += 1
// 创造新的承诺来处理指数退避
var backoff = new Promise(function (resolve) {
setTimeout(function () {
resolve()
}, config.retryDelay || 1)
})
// 返回承诺,其中将撤回axios以重试请求
return backoff.then(function () {
return axios(config)
})
})
// 从mock获取基础域名配置
const MOCK_CONFIG_URL = 'https://oss-config.test.glsx.com.cn/mock/60a371eafb9c105681999ab8/microCustomizationService/e-shield-trialrun_config'
let baseFlag = true
const getBaseUrl = () => {
return new Promise((resolve, reject) => {
let BASE_URL = store.state.baseURL
if (!BASE_URL && baseFlag) {
baseFlag = false
instance({
url: MOCK_CONFIG_URL,
method: 'get'
}).then((res) => {
const resData = res.data
if (resData) {
const resBaseURL = resData.axios.baseURL
store.commit('updateBaseURL', resBaseURL)
baseFlag = !resBaseURL
resolve(resBaseURL)
} else {
baseFlag = true
resolve(BASE_URL)
}
}).catch((err) => {
baseFlag = true
resolve(BASE_URL)
})
} else {
resolve(BASE_URL)
}
})
}
const HTTP_POST = (baseUrl, options) => {
instance({
url: baseUrl + options.url,
method: 'post',
data: JSON.stringify(options.data)
}).then((res) => {
options.success(res.data)
}).catch((err) => {
options.error(err)
})
}
const HTTP_GET = (baseUrl, options) => {
instance({
url: baseUrl + options.url,
method: 'get',
params: options.data
}).then((res) => {
options.success(res.data)
}).catch((err) => {
options.error(err)
})
}
export default class HTTP {
axiosPost (options) {
getBaseUrl().then((baseUrl) => {
HTTP_POST(baseUrl, options)
}, (err) => {
HTTP_POST('')
})
}
axiosGet (options) {
getBaseUrl().then((baseUrl) => {
HTTP_GET(baseUrl, options)
}, (err) => {
HTTP_GET('')
})
}
}
function trimSpace(str) {
return str.replace(/\s+/g, '');
}
// trimSpace(str).length < = 0弹出提示
function throttle (fn, delay) {
var t = null,
begin = new Date().getTime();
return function () {
var _self = this,
args = arguments,
cur = new Date().getTime();
clearTimeout(t);
if(cur - begin >= delay) {
fn.apply(_self, args);
begin = cur;
} else {
t = setTimeout(function () {
fn.apply(_self, args);
}, delay);
}
}
}
function debounce(fn, delay, triggerNow) {
var t = null;
var debounced = function(){
var _self = this,
args = arguments;
if(t){
clearTimeout(t);
}
if(triggerNow){
var exec = !t;
t = setTimeout(function(){
t = null;
}, delay);
if(exec){
// 初次进来
fn.apply(_self, args);
}
}else{
t = setTimeout(function(){
fn.apply(_self, args);
}, delay);
}
}
debounced.remove = function(){
clearTimeout(t);
t = null;
}
return debounced;
}
export {
trimSpace,
throttle,
debounce
}
\ No newline at end of file
<template>
<div class="home">
</div>
</template>
<script>
export default {
name: 'Home',
components: {
},
data() {
return {
}
},
mounted() {
this.$root.parentVuex.dispatch('app/setCommonData', { showEmpty: true });
},
methods: {
// changeParentState(){
// if(this.isQiankun){
// this.$root.parentVuex.commit('setCommonData', { parent: this.num++ });
// }
// }
}
}
</script>
<template>
<div id="home">
VUE MIRCRO CHILD
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
<template>
<div class="system-container">
<div class="container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="menuFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
@click="search"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
@click="refresh"
>重置</el-button>
</slot>
</search-form>
<div class="table-btn">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-plus"
@click="btnClick('create')"
>新增目录</el-button>
</div>
<el-table
ref="menuTable"
:data="menuTableData"
style="width: 100%"
row-key="id"
lazy
:load="load"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column
v-for="(item,index) in listHeadData"
:key="index"
:prop="item.prop"
:sortable="item.sortable"
:ref="item.ref"
:width="item.width"
:label="item.label"
show-overflow-tooltip
>
<template slot-scope="scope">
<template v-if="item.prop === 'enableStatus'">
<span
class="dot"
:class="scope.row.enableStatus ? MENUSTATUS[scope.row.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.row.enableStatus ? MENUSTATUS[scope.row.enableStatus].split(',')[0] : '--'}}</span>
</template>
<template v-else-if="item.prop === 'type'">
<span>
{{scope.row.type ? MENU_NAME[scope.row.type] : '--'}}
</span>
</template>
<template v-else>
{{scope.row[item.prop]?scope.row[item.prop]:'--'}}
</template>
</template>
</el-table-column>
<el-table-column
align="center"
width="250"
fixed="right"
prop="btn"
label="操作"
>
<template slot-scope="scope">
<el-button
v-for="(j, idx) in tableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.row)"
>{{j.name}}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageNum"
:page-sizes="[10,20,30,40]"
:page-size="page.pageSize"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
>
</el-pagination>
<basic-dialog
:title="menuDialogTitle"
:isVisible="menuVisible"
@confirmDialog="handleConfirm"
@closeDialog="handleClose"
>
<slot>
<rule-form
:ruleForm="menuForm"
:rules="menuRules"
:ruleData="menuData"
@radioChange="radioChange"
ref='menuForm'
></rule-form>
</slot>
</basic-dialog>
<basic-dialog
:title="filterDialogTitle"
:isVisible="filterVisible"
@confirmDialog="filterConfirm"
@closeDialog="closeFilter"
>
<slot>
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
>
</el-input>
<el-tree
class="filter-tree"
:data="filterTextData"
:props="defaultProps"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
check-on-click-node
>
</el-tree>
</slot>
</basic-dialog>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import { getMenuList, getMenuChildren, addMenu, editMenu, menuInfo, deleteMenu, getPermtree } from 'services/menu';
export default {
data() {
return {
MENUSTATUS: this.$Constants.MENU_STATUS,
MENU_NAME: this.$Constants.MENU_NAME,
searchForm: {},
menuFormList: [
{
type: 'input',
inputType: 'text',
prop: 'name',
placeholder: '请输入菜单名称'
},
{
type: 'select',
prop: 'enableStatus',
placeholder: '请选择菜单状态',
options: [{
value: '1',
label: '正常'
}, {
value: '2',
label: '不显示'
}]
}
],
menuTableData: [],
// 列表 头部设置 数据
listHeadData: [
{ prop: 'menuName', label: '菜单名称', width: '200' },
{ prop: 'orderNum', label: '排序' },
{ prop: 'frontRoute', label: '请求地址' },
{ prop: 'type', label: '菜单类型' },
{ prop: 'enableStatus', label: '状态' },
{ prop: 'permissionTag', label: '权限标识' }
],
page: {
pageSize: 10,
pageNumber: 1
},
total: 10,
tableParams: {
tableOption: {
btnList: [
{
type: 'primary',
name: '新增',
pType: 'btnCreate'
},
{
type: 'primary',
name: '编辑',
pType: 'edit'
},
{
type: 'danger',
name: '删除',
pType: 'delete'
}
]
}
},
// 弹窗数据
menuDialogTitle: '新增菜单',
menuVisible: false,
menuForm: {
type: '1',
parentName: '',
enableStatus: true
},
form: {
// type: '1',
parentName: '',
enableStatus: true
},
menuData: [
{ label: '菜单类型:', prop: 'type', type: 'radio', children: this.$Constants.MENU_TYPE, disabled: false },
{ label: '上级菜单:', prop: 'parentName', type: 'input', readonly: true, clickFunc: this.selectSuperior, hidden: true },
{ label: '菜单名称:', prop: 'menuName', type: 'input', maxlength: 20 },
{ label: '权限标识:', prop: 'permissionTag', type: 'input' },
{ label: '前端路由:', prop: 'frontRoute', type: 'input' },
{ label: '显示排序:', prop: 'orderNum', type: 'input', maxlength: 5 },
{ label: '显示状态:', prop: 'enableStatus', type: 'switch' },
{ label: '图标:', prop: 'icon', type: 'input', hidden: false }
],
menuRules: {
type: [{ required: true, message: '请选择菜单类型', trigger: 'blur' }],
menuName: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
orderNum: [{ required: true, message: '请输入显示排序', trigger: 'blur' },
{ validator: this.$Common.checkRegExpNumber, trigger: 'blur' }],
enableStatus: [{ required: true }],
},
// 部门弹窗
filterDialogTitle: '选择上级',
filterVisible: false,
filterText: '',
filterTextData: [],
defaultProps: {
children: 'children',
label: 'label'
},
loading: false,
isOpen: true
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
}
},
mounted() {
this.search()
},
methods: {
search() {
let params = Object.assign({}, this.searchForm, this.page)
this.getList(params)
},
// 重置搜索条件
refresh() {
this.searchForm = {}
},
emptyData(params) {
let arr = params
for (let key in arr) {
if (params[key] == null || params[key] == '' || params[key] == []) {
delete params[key]
}
}
return arr
},
// 确定,新增、编辑
handleConfirm() {
this.$refs.menuForm.$children[0].validate((valid) => {
if (valid) {
let params = JSON.parse(JSON.stringify(this.menuForm))
params.enableStatus = this.menuForm.enableStatus ? 1 : 2
if (params.parentName) delete params.parentName
if (params.menuNo) delete params.menuNo
if (params.ppId) delete params.ppId
this.emptyData(params)
let api = addMenu
if (params.id) api = editMenu
api(params).then(res => {
if (res.code == 200) {
this.$message({
type: 'success',
message: '操作成功!'
})
this.handleClose()
this.$root.parentVuex.dispatch('menu/updateMenu', params)
if (params.parentId) {
getMenuChildren({ parentId: params.parentId }).then(res => {
this.$set(this.$refs.menuTable.store.states.lazyTreeNodeMap, this.menuForm.ppId, res.data)
})
} else {
this.search()
}
} else {
this.$message({
type: 'error',
message: res.message
})
}
})
}
})
},
// 取消
handleClose() {
if (!this.menuVisible && this.$refs.menuForm) {
this.$refs.menuForm.$children[0].resetFields()
}
this.menuVisible = !this.menuVisible
},
// 按钮事件
btnClick(pType, scope) {
switch (pType) {
case 'create':
this.isOpen = true
this.menuDialogTitle = '新增目录'
this.menuData.map(item => {
if (item.prop == 'parentName') {
item.hidden = true
} else if (item.prop == 'type') {
item.children = this.$Constants.MENU_TYPE
item.disabled = false
} else if (item.prop == 'icon') {
item.hidden = false
}
})
this.menuForm = _.cloneDeep(this.form)
this.handleClose()
break
case 'btnCreate':
this.isOpen = true
this.menuDialogTitle = '新增菜单'
this.menuData.map(item => {
if (item.prop == 'type') {
item.children = this.$Constants.MENU_OTYPE
item.disabled = false
} else if (item.prop == 'icon') {
item.hidden = true
}
})
this.menuForm = _.cloneDeep(this.form)
this.menuForm.ppId = scope.id
this.handleClose()
break
case 'edit':
this.menuDialogTitle = '编辑菜单'
this.menuData.map(item => {
if (item.prop == 'type') {
item.disabled = true
} else if (item.prop == 'icon') {
item.hidden = !(scope.parentId == 0)
}
})
this.isOpen = false
this.editEvent(scope)
break
case 'delete':
this.deleteEvent(scope)
break
}
},
// 编辑触发事件
editEvent(row) {
if (row.parentId == 0) {
this.menuData[0].children = this.$Constants.MENU_TYPE
this.menuData[1].hidden = true
} else {
this.menuData[0].children = this.$Constants.MENU_OTYPE
this.menuData[1].hidden = false
}
menuInfo({ menuId: row.id }).then(res => {
this.menuForm = JSON.parse(JSON.stringify(res.data))
this.menuForm.enableStatus = res.data.enableStatus == 1 ? true : false
this.menuForm.type = res.data.type + ''
this.handleClose(res.data)
})
},
// 删除触发事件
deleteEvent(row) {
console.log(row)
const that = this
const tipData = {
that: that,
tipText: '是否删除当前记录',
tipTitle: '提示',
type: 'error',
callBack: () => {
deleteMenu({ menuId: row.id }).then(res => {
if (res.code == 200) {
this.$message({
type: 'success',
message: '删除成功!'
})
this.$root.parentVuex.dispatch('menu/updateMenu', row.id);
if (row.parentId == 0) {
this.getList()
} else {
getMenuChildren({ parentId: row.parentId }).then(res => {
const nodes = res.data
this.$set(this.$refs.menuTable.store.states.lazyTreeNodeMap, row.ppId, nodes)
})
}
} else {
this.$message({
type: 'error',
message: res.message
})
}
})
}
}
this.$Common.confirmDialog(tipData)
},
load(tree, treeNode, resolve) {
getMenuChildren({ parentId: tree.menuNo }).then(res => {
resolve(res.data)
})
},
// 上级弹窗
selectSuperior() {
if (this.isOpen) {
this.getPermtree()
this.closeFilter()
}
},
closeFilter() {
this.filterVisible = !this.filterVisible
},
filterConfirm() {
this.menuForm.parentId = this.$refs.tree.getCurrentNode().id
this.menuForm.parentName = this.$refs.tree.getCurrentNode().label
this.closeFilter()
},
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
getList(params) {
getMenuList(params).then((res) => {
if (res.code == 200) {
this.total = res.data.totalElements
this.menuTableData = res.data.list
} else {
this.menuTableData = []
}
})
},
// 获取上级菜单
getPermtree() {
getPermtree().then(res => {
if (res.code = 200) {
this.filterTextData = res.data
}
})
},
// 页码
handleSizeChange(value) {
this.page.pageSize = value
this.search()
},
handleCurrentChange(value) {
this.page.pageNumber = value
this.search()
},
radioChange(event, prop) {
if (event != 1) {
this.menuData.map(item => {
if (item.prop == 'parentName') {
item.hidden = false
}
})
} else {
this.menuData.map(item => {
if (item.prop == 'parentName') {
item.hidden = true
}
})
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>
\ No newline at end of file
<template>
<div class="system-container">
<div class="container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="reportFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="reportTableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
<el-button
type="primary"
:size="btn_size"
>导出Excel</el-button>
</slot>
</search-form>
<basic-table
ref="roleTable"
:tableParams="reportTableParams"
:searchForm="searchForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in reportTableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
</div>
</div>
</template>
<script>
import { getProvinceList } from 'services/common';
export default {
data() {
return {
searchForm: {},
reportFormList: [
{
type: 'input',
inputType: 'text',
prop: 'status',
placeholder: '特约店代码',
},
{
type: 'input',
inputType: 'text',
prop: 'status',
placeholder: '特约店名称',
},
{
type: 'input',
inputType: 'text',
prop: 'status',
placeholder: '承租人姓名',
},
{
type: 'input',
inputType: 'text',
prop: 'status',
placeholder: '联系电话',
},
{
type: 'input',
inputType: 'text',
prop: 'status',
placeholder: '业务类型',
},
{
type: 'input',
inputType: 'text',
prop: 'status',
placeholder: '项目分组',
},
{
type: 'selectDate',
prop: 'status',
dateModel: '',
placeholder: '请选择',
options: [{
label: '全部类型',
value: 0
}, {
label: '试驾围栏修改审核',
value: 1
}, {
label: '上牌资料审核',
value: 2
}]
}
],
reportTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '特约店代码',
prop: 'roleName'
}, {
label: '特约店名称',
prop: 'remark'
}, {
label: '车型',
prop: 'enableStatus'
}, {
label: '车架号VIN码',
prop: 'createdDate'
}, {
label: '时间',
prop: 'createdDate'
}
]
},
list: {
"message": "success",
"code": 200,
"data": [
{
"id": 1,
"code": "11",
"name": "北京市",
"regionCode": "000003",
"regionName": "华北大区"
},
{
"id": 2,
"code": "12",
"name": "天津市",
"regionCode": "000003",
"regionName": "华北大区"
},
{
"id": 33,
"code": "81",
"name": "香港",
"regionCode": "000008",
"regionName": "港澳台大区"
},
{
"id": 34,
"code": "82",
"name": "澳门",
"regionCode": "000008",
"regionName": "港澳台大区"
}
]
}
}
},
mounted() {
getProvinceList().then(res => {
console.log(res)
})
},
methods: {
btnClick(type, scope) {
}
},
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<h2>基础信息</h2>
<el-divider></el-divider>
<el-form
ref="shopForm"
:model="shopForm"
label-width="120px"
:inline="true"
>
<el-form-item label="特约店名称:">
<el-input
v-model="shopForm.shopName"
placeholder="请输入特约店名称"
></el-input>
</el-form-item>
<el-form-item label="特约店编码:">
<el-input
v-model="shopForm.shopCode"
Placeholder="请输入特约店编码"
></el-input>
</el-form-item>
<el-form-item label="特约店级别:">
<el-radio-group v-model="shopForm.shopLevel">
<el-radio label="">一级店</el-radio>
<el-radio label="">二级店</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="特约店详细地址:">
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
shopForm: {}
}
},
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="system-container vehicle">
<div class="container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="shopFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="shopTableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
</slot>
</search-form>
<h3>
<el-button
v-for="item in authList"
:key="item.id"
:type="item.type"
:size="btn_size"
@click="btnClick(item.pType)"
>{{item.name}}</el-button>
</h3>
<basic-table
ref="roleTable"
:tableParams="shopTableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in shopTableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
</div>
</div>
</template>
<script>
import { getList } from 'services/specialshop'
export default {
data() {
return {
searchForm: {},
shopFormList: [
{
label: '关键字:',
type: 'input',
inputType: 'text',
prop: 'term',
placeholder: '特约店编码|特约店名称',
}
],
shopTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
mutiSelectName: 'specialShop',
listName: 'list',
tableColumns: [
{
label: '特约店编码',
prop: 'shopCode'
}, {
label: '特约店名称',
prop: 'shopName'
}, {
label: '店级别',
prop: 'shopLevel'
}, {
label: '所属大区',
prop: 'area'
}, {
label: '所属省',
prop: 'province'
}, {
label: '所属市',
prop: 'city'
}, {
label: '详细地址',
prop: 'address'
}, {
label: '店围栏名',
prop: 'fenceName'
}
],
tableOption: {
width: 300,
btnList: [
{
type: 'danger',
name: '删除',
pType: 'delete'
},
{
type: 'primary',
name: '编辑',
pType: 'edit'
},
{
type: 'primary',
name: '查看',
pType: 'edit'
}
]
}
},
getListApi: getList,
authList: [
{
id: 1,
name: '新增特约店',
type: 'primary',
pType: 'create'
},
{
id: 2,
name: '批量删除',
type: 'default',
pType: 'delete'
},
{
id: 3,
name: '批量导出',
type: 'default',
pType: 'export'
}
]
}
},
methods: {
btnClick(pType, scope) {
console.log(pType)
switch (pType) {
case 'create':
this.$router.push({ name: 'addShop' })
break
}
}
},
}
</script>
<style>
.vehicle .el-form .el-input__inner {
width: 300px;
}
</style>
\ No newline at end of file
<template>
<div class="system-container">
<div class="container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="todoFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="todoTableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
</slot>
</search-form>
<basic-table
ref="roleTable"
:tableParams="todoTableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in todoTableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
</div>
</div>
</template>
<script>
export default {
data() {
return {
searchForm: {},
todoFormList: [
{
label: '处理状态:',
type: 'select',
prop: 'status',
placeholder: '请选择',
options: [{
label: '全部待办',
value: 0
}, {
label: '未处理',
value: 1
}, {
label: '已处理',
value: 2
}]
},
{
label: '事项类型:',
type: 'select',
prop: 'status',
placeholder: '请选择',
options: [{
label: '全部类型',
value: 0
}, {
label: '试驾围栏修改审核',
value: 1
}, {
label: '上牌资料审核',
value: 2
}]
}
],
todoTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '事项类型',
prop: 'roleName'
}, {
label: '创建人',
prop: 'remark'
}, {
label: '车辆类型',
prop: 'enableStatus'
}, {
label: '创建时间',
prop: 'createdDate'
}
],
tableOption: {
width: 300,
btnList: [
{
type: 'primary',
name: '编辑',
pType: 'edit'
},
{
type: 'danger',
name: '删除',
pType: 'delete'
}
]
}
}
}
},
methods: {
btnClick(type, scope) {
}
},
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="system-container vehicle">
<div class="container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="todoFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="todoTableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
>重置</el-button>
</slot>
</search-form>
<h3>试驾车辆信息
<div class="pull-right">
<template>
<el-button
v-for="item in authList"
:key="item.id"
:type="item.type"
:size="btn_size"
>{{item.name}}</el-button>
</template>
</div>
</h3>
<basic-table
ref="roleTable"
:tableParams="todoTableParams"
:getListApi="getListApi"
:searchForm="searchForm"
:hasNum="false"
>
<span
slot="status"
slot-scope="scope"
>
<span
class="dot"
:class="scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[1] : ''"
></span>
<span class="statusText">{{ scope.scope.enableStatus ? USERSTATUS[scope.scope.enableStatus].split(',')[0] : '--'}}</span>
</span>
<span
slot="table-button"
slot-scope="scope"
>
<el-button
v-for="(j, idx) in todoTableParams.tableOption.btnList"
:key="idx"
:type="j.type"
size="mini"
plain
@click="btnClick(j.pType, scope.scope)"
>{{j.name}}</el-button>
</span>
</basic-table>
</div>
</div>
</template>
<script>
export default {
data() {
return {
searchForm: {},
todoFormList: [
{
label: '关键字:',
type: 'input',
inputType: 'text',
prop: 'status',
placeholder: '特约店编码|店名称|车架号|设备号|车型',
}
],
todoTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '业务工单号',
prop: 'roleName'
}, {
label: '所属大区',
prop: 'remark'
}, {
label: '所属省',
prop: 'enableStatus'
}, {
label: '所属市',
prop: 'createdDate'
}, {
label: '特约店名称',
prop: 'createdDate'
}, {
label: '特约店编码',
prop: 'createdDate'
}, {
label: '店级别',
prop: 'createdDate'
}, {
label: '车架号',
prop: 'createdDate'
}, {
label: '车型',
prop: 'createdDate'
}, {
label: '配置',
prop: 'createdDate'
}, {
label: '车牌',
prop: 'createdDate'
}, {
label: '设备号',
prop: 'createdDate'
}, {
label: '安装日期',
prop: 'createdDate'
}
],
tableOption: {
width: 300,
btnList: [
{
type: 'primary',
name: '编辑',
pType: 'edit'
},
{
type: 'danger',
name: '删除',
pType: 'delete'
},
{
type: 'primary',
name: '查看',
pType: 'edit'
},
{
type: 'danger',
name: '解绑',
pType: 'delete'
}
]
}
},
authList: [
{
id: 1,
name: '新增车辆',
type: 'primary',
callback: 'create'
},
{
id: 2,
name: '车辆导入',
type: 'default',
callback: 'create'
},
{
id: 3,
name: '导出Excel',
type: 'default',
callback: 'create'
}
]
}
},
methods: {
btnClick(type, scope) {
}
},
}
</script>
<style>
.vehicle .el-form .el-input__inner {
width: 300px;
}
</style>
\ No newline at end of file
<template>
<div class="system-container">
<div class="container">
<search-form
class="searchTop border-shadow"
:formModel="searchForm"
:formList="worklogFormList"
>
<slot name="form-slot">
<el-button
type="primary"
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
@click="refresh"
>重置</el-button>
</slot>
</search-form>
<div class="table-btn">
<el-button
type="primary"
:size="btn_size"
@click="exportTable"
>导出</el-button>
</div>
<basic-table
ref="worklogTable"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
:searchForm="searchDataForm"
:hasNum="false"
>
</basic-table>
</div>
</div>
</template>
<script>
import store from '@/store';
import { WORKLOG_API } from '@/config/config'
import { getWorkLogList, exportWorkLog } from 'services/worklog';
export default {
data() {
return {
WORKLOGSTATUS: this.$Constants.WORKLOG_STATUS,
searchForm: {},
searchDataForm: {},
worklogFormList: [
{
type: 'daterange',
prop: 'daterange',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
}
],
tableParams: {
// mutiSelectName: 'worklog',
// mutiSelectUniqueKey: 'id',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '日志编号',
prop: 'id'
}, {
label: '系统菜单',
prop: 'module'
}, {
label: '操作类型',
prop: 'action'
}, {
label: '操作账号',
prop: 'operatorName'
}, {
label: '所属组织',
prop: 'belongOrg'
}, {
label: '主机IP',
prop: 'ip',
}, {
label: '操作状态',
prop: 'result',
// addHtml: 'status'
}, {
label: '创建时间',
prop: 'createdDate'
}
]
},
getListApi: getWorkLogList
}
},
methods: {
refresh() {
this.searchForm = {}
this.searchDataForm = {}
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
if (this.searchForm.daterange) {
this.searchDataForm.sDate = this.searchForm.daterange[0]
this.searchDataForm.eDate = this.searchForm.daterange[1]
} else {
if (this.searchDataForm.sDate) delete this.searchDataForm.sDate && delete this.searchDataForm.eDate
}
resolve()
})
},
// 导出列表
exportTable() {
const params = this.$refs.worklogTable.page
this.$Common.exportExcel({
url: store.state.baseURL + WORKLOG_API.WORKLOG_EXPORT,
data: params,
method: 'GET',
fileName: '操作日志.xlsx'
})
}
}
}
</script>
\ No newline at end of file
const path = require('path')
const { name, port } = require("./package");
function resolve (dir) {
return path.join(__dirname, dir)
}
const dev = process.env.NODE_ENV === "development";
const getPublicPath = dev ? `//localhost:${port}` : 'http://eshield-perm.test.glsx.com.cn';
module.exports = {
// publicPath: dev ? `//localhost:${port}` : "/",
outputDir: "dist",
assetsDir: "static",
filenameHashing: true,
devServer: {
overlay: {
warning: false,
errors: false
},
// 监听端口
port,
// 关闭主机检查,使微应用可以被 fetch
disableHostCheck: true,
// 配置跨域请求头,解决开发环境的跨域问题
headers: {
'Access-Control-Allow-Origin': '*'
}
},
lintOnSave: false,
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src'))
.set('components', resolve('src/components'))
.set('config', resolve('src/config'))
.set('utils', resolve('src/utils'))
.set('services', resolve('src/services'))
const fontRule = config.module.rule('fonts');
fontRule.uses.clear();
fontRule
.use('file-loader')
.loader('file-loader')
.options({
name: 'fonts/[name].[hash:8].[ext]',
publicPath: getPublicPath
})
.end()
},
configureWebpack: {
output: {
// 微应用的包名,这里与主应用中注册的微应用名称一致
library: `${name}-[name]`,
// 将你的 library 暴露为所有的模块定义下都可运行的方式
libraryTarget: 'umd',
// 按需加载相关
jsonpFunction: `webpackJsonp_${name}`
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!