From a28f8de41ab2d99457875db7cdd0cc5bf9325f32 Mon Sep 17 00:00:00 2001
From: master <master@163.com>
Date: 星期四, 07 四月 2022 09:57:58 +0800
Subject: [PATCH] 添加任务记录等模块
---
src/cool/modules/hntask/views/plan_inventory.vue | 116 ++++++++++++++++
src/cool/modules/hntask/views/task_exec_record.vue | 144 ++++++++++++++++++++
src/cool/modules/hntask/views/task_message_record.vue | 120 +++++++++++++++++
3 files changed, 380 insertions(+), 0 deletions(-)
diff --git a/src/cool/modules/hntask/views/plan_inventory.vue b/src/cool/modules/hntask/views/plan_inventory.vue
new file mode 100644
index 0000000..cc8d76e
--- /dev/null
+++ b/src/cool/modules/hntask/views/plan_inventory.vue
@@ -0,0 +1,116 @@
+<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: [
+ {
+ type: "selection",
+ align: "center"
+ },
+ {
+ label: "id",
+ prop: "id",
+ sortable: true //鏄惁鎺掑簭鍔熻兘
+ },
+ {
+ label: "鐩樼叅璁″垝ID",
+ prop: "plan_id"
+ },
+ {
+ label: "鐩樼叅鍚嶇О",
+ prop: "plan_name"
+ },
+ {
+ label: "鐓ょ鏍囪",
+ prop: "coal_marker"
+ },
+ {
+ label: "鐓ゅ爢閲嶉噺",
+ prop: "coal_weight"
+ },
+ {
+ label: "鐓ゅ爢浣撶Н",
+ prop: "coal_volume"
+ },
+ {
+ label: "缁勫悎鐐逛簯ID",
+ prop: "com_model_id"
+ },
+ {
+ label: "澶囨敞",
+ prop: "remark"
+ },
+ {
+ prop: "status",
+ label: "鐘舵��"
+ },
+ {
+ label: "鎿嶄綔",
+ type: "op"
+ }
+ ]
+ });
+
+ // crud 鍔犺浇
+ function onLoad({ ctx, app }: CrudLoad) {
+ // 缁戝畾 service
+ ctx.service(service.business.planinventory).done();
+ app.refresh();
+ }
+
+ return {
+ refs,
+ setRefs,
+ upsert,
+ table,
+ onLoad
+ };
+ }
+});
+</script>
diff --git a/src/cool/modules/hntask/views/task_exec_record.vue b/src/cool/modules/hntask/views/task_exec_record.vue
new file mode 100644
index 0000000..d6c4658
--- /dev/null
+++ b/src/cool/modules/hntask/views/task_exec_record.vue
@@ -0,0 +1,144 @@
+<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: [
+ {
+ type: "selection",
+ align: "center"
+ },
+ {
+ label: "id",
+ prop: "id",
+ sortable: true //鏄惁鎺掑簭鍔熻兘
+ },
+ {
+ label: "浠诲姟绫诲瀷",
+ prop: "is_periodic"
+ },
+ {
+ label: "閫昏緫ID",
+ prop: "logic_id"
+ },
+ {
+ label: "鐗╃悊ID",
+ prop: "device_id"
+ },
+ {
+ label: "鎵ц浠诲姟鍙傛暟",
+ prop: "device_params"
+ },
+ {
+ label: "浠诲姟鏉ユ簮",
+ prop: "task_id"
+ },
+ {
+ label: "寮�濮嬫椂闂�",
+ prop: "start_time"
+ },
+ {
+ label: "缁撴潫鏃堕棿",
+ prop: "end_time"
+ },
+ {
+ label: "鎵ц鑰楁椂",
+ prop: "exec_time"
+ },
+ {
+ label: "鎵ц缁撴灉",
+ prop: "exec_result"
+ },
+ {
+ label: "鏁版嵁鍥炰紶鏃堕棿",
+ prop: "send_time"
+ },
+ {
+ label: "鏈嶅姟绔帴鏀舵椂闂�",
+ prop: "receive_time"
+ },
+ {
+ label: "浠诲姟鎸囦护",
+ prop: "task_command"
+ },
+ {
+ label: "妫�娴嬭褰旾D",
+ prop: "task_monitor_id"
+ },
+ {
+ label: "澶囨敞",
+ prop: "remark"
+ },
+ {
+ prop: "status",
+ label: "鐘舵��"
+ },
+ {
+ label: "鎿嶄綔",
+ type: "op"
+ }
+ ]
+ });
+
+ // crud 鍔犺浇
+ function onLoad({ ctx, app }: CrudLoad) {
+ // 缁戝畾 service
+ ctx.service(service.business.execrecord).done();
+ app.refresh();
+ }
+
+ return {
+ refs,
+ setRefs,
+ upsert,
+ table,
+ onLoad
+ };
+ }
+});
+</script>
diff --git a/src/cool/modules/hntask/views/task_message_record.vue b/src/cool/modules/hntask/views/task_message_record.vue
new file mode 100644
index 0000000..d76fc49
--- /dev/null
+++ b/src/cool/modules/hntask/views/task_message_record.vue
@@ -0,0 +1,120 @@
+<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: [
+ {
+ type: "selection",
+ align: "center"
+ },
+ {
+ label: "id",
+ prop: "id",
+ sortable: true //鏄惁鎺掑簭鍔熻兘
+ },
+ {
+ label: "浠诲姟绫诲瀷",
+ prop: "is_periodic"
+ },
+ {
+ label: "娑堟伅",
+ prop: "message"
+ },
+ {
+ label: "鍙戦�佹簮",
+ prop: "msg_target"
+ },
+ {
+ label: "鍙戦�佺洰鏍�",
+ prop: "msg_target"
+ },
+ {
+ label: "浠诲姟鏉ユ簮",
+ prop: "task_id"
+ },
+ {
+ label: "鍙戦�佹椂闂�",
+ prop: "send_time"
+ },
+ {
+ label: "妫�娴嬭褰旾D",
+ prop: "task_monitor_id"
+ },
+ {
+ label: "澶囨敞",
+ prop: "remark"
+ },
+ {
+ prop: "status",
+ label: "鐘舵��"
+ },
+ {
+ label: "鎿嶄綔",
+ type: "op"
+ }
+ ]
+ });
+
+ // crud 鍔犺浇
+ function onLoad({ ctx, app }: CrudLoad) {
+ // 缁戝畾 service
+ ctx.service(service.business.messagerecord).done();
+ app.refresh();
+ }
+
+ return {
+ refs,
+ setRefs,
+ upsert,
+ table,
+ onLoad
+ };
+ }
+});
+</script>
--
Gitblit v1.9.1