石超 2023-08-24 09:47:26 +08:00
commit 5001486093
26 changed files with 2254 additions and 42 deletions

View File

@ -26,7 +26,7 @@
} }
}, },
"feixian":{ "feixian":{
"appname":"费县森林防火电子沙盘", "appname":"费县智慧林业防灭火平台",
"area":"费县", "area":"费县",
"baseUrl":"http://223.99.16.253:9001", "baseUrl":"http://223.99.16.253:9001",
"layerurl":"http://223.99.16.253:9006/applicationMars/getApplicationInfo", "layerurl":"http://223.99.16.253:9006/applicationMars/getApplicationInfo",

BIN
public/img/gridman-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
public/img/gridman/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -7,7 +7,7 @@
<meta name="author" content="山东慧创 http://www.hopetrytech.com "> <meta name="author" content="山东慧创 http://www.hopetrytech.com ">
<link rel="icon" href="<%= BASE_URL %>sitelogo.jpg"> <link rel="icon" href="<%= BASE_URL %>sitelogo.jpg">
<title>林业防火平台</title> <title>费县智慧林业防火平台</title>
<style> <style>
.popup-container{ .popup-container{
text-align:left; text-align:left;

View File

@ -24,12 +24,6 @@ import Layout from '../views/layout/Layout'
export const constantRouterMap = [ export const constantRouterMap = [
{ path: '/login', component: () => import('@/views/login/index'), meta: { sortNo: 0 }, hidden: true }, { path: '/login', component: () => import('@/views/login/index'), meta: { sortNo: 0 }, hidden: true },
{ path: '/home', component: () => import('@/views/home/index'), meta: { sortNo: 0 }, hidden: true }, { path: '/home', component: () => import('@/views/home/index'), meta: { sortNo: 0 }, hidden: true },
{
path: '/navigation',
name: 'navigation',
meta: { title: '系统导航', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
component: () => import('@/views/navigation/index.vue')
},
{ path: '/404', component: () => import('@/views/errorPage/404'), meta: { sortNo: 0 }, hidden: true }, { path: '/404', component: () => import('@/views/errorPage/404'), meta: { sortNo: 0 }, hidden: true },
{ path: '/401', component: () => import('@/views/errorPage/401'), meta: { sortNo: 0 }, hidden: true }, { path: '/401', component: () => import('@/views/errorPage/401'), meta: { sortNo: 0 }, hidden: true },
// // 把二级路由提前加到路由表,实现路由缓存 // // 把二级路由提前加到路由表,实现路由缓存
@ -45,32 +39,69 @@ export const constantRouterMap = [
// component: () => import('@/views/flowschemes/add') // component: () => import('@/views/flowschemes/add')
// }] // }]
// }, // },
{ {
path: '/', path: '/index', // 控制台
name: 'layout',
redirect:"/navigation",
component: () => import('@/views/index/index'),
meta: { sortNo: 0 },
children: [
{
path: '/navigation',
name: 'navigation',
meta: { title: '导航页', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
component: () => import('@/views/navigation/index')
},{
path: '/helpdocument',
name: 'helpdocument',
meta: { title: '系统文档', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
component: () => import('@/views/documentation/index')
}
]
},{
path: '/gridman', // 网格化管理
name: 'layout',
component: () => import('@/views/gridman/index'),
meta: { sortNo: 0 },
children: [
// {
// path: '/navigation',
// name: 'navigation',
// meta: { title: '导航页', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
// component: () => import('@/views/navigation/index')
// },{
// path: '/helpdocument',
// name: 'helpdocument',
// meta: { title: '系统文档', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
// component: () => import('@/views/documentation/index')
// }
]
},
{
path: '/', // 管理中心
component: Layout, component: Layout,
redirect: 'home', redirect: 'home',
name: 'layout', name: 'layout',
meta: { sortNo: 0 }, meta: { sortNo: 0 },
children: [ children: [
{ {
path: '/dashboard', path: '/dashboard',
name: 'dashboard', name: 'dashboard',
meta: { title: '主页', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon- meta: { title: '主页', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
component: () => import('@/views/dashboard/index') component: () => import('@/views/dashboard/index')
},{ },{
path: '/documentation', path: '/documentation',
name: 'documentation', name: 'documentation',
meta: { title: '系统文档', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon- meta: { title: '系统文档', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
component: () => import('@/views/documentation/widget/AddForm.vue') component: () => import('@/views/documentation/widget/AddForm.vue')
},{ },{
path: '/profile', path: '/profile',
name: 'profile', name: 'profile',
hidden: true, hidden: true,
meta: { title: '个人中心', icon: 'guide', sortNo: 0 }, meta: { title: '个人中心', icon: 'guide', sortNo: 0 },
component: () => import('@/views/usermanager/profile') component: () => import('@/views/usermanager/profile')
} }
] ]
} }
] ]

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="documentation-container"> <div class="documentation-container">
<p style="box-sizing: inherit; margin-top: 0px; margin-bottom: 11px; padding: 0px; color: #333333; font-family: tahoma, arial, 'PingFang SC', 'Hiragino Sans GB', 'WenQuanYi Micro Hei', 'Microsoft YaHei', sans-serif; font-size: 12px; text-align: center;" data-v-5b66b893="" data-spm-anchor-id="a1zaa.8161610.0.i0.67774c80ll4sHX"><span style="box-sizing: inherit; font-weight: bolder; color: #ffffff;" data-v-5b66b893=""><span style="box-sizing: inherit; font-size: 21px; font-family: 微软雅黑, 'Microsoft YaHei', 宋体, SimSun, 黑体, SimHei; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important;" data-v-5b66b893="">费县森林防火电子沙盘使用规定</span></span></p>
</div> </div>
</template> </template>
<script> <script>
@ -13,7 +13,8 @@
<style scoped> <style scoped>
.documentation-container{ .documentation-container{
width:100%; width:1024px;
height:100vh; margin:0px auto;
padding:50px 0px;
} }
</style> </style>

118
src/views/gridman/index.vue Normal file
View File

@ -0,0 +1,118 @@
<template>
<div class="gridman-container">
<div class="gridman-header">
网格化管理
</div>
<div class="gridman-navigation">
<div class="nav-item" v-for="(item,index) in navList" :key="index" :style="{'top':item.top+'px'}">
<img :src="'/img/gridman/nav-'+(index+1)+'.png'" alt="">
<div class="nav-lable">{{item.lable}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'index',
created(){
},
data(){
return {
navList:[
{
lable:"重点人群",
url:"",
top:0,
},{
lable:"区域划分",
url:"",
top:90,
},{
lable:"消防值班",
url:"",
top:140,
},{
lable:"护林员",
url:"",
top:160,
},{
lable:"进山登记",
url:"",
top:140,
},{
lable:"站点管理",
url:"",
top:90,
},{
lable:"网格员",
url:"",
top:0,
},
]
}
}
}
</script>
<style scoped>
.gridman-container{
width:100%;
height: 100%;
background-image:url(/img/gridman/bg.png);
background-size:100% 100%;
}
.gridman-header{
width:100%;
height:99px;
background-image:url(/img/gridman/header.png);
background-size:100% 100%;
text-align: center;
color:#fff;
line-height:90px;
font-size:36px;
letter-spacing: 5px;
}
.gridman-navigation{
height:200px;
width:1470px;
margin:0px auto;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
.gridman-navigation::after{
content:"";
height:0;
clear:both;
overflow: hidden;
display: block;
}
.gridman-navigation .nav-item{
width:150px;
height:150px;
float:left;
margin:0px 30px;
cursor:pointer;
position:relative;
}
.gridman-navigation .nav-item img{
width:150px;
}
.nav-lable{
width:150px;
position:relative;
top:20px;
font-size:24px;
text-align:center;
color:#fff;
}
</style>

View File

@ -950,6 +950,11 @@ export default {
this.HKmonitorboxShow = true; this.HKmonitorboxShow = true;
} }
} }
},
destroyed(){
for(let i=0;i<20;i++){
document.getElementById("map-querybar").style.display= "none";
}
} }
} }
</script> </script>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="box"> <div class="box">
<div class="tab-container"> <div class="tab-container">
<div class="tab-button">图上量算</div> <div class="tab-button">常用工具</div>
<!-- <div class="tab-button" :style="{'border-bottom':active == 1 ? '3px solid #01D6D5': '0px'}" @click="active = 1;">图上量算</div> --> <!-- <div class="tab-button" :style="{'border-bottom':active == 1 ? '3px solid #01D6D5': '0px'}" @click="active = 1;">图上量算</div> -->
<!-- <div class="tab-button" :style="{'border-bottom':active == 2 ? '3px solid #01D6D5': '0px'}" @click="active = 2;initDrawLayer();">图上绘标</div> --> <!-- <div class="tab-button" :style="{'border-bottom':active == 2 ? '3px solid #01D6D5': '0px'}" @click="active = 2;initDrawLayer();">图上绘标</div> -->
</div> </div>

50
src/views/index/index.vue Normal file
View File

@ -0,0 +1,50 @@
<template>
<div class="navigation-container">
<div class="navigation-header">
费县智慧林业防灭火平台
</div>
<div class="navigation-body">
<router-view></router-view>
</div>
</div>
</template>
<script>
export default {
name: 'index',
data(){
return {
}
}
}
</script>
<style scoped>
.navigation-container{
width:100%;
height:100vh;
background:#071216;
}
.navigation-header{
width:100%;
height:100px;
background-image:url(/img/navigation/header.png);
background-size:100% 100px;
text-align: center;
font-size:40px;
line-height:90px;
color:#fff;
}
.navigation-body{
width:100%;
height: calc( 100vh - 100px);
padding-top:100px;
background-image:url(/img/navigation/container-bg.png);
background-size:100% 100%;
overflow-y:auto;
}
</style>

View File

@ -150,7 +150,7 @@
this.$store.dispatch('Login', this.loginForm).then(() => { this.$store.dispatch('Login', this.loginForm).then(() => {
this.loading = false this.loading = false
this.$router.push({ this.$router.push({
path: '/home' path: '/index'
}) })
}).catch(() => { }).catch(() => {
this.loading = false this.loading = false

View File

@ -1,10 +1,7 @@
<template> <template>
<div class="navigation-container"> <div class="container">
<div class="navigation-header"> <div class="body">
费县指挥森林防火平台 <p class="tip">控制台</p>
</div>
<div class="navigation-body">
<p class="tip">WELCOME 欢迎使用管理系统 </p>
<div class="navigation-center"> <div class="navigation-center">
<div class="navigation-item" v-for="(item,index) in routerlist" :key="index" :style="{'background':item.bgColor}" @click="$router.push({'path':item.url})"> <div class="navigation-item" v-for="(item,index) in routerlist" :key="index" :style="{'background':item.bgColor}" @click="$router.push({'path':item.url})">
<div class="item-icon"> <div class="item-icon">
@ -40,7 +37,7 @@
<div class="documation-item"> <div class="documation-item">
<p style="font-size:16px;color:#fff;margin-top:40px;">用户手册</p> <p style="font-size:16px;color:#fff;margin-top:40px;">用户手册</p>
<p> <p>
<el-button type="warning" size="middle" round> <el-button type="warning" size="middle" round @click="$router.push({'path':'/helpdocument'})">
<i class="el-icon el-icon-right"></i> <i class="el-icon el-icon-right"></i>
</el-button> </el-button>
</p> </p>
@ -64,7 +61,7 @@
},{ },{
lable:"网格化管理", lable:"网格化管理",
icon:"", icon:"",
url:"", url:"/gridman",
bgColor:"linear-gradient(180deg, #DBA2FD 0%, #3C31F5 100%)" bgColor:"linear-gradient(180deg, #DBA2FD 0%, #3C31F5 100%)"
},{ },{
lable:"监测中心", lable:"监测中心",

740
src/views/record/index.vue Normal file
View File

@ -0,0 +1,740 @@
<template>
<div class="flex-column">
<sticky :className="'sub-navbar'">
<div class="filter-container">
<!-- <el-input @keyup.enter.native="handleFilter" size="mini" prefix-icon="el-icon-search" style="width: 200px;margin-bottom: 0;margin:0px 12px;" class="filter-item" :placeholder="'站点名称'"
v-model="listQuery.key">
</el-input> -->
<el-autocomplete
size="mini"
v-model="siteName"
style="margin-right:12px;"
:fetch-suggestions="querySearchAsync"
placeholder="防火站点"
:value-key="'name'"
@select="handleSelect"
clearable
></el-autocomplete>
<el-date-picker
v-model="startEndTime"
style="position:relative;top:1px;"
size="mini"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="dateTimeChange"
>
</el-date-picker>
<!-- 人员名称 -->
<el-input @keyup.enter.native="handleFilter" clearable size="mini" prefix-icon="el-icon-search" style="width: 200px;margin-bottom: 0;margin:0px 12px;" class="filter-item" :placeholder="'人员姓名'"
v-model="listQuery.userName">
</el-input>
<!-- 身份证号 -->
<el-input @keyup.enter.native="handleFilter" clearable size="mini" prefix-icon="el-icon-search" style="width: 200px;margin-bottom: 0;margin-right:12px;" class="filter-item" :placeholder="'身份证号'"
v-model="listQuery.cardNo">
</el-input>
<el-button type="default" size="mini" @click="resetListQuery"></el-button>
<el-button type="primary" size="mini" @click="getList()"></el-button>
<permission-btn moduleName='modulemanager' :size="'mini'" v-on:btn-event="onBtnClicked"></permission-btn>
</div>
</sticky>
<div class="app-container flex-item">
<div class="bg-white fh">
<el-table ref="mainTable" :key='tableKey' :data="tableData" v-loading="listLoading" size="mini" border fit
highlight-current-row style="width: 100%;" height="calc(100vh - 182px)" @row-click="rowClick" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55">
</el-table-column>
<el-table-column :label="'Id'" v-if="showDescription" min-width="120px">
<template slot-scope="scope">
<span>{{scope.row.id}}</span>
</template>
</el-table-column>
<el-table-column prop="userName" label="人员姓名" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="cardNo" label="身份证号" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="phone" label="电话" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="inTime" label="进山时间" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="siteName" label="防火站点" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="inTypeName" label="登记方式" show-overflow-tooltip>
</el-table-column>
<el-table-column :label="'操作'" style="text-align:center;" width="120px">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-document" @click="getDetail(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="listQuery.pageIndex" :limit.sync="listQuery.pageSize" @pagination="handleCurrentChange" />
</div>
</div>
<el-dialog width="750px" height="400px" top=" calc( 50vh - 200px)"
class="dialog-mini body-small addWindow"
v-el-drag-dialog
:title="'登记信息'"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="addServiceVisible"
>
<el-container style="width:750px;height:400px;overflow-y:hidden;">
<el-container v-if="addServiceVisible">
<AddForm :detailInfo="detailInfo" @close="addServiceVisible = false"></AddForm>
</el-container>
</el-container>
</el-dialog>
<el-dialog width="1066px" height="690px" top="60px"
class="dialog-mini body-small addWindow"
v-el-drag-dialog
:title="'编辑服务'"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="editServiceVisible"
>
<el-container style="width:1050px;height:690px;overflow-y:hidden;">
<el-container v-if="editServiceVisible">
<EditForm @editSuccess="editSuccess" @close="editServiceVisible = false" :id="editForm.id"></EditForm>
</el-container>
</el-container>
</el-dialog>
<el-dialog width="800px" height="690px" top="60px"
class="dialog-mini body-small addWindow"
v-el-drag-dialog
:title="'编辑服务'"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="selectRolesVisible"
>
<el-container style="width:800px;height:690px;overflow-y:hidden;">
<el-container v-if="selectRolesVisible">
<!-- <EditForm @editSuccess="editSuccess" :id="editForm.id"></EditForm> -->
<!-- <select-roles :roles="selectRoles" :isUnLoadGroupList="true" :userNames="selectRoleNames" v-on:roles-change="rolesChange"></select-roles> -->
<select-roles :serviceId="serviceId" @serviceSuccess="serviceSuccess"></select-roles>
</el-container>
</el-container>
</el-dialog>
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import { listToTreeSelect} from '@/utils'
import extend from "@/extensions/delRows.js"
import * as modules from '@/api/modules'
import * as login from '@/api/login'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import waves from '@/directive/waves' //
import Sticky from '@/components/Sticky'
import permissionBtn from '@/components/PermissionBtn'
import elDragDialog from '@/directive/el-dragDialog'
import iconData from '@/assets/public/css/comIconfont/iconfont/iconfont.json'
import {getMethodCommon,postMethodCommon } from "@/api/common";
// import AddForm from './widget/AddForm';
import AddForm from './widget/Examine';
import EditForm from './widget/EditForm';
import SelectRoles from './widget/SelectRoles'
export default {
name: 'module',
components: {
Sticky,
permissionBtn,
Pagination,
AddForm,
EditForm,
SelectRoles
// elDragDialog
},
mixins: [extend],
directives: {
waves,
elDragDialog
},
data() {
return {
siteName:null,
startEndTime:[new Date("2023-01-01"),new Date()],
lngLat:[117.92214891969796,35.26152309532066],
states:[
{
value:1,
label:"应急",
},{
value:0,
label:"防火",
}
],
tableData:[
{
name:"徐景良",
phone:"17861857725",
time:"2023-04-19 10:00:00",
site:"塔山防火站",
method:"本人登记",
user:"徐景良",
},{
name:"张斌",
phone:"17861857725",
time:"2023-04-19 10:00:00",
site:"塔山防火站",
method:"管理员登记",
user:"张斌",
}
],
addServiceVisible:false,
editServiceVisible:false,
selectRolesVisible:false,
iconData: iconData,
normalizer(node) {
// treeselect
return {
label: node.name,
id: node.id,
children: node.children,
}
},
columns: [
// treetable
{
text: '模块名称',
value: 'name'
},
{
text: '模块标识',
value: 'code'
},
{
text: 'URL',
value: 'url'
}
],
selectMenus: [], //
tableKey: 0,
list: [], //
total: 0,
currentModule: null, // treetable
listLoading:false,
listQuery: {
//
pageIndex: 1,
pageSize: 20,
startTime:null,
endTime:null,
cardNo: null,
userName:null,
siteId:null,
},
apps: [],
showDescription: false,
modules: [], // 访
modulesTree: [], // 访
temp: {
//
id: undefined,
cascadeId: '',
url: '',
code: '',
sortNo: 0,
iconName: '',
parentId: null,
name: '',
status: 0,
isSys: false
},
menuTemp: {
//
id: undefined,
url: '',
icon: '',
code: '',
moduleId: null,
name: '',
status: 0,
sort: 0
},
dialogFormVisible: false, //
dialogStatus: '',
dialogMenuVisible: false, //
dialogMenuStatus: '',
chkRoot: false, //
treeDisabled: false, //
textMap: {
update: '编辑',
create: '添加'
},
rules: {
name: [
{
required: true,
message: '名称不能为空',
trigger: 'blur'
}
]
},
downloadLoading: false,
multipleSelection:[],
editForm:null,
selectRoles: [], //
selectRoleNames: '',
serviceId:null,
}
},
computed: {
},
filters: {
},
created() {
this.listQuery.startTime = this.formatTime(this.startEndTime[0]);
this.listQuery.endTime = this.formatTime(this.startEndTime[1]);
this.getList();
},
mounted() {
},
methods: {
resetListQuery(){
this.listQuery.userName = null;
this.listQuery.cardNo = null;
this.listQuery.siteId = null;
this.siteName = null;
this.getList();
},
querySearchAsync(e,cb){
if(e == "" || e==null || e == " "){
return;
}
getMethodCommon("/FireCodePC/LoadAllSite",{pageIndex:1,pageSize:10,siteName:e,state:3}).then(res=>{
if(res.code == 200){
if(res.data.length>0){
let list = [
// {
// name:"",
// value:null
// }
];
res.data.forEach((item,index)=>{
let it = {
name:item.siteName,
value:item.id
}
list.push(it);
})
if(list.length>0){
cb(list);
}else{
return null;
}
}
}
})
},
handleSelect(e){
this.listQuery.siteId = e.value;
this.getList();
},
formatTime(dateParam){
var date = new Date(dateParam);
var year = date.getFullYear(); //
var month = date.getMonth() + 1; // +1
var dates = date.getDate();
var hour = date.getHours();
var minute = date.getMinutes();
var seconds = date.getSeconds();
if(month<10)month="0"+month;
if(date<10)date="0"+date;
if(hour<10)hour = "0"+hour;
if(minute<10)minute = "0"+minute;
if(seconds<10)seconds = "0"+seconds
var time=year + "-" + month + "-" + dates + " "+ hour+":"+minute+":"+seconds
return time;
},
dateTimeChange(e){
this.listQuery.startTime = this.formatTime(e[0]);
this.listQuery.endTime = this.formatTime(e[1]);
this.getList();
},
serviceSuccess(){
this.selectRolesVisible = false;
},
rolesChange(type, val) {
if(type === 'Texts'){
this.selectRoleNames = val
return
}
this.selectRoles = val
},
selectRole(id){
this.serviceId = id;
this.selectRolesVisible = true;
},
addSuccess(){
this.addServiceVisible = false;
this.getList();
},
editSuccess(){
this.editServiceVisible = false;
this.getList();
},
rowClick(row) {
this.$refs.mainTable.clearSelection()
this.$refs.mainTable.toggleRowSelection(row)
},
handleSelectionChange(val) {
this.multipleSelection = val
},
onBtnClicked: function(domId) {
console.log('you click:' + domId)
switch (domId) {
case 'btnAdd':
this.addServiceVisible = true;
break
case 'btnEdit':
if (this.multipleSelection.length != 1) {
this.$message({
message: '只能选中一个进行编辑',
type: 'error'
})
return
}
this.handleUpdate()
break
case 'btnDel':
if (this.multipleSelection.length < 1) {
this.$message({
message: '至少删除一个',
type: 'error'
})
return
}
this.handleDelete()
break
case 'btnAddMenu':
this.handleAddMenu()
break
case 'btnEditMenu':
if (this.selectMenus.length !== 1) {
this.$message({
message: '只能选中一个进行编辑',
type: 'error'
})
return
}
this.handleEditMenu(this.selectMenus[0])
break
case 'btnDelMenu':
if (this.selectMenus.length < 1) {
this.$message({
message: '至少删除一个',
type: 'error'
})
return
}
this.handleDelMenus(this.selectMenus)
break
default:
break
}
},
getList() {
this.listLoading = true
getMethodCommon("/FireCodeApp/LoadInUser",this.listQuery).then(res=>{
if(res.code == 200){
this.tableData = res.data
this.total = res.count
this.listLoading = false
}
})
},
handleFilter() {
this.listQuery.pageIndexIndex = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.pageIndex = val.page
this.listQuery.pageSize = val.limit
this.getList()
},
resetTemp() {
this.temp = {
id: undefined,
cascadeId: '',
url: '',
iconName: '',
code: '',
parentId: null,
name: '',
status: 0
}
},
// #region
handleCreate() {
//
this.resetTemp()
this.dialogStatus = 'create'
this.dialogFormVisible = true
this.dpSelectModule = null
this.$nextTick(() => {
this.$refs['dataForm'].clearValidate()
})
},
createData() {
//
this.$refs['dataForm'].validate(valid => {
if (valid) {
if(this.temp.url.indexOf('http') > -1 && !this.temp.code){
this.$message.error('请输入模块标识')
return
}
modules.add(this.temp).then(response => {
//
this.temp.id = response.result.id
this.temp.cascadeId = response.result.cascadeId
this.list.unshift(this.temp)
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
})
this.getModulesTree()
})
}
})
},
handleUpdate() {
this.editForm = this.multipleSelection[0];
this.editServiceVisible = true;
},
getDetail(row){
this.detailInfo = row;
this.addServiceVisible = true;
},
updateData() {
//
this.$refs['dataForm'].validate(valid => {
if (valid) {
const tempData = Object.assign({}, this.temp)
if(tempData.url.indexOf('http') > -1 && !tempData.code){
this.$message.error('请输入模块标识')
return
}
modules.update(tempData).then(() => {
this.dialogFormVisible = false
this.$notify({
title: '成功',
message: '更新成功',
type: 'success',
duration: 2000
})
this.getModulesTree()
for (const v of this.list) {
if (v.id === this.temp.id) {
const index = this.list.indexOf(v)
this.list.splice(index, 1, this.temp)
break
}
}
})
}
})
},
handleDelete() {
this.$confirm('确定删除所选数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let idsStr = [];
this.multipleSelection.forEach((item,index)=>{
idsStr.push(item.id);
})
postMethodCommon("/CimService/Delete",idsStr).then(res=>{
if(res.code == 200){
this.$message({
type:"success",
message:"删除成功",
})
}
this.getList();
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
// #end region
// #region
handleAddMenu() {
//
this.resetMenuTemp()
this.dialogMenuStatus = 'create'
this.dialogMenuVisible = true
this.$nextTick(() => {
this.$refs['menuForm'].clearValidate()
})
},
addMenu() {
//
this.$refs['menuForm'].validate(valid => {
if (valid) {
modules.addMenu(this.menuTemp).then(response => {
//
this.menuTemp.id = response.result.id
this.list.unshift(this.menuTemp)
this.dialogMenuVisible = false
this.$notify({
title: '成功',
message: '创建成功',
type: 'success',
duration: 2000
})
})
}
})
},
handleEditMenu(row) {
//
this.menuTemp = Object.assign({}, row) // copy obj
this.dialogMenuStatus = 'update'
this.dialogMenuVisible = true
this.$nextTick(() => {
this.$refs['menuForm'].clearValidate()
})
},
updateMenu() {
//
this.$refs['menuForm'].validate(valid => {
if (valid) {
const tempData = Object.assign({}, this.menuTemp)
modules.updateMenu(tempData).then(() => {
this.dialogMenuVisible = false
this.$notify({
title: '成功',
message: '更新成功',
type: 'success',
duration: 2000
})
for (const v of this.list) {
if (v.id === this.menuTemp.id) {
const index = this.list.indexOf(v)
this.list.splice(index, 1, this.menuTemp)
break
}
}
})
}
})
},
handleDelMenus(rows) {
//
modules.delMenu(rows.map(u => u.id)).then(() => {
this.$notify({
title: '成功',
message: '删除成功',
type: 'success',
duration: 2000
})
rows.forEach(row => {
const index = this.list.indexOf(row)
this.list.splice(index, 1)
})
})
}
// #end region
}
}
</script>
<style lang="scss">
.text {
font-size: 14px;
}
.item {
margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: '';
}
.clearfix:after {
clear: both;
}
.el-card__header {
padding: 12px 20px;
}
.selectIcon-box{
text-align: center;
border: 1px solid #eeeeee;
border-right: 0;
border-bottom: 0;
.el-col{
padding: 10px 0;
border-right: 1px solid #eeeeee;
border-bottom: 1px solid #eeeeee;
&.active{
.iconfont{
color: #409EFF;
}
}
}
.iconfont{
cursor: pointer;
font-size: 20px;
}
}
.custom-icon-input::before{
font-size: 18px;
position: absolute;
right: 10px;
top: 0;
}
</style>

View File

@ -0,0 +1,398 @@
<template>
<div style="width:100%;height:100%;overflow:auto;padding:0px 23px;">
<!-- <div class="service-type-btn" v-if="serviceType==null">
<el-button type="primary" style="width:200px;height:120px;" @click="serviceType = 'data'" >在线服务</el-button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<el-button type="primary" style="width:200px;height:120px;" @click="serviceType = 'shp'">数据服务</el-button>
</div> -->
<el-form ref="form" size="mini" :model="addForm" :rules="rules" label-width="140px">
<el-form-item label="站点名称: " prop="name">
<el-input v-model="addForm.name" ></el-input>
</el-form-item>
<el-form-item label="负责人: " prop="url">
<el-input v-model="addForm.url" ></el-input>
</el-form-item>
<el-form-item label="负责人电话: ">
<el-input v-model="addForm.data_service_url" ></el-input>
</el-form-item>
<el-form-item label="站点地址: ">
<el-input v-model="addForm.data_source_name" ></el-input>
</el-form-item>
<el-form-item label="是否有人值守: " prop="">
<el-radio-group v-model="addForm.isshow" >
<el-radio :label="true" ></el-radio>
<el-radio :label="false" ></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否接收进山消息: " prop="data_type">
<el-radio-group v-model="addForm.data_type" >
<el-radio :label="'二维'" ></el-radio>
<el-radio :label="'三维'" ></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="消息接收人员: ">
<el-input v-model="addForm.srid" ></el-input>
</el-form-item>
<el-form-item label="防火提示语: ">
<el-input type="textarea" style="white-space:pre-line;" :autosize="{minRows:10,maxRows:1000}" v-model="addForm.data_description" ></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('form')"></el-button>
<el-button @click="close()"></el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { postMethodCommon, getMethodCommon } from '../../../api/common';
import form from '../../../store/modules/form';
let BASE_IMAGE_URL = BASE_IMAGE_API_URL;
export default {
name:"AddForm",
data(){
return {
BASE_IMAGE_URL:BASE_IMAGE_URL,
addForm:{},
rules:{
name:[
{ required: true, message: '请输入服务名称', trigger: 'blur' },
],
url:[
{ required: true, message: '请输入服务地址', trigger: 'blur' },
],
service_type_id:[
{ required: true, message: '请输入服务类型', trigger: 'blur' },
],
data_type:[
{ required: true, message: '请输入服务类型', trigger: 'blur' },
],
},
coverImage:null,
descImages:[],
bigTypeOptions:[],
serviceTypeOptions:[],
limit:999,
fileList: [],
serviceType:null,
tablenameExists:false,
newServiceId:null,
filename:"",
}
},
created(){
this.getDictionary();
},
methods:{
addSymbol(){
if(window.event.keyCode==13){
// var rawData = $("#"+id).val();
// $("#"+id).val(rawData+"\n");
var textarea = document.getElementById("service_description");
var position = cursorPosition.get(textarea);
cursorPosition.add(textarea, position, "\n");
console.log(this.addForm.data_description);
}
},
checkTableName(){
getMethodCommon("/CimService/IsExistTable",{table:this.addForm.tablename}).then(res=>{
if(res.code == 200){
console.log(res);
this.tablenameExists = res.result;
}
})
},
delImage(type,path,index){
postMethodCommon("/CimService/DeleteFileByPath?paths="+path).then(res=>{
})
if(type == 'coverImage'){
this.coverImage = null;
}
if(type == 'descImage'){
let arr = [];
for(let i=0;i<this.descImages.length;i++){
if(i != index){
arr.push(this.descImages[i])
}
}
this.descImages = arr;
}
},
handleSuccessAfterImage(response,file,fileList){
},
//
handlePictureCardPreviewAfterImage(file) {
console.log('aaa',file)
},
handleExceedAfterImage(files, fileList) {
this.$message.warning(`只能选择一个文件`);
},
//
UploadCoverImage(param){
let formData = new FormData()
formData.append('files', param.file)
let url = BASE_IMAGE_URL + '/api/Platform/Upload?project=CimPlatform';
postMethodCommon(url,formData).then(res =>{
if(res.code == 200){
this.coverImage = {
id:res.result[0].id,
path:res.result[0].filePath
}
}
})
},
UploadDescImage(param){
let formData = new FormData()
formData.append('files', param.file)
let url = BASE_IMAGE_URL + '/api/Platform/Upload?project=CimPlatform';
postMethodCommon(url,formData).then(res =>{
if(res.code == 200){
let obj = {
id:res.result[0].id,
path:res.result[0].filePath
}
this.descImages.push(obj);
}
})
},
bigTypeValueChange(id){
let arr = this.bigTypeOptions.filter((item,index)=>{
return item.id == id;
})
this.addForm.big_type_name = arr[0].name;
},
serviceTypeValueChange(id){
let arr = this.serviceTypeOptions.filter((item,index)=>{
return item.id == id;
})
this.addForm.service_type_name = arr[0].name;
},
submitForm(formName) {
this.fileList.forEach((item,index)=>{
if(index<this.fileList.length-1){
this.filename+=item.name+",";
}else{
this.filename+=item.name
}
})
this.addForm.filename = this.filename;
this.$refs[formName].validate((valid) => {
if (valid) {
// this.createData();
this.addFormData();
} else {
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
createData(){
let _this = this
if(this.fileList.length>0){
let formData = new FormData();
this.fileList.forEach(item => {
formData.append("files", item.raw);
});
if (this.fileList.length === 0) {
this.$message.warning(`请选择上传文件!!`)
return;
}
let url = '/Files/UploadShpFiles?tablename='+this.addForm.tablename;
postMethodCommon(url, formData).then(res => {
if (res.code === 200) {
let importShpFormData = {
filepath: res.result,
tablename: this.addForm.tablename,
serviceid:this.newServiceId
}
this.importShpToDatabase(importShpFormData);
}
})
}else{
this.addFormData();
}
},
//shp
uploadSheFile(){
let _this = this
if(this.fileList.length>0){
let formData = new FormData();
this.fileList.forEach(item => {
formData.append("files", item.raw);
});
if (this.fileList.length === 0) {
this.$message.warning(`请选择上传文件!!`)
return
}
let url = '/Files/UploadShpFiles?tablename='+this.addForm.tablename;
postMethodCommon(url, formData).then(res => {
if (res.code === 200) {
// this.filename = this.fileList
let importShpFormData = {
filepath: res.result,
tablename: this.addForm.tablename,
serviceid:this.newServiceId,
srid: 0
}
this.importShpToDatabase(importShpFormData);
}
})
}else{
return;
}
},
// shp
importShpToDatabase(formData){
postMethodCommon("/CimService/ImportShpData",formData).then(res=>{
if(res.code == 200){
// let updateform = {
// id:this.newServiceId,
// filename:this.filename,
// }
// postMethodCommon("/CimService/AddOrUpdate",updateform).then(response=>{})
this.$emit("addSuccess");
this.$message({
type:"success",
message:"添加服务成功"
})
}else{
this.$emit("addSuccess");
this.$message({
type:"warning",
message:"服务基本信息添加成功导入shp文件失败请重新导入"
})
}
}).catch(e=>{
this.$emit("addSuccess");
this.$message({
type:"warning",
message:"服务基本信息添加成功导入shp文件失败请重新导入"
})
})
},
//
addFormData(){
let _this = this;
_this.addForm.coverImage = this.coverImage;
_this.addForm.descImages = this.descImages;
postMethodCommon("/CimService/AddOrUpdate",this.addForm).then(response=>{
if(response.code == 200){
this.newServiceId = response.serviceid;
_this.addForm.id = response.serviceid;
// shp
if(this.fileList.length>0){
this.uploadSheFile();
}else{
this.$emit("addSuccess");
this.$message({
type:"success",
message:"添加服务成功"
})
}
// this.$emit("addSuccess");
// this.$message({
// type:"success",
// message:""
// })
}
})
},
getDictionary(){
getMethodCommon('/Categorys/LoadList',{typeid: "CIM_SERVICE_TYPE"}).then(res => {
this.serviceTypeOptions = res.result
})
getMethodCommon('/Categorys/LoadList',{typeid: "CIM_SERVICE_BIGTYPE"}).then(res => {
this.bigTypeOptions = res.result
})
},
//
handlePreview(file) {
},
//
handleRemove(file, fileList) {
this.fileList = fileList
},
//
handleSuccess(res, file, fileList) {
this.$message.success('文件上传成功')
},
//
handleExceed(files, fileList) {
this.$message.warning(`只能选择 ${this.limit} 个文件进行上传!!`)
},
//
handleChange(file, fileList) {
// this.form.name = file.name.split(".")[0]
// let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
// let size = file.size / 1024 / 1024;
// if (extension !== 'shp') {
// this.$message.warning('.shp')
// return false
// }
// if (size > 100) {
// this.$message.warning('100M')
// return false
// }
if (file) {
this.fileList = fileList
}
},
//
handleError(err, file, fileList) {
this.$message.error('文件上传失败')
},
beforeUpload(file) {
let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
let size = file.size / 1024 / 1024;
if (extension !== 'shp') {
this.$message.warning('只能上传后缀是.shp的文件')
return false
}
if (size > 100) {
this.$message.warning('文件大小不得超过100M')
return false
}
return true
},
close(){
this.$emit("close");
}
}
}
</script>
<style scoped>
.service-type-btn{
width:100%;
height:180px;
text-align: center;
margin-top:100px;
}
</style>

View File

@ -0,0 +1,568 @@
<template>
<div style="width:100%;height:100%;overflow:auto;padding:0px 23px;">
<!-- <div class="service-type-btn" v-if="serviceType==null">
<el-button type="primary" style="width:200px;height:120px;" @click="serviceType = 'data'" >在线服务</el-button>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<el-button type="primary" style="width:200px;height:120px;" @click="serviceType = 'shp'">数据服务</el-button>
</div> -->
<el-form ref="form" size="mini" :model="addForm" :rules="rules" label-width="140px">
<el-form-item label="服务名称: " prop="name">
<el-input v-model="addForm.name" ></el-input>
</el-form-item>
<el-form-item label="服务地址: " prop="url">
<el-input v-model="addForm.url" ></el-input>
</el-form-item>
<el-form-item label="数据服务地址: ">
<el-input v-model="addForm.data_service_url" ></el-input>
</el-form-item>
<el-form-item label="数据源名称: ">
<el-input v-model="addForm.data_source_name" ></el-input>
</el-form-item>
<el-form-item label="数据集名称: ">
<el-input v-model="addForm.data_set_name" ></el-input>
</el-form-item>
<el-form-item label="所属分类: ">
<el-select v-model="addForm.big_type_id" placeholder="请选择服务类型" @change="bigTypeValueChange">
<el-option v-for="(item,index) in bigTypeOptions" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="表名: " >
<el-input v-model="addForm.tablename" ></el-input>
</el-form-item>
<el-form-item label="数据采集时间: ">
<el-date-picker
v-model="addForm.collecttime"
value-format="yyyy-MM-dd"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="矢量数据: ">
<el-input v-model="addForm.demension" ></el-input>
</el-form-item>
<el-form-item label="服务类型: " prop="service_type_id">
<el-select v-model="addForm.service_type_id" placeholder="请选择服务类型" @change="serviceTypeValueChange">
<el-option v-for="(item,index) in serviceTypeOptions" :key="index" :label="item.name" :value="item.id" ></el-option>
</el-select>
</el-form-item>
<el-form-item label="数据类型: " prop="data_type">
<el-radio-group v-model="addForm.data_type" >
<el-radio :label="'二维'" >二维</el-radio>
<el-radio :label="'三维'" >三维</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="二维矢量数据空间参考: ">
<el-input v-model="addForm.srid" ></el-input>
</el-form-item>
<el-form-item label="上传shp文件" size="mini">
<el-upload
size="mini"
class="upload-demo"
action="#"
drag
:limit="limit"
:on-preview="handlePreview"
:file-list="fileList"
:auto-upload="false"
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-exceed="handleExceed"
:on-change="handleChange"
:on-success="handleSuccess"
:on-error="handleError"
>
<i class="el-icon-upload" style="font-size:30px;line-height:0px;"></i>
<div class="el-upload__text">将Shp文件拖到此处<em>点击上传</em>上传成功后自动替换原有文件
<div style="margin-top:12px;margin-left:180px;" v-if="fileList<=0">
<div class="file-box" v-for="(item,index) in currentFileList" :key="index">
<p style="font-size:20px;color:#999;"><i class="el-icon-document"></i></p>
<p>{{item}}</p>
</div>
</div>
</div>
</el-upload>
</el-form-item>
<el-form-item label="上架服务超市: " prop="">
<el-radio-group v-model="addForm.isshow" >
<el-radio :label="true" ></el-radio>
<el-radio :label="false" ></el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="上传shp文件" size="mini">
<el-upload
size="mini"
class="upload-demo"
action="#"
drag
:limit="limit"
:on-preview="handlePreview"
:file-list="fileList"
:auto-upload="false"
:before-upload="beforeUpload"
:on-remove="handleRemove"
:on-change="handleChange"
:on-success="handleSuccess"
:on-error="handleError"
>
<i class="el-icon-upload" style="font-size:60px;line-height:0px;"></i>
<div class="el-upload__text">将Shp文件拖到此处<em>点击上传</em></div>
</el-upload>
</el-form-item> -->
<el-form-item label="服务描述: ">
<el-input type="textarea" style="white-space:pre-line;" :autosize="{minRows:10,maxRows:1000}" id="service_description" v-model="addForm.data_description"></el-input>
</el-form-item>
<el-form-item label="封面图片: " >
<div class="image-container" style="position:relative;width:150px;float:left;margin-right:12px;" v-if="coverImage!=null">
<div @click="delImage('coverImage',coverImage.path,0)" class="del-btn" style="height:40px;width:40px;text-align:center;line-height:40px;position:absolute;right:8px;top:8px;border-radius:50%;background:rgba(255,255,255,0.4)">
<span><i class="el-icon-delete"></i></span>
</div>
<img :src="BASE_IMAGE_URL+'/'+coverImage.path" alt="" width="150px" height="150px">
</div>
<el-upload
ref="upload"
action="string"
accept=".png,.jpg,.docx,.xlsx,.xls"
list-type="picture-card"
:show-file-list="false"
:on-preview="handlePictureCardPreviewAfterImage"
:on-success="handleSuccessAfterImage"
:on-exceed="handleExceedAfterImage"
:http-request="UploadCoverImage">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="功能描述图片: " >
<div class="image-container" style="position:relative;width:150px;float:left;margin-right:12px;" v-for="(item,index) in descImages" :key="index" >
<div @click="delImage('descImage',item.path,index)" class="del-btn" style="height:40px;width:40px;text-align:center;line-height:40px;position:absolute;right:8px;top:8px;border-radius:50%;background:rgba(255,255,255,0.4)">
<span><i class="el-icon-delete"></i></span>
</div>
<img :src="BASE_IMAGE_URL+'/'+item.path" alt="" width="150px" height="150px">
</div>
<el-upload
ref="upload"
action="string"
accept=".png,.jpg,.docx,.xlsx,.xls"
list-type="picture-card"
:show-file-list="false"
:on-preview="handlePictureCardPreviewAfterImage"
:on-success="handleSuccessAfterImage"
:on-exceed="handleExceedAfterImage"
:http-request="UploadDescImage">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('form')"></el-button>
<el-button @click="close"></el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { postMethodCommon, getMethodCommon } from '../../../api/common';
let BASE_IMAGE_URL = BASE_IMAGE_API_URL;
export default {
name:"AddForm",
props:['id'],
data(){
return {
BASE_IMAGE_URL:BASE_IMAGE_URL,
addForm:{},
rules:{
name:[
{ required: true, message: '请输入服务名称', trigger: 'blur' },
],
url:[
{ required: true, message: '请输入服务地址', trigger: 'blur' },
],
service_type_id:[
{ required: true, message: '请输入服务类型', trigger: 'blur' },
],
data_type:[
{ required: true, message: '请输入服务类型', trigger: 'blur' },
],
},
coverImage:null,
descImages:[],
bigTypeOptions:[],
serviceTypeOptions:[],
limit:999,
fileList: [],
serviceType:null,
currentFileList:[],
filename:"",
}
},
created(){
this.getDictionary();
this.getServiceDetail();
},
methods:{
close(){
this.$emit("close");
},
addSymbol(){
// if(window.event.keyCode==13){
// var rawData = $("#"+id).val();
// $("#"+id).val(rawData+"\n");
var textarea = document.getElementById("service_description");
var position = cursorPosition.get(textarea);
cursorPosition.add(textarea, position, "\n");
console.log(this.addForm.data_description);
// }
},
getServiceDetail(){
postMethodCommon("/CimService/GetServiceById?id="+this.id).then(res=>{
if(res.code == 200){
this.addForm = res.result;
if(this.addForm.filename){
this.currentFileList = this.addForm.filename.split(",");
}
console.log("currentFileList",this.currentFileList);
if(res.result.cover_img!=null){
this.coverImage = {
id: res.result.cover_img.id,
path:res.result.cover_img.path
}
}else{
// this.coverImage = {
// id:"",
// path:""
// }
}
res.result.desc_imgs.forEach((item,index)=>{
console.log("item",item);
let obj = {
id:item.id,
path:item.path
}
this.descImages.push(obj);
})
console.log(this.descImages);
}
})
},
delImage(type,path,index){
postMethodCommon("/CimService/DeleteFileByPath",[path]).then(res=>{
console.log(res);
})
if(type == 'coverImage'){
this.coverImage = null;
}
if(type == 'descImage'){
let arr = [];
for(let i=0;i<this.descImages.length;i++){
if(i != index){
arr.push(this.descImages[i])
}
}
this.descImages = arr;
}
},
handleSuccessAfterImage(response,file,fileList){
},
//
handlePictureCardPreviewAfterImage(file) {
console.log('aaa',file)
},
handleExceedAfterImage(files, fileList) {
this.$message.warning(`只能选择一个文件`);
},
//
UploadCoverImage(param){
let formData = new FormData()
formData.append('files', param.file)
// let url ='/Files/Upload'
let url = BASE_IMAGE_URL + '/api/Platform/Upload?project=CimPlatform';
postMethodCommon(url,formData).then(res =>{
if(res.code == 200){
this.coverImage = {
id:res.result[0].id,
path:res.result[0].filePath
}
}
})
},
UploadDescImage(param){
let formData = new FormData()
formData.append('files', param.file)
let url = BASE_IMAGE_URL + '/api/Platform/Upload?project=CimPlatform';
postMethodCommon(url,formData).then(res =>{
if(res.code == 200){
let obj = {
id:res.result[0].id,
path:res.result[0].filePath
}
this.descImages.push(obj);
}
})
},
bigTypeValueChange(id){
let arr = this.bigTypeOptions.filter((item,index)=>{
return item.id == id;
})
this.addForm.big_type_name = arr[0].name;
},
serviceTypeValueChange(id){
let arr = this.serviceTypeOptions.filter((item,index)=>{
return item.id == id;
})
this.addForm.service_type_name = arr[0].name;
},
submitForm(formName) {
if(this.fileList.length>0){
this.fileList.forEach((item,index)=>{
if(index<this.fileList.length-1){
this.filename+=item.name+",";
}else{
this.filename+=item.name
}
})
this.addForm.filename = this.filename;
}
this.$refs[formName].validate((valid) => {
if (valid) {
// this.createData();
this.editFormData();
} else {
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
//
editFormData(){
let _this = this;
// _this.addForm.coverImage = this.coverImage;
// _this.addForm.descImages = this.descImages;
_this.addForm.coverImage = this.coverImage;
_this.addForm.descImages = this.descImages;
delete _this.addForm.cover_img;
delete _this.addForm.desc_imgs;
postMethodCommon("/CimService/AddOrUpdate",this.addForm).then(response=>{
if(response.code == 200){
this.newServiceId = response.serviceid;
// shp
if(this.fileList.length>0){
this.uploadSheFile();
}else{
this.$emit("editSuccess");
this.$message({
type:"success",
message:"编辑服务成功"
})
}
}
})
},
//shp
uploadSheFile(){
let _this = this
console.log("filelist",this.fileList);
if(this.fileList.length>0){
let formData = new FormData();
this.fileList.forEach(item => {
formData.append("files", item.raw);
});
if (this.fileList.length === 0) {
this.$message.warning(`请选择上传文件!!`)
return
}
let url = '/Files/UploadShpFiles?tablename='+this.addForm.tablename;
postMethodCommon(url, formData).then(res => {
if (res.code === 200) {
let importShpFormData = {
filepath: res.result,
tablename: this.addForm.tablename,
serviceid:this.addForm.id,
// srid: 0
}
this.importShpToDatabase(importShpFormData);
}
})
}else{
return;
}
},
// shp
importShpToDatabase(formData){
postMethodCommon("/CimService/ImportShpData",formData).then(res=>{
if(res.code == 200){
this.$emit("editSuccess");
this.$message({
type:"success",
message:"更新服务成功"
})
}
})
},
createData(){
let _this = this
if(this.fileList.length>0){
let formData = new FormData();
this.fileList.forEach(item => {
formData.append("files", item.raw);
});
if (this.fileList.length === 0) {
this.$message.warning(`请选择上传文件!!`)
return
}
let url = `/Files/Upload`
postMethodCommon(url, formData).then(res => {
if (res.code === 200) {
_this.addForm.filepath = res.result[0].filePath
_this.addForm.coverImage = this.coverImage;
_this.addForm.descImages = this.descImages;
delete _this.addForm.cover_img;
delete _this.addForm.desc_imgs;
postMethodCommon("/CimService/AddOrUpdate",this.addForm).then(response=>{
if(response.code == 200){
this.$emit("editSuccess");
this.$message({
type:"success",
message:"更新服务成功"
})
}
})
}
})
}else{
_this.addForm.coverImage = this.coverImage;
_this.addForm.descImages = this.descImages;
delete _this.addForm.cover_img;
delete _this.addForm.desc_imgs;
postMethodCommon("/CimService/AddOrUpdate",this.addForm).then(response=>{
if(response.code == 200){
this.$emit("editSuccess");
this.$message({
type:"success",
message:"修改服务成功"
})
}
})
}
},
getDictionary(){
getMethodCommon('/Categorys/LoadList',{typeid: "CIM_SERVICE_TYPE"}).then(res => {
this.serviceTypeOptions = res.result
})
getMethodCommon('/Categorys/LoadList',{typeid: "CIM_SERVICE_BIGTYPE"}).then(res => {
this.bigTypeOptions = res.result
})
},
//
handlePreview(file) {
},
//
handleRemove(file, fileList) {
this.fileList = fileList
},
//
handleSuccess(res, file, fileList) {
this.$message.success('文件上传成功')
},
//
handleExceed(files, fileList) {
this.$message.warning(`只能选择 ${this.limit} 个文件进行上传!!`)
},
//
handleChange(file, fileList) {
// this.form.name = file.name.split(".")[0]
// let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
// let size = file.size / 1024 / 1024;
// if (extension !== 'shp') {
// this.$message.warning('.shp')
// return false
// }
// if (size > 100) {
// this.$message.warning('100M')
// return false
// }
/*
*/
if (file) {
this.fileList = fileList
}
},
//
handleError(err, file, fileList) {
this.$message.error('文件上传失败')
},
beforeUpload(file) {
let extension = file.name.substring(file.name.lastIndexOf('.') + 1)
let size = file.size / 1024 / 1024;
if (extension !== 'shp') {
this.$message.warning('只能上传后缀是.shp的文件')
return false
}
if (size > 100) {
this.$message.warning('文件大小不得超过100M')
return false
}
return true
}
}
}
</script>
<style scoped>
.service-type-btn{
width:100%;
height:180px;
text-align: center;
margin-top:100px;
}
.file-box{
width:150px;
float:left;
text-align:center;
}
::v-deep .el-upload-dragger{
width:826px;
}
</style>

View File

@ -0,0 +1,92 @@
<template>
<div style="width:100%;height:100%;overflow:auto;padding:0px 23px;">
<el-descriptions class="margin-top" title="" :column="2" size="large" border>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
人员姓名
</template>
{{detailInfo.userName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-user"></i>
身份证号
</template>
{{detailInfo.cardNo}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-mobile-phone"></i>
电话
</template>
{{detailInfo.phone}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-time"></i>
进山时间
</template>
{{detailInfo.inTime}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-map-location"></i>
登记站点
</template>
{{detailInfo.siteName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
<i class="el-icon-edit-outline"></i>
登记方式
</template>
{{detailInfo.inTypeName}}
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<script>
import { postMethodCommon, getMethodCommon } from '../../../api/common';
import form from '../../../store/modules/form';
let BASE_IMAGE_URL = BASE_IMAGE_API_URL;
export default {
name:"AddForm",
components:{
},
props:['detailInfo'],
data(){
return {
lngLat:[117.92214891969796,35.26152309532066],
}
},
created(){
},
methods:{
}
}
</script>
<style scoped>
.service-type-btn{
width:100%;
height:180px;
text-align: center;
margin-top:100px;
}
.monitor{
width:100%;
height:420px;
}
.margin-top{
margin-top:12px;
}
</style>

View File

@ -0,0 +1,118 @@
<template>
<div class="monitorMapContainer" id="monitorMapContainer">
</div>
</template>
<script>
// import appConfig from "../../../../public/config.json"
let appConfig = {};
export default {
name:"Map",
props:["lngLat"],
data(){
return {
globalMap:null,
}
},
mounted(){
this.initMap();
},
methods:{
initMap(){
let _this = this;
this.$mapboxgl.accessToken = "pk.eyJ1Ijoic2hpY2hhbzEyMyIsImEiOiJja3FobnI1aDEwNGF6Mm9vOXVhNnBzZmFhIn0.2fZKiMqCQHxVY74QShMEGQ";
this.globalMap = new this.$mapboxgl.Map({
container: 'monitorMapContainer',
zoom: 15.1,
pitch:15,
style: {
glyphs: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf",
"version": 8,
"sources": {
"raster-tiles": {
"type": "raster",
"tiles": ['http://t0.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk='+appConfig.appInfo.tiandituKey],
"tileSize": 256,
},
"raster-tiles-l": {
"type": "raster",
"tiles": ['http://t0.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk='+appConfig.appInfo.tiandituKey],
"tileSize": 256,
}
},
"layers": [
{
"id": "tdt-img-tiles",
"type": "raster",
"source": "raster-tiles",
"minzoom": 0,
"maxzoom": 22
},
{
"id": "tdt-img-tiles-l",
"type": "raster",
"source": "raster-tiles-l",
"minzoom": 0,
"maxzoom": 22
}
]
},
maxZoom: 22,
minZoom: 5,
center:_this.lngLat,
})
this.globalMap.on("load",()=>{
_this.addIconLayer();
})
},
addIconLayer(){
let _this = this;
this.globalMap.loadImage('/image/jianchazhan.png', (error, image) => {
_this.globalMap.addImage('iocnImage', image);
});
this.globalMap.addSource('iconSource', {
type: 'geojson',
data: {
"type": "FeatureCollection",
"features":[
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": _this.lngLat
}
}
]
}
});
this.globalMap.addLayer({
'id': 'iconLayer',
'type': 'symbol',
'source': 'iconSource',
'layout': {
'icon-allow-overlap': true,
'icon-image':"iocnImage",
'icon-size': 0.2,
"text-field":"防火站点",
"text-size":12,
"text-offset":[0,2],
},
paint: {
"text-color": "#fff"
}
});
}
}
}
</script>
<style scoped>
.monitorMapContainer{
width:100%;
height:100%;
}
</style>

View File

@ -0,0 +1,94 @@
<template>
<div>
<el-table ref="mainTable2" :data="tableData" border fit
highlight-current-row style="width:780px;" height="640px" @selection-change="handleSelectionChange" :row-key="getRowKeys">
<el-table-column type="selection" align="center" width="55" :reserve-selection="true">
</el-table-column>
<el-table-column prop="name" label="角色名称" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="status" label="状态" show-overflow-tooltip>
<template slot-scope="scope">{{scope.row.status == 0 ? '正常':'停用'}}</template>
</el-table-column>
</el-table>
<el-button type="primary" size="mini" @click="submit"></el-button>
</div>
</template>
<script>
import { getMethodCommon,postMethodCommon} from '../../../api/common'
export default {
name:"SelectRoles",
props:['serviceId'],
data(){
return {
tableData:[],
multipleSelection:[],
}
},
created(){
this.getRoles();
},
methods:{
getRolesById(){
postMethodCommon("/CimService/GetRoleByServiceId?ServiceId="+this.serviceId).then(res=>{
if(res.code == 200){
let _this = this;
res.result.forEach((item,index)=>{
_this.$nextTick(()=>{
// let arr = _this.tableData.find(row=>{
// return row.id == item.id;
// })
_this.$refs.mainTable2.toggleRowSelection(_this.tableData.find(row=>{
return row.id == item.id;
}),true);
})
})
}
})
},
getRoles(){
getMethodCommon("/roles/load").then(res=>{
this.tableData = res.result;
this.getRolesById();
})
},
getRowKeys(row){
return row.id
},
handleSelectionChange(val){
this.multipleSelection = val;
},
submit(){
let formData ={
isRoleService:true,
roleServices:[],
};
this.multipleSelection.forEach((item,index)=>{
let obj = {
roleId:item.id,
serviceId:this.serviceId,
description:"",
}
formData.roleServices.push(obj);
})
postMethodCommon("/CimService/AddRoleService",formData).then(res=>{
if(res.code == 200){
this.$message({
type:"success",
message:"绑定成功",
})
this.$emit("serviceSuccess");
}
})
}
}
}
</script>