| | |
| | | const BASE_URL = 'http://192.168.20.39:12316'; |
| | | const BASE_URL = 'http://192.168.20.39:12316/server'; |
| | | //webSocket 服务地址 |
| | | var socketUrl = 'ws://192.168.20.39:12316/ws/select'; |
| | | var socketUrl = 'ws://192.168.20.39:12316/server/ws/select'; |
| | | //数据库监控地址 |
| | | var sql_Url = 'http://192.168.20.39:8081/admin/druid/sql.html'; |
| | | //路径分析地址 |
| | |
| | | |
| | | //综合展示获取 |
| | | export function select_Comprehensive_ByPageAndCount(params) { |
| | | return request.get('/comprehensive/selectAddrByPage', { params: params }); |
| | | return request.get('/locate/selectAddrByPage', { params: params }); |
| | | } |
| | | //综合展示地名定位 |
| | | export function select_Comprehensive_SelectWktById(params) { |
| | | return request.get('/comprehensive/selectWktById', { params: params }); |
| | | return request.get('/locate/selectWktById', { params: params }); |
| | | } |
| | | //上传Shp文件读取第一条记录的WKT; |
| | | export function inquiry_uploadShp(params) { |
| | |
| | | <div class="rightBox"> |
| | | <div class="rightTitle"> |
| | | <span>管道</span> |
| | | <el-link :underline="false" class="boxClose" |
| | | <el-link @click="closeMenuBox" :underline="false" class="boxClose" |
| | | ><i class="el-icon-close"></i> |
| | | </el-link> |
| | | </div> |
| | | <el-table :data="tableData" height="220"> |
| | | <el-table-column align="center" type="index" label="序号" width="50" /> |
| | | <el-table-column label="定位" width="100" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | icon="el-icon-map-location" |
| | | size="mini" |
| | | @click="spaceLocation(scope.$index, scope.row)" |
| | | ></el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in attributeData" |
| | | :key="index" |
| | | :label="item.alias" |
| | | :prop="item.field" |
| | | show-overflow-tooltip |
| | | align="center" |
| | | ></el-table-column> |
| | | </el-table> |
| | | <div class="rightPage"> |
| | | <!-- <el-pagination |
| | | <div class="tableBox"> |
| | | <el-table :data="tableData" style="height: 100%; width: 100%"> |
| | | <el-table-column |
| | | align="center" |
| | | type="index" |
| | | label="序号" |
| | | width="50" |
| | | /> |
| | | <el-table-column label="定位" width="100" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | icon="el-icon-map-location" |
| | | size="mini" |
| | | @click="spaceLocation(scope.$index, scope.row)" |
| | | ></el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, index) in attributeData" |
| | | :key="index" |
| | | :label="item.alias" |
| | | :prop="item.field" |
| | | show-overflow-tooltip |
| | | align="center" |
| | | ></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!-- <div class="rightPage"> --> |
| | | <!-- <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="listPage.pageIndex" |
| | |
| | | :total="listPage.pageCount" |
| | | > |
| | | </el-pagination> --> |
| | | </div> |
| | | <!-- </div> --> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | } |
| | | this.tableData = data.result; |
| | | }, |
| | | closeMenuBox() { |
| | | if (this.imagePoint != null) { |
| | | sgworld.Creator.DeleteObject(this.imagePoint); |
| | | this.imagePoint = null; |
| | | } |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | this.$store.state.mapPopBoolean = false; |
| | | this.$store.state.mapPopBoxFlag = null; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.setTableAll(); |
| | |
| | | color: white; |
| | | width: 100%; |
| | | } |
| | | .tableBox { |
| | | height: 327px; |
| | | } |
| | | .rightPage { |
| | | position: absolute; |
| | | bottom: 10px; |
| | |
| | | color: white; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less"> |
| | | /deep/ .el-table, |
| | | .el-table__expanded-cell { |
| | | background-color: transparent !important; |
| | | } |
| | | /deep/ .el-table { |
| | | background-color: transparent; |
| | | |
| | | /* 表格内背景颜色 */ |
| | | /deep/ .el-table th, |
| | | .el-table tr, |
| | | .el-table td { |
| | | background-color: transparent !important; |
| | | color: white; |
| | | } |
| | | /*最外层透明*/ |
| | | /deep/ .el-table, |
| | | /deep/ .el-table__expanded-cell { |
| | | background-color: transparent; |
| | | } |
| | | /* 表格内背景颜色 */ |
| | | /deep/ .el-table th, |
| | | /deep/ .el-table tr, |
| | | /deep/ .el-table td { |
| | | background-color: transparent; |
| | | th, |
| | | td { |
| | | background-color: transparent; |
| | | } |
| | | .el-table__expanded-cell { |
| | | background-color: transparent !important; |
| | | } |
| | | |
| | | // 表头背景色 |
| | | th.el-table__cell { |
| | | background-color: #303030; |
| | | color: #fff; |
| | | } |
| | | tr > td { |
| | | background-color: #303030; |
| | | color: #fff; |
| | | } |
| | | |
| | | // hover效果 |
| | | tr:hover > td { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | } |
| | | |
| | | tbody tr:hover { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | // text-align: center; |
| | | } |
| | | |
| | | // 滚动条宽高 |
| | | .el-table__body-wrapper::-webkit-scrollbar { |
| | | width: 5px; |
| | | height: 5px; |
| | | } |
| | | |
| | | .el-table__body-wrapper::-webkit-scrollbar { |
| | | width: 5px; |
| | | /*滚动条宽度*/ |
| | | height: 5px; |
| | | /*滚动条高度*/ |
| | | } |
| | | /*定义滚动条轨道 内阴影+圆角*/ |
| | | .el-table__body-wrapper::-webkit-scrollbar-track { |
| | | box-shadow: 0px 1px 3px #216fe6 inset; |
| | | /*滚动条的背景区域的内阴影*/ |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | /*定义滑块 内阴影+圆角*/ |
| | | .el-table__body-wrapper::-webkit-scrollbar-thumb { |
| | | box-shadow: 0px 1px 3px #216fe6 inset; |
| | | border-radius: 6px; |
| | | background-color: #216fe6; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | <style lang="less"></style> |
| | | <style scoped lang="less"></style> |
| | |
| | | :title="treeChange" |
| | | placeholder="请选择..." |
| | | > |
| | | <el-option |
| | | :value="menuTopFrom.queryLayer" |
| | | style="overflow: auto; height: 100%" |
| | | > |
| | | <el-tree |
| | | :data="layerData" |
| | | show-checkbox |
| | | node-key="id" |
| | | ref="tree" |
| | | accordion |
| | | highlight-current |
| | | :props="defaultProps" |
| | | > |
| | | </el-tree> |
| | | <el-option :value="menuTopFrom.queryLayer" style="height: 100%"> |
| | | <div style="height: 200px; overflow: auto"> |
| | | <el-tree |
| | | :data="layerData" |
| | | show-checkbox |
| | | node-key="id" |
| | | ref="tree" |
| | | accordion |
| | | highlight-current |
| | | :props="defaultProps" |
| | | > |
| | | </el-tree> |
| | | </div> |
| | | <div style="margin-top: 5px"> |
| | | <el-button size="mini" plain @click="getCheckedNodes" |
| | | >确认</el-button |
| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-select v-model="menuTopFrom.queryType" placeholder="请选择..."> |
| | | <el-select |
| | | @change="changeValue($event)" |
| | | v-model="menuTopFrom.queryType" |
| | | placeholder="请选择..." |
| | | > |
| | | <el-option |
| | | v-for="item in queryOption" |
| | | :key="item.value" |
| | |
| | | <input |
| | | :accept="'.shp, .shx, .dbf, .prj'" |
| | | style="display: none" |
| | | ref="pathClear" |
| | | type="file" |
| | | name="file" |
| | | id="getMenuTopFile" |
| | | multiple="multiple" |
| | | @change="setMenuTopFile()" |
| | | /> |
| | | <el-link @click="getMenuTopFile" :underline="false" |
| | | <!-- <el-link @click="getMenuTopFile" :underline="false" |
| | | >导入选择范围</el-link |
| | | > |
| | | > --> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button plain @click="getAttributeQuery">查询</el-button> |
| | | <el-button type="info" plain>重置</el-button> |
| | | <el-button type="info" @click="clearQuery" plain>重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | value: 'polygon', |
| | | label: '多边形', |
| | | }, |
| | | { |
| | | value: 'inputFile', |
| | | label: '导入选择范围', |
| | | }, |
| | | ], |
| | | defaultProps: { |
| | | children: 'children', |
| | |
| | | this.getAllTable(); |
| | | }, |
| | | methods: { |
| | | changeValue(value) { |
| | | // var obj = {}; |
| | | // obj = this.queryOption.find(function (item) { |
| | | // return item.value === value; |
| | | // }); |
| | | // if (obj.value == 'inputFile') { |
| | | // this.getMenuTopFile(); |
| | | // } |
| | | }, |
| | | async getAllTable() { |
| | | const data = await inquiry_SelectTabs(); |
| | | if (data.code != 200) { |
| | |
| | | return this.$message.error('用户角色请求错误'); |
| | | } |
| | | this.$store.state.mapMenuShpFile = rs.result; |
| | | this.showMapMenuPop(); |
| | | }, |
| | | error: (e) => { |
| | | console.log(e); |
| | |
| | | //清空标绘 |
| | | sgworld.Creator.SimpleGraphic.edit(false, { editProp: false }); |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | var val = document.getElementById('getMenuTopFile').files; |
| | | if (!val || !val.length) { |
| | | if (this.menuTopFrom.queryType != 'inputFile') { |
| | | sgworld.Creator.createSimpleGraphic( |
| | | this.menuTopFrom.queryType, |
| | | {}, |
| | |
| | | } |
| | | ); |
| | | } else { |
| | | this.showMapMenuPop(); |
| | | this.getMenuTopFile(); |
| | | } |
| | | }, |
| | | setTurfGeometry(res) { |
| | |
| | | this.showMapMenuPop(); |
| | | }, |
| | | showMapMenuPop() { |
| | | console.log(this.treeChange); |
| | | this.$store.state.mapSpaceQueryLayer = this.treeChange; |
| | | if ( |
| | | this.$store.state.mapPopBoolean != true && |
| | |
| | | } |
| | | this.$bus.$emit('changeMapMenuTop', 'true'); |
| | | //清空inputFile |
| | | var file = document.getElementById('getMenuTopFile'); |
| | | file.outerHTML = file.outerHTML; |
| | | // var file = document.getElementById('getMenuTopFile'); |
| | | // file.outerHTML = file.outerHTML; |
| | | this.$refs.pathClear.value = ''; |
| | | }, |
| | | clearQuery() { |
| | | this.$refs.pathClear.value = ''; |
| | | this.treeChange = []; |
| | | this.menuTopFrom.queryLayer = null; |
| | | this.menuTopFrom.queryType = 'rectangle'; |
| | | this.$refs.tree.setCheckedKeys([]); |
| | | sgworld.Creator.SimpleGraphic.clear(); |
| | | }, |
| | | setCartesianToEightFour(res) { |
| | | var std = {}; |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | <style lang="less" scoped> |
| | | .menuBox { |
| | | width: 98%; |
| | | height: 100%; |
| | |
| | | padding: 4px 20px; |
| | | font-weight: 400; |
| | | } |
| | | /deep/.el-input__inner { |
| | | background-color: transparent !important ; |
| | | color: #fff; |
| | | border: 1px solid; |
| | | } |
| | | /deep/ .el-select .el-input__inner { |
| | | border-color: #fff !important; |
| | | } |
| | | </style> |
| | |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div class="bottomPage"> |
| | | <div class="bottomPage pagination_box"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | <style lang="less" scoped> |
| | | .menuPop { |
| | | width: 100%; |
| | | height: 100%; |
| | | width: calc(100% - 1px); |
| | | height: calc(100% - 1px); |
| | | margin: 0; |
| | | padding: 0; |
| | | overflow: hidden; |
| | | border: 1px solid gray; |
| | | float: left; |
| | | |
| | | .rightTitle { |
| | | padding: 5px; |
| | | color: white; |
| | |
| | | position: absolute; |
| | | bottom: 1%; |
| | | } |
| | | // 设置输入框的背景色、字体颜色、边框属性设置; |
| | | /deep/.el-input__inner { |
| | | background-color: transparent !important ; |
| | | color: #fff; |
| | | border: 1px solid; |
| | | } |
| | | /deep/ .el-select .el-input__inner { |
| | | border-color: #fff !important; |
| | | } |
| | | /deep/ .el-table { |
| | | background-color: transparent; |
| | | |
| | | th, |
| | | td { |
| | | background-color: transparent; |
| | | } |
| | | .el-table__expanded-cell { |
| | | background-color: transparent !important; |
| | | } |
| | | |
| | | // 表头背景色 |
| | | th.el-table__cell { |
| | | background-color: #303030; |
| | | color: #fff; |
| | | } |
| | | tr > td { |
| | | background-color: #303030; |
| | | color: #fff; |
| | | } |
| | | |
| | | // hover效果 |
| | | tr:hover > td { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | } |
| | | |
| | | tbody tr:hover { |
| | | background-color: rgba(255, 255, 255, 0.3) !important; |
| | | // text-align: center; |
| | | } |
| | | |
| | | // 滚动条宽高 |
| | | .el-table__body-wrapper::-webkit-scrollbar { |
| | | width: 5px; |
| | | height: 5px; |
| | | } |
| | | |
| | | .el-table__body-wrapper::-webkit-scrollbar { |
| | | width: 5px; |
| | | /*滚动条宽度*/ |
| | | height: 5px; |
| | | /*滚动条高度*/ |
| | | } |
| | | /*定义滚动条轨道 内阴影+圆角*/ |
| | | .el-table__body-wrapper::-webkit-scrollbar-track { |
| | | box-shadow: 0px 1px 3px #216fe6 inset; |
| | | /*滚动条的背景区域的内阴影*/ |
| | | border-radius: 10px; |
| | | } |
| | | |
| | | /*定义滑块 内阴影+圆角*/ |
| | | .el-table__body-wrapper::-webkit-scrollbar-thumb { |
| | | box-shadow: 0px 1px 3px #216fe6 inset; |
| | | border-radius: 6px; |
| | | background-color: #216fe6; |
| | | } |
| | | } |
| | | .pagination_box { |
| | | margin-top: 20px; |
| | | /deep/.el-input__inner { |
| | | background-color: transparent !important; |
| | | border: 1px solid; |
| | | color: white; |
| | | } |
| | | /deep/.el-pagination__total { |
| | | color: white; |
| | | } |
| | | /deep/.el-pagination__jump { |
| | | color: white; |
| | | } |
| | | /deep/.el-pager li.active { |
| | | color: #409eff; |
| | | } |
| | | /deep/.el-pager li { |
| | | color: white; |
| | | background: transparent; |
| | | } |
| | | /deep/.el-pager li { |
| | | color: white; |
| | | } |
| | | /deep/.btn-prev { |
| | | background: transparent; |
| | | } |
| | | /deep/.btn-next { |
| | | background: transparent; |
| | | } |
| | | /deep/.btn-next i { |
| | | color: white; |
| | | } |
| | | /deep/.btn-prev i { |
| | | color: white; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="spaceBox"> |
| | | <el-select v-model="menuTopFrom.queryLayer" placeholder="请选择..."> |
| | | <el-option |
| | | :value="menuTopFrom.queryLayer" |
| | | style="overflow: auto; height: 100%" |
| | | > |
| | | <el-tree |
| | | :data="layerData" |
| | | :props="defaultProps" |
| | | :show-checkbox="true" |
| | | :check-on-click-node="true" |
| | | :check-strictly="true" |
| | | node-key="id" |
| | | @check="menuTreeCheck" |
| | | ref="treeForm" |
| | | :default-expanded-keys="[1]" |
| | | accordion |
| | | > |
| | | </el-tree> |
| | | <el-option :value="menuTopFrom.queryLayer" style="height: 100%"> |
| | | <div style="height: 200px; overflow: auto"> |
| | | <el-tree |
| | | :data="layerData" |
| | | :props="defaultProps" |
| | | :show-checkbox="true" |
| | | :check-on-click-node="true" |
| | | :check-strictly="true" |
| | | node-key="id" |
| | | @check="menuTreeCheck" |
| | | ref="treeForm" |
| | | :default-expanded-keys="[1]" |
| | | accordion |
| | | > |
| | | </el-tree> |
| | | </div> |
| | | <div style="margin-top: 5px"> |
| | | <el-button size="mini" plain @click="getCheckedNodes">确认</el-button> |
| | | <el-button size="mini" type="info" plain @click="resetCheckedNodes" |
| | |
| | | overflow: hidden; |
| | | } |
| | | </style> |
| | | <style lang="less"> |
| | | <style lang="less" scoped> |
| | | .el-tree .el-tree-node .is-leaf + .el-checkbox .el-checkbox__inner { |
| | | display: inline-block; |
| | | } |
| | | .el-tree .el-tree-node .el-checkbox .el-checkbox__inner { |
| | | display: none; |
| | | } |
| | | |
| | | /deep/.el-form-item__label { |
| | | color: white; |
| | | } |
| | | /deep/.el-input__inner { |
| | | background-color: transparent !important ; |
| | | color: #fff !important; |
| | | border: 1px solid; |
| | | } |
| | | |
| | | /deep/ .el-input__inner { |
| | | border-color: #fff !important; |
| | | } |
| | | /deep/.el-select-dropdown { |
| | | border-color: white; |
| | | opacity: 0.85; |
| | | } |
| | | </style> |
| | |
| | | import { getPerms } from '../api/api'; |
| | | import validCode from './verificationCode.vue'; |
| | | import { mapActions } from 'vuex'; |
| | | import moment from 'moment'; |
| | | |
| | | export default { |
| | | components: { validCode }, |
| | |
| | | getCode(data) { |
| | | this.validCode = data; //在data中定义一个 validCode:'',用来记录验证码。 |
| | | }, |
| | | |
| | | submitForm(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | this.loading = true; |
| | | |
| | | this.login(this.loginForm) |
| | | .then((response) => { |
| | | this.setCookies(response); |
| | | getPerms().then((res) => { |
| | | if (res.code == 200) { |
| | | this.$store.commit('getPermsEntity', res.result); |
| | | |
| | | if (res.result.length != 0) { |
| | | this.$router.push('/'); |
| | | } |
| | |
| | | } |
| | | }); |
| | | }, |
| | | setCookies(res) { |
| | | var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss'); |
| | | var LfPrems = { |
| | | token: res.result.token, |
| | | uname: res.result.uname, |
| | | time: timeData, |
| | | }; |
| | | LfPrems = JSON.stringify(LfPrems); |
| | | localStorage.setItem('LFToken', LfPrems); |
| | | }, |
| | | }, |
| | | created() {}, |
| | | }; |
| | |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="info">查询</el-button> |
| | | <el-button @click="setQueryTable" type="info">查询</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table :data="tableData" height="200px" style="width: 100%"> |
| | |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.listData.pageIndex = val; |
| | | this.getToponymicData(); |
| | | }, |
| | | setQueryTable() { |
| | | this.listData.pageSize = 10; |
| | | this.listData.pageIndex = 1; |
| | | this.getToponymicData(); |
| | | }, |
| | | async getToponymicData() { |
| | |
| | | } |
| | | |
| | | .box-card { |
| | | background-color: rgba(0, 0, 0, 0.6); |
| | | background: #303030; |
| | | opacity: 0.85; |
| | | border: 1px solid rgba(32, 160, 255, 0.6); |
| | | color: white; |
| | | } |
| | | .menu_Top { |
| | | background: rgba(0, 0, 0, 0.5); |
| | | background: #303030; |
| | | opacity: 0.85; |
| | | width: 100%; |
| | | height: 6%; |
| | | padding: 1%; |
| | |
| | | z-index: 40; |
| | | } |
| | | .menu_Popup { |
| | | background: rgba(0, 0, 0, 0.6); |
| | | background: #303030; |
| | | opacity: 0.85; |
| | | width: 60%; |
| | | height: 45%; |
| | | |
| | |
| | | import { logout, selectMenuRecursive } from '@/api/api'; |
| | | import { removeToken, getToken } from '@/utils/auth'; |
| | | import customElMenu from '../components/customElMenu.vue'; |
| | | import { queryMenuTree } from '../api/api'; |
| | | import { queryMenuTree, getPerms } from '../api/api'; |
| | | import colorChange from '../views/maintenance/colorChange.vue'; |
| | | import { containsCoordinate } from 'ol/extent'; |
| | | import Vue from 'vue'; |
| | |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | async getCookies() { |
| | | var boolean = this.getTimeCookies(); |
| | | if (boolean != true) { |
| | | this.$router.push('/login'); |
| | | return; |
| | | } |
| | | if (this.$store.state.permsEntity.length == 0) { |
| | | const data = await getPerms(); |
| | | this.$store.state.permsEntity = data.result; |
| | | } |
| | | this.$store.state.uname = JSON.parse( |
| | | localStorage.getItem('LFToken') |
| | | ).uname; |
| | | this.$router.push('/'); |
| | | }, |
| | | getTimeCookies() { |
| | | var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time); |
| | | var time2 = new Date(); |
| | | if (time2 > time1) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | //主题切换 |
| | | setThemeColors() {}, |
| | | //鼠标移入菜单事件 |
| | |
| | | |
| | | this.changeSelectStyle = index; |
| | | }, |
| | | |
| | | setShowFalseDiv(bolean) { |
| | | var index = this.showFlag; |
| | | let newItem = this.listMenu[index]; |
| | |
| | | this.$store.commit('currentPerms', res.perms); |
| | | }, |
| | | async getMenuTree() { |
| | | this.getCookies(); |
| | | const data = await queryMenuTree(); |
| | | var that = this; |
| | | if (data.code == 200) { |
| | |
| | | } |
| | | .secondMenuDiv { |
| | | position: absolute; |
| | | z-index: 30; |
| | | z-index: 1024; |
| | | margin-top: 10px; |
| | | border: 1px solid white; |
| | | border-radius: 5px; |
| | |
| | | duration: 5 * 1000, |
| | | }); |
| | | } |
| | | |
| | | commit('SET_UNAME', data.result.uname); |
| | | commit('SET_TOKEN', data.result.token); |
| | | |
| | | setToken(data.result.token); |
| | | resolve(data); |
| | | }) |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | setCookies(res) { |
| | | var value = localStorage.getItem('LFToken'); |
| | | if (value != null) { |
| | | this.rmCookies(); |
| | | } |
| | | var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss'); |
| | | var token = res.result; |
| | | var LfPrems = { |
| | | token: token, |
| | | time: timeData, |
| | | }; |
| | | LfPrems = JSON.stringify(LfPrems); |
| | | localStorage.setItem('LFToken', LfPrems); |
| | | }, |
| | | rmCookies() { |
| | | localStorage.removeItem('LFToken'); |
| | | }, |
| | | getpublickey({ commit, state }, userInfo) { |
| | | return new Promise((resolve, reject) => { |
| | | getPublicKey(userInfo) |
| | |
| | | // } |
| | | //=========================== |
| | | //=======使用sessionStorage====== |
| | | |
| | | const TokenKey = 'Admin-Token'; |
| | | |
| | | export function getToken() { |
| | | console.log(window.sessionStorage.getItem(TokenKey)); |
| | | return window.sessionStorage.getItem(TokenKey); |
| | | } |
| | | |
| | |
| | | export function removeToken() { |
| | | return window.sessionStorage.removeItem(TokenKey); |
| | | } |
| | | // export function setCookies(res) { |
| | | // var timeData = moment(res.result.expire).format('YYYY-MM-DD HH:mm:ss'); |
| | | // var token = res.result; |
| | | // var LfPrems = { |
| | | // token: token, |
| | | // time: timeData, |
| | | // }; |
| | | // LfPrems = JSON.stringify(LfPrems); |
| | | // localStorage.setItem('LFToken', LfPrems); |
| | | // } |
| | |
| | | }, |
| | | setIquery(res) { |
| | | switch (res) { |
| | | case 'e1': |
| | | case 'e2': |
| | | this.$store.state.mapMenuBoolean = true; |
| | | this.$store.state.mapMenuBoxFlag = '1'; |
| | | break; |
| | | case 'e2': |
| | | case 'e1': |
| | | this.$store.state.mapMenuBoolean = true; |
| | | this.$store.state.mapMenuBoxFlag = '2'; |
| | | break; |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.$store.state.mapMenuBoolean = false; |
| | | this.$store.state.mapMenuBoxFlag = null; |
| | | this.$store.state.mapPopBoolean = false; |
| | | this.$store.state.mapPopBoxFlag = null; |
| | | this.initMap(); |
| | | }, |
| | | //初始化菜单授权 |
| | |
| | | import databaseMonitoring from '@/views/maintenance/databaseMonitoring.vue'; //数据库监控 |
| | | import systemMonitoring from '@/views/maintenance/systemMonitoring.vue'; //系统监控 |
| | | import parameterConfiguration from '@/views/maintenance/parameterConfiguration.vue'; //系统配置 |
| | | import { selectMenuRecursive, queryMenuTree } from '../../api/api'; |
| | | import { selectMenuRecursive, queryMenuTree, getPerms } from '../../api/api'; |
| | | import customElMenu from '../../components/customElMenu.vue'; |
| | | export default { |
| | | components: { |
| | |
| | | formLabelWidth: '70px', |
| | | }; |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | created() { |
| | | this.getTreeData(); |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | async getCookies() { |
| | | var boolean = this.getTimeCookies(); |
| | | if (boolean != true) { |
| | | this.$router.push('/login'); |
| | | return; |
| | | } |
| | | if (this.$store.state.permsEntity.length == 0) { |
| | | const data = await getPerms(); |
| | | this.$store.state.permsEntity = data.result; |
| | | } |
| | | var store = this.menuList[0]; |
| | | this.setViewController(store); |
| | | }, |
| | | getTimeCookies() { |
| | | var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time); |
| | | var time2 = new Date(); |
| | | if (time2 > time1) { |
| | | return false; |
| | | } else { |
| | | return true; |
| | | } |
| | | }, |
| | | //获取树 |
| | | async getTreeData() { |
| | | const data = await queryMenuTree(); |
| | |
| | | return value.type == 1; |
| | | }); |
| | | this.menuList = this.treeData(menuList); |
| | | this.setViewController(this.menuList[0]); |
| | | this.getCookies(); |
| | | // |
| | | } else { |
| | | alert('暂无菜单栏数据'); |
| | | } |
| | |
| | | // this.treeList = this.treeData(data.result); |
| | | }, |
| | | setViewController(res) { |
| | | if (res == null) { |
| | | return; |
| | | } |
| | | if (res.children != null) { |
| | | this.setViewController(res.children[0]); |
| | | } else { |
| | |
| | | }, |
| | | |
| | | handleselect(index, indexPath, e) { |
| | | this.getTimeCookies(); |
| | | var data = e.$attrs.perms; |
| | | this.$store.state.currentPerms = data.perms; |
| | | var index = data.url; |