单位管理、消息通知、影像更换、BUG修改、导航修改
parent
f77ab8a826
commit
244fae7844
12
.env.dev
12
.env.dev
|
|
@ -4,8 +4,16 @@ NODE_ENV = development
|
|||
#VUE_APP_BASE_API =http://221.2.83.254:9001/api
|
||||
#VUE_APP_BASE_IMG_URL =http://221.2.83.254:9001
|
||||
|
||||
VUE_APP_BASE_API =http://60.217.22.180:9001/api
|
||||
VUE_APP_BASE_IMG_URL =http://60.217.22.180:9001
|
||||
#VUE_APP_BASE_API =http://60.217.22.153:9001/api
|
||||
#VUE_APP_BASE_IMG_URL =http://60.217.22.153:9001
|
||||
|
||||
# VUE_APP_BASE_API =http://60.217.22.153:9001/api
|
||||
# VUE_APP_BASE_IMG_URL =http://60.217.22.153:9001
|
||||
|
||||
VUE_APP_BASE_API =http://192.168.10.125:85/api
|
||||
VUE_APP_BASE_IMG_URL =http://192.168.10.125:85
|
||||
VUE_APP_GEOSERVER_URL = http://60.217.22.153:9007/
|
||||
|
||||
# 测试服务区
|
||||
#VUE_APP_BASE_API = http://123.132.248.154:9224/api
|
||||
#VUE_APP_BASE_IMG_URL = http://123.132.248.154:9224
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
NODE_ENV = production
|
||||
|
||||
# 正式服务器
|
||||
VUE_APP_BASE_API =http://60.217.22.180:9001/api
|
||||
VUE_APP_BASE_IMG_URL =http://60.217.22.180:9001
|
||||
#VUE_APP_BASE_API =http://60.217.22.153:9001/api
|
||||
#VUE_APP_BASE_IMG_URL =http://60.217.22.153:9001
|
||||
|
||||
VUE_APP_BASE_API =http://60.217.22.153:9001/api
|
||||
VUE_APP_BASE_IMG_URL =http://60.217.22.153:9001
|
||||
VUE_APP_GEOSERVER_URL = http://60.217.22.153:9007/
|
||||
|
||||
# 测试服务区
|
||||
# VUE_APP_BASE_API = http://123.132.248.154:9224/api
|
||||
# VUE_APP_BASE_IMG_URL = http://123.132.248.154:9224
|
||||
|
|
@ -47,6 +47,7 @@
|
|||
"vue-json-excel": "^0.2.98",
|
||||
"vue-layer": "^0.9.14",
|
||||
"vue-multiselect": "^2.1.6",
|
||||
"vue-qr": "^4.0.9",
|
||||
"vue-router": "3.0.1",
|
||||
"vue-video-player": "^5.0.2",
|
||||
"vuedraggable": "^2.23.2",
|
||||
|
|
|
|||
|
|
@ -28,14 +28,14 @@
|
|||
"feixian":{
|
||||
"appname":"沂水县智慧林业防灭火平台",
|
||||
"area":"沂水县",
|
||||
"baseUrl":"http://60.217.22.180:9001",
|
||||
"layerurl":"http://60.217.22.180:9006/applicationMars/getApplicationInfo/yishuixian",
|
||||
"baseUrl":"http://60.217.22.153:9001",
|
||||
"layerurl":"http://60.217.22.153:9006/applicationMars/getApplicationInfo/yishuixian",
|
||||
"uavWebSocketUrl":"ws://123.132.248.154:9211/",
|
||||
"map":{
|
||||
"center":[],
|
||||
"zoom":null
|
||||
},
|
||||
"waterUrl":"http://60.217.22.180:9007/geoserver/ksp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ksp%3Aqushuidian&maxFeatures=50000&outputFormat=application%2Fjson",
|
||||
"waterUrl":"http://60.217.22.153:9007/geoserver/ksp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ksp%3Aqushuidian&maxFeatures=50000&outputFormat=application%2Fjson",
|
||||
"goodsUrl":"",
|
||||
"tools":{
|
||||
"routebox":true,
|
||||
|
|
@ -51,14 +51,14 @@
|
|||
"yishuixian":{
|
||||
"appname":"沂水县智慧林业防灭火平台",
|
||||
"area":"沂水县",
|
||||
"baseUrl":"http://60.217.22.180:9001",
|
||||
"layerurl":"http://60.217.22.180:9006/applicationMars/getApplicationInfo/yishuixian",
|
||||
"baseUrl":"http://60.217.22.153:9001",
|
||||
"layerurl":"http://60.217.22.153:9006/applicationMars/getApplicationInfo/yishuixian",
|
||||
"uavWebSocketUrl":"ws://123.132.248.154:9211/",
|
||||
"map":{
|
||||
"center":[],
|
||||
"zoom":null
|
||||
},
|
||||
"waterUrl":"http://60.217.22.180:9007/geoserver/ksp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ksp%3Aqushuidian&maxFeatures=50000&outputFormat=application%2Fjson",
|
||||
"waterUrl":"http://60.217.22.153:9007/geoserver/ksp/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ksp%3Aqushuidian&maxFeatures=50000&outputFormat=application%2Fjson",
|
||||
"goodsUrl":"",
|
||||
"tools":{
|
||||
"routebox":true,
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@
|
|||
"pid": 10,
|
||||
"name": "最新高清影像",
|
||||
"type": "wms",
|
||||
"url": "http://175.27.168.120:8080/geoserver/feixianfanghuo/wms",
|
||||
"layers": "feixianfanghuo:feixianfanghuo",
|
||||
"url": "http://60.217.22.153:9007/geoserver/yishui/wms",
|
||||
"layers": "yishui:yingxiang",
|
||||
"crs": "EPSG:4326",
|
||||
"parameters": {
|
||||
"transparent": "true",
|
||||
|
|
@ -124,7 +124,15 @@
|
|||
"mapSplit": false,
|
||||
"noCenter": true,
|
||||
"show": false
|
||||
}
|
||||
},{
|
||||
"pid": 10,
|
||||
"name": "天地图注记",
|
||||
"icon": "img/basemaps/tdt_vec.png",
|
||||
"type": "group",
|
||||
"layers": [
|
||||
{ "name": "注记", "type": "tdt", "layer": "vec_z" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"layers": [
|
||||
{
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -13,7 +13,7 @@
|
|||
import Vue from "vue";
|
||||
import axios from "axios";
|
||||
import AppInfo from "../../../public/config/app.json";
|
||||
|
||||
let GEOSERVER_BASE_API = process.env.VUE_APP_GEOSERVER_URL;
|
||||
// 为了方便使用,绑定到原型链,在其他vue文件,直接 this.mars3d 来使用
|
||||
Vue.prototype.mars3d = window.mars3d;
|
||||
Vue.prototype.Cesium = mars3d.Cesium;
|
||||
|
|
@ -82,9 +82,23 @@ export default {
|
|||
item.children.forEach((it, idx) => {
|
||||
let attribute = JSON.parse(it.attribute);
|
||||
attribute.pid = group.id;
|
||||
|
||||
if(attribute.type == "geojson"){
|
||||
delete attribute.symbol.styleOptions.opacity
|
||||
delete attribute.symbol.styleOptions.color
|
||||
}
|
||||
|
||||
let ipinfo = this.matchHttpIpPort(attribute.url);
|
||||
if(ipinfo){ // 如果匹配得到则替换为配置文件中的
|
||||
attribute.url = attribute.url.replace(ipinfo[0],GEOSERVER_BASE_API);
|
||||
}else{ //如果没有匹配到则直接拼接
|
||||
attribute.url = GEOSERVER_BASE_API+attribute.url
|
||||
}
|
||||
|
||||
configLayers.unshift(attribute);
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
data.map3d.layers = configLayers;
|
||||
this.initMars3d(data.map3d);
|
||||
|
|
@ -95,7 +109,8 @@ export default {
|
|||
}finally{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// this.initMars3d(data.map3d)// 构建地图
|
||||
});
|
||||
}
|
||||
|
|
@ -107,6 +122,14 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
matchHttpIpPort(url) { // 匹配“ http://ip:port ”
|
||||
const ipRegex = /^http\:\/\/\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b\:\b[0-9]{1,5}\//;
|
||||
const match = url.match(ipRegex);
|
||||
if (match) {
|
||||
return match;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
getLayers() {},
|
||||
initMars3d(options) {
|
||||
if (this[`map${this.mapKey}`]) return;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
const WS_URL_PRODUCTION = 'ws://60.217.22.180:9002/ws'
|
||||
const WS_URL_PRODUCTION = 'ws://60.217.22.153:9002/ws'
|
||||
// const WS_URL_PRODUCTION = 'ws://123.132.248.154:9225/ws'
|
||||
export const WS_URL = WS_URL_PRODUCTION
|
||||
|
|
|
|||
|
|
@ -95,24 +95,6 @@ export default {
|
|||
font_formats:
|
||||
"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",
|
||||
branding: false,
|
||||
//此处为图片上传处理函数,这个直接用了base64的图片形式上传图片,
|
||||
//如需ajax上传可参考https://www.tiny.cloud/docs/configure/file-image-upload/#images_upload_handler
|
||||
// images_upload_handler: (blobInfo, success, failure) => {
|
||||
// const img = "data:image/jpeg;base64," + blobInfo.base64();
|
||||
// success(img);
|
||||
// }
|
||||
|
||||
// 原始
|
||||
// images_upload_url:BASE_IMAGE_API+"/api/Platform/Upload",
|
||||
|
||||
// images_upload_handler:(blobInfo, success, failure) => {
|
||||
// let fd = new FormData()
|
||||
// fd.append('files',blobInfo.blob())
|
||||
// axios.post(BASE_IMAGE_API+'/api/Platform/Upload',fd).then(res=>{
|
||||
// success(BASE_IMAGE_API+"/"+res.data.result[0].filePath);
|
||||
// })
|
||||
// },
|
||||
|
||||
images_upload_url:BASE_IMAGE_API+"/api/Files/Upload",
|
||||
|
||||
images_upload_handler:(blobInfo, success, failure) => {
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@
|
|||
>
|
||||
</personnel>
|
||||
</div>
|
||||
|
||||
<!-- 物资 -->
|
||||
<div class="goods-container" v-if="goodsVisible" v-drag>
|
||||
<goodsbox
|
||||
|
|
@ -203,7 +204,6 @@
|
|||
<div class="route" v-show="routeShow && appTools['routebox']">
|
||||
<routebox></routebox>
|
||||
</div>
|
||||
|
||||
<!-- 监控列表 -->
|
||||
<div class="monitor" v-if="monitorShow && appTools['monitorbox']">
|
||||
<monitorbox @showLCmonitorbox="showLCmonitorbox"></monitorbox>
|
||||
|
|
@ -303,7 +303,7 @@
|
|||
<reportbox @getAllReportList="getAllReportList"></reportbox>
|
||||
</div> -->
|
||||
<!-- 任务下发 -->
|
||||
<div class="task" v-if="taskDeliveryShow && finishLoadMap">
|
||||
<div class="task" v-if="taskDeliveryShow && finishLoadMap" v-drag>
|
||||
<taskDelivery
|
||||
@closeTask="closeTask"
|
||||
:lng="tasklng"
|
||||
|
|
@ -384,6 +384,7 @@
|
|||
|
||||
<script>
|
||||
// 请求接口获取全部路由和工具箱信息
|
||||
import { getMethodCommon,postMethodCommon } from "../../api/common";
|
||||
import { getModules } from "@/api/modules.js";
|
||||
|
||||
import AppConfigInfo from "../../../public/config/app.json";
|
||||
|
|
@ -509,7 +510,7 @@ export default {
|
|||
callCenterVisible: true,
|
||||
oneButtonCallShow: false,
|
||||
finishLoadMap: false, // 地图加载完成
|
||||
firePopupClosed: false,
|
||||
firePopupClosed: false
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -530,6 +531,8 @@ export default {
|
|||
this.appName = AppConfig.appname;
|
||||
this.appTools = AppConfig.tools;
|
||||
|
||||
window.delTaskPoint = this.delTaskPoint;
|
||||
|
||||
// 每秒更新日期时间
|
||||
setInterval(function () {
|
||||
_this.handlerTime();
|
||||
|
|
@ -587,7 +590,104 @@ export default {
|
|||
this.rightType = 3;
|
||||
this.setVisibleShow = true;
|
||||
},
|
||||
getTaskList() {},
|
||||
getTaskList() {
|
||||
getMethodCommon("/FireManagement/LoadAllTask",{
|
||||
pageIndex:1,
|
||||
pageSize:999,
|
||||
}).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.taskList = res.data;
|
||||
this.drawTaskPoint();
|
||||
}
|
||||
})
|
||||
},
|
||||
delTaskPoint(id){
|
||||
postMethodCommon("/FireManagement/DeleteFireTask",[id]).then(res=>{
|
||||
if(res.code==200){
|
||||
this.$message({
|
||||
type:"success",
|
||||
message:"删除成功"
|
||||
})
|
||||
this.getTaskList();
|
||||
}
|
||||
})
|
||||
},
|
||||
// 绘制任务点图标
|
||||
drawTaskPoint(){
|
||||
if(this.taskGraphicLayer){
|
||||
this.taskGraphicLayer.clear();
|
||||
}else{
|
||||
this.taskGraphicLayer = new this.mars3d.layer.GraphicLayer();
|
||||
window.globalmap.addLayer(this.taskGraphicLayer);
|
||||
}
|
||||
this.taskList.forEach((item,index)=>{
|
||||
let graphic = new mars3d.graphic.BillboardEntity({
|
||||
position: [parseFloat(item.lng),parseFloat(item.lat)],
|
||||
style: {
|
||||
image: "/img/marktask.png",
|
||||
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||
clampToGround:true,
|
||||
scale:0.4,
|
||||
label: {
|
||||
text: "任务点",
|
||||
font_size: 14,
|
||||
color: "#ffffff",
|
||||
pixelOffsetY: 10,
|
||||
distanceDisplayCondition: true,
|
||||
distanceDisplayCondition_far: 500000,
|
||||
distanceDisplayCondition_near: 0
|
||||
}
|
||||
},
|
||||
"popup": `<div class="marsTiltPanel marsTiltPanel-theme-blue" style="font-size:12px;">
|
||||
<div class="marsTiltPanel-wrap">
|
||||
<div class="area">
|
||||
<div class="arrow-lt"></div>
|
||||
<div class="b-t"></div>
|
||||
<div class="b-r"></div>
|
||||
<div class="b-b"></div>
|
||||
<div class="b-l"></div>
|
||||
<div class="arrow-rb"></div>
|
||||
<div class="label-wrap">
|
||||
<div class="title">任务信息</div>
|
||||
<div class="label-content">
|
||||
<div class="data-li">
|
||||
<div class="data-label">任务内容:${item.content? item.content:'暂无任务内容'}</div>
|
||||
</div>
|
||||
<div class="data-li">
|
||||
<div class="data-label">任务地点:</div>
|
||||
<div class="data-value"><span id="lablYeWei" class="label-num">${item.lng},${item.lat}</span><span class="label-unit"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-li">
|
||||
<div class="data-label">任务创建时间:</div>
|
||||
<div class="data-value"><span id="lablYeWei" class="label-num">${item.taskTime}</span><span class="label-unit"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-li">
|
||||
<div class="data-value">
|
||||
<span id="lablCSFM2" onclick="delTaskPoint(${item.id})" class="label-tag data-value-status-3" title="删除任务点">删除任务点</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b-t-l"></div>
|
||||
<div class="b-b-r"></div>
|
||||
</div>
|
||||
<div class="arrow" ></div>
|
||||
</div>`,
|
||||
"popupOptions":{
|
||||
"offsetY":-30,
|
||||
"template":"{content}",
|
||||
"horizontalOrigin":"Cesium.HorizontalOrigin.LEFT",
|
||||
"verticalOrigin":"Cesium.VerticalOrigin.CENTER"
|
||||
},
|
||||
attr: { remark: "火点"}
|
||||
})
|
||||
this.taskGraphicLayer.addGraphic(graphic) // 还可以另外一种写法: graphic.addTo(graphicLayer)
|
||||
})
|
||||
},
|
||||
// 一件呼叫
|
||||
callUser() {
|
||||
this.oneButtonCallShow = true;
|
||||
|
|
@ -630,6 +730,7 @@ export default {
|
|||
this.videoCallShow = false;
|
||||
},
|
||||
closeTask() {
|
||||
this.getTaskList();
|
||||
this.taskDeliveryShow = false;
|
||||
},
|
||||
mergeSuccess() {
|
||||
|
|
@ -873,6 +974,18 @@ export default {
|
|||
this.setVisibleShow = true;
|
||||
},
|
||||
},
|
||||
{
|
||||
text: "设为任务点",
|
||||
show: function (e) {
|
||||
return Cesium.defined(e.cartesian)
|
||||
},
|
||||
callback: (e) => {
|
||||
const mpt = mars3d.LngLatPoint.fromCartesian(e.cartesian)
|
||||
this.tasklng = mpt._lng
|
||||
this.tasklat = mpt._lat
|
||||
this.taskDeliveryShow = true
|
||||
}
|
||||
},
|
||||
// {
|
||||
// text: "设为任务点",
|
||||
// show: function (e) {
|
||||
|
|
@ -1020,6 +1133,10 @@ export default {
|
|||
|
||||
// 查询火点
|
||||
_self.getFirePointList();
|
||||
|
||||
// 查询任务点
|
||||
_self.getTaskList();
|
||||
|
||||
},
|
||||
handlerlistenPopup(map){
|
||||
let _this = this
|
||||
|
|
@ -1394,6 +1511,7 @@ export default {
|
|||
position: absolute;
|
||||
top: 130px;
|
||||
left: 290px;
|
||||
z-index:99999;
|
||||
}
|
||||
|
||||
.tools-box {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ var tuples = new RegExp('^' + numberRegexp.source + '(\\s' + numberRegexp.source
|
|||
* @return {?Object} A GeoJSON geometry object
|
||||
*/
|
||||
function parse(input) {
|
||||
if(!input){
|
||||
return null;
|
||||
}
|
||||
var parts = input.split(';');
|
||||
var _ = parts.pop();
|
||||
var srid = (parts.shift() || '').split('=').pop();
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const GD_KEY = "6af6a87038f44c8c793aa70331f2b7ca"
|
|||
let pathGraphicLayers = null
|
||||
|
||||
//导航寻路
|
||||
export const getRouterFunc = (params, method = 'all') => {
|
||||
export const getRouterFunc = (params, method = 'postgis') => {
|
||||
/**
|
||||
* method:
|
||||
* 当为 postgis时,仅仅使用postgis导航
|
||||
|
|
@ -276,6 +276,7 @@ const getMinimumRoute = (pathObject) => {
|
|||
//备份Object
|
||||
let pathObjectClone = deepClone(pathObject)
|
||||
let { allCoordinates, startLngLat, endLngLat, startRouterLngLat, endRouterLngLat, gdRoute, postGisRoute } = pathObjectClone
|
||||
console.log("pathObject",pathObject);
|
||||
// 当只有一个点时(终点),说明高德地图和postgis都未查询到线路,直接返回两点
|
||||
if (allCoordinates.length <= 1) {
|
||||
pathObjectClone.allCoordinates = [startLngLat, endLngLat]
|
||||
|
|
@ -302,7 +303,6 @@ const getMinimumRoute = (pathObject) => {
|
|||
}
|
||||
// 阈值计算重复路线,去除重复线路
|
||||
let overlapping = turf.lineOverlap(gdRouteLine, postGisRouteLine, { tolerance: 0.1 });
|
||||
console.log('overlapping::: ', overlapping);
|
||||
if (overlapping.features.length) {
|
||||
let lastOverlapPoint = overlapping.features.at(-1).geometry.coordinates[0]
|
||||
let [overlapGdCoordinates, overlapPostGisCoordinates] = sliceByPoint(startRouterLngLat, gdRouteLine, endRouterLngLat, postGisRoute, lastOverlapPoint)
|
||||
|
|
@ -329,8 +329,10 @@ const getMinimumRoute = (pathObject) => {
|
|||
let distanceStartToEnd = turf.distance(startLngLatPoint, endLngLatPoint)
|
||||
//计算出发点到出发导航路线出发点的步行距离
|
||||
let distanceStartToStartRoute = turf.distance(startLngLatPoint, startRouterLngLatPoint)
|
||||
console.log("计算出发点到出发导航路线出发点的步行距离",distanceStartToStartRoute);
|
||||
//计算终点到出发导航路线终点的步行距离
|
||||
let distanceEndToEndRoute = turf.distance(endLngLatPoint, endRouterLngLatPoint)
|
||||
console.log("计算终点到出发导航路线终点的步行距离",distanceEndToEndRoute);
|
||||
//如果出发点与目的地的实际距离小于步行的距离,直接使用出发点到目的地的距离,导航此时不适用
|
||||
if (distanceStartToEnd < (distanceStartToStartRoute + distanceEndToEndRoute)) {
|
||||
pathObjectClone.allCoordinates = [startLngLat, endLngLat]
|
||||
|
|
@ -387,6 +389,7 @@ const getOneLineCoordinatesFromGeometry = (geometry) => {
|
|||
} else {
|
||||
list = []
|
||||
}
|
||||
|
||||
return list
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,173 @@
|
|||
<template>
|
||||
<div class="box">
|
||||
<div class="box-title">属性编辑</div>
|
||||
<div class="box-container">
|
||||
<el-form ref="form" :inline="true" label-width="100px" size="small" >
|
||||
<el-form-item v-for="(item,index) in showFields" :key="index" :label="item.name" >
|
||||
<el-input v-model="editData[item.field]" style="min-width:240px;"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="text-align:right;padding-top:5px;">
|
||||
<el-button type="default" size="mini" style="margin-right:10px;" @click="$emit('close')">取消</el-button>
|
||||
<el-button type="primary" size="mini" style="margin-right:20px;" @click="saveData">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let BASE_URL = process.env.VUE_APP_BASE_API
|
||||
import axios from "axios";
|
||||
import { postMethodCommon,getMethodCommon } from '@/api/common.js';
|
||||
import { isJson } from "../../../utils/index";
|
||||
export default {
|
||||
props:['editData','tableName','showFields'],
|
||||
name: 'monitorbox',
|
||||
data(){
|
||||
return{
|
||||
list:[
|
||||
|
||||
],
|
||||
formData:{},
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
editData(newVal,oldVal){
|
||||
this.handleData();
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.handleData();
|
||||
console.log("showField",this.showFields)
|
||||
},
|
||||
mounted(){
|
||||
|
||||
},
|
||||
methods:{
|
||||
handleData(){
|
||||
this.list = [];
|
||||
for(let key in this.editData){
|
||||
let obj = {
|
||||
name:key,
|
||||
value:this.editData[key]
|
||||
}
|
||||
this.list.push(obj);
|
||||
}
|
||||
},
|
||||
saveData(){
|
||||
this.formData = this.editData;
|
||||
this.formData.tableName = this.tableName;
|
||||
this.formData.spaceType = "EPSG:4326";
|
||||
postMethodCommon("http://223.99.16.253:9006/geoserver/updateLayerData",this.formData).then(res=>{
|
||||
this.$message({type:"success",message:"修改成功"});
|
||||
this.$emit("close");
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.box{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background-image: url(/img/biaohui.png);
|
||||
background-size: 100% 100%;
|
||||
text-align:left;
|
||||
z-index: 99;
|
||||
}
|
||||
.box-title{
|
||||
width:100%;
|
||||
height:45px;
|
||||
overflow: hidden;
|
||||
line-height:40px;
|
||||
color:#eee;
|
||||
text-align: left;
|
||||
font-size:16px;
|
||||
text-indent:18px;
|
||||
}
|
||||
.box-container{
|
||||
width: calc( 100% - 0px);
|
||||
padding:0px 12px;
|
||||
height: calc( 100% - 90px);
|
||||
overflow: auto;
|
||||
}
|
||||
.table-header{
|
||||
width: calc( 100% - 10px);
|
||||
height:25px;
|
||||
color:#fff;
|
||||
text-align: center;
|
||||
}
|
||||
.table-header div{
|
||||
float:left;
|
||||
width:20%;
|
||||
border-bottom:1px dashed #008cff;
|
||||
padding-bottom:8px;
|
||||
}
|
||||
.table-body{
|
||||
width:100%;
|
||||
height: calc( 100% - 40px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.table-body .item{
|
||||
width:100%;
|
||||
height:36px;
|
||||
background: #003cff2f;
|
||||
font-size:12px;
|
||||
text-align: center;
|
||||
line-height:36px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.table-body .item:nth-child(2n){
|
||||
background:#0059ff50;
|
||||
}
|
||||
|
||||
.table-body .item div{
|
||||
float:left;
|
||||
width:20%;
|
||||
color:#eee;
|
||||
overflow: hidden;
|
||||
height:36px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {
|
||||
border: 0
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
background: transparent;
|
||||
border-radius: 5px
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
padding-top: 100px;
|
||||
-webkit-box-shadow: inset 1px 1px 0 rgba(0, 0, 0, .1), inset -1px -1px 0 rgba(0, 0, 0, .07);
|
||||
background-color: #797979;
|
||||
min-height: 28px;
|
||||
border-radius: 4px;
|
||||
background-clip: padding-box
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb {
|
||||
border: 0
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
-webkit-box-shadow: inset 1px 1px 1px rgba(0, 0, 0, .25);
|
||||
background-color: rgba(0, 0, 0, .4)
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:active {
|
||||
-webkit-box-shadow: inset 1px 1px 3px rgba(0, 0, 0, .35);
|
||||
background-color: rgba(0, 0, 0, .5)
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label{
|
||||
color:#fff;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -222,23 +222,19 @@ import axios from 'axios'
|
|||
address:"",
|
||||
work:this.callText
|
||||
}
|
||||
|
||||
axios({
|
||||
method:"post",
|
||||
url:"http://123.132.248.154:9224/api/FireCodePC/EventAssign",
|
||||
data:param,
|
||||
|
||||
}).then(res=>{
|
||||
|
||||
postMethodCommon("/FireCodePC/EventAssign",param).then(res=>{
|
||||
this.loading = false;
|
||||
if(res.data.code==200){
|
||||
if(res.code==200){
|
||||
this.$message({
|
||||
message: res.data.message,
|
||||
message: res.message,
|
||||
type: 'success'
|
||||
});
|
||||
this.callText = null;
|
||||
this.callTextShow = false;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// postMethodCommon('/FireCodePC/EventAssign',param).then(res =>{
|
||||
// if(res.code == 200){
|
||||
|
|
|
|||
|
|
@ -1,19 +1,30 @@
|
|||
<template>
|
||||
<div class="box">
|
||||
<div class="box-title">下发任务</div>
|
||||
<div class="box-container">
|
||||
<div class="box-container" style="padding-top: 20px;">
|
||||
<div class="inputer">
|
||||
<span>位置:</span>
|
||||
<el-input size="mini" style="width:300px;" v-model="location"></el-input>
|
||||
<!-- <el-button icon="el-icon-location-outline" size="mini" type="primary"
|
||||
style="float:left;position:relative;left:4px;" @click="initDrawLayer()"></el-button> -->
|
||||
|
||||
</div>
|
||||
<div class="inputer">
|
||||
<span>任务详情:</span>
|
||||
<el-input type="textarea" :rows="6" style="width:300px;" placeholder="请输入内容" v-model="content">
|
||||
<el-input type="textarea" :rows="4" style="width:300px;" placeholder="请输入内容" v-model="content">
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="inputer">
|
||||
<span style="float:left;margin-left:12px;">接收人员:</span>
|
||||
|
||||
<div class="" style="float:left;width:300px;">
|
||||
<el-table ref="multipleTable" :data="list" tooltip-effect="dark" height="200px"
|
||||
style="width: 100%;margin-top:12px;" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="姓名">
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align:right;margin:0px 28px;">
|
||||
<el-button size="mini" @click="close">关闭</el-button>
|
||||
|
|
@ -23,296 +34,257 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import { parse } from '../lib/handleGeojson';
|
||||
export default {
|
||||
name: 'taskDelivery',
|
||||
props: ['globalmap','lng','lat'],
|
||||
data() {
|
||||
return {
|
||||
location: '',
|
||||
content: '',
|
||||
pathPointGraphicLayer: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
if(this.lat){
|
||||
this.location = this.lng + "," + this.lat;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initDrawLayer() { // 图上标绘
|
||||
this.pathPointGraphicLayer = new mars3d.layer.GraphicLayer({
|
||||
name: "标绘图层",
|
||||
id: 10101,
|
||||
isRestorePositions: true,
|
||||
hasEdit: true,
|
||||
isAutoEditing: true // 绘制完成后是否自动激活编辑
|
||||
})
|
||||
window.globalmap.addLayer(this.pathPointGraphicLayer)
|
||||
// 在layer上绑定监听事件
|
||||
let _this = this;
|
||||
this.pathPointGraphicLayer.on(mars3d.EventType.click, function (e) {
|
||||
_this.showEditor(e)
|
||||
})
|
||||
|
||||
this.pathPointGraphicLayer.on(mars3d.EventType.drawCreated, function (e) {
|
||||
|
||||
})
|
||||
|
||||
this.pathPointGraphicLayer.on(mars3d.EventType.editStop, function (e) {
|
||||
mars3d.widget.disable("widgets/plotAttr/widget.js")
|
||||
})
|
||||
this.drawMarker()
|
||||
|
||||
},
|
||||
drawMarker() { //图上标绘
|
||||
var img = '/img/homeimg/5.png';
|
||||
this.pathPointGraphicLayer.startDraw({
|
||||
type: "billboard",
|
||||
style: {
|
||||
scale: 0.6,
|
||||
clampToGround: true,
|
||||
image: img,
|
||||
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
showEditor(e) {
|
||||
var graphic = e.graphic
|
||||
const cartesian = e.cartesian
|
||||
const point = mars3d.LngLatPoint.fromCartesian(cartesian)
|
||||
point.format()
|
||||
this.location = point.lng + "," + point.lat;
|
||||
this.lng = point.lng
|
||||
this.lat = point.lat
|
||||
if (!graphic._conventStyleJson) {
|
||||
graphic.options.style = graphic.toJSON().style //因为示例中的样式可能有复杂对象,需要转为单个json简单对象
|
||||
graphic._conventStyleJson = true //只处理一次
|
||||
}
|
||||
var plotAttr = mars3d.widget.getClass("widgets/plotAttr/widget.js")
|
||||
if (plotAttr && plotAttr.isActivate) {
|
||||
plotAttr.startEditing(graphic, graphic.coordinates)
|
||||
} else {
|
||||
mars3d.widget.activate({
|
||||
map: window.globalmap,
|
||||
uri: "widgets/plotAttr/widget.js",
|
||||
name: "属性编辑",
|
||||
graphic: graphic,
|
||||
lonlats: graphic.coordinates
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
bindMapClick(type) { //绑定点击事件 绘制获取起始点数据
|
||||
if (this.pathPointGraphicLayer == null) {
|
||||
this.pathPointGraphicLayer = new mars3d.layer.GraphicLayer();
|
||||
window.globalmap.addLayer(this.pathPointGraphicLayer);
|
||||
}
|
||||
let _this = this;
|
||||
window.globalmap.setCursor(true)
|
||||
window.globalmap.on(mars3d.EventType.click, function (event) {
|
||||
window.globalmap.setCursor(false)
|
||||
const cartesian = event.cartesian
|
||||
const point = mars3d.LngLatPoint.fromCartesian(cartesian)
|
||||
point.format()
|
||||
_this.location = point.lng + "," + point.lat;
|
||||
_this.drawPoint(type, point.lng, point.lat, point.z);
|
||||
})
|
||||
},
|
||||
drawPoint(type, lng, lat, z) { // 绘制起点、终点
|
||||
let image = '/img/homeimg/5.png';
|
||||
this.pathPointGraphicLayer.clear();
|
||||
var graphic = new mars3d.graphic.BillboardEntity({
|
||||
position: [lng, lat, z],
|
||||
style: {
|
||||
image: image,
|
||||
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||
clampToGround: true
|
||||
},
|
||||
attr: { remark: '任务点' }
|
||||
})
|
||||
this.pathPointGraphicLayer.addGraphic(graphic) // 还可以另
|
||||
},
|
||||
close() {
|
||||
if (this.pathPointGraphicLayer != null) {
|
||||
this.pathPointGraphicLayer.clear();
|
||||
window.globalmap.off(mars3d.EventType.click)
|
||||
}
|
||||
this.$emit('closeTask')
|
||||
},
|
||||
onSubmit() {
|
||||
var querys = {
|
||||
content: this.content,
|
||||
lng: this.lng,
|
||||
lat: this.lat,
|
||||
}
|
||||
if(this.lng == ''){
|
||||
this.$message.warning("请选择位置");
|
||||
return;
|
||||
}
|
||||
var url = process.env.VUE_APP_BASE_API + '/FireManagement/FireClueTask'
|
||||
var _this = this
|
||||
axios({
|
||||
method: "post",
|
||||
url: url,
|
||||
data: querys,
|
||||
headers: {
|
||||
'X-Token': localStorage.getItem("X-Token")
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
_this.close()
|
||||
}else{
|
||||
this.$message.success(res.data.msg);
|
||||
}
|
||||
})
|
||||
import axios from 'axios'
|
||||
import { getMethodCommon } from '../../../api/common';
|
||||
let BASE_URL = process.env.VUE_APP_BASE_API;
|
||||
export default {
|
||||
name: 'taskDelivery',
|
||||
props: ['globalmap', 'lng', 'lat'],
|
||||
data() {
|
||||
return {
|
||||
location: '',
|
||||
content: '',
|
||||
pathPointGraphicLayer: null,
|
||||
list: [],
|
||||
multipleSelection: [],
|
||||
listQuery:{
|
||||
pageIndex:1,
|
||||
pageSize:12,
|
||||
name:null,
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
created() {
|
||||
this.getUserList();
|
||||
},
|
||||
mounted() {
|
||||
if (this.lat) {
|
||||
this.location = this.lng + "," + this.lat;
|
||||
} ``
|
||||
},
|
||||
methods: {
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
getUserList() {
|
||||
getMethodCommon("/FireManagement/LoadFireClueUser",this.listQuery).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.list = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
close() {
|
||||
// if (this.pathPointGraphicLayer != null) {
|
||||
// this.pathPointGraphicLayer.clear();
|
||||
// window.globalmap.off(mars3d.EventType.click)
|
||||
// }
|
||||
this.$emit('closeTask')
|
||||
},
|
||||
onSubmit() {
|
||||
var querys = {
|
||||
content: this.content,
|
||||
lng: this.lng,
|
||||
lat: this.lat,
|
||||
recipientUsers: this.multipleSelection.map(e => e.id)
|
||||
}
|
||||
if (this.lng == '') {
|
||||
this.$message.warning("请选择位置");
|
||||
return;
|
||||
}
|
||||
var url = process.env.VUE_APP_BASE_API + '/FireManagement/FireClueTask'
|
||||
var _this = this
|
||||
axios({
|
||||
method: "post",
|
||||
url: url,
|
||||
data: querys,
|
||||
headers: {
|
||||
'X-Token': localStorage.getItem("X-Token")
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.data.code == 200) {
|
||||
this.$message.success(res.data.msg);
|
||||
// TODO 添加任务点后,在地图显示相应的图标
|
||||
_this.close()
|
||||
} else {
|
||||
this.$message.error(res.data.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url(/img/huoqing-bg.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.box {
|
||||
width: 100%;
|
||||
/* height: 100%; */
|
||||
background-image: url(/img/huoqing-bg.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.box-container {
|
||||
width: calc(100% - 0px);
|
||||
padding: 0px 12px;
|
||||
height: calc(100% - 100px);
|
||||
}
|
||||
.box-container {
|
||||
width: calc(100% - 0px);
|
||||
padding: 0px 12px;
|
||||
height: calc(100% - 150px)!important;
|
||||
}
|
||||
|
||||
.box-title {
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
color: #fff;
|
||||
text-indent: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
.box-title {
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
line-height: 45px;
|
||||
color: #fff;
|
||||
text-indent: 30px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.tab-container {
|
||||
width: 210px;
|
||||
height: 60px;
|
||||
border-bottom: 1px solid #2F5D55;
|
||||
padding-top: 10px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
.tab-container {
|
||||
width: 210px;
|
||||
height: 60px;
|
||||
border-bottom: 1px solid #2F5D55;
|
||||
padding-top: 10px;
|
||||
margin: 0px auto;
|
||||
}
|
||||
|
||||
.inputer {
|
||||
width: 84%;
|
||||
margin: 0px auto;
|
||||
line-height: 40px;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
.inputer {
|
||||
width: 84%;
|
||||
margin: 0px auto;
|
||||
line-height: 40px;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
::v-deep .el-input__inner {
|
||||
background: none;
|
||||
border-color: #00fff0;
|
||||
color: #fff;
|
||||
}
|
||||
::v-deep .el-input__inner {
|
||||
background: none;
|
||||
border-color: #00fff0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-textarea__inner {
|
||||
background: none;
|
||||
border-color: #00fff0;
|
||||
color: #fff;
|
||||
}
|
||||
::v-deep .el-textarea__inner {
|
||||
background: none;
|
||||
border-color: #00fff0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.upload-iocn-box {
|
||||
width: 240px;
|
||||
height: 210px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
margin-top: 25px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.upload-iocn-box {
|
||||
width: 240px;
|
||||
height: 210px;
|
||||
float: left;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
margin-top: 25px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.upload-icon-bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background: #193632;
|
||||
z-index: 2;
|
||||
}
|
||||
.upload-icon-bg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background: #193632;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.upload-iocn-box::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: -3px;
|
||||
z-index: 1;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.upload-iocn-box::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
left: -3px;
|
||||
z-index: 1;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
.upload-iocn-box::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
.upload-iocn-box::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-icon-bg2::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
left: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
.upload-icon-bg2::after {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
left: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-icon-bg2::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
.upload-icon-bg2::before {
|
||||
content: "";
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: #00fff0;
|
||||
position: absolute;
|
||||
bottom: -3px;
|
||||
right: -3px;
|
||||
border-radius: 1px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.upload-iocn-box img {
|
||||
width: 80px;
|
||||
}
|
||||
.upload-iocn-box img {
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
.upload-iocn {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.upload-iocn {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.upload-icon-text {
|
||||
font-size: 14px;
|
||||
color: #ccc;
|
||||
margin: 16px 0px;
|
||||
}
|
||||
.upload-icon-text {
|
||||
font-size: 14px;
|
||||
color: #ccc;
|
||||
margin: 16px 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-table th.el-table__cell {
|
||||
background: #193632;
|
||||
color: #fff;
|
||||
border: 1px solid #00fff0;
|
||||
}
|
||||
|
||||
::v-deep .el-table tr {
|
||||
background: #193632;
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
|
||||
|
||||
::v-deep .el-table .el-table__body tr:hover>td {
|
||||
background-color: rgba(255, 255, 255, .1) !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table .el-table__body tr.current-row>td {
|
||||
background-color: rgba(255, 255, 255, .1) !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table,
|
||||
.el-table__expanded-cell {
|
||||
background: none;
|
||||
}
|
||||
|
||||
::v-deep .el-table td,
|
||||
.el-table th.is-leaf {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-table th,
|
||||
.el-table tr {
|
||||
background: none;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,565 @@
|
|||
<template>
|
||||
<div class="site-content">
|
||||
<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.name"
|
||||
>
|
||||
</el-input>
|
||||
|
||||
<el-button type="primary" size="mini" @click="getList()" icon="el-icon-search"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button type="primary" size="mini" @click="add()" icon="el-icon-plus">添加</el-button>
|
||||
<el-button type="warning" size="mini" @click="react()" icon="el-icon-edit">编辑</el-button>
|
||||
<el-button type="danger" size="mini" @click="del()" icon="el-icon-delete">删除</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">
|
||||
<div class="flex jc-sb" style="height: calc(100% - 100px)">
|
||||
<div class="mr-1 max-h" style="width:100%;">
|
||||
<el-table
|
||||
ref="mainTable"
|
||||
:key="tableKey"
|
||||
:data="tableData"
|
||||
v-loading="listLoading"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
height="100%"
|
||||
@row-click="rowClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" align="center" width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="imaUrl"
|
||||
label="图标"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<img :src="image_base+'/'+scope.row.imaUrl" alt="">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="unitName"
|
||||
label="队伍名称"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="listQuery.pageIndex"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
@pagination="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
width="40%"
|
||||
height="60%"
|
||||
top=" calc(50vh - 340px)"
|
||||
class="dialog-mini body-small addWindow"
|
||||
v-el-drag-dialog
|
||||
:title="titleStr"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="addServiceVisible"
|
||||
>
|
||||
<AddForm
|
||||
v-if="addServiceVisible"
|
||||
@addSuccess="addSuccess"
|
||||
:detailInfo="detailInfo"
|
||||
@close="addServiceVisible = false"
|
||||
></AddForm>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
width="40%"
|
||||
height="60%"
|
||||
top=" calc(50vh - 340px)"
|
||||
class="dialog-mini body-small addWindow"
|
||||
v-el-drag-dialog
|
||||
:title="titleStr"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="editServiceVisible"
|
||||
>
|
||||
<EditForm
|
||||
v-if="editServiceVisible"
|
||||
@addSuccess="editSuccess"
|
||||
:detailInfo="editForm"
|
||||
@close="editServiceVisible = false"
|
||||
></EditForm>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入护林员 -->
|
||||
<el-dialog
|
||||
width="400px"
|
||||
height="60%"
|
||||
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="importVisible"
|
||||
>
|
||||
<ImportForestranger v-if="importVisible" @importSuccess="importSuccess"></ImportForestranger>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AppConfigInfo from "/public/config/app.json";
|
||||
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 Treeselect from "@riophae/vue-treeselect";
|
||||
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 Sticky from "@/components/Sticky";
|
||||
import ImportForestranger from './widget/ImportForestranger.vue'
|
||||
import EditForm from './widget/EditForm.vue'
|
||||
let VUE_APP_BASE_IMG_URL = process.env.VUE_APP_BASE_IMG_URL
|
||||
export default {
|
||||
name: "module",
|
||||
components: {
|
||||
permissionBtn,
|
||||
Pagination,
|
||||
AddForm,
|
||||
Sticky,
|
||||
ImportForestranger,
|
||||
EditForm
|
||||
},
|
||||
mixins: [extend],
|
||||
directives: {
|
||||
waves,
|
||||
elDragDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
image_base:VUE_APP_BASE_IMG_URL,
|
||||
areaId:null,
|
||||
orgs:[],
|
||||
cascaderProps:{label:'name',value:'id',children:'child',checkStrictly: true},
|
||||
importVisible:false,
|
||||
rowdata: {},
|
||||
tableKey: 0,
|
||||
titleStr: "添加",
|
||||
tableData: [],
|
||||
addServiceVisible: false,
|
||||
editServiceVisible:false,
|
||||
total: 0,
|
||||
listQuery: {
|
||||
// 查询条件
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
},
|
||||
detailInfo: [],
|
||||
clocklnglat: "",
|
||||
clockInList: [],
|
||||
clockInName: "",
|
||||
clockInVisible: false,
|
||||
rowdataKey: 1,
|
||||
flyCenter: [],
|
||||
clockDetail: {},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
filters: {},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
handleChange(e){
|
||||
this.listQuery.areaId = e && e[e.length-1];
|
||||
this.getList();
|
||||
},
|
||||
gethlyList(){
|
||||
getMethodCommon("/FireGrid/LoadUsers").then(res =>{
|
||||
this.orgs = res.data;
|
||||
this.handleOrgs();
|
||||
})
|
||||
},
|
||||
handleOrgs(orgs){
|
||||
for(let i=0;i<this.orgs[0].child.length;i++){
|
||||
if(this.orgs[0].child[i]){
|
||||
if(this.orgs[0].child[i].child){
|
||||
this.orgs[0].child[i].child = null;
|
||||
}
|
||||
|
||||
// for(let j=0;j<this.orgs[0].child[i].child.length;j++){
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
importSuccess(){
|
||||
this.importVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
rightClick(e) {
|
||||
console.log("rightClick", e);
|
||||
this.clockInVisible = true;
|
||||
this.clocklnglat = e;
|
||||
this.clockDetail = null;
|
||||
},
|
||||
editClock(e) {
|
||||
console.log("223311", e);
|
||||
this.clockDetail = e;
|
||||
this.clockInVisible = true;
|
||||
},
|
||||
gofly(item) {
|
||||
console.log("iii", item);
|
||||
this.flyCenter = [item.lng, item.lat];
|
||||
},
|
||||
delItem(item) {
|
||||
console.log("123", item);
|
||||
let param = {
|
||||
id: item.id,
|
||||
};
|
||||
this.$confirm("确定删除本条数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
postMethodCommon("/FireGrid/DeleteCheckPoint?id=" + param.id).then(
|
||||
(res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
});
|
||||
}
|
||||
this.rowdataKey++;
|
||||
this.getClockInList();
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
clockInSuccess() {
|
||||
this.rowdataKey++;
|
||||
this.getClockInList();
|
||||
},
|
||||
getClockInList() {
|
||||
let param = {
|
||||
name: this.clockInName,
|
||||
};
|
||||
getMethodCommon("/FireGrid/GetTotalCheckPoint", param).then((res) => {
|
||||
this.clockInList = res.result;
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.addServiceVisible = true;
|
||||
this.detailInfo = [];
|
||||
this.titleStr = "添加";
|
||||
},
|
||||
addSuccess() {
|
||||
this.addServiceVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
editSuccess(){
|
||||
this.editServiceVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
del() {
|
||||
var _this = this;
|
||||
if (this.multipleSelection.length != 1) {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "请选择一条数据进行删除",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定删除所选数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
postMethodCommon("/FireCodePC/DeleteUserUnitById?id=" +
|
||||
_this.multipleSelection[0].id,
|
||||
{}
|
||||
).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
});
|
||||
}
|
||||
_this.getList();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
react() {
|
||||
if (this.multipleSelection.length != 1) {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "请选择一条数据进行编辑",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.editForm = this.multipleSelection[0];
|
||||
this.editServiceVisible = true;
|
||||
this.titleStr = "编辑";
|
||||
},
|
||||
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/GetUserUnit", this.listQuery).then(
|
||||
(res) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res);
|
||||
this.tableData = res.data;
|
||||
|
||||
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();
|
||||
},
|
||||
|
||||
handleUpdate() {
|
||||
this.editForm = this.multipleSelection[0];
|
||||
this.editServiceVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.filter-container {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.site-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
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: 94%;
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
}
|
||||
|
||||
.app-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.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;
|
||||
}
|
||||
.forestlistbox {
|
||||
height: calc(100% - 30px);
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
}
|
||||
.forestUl {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,230 @@
|
|||
<template>
|
||||
<div style="width:100%;height:50vh;padding:0px 23px; z-index:10;">
|
||||
<el-form ref="form" size="mini" :model="addForm" :rules="rules" label-width="140px">
|
||||
|
||||
<el-form-item label="队伍名称: " prop="unitName">
|
||||
<el-input v-model="addForm.unitName" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍类型: " prop="unitType">
|
||||
<el-input v-model="addForm.unitType" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍描述:" prop="description">
|
||||
<el-input v-model="addForm.description" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍图标:" prop="iocn">
|
||||
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
name="files"
|
||||
:action="upload_url"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload">
|
||||
<img v-if="addForm.imaUrl" :src="imaUrl_base+'/'+addForm.imaUrl" class="">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item style="margin-top: 16%;">
|
||||
<el-button @click="close()">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm('form')" >保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listToTreeSelect } from '@/utils'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { postMethodCommon, getMethodCommon } from '../../../api/common';
|
||||
import { validateMobile, validID, validateStock } from './validate.js'
|
||||
import form from '../../../store/modules/form';
|
||||
let BASE_IMAGE_URL = process.env.VUE_APP_BASE_API;
|
||||
let VUE_APP_BASE_IMG_URL = process.env.VUE_APP_BASE_IMG_URL
|
||||
|
||||
// let BASE_IMAGE_URL = BASE_IMAGE_API_URL;
|
||||
export default {
|
||||
name: "AddForm",
|
||||
props: ['detailInfo'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imaUrl_base:VUE_APP_BASE_IMG_URL,
|
||||
upload_url:BASE_IMAGE_URL+"/Files/Upload",
|
||||
BASE_IMAGE_URL: BASE_IMAGE_URL,
|
||||
addForm: {
|
||||
unitName:null,
|
||||
unitType:null,
|
||||
description:null,
|
||||
imaUrl:null,
|
||||
createTime:new Date(),
|
||||
id:0,
|
||||
createUserId:"1",
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '姓名不能为空', trigger: 'blur' },
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: '电话不能为空', trigger: 'blur' },
|
||||
{ validator: validateMobile.bind(this), trigger: 'blur' }
|
||||
],
|
||||
gender: [
|
||||
{ required: true, message: '性别不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
orgsTree: [], // 用户可访问到的所有机构组成的树
|
||||
selectRoles: [], // 用户分配的角色
|
||||
selectRoleNames: '',
|
||||
level:0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.detailInfo.length == 1) {
|
||||
// this.addForm = this.detailInfo[0];
|
||||
this.getDetail()
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectOrgs: {
|
||||
get: function () {
|
||||
if (this.detailInfo.length == 1) {
|
||||
return this.addForm.areaId
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
},
|
||||
set: function (v) {
|
||||
var _this = this
|
||||
_this.addForm.areaId = v
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess(e){
|
||||
this.addForm.imaUrl = e.result[0].filePath
|
||||
},
|
||||
beforeAvatarUpload(e){
|
||||
console.log(e);
|
||||
return;
|
||||
},
|
||||
getDetail() {
|
||||
getMethodCommon("/FireCodeApp/GetForestryUserById?id=" + this.detailInfo[0].Id, {}).then(res => {
|
||||
if (res.code == 200) {
|
||||
let detail = {...res.data[0]};
|
||||
this.addForm.id = detail.Id;
|
||||
this.addForm.name = detail.Name;
|
||||
this.addForm.account = detail.Account;
|
||||
this.addForm.sex = detail.Sex;
|
||||
this.addForm.userRole = detail.UserRole;
|
||||
this.addForm.areaId = detail.areaId;
|
||||
// if(this.addForm.areaId){
|
||||
// var areaId = this.addForm.areaId.split(',')
|
||||
// this.addForm.areaId = turnNum(areaId)
|
||||
// }
|
||||
// var turnNum = function (nums) {
|
||||
// return nums.map(Number);
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
traverse(arr) {
|
||||
this.level++;
|
||||
if(this.level<3){
|
||||
if (arr && arr.length > 0) {
|
||||
var list = []
|
||||
arr.forEach(childelement => {
|
||||
list.push({
|
||||
id: childelement.id,
|
||||
label: childelement.areaName,
|
||||
parentId: childelement.pId || null,
|
||||
children: this.traverse(childelement.child)
|
||||
})
|
||||
});
|
||||
return list
|
||||
}
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 添加
|
||||
postMethodCommon("/FireCodePC/AddOrUpdateUserUnit", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "添加成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
createForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
// delete this.addForm.zrclist
|
||||
postMethodCommon("/FireCodeApp/EditForestryUser ", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "编辑成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .vue-treeselect__control {
|
||||
background: rgba(0, 9, 34, 0);
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
::v-deep .el-radio {
|
||||
color: #333;
|
||||
|
||||
}
|
||||
|
||||
.service-type-btn {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
text-align: center;
|
||||
margin-top: 100px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,228 @@
|
|||
<template>
|
||||
<div style="width:100%;height:50vh;padding:0px 23px; z-index:10;">
|
||||
<el-form ref="form" size="mini" :model="addForm" :rules="rules" label-width="140px">
|
||||
|
||||
<el-form-item label="队伍名称: " prop="unitName">
|
||||
<el-input v-model="addForm.unitName" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍类型: " prop="unitType">
|
||||
<el-input v-model="addForm.unitType" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍描述:" prop="description">
|
||||
<el-input v-model="addForm.description" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍图标:" prop="iocn">
|
||||
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
name="files"
|
||||
:action="upload_url"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload">
|
||||
<img v-if="addForm.imaUrl" :src="imaUrl_base+'/'+addForm.imaUrl" class="">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item style="margin-top: 16%;">
|
||||
<el-button @click="close()">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm('form')" >保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listToTreeSelect } from '@/utils'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { postMethodCommon, getMethodCommon } from '../../../api/common';
|
||||
import { validateMobile, validID, validateStock } from './validate.js'
|
||||
import form from '../../../store/modules/form';
|
||||
let BASE_IMAGE_URL = process.env.VUE_APP_BASE_API;
|
||||
let VUE_APP_BASE_IMG_URL = process.env.VUE_APP_BASE_IMG_URL
|
||||
|
||||
// let BASE_IMAGE_URL = BASE_IMAGE_API_URL;
|
||||
export default {
|
||||
name: "AddForm",
|
||||
props: ['detailInfo'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imaUrl_base:VUE_APP_BASE_IMG_URL,
|
||||
upload_url:BASE_IMAGE_URL+"/Files/Upload",
|
||||
BASE_IMAGE_URL: BASE_IMAGE_URL,
|
||||
addForm: {
|
||||
unitName:null,
|
||||
unitType:null,
|
||||
description:null,
|
||||
imaUrl:null,
|
||||
createTime:new Date(),
|
||||
id:0,
|
||||
createUserId:"1",
|
||||
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '姓名不能为空', trigger: 'blur' },
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: '电话不能为空', trigger: 'blur' },
|
||||
{ validator: validateMobile.bind(this), trigger: 'blur' }
|
||||
],
|
||||
gender: [
|
||||
{ required: true, message: '性别不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
orgsTree: [], // 用户可访问到的所有机构组成的树
|
||||
selectRoles: [], // 用户分配的角色
|
||||
selectRoleNames: '',
|
||||
level:0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.addForm = this.detailInfo;
|
||||
|
||||
},
|
||||
computed: {
|
||||
selectOrgs: {
|
||||
get: function () {
|
||||
if (this.detailInfo.length == 1) {
|
||||
return this.addForm.areaId
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
},
|
||||
set: function (v) {
|
||||
var _this = this
|
||||
_this.addForm.areaId = v
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess(e){
|
||||
this.addForm.imaUrl = e.result[0].filePath
|
||||
},
|
||||
beforeAvatarUpload(e){
|
||||
console.log(e);
|
||||
return;
|
||||
},
|
||||
getDetail() {
|
||||
getMethodCommon("/FireCodeApp/GetForestryUserById?id=" + this.detailInfo[0].Id, {}).then(res => {
|
||||
if (res.code == 200) {
|
||||
let detail = {...res.data[0]};
|
||||
this.addForm.id = detail.Id;
|
||||
this.addForm.name = detail.Name;
|
||||
this.addForm.account = detail.Account;
|
||||
this.addForm.sex = detail.Sex;
|
||||
this.addForm.userRole = detail.UserRole;
|
||||
this.addForm.areaId = detail.areaId;
|
||||
// if(this.addForm.areaId){
|
||||
// var areaId = this.addForm.areaId.split(',')
|
||||
// this.addForm.areaId = turnNum(areaId)
|
||||
// }
|
||||
// var turnNum = function (nums) {
|
||||
// return nums.map(Number);
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
traverse(arr) {
|
||||
this.level++;
|
||||
if(this.level<3){
|
||||
if (arr && arr.length > 0) {
|
||||
var list = []
|
||||
arr.forEach(childelement => {
|
||||
list.push({
|
||||
id: childelement.id,
|
||||
label: childelement.areaName,
|
||||
parentId: childelement.pId || null,
|
||||
children: this.traverse(childelement.child)
|
||||
})
|
||||
});
|
||||
return list
|
||||
}
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 添加
|
||||
postMethodCommon("/FireCodePC/AddOrUpdateUserUnit", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "添加成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
createForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
// delete this.addForm.zrclist
|
||||
postMethodCommon("/FireCodeApp/EditForestryUser ", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "编辑成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .vue-treeselect__control {
|
||||
background: rgba(0, 9, 34, 0);
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
::v-deep .el-radio {
|
||||
color: #333;
|
||||
|
||||
}
|
||||
|
||||
.service-type-btn {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
text-align: center;
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
<template>
|
||||
<div class=''>
|
||||
<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:60px;line-height:0px;"></i>
|
||||
<div class="el-upload__text">将Excel文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
|
||||
<p style="text-align: right;margin-top:18px;">
|
||||
<el-button type="primary" size="mini" @click="onSubmit">导入信息</el-button>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { postMethodCommon } from '../../../api/common';
|
||||
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props:[],
|
||||
data() {
|
||||
return {
|
||||
limit:1,
|
||||
fileList:[],
|
||||
form:{},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
methods: {
|
||||
//文件上传时的钩子
|
||||
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]
|
||||
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 !== 'apk') {
|
||||
|
||||
this.$message.warning('只能上传后缀是.apk的文件')
|
||||
return false
|
||||
}
|
||||
if (size > 100) {
|
||||
this.$message.warning('文件大小不得超过100M')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
onSubmit() {
|
||||
let _this = this
|
||||
let formData = new FormData();
|
||||
this.fileList.forEach(item => {
|
||||
formData.append("files", item.raw);
|
||||
});
|
||||
if (this.fileList.length === 0) {
|
||||
this.$message.warning(`请选择上传文件!!`)
|
||||
return
|
||||
}
|
||||
postMethodCommon("/Files/Upload", formData).then(res => {
|
||||
if (res.code === 200) {
|
||||
_this.form.filepath = res.result[0].filePath
|
||||
|
||||
let param = {
|
||||
"file_path": res.result[0].filePath,
|
||||
"token": ""
|
||||
}
|
||||
postMethodCommon('/FireCodeApp/BatchExportRanger',param).then(res2 => {
|
||||
|
||||
_this.$emit("importSuccess")
|
||||
|
||||
_this.fileList = []
|
||||
|
||||
})
|
||||
} else {
|
||||
_this.$message.warning(`接口错误!!`)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
const validateMobile = function (rule, value, callback) {
|
||||
let newValue = value.replace(/[^0-9]/gi, '')
|
||||
if (value !== newValue) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else if (newValue.length !== 11) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const validID = function(rule, value, callback) {
|
||||
// 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
|
||||
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
||||
if (reg.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入正确的身份证号码"));
|
||||
}
|
||||
}
|
||||
var validateStock = (rule, value, callback) => {
|
||||
if (!value || value == 0) {
|
||||
callback(new Error("不能为空"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
export { validateMobile ,validID,validateStock}
|
||||
|
|
@ -0,0 +1,617 @@
|
|||
<template>
|
||||
<div class="site-content">
|
||||
<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-button type="primary" size="mini" @click="getList()" icon="el-icon-search"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button type="primary" size="mini" @click="add()" icon="el-icon-plus">添加</el-button>
|
||||
<el-button type="warning" size="mini" @click="react()" icon="el-icon-edit">编辑</el-button>
|
||||
<el-button type="danger" size="mini" @click="del()" icon="el-icon-delete">删除</el-button>
|
||||
</div>
|
||||
</sticky>
|
||||
<div class="app-container flex-item">
|
||||
<div class="fh">
|
||||
<div class="flex jc-sb" style="height: calc(100% - 100px)">
|
||||
<div class="mr-1 max-h" style="width:100%;">
|
||||
<el-table
|
||||
ref="mainTable"
|
||||
:key="tableKey"
|
||||
:data="tableData"
|
||||
v-loading="listLoading"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
height="100%"
|
||||
@row-click="rowClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
|
||||
|
||||
<el-table-column type="selection" align="center" width="55">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="messageTitle"
|
||||
label="通知标题"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column
|
||||
prop="unitName"
|
||||
label="通知"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column type="expand" label="详情" width="120">
|
||||
<template slot-scope="props">
|
||||
<el-table
|
||||
:data="props.row.users"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="recipientName"
|
||||
label="姓名"
|
||||
sortable
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="recipientName"
|
||||
label="是否已读"
|
||||
sortable
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scop">{{scop.row.isRead == 1 ?'已读':'未读'}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="receivingTime"
|
||||
label="已读时间"
|
||||
sortable
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="listQuery.pageIndex"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
@pagination="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <el-dialog
|
||||
width="1080px"
|
||||
height="800px"
|
||||
top=" calc(50vh - 400px)"
|
||||
class="dialog-mini body-small addWindow"
|
||||
v-el-drag-dialog
|
||||
:title="titleStr"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="addServiceVisible"
|
||||
>
|
||||
<AddForm
|
||||
v-if="addServiceVisible"
|
||||
@addSuccess="addSuccess"
|
||||
:detailInfo="detailInfo"
|
||||
@close="addServiceVisible = false"
|
||||
></AddForm>
|
||||
</el-dialog> -->
|
||||
|
||||
<div style="width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:2;background:#fff;" v-if="addServiceVisible">
|
||||
|
||||
<AddForm
|
||||
v-if="addServiceVisible"
|
||||
@addSuccess="addSuccess"
|
||||
:detailInfo="detailInfo"
|
||||
@close="addServiceVisible = false"
|
||||
></AddForm>
|
||||
</div>
|
||||
|
||||
<div style="width:100%;height:100%;position:absolute;top:0px;left:0px;z-index:2;background:#fff;" v-if="editServiceVisible">
|
||||
<EditForm
|
||||
v-if="editServiceVisible"
|
||||
@addSuccess="editSuccess"
|
||||
:detailInfo="editForm"
|
||||
@close="editServiceVisible = false"
|
||||
></EditForm>
|
||||
</div>
|
||||
<!-- <el-dialog
|
||||
width="1080px"
|
||||
height="800px"
|
||||
top=" calc(50vh - 400px)"
|
||||
class="dialog-mini body-small addWindow"
|
||||
v-el-drag-dialog
|
||||
:title="titleStr"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="editServiceVisible"
|
||||
>
|
||||
<EditForm
|
||||
v-if="editServiceVisible"
|
||||
@addSuccess="editSuccess"
|
||||
:detailInfo="editForm"
|
||||
@close="editServiceVisible = false"
|
||||
></EditForm>
|
||||
</el-dialog> -->
|
||||
|
||||
<!-- 导入护林员 -->
|
||||
<el-dialog
|
||||
width="400px"
|
||||
height="60%"
|
||||
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="importVisible"
|
||||
>
|
||||
<ImportForestranger v-if="importVisible" @importSuccess="importSuccess"></ImportForestranger>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AppConfigInfo from "/public/config/app.json";
|
||||
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 Treeselect from "@riophae/vue-treeselect";
|
||||
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 Sticky from "@/components/Sticky";
|
||||
import ImportForestranger from './widget/ImportForestranger.vue'
|
||||
import EditForm from './widget/EditForm.vue'
|
||||
let VUE_APP_BASE_IMG_URL = process.env.VUE_APP_BASE_IMG_URL
|
||||
export default {
|
||||
name: "module",
|
||||
|
||||
components: {
|
||||
// permissionBtn,
|
||||
Pagination,
|
||||
AddForm,
|
||||
Sticky,
|
||||
ImportForestranger,
|
||||
EditForm
|
||||
},
|
||||
mixins: [extend],
|
||||
directives: {
|
||||
waves,
|
||||
elDragDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
image_base:VUE_APP_BASE_IMG_URL,
|
||||
areaId:null,
|
||||
orgs:[],
|
||||
cascaderProps:{label:'name',value:'id',children:'child',checkStrictly: true},
|
||||
importVisible:false,
|
||||
rowdata: {},
|
||||
tableKey: 0,
|
||||
titleStr: "添加",
|
||||
tableData: [],
|
||||
addServiceVisible: false,
|
||||
editServiceVisible:false,
|
||||
total: 0,
|
||||
listQuery: {
|
||||
// 查询条件
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
createId:localStorage.getItem("userId")
|
||||
},
|
||||
detailInfo: [],
|
||||
clocklnglat: "",
|
||||
clockInList: [],
|
||||
clockInName: "",
|
||||
clockInVisible: false,
|
||||
rowdataKey: 1,
|
||||
flyCenter: [],
|
||||
clockDetail: {},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
filters: {},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
handleChange(e){
|
||||
this.listQuery.areaId = e && e[e.length-1];
|
||||
this.getList();
|
||||
},
|
||||
gethlyList(){
|
||||
getMethodCommon("/FireGrid/LoadUsers").then(res =>{
|
||||
this.orgs = res.data;
|
||||
this.handleOrgs();
|
||||
})
|
||||
},
|
||||
handleOrgs(orgs){
|
||||
for(let i=0;i<this.orgs[0].child.length;i++){
|
||||
if(this.orgs[0].child[i]){
|
||||
if(this.orgs[0].child[i].child){
|
||||
this.orgs[0].child[i].child = null;
|
||||
}
|
||||
|
||||
// for(let j=0;j<this.orgs[0].child[i].child.length;j++){
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
importSuccess(){
|
||||
this.importVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
rightClick(e) {
|
||||
console.log("rightClick", e);
|
||||
this.clockInVisible = true;
|
||||
this.clocklnglat = e;
|
||||
this.clockDetail = null;
|
||||
},
|
||||
editClock(e) {
|
||||
console.log("223311", e);
|
||||
this.clockDetail = e;
|
||||
this.clockInVisible = true;
|
||||
},
|
||||
gofly(item) {
|
||||
console.log("iii", item);
|
||||
this.flyCenter = [item.lng, item.lat];
|
||||
},
|
||||
delItem(item) {
|
||||
console.log("123", item);
|
||||
let param = {
|
||||
id: item.id,
|
||||
};
|
||||
this.$confirm("确定删除本条数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
postMethodCommon("/FireGrid/DeleteCheckPoint?id=" + param.id).then(
|
||||
(res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
});
|
||||
}
|
||||
this.rowdataKey++;
|
||||
this.getClockInList();
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
clockInSuccess() {
|
||||
this.rowdataKey++;
|
||||
this.getClockInList();
|
||||
},
|
||||
getClockInList() {
|
||||
let param = {
|
||||
name: this.clockInName,
|
||||
};
|
||||
getMethodCommon("/FireGrid/GetTotalCheckPoint", param).then((res) => {
|
||||
this.clockInList = res.result;
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.addServiceVisible = true;
|
||||
this.detailInfo = [];
|
||||
this.titleStr = "添加";
|
||||
},
|
||||
addSuccess() {
|
||||
this.addServiceVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
editSuccess(){
|
||||
this.editServiceVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
del() {
|
||||
var _this = this;
|
||||
if (this.multipleSelection.length != 1) {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "请选择一条数据进行删除",
|
||||
});
|
||||
return;
|
||||
}
|
||||
let ids = []
|
||||
this.multipleSelection.forEach((item,index)=>{
|
||||
ids.push(item.id)
|
||||
})
|
||||
|
||||
console.log("ids",ids)
|
||||
this.$confirm("确定删除所选数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
postMethodCommon("/Grid/DeleteMessage",ids).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
});
|
||||
}
|
||||
_this.getList();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
react() {
|
||||
if (this.multipleSelection.length != 1) {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "请选择一条数据进行编辑",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.editForm = this.multipleSelection[0];
|
||||
this.editServiceVisible = true;
|
||||
this.titleStr = "编辑";
|
||||
},
|
||||
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("/Grid/LoadAllUserMessage", this.listQuery).then(
|
||||
(res) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res);
|
||||
this.tableData = res.data;
|
||||
|
||||
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();
|
||||
},
|
||||
|
||||
handleUpdate() {
|
||||
this.editForm = this.multipleSelection[0];
|
||||
this.editServiceVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.filter-container {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.site-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
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: 94%;
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
}
|
||||
|
||||
.app-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.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;
|
||||
}
|
||||
.forestlistbox {
|
||||
height: calc(100% - 30px);
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
}
|
||||
.forestUl {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,264 @@
|
|||
<template>
|
||||
<div style="width:100%;height:680px;padding:24px;">
|
||||
<el-input placeholder="通知标题" v-model="formData.messageTitle" style="margin-bottom:20px" size="small" ></el-input>
|
||||
|
||||
<editor v-model="formData.messageContent" :init="init" ></editor>
|
||||
|
||||
<p style="color:#fff;">
|
||||
(扫码信息消息接收人员)
|
||||
<el-link type="primary" style="float:left;" @click="selectUserVisible = true;"> <i class="el-icon el-icon-plus"></i>添加消息接收人员</el-link>
|
||||
|
||||
</p>
|
||||
<el-table
|
||||
:data="siteUser"
|
||||
border
|
||||
height="150px"
|
||||
style="width: 100%">
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="用户姓名"
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="phone"
|
||||
label="联系电话"
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="delUser(scope)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="select-user-container" v-if="selectUserVisible">
|
||||
<selectUser @cancle="selectUserVisible=false" @confirm="selectUserSuccess"></selectUser>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<i class="el-icon-warning-outline" style="margin:12px 0px;">不添加消息接收人员点击确定按钮,默认给全部人员发送通知消息。</i>
|
||||
</p>
|
||||
<el-button type="primary" size="mini" @click="release()">确定</el-button>
|
||||
<el-button type="default" size="mini" @click="close()">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import tinymce from "/public/static/tinymce/tinymce";
|
||||
import Editor from "@tinymce/tinymce-vue";
|
||||
import "/public/static/tinymce/themes/silver";
|
||||
import 'tinymce/skins/ui/oxide/skin.css';
|
||||
import "/public/static/tinymce/plugins/image";
|
||||
import "/public/static/tinymce/plugins/media";
|
||||
import "/public/static/tinymce/plugins/table";
|
||||
import "/public/static/tinymce/plugins/lists";
|
||||
import "/public/static/tinymce/plugins/contextmenu";
|
||||
import "/public/static/tinymce/plugins/wordcount";
|
||||
import "/public/static/tinymce/plugins/colorpicker";
|
||||
import "/public/static/tinymce/plugins/textcolor";
|
||||
import "/public/static/tinymce/plugins/preview";
|
||||
import "/public/static/tinymce/plugins/code";
|
||||
import "/public/static/tinymce/plugins/link";
|
||||
import "/public/static/tinymce/plugins/advlist";
|
||||
import "/public/static/tinymce/plugins/codesample";
|
||||
import "/public/static/tinymce/plugins/hr";
|
||||
import "/public/static/tinymce/plugins/fullscreen";
|
||||
import "/public/static/tinymce/plugins/textpattern";
|
||||
import "/public/static/tinymce/plugins/searchreplace";
|
||||
import "/public/static/tinymce/plugins/autolink";
|
||||
import "/public/static/tinymce/plugins/directionality";
|
||||
import "/public/static/tinymce/plugins/visualblocks";
|
||||
import "/public/static/tinymce/plugins/visualchars";
|
||||
import "/public/static/tinymce/plugins/template";
|
||||
import "/public/static/tinymce/plugins/charmap";
|
||||
import "/public/static/tinymce/plugins/nonbreaking";
|
||||
import "/public/static/tinymce/plugins/insertdatetime";
|
||||
import "/public/static/tinymce/plugins/imagetools";
|
||||
import "/public/static/tinymce/plugins/autosave";
|
||||
import "/public/static/tinymce/plugins/autoresize";
|
||||
|
||||
|
||||
import axios from 'axios';
|
||||
import { getMethodCommon,postMethodCommon } from '../../../api/common';
|
||||
const BASE_IMAGE_API = process.env.VUE_APP_BASE_IMG_URL;
|
||||
import selectUser from './SelectRoles.vue';
|
||||
// import "tinymce/icons/default/icons";
|
||||
export default {
|
||||
name:"ArticleManagement",
|
||||
props: {
|
||||
isAdd:Boolean,
|
||||
id:Number,
|
||||
value: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
// 默认插件 这里写的比较全,基本上是全部了
|
||||
plugins: {
|
||||
type: [String, Array],
|
||||
default:
|
||||
"preview searchreplace autolink directionality visualblocks visualchars fullscreen image link template code codesample charmap hr nonbreaking insertdatetime advlist lists wordcount imagetools textpattern autosave bdmap autoresize lineheight"
|
||||
},
|
||||
// 默认工具栏 这里写的比较全,基本上是全部了
|
||||
toolbar: {
|
||||
type: [String, Array],
|
||||
default:
|
||||
"code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link codesample | alignleft aligncenter alignright alignjustify outdent indent lineheight formatpainter | \
|
||||
styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
|
||||
image charmap hr pagebreak insertdatetime | bdmap fullscreen preview"
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Editor,
|
||||
selectUser
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
siteUser:[],
|
||||
selectUserVisible:false,
|
||||
formData:{
|
||||
messageContent:null,
|
||||
messageTitle:null,
|
||||
siteUser:[]
|
||||
},
|
||||
cateTree:[],
|
||||
defaultProps:{
|
||||
|
||||
},
|
||||
content:null,
|
||||
init: {
|
||||
language_url: "/static/tinymce/langs/zh-Hans.js", // 中文语言包路径
|
||||
language: "zh-Hans",
|
||||
skin_url: "/static/tinymce/skins/ui/oxide",
|
||||
height: 500,
|
||||
min_height: 500,
|
||||
max_height: 500,
|
||||
width:"auto",
|
||||
toolbar_mode: "wrap",
|
||||
plugins: this.plugins,
|
||||
toolbar: this.toolbar,
|
||||
content_style: "p {margin: 5px 0;}",
|
||||
fontsize_formats: "12px 14px 16px 18px 24px 36px 48px 56px 72px",
|
||||
font_formats:
|
||||
"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",
|
||||
branding: false,
|
||||
images_upload_url:BASE_IMAGE_API+"/api/Files/Upload",
|
||||
|
||||
images_upload_handler:(blobInfo, success, failure) => {
|
||||
let fd = new FormData()
|
||||
fd.append('files',blobInfo.blob())
|
||||
axios.post(BASE_IMAGE_API+'/api/Files/Upload',fd).then(res=>{
|
||||
success(BASE_IMAGE_API+"/"+res.data.result[0].filePath);
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
created(){
|
||||
// this.getCateTree();
|
||||
this.getArticleDetail();
|
||||
|
||||
},
|
||||
mounted() {
|
||||
tinymce.init({}); // 这里传个空对象就可以了
|
||||
},
|
||||
|
||||
methods:{
|
||||
selectUserSuccess(e){
|
||||
let _this = this;
|
||||
console.log("EEEEEEE",e);
|
||||
e.forEach((item,index)=>{
|
||||
let obj = {
|
||||
"siteUserId": item.Id,
|
||||
"userRole": 0,
|
||||
"name": item.Name,
|
||||
"phone": item.Account
|
||||
}
|
||||
_this.siteUser.push(obj)
|
||||
console.log("obj",this.siteUser)
|
||||
// this.siteUser.push(obj);
|
||||
})
|
||||
this.selectUserVisible = false;
|
||||
},
|
||||
getArticleDetail(){
|
||||
|
||||
},
|
||||
delUser(scope){
|
||||
this.siteUser.splice(scope.$index,1);
|
||||
},
|
||||
|
||||
// getCateTree(){
|
||||
// postMethodCommon("/CimApiDescCategory/LoadTree").then(res=>{
|
||||
// if(res.code == 200){
|
||||
// this.cateTree = res.data;
|
||||
// this.cateTree.forEach((item,index)=>{
|
||||
// this.cateTree[index].label = item.name;
|
||||
// this.cateTree[index].value = item.id;
|
||||
// this.cateTree[index].children = [];
|
||||
// if(item.child.length>0){
|
||||
// item.child.forEach((it,idx)=>{
|
||||
// let obj = {
|
||||
// label:it.name,
|
||||
// value:it.id,
|
||||
// }
|
||||
// this.cateTree[index].children.push(obj);
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// if(!this.isAdd){
|
||||
// this.getArticleDetail();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
|
||||
handleChange(val){
|
||||
this.formData.category_id= val[1];
|
||||
},
|
||||
|
||||
close(){
|
||||
this.$emit("close");
|
||||
},
|
||||
|
||||
release(){
|
||||
this.formData.userId = [];
|
||||
this.formData.createId = localStorage.getItem("userId")
|
||||
this.siteUser.forEach((item,index)=>{
|
||||
this.formData.userId.push(item.siteUserId)
|
||||
})
|
||||
console.log("formData",this.formData);
|
||||
delete this.formData.siteUser
|
||||
postMethodCommon("/Grid/AddMessage",this.formData).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.$message({
|
||||
type:"success",
|
||||
message:"操作成功",
|
||||
})
|
||||
this.close();
|
||||
this.$emit("addSuccess")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.select-user-container{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:0px;
|
||||
z-index:99999;
|
||||
background:#fff;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,287 @@
|
|||
<template>
|
||||
<div style="width:100%;height:680px;padding:24px;">
|
||||
<el-input placeholder="通知标题" v-model="formData.messageTitle" style="margin-bottom:20px" size="small" ></el-input>
|
||||
|
||||
<editor v-model="formData.messageContent" :init="init" style="position:relative;z-index:9999999999;" ></editor>
|
||||
|
||||
<p style="color:#fff;">
|
||||
|
||||
<el-link type="primary" style="float:left;" @click="selectUserVisible = true;"> <i class="el-icon el-icon-plus"></i>添加消息接收人员(默认发送所有人员)</el-link>
|
||||
|
||||
</p>
|
||||
<el-table
|
||||
:data="siteUser"
|
||||
border
|
||||
height="150px"
|
||||
style="width: 100%">
|
||||
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="用户姓名"
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="phone"
|
||||
label="是否已读"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.phone==1 ? '已读' : '未读' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="delUser(scope)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="select-user-container" v-if="selectUserVisible">
|
||||
<selectUser @cancle="selectUserVisible=false" @confirm="selectUserSuccess"></selectUser>
|
||||
</div>
|
||||
<p>
|
||||
<i class="el-icon-warning-outline" style="margin:12px 0px;">不添加消息接收人员点击确定按钮,默认给全部人员发送通知消息。</i>
|
||||
</p>
|
||||
<el-button type="primary" size="mini" style="margin-top:12px;" @click="release()">确定</el-button>
|
||||
<el-button type="default" size="mini" style="margin-top:12px;" @click="close()">取消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import tinymce from "/public/static/tinymce/tinymce";
|
||||
import Editor from "@tinymce/tinymce-vue";
|
||||
import "/public/static/tinymce/themes/silver";
|
||||
import 'tinymce/skins/ui/oxide/skin.css';
|
||||
import "/public/static/tinymce/plugins/image";
|
||||
import "/public/static/tinymce/plugins/media";
|
||||
import "/public/static/tinymce/plugins/table";
|
||||
import "/public/static/tinymce/plugins/lists";
|
||||
import "/public/static/tinymce/plugins/contextmenu";
|
||||
import "/public/static/tinymce/plugins/wordcount";
|
||||
import "/public/static/tinymce/plugins/colorpicker";
|
||||
import "/public/static/tinymce/plugins/textcolor";
|
||||
import "/public/static/tinymce/plugins/preview";
|
||||
import "/public/static/tinymce/plugins/code";
|
||||
import "/public/static/tinymce/plugins/link";
|
||||
import "/public/static/tinymce/plugins/advlist";
|
||||
import "/public/static/tinymce/plugins/codesample";
|
||||
import "/public/static/tinymce/plugins/hr";
|
||||
import "/public/static/tinymce/plugins/fullscreen";
|
||||
import "/public/static/tinymce/plugins/textpattern";
|
||||
import "/public/static/tinymce/plugins/searchreplace";
|
||||
import "/public/static/tinymce/plugins/autolink";
|
||||
import "/public/static/tinymce/plugins/directionality";
|
||||
import "/public/static/tinymce/plugins/visualblocks";
|
||||
import "/public/static/tinymce/plugins/visualchars";
|
||||
import "/public/static/tinymce/plugins/template";
|
||||
import "/public/static/tinymce/plugins/charmap";
|
||||
import "/public/static/tinymce/plugins/nonbreaking";
|
||||
import "/public/static/tinymce/plugins/insertdatetime";
|
||||
import "/public/static/tinymce/plugins/imagetools";
|
||||
import "/public/static/tinymce/plugins/autosave";
|
||||
import "/public/static/tinymce/plugins/autoresize";
|
||||
|
||||
|
||||
import axios from 'axios';
|
||||
import { getMethodCommon,postMethodCommon } from '../../../api/common';
|
||||
const BASE_IMAGE_API = process.env.VUE_APP_BASE_IMG_URL;
|
||||
import selectUser from './SelectRoles.vue';
|
||||
// import "tinymce/icons/default/icons";
|
||||
export default {
|
||||
name:"ArticleManagement",
|
||||
props: {
|
||||
detailInfo:Object,
|
||||
isAdd:Boolean,
|
||||
id:Number,
|
||||
value: {
|
||||
type: String,
|
||||
default: ""
|
||||
},
|
||||
// 默认插件 这里写的比较全,基本上是全部了
|
||||
plugins: {
|
||||
type: [String, Array],
|
||||
default:
|
||||
"preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code codesample charmap hr nonbreaking insertdatetime advlist lists wordcount imagetools textpattern autosave bdmap autoresize lineheight"
|
||||
},
|
||||
// 默认工具栏 这里写的比较全,基本上是全部了
|
||||
toolbar: {
|
||||
type: [String, Array],
|
||||
default:
|
||||
"code undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link codesample | alignleft aligncenter alignright alignjustify outdent indent lineheight formatpainter | \
|
||||
styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
|
||||
image media charmap hr pagebreak insertdatetime | bdmap fullscreen preview"
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Editor,
|
||||
selectUser
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
siteUser:[],
|
||||
selectUserVisible:false,
|
||||
formData:{
|
||||
messageContent:null,
|
||||
messageTitle:null,
|
||||
siteUser:[]
|
||||
},
|
||||
cateTree:[],
|
||||
defaultProps:{
|
||||
|
||||
},
|
||||
content:null,
|
||||
init: {
|
||||
language_url: "/static/tinymce/langs/zh-Hans.js", // 中文语言包路径
|
||||
language: "zh-Hans",
|
||||
skin_url: "/static/tinymce/skins/ui/oxide",
|
||||
height: 500,
|
||||
min_height: 500,
|
||||
max_height: 500,
|
||||
width:"auto",
|
||||
toolbar_mode: "wrap",
|
||||
plugins: this.plugins,
|
||||
toolbar: this.toolbar,
|
||||
content_style: "p {margin: 5px 0;}",
|
||||
fontsize_formats: "12px 14px 16px 18px 24px 36px 48px 56px 72px",
|
||||
font_formats:
|
||||
"微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;",
|
||||
branding: false,
|
||||
images_upload_url:BASE_IMAGE_API+"/api/Files/Upload",
|
||||
|
||||
images_upload_handler:(blobInfo, success, failure) => {
|
||||
let fd = new FormData()
|
||||
fd.append('files',blobInfo.blob())
|
||||
axios.post(BASE_IMAGE_API+'/api/Files/Upload',fd).then(res=>{
|
||||
success(BASE_IMAGE_API+"/"+res.data.result[0].filePath);
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.formData = this.detailInfo
|
||||
this.siteUser = []
|
||||
this.formData.users.forEach((item,index)=>{
|
||||
let obj = {
|
||||
"siteUserId": item.recipient,
|
||||
"userRole": 0,
|
||||
"name": item.recipientName,
|
||||
"phone": item.isRead
|
||||
}
|
||||
this.siteUser.push(obj)
|
||||
})
|
||||
// this.getCateTree();
|
||||
this.getArticleDetail();
|
||||
|
||||
},
|
||||
mounted() {
|
||||
tinymce.init({}); // 这里传个空对象就可以了
|
||||
},
|
||||
|
||||
methods:{
|
||||
selectUserSuccess(e){
|
||||
let _this = this;
|
||||
console.log(e,_this.siteUser);
|
||||
|
||||
e.forEach((item,index)=>{
|
||||
let user = _this.siteUser.find((it,idx)=>{
|
||||
return it.siteUserId == item.Id
|
||||
})
|
||||
if(user){
|
||||
|
||||
}else{
|
||||
let obj = {
|
||||
"siteUserId": item.Id,
|
||||
"userRole": 0,
|
||||
"name": item.Name,
|
||||
"phone": item.Account
|
||||
}
|
||||
_this.siteUser.push(obj)
|
||||
}
|
||||
|
||||
// this.siteUser.push(obj);
|
||||
})
|
||||
this.selectUserVisible = false;
|
||||
},
|
||||
getArticleDetail(){
|
||||
|
||||
},
|
||||
delUser(scope){
|
||||
this.siteUser.splice(scope.$index,1);
|
||||
},
|
||||
|
||||
// getCateTree(){
|
||||
// postMethodCommon("/CimApiDescCategory/LoadTree").then(res=>{
|
||||
// if(res.code == 200){
|
||||
// this.cateTree = res.data;
|
||||
// this.cateTree.forEach((item,index)=>{
|
||||
// this.cateTree[index].label = item.name;
|
||||
// this.cateTree[index].value = item.id;
|
||||
// this.cateTree[index].children = [];
|
||||
// if(item.child.length>0){
|
||||
// item.child.forEach((it,idx)=>{
|
||||
// let obj = {
|
||||
// label:it.name,
|
||||
// value:it.id,
|
||||
// }
|
||||
// this.cateTree[index].children.push(obj);
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// if(!this.isAdd){
|
||||
// this.getArticleDetail();
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
|
||||
handleChange(val){
|
||||
this.formData.category_id= val[1];
|
||||
},
|
||||
|
||||
close(){
|
||||
this.$emit("close");
|
||||
},
|
||||
|
||||
release(){
|
||||
this.formData.userId = [];
|
||||
this.formData.createId = localStorage.getItem("userId")
|
||||
this.siteUser.forEach((item,index)=>{
|
||||
this.formData.userId.push(item.siteUserId)
|
||||
})
|
||||
console.log("formData",this.formData);
|
||||
delete this.formData.siteUser
|
||||
delete this.formData.users;
|
||||
postMethodCommon("/Grid/EditMessage",this.formData).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.$message({
|
||||
type:"success",
|
||||
message:"操作成功",
|
||||
})
|
||||
this.close();
|
||||
this.$emit("addSuccess")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.select-user-container{
|
||||
width:100%;
|
||||
height:100%;
|
||||
position:absolute;
|
||||
top:0px;
|
||||
left:0px;
|
||||
z-index:99999;
|
||||
background:#fff;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
<template>
|
||||
<div class=''>
|
||||
<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:60px;line-height:0px;"></i>
|
||||
<div class="el-upload__text">将Excel文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
|
||||
<p style="text-align: right;margin-top:18px;">
|
||||
<el-button type="primary" size="mini" @click="onSubmit">导入信息</el-button>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { postMethodCommon } from '../../../api/common';
|
||||
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props:[],
|
||||
data() {
|
||||
return {
|
||||
limit:1,
|
||||
fileList:[],
|
||||
form:{},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
methods: {
|
||||
//文件上传时的钩子
|
||||
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]
|
||||
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 !== 'apk') {
|
||||
|
||||
this.$message.warning('只能上传后缀是.apk的文件')
|
||||
return false
|
||||
}
|
||||
if (size > 100) {
|
||||
this.$message.warning('文件大小不得超过100M')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
onSubmit() {
|
||||
let _this = this
|
||||
let formData = new FormData();
|
||||
this.fileList.forEach(item => {
|
||||
formData.append("files", item.raw);
|
||||
});
|
||||
if (this.fileList.length === 0) {
|
||||
this.$message.warning(`请选择上传文件!!`)
|
||||
return
|
||||
}
|
||||
postMethodCommon("/Files/Upload", formData).then(res => {
|
||||
if (res.code === 200) {
|
||||
_this.form.filepath = res.result[0].filePath
|
||||
|
||||
let param = {
|
||||
"file_path": res.result[0].filePath,
|
||||
"token": ""
|
||||
}
|
||||
postMethodCommon('/FireCodeApp/BatchExportRanger',param).then(res2 => {
|
||||
|
||||
_this.$emit("importSuccess")
|
||||
|
||||
_this.fileList = []
|
||||
|
||||
})
|
||||
} else {
|
||||
_this.$message.warning(`接口错误!!`)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,155 @@
|
|||
<template>
|
||||
<div class="select-user-container">
|
||||
<div class="operate-container">
|
||||
<el-link type="default" @click="$emit('cancle')">取消</el-link>
|
||||
<el-link type="primary" style="float:right;" @click="$emit('confirm',multipleSelection)">确定</el-link>
|
||||
</div>
|
||||
|
||||
<div class="search-container">
|
||||
<el-select v-model="listQuery.unitname" clearable style="width:200px;margin-right:15px;" placeholder="请选择单位" size="mini" @change="selectChange" >
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.unitName"
|
||||
:value="item.unitName">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-input placeholder="请输入人员名称" v-model="listQuery.username" @keyup.enter="getList" style="width:300px;margin-right:15px;" size="mini"></el-input>
|
||||
|
||||
<el-button type="default" size="mini" icon="el-icon-search" @click="getListByBtn">搜索</el-button>
|
||||
</div>
|
||||
|
||||
<el-table ref="mainTable2" :data="tableData"
|
||||
:reserve-selection="true"
|
||||
highlight-current-row @selection-change="handleSelectionChange" :row-key="getRowKeys">
|
||||
|
||||
<el-table-column type="selection" align="center" width="55" :reserve-selection="true">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" prop="Name" label="人员名称" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" prop="UnitName" label="单位名称" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" prop="Account" label="联系电话" show-overflow-tooltip>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
|
||||
<el-pagination
|
||||
background
|
||||
style="margin-top:12px;"
|
||||
@current-change="pageChange"
|
||||
layout="prev, pager, next"
|
||||
:page-size="15"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getMethodCommon,postMethodCommon} from '../../../api/common'
|
||||
export default {
|
||||
name:"SelectRoles",
|
||||
props:['serviceId'],
|
||||
data(){
|
||||
return {
|
||||
unitOptions:[],
|
||||
listQuery:{
|
||||
pageIndex: 1,
|
||||
pageSize: 15,
|
||||
username: null,
|
||||
unitName:null,
|
||||
},
|
||||
tableData:[],
|
||||
total:0,
|
||||
multipleSelection:[],
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.handleGetUnitList();
|
||||
this.getList();
|
||||
},
|
||||
methods:{
|
||||
getListByBtn(){
|
||||
this.listQuery.pageIndex = 1;
|
||||
this.getList()
|
||||
},
|
||||
selectChange(e){
|
||||
this.listQuery.pageIndex = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleGetUnitList(){
|
||||
getMethodCommon("/FireCodePC/GetUserUnit?pageIndex=1&pageSize=999").then(res=>{
|
||||
if(res.code == 200){
|
||||
this.unitOptions = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
pageChange(e){
|
||||
this.listQuery.pageIndex = e;
|
||||
this.getList();
|
||||
},
|
||||
getListById(){
|
||||
postMethodCommon("/CimService/GetRoleByServiceId?ServiceId="+this.serviceId).then(res=>{
|
||||
if(res.code == 200){
|
||||
let _this = this;
|
||||
res.result.forEach((item,index)=>{
|
||||
_this.$nextTick(()=>{
|
||||
_this.$refs.mainTable2.toggleRowSelection(_this.tableData.find(row=>{
|
||||
return row.Id == item.Id;
|
||||
}),true);
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getList(){
|
||||
getMethodCommon("/FireCodeApp/GetForestryUser", this.listQuery).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.tableData = res.data;
|
||||
this.total = res.count;
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
getRowKeys(row){
|
||||
return row.Id
|
||||
},
|
||||
handleSelectionChange(val){
|
||||
this.multipleSelection = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.select-user-container{
|
||||
width:100%;
|
||||
height:100%;
|
||||
padding:20px;
|
||||
background:#fff;
|
||||
}
|
||||
.operate-container{
|
||||
width:100%;
|
||||
height:40px;
|
||||
}
|
||||
|
||||
.search-container{
|
||||
width:100%;
|
||||
height:40px;
|
||||
margin:5px 0px;
|
||||
}
|
||||
|
||||
::v-deep .el-input__inner{
|
||||
background:none!important;
|
||||
color:#666!important;
|
||||
}
|
||||
|
||||
::v-deep .el-table th.el-table__cell{
|
||||
border:0px!important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
const validateMobile = function (rule, value, callback) {
|
||||
let newValue = value.replace(/[^0-9]/gi, '')
|
||||
if (value !== newValue) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else if (newValue.length !== 11) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const validID = function(rule, value, callback) {
|
||||
// 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
|
||||
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
||||
if (reg.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入正确的身份证号码"));
|
||||
}
|
||||
}
|
||||
var validateStock = (rule, value, callback) => {
|
||||
if (!value || value == 0) {
|
||||
callback(new Error("不能为空"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
export { validateMobile ,validID,validateStock}
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
扫码<br/>下载 APP
|
||||
</div>
|
||||
<div class="code-image">
|
||||
<img src="/img/navigation/code.png" alt="">
|
||||
<VueQr :text="QRCode" :size="400"></VueQr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -48,10 +48,17 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import VueQr from "vue-qr"
|
||||
import { getMethodCommon } from "../../api/common";
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
components:{
|
||||
VueQr
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
QRCode: null,
|
||||
routerlist:[
|
||||
{
|
||||
lable:"防灭火沙盘",
|
||||
|
|
@ -61,7 +68,7 @@
|
|||
},{
|
||||
lable:"数据中心",
|
||||
icon:"4",
|
||||
url:"http://60.217.22.180:9003/#/dashboard?id="+ localStorage.getItem("X-Token"),
|
||||
url:"http://60.217.22.153:9003/#/dashboard?id="+ localStorage.getItem("X-Token"),
|
||||
bgColor:"linear-gradient(180deg, #E0FF13 0%, #086D3C 100%)"
|
||||
},{
|
||||
lable:"管理中心",
|
||||
|
|
@ -72,16 +79,26 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.getAppUrl();
|
||||
},
|
||||
methods: {
|
||||
goDetail(item) {
|
||||
if (item.lable == '数据中心') {
|
||||
window.open('http://60.217.22.180:9003/#/dashboard?id=' + localStorage.getItem("X-Token"), '_blank')
|
||||
window.open('http://60.217.22.153: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 })
|
||||
}
|
||||
},
|
||||
getAppUrl(){
|
||||
getMethodCommon("/FireCodeApp/GetUpdateFiles",{project:"yishuixian"}).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.QRCode = process.env.VUE_APP_BASE_IMG_URL+'/'+ res.data.filepath;
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,565 @@
|
|||
<template>
|
||||
<div class="site-content">
|
||||
<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.name"
|
||||
>
|
||||
</el-input>
|
||||
|
||||
<el-button type="primary" size="mini" @click="getList()" icon="el-icon-search"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button type="primary" size="mini" @click="add()" icon="el-icon-plus">添加</el-button>
|
||||
<el-button type="warning" size="mini" @click="react()" icon="el-icon-edit">编辑</el-button>
|
||||
<el-button type="danger" size="mini" @click="del()" icon="el-icon-delete">删除</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">
|
||||
<div class="flex jc-sb" style="height: calc(100% - 100px)">
|
||||
<div class="mr-1 max-h" style="width:100%;">
|
||||
<el-table
|
||||
ref="mainTable"
|
||||
:key="tableKey"
|
||||
:data="tableData"
|
||||
v-loading="listLoading"
|
||||
border
|
||||
fit
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
height="100%"
|
||||
@row-click="rowClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" align="center" width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="imaUrl"
|
||||
label="图标"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<img :src="image_base+'/'+scope.row.imaUrl" alt="">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="unitName"
|
||||
label="队伍名称"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="listQuery.pageIndex"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
@pagination="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
width="40%"
|
||||
height="60%"
|
||||
top=" calc(50vh - 340px)"
|
||||
class="dialog-mini body-small addWindow"
|
||||
v-el-drag-dialog
|
||||
:title="titleStr"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="addServiceVisible"
|
||||
>
|
||||
<AddForm
|
||||
v-if="addServiceVisible"
|
||||
@addSuccess="addSuccess"
|
||||
:detailInfo="detailInfo"
|
||||
@close="addServiceVisible = false"
|
||||
></AddForm>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
width="40%"
|
||||
height="60%"
|
||||
top=" calc(50vh - 340px)"
|
||||
class="dialog-mini body-small addWindow"
|
||||
v-el-drag-dialog
|
||||
:title="titleStr"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:visible.sync="editServiceVisible"
|
||||
>
|
||||
<EditForm
|
||||
v-if="editServiceVisible"
|
||||
@addSuccess="editSuccess"
|
||||
:detailInfo="editForm"
|
||||
@close="editServiceVisible = false"
|
||||
></EditForm>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入护林员 -->
|
||||
<el-dialog
|
||||
width="400px"
|
||||
height="60%"
|
||||
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="importVisible"
|
||||
>
|
||||
<ImportForestranger v-if="importVisible" @importSuccess="importSuccess"></ImportForestranger>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AppConfigInfo from "/public/config/app.json";
|
||||
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 Treeselect from "@riophae/vue-treeselect";
|
||||
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 Sticky from "@/components/Sticky";
|
||||
import ImportForestranger from './widget/ImportForestranger.vue'
|
||||
import EditForm from './widget/EditForm.vue'
|
||||
let VUE_APP_BASE_IMG_URL = process.env.VUE_APP_BASE_IMG_URL
|
||||
export default {
|
||||
name: "module",
|
||||
components: {
|
||||
permissionBtn,
|
||||
Pagination,
|
||||
AddForm,
|
||||
Sticky,
|
||||
ImportForestranger,
|
||||
EditForm
|
||||
},
|
||||
mixins: [extend],
|
||||
directives: {
|
||||
waves,
|
||||
elDragDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
image_base:VUE_APP_BASE_IMG_URL,
|
||||
areaId:null,
|
||||
orgs:[],
|
||||
cascaderProps:{label:'name',value:'id',children:'child',checkStrictly: true},
|
||||
importVisible:false,
|
||||
rowdata: {},
|
||||
tableKey: 0,
|
||||
titleStr: "添加",
|
||||
tableData: [],
|
||||
addServiceVisible: false,
|
||||
editServiceVisible:false,
|
||||
total: 0,
|
||||
listQuery: {
|
||||
// 查询条件
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
name: null,
|
||||
},
|
||||
detailInfo: [],
|
||||
clocklnglat: "",
|
||||
clockInList: [],
|
||||
clockInName: "",
|
||||
clockInVisible: false,
|
||||
rowdataKey: 1,
|
||||
flyCenter: [],
|
||||
clockDetail: {},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
filters: {},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
handleChange(e){
|
||||
this.listQuery.areaId = e && e[e.length-1];
|
||||
this.getList();
|
||||
},
|
||||
gethlyList(){
|
||||
getMethodCommon("/FireGrid/LoadUsers").then(res =>{
|
||||
this.orgs = res.data;
|
||||
this.handleOrgs();
|
||||
})
|
||||
},
|
||||
handleOrgs(orgs){
|
||||
for(let i=0;i<this.orgs[0].child.length;i++){
|
||||
if(this.orgs[0].child[i]){
|
||||
if(this.orgs[0].child[i].child){
|
||||
this.orgs[0].child[i].child = null;
|
||||
}
|
||||
|
||||
// for(let j=0;j<this.orgs[0].child[i].child.length;j++){
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
importSuccess(){
|
||||
this.importVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
rightClick(e) {
|
||||
console.log("rightClick", e);
|
||||
this.clockInVisible = true;
|
||||
this.clocklnglat = e;
|
||||
this.clockDetail = null;
|
||||
},
|
||||
editClock(e) {
|
||||
console.log("223311", e);
|
||||
this.clockDetail = e;
|
||||
this.clockInVisible = true;
|
||||
},
|
||||
gofly(item) {
|
||||
console.log("iii", item);
|
||||
this.flyCenter = [item.lng, item.lat];
|
||||
},
|
||||
delItem(item) {
|
||||
console.log("123", item);
|
||||
let param = {
|
||||
id: item.id,
|
||||
};
|
||||
this.$confirm("确定删除本条数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
postMethodCommon("/FireGrid/DeleteCheckPoint?id=" + param.id).then(
|
||||
(res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
});
|
||||
}
|
||||
this.rowdataKey++;
|
||||
this.getClockInList();
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
clockInSuccess() {
|
||||
this.rowdataKey++;
|
||||
this.getClockInList();
|
||||
},
|
||||
getClockInList() {
|
||||
let param = {
|
||||
name: this.clockInName,
|
||||
};
|
||||
getMethodCommon("/FireGrid/GetTotalCheckPoint", param).then((res) => {
|
||||
this.clockInList = res.result;
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.addServiceVisible = true;
|
||||
this.detailInfo = [];
|
||||
this.titleStr = "添加";
|
||||
},
|
||||
addSuccess() {
|
||||
this.addServiceVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
editSuccess(){
|
||||
this.editServiceVisible = false;
|
||||
this.getList();
|
||||
},
|
||||
del() {
|
||||
var _this = this;
|
||||
if (this.multipleSelection.length != 1) {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "请选择一条数据进行删除",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定删除所选数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
postMethodCommon("/FireCodePC/DeleteUserUnitById?id=" +
|
||||
_this.multipleSelection[0].id,
|
||||
{}
|
||||
).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功",
|
||||
});
|
||||
}
|
||||
_this.getList();
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
react() {
|
||||
if (this.multipleSelection.length != 1) {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "请选择一条数据进行编辑",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.editForm = this.multipleSelection[0];
|
||||
this.editServiceVisible = true;
|
||||
this.titleStr = "编辑";
|
||||
},
|
||||
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/GetUserUnit", this.listQuery).then(
|
||||
(res) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res);
|
||||
this.tableData = res.data;
|
||||
|
||||
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();
|
||||
},
|
||||
|
||||
handleUpdate() {
|
||||
this.editForm = this.multipleSelection[0];
|
||||
this.editServiceVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
|
||||
.filter-container {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.site-container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
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: 94%;
|
||||
background: rgba(0, 9, 34, 0.6);
|
||||
}
|
||||
|
||||
.app-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.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;
|
||||
}
|
||||
.forestlistbox {
|
||||
height: calc(100% - 30px);
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
}
|
||||
.forestUl {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,230 @@
|
|||
<template>
|
||||
<div style="width:100%;height:50vh;padding:0px 23px; z-index:10;">
|
||||
<el-form ref="form" size="mini" :model="addForm" :rules="rules" label-width="140px">
|
||||
|
||||
<el-form-item label="队伍名称: " prop="unitName">
|
||||
<el-input v-model="addForm.unitName" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍类型: " prop="unitType">
|
||||
<el-input v-model="addForm.unitType" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍描述:" prop="description">
|
||||
<el-input v-model="addForm.description" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍图标:" prop="iocn">
|
||||
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
name="files"
|
||||
:action="upload_url"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload">
|
||||
<img v-if="addForm.imaUrl" :src="imaUrl_base+'/'+addForm.imaUrl" class="">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item style="margin-top: 16%;">
|
||||
<el-button @click="close()">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm('form')" >保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listToTreeSelect } from '@/utils'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { postMethodCommon, getMethodCommon } from '../../../api/common';
|
||||
import { validateMobile, validID, validateStock } from './validate.js'
|
||||
import form from '../../../store/modules/form';
|
||||
let BASE_IMAGE_URL = process.env.VUE_APP_BASE_API;
|
||||
let VUE_APP_BASE_IMG_URL = process.env.VUE_APP_BASE_IMG_URL
|
||||
|
||||
// let BASE_IMAGE_URL = BASE_IMAGE_API_URL;
|
||||
export default {
|
||||
name: "AddForm",
|
||||
props: ['detailInfo'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imaUrl_base:VUE_APP_BASE_IMG_URL,
|
||||
upload_url:BASE_IMAGE_URL+"/Files/Upload",
|
||||
BASE_IMAGE_URL: BASE_IMAGE_URL,
|
||||
addForm: {
|
||||
unitName:null,
|
||||
unitType:null,
|
||||
description:null,
|
||||
imaUrl:null,
|
||||
createTime:new Date(),
|
||||
id:0,
|
||||
createUserId:"1",
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '姓名不能为空', trigger: 'blur' },
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: '电话不能为空', trigger: 'blur' },
|
||||
{ validator: validateMobile.bind(this), trigger: 'blur' }
|
||||
],
|
||||
gender: [
|
||||
{ required: true, message: '性别不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
orgsTree: [], // 用户可访问到的所有机构组成的树
|
||||
selectRoles: [], // 用户分配的角色
|
||||
selectRoleNames: '',
|
||||
level:0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.detailInfo.length == 1) {
|
||||
// this.addForm = this.detailInfo[0];
|
||||
this.getDetail()
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selectOrgs: {
|
||||
get: function () {
|
||||
if (this.detailInfo.length == 1) {
|
||||
return this.addForm.areaId
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
},
|
||||
set: function (v) {
|
||||
var _this = this
|
||||
_this.addForm.areaId = v
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess(e){
|
||||
this.addForm.imaUrl = e.result[0].filePath
|
||||
},
|
||||
beforeAvatarUpload(e){
|
||||
console.log(e);
|
||||
return;
|
||||
},
|
||||
getDetail() {
|
||||
getMethodCommon("/FireCodeApp/GetForestryUserById?id=" + this.detailInfo[0].Id, {}).then(res => {
|
||||
if (res.code == 200) {
|
||||
let detail = {...res.data[0]};
|
||||
this.addForm.id = detail.Id;
|
||||
this.addForm.name = detail.Name;
|
||||
this.addForm.account = detail.Account;
|
||||
this.addForm.sex = detail.Sex;
|
||||
this.addForm.userRole = detail.UserRole;
|
||||
this.addForm.areaId = detail.areaId;
|
||||
// if(this.addForm.areaId){
|
||||
// var areaId = this.addForm.areaId.split(',')
|
||||
// this.addForm.areaId = turnNum(areaId)
|
||||
// }
|
||||
// var turnNum = function (nums) {
|
||||
// return nums.map(Number);
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
traverse(arr) {
|
||||
this.level++;
|
||||
if(this.level<3){
|
||||
if (arr && arr.length > 0) {
|
||||
var list = []
|
||||
arr.forEach(childelement => {
|
||||
list.push({
|
||||
id: childelement.id,
|
||||
label: childelement.areaName,
|
||||
parentId: childelement.pId || null,
|
||||
children: this.traverse(childelement.child)
|
||||
})
|
||||
});
|
||||
return list
|
||||
}
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 添加
|
||||
postMethodCommon("/FireCodePC/AddOrUpdateUserUnit", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "添加成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
createForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
// delete this.addForm.zrclist
|
||||
postMethodCommon("/FireCodeApp/EditForestryUser ", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "编辑成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .vue-treeselect__control {
|
||||
background: rgba(0, 9, 34, 0);
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
::v-deep .el-radio {
|
||||
color: #333;
|
||||
|
||||
}
|
||||
|
||||
.service-type-btn {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
text-align: center;
|
||||
margin-top: 100px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,228 @@
|
|||
<template>
|
||||
<div style="width:100%;height:50vh;padding:0px 23px; z-index:10;">
|
||||
<el-form ref="form" size="mini" :model="addForm" :rules="rules" label-width="140px">
|
||||
|
||||
<el-form-item label="队伍名称: " prop="unitName">
|
||||
<el-input v-model="addForm.unitName" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍类型: " prop="unitType">
|
||||
<el-input v-model="addForm.unitType" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍描述:" prop="description">
|
||||
<el-input v-model="addForm.description" style="width:300px ;"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="队伍图标:" prop="iocn">
|
||||
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
name="files"
|
||||
:action="upload_url"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload">
|
||||
<img v-if="addForm.imaUrl" :src="imaUrl_base+'/'+addForm.imaUrl" class="">
|
||||
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item style="margin-top: 16%;">
|
||||
<el-button @click="close()">取消</el-button>
|
||||
<el-button type="primary" @click="submitForm('form')" >保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listToTreeSelect } from '@/utils'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { postMethodCommon, getMethodCommon } from '../../../api/common';
|
||||
import { validateMobile, validID, validateStock } from './validate.js'
|
||||
import form from '../../../store/modules/form';
|
||||
let BASE_IMAGE_URL = process.env.VUE_APP_BASE_API;
|
||||
let VUE_APP_BASE_IMG_URL = process.env.VUE_APP_BASE_IMG_URL
|
||||
|
||||
// let BASE_IMAGE_URL = BASE_IMAGE_API_URL;
|
||||
export default {
|
||||
name: "AddForm",
|
||||
props: ['detailInfo'],
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
imaUrl_base:VUE_APP_BASE_IMG_URL,
|
||||
upload_url:BASE_IMAGE_URL+"/Files/Upload",
|
||||
BASE_IMAGE_URL: BASE_IMAGE_URL,
|
||||
addForm: {
|
||||
unitName:null,
|
||||
unitType:null,
|
||||
description:null,
|
||||
imaUrl:null,
|
||||
createTime:new Date(),
|
||||
id:0,
|
||||
createUserId:"1",
|
||||
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '姓名不能为空', trigger: 'blur' },
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: '电话不能为空', trigger: 'blur' },
|
||||
{ validator: validateMobile.bind(this), trigger: 'blur' }
|
||||
],
|
||||
gender: [
|
||||
{ required: true, message: '性别不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
dialogFormVisible: false,
|
||||
orgsTree: [], // 用户可访问到的所有机构组成的树
|
||||
selectRoles: [], // 用户分配的角色
|
||||
selectRoleNames: '',
|
||||
level:0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.addForm = this.detailInfo;
|
||||
|
||||
},
|
||||
computed: {
|
||||
selectOrgs: {
|
||||
get: function () {
|
||||
if (this.detailInfo.length == 1) {
|
||||
return this.addForm.areaId
|
||||
} else {
|
||||
return []
|
||||
}
|
||||
},
|
||||
set: function (v) {
|
||||
var _this = this
|
||||
_this.addForm.areaId = v
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleAvatarSuccess(e){
|
||||
this.addForm.imaUrl = e.result[0].filePath
|
||||
},
|
||||
beforeAvatarUpload(e){
|
||||
console.log(e);
|
||||
return;
|
||||
},
|
||||
getDetail() {
|
||||
getMethodCommon("/FireCodeApp/GetForestryUserById?id=" + this.detailInfo[0].Id, {}).then(res => {
|
||||
if (res.code == 200) {
|
||||
let detail = {...res.data[0]};
|
||||
this.addForm.id = detail.Id;
|
||||
this.addForm.name = detail.Name;
|
||||
this.addForm.account = detail.Account;
|
||||
this.addForm.sex = detail.Sex;
|
||||
this.addForm.userRole = detail.UserRole;
|
||||
this.addForm.areaId = detail.areaId;
|
||||
// if(this.addForm.areaId){
|
||||
// var areaId = this.addForm.areaId.split(',')
|
||||
// this.addForm.areaId = turnNum(areaId)
|
||||
// }
|
||||
// var turnNum = function (nums) {
|
||||
// return nums.map(Number);
|
||||
// }
|
||||
}
|
||||
})
|
||||
},
|
||||
traverse(arr) {
|
||||
this.level++;
|
||||
if(this.level<3){
|
||||
if (arr && arr.length > 0) {
|
||||
var list = []
|
||||
arr.forEach(childelement => {
|
||||
list.push({
|
||||
id: childelement.id,
|
||||
label: childelement.areaName,
|
||||
parentId: childelement.pId || null,
|
||||
children: this.traverse(childelement.child)
|
||||
})
|
||||
});
|
||||
return list
|
||||
}
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 添加
|
||||
postMethodCommon("/FireCodePC/AddOrUpdateUserUnit", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "添加成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
createForm() {
|
||||
var _this = this
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
// delete this.addForm.zrclist
|
||||
postMethodCommon("/FireCodeApp/EditForestryUser ", _this.addForm).then(response => {
|
||||
if (response.code == 200) {
|
||||
// 上传shp
|
||||
this.$emit("addSuccess");
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "编辑成功"
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.$emit("close");
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .vue-treeselect__control {
|
||||
background: rgba(0, 9, 34, 0);
|
||||
}
|
||||
|
||||
::v-deep .el-form-item__label {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
::v-deep .el-radio {
|
||||
color: #333;
|
||||
|
||||
}
|
||||
|
||||
.service-type-btn {
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
text-align: center;
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
<template>
|
||||
<div class=''>
|
||||
<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:60px;line-height:0px;"></i>
|
||||
<div class="el-upload__text">将Excel文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
|
||||
<p style="text-align: right;margin-top:18px;">
|
||||
<el-button type="primary" size="mini" @click="onSubmit">导入信息</el-button>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { postMethodCommon } from '../../../api/common';
|
||||
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props:[],
|
||||
data() {
|
||||
return {
|
||||
limit:1,
|
||||
fileList:[],
|
||||
form:{},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
methods: {
|
||||
//文件上传时的钩子
|
||||
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]
|
||||
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 !== 'apk') {
|
||||
|
||||
this.$message.warning('只能上传后缀是.apk的文件')
|
||||
return false
|
||||
}
|
||||
if (size > 100) {
|
||||
this.$message.warning('文件大小不得超过100M')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
onSubmit() {
|
||||
let _this = this
|
||||
let formData = new FormData();
|
||||
this.fileList.forEach(item => {
|
||||
formData.append("files", item.raw);
|
||||
});
|
||||
if (this.fileList.length === 0) {
|
||||
this.$message.warning(`请选择上传文件!!`)
|
||||
return
|
||||
}
|
||||
postMethodCommon("/Files/Upload", formData).then(res => {
|
||||
if (res.code === 200) {
|
||||
_this.form.filepath = res.result[0].filePath
|
||||
|
||||
let param = {
|
||||
"file_path": res.result[0].filePath,
|
||||
"token": ""
|
||||
}
|
||||
postMethodCommon('/FireCodeApp/BatchExportRanger',param).then(res2 => {
|
||||
|
||||
_this.$emit("importSuccess")
|
||||
|
||||
_this.fileList = []
|
||||
|
||||
})
|
||||
} else {
|
||||
_this.$message.warning(`接口错误!!`)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
destroyed() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
const validateMobile = function (rule, value, callback) {
|
||||
let newValue = value.replace(/[^0-9]/gi, '')
|
||||
if (value !== newValue) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else if (newValue.length !== 11) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const validID = function(rule, value, callback) {
|
||||
// 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
|
||||
let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
|
||||
if (reg.test(value)) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入正确的身份证号码"));
|
||||
}
|
||||
}
|
||||
var validateStock = (rule, value, callback) => {
|
||||
if (!value || value == 0) {
|
||||
callback(new Error("不能为空"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
export { validateMobile ,validID,validateStock}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
<template>
|
||||
<div style="padding:24px;overflow-y:hidden;">
|
||||
<el-tabs v-model="activeName">
|
||||
<el-tab-pane label="" name="zhifa">
|
||||
<div class="flex-column">
|
||||
|
||||
<el-row style="overflow-y: hidden;">
|
||||
|
||||
<el-col :span="12" style="padding: 20px;border: 1px silver solid;margin-left: 10px">
|
||||
|
||||
<el-form ref="form" :model="form" label-width="80px" size="mini">
|
||||
<el-form-item label="当前版本">
|
||||
<span style="font-size:15px;font-weight:bold;color:#000;">{{currentAppInfo.edition}}</span>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="版本号">
|
||||
<el-input v-model="form.edition"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称">
|
||||
<el-input v-model="form.project_name"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item 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:60px;line-height:0px;"></i>
|
||||
<div class="el-upload__text">将APP文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述信息">
|
||||
<el-input type="textarea" v-model="form.description"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否必须更新" label-width="120px">
|
||||
<el-radio-group v-model="form.must_update" size="medium">
|
||||
<el-radio border :label="1">是</el-radio>
|
||||
<el-radio border :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">立即创建</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {postMethodCommon,getMethodCommon} from "../../api/common";
|
||||
|
||||
export default {
|
||||
name: "version",
|
||||
data() {
|
||||
return {
|
||||
currentAppInfo:{},
|
||||
activeName:"zhifa",
|
||||
limit: 1,
|
||||
fileList: [],
|
||||
form: {
|
||||
edition: "",
|
||||
description: "",
|
||||
filepath: "",
|
||||
must_update: '',
|
||||
project_name: ''
|
||||
},
|
||||
flyControlForm: {
|
||||
edition: "",
|
||||
description: "",
|
||||
filepath: "",
|
||||
must_update: '',
|
||||
project_name: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.getAppInfo();
|
||||
},
|
||||
methods: {
|
||||
getAppInfo(){
|
||||
getMethodCommon("/FireCodeApp/GetUpdateFiles",{project:'yishuixian'}).then(res=>{
|
||||
if(res.code == 200){
|
||||
this.currentAppInfo = res.data;
|
||||
this.form.project_name = res.data.project_name;
|
||||
this.form.description = res.data.description;
|
||||
this.form.must_update = res.data.must_update;
|
||||
}
|
||||
})
|
||||
},
|
||||
//文件上传时的钩子
|
||||
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]
|
||||
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 !== 'apk') {
|
||||
|
||||
this.$message.warning('只能上传后缀是.apk的文件')
|
||||
return false
|
||||
}
|
||||
if (size > 100) {
|
||||
this.$message.warning('文件大小不得超过100M')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
onSubmit() {
|
||||
let _this = this
|
||||
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.form.filepath = res.result[0].filePath
|
||||
postMethodCommon('/FireCodeApp/AddAppFiles', _this.form).then(res2 => {
|
||||
if (res2.code === 200) {
|
||||
_this.$message.warning(`上传成功`)
|
||||
_this.form = {
|
||||
edition: "",
|
||||
description: "",
|
||||
filepath: "",
|
||||
must_update: '',
|
||||
project_name: ''
|
||||
}
|
||||
_this.fileList = []
|
||||
} else {
|
||||
_this.$message.warning(`接口错误!!`)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.$message.warning(`接口错误!!`)
|
||||
}
|
||||
})
|
||||
},
|
||||
onFlyControlSubmit() {
|
||||
let _this = this
|
||||
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.flyControlForm.filepath = res.result[0].filePath
|
||||
postMethodCommon('/TaxProductEquipment/AddAppFiles', _this.flyControlForm).then(res2 => {
|
||||
if (res2.code === 200) {
|
||||
_this.$message.warning(`上传成功`)
|
||||
_this.flyControlForm = {
|
||||
edition: "",
|
||||
description: "",
|
||||
filepath: "",
|
||||
must_update: '',
|
||||
project_name: ''
|
||||
}
|
||||
_this.fileList = []
|
||||
} else {
|
||||
_this.$message.warning(`接口错误!!`)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.$message.warning(`接口错误!!`)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/.el-upload-dragger{
|
||||
height:100px;
|
||||
line-height: 20px;
|
||||
}
|
||||
/deep/ .el-icon-upload{
|
||||
|
||||
}
|
||||
/deep/.el-upload__text{
|
||||
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue