From 8b56ab2d31905c3c7582296e9e0052fe02f45207 Mon Sep 17 00:00:00 2001
From: master <master@163.com>
Date: 星期五, 04 三月 2022 16:21:14 +0800
Subject: [PATCH] 添加采集设备页面
---
src/cool/modules/huaneng/views/huaneng.vue | 248 +++++++++++++++++++++++++------------------------
1 files changed, 126 insertions(+), 122 deletions(-)
diff --git a/src/cool/modules/huaneng/views/huaneng.vue b/src/cool/modules/huaneng/views/huaneng.vue
index 8854f03..8243663 100644
--- a/src/cool/modules/huaneng/views/huaneng.vue
+++ b/src/cool/modules/huaneng/views/huaneng.vue
@@ -1,122 +1,126 @@
-<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: "濮撳悕",
- prop: "name",
- component: {
- name: "el-input"
- }
- },
- {
- label: "鍚嶇О",
- prop: "title",
- component: {
- name: "el-input"
- }
- },
- {
- label: "搴忓彿",
- prop: "price",
- component: {
- name: "el-input"
- }
- },
- {
- label: "鍒嗙被",
- prop: "type",
- component: {
- name: "el-input"
- }
- }
- ]
- });
-
- // 琛ㄦ牸閰嶇疆
- const table = reactive<Table>({
- columns: [
- {
- label: "濮撳悕",
- prop: "name"
- },
- {
- label: "璁惧",
- prop: "title"
- },
- {
- label: "搴忓彿",
- prop: "price"
- },
- {
- label: "鍒嗙被",
- prop: "type"
- },
- {
- label: "鎿嶄綔",
- type: "op"
- }
- ]
- });
-
- // crud 鍔犺浇
- function onLoad({ ctx, app }: CrudLoad) {
- console.log(service);
-
- // 缁戝畾 service
- ctx.service(service.huaneng.huaneng).done();
- app.refresh();
- }
-
- return {
- refs,
- setRefs,
- upsert,
- table,
- onLoad
- };
- }
-});
-</script>
+<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: "濮撳悕",
+ prop: "name",
+ component: {
+ name: "el-input"
+ }
+ },
+ {
+ label: "鍚嶇О",
+ prop: "title",
+ component: {
+ name: "el-input"
+ }
+ },
+ {
+ label: "搴忓彿",
+ prop: "price",
+ component: {
+ name: "el-input"
+ }
+ },
+ {
+ label: "鍒嗙被",
+ prop: "type",
+ component: {
+ name: "el-input"
+ }
+ }
+ ]
+ });
+
+ // 琛ㄦ牸閰嶇疆
+ const table = reactive<Table>({
+ columns: [
+ {
+ type: "selection",
+ align: "center"
+ },
+ {
+ label: "濮撳悕",
+ prop: "name"
+ },
+ {
+ label: "璁惧",
+ prop: "title"
+ },
+ {
+ label: "搴忓彿",
+ prop: "price"
+ },
+ {
+ label: "鍒嗙被",
+ prop: "type"
+ },
+ {
+ label: "鎿嶄綔",
+ type: "op"
+ }
+ ]
+ });
+
+ // crud 鍔犺浇
+ function onLoad({ ctx, app }: CrudLoad) {
+ console.log("service", service);
+
+ // 缁戝畾 service
+ ctx.service(service.huaneng.huaneng).done();
+ app.refresh();
+ }
+
+ return {
+ refs,
+ setRefs,
+ upsert,
+ table,
+ onLoad
+ };
+ }
+});
+</script>
--
Gitblit v1.9.1