Commit e202ccba by yuhao

innit

parents
.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?
# xzxt-rxbd-vue
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
{
"compilerOptions": {
"target": "es5",
"module": "esnext",
"baseUrl": "./",
"moduleResolution": "node",
"paths": {
"@/*": [
"src/*"
]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "xzxt-rxbd-vue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"crypto-js": "^4.1.1",
"driver.js": "^0.9.8",
"echarts": "^4.9.0",
"element-ui": "^2.4.5",
"file-saver": "^2.0.5",
"js-base64": "^3.7.2",
"js-cookie": "^2.2.1",
"kindeditor": "^4.1.10",
"moment": "^2.29.1",
"qs": "^6.9.4",
"relation-graph": "^1.1.0",
"sass-resources-loader": "^2.1.1",
"video.js": "^7.14.3",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vue-wechat-title": "^2.0.7",
"vuedraggable": "^2.24.3",
"vuex": "^3.4.0",
"vuex-persistedstate": "^4.0.0-beta.1",
"xlsx": "^0.17.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.5.0",
"@vue/cli-plugin-eslint": "^4.5.0",
"@vue/cli-plugin-router": "^4.5.0",
"@vue/cli-plugin-vuex": "^4.5.0",
"@vue/cli-service": "^4.5.0",
"@vue/eslint-config-prettier": "^6.0.0",
"axios": "^0.18.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.2",
"script-loader": "^0.7.2",
"vue-cli-plugin-axios": "^0.0.4",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"success": true,
"code": 200,
"message": "成功",
"data": {
"total": 13,
"rows": [
{
"id": "05000200",
"label": "盗窃案[05000200]",
"parentId": "",
"children": []
},
{
"id": "05000300",
"label": "诈骗案[05000300]",
"parentId": "",
"children": []
},
{
"id": "05000100",
"label": "抢劫案[05000100]",
"parentId": "",
"children": []
},
{
"id": "05000400",
"label": "抢夺案[05000400]",
"parentId": "",
"children": []
},
{
"id": "06010300",
"label": "招摇撞骗案[06010300]",
"parentId": "",
"children": []
},
{
"id": "05001000",
"label": "敲诈勒索案[05001000]",
"parentId": "",
"children": []
},
{
"id": "04000900",
"label": "非法拘禁案[04000900]",
"parentId": "",
"children": []
},
{
"id": "06012400",
"label": "寻衅滋事案[06012400]",
"parentId": "",
"children": []
},
{
"id": "05001100",
"label": "故意毁坏财物案[05001100]",
"parentId": "",
"children": []
},
{
"id": "06012300",
"label": "聚众斗殴案[06012300]",
"parentId": "",
"children": []
},
{
"id": "03080700",
"label": "强迫交易案[03080700]",
"parentId": "",
"children": []
},
{
"id": "04000300",
"label": "故意伤害案[04000300]",
"parentId": "",
"children": []
},
{
"id": "06015400",
"label": "催收非法债务案[06015400]",
"parentId": "",
"children": []
}
]
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"code": 200,
"data": {
"rows": [
{
"ids": "26096",
"label": "海南省",
"codeType": "CODE_XZQH",
"text": "海南省",
"pId": null,
"id": "460000",
"isParent": true,
"children": [
{
"ids": "26097",
"label": "海南省海口市",
"codeType": "CODE_XZQH",
"text": "海南省海口市",
"pId": "460000",
"id": "460100",
"isParent": true,
"children": [
{
"ids": "26098",
"label": "海南省海口市秀英区",
"codeType": "CODE_XZQH",
"text": "海南省海口市秀英区",
"pId": "460100",
"id": "460105",
"isParent": false,
"children": []
},
{
"ids": "26099",
"label": "海南省海口市龙华区",
"codeType": "CODE_XZQH",
"text": "海南省海口市龙华区",
"pId": "460100",
"id": "460106",
"isParent": false,
"children": []
},
{
"ids": "26100",
"label": "海南省海口市琼山区",
"codeType": "CODE_XZQH",
"text": "海南省海口市琼山区",
"pId": "460100",
"id": "460107",
"isParent": false,
"children": []
},
{
"ids": "26101",
"label": "海南省海口市美兰区",
"codeType": "CODE_XZQH",
"text": "海南省海口市美兰区",
"pId": "460100",
"id": "460108",
"isParent": false,
"children": []
}
]
},
{
"ids": "26102",
"label": "海南省三亚市",
"codeType": "CODE_XZQH",
"text": "海南省三亚市",
"pId": "460000",
"id": "460200",
"isParent": true,
"children": [
{
"ids": "26103",
"label": "海南省三亚市海棠区",
"codeType": "CODE_XZQH",
"text": "海南省三亚市海棠区",
"pId": "460200",
"id": "460202",
"isParent": false,
"children": []
},
{
"ids": "26104",
"label": "海南省三亚市吉阳区",
"codeType": "CODE_XZQH",
"text": "海南省三亚市吉阳区",
"pId": "460200",
"id": "460203",
"isParent": false,
"children": []
},
{
"ids": "26105",
"label": "海南省三亚市天涯区",
"codeType": "CODE_XZQH",
"text": "海南省三亚市天涯区",
"pId": "460200",
"id": "460204",
"isParent": false,
"children": []
},
{
"ids": "26106",
"label": "海南省三亚市崖州区",
"codeType": "CODE_XZQH",
"text": "海南省三亚市崖州区",
"pId": "460200",
"id": "460205",
"isParent": false,
"children": []
}
]
},
{
"ids": "26107",
"label": "海南省三沙市",
"codeType": "CODE_XZQH",
"text": "海南省三沙市",
"pId": "460000",
"id": "460300",
"isParent": true,
"children": []
},
{
"ids": "26108",
"label": "海南省儋州市",
"codeType": "CODE_XZQH",
"text": "海南省儋州市",
"pId": "460000",
"id": "460400",
"isParent": true,
"children": []
},
{
"ids": "26109",
"label": "海南省五指山市",
"codeType": "CODE_XZQH",
"text": "海南省五指山市",
"pId": "460000",
"id": "469001",
"isParent": false,
"children": []
},
{
"ids": "26110",
"label": "海南省琼海市",
"codeType": "CODE_XZQH",
"text": "海南省琼海市",
"pId": "460000",
"id": "469002",
"isParent": false,
"children": []
},
{
"ids": "26111",
"label": "海南省文昌市",
"codeType": "CODE_XZQH",
"text": "海南省文昌市",
"pId": "460000",
"id": "469005",
"isParent": false,
"children": []
},
{
"ids": "26112",
"label": "海南省万宁市",
"codeType": "CODE_XZQH",
"text": "海南省万宁市",
"pId": "460000",
"id": "469006",
"isParent": false,
"children": []
},
{
"ids": "26113",
"label": "海南省东方市",
"codeType": "CODE_XZQH",
"text": "海南省东方市",
"pId": "460000",
"id": "469007",
"isParent": false,
"children": []
},
{
"ids": "26114",
"label": "海南省定安县",
"codeType": "CODE_XZQH",
"text": "海南省定安县",
"pId": "460000",
"id": "469021",
"isParent": false,
"children": []
},
{
"ids": "26115",
"label": "海南省屯昌县",
"codeType": "CODE_XZQH",
"text": "海南省屯昌县",
"pId": "460000",
"id": "469022",
"isParent": false,
"children": []
},
{
"ids": "26116",
"label": "海南省澄迈县",
"codeType": "CODE_XZQH",
"text": "海南省澄迈县",
"pId": "460000",
"id": "469023",
"isParent": false,
"children": []
},
{
"ids": "26117",
"label": "海南省临高县",
"codeType": "CODE_XZQH",
"text": "海南省临高县",
"pId": "460000",
"id": "469024",
"isParent": false,
"children": []
},
{
"ids": "26118",
"label": "海南省白沙黎族自治县",
"codeType": "CODE_XZQH",
"text": "海南省白沙黎族自治县",
"pId": "460000",
"id": "469025",
"isParent": false,
"children": []
},
{
"ids": "26119",
"label": "海南省昌江黎族自治县",
"codeType": "CODE_XZQH",
"text": "海南省昌江黎族自治县",
"pId": "460000",
"id": "469026",
"isParent": false,
"children": []
},
{
"ids": "26120",
"label": "海南省乐东黎族自治县",
"codeType": "CODE_XZQH",
"text": "海南省乐东黎族自治县",
"pId": "460000",
"id": "469027",
"isParent": false,
"children": []
},
{
"ids": "26222",
"label": "海南省陵水黎族自治县",
"codeType": "CODE_XZQH",
"text": "海南省陵水黎族自治县",
"pId": "460000",
"id": "469028",
"isParent": false,
"children": []
},
{
"ids": "26223",
"label": "海南省保亭黎族苗族自治县",
"codeType": "CODE_XZQH",
"text": "海南省保亭黎族苗族自治县",
"pId": "460000",
"id": "469029",
"isParent": false,
"children": []
},
{
"ids": "26224",
"label": "海南省琼中黎族苗族自治县",
"codeType": "CODE_XZQH",
"text": "海南省琼中黎族苗族自治县",
"pId": "460000",
"id": "469030",
"isParent": false,
"children": []
}
]
}
]
},
"success": true,
"message": "成功"
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<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="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view v-wechat-title="$route.meta.title"></router-view>
</div>
</template>
<script>
export default {};
</script>
<style lang="scss" scoped>
/*每个页面公共css */
@import "@/assets/styles/main.scss";
#app {
height: 100%;
width: 100%;
}
</style>
var relUrlIp = window.location.host.substring(
0,
window.location.host.length - 5
);
let base = {
bigurl: "",
mapurl: "",
naotuPath: "",
XingZhen: "",
ZhiTu_url: "",
Ptlogin: "",
ebss: "",
alyIP: "",
alyIP2: ''
};
if (
relUrlIp == "74.6.54.164"
) {
base.alyIP = "/apiXzxtGaw";
base.alyIP2 = "/apialyhainan";
base.alyIP14 = 'http://65.26.2.101:9005' //人档车档
} else {
//------------------------------服务器路径**测试**----------------------------------
base.alyIP = "/api";
base.alyIP2 = "/apialyhainan";
base.alyIP14 = 'http://65.26.2.101:9005' //人档车档
}
export default base;
import { post, postform, postdown,get } from "@/utils/http.js";
const baseUrl = '/api'
export const login = params =>
post(baseUrl+`/blade-auth/token`, params);
export const sign = params =>
post(baseUrl+`/blade-auth/sign`, params);
@font-face {
font-family: 'YouSheBiaoTiHei';
src: url('YouSheBiaoTiHei-2.ttf');
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
@import './main.scss';
.el-submenu .el-menu-item {
padding: 0 !important;
}
.activeClass {
color: #0061F7;
}
.headerTitle {
height: 64px;
// background: #0061F7;
font-size: 18px;
font-weight: bold;
line-height: 64px;
color: #fff;
padding: 0 4px;
margin-bottom: 16px;
img {
width: 36px;
margin-right: 5px;
}
}
.headerUser {
height: 56px;
// background: #0061F7;
font-size: 18px;
font-weight: bold;
line-height: 56px;
color: #333;
padding: 0 16px 0 43px;
background: rgba(0, 0, 0, 0.2);
// background-color: #fff;
position: sticky;
top: 0;
z-index: 99
}
.queryContent {
height: calc(100vh - 1px);
// height: 100%;
}
.rightContent {
flex: 1;
height: 100%;
overflow-y: auto;
.topMenu {
height: 48px;
background: #FFFFFF;
padding: 0 20px;
z-index: -1;
}
}
/deep/ .el-tabs__header {
margin: 0 !important;
}
/deep/ .el-tabs__nav-wrap::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 2px;
z-index: 1;
background-color: unset !important;
}
/deep/ .el-tabs__item {
padding: 0 20px;
height: 48px;
box-sizing: border-box;
line-height: 48px;
display: inline-block;
list-style: none;
font-size: 14px;
font-weight: 500;
color: #303133;
position: relative;
}
.leftMenu {
width: 220px;
height: 100%;
background: linear-gradient(#1C222B, #4B5B76) !important;
box-shadow: 4px 0px 8px rgba(0, 0, 0, 0.08);
opacity: 1;
font-size: 14px;
// padding-top: 12px;
padding: 0 16px;
box-sizing: border-box;
overflow: hidden;
.iconfont {
margin-right: 18px;
margin-left: 7px;
}
/deep/ .el-submenu ul>li {
// background-color: #1C1D27 !important;
}
/deep/ .el-menu /deep/ .el-submenu__title:hover {
// background-color: #2F313D !important;
}
/deep/ .el-menu-item.is-active {
background-color: rgba(33, 150, 243, 0.2) !important;
color: #fff;
i {
color: #2962FF;
}
}
/deep/ .el-menu-item,
/deep/ .el-submenu {
border-left: 3px solid transparent;
}
/deep/ .el-menu-item,
/deep/ .el-submenu__title {
height: 56px;
line-height: 56px;
}
/deep/ .el-divider--horizontal {
width: 70%;
margin: 10px 0 10px 30px;
background-color: #12131B;
}
/deep/ .el-scrollbar {
.el-scrollbar__wrap {
overflow-x: hidden;
.el-scrollbar__view {
height: 100%;
}
.el-menu {
/*margin-top:10px;*/
width: 100%;
height: 100%;
.el-submenu:not(.is-opened) {
.el-submenu__icon-arrow {
transform: rotateZ(-90deg);
}
}
.el-submenu.is-opened {
.el-submenu__icon-arrow {
transform: rotateZ(180deg);
}
}
.el-menu-item.is-active {
color: $base-color;
/*background:$-left-active-background !important;*/
font-weight: bold;
/*border-right:$-left-active-background-border;*/
}
.el-menu-item,
.el-submenu__title {
font-size: 14px;
}
/*/deep/ .el-submenu__title:hover{
background-color:#ecf5ff !important;
}*/
.el-menu.el-menu--inline li {
padding-left: 59px !important;
}
.el-submenu__icon-arrow {
font-size: 15px;
}
}
}
}
}
\ No newline at end of file
#home{
width: 100%;
height: 100%;
position: fixed;
background-image: url(../../assets/img/login/bg1.png);
background-repeat: no-repeat;
background-size: 100% 100%;
z-index: 100;
}
.common-lay .el-main{
line-height: 0px;
}
.el-input-div /deep/ .el-input__inner{
padding: 0 33px;
}
.loginBtn /deep/ .el-button{
border: none;
}
.inputs /deep/ input{
height: 44px;
background: rgba(255,255,255,1) !important;
}
.el-input input:-webkit-autofill {
//-webkit-text-fill-color: #01cfff !important;
//background-color: #fff;
}
<template>
<div class="loading-layer" v-show="isShow">
<div class="loading-anim">
<div class="box">
<div class="border out ns-border-color"></div>
<div class="border in ns-border-color"></div>
<div class="border mid ns-border-color"></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: "loading-cover",
data() {
return {
isShow: true
};
},
created() {},
methods: {
show() {
this.isShow = true;
},
hide() {
this.isShow = false;
}
}
};
</script>
<style lang="scss">
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.box {
background: red;
}
.loading-layer {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 997;
}
.loading-anim {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.loading-anim > view {
position: relative;
width: 40px;
height: 40px;
perspective: 800px;
transform-style: preserve-3d;
transition: all 0.2s ease-out;
}
.loading-anim .border {
position: absolute;
border-radius: 50%;
border: 2px solid;
}
.loading-anim .out {
top: 15%;
left: 15%;
width: 70%;
height: 70%;
border-left-color: transparent !important;
border-right-color: transparent !important;
animation: spin 0.8s linear reverse infinite;
}
.loading-anim .in {
top: 25%;
left: 25%;
width: 50%;
height: 50%;
border-top-color: transparent !important;
border-bottom-color: transparent !important;
animation: spin 0.8s linear infinite;
}
.loading-anim .mid {
top: 40%;
left: 40%;
width: 20%;
height: 20%;
border-left-color: transparent;
border-right-color: transparent;
animation: spin 0.6s linear infinite;
}
</style>
<template>
<div>
<el-form :model="formData"
:rules="rules"
ref="ruleForm"
:label-width="labelWidth"
:label-position="labelPosition">
<el-form-item :class="{'formItem3':isActive}"
v-for="item in formConfig"
:label="item.label"
:prop="item.prop"
size="small"
:key="item.prop">
<!-- 输入框 -->
<el-input v-if="item.type === 'input'"
size="small"
placeholder="请输入"
v-model.trim="formData[item.prop]"
:disabled="item.disabled"
:style="{ width: item.width }"
@change="item.change && item.change(formData[item.prop])"></el-input>
<el-input-number v-if="item.type === 'inputNum'"
size="small"
placeholder="请输入"
:min="0"
v-model.trim="formData[item.prop]"
:disabled="item.disabled"
:style="{ width: item.width }"
@change="item.change && item.change(formData[item.prop])"></el-input-number>
<div v-if="item.type === 'inputRangeNum'"
style="display: inline-flex">
<el-input-number size="small"
placeholder="请输入"
:min="0"
v-model.trim="formData[item.propMin]"
:disabled="item.disabled"
:style="{ width: item.width }"
@change="item.change && item.change(formData[item.propMin])"></el-input-number>
<el-input-number size="small"
placeholder="请输入"
:min="0"
v-model.trim="formData[item.propMax]"
:disabled="item.disabled"
:style="{ width: item.width }"
@change="item.change && item.change(formData[item.propMax])"></el-input-number>
</div>
<!-- 下拉框 -->
<el-select v-if="item.type === 'select'"
v-model="formData[item.prop]"
:disabled="item.disabled"
size="small"
clearable
:style="{ width: item.width }"
@change="item.change && item.change(formData[item.prop])">
<el-option v-for="option in item.options"
:label="option.label"
:value="option.value"
:key="option.value"></el-option>
</el-select>
<!-- 自选下拉框 -->
<el-select v-if="item.type === 'selectSelf'"
v-model="formData[item.prop]"
:disabled="item.disabled"
size="small"
clearable
:style="{ width: item.width }"
@change="item.change && item.change(formData[item.prop])">
<el-option v-for="option in item.options"
:label="option.name"
:value="option.value"
:key="option.name"></el-option>
</el-select>
<!-- 单选框 -->
<el-radio-group v-if="item.type === 'radio'"
v-model="formData[item.prop]"
:disabled="item.disabled"
@change="item.change && item.change(formData[item.prop])">
<el-radio v-for="radio in item.radios"
size="small"
:label="radio.val"
:key="radio.label">{{radio.label}}</el-radio>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group v-if="item.type === 'checkbox'"
v-model="formData[item.prop]"
:disabled="item.disabled"
@change="checkboxChange">
<el-checkbox v-for="checkbox in item.checkboxs"
size="small"
:label="checkbox.label"
:key="checkbox.label">
{{checkbox.name}}
</el-checkbox>
</el-checkbox-group>
<el-date-picker v-if="item.type === 'date'"
v-model="formData[item.prop]"
type="date"
style="width:100%;"
size="small"
placeholder="请选择日期"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd">
</el-date-picker>
<el-date-picker v-if="item.type === 'daterange'"
v-model="formData[item.prop]"
type="daterange"
unlink-panels
style="width:100%;"
size="small"
range-separator="至"
placeholder="请选择日期"
format="yyyy 年 MM 月 dd 日"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd">
</el-date-picker>
<select-tree-dialog v-if="item.type === 'codeTreeDialog'"
:placeholder="'请选择'"
:sendId="item.id"
:formData="formData"
:currentItem="item" />
<select-tree-dialog v-if="item.type == 'codeTreeDialogs'"
:placeholder="'请选择'"
:sendId="item.id"
:formData="formData"
:currentItem="item" />
</el-form-item>
<!-- 操作按钮 -->
<div class="searchBtn">
<div v-for="item in searchHandle"
:key="item.label">
<el-button v-if="!item.show ? item.show : true"
:class="item.class"
:type="item.type"
:icon="item.icon"
size="small"
@click.native.prevent="item.handle()">
{{ item.label }}
</el-button>
</div>
</div>
</el-form>
</div>
</template>
<script>
import SelectTreeDialog from "@c/treeCode_components.vue";
import axios from "axios";
import base from "@/api/base";
import { foreachTree } from '@/utils/util.js'
export default {
components: {
SelectTreeDialog,
},
props: {
isActive: {
type: Boolean,
default: false,
},
// 表单域标签的宽度
labelWidth: {
type: String,
default: '100px'
},
// 表单域标签的位置
labelPosition: {
type: String,
default: 'right'
},
// 表单配置
formConfig: {
type: Array,
required: true
},
// 表单数据
formData: {
type: Object,
required: true
},
// 表单规则
rules: {
type: Array,
},
searchHandle: {
type: Array,
required: true
}
},
created () {
this.init()
},
methods: {
checkboxChange (val) {
console.log(val)
},
init () {
let self = this;
/*获取字典*/
// // debugger;
self.formConfig.forEach((val) => {
if (val.type == "codeTree" || val.type == "codeTreeDialog") {
if (val.codeOptions.length == 0) {
axios
.get(`JsonData/${val.codeTree}.json`)
.then((res) => {
self.$set(val, "codeOptions", res.data.data.rows);
})
.catch((err) => {
console.log(err);
});
}
} else if (val.type == "codeTreeDialogs") {
let unitcode = JSON.parse(localStorage.getItem("userInfo")).unitcode;
let grade = JSON.parse(localStorage.getItem("userInfo")).grade;
if (grade == 'S' || grade == 'T') {
var newUnicode = unitcode.substring(0, 2) + '0000000000'
} else if (grade == 'D') {
var newUnicode = unitcode.substring(0, 4) + '00000000'
} else if (grade == 'X') {
var newUnicode = unitcode.substring(0, 6) + '000000'
} else if (grade == 'K') {
var newUnicode = unitcode.substring(0, 8) + '0000'
}
if (val.codeOptions.length == 0) {
axios
.get(`JsonData/${val.codeTree}.json`)
.then((res) => {
// console.log(res.data.rows, res.data.data.rows);
// return
let dwList = (res.data.rows ? res.data.rows : res.data.data.rows).filter(item => item.id.includes(newUnicode.substring(0, 2)))
if (dwList.length > 0) {
let result
foreachTree(dwList, (item) => { if (item.id === newUnicode) result = item })
if (grade == 'S' || grade == 'T') {
self.$set(val, "codeOptions", dwList);
} else {
self.$set(val, "codeOptions", [result]);
}
}
})
.catch((err) => {
console.log(err);
});
}
}
});
},
},
}
</script>
<style lang="scss" scoped>
.el-form {
.el-form-item {
display: inline-block;
width: 25%;
}
.formItem3 {
width: 33%;
}
.searchBtn {
display: flex;
justify-content: center;
.el-button {
width: 98px;
}
}
}
</style>
\ No newline at end of file
import FileSaver from 'file-saver';
import XLSX from 'xlsx';
export default {
// 导出Excel表格
exportExcel (name, tableName) {
debugger
//name表示生成excel的文件名 tableName表示表格的id
let fix = document.querySelector('.el-table__fixed');
//let con = document.querySelector(tableName);
//console.log(con);
let sel;
if(fix){ //判断要导出的节点中是否有fixed的表格,如果有,转换excel时先将该dom移除,然后append回去
sel = XLSX.utils.table_to_book(document.querySelector('#myTable').removeChild(fix));
document.querySelector('#myTable').appendChild(fix);
}else{
sel = XLSX.utils.table_to_book(document.querySelector(tableName));
}
//var sel = XLSX.utils.table_to_book(document.querySelector(tableName))
var selIn = XLSX.write(sel, { bookType: 'xlsx', bookSST: true, type: 'array' })
try {
FileSaver.saveAs(new Blob([selIn], { type: 'application/octet-stream' }), name)
} catch (e) {
if (typeof console !== 'undefined') console.log(e, selIn)
}
return selIn
}
};
<template>
<!--左侧导航-->
<div>
<div style="display: flex"
class="queryContent">
<div class="leftMenu"
:style="{ width: isCollapse == true ? '72px' : '240px' }">
<div class="headerTitle">
<img src="../assets/img/login/jinhui.png"
alt="" />
<span>{{ topHeader }}</span>
<!-- <span>统计分析</span> -->
</div>
<!-- class="t0" -->
<el-scrollbar style="height: 88%;">
<el-menu @select="changeSidebar"
:default-active="myPath"
@open="handleMenuOpen"
@close="handleMenuClose"
class="left-cd"
:collapse="isCollapse"
:unique-opened="isOpenOnly"
active-text-color="#fff"
background-color="#ab181800"
text-color="#fff"
ref="menu">
<!-- activeIndex -->
<div class="menu_wrap"
v-for="item in leftMenus"
:key="item.index"
v-permission="item.roles">
<!-- &&checkPermission([item.newAuth]) -->
<el-menu-item :index="item.index"
v-if="item.hasChildren == false"
@click="goDetail(item)">
<!-- <i :class="item.className"></i> -->
<img style="width: 20px;height: 20px"
:src="item.icon"
alt="" />
{{ item.label }}
</el-menu-item>
<el-submenu :index="item.index"
v-if="item.hasChildren == true">
<template slot="title">
<!-- <i :class="item.className"></i> -->
<img style="width: 20px;height: 20px"
:src="item.icon"
alt="" />
<span slot="title"
style="color: #343a3f !important">{{
item.label
}}</span>
</template>
<el-menu-item :index="subitem.index"
v-for="(subitem, index) in item.children"
:key="index"
@click="goDetail(subitem)"
v-permission="subitem.roles"><i class="iconfont iconquanxianjiesuo"
v-show="subitem.disabled"></i>{{ subitem.label }}</el-menu-item>
</el-submenu>
</div>
</el-menu>
</el-scrollbar>
</div>
<div class="rightContent">
<div class="headerUser">
<el-menu class="get-user"
mode="horizontal">
<el-submenu index="2">
<template slot="title">
<i style="background: #D6DBE3;display: inline-block;width:32px;height:32px;border-radius: 16px;margin-right: 8px"></i>{{realname}}
</template>
<el-menu-item index="2-1"
@click="loginOut">退出</el-menu-item>
</el-submenu>
</el-menu>
</div>
<keep-alive>
<router-view />
</keep-alive>
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
import checkPermission from '@/utils/permission' // 权限判断函数
import path from 'path'
import router from '@/router'
export default {
name: "leftMenu_components",
props: {
isCollapseP: Boolean,
},
data () {
return {
visible: false,
top: 0,
left: 0,
selectedTag: {},
affixTags: [],
myPath: this.$route.meta.activePath ? this.$route.meta.activePath : this.$route.path,
isOpenOnly: true,
isCollapse: this.isCollapseP,
activeIndex: this.$route.name,
navList: [],
leftMenus: [],
topMenus: [],
activeName: "",
topHeader: "",
realname: JSON.parse(sessionStorage.getItem("userInfo")).realname
};
},
computed: {
...mapGetters(["topMenu", "leftMenu", "header"]),
},
created () {
// console.log(this.$route.matched[1], this.$route.meta.activePath, 1111);
this.navList = JSON.parse(sessionStorage.getItem("navList"));
this.topMenus = this.topMenu;
this.leftMenus = this.leftMenu;
this.topHeader = this.header;
},
mounted () {
},
methods: {
isActive (route) {
return route.path === this.$route.path
},
openMenu (tag, e) {
const menuMinWidth = 105
const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
const offsetWidth = this.$el.offsetWidth // container width
const maxLeft = offsetWidth - menuMinWidth // left boundary
const left = e.clientX - offsetLeft + 15 // 15: margin right
if (left > maxLeft) {
this.left = maxLeft
} else {
this.left = left
}
this.top = e.clientY
this.visible = true
this.selectedTag = tag
},
closeMenu () {
this.visible = false
},
checkPermission,
goDetail (item) {
if (item.index != this.$route.path) {
this.$router.push(item.index);
path.resolve('/', item.index)
}
},
handleClick (tab) {
this.activeName = tab.name;
this.$router.push(tab.name);
},
handleMenuOpen (key, keyPath) { },
handleMenuClose (key, keyPath) { },
changeSidebar (index) {
sessionStorage.setItem("routerPath", index);
},
loginOut () {
sessionStorage.removeItem("userInfo")
sessionStorage.removeItem('token')
this.$router.replace('/login')
}
},
watch: {
visible (value) {
if (value) {
document.body.addEventListener('click', this.closeMenu)
} else {
document.body.removeEventListener('click', this.closeMenu)
}
},
// $route () {
// },
// 监视$route的变化
$route: function (to, from) {
//设置导航菜单高亮的路径为前两段路径
if (this.$route.meta && this.$route.meta.activePath) {
this.myPath = this.$route.meta.activePath;
} else {
this.myPath = this.$route.matched[1].path;
}
},
isCollapseP (val) {
this.isCollapse = val;
},
topMenu (val) {
this.topMenus = val;
this.activeName = val[0].id;
},
leftMenu (val) {
this.leftMenus = val;
},
header (val) {
this.topHeader = val;
// this.header = val;
},
// $route (val) {
// this.activeIndex = this.$route.name;
// let index = this.topMenus.findIndex((i) => i.id == val.name);
// if (!val.meta.isAdd && index >= 0) {
// this.activeName = val.name;
// }
// },
},
};
</script>
<style scoped lang="scss">
@import "../assets/styles/leftMenu.scss";
/deep/.get-user {
float: right;
height: 100%;
.menu_wrap {
.el-menu-item {
padding-left: 0 !important;
width: 100%;
&.is-active {
}
}
}
.el-submenu {
height: 100%;
.el-submenu__title {
line-height: 56px !important;
height: 100% !important;
}
}
}
/deep/.t0 {
overflow: hidden !important;
height: calc(100% - 70px);
}
/deep/.left-cd {
height: 100%;
/* overflow: auto !important; */
.menu_wrap {
margin-bottom: 8px;
.el-menu-item {
padding-left: 12px !important;
padding-right: 0 !important;
height: 48px;
line-height: 48px;
border-radius: 8px;
margin: 0 !important;
&.is-active {
background: #3375e1 !important;
border-radius: 8px;
}
&:hover {
background: #3375e1 !important;
border-radius: 8px;
}
img {
margin-right: 12px;
}
}
}
}
.rightContent {
overflow: hidden;
/* background: url(../assets/img/ajda/right1.png) no-repeat; */
background-size: 100% 100%;
}
.el-menu {
background-color: transparent;
&.el-menu--horizontal {
border-bottom: none;
}
/deep/.el-submenu__title:hover {
background-color: transparent !important;
}
/deep/.el-submenu__title {
color: #ffffff !important;
}
.el-submenu:hover {
/deep/.el-submenu__title {
color: #ffffff !important;
}
}
}
.tags-view-item {
display: inline-block;
position: relative;
cursor: pointer;
width: 124px;
height: 44px;
line-height: 44px;
background: rgba(0, 0, 0, 0.4);
border-radius: 12px 12px 0px 0px;
font-size: 16px;
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
font-weight: 400;
color: #d6dbe3;
padding: 0 20px;
margin-top: 11px;
margin-right: 4px;
i {
margin-right: 10px;
}
&.active {
background-color: #3375e1;
color: #fff;
}
}
.el-menu {
border: none;
}
</style>
import Vue from "vue";
import "@/plugins/axios";
import App from "@/App.vue";
import router from "@/router";
import store from "@/store";
import "@/plugins/element.js";
import Util from "@/utils/util";
import VueWechatTitle from "vue-wechat-title";
import Watermark from "@/utils/watermark.js"
import Driver from 'driver.js'
import 'driver.js/dist/driver.min.css'
import '@/assets/font/iconfont.css'
import moments from 'moment'
Vue.prototype.$moment = moments;
//全局导出excel
import htmlToExcel from './excel/htmlToExcel';
Vue.prototype.htmlToExcels = htmlToExcel;
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
Vue.prototype.$driver = new Driver({
className: "scoped-class", // className to wrap driver.js popover
animate: true, // Animate while changing highlighted element
opacity: 0.75, // Background opacity (0 means only popovers and without overlay)
padding: 1, // Distance of element from around the edges
allowClose: true, // Whether clicking on overlay should close or not
overlayClickNext: false, // Should it move to next step on overlay click
doneBtnText: "完成", // Text on the final button
closeBtnText: "关闭", // Text on the close button for this step
nextBtnText: "下一步", // Next button text for this step
prevBtnText: "上一步" // Previous button text for this step
})
import Nsloading from "@/components/Loading.vue";
Vue.prototype.$store = store;
const LoadingCons = Vue.extend(Nsloading);
// 常用工具函数
Vue.prototype.$util = Util;
window.util = Util;
Vue.use(VueWechatTitle);
let userInfo = window.sessionStorage.getItem("userInfo") || "";
if (userInfo) {
userInfo = JSON.parse(window.sessionStorage.getItem("userInfo"))
let zjhm = userInfo.identitycard.replace(/^(.{10})(?:\d+)(.{4})$/, "$1****$2")
let name = userInfo.realname.substring(0, userInfo.realname.length - 1)
let names = userInfo.realname.replace(name, '***')
let xmmc = '统计分析子系统'
let time = Util.timeStampTurnTime(new Date().getTime())
let one = `${zjhm} ${names}`
let two = `${userInfo.ip} ${time}`
Watermark.set(xmmc, one, two)
}
Vue.directive("nsLoading", {
bind (el, binding) {
const instance = new LoadingCons({
el: document.createElement("div"),
data: {}
});
el.appendChild(instance.$el);
el.instance = instance;
Vue.nextTick(() => {
el.instance.isShow = binding.value;
});
},
/**
* 所在组件的 VNode 更新时调用
* @param {*} el
* @param {*} binding
*/
update (el, binding) {
// 通过对比值的变化判断loading是否显示
if (binding.oldValue !== binding.value) {
el.instance.isShow = binding.value;
}
},
/**
* 只调用一次,在 指令与元素解绑时调用
* @param {*} el
*/
unbind (el) {
const mask = el.instance.$el;
if (mask.parentNode) {
mask.parentNode.removeChild(mask);
}
el.instance.$destroy();
el.instance = undefined;
}
});
function checkPermission (el, binding) {
const { value } = binding
const roles = store.getters && store.getters.roles
if (value && value instanceof Array) {
if (value.length > 0) {
const permissionRoles = value
const hasPermission = roles.some(role => {
return permissionRoles.includes(role)
})
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el)
}
}
}
};
Vue.directive('permission', {
inserted (el, binding) {
checkPermission(el, binding)
},
update (el, binding) {
checkPermission(el, binding)
}
});
new Vue({
router,
store,
render: h => h(App)
}).$mount("#app");
"use strict";
import Vue from "vue";
import axios from "axios";
// Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
let config = {
// baseURL: process.env.baseURL || process.env.apiUrl || ""
// timeout: 60 * 1000, // Timeout
// withCredentials: true, // Check cross-site Access-Control
};
const _axios = axios.create(config);
_axios.interceptors.request.use(
function(config) {
// Do something before request is sent
return config;
},
function(error) {
// Do something with request error
return Promise.reject(error);
}
);
// Add a response interceptor
_axios.interceptors.response.use(
function(response) {
// Do something with response data
return response;
},
function(error) {
// Do something with response error
return Promise.reject(error);
}
);
Plugin.install = function(Vue) {
Vue.axios = _axios;
window.axios = _axios;
Object.defineProperties(Vue.prototype, {
axios: {
get() {
return _axios;
}
},
$axios: {
get() {
return _axios;
}
}
});
};
Vue.use(Plugin);
export default Plugin;
import Vue from "vue";
import Element from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(Element);
import Vue from "vue";
import VueRouter from "vue-router";
import loginRoutes from "./modules/login";
import statistical from "./modules/statistical";
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push (location) {
if (location && typeof location == "string" && location.indexOf("http") != -1)
return window.location.open(location, "_self");
return originalPush.call(this, location).catch(err => err);
};
const originalResolve = VueRouter.prototype.resolve;
VueRouter.prototype.pushToTab = function pushToTab (location) {
if (!location) return;
if (location && typeof location == "string" && location.indexOf("http") != -1)
return window.open(location, "_blank");
const { href } = originalResolve.call(this, location);
window.open(href, "_blank");
};
Vue.use(VueRouter);
const mainRouters = [
...loginRoutes, ...statistical,
{
path: "*",
name: "error",
component: () => import("@/views/error.vue")
},
];
const router = new VueRouter({
// mode: "history",
// base: process.env.BASE_URL,
routes: mainRouters
});
// router.beforeEach((to, from, next) => {
// const token = getToken();
// if (!token) {
// if (to.path === '/login') {
// next();
// } else {
// next({
// path: "/login",
// query: { redirect: to.fullPath }
// });
// }
// }
// if (to.meta.auth < store.state.user.userAuth) {
// Message.error("暂无权限");
// return;
// }
// next();
// });
export default router;
export default [
{
path: '/',
redirect: '/login'
},
{
path: "/jump",
name: "jump",
meta: {
title: '登录',
auth: "5",
isUpdata: false
},
component: () => import("@/views/ddLogin.vue")
},
{
path: "/login",
name: "Login",
meta: {
title: "登录",
auth: "5"
},
component: () => import("@/views/login.vue")
},
]
\ No newline at end of file
import menuLayout from "@/layout/menuLayout.vue";
const menuLayouts = [
{
path: "/statistical",
name: "statistical",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/index.vue")
},
{
path: "/structure",
name: "structure",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/jgfbt.vue")
},
{
path: "/zcsw",
name: "zcsw",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/zcsw.vue")
},
{
path: "/zarys",
name: "zarys",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/zarys.vue")
},
{
path: "/qfgm",
name: "qfgm",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/qfgm.vue")
},
{
path: "/yzbl",
name: "yzbl",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/yzbl.vue")
},
{
path: "/xxma",
name: "xxma",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/xxma.vue")
},
{
path: "/sqaj",
name: "sqaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/sqaj.vue")
},
{
path: "/qjaj",
name: "qjaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/qjaj.vue")
},
{
path: "/shaj",
name: "shaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/shaj.vue")
},
{
path: "/qfcc",
name: "qfcc",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/qfcc.vue")
},
{
path: "/zpaj",
name: "zpaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/zpaj.vue")
},
{
path: "/dxwl",
name: "dxwl",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/dxwl.vue")
},
{
path: "/ctdq",
name: "ctdq",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/ctdq.vue")
},
{
path: "/dqaj",
name: "dqaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/dqaj.vue")
},
{
path: "/rsdq",
name: "rsdq",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/rsdq.vue")
},
{
path: "/dqjdc",
name: "dqjdc",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/dqjdc.vue")
},
{
path: "/pqaj",
name: "pqaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/pqaj.vue")
},
{
path: "/qjqj",
name: "qjqj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/qjqj.vue")
},
{
path: "/qdaj",
name: "qdaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/qdaj.vue")
},
{
path: "/wwaj",
name: "wwaj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/wwaj.vue")
},
{
path: "/ajtjb",
name: "ajtjb",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/basicInfo/ajtjb.vue")
},
{
path: "/ajlbtj",
name: "ajtajlbtjjb",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/ajlb/ajlbtj.vue")
},
{
path: "/ajlbtjcd",
name: "ajlbtjcd",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/ajlb/ajlbtjcd.vue")
},
{
path: "/qqqctj",
name: "qqqctj",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/qqqc/qqqctj.vue")
},
{
path: "/rxyj",
name: "rxyj",
meta: {
title: '人像预警',
auth: "5",
},
component: () => import("@/views/rxyj/rxyj.vue")
},
{
path: "/rxgl",
name: "rxgl",
meta: {
title: '人像预警',
auth: "5",
},
component: () => import("@/views/rxyj/rxgl.vue")
},
]
export default [{
path: "/right",
component: menuLayout,
children: [...menuLayouts]
}, {
path: "/caseDetail",
name: "caseDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/caseDetail.vue")
}, {
path: "/zcswDetail",
name: "zcswDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/zcswDetail.vue")
}, {
path: "/zaryDetail",
name: "zaryDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/statistical/zaryDetail.vue")
}, {
path: "/ajtjbDetail",
name: "ajtjbDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/basicInfo/ajtjbDetail.vue")
}, {
path: "/ajzztDetail",
name: "ajzztDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/basicInfo/ajzztDetail.vue")
}, {
path: "/nlhjDetail",
name: "nlhjDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/basicInfo/nlhjDetail.vue")
}, {
path: "/shrDetail",
name: "shrDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/basicInfo/shrDetail.vue")
}, {
path: "/xyrDetail",
name: "xyrDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/basicInfo/xyrDetail.vue")
}, {
path: "/ajlbtjDetail",
name: "ajlbtjDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/ajlb/ajlbtjDetail.vue")
}, {
path: "/qqqctjDetail",
name: "qqqctjDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/qqqc/qqqctjDetail.vue")
}, {
path: "/wcnfz",
name: "wcnfc",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcn/wcnfz.vue")
}, {
path: "/wcnajlbDetail",
name: "wcnajlbDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcn/wcnajlbDetail.vue")
}, {
path: "/wcnajsDetail",
name: "wcnajsDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcn/wcnajsDetail.vue")
}, {
path: "/ajlbDetail",
name: "ajlbDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/ajlb/ajlbDetail.vue")
}, {
path: "/ajsDetail",
name: "ajsDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/ajlb/ajsDetail.vue")
}, {
path: "/wcnrysDetail",
name: "wcnrysDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcn/wcnrysDetail.vue")
}, {
path: "/wcnshrfz",
name: "wcnshrfz",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcnshr/wcnfz.vue")
}, {
path: "/wcnshrajlbDetail",
name: "wcnajlbDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcnshr/wcnajlbDetail.vue")
}, {
path: "/wcnshrajsDetail",
name: "wcnajsDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcnshr/wcnajsDetail.vue")
}, {
path: "/wcnshrrysDetail",
name: "wcnrysDetail",
meta: {
title: '统计分析',
auth: "5",
},
component: () => import("@/views/wcnshr/wcnrysDetail.vue")
}, {
path: "/rxyjDetail",
name: "rxyj",
meta: {
title: '人像预警',
auth: "5",
},
component: () => import("@/views/rxyj/rxyjDetail.vue")
}, {
path: "/bklb",
name: "bklb",
meta: {
title: '布控列表',
auth: "5",
},
component: () => import("@/views/bklb/bklb.vue")
},]
\ No newline at end of file
const getters = {
token: state => state.user.token,
topMenu: state => state.user.topMenu,
Breadcrumbs: state => state.user.Breadcrumbs,
leftMenu: state => state.user.leftMenu,
header: state => state.user.header,
roles: state => state.user.roles,
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
};
export default getters;
import Vue from "vue";
import Vuex from "vuex";
import getters from "./getters";
import createPersistedState from "vuex-persistedstate";
import user from "./modules/user";
import tagsView from "./modules/tagsView";
Vue.use(Vuex);
const store = new Vuex.Store({
modules: {
user, tagsView
},
getters,
plugins: [
createPersistedState({
storage: window.sessionStorage,
reducer (val) {
const { user } = val;
return { user };
}
})
],
});
export default store;
const state = {
visitedViews: [],
cachedViews: []
}
const mutations = {
ADD_VISITED_VIEW: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
},
ADD_CACHED_VIEW: (state, view) => {
if (state.cachedViews.includes(view.name)) return
if (!view.meta.noCache) {
state.cachedViews.push(view.name)
}
},
DEL_VISITED_VIEW: (state, view) => {
for (const [i, v] of state.visitedViews.entries()) {
if (v.path === view.path) {
state.visitedViews.splice(i, 1)
break
}
}
},
DEL_CACHED_VIEW: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
index > -1 && state.cachedViews.splice(index, 1)
},
DEL_OTHERS_VISITED_VIEWS: (state, view) => {
state.visitedViews = state.visitedViews.filter(v => {
return v.meta.affix || v.path === view.path
})
},
DEL_OTHERS_CACHED_VIEWS: (state, view) => {
const index = state.cachedViews.indexOf(view.name)
if (index > -1) {
state.cachedViews = state.cachedViews.slice(index, index + 1)
} else {
// if index = -1, there is no cached tags
state.cachedViews = []
}
},
DEL_ALL_VISITED_VIEWS: state => {
// keep affix tags
const affixTags = state.visitedViews.filter(tag => tag.meta.affix)
state.visitedViews = affixTags
},
DEL_ALL_CACHED_VIEWS: state => {
state.cachedViews = []
},
UPDATE_VISITED_VIEW: (state, view) => {
for (let v of state.visitedViews) {
if (v.path === view.path) {
v = Object.assign(v, view)
break
}
}
}
}
const actions = {
addView({ dispatch }, view) {
dispatch('addVisitedView', view)
dispatch('addCachedView', view)
},
addVisitedView({ commit }, view) {
commit('ADD_VISITED_VIEW', view)
},
addCachedView({ commit }, view) {
commit('ADD_CACHED_VIEW', view)
},
delView({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delVisitedView', view)
dispatch('delCachedView', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delVisitedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_VISITED_VIEW', view)
resolve([...state.visitedViews])
})
},
delCachedView({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_CACHED_VIEW', view)
resolve([...state.cachedViews])
})
},
delOthersViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delOthersVisitedViews', view)
dispatch('delOthersCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delOthersVisitedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
delOthersCachedViews({ commit, state }, view) {
return new Promise(resolve => {
commit('DEL_OTHERS_CACHED_VIEWS', view)
resolve([...state.cachedViews])
})
},
delAllViews({ dispatch, state }, view) {
return new Promise(resolve => {
dispatch('delAllVisitedViews', view)
dispatch('delAllCachedViews', view)
resolve({
visitedViews: [...state.visitedViews],
cachedViews: [...state.cachedViews]
})
})
},
delAllVisitedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_VISITED_VIEWS')
resolve([...state.visitedViews])
})
},
delAllCachedViews({ commit, state }) {
return new Promise(resolve => {
commit('DEL_ALL_CACHED_VIEWS')
resolve([...state.cachedViews])
})
},
updateVisitedView({ commit }, view) {
commit('UPDATE_VISITED_VIEW', view)
}
}
export default {
namespaced: true,
state,
mutations,
actions
}
import {removeToken} from "@/utils/auth";
const state = {
// token: getToken(),
topMenu: [],
Breadcrumbs: [],
leftMenu: [],
header: '',
roles: []
};
const mutations = {
SET_TOKEN: (state, token) => {
state.token = token;
},
SET_Menu: (state, content) => {
state.topMenu = content;
},
SET_Breadcrumb: (state, content) => {
state.Breadcrumbs = content;
},
SET_LeftMenu: (state, content) => {
state.leftMenu = content;
},
SET_Header: (state, content) => {
state.header = content;
},
SET_ROLES: (state, roles) => {
state.roles = roles
}
};
const actions = {
remove_token({ commit }) {
commit("SET_TOKEN", "");
removeToken();
},
logout({ commit }) {
commit('SET_ROLES', [])
sessionStorage.removeItem("userInfo");
sessionStorage.removeItem('token', '')
},
};
export default {
namespaced: true,
state,
mutations,
actions
};
/**
* 跳转路径配置文件
* @type {string}
*/
let jumpUrlPath = {};
const userInfo = sessionStorage.getItem('userInfo') && JSON.parse(sessionStorage.getItem('userInfo'))
//案件档案跳转地址
jumpUrlPath.toAjda = "http://65.26.2.101:9005/#/jump?path=queryAjda&asjbh=";
jumpUrlPath.toAjda = "http://74.6.54.163:9004/#/jump?path=queryAjda&asjbh=";
//个人中心跳转地址
// http://localhost:8083/ http://65.26.2.99:9002/
jumpUrlPath.toGrzx = `http://65.26.2.99:9002/#/jump?path=addXg&xxzjbh=${userInfo.userId}&token=`;
//jumpUrlPath.toGrzx = "http://65.26.2.99:9002/#/jump?path=addXg?personalInfo&token=";
export default jumpUrlPath;
import Cookies from "js-cookie";
const TokenKey = "SDrxEA%_tWW6ezd3";
export function getToken() {
return Cookies.get(TokenKey);
}
export function setToken(token, expires = 0) {
if (expires) return Cookies.set(TokenKey, token, { expires });
return Cookies.set(TokenKey, token);
}
export function removeToken() {
return Cookies.remove(TokenKey);
}
const CryptoJS = require('crypto-js'); //引用AES源码js
// key iv 自己设置16即可,位置要对应上;
const key = CryptoJS.enc.Utf8.parse("xzeq2021@zhyy#54"); //十六位十六进制数作为密钥
const skKey = CryptoJS.enc.Utf8.parse("maplogin");
const iv = CryptoJS.enc.Utf8.parse('xzeq2021@zhyy#54'); //十六位十六进制数作为密钥偏移量
//解密方法
function Decrypt(word) {
let encryptedHexStr = CryptoJS.enc.Hex.parse(word);
let srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
let decrypt = CryptoJS.AES.decrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
return decryptedStr.toString();
}
//加密方法
function Encrypt(word) {
let srcs = CryptoJS.enc.Utf8.parse(word);
let encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
return encrypted.ciphertext.toString().toUpperCase();
}
function skEncrypt(word, keyStr, ivStr) {
let key = '';
let iv = '';
if (keyStr) {
key = CryptoJS.enc.Utf8.parse(keyStr);
iv = CryptoJS.enc.Utf8.parse(ivStr);
}
let srcs = CryptoJS.enc.Utf8.parse(word);
var encrypted = CryptoJS.AES.encrypt(srcs, key, {
iv: iv,
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.ZeroPadding,
});
// console.log("参数", keyStr, ivStr);
return CryptoJS.enc.Base64.stringify(encrypted.ciphertext);
}
// 解密
function skDecrypt(word) {
let key = CryptoJS.enc.Utf8.parse("maplogin");
let iv = CryptoJS.enc.Utf8.parse("map_vues");
let encryptedHexStr = CryptoJS.enc.Hex.parse(word);
let srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
let decrypt = CryptoJS.AES.decrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
return decryptedStr.toString();
}
function creattimeBumderNYR(number) {
var dateh = new Date(number);
let month =
(dateh.getMonth() + 1 < 10
? "0" + (dateh.getMonth() + 1)
: dateh.getMonth() + 1) + "-";
let day =
(dateh.getDate() < 10 ? "0" + dateh.getDate() : dateh.getDate()) + " ";
var year = dateh.getFullYear() + "-";
var houyizhou = year + month + day;
return houyizhou;
}
export default {
Decrypt ,
Encrypt,
skEncrypt,
skDecrypt,
creattimeBumderNYR
}
import axios from "axios";
import store from "@/store";
import { Message, MessageBox } from "element-ui";
import qs from "qs";
var arr = document.cookie.split("; ");
let userToken = "";
let appToken = "";
arr.forEach((item) => {
if (item.includes("userToken=")) {
userToken = item.split("userToken=")[1];
}
if (item.includes("appToken=")) {
appToken = item.split("appToken=")[1];
}
});
// debugger
axios.defaults.timeout = 0;
axios.defaults.headers = {
"X-Requested-With": "XMLHttpRequest",
"authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
"token": userToken,
"appToken": appToken,
};
axios.defaults.responseType = "json";
// axios.defaults.withCredentials = true;
var instance = axios.create({
headers: {
"content-type": "multipart/form-data",
"authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
"token": userToken,
"appToken": appToken,
}
});
var json = axios.create({
headers: {
"content-type": "application/json",
"authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
"token": userToken,
"appToken": appToken,
}
});
var down = axios.create({
headers: {
"content-type": "application/json",
"blade-auth": window.sessionStorage.getItem("token")
},
});
// request 请求拦截器
axios.interceptors.request.use(
config => {
config.headers["Content-Type"] = "application/x-www-form-urlencoded";
let token = sessionStorage.getItem("token")
if (config.url.indexOf("/api/blade-auth/token") === -1) {
config.headers["blade-auth"] = token;
}
return config;
},
error => {
return Promise.reject(error);
}
);
// response 响应拦截器
axios.interceptors.response.use(
response => {
const status = response.data.code;
const message = response.data.message;
var relUrlIp = window.location.host.substring(
0,
window.location.host.length - 5
);
let unitcode = ''
if (JSON.parse(window.sessionStorage.getItem("userInfo"))) {
unitcode = JSON.parse(window.sessionStorage.getItem("userInfo")).unitcode
}
// debugger
var self = this
if (status == "401") {
MessageBox.confirm("系统登录超时,请重新登录", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
window.location.href = 'http://74.6.54.165:9006/#/login';
})
}
if (status < 0) {
Message({
message: message,
type: "error"
});
return Promise.reject(new Error(message));
}
return response;
},
error => {
return Promise.reject(new Error(error));
}
);
instance.interceptors.request.use(
config => {
let token = sessionStorage.getItem("token")
if (config.url.indexOf("/api/blade-auth/token") === -1) {
config.headers["blade-auth"] = token;
}
return config;
},
error => {
return Promise.reject(error);
}
);
instance.interceptors.response.use(
response => {
const status = response.data.code;
const message = response.data.message;
var relUrlIp = window.location.host.substring(
0,
window.location.host.length - 5
);
let unitcode = ''
if (JSON.parse(window.sessionStorage.getItem("userInfo"))) {
unitcode = JSON.parse(window.sessionStorage.getItem("userInfo")).unitcode
}
var self = this
if (status == "401") {
MessageBox.confirm("系统登录超时,请重新登录", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
window.location.href = 'http://74.6.54.165:9006/#/login';
})
}
if (status < 0) {
Message({
message: message,
type: "error"
});
return Promise.reject(new Error(message));
}
return response.data;
},
error => {
return Promise.reject(new Error(error));
}
);
json.interceptors.response.use(
response => {
const status = response.data.code;
var relUrlIp = window.location.host.substring(
0,
window.location.host.length - 5
);
let unitcode = ''
if (JSON.parse(window.sessionStorage.getItem("userInfo"))) {
unitcode = JSON.parse(window.sessionStorage.getItem("userInfo")).unitcode
}
if (status == "401") {
MessageBox.confirm("系统登录超时,请重新登录", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
window.location.href = 'http://74.6.54.165:9006/#/login';
})
}
return response.data;
},
error => {
return Promise.reject(new Error(error));
}
);
json.interceptors.request.use(
config => {
config.headers["Content-Type"] = "application/x-www-form-urlencoded";
let token = sessionStorage.getItem("token")
if (config.url.indexOf("/api/blade-auth/token") === -1) {
config.headers["blade-auth"] = token;
}
return config;
},
error => {
return Promise.reject(error);
}
);
/**
* 封装get方法
* @param url
* @param data
* @returns {Promise}
*/
export function get (url, params) {
return new Promise((resolve, reject) => {
axios
.get(url, {
params: params
})
.then(res => {
resolve(res.data);
})
.catch(err => {
reject(err.data);
});
});
}
/**
* 封装post请求
* @param url
* @param data
* @returns {Promise}
*/
export function post (url, params) {
return new Promise((resolve, reject) => {
axios
.post(url, qs.stringify(params))
.then(response => {
resolve(response);
})
.catch(err => {
reject(err.data);
});
});
}
/**
* 封装post请求 multipart/form-data
* @param url
* @param data
* @returns {Promise}
*/
export function postform (url, data) {
return new Promise((resolve, reject) => {
instance.post(url, data).then(response => {
resolve(response);
});
}).catch(err => {
reject(err.data);
});
}
/**
* 封装post请求 文件下载
* @param url
* @param data
* @returns {Promise}
*/
export function postdown (url, data) {
return new Promise((resolve, reject) => {
down.post(url, data).then(response => {
resolve(response);
});
}).catch(err => {
reject(err.data);
});
}
/**
* 封装post请求 json格式
* @param url
* @param data
* @returns {Promise}
*/
export function postJson (url, data) {
// debugger
return new Promise((resolve, reject) => {
json.post(url, JSON.parse(data)).then(response => {
resolve(response);
});
}).catch(err => {
reject(err.data);
});
}
export default axios;
import store from '@/store'
/**
* @param {Array} value
* @returns {Boolean}
* @example v-if="checkPermission(['admin','editor'])"
*/
export default function checkPermission (value) {
if (value && value instanceof Array && value.length > 0) {
const roles = store.getters && store.getters.roles
const permissionRoles = value
const hasPermission = roles.some(role => {
return permissionRoles.includes(role)
})
return hasPermission
} else {
return false
}
}
/*
验证规则
*/
const validateisSFZH = (rule, value, callback) => {
// let patter = new RegExp("/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/");//验证是否身份证号
let patter = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;//验证是否手机号
if (!patter.test(value)) {
return callback(new Error("请输入正确格式的身份证号!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisNoiDentity = (rule, value, callback) => {
// let patter = new RegExp("/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/");//验证是否身份证号
let patter = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;//验证是否手机号
if (!value) {
callback()
}
if (!patter.test(value)) {
return callback(new Error("请输入正确格式的身份证号!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisIphone = (rule, value, callback) => {
// let patter = new RegExp("/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/");//验证是否身份证号
let patter = /^1[345789]\d{9}$/;//验证是否手机号
if (!value) {
callback()
}
if (!patter.test(value)) {
return callback(new Error("请输入正确格式的手机号!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisPhone = (rule, value, callback) => {
let patter = /^1[345789]\d{9}$/;//验证是否手机号
console.log(value)
// let patter = new RegExp("/^1[345789]\d{9}$/");//验证是否手机号
if (!patter.test(value)) {
return callback(new Error("请输入正确格式的手机号!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisNumber = (rule, value, callback) => {
let patter = /^[0-9]*$/;//验证是否是数字
if (!patter.test(value)) {
return callback(new Error("请输入正确的数字!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisWeight = (rule, value, callback) => {
let patter = /^(0(\.\d{1}){0,1}|[1-8]\d{1,3}(\.\d{1}){0,1}|9\d{1,2}(\.\d{1}){0,1}|999(\.0){0,1}|.{0})$/;
if (!patter.test(value)) {
return callback(new Error("请输入正确的体重!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisAj = (rule, value, callback) => {
let patter = /^A[0-9]{22}$/;//验证是否是案件编号
if (!patter.test(value)) {
return callback(new Error("请输入正确的案件编号!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisYczc = (rule, value, callback) => {
let patter = /^[A-Za-z0-9]{6}$/;//验证是否是车牌号
if (!patter.test(value)) {
return callback(new Error("请输入正确的车牌号!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateisPassword = (rule, value, callback) => {
let patter = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6}$/;//验证是否是正确的6位密码
if (!patter.test(value)) {
return callback(new Error("请输入正确的正确的6位密码!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validateLowerCase = (rule, value, callback) => {
let patter = /^[a-z]+$/;//验证是否是小写字母
if (!patter.test(value)) {
return callback(new Error("请输入正确的是小写字母!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validatePowerCase = (rule, value, callback) => {
let patter = /^[A-Z]+$/;//验证是否是大写字母
if (!patter.test(value)) {
return callback(new Error("请输入正确的大写字母!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
const validatAlphabets = (rule, value, callback) => {
let patter = /^[A-Za-z]+$/;//验证是否是大小写字母
if (!patter.test(value)) {
return callback(new Error("请输入正确的大小写字母!"));
} else {
callback();//必须有此项回调,否则验证会一直不通过
}
};
//直接验证通过
const validatStraightly = (rule, value, callback) => {
callback()
};
const checkEmpty = (rule, value, callback) => {
console.log(value)
if (!value) {
return callback(new Error('不能为空'));
}
};
export default {
checkEmpty: [
{
required: true,
message: "不能为空",
trigger: "blur"
}
],
emptyAbleIphone: [{
validator: validateisIphone,
trigger: "blur",
message: "请输入正确格式的手机号"
}],
identity: [{
validator: validateisSFZH,
trigger: "blur",
message: "请输入正确格式的身份证号"
}],
emptyAbleIdentity: [{
validator: validateisNoiDentity,
trigger: "blur",
required: true,
message: "请输入正确格式的身份证号"
}],
mobilePhone: [{
validator: validateisPhone,
trigger: "blur",
message: "请输入正确格式的手机号"
}],
number: [{
required: true,
message: "数字不能为空"
}, {
validator: validateisNumber,
trigger: "blur",
message: "请输入正确的数字"
}],
caseNumber: [{
required: true,
message: "案件编号不能为空"
}, {
validator: validateisAj,
trigger: "blur",
message: "请输入正确格式的案件编号"
}],
//体重
weight: [{
validator: validateisWeight,
trigger: "blur",
message: "请输入正确的数字"
}],
carNumber: [{
required: true,
message: "车牌号不能为空"
}, {
validator: validateisYczc,
trigger: "blur",
message: "请输入正确格式的车牌号码"
}],
password: [{
required: true,
message: "密码不能为空"
}, {
validator: validateisPassword,
trigger: "blur",
message: "请输入正确格式的6位密码"
}],
lowerCase: [{
required: true,
message: "密码不能为空"
}, {
validator: validateLowerCase,
trigger: "blur",
message: "请输入正确格式的小写字母"
}],
powerCase: [{
required: true,
message: "大写不能为空"
}, {
validator: validatePowerCase,
trigger: "blur",
message: "请输入正确格式的大写字母"
}],
alphabets: [{
required: true,
message: "大小写不能为空"
}, {
validator: validatAlphabets,
trigger: "blur",
message: "请输入正确格式的大小写字母"
}],
//体重
validatStraightly: [{
trigger: "blur",
}],
}
\ No newline at end of file
const CryptoJS = require('crypto-js'); //引用AES源码js
const sKey = CryptoJS.enc.Utf8.parse('xzeq2021@zhyy#54'); //十六位十六进制数作为密钥
//解密方法
function Decrypt(content) {
var decrypt = CryptoJS.AES.decrypt(content, sKey, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
return CryptoJS.enc.Utf8.stringify(decrypt).toString();
}
function Encrypt(content) {
var sContent = CryptoJS.enc.Utf8.parse(content);
var encrypted = CryptoJS.AES.encrypt(sContent, sKey, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
return encrypted.toString().replace(/\+/g, '%2B');
}
//不转译加密方法
function Encrypts(content) {
var sContent = CryptoJS.enc.Utf8.parse(content);
var encrypted = CryptoJS.AES.encrypt(sContent, sKey, { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 });
return encrypted.toString();
}
export default {
Decrypt,
Encrypt,
Encrypts
}
\ No newline at end of file
export default {
/**
* 时间戳转日期格式
* @param {Object} timeStamp
*/
timeStampTurnTime (timeStamp) {
if (timeStamp != undefined && timeStamp != "" && timeStamp > 0) {
var date = new Date();
date.setTime(timeStamp);
var y = date.getFullYear();
var m = date.getMonth() + 1;
m = m < 10 ? "0" + m : m;
var d = date.getDate();
d = d < 10 ? "0" + d : d;
var h = date.getHours();
h = h < 10 ? "0" + h : h;
var minute = date.getMinutes();
var second = date.getSeconds();
minute = minute < 10 ? "0" + minute : minute;
second = second < 10 ? "0" + second : second;
return y + "-" + m + "-" + d + " " + h + ":" + minute + ":" + second;
} else {
return "";
}
},
/**
* 数值去重
* @param {Array} arr 数组
* @param {string} field 字段
*/
unique (arr, field) {
const res = new Map();
return arr.filter(a => !res.has(a[field]) && res.set(a[field], 1));
},
/**
* 判断值是否在数组中
* @param {Object} elem
* @param {Object} arr
* @param {Object} i
*/
inArray: function (elem, arr) {
return arr == null ? -1 : arr.indexOf(elem);
},
/**
* 获取某天日期
* @param {Object} day
*/
getDay: function (day) {
var today = new Date();
var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
today.setTime(targetday_milliseconds);
const doHandleMonth = function (month) {
var m = month;
if (month.toString().length == 1) {
m = "0" + month;
}
return m;
};
var tYear = today.getFullYear();
var tMonth = today.getMonth();
var tDate = today.getDate();
var tWeek = today.getDay();
var time = parseInt(today.getTime() / 1000);
tMonth = doHandleMonth(tMonth + 1);
tDate = doHandleMonth(tDate);
const week = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
return {
t: time,
y: tYear,
m: tMonth,
d: tDate,
w: week[tWeek]
};
},
/**
* 深度拷贝对象
* @param {Object} obj
*/
deepClone (obj) {
const isObject = function (obj) {
return typeof obj == "object";
};
if (!isObject(obj)) {
throw new Error("obj 不是一个对象!");
}
//判断传进来的是对象还是数组
let isArray = Array.isArray(obj);
let cloneObj = isArray ? [] : {};
//通过for...in来拷贝
for (let key in obj) {
cloneObj[key] = isObject(obj[key]) ? this.deepClone(obj[key]) : obj[key];
}
return cloneObj;
}
};
/**
* 遍历树
*
*/
export const foreachTree = (data, callback, childrenName = 'children') => {
for (let i = 0; i < data.length; i++) {
callback(data[i])
if (data[i][childrenName] && data[i][childrenName].length > 0) {
foreachTree(data[i][childrenName], callback, childrenName)
}
}
}
\ No newline at end of file
let watermark = {}
let setWatermark = (str1,str2,str3) => {
let id = '1.23452384164.123412415'
if (document.getElementById(id) !== null) {
document.body.removeChild(document.getElementById(id))
}
let can = document.createElement('canvas')
can.width = 480
can.height = 160
let cans = can.getContext('2d')
cans.rotate(-13 * Math.PI / 180)
cans.font = '14px Vedana'
cans.fillStyle = 'rgba(0, 0, 0, 0.15)'
cans.textAlign = 'left'
cans.textBaseline = 'Middle'
cans.fillText(str1, can.width / 3, can.height / 2)
cans.fillText(str2, can.width / 3, can.height / 1.65)
cans.fillText(str3, can.width / 3, can.height / 1.42)
let div = document.createElement('div')
div.id = id
div.style.pointerEvents = 'none'
div.style.top = '0px'
div.style.left = '0px'
div.style.position = 'fixed'
div.style.zIndex = '100000'
div.style.width = document.documentElement.clientWidth - 10 + 'px'
div.style.height = document.documentElement.clientHeight - 10 + 'px'
div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat'
document.body.appendChild(div)
return id
}
// 该方法只允许调用一次
watermark.set = (str1,str2,str3) => {
let id = setWatermark(str1,str2,str3)
setInterval(() => {
if (document.getElementById(id) === null) {
id = setWatermark(str1,str2,str3)
}
}, 500)
window.onresize = () => {
setWatermark(str1,str2,str3)
}
}
export default watermark
import axios from "axios";
import { foreachTree } from '@/utils/util.js'
export const mixinsZd = {
created () {
this.init()
},
methods: {
init () {
let self = this;
/*获取字典*/
// // debugger;
self.propQueryField.forEach((val) => {
if (val.type == "codeTree" || val.type == "codeTreeDialog") {
if (val.codeOptions.length == 0) {
axios
.get(`JsonData/${val.codeTree}.json`)
.then((res) => {
console.log(res, 1111);
self.$set(val, "codeOptions", res.data.data.rows);
})
.catch((err) => {
console.log(err);
});
}
} else if (val.type == "codeTreeDialogs") {
let unitcode = JSON.parse(sessionStorage.getItem("userInfo")).unitcode;
let grade = JSON.parse(sessionStorage.getItem("userInfo")).grade;
if (grade == 'S' || grade == 'T') {
var newUnicode = unitcode.substring(0, 2) + '0000000000'
} else if (grade == 'D') {
var newUnicode = unitcode.substring(0, 4) + '00000000'
} else if (grade == 'X') {
var newUnicode = unitcode.substring(0, 6) + '000000'
} else if (grade == 'K') {
var newUnicode = unitcode.substring(0, 8) + '0000'
}
if (val.codeOptions.length == 0) {
axios
.get(`JsonData/${val.codeTree}.json`)
.then((res) => {
let dwList = res.data.data.rows.filter(item => item.id.includes(newUnicode.substring(0, 2)))
if (dwList.length > 0) {
let result
foreachTree(dwList, (item) => { if (item.id === newUnicode) result = item })
if (grade == 'S' || grade == 'T') {
self.$set(val, "codeOptions", dwList);
} else {
self.$set(val, "codeOptions", [result]);
}
}
})
.catch((err) => {
console.log(err);
});
}
}
});
},
},
}
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment