From 9405101d4700f4273dcf66442e380733dc33db26 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期二, 06 六月 2023 18:21:43 +0800
Subject: [PATCH] 分类树联调

---
 Source/UBCS-WEB/src/components/Crud/Crud.vue |   93 ++++++++++++++++++----------------------------
 1 files changed, 36 insertions(+), 57 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Crud/Crud.vue b/Source/UBCS-WEB/src/components/Crud/Crud.vue
index b4b82c2..49edc24 100644
--- a/Source/UBCS-WEB/src/components/Crud/Crud.vue
+++ b/Source/UBCS-WEB/src/components/Crud/Crud.vue
@@ -1,45 +1,28 @@
 <template>
   <basic-container>
-<!--    <avue-crud ref="crud"-->
-<!--               v-loading="loading"-->
-<!--               :data="data"-->
-<!--               :option="option"-->
-<!--               :page="page"-->
-<!--               @sort-change="sortChange"-->
-<!--               @selection-change="selectionChange"-->
-<!--               @on-load="onLoad">-->
-<!--      <template slot="menu">-->
-<!--        <el-button type="text">鏂囧瓧鎸夐挳</el-button>-->
-<!--      </template>-->
-<!--      <template slot="menuLeft">-->
-<!--      </template>-->
-<!--    </avue-crud>-->
-
     <div class="testbox">
       <div style="margin-top: 10px;display: flex;flex-wrap: wrap;width: 100%;">
         <el-button size="small" type="primary" plain @click="addvisible=true">澧炲姞
           <FormTemplateDialog
             :visible.sync="addvisible"
             :type="add"
-            :templateOid="this.templateOid"
-            :codeClassifyOid="this.codeClassifyOid"
+            :templateOid="this.templateOids"
+            :codeClassifyOid="this.codeClassifyOids"
             :codeRuleOid="this.codeRuleOid"
             :disabledProp="disabledProp"
             :rowOid="rowOid"
           >
           </FormTemplateDialog></el-button>
-
         <el-button size="small" type="primary" plain @click="editvisible=true">缂栬緫
           <FormTemplateDialog
             :visible.sync="editvisible"
             :type="edit"
-            :templateOid="this.templateOid"
-            :codeClassifyOid="this.codeClassifyOid"
+            :templateOid="this.templateOids"
+            :codeClassifyOid="this.codeClassifyOids"
             :codeRuleOid="this.codeRuleOid"
             :disabledProp="disabledProp"
             :rowOid="rowOid"
           ></FormTemplateDialog></el-button>
-
         <el-button size="small" type="primary" plain>鎵归噺瀵煎叆鐢宠</el-button>
         <el-button size="small" type="primary" plain>鍘嗗彶鏁版嵁瀵煎叆</el-button>
         <el-button size="small" type="primary" plain>鎵归噺鐢宠缂栫爜</el-button>
@@ -87,22 +70,14 @@
               </template>
             </el-table-column>
           </div>
-<!--          <el-table-column fixed="right" label="鎿嶄綔" width="120" >-->
-<!--            <template slot-scope="scope" >-->
-<!--              <el-button size="small" type="text" @click.native.prevent="enumDeleteRow(scope.$index, tableData)">-->
-<!--                绉婚櫎-->
-<!--              </el-button>-->
-<!--            </template>-->
-<!--          </el-table-column>-->
         </el-table>
-
       </el-row>
     </div>
     <div class="block" style="display: flex;justify-content: flex-end">
       <el-pagination
         @size-change="handleSizeChange"
         @current-change="handleCurrentChange"
-        :current-page="currentPage4"
+        :current-page="page.currentPage"
         :page-sizes="page.pageSizes"
         :page-size="page.pageSizes"
         layout="total, sizes, prev, pager, next, jumper"
@@ -111,18 +86,33 @@
     </div>
   </basic-container>
 </template>
-
 <script>
 import {MasterTable, TableData} from "@/api/GetItem";
 export default {
   name: "Crud.vue",
+  props:{
+    page:{
+      type: Object,
+      default: ()=>{
+        return {}
+      }
+    },
+    templateOid:{
+      type:String,
+      default:""
+    },
+    codeClassifyOid:{
+      type:String,
+      default:""
+    }
+  },
   data() {
     return {
       addvisible:false,
       editvisible:false,
       findvisible:false,
-      templateOid: "78B8C7C5-A042-0B96-FE6D-65421451782A",
-      codeClassifyOid: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
+      templateOids: "78B8C7C5-A042-0B96-FE6D-65421451782A",
+      codeClassifyOids: "4524E801-6CC6-92E8-1AC3-2AB9604E8F96",
       codeRuleOid: "B95872A6-9CEA-D490-8F1B-9D26548CAF96",
       rowOid: '6EF696C3-CD87-0E7C-1EA1-8DE3913A95C9',
       disabledProp: ["id"],
@@ -133,14 +123,6 @@
       data: [],
       options:{},
       option: {
-        //榛樿楂樺害,
-        align: 'center',
-        menuAlign: 'center',
-        addBtn: false,
-        editBtn: false,
-        selection: true,
-        selectionFixed: false,
-        index: true,
         column: []
       },
       List: [],
@@ -150,12 +132,6 @@
         truefalse: "switch",
         number: "number",
         datetime: "datetime",
-      },
-      page: {
-        total: 0,
-        currentPage: 1,
-        pageSize: 10,
-        pageSizes: [10, 30, 50, 100, 200],
       },
       tableData:[],
       tableHeadData:[],
@@ -174,7 +150,12 @@
   },
   methods: {
     handleSizeChange(val){
-      console.log(val)
+      this.page.pageSize=val
+      this.CrudRend()
+    },
+    handleCurrentChange(val){
+      this.page.currentPage=val
+      this.CrudRend()
     },
     // 鐩戝惉鍗曞厓鏍肩偣鍑讳簨浠跺苟瀛樺偍姝e湪缂栬緫鐨勮
     handleCellClick(row, column) {
@@ -220,11 +201,10 @@
     //琛ㄦ牸鏁版嵁
     CrudRend() {
       TableData({
-        templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
-        codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
+        templateOid: this.templateOid,
+        codeClassifyOid: this.codeClassifyOid,
         page: this.page.currentPage,
-        limit:9,
-        _: 1685089123575
+        limit:this.page.pageSize,
       }).then(res => {
         this.page.total = res.data.total;
         this.data = res.data.data;
@@ -241,8 +221,8 @@
         order = "desc";
       }
       TableData({
-        templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
-        codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
+        templateOid: this.templateOid,
+        codeClassifyOid: this.codeClassifyOid,
         order: order,
         sort: val.prop,
         page: this.page.currentPage,
@@ -257,11 +237,10 @@
     //鍒嗛〉鍒锋柊
     async onLoad(val) {
       await TableData({
-        templateOid: "A12826E4-2B66-6D56-DE30-92BB1D7F607F",
-        codeClassifyOid: "D9CF223F-317D-71EB-BD11-433A94CAD9F3",
+        templateOid: this.templateOid,
+        codeClassifyOid: this.codeClassifyOid,
         page: val.currentPage,
         limit: val.pageSize,
-        _: 1685089123575
       }).then(res => {
         this.data = res.data.data;
       })

--
Gitblit v1.9.3