From 5f14e63a2400456055086632e027951086114648 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期五, 06 十二月 2024 15:07:04 +0800
Subject: [PATCH] #

---
 zy-asrs-admin/src/views/base/locTypeBind/index.vue |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/zy-asrs-admin/src/views/base/locTypeBind/index.vue b/zy-asrs-admin/src/views/base/locTypeBind/index.vue
index 4490c60..9738f60 100644
--- a/zy-asrs-admin/src/views/base/locTypeBind/index.vue
+++ b/zy-asrs-admin/src/views/base/locTypeBind/index.vue
@@ -5,6 +5,7 @@
 import { message, Modal } from 'ant-design-vue';
 import { logout } from '@/config.js';
 import EditView from './edit.vue'
+import InitView from './init.vue'
 import { formatMessage } from '@/utils/localeUtils.js';
 const context = getCurrentInstance()?.appContext.config.globalProperties;
 
@@ -15,6 +16,12 @@
 let pageSize = 10;
 const searchInput = ref("")
 const editChild = ref(null)
+const initChild = ref(null)
+
+const state = reactive({
+  selectedRowKeys: [],
+  loading: false,
+});
 
 let currentLocType = ref(null)
 let tableData = ref([]);
@@ -97,10 +104,7 @@
   },
 ];
 
-const state = reactive({
-  selectedRowKeys: [],
-  loading: false,
-});
+
 const hasSelected = computed(() => state.selectedRowKeys.length > 0);
 const start = () => {
   state.loading = true;
@@ -116,6 +120,7 @@
 };
 
 function getPage() {
+  state.loading = true;
   post('/api/locTypeBind/page', {
     current: currentPage,
     pageSize: pageSize,
@@ -126,6 +131,8 @@
     if (result.code == 200) {
       let data = result.data;
       tableData.value = data;
+
+      state.loading = false;
     } else if (result.code === 401) {
       message.error(result.msg);
       logout()
@@ -133,6 +140,10 @@
       message.error(result.msg);
     }
   })
+}
+
+const handleInit = (item) => {
+  initChild.value.open = true;
 }
 
 const handleEdit = (item) => {
@@ -259,12 +270,13 @@
     </a-card>
 
     <a-card style="flex: 10;">
+      <InitView ref="initChild" @tableReload="handleTableReload" />
       <EditView ref="editChild" @tableReload="handleTableReload" />
       <div class="table-header">
         <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '璇疯緭鍏�')"
           style="width: 200px;" @search="onSearch" />
         <div class="table-header-right">
-          <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.init', '鍒濆鍖�') }}</a-button>
+          <a-button @click="handleInit(null)" type="primary">{{ formatMessage('page.init', '鍒濆鍖�') }}</a-button>
           <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '娣诲姞') }}</a-button>
           <a-button @click="handleExport">{{ formatMessage('page.export', '瀵煎嚭') }}</a-button>
         </div>
@@ -272,7 +284,7 @@
       <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }"
         :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id"
         :pagination="{ total: tableData.total, onChange: onPageChange }"
-        :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns">
+        :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" :loading="state.loading">
         <template #bodyCell="{ column, text, record }">
           <template v-if="column.dataIndex === 'oper'">
             <div style="display: flex;justify-content: space-evenly;">

--
Gitblit v1.9.1