Commit 43198fc1 by 黄志甲

完成综合门户的全部对接

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