diff --git a/.env.dev b/.env.dev index afcf62b..e75a2de 100644 --- a/.env.dev +++ b/.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 diff --git a/.env.prod b/.env.prod index b06fbab..8a7d838 100644 --- a/.env.prod +++ b/.env.prod @@ -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 \ No newline at end of file diff --git a/package.json b/package.json index bfaed3a..a8badcb 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/public/config/app.json b/public/config/app.json index 9d54a90..da0e57e 100644 --- a/public/config/app.json +++ b/public/config/app.json @@ -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, diff --git a/public/config/yishuixianConfig.json b/public/config/yishuixianConfig.json index 6217e81..c81ea2f 100644 --- a/public/config/yishuixianConfig.json +++ b/public/config/yishuixianConfig.json @@ -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": [ { diff --git a/public/img/沂水县常用图层图标.zip b/public/img/沂水县常用图层图标.zip new file mode 100644 index 0000000..e85d0ec Binary files /dev/null and b/public/img/沂水县常用图层图标.zip differ diff --git a/src/components/mars3d/Map.vue b/src/components/mars3d/Map.vue index 2a695be..dff211c 100644 --- a/src/components/mars3d/Map.vue +++ b/src/components/mars3d/Map.vue @@ -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; diff --git a/src/utils/websocketApi.js b/src/utils/websocketApi.js index 3c34f5b..06d7f84 100644 --- a/src/utils/websocketApi.js +++ b/src/utils/websocketApi.js @@ -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 diff --git a/src/views/documentation/widget/AddForm.vue b/src/views/documentation/widget/AddForm.vue index fca2ac1..cd065e8 100644 --- a/src/views/documentation/widget/AddForm.vue +++ b/src/views/documentation/widget/AddForm.vue @@ -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) => { diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 9004f16..b04c11b 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -171,6 +171,7 @@ > +
-
@@ -303,7 +303,7 @@
--> -
+
// 请求接口获取全部路由和工具箱信息 +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": `
+
+
+
+
+
+
+
+
+
+
任务信息
+
+
+
任务内容:${item.content? item.content:'暂无任务内容'}
+
+
+
任务地点:
+
${item.lng},${item.lat} +
+
+
+
任务创建时间:
+
${item.taskTime} +
+
+
+
+ 删除任务点 +
+
+
+
+
+
+
+
+
+
`, + "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 { diff --git a/src/views/home/lib/handleGeojson.js b/src/views/home/lib/handleGeojson.js index 0df0c24..37a8c45 100644 --- a/src/views/home/lib/handleGeojson.js +++ b/src/views/home/lib/handleGeojson.js @@ -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(); diff --git a/src/views/home/lib/routePath.js b/src/views/home/lib/routePath.js index 81508ed..3a20631 100644 --- a/src/views/home/lib/routePath.js +++ b/src/views/home/lib/routePath.js @@ -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 } diff --git a/src/views/home/widget/editorbox.vue b/src/views/home/widget/editorbox.vue new file mode 100644 index 0000000..c6931dc --- /dev/null +++ b/src/views/home/widget/editorbox.vue @@ -0,0 +1,173 @@ + + + + + \ No newline at end of file diff --git a/src/views/home/widget/onebuttoncall.vue b/src/views/home/widget/onebuttoncall.vue index 79d7b4c..93b094d 100644 --- a/src/views/home/widget/onebuttoncall.vue +++ b/src/views/home/widget/onebuttoncall.vue @@ -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){ diff --git a/src/views/home/widget/taskDelivery.vue b/src/views/home/widget/taskDelivery.vue index 70fb332..5db54ee 100644 --- a/src/views/home/widget/taskDelivery.vue +++ b/src/views/home/widget/taskDelivery.vue @@ -1,19 +1,30 @@ \ No newline at end of file diff --git a/src/views/message - 副本/index.vue b/src/views/message - 副本/index.vue new file mode 100644 index 0000000..770bcc7 --- /dev/null +++ b/src/views/message - 副本/index.vue @@ -0,0 +1,565 @@ + + + + + diff --git a/src/views/message - 副本/widget/AddForm.vue b/src/views/message - 副本/widget/AddForm.vue new file mode 100644 index 0000000..debd519 --- /dev/null +++ b/src/views/message - 副本/widget/AddForm.vue @@ -0,0 +1,230 @@ + + + \ No newline at end of file diff --git a/src/views/message - 副本/widget/EditForm.vue b/src/views/message - 副本/widget/EditForm.vue new file mode 100644 index 0000000..0037ce3 --- /dev/null +++ b/src/views/message - 副本/widget/EditForm.vue @@ -0,0 +1,228 @@ + + + \ No newline at end of file diff --git a/src/views/message - 副本/widget/ImportForestranger.vue b/src/views/message - 副本/widget/ImportForestranger.vue new file mode 100644 index 0000000..b1d5ed0 --- /dev/null +++ b/src/views/message - 副本/widget/ImportForestranger.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/src/views/message - 副本/widget/validate.js b/src/views/message - 副本/widget/validate.js new file mode 100644 index 0000000..b7222cb --- /dev/null +++ b/src/views/message - 副本/widget/validate.js @@ -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} \ No newline at end of file diff --git a/src/views/message/index.vue b/src/views/message/index.vue new file mode 100644 index 0000000..d621364 --- /dev/null +++ b/src/views/message/index.vue @@ -0,0 +1,617 @@ + + + + + diff --git a/src/views/message/widget/AddForm.vue b/src/views/message/widget/AddForm.vue new file mode 100644 index 0000000..5eeb691 --- /dev/null +++ b/src/views/message/widget/AddForm.vue @@ -0,0 +1,264 @@ + + + + \ No newline at end of file diff --git a/src/views/message/widget/EditForm.vue b/src/views/message/widget/EditForm.vue new file mode 100644 index 0000000..6523380 --- /dev/null +++ b/src/views/message/widget/EditForm.vue @@ -0,0 +1,287 @@ + + + + \ No newline at end of file diff --git a/src/views/message/widget/ImportForestranger.vue b/src/views/message/widget/ImportForestranger.vue new file mode 100644 index 0000000..b1d5ed0 --- /dev/null +++ b/src/views/message/widget/ImportForestranger.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/src/views/message/widget/SelectRoles.vue b/src/views/message/widget/SelectRoles.vue new file mode 100644 index 0000000..9ba77cb --- /dev/null +++ b/src/views/message/widget/SelectRoles.vue @@ -0,0 +1,155 @@ + + + \ No newline at end of file diff --git a/src/views/message/widget/validate.js b/src/views/message/widget/validate.js new file mode 100644 index 0000000..b7222cb --- /dev/null +++ b/src/views/message/widget/validate.js @@ -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} \ No newline at end of file diff --git a/src/views/navigation/index.vue b/src/views/navigation/index.vue index c7b7232..89c2d38 100644 --- a/src/views/navigation/index.vue +++ b/src/views/navigation/index.vue @@ -30,7 +30,7 @@ 扫码
下载 APP
- +
@@ -48,10 +48,17 @@ diff --git a/src/views/unitmanager/index.vue b/src/views/unitmanager/index.vue new file mode 100644 index 0000000..770bcc7 --- /dev/null +++ b/src/views/unitmanager/index.vue @@ -0,0 +1,565 @@ + + + + + diff --git a/src/views/unitmanager/widget/AddForm.vue b/src/views/unitmanager/widget/AddForm.vue new file mode 100644 index 0000000..debd519 --- /dev/null +++ b/src/views/unitmanager/widget/AddForm.vue @@ -0,0 +1,230 @@ + + + \ No newline at end of file diff --git a/src/views/unitmanager/widget/EditForm.vue b/src/views/unitmanager/widget/EditForm.vue new file mode 100644 index 0000000..0037ce3 --- /dev/null +++ b/src/views/unitmanager/widget/EditForm.vue @@ -0,0 +1,228 @@ + + + \ No newline at end of file diff --git a/src/views/unitmanager/widget/ImportForestranger.vue b/src/views/unitmanager/widget/ImportForestranger.vue new file mode 100644 index 0000000..b1d5ed0 --- /dev/null +++ b/src/views/unitmanager/widget/ImportForestranger.vue @@ -0,0 +1,132 @@ + + + + + \ No newline at end of file diff --git a/src/views/unitmanager/widget/validate.js b/src/views/unitmanager/widget/validate.js new file mode 100644 index 0000000..b7222cb --- /dev/null +++ b/src/views/unitmanager/widget/validate.js @@ -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} \ No newline at end of file diff --git a/src/views/version/version.vue b/src/views/version/version.vue new file mode 100644 index 0000000..02b7266 --- /dev/null +++ b/src/views/version/version.vue @@ -0,0 +1,232 @@ + + + + + \ No newline at end of file