Explorar el Código

框架调整,代码引入

maxiaoxiao hace 2 meses
padre
commit
630454aebb
Se han modificado 10 ficheros con 793 adiciones y 5 borrados
  1. 107 0
      api/apis.js
  2. 135 0
      api/dkjbxx.js
  3. 19 0
      package.json
  4. 18 5
      pages.json
  5. 122 0
      pages/check/MapView.vue
  6. 105 0
      pages/check/index.vue
  7. 84 0
      pages/check/mapto.js
  8. 59 0
      pages/classify/classify.vue
  9. 143 0
      pages/index/index.vue
  10. 1 0
      static/Config/config.js

+ 107 - 0
api/apis.js

@@ -0,0 +1,107 @@
+import request from "@/utils/http.js"
+
+// 查询监管批次数据列表
+export function listPcsj(query) {
+	return request({
+		url: '/apply/supervise/pcsj/list',
+		method: 'get',
+		params: query
+	})
+}
+
+// 查询监管批次数据列表
+export function listPcsjXQList(query) {
+	return request({
+		url: '/apply/supervise/xq/list',
+		method: 'get',
+		params: query
+	})
+}
+
+export function apiGetDayRandom() {
+	return request({
+		url: "/randomWall"
+	})
+}
+
+export function apiGetNotice(data = {}) {
+	return request({
+		url: "/wallNewsList",
+		data
+	})
+}
+
+
+export function apiGetClassify(data = {}) {
+	return request({
+		url: "/classify",
+		data
+	})
+}
+
+
+
+export function apiGetClassList(data = {}) {
+	return request({
+		url: "/wallList",
+		data
+	})
+}
+
+
+export function apiGetSetupScore(data = {}) {
+	return request({
+		url: "/setupScore",
+		data
+	})
+}
+
+
+export function apiWriteDownload(data = {}) {
+	return request({
+		url: "/downloadWall",
+		data
+	})
+}
+
+
+
+export function apiDetailWall(data = {}) {
+	return request({
+		url: "/detailWall",
+		data
+	})
+}
+
+
+export function apiUserInfo(data = {}) {
+	return request({
+		url: "/userInfo",
+		data
+	})
+}
+
+
+export function apiGetHistoryList(data = {}) {
+	return request({
+		url: "/userWallList",
+		data
+	})
+}
+
+
+
+export function apiNoticeDetail(data = {}) {
+	return request({
+		url: "/wallNewsDetail",
+		data
+	})
+}
+
+
+export function apiSearchData(data = {}) {
+	return request({
+		url: "/searchWall",
+		data
+	})
+}

+ 135 - 0
api/dkjbxx.js

@@ -0,0 +1,135 @@
+import request from "@/utils/http.js"
+
+// 查询地块基本信息(DKJBXX)列表
+export function listDkjbxx(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/list',
+    method: 'POST',
+    data
+  })
+}
+export function getDkcount(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/hctb/count',
+    method: 'POST',
+    data
+  })
+}
+
+// 查询地块基本信息(DKJBXX)详细
+export function getDkjbxx(id) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/' + id,
+    method: 'get'
+  })
+}
+export function getDkjbywy(id) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/ywyp/' + id,
+    method: 'get'
+  })
+}
+
+// 核查流程记录
+export function getAuditflow(params) {
+  return request({
+    url: '/rsmonitoring/auditflow/record/list/business',
+    method: 'get',
+    params
+  })
+}
+
+// 分发
+export function field(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/fieldwork/adds',
+    method: 'post',
+    data
+  })
+}
+export function removeField(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/fieldwork/removes',
+    method: 'post',
+    data
+  })
+}
+export function getStep(params) {
+  return request({
+    url: '/rsmonitoring/auditflow/record/list/step',
+    method: 'get',
+    params
+  })
+}
+
+
+// 地块县级操作
+export function hgxDkjbxx(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/hgx',
+    method: 'post',
+    data: data
+  })
+}
+export function hgxinfo(params) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/hgx/info',
+    method: 'get',
+    params
+  })
+}
+
+// 地块市级审核操作
+export function scDkjbxx(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/sc',
+    method: 'post',
+    data: data
+  })
+}
+export function scinfo(params) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/sc/info',
+    method: 'get',
+    params
+  })
+}
+// 地块省级提交操作
+export function tjDkjbxx(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/tj',
+    method: 'post',
+    data: data
+  })
+}
+export function tjinfo(params) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/tj/info',
+    method: 'get',
+    params
+  })
+}
+
+
+export function getdecTree(params) {
+  return request({
+    url: '/rsmonitoring/dict_data/tree',
+    method: 'get',
+    params
+  })
+}
+export function hgxSplit(data) {
+  return request({
+    url: '/rsmonitoring/dkjbxx/hgx/split',
+    method: 'post',
+    data
+  })
+}
+
+
+
+
+
+
+
+

+ 19 - 0
package.json

@@ -0,0 +1,19 @@
+{
+  "name": "rsmonitoring-app",
+  "version": "1.0.0",
+  "description": "",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "keywords": [],
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "axios": "^0.19.2",
+    "gcoord": "^1.0.6",
+    "js-cookie": "3.0.1",
+    "ol": "^10.2.1",
+    "vant": "^4.9.7"
+  }
+}

+ 18 - 5
pages.json

@@ -70,22 +70,35 @@
     "style": {
       "navigationBarTitleText": "浏览文本"
     }
-  }],
+  },
+	{
+    "path": "pages/index/index",
+    "style": {
+      "navigationBarTitleText": "任务"
+    }
+  },
+  {
+    "path": "pages/check/index",
+    "style": {
+      "navigationBarTitleText": "核查"
+    }
+  }
+],
   "tabBar": {
     "color": "#000000",
     "selectedColor": "#000000",
     "borderStyle": "white",
     "backgroundColor": "#ffffff",
     "list": [{
-        "pagePath": "pages/index",
+        "pagePath": "pages/index/index",
         "iconPath": "static/images/tabbar/home.png",
         "selectedIconPath": "static/images/tabbar/home_.png",
-        "text": "首页"
+        "text": "任务"
       }, {
-        "pagePath": "pages/work/index",
+        "pagePath": "pages/check/index",
         "iconPath": "static/images/tabbar/work.png",
         "selectedIconPath": "static/images/tabbar/work_.png",
-        "text": "工作台"
+        "text": "核查"
       }, {
         "pagePath": "pages/mine/index",
         "iconPath": "static/images/tabbar/mine.png",

+ 122 - 0
pages/check/MapView.vue

@@ -0,0 +1,122 @@
+<template>
+	<view id="container" class=""></view>
+	<!-- <image src="@/static/images/logo2.jpg"></image> -->
+	<!-- <image src="@/static/images/xxmLogo.png"></image> -->
+	<!-- <image src="@/static/roadmap/3/6/3.png"></image> -->
+	<!-- <image src="../../static/roadmap/3/6/3.png"></image> -->
+	<!-- <link href="ol/ol.css"></link> -->
+</template>
+<script module="ol" lang="renderjs">
+	// import Axios from "../../static";
+	// import "ol/ol.css";
+
+	import {
+		transform
+	} from "ol/proj.js";
+	import Map from "ol/Map";
+	import View from "ol/View";
+	// import TileLayer from "ol/layer/Tile";
+	import XYZ from "ol/source/XYZ";
+	import Tile from "ol/layer/Tile";
+	import OSM from 'ol/source/OSM'
+	let map = null;
+	export default {
+		name: "map-view",
+		data() {
+			return {
+				maps: {},
+			};
+		},
+		mounted() {
+			this.createMap();
+		},
+		methods: {
+			createMap() {
+				var view = new View({
+					center: transform([116.40, 39.91], "EPSG:4326", "EPSG:3857"), //地图初始中心点
+					// center: gcoord.transform([103.23, 35.33], "EPSG:4326", "EPSG:3857"), //地图初始中心点
+					// 	[106.67591743605254, 38.21012898330025],
+					// 	gcoord.WGS84,
+					// 	gcoord.BD09
+					// ), //地图初始中心点
+					projection: "EPSG:3857",
+					zoom: 12,
+					minZoom: 2,
+					maxZoom: 20
+				});
+				this.addMap("container", view);
+			},
+			addMap(target, view) {
+				if (this.maps[target]) return;
+				// var gaodeMapLayer = new TileLayer({
+				// 	title: "高德地图",
+				// 	source: new XYZ({
+				// 		url: "http://wprd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&style=7&x={x}&y={y}&z={z}",
+				// 		wrapX: false,
+				// 	}),
+				// });
+				// 使用OpenStreetMap地图源
+				// var osm= new Tile({
+				//              source: new OSM(), 
+				//            });
+				// var osm = new Tile({
+				// 	source: new XYZ({
+				// 		url: "@/static/roadmap/{z}/{x}/{y}.png",
+				// 	}),
+				// });
+				//console.log('../../../www/static/roadmap/{2}/{3}/{1}.png')
+				//var vecLayer1 = new Tile({
+				//	source: new XYZ({
+				//		url: "../../../www/static/roadmap/{z}/{x}/{y}.png",
+				//	}),
+				//});
+				var key = "12df6e32906dbb916fad14dc65ebdbf8"; // 请替换成你的key
+				// 矢量底图
+				var vecLayer = new Tile({
+					source: new XYZ({
+						//url: 'http://{s}.tile.osm.org/{z}/{x}/{y}.png'
+						//'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
+						url:"http://t0.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=" +key,
+					}),
+				});
+				// 矢量标注
+				var cvaLayer = new Tile({
+					source: new XYZ({
+						url: "http://t0.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=" +
+							key,
+					}),
+				});
+				console.log("瓦片路径:..doc/tiles/{z}/{x}/{y}.png");
+				var lyr = new Tile({
+					source: new XYZ({
+						//url: "http://49.232.215.206:3001/static/tiles/gg/{z}/{x}/{-y}.png"
+						url: "../doc/tiles/{z}/{x}/{-y}.png"
+					}),
+				});
+
+
+
+				let map = new Map({
+					//地图容器div的ID
+					target,
+					//地图容器中加载的图层
+					// layers: [gaodeMapLayer],
+					//  layers: [lyr],
+					layers: [vecLayer, cvaLayer, lyr],
+					//地图视图设置
+					view, //同一个view
+
+				});
+				this.maps[target] = map;
+				// window.map = this.maps;
+				console.log(map, "window.map", lyr);
+			},
+		},
+	};
+</script>
+<style scoped>
+	#container {
+		width: 100vw;
+		height: 50vh;
+	}
+</style>

+ 105 - 0
pages/check/index.vue

@@ -0,0 +1,105 @@
+<template>
+	<view class="">
+		<MapView></MapView>
+		<van-list id="checklist" v-model="loading" :immediate-check="false" :error.sync="error" error-text="请求失败,点击重新加载"
+			finished-text="没有更多了~" @load="getList">
+			<view class="list-item" v-for="(item, key) in tableData" :key="key" @click="goDetail(item)">
+				<div class="nameTitle">{{ item.name }}</div>
+				<div>{{ item.dkbh }}</div>
+				<div>监测面积:{{ item.dkmj }}</div>
+				<div>核查截止日期:{{ item.jsdw }}</div>
+				<div @click="navigation">导航</div>
+				<div @click="upload">上传</div>
+				<view class="status">{{ item.status }}</view>
+			</view>
+		</van-list>
+	</view>
+</template>
+<script>
+	// import MapView from "../../static/MapView.vue";
+	import MapView from "./MapView.vue";
+	import {
+		listDkjbxx
+	} from "@/api/dkjbxx.js";
+	import {
+		handleNavigation
+	} from "./mapto.js";
+	import {
+		chooseImage,
+		chooseVideo,
+		chooseMedia
+	} from "@/utils/choose.js";
+	export default {
+		name: "check",
+		components: {
+			MapView,
+		},
+		data() {
+			return {
+				queryParams: {
+					pageNum: 1,
+					pageSize: 10,
+					time: ["", ""],
+					startTime: "",
+					endTime: "",
+					auditflowList: [],
+					dkmjbs: "",
+					dkmj: "",
+					descValue: "dkmj",
+					dkbh: "",
+					xzqdm: null,
+				},
+				loading: false,
+				tableData: [{}],
+			};
+		},
+		mounted() {},
+		onShow(options) {
+			uni.getStorage({
+				key: "my_param",
+				success: (res) => {
+					this.queryParams.id = res.data.id;
+					console.log("获取的参数是:", res.data);
+					 this.getList();
+				},
+			});
+		},
+		unmounted() {},
+		methods: {
+			getList() {
+				listDkjbxx(this.queryParams).then((response) => {
+					this.tableData = response.rows;
+					this.total = response.total;
+					// this.open = true;
+					// this.title = "修改监管批次数据";
+					// this.initVectorLayer("mapDiv");
+					// this.initVectorLayer("mapCon1");
+					// this.initVectorLayer("mapCon2");
+					// this.addGeoJson("mapDiv");
+					// this.addGeoJson("mapCon1");
+					// this.addGeoJson("mapCon2");
+				});
+			},
+			navigation() {
+				console.log("s-xsx");
+				handleNavigation({
+					latitude: 39.9042,
+					longitude: 116.4074,
+					name: "地址名称",
+					address: "地址详情",
+					selfLocation: {},
+				});
+			},
+			upload() {
+				console.log(uni, '---', uni.chooseMedia)
+				chooseMedia()
+			}
+		},
+	};
+</script>
+<style scoped>
+	#checklist {
+		width: 100%;
+		height: 50vh;
+	}
+</style>

+ 84 - 0
pages/check/mapto.js

@@ -0,0 +1,84 @@
+export function handleNavigation(toData) {
+    console.log("s-xsxd", toData)
+    if (!toData.latitude || !toData.longitude || !toData.name) return
+    // 微信
+    // #ifdef MP-WEIXIN
+    uni.openLocation({
+        ..._obj,
+        latitude: parseFloat(toData.latitude),
+        longitude: parseFloat(toData.longitude),
+        success: function (res) {
+            console.log('打开系统位置地图成功')
+        },
+        fail: function (error) {
+            console.log(error)
+        }
+    })
+    console.log(toData, '---')
+    // #endif
+    console.log(toData, '---')
+    // #ifdef APP-PLUS
+    // 判断系统安装的地图应用有哪些, 并生成菜单按钮
+    let _mapName = [
+        { title: '高德地图', name: 'amap', androidName: 'com.autonavi.minimap', iosName: 'iosamap://' },
+        { title: '百度地图', name: 'baidumap', androidName: 'com.baidu.BaiduMap', iosName: 'baidumap://' },
+        { title: '腾讯地图', name: 'qqmap', androidName: 'com.tencent.map', iosName: 'qqmap://' },
+    ]
+
+    // 根据真机有的地图软件 生成的 操作菜单
+    let buttons = []
+    let platform = uni.getSystemInfoSync().platform
+    platform === 'android' && _mapName.forEach(item => {
+        if (plus.runtime.isApplicationExist({ pname: item.androidName })) {
+            buttons.push(item)
+        }
+    })
+    platform === 'ios' && _mapName.forEach(item => {
+        console.log(item.iosName)
+        if (plus.runtime.isApplicationExist({ action: item.iosName })) {
+            buttons.push(item)
+        }
+    })
+    console.log(buttons, '---')                                
+    if (buttons.length) {
+        plus.nativeUI.actionSheet({ //选择菜单
+            title: "选择地图应用",
+            cancel: "取消",
+            buttons: buttons
+        }, function (e) {
+            let _map = buttons[e.index - 1]
+            openURL(_map, platform, toData)
+        })
+    } else {
+        uni.showToast({
+            title: '请安装地图软件',
+            icon: 'none'
+        })
+        return
+    }
+    // #endif
+}
+
+// 打开第三方程序实际应用
+function openURL(map, platform, toData) {
+    let _defaultUrl = {
+        android: {
+            "amap": `amapuri://route/plan/?sid=&did=&dlat=${toData.latitude}&dlon=${toData.longitude}&dname=${toData.name}&dev=0&t=0`,
+            'qqmap': `qqmap://map/routeplan?type=drive&to=${toData.name}&tocoord=${toData.latitude},${toData.longitude}&referer=fuxishan_uni_client`,
+            'baidumap': `baidumap://map/direction?origin=${toData.selfLocation.latitude},${toData.selfLocation.longitude}&destination=name:${toData.name}|latlng:${toData.latitude},${toData.longitude}&coord_type=wgs84&mode=driving&src=andr.baidu.openAPIdemo"`
+        },
+        ios: {
+            "amap": `iosamap://path?sourceApplication=fuxishan_uni_client&dlat=${toData.latitude}&dlon=${toData.longitude}&dname=${toData.name}&dev=0&t=0`,
+            'qqmap': `qqmap://map/routeplan?type=drive&to=${toData.name}&tocoord=${toData.latitude},${toData.longitude}&referer=fuxishan_uni_client`,
+            'baidumap': `baidumap://map/direction?origin=${toData.selfLocation.latitude},${toData.selfLocation.longitude}&destination=name:${toData.name}|latlng:${toData.latitude},${toData.longitude}&mode=driving&src=ios.baidu.openAPIdemo`
+        }
+    }
+    let newurl = encodeURI(_defaultUrl[platform][map.name]);
+    console.log(newurl)
+    plus.runtime.openURL(newurl, function (res) {
+        console.log(res)
+        uni.showModal({
+            content: res.message
+        })
+    }, map.androidName ? map.androidName : '');
+}

+ 59 - 0
pages/classify/classify.vue

@@ -0,0 +1,59 @@
+<template>
+	<view class="classLayout pageBg">
+		<!-- #ifndef MP-TOUTIAO -->
+		<custom-nav-bar title="分类"></custom-nav-bar>
+		<!-- #endif -->
+		
+		<view class="classify">
+			<theme-item v-for="item in classifyList" 
+			:key="item._id"
+			:item="item"
+			></theme-item>
+		</view>
+		
+		
+	</view>
+</template>
+
+<script setup>
+import { ref } from 'vue';
+import {onShareAppMessage,onShareTimeline} from "@dcloudio/uni-app"
+import {apiGetClassify} from "@/api/apis.js"
+const classifyList = ref([]);
+
+const getClassify =async()=>{
+	let res =await apiGetClassify({
+		pageSize:15
+	});
+	classifyList.value = res.data
+	console.log(res);
+}
+
+
+//分享给好友
+onShareAppMessage((e)=>{
+	return {
+		title:"咸虾米壁纸,精选分类",
+		path:"/pages/classify/classify"
+	}
+})
+
+//分享朋友圈
+onShareTimeline(()=>{
+	return {
+		title:"咸虾米壁纸,精选分类"
+	}
+})
+
+
+getClassify();
+</script>
+
+<style lang="scss" scoped>
+.classify{
+	padding:30rpx;
+	display: grid;
+	grid-template-columns: repeat(3,1fr);
+	gap:15rpx;
+}
+</style>

+ 143 - 0
pages/index/index.vue

@@ -0,0 +1,143 @@
+<template>
+	<view class="orderPage">
+		<!-- sticky 
+<uni-segmented-control :current="current" :values="tabOptions" style-type="text"
+					active-color="#007aff" @clickItem="onClickItem" />-->
+		<!-- <van-sticky :offset-top="140">-->
+		<van-tabs v-model="searchForm.basetype" @click="tabList(searchForm.basetype)">
+			<van-tab v-for="(item, key) in tabOptions" :key="key" :name="item.name"
+				:title="`${item.name}(${item.num})`"></van-tab>
+		</van-tabs>
+
+		<!--</van-sticky>-->
+		<!-- :finished="finished" -->
+		{{pcsjList}}---
+		<van-list v-model="loading" :immediate-check="false" :error.sync="error" error-text="请求失败,点击重新加载"
+			finished-text="没有更多了~" @load="getList">
+			<view class="list-item" v-for="(item, key) in pcsjList" :key="key" @click="goDetail(item)">
+				<div class="nameTitle">{{ item.name }}</div>
+				<div>{{ item.dkbh }}</div>
+				<div>监测面积:{{ item.dkmj }}</div>
+				<div>核查截止日期:{{ item.jsdw }}</div>
+				<view class="status">{{ item.status }}</view>
+			</view>
+		</van-list>
+	</view>
+</template>
+<script>
+	import {
+		Button
+	} from "vant";
+	import {
+		listDkjbxx
+	} from "@/api/dkjbxx.js";
+	export default {
+		name: "list",
+		components: {},
+		data() {
+			return {
+				activeName: "a",
+				searchForm: {},
+				tabOptions: [{
+						name: "待核查",
+						num: 2,
+					},
+					{
+						name: "核查中",
+						num: 1,
+					},
+					{
+						name: "已核查",
+						num: 1,
+					},
+					{
+						name: "已退回",
+						num: 1,
+					},
+				],
+				queryParams: {
+					pageNum: 1,
+					pageSize: 10,
+					time: ["", ""],
+					startTime: "",
+					endTime: "",
+					auditflowList: [],
+					dkmjbs: "",
+					dkmj: "",
+					descValue: "dkmj",
+					dkbh: "",
+					xzqdm: null,
+				},
+				loading: false,
+				pcsjList: [],
+				total: 0,
+			};
+		},
+		mounted() {
+			console.log("aaaa", "00s00s");
+			this.getList();
+		},
+		unmounted() {},
+		methods: {
+			getList() {
+				this.loading = true;
+				console.log("", "00s00s");
+				listDkjbxx(this.queryParams).then((res) => {
+					console.log(res, "00s00s");
+					this.pcsjList = res.rows;
+					this.total = res.total;
+					this.loading = false;
+				});
+			},
+			//跳转到详情页
+			goDetail(value) {
+				uni.setStorage({
+					key: "my_param",
+					data: value,
+					success: () => {
+						uni.switchTab({
+							url: "/pages/check/index",
+						});
+					},
+				});
+				//   uni.navigateTo({
+				//     url: "/pages/check/index?item=" + value,
+				//   });
+			},
+		},
+	};
+</script>
+<style scoped lang="scss">
+	page {
+		background: $page-bg-color;
+		height: 100%;
+	}
+
+	.orderPage {
+		padding: 30rpx;
+		background: azure;
+		padding-bottom: 50px;
+
+		.list-item {
+			background: #fff;
+			padding: 40rpx 20rpx;
+			border-radius: 20rpx;
+			margin-bottom: 30rpx;
+			position: relative;
+
+			.nameTitle {
+				color: red;
+				line-height: 50rpx;
+			}
+
+			.status {
+				width: 100rpx;
+				height: 100rpx;
+				background: aqua;
+				position: absolute;
+				right: 20rpx;
+				top: 20rpx;
+			}
+		}
+	}
+</style>

+ 1 - 0
static/Config/config.js

@@ -0,0 +1 @@
+export const BASE_URL = 'http://192.168.60.52:8080'