Commit 43198fc1 by 黄志甲

完成综合门户的全部对接

parent 76d57fbd
......@@ -7,6 +7,9 @@ import ViewUI from 'view-design';
import 'view-design/dist/styles/iview.css';
import echarts from 'echarts'
import utils from "./commons/utils/index.js"
import store from "./store"
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
Vue.use(ViewUI);
......@@ -36,6 +39,7 @@ router.beforeEach((to, from, next) => {
new Vue({
el: '#app',
router,
store,
components: {
App
},
......
......@@ -2,12 +2,12 @@ import Vuex from "vuex"
import Vue from "vue"
import power from "./modules/power.js"
Vue.use(Vuex);
import publicdata from "./modules/publicdata.js"
Vue.use(Vuex);
export default new Vuex.Store({
modules: {
power
power,
publicdata
}
})
\ No newline at end of file
......@@ -2,9 +2,10 @@
/* 权限 */
export default {
//参数
state: {
systemId:{}, //项目
year:{}, //年份
},
actions: {
......
/* 项目,年份,地区 */
import {getCityAreaList,getYearList,getStatusCyclicList} from "@/commons/api/gateway.js"
export default {
//参数
state: {
project: [{ //项目
name: "广西党员扶残温暖同行项目",
value: "1"
},
{
name: "广西贫困残疾人家庭无障碍改造项目",
value: "2"
}
],
year:[], //年份
region:[] //地区
},
actions: {
setYear:({commit},year) =>{
commit('setYear',year)
},
setRegion:({commit},region)=>{
commit('setRegion',region)
}
},
getters: {
project: state => state.project,
year: state => state.year,
region:state =>state.region
},
mutations: {
//赋值state
setYear:(state,year)=>{
state.year = year
},
setRegion:(state,region)=>{
state.region = region
}
},
namespaced: true
}
......@@ -41,39 +41,29 @@
<Submenu :name="`${index+1}-${key+1}`" v-for="(items,key) in item.children" :key="key">
<template slot="title">
<Icon :type="items.icon" />
{{items.title}}
{{items.title}}
<!-- {{index+1}} - {{key+1}} -->
</template>
<MenuItem
v-for="(v,i) in items.children" :key="i"
:name="`${index+1}-${key+1}-${i+1}`"
:id="`id${index+1}-${key+1}-${i+1}`"
:to="v.path"
v-if="!v.children">
{{v.title}}
<MenuItem v-for="(v,i) in items.children" :key="i" :name="`${index+1}-${key+1}-${i+1}`" :id="`id${index+1}-${key+1}-${i+1}`"
:to="v.path" v-if="!v.children">
{{v.title}}
<!-- {{index+1}}-{{key+1}}-{{i+1}} -->
</MenuItem>
</MenuItem>
<!-- 三层 -->
<Submenu
:name="`${index+1}-${key+1}-${i+1}`"
v-for="(v,i) in items.children" :key="i"
v-if="v.children"
>
<Submenu :name="`${index+1}-${key+1}-${i+1}`" v-for="(v,i) in items.children" :key="i" v-if="v.children">
<template slot="title">
{{v.title}}
{{v.title}}
<!-- {{index+1}}-{{key+1}}-{{i+1}} -->
</template>
<MenuItem v-for="(vs,is) in v.children" :key="is"
:name="`${index+1}-${key+1}-${i+1}-${is+1}`"
:id="`id${index+1}-${key+1}-${i+1}-${is+1}`"
:to="vs.path">
{{vs.title}}
<MenuItem v-for="(vs,is) in v.children" :key="is" :name="`${index+1}-${key+1}-${i+1}-${is+1}`" :id="`id${index+1}-${key+1}-${i+1}-${is+1}`"
:to="vs.path">
{{vs.title}}
<!-- {{index+1}}-{{key+1}}-{{i+1}}-{{is+1}} -->
</MenuItem>
</Submenu>
</Submenu>
</Submenu>
</MenuGroup>
......@@ -86,11 +76,32 @@
<Layout>
<Header :style="{ background: '#fff',borderBottom:'1px solid rgba(0, 0, 0, .1)',height: '50px',lineHeight:'50px'}">
<Row type="flex" justify="end" align="middle" v-if="!isCollapsed">
<!-- <Col span="2" v-for="(item,index) in menu" :key="index" :to="item.children[0].children[0].path">
<div class="herText" :class="index==headerIndex?'onHeaderClass':''" @click="index==headerIndex?'':onHeaderFun(index)">
{{item.title}}
</div>
</Col> -->
<Col span="21">
<!-- <Menu mode="horizontal" active-name="1">
<div class="layout-logo"></div>
<div class="layout-nav">
<MenuItem name="1">
<Icon type="ios-navigate"></Icon>
Item 1
</MenuItem>
<MenuItem name="2">
<Icon type="ios-keypad"></Icon>
Item 2
</MenuItem>
<MenuItem name="3">
<Icon type="ios-analytics"></Icon>
Item 3
</MenuItem>
<MenuItem name="4">
<Icon type="ios-paper"></Icon>
Item 4
</MenuItem>
</div>
</Menu> -->
<!-- <div class="herText" :class="index==headerIndex?'onHeaderClass':''" @click="index==headerIndex?'':onHeaderFun(index)">
{{item.title}}
</div> -->
</Col>
<Col span="3">
<Row type="flex" justify="end" align="middle">
<div class="name know-flex konw-center know-align-center">
......@@ -103,14 +114,13 @@
</Row>
</Header>
<Content :style="{padding: '0 16px 16px'}">
<Breadcrumb :style="{margin: '8px 0'}">
<BreadcrumbItem>{{menu[headerIndex].title}}</BreadcrumbItem>
<BreadcrumbItem>{{menu[headerIndex].children[menuIndex].title}}</BreadcrumbItem>
<BreadcrumbItem>{{menu[headerIndex].children[menuIndex].children[menuChildren].title}}</BreadcrumbItem>
<BreadcrumbItem
v-if="menu[headerIndex].children[menuIndex].children[menuChildren].children">
{{menu[headerIndex].children[menuIndex].children[menuChildren].children[menuDeepest].title}}
</BreadcrumbItem>
<Breadcrumb :style="{margin: '8px 0'}">
<BreadcrumbItem>{{menu[headerIndex].title}}</BreadcrumbItem>
<BreadcrumbItem>{{menu[headerIndex].children[menuIndex].title}}</BreadcrumbItem>
<BreadcrumbItem>{{menu[headerIndex].children[menuIndex].children[menuChildren].title}}</BreadcrumbItem>
<BreadcrumbItem v-if="menu[headerIndex].children[menuIndex].children[menuChildren].children">
{{menu[headerIndex].children[menuIndex].children[menuChildren].children[menuDeepest].title}}
</BreadcrumbItem>
</Breadcrumb>
<div class="content" :style="{height:height+'px'}">
<router-view />
......@@ -128,10 +138,9 @@
<p class="font-20">是否注销登录?</p>
</div>
<div slot="footer">
<Button type="error" size="large" long>确认</Button>
<Button type="error" size="large" long @click="loginOut">确认</Button>
</div>
</Modal>
</div>
</template>
<script>
......@@ -141,8 +150,8 @@
return {
menu: menus,
menuIndex: 0,
menuChildren: 0,
menuDeepest:0,
menuChildren: 0,
menuDeepest: 0,
type: 0,
isCollapsed: false,
headerIndex: 0,
......@@ -202,16 +211,13 @@
// this.menuChildren = 0
// let indexRouter = this.menu[index].children[0].children[0].path
// this.$router.push(indexRouter)
// },
onIndexFun(){
this.openNames= []
this.activeName= ''
this.$router.push('/welcome')
},
// },
onIndexFun() {
this.openNames = []
this.activeName = ''
this.$router.push('/welcome')
},
//选中高亮操作
onSelectFun() {
let paths = this.$route.path
......@@ -221,7 +227,7 @@
this.headerIndex = index
item.children.forEach((v, i) => {
if (`/${arr[1]}/${arr[2]}` == v.path) {
this.openNames = []
this.openNames = []
this.menuIndex = i
this.openNames.push(`${index+1}-${i+1}`)
v.children.forEach((content, key) => {
......@@ -231,7 +237,7 @@
} else if (`/${arr[1]}/${arr[2]}/${arr[3]}` == content.path) {
content.children.forEach((vs, is) => {
if (paths == vs.path) {
this.menuChildren = key
this.menuChildren = key
this.menuDeepest = is
this.openNames.push(`${index+1}-${i+1}-${key+1}`)
this.activeName = `${index+1}-${i+1}-${key+1}-${is+1}`
......@@ -259,11 +265,15 @@
<style>
/* 覆盖样式 */
/* .ivu-menu-dark {
background: #20222A !important
} */
.menuCalss {
overflow: auto
}
}
.menuCalss::-webkit-scrollbar {
width: 2px;
......
......@@ -5,8 +5,9 @@
<Col span="4">
<FormItem label="项目">
<Select v-model="queryData.systemId" placeholder="请选择项目" class="fromItem" clearable @on-clear="clear('systemId')">
<Option value="1">项目1</Option>
<Option value="2">项目2</Option>
<Option v-for="(item,index) in project" :key="index" :value="item.value">
{{item.name}}
</Option>
</Select>
</FormItem>
</Col>
......@@ -88,9 +89,9 @@
<script>
import {
option,
map
} from "./echarts.js" //饼图配置 柱形图配置
mapGetters,
mapActions
} from 'vuex'
import {
getCityAreaList,
getYearList,
......@@ -137,8 +138,8 @@
this.getYearListFun()
this.getStatusCyclicListFun()
},
computed: {
computed:{
...mapGetters('publicdata',['project'])
},
watch: {
statusList(newsStatusList, oldVal) {
......@@ -148,19 +149,15 @@
})
this.drawLine()
},
dataList(newDataList,oldVal){
this.dataFun()
}
},
mounted() {
setTimeout(() => {
this.drawLine()
this.dataFun()
}, 500)
},
methods: {
//获取区域
......@@ -171,7 +168,6 @@
}
})
},
//获取年份
getYearListFun() {
getYearList().then(res => {
......@@ -216,8 +212,6 @@
})
},
drawLine() {
var echarts = require('echarts');
var myChart = echarts.init(document.getElementById('myChart'));
......
......@@ -8,13 +8,13 @@
</Col>
<Col span="12">
<div class="text-right">
<Button @click="getWorkSituationListFun(),queryInfo.id='450000000000'">
<Button @click="getWorkSituationListFun(cityAreaList[0].id),onClickType=true">
返回上级地区
</Button>
</div>
</Col>
</Row>
<div id="map" style="width:100%;height: 800px;"></div>
<div id="map" style="width:100%;height:750px;"></div>
</Card>
</Col>
<Col :xs="24" :md="11" class="row-col">
......@@ -22,33 +22,40 @@
<Card>
<p slot="title">搜索条件</p>
<div>
<Form :model="formItem" :label-width="50" inline>
<Form :model="queryInfo" :label-width="50" inline>
<FormItem label="项目">
<Select v-model="formItem.select" class="fromItem">
<Option value="beijing">New York</Option>
<Select v-model="queryInfo.systemId" class="fromItem">
<Option v-for="(item,index) in project" :key="index" :value="item.value">
{{item.name}}
</Option>
</Select>
</FormItem>
</Form>
<Form :model="formItem" :label-width="50" inline>
<Form :model="queryInfo" :label-width="50" inline>
<FormItem label="年份">
<Select v-model="formItem.select" class="fromItem">
<Option value="beijing">New York</Option>
<Select v-model="queryInfo.year" class="fromItem">
<Option value="0">全部</Option>
<Option v-for="(item,index) in yearList" :key="index" :value="item.year">
{{item.year}}
</Option>
</Select>
</FormItem>
<FormItem label="地区">
<Select v-model="formItem.select" class="fromItem">
<Option value="beijing">New York</Option>
<Select v-model="queryInfo.id" class="fromItem">
<option></option>
<Option v-for="(item,index) in cityAreaList" :key="index" :value="item.id">
{{item.name}}
</Option>
</Select>
</FormItem>
<FormItem>
<Button type="primary">查询</Button>
<Button type="primary" @click="getWorkSituationListFun(queryInfo.id)">查询</Button>
</FormItem>
</Form>
</div>
</Card>
<div style="margin-top:30px;">
<Table border :columns="columns1" :data="list"></Table>
<Table border :columns="columns1" :data="list" height="580"></Table>
</div>
</Card>
</Col>
......@@ -56,10 +63,16 @@
</template>
<script>
import {
mapGetters,
mapActions
} from 'vuex'
import mapList from "./map.json"
import {
getWorkSituationList,
getMapJson
getMapJson,
getCityAreaList,
getYearList
} from "@/commons/api/gateway.js"
import {
getJson
......@@ -68,7 +81,9 @@
data() {
return {
formItem: {
value: ''
systemId: '1',
year: '0',
id: "0"
},
list: [],
columns1: [{
......@@ -102,22 +117,46 @@
align: 'center',
}
],
queryInfo: {
id: '450000000000',
systemId: 1,
id: 0,
systemId: "1",
year: '0',
mapId: 'g450000'
}
},
cityAreaList: [],
yearList: [],
onClickType:true
}
},
computed: {
...mapGetters('publicdata', ['project'])
},
created() {
this.getWorkSituationListFun()
this.getCityAreaListFun()
this.getYearListFun()
},
methods: {
getWorkSituationListFun() {
//获取区域
getCityAreaListFun() {
getCityAreaList().then(res => {
if (res.success) {
this.cityAreaList = res.data
this.getWorkSituationListFun(res.data[0].id)
}
})
},
//获取年份
getYearListFun() {
getYearList().then(res => {
if (res.success) {
this.yearList = res.data
}
})
},
//根据地区查询列表以及绘制地图
getWorkSituationListFun(id) {
this.queryInfo.id = id
getWorkSituationList(this.queryInfo).then(res => {
if (res.success) {
this.list = res.data
......@@ -130,10 +169,6 @@
}
})
},
//地图
getMapJsonFun(dataList, areaId) {
var that = this
......@@ -200,12 +235,12 @@
}]
}
myChart.setOption(option);
//点击事件
myChart.on('click', function(params) {
console.log(params.data);
that.queryInfo.id = params.data.areaId
that.getWorkSituationListFun()
if(that.onClickType){
that.getWorkSituationListFun(params.data.areaId)
}
that.onClickType = false
})
......
......@@ -38,7 +38,11 @@
</template>
<script>
import {mapGetters,mapActions} from 'vuex'
import { login,getCoedeImg } from "@/commons/api/login.js"
//获取地区 年份 存入vuex
import { getCityAreaList, getYearList } from "@/commons/api/gateway.js"
export default {
data() {
return {
......@@ -57,30 +61,39 @@
}
},
created() {
this.imgSet()
this.getYearListFun()
this.getCityAreaListFun()
},
methods: {
...mapActions('publicdata', ['setYear','setRegion']),
//获取年份
getYearListFun(){
getYearList().then(res=>{
console.log(res)
if(res.success){
this.setYear(res.data)
}
})
},
//获取地区
getCityAreaListFun(){
getCityAreaList().then(res=>{
if(res.success){
this.setRegion(res.data)
}
})
},
//获取图片
imgSet(){
this.url = `http://192.168.3.116:9999/getImage?time=${new Date().getTime()}`
},
getCoedeImgFun(){
getCoedeImg().then(res=>{
console.log(res)
})
},
login(name){
this.$refs[name].validate((valid) => {
if (valid) {
this.$Message.success('Success!');
localStorage.setItem('token','15154848df4s8f4s84sd84s')
this.$router.push({path:'/admin/administrators/subsystem'})
// let arr = ['admin-administrators-subsystem','admin-administrators-adminList','admin-administrators-dictionary',]
// let nArr = JSON.stringify(arr)
// localStorage.setItem('power',nArr)
} else {
this.$Message.error('请输入账号和密码');
}
......
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