Forráskód Böngészése

优化代码以及添加新的数据

DESKTOP-MINPJAU\Administrator 3 éve
szülő
commit
7ae9a36466

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 48 - 1140
package-lock.json


+ 0 - 2
package.json

@@ -11,7 +11,6 @@
   "dependencies": {
     "@babel/standalone": "7.14.8",
     "@element-plus/icons-vue": "^2.0.6",
-    "@kangc/v-md-editor": "^2.3.5",
     "@vitejs/plugin-legacy": "^1.8.2",
     "@vueuse/core": "^8.7.5",
     "axios": "^0.27.2",
@@ -27,7 +26,6 @@
     "nprogress": "^0.2.0",
     "qrcanvas": "^3.1.2",
     "sortablejs": "^1.14.0",
-    "throttle-debounce": "^3.0.1",
     "vue": "^3.2.37",
     "vue-router": "^4.0.16",
     "vuex": "^4.0.2",

+ 51 - 0
src/components/xc/xc-table-v2/XcTableV2.vue

@@ -0,0 +1,51 @@
+<template>
+  <el-auto-resizer>
+    <template #default="{ height, width }">
+      <el-table-v2 :data="props.data"
+                   :columns="columns"
+                   :width="width"
+                   :height="height - 200"
+                   fixed/>
+    </template>
+  </el-auto-resizer>
+</template>
+
+<script setup name='XcTableV2'>
+
+const props = defineProps({
+  data: {
+    type: Array,
+    default: []
+  }
+})
+
+// let width = $ref(123)
+// let height = $ref(400)
+
+let columns = $ref([])
+
+onBeforeMount(() => {
+  console.log(useSlots().default())
+  for (let i = 0; i < useSlots().default().length; i++) {
+    let item = useSlots().default()[i]
+    if (item.props.type === 'selection') {
+      columns.push({
+        dataKey: 'selection',
+        width: 50,
+
+      });
+    } else {
+      columns.push({
+        dataKey: item.props.prop,
+        title: item.props.label,
+        width: item.props.width ? 120 : parseInt(item.props.width)
+      });
+    }
+  }
+})
+
+</script>
+
+<style scoped>
+
+</style>

+ 98 - 12
src/components/xc/xc-table/XcTable.vue

@@ -1,32 +1,118 @@
 <template>
   <el-table
-      :data="props.data.data"
+      ref="tableRef"
+      :data="!props.localPaging ? props.data.data :
+       props.data.data.slice((props.data.currentPage - 1) * props.data.pageSize,props.data.currentPage * props.data.pageSize) "
       style="width: 100%"
-      :height="props.height">
+      :height="!props.height ? windowSize.h - 120 :props.height"
+      @selection-change="selectionChange"
+      @row-click="rowClick"
+      highlight-current-row
+      :row-key="props.rowKey"
+      border
+      @select-all="selectAll"
+      stripe>
     <slot/>
   </el-table>
+  <el-pagination
+      :current-page="props.data.currentPage"
+      :page-size="props.data.pageSize"
+      :total="props.data.total"
+      :layout="props.layout"
+      :small="!!props.small"
+      :page-sizes="[10, 20, 30, 100]"
+      @current-change="currentChange"
+      @size-change="sizeChange"/>
 </template>
 
 <script setup name='XcTable'>
+import store from "@/store";
+
 const props = defineProps({
   data: {
-    type: Array,
+    type: Object,
     default: {
       data: [],
       currentPage: 1,
-      pageSize: 30
-    },
-    height: {
-      type: Number,
-      default: 300,
+      pageSize: 30,
+      total: 0
     },
-    openPaging: {
-      type: Boolean,
-      default: true
-    }
   },
+  rowKey: {
+    type: String
+  },
+  height: {
+    type: Number,
+  },
+  localPaging: {
+    type: Boolean,
+  },
+  openPaging: {
+    type: Boolean,
+    default: true
+  },
+  layout: {
+    type: String,
+    default: 'total, sizes, prev, pager, next, jumper'
+  },
+  small: {
+    type: Boolean
+  }
+})
+const emit = defineEmits(['currentChange', 'sizeChange', 'rowClick'])
+
+let tableRef = $ref(null)
+let selectedData = $ref([])
+
+const windowSize = computed(() => {
+  return store.state.app.windowSize
 })
 
+let flag = false // 默认 为全不选
+const selectAll = (selection) => {
+  flag = !flag
+  if (!flag) {
+    // 在点击了全不选中 需要清空
+    tableRef.clearSelection()
+    return
+  }
+  let length = selection.length
+  for (let i = 0; i < length; i++) {
+    let item = selection[i]
+    if (item.children) {
+      toggleSelection(item.children, flag)
+    }
+  }
+}
+
+const toggleSelection = (row, selected) => {
+  if (row) {
+    for (let i = 0, len = row.length; i < len; i++) {
+      tableRef.toggleRowSelection(row[i], selected)
+    }
+  }
+}
+
+const selectionChange = (selection) => {
+  selectedData = selection
+}
+
+const rowClick = (row, column, event) => {
+  tableRef.toggleRowSelection(row, !selectedData.includes(row))
+  emit('rowClick', row, column, event)
+}
+
+const currentChange = (val) => {
+  emit('currentChange', val)
+  props.data.currentPage = val
+  tableRef.setScrollTop(0)
+}
+
+const sizeChange = (val) => {
+  emit('sizeChange', val)
+  props.data.pageSize = val
+  tableRef.setScrollTop(0)
+}
 </script>
 
 <style scoped>

+ 64 - 57
src/components/zhu-yuan-yi-sheng/yi-zhu-lu-ru/HuoQuMuBan.vue

@@ -12,7 +12,8 @@
           </el-radio-group>
           <el-input v-model="code" clearable style="width: 120px" @keyup.enter="dianJiChaXun"></el-input>
           <el-button @click="dianJiChaXun">查询</el-button>
-          <el-table :data="fuJiMuBanShuJu.data" :height="windowSize.h / 1.6" highlight-current-row stripe style="width: 300px">
+          <el-table :data="fuJiMuBanShuJu.data" :height="windowSize.h / 1.6" highlight-current-row stripe
+                    style="width: 300px">
             <el-table-column label="名称" prop="patternName" width="70"></el-table-column>
             <el-table-column label="排序" prop="sortNo"></el-table-column>
             <el-table-column label="操作" width="120">
@@ -22,13 +23,17 @@
                   <template #dropdown>
                     <el-dropdown-menu>
                       <el-dropdown-item icon="Edit" @click="xiuGaiMuBan(scope.row)">修改</el-dropdown-item>
-                      <br />
-                      <el-dropdown-item icon="Delete" @click="shanChuMuBan(scope.row, scope.$index)">删除 </el-dropdown-item>
-                      <br />
-                      <el-dropdown-item v-if="scope.row.yiBeiShouCang" :disabled="scope.row.inputId === user.code" icon="Collection" @click="dianJiShouCang(scope.row)"
-                        >取消收藏
+                      <br/>
+                      <el-dropdown-item icon="Delete" @click="shanChuMuBan(scope.row, scope.$index)">删除
+                      </el-dropdown-item>
+                      <br/>
+                      <el-dropdown-item v-if="scope.row.yiBeiShouCang" :disabled="scope.row.inputId === user.code"
+                                        icon="Collection" @click="dianJiShouCang(scope.row)"
+                      >取消收藏
+                      </el-dropdown-item>
+                      <el-dropdown-item v-else :disabled="scope.row.inputId === user.code" icon="Collection"
+                                        @click="dianJiShouCang(scope.row)">收藏
                       </el-dropdown-item>
-                      <el-dropdown-item v-else :disabled="scope.row.inputId === user.code" icon="Collection" @click="dianJiShouCang(scope.row)">收藏 </el-dropdown-item>
                     </el-dropdown-menu>
                   </template>
                 </el-dropdown>
@@ -36,13 +41,13 @@
             </el-table-column>
           </el-table>
           <el-pagination
-            :current-page="fuJiMuBanShuJu.currentPage"
-            :page-size="fuJiMuBanShuJu.pageSize"
-            :pager-count="5"
-            :total="fuJiMuBanShuJu.total"
-            layout="total,  prev, pager, next"
-            small
-            @current-change="handleCurrentChange"
+              :current-page="fuJiMuBanShuJu.currentPage"
+              :page-size="fuJiMuBanShuJu.pageSize"
+              :pager-count="5"
+              :total="fuJiMuBanShuJu.total"
+              layout="total,  prev, pager, next"
+              small
+              @current-change="handleCurrentChange"
           >
           </el-pagination>
         </el-aside>
@@ -50,56 +55,57 @@
           <el-button :disabled="xuanZhongShuJu.length === 0" type="primary" @click="dianJiQueDing">确定</el-button>
           开始时间:
           <el-date-picker
-            v-model="startTime"
-            :disabled-date="disabledDate"
-            format="YYYY-MM-DD HH:mm:ss"
-            style="width: 180px"
-            type="datetime"
-            value-format="YYYY-MM-DD HH:mm:ss"
+              v-model="startTime"
+              :disabled-date="disabledDate"
+              format="YYYY-MM-DD HH:mm:ss"
+              style="width: 180px"
+              type="datetime"
+              value-format="YYYY-MM-DD HH:mm:ss"
           ></el-date-picker>
           医嘱时间:
           <el-input v-model="orderTime" disabled style="width: 180px"></el-input>
           频率:
           <el-select
-            v-model="frequCode"
-            :remote-method="pinLvRemoteMethod"
-            clearable
-            filterable
-            remote
-            size="small"
-            style="width: 120px"
-            @change="getFrequCodeName"
-            @clear="frequCode = null"
+              v-model="frequCode"
+              :remote-method="pinLvRemoteMethod"
+              clearable
+              filterable
+              remote
+              size="small"
+              style="width: 120px"
+              @change="getFrequCodeName"
+              @clear="frequCode = null"
           >
-            <el-option v-for="item in yaoPinPingLvData" :key="item.code" :label="item.name" :value="{ label: item.name, value: item.code }">
+            <el-option v-for="item in yaoPinPingLvData" :key="item.code" :label="item.name"
+                       :value="{ label: item.name, value: item.code }">
               <span style="color: #8492a6; font-size: 12px">{{ item.code }}</span>
               <el-divider direction="vertical"></el-divider>
               <span>{{ item.name }}</span>
             </el-option>
           </el-select>
-          <el-divider direction="vertical"></el-divider>
+          <el-divider direction="vertical"/>
           <el-button :disabled="muBanShuJu.length === 0" type="warning" @click="bianJiNeiRong">编辑内容</el-button>
           <el-table
-            ref="tableRef"
-            :data="muBanShuJu"
-            :height="windowSize.h / 1.6"
-            :row-class-name="differChildrenRows"
-            border
-            class="eltable"
-            row-key="id"
-            @selection-change="xuanZhongMuBan"
-            @select-all="quanXuanMuBan"
-          >
-            <el-table-column fixed="left" type="selection"></el-table-column>
+              ref="tableRef"
+              :data="muBanShuJu"
+              :height="windowSize.h / 1.6"
+              :row-class-name="differChildrenRows"
+              border
+              class="eltable"
+              row-key="id"
+              @selection-change="xuanZhongMuBan"
+              @select-all="quanXuanMuBan"
+              default-expand-all>
+            <el-table-column fixed="left" type="selection"/>
             <el-table-column fixed="left" label="uuid" prop="id"></el-table-column>
             <el-table-column label="医嘱名称" prop="orderName" show-overflow-tooltip width="135"></el-table-column>
             <el-table-column label="规格" prop="drugSpecification"></el-table-column>
             <el-table-column label="频率" prop="frequCodeName"></el-table-column>
             <el-table-column label="一次剂量" prop="dose">
-              <template #default="scope"> {{ scope.row.dose }} {{ scope.row.doseUnitName }} </template>
+              <template #default="scope"> {{ scope.row.dose }} {{ scope.row.doseUnitName }}</template>
             </el-table-column>
             <el-table-column label="领量" prop="drugQuan">
-              <template #default="scope"> {{ scope.row.drugQuan }} {{ scope.row.miniUnitName }} </template>
+              <template #default="scope"> {{ scope.row.drugQuan }} {{ scope.row.miniUnitName }}</template>
             </el-table-column>
             <el-table-column label="给药方式" prop="supplyCodeName"></el-table-column>
             <el-table-column label="执行科室" prop="execUnitName"></el-table-column>
@@ -114,14 +120,14 @@
 
 <script name="HuoQuMuBan" setup>
 import store from '../../../store'
-import { huoQuMuBanShuJu, huoQuYiZhuMuBan, huoQuZhuYuanPinLv, muBanCaoZuo } from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
-import { muBanMing } from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
-import { computed, ref } from 'vue'
-import { listIsBlank, stringNotBlank } from '@/utils/blank-utils'
-import { ElMessage, ElMessageBox } from 'element-plus'
-import { clone } from '@/utils/clone'
+import {huoQuMuBanShuJu, huoQuYiZhuMuBan, huoQuZhuYuanPinLv, muBanCaoZuo} from '@/api/zhu-yuan-yi-sheng/yi-zhu-lu-ru'
+import {muBanMing} from '@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng'
+import {computed, ref} from 'vue'
+import {listIsBlank, stringNotBlank} from '@/utils/blank-utils'
+import {ElMessage, ElMessageBox} from 'element-plus'
+import {clone} from '@/utils/clone'
 import BaoCunMuBan from './BaoCunMuBan.vue'
-import { getServerDateApi } from '@/api/public-api'
+import {getServerDateApi} from '@/api/public-api'
 
 // 调用父组件的方法
 const emit = defineEmits(['mu-ban-shu-ju', 'close'])
@@ -193,10 +199,11 @@ const shanChuMuBan = (row, index) => {
   ElMessageBox.confirm('确定要删除该模板吗?', '提示', {
     type: 'error',
   })
-    .then(() => {
-      muBanCaoZuo(row.patternCode, '', user.value.deptCode, 0, 2)
-    })
-    .catch((e) => {})
+      .then(() => {
+        muBanCaoZuo(row.patternCode, '', user.value.deptCode, 0, 2)
+      })
+      .catch((e) => {
+      })
 }
 
 // 收藏模板
@@ -205,7 +212,7 @@ const dianJiShouCang = (row) => {
 }
 
 /* 添加子医嘱的背景颜色 */
-const differChildrenRows = ({ row }) => {
+const differChildrenRows = ({row}) => {
   if (row.isChildren) {
     return 'children-row'
   }
@@ -261,7 +268,7 @@ const disabledDate = (time) => {
 }
 
 // 获取评率
-const getFrequCodeName = ({ label, value }) => {
+const getFrequCodeName = ({label, value}) => {
   frequCodeName.value = label
   frequCode.value = value
 }

+ 0 - 30
src/router/modules/pages.js

@@ -1,30 +0,0 @@
-import Layout from '@/layout/index.vue'
-import { createNameComponent } from '../createNode'
-const route = [
-  {
-    path: '/pages',
-    component: Layout,
-    redirect: '/pages/crudTable',
-    meta: { title: '页面', icon: 'el-icon-document-copy' },
-    alwaysShow: true,
-    children: [
-      {
-        path: 'crudTable',
-        component: createNameComponent(() => import('@/views/main/pages/crudTable/index.vue')),
-        meta: { title: '业务表格', cache: false, roles: ['admin', 'editor'] },
-      },
-      {
-        path: 'categoryTable',
-        component: createNameComponent(() => import('@/views/main/pages/categoryTable/index.vue')),
-        meta: { title: '分类联动表格', cache: true, roles: ['admin'] },
-      },
-      {
-        path: 'treeTable',
-        component: createNameComponent(() => import('@/views/main/pages/treeTable/index.vue')),
-        meta: { title: '树联动表格', cache: true },
-      },
-    ],
-  },
-]
-
-export default route

+ 91 - 89
src/utils/request.js

@@ -1,109 +1,111 @@
 import axios from 'axios'
-import { ElMessage, ElMessageBox } from 'element-plus'
+import {ElMessage, ElMessageBox} from 'element-plus'
 import router from '@/router'
 import store from '@/store'
-import { startLoading, endLoading } from './loading'
+import {startLoading, endLoading} from './loading'
 
 let loginBox = null
 
 const service = axios.create({
-  baseURL: import.meta.env.VITE_BASE_URL,
-  withCredentials: true,
-  timeout: 0,
+    baseURL: import.meta.env.VITE_BASE_URL,
+    withCredentials: true,
+    timeout: 0,
 })
 
 /*axios请求拦截*/
 service.interceptors.request.use(
-  (config) => {
-    if (typeof config.jdtTitle !== 'undefined') {
-      store.commit('app/setJdt', { title: config.jdtTitle, isOpen: true, closeButton: false })
-    } else {
-      if (config.url !== '/caseFrontSheet/printVerify' && !config.url.startsWith('/mixLabelPrint')) {
-        startLoading()
-      }
+    (config) => {
+        if (typeof config.jdtTitle !== 'undefined') {
+            store.commit('app/setJdt', {title: config.jdtTitle, isOpen: true, closeButton: false})
+        } else {
+            if (config.url !== '/caseFrontSheet/printVerify' && !config.url.startsWith('/mixLabelPrint')) {
+                startLoading()
+            }
+        }
+        if (store.getters['user/token']) {
+            config.headers['token'] = store.state.user.token
+        }
+        return config
+    },
+    (error) => {
+        endLoading()
+        store.commit('app/closeButton', true)
+        return Promise.reject(error)
     }
-    if (store.getters['user/token']) {
-      config.headers['token'] = store.state.user.token
-    }
-    return config
-  },
-  (error) => {
-    endLoading()
-    store.commit('app/closeButton', true)
-    return Promise.reject(error)
-  }
 )
 
 service.interceptors.response.use(
-  (response) => {
-    endLoading()
-    store.commit('app/closeButton', true)
-    if (response.data.code === 200 || response.data.code === 0) {
-      return response.data.data
-    }
-    if (response.data.code === 2002) {
-      return response.data
-    }
-    if (response.data.code === 201) {
-      ElMessage({
-        type: 'success',
-        title: '成功',
-        duration: 2800,
-        dangerouslyUseHTMLString: true,
-        message: response.data.message,
-        showClose: true,
-        offset: 130,
-      })
-      return response.data.data
-    }
-    if (response.data.code > 1000 && response.data.code < 2000) {
-      ElMessage({
-        type: 'error',
-        message: response.data.message,
-        duration: 3000,
-        showClose: true,
-      })
-    } else if (response.data.code > 2000 && response.data.code < 3000) {
-      if (response.data.code === 2003) {
-        ElMessageBox.alert(response.data.message, '提示', {
-          type: 'error',
-          dangerouslyUseHTMLString: true,
-          confirmButtonText: '确定',
-        }).then(() => {})
-      } else {
-        ElMessageBox.alert(response.data.message, '提示', {
-          type: 'error',
-          confirmButtonText: '确定',
-        }).then(() => {})
-      }
-    } else if (response.data.code > 3000 && response.data.code < 4000) {
-      if (loginBox === null) {
-        loginBox = ElMessageBox.alert(response.data.message, '提示', {
-          type: 'warning',
-          confirmButtonText: '确定',
-          showClose: false,
-        }).then(() => {
-          loginBox = null
-          router.push('/login')
+    (response) => {
+        endLoading()
+        store.commit('app/closeButton', true)
+        if (response.data.code === 200 || response.data.code === 0) {
+            return response.data.data
+        }
+        if (response.data.code === 2002) {
+            return response.data
+        }
+        if (response.data.code === 201) {
+            ElMessage({
+                type: 'success',
+                title: '成功',
+                duration: 2800,
+                dangerouslyUseHTMLString: true,
+                message: response.data.message,
+                showClose: true,
+                offset: 130,
+            })
+            return response.data.data
+        }
+        if (response.data.code > 1000 && response.data.code < 2000) {
+            ElMessage({
+                type: 'error',
+                message: response.data.message,
+                duration: 3000,
+                showClose: true,
+            })
+        } else if (response.data.code > 2000 && response.data.code < 3000) {
+            if (response.data.code === 2003) {
+                ElMessageBox.alert(response.data.message, '提示', {
+                    type: 'error',
+                    dangerouslyUseHTMLString: true,
+                    confirmButtonText: '确定',
+                }).then(() => {
+                })
+            } else {
+                ElMessageBox.alert(response.data.message, '提示', {
+                    type: 'error',
+                    confirmButtonText: '确定',
+                }).then(() => {
+                })
+            }
+        } else if (response.data.code > 3000 && response.data.code < 4000) {
+            if (loginBox === null) {
+                loginBox = ElMessageBox.alert(response.data.message, '提示', {
+                    type: 'warning',
+                    confirmButtonText: '确定',
+                    showClose: false,
+                }).then(() => {
+                    loginBox = null
+                    router.push('/login')
+                })
+            }
+        }
+        if (response.data.data) {
+            return Promise.reject(response.data)
+        }
+        return Promise.reject(response.data.message || '服务器内部错误')
+    },
+    (error) => {
+        endLoading()
+        store.commit('app/closeButton', true)
+        ElMessage({
+            message: error,
+            type: 'error',
+            duration: 2500,
+            showClose: true,
         })
-      }
-    }
-    if (response.data.data) {
-      return Promise.reject(response.data)
+        return Promise.reject(error)
     }
-    return Promise.reject(response.data.message || '服务器内部错误')
-  },
-  (error) => {
-    endLoading()
-    store.commit('app/closeButton', true)
-    ElMessage({
-      message: error,
-      type: 'error',
-      duration: 2500,
-      showClose: true,
-    })
-    return Promise.reject(error)
-  }
 )
 
 export default service

+ 7 - 3
src/views/hospitalization/zhu-yuan-yi-sheng/yi-zhu-lu-ru/TianJiaYiZhu.vue

@@ -569,9 +569,13 @@ const geiYaoFangShiRemoteMethod = (val) => {
 /* 父医嘱 */
 const fuYiZhuData = ref([])
 const fuYiZhuClick = () => {
-  fuYiZhuData.value = yiZhuList.value.filter(item => {
-    return stringNotBlank(item.drugFlag) && item.drugFlag === 'i' && item.id !== yiZhuData.value.id && stringIsBlank(item.parentNo)
-  })
+  fuYiZhuData.value = []
+  for (let i = 0, len = yiZhuList.value.length; i < len; i++) {
+    fuYiZhuData.value.push({
+      code: yiZhuList.value[i].id,
+      name: yiZhuList.value[i].orderName
+    })
+  }
 }
 
 /* 获取执行科室 */

+ 28 - 27
src/views/settings/Test.vue

@@ -6,24 +6,12 @@
   <el-button @click="test1">清空</el-button>
   <el-button @click="generateData">生成数据</el-button>
 
-  <!--  <InputAndTable v-model="tableValue" :data="tableData" :realPagination="false">-->
-  <!--    <template #aside>-->
-  <!--      <span @click="searchMethod = 'py'" label="1">拼音</span>-->
-  <!--      <span @click="te('bm')">编码</span>-->
-  <!--      <span @click="te('mc')">名称</span>-->
-  <!--    </template>-->
-  <!--    <template #tableItem>-->
-  <!--      <el-table-column label="编码" prop="code">-->
-  <!--        <template #default="scope">-->
-  <!--          <el-button @click="te( scope.row.code)">{{ scope.row.code }}</el-button>-->
-  <!--        </template>-->
-  <!--      </el-table-column>-->
-  <!--      <el-table-column label="名称" prop="name"></el-table-column>-->
-  <!--      <el-table-column label="其他" prop="qita"></el-table-column>-->
-  <!--    </template>-->
-  <!--  </InputAndTable>-->
-  <!--  <InputAndDialog v-model="inputdialog"/>-->
-  <xc-table></xc-table>
+  <xc-table :data="tableData" row-key="code" localPaging small>
+    <el-table-column type="selection" reserve-selection/>
+    <el-table-column label="编码" prop="code"></el-table-column>
+    <el-table-column label="名称" prop="name"></el-table-column>
+    <el-table-column label="其他" prop="qita"></el-table-column>
+  </xc-table>
 
 </template>
 
@@ -31,8 +19,14 @@
 import sleep from "@/utils/sleep";
 import XcTable from "@/components/xc/xc-table/XcTable.vue";
 
+let dataV2 = $ref([])
 
-// const
+let tableData = $ref({
+  data: [],
+  currentPage: 1,
+  pageSize: 30,
+  total: 0
+})
 
 
 const vChange = (val) => {
@@ -92,22 +86,29 @@ const te = (val) => {
   console.log(val)
 }
 
-let tableValue = $ref('')
-
-let tableData = $ref({
-  data: [],
-  currentPage: 1,
-  total: 1000
-})
-
 for (let i = 0; i < 1000; i++) {
+  let children = []
+  if (i % 3 === 0) {
+    for (let j = 0; j < 10; j++) {
+      children.push({
+        code: 'code' + i,
+        name: 'name' + i,
+        qita: 'qita' + 12,
+      });
+    }
+  }
   tableData.data.push({
     code: 'code' + i,
     name: 'name' + i,
     qita: 'qita' + 12,
+    children: children
   })
 }
 
+console.log(tableData)
+
+tableData.total = tableData.data.length
+
 
 </script>
 

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott