Commit 0b072fcb authored by 乐宝呗666's avatar 乐宝呗666

格式化代码,提取header

parent f83b50a8
...@@ -9,7 +9,8 @@ module.exports = { ...@@ -9,7 +9,8 @@ module.exports = {
], ],
rules: { rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-async-promise-executor':process.env.NODE_ENV === 'production' ? 'error' : 'off',
}, },
parserOptions: { parserOptions: {
parser: 'babel-eslint' parser: 'babel-eslint'
......
...@@ -2348,7 +2348,6 @@ ...@@ -2348,7 +2348,6 @@
"version": "7.10.4", "version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.10.4.tgz",
"integrity": "sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw==", "integrity": "sha512-UpTN5yUJr9b4EX2CnGNWIvER7Ab83ibv0pcvvHc4UOdrBI5jb8bj+32cCwPX6xu0mt2daFNjYhoi+X7beH0RSw==",
"dev": true,
"requires": { "requires": {
"regenerator-runtime": "^0.13.4" "regenerator-runtime": "^0.13.4"
}, },
...@@ -2356,8 +2355,7 @@ ...@@ -2356,8 +2355,7 @@
"regenerator-runtime": { "regenerator-runtime": {
"version": "0.13.5", "version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
"dev": true
} }
} }
}, },
...@@ -2873,6 +2871,59 @@ ...@@ -2873,6 +2871,59 @@
"@types/yargs": "^13.0.0" "@types/yargs": "^13.0.0"
} }
}, },
"@jiaminghi/bezier-curve": {
"version": "0.0.9",
"resolved": "https://registry.npmjs.org/@jiaminghi/bezier-curve/-/bezier-curve-0.0.9.tgz",
"integrity": "sha512-u9xJPOEl6Dri2E9FfmJoGxYQY7vYJkURNX04Vj64tdi535tPrpkuf9Sm0lNr3QTKdHQh0DdNRsaa62FLQNQEEw==",
"requires": {
"@babel/runtime": "^7.5.5"
}
},
"@jiaminghi/c-render": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/@jiaminghi/c-render/-/c-render-0.4.3.tgz",
"integrity": "sha512-FJfzj5hGj7MLqqqI2D7vEzHKbQ1Ynnn7PJKgzsjXaZpJzTqs2Yw5OSeZnm6l7Qj7jyPAP53lFvEQNH4o4j6s+Q==",
"requires": {
"@babel/runtime": "^7.5.5",
"@jiaminghi/bezier-curve": "*",
"@jiaminghi/color": "*",
"@jiaminghi/transition": "*"
}
},
"@jiaminghi/charts": {
"version": "0.2.18",
"resolved": "https://registry.npmjs.org/@jiaminghi/charts/-/charts-0.2.18.tgz",
"integrity": "sha512-K+HXaOOeWG9OOY1VG6M4mBreeeIAPhb9X+khG651AbnwEwL6G2UtcAQ8GWCq6GzhczcLwwhIhuaHqRygwHC0sA==",
"requires": {
"@babel/runtime": "^7.5.5",
"@jiaminghi/c-render": "^0.4.3"
}
},
"@jiaminghi/color": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@jiaminghi/color/-/color-0.1.1.tgz",
"integrity": "sha512-M09+Sb5HGqVim0zo+nG5gU1v+6gXT8ptr0BZR6dMGt83XmCJgnZtO8s7llTW4hLFFFM5co6geZvTekqLpSPAAQ==",
"requires": {
"@babel/runtime": "^7.5.5"
}
},
"@jiaminghi/data-view": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/@jiaminghi/data-view/-/data-view-2.10.0.tgz",
"integrity": "sha512-Cud2MTiMcqc5k2KWabR/svuVQmXHANqURo+yj40370/LdI/gyUJ6LG203hWXEnT1nMCeiv/SLVmxv3PXLScCeA==",
"requires": {
"@babel/runtime": "^7.5.5",
"@jiaminghi/charts": "*"
}
},
"@jiaminghi/transition": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/@jiaminghi/transition/-/transition-1.1.11.tgz",
"integrity": "sha512-owBggipoHMikDHHDW5Gc7RZYlVuvxHADiU4bxfjBVkHDAmmck+fCkm46n2JzC3j33hWvP9nSCAeh37t6stgWeg==",
"requires": {
"@babel/runtime": "^7.5.5"
}
},
"@kazupon/vue-i18n-loader": { "@kazupon/vue-i18n-loader": {
"version": "0.5.0", "version": "0.5.0",
"resolved": "https://registry.npmjs.org/@kazupon/vue-i18n-loader/-/vue-i18n-loader-0.5.0.tgz", "resolved": "https://registry.npmjs.org/@kazupon/vue-i18n-loader/-/vue-i18n-loader-0.5.0.tgz",
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
"test:unit": "vue-cli-service test:unit" "test:unit": "vue-cli-service test:unit"
}, },
"dependencies": { "dependencies": {
"@jiaminghi/data-view": "^2.10.0",
"axios": "^0.19.0", "axios": "^0.19.0",
"axios-mock-adapter": "^1.18.1", "axios-mock-adapter": "^1.18.1",
"better-scroll": "^1.15.2", "better-scroll": "^1.15.2",
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" data-use-rem="1920">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>icon.ico"> <link rel="icon" href="<%= BASE_URL %>icon.ico">
......
src/assets/img/titleBg.png

93 KB | W: | H:

src/assets/img/titleBg.png

253 KB | W: | H:

src/assets/img/titleBg.png
src/assets/img/titleBg.png
src/assets/img/titleBg.png
src/assets/img/titleBg.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -12,6 +12,102 @@ ...@@ -12,6 +12,102 @@
// 在这里写公用的class // 在这里写公用的class
// 注意 这个文件里只写class // 注意 这个文件里只写class
// mixin等内容请在 public.scss 里书写 // mixin等内容请在 public.scss 里书写
// 字体大小
$base-font-size: 2.4rem;
$font-sizes: (
xxs: 0.1,//0.24rem
xs: 0.125,//0.30rem
sm: 0.1333,//0.32rem
md: 0.1667,//0.4rem
lg: 0.1875,//0.45rem
xl: 0.2083,//0.5rem
xxl: 0.3167,//0.76rem
);
// 宽高
.w-100 {
width: 100%;
}
.h-100 {
height: 100%;
}
//flex
.d-flex {
display: flex;
}
.flex-column {
flex-direction: column;
}
.flex-wrap {
flex-wrap: wrap;
}
.flex-nowrap {
flex-wrap: nowrap;
}
$flex-jc: (
start: flex-start,
end: flex-end,
center: center,
between: space-between,
around: space-around,
evenly: space-evenly,
);
$flex-ai: (
start: flex-start,
end: flex-end,
center: center,
stretch: stretch,
);
.flex-1 {
flex: 1;
}
.flex-4 {
flex:4;
}
.flex-3 {
flex:3;
}
.flex-2 {
flex:2;
}
//对齐
@each $var in (left, center, right) {
.text-#{$var} {
text-align: $var !important;
}
}
//flex
@each $key,
$value in $flex-jc {
.jc-#{$key} {
justify-content: $value;
}
}
@each $key,
$value in $flex-ai {
.ai-#{$key} {
align-items: $value;
}
}
//字体
@each $fontkey,
$fontvalue in $font-sizes {
.fs-#{$fontkey} {
font-size: $fontvalue * $base-font-size;
}
}
// 文字相关 // 文字相关
.#{$prefix}-text-center { .#{$prefix}-text-center {
......
...@@ -59,7 +59,14 @@ $prefix: d2; ...@@ -59,7 +59,14 @@ $prefix: d2;
} }
.bg {
// background-color: #000E42;
// background-size: cover;
// background-position: center center;
}
.dv-loading {
color: #fff;
}
ul{list-style: none; padding: 0} ul{list-style: none; padding: 0}
.d2-container-full{height: 100%;} .d2-container-full{height: 100%;}
.d2-container-full__body{height: 100%;} .d2-container-full__body{height: 100%;}
......
<template>
<div class="headerLayout">
<div class="tabList">
<div v-for="(item,index) in buttenList" :key="index" @click="change(index)">
<el-button class="tabButton" size="mini" :class="num==index?'is-active':''">{{item}}</el-button>
</div>
</div>
<h3>企业运行图谱</h3>
<div class="time">{{nowDate | moment("YYYY/MM/DD")}} {{nowDate | moment("HH:mm:ss")}} 星期{{week | weekFilter}}</div>
<div class="right-menu">
<el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper">
<img src="~@/assets/img/timg.jpg" class="user-avatar">
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown" class="user-dropdown">
<router-link to="/">
<el-dropdown-item>
Home
</el-dropdown-item>
</router-link>
<el-dropdown-item divided @click.native="logout">
<span style="display:block; width: 60px">Log Out</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</template>
<script>
export default {
data () {
return {
screenWidth: document.body.clientWidth,
num: 0,
nowDate: '',
week: '',
hour: '',
monthData: {
id: 'dataByMonth',
xData: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
yData: [70, 90, 110, 108, 100, 110, 130, 140, 150, 120, 110, 98],
colors: ['RGBA(27, 157, 247, 1)', 'RGBA(30, 201, 251, 1)']
},
buttenList: ['概况', '运营', '商机', '客户']
}
},
filters: {
weekFilter: function (value) {
let nvalue = ''
switch (value) {
case 1:
nvalue = '一'
break
case 2:
nvalue = '二'
break
case 3:
nvalue = '三'
break
case 4:
nvalue = '四'
break
case 5:
nvalue = '五'
break
case 6:
nvalue = '六'
break
case 0:
nvalue = '日'
break
}
return nvalue
}
},
watch: {
screenwidth (val) {
if (!this.timer) {
this.screenWidth = val
this.timer = true
const that = this
setTimeout(function () {
console.log(that.screenWidth)
that.timer = false
}, 400)
}
}
},
mounted () {
this.init()
this.getDate()
const that = this
window.onresize = () => {
return (() => {
window.screenWidth = document.body.clientWidth
that.screenWidth = window.screenWidth
})()
}
},
methods: {
logout () {
this.$router.push('/login')
},
init () {
this.num = sessionStorage.getItem('num')
const user = JSON.parse(sessionStorage.getItem('user'))
if (user.role === 1) {
this.buttenList.push('管理端')
}
},
getDate () {
const vm = this
this.nowDate = new Date()
this.week = new Date().getDay()
setTimeout(function () {
vm.getDate()
}, 1000)
},
change (index) {
this.num = index
sessionStorage.setItem('num', index)
const token = sessionStorage.getItem('token')
switch (index) {
case 0:
this.$router.replace('/index')
break
case 1:
this.$router.replace('/content/operation/page')
break
case 2:
this.$router.replace('/content/business/page')
break
case 3:
this.$router.replace('/content/client/page')
break
// case 4:
// this.$router.replace('/content/organization/page')
// break
// case 5:
// this.$router.replace('/content/organization/page')
// break
case 4:
// this.$router.replace('/http://localhost:9528/#/dashboard')
// window.location.replace('http://localhost:9528/#/dashboard')
window.open('http://111.203.232.175:8085/#/dashboard?token=' + token)
// window.open('http://localhost:9528/#/dashboard?token=' + token)
}
}
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/headerLayout.scss';
.right-menu {
float: right;
height: 100%;
line-height: 50px;
&:focus {
outline: none;
}
.right-menu-item {
display: inline-block;
padding: 0 8px;
height: 100%;
font-size: 18px;
color: #5a5e66;
vertical-align: text-bottom;
&.hover-effect {
cursor: pointer;
transition: background .3s;
&:hover {
background: rgba(0, 0, 0, .025)
}
}
}
.avatar-container {
margin-right: 30px;
.avatar-wrapper {
margin-top: 14px;
position: relative;
.user-avatar {
cursor: pointer;
width: 40px;
height: 40px;
border-radius: 10px;
}
.el-icon-caret-bottom {
cursor: pointer;
position: absolute;
right: -20px;
top: 25px;
font-size: 12px;
}
}
}
}
</style>
...@@ -7,7 +7,6 @@ import d2Admin from './plugin/d2admin' ...@@ -7,7 +7,6 @@ import d2Admin from './plugin/d2admin'
// store // store
import store from '../store/index' import store from '../store/index'
// import $ from 'jquery' // import $ from 'jquery'
// 菜单和路由设置 // 菜单和路由设置
import router from './router' import router from './router'
...@@ -20,8 +19,9 @@ import moment from 'moment' ...@@ -20,8 +19,9 @@ import moment from 'moment'
// 引入echarts // 引入echarts
import echarts from 'echarts' import echarts from 'echarts'
import dataV from '@jiaminghi/data-view'
// 适配flex
import '@/utils/flexible.js'
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts
// Vue.prototype.$ = $ // Vue.prototype.$ = $
...@@ -29,14 +29,14 @@ Vue.prototype.$echarts = echarts ...@@ -29,14 +29,14 @@ Vue.prototype.$echarts = echarts
Vue.prototype.downUrl = 'http://10.11.16.19:8080' Vue.prototype.downUrl = 'http://10.11.16.19:8080'
Vue.prototype.baseUrl = 'http://10.12.8.67:51005' Vue.prototype.baseUrl = 'http://10.12.8.67:51005'
// 核心插件 // 核心插件
Vue.use(d2Admin) Vue.use(d2Admin)
Vue.use(dataV)
Vue.prototype.moment = moment Vue.prototype.moment = moment
Vue.filter('moment', function (value, formatString) { Vue.filter('moment', function (value, formatString) {
formatString = formatString || 'YYYY-MM-DD HH:mm:ss' formatString = formatString || 'YYYY-MM-DD HH:mm:ss'
if (value == 0 || value == null || value == '') { if (value === 0 || value === null || value === '') {
return '-' return '-'
} else { } else {
return moment(value).format(formatString) return moment(value).format(formatString)
......
...@@ -26,10 +26,9 @@ const router = new VueRouter({ ...@@ -26,10 +26,9 @@ const router = new VueRouter({
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 进度条 // 进度条
NProgress.start() NProgress.start()
//验证当前路由所有的匹配中是否需要有登录验证的 // 验证当前路由所有的匹配中是否需要有登录验证的
// next() // next()
if (to.matched.some(r => r.meta.auth)) { if (to.matched.some(r => r.meta.auth)) {
const token = sessionStorage.getItem('token') const token = sessionStorage.getItem('token')
if (token) { if (token) {
next() next()
...@@ -45,19 +44,19 @@ router.beforeEach((to, from, next) => { ...@@ -45,19 +44,19 @@ router.beforeEach((to, from, next) => {
NProgress.done() NProgress.done()
} }
} else { } else {
if (from.name === 'login') {
if(from.name==='login'){ // 防止无限循环
//防止无限循环
if (to.name === 'login') { if (to.name === 'login') {
next(); next()
return return
} }
next({ next({
path: '/index', path: '/index'
}); })
}else } else {
// 不需要身份校验 直接通过 // 不需要身份校验 直接通过
next() next()
}
} }
}) })
......
...@@ -14,7 +14,7 @@ const frameIn = [ ...@@ -14,7 +14,7 @@ const frameIn = [
{ {
path: '/', path: '/',
redirect: { name: 'index' }, redirect: { name: 'index' },
component: _import('system/index'), component: _import('content/layout'),
children: [ children: [
// 首页 概况 // 首页 概况
{ {
...@@ -23,7 +23,7 @@ const frameIn = [ ...@@ -23,7 +23,7 @@ const frameIn = [
meta: { meta: {
auth: true auth: true
}, },
component: _import('system/index') component: _import('content/overview')
}, },
// 刷新页面 必须保留 // 刷新页面 必须保留
{ {
......
/*
* rem.js
* v0.1.1
* fixed 2015-3-12
*/
(function (win) {
var doc = win.document
var html = doc.documentElement
var option = html.getAttribute('data-use-rem')
if (option === null) {
return
}
// defaut baseWidth : 640px;
var baseWidth = parseInt(option).toString() === 'NaN' ? 960 : parseInt(option)
var grids = baseWidth / 100
var clientWidth = html.clientWidth || 960
// set rem first
html.style.fontSize = clientWidth / grids + 'px'
// create testDom
var testDom = document.createElement('div')
var testDomWidth = 0
var adjustRatio = 0
testDom.style.cssText = 'height:0;width:1rem;'
// doc.body.appendChild(testDom);
var calcTestDom = function () {
testDomWidth = testDom.offsetWidth
if (testDomWidth !== Math.round(clientWidth / grids)) {
adjustRatio = clientWidth / grids / testDomWidth
var reCalcRem = clientWidth * adjustRatio / grids
html.style.fontSize = reCalcRem + 'px'
} else {
doc.body.removeChild(testDom)
}
}
// detect if rem calc is working directly
// if not , recalc and set the rem value
setTimeout(calcTestDom, 20)
var reCalc = function () {
var newCW = html.clientWidth
if (newCW === clientWidth) {
return
}
clientWidth = newCW
html.style.fontSize = newCW * (adjustRatio || 1) / grids + 'px'
// if( testDom ) setTimeout(calcTestDom, 20);
}
// Abort if browser does not support addEventListener
if (!doc.addEventListener) {
return
}
var resizeEvt = 'orientationchange' in win ? 'orientationchange' : 'resize'
win.addEventListener(resizeEvt, reCalc, false)
// detect clientWidth is changed ?
doc.addEventListener('DOMContentLoaded', reCalc, false)
})(window)
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,19 +24,19 @@ export default { ...@@ -24,19 +24,19 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
vm.chart.clear() vm.chart.clear()
this.message.data.forEach(function (item) { this.message.data.forEach(function (item) {
if (item.name == '税率' || item.name == '占比') { if (item.name === '税率' || item.name === '占比') {
item.yAxisIndex = 1 // 当name为税率或者占比(折线图)时,设置yAxisIndex为1(右侧的Y轴), item.yAxisIndex = 1 // 当name为税率或者占比(折线图)时,设置yAxisIndex为1(右侧的Y轴),
} }
}) })
// console.info(this.message.data) // console.info(this.message.data)
vm.option = { vm.option = {
color: ['#9FFED7'], color: ['#9FFED7'],
tooltip: { tooltip: {
transitionDuration: 0, // 提示框浮层的移动动画过渡时间,单位是s,设置0的时候会紧跟鼠标移动 transitionDuration: 0, // 提示框浮层的移动动画过渡时间,单位是s,设置0的时候会紧跟鼠标移动
trigger: 'axis', trigger: 'axis',
...@@ -50,13 +50,13 @@ export default { ...@@ -50,13 +50,13 @@ export default {
top: 40 top: 40
}, },
legend: { legend: {
padding: 18, padding: 18,
textStyle: { textStyle: {
color: '#ffffff' // 图例文字颜色 color: '#ffffff' // 图例文字颜色
}, },
orient: 'vertical', //垂直显示 orient: 'vertical', // 垂直显示
y: 'center', //延Y轴居中 y: 'center', // 延Y轴居中
x: 'right',//居右显示 x: 'right', // 居右显示
data: this.message.title data: this.message.title
}, },
xAxis: [ xAxis: [
...@@ -115,19 +115,19 @@ export default { ...@@ -115,19 +115,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -98,13 +98,13 @@ export default { ...@@ -98,13 +98,13 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -94,19 +94,19 @@ export default { ...@@ -94,19 +94,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
const bars = [] const bars = []
this.message.title.forEach(e => { this.message.title.forEach(e => {
bars.push({ type: 'bar' }) bars.push({ type: 'bar' })
...@@ -39,8 +39,8 @@ export default { ...@@ -39,8 +39,8 @@ export default {
let flag = true let flag = true
da.forEach(arg => { da.forEach(arg => {
// console.log(arg["type"], this.message.title[j]) // console.log(arg["type"], this.message.title[j])
if (arg["type"] === this.message.title[j]) { if (arg.type === this.message.title[j]) {
arr.push(arg["num"]) arr.push(arg.num)
flag = false flag = false
} }
}) })
...@@ -59,8 +59,8 @@ export default { ...@@ -59,8 +59,8 @@ export default {
// 清空图表 // 清空图表
vm.chart.clear() vm.chart.clear()
vm.option = { vm.option = {
color: ['#30DDF4', '#E23AA2', '#F5A623', '#D6FFBA'], color: ['#30DDF4', '#E23AA2', '#F5A623', '#D6FFBA'],
grid: { grid: {
height: 135, height: 135,
top: 40 top: 40
}, },
...@@ -105,19 +105,19 @@ export default { ...@@ -105,19 +105,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
<template> <template>
<d2-container class="business"> <d2-container class="business">
<headerLayout></headerLayout> <!-- <headerLayout></headerLayout> -->
<div class="section"> <div class="section">
<div class="leftBlock"> <div class="leftBlock">
<div class="topBox"> <div class="topBox">
...@@ -82,17 +82,15 @@ ...@@ -82,17 +82,15 @@
</template> </template>
<script> <script>
import headerLayout from '../../system/index/components/headerLayout' // 公共头部
// import {pie, pies} from './components/pie' // 饼图/
import quoteProportion from './components/barPolyline' // 报价及占比 import quoteProportion from './components/barPolyline' // 报价及占比
import scatterPlot from './components/scatterPlot' // 项目分析 import scatterPlot from './components/scatterPlot' // 项目分析
import knowledgeGraph from '../../system/index/components/knowledgeGraph'// 知识图谱 import knowledgeGraph from '../overview/components/knowledgeGraph'// 知识图谱
import funnel from './components/funnel' // 梯形图 import funnel from './components/funnel' // 梯形图
import * as API_BUSSINESS from '@/api/con.business.js' import * as API_BUSSINESS from '@/api/con.business.js'
const pie = () => import('./components/pie') const pie = () => import('./components/pie')
const pies = () => import('./components/pie') const pies = () => import('./components/pie')
export default { export default {
components: { headerLayout, pie, pies, quoteProportion, scatterPlot, knowledgeGraph, funnel }, components: { pie, pies, quoteProportion, scatterPlot, knowledgeGraph, funnel },
data () { data () {
return { return {
businessType: [], // 商机业务类型 businessType: [], // 商机业务类型
...@@ -115,7 +113,7 @@ export default { ...@@ -115,7 +113,7 @@ export default {
numFilter (value) { numFilter (value) {
value = value / 1000000 value = value / 1000000
// 截取当前数据到小数点后两位(以百万元为单位) // 截取当前数据到小数点后两位(以百万元为单位)
let realVal = parseFloat(value).toFixed(2) const realVal = parseFloat(value).toFixed(2)
return realVal return realVal
} }
}, },
...@@ -129,80 +127,80 @@ export default { ...@@ -129,80 +127,80 @@ export default {
this.totalData = res this.totalData = res
this.totalObj = this.totalData.data this.totalObj = this.totalData.data
// 商机税率 // 商机税率
let argRate = this.totalData.data.taxrate const argRate = this.totalData.data.taxrate
let taxrate = [] const taxrate = []
let arr5 = [] const arr5 = []
let arr6 = [] const arr6 = []
let maxra = 0 let maxra = 0
argRate.forEach(e => { argRate.forEach(e => {
taxrate.push(e['taxrate']) taxrate.push(e.taxrate)
arr5.push(e['num']) arr5.push(e.num)
arr6.push(e['percentage']) arr6.push(e.percentage)
let mid = parseInt(e['num']) const mid = parseInt(e.num)
if (mid > maxra) { if (mid > maxra) {
maxra = mid maxra = mid
} }
}) })
let darate = [] const darate = []
let sj = { 'name': '商机', 'type': 'bar', 'data': arr5 } const sj = { name: '商机', type: 'bar', data: arr5 }
let rate = { 'name': '税率', 'type': 'line', 'data': arr6 } const rate = { name: '税率', type: 'line', data: arr6 }
darate.push(sj) darate.push(sj)
darate.push(rate) darate.push(rate)
this.taxRate = { 'data': darate, 'max': maxra, 'title': [ '商机', '税率' ], 'column': taxrate } this.taxRate = { data: darate, max: maxra, title: ['商机', '税率'], column: taxrate }
// 商机报价及占比 // 商机报价及占比
let argquo = this.totalData.data.offer const argquo = this.totalData.data.offer
let column = [] const column = []
let arr2 = [] const arr2 = []
let arr3 = [] const arr3 = []
let max = 0 let max = 0
argquo.forEach(e => { argquo.forEach(e => {
column.push(e['level']) column.push(e.level)
arr2.push(e['num']) arr2.push(e.num)
arr3.push(e['percentage']) arr3.push(e.percentage)
let mid = parseInt(e['num']) const mid = parseInt(e.num)
if (mid > max) { if (mid > max) {
max = mid max = mid
} }
}) })
let daq = [] const daq = []
let bj = { 'name': '报价', 'type': 'bar', 'data': arr2 } const bj = { name: '报价', type: 'bar', data: arr2 }
let ratio = { 'name': '占比', 'type': 'line', 'data': arr3 } const ratio = { name: '占比', type: 'line', data: arr3 }
daq.push(bj) daq.push(bj)
daq.push(ratio) daq.push(ratio)
this.quoteProportion = { 'data': daq, 'max': max, 'title': [ '报价', '占比' ], 'column': column } this.quoteProportion = { data: daq, max: max, title: ['报价', '占比'], column: column }
// 项目分析 // 项目分析
this.projectObj = this.totalData.data.analysis this.projectObj = this.totalData.data.analysis
this.projectAnalysis = this.projectObj this.projectAnalysis = this.projectObj
// 商机成功率 // 商机成功率
let argsuc = this.totalData.data.success const argsuc = this.totalData.data.success
let titlesuc = [] const titlesuc = []
let dasuc = [] const dasuc = []
argsuc.forEach(e => { argsuc.forEach(e => {
titlesuc.push(e['success']) titlesuc.push(e.success)
var suc = { 'name': e['success'], 'value': e['num'] } var suc = { name: e.success, value: e.num }
dasuc.push(suc) dasuc.push(suc)
}) })
this.funnelChart.push({ 'success': titlesuc, 'num': dasuc }) this.funnelChart.push({ success: titlesuc, num: dasuc })
// 对商机业务类型遍历 // 对商机业务类型遍历
let arg = this.totalData.data.type const arg = this.totalData.data.type
let title = [] const title = []
let da = [] const da = []
arg.forEach(element => { arg.forEach(element => {
title.push(element['type']) title.push(element.type)
var jso = { 'name': element['type'], 'value': element['num'] } var jso = { name: element.type, value: element.num }
da.push(jso) da.push(jso)
}) })
this.businessType.push({ 'title': title, 'data': da }) this.businessType.push({ title: title, data: da })
// 对商机来源遍历 // 对商机来源遍历
let argsou = this.totalData.data.source const argsou = this.totalData.data.source
let titlesou = [] const titlesou = []
let dasou = [] const dasou = []
argsou.forEach(element => { argsou.forEach(element => {
titlesou.push(element['source']) titlesou.push(element.source)
var sou = { 'name': element['source'], 'value': element['num'] } var sou = { name: element.source, value: element.num }
dasou.push(sou) dasou.push(sou)
}) })
this.source.push({ 'title': titlesou, 'data': dasou }) this.source.push({ title: titlesou, data: dasou })
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -106,19 +106,19 @@ export default { ...@@ -106,19 +106,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -82,7 +82,7 @@ export default { ...@@ -82,7 +82,7 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
// // 设置默认选中高亮部分 // // 设置默认选中高亮部分
// vm.chart.dispatchAction({ // vm.chart.dispatchAction({
...@@ -115,14 +115,14 @@ export default { ...@@ -115,14 +115,14 @@ export default {
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
const bars = [] const bars = []
this.message.title.forEach(e => { this.message.title.forEach(e => {
bars.push({ type: 'bar' }) bars.push({ type: 'bar' })
...@@ -37,8 +37,8 @@ export default { ...@@ -37,8 +37,8 @@ export default {
for (let j = 0; j < this.message.title.length; j++) { for (let j = 0; j < this.message.title.length; j++) {
let flag = true let flag = true
da.forEach(arg => { da.forEach(arg => {
if (arg["type"] === this.message.title[j]) { if (arg.type === this.message.title[j]) {
arr.push(arg["num"]) arr.push(arg.num)
flag = false flag = false
} }
}) })
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
vm.chart.clear() vm.chart.clear()
vm.option = { vm.option = {
color: ['#30DDF4', '#E23AA2', '#F5A623', '#D6FFBA'], color: ['#30DDF4', '#E23AA2', '#F5A623', '#D6FFBA'],
grid: { grid: {
height: 135, height: 135,
top: 50 top: 50
}, },
...@@ -100,19 +100,19 @@ export default { ...@@ -100,19 +100,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
<template> <template>
<d2-container class="client"> <d2-container class="client">
<headerLayout></headerLayout> <!-- <headerLayout></headerLayout> -->
<div class="section"> <div class="section">
<div class="leftBlock"> <div class="leftBlock">
<div class="topBox"> <div class="topBox">
...@@ -150,15 +150,15 @@ ...@@ -150,15 +150,15 @@
</template> </template>
<script> <script>
import headerLayout from '../../system/index/components/headerLayout' // 公共头部 // import headerLayout from '../../system/index/components/headerLayout' // 公共头部
import pie from './components/pie' // 商机业务类型 import pie from './components/pie' // 商机业务类型
import distributed from './components/distributed' // 客户分布 import distributed from './components/distributed' // 客户分布
import scatterPlot from './components/scatterPlot' // 客户分析 import scatterPlot from './components/scatterPlot' // 客户分析
import knowledgeGraph from '../../system/index/components/knowledgeGraph'// 知识图谱 import knowledgeGraph from '../overview/components/knowledgeGraph'// 知识图谱
import * as API_CLIENT from '@/api/con.client.js' import * as API_CLIENT from '@/api/con.client.js'
export default { export default {
components: { headerLayout, pie, distributed, scatterPlot, knowledgeGraph }, components: { pie, distributed, scatterPlot, knowledgeGraph },
data () { data () {
return { return {
clientData: {}, // 客户数据 clientData: {}, // 客户数据
...@@ -184,7 +184,7 @@ export default { ...@@ -184,7 +184,7 @@ export default {
}, },
methods: { methods: {
// 默认展示公司信息 // 默认展示公司信息
GetCustomerInfo() { GetCustomerInfo () {
API_CLIENT.CustomerInfo().then(res => { API_CLIENT.CustomerInfo().then(res => {
this.customername = res.data this.customername = res.data
}) })
...@@ -216,27 +216,27 @@ export default { ...@@ -216,27 +216,27 @@ export default {
// 客户分析 // 客户分析
this.clientAnalysis = this.clientObj.analysis this.clientAnalysis = this.clientObj.analysis
// 客户分布 // 客户分布
let argdis = this.clientObj.area const argdis = this.clientObj.area
let titdis = [] const titdis = []
let dadis = [] const dadis = []
let numdis = [] const numdis = []
argdis.forEach(e => { argdis.forEach(e => {
titdis.push(e['area']) titdis.push(e.area)
numdis.push(e['num']) numdis.push(e.num)
var dis = { 'name': e['area'], 'value': e['num'] } var dis = { name: e.area, value: e.num }
dadis.push(dis) dadis.push(dis)
}) })
this.distributed.push({ 'title': titdis, 'num': numdis, 'data': dadis }) this.distributed.push({ title: titdis, num: numdis, data: dadis })
// 对客户属性遍历 // 对客户属性遍历
let arg = this.clientObj.status const arg = this.clientObj.status
let title = [] const title = []
let da = [] const da = []
arg.forEach(element => { arg.forEach(element => {
title.push(element['status']) title.push(element.status)
var jso = { 'name': element['status'], 'value': element['num'] } var jso = { name: element.status, value: element.num }
da.push(jso) da.push(jso)
}) })
this.businessType.push({ 'title': title, 'data': da }) this.businessType.push({ title: title, data: da })
}) })
} }
} }
......
import page from './layout'
export default page
<template>
<dv-full-screen-container class="bg">
<header-layout></header-layout>
<router-view />
</dv-full-screen-container>
</template>
<script>
import headerLayout from '@/components/HeaderLayout/index' // 公共头部
export default {
components: { headerLayout },
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
</style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -44,19 +44,22 @@ export default { ...@@ -44,19 +44,22 @@ export default {
}, },
xAxis: { type: 'category' }, xAxis: { type: 'category' },
yAxis: { gridIndex: 0 }, yAxis: { gridIndex: 0 },
series: [{ type: 'line', series: [{
type: 'line',
smooth: true, smooth: true,
seriesLayoutBy: 'row', seriesLayoutBy: 'row',
areaStyle: { normal: { areaStyle: {
color: new echarts.graphic.LinearGradient( normal: {
0, 0, 0, 1, color: new echarts.graphic.LinearGradient(
[ 0, 0, 0, 1,
{ offset: 0, color: '#30DDF4' }, [
{ offset: 0.4, color: 'rgba(255,255,255,0.1)' }, { offset: 0, color: '#30DDF4' },
{ offset: 1, color: 'rgba(255,255,255,0)' } { offset: 0.4, color: 'rgba(255,255,255,0.1)' },
] { offset: 1, color: 'rgba(255,255,255,0)' }
) ]
} } )
}
}
}] }]
} }
vm.drawBar() vm.drawBar()
...@@ -66,19 +69,19 @@ export default { ...@@ -66,19 +69,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -60,19 +60,19 @@ export default { ...@@ -60,19 +60,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
orient: 'vertical', orient: 'vertical',
data: ['技术岗', '销售岗', '管理岗', '职能岗', '其他岗'], data: ['技术岗', '销售岗', '管理岗', '职能岗', '其他岗'],
right: 20, right: 20,
bottom:10, bottom: 10,
textStyle: { textStyle: {
color: '#ffffff' color: '#ffffff'
}, },
...@@ -87,19 +87,19 @@ export default { ...@@ -87,19 +87,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -59,19 +59,19 @@ export default { ...@@ -59,19 +59,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
dataset: { dataset: {
source: [ source: [
['product', '2012', '2013', '2014', '2015', '2016', '2017'], ['product', '2012', '2013', '2014', '2015', '2016', '2017'],
['Matcha Latte', 41.1, 30.4, 65.1, 53.3, 83.8, 98.7], ['Matcha Latte', 41.1, 30.4, 65.1, 53.3, 83.8, 98.7]
] ]
}, },
xAxis: { type: 'category' }, xAxis: { type: 'category' },
...@@ -55,19 +55,19 @@ export default { ...@@ -55,19 +55,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
<template> <template>
<d2-container class="operation"> <d2-container class="operation">
<headerLayout></headerLayout> <!-- <headerLayout></headerLayout> -->
<div class="section"> <div class="section">
<div class="leftBlock"> <div class="leftBlock">
<div class="topBox height100"> <div class="topBox height100">
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</template> </template>
<script> <script>
import headerLayout from '../../system/index/components/headerLayout' // 公共头部 // import headerLayout from '../../system/index/components/headerLayout' // 公共头部
import doubleHistogram from './components/doubleHistogram' // 双柱状图 import doubleHistogram from './components/doubleHistogram' // 双柱状图
import pie from './components/pie' // 饼图 import pie from './components/pie' // 饼图
import lineChart from './components/polyline' // 折线图 import lineChart from './components/polyline' // 折线图
...@@ -65,10 +65,10 @@ import turnoverStatistics from './components/turnoverStatistics' // 营业额统 ...@@ -65,10 +65,10 @@ import turnoverStatistics from './components/turnoverStatistics' // 营业额统
import cashFlow from './components/cashFlow' // 现金流 import cashFlow from './components/cashFlow' // 现金流
import revenueRanking from './components/revenueRanking' // 营收排行 import revenueRanking from './components/revenueRanking' // 营收排行
import assetManagement from './components/assetManagement' // 资产管理 import assetManagement from './components/assetManagement' // 资产管理
import knowledgeGraph from '../../system/index/components/knowledgeGraph'// 知识图谱 import knowledgeGraph from '../overview/components/knowledgeGraph'// 知识图谱
export default { export default {
components: { headerLayout, doubleHistogram, pie, lineChart, turnoverStatistics, cashFlow, knowledgeGraph, revenueRanking, assetManagement }, components: { doubleHistogram, pie, lineChart, turnoverStatistics, cashFlow, knowledgeGraph, revenueRanking, assetManagement },
data () { data () {
return { return {
profitChart: {}, // 流水利润完成比 profitChart: {}, // 流水利润完成比
...@@ -81,38 +81,38 @@ export default { ...@@ -81,38 +81,38 @@ export default {
revenueRanking: { revenueRanking: {
table: [ table: [
{ {
'name': '平台应用吧', name: '平台应用吧',
'num': '1500W', num: '1500W',
'percent': '50%' percent: '50%'
}, },
{ {
'name': '平台应用吧', name: '平台应用吧',
'num': '1500W', num: '1500W',
'percent': '50%' percent: '50%'
}, },
{ {
'name': '平台应用吧', name: '平台应用吧',
'num': '1500W', num: '1500W',
'percent': '50%' percent: '50%'
} }
] ]
}, // 营收排行 }, // 营收排行
assetManagement: { assetManagement: {
table: [ table: [
{ {
'name': '服务器', name: '服务器',
'num': '20个', num: '20个',
'principal': '米修' principal: '米修'
}, },
{ {
'name': '笔记本', name: '笔记本',
'num': '50个', num: '50个',
'principal': '米修' principal: '米修'
}, },
{ {
'name': '源代码', name: '源代码',
'num': '60个', num: '60个',
'principal': '米修' principal: '米修'
} }
] ]
} // 资产管理 } // 资产管理
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -40,7 +40,7 @@ export default { ...@@ -40,7 +40,7 @@ export default {
orient: 'vertical', orient: 'vertical',
data: ['技术岗', '销售岗', '管理岗', '职能岗', '其他岗'], data: ['技术岗', '销售岗', '管理岗', '职能岗', '其他岗'],
right: 20, right: 20,
bottom:10, bottom: 10,
textStyle: { textStyle: {
color: '#ffffff' color: '#ffffff'
}, },
...@@ -86,19 +86,19 @@ export default { ...@@ -86,19 +86,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -59,19 +59,19 @@ export default { ...@@ -59,19 +59,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
import 'echarts-liquidfill/src/liquidFill.js' import 'echarts-liquidfill/src/liquidFill.js'
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -106,19 +106,19 @@ export default { ...@@ -106,19 +106,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
<template> <template>
<d2-container class="organization"> <d2-container class="organization">
<headerLayout></headerLayout> <!-- <headerLayout></headerLayout> -->
<div class="section"> <div class="section">
<div class="leftBlock"> <div class="leftBlock">
<div class="topBox"> <div class="topBox">
...@@ -68,14 +68,14 @@ ...@@ -68,14 +68,14 @@
</template> </template>
<script> <script>
import headerLayout from '../../system/index/components/headerLayout' // 公共头部 // import headerLayout from '../../system/index/components/headerLayout' // 公共头部
import pie from './components/pie' // 岗位分布 import pie from './components/pie' // 岗位分布
import waterBall from './components/waterBall' // 岗位分布 import waterBall from './components/waterBall' // 岗位分布
import lineChart from './components/polyline' // 折线图 import lineChart from './components/polyline' // 折线图
import knowledgeGraph from '../../system/index/components/knowledgeGraph'// 知识图谱 import knowledgeGraph from '../overview/components/knowledgeGraph'// 知识图谱
export default { export default {
components: { headerLayout, pie, waterBall, lineChart, knowledgeGraph }, components: { pie, waterBall, lineChart, knowledgeGraph },
data () { data () {
return { return {
input: '', input: '',
...@@ -87,15 +87,15 @@ export default { ...@@ -87,15 +87,15 @@ export default {
ball4: {}, ball4: {},
refundAmountLine: {}, refundAmountLine: {},
talent: [ talent: [
{ 'name': '高潜人才', 'color': 'rgba(48,221,244,0.4)' }, { name: '高潜人才', color: 'rgba(48,221,244,0.4)' },
{ 'name': '高潜人才', 'color': 'rgba(48,221,244,0.6)' }, { name: '高潜人才', color: 'rgba(48,221,244,0.6)' },
{ 'name': '高潜人才', 'color': 'rgba(226,58,162,0.4)' }, { name: '高潜人才', color: 'rgba(226,58,162,0.4)' },
{ 'name': '稳定贡献者', 'color': 'rgba(160,255,216,0.6)' }, { name: '稳定贡献者', color: 'rgba(160,255,216,0.6)' },
{ 'name': '稳定贡献者', 'color': 'rgba(48,221,244,0.4)' }, { name: '稳定贡献者', color: 'rgba(48,221,244,0.4)' },
{ 'name': '高潜人才', 'color': 'rgba(48,221,244,0.6)' }, { name: '高潜人才', color: 'rgba(48,221,244,0.6)' },
{ 'name': '待处理', 'color': 'rgba(231,112,125,0.6)' }, { name: '待处理', color: 'rgba(231,112,125,0.6)' },
{ 'name': '待发展者', 'color': 'rgba(160,255,216,0.6)' }, { name: '待发展者', color: 'rgba(160,255,216,0.6)' },
{ 'name': '待发展者', 'color': 'rgba(48,221,244,0.4)' } { name: '待发展者', color: 'rgba(48,221,244,0.4)' }
] ]
} }
}, },
...@@ -122,4 +122,3 @@ export default { ...@@ -122,4 +122,3 @@ export default {
} }
} }
</style> </style>
...@@ -24,28 +24,28 @@ export default { ...@@ -24,28 +24,28 @@ export default {
} }
}, },
components: { pieChart, distributed }, components: { pieChart, distributed },
mounted() { mounted () {
this.getCustoList() this.getCustoList()
}, },
methods: { methods: {
// 查询概况页面数据 // 查询概况页面数据
getCustoList() { getCustoList () {
API_BASIC.GetBasicList().then(res => { API_BASIC.GetBasicList().then(res => {
// 客户分布 // 客户分布
let argcustomer = res.data.customer const argcustomer = res.data.customer
let title = [] const title = []
let data = [] const data = []
let num = [] const num = []
argcustomer.forEach(e => { argcustomer.forEach(e => {
title.push(e['status']) title.push(e.status)
num.push(e['new']) num.push(e.new)
var dis = { 'name': e['status'], 'value': e['new'] } var dis = { name: e.status, value: e.new }
data.push(dis) data.push(dis)
}) })
this.distributedChart.push({ 'title': title, 'num': num, 'data': data }) this.distributedChart.push({ title: title, num: num, data: data })
}) })
},
} }
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -17,21 +17,20 @@ export default { ...@@ -17,21 +17,20 @@ export default {
keywords: [] keywords: []
} }
}, },
mounted() { mounted () {
this.GET_Keywords() this.GET_Keywords()
}, },
methods: { methods: {
GET_Keywords() { GET_Keywords () {
API_BASIC.GetBasicList().then(res => { API_BASIC.GetBasicList().then(res => {
let keyword = res.data.org[0].hotwords.split(',') const keyword = res.data.org[0].hotwords.split(',')
keyword.forEach(element => { keyword.forEach(element => {
let value = Math.ceil(Math.random()*5) + 10 const value = Math.ceil(Math.random() * 5) + 10
this.keywords.push({'name':element,'value':value}) this.keywords.push({ name: element, value: value })
}); })
}) })
} }
}, }
} }
</script> </script>
...@@ -25,23 +25,23 @@ import * as API_BASIC from '@/api/sys.basic.js' ...@@ -25,23 +25,23 @@ import * as API_BASIC from '@/api/sys.basic.js'
export default { export default {
data () { data () {
return { return {
newsList: [], newsList: [],
newsObj: {} newsObj: {}
} }
}, },
mounted() { mounted () {
this.getCustomerList() this.getCustomerList()
}, },
methods: { methods: {
getCustomerList() { getCustomerList () {
API_BASIC.GetBasicList().then(res => { API_BASIC.GetBasicList().then(res => {
this.newsList = res.data.news this.newsList = res.data.news
this.newsList.forEach(element => { this.newsList.forEach(element => {
this.newsObj = element this.newsObj = element
}); })
}) })
} }
}, }
} }
</script> </script>
......
...@@ -27,41 +27,41 @@ ...@@ -27,41 +27,41 @@
<li>新零售</li> <li>新零售</li>
<li>企业智能化</li> --> <li>企业智能化</li> -->
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import * as API_BASIC from '@/api/sys.basic.js' import * as API_BASIC from '@/api/sys.basic.js'
export default { export default {
data() { data () {
return { return {
basicData: {}, basicData: {},
basicObj: {}, basicObj: {},
hotwordsarr: [], hotwordsarr: [],
labelArr: [], labelArr: [],
businessarr: [] businessarr: []
} }
}, },
mounted() { mounted () {
this.getBasicList() this.getBasicList()
}, },
methods: { methods: {
// 查询概况页面数据 // 查询概况页面数据
getBasicList() { getBasicList () {
API_BASIC.GetBasicList().then(res => { API_BASIC.GetBasicList().then(res => {
this.basicData = res.data this.basicData = res.data
this.basicData.org.forEach(element => { this.basicData.org.forEach(element => {
this.basicObj = element this.basicObj = element
this.labelArr = element.label.split(',') this.labelArr = element.label.split(',')
this.hotwordsarr = element.hotwords.split(',') this.hotwordsarr = element.hotwords.split(',')
this.businessarr = element.business.split(',') this.businessarr = element.business.split(',')
}); })
}) })
},
} }
}
} }
</script> </script>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
</li> </li>
</ul> --> </ul> -->
<el-carousel indicator-position="none" height="88px"> <el-carousel indicator-position="none" height="88px">
<el-carousel-item v-for="(icon, id) in iconList" :key="id"> <el-carousel-item v-for="(icon, id) in iconList" :key="id">
<div class="softwareSolution"> <div class="softwareSolution">
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</li> </li>
</ul> </ul>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
</div> </div>
<div class="subtitle"><i class="diamond"></i>案例展示</div> <div class="subtitle"><i class="diamond"></i>案例展示</div>
<div class="caseShow"> <div class="caseShow">
...@@ -79,43 +79,43 @@ export default { ...@@ -79,43 +79,43 @@ export default {
caseObj: {} caseObj: {}
} }
}, },
mounted() { mounted () {
this.getCustomerList() this.getCustomerList()
}, },
methods: { methods: {
// 查询概况页面数据 // 查询概况页面数据
getCustomerList() { getCustomerList () {
API_BASIC.GetBasicList().then(res => { API_BASIC.GetBasicList().then(res => {
this.iconList = res.data.program this.iconList = res.data.program
for(let i = 0; i < this.iconList.length; i++) { for (let i = 0; i < this.iconList.length; i++) {
this.iconList[i]['name'] = this.iconList[i].name // this.iconList[i].name = this.iconList[i].name
this.iconList[i]['urlArr'] = this.iconList[i].url.split(',') this.iconList[i].urlArr = this.iconList[i].url.split(',')
this.iconList[i]['introArr'] = this.iconList[i].introduce.split(',') this.iconList[i].introArr = this.iconList[i].introduce.split(',')
} }
this.iconList.forEach(element => { this.iconList.forEach(element => {
this.basicObj.name = element.name this.basicObj.name = element.name
this.introducearr = element.introduce.split(',') this.introducearr = element.introduce.split(',')
this.urlarr = element.url.split(',') this.urlarr = element.url.split(',')
}); })
// 案例展示 // 案例展示
this.caseList = res.data.case this.caseList = res.data.case
this.caseList.forEach(ele => { this.caseList.forEach(ele => {
this.caseObj = ele this.caseObj = ele
}) })
// 客户分布 // 客户分布
let argcustomer = res.data.customer const argcustomer = res.data.customer
let titledis = [] const titledis = []
let data = [] const data = []
let num = [] const num = []
argcustomer.forEach(e => { argcustomer.forEach(e => {
titledis.push(e['status']) titledis.push(e.status)
num.push(e['new']) num.push(e.new)
var dis = { 'name': e['status'], 'value': e['new'] } var dis = { name: e.status, value: e.new }
data.push(dis) data.push(dis)
}) })
this.distributedChart.push({ 'title': titledis, 'num': num, 'data': data }) this.distributedChart.push({ title: titledis, num: num, data: data })
}) })
}, }
} }
} }
</script> </script>
......
...@@ -76,15 +76,15 @@ export default { ...@@ -76,15 +76,15 @@ export default {
} }
}, },
watch: { watch: {
screenwidth(val) { screenwidth (val) {
if(!this.timer){ if (!this.timer) {
this.screenWidth = val this.screenWidth = val
this.timer = true this.timer = true
let that = this const that = this
setTimeout(function(){ setTimeout(function () {
console.log(that.screenWidth) console.log(that.screenWidth)
that.timer = false that.timer = false
},400) }, 400)
} }
} }
}, },
...@@ -93,25 +93,25 @@ export default { ...@@ -93,25 +93,25 @@ export default {
this.getDate() this.getDate()
const that = this const that = this
window.onresize = () => { window.onresize = () => {
return(() => { return (() => {
window.screenWidth = document.body.clientWidth window.screenWidth = document.body.clientWidth
that.screenWidth = window.screenWidth that.screenWidth = window.screenWidth
})() })()
} }
}, },
methods: { methods: {
logout() { logout () {
this.$router.push('/login') this.$router.push('/login')
}, },
init () { init () {
this.num = sessionStorage.getItem('num') this.num = sessionStorage.getItem('num')
let user = JSON.parse(sessionStorage.getItem('user')) const user = JSON.parse(sessionStorage.getItem('user'))
if(user.role === 1) { if (user.role === 1) {
this.buttenList.push('管理端') this.buttenList.push('管理端')
} }
}, },
getDate () { getDate () {
let vm = this const vm = this
this.nowDate = new Date() this.nowDate = new Date()
this.week = new Date().getDay() this.week = new Date().getDay()
setTimeout(function () { setTimeout(function () {
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
change (index) { change (index) {
this.num = index this.num = index
sessionStorage.setItem('num', index) sessionStorage.setItem('num', index)
let token = sessionStorage.getItem('token') const token = sessionStorage.getItem('token')
switch (index) { switch (index) {
case 0: case 0:
this.$router.replace('/index') this.$router.replace('/index')
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</div> </div>
<h3>关系筛选</h3> <h3>关系筛选</h3>
<el-checkbox-group v-model="checked"> <el-checkbox-group v-model="checked">
<el-checkbox v-for="item in checkList" :label="item.value">{{item.name}}</el-checkbox> <el-checkbox v-for="item in checkList" :label="item.value" :key="item.value">{{item.name}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="inquire" @click="handleChange">查询</div> <div class="inquire" @click="handleChange">查询</div>
</div> </div>
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
</template> </template>
<script> <script>
import * as API_KNOWLED from '@/api/sys.knowled.js' import * as API_KNOWLED from '@/api/sys.knowled.js'
import vis from '@/assets/js/VisHelper.js' import vis from '@/assets/js/VisHelper.js'
import knowledgeJSON from '@/assets/js/knowledgeJSON.js' // import knowledgeJSON from '@/assets/js/knowledgeJSON.js'
export default { export default {
data () { data () {
return { return {
...@@ -41,12 +41,12 @@ export default { ...@@ -41,12 +41,12 @@ export default {
knowledData: [], knowledData: [],
checked: [1], checked: [1],
checkList: [ checkList: [
{'name':'对应销售','value':2}, { name: '对应销售', value: 2 },
{'name':'对应商机','value':3}, { name: '对应商机', value: 3 },
{'name':'对应客户','value':4} { name: '对应客户', value: 4 }
], ],
value:'', value: '',
topoData:{} //接收到的topo数据 topoData: {} // 接收到的topo数据
} }
}, },
mounted () { mounted () {
...@@ -79,35 +79,35 @@ export default { ...@@ -79,35 +79,35 @@ export default {
this.topoAll(res.data) this.topoAll(res.data)
}) })
}, },
//通过控制关系筛选来控制左侧图谱展示,默认展示1 // 通过控制关系筛选来控制左侧图谱展示,默认展示1
handleChange() { handleChange () {
let vm = this const vm = this
let newData = { const newData = {
retNodes:[], retNodes: [],
retLinks:[], retLinks: []
} }
if(vm.topoData.retNodes){ if (vm.topoData.retNodes) {
vm.topoData.retNodes.forEach((v,i)=>{ vm.topoData.retNodes.forEach((v, i) => {
vm.checked.forEach((a,b)=>{ vm.checked.forEach((a, b) => {
if(v.type == a){ if (v.type === a) {
newData.retNodes.push(v) newData.retNodes.push(v)
} }
}) })
}) })
newData.retLinks =vm.topoData.retLinks newData.retLinks = vm.topoData.retLinks
vm.initTopu(newData) vm.initTopu(newData)
} }
}, },
topoAll (value) { topoAll (value) {
let vm = this const vm = this
let data = { const data = {
retLinks:[], retLinks: [],
retNodes:[] retNodes: []
} }
let linksArr = [] const linksArr = []
value.links.forEach((v,i)=>{ value.links.forEach((v, i) => {
// v.indexName = '线上的字' // v.indexName = '线上的字'
let linksObj = {} const linksObj = {}
linksObj.id = v.id linksObj.id = v.id
linksObj.from = v.from linksObj.from = v.from
linksObj.to = v.to linksObj.to = v.to
...@@ -121,11 +121,11 @@ export default { ...@@ -121,11 +121,11 @@ export default {
vm.handleChange() vm.handleChange()
// vm.initTopu(data) // vm.initTopu(data)
}, },
topoDialog (data,value) { topoDialog (data, value) {
let vm = this const vm = this
vm.value = value vm.value = value
// let data = knowledgeJSON[0] // let data = knowledgeJSON[0]
if(data){ if (data) {
vm.topoData = JSON.parse(data) vm.topoData = JSON.parse(data)
} }
vm.handleChange() vm.handleChange()
......
...@@ -12,16 +12,16 @@ ...@@ -12,16 +12,16 @@
</el-select> </el-select>
<div class="search" style="width: 280px"> <div class="search" style="width: 280px">
<el-autocomplete <el-autocomplete
style="float: left; width: 196px;" style="float: left; width: 196px;"
class="inline-input" class="inline-input"
v-model="state" v-model="state"
size="mini" size="mini"
clearable clearable
:fetch-suggestions="querySearch" :fetch-suggestions="querySearch"
placeholder="请输入项目名称" placeholder="请输入项目名称"
:trigger-on-focus="false" :trigger-on-focus="false"
@select="handleSelect" @select="handleSelect"
></el-autocomplete> ></el-autocomplete>
<div class="searchBtn"> <div class="searchBtn">
<el-button type="text" style="color: #606266; position: relative; bottom: 6px">搜索</el-button> <el-button type="text" style="color: #606266; position: relative; bottom: 6px">搜索</el-button>
</div> </div>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<script> <script>
import vis from '@/assets/js/VisHelper.js' import vis from '@/assets/js/VisHelper.js'
import knowledgeJSON from '@/assets/js/knowledgeJSON.js' // import knowledgeJSON from '@/assets/js/knowledgeJSON.js'
import knowledgeDialog from './knowledgeDialog' import knowledgeDialog from './knowledgeDialog'
import * as API_KNOWLED from '@/api/sys.knowled.js' import * as API_KNOWLED from '@/api/sys.knowled.js'
...@@ -100,17 +100,17 @@ export default { ...@@ -100,17 +100,17 @@ export default {
}) })
}, },
topoAll (value) { topoAll (value) {
let vm = this const vm = this
// let data = knowledgeJSON[0] // let data = knowledgeJSON[0]
let data = { const data = {
retLinks:[], retLinks: [],
retNodes:[] retNodes: []
} }
let linksArr = [] const linksArr = []
value.links.forEach((v,i)=>{ value.links.forEach((v, i) => {
// v.indexName = '线上的字' // v.indexName = '线上的字'
let linksObj = {} const linksObj = {}
linksObj.id = v.id linksObj.id = v.id
linksObj.from = v.from linksObj.from = v.from
linksObj.to = v.to linksObj.to = v.to
...@@ -141,14 +141,14 @@ export default { ...@@ -141,14 +141,14 @@ export default {
}, },
openDialog () { openDialog () {
let data = '' let data = ''
if(this.state){ if (this.state) {
data = localStorage.getItem('data') data = localStorage.getItem('data')
}else{ } else {
data = '' data = ''
} }
this.$store.commit('d2admin/information/changeKnowledgeDialogShow', true) this.$store.commit('d2admin/information/changeKnowledgeDialogShow', true)
setTimeout(() => { setTimeout(() => {
this.$refs.child.topoDialog(data,this.value) this.$refs.child.topoDialog(data, this.value)
}, 500) }, 500)
} }
}, },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -91,19 +91,19 @@ export default { ...@@ -91,19 +91,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
</template> </template>
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -25,7 +25,7 @@ export default { ...@@ -25,7 +25,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -68,19 +68,19 @@ export default { ...@@ -68,19 +68,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -22,63 +22,63 @@ export default { ...@@ -22,63 +22,63 @@ export default {
methods: { methods: {
drawLine () { drawLine () {
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
var uploadedData = require('./data-1528971808162-BkOXf61WX.json') var uploadedData = require('./data-1528971808162-BkOXf61WX.json')
echarts.registerMap('china', uploadedData) echarts.registerMap('china', uploadedData)
var geoCoordMap = { //地理坐标 var geoCoordMap = { // 地理坐标
'台湾省': [121.5135, 25.0308], 台湾省: [121.5135, 25.0308],
'黑龙江省': [127.9688, 45.368], 黑龙江省: [127.9688, 45.368],
'内蒙古': [110.3467, 41.4899], 内蒙古: [110.3467, 41.4899],
'吉林省': [125.8154, 44.2584], 吉林省: [125.8154, 44.2584],
'北京市': [116.4551, 40.2539], 北京市: [116.4551, 40.2539],
'辽宁省': [123.1238, 42.1216], 辽宁省: [123.1238, 42.1216],
'河北省': [114.4995, 38.1006], 河北省: [114.4995, 38.1006],
'天津市': [117.4219, 39.4189], 天津市: [117.4219, 39.4189],
'山西省': [112.3352, 37.9413], 山西省: [112.3352, 37.9413],
'陕西省': [109.1162, 34.2004], 陕西省: [109.1162, 34.2004],
'甘肃省': [103.5901, 36.3043], 甘肃省: [103.5901, 36.3043],
'宁夏回族': [106.3586, 38.1775], 宁夏回族: [106.3586, 38.1775],
'青海省': [101.4038, 36.8207], 青海省: [101.4038, 36.8207],
'新疆维吾尔': [87.9236, 43.5883], 新疆维吾尔: [87.9236, 43.5883],
'西藏': [91.11, 29.97], 西藏: [91.11, 29.97],
'四川省': [103.9526, 30.7617], 四川省: [103.9526, 30.7617],
'重庆市': [108.384366, 30.439702], 重庆市: [108.384366, 30.439702],
'山东省': [117.1582, 36.8701], 山东省: [117.1582, 36.8701],
'河南省': [113.4668, 34.6234], 河南省: [113.4668, 34.6234],
'江苏省': [118.8062, 31.9208], 江苏省: [118.8062, 31.9208],
'安徽省': [117.29, 32.0581], 安徽省: [117.29, 32.0581],
'湖北省': [114.3896, 30.6628], 湖北省: [114.3896, 30.6628],
'浙江省': [119.5313, 29.8773], 浙江省: [119.5313, 29.8773],
'福建省': [119.4543, 25.9222], 福建省: [119.4543, 25.9222],
'江西省': [116.0046, 28.6633], 江西省: [116.0046, 28.6633],
'湖南省': [113.0823, 28.2568], 湖南省: [113.0823, 28.2568],
'贵州省': [106.6992, 26.7682], 贵州省: [106.6992, 26.7682],
'云南省': [102.9199, 25.4663], 云南省: [102.9199, 25.4663],
'广东省': [113.12244, 23.009505], 广东省: [113.12244, 23.009505],
'广西壮族': [108.479, 23.1152], 广西壮族: [108.479, 23.1152],
'海南省': [110.3893, 19.8516], 海南省: [110.3893, 19.8516],
'上海市': [121.4648, 31.2891], 上海市: [121.4648, 31.2891],
'香港': [114.2784, 22.3057] 香港: [114.2784, 22.3057]
} }
var data = this.message var data = this.message
var convertData = function (data) { var convertData = function (data) {
var res = [] var res = []
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
var geoCoord = geoCoordMap[data[i].name] var geoCoord = geoCoordMap[data[i].name]
if (geoCoord) { if (geoCoord) {
res.push({ res.push({
name: data[i].name, name: data[i].name,
value: geoCoord.concat(data[i].value) value: geoCoord.concat(data[i].value)
}) })
} }
} }
return res return res
} }
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -111,7 +111,7 @@ var convertData = function (data) { ...@@ -111,7 +111,7 @@ var convertData = function (data) {
transitionDuration: 0, transitionDuration: 0,
trigger: 'item', trigger: 'item',
formatter: function (params) { formatter: function (params) {
if (typeof (params.value)[2] == 'undefined') { if (typeof (params.value)[2] === 'undefined') {
return params.name + ' : ' + params.value return params.name + ' : ' + params.value
} else { } else {
return params.name + ' : ' + params.value[2] return params.name + ' : ' + params.value[2]
...@@ -258,19 +258,19 @@ var convertData = function (data) { ...@@ -258,19 +258,19 @@ var convertData = function (data) {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -84,19 +84,19 @@ export default { ...@@ -84,19 +84,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<script> <script>
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') const echarts = require('echarts/lib/echarts')
// 引入提示框和title组件 // 引入提示框和title组件
require('echarts/lib/component/tooltip') require('echarts/lib/component/tooltip')
require('echarts/lib/component/title') require('echarts/lib/component/title')
...@@ -24,7 +24,7 @@ export default { ...@@ -24,7 +24,7 @@ export default {
}, },
methods: { methods: {
drawLine () { drawLine () {
let vm = this const vm = this
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
vm.chart = echarts.init(document.getElementById(vm.idstr)) vm.chart = echarts.init(document.getElementById(vm.idstr))
// 清空图表 // 清空图表
...@@ -68,17 +68,19 @@ export default { ...@@ -68,17 +68,19 @@ export default {
data: [820, 932, 901, 934, 1290, 1330, 620], data: [820, 932, 901, 934, 1290, 1330, 620],
smooth: true, // 折线图平滑 smooth: true, // 折线图平滑
type: 'line', type: 'line',
areaStyle: { normal: { areaStyle: {
color: new echarts.graphic.LinearGradient( normal: {
0, 0, 0, 1, color: new echarts.graphic.LinearGradient(
[ 0, 0, 0, 1,
{ offset: 0, color: '#30DDF4' }, [
{ offset: 0.4, color: 'rgba(255,255,255,0.1)' }, { offset: 0, color: '#30DDF4' },
{ offset: 1, color: 'rgba(255,255,255,0)' } { offset: 0.4, color: 'rgba(255,255,255,0.1)' },
] { offset: 1, color: 'rgba(255,255,255,0)' }
) ]
} }, )
itemStyle: {// 线条样式 }
},
itemStyle: { // 线条样式
normal: { normal: {
color: '#30DDF4', color: '#30DDF4',
lineStyle: { // 系列级个性化折线样式 lineStyle: { // 系列级个性化折线样式
...@@ -103,19 +105,19 @@ export default { ...@@ -103,19 +105,19 @@ export default {
}, },
drawBar () { drawBar () {
// 绘制图表 // 绘制图表
let vm = this const vm = this
vm.chart.setOption(vm.option) vm.chart.setOption(vm.option)
vm.eventList() vm.eventList()
}, },
eventList () { eventList () {
let vm = this const vm = this
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
}) })
} }
}, },
watch: { watch: {
message: function () { message: function () {
let vm = this const vm = this
setTimeout(function () { setTimeout(function () {
vm.drawLine() vm.drawLine()
}, 1000) }, 1000)
......
<template> <template>
<d2-container class="mainPage"> <div id="overview">
<headerLayout></headerLayout> <dv-loading v-show="loading">Loading...</dv-loading>
<d2-container v-show="!loading" class="mainPage">
<div class="section"> <div class="section">
<div style="position: absolute; width: 250px; left: 630px; z-index: 1; top: 20px"> <div style="position: absolute; width: 250px; left: 630px; z-index: 1; top: 20px">
<el-button @click="getData(1)">客户</el-button> <el-button @click="getData(1)">客户</el-button>
<el-button @click="getData(2)">商机</el-button> <el-button @click="getData(2)">商机</el-button>
<el-button @click="getData(3)">项目</el-button> <el-button @click="getData(3)">项目</el-button>
</div> </div>
<mapChina :message="mapChina" idstr="mapChina" class="mapChina"></mapChina> <mapChina :message="mapChina" idstr="mapChina" class="mapChina"></mapChina>
<div class="leftBlock"> <div class="leftBlock">
<deptIntroduction class="deptIntroduction"></deptIntroduction> <deptIntroduction class="deptIntroduction"></deptIntroduction>
...@@ -19,11 +20,11 @@ ...@@ -19,11 +20,11 @@
<companyHotWord class="companyHotWord"></companyHotWord> <companyHotWord class="companyHotWord"></companyHotWord>
</div> </div>
</div> </div>
</d2-container> </d2-container>
</div>
</template> </template>
<script> <script>
import headerLayout from './components/headerLayout' // 公共头部
import mapChina from './components/mainPageEcharts/mapChina' // 地图 import mapChina from './components/mainPageEcharts/mapChina' // 地图
import deptIntroduction from './components/deptIntroduction'// 部门介绍 import deptIntroduction from './components/deptIntroduction'// 部门介绍
import deptOperation from './components/deptOperation'// 部门运营 import deptOperation from './components/deptOperation'// 部门运营
...@@ -31,51 +32,53 @@ import clientDistributed from './components/clientDistributed'// 客户增长分 ...@@ -31,51 +32,53 @@ import clientDistributed from './components/clientDistributed'// 客户增长分
import knowledgeGraph from './components/knowledgeGraph'// 知识图谱 import knowledgeGraph from './components/knowledgeGraph'// 知识图谱
import companyNews from './components/companyNews'// 公司新闻 import companyNews from './components/companyNews'// 公司新闻
import companyHotWord from './components/companyHotWord'// 企业热词 import companyHotWord from './components/companyHotWord'// 企业热词
import * as API_BASIC from '@/api/sys.basic.js' import * as API_BASIC from '@/api/sys.basic.js'
export default { export default {
components: { headerLayout, mapChina, deptIntroduction, deptOperation, clientDistributed, knowledgeGraph, companyNews, companyHotWord }, components: { mapChina, deptIntroduction, deptOperation, clientDistributed, knowledgeGraph, companyNews, companyHotWord },
data () { data () {
return { return {
loading: true,
newData: [], newData: [],
mapChina: [], mapChina: [],
type : 1 type: 1
} }
}, },
mounted () { mounted () {
this.GET_MapChina() this.GET_MapChina()
}, },
methods: { methods: {
getData(type) { getData (type) {
this.type = type this.type = type
this.GET_MapChina(); this.GET_MapChina()
}, },
GET_MapChina() { GET_MapChina () {
const type = this.type const type = this.type
API_BASIC.GetMapChina(type).then(res => { API_BASIC.GetMapChina(type).then(res => {
this.loading = false
this.newData = res.data this.newData = res.data
this.newData.forEach(e => { this.newData.forEach(e => {
var arr = { 'name': e['area'], 'value': e['num'] } var arr = { name: e.area, value: e.num }
this.mapChina.push(arr) this.mapChina.push(arr)
}); })
})
},
// 方法
handleSure () {
deleteKmz({
'kmzId': this.delMsg.deleteId,
'userId': this.delMsg.userId
}).then(res => {
console.log(res)
if (res.code == 200) {
this.$message.success('success')
} else {
this.$message.error(res.message)
}
}).catch(err => {
console.log('err', err)
}) })
} }
// 方法
// handleSure () {
// deleteKmz({
// kmzId: this.delMsg.deleteId,
// userId: this.delMsg.userId
// }).then(res => {
// console.log(res)
// if (res.code == 200) {
// this.$message.success('success')
// } else {
// this.$message.error(res.message)
// }
// }).catch(err => {
// console.log('err', err)
// })
// }
} }
} }
......
...@@ -56,10 +56,10 @@ ...@@ -56,10 +56,10 @@
</div> </div>
</el-form> </el-form>
</div></el-col> </div></el-col>
</el-row> </el-row>
<el-dialog <el-dialog
title="收货地址" title="收货地址"
:visible.sync="resetVisible" :visible.sync="resetVisible"
> >
<el-form :model="form"> <el-form :model="form">
...@@ -84,7 +84,7 @@ import * as API_LOGIN from '@/api/user.js' ...@@ -84,7 +84,7 @@ import * as API_LOGIN from '@/api/user.js'
export default { export default {
name: 'Login', name: 'Login',
data() { data () {
const validateUsername = (rule, value, callback) => { const validateUsername = (rule, value, callback) => {
if (!validUsername(value)) { if (!validUsername(value)) {
callback(new Error('Please enter the correct user name')) callback(new Error('Please enter the correct user name'))
...@@ -102,16 +102,16 @@ export default { ...@@ -102,16 +102,16 @@ export default {
return { return {
// 重置密码 // 重置密码
resetVisible: false, resetVisible: false,
form: { form: {
name: '', name: '',
region: '', region: '',
date1: '', date1: '',
date2: '', date2: '',
delivery: false, delivery: false,
type: [], type: [],
resource: '', resource: '',
desc: '' desc: ''
}, },
formLabelWidth: '120px', formLabelWidth: '120px',
src: './assets/img/Wisenergy.png', src: './assets/img/Wisenergy.png',
loginForm: { loginForm: {
...@@ -129,15 +129,15 @@ export default { ...@@ -129,15 +129,15 @@ export default {
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function (route) {
this.redirect = route.query && route.query.redirect this.redirect = route.query && route.query.redirect
this.$router.push({ path: this.redirect }); this.$router.push({ path: this.redirect })
}, },
immediate: true immediate: true
} }
}, },
methods: { methods: {
showPwd() { showPwd () {
if (this.passwordType === 'password') { if (this.passwordType === 'password') {
this.passwordType = '' this.passwordType = ''
} else { } else {
...@@ -147,13 +147,13 @@ export default { ...@@ -147,13 +147,13 @@ export default {
this.$refs.password.focus() this.$refs.password.focus()
}) })
}, },
handleLogin() { handleLogin () {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate(valid => {
if (valid) { if (valid) {
this.loading = true this.loading = true
API_LOGIN.login(this.loginForm).then((res) => { API_LOGIN.login(this.loginForm).then((res) => {
sessionStorage.setItem('token',res.token); sessionStorage.setItem('token', res.token)
sessionStorage.setItem('user', JSON.stringify(res.user)); sessionStorage.setItem('user', JSON.stringify(res.user))
this.$router.push({ path: (this.redirect || '/') }) this.$router.push({ path: (this.redirect || '/') })
this.loading = false this.loading = false
}).catch(() => { }).catch(() => {
......
import { Message, MessageBox } from 'element-ui' import { Message, MessageBox } from 'element-ui'
import util from '@/libs/util.js' import util from '@/libs/util.js'
import router from '@/router' import router from '@/router'
import { AccountLogin } from '@api/sys.login' import { AccountLogin } from '@/api/sys.login'
export default { export default {
namespaced: true, namespaced: true,
......
...@@ -150,7 +150,7 @@ module.exports = { ...@@ -150,7 +150,7 @@ module.exports = {
.end() .end()
// 重新设置 alias // 重新设置 alias
config.resolve.alias config.resolve.alias
.set('@api', resolve('src/api')) .set('@', resolve('src'))
// 分析工具 // 分析工具
if (process.env.npm_config_report) { if (process.env.npm_config_report) {
config config
......
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