Commit 06000af4 by 张立顺

chore: migrate legacy master snapshot

Source: git@192.168.3.233:micro-customization-system/system.git
Source-Commit: 9b456a9744a56b0f351ecbc86f5cb4d017897212
1 parent 3c953207
Showing 98 changed files with 4870 additions and 0 deletions
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",
"dev": "vue-cli-service serve --progress",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.20.0",
"core-js": "^3.6.5",
"echarts": "^5.2.2",
"element-ui": "^2.15.7",
"js-md5": "^0.7.3",
"moment": "^2.29.1",
"sass": "^1.45.1",
"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",
"sass-loader": "^10.0.3",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^4.6.1"
},
"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 exclude="vehicleAddUpadate,vehicleTypeManage">
<router-view />
</keep-alive>
</div>
</template>
<script>
import { mapMutations } from "vuex";
export default {
data() {
return {
isQiankun: window.__POWERED_BY_QIANKUN__,
};
},
watch: {
$route(to, from) {
if (this.isQiankun) {
this.getBreadcrumb();
}
},
},
methods: {
...mapMutations(["updateBaseURL"]),
getBreadcrumb() {
const {
getters: { curBreadCrumb },
} = this.$root.parentVuex;
let matched = this.$route.matched.filter((item) => item.name); // this.$route.matched 可以获取到一个数组,包含当前路由的所有嵌套路径片段的路由记录
const first = matched[0];
const { meta, path } = first;
const basePath = "/system#";
let breadcrumb = [];
if (meta) {
const { title, pushState } = meta;
if (pushState && title) {
breadcrumb.push({
name: title,
path: basePath + path,
});
history.state.pushState = pushState;
history.state.breadcrumb = [...curBreadCrumb, breadcrumb[0]];
// this.$root.parentVuex.dispatch('menu/setBreadCrumb', [...curBreadCrumb, breadcrumb[0]]);
}
}
},
goToPage(path) {
this.$root.parentRouter.push(path);
},
},
created() {},
};
</script>
<style lang="scss">
#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;
} */
.links_group {
position: relative;
display: flex;
align-items: flex-end;
justify-content: space-between;
padding: 10px 0;
.name {
font-size: 18px;
font-weight: bold;
color: #666;
}
}
.links_group:after {
display: block;
content: "";
height: 1px;
position: absolute;
left: 0;
right: 0;
bottom: 0;
background: #d8d8d8;
transform: scaleY(0.5);
}
.el_table {
thead {
th {
background: rgba($color: #f2f2f2, $alpha: 0.5) !important;
}
}
}
.pagination_list {
text-align: right;
padding: 10px 0;
}
// 下划线
.glsx_hairline {
position: relative;
}
.glsx_hairline:after {
display: block;
content: "";
height: 1px;
background: #d8d8d8;
position: absolute;
left: 0;
right: 0;
bottom: 0;
transform: scaleY(0.5);
}
.el_link{
margin:0 4px;
}
</style>
const MAP_KEY = '75116f653f3b2e4568116dad8cd9b899'
export const CONSTANT = {
//ROOT: process.env.NODE_ENV === 'development'?'ots/':'',
API_URL: '/ots/',
MAP_KEY,
}
\ No newline at end of file \ No newline at end of file
//import ClipboardJS from 'clipboard'
//window.ClipboardJS = ClipboardJS
//import EventBus from '../event-bus'
import { Message } from "element-ui";
// EventBus.$on('uiMap.copySuccess', (data)=>{
// Message({
// type: 'success',
// message: '已复制内容至粘贴板'
// });
// });
function MapService() {
this.map = null;
this.restainLayer = null;
}
MapService.prototype = {
// 设置默认图标
setDefaultIcon(marker) {
marker.setIcon(require('@/assets/images/icon_car.png'))
},
// 获取经纬度
getLngLat: function (lng, lat) {
return new AMap.LngLat(lng, lat);
},
// 清空地图覆盖物
clearMap: function (map) {
this.map.clearMap();
},
// 设置地图视角
setFitView: function (map) {
this.map.setFitView();
},
// 创建车辆位置点
createCarMarker: function (lnglatXY, map) {
var marker = new AMap.Marker({
position: lnglatXY,
icon: require('@/assets/images/icon_car.png'),
map: map,
autoRotation: true,
offset: new AMap.Pixel(-18, -11),
zIndex: 1020,
animation: 'AMAP_ANIMATION_DROP'
});
return marker;
},
// 创建位置点弹框
createActiveInfo(info) {
let msg = '报警'
// 激活
if (info.type == 1) {
msg = '激活'
}
// 定位
if (info.type == 2) {
msg = '定位'
}
let _html = `<h3 class="map-infowindow-title">${info.name}/${info.standNo}</h3>
<div class="map-infowindow-ct">
<p><i class="icon icon-info_device"></i> 设备号: <span class="des">${info.sn} (${info.source == 1 ? '有线' : '无线'})</span></p>`
// 是否包含断电、光感报警
if (info.alarmTypeSet && info.alarmTypeSet.length > 0) {
let tg = '';
let cHmtl = ''
let typeList = {
1: '断电',
99: '光感'
}
info.alarmTypeSet.forEach((alarmType) => {
tg += `<a class="btn_danger">${typeList[alarmType]}</a>`
});
cHmtl = '<p><i class="icon icon-info_device_alarm"></i><span>报警状态:</span>' + tg + '</p>';
_html += cHmtl
}
_html += `<p><i class="icon icon-info_time"></i>${msg}时间: <span class="des"data-time>${info.time}</span></p>
<p style="display:${info.bsLng ? 'flex' : 'none'}"><i class="icon icon-info_type"></i>定位类型: <a class="locate-btn active" id="locateTypeGps">GPS</a><a class="locate-btn" id="locateTypeBase">基站</a></p>
<p class="long_p"><i class="icon icon-info_location"></i><span>${msg}地址:</span><span class="des" data-transferAddress>${info.address}</span></p>
</div>`;
return _html
},
// 位置点弹框
bindActiveLocationInfoWindow(marker, map, info) {
var self = this
var infoDiv = document.createElement('div')
infoDiv.innerHTML = self.createActiveInfo(info)
// gps位置信息
function fillGPS() {
infoDiv.querySelector('[data-time]').textContent = info.time;
infoDiv.querySelector('[data-transferAddress]').textContent = info.address;
infoDiv.querySelector('#locateTypeGps').classList.add('active');
infoDiv.querySelector('#locateTypeBase').classList.remove('active');
marker.setPosition(self.getLngLat(info.lng, info.lat));
marker.infoWindow && marker.infoWindow.open(map, marker.getPosition());
}
// 基站位置信息
function fillBase() {
infoDiv.querySelector('[data-time]').textContent = info.bsTime;
infoDiv.querySelector('[data-transferAddress]').textContent = info.bsAddress;
infoDiv.querySelector('#locateTypeGps').classList.remove('active');
infoDiv.querySelector('#locateTypeBase').classList.add('active');
marker.setPosition(self.getLngLat(info.bsLng, info.bsLat));
marker.infoWindow && marker.infoWindow.open(map, marker.getPosition());
}
infoDiv.querySelector('#locateTypeGps').onclick = function (e) {
fillGPS()
}
infoDiv.querySelector('#locateTypeBase').onclick = function (e) {
fillBase()
}
if (info.lng) {
fillGPS()
}
if (!info.lng && info.bsLng) {
fillBase()
}
return this.createActiveInfoWindow(marker, map, infoDiv)
},
// 创建位置点弹框
createActiveInfoWindow(marker, map, div, isInfoOpen, isInfoAutoMove) {
var infoWindow = new AMap.InfoWindow({
offset: new AMap.Pixel(0, 0),
content: div,
autoMove: !!isInfoAutoMove,
})
console.log(infoWindow)
marker.infoWindow = infoWindow
if (isInfoOpen) {
infoWindow.open(map, marker.getPosition())
}
//给Marker绑定单击事件
marker.on('click', markerClick)
function markerClick(e) {
//infoWindow.setContent(e.target.content);
infoWindow.open(map, e.target.getPosition())
}
return infoWindow
},
// 打开激活位置点弹框
openActiveInfoWindow(map, makers, infoWindow) {
const MAP = map
const lnglat = makers.getPosition()
infoWindow.open(MAP, lnglat)
MAP.setZoomAndCenter(MAP.getZoom(), lnglat)
}
}
const mapService = new MapService();
export default mapService
\ No newline at end of file \ No newline at end of file
.icon {display: inline-block;background-image: url(./sprite.png);background-size: 119px 97px; vertical-align: middle;}
.icon-battery_empty { width: 42px; height: 20px; background-position: 0px 0px; }
.icon-battery_enough { width: 42px; height: 20px; background-position: 0px -20px; }
.icon-fullsize.active { width: 18px; height: 18px; background-position: 0px -79px; }
.icon-fullsize:active { width: 18px; height: 18px; background-position: 0px -79px; }
.icon-fullsize:hover { background-position: 0px -79px; }
.icon-fullsize { width: 18px; height: 18px; background-position: -18px -79px; }
.icon-icon_zoom_out.active { width: 18px; height: 18px; background-position: -36px -79px; }
.icon-icon_zoom_out:active { width: 18px; height: 18px; background-position: -36px -79px; }
.icon-icon_zoom_out:hover { background-position: -36px -79px; }
.icon-icon_zoom_out { width: 18px; height: 18px; background-position: -54px -79px; }
.icon-info_copy.active { width: 16px; height: 16px; background-position: -101px -36px; }
.icon-info_copy:active { width: 16px; height: 16px; background-position: -101px -36px; }
.icon-info_copy:hover { background-position: -101px -36px; }
.icon-info_copy { width: 16px; height: 16px; background-position: -101px -52px; }
.icon-info_device_alarm { width: 20px; height: 20px; background-position: -42px 0px; }
.icon-info_device_status { width: 20px; height: 20px; background-position: -42px -20px; }
.icon-info_device { width: 20px; height: 20px; background-position: 0px -40px; }
.icon-info_location { width: 20px; height: 20px; background-position: -20px -40px; }
.icon-info_stop { width: 20px; height: 20px; background-position: -40px -40px; }
.icon-info_time { width: 20px; height: 20px; background-position: -62px 0px; }
.icon-info_type { width: 20px; height: 20px; background-position: -62px -20px; }
.icon-locate.active { width: 19px; height: 19px; background-position: -62px -40px; }
.icon-locate:active { width: 19px; height: 19px; background-position: -62px -40px; }
.icon-locate:hover { background-position: -62px -40px; }
.icon-locate { width: 19px; height: 19px; background-position: 0px -60px; }
.icon-minisize.active { width: 18px; height: 19px; background-position: -82px -19px; }
.icon-minisize:active { width: 18px; height: 19px; background-position: -82px -19px; }
.icon-minisize:hover { background-position: -82px -19px; }
.icon-minisize { width: 18px; height: 18px; background-position: -72px -79px; }
.icon-refresh.active { width: 18px; height: 19px; background-position: -82px -38px; }
.icon-refresh:active { width: 18px; height: 19px; background-position: -82px -38px; }
.icon-refresh:hover { background-position: -82px -38px; }
.icon-refresh { width: 18px; height: 19px; background-position: -82px -57px; }
.icon-ruler.active { width: 19px; height: 19px; background-position: -19px -60px; }
.icon-ruler:active { width: 19px; height: 19px; background-position: -19px -60px; }
.icon-ruler:hover { background-position: -19px -60px; }
.icon-ruler { width: 19px; height: 19px; background-position: -38px -60px; }
.icon-satellite.active { width: 18px; height: 18px; background-position: -101px 0px; }
.icon-satellite:active { width: 18px; height: 18px; background-position: -101px 0px; }
.icon-satellite:hover { background-position: -101px 0px; }
.icon-satellite { width: 18px; height: 18px; background-position: -101px -18px; }
.icon-zoom_in.active { width: 19px; height: 19px; background-position: -57px -60px; }
.icon-zoom_in:active { width: 19px; height: 19px; background-position: -57px -60px; }
.icon-zoom_in:hover { background-position: -57px -60px; }
.icon-zoom_in { width: 19px; height: 19px; background-position: -82px 0px; }
\ No newline at end of file \ No newline at end of file
/*
Stylus variables are information about icon's compiled state, stored under its original file name
.icon-home {
width: $icon_home_width;
}
The large array-like variables contain all information about a single icon
$icon_home = x y offset_x offset_y width height total_width total_height image_path;
At the bottom of this section, we provide information about the spritesheet itself
$spritesheet = width height image $spritesheet_sprites;
*/
$icon_fullsize_active_name = 'icon_fullsize_active';
$icon_fullsize_active_x = 54px;
$icon_fullsize_active_y = 57px;
$icon_fullsize_active_offset_x = -54px;
$icon_fullsize_active_offset_y = -57px;
$icon_fullsize_active_width = 18px;
$icon_fullsize_active_height = 18px;
$icon_fullsize_active_total_width = 76px;
$icon_fullsize_active_total_height = 75px;
$icon_fullsize_active_image = '~sprite.png';
$icon_fullsize_active = 54px 57px -54px -57px 18px 18px 76px 75px '~sprite.png' 'icon_fullsize_active';
$icon_fullsize_name = 'icon_fullsize';
$icon_fullsize_x = 0px;
$icon_fullsize_y = 57px;
$icon_fullsize_offset_x = 0px;
$icon_fullsize_offset_y = -57px;
$icon_fullsize_width = 18px;
$icon_fullsize_height = 18px;
$icon_fullsize_total_width = 76px;
$icon_fullsize_total_height = 75px;
$icon_fullsize_image = '~sprite.png';
$icon_fullsize = 0px 57px 0px -57px 18px 18px 76px 75px '~sprite.png' 'icon_fullsize';
$icon_locate_active_name = 'icon_locate_active';
$icon_locate_active_x = 19px;
$icon_locate_active_y = 0px;
$icon_locate_active_offset_x = -19px;
$icon_locate_active_offset_y = 0px;
$icon_locate_active_width = 19px;
$icon_locate_active_height = 19px;
$icon_locate_active_total_width = 76px;
$icon_locate_active_total_height = 75px;
$icon_locate_active_image = '~sprite.png';
$icon_locate_active = 19px 0px -19px 0px 19px 19px 76px 75px '~sprite.png' 'icon_locate_active';
$icon_locate_name = 'icon_locate';
$icon_locate_x = 0px;
$icon_locate_y = 19px;
$icon_locate_offset_x = 0px;
$icon_locate_offset_y = -19px;
$icon_locate_width = 19px;
$icon_locate_height = 19px;
$icon_locate_total_width = 76px;
$icon_locate_total_height = 75px;
$icon_locate_image = '~sprite.png';
$icon_locate = 0px 19px 0px -19px 19px 19px 76px 75px '~sprite.png' 'icon_locate';
$icon_minisize_active_name = 'icon_minisize_active';
$icon_minisize_active_x = 36px;
$icon_minisize_active_y = 38px;
$icon_minisize_active_offset_x = -36px;
$icon_minisize_active_offset_y = -38px;
$icon_minisize_active_width = 18px;
$icon_minisize_active_height = 19px;
$icon_minisize_active_total_width = 76px;
$icon_minisize_active_total_height = 75px;
$icon_minisize_active_image = '~sprite.png';
$icon_minisize_active = 36px 38px -36px -38px 18px 19px 76px 75px '~sprite.png' 'icon_minisize_active';
$icon_minisize_name = 'icon_minisize';
$icon_minisize_x = 18px;
$icon_minisize_y = 57px;
$icon_minisize_offset_x = -18px;
$icon_minisize_offset_y = -57px;
$icon_minisize_width = 18px;
$icon_minisize_height = 18px;
$icon_minisize_total_width = 76px;
$icon_minisize_total_height = 75px;
$icon_minisize_image = '~sprite.png';
$icon_minisize = 18px 57px -18px -57px 18px 18px 76px 75px '~sprite.png' 'icon_minisize';
$icon_refresh_active_name = 'icon_refresh_active';
$icon_refresh_active_x = 0px;
$icon_refresh_active_y = 38px;
$icon_refresh_active_offset_x = 0px;
$icon_refresh_active_offset_y = -38px;
$icon_refresh_active_width = 18px;
$icon_refresh_active_height = 19px;
$icon_refresh_active_total_width = 76px;
$icon_refresh_active_total_height = 75px;
$icon_refresh_active_image = '~sprite.png';
$icon_refresh_active = 0px 38px 0px -38px 18px 19px 76px 75px '~sprite.png' 'icon_refresh_active';
$icon_refresh_name = 'icon_refresh';
$icon_refresh_x = 18px;
$icon_refresh_y = 38px;
$icon_refresh_offset_x = -18px;
$icon_refresh_offset_y = -38px;
$icon_refresh_width = 18px;
$icon_refresh_height = 19px;
$icon_refresh_total_width = 76px;
$icon_refresh_total_height = 75px;
$icon_refresh_image = '~sprite.png';
$icon_refresh = 18px 38px -18px -38px 18px 19px 76px 75px '~sprite.png' 'icon_refresh';
$icon_ruler_active_name = 'icon_ruler_active';
$icon_ruler_active_x = 0px;
$icon_ruler_active_y = 0px;
$icon_ruler_active_offset_x = 0px;
$icon_ruler_active_offset_y = 0px;
$icon_ruler_active_width = 19px;
$icon_ruler_active_height = 19px;
$icon_ruler_active_total_width = 76px;
$icon_ruler_active_total_height = 75px;
$icon_ruler_active_image = '~sprite.png';
$icon_ruler_active = 0px 0px 0px 0px 19px 19px 76px 75px '~sprite.png' 'icon_ruler_active';
$icon_ruler_name = 'icon_ruler';
$icon_ruler_x = 38px;
$icon_ruler_y = 19px;
$icon_ruler_offset_x = -38px;
$icon_ruler_offset_y = -19px;
$icon_ruler_width = 19px;
$icon_ruler_height = 19px;
$icon_ruler_total_width = 76px;
$icon_ruler_total_height = 75px;
$icon_ruler_image = '~sprite.png';
$icon_ruler = 38px 19px -38px -19px 19px 19px 76px 75px '~sprite.png' 'icon_ruler';
$icon_satellite_active_name = 'icon_satellite_active';
$icon_satellite_active_x = 57px;
$icon_satellite_active_y = 37px;
$icon_satellite_active_offset_x = -57px;
$icon_satellite_active_offset_y = -37px;
$icon_satellite_active_width = 18px;
$icon_satellite_active_height = 18px;
$icon_satellite_active_total_width = 76px;
$icon_satellite_active_total_height = 75px;
$icon_satellite_active_image = '~sprite.png';
$icon_satellite_active = 57px 37px -57px -37px 18px 18px 76px 75px '~sprite.png' 'icon_satellite_active';
$icon_satellite_name = 'icon_satellite';
$icon_satellite_x = 57px;
$icon_satellite_y = 18px;
$icon_satellite_offset_x = -57px;
$icon_satellite_offset_y = -18px;
$icon_satellite_width = 18px;
$icon_satellite_height = 19px;
$icon_satellite_total_width = 76px;
$icon_satellite_total_height = 75px;
$icon_satellite_image = '~sprite.png';
$icon_satellite = 57px 18px -57px -18px 18px 19px 76px 75px '~sprite.png' 'icon_satellite';
$icon_zoom_in_active_name = 'icon_zoom_in_active';
$icon_zoom_in_active_x = 38px;
$icon_zoom_in_active_y = 0px;
$icon_zoom_in_active_offset_x = -38px;
$icon_zoom_in_active_offset_y = 0px;
$icon_zoom_in_active_width = 19px;
$icon_zoom_in_active_height = 19px;
$icon_zoom_in_active_total_width = 76px;
$icon_zoom_in_active_total_height = 75px;
$icon_zoom_in_active_image = '~sprite.png';
$icon_zoom_in_active = 38px 0px -38px 0px 19px 19px 76px 75px '~sprite.png' 'icon_zoom_in_active';
$icon_zoom_in_name = 'icon_zoom_in';
$icon_zoom_in_x = 19px;
$icon_zoom_in_y = 19px;
$icon_zoom_in_offset_x = -19px;
$icon_zoom_in_offset_y = -19px;
$icon_zoom_in_width = 19px;
$icon_zoom_in_height = 19px;
$icon_zoom_in_total_width = 76px;
$icon_zoom_in_total_height = 75px;
$icon_zoom_in_image = '~sprite.png';
$icon_zoom_in = 19px 19px -19px -19px 19px 19px 76px 75px '~sprite.png' 'icon_zoom_in';
$icon_zoom_out_active_name = 'icon_zoom_out_active';
$icon_zoom_out_active_x = 36px;
$icon_zoom_out_active_y = 57px;
$icon_zoom_out_active_offset_x = -36px;
$icon_zoom_out_active_offset_y = -57px;
$icon_zoom_out_active_width = 18px;
$icon_zoom_out_active_height = 18px;
$icon_zoom_out_active_total_width = 76px;
$icon_zoom_out_active_total_height = 75px;
$icon_zoom_out_active_image = '~sprite.png';
$icon_zoom_out_active = 36px 57px -36px -57px 18px 18px 76px 75px '~sprite.png' 'icon_zoom_out_active';
$icon_zoom_out_name = 'icon_zoom_out';
$icon_zoom_out_x = 57px;
$icon_zoom_out_y = 0px;
$icon_zoom_out_offset_x = -57px;
$icon_zoom_out_offset_y = 0px;
$icon_zoom_out_width = 19px;
$icon_zoom_out_height = 18px;
$icon_zoom_out_total_width = 76px;
$icon_zoom_out_total_height = 75px;
$icon_zoom_out_image = '~sprite.png';
$icon_zoom_out = 57px 0px -57px 0px 19px 18px 76px 75px '~sprite.png' 'icon_zoom_out';
$spritesheet_width = 76px;
$spritesheet_height = 75px;
$spritesheet_image = '~sprite.png';
$spritesheet_sprites = $icon_fullsize_active $icon_fullsize $icon_locate_active $icon_locate $icon_minisize_active $icon_minisize $icon_refresh_active $icon_refresh $icon_ruler_active $icon_ruler $icon_satellite_active $icon_satellite $icon_zoom_in_active $icon_zoom_in $icon_zoom_out_active $icon_zoom_out;
$spritesheet = 76px 75px '~sprite.png' $spritesheet_sprites;
/*
The provided mixins are intended to be used with the array-like variables
.icon-home {
spriteWidth($icon_home)
}
.icon-email {
sprite($icon_email)
}
Example usage in HTML:
`display: block` sprite:
<div class="icon-home"></div>
To change `display` (e.g. `display: inline-block;`), we suggest using a common CSS class:
// CSS
.icon {
display: inline-block;
}
// HTML
<i class="icon icon-home"></i>
*/
spriteWidth($sprite) {
width: $sprite[4];
}
spriteHeight($sprite) {
height: $sprite[5];
}
spritePosition($sprite) {
background-position: $sprite[2] $sprite[3];
}
spriteImage($sprite) {
background-image: url($sprite[8]);
}
sprite($sprite) {
spriteImage($sprite)
spritePosition($sprite)
spriteWidth($sprite)
spriteHeight($sprite)
}
/*
The `sprites` mixin generates identical output to the CSS template
but can be overridden inside of Stylus
This must be run when you have at least 2 sprites.
If run with a single sprite, then there will be reference errors.
sprites($spritesheet_sprites);
*/
sprites($sprites) {
for $sprite in $sprites {
$sprite_name = $sprite[9];
.{$sprite_name} {
sprite($sprite);
}
}
}
.map-wrap{
// position: absolute;
// top: 100px;
// left: 0;
width: 100%;
height: calc(100% - 100px);
overflow: hidden;
.map-controll{
position: absolute;
top: 40px;
right: 250px;
z-index: 102;
.fullsize-btn{
margin-left: 20px;
}
}
.map-bottom-controll{
position: absolute;
bottom: 30px;
right: 20px;
z-index: 102;
ul{
border: 1px solid #eee;
color: #094;
}
.ctrl-item{
background-color: #fff;
padding: 6px 10px;
font-size: 16px;
}
}
.controll-wrap{
position: absolute;
top: 40px;
left: 40px;
z-index: 101;
width: 320px;
max-height: 716px;
}
.menu-search{
.el-select{
width: 100px;
}
.input-with-select{
width: 100%;
}
.el-input-group__append{
background: #094;
border-color: #094;
color: #fff;
font-size: 16px;
}
.el-input-group__append:hover, .el-input-group__append:focus {
background: #33ad69;
border-color: #33ad69;
}
}
.filter-entrance{
margin-top: 10px;
background-color: rgba(255,255,255,0.9);
//border: 1px solid #dcdfe6;
box-shadow: 1px 1px 5px #dcdfe6;
.el-button{
padding: 6px;
}
}
.filter-dialog-set{
margin-top: 10px;
height: 100%;
position: relative;
}
.filter-dialog{
position: absolute;
top: 0;
left: 0;
width: 100%;
background-color: #fff;
border: 1px solid #dcdfe6;
box-sizing: border-box;
.filter-dialog-header{
text-align: center;
padding: 8px;
border-bottom: 1px solid #eee;
.el-icon-close{
font-size: 16px;
cursor: pointer;
}
}
.filter-dialog-body{
padding: 15px;
.upload-wrap{
.el-select{
width: 100px;
}
.input-with-select{
width: 100%;
}
}
}
.upload-sure-btn{
width: 100%;
}
animation-duration: .5s;
animation-delay: 0s;
display: none;
&.active{
display: block
}
.sub-filter{
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.monitor-list{
max-height: calc(100vh - 280px);
/* max-height: 568px; */
overflow: auto;
margin-right: -10px;
padding-right: 10px;
}
.monitor-list-item{
display: flex;
border-bottom: 1px solid #eee;
.user-info{
flex: 1;
color: #666;
&>p{
margin: 8px 0;
}
.name{
color: #333;
margin-right: 15px;
}
}
&:last-child{
border-bottom: none;
}
.device-icon{
margin-right: 5px;
margin-top: 12px;
}
}
.device-icon-label{
display: inline-block;
margin-left: 5px;
}
.device-icon{
display: inline-block;
vertical-align: middle;
width: 8px;
height: 8px;
border-radius: 5px;
background-color: rgba(0,153,68,0.8);
&.offline{
background-color: rgba(255,0,0,0.8);
}
}
.filter-dialog-footer{
border-top: 1px solid #eee;
padding: 10px;
span{
vertical-align: middle;
}
}
}
.search-box{
.date-filter{
position: absolute;
top: 0px;
right: 0px;
}
.el-form--inline .el-form-item{
margin-right: 0px;
}
.stay-ctrl{
margin-top: 5px;
input{
width: 100%;
}
.el-form-item{
margin-bottom: 0px;
}
.unit{
line-height: 30px;
margin-left: 10px;
}
}
.el-range-editor--mini .el-range-input{
width: 115px;
}
.el-form-item{
margin-bottom: 15px;
}
.submit-el-form-item{
margin-top: 20px;
}
}
.search-box, .result-box{
padding: 20px;
background: #fff;
box-shadow: 1px 1px 4px #ccc;
display: none;
}
.search-box.active, .result-box.active{
display: block;
}
.result-box{
/* height: 100%;
max-height: 660px; */
padding: 0px;
.result-box-head{
text-align: center;
border-bottom: 1px solid #ddd;
padding: 10px 15px;
&>*{
vertical-align: middle;
}
}
.result-box-filter{
font-size: 0px;
padding: 5px 0px;
border-bottom: 1px solid #eee;
.el-button{
font-size: 13px;
padding: 2px 10px;
margin: 0;
&:first-child{
border-right: 1px solid #eee;
}
i{
margin: 0 3px;
}
}
}
.stay-list{
/* height: calc(100% - 70px); */
max-height: calc(100vh - 200px);
overflow-y: auto;
}
.stay-list-item{
line-height: 1.5;
padding: 10px 15px;
border-bottom: 1px solid #eee;
p{
margin: 0px;
}
.datetime{
font-size: 13px;
color: #666;
}
}
}
.replay-player{
max-width: 400px;
position: absolute;
top: 20px;
right: 20px;
z-index: 500;
background: #fff;
padding: 5px 10px;
margin-top: 10px;
.el-progress{
display: inline-block;
width: 200px;
margin: 0;
height: 10px;
border-radius: 0;
}
&>a{
margin: 0 5px;
cursor: pointer;
&:hover{
color: #094;
}
}
}
.row-form-item .el-form-item__label{
float: none;
}
}
.full-width .map-wrap{
// top: 0px;
height: 100%;
}
.map-container{
width: 100%;
height: 100%;
z-index: 100;
}
.el-loading-mask{
z-index: 500;
}
.map-infowindow-ct{
&>p{
display: flex;
align-items: center;
}
.long_p{
align-items: flex-start;
}
.des{
flex: 1;
word-break: break-all;
}
.icon{
display: block;
margin-right: 5px;
}
.battery{
position: relative;
width: 42px;
height: 20px;
i{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.fill{
width: 39px;
}
.fill-percentage{
padding: 3px;
box-sizing: border-box;
background-color: #d4f1dc;
}
.text{
color: #37c060;
font-size: 12px;
text-align: center;
}
&.empty .fill-percentage{
background-color: #f0d0d0;
}
&.empty .fill-percentage{
color: #df2222;
}
&.hide{
display: none;
}
}
.redirect-row{
display: flex;
}
a.redirect-btn{
flex: 1;
border: 1px solid rgba(0,153,68,0.8);
border-radius: 2px;
text-align: center;
padding: 4px 0px;
color: rgba(0,153,68,0.8);
margin: 2px;
cursor: pointer;
&:hover{
color: rgba(0,153,68, 1);
border-color: rgba(0,153,68, 1);
}
}
a.locate-btn{
padding: 2px 8px;
border: 1px solid #094;
border-radius: 4px 0 0 4px;
line-height: 16px;
& + .locate-btn{
border-radius: 0 4px 4px 0;
border-left: none;
}
&.active{
background-color: #094;
color: #fff;
}
}
.btn_danger{
background:#f00;
color:#fff;
font-size:12px;
margin:0 4px;
border-radius:4px;
padding:2px 8px;
border:1px solid #f00;
}
}
.poi_marker{
display: inline-block;
width: 40px;
height: 48px;
//background-image: url('./assets/images/poi-marker-default.png');
background-size: 40px 50px;
text-align: center;
color: #fff;
padding-top: 2px;
}
.poi_infowin{
.poi_item{
display: flex;
justify-content: space-between;
label{
color: #666;
}
span, input{
flex: 1;
}
input{
border: 1px solid #ccc;
height: 22px;
padding: 2px 8px;
}
}
.poi_ctrl{
justify-content: flex-end;
&>a{
display: inline-block;
border: 1px solid rgba(0, 153, 68, 0.8);
border-radius: 12px;
text-align: center;
padding: 2px 10px;
color: rgba(0, 153, 68, 0.8);
margin-left: 10px;
cursor: pointer;
}
&>a[data-delete]{
border: 1px solid #dcdfe6;
color: #606266;
}
}
}
\ No newline at end of file \ No newline at end of file
const chartConfig = {
type: 'line',
data: {
labels: [],
datasets: [{
data: [],
label: '设备激活数(个)',
borderDash: [1],
backgroundColor: 'rgba(0,153,68,0.3)',
borderColor: 'rgba(0,153,68,0.8)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
legend: false,
tooltips: {
intersect: false,
displayColors: false
},
scales: {
yAxes: [{
ticks: {
beginAtZero:true,
//stepSize: 1,
callback: function(value, index, values) {
if (Math.floor(value) === value) {
return value;
}
},
autoSkip: true,
maxRotation: 10,
maxTicksLimit: 10
}
}],
xAxes: []
}
}
}
export default chartConfig;
\ No newline at end of file \ No newline at end of file
This diff could not be displayed because it is too large.
export const Validator = {
/*手机号码格式校验正则*/
PHONEREG: /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/,
/*同时包含字母和数字*/
ISNUMANDLETTERS: /^[a-zA-Z0-9]+$/,
/*特殊字符正则*/
SPECIALLETTER:new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]"),
/*邮箱地址格式正则*/
//EMAILREG:/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/,
EMAILREG:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
/*判断是否为中文*/
ISCHINESE:/^[\u0391-\uFFE5]+$/,
/*判断是否为英文字母*/
ISENGLISH:/^[a-zA-Z]+$/,
/*是否包含空格*/
ISHAVENULL:/^[^\s]*$/,
/*保留两位小数*/
TWODECIMAL: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/,
/*判断是否为正整数*/
ISDECIMAL:/^[0-9]*$/,
/**
* 账号管理-手机号码校验
*/
checkPhoneNumber:function(str){
return Validator.PHONEREG.test(str);
},
// 车架号
CHECKVINNUMBER:/(?!^[0-9]{17}$)(?!^[a-zA-Z]{17}$)^[0-9A-Za-z]{17}$/
};
<template>
<div>
<div id="mapContainer" class="map-container"></div>
</div>
</template>
<script>
// import mapService from "@/amap/mapService";
import "@/assets/spritesmith-generated/sprite.css";
import "@/assets/styles/monitor.scss";
import GLMapSdk from "@/utils/glsk-mapapi-sdk";
/**
* address: gps地址
* bsAddress:基站地址
* bsLat,bsLng:基站经纬度
* gpsLat,gpsLng:gps经纬度
* name:车主姓名
* standNo:车架号
* time:定位时间
*/
export default {
name: "MapLocation",
props: {
info: {
type: Object,
default: function () {
return {
};
},
},
},
data() {
return {
mapObj: "",
zoom: 12,
};
},
mounted() {
this.initMap();
console.log('地图');
},
methods: {
async initMap() {
// console.log(GLMapSdk);
try {
// new GLMapSdk(async (mapapi) => {
console.log(this.mapapi, 'mapapi');
const mapapi = this.mapapi
const map = await mapapi.invoke("Map", "mapContainer");
const { lng, lat } = this.info;
mapapi.invoke("centerAndZoom", mapapi.invoke("Point", lng, lat), this.zoom);
mapapi.invoke('NavigationControl')
// mapapi.invoke('enableScrollWheelZoom')
this.drawMaker(mapapi, map);
// })
} catch (error) {
console.log(error);
}
},
// 激活位置
drawMaker(mapapi, map) {
let data = this.info;
const lng = parseFloat(data.lng || data.bsLng);
const lat = parseFloat(data.lat || data.bsLat);
var marker = mapapi.invoke("Marker", mapapi.invoke("Point", lng, lat), {
icon: mapapi.invoke(
"Icon",
require("@/assets/images/icon_car.png"),
mapapi.invoke("Size", 60, 60),
{
anchor: mapapi.invoke("Size", 10, 15),
infoWindowAnchor: mapapi.invoke("Size", 10, 0),
}
),
});
this.bindActiveLocationInfoWindow(marker, map, data);
mapapi.invoke("addOverlay", marker);
},
// 创建位置点弹框
createActiveInfo(info) {
let msg = "报警";
// 激活
if (info.type == 1) {
msg = "激活";
}
// 定位
if (info.type == 2) {
msg = "定位";
}
let _html = `<h3 class="map-infowindow-title">${info.name}/${info.standNo}</h3>
<div class="map-infowindow-ct">
<p><i class="icon icon-info_device"></i> 设备号: <span class="des">${
info.sn
} (${info.source == 1 ? "有线" : "无线"})</span></p>`;
// 是否包含断电、光感报警
if (info.alarmTypeSet && info.alarmTypeSet.length > 0) {
let tg = "";
let cHmtl = "";
let typeList = {
1: "断电",
99: "光感",
};
info.alarmTypeSet.forEach((alarmType) => {
tg += `<a class="btn_danger">${typeList[alarmType]}</a>`;
});
cHmtl =
'<p><i class="icon icon-info_device_alarm"></i><span>报警状态:</span>' +
tg +
"</p>";
_html += cHmtl;
}
_html += `<p><i class="icon icon-info_time"></i>${msg}时间: <span class="des"data-time>${
info.time
}</span></p>
<p style="display:${
info.bsLng ? "flex" : "none"
}"><i class="icon icon-info_type"></i>定位类型: <a class="locate-btn active" id="locateTypeGps">GPS</a><a class="locate-btn" id="locateTypeBase">基站</a></p>
<p class="long_p"><i class="icon icon-info_location"></i><span>${msg}地址:</span><span class="des" data-transferAddress>${
info.address
}</span></p>
</div>`;
return _html;
},
// 位置点弹框
bindActiveLocationInfoWindow(marker, map, info) {
var self = this;
var infoDiv = document.createElement("div");
infoDiv.innerHTML = self.createActiveInfo(info);
// gps位置信息
function fillGPS() {
infoDiv.querySelector("[data-time]").textContent = info.time;
infoDiv.querySelector("[data-transferAddress]").textContent = info.address;
infoDiv.querySelector("#locateTypeGps").classList.add("active");
infoDiv.querySelector("#locateTypeBase").classList.remove("active");
marker.setPosition(self.mapapi.invoke("Point", info.lng, info.lat));
// map.openInfoWindow(marker.infoWindow, marker.getPosition());
self.mapapi.invoke("mapOpenInfoWindow", marker.infoWindow, self.mapapi.invoke('markerGetPosition'));
}
// 基站位置信息
function fillBase() {
infoDiv.querySelector("[data-time]").textContent = info.bsTime;
infoDiv.querySelector("[data-transferAddress]").textContent = info.bsAddress;
infoDiv.querySelector("#locateTypeGps").classList.remove("active");
infoDiv.querySelector("#locateTypeBase").classList.add("active");
console.log(self.mapapi.invoke("Point", info.bsLng, info.bsLat), "基站点位置", map);
marker.setPosition(self.mapapi.invoke("Point", info.bsLng, info.bsLat));
// map.openInfoWindow(marker.infoWindow, marker.getPosition());
self.mapapi.invoke("mapOpenInfoWindow", marker.infoWindow, self.mapapi.invoke('markerGetPosition'));
}
infoDiv.querySelector("#locateTypeGps").onclick = function (e) {
fillGPS();
};
infoDiv.querySelector("#locateTypeBase").onclick = function (e) {
fillBase();
};
if (info.lng) {
fillGPS();
}
if (!info.lng && info.bsLng) {
fillBase();
}
return this.createActiveInfoWindow(marker, map, infoDiv);
},
// 创建位置点弹框
createActiveInfoWindow(marker, map, div, isInfoOpen, isInfoAutoMove) {
const { mapapi } = this;
let opts = {
width: 150, // 信息窗口宽度
// height: 170, // 信息窗口高度
};
let infoWindow = mapapi.invoke("InfoWindow", div, opts);
marker.infoWindow = infoWindow;
// map.openInfoWindow(infoWindow, marker.getPosition());
mapapi.invoke("mapOpenInfoWindow", infoWindow, mapapi.invoke('markerGetPosition'));
//给Marker绑定单击事件
// marker.addEventListener("click", markerClick);
mapapi.invoke("markerAddEventListener", 'click', markerClick)
function markerClick(e) {
// map.openInfoWindow(infoWindow, marker.getPosition());
mapapi.invoke("mapOpenInfoWindow", infoWindow, mapapi.invoke('markerGetPosition'));
}
return infoWindow;
},
// 打开激活位置点弹框
openActiveInfoWindow(map, makers, infoWindow) {
const MAP = map;
const lnglat = makers.getPosition();
infoWindow.open(MAP, lnglat);
MAP.setZoomAndCenter(MAP.getZoom(), lnglat);
},
},
};
</script>
<style lang="scss" scoped>
p {
margin: 0;
padding: 0;
}
.map-container {
width: 100%;
min-width: 600px;
height: 400px;
font-size: 13px;
}
</style>
<template>
<el-button :type="type" v-if="hasPermission()" :size="size">
<slot />
</el-button>
<!-- <el-link :type="type" v-if="link && hasPermission()">
<slot />
</el-link> -->
</template>
<script>
export default {
name: "AuthButton",
props: {
uid: {
type: [String, Number],
default: "",
},
type: {
type: [String, Number],
default: "default",
},
link: {
type: Boolean,
default: false,
},
size:{
type:String,
default:''
},
permissionTag:{
type:[String,Number],
default:''
}
},
data() {
return {};
},
mounted() {
},
methods: {
// 判断是否有权限
hasPermission() {
let id = this.uid;
let _name = this.name;
let _tag = this.permissionTag;
let list = this.$root.parentCommon.getAuthData();
let idx = list.findIndex((k) => k.id == id || k.label == _name || k.origin.permissionTag == _tag);
if (idx < 0) {
return false;
} else {
return true;
}
},
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
<template>
<el-link class="el_link" :underline="false" :type="type" v-if="hasPermission()">
<slot />
</el-link>
</template>
<script>
export default {
name: "AuthLink",
props: {
uid: {
type: [String, Number],
default: "",
},
name: {
type: String,
default: "",
},
type: {
type: [String, Number],
default: "default",
},
link: {
type: Boolean,
default: false,
},
permissionTag:{
type:[String,Number],
default:''
}
},
data() {
return {};
},
mounted() {},
methods: {
// 判断是否有权限
hasPermission() {
let id = this.uid;
let _name = this.name;
let _tag = this.permissionTag;
let list = this.$root.parentCommon.getAuthData();
let idx = list.findIndex((k) => k.id == id || k.label == _name || k.origin.permissionTag == _tag);
if (idx < 0) {
return false;
} else {
return true;
}
},
},
};
</script>
<style lang="scss" scoped>
.el_link:hover {
text-decoration: none;
}
</style>
\ No newline at end of file \ No newline at end of file
<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"
:loading="btnLoading"
>{{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'
},
btnLoading: {
type: Boolean,
default: false
}
},
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"
:show-overflow-tooltip="true"
>
<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(true, true)
},
refreshTable(clearMuti = true, resetCurrentPage = false) {
this.beforeSearchFn().then(res => {
// 清空多选
clearMuti && this.clearMutiSelect()
this.loading = true
console.log(this.searchForm)
resetCurrentPage && (this.page.pageNumber = 1)
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>
<template>
<div class="dialog_page">
<el-dialog ref="glsxDialogCom" :title="title" :visible.sync="show" :width="width" :append-to-body="appendtobody" :show-close="showClose" custom-class="glsx_dialog" :close-on-press-escape="false" :close-on-click-modal="false" @close="onCancel" @opened="onDialogOpened">
<div slot="title" class="test" v-if="slotInfo.title">
<slot name="title" />
</div>
<div class="dialog_content">
<slot />
</div>
<div class="dialog_footer" v-show="hasFooter">
<slot name="footer"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: "GlsxDialog",
props: {
show: {
type: Boolean,
default: false,
},
title: {
type: String,
default: "提示",
},
width: {
type: String,
default: "46%",
},
cancel: {
required: false,
type: Function,
},
confirm: {
required: false,
type: Function,
},
usefooter: {
required: false,
type: Boolean,
default: false,
},
appendtobody: {
required: false,
type: Boolean,
default: false,
},
value: {
type: Boolean,
default: false,
},
showClose: {
required: false,
type: Boolean,
default: true,
},
},
data() {
return {
hasFooter: false,
hasTitle: false,
slotInfo: {},
};
},
created() {
let o = this.$slots;
this.hasFooter = o.footer;
this.hasTitle = o.title;
this.slotInfo = o;
},
mounted: function () {
//this.$refs.glsxDialogCom.rendered = true;
},
methods: {
/**
* 取消关闭弹框
*/
onCancel: function () {
// 兼容以前的页面
this.$emit("close");
//this.$emit("input", false);
},
/**
* 确定
*/
onConfirm: function () {},
//
onDialogOpened() {},
},
};
</script>
<style lang="scss">
.glsx_dialog {
.el-dialog__header {
border-bottom: 1px solid #ddd !important;
padding-top: 10px;
font-size: 14px;
}
.el-dialog__headerbtn {
top: 10px;
right: 10px;
}
.el-dialog__body {
padding: 0;
}
.el-dialog__footer {
border-top: 1px solid #ddd;
}
}
</style>
<style lang="scss" scoped>
.dialog_content {
max-height: 600px;
overflow-y: auto;
padding: 20px;
}
.dialog_footer {
padding: 10px 15px;
border-top: 1px solid #e1e1e1;
text-align: right;
}
</style>
<template>
<div class="">
<el-input placeholder="输入关键字进行过滤" v-model="filterText" size="small">
</el-input>
<div v-loading="loading">
<el-tree style="max-height:50vh;overflow:auto" class="filter-tree" :data="filterTextData" :filter-node-method="filterNode" highlight-current ref="tree" node-key="id" check-on-click-node>
</el-tree>
</div>
<p style="text-align: right; margin-top: 10px">
<el-button @click="filterConfirm" type="primary">确定</el-button>
<el-button @click="closeFilter">取消</el-button>
</p>
</div>
</template>
<script>
import { getOrgTree } from "services/common";
import { showToast } from "@/utils/util";
export default {
name: "GlsxOrganization",
props: {
isLast: {
type: Boolean,
default: false,
},
},
data() {
return {
filterText: "",
filterTextData: this.$store.state.organizationTree,
_timeout: "",
loading: false,
};
},
mounted() {
let o = this.$store.state.organizationTree;
if (!o || o.length <= 0) {
this.getTree();
}
},
watch: {
filterText(n) {
let _this = this;
_this.loading = true;
setTimeout(function () {
_this.$refs.tree.filter(n);
}, 100);
},
},
methods: {
// 确认选择树
filterConfirm() {
let o = this.$refs.tree.getCurrentNode();
if (!o) {
showToast({
message: "请选择所属组织",
type: "error",
});
return false;
}
const { label, id, origin } = o;
if (this.isLast) {
if (origin && origin.type != "u") {
showToast({
message: "请选择下级所属组织",
type: "error",
});
return false;
}
}
console.log(o);
this.$emit("change", o);
// this.searchForm.specialShopName = label.split("/")[1];
// this.searchForm.specialShopCode = label.split("/")[0];
//this.$set(this, "form.specialShopName", label);
//this.searchForm.specialShopId = id;
//this.closeFilter();
},
// 获取组织机构树数据
getTree() {
getOrgTree({ hasUserLeaf: true }).then((res) => {
const { data } = res;
this.filterTextData = data || [];
this.$store.commit("updateOrganizationTree", data || []);
});
},
// 搜索树
filterNode(value, data) {
let _this = this;
if (!value) {
_this.loading = false;
return true;
}
setTimeout(function () {
_this.loading = false;
}, 1500);
return data.label.indexOf(value) !== -1;
},
// 关闭树
closeFilter() {
this.$emit("change");
},
// 搜索树
onChange(val) {
this.loading = true;
this.$refs.tree.filter(val);
},
},
};
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
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-input placeholder="请输入内容" v-model="plateNo" maxlength="6" @input="onInput" :disabled="disabled">
<template slot="prepend">
<el-popover v-model="showPopover" ref="popover" placement="bottom-start" width="490" trigger="click" :disabled="disabled">
<div>
<div class="province-select">
<el-tag class="el_tag" v-for="item in provinceArr" :key="item" :effect="plateProvince==item ?'dark':'light'" :type="plateProvince==item?'primary':'info'" @click="selectProvince(item)">{{ item }}</el-tag>
</div>
<div class="no-select">
<el-tag class="el_tag" v-for="item in letterArr" :key="item" :effect="plateLetter==item ?'dark':'light'" :type="plateLetter==item?'primary':'info'" @click="selectLetter(item)">{{ item }}</el-tag>
</div>
</div>
<template slot="reference">
<div class="plate_show">
<span class="plate_name" v-if="!plateProvince && !plateLetter">请选择</span>
<span class="plate_name">{{plateProvince}}</span>
<span class="plate_name">{{plateLetter}}</span>
<i :class="showPopover?'el-icon-arrow-up':'el-icon-arrow-down'"></i>
</div>
</template>
</el-popover>
</template>
</el-input>
</div>
</template>
<script>
export default {
name: "PlateNumberInput",
props: {
value: {
type: String,
default: "",
},
disabled: {
type: Boolean,
default: false,
},
},
model: {
prop: "",
},
data() {
return {
provinceArr: [
"粤",
"京",
"沪",
"闽",
"川",
"辽",
"皖",
"苏",
"鄂",
"晋",
"吉",
"冀",
"宁",
"豫",
"黑",
"鲁",
"浙",
"桂",
"蒙",
"渝",
"津",
"云",
"湘",
"新",
"赣",
"甘",
"陕",
"贵",
"青",
"藏",
"琼",
],
letterArr: [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M",
"N",
"O",
"P",
"Q",
"R",
"S",
"T",
"U",
"V",
"W",
"X",
"Y",
"Z",
],
showPopover: false,
plateNo: "",
plateProvince: "",
plateLetter: "",
};
},
watch: {
value: {
handler: function (n, o) {
console.log(n);
this.value = n;
if (!n) {
this.plateNo = "";
this.plateProvince = "";
this.plateLetter = "";
}
if (n) {
this.plateProvince = n.substr(0, 1);
this.plateLetter = n.substr(1, 1);
this.plateNo = n.substr(2, n.length - 2);
}
},
},
},
created() {
console.log(this.disabled)
},
methods: {
// 选择省份
selectProvince(e) {
this.plateProvince = e;
this.toParent();
},
// 选择字母
selectLetter(e) {
this.plateLetter = e;
this.toParent();
},
// 监听输入
onInput(e) {
this.toParent();
},
// 传递参数给父组件
toParent() {
let plate = `${this.plateProvince || ""}${this.plateLetter || ""}${
this.plateNo || ""
}`;
this.$emit("input", plate);
},
// 打开键盘
openKeyboard() {
console.log(this.disabled);
if (this.disabled) {
return false;
}
this.showPopover = !this.showPopover;
},
},
};
</script>
<style lang="scss" scoped>
.el_tag {
cursor: pointer;
margin: 4px;
}
.plate_show {
cursor: pointer;
}
.plate_name {
margin: 0 2px 0 0;
}
</style>
\ No newline at end of file \ No newline at end of file
<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 \ No newline at end of file
<template>
<div>
<el-form
class="clearfix search-form"
:model="formModel"
:size="size"
@submit.native.prevent
>
<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"
@keyup.enter.native="onInput"
></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>
</el-form-item>
<el-form-item>
<template>
<slot name="form-slot">
</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: () => []
}
},
methods:{
onInput(e){
this.$emit('input',e)
}
}
}
</script>
<style lang="scss">
.search-form {
padding: 18px 18px 0;
.el-form-item {
display: inline-block;
// float: left;
width: calc(50% - 20px);
max-width: 420px;
margin-right: 18px;
}
.el-form-item__content {
width: 100%;
}
}
</style>
\ No newline at end of file \ 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 \ 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() {
return MOCK_CONFIG_URL + '/test_config'
},
LOGIN_ACTION: '/login_action'
}
const USER_API = {
USER_SEARCH: '/usercenter/user/search',
USER_SUPER: '/usercenter/user/suitableSuperUsers',
USER_ADD: '/usercenter/user/add',
USER_EDIT: '/usercenter/user/edit',
USER_INFO: '/usercenter/user/info',
USER_DELETE: '/usercenter/user/delete',
ROLE_SIMPLELIST: '/usercenter/role/simplelist'
}
const VEHICLETYPE_API={
VEHICLETYPE_SEARCH:'/trialdrive/vehicle/tenanttypes/search',
TENANT_SIMPLELIST: '/usercenter/tenant/simplelist',
MENU_TREE:'/trialdrive/vehicle/brandseries',
MENU_TREE_ONE:'/vehicle/brands',
MENU_TREE_TWO:'/vehicle/subbrands',
MENU_TREE_THREE:'/vehicle/series',
VEHICLETYPE_TYPES:'/trialdrive/vehicle/types',
VEHICLETYPE_ADD:'/trialdrive/vehicle/savetypes',
VEHICLETYPE_EDIT:'/trialdrive/vehicle/gettenanttypes',
VEHICLETYPE_DELETE:'/trialdrive/vehicle/tenanttypes/delete',
VEHICLETYPE_INFO:'/trialdrive/vehicle/gettenanttypes'
}
const ROLE_API = {
ROLE_SEARCH: '/usercenter/role/search',
ROLE_INFO: '/usercenter/role/info',
TENANT_SIMPLELIST: '/usercenter/tenant/simplelist',
ROLE_ADD: '/usercenter/role/add',
ROLE_EDIT: '/usercenter/role/edit',
ROLE_DELETE: '/usercenter/role/delete',
MENU_TREE: '/usercenter/menu/checkedtree',
ROLE_VISIBILITY: '/usercenter/role/visibility',
ROLE_PERMISSION: '/usercenter/tenant/rolepermission'
}
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 ORGINIZA_API = {
ORGINIZA_SEARCH: '/usercenter/organization/search',
ORGINIZA_CHILDREN: '/usercenter/organization/children',
ORGINIZA_SIMPLElIST: '/usercenter/organization/simplelist',
ORGINIZA_TREEORY: '/usercenter/organization/orgtree',
ORGINIZA_ADD: '/usercenter/organization/add',
ORGINIZA_EDIT: '/usercenter/organization/edit',
ORGINIZA_DELETE: '/usercenter/organization/delete',
ORGINIZA_INFO: '/usercenter/organization/info'
}
const DICT_API = {
DICT_SEARCH: '/publiccenter/dict/type/search',
DICT_ADD: '/publiccenter/dict/type/add',
DICT_EDIT: '/publiccenter/dict/type/edit',
DICT_DELETE: '/publiccenter/dict/type/delete',
DICTDATA_SEARCH: '/publiccenter/dict/data/search',
DICTDATA_EXPORT: '/publiccenter/dict/data/export',
DICTDATA_ADD: '/publiccenter/dict/data/add',
DICTDATA_EDIT: '/publiccenter/dict/data/edit',
DICTDATA_DELETE: '/publiccenter/dict/data/delete',
DICTDATA_TYPE: '/publiccenter/dict/data/type'
}
const WORKLOG_API = {
WORKLOG_SEARCH: '/loggincenter/loggin/search',
WORKLOG_EXPORT: '/loggincenter/loggin/export'
}
export { API, USER_API,VEHICLETYPE_API, ROLE_API, ORGINIZA_API, DICT_API, WORKLOG_API, MENU_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 \ 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 \ 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 GlsxDialog from "@/components/dialog";
import GlMapSdk from "@/utils/glsk-mapapi-sdk";
console.log(GlMapSdk);
// import axios from 'axios'
Vue.component('glsx-dialog', GlsxDialog)
Vue.prototype.btn_size = 'mini'
Vue.prototype.$Common = Common
Vue.prototype.$Constants = Constants
Vue.use(VueRouter);
Vue.use(ElementUI)
Vue.config.productionTip = false;
Vue.prototype.mapapi = new GlMapSdk()
let router = null;
let instance = null;
function render({ data = {}, container } = {}) {
router = new VueRouter({
base: window.__POWERED_BY_QIANKUN__ ? '/system' : '/',
routes,
});
console.log(data)
store.state.baseURL = data.baseURL;
instance = new Vue({
router,
store,
data() {
return {
parentRouter: data.router,
parentVuex: data.store,
parentCommon: data.common
}
},
render: h => h(App),
}).$mount(container ? container.querySelector('#glsx-sub-system') : '#glsx-sub-system');
}
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'
Vue.use(VueRouter)
const routes = [
{
path: '/',
name: 'user',
meta: { title: '用户管理' },
component: () => import('../views/user/index.vue')
},
{
path: '/user',
name: 'user',
meta: { title: '用户管理' },
component: () => import('../views/user/index.vue')
},
{
path: '/role',
name: 'role',
meta: { title: '角色管理' },
component: () => import('../views/role/index.vue')
},
{
path: '/vehicleTypeManage',
name: 'vehicleTypeManage',
meta: { title: '车型管理' },
keepAlive:false,
component: () => import('../views/vehicleTypeManage/index.vue')
},
{
path: '/vehicleTypeManage/vehicleAddUpadate',
name: 'vehicleAddUpadate',
meta: { title: '车型库' },
hidden:true,
keepAlive:false,
component: () => import('../views/vehicleTypeManage/vehicleAddUpadate.vue')
},
{
path: '/orginizaManage',
name: 'orginizaManage',
meta: { title: '组织管理' },
component: () => import('../views/orginizaManage/index.vue')
},
{
path: '/menuManage',
name: 'menuManage',
meta: { title: '菜单管理' },
component: () => import('../views/menuManage/index.vue')
},
{
path: '/dictionaryManage',
name: 'dictionaryManage',
meta: { title: '字典管理' },
component: () => import('../views/dictionaryManage/index.vue')
},
{
path: '/dictionaryManage/dictionaryData',
name: 'dictionaryData',
meta: {
title: '字典数据',
pushState: true
},
component: () => import('../views/dictionaryManage/dictionaryData/index.vue')
},
{
path: '/workLog',
name: 'workLog',
meta: { title: '操作日志' },
component: () => import('../views/workLog/index.vue')
},
{
path: '/home/index',
name: 'homeIndex',
meta: { title: '数据看板' },
component: () => import('../views/home/index.vue')
},
{
path: '/work/order',
name: 'workOrder',
meta: { title: '工单管理' },
component: () => import('../views/work/order.vue')
},
{
path: '/work/order/add',
name: 'workOrderAdd',
meta: { title: '新增工单' },
component: () => import('../views/work/add.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)
// }
// // 获取字典详情
// function dictInfo (params) {
// const url = `${COMMON_API.DICTDATA_TYPE}/${params}`
// return request({}, url)
// }
// // 获取第一级组织列表树
// function getSimpleRoot (params) {
// const url = COMMON_API.ORGINIZA_SIMPLEROOT
// return request(params, url)
// }
// // 获取组织列表树
// function getSimpleList (params) {
// const url = COMMON_API.ORGINIZA_SIMPLELIST
// return request(params, url)
// }
function getOrgTree(params) {
return request(params, '/usercenter/organization/orgtree')
}
export { getOrgTree }
import { DICT_API } from '@/config/config'
import request from '@/services/request'
// 字典列表
function getDictList (params) {
const url = DICT_API.DICT_SEARCH
return request(params, url)
}
// 新增字典
function addDict (params) {
const url = DICT_API.DICT_ADD
return request(params, url, 'post')
}
// 编辑字典
function editDict (params) {
const url = DICT_API.DICT_EDIT
return request(params, url, 'post')
}
// 删除字典
function deleteDict (params) {
const url = DICT_API.DICT_DELETE
return request(params, url)
}
// 字典数据列表
function getDictDataList (params) {
const url = DICT_API.DICTDATA_SEARCH
return request(params, url)
}
// 新增字典数据类型
function addDictData (params) {
const url = DICT_API.DICTDATA_ADD
return request(params, url, 'post')
}
// 编辑字典数据类型
function editDictData (params) {
const url = DICT_API.DICTDATA_EDIT
return request(params, url, 'post')
}
// 删除字典数据类型
function deleteDictData (params) {
const url = DICT_API.DICTDATA_DELETE
return request(params, url)
}
// 导出字典数据
function exportDictData (params) {
const url = DICT_API.DICTDATA_EXPORT
return request(params, url)
}
export { getDictList, addDict, editDict, deleteDict, getDictDataList, addDictData, editDictData, deleteDictData, exportDictData }
import request from "@/services/request";
// 首页-数据看板-获取统计数据
export const GET_HOME_DEVICENUMBER = (params) => {
return request(params, "/trialdrive/home/getdevicenumber");
};
// 首页-数据看板-获取警情统计数据
export const GET_HOME_ALARMNUMBER = (params) => {
return request(params, "/trialdrive/home/getalarmnumber");
};
// 首页-数据看板-获取设备激活趋势
export const GET_HOME_ACTIVEDEVICEINFO = (params) => {
return request(params, "/trialdrive/home/getactivedeviceinfo");
};
// 首页-数据看板-获取角色(判断是否为仲利)
export const GET_HOME_AUTHUSERORG = (params) => {
return request(params, "/trialdrive/home/authuserorg");
};
// 首页-数据看板-总绑定数图表
export const GET_HOME_NEWBINDDEVICEINFO = (params) => {
return request(params, "/trialdrive/home/getnewbinddeviceinfo");
};
// 首页-数据看板-获取围栏报警数量
export const GET_FENCE_ALARM = (params) => {
return request(params, "/alarmcenternew/fencealarm/getFenceAlarmCount");
};
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 request from '@/services/request'
import store from '@/store'
// 工单管理-工单列表-获取列表
export const GET_WORKORDER_SEARCH = params => {
return request(params, '/trialdrive/workorder/search')
}
// 工单管理-工单列表-导出excel
export const GET_WORKORDER_EXPORT = '/trialdrive/workorder/export'
// 工单管理-工单列表-设备组合下拉列表接口
export const GET_DEVICE_COMPOSE = params => {
return request(params, '/trialdrive/device/compose')
}
// 工单管理-工单列表-新增工单
export const ADD_WORKORDER_INFO = params => {
return request(params, '/trialdrive/workorder/add', 'POST')
}
// 工单管理-工单列表-编辑工单
export const EDIT_WORKORDER_INFO = params => {
return request(params, '/trialdrive/workorder/edit', 'POST')
}
// 工单管理-工单列表-获取工单详情
export const GET_WORKORDER_INFO = params => {
return request(params, '/trialdrive/workorder/info')
}
// 工单管理-工单列表-验证工单设备有效位置接口
export const VERIFY_WORKORDER_INFO = params => {
return request(params, '/trialdrive/workorder/verify', 'POST')
}
// 工单管理-工单列表-激活工单接口
export const ACTIVATE_WORKORDER_INFO = params => {
return request(params, '/trialdrive/workorder/activate', 'POST')
}
// 工单管理-工单列表-新增工单-新增车辆-获取车型数据
export const GET_VEHICLE_SELECTEDTYPETREE = params => {
return request(params, '/trialdrive/vehicle/getSelectedTypeTree')
}
// 工单管理-工单列表-图片打包下载
//export const GET_WORKORDER_BATCHEXPORTPICS = "/trialdrive/workorder/batchExportPics";
export const GET_WORKORDER_BATCHEXPORTPICS = params => {
return request(params, '/trialdrive/workorder/batchExportPics')
}
// 工单管理-工单列表-导入工单-模板下载
export const GET_WORKORDER_TEMPLATEFILE = 'https://img01.glsx.com.cn/weapp/resource/e-shield/新E盾工单导入模板.xlsx'
// 工单管理-工单列表-导入工单
export const IMPORT_WORKORDER_FILES = store.state.baseURL + '/trialdrive/workorder/import'
// 工单管理-工单列表-激活工单-校验SN号
export const VERIFY_DEVICE_INFO = params => {
return request(params, '/trialdrive/vehicle/vehicleinfo/verifydevice')
}
// 工单管理-工单列表-激活工单-获取设备型号
export const GET_CLASSIFYNAME_INFO = params => {
return request(params, '/trialdrive/vehicle/vehicleinfo/getclassifynamebysn')
}
// 工单管理-工单列表-工单详情-获取工单日志列表
export const GET_WORKORDER_OPERLOG = params => {
return request(params, '/trialdrive/workorder/operlog')
}
// 工单管理-工单列表-获取工单状态
export const GET_WORKORDER_STATUSOPTION = params => {
return request(params, '/trialdrive/workorder/status/option')
}
// 工单管理-工单列表-工单详情-获取工单进度列表
export const GET_WORKORDER_PROGRESS = params => {
return request(params, '/trialdrive/workorder/getProgress')
}
// 工单管理-工单列表-工单详情-删除存量图片
export const DELETE_ORDER_IMAGE = params => {
return request(params, '/trialdrive/workorder/deleteImage')
}
// 工单管理-工单列表-工单详情-单独更新图片信息
export const UPDATE_ORDER_IMAGE = params => {
return request(params, '/trialdrive/workorder/updateImage', 'POST')
}
// 工单管理-工单列表-删除工单
export const DELETE_ORDER_INFO = params => {
return request(params, '/trialdrive/workorder/delete')
}
// 工单管理-工单列表-关联车辆-根据车架号获取车辆列表
export const GET_VEHICLE_LIST_BY_VIN = params => {
return request(params, '/trialdrive/workorder/getLinkVehicleList')
}
// 工单管理-工单列表-关联车辆-保存数据
export const SAVE_RELINKVEHICLE_INFO = params => {
return request(params, '/trialdrive/workorder/reLinkVehicle', 'POST')
}
// 工单管理-工单列表-关联车辆-校验车架号
export const CHECK_WORKORDER_VERIFYDUPLICATEVIM = params => {
return request(params, '/trialdrive/workorder/verifyDuplicateVim')
}
// 工单管理-工单列表-工单重推
export const REPUSH_TO_BHG = params => {
return request(params, '/trialdrive/workorder/repushToBhg')
}
import { ORGINIZA_API } from '@/config/config'
import request from '@/services/request'
// 获取组织列表
function getTableList(params) {
const url = ORGINIZA_API.ORGINIZA_SEARCH
return request(params, url)
}
// 根据根节点,获取子节点列表
function getChildren(params) {
const url = ORGINIZA_API.ORGINIZA_CHILDREN
return request(params, url)
}
// 获取组织列表树
function getSimpleList(params) {
const url = ORGINIZA_API.ORGINIZA_SIMPLElIST
return request(params, url)
}
// 组织架构
function getTreeOrg(params) {
const url = ORGINIZA_API.ORGINIZA_TREEORY
return request(params, url)
}
// 添加组织
function addOrganiza(params) {
const url = ORGINIZA_API.ORGINIZA_ADD
return request(params, url, 'post')
}
// 编辑组织
function editOrganiza(params) {
const url = ORGINIZA_API.ORGINIZA_EDIT
return request(params, url, 'post')
}
// 删除组织
function deleteOrganiza(params) {
const url = ORGINIZA_API.ORGINIZA_DELETE
return request(params, url)
}
// 组织详情
function organizaInfo(params) {
const url = ORGINIZA_API.ORGINIZA_INFO
return request(params, url)
}
// 获取组织架构
export const GET_ORIGINIZATION_LIST = params => {
return request(params, ORGINIZA_API.ORGINIZA_TREEORY);
}
export { getTableList, getChildren, getSimpleList, getTreeOrg, addOrganiza, editOrganiza, deleteOrganiza, organizaInfo }
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 { ROLE_API } from '@/config/config'
import request from '@/services/request'
// 获取用户列表
function getRoleList (params) {
const url = ROLE_API.ROLE_SEARCH
return request(params, url)
}
// 获取用户详情
function roleInfo (params) {
const url = ROLE_API.ROLE_INFO
return request(params, url)
}
// 获取租户列表
function getTenantList (params) {
const url = ROLE_API.TENANT_SIMPLELIST
return request(params, url)
}
// 获取用户列表
function addRole (params) {
const url = ROLE_API.ROLE_ADD
return request(params, url, 'post')
}
// 获取用户列表
function editRole (params) {
const url = ROLE_API.ROLE_EDIT
return request(params, url, 'post')
}
// 获取用户列表
function deleteRole (params) {
const url = ROLE_API.ROLE_DELETE
return request(params, url)
}
// 获取菜单权限
function getMenuTree (params) {
const url = ROLE_API.MENU_TREE
return request(params, url)
}
// 角色可见度接口
function getVisibility (params) {
const url = ROLE_API.ROLE_VISIBILITY
return request(params, url)
}
// 数据权限租户列表接口
function getPermission (params) {
const url = ROLE_API.ROLE_PERMISSION
return request(params, url)
}
export { getRoleList, roleInfo, getTenantList, addRole, editRole, deleteRole, getMenuTree, getVisibility, getPermission }
import { USER_API, DICT_API } from '@/config/config'
import request from '@/services/request'
// 获取用户列表
function getUserList (params) {
const url = USER_API.USER_SEARCH
return request(params, url)
}
// 获取上级树
function getSuperUser (params) {
const url = USER_API.USER_SUPER
return request(params, url)
}
// 新增用户
function addUser (params) {
const url = USER_API.USER_ADD
return request(params, url, 'post')
}
// 编辑用户
function editUser (params) {
const url = USER_API.USER_EDIT
return request(params, url, 'post')
}
// 用户详情
function detailUser (params) {
const url = USER_API.USER_INFO
return request(params, url)
}
// 删除用户
function deleteUser (params) {
const url = USER_API.USER_DELETE
return request(params, url)
}
// 下拉角色列表
function roleList (params) {
const url = USER_API.ROLE_SIMPLELIST
return request(params, url)
}
// 字典
function dictInfo (params) {
const url = `${DICT_API.DICTDATA_TYPE}/${params}`
return request({}, url)
}
function resetPassword(params) {
return request(params, '/usercenter/user/resetPassword')
}
// 获取车辆树列表
export const GET_VEHICLE_TREE = params => {
return request(params,'/trialdrive/vehicle/tree')
}
// 获取车辆树列表-查询用户下面的车辆
export const GET_USER_VEHICLE_LIST = params => {
return request(params,'/trialdrive/vehicle/uvlist')
}
// 获取车辆树列表-查询组织下面的车辆
export const GET_ORGANIZATION_VEHICLE_LIST = params => {
return request(params,'/trialdrive/vehicle/ovlist')
}
// 用户管理-指定数据-保存数据
export const SAVE_USER_ASSIGN_INFO = params => {
return request(params,'/trialdrive/vehicle/permit/assign','post')
}
// 用户管理-指定数据-获取用户指定数据
export const GET_USER_ASSIGN_INFO = params => {
return request(params,'/trialdrive/vehicle/permit/assigndetails')
}
// 用户管理-指定数据-按组织授权-获取详情
export const GET_ORGZ_ASSIGN_INFO = params => {
return request(params,'/trialdrive/vehicle/orgz/assigndetails')
}
// 用户管理-指定数据-按组织授权-保存数据
export const SAVE_ORGZ_ASSIGN_INFO = params => {
return request(params,'/trialdrive/vehicle/orgz/assign','POST')
}
// 用户管理-指定数据-文件导入接口
export const IMPORT_VEHICLE_TEMPLATE = '/trialdrive/vehicle/permit/import'
// 用户管理-指定数据-文件导入-模板下载
export const DOWNLOAD_ASSIGNPERMIT_TEMPLATE_FILE = params => {
return request(params,'/publiccenter/dict/data/type/excelTemplate/assignPermit')
}
// 用户管理-删除用户-查询用户是否绑定车辆
export const JUDGE_USER_BINDVEHICLE = params => {
return request(params,'/trialdrive/data/sniff','POST')
}
// 重置用户uuid
export const REST_USER_UUID = params => {
return request(params,'/usercenter/user/resetUID')
}
export { getUserList, getSuperUser, addUser, editUser, detailUser, deleteUser, roleList, dictInfo, resetPassword}
import { VEHICLETYPE_API } from '@/config/config'
import request from '@/services/request'
// 获取车型管理列表
function getTableList(params) {
const url = VEHICLETYPE_API.VEHICLETYPE_SEARCH
return request(params, url)
}
// 获取租户列表
function getTenantList(params) {
const url = VEHICLETYPE_API.TENANT_SIMPLELIST
return request(params, url)
}
// 获取菜单权限
function getMenuTree(params) {
const url = VEHICLETYPE_API.MENU_TREE
return request(params, url)
}
//1层
function getMenuTreeFirst(params) {
const url = VEHICLETYPE_API.MENU_TREE_ONE
return request(params, url)
}
//2层
function getMenuTreeSecond(params) {
const url = VEHICLETYPE_API.MENU_TREE_TWO
return request(params, url)
}
//3层
function getMenuTreeThird(params) {
const url = VEHICLETYPE_API.MENU_TREE_THREE
return request(params, url)
}
//获取菜单的叶子节点(车型)
function geMenuTreeLeaf(params) {
const url = VEHICLETYPE_API.VEHICLETYPE_TYPES
return request(params, url)
}
//新增车型接口
function addVehicleType(params) {
const url = VEHICLETYPE_API.VEHICLETYPE_ADD
return request(params, url, 'post')
}
// 获取车型库
function GETVEHICLEINFO(params) {
const url = VEHICLETYPE_API.VEHICLETYPE_INFO
return request(params, url)
}
//删除一条表数据
function delelteTableRowData(params) {
const url = VEHICLETYPE_API.VEHICLETYPE_DELETE
return request(params, url)
}
//获取编辑的接口,获取页面信息
function editVehicleType(params) {
const url = VEHICLETYPE_API.VEHICLETYPE_EDIT
return request(params, url)
}
export { getTableList, getTenantList, getMenuTree, getMenuTreeFirst, getMenuTreeSecond,getMenuTreeThird, geMenuTreeLeaf, addVehicleType, GETVEHICLEINFO,delelteTableRowData,editVehicleType}
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 }
const getters = {
// 获取车型数据
getTreeData:state => {
let arr = state.vehicleTree;
//let n = localStorage.getItem('carTree') ? JSON.parse(localStorage.getItem('carTree')) : []
let n = state.vehicleCarTree
if(!arr || arr.length<=0){
arr = n;
}
return arr;
},
}
export default getters;
\ No newline at end of file \ No newline at end of file
import Vue from 'vue';
import Vuex from 'vuex';
import state from './state';
import mutations from './mutations';
import getters from './getter'
Vue.use(Vuex);
const store = new Vuex.Store({
state,
getters,
mutations
})
export default store;
\ No newline at end of file \ No newline at end of file
import state from "./state";
export default {
//更新全局baseURL
updateBaseURL(state, newBaseURL) {
state.baseURL = newBaseURL;
},
// 更新车型数据
updateVehicleTree(state, list) {
state.vehicleTree = list;
},
// 更新车型数据
updateVehicleCarTree(state, list) {
state.vehicleCarTree = list;
},
// 更新定制后的车型数据
updateVehicleCustomTree(state, list) {
state.vehicleCustomTree = list;
},
// 更新设备组合数据
updateDeviceAssembly(state, list) {
state.deviceAssembly = list;
},
// 更新组织树数据
updateOrganizationTree(state, list) {
state.organizationTree = list;
},
// 更新用户组织树数据
updateUserOrganizationTree(state, list) {
state.userVehicleTree = list;
},
// 系统管理-用户管理-指定数据-按组织授权-更新组织树
updateTreeByOrganization(state,list){
state.organizationUserTree = list
}
};
const state = {
baseURL: '',
token: '', // 令牌
loginStatus: false, // 是否登录
userInfo: {
username: '', // 用户名
phoneNumber: '', // 手机号
tenantId: '', // 租户id
superiorId: '', // 上级id
account: '', // 登录名
email: '',
gender: '',
position: ''
},
vehicleTree:[], // 车形数据
vehicleCarTree:[],// 车型原始数据
vehicleCustomTree:[], // 新增工单-新增车辆-车型数据
deviceAssembly:[], // 新增工单-新增车辆-设备组合
organizationTree:[], // 组织树
userVehicleTree:[], // 用户管理-指定数据-组织树
organizationUserTree:[], // 用户管理-指定数据-按组织授权-树
}
try {
} catch(e) {}
export default state;
\ No newline at end of file \ No newline at end of file
.add_work_page {
padding-bottom: 60px;
}
.head_title {
position: relative;
font-size: 18px;
font-weight: bold;
padding: 10px 0;
//margin-bottom: 30px;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.mb30 {
margin-bottom: 30px;
}
.el_form_box {
display: flex;
flex-wrap: wrap;
.el-form-item {
flex: 0 0 50%;
padding-right: 30px;
box-sizing: border-box;
}
.long_form_item {
flex: 0 0 100%;
}
.el_date_picker {
margin-right: 10px;
}
}
// 提交按钮区域
.submit_box {
position: fixed;
bottom: 0;
right: 16px;
z-index: 10;
padding: 10px 24px;
display: flex;
align-items: center;
justify-content: flex-end;
background: #fff;
}
.city_box {
display: flex;
.el-form-item {
flex: 2;
padding-right: 0;
}
.cascader_item {
flex: 1;
padding-right: 4px;
.el_cascader {
width: 100%;
}
}
// .el_cascader {
// width:40%;
// margin-right:4px;
// }
}
.inline-b {
display: inline-block;
}
.pull-right {
float: right;
}
.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: 270px;
overflow-x: auto;
.el-tree {
font-size: 14px;
}
.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% - 270px);
}
}
.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 \ No newline at end of file
.c_canvas {
width: 100%;
height: 100px;
}
.c_canvass {
width: 100px;
height: 134px;
}
.static_list_box {
display: flex;
align-items: center;
position: relative;
.mask {
position: absolute;
width: 100%;
height: 234px;
background-color: #fbfbfb;
top: 0;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
}
.cell_box {
flex: 1;
margin: 0 10px 0 0;
border: 1px solid #d8d8d8;
border-radius: 4px;
background: rgba($color: #d8d8d8, $alpha: 0.1);
.head {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px;
font-size: 14px;
color: #666;
font-weight: bold;
}
.head:after {
display: block;
content: "";
height: 1px;
background: #d8d8d8;
position: absolute;
left: 0;
right: 0;
bottom: 0;
transform: scaleY(0.5);
}
.info_box {
padding: 10px;
.title {
font-size: 30px;
color: #666;
}
.footer {
padding: 10px 0;
border-top: 2px solid #eee;
font-size: 13px;
display: flex;
.footer-box {
flex: 1;
}
}
.equipment_box {
display: flex;
.equipment_boxs {
display: flex;
flex: 1;
}
}
}
}
.cell_box:last-child {
margin: 0;
}
}
// 常规报警
.alarm_box {
margin: 20px 0;
background: #fff;
.head {
position: relative;
padding: 10px;
font-size: 14px;
color: #666;
font-weight: bold;
border: 1px solid #d8d8d8;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
display: flex;
align-items: center;
justify-content: space-between;
}
.alarm_list {
display: flex;
align-items: center;
padding: 10px 0;
.cell {
flex: 1;
margin: 0 20px 0 0;
border: 1px solid #d8d8d8;
border-radius: 4px;
background: rgba($color: #d8d8d8, $alpha: 0.1);
cursor: pointer;
.title {
display: flex;
align-items: center;
padding: 10px;
font-size: 12px;
font-weight: bold;
color: #666;
img {
width: 20px;
height: 20px;
margin-right: 10px;
}
}
.num {
font-size: 30px;
color: #666;
padding: 10px;
}
}
.cell:hover {
background: rgba($color: #2196f3, $alpha: 0.1);
border: 1px solid #2196f3;
}
.cell:last-child {
margin: 0;
}
}
}
// 设备激活趋势
.device_box {
border: 1px solid #d8d8d8;
border-radius: 4px;
.head {
border: 0;
}
.head:after {
display: block;
content: "";
height: 1px;
background: #d8d8d8;
position: absolute;
left: 0;
right: 0;
bottom: 0;
}
.chart_box {
padding: 20px 0;
.chart_wrapper {
width: 100%;
height: 300px;
}
}
}
.area_car{
position: fixed;
top:100px;
right:40px;
z-index:99;
cursor: pointer;
.img{
width:80px;
height: 80px;
}
}
\ No newline at end of file \ 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 \ No newline at end of file
.sort_select {
width: 120px;
}
.small_select {
width: 120px;
}
.long_input {
width: 300px;
}
.data_picker {
width: 240px;
}
.table_box {
margin: 10px 0;
}
.el_link {
margin: 0 4px;
}
.upload_box {
.input_box {
display: flex;
align-items: center;
.a_input {
margin-right: 10px;
width: 320px;
}
}
.tips {
font-size: 12px;
color: #999;
line-height: 2;
}
}
.dialog_links {
display: flex;
align-items: center;
justify-content: space-between;
}
.upload_result {
display: flex;
justify-content: center;
.cell {
position: relative;
width: 200px;
display: flex;
flex-direction: column;
text-align: center;
span {
line-height: 2;
}
.num {
font-size: 18px;
font-weight: bold;
color: #666;
}
.cred {
color: #f00;
}
}
.cell:after {
display: block;
content: "";
width: 1px;
background: #d8d8d8;
position: absolute;
top: 50%;
right: 0;
height: 70%;
transform: translateY(-50%);
opacity: 0.8;
}
.cell:last-child:after {
display: none;
}
}
.pre_select_box {
display: flex;
align-items: center;
.sort_select {
margin-right: 4px;
}
}
// 自定义弹框标题
.custom_title {
display: flex;
align-items: center;
justify-content: space-between;
.name {
font-size: 16px;
}
.dialog_menu {
display: flex;
align-items: center;
padding-right: 10px;
a {
padding: 10px;
margin:0 0 0 10px;
}
.active {
position: relative;
color: #409eff;
}
.active:after {
display: block;
content: "";
height: 2px;
background: #409eff;
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 80%;
}
}
}
/* 关联车辆 */
.car_info_box{
.cell{
display:flex;
align-items: center;
line-height:30px;
}
}
.btn_mini_size{
padding:2px 12px !important;
min-height: 24px;
}
\ No newline at end of file \ 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 \ 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 \ 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[3456789]\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();
}
},
};
// 通过url下载文件
export const downPackFile = (options) => {
if (!options) {
return false;
}
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();
};
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!