Commit 5644be2d by 姜雷

添加全路由

parents
> 1%
last 2 versions
not ie <= 8
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
VUE_APP_LIB_BASE_MANAGER=http://ex-dev-dcxy-static.168cad.top
VUE_APP_BASE_URL=/systemManageShell/
VUE_APP_MENU_CODE=0003
VUE_APP_WHITE_LIST=/login,/404,/401
VUE_APP_SYSTEM_SERVER_URL=http://ex-dev-dcxy-system-manage.168cad.top
VUE_APP_CUSTOMER_SERVER_URL=http://ex-dev-customer-manage.168cad.top
VUE_APP_BASE_SERVER_URL=http://ex-dev-dcxy-base-manage.168cad.top
VUE_APP_BASE_SERVER_URL_APP=http://ex-dev-dcxy-base-app.168cad.top
NODE_ENV = production
VUE_APP_SYSTEM_SERVER_URL=http://192.168.1.33:8886
VUE_APP_CUSTOMER_SERVER_URL=http://ex-dev-customer-manage.168cad.top
VUE_APP_BASE_SERVER_URL=http://ex-dev-dcxy-base-manage.168cad.top
VUE_APP_BASE_SERVER_URL_APP=http://ex-dev-dcxy-base-app.168cad.top
NODE_ENV = production
NODE_ENV = production
VUE_APP_SYSTEM_SERVER_URL=http://ex-test-dcxy-system-manage.168cad.top
VUE_APP_CUSTOMER_SERVER_URL=http://ex-test-customer-manage.168cad.top
VUE_APP_BASE_SERVER_URL=http://ex-test-dcxy-base-manage.168cad.top
VUE_APP_BASE_SERVER_URL_APP=http://ex-test-dcxy-base-app.168cad.top
/build/
/config/
/dist/
/*.js
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
extends: ['plugin:vue/essential'],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
.DS_Store
node_modules/
/dist/
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"requirePragma": false,
"proseWrap": "preserve"
}
# 运维替换文件
打包分别有 3 种模式
```bash
npm run build:dev # 开发环境
npm run build:test # 测试环境
npm run build:master # 生成环境
```
替换配置也有 3 种模式
根目录下`.env.dev`,`.env.test`,`.env.master`,分别替换服务地址
```bash
VUE_APP_SYSTEM_SERVER_URL=http://ex-dev-dcxy-system-manage.168cad.top #系统管理接口
VUE_APP_CUSTOMER_SERVER_URL=http://ex-dev-customer-manage.168cad.top #会员系统接口
VUE_APP_BASE_SERVER_URL=http://ex-dev-dcxy-base-manage.168cad.top #基础服务接口
VUE_APP_BASE_SERVER_URL_APP=http://ex-dev-dcxy-base-app.168cad.top #基础服务APP接口
```
## Build Setup
```bash
# install dependencies
npm install
# build for production with minification
npm run build:{mode}
# build for production and view the bundle analyzer report
npm run build --report
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
module.exports = {
presets: ['@vue/app'],
plugins: [
[
'component',
{
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk',
},
],
],
};
{
"name": "admin",
"version": "1.0.0",
"description": "A Vue.js project",
"author": "kuangshu <252019869@qq.com>",
"private": true,
"scripts": {
"dev": "vue-cli-service serve --port 8891",
"start": "npm run dev",
"lint": "eslint --ext .js,.vue src",
"build": "vue-cli-service build --modern",
"build:dev": "vue-cli-service build --modern --mode dev",
"build:test": "vue-cli-service build --modern --mode test",
"build:master": "vue-cli-service build --modern --mode master",
"build:prod": "vue-cli-service build --modern",
"buildapp:dev": "vue-cli-service build --modern --mode dev",
"buildlib:dev": "vue-cli-service build --target lib --name manageShell ./src/lib-main.js --modern --mode dev",
"analyz": "cross-env NODE_ENV=production npm_config_report=true npm run build"
},
"dependencies": {
"axios": "^0.18.0",
"blueimp-md5": "^2.10.0",
"element-ui": "^2.4.5",
"js-cookie": "^2.2.0",
"lodash": "^4.17.5",
"normalize.css": "^8.0.0",
"nprogress": "^0.2.0",
"popmotion": "^8.1.22",
"qiniu-js": "^2.2.0",
"rym-element-ui": "^0.1.43",
"vue": "^2.5.2",
"vue-qr": "^1.2.8",
"vue-router": "^3.0.1",
"vuedraggable": "^2.16.0",
"vuex": "^3.0.1",
"wangeditor": "^3.1.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.2.0",
"@vue/cli-plugin-eslint": "^3.2.0",
"@vue/cli-service": "^3.2.0",
"@vue/eslint-config-prettier": "^4.0.1",
"babel-eslint": "^10.0.1",
"babel-plugin-component": "^1.1.1",
"cross-env": "^5.2.0",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.21",
"webpack": "^4.28.3"
},
"engines": {
"node": ">= 8.0.0",
"npm": ">= 3.0.0"
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
<meta charset="utf-8">
<title>baseManage demo</title>
<script src="https://unpkg.com/vue"></script>
<script src="./baseManage.umd.js"></script>
<link rel="stylesheet" href="./baseManage.css">
<script>
console.log(baseManage)
</script>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511504199105" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1815" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M817.968553 215.897142l-169.357176 0 0-58.869782c0-25.391297-20.657482-46.048779-46.048779-46.048779l-181.125197 0c-25.391297 0-46.048779 20.657482-46.048779 46.048779l0 58.869782-169.357176 0c-25.391297 0-46.048779 20.657482-46.048779 46.048779l0 71.631434c0 25.391297 20.657482 46.048779 46.048779 46.048779l28.321022 0 0 425.947112c0 59.246359 48.200792 107.447151 107.447151 107.447151l340.40076 0c59.246359 0 107.447151-48.200792 107.447151-107.447151L789.647531 379.626133l28.321022 0c25.391297 0 46.048779-20.657482 46.048779-46.048779l0-71.631434C864.017332 236.554624 843.35985 215.897142 817.968553 215.897142zM426.553932 162.14389l170.892135 0 0 53.753251-170.892135 0L426.553932 162.14389zM738.482221 805.574269c0 31.033807-25.248034 56.281841-56.281841 56.281841L341.79962 861.85611c-31.033807 0-56.281841-25.248034-56.281841-56.281841L285.517779 379.626133l452.964442 0L738.482221 805.574269zM812.852022 328.460824l-601.704045 0 0-61.398372 203.227588 0c2.302439 0.356111 4.66116 0.542352 7.061836 0.542352l181.125197 0c2.400676 0 4.759397-0.186242 7.062859-0.542352l203.226564 0L812.852022 328.460824zM513.023306 783.320429c14.128789 0 25.582655-11.453866 25.582655-25.582655l0-288.572348c0-14.128789-11.453866-25.582655-25.582655-25.582655-14.128789 0-25.582655 11.453866-25.582655 25.582655l0 288.572348C487.440651 771.866562 498.894518 783.320429 513.023306 783.320429zM645.541459 783.320429c14.128789 0 25.582655-11.453866 25.582655-25.582655l0-288.572348c0-14.128789-11.453866-25.582655-25.582655-25.582655s-25.582655 11.453866-25.582655 25.582655l0 288.572348C619.958804 771.866562 631.41267 783.320429 645.541459 783.320429zM380.505154 783.320429c14.128789 0 25.582655-11.453866 25.582655-25.582655l0-288.572348c0-14.128789-11.453866-25.582655-25.582655-25.582655s-25.582655 11.453866-25.582655 25.582655l0 288.572348C354.922499 771.866562 366.376365 783.320429 380.505154 783.320429z" p-id="3757"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511504199105" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1815" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M185.89696 532.2752h286.72v286.72a20.48 20.48 0 1 0 40.96 0v-286.72h286.72a20.48 20.48 0 1 0 0-40.96h-286.72v-286.72a20.48 20.48 0 1 0-40.96 0v286.72h-286.72a20.48 20.48 0 1 0 0 40.96z" fill="" p-id="3098"></path></svg>
\ No newline at end of file
<!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" />
<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script> -->
<!-- <script src="<%= VUE_APP_LIB_BASE_MANAGER %>/baseManage/lib/manageShell.umd.js"></script> -->
<link
rel="stylesheet"
href="<%= VUE_APP_LIB_BASE_MANAGER %>/baseManage/lib/manageShell.css"
/>
<title>系统管理</title>
</head>
<body>
<noscript>
<strong
>We're sorry but hello-world doesn't work properly without JavaScript
enabled. Please enable it to continue.</strong
>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<app-layout v-if="isInnerPage">
<template slot="title">
<UserBox />
</template>
<template slot="nav">
<sidebar-nav :routers="route" />
</template>
<router-view v-if="routerDone" />
<div
class="loading-container"
v-else
v-loading="!routerDone"
></div>
</app-layout>
<router-view v-else />
</div>
</template>
<script>
import UserBox from './containers/layout/components/UserBox';
const whiteList = process.env.VUE_APP_WHITE_LIST.split(','); // 不重定向白名单
export default {
name: 'App',
components: { UserBox },
props: {
route: {
type: Array,
default: () => [],
},
},
data() {
return {
routerDone: false,
isInnerPage: true,
};
},
mounted() {
if (this.$route.meta && this.$route.meta.store) {
this.showComponents(this.$route.meta.store);
} else {
this.showComponents();
}
},
watch: {
$route(newVal) {
this.routerDone = false;
if (newVal.meta && newVal.meta.store) {
this.showComponents(newVal.meta.store);
} else {
this.showComponents();
}
},
},
methods: {
showComponents(store) {
this.isInnerPage =
whiteList.indexOf(this.$route.path) !== -1 ? false : true;
if (store) {
store.install(this.$store);
this.$nextTick(vm => {
this.routerDone = true;
});
} else {
this.routerDone = true;
}
},
},
};
</script>
<style lang="scss">
.loading-container {
margin: 50px;
}
</style>
import fetch from '../fetch';
const path = process.env.VUE_APP_BASE_SERVER_URL_APP;
export const getUploadImgToken = req =>
fetch({
url: path + '/common/getQNToken',
...req,
});
export const getDelImgToken = req =>
fetch({
url: path + '/common/deleteFiles',
...req,
});
import fetch from '../fetch';
const path = process.env.VUE_APP_BASE_SERVER_URL;
// const path = 'http://192.168.1.33:8889';
export const fetchAreaList = req =>
fetch({
url: path + '/dcxy/baseArea/queryAlls',
method: 'get',
...req,
});
//获取下拉列表
export const fetchSelectList = req =>
fetch({
url: path + '/baseData/get/baseData',
method: 'get',
...req,
});
//获取服务类型
export const fetchServiceList = req =>
fetch({
url: path + '/baseData/get/service',
method: 'get',
...req,
});
// 获取运营商
export const fetchOperatorList = req =>
fetch({
url: path + '/dcxy/baseOperator/queryAll',
method: 'get',
...req,
});
// 获取豆类型
export const fetchBeansList = req =>
fetch({
url: '/baseData/beans',
method: 'get',
...req,
});
// 获取所有菜单
export const fetchMenuTree = req =>
fetch({
url: '/menu/menuButton/list',
method: 'get',
...req,
});
// 获取所有系统用户
export const fetchAdminList = req =>
fetch({
url: '/admin/admin',
method: 'get',
...req,
});
import axios from 'axios';
import { Message, MessageBox } from 'element-ui';
import store from '@/store';
import { errorHandle } from './validate';
const createBaseFetch = config => {
const service = axios.create({
timeout: 10000,
...config,
});
let logout = false;
// request拦截器
service.interceptors.request.use(
conf => {
store.dispatch('fetchStart');
conf.headers = {
...conf.headers,
reqSource: 'pc',
token: store.getters.token ? store.getters.token : '',
};
return conf;
},
error => {
// Do something with request error
console.log(error); // for debug
Promise.reject(error);
}
);
// respone拦截器
service.interceptors.response.use(response => {
const res = response.data;
/**
* code为非 1000 是抛错
*/
setTimeout(() => {
store.dispatch('fetchDone');
}, 500);
if (res.code !== 1000) {
if (
response.headers &&
/application\/octet-stream/.test(response.headers['content-type'])
) {
return response;
}
Message({
message: res.msg || '网络错误!',
type: 'error',
duration: 5 * 1000,
});
// -2:其他客户端登录了;Token 过期了;
if (res.code === -2) {
if (logout) return;
logout = true;
MessageBox.confirm(
'你已被登出,可以取消继续留在该页面,或者重新登录',
'确定登出',
{
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
store.dispatch('FedLogOut').then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
});
})
.catch(err => {
console.log(err);
logout = false;
});
}
return Promise.reject(response.data);
} else {
return response.data;
}
}, errorHandle);
return service;
};
export default createBaseFetch;
import axios from 'axios';
import { Message, MessageBox } from 'element-ui';
import store from '../store';
import { SUCCESS_CODE } from '@/config';
import { errorHandle } from './validate';
import { getYourIP } from '@/utils/getIp.js';
let ip = '127.0.0.1';
getYourIP(ipVal => {
ip = ipVal;
});
// 创建axios实例
const service = axios.create({
baseURL: process.env.VUE_APP_SYSTEM_SERVER_URL, // api的base_url
timeout: 10000,
});
let logout = false;
// request拦截器
service.interceptors.request.use(
conf => {
store.dispatch('fetchStart');
if (store.getters.token) {
conf.headers = {
...conf.headers,
reqSource: 'pc',
token: store.getters.token,
ip: ip,
};
} else {
conf.headers = {
...conf.headers,
reqSource: 'pc',
ip: ip,
};
}
return conf;
},
error => {
// Do something with request error
console.log(error); // for debug
Promise.reject(error);
}
);
// respone拦截器
service.interceptors.response.use(response => {
const res = response.data;
/**
* code为非'0'是抛错
*/
setTimeout(() => {
store.dispatch('fetchDone');
}, 500);
if (res.code !== SUCCESS_CODE) {
if (
response.headers &&
response.headers['content-type'] === 'application/octet-stream'
) {
return response;
}
Message({
message: res.msg || '网络错误!',
type: 'error',
duration: 5 * 1000,
});
// -2:其他客户端登录了;Token 过期了;
if (res.code === '-2') {
if (logout) return;
logout = true;
MessageBox.confirm(
'你已被登出,可以取消继续留在该页面,或者重新登录',
'确定登出',
{
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
store.dispatch('FedLogOut').then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
});
})
.catch(err => {
console.log(err);
logout = false;
});
}
return Promise.reject(response.data);
} else {
return response.data;
}
}, errorHandle);
export default service;
import fetch from '@/api/fetch';
// 登录
export const login = req =>
fetch({
url: '/login',
method: 'post',
withCredentials: true,
timeout: 60000,
...req,
});
// 登出
export const logout = () =>
fetch({
method: 'post',
data: {},
});
// 修改密码
export const changePwd = req =>
fetch({
url: '/login/modifiyPwd',
method: 'post',
...req,
});
// 获取验证码
export const fetchVcode = req =>
fetch({
url: '/login/verifyCode',
method: 'get',
withCredentials: true,
...req,
});
import { Message, MessageBox } from 'element-ui';
import store from '../store';
export const validateCode = res => {
const { code } = res;
switch (code) {
case '0':
return res;
case '-2':
MessageBox.confirm(
'你已被登出,可以取消继续留在该页面,或者重新登录',
'确定登出',
{
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
store.dispatch('FedLogOut').then(() => {
location.reload(); // 为了重新实例化vue-router对象 避免bug
});
});
return Promise.reject(res);
default:
return Promise.reject(res);
}
};
export const errorHandle = error => {
console.log('err' + error); // for debug
store.dispatch('fetchDone');
if (error.message && /timeout/.test(error.message)) {
Message({
message: '请求超时!',
type: 'error',
duration: 5 * 1000,
});
return Promise.reject({ error, msg: '请求超时!' });
}
Message({
message: error.message,
type: 'error',
duration: 5 * 1000,
});
return Promise.reject(error);
};
import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon'// svg组件
// register globally
Vue.component('svg-icon', SvgIcon)
const requireAll = requireContext => requireContext.keys().map(requireContext)
const req = require.context('./svg', false, /\.svg$/)
requireAll(req)
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511504199105" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1815" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M817.968553 215.897142l-169.357176 0 0-58.869782c0-25.391297-20.657482-46.048779-46.048779-46.048779l-181.125197 0c-25.391297 0-46.048779 20.657482-46.048779 46.048779l0 58.869782-169.357176 0c-25.391297 0-46.048779 20.657482-46.048779 46.048779l0 71.631434c0 25.391297 20.657482 46.048779 46.048779 46.048779l28.321022 0 0 425.947112c0 59.246359 48.200792 107.447151 107.447151 107.447151l340.40076 0c59.246359 0 107.447151-48.200792 107.447151-107.447151L789.647531 379.626133l28.321022 0c25.391297 0 46.048779-20.657482 46.048779-46.048779l0-71.631434C864.017332 236.554624 843.35985 215.897142 817.968553 215.897142zM426.553932 162.14389l170.892135 0 0 53.753251-170.892135 0L426.553932 162.14389zM738.482221 805.574269c0 31.033807-25.248034 56.281841-56.281841 56.281841L341.79962 861.85611c-31.033807 0-56.281841-25.248034-56.281841-56.281841L285.517779 379.626133l452.964442 0L738.482221 805.574269zM812.852022 328.460824l-601.704045 0 0-61.398372 203.227588 0c2.302439 0.356111 4.66116 0.542352 7.061836 0.542352l181.125197 0c2.400676 0 4.759397-0.186242 7.062859-0.542352l203.226564 0L812.852022 328.460824zM513.023306 783.320429c14.128789 0 25.582655-11.453866 25.582655-25.582655l0-288.572348c0-14.128789-11.453866-25.582655-25.582655-25.582655-14.128789 0-25.582655 11.453866-25.582655 25.582655l0 288.572348C487.440651 771.866562 498.894518 783.320429 513.023306 783.320429zM645.541459 783.320429c14.128789 0 25.582655-11.453866 25.582655-25.582655l0-288.572348c0-14.128789-11.453866-25.582655-25.582655-25.582655s-25.582655 11.453866-25.582655 25.582655l0 288.572348C619.958804 771.866562 631.41267 783.320429 645.541459 783.320429zM380.505154 783.320429c14.128789 0 25.582655-11.453866 25.582655-25.582655l0-288.572348c0-14.128789-11.453866-25.582655-25.582655-25.582655s-25.582655 11.453866-25.582655 25.582655l0 288.572348C354.922499 771.866562 366.376365 783.320429 380.505154 783.320429z" p-id="3757"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511504199105" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1815" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M770.56 460.8h250.88C998.4 220.16 803.84 25.6 563.2 2.56v250.88c104.96 20.48 186.88 102.4 207.36 207.36z m0 0M460.8 253.44V2.56C220.16 25.6 25.6 220.16 2.56 460.8h250.88c20.48-104.96 102.4-186.88 207.36-207.36z m0 0M563.2 770.56v250.88c243.2-23.04 435.2-217.6 460.8-460.8H773.12C750.08 668.16 668.16 750.08 563.2 770.56z m0 0M253.44 563.2H2.56c23.04 243.2 217.6 435.2 460.8 460.8V773.12C355.84 750.08 273.92 668.16 253.44 563.2z m0 0" fill="" p-id="1816"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1503993826520" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7878" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M941.677063 391.710356c9.337669-14.005992 6.224772-32.68133-6.224772-43.575447-14.005992-10.894118-32.68133-7.78122-43.575447 6.224771-1.556449 1.556449-174.300768 205.426673-379.727441 205.426673-199.200878 0-379.727441-205.426673-381.28389-206.982098-10.894118-12.450567-31.124881-14.005992-43.575448-3.112898-12.450567 10.894118-14.005992 31.124881-3.112897 43.575448 3.112897 4.668323 40.46255 46.687322 99.600439 93.375667l-79.369676 82.48155c-12.450567 12.450567-10.894118 32.68133 1.556449 43.575448 3.112897 6.224772 10.894118 9.337669 18.675338 9.337669 7.78122 0 15.562441-3.112897 21.787213-9.337669l85.594447-88.706321c40.46255 28.013007 88.706321 54.469566 141.619438 73.14388L340.959485 707.631586c-4.668323 17.118889 4.669346 34.237779 21.787213 38.906101h9.337669c14.005992 0 26.456558-9.337669 29.568432-23.343661l32.68133-110.494556c24.90011 4.668323 51.356668 7.78122 77.813227 7.78122s52.913117-3.112897 77.813227-7.78122l32.68133 108.938108c3.112897 14.005992 17.118889 23.343661 29.569456 23.343661 3.112897 0 6.224772 0 7.78122-1.556449 17.118889-4.669346 26.456558-21.787212 21.788236-38.906102l-32.68133-108.938108c52.913117-18.675338 101.156888-45.131897 141.619438-73.14388l84.037998 87.150896c6.224772 6.224772 14.005992 9.337669 21.787212 9.337669 7.78122 0 15.562441-3.112897 21.787212-9.337669 12.450567-12.450567 12.450567-31.124881 1.556449-43.575448l-79.369675-82.48155c63.808258-46.688345 101.158934-91.820242 101.158934-91.820242z" p-id="7879"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511504319223" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3230" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M942.827259 80.3367c-11.42419-11.406794-26.41051-17.117866-41.377386-17.117866-14.985296 0-29.952172 5.711072-41.358967 17.117866L719.392444 221.014696l-19.441794 19.441794L681.577187 258.832 569.516971 370.909611 375.99749 564.411697l0 0.019443 0 84.372619 81.145112 0 0.010233 0 95.418186-95.435583 213.398228-213.400275 3.14155-3.14155-0.019443 0 9.979282-9.977235 0 0L942.827259 163.073052C965.697129 140.259464 965.697129 103.186104 942.827259 80.3367z" p-id="3231"></path><path d="M793.542234 367.521444 580.14196 580.939115 484.72582 676.376745 473.299583 687.800935 457.152834 687.800935 375.99749 687.800935 337.000314 687.800935 337.000314 648.803759 337.000314 564.411697 337.000314 548.264948 348.424504 536.838711 541.943986 343.338672 654.004201 231.259014 665.428392 219.834824 64.020082 219.834824 64.020082 960.781166 804.966425 960.781166 804.966425 356.116697 796.607036 364.475062Z" p-id="3232"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1521704598179" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4010" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M512 557.223994l249.203712 249.203712c12.491499 12.491499 32.730449 12.489452 45.221948-0.002047s12.493545-32.730449 0.002047-45.221948L557.223994 512l249.203712-249.203712c12.491499-12.491499 12.489452-32.730449-0.002047-45.221948s-32.730449-12.493545-45.221948-0.002047L512 466.776006 262.796288 217.572294c-12.491499-12.491499-32.729425-12.490475-45.220924 0.001023-6.246261 6.246261-9.370415 14.429641-9.370415 22.610974s3.121084 16.365736 9.367345 22.610974L466.774983 512 217.572294 761.203712c-6.246261 6.246261-9.367345 14.428617-9.367345 22.610974s3.125177 16.365736 9.370415 22.610974c12.491499 12.491499 32.729425 12.493545 45.220924 0.002047L512 557.223994z" p-id="4011" fill="#d81e06"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1534225155003" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="755" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M516.672 605.76c11.136 42.624 0.64 89.856-32.64 123.136L348.288 864.64c-49.792 49.792-131.264 49.792-180.992 0l-45.248-45.248c-49.792-49.792-49.792-131.264 0-180.992l135.744-135.744c33.216-33.216 80.512-43.776 123.136-32.64L303.04 547.904 277.568 573.312l-110.336 110.336c-24.96 24.96-24.96 65.536 0 90.496l45.248 45.248c24.96 24.96 65.536 24.96 90.496 0l110.336-110.336 25.472-25.472L516.672 605.76zM891.328 140.608 846.08 95.36c-49.792-49.792-131.264-49.792-180.992 0L529.28 231.104C496.064 264.32 485.568 311.616 496.704 354.24l77.888-77.888L600 250.88l110.336-110.336c24.96-24.96 65.536-24.96 90.496 0l45.248 45.248c24.96 24.96 24.96 65.536 0 90.496l-110.336 110.336-25.472 25.472L632.448 489.984c42.624 11.136 89.856 0.64 123.136-32.64l135.744-135.744C941.12 271.808 941.12 190.336 891.328 140.608zM690.496 296.128c-12.416-12.416-32.832-12.48-45.248 0L574.528 366.848 529.28 412.096 438.784 502.656 393.536 547.904 322.816 618.624C319.744 621.696 317.376 625.28 315.84 629.184c-3.136 7.68-3.136 16.384 0 24.128 1.536 3.84 3.904 7.488 6.976 10.56 3.136 3.136 6.72 5.44 10.56 6.976 7.68 3.136 16.384 3.136 24.128 0 3.84-1.536 7.488-3.904 10.56-6.976l70.72-70.72 45.248-45.248 90.496-90.496 45.248-45.248 70.72-70.72C702.976 328.96 702.976 308.608 690.496 296.128z" p-id="756"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1503994678729" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9229" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M780.8 354.579692 665.6 354.579692 665.6 311.689846c0-72.310154-19.849846-193.299692-153.6-193.299692-138.870154 0-153.6 135.049846-153.6 193.299692l0 42.889846L243.2 354.579692 243.2 311.689846C243.2 122.249846 348.790154 0 512 0s268.8 122.249846 268.8 311.689846L780.8 354.579692zM588.8 669.420308C588.8 625.900308 554.220308 590.769231 512 590.769231s-76.8 35.131077-76.8 78.651077c0 29.459692 15.399385 54.468923 38.439385 67.820308l0 89.639385c0 21.740308 17.250462 39.699692 38.4 39.699692s38.4-17.959385 38.4-39.699692l0-89.639385C573.44 723.889231 588.8 698.88 588.8 669.420308zM896 512l0 393.609846c0 65.260308-51.869538 118.390154-115.2 118.390154L243.2 1024c-63.291077 0-115.2-53.129846-115.2-118.390154L128 512c0-65.220923 51.869538-118.390154 115.2-118.390154l537.6 0C844.130462 393.609846 896 446.779077 896 512z" p-id="9230"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511504199105" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1815" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M185.89696 532.2752h286.72v286.72a20.48 20.48 0 1 0 40.96 0v-286.72h286.72a20.48 20.48 0 1 0 0-40.96h-286.72v-286.72a20.48 20.48 0 1 0-40.96 0v286.72h-286.72a20.48 20.48 0 1 0 0 40.96z" fill="" p-id="3098"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1503994797471" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9770" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M565.272827 34.627285l112.095872 237.542288c8.706637 18.321022 25.411424 31.051641 44.82285 33.996289l250.776598 38.081157c48.697387 7.411435 68.22505 70.046082 32.933559 105.979639l-181.494353 184.937155c-13.998147 14.230618-20.352386 34.815477-17.05903 54.93539l42.819161 261.127145c8.346858 50.695541-42.64204 89.451974-86.225039 65.51841l-224.307979-123.271141c-17.285968-9.525824-37.992596-9.525824-55.278564 0l-224.313514 123.271141c-43.582999 23.933565-94.571897-14.822869-86.219504-65.51841l42.813626-261.127145c3.321031-20.119914-3.088559-40.704772-17.086706-54.93539l-181.439002-184.937155c-35.285956-35.933557-15.819179-98.57374 32.933559-105.979639l250.748923-38.081157c19.350541-2.939112 36.083003-15.675267 44.75643-33.996289l112.123547-237.542288C480.497972-11.540583 543.509003-11.540583 565.272827 34.627285z" p-id="9771"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511504440567" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5070" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M568.6 0h454.9v454.9H568.6V0z m0 568.6h454.9v454.9H568.6V568.6zM0 568.6h454.9v454.9H0V568.6zM0 0h454.9v454.9H0V0z" fill="" p-id="5071"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1511512690058" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3507" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M1013.703 693.345c6.865 6.865 10.297 14.874 10.297 24.027l0 205.944c0 9.916-3.432 18.115-10.297 24.599-6.865 6.483-15.255 9.725-25.171 9.725L782.588 957.64c-9.153 0-17.162-3.242-24.027-9.725-6.865-6.483-10.297-14.683-10.297-24.599L748.264 717.372c0-6.102 1.526-11.823 4.577-17.162s7.246-9.534 12.586-12.586 11.06-4.577 17.162-4.577l77.801 0L860.39 546.896c0-4.577-1.144-8.772-3.432-12.586s-5.339-6.865-9.153-9.153-8.009-3.432-12.585-3.432L543.464 521.725l0 161.323 77.801 0c9.153 0 17.162 3.432 24.027 10.297s10.297 14.874 10.297 24.027l0 205.944c0 6.102-1.526 11.823-4.577 17.162s-7.246 9.534-12.585 12.585-11.06 4.577-17.162 4.577L415.321 957.64c-6.102 0-11.823-1.526-17.162-4.577s-9.725-7.246-13.158-12.585-5.149-11.06-5.149-17.162L379.852 717.372c0-9.153 3.432-17.162 10.297-24.027s15.255-10.297 25.171-10.297l76.657 0L491.977 521.725 188.782 521.725c-7.628 0-13.92 2.479-18.878 7.437-4.958 4.958-7.437 10.869-7.437 17.734l0 136.152 77.801 0c9.916 0 18.115 3.432 24.599 10.297s9.725 14.874 9.725 24.027l0 205.944c0 9.916-3.242 18.115-9.725 24.599-6.483 6.483-14.683 9.725-24.599 9.725L34.324 957.64c-3.814 0-7.437-0.572-10.869-1.716-3.432-1.144-6.483-2.67-9.153-4.577-2.67-1.907-5.149-4.386-7.437-7.437-2.288-3.051-4.004-6.293-5.149-9.725C0.572 930.753 0 927.13 0 923.316L0 717.372c0-3.051 0.381-6.102 1.144-9.153s1.907-5.721 3.432-8.009 3.432-4.577 5.721-6.865 4.577-4.195 6.865-5.721 4.958-2.67 8.009-3.432 6.102-1.144 9.153-1.144l77.801 0L112.125 495.41c0-6.865 2.479-12.776 7.437-17.734s10.869-7.437 17.734-7.437l354.682 0L491.978 342.096l-76.657 0c-9.916 0-18.306-3.432-25.171-10.297s-10.297-14.874-10.297-24.027L379.853 101.828c0-9.916 3.432-18.306 10.297-25.171s15.255-10.297 25.171-10.297l205.944 0c6.102 0 11.823 1.716 17.162 5.149 5.339 3.432 9.534 7.818 12.585 13.158 3.051 5.339 4.577 11.06 4.577 17.162l0 205.944c0 9.153-3.432 17.162-10.297 24.027s-14.874 10.297-24.027 10.297l-77.801 0 0 128.143L885.56 470.24c7.628 0 13.92 2.479 18.878 7.437s7.437 10.869 7.437 17.734l0 187.638 76.657 0C998.448 683.048 1006.838 686.48 1013.703 693.345z" p-id="3508"></path></svg>
\ No newline at end of file
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1503993891882" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7986" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M504.951 511.98c93.49 0 169.28-74.002 169.28-165.26 0-91.276-75.79-165.248-169.28-165.248-93.486 0-169.287 73.972-169.279 165.248-0.001 91.258 75.793 165.26 169.28 165.26z m77.6 55.098H441.466c-120.767 0-218.678 95.564-218.678 213.45V794.3c0 48.183 97.911 48.229 218.678 48.229H582.55c120.754 0 218.66-1.78 218.66-48.229v-13.77c0-117.887-97.898-213.45-218.66-213.45z" p-id="7987"></path></svg>
\ No newline at end of file
//to reset element-ui default css
/* 改变主题色变量 */
$--color-primary: #1459fc;
$--color-danger: #ff3333;
/* 改变 icon 字体路径变量,必需 */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import '~element-ui/packages/theme-chalk/src/index';
#app {
.el-checkbox__input.is-checked + .el-checkbox__label {
color: $--color-primary;
}
.el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: $--color-primary;
border-color: $--color-primary;
}
}
.el-upload {
input[type='file'] {
display: none !important;
}
}
.el-upload__input {
display: none;
}
//暂时性解决diolag 问题 https://github.com/ElemeFE/element/issues/2461
.el-dialog {
transform: none;
left: 0;
position: relative;
margin: 0 auto;
}
.el-dialog__body {
padding: 30px 40px;
}
//element ui upload
.upload-container {
.el-upload {
width: 100%;
.el-upload-dragger {
width: 100%;
height: 200px;
}
}
}
.el-input__inner {
background-color: #f6f6f6;
border-color: #f6f6f6;
}
.el-select .el-input .el-select__caret.is-reverse {
color: $--color-primary;
}
.el-select {
width: 100%;
}
.el-submenu .el-menu-item,
.el-submenu__title {
height: 40px;
line-height: 40px;
}
.el-input__inner,
.el-button {
height: 22px;
line-height: 22px;
font-size: 12px;
}
.el-button {
padding: 0 8px;
}
.el-input {
.el-input__suffix .el-input__icon {
line-height: 22px;
}
}
.el-loading-mask {
z-index: 1000 !important;
}
@media screen and (min-width: $bigScreenWidth) {
.el-submenu .el-menu-item,
.el-submenu__title {
height: 56px;
line-height: 56px;
}
.el-input__inner,
.el-button {
height: 40px;
line-height: 1;
font-size: 14px;
}
.el-button {
font-size: 14px;
padding: 12px 20px;
}
.el-input {
.el-input__suffix .el-input__icon {
line-height: 40px;
}
}
}
@import './variables.scss';
@import './element-ui.scss';
body {
-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 {
box-sizing: border-box;
}
*,
*:before,
*:after {
box-sizing: inherit;
}
div:focus {
outline: none;
}
a:focus,
a:active {
outline: none;
}
a,
a:focus,
a:hover {
cursor: pointer;
color: inherit;
text-decoration: none;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type='number'] {
-webkit-appearance: none;
-moz-appearance: textfield;
}
img {
display: block;
width: 100%;
height: 100%;
}
.clearfix {
&:after {
visibility: hidden;
display: block;
font-size: 0;
content: ' ';
clear: both;
height: 0;
}
}
.ImportentText {
font-style: normal;
color: #ffd200;
}
.ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.pointer {
cursor: pointer;
}
.el-tooltip__popper {
max-width: 60%;
}
html,
body,
#app {
width: 100%;
height: 100%;
overflow: hidden;
}
#app {
font-size: 12px;
}
body {
.el-input-number,
.el-input__inner,
.el-input,
.el-button {
height: 22px;
line-height: 22px;
font-size: 12px;
}
}
.el-button {
padding: 0 8px;
}
@media screen and (min-width: $bigScreenWidth) {
#app {
font-size: 14px;
}
body {
.el-input-number,
.el-input__inner,
.el-input,
.el-button {
height: 40px;
line-height: 40px;
font-size: 14px;
}
.el-button {
line-height: 1;
}
}
.el-button {
padding: 12px 20px;
}
}
// media min-width
$bigScreenWidth: 1600px;
//sidebar
$sideBar-width: 112px;
$menuBg: #477cfa;
$subMenuBg: #306bf6;
$menuHover: #1459fc;
$menuActions: #1459fc;
// topbar
$topBar-height: 44px;
// footer
$footer-height: 30px;
<template>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<template v-for="(item,index) in levelList">
<el-breadcrumb-item :key="item.path" v-if="item.meta.title">
<span v-if="item.redirect==='noredirect'||index==levelList.length-1" class="no-redirect">{{item.meta.title}}</span>
<router-link v-else :to="item.redirect||item.path">{{item.meta.title}}</router-link>
</el-breadcrumb-item>
</template>
</transition-group>
</el-breadcrumb>
</template>
<script>
export default {
created() {
this.getBreadcrumb()
},
data() {
return {
levelList: null
}
},
watch: {
$route() {
this.getBreadcrumb()
}
},
methods: {
getBreadcrumb() {
let matched = this.$route.matched.filter(item => item.name)
const first = matched[0]
if (first && first.name !== 'home') {
matched = [{ path: '/home', meta: { title: '首页' }}].concat(matched)
}
this.levelList = matched
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.app-breadcrumb.el-breadcrumb {
display: inline-block;
font-size: 14px;
line-height: 50px;
margin-left: 10px;
.no-redirect {
color: #97a8be;
cursor: text;
}
}
</style>
<template>
<div class="scroll-container" ref="scrollContainer" @wheel.prevent="handleScroll" >
<div class="scroll-wrapper" ref="scrollWrapper" :style="{top: top + 'px'}">
<slot></slot>
</div>
</div>
</template>
<script>
const delta = 15;
export default {
name: 'scrollBar',
data() {
return {
top: 0,
};
},
methods: {
handleScroll(e) {
const eventDelta = e.wheelDelta || -e.deltaY * 3;
const $container = this.$refs.scrollContainer;
const $containerHeight = $container.offsetHeight;
const $wrapper = this.$refs.scrollWrapper;
const $wrapperHeight = $wrapper.offsetHeight;
if (eventDelta > 0) {
this.top = Math.min(0, this.top + eventDelta);
} else {
if ($containerHeight - delta < $wrapperHeight) {
if (this.top < -($wrapperHeight - $containerHeight + delta)) {
this.top = this.top;
} else {
this.top = Math.max(
this.top + eventDelta,
$containerHeight - $wrapperHeight - delta
);
}
} else {
this.top = 0;
}
}
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.scroll-container {
position: relative;
width: 100%;
height: 100%;
.scroll-wrapper {
position: absolute;
width: 100% !important;
}
}
</style>
<template>
<div class="scroll-container" ref="scrollContainer" @wheel.prevent="handleScroll">
<div class="scroll-wrapper" ref="scrollWrapper" :style="{left: left + 'px'}">
<slot></slot>
</div>
</div>
</template>
<script>
const padding = 15 // tag's padding
export default {
name: 'scrollPane',
data() {
return {
left: 0
}
},
methods: {
handleScroll(e) {
const eventDelta = e.wheelDelta || -e.deltaY * 3
const $container = this.$refs.scrollContainer
const $containerWidth = $container.offsetWidth
const $wrapper = this.$refs.scrollWrapper
const $wrapperWidth = $wrapper.offsetWidth
if (eventDelta > 0) {
this.left = Math.min(0, this.left + eventDelta)
} else {
if ($containerWidth - padding < $wrapperWidth) {
if (this.left < -($wrapperWidth - $containerWidth + padding)) {
this.left = this.left
} else {
this.left = Math.max(this.left + eventDelta, $containerWidth - $wrapperWidth - padding)
}
} else {
this.left = 0
}
}
},
moveToTarget($target) {
const $container = this.$refs.scrollContainer
const $containerWidth = $container.offsetWidth
const $targetLeft = $target.offsetLeft
const $targetWidth = $target.offsetWidth
if ($targetLeft < -this.left) {
// tag in the left
this.left = -$targetLeft + padding
} else if ($targetLeft + padding > -this.left && $targetLeft + $targetWidth < -this.left + $containerWidth - padding) {
// tag in the current view
// eslint-disable-line
} else {
// tag in the right
this.left = -($targetLeft - ($containerWidth - $targetWidth) + padding)
}
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.scroll-container {
white-space: nowrap;
position: relative;
overflow: hidden;
width: 100%;
.scroll-wrapper {
position: absolute;
}
}
</style>
<template>
<el-select
clearable
filterable
:value="value"
@change="changeHandle"
>
<el-option
v-for="(item, index) in areaList"
:key="index"
:value="item.id"
:label="item.areaName"
></el-option>
</el-select>
</template>
<script>
import areaMixin from './mixin.js';
export default {
name: 'area-select',
props: {
size: String,
value: Number,
},
mixins: [areaMixin],
methods: {
changeHandle(val) {
if (val) {
this.$emit('input', val);
} else {
this.$emit('input', null);
}
},
},
};
</script>
import { fetchAreaList } from '@/api/base/index';
const GET_AREA_LIST = 'GET_AREA_LIST';
const FETCH_STATE = 'FETCH_STATE';
const state = () => ({
list: [],
fetching: false,
});
const getters = {
areaList: state => state.list,
};
const actions = {
fetchAreaList({ state, commit }) {
if (state.fetching) return;
commit(FETCH_STATE, true);
return fetchAreaList().then(res => {
const list = res.data;
commit(GET_AREA_LIST, list);
commit(FETCH_STATE, false);
});
},
};
const mutations = {
[GET_AREA_LIST](state, list) {
state.list = list;
},
[FETCH_STATE](state, fetching) {
state.fetching = fetching;
},
};
export default {
namespaced: true,
state,
getters,
actions,
mutations,
};
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment