From 80b6cbfc9c861469146318d0b3dd5f8b8b525b8a Mon Sep 17 00:00:00 2001
From: xiejun <xiejun@vci-tech.com>
Date: 星期五, 01 十一月 2024 15:11:19 +0800
Subject: [PATCH] Revert "集成获取mdm分发通用数据格式接口集成"

---
 Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/lemon/tree/index.vue.btl |  124 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/lemon/tree/index.vue.btl b/Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/lemon/tree/index.vue.btl
new file mode 100644
index 0000000..71f9441
--- /dev/null
+++ b/Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/lemon/tree/index.vue.btl
@@ -0,0 +1,124 @@
+<template>
+    <div>
+        <BasicTable @register="registerTable">
+            <template \#toolbar>
+                <a-button type="primary" v-auth="'${modelCode!}_add'" @click="handleCreate">
+                    鏂板
+                </a-button>
+            </template>
+            <template \#bodyCell="{ column, record }">
+             #for(x in prototypes) {
+                    #if(isNotEmpty(x.dictCode)){
+                    <template v-if="column.dataIndex === '${x.propertyName!}'">
+                              {{ formatDictValue(options['${x.propertyName!}Data'], record.category) }}
+                     </template>
+                    #}
+              #}
+             <template v-if="column.dataIndex === 'action'">
+                 <TableAction
+                     :actions="[
+                          {
+                            auth: '${modelCode!}_view',
+                            label: '鏌ョ湅',
+                            color: 'success',
+                            icon: 'clarity:info-standard-line',
+                            onClick: handleView.bind(null, record),
+                          },
+                          {
+                            auth: '${modelCode!}_edit',
+                            label: '缂栬緫',
+                            icon: 'clarity:note-edit-line',
+                            onClick: handleEdit.bind(null, record),
+                          },
+                          {
+                            auth: '${modelCode!}_delete',
+                            label: '鍒犻櫎',
+                            icon: 'ant-design:delete-outlined',
+                            color: 'error',
+                            popConfirm: {
+                              title: '鏄惁纭鍒犻櫎',
+                              confirm: handleDelete.bind(null, record),
+                            },
+                          },
+                        ]"
+                      />
+                 </template>
+            </template>
+        </BasicTable>
+        <${modelClass!}Modal @register="registerModal" @success="handleSuccess" />
+    </div>
+</template>
+<script lang="ts" setup name="${modelClass!}">
+    import { ref } from 'vue';
+    import ${modelClass!}Modal from './${modelCode!}Modal.vue';
+    import { BasicTable, useTable, TableAction } from '/@/components/Table';
+    import { getList, remove } from '/@/api/${serviceCode!}/${modelCode!}';
+    import { useModal } from '/@/components/Modal';
+    import { columns, searchFormSchema } from './${modelCode!}.data';
+    import { useMessage } from '/@/hooks/web/useMessage';
+    import { formatDictValue } from '/@/utils';
+    import { getDictList } from '/@/api/system/system';
+    //鍒濆鍖栧瓧鍏�
+    let options = ref({});
+    async function fetch() {
+    #for(x in prototypes) {
+        #if(isNotEmpty(x.dictCode)){
+          options.value['${x.propertyName!}Data'] = await getDictList({ code: '${x.dictCode!}' });
+        #}
+    #}
+    }
+    fetch();
+
+    const { createMessage } = useMessage();
+    const [registerModal, { openModal }] = useModal();
+    const [registerTable, { reload }] = useTable({
+        api: getList,
+        rowKey: 'id',
+        columns,
+        formConfig: {
+            labelWidth: 120,
+            schemas: searchFormSchema,
+            baseColProps: { xl: 12, xxl: 8 },
+        },
+        useSearchForm: true,
+        actionColumn: {
+            width: 250,
+            title: '鎿嶄綔',
+            dataIndex: 'action',
+        },
+    });
+
+    function handleCreate() {
+        openModal(true, {
+            isDetail: false,
+            isUpdate: false,
+        });
+    }
+
+    function handleView(record: Recordable) {
+        openModal(true, {
+            record,
+            isUpdate: false,
+            isDetail: true,
+        });
+    }
+
+    function handleEdit(record: Recordable) {
+        openModal(true, {
+            record,
+            isDetail: false,
+            isUpdate: true,
+        });
+    }
+    async function handleDelete(record: Recordable) {
+        await remove({ ids: record.id });
+        createMessage.success('鎿嶄綔鎴愬姛');
+        reload();
+    }
+
+    function handleSuccess() {
+        //鎿嶄綔鎴愬姛鎻愮ず
+        createMessage.success('鎿嶄綔鎴愬姛');
+        reload();
+    }
+</script>

--
Gitblit v1.9.3