兰宝车间质量管理系统-前端
疯狂的狮子Li
2024-12-08 84888c3c287ba418c1dca23fc081da8b979519c1
src/views/tool/gen/index.vue
@@ -52,7 +52,7 @@
              删除
            </el-button>
          </el-col>
          <right-toolbar v-model:showSearch="showSearch" @query-table="getList"></right-toolbar>
          <right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
        </el-row>
      </template>
@@ -113,8 +113,8 @@
</template>
<script setup name="Gen" lang="ts">
import { listTable, previewTable, delTable, genCode, synchDb, getDataNames } from '@/api/tool/gen';
import { TableQuery, TableVO } from '@/api/tool/gen/types';
import {delTable, genCode, getDataNames, listTable, previewTable, synchDb} from '@/api/tool/gen';
import {TableQuery, TableVO} from '@/api/tool/gen/types';
import router from '@/router';
import ImportTable from './importTable.vue';
@@ -155,17 +155,6 @@
  title: '代码预览'
});
onActivated(() => {
  const time = route.query.t;
  if (time != null && time != uniqueId.value) {
    uniqueId.value = time as string;
    queryParams.value.pageNum = Number(route.query.pageNum);
    dateRange.value = ['', ''];
    queryFormRef.value?.resetFields();
    getList();
  }
});
/** 查询多数据源名称 */
const getDataNameList = async () => {
  const res = await getDataNames();
@@ -202,7 +191,7 @@
/** 同步数据库操作 */
const handleSynchDb = async (row: TableVO) => {
  const tableId = row.tableId;
  await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?').catch(() => {});
  await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?');
  await synchDb(tableId);
  proxy?.$modal.msgSuccess('同步成功');
};
@@ -248,6 +237,13 @@
};
onMounted(() => {
  const time = route.query.t;
  if (time != null && time != uniqueId.value) {
    uniqueId.value = time as string;
    queryParams.value.pageNum = Number(route.query.pageNum);
    dateRange.value = ['', ''];
    queryFormRef.value?.resetFields();
  }
  getList();
  getDataNameList();
});