From 71a9eef518f2f2f1a1eb2fb90f2eb8ab7b155bc8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 08 一月 2026 14:57:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_天津军泰伟业' into dev_天津军泰伟业
---
src/views/tool/gen/importTable.vue | 211 +++++++++++++++++++++++++++++-----------------------
1 files changed, 118 insertions(+), 93 deletions(-)
diff --git a/src/views/tool/gen/importTable.vue b/src/views/tool/gen/importTable.vue
index 67624e2..67e4723 100644
--- a/src/views/tool/gen/importTable.vue
+++ b/src/views/tool/gen/importTable.vue
@@ -1,47 +1,66 @@
<template>
<!-- 瀵煎叆琛� -->
- <el-dialog title="瀵煎叆琛�" v-model="visible" width="800px" top="5vh" append-to-body>
- <el-form :model="queryParams" ref="queryRef" :inline="true">
- <el-form-item label="琛ㄥ悕绉�" prop="tableName">
- <el-input
- v-model="queryParams.tableName"
- placeholder="璇疯緭鍏ヨ〃鍚嶇О"
- clearable
- @keyup.enter="handleQuery"
- />
+ <el-dialog title="瀵煎叆琛�"
+ v-model="visible"
+ width="800px"
+ top="5vh"
+ append-to-body>
+ <el-form :model="queryParams"
+ ref="queryRef"
+ :inline="true">
+ <el-form-item label="琛ㄥ悕绉�"
+ prop="tableName">
+ <el-input v-model="queryParams.tableName"
+ placeholder="璇疯緭鍏ヨ〃鍚嶇О"
+ clearable
+ style="width: 180px"
+ @keyup.enter="handleQuery" />
</el-form-item>
- <el-form-item label="琛ㄦ弿杩�" prop="tableComment">
- <el-input
- v-model="queryParams.tableComment"
- placeholder="璇疯緭鍏ヨ〃鎻忚堪"
- clearable
- @keyup.enter="handleQuery"
- />
+ <el-form-item label="琛ㄦ弿杩�"
+ prop="tableComment">
+ <el-input v-model="queryParams.tableComment"
+ placeholder="璇疯緭鍏ヨ〃鎻忚堪"
+ clearable
+ style="width: 180px"
+ @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
- <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
+ <el-button type="primary"
+ icon="Search"
+ @click="handleQuery">鎼滅储</el-button>
+ <el-button icon="Refresh"
+ @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
<el-row>
- <el-table @row-click="clickRow" ref="table" :data="dbTableList" @selection-change="handleSelectionChange" height="260px">
- <el-table-column type="selection" width="55"></el-table-column>
- <el-table-column prop="tableName" label="琛ㄥ悕绉�" :show-overflow-tooltip="true"></el-table-column>
- <el-table-column prop="tableComment" label="琛ㄦ弿杩�" :show-overflow-tooltip="true"></el-table-column>
- <el-table-column prop="createTime" label="鍒涘缓鏃堕棿"></el-table-column>
- <el-table-column prop="updateTime" label="鏇存柊鏃堕棿"></el-table-column>
+ <el-table @row-click="clickRow"
+ ref="table"
+ :data="dbTableList"
+ @selection-change="handleSelectionChange"
+ height="260px">
+ <el-table-column type="selection"
+ width="55"></el-table-column>
+ <el-table-column prop="tableName"
+ label="琛ㄥ悕绉�"
+ :show-overflow-tooltip="true"></el-table-column>
+ <el-table-column prop="tableComment"
+ label="琛ㄦ弿杩�"
+ :show-overflow-tooltip="true"></el-table-column>
+ <el-table-column prop="createTime"
+ label="鍒涘缓鏃堕棿"></el-table-column>
+ <el-table-column prop="updateTime"
+ label="鏇存柊鏃堕棿"></el-table-column>
</el-table>
- <pagination
- v-show="total>0"
- :total="total"
- v-model:page="queryParams.pageNum"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
- />
+ <pagination v-show="total>0"
+ :total="total"
+ v-model:page="queryParams.pageNum"
+ v-model:limit="queryParams.pageSize"
+ @pagination="getList" />
</el-row>
<template #footer>
<div class="dialog-footer">
- <el-button type="primary" @click="handleImportTable">纭� 瀹�</el-button>
+ <el-button type="primary"
+ @click="handleImportTable">纭� 瀹�</el-button>
<el-button @click="visible = false">鍙� 娑�</el-button>
</div>
</template>
@@ -49,70 +68,76 @@
</template>
<script setup>
-import { listDbTable, importTable } from "@/api/tool/gen";
+ import { listDbTable, importTable } from "@/api/tool/gen";
-const total = ref(0);
-const visible = ref(false);
-const tables = ref([]);
-const dbTableList = ref([]);
-const { proxy } = getCurrentInstance();
+ const total = ref(0);
+ const visible = ref(false);
+ const tables = ref([]);
+ const dbTableList = ref([]);
+ const { proxy } = getCurrentInstance();
-const queryParams = reactive({
- pageNum: 1,
- pageSize: 10,
- tableName: undefined,
- tableComment: undefined
-});
-
-const emit = defineEmits(["ok"]);
-
-/** 鏌ヨ鍙傛暟鍒楄〃 */
-function show() {
- getList();
- visible.value = true;
-}
-/** 鍗曞嚮閫夋嫨琛� */
-function clickRow(row) {
- proxy.$refs.table.toggleRowSelection(row);
-}
-/** 澶氶�夋閫変腑鏁版嵁 */
-function handleSelectionChange(selection) {
- tables.value = selection.map(item => item.tableName);
-}
-/** 鏌ヨ琛ㄦ暟鎹� */
-function getList() {
- listDbTable(queryParams).then(res => {
- dbTableList.value = res.rows;
- total.value = res.total;
+ const queryParams = reactive({
+ pageNum: 1,
+ pageSize: 10,
+ tableName: undefined,
+ tableComment: undefined,
});
-}
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-function handleQuery() {
- queryParams.pageNum = 1;
- getList();
-}
-/** 閲嶇疆鎸夐挳鎿嶄綔 */
-function resetQuery() {
- proxy.resetForm("queryRef");
- handleQuery();
-}
-/** 瀵煎叆鎸夐挳鎿嶄綔 */
-function handleImportTable() {
- const tableNames = tables.value.join(",");
- if (tableNames == "") {
- proxy.$modal.msgError("璇烽�夋嫨瑕佸鍏ョ殑琛�");
- return;
+
+ const emit = defineEmits(["ok"]);
+
+ /** 鏌ヨ鍙傛暟鍒楄〃 */
+ function show() {
+ getList();
+ visible.value = true;
}
- importTable({ tables: tableNames }).then(res => {
- proxy.$modal.msgSuccess(res.msg);
- if (res.code === 200) {
- visible.value = false;
- emit("ok");
- }
- });
-}
-defineExpose({
- show,
-});
+ /** 鍗曞嚮閫夋嫨琛� */
+ function clickRow(row) {
+ proxy.$refs.table.toggleRowSelection(row);
+ }
+
+ /** 澶氶�夋閫変腑鏁版嵁 */
+ function handleSelectionChange(selection) {
+ tables.value = selection.map(item => item.tableName);
+ }
+
+ /** 鏌ヨ琛ㄦ暟鎹� */
+ function getList() {
+ listDbTable(queryParams).then(res => {
+ dbTableList.value = res.rows;
+ total.value = res.total;
+ });
+ }
+
+ /** 鎼滅储鎸夐挳鎿嶄綔 */
+ function handleQuery() {
+ queryParams.pageNum = 1;
+ getList();
+ }
+
+ /** 閲嶇疆鎸夐挳鎿嶄綔 */
+ function resetQuery() {
+ proxy.resetForm("queryRef");
+ handleQuery();
+ }
+
+ /** 瀵煎叆鎸夐挳鎿嶄綔 */
+ function handleImportTable() {
+ const tableNames = tables.value.join(",");
+ if (tableNames == "") {
+ proxy.$modal.msgError("璇烽�夋嫨瑕佸鍏ョ殑琛�");
+ return;
+ }
+ importTable({ tables: tableNames }).then(res => {
+ proxy.$modal.msgSuccess(res.msg);
+ if (res.code === 200) {
+ visible.value = false;
+ emit("ok");
+ }
+ });
+ }
+
+ defineExpose({
+ show,
+ });
</script>
--
Gitblit v1.9.3