From 7f1640ad12c63b692a8a4a7deaef46768adde198 Mon Sep 17 00:00:00 2001
From: master <master@163.com>
Date: 星期三, 20 四月 2022 16:52:06 +0800
Subject: [PATCH] 新增告警、模型文件上传等页面

---
 src/cool/modules/doulunji/views/doulunji_message.vue |  206 ++++++++++++++++++++++++++++++++++
 src/cool/modules/warnning/directives/index.ts        |    1 
 src/cool/modules/warnning/index.ts                   |   15 ++
 src/cool/modules/warnning/service/index.ts           |    1 
 src/cool/modules/warnning/store/index.ts             |    1 
 public/hn3d/example/00_hn_new.html                   |   14 +
 src/cool/modules/warnning/pages/index.ts             |    1 
 src/cool/modules/warnning/views/warnning_log.vue     |   96 ++++++++++++++++
 src/cool/modules/warnning/components/index.ts        |    1 
 src/cool/modules/warnning/views/index.ts             |    1 
 10 files changed, 333 insertions(+), 4 deletions(-)

diff --git a/public/hn3d/example/00_hn_new.html b/public/hn3d/example/00_hn_new.html
index 22b5707..79478b6 100644
--- a/public/hn3d/example/00_hn_new.html
+++ b/public/hn3d/example/00_hn_new.html
@@ -36,6 +36,10 @@
       width: 120px;
       text-align: center
     }
+
+    .disable {
+      pointer-events: none;
+    }
   </style>
 </head>
 
@@ -60,9 +64,7 @@
     <button type="button" id="meipeng_pati_madao" class="btn btn-primary" style="width: 100%;">鐖椹亾</button>
     <button type="button" id="meipeng_tiejia" class="btn btn-primary" style="width: 100%;">閽㈢粨鏋勬灦</button>
     <button type="button" id="meipeng_dimian" class="btn btn-primary" style="width: 100%;">鐓ゆ鍦伴潰</button>
-    <!-- <button type="button" id="dou_move" class="btn btn-primary" style="width: 100%;">绉诲姩</button>
-    <button type="button" id="dou_rote" class="btn btn-primary" style="width: 100%;">鏃嬭浆</button>
-    <button type="button" id="dou_work" class="btn btn-primary" style="width: 100%;">鎸栫叅</button> -->
+
     <button type="button" id="test_btn" class="btn btn-primary" style="width: 100%;">娴嬭瘯</button>
     <button type="button" id="point_btn" class="btn btn-primary" style="width: 100%;">鐓ゅ爢</button>
   </div>
@@ -362,6 +364,7 @@
 
       // 璇锋眰鏁版嵁搴撴暟鎹紝瀵规枟杞満妯″瀷杩涜鎿嶄綔
       $("#test_btn").click(function () {
+        $("#test_btn").addClass("disable");
         console.log(dou_params)
         if (model_no < dou_params.length - 1) {
           model_no++
@@ -371,6 +374,9 @@
         let item = dou_params[model_no]
         console.log(item)
         dou_move(item.longitude, item.latitude, item.elevation, item.heading_angle)
+        setTimeout(function () {
+          $("#test_btn").removeClass("disable");
+        }, 5000);
       })
 
 
@@ -506,7 +512,7 @@
 
 
       $("#point_btn").click(function () {
-        var data_path = 'http://112.74.77.127:9100/hn/pointcloud/hn4.txt'
+        var data_path = 'http://112.74.77.127:9100/hn/pointcloud/hn.txt'
         console.log("鎴戠偣鍑讳簡")
         $.ajax({
           url: data_path,
diff --git a/src/cool/modules/doulunji/views/doulunji_message.vue b/src/cool/modules/doulunji/views/doulunji_message.vue
new file mode 100644
index 0000000..dbbedb6
--- /dev/null
+++ b/src/cool/modules/doulunji/views/doulunji_message.vue
@@ -0,0 +1,206 @@
+<template>
+  <cl-crud :ref="setRefs('crud')"
+           @load="onLoad">
+    <el-row type="flex"
+            align="middle">
+      <!-- 鍒锋柊鎸夐挳 -->
+      <cl-refresh-btn />
+      <!-- 鏂板鎸夐挳 -->
+      <cl-add-btn />
+      <!-- 鍒犻櫎鎸夐挳 -->
+      <cl-multi-delete-btn />
+      <cl-flex1 />
+      <!-- 鍏抽敭瀛楁悳绱� -->
+      <cl-search-key />
+    </el-row>
+
+    <el-row>
+      <!-- 鏁版嵁琛ㄦ牸 -->
+      <cl-table :ref="setRefs('table')"
+                v-bind="table" />
+    </el-row>
+
+    <el-row type="flex">
+      <cl-flex1 />
+      <!-- 鍒嗛〉鎺т欢 -->
+      <cl-pagination />
+    </el-row>
+
+    <!-- 鏂板銆佺紪杈� -->
+    <cl-upsert :ref="setRefs('upsert')"
+               v-bind="upsert" />
+  </cl-crud>
+</template>
+
+<script lang="ts">
+import { defineComponent, reactive } from "vue";
+import { CrudLoad, Upsert, Table } from "@cool-vue/crud/types";
+import { useCool } from "/@/cool";
+
+export default defineComponent({
+	setup() {
+		const { refs, setRefs, service } = useCool();
+
+		// 鏂板銆佺紪杈戦厤缃�
+		const upsert = reactive<Upsert>({
+			items: [
+				{
+					label: "閫昏緫ID",
+					prop: "logic_id",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "璁惧鍚嶇О",
+					prop: "name",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "妯″瀷鏂囦欢",
+					prop: "data_path",
+					component: {
+						name: "cl-upload"
+					}
+				},
+				{
+					label: "缁忓害",
+					prop: "longitude",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "绾害",
+					prop: "latitude",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "楂樺害",
+					prop: "height",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "鏃嬭浆瑙�",
+					prop: "heading",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "淇话瑙�",
+					prop: "peatch",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "妯粴瑙�",
+					prop: "roll",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "澶囨敞",
+					prop: "remark",
+					component: {
+						name: "el-input"
+					}
+				},
+				{
+					label: "鐘舵��",
+					prop: "status",
+					component: {
+						name: "el-input"
+					}
+				}
+			]
+		});
+
+		// 琛ㄦ牸閰嶇疆
+		const table = reactive<Table>({
+			columns: [
+				{
+					label: "id",
+					prop: "id"
+				},
+				{
+					label: "妯″瀷鍚嶇О",
+					prop: "name"
+				},
+
+				{
+					label: "璺緞淇℃伅",
+					prop: "data_path"
+				},
+				{
+					label: "缁忓害",
+					prop: "longitude"
+				},
+				{
+					label: "绾害",
+					prop: "latitude"
+				},
+				{
+					label: "楂樺害",
+					prop: "height"
+				},
+				{
+					label: "鏃嬭浆瑙�",
+					prop: "heading"
+				},
+				{
+					label: "缈绘粴瑙�",
+					prop: "roll"
+				},
+				{
+					label: "淇话瑙�",
+					prop: "peatch"
+				},
+				{
+					label: "缂╂斁姣斾緥",
+					prop: "scale"
+				},
+				{
+					label: "璺緞淇℃伅",
+					prop: "data_path"
+				},
+				{
+					label: "澶囨敞",
+					prop: "remark"
+				},
+				{
+					label: "鐘舵��",
+					prop: "status"
+				},
+				{
+					label: "鎿嶄綔",
+					type: "op"
+				}
+			]
+		});
+
+		// crud 鍔犺浇
+		function onLoad({ ctx, app }: CrudLoad) {
+			// 缁戝畾 service
+			ctx.service(service.business.modelstatic).done();
+			app.refresh();
+		}
+
+		return {
+			refs,
+			setRefs,
+			upsert,
+			table,
+			onLoad
+		};
+	}
+});
+</script>
diff --git a/src/cool/modules/warnning/components/index.ts b/src/cool/modules/warnning/components/index.ts
new file mode 100644
index 0000000..ff8b4c5
--- /dev/null
+++ b/src/cool/modules/warnning/components/index.ts
@@ -0,0 +1 @@
+export default {};
diff --git a/src/cool/modules/warnning/directives/index.ts b/src/cool/modules/warnning/directives/index.ts
new file mode 100644
index 0000000..ff8b4c5
--- /dev/null
+++ b/src/cool/modules/warnning/directives/index.ts
@@ -0,0 +1 @@
+export default {};
diff --git a/src/cool/modules/warnning/index.ts b/src/cool/modules/warnning/index.ts
new file mode 100644
index 0000000..08b1faf
--- /dev/null
+++ b/src/cool/modules/warnning/index.ts
@@ -0,0 +1,15 @@
+import components from "./components";
+import directives from "./directives";
+import service from "./service";
+import store from "./store";
+import pages from "./pages";
+import views from "./views";
+
+export default {
+	components,
+	directives,
+	service,
+	store,
+	pages,
+	views
+};
diff --git a/src/cool/modules/warnning/pages/index.ts b/src/cool/modules/warnning/pages/index.ts
new file mode 100644
index 0000000..d6d1738
--- /dev/null
+++ b/src/cool/modules/warnning/pages/index.ts
@@ -0,0 +1 @@
+export default [];
diff --git a/src/cool/modules/warnning/service/index.ts b/src/cool/modules/warnning/service/index.ts
new file mode 100644
index 0000000..ff8b4c5
--- /dev/null
+++ b/src/cool/modules/warnning/service/index.ts
@@ -0,0 +1 @@
+export default {};
diff --git a/src/cool/modules/warnning/store/index.ts b/src/cool/modules/warnning/store/index.ts
new file mode 100644
index 0000000..ff8b4c5
--- /dev/null
+++ b/src/cool/modules/warnning/store/index.ts
@@ -0,0 +1 @@
+export default {};
diff --git a/src/cool/modules/warnning/views/index.ts b/src/cool/modules/warnning/views/index.ts
new file mode 100644
index 0000000..d6d1738
--- /dev/null
+++ b/src/cool/modules/warnning/views/index.ts
@@ -0,0 +1 @@
+export default [];
diff --git a/src/cool/modules/warnning/views/warnning_log.vue b/src/cool/modules/warnning/views/warnning_log.vue
new file mode 100644
index 0000000..b5c6b10
--- /dev/null
+++ b/src/cool/modules/warnning/views/warnning_log.vue
@@ -0,0 +1,96 @@
+<template>
+  <cl-crud :ref="setRefs('crud')"
+           @load="onLoad">
+    <el-row type="flex"
+            align="middle">
+      <!-- 鍒锋柊鎸夐挳 -->
+      <cl-refresh-btn />
+      <!-- 鏂板鎸夐挳 -->
+      <cl-add-btn />
+      <!-- 鍒犻櫎鎸夐挳 -->
+      <cl-multi-delete-btn />
+      <cl-flex1 />
+      <!-- 鍏抽敭瀛楁悳绱� -->
+      <cl-search-key />
+    </el-row>
+
+    <el-row>
+      <!-- 鏁版嵁琛ㄦ牸 -->
+      <cl-table :ref="setRefs('table')"
+                v-bind="table" />
+    </el-row>
+
+    <el-row type="flex">
+      <cl-flex1 />
+      <!-- 鍒嗛〉鎺т欢 -->
+      <cl-pagination />
+    </el-row>
+
+    <!-- 鏂板銆佺紪杈� -->
+    <cl-upsert :ref="setRefs('upsert')"
+               v-bind="upsert" />
+  </cl-crud>
+</template>
+
+<script lang="ts">
+import { defineComponent, reactive } from "vue";
+import { CrudLoad, Upsert, Table } from "@cool-vue/crud/types";
+import { useCool } from "/@/cool";
+
+export default defineComponent({
+	setup() {
+		const { refs, setRefs, service } = useCool();
+
+		// 鏂板銆佺紪杈戦厤缃�
+		const upsert = reactive<Upsert>({
+			items: []
+		});
+
+		// 琛ㄦ牸閰嶇疆
+		const table = reactive<Table>({
+			columns: [
+				{
+					label: "鍛婅绫诲瀷",
+					prop: "alarm_type"
+				},
+				{
+					label: "鍛婅鏃堕棿",
+					prop: "report_time"
+				},
+
+				{
+					label: "鍛婅鍐呭",
+					prop: "report_content"
+				},
+				{
+					label: "澶囨敞",
+					prop: "remark"
+				},
+				{
+					label: "鐘舵��",
+					prop: "status"
+				},
+				{
+					label: "鎿嶄綔",
+					type: "op"
+				}
+			]
+		});
+
+		// crud 鍔犺浇
+		function onLoad({ ctx, app }: CrudLoad) {
+			// 缁戝畾 service
+			ctx.service(service.business.alarm).done();
+			app.refresh();
+		}
+
+		return {
+			refs,
+			setRefs,
+			upsert,
+			table,
+			onLoad
+		};
+	}
+});
+</script>

--
Gitblit v1.9.1