From 0da9c6652870390cd07bc90211aefe095445baf6 Mon Sep 17 00:00:00 2001
From: master <master@163.com>
Date: 星期三, 23 三月 2022 17:09:23 +0800
Subject: [PATCH] 完善表格功能

---
 src/cool/modules/userInfo/views/userInfo.vue |   73 ++++++++++++++++++++++++++++++++++--
 1 files changed, 69 insertions(+), 4 deletions(-)

diff --git a/src/cool/modules/userInfo/views/userInfo.vue b/src/cool/modules/userInfo/views/userInfo.vue
index a3d8511..df0d115 100644
--- a/src/cool/modules/userInfo/views/userInfo.vue
+++ b/src/cool/modules/userInfo/views/userInfo.vue
@@ -1,5 +1,70 @@
 <template>
-  <div>
-    鐢ㄦ埛绠$悊椤甸潰
-  </div>
-</template>
\ No newline at end of file
+  <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: []
+		});
+
+		// crud 鍔犺浇
+		function onLoad({ ctx, app }: CrudLoad) {
+			// 缁戝畾 service
+			ctx.service(service.business.basedeviceinfo).done();
+			app.refresh();
+		}
+
+		return {
+			refs,
+			setRefs,
+			upsert,
+			table,
+			onLoad
+		};
+	}
+});
+</script>

--
Gitblit v1.9.1