关键监测中心、数据中心、站点管理
parent
cfde67f531
commit
87cc93a3aa
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<div class="mapContainer" id="mapContainer">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import appConfig from "../../../public/config.json"
|
||||
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: 'mapContainer',
|
||||
zoom: 15.1,
|
||||
pitch:15,
|
||||
style:"mapbox://styles/mapbox/satellite-v9",
|
||||
// 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('/img/center.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.15,
|
||||
"text-field":"防火站点",
|
||||
"text-size":12,
|
||||
"text-offset":[0,2],
|
||||
},
|
||||
paint: {
|
||||
"text-color": "#fff"
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.mapContainer{
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -75,6 +75,11 @@ export const constantRouterMap = [
|
|||
name: 'gridman_record',
|
||||
meta: { title: '进山记录', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
|
||||
component: () => import('@/views/gridman/record/index')
|
||||
},{
|
||||
path: '/gridman_site',
|
||||
name: 'gridman_site',
|
||||
meta: { title: '站点管理', icon: 'zhuyeicon', sortNo: 0 }, // iconfont icon-
|
||||
component: () => import('@/views/gridman/site/index')
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
top:140,
|
||||
},{
|
||||
lable:"站点管理",
|
||||
url:"",
|
||||
url:"/gridman_site",
|
||||
top:90,
|
||||
},{
|
||||
lable:"网格员",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,772 @@
|
|||
<template>
|
||||
<div class="site-content">
|
||||
|
||||
<sticky :className="'sub-navbar'">
|
||||
<div class="filter-container">
|
||||
<el-select v-model="listQuery.state" clearable placeholder="审核状态" size="mini" @change="stateChange">
|
||||
<el-option v-for="item in states" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<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.siteName">
|
||||
</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="fh">
|
||||
<el-table ref="mainTable" :key='tableKey' :data="tableData" v-loading="listLoading" border fit
|
||||
highlight-current-row style="width: 100%;" height="calc(100% - 112px)" @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="siteName" label="站点名称" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="siteAddress" label="站点地址" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="state" label="审核状态" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.state == '未审核'? 'warning': (scope.row.state == '审核通过' ? 'success':'danger')"
|
||||
size="mini">{{scope.row.state}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="director" label="负责人" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="phone" label="负责人电话" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="'操作'" style="text-align:center;" width="180px">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="mini" icon="" @click="signelEdit(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="1066px" height="690px" top=" calc(50vh - 340px)" 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:1050px;height:690px;overflow-y:hidden;">
|
||||
<el-container v-if="addServiceVisible">
|
||||
<AddForm @addSuccess="addSuccess" :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 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: {
|
||||
permissionBtn,
|
||||
Pagination,
|
||||
AddForm,
|
||||
EditForm,
|
||||
SelectRoles
|
||||
// elDragDialog
|
||||
},
|
||||
mixins: [extend],
|
||||
directives: {
|
||||
waves,
|
||||
elDragDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
states: [
|
||||
{
|
||||
value: 0,
|
||||
label: "未审核",
|
||||
}, {
|
||||
value: 1,
|
||||
label: "审核通过",
|
||||
}, {
|
||||
value: 2,
|
||||
label: "未通过",
|
||||
}, {
|
||||
value: 3,
|
||||
label: "全部",
|
||||
}
|
||||
],
|
||||
tableData: [],
|
||||
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,
|
||||
state: 3,
|
||||
siteName: 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.getList()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
this.$router.push({ 'path': '/gridman' })
|
||||
},
|
||||
resetListQuery() {
|
||||
this.listQuery.state = 3;
|
||||
this.listQuery.siteName = null;
|
||||
this.getList();
|
||||
},
|
||||
stateChange(e) {
|
||||
this.listQuery.state = e;
|
||||
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.$message({
|
||||
type: "success",
|
||||
message: "审核成功!"
|
||||
})
|
||||
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("/FireCodePC/LoadAllSite", this.listQuery).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.tableData = res.data
|
||||
this.tableData.forEach((item, index) => {
|
||||
switch (item.state) {
|
||||
case 0: this.tableData[index].state = "未审核";
|
||||
break;
|
||||
case 1: this.tableData[index].state = "审核通过";
|
||||
break;
|
||||
case 2: this.tableData[index].state = "未通过";
|
||||
break;
|
||||
case 3: this.tableData[index].state = "全部";
|
||||
break;
|
||||
}
|
||||
})
|
||||
this.total = res.count
|
||||
this.listLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.pageIndex = 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;
|
||||
},
|
||||
signelEdit(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" scoped>
|
||||
::v-deep .dialog-mini .el-dialog__header {
|
||||
background: rgba(10,39,78, 1);
|
||||
}
|
||||
|
||||
::v-deep .dialog-mini .el-dialog__header .el-dialog__title {
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
::v-deep .el-descriptions__body {
|
||||
background: rgba(0, 9, 34, 1);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-descriptions-item__label.is-bordered-label {
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-input__inner {
|
||||
background: rgba(0, 9, 34, 1);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-dialog {
|
||||
background: rgba(10,39,78, 1);
|
||||
|
||||
}
|
||||
|
||||
::v-deep .el-loading-mask {
|
||||
background: rgba(0, 9, 34, 0.9);
|
||||
|
||||
}
|
||||
|
||||
.filter-container {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.site-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url(/img/gridman/bg.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.site-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;
|
||||
}
|
||||
|
||||
.header-btn {
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
top: 4%;
|
||||
left: 2%;
|
||||
}
|
||||
|
||||
.site-content {
|
||||
width: 100%;
|
||||
height: 86%;
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
}
|
||||
|
||||
.app-container {
|
||||
height: 100%;
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
}
|
||||
|
||||
::v-deep .el-table {
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
border-left: 1px solid #00EDE8;
|
||||
}
|
||||
|
||||
::v-deep .el-table .el-table__body tr:hover td {
|
||||
background: rgba(24, 77, 143, 0.4) !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
::v-deep .el-table .el-table__body tr.current-row td {
|
||||
cursor: pointer;
|
||||
background: rgba(24, 77, 143, 0.4) !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table tr {
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
border: none;
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
::v-deep .el-table th.el-table__cell {
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
color: #fff;
|
||||
border: 1px solid #00EDE8;
|
||||
|
||||
}
|
||||
|
||||
::v-deep .el-pagination__total,
|
||||
.el-pagination__jump {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-table td.el-table__cell,
|
||||
.el-table th.el-table__cell.is-leaf {
|
||||
border-bottom: 1px solid #00EDE8;
|
||||
}
|
||||
|
||||
::v-deep .el-table--border .el-table__cell,
|
||||
.el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed {
|
||||
border-right: 1px solid #00EDE8;
|
||||
}
|
||||
|
||||
::v-deep .pagination-container {
|
||||
background: rgba(0, 9, 34, 0.6) !important;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.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>
|
||||
|
|
@ -0,0 +1,399 @@
|
|||
<template>
|
||||
<div style="width:100%;height:100%;overflow:auto;padding:0px 23px; background: rgba(0, 9, 34, 0.6);">
|
||||
<!-- <div class="service-type-btn" v-if="serviceType==null">
|
||||
<el-button type="primary" style="width:200px;height:120px;" @click="serviceType = 'data'" >在线服务</el-button>
|
||||
|
||||
<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 = process.env.VUE_APP_BASE_IMG_URL;
|
||||
// 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>
|
||||
|
|
@ -0,0 +1,570 @@
|
|||
<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>
|
||||
|
||||
<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;
|
||||
let BASE_IMAGE_URL = process.env.VUE_APP_BASE_IMG_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>
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
<template>
|
||||
<div style="width:100%;height:100%;overflow:auto;padding:0px 23px;">
|
||||
<el-descriptions class="margin-top" title="" :column="2" size="mini" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
站点名称
|
||||
</template>
|
||||
{{detailInfo.siteName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-user"></i>
|
||||
站点状态
|
||||
</template>
|
||||
<el-tag :type="detailInfo.state == '未审核'? 'warning': (detailInfo.state == '审核通过' ? 'success':'danger')" size="mini">{{detailInfo.state}}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-mobile-phone"></i>
|
||||
负责人
|
||||
</template>
|
||||
{{detailInfo.director}}
|
||||
</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-office-building"></i>
|
||||
是否有人值守
|
||||
</template>
|
||||
<el-tag size="mini" v-if="detailInfo.isonduty">是</el-tag>
|
||||
<el-tag size="mini" type="danger" v-else>否</el-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<i class="el-icon-office-building"></i>
|
||||
是否接收进山消息推送
|
||||
</template>
|
||||
<el-tag size="mini" v-if="detailInfo.isreceive">是</el-tag>
|
||||
<el-tag size="mini" type="danger" v-else>否</el-tag>
|
||||
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
站点图片
|
||||
</template>
|
||||
{{detailInfo.siteImg}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
站点地址
|
||||
</template>
|
||||
{{detailInfo.siteAddress}}
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions class="margin-top" title="" style="margin-top:15px;" :column="4" size="mini" border>
|
||||
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
站点地址
|
||||
</template>
|
||||
<div class="position">
|
||||
<Map :lngLat="lngLat"></Map>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-descriptions class="margin-top" title="" style="margin-top:15px;" :column="3" size="mini" border>
|
||||
<el-descriptions-item>
|
||||
<template slot="label">
|
||||
<div style="min-width:160px;">
|
||||
<i class="el-icon-tickets"></i>
|
||||
接收消息人员
|
||||
</div>
|
||||
</template>
|
||||
<el-table
|
||||
border
|
||||
:data="userlist"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="人员名称"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="account"
|
||||
label="手机号"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div style="margin-top:15px;">
|
||||
<el-input placeholder="审核说明" v-model="form.content" style="width:calc( 100% - 140px);margin-right:15px;" size="mini"></el-input>
|
||||
<el-button type="danger" size="mini" @click="examine(2)">拒绝</el-button>
|
||||
<el-button type="success" size="mini" @click="examine(1)">通过</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { postMethodCommon, getMethodCommon } from '../../../../api/common';
|
||||
import form from '../../../../store/modules/form';
|
||||
let BASE_IMAGE_URL = process.env.VUE_APP_BASE_IMG_URL;
|
||||
|
||||
import Map from '@/components/mapbox/Map.vue';
|
||||
|
||||
export default {
|
||||
name:"AddForm",
|
||||
components:{
|
||||
Map,
|
||||
},
|
||||
props:["detailInfo"],
|
||||
data(){
|
||||
return {
|
||||
form:{
|
||||
siteId:null,
|
||||
state:null,
|
||||
content:null,
|
||||
},
|
||||
lngLat:null,
|
||||
userlist:[]
|
||||
}
|
||||
},
|
||||
created(){
|
||||
console.log(process.env.VUE_APP_BASE_IMG_URL)
|
||||
this.form.siteId = this.detailInfo.id;
|
||||
this.form.content = this.detailInfo.stateContent
|
||||
let transformAfter = this.transformGCJ2WGS(this.detailInfo.lat,this.detailInfo.lng)
|
||||
this.lngLat = [transformAfter.lon,transformAfter.lat];
|
||||
|
||||
this.getUserList();
|
||||
},
|
||||
methods:{
|
||||
examine(state){
|
||||
this.form.state = state;
|
||||
console.log(this.form);
|
||||
postMethodCommon("/FireCodePC/AuditSite?siteId="+this.form.siteId+"&state="+this.form.state+"&content="+this.form.content).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.$emit("addSuccess")
|
||||
}
|
||||
})
|
||||
},
|
||||
getUserList(){
|
||||
getMethodCommon("/FireCodeApp/LoadSiteUser",{siteId:this.detailInfo.id,userRole:2,pageIndex:1,pageSize:10000}).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.userlist = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
transformGCJ2WGS(gcjLat, gcjLon) {
|
||||
let d = this.delta(gcjLat, gcjLon)
|
||||
return {
|
||||
'lat': gcjLat - d.lat,
|
||||
'lon': gcjLon - d.lon
|
||||
}
|
||||
},
|
||||
delta(lat, lon) {
|
||||
var PI = 3.14159265358979324;
|
||||
let a = 6378245.0 // a: 卫星椭球坐标投影到平面地图坐标系的投影因子。
|
||||
let ee = 0.00669342162296594323 // ee: 椭球的偏心率。
|
||||
let dLat = this.transformLat(lon - 105.0, lat - 35.0)
|
||||
let dLon = this.transformLon(lon - 105.0, lat - 35.0)
|
||||
let radLat = lat / 180.0 * PI
|
||||
let magic = Math.sin(radLat)
|
||||
magic = 1 - ee * magic * magic
|
||||
let sqrtMagic = Math.sqrt(magic)
|
||||
dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * PI)
|
||||
dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * PI)
|
||||
return {
|
||||
'lat': dLat,
|
||||
'lon': dLon
|
||||
}
|
||||
},
|
||||
transformLat(x, y) {
|
||||
var PI = 3.14159265358979324;
|
||||
let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x))
|
||||
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0
|
||||
ret += (20.0 * Math.sin(y * PI) + 40.0 * Math.sin(y / 3.0 * PI)) * 2.0 / 3.0
|
||||
ret += (160.0 * Math.sin(y / 12.0 * PI) + 320 * Math.sin(y * PI / 30.0)) * 2.0 / 3.0
|
||||
return ret
|
||||
},
|
||||
transformLon(x, y) {
|
||||
var PI = 3.14159265358979324;
|
||||
let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x))
|
||||
ret += (20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0 / 3.0
|
||||
ret += (20.0 * Math.sin(x * PI) + 40.0 * Math.sin(x / 3.0 * PI)) * 2.0 / 3.0
|
||||
ret += (150.0 * Math.sin(x / 12.0 * PI) + 300.0 * Math.sin(x / 30.0 * PI)) * 2.0 / 3.0
|
||||
return ret
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.service-type-btn{
|
||||
width:100%;
|
||||
height:180px;
|
||||
text-align: center;
|
||||
margin-top:100px;
|
||||
}
|
||||
|
||||
.position{
|
||||
width:900px;
|
||||
height:320px;
|
||||
}
|
||||
|
||||
::v-deep a.mapboxgl-ctrl-logo{
|
||||
display:none!important;
|
||||
}
|
||||
|
||||
::v-deep .mapboxgl-ctrl-attrib-inner{
|
||||
display:none!important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -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>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="body">
|
||||
<p class="tip">控制台</p>
|
||||
<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="goDetail(item)">
|
||||
<div class="item-icon">
|
||||
<img class="top-img" :src="'/img/navigation/top-'+(index+1)+'.png'" alt="">
|
||||
<img class="bottom-img" :src="'/img/navigation/bottom-'+(index+1)+'.png'" alt="">
|
||||
|
|
@ -66,12 +66,12 @@
|
|||
},{
|
||||
lable:"监测中心",
|
||||
icon:"",
|
||||
url:"",
|
||||
url:"http://60.213.14.14:6088/forestry/",
|
||||
bgColor:"linear-gradient(180deg, #FEA887 0%, #EF3E70 100%)"
|
||||
},{
|
||||
lable:"数据中心",
|
||||
icon:"",
|
||||
url:"http://223.99.16.253:9003/",
|
||||
url:"http://223.99.16.253:9003/#/dashboard?id="+ localStorage.getItem("X-Token"),
|
||||
bgColor:"linear-gradient(180deg, #E0FF13 0%, #086D3C 100%)"
|
||||
},{
|
||||
lable:"管理中心",
|
||||
|
|
@ -81,7 +81,18 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goDetail(item) {
|
||||
if (item.lable == '数据中心') {
|
||||
window.open('http://223.99.16.253:9003/#/dashboard?id=' + localStorage.getItem("X-Token"), '_blank')
|
||||
}else if (item.lable == '监测中心') {
|
||||
window.open('http://60.213.14.14:6088/forestry/', '_blank')
|
||||
} else {
|
||||
this.$router.push({ 'path': item.url })
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue