From 25e2e0e018a00adbfedcee5377d5d0349bb6eb54 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期四, 23 十一月 2023 16:50:31 +0800
Subject: [PATCH] update 优化 页面关于权限标识符说明
---
src/views/tool/gen/index.vue | 122 ++++++++++++++++++++--------------------
1 files changed, 61 insertions(+), 61 deletions(-)
diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue
index dd48635..82d5228 100644
--- a/src/views/tool/gen/index.vue
+++ b/src/views/tool/gen/index.vue
@@ -136,31 +136,31 @@
const importRef = ref<InstanceType<typeof ImportTable>>();
const queryParams = ref<TableQuery>({
- pageNum: 1,
- pageSize: 10,
- tableName: '',
- tableComment: '',
- dataName: ""
+ pageNum: 1,
+ pageSize: 10,
+ tableName: '',
+ tableComment: '',
+ dataName: ""
})
-const preview = ref <any>({
- data: {},
- activeName: 'domain.java'
+const preview = ref<any>({
+ data: {},
+ activeName: 'domain.java'
})
const dialog = reactive<DialogOption>({
- visible: false,
- title: '浠g爜棰勮'
+ visible: false,
+ title: '浠g爜棰勮'
});
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 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();
+ }
})
/** 鏌ヨ澶氭暟鎹簮鍚嶇О */
@@ -171,81 +171,81 @@
/** 鏌ヨ琛ㄩ泦鍚� */
const getList = async () => {
- loading.value = true;
- const res = await listTable(proxy?.addDateRange(queryParams.value, dateRange.value));
- tableList.value = res.rows;
- total.value = res.total;
- loading.value = false;
+ loading.value = true;
+ const res = await listTable(proxy?.addDateRange(queryParams.value, dateRange.value));
+ tableList.value = res.rows;
+ total.value = res.total;
+ loading.value = false;
}
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
- queryParams.value.pageNum = 1;
- getList();
+ queryParams.value.pageNum = 1;
+ getList();
}
/** 鐢熸垚浠g爜鎿嶄綔 */
const handleGenTable = async (row?: TableVO) => {
- const tbIds = row?.tableId || ids.value;
- if (tbIds == "") {
- proxy?.$modal.msgError('璇烽�夋嫨瑕佺敓鎴愮殑鏁版嵁');
- return;
- }
- if (row?.genType === "1") {
- await genCode(row.tableId);
- proxy?.$modal.msgSuccess('鎴愬姛鐢熸垚鍒拌嚜瀹氫箟璺緞锛�' + row.genPath);
- } else {
- proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
- }
+ const tbIds = row?.tableId || ids.value;
+ if (tbIds == "") {
+ proxy?.$modal.msgError('璇烽�夋嫨瑕佺敓鎴愮殑鏁版嵁');
+ return;
+ }
+ if (row?.genType === "1") {
+ await genCode(row.tableId);
+ proxy?.$modal.msgSuccess('鎴愬姛鐢熸垚鍒拌嚜瀹氫箟璺緞锛�' + row.genPath);
+ } else {
+ proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
+ }
}
/** 鍚屾鏁版嵁搴撴搷浣� */
const handleSynchDb = async (row: TableVO) => {
- const tableId = row.tableId;
- await proxy?.$modal.confirm('纭瑕佸己鍒跺悓姝�"' + row.tableName + '"琛ㄧ粨鏋勫悧锛�');
- await synchDb(tableId);
- proxy?.$modal.msgSuccess('鍚屾鎴愬姛');
+ const tableId = row.tableId;
+ await proxy?.$modal.confirm('纭瑕佸己鍒跺悓姝�"' + row.tableName + '"琛ㄧ粨鏋勫悧锛�');
+ await synchDb(tableId);
+ proxy?.$modal.msgSuccess('鍚屾鎴愬姛');
}
/** 鎵撳紑瀵煎叆琛ㄥ脊绐� */
const openImportTable = () => {
- importRef.value.show(queryParams.value.dataName);
+ importRef.value?.show(queryParams.value.dataName);
}
/** 閲嶇疆鎸夐挳鎿嶄綔 */
const resetQuery = () => {
- dateRange.value = ['', ''];
- queryFormRef.value?.resetFields();
- handleQuery();
+ dateRange.value = ['', ''];
+ queryFormRef.value?.resetFields();
+ handleQuery();
}
/** 棰勮鎸夐挳 */
const handlePreview = async (row: TableVO) => {
- const res = await previewTable(row.tableId);
- preview.value.data = res.data;
- dialog.visible = true;
- preview.value.activeName = 'domain.java';
+ const res = await previewTable(row.tableId);
+ preview.value.data = res.data;
+ dialog.visible = true;
+ preview.value.activeName = 'domain.java';
}
/** 澶嶅埗浠g爜鎴愬姛 */
const copyTextSuccess = () => {
- proxy?.$modal.msgSuccess('澶嶅埗鎴愬姛');
+ proxy?.$modal.msgSuccess('澶嶅埗鎴愬姛');
}
// 澶氶�夋閫変腑鏁版嵁
const handleSelectionChange = (selection: TableVO[]) => {
- ids.value = selection.map(item => item.tableId);
- single.value = selection.length != 1;
- multiple.value = !selection.length;
+ ids.value = selection.map(item => item.tableId);
+ single.value = selection.length != 1;
+ multiple.value = !selection.length;
}
/** 淇敼鎸夐挳鎿嶄綔 */
const handleEditTable = (row?: TableVO) => {
- const tableId = row?.tableId || ids.value[0];
- router.push({ path: '/tool/gen-edit/index/' + tableId, query: { pageNum: queryParams.value.pageNum } });
+ const tableId = row?.tableId || ids.value[0];
+ router.push({ path: '/tool/gen-edit/index/' + tableId, query: { pageNum: queryParams.value.pageNum } });
}
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
const handleDelete = async (row?: TableVO) => {
- const tableIds = row?.tableId || ids.value;
- await proxy?.$modal.confirm('鏄惁纭鍒犻櫎琛ㄧ紪鍙蜂负"' + tableIds + '"鐨勬暟鎹」锛�');
- await delTable(tableIds);
- getList();
- proxy?.$modal.msgSuccess('鍒犻櫎鎴愬姛');
+ const tableIds = row?.tableId || ids.value;
+ await proxy?.$modal.confirm('鏄惁纭鍒犻櫎琛ㄧ紪鍙蜂负"' + tableIds + '"鐨勬暟鎹」锛�');
+ await delTable(tableIds);
+ await getList();
+ proxy?.$modal.msgSuccess('鍒犻櫎鎴愬姛');
}
onMounted(() => {
- getList();
- getDataNameList();
+ getList();
+ getDataNameList();
})
</script>
--
Gitblit v1.9.3