From 6666ce5526b1ed17f5c3906c94620cad586745a5 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期五, 28 六月 2024 17:01:39 +0800
Subject: [PATCH] 优化代码
---
src/views/system/config/index.vue | 11 ++
src/views/system/role/index.vue | 25 +++++
src/views/system/user/profile/userAvatar.vue | 9 +
src/views/system/user/authRole.vue | 4
src/views/monitor/logininfor/index.vue | 8 +
src/views/monitor/operlog/index.vue | 9 +
src/views/system/menu/index.vue | 12 ++
src/views/system/role/authUser.vue | 11 +
src/views/system/dict/data.vue | 12 ++
src/views/system/role/selectUser.vue | 16 ++-
src/views/tool/gen/editTable.vue | 2
src/views/tool/gen/importTable.vue | 8 +
src/views/monitor/job/log.vue | 8 +
src/views/monitor/job/index.vue | 18 +++
src/views/system/dept/index.vue | 9 +
src/views/system/post/index.vue | 10 ++
src/layout/components/TagsView/index.vue | 20 ++++
src/views/monitor/online/index.vue | 3
src/views/system/user/index.vue | 23 ++++
src/views/tool/gen/genInfoForm.vue | 4
src/views/tool/gen/index.vue | 11 ++
src/layout/components/TagsView/ScrollPane.vue | 2
src/views/system/user/profile/resetPwd.vue | 2
src/views/system/notice/index.vue | 9 +
src/layout/components/Settings/index.vue | 4
src/views/system/dict/index.vue | 11 ++
26 files changed, 253 insertions(+), 8 deletions(-)
diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue
index 0496918..7164a17 100644
--- a/src/layout/components/Settings/index.vue
+++ b/src/layout/components/Settings/index.vue
@@ -110,10 +110,12 @@
settingsStore.theme = val;
handleThemeStyle(val);
}
+
function handleTheme(val) {
settingsStore.sideTheme = val;
sideTheme.value = val;
}
+
function saveSetting() {
proxy.$modal.loading("姝e湪淇濆瓨鍒版湰鍦帮紝璇风◢鍊�...");
let layoutSetting = {
@@ -128,11 +130,13 @@
localStorage.setItem("layout-setting", JSON.stringify(layoutSetting));
setTimeout(proxy.$modal.closeLoading(), 1000)
}
+
function resetSetting() {
proxy.$modal.loading("姝e湪娓呴櫎璁剧疆缂撳瓨骞跺埛鏂帮紝璇风◢鍊�...");
localStorage.removeItem("layout-setting")
setTimeout("window.location.reload()", 1000)
}
+
function openSetting() {
showSettings.value = true;
}
diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue
index 8c8be44..7b6216e 100644
--- a/src/layout/components/TagsView/ScrollPane.vue
+++ b/src/layout/components/TagsView/ScrollPane.vue
@@ -20,6 +20,7 @@
onMounted(() => {
scrollWrapper.value.addEventListener('scroll', emitScroll, true)
})
+
onBeforeUnmount(() => {
scrollWrapper.value.removeEventListener('scroll', emitScroll)
})
@@ -29,6 +30,7 @@
const $scrollWrapper = scrollWrapper.value;
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
}
+
const emits = defineEmits()
const emitScroll = () => {
emits('scroll')
diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue
index 2a7a7b0..b2da82f 100644
--- a/src/layout/components/TagsView/index.vue
+++ b/src/layout/components/TagsView/index.vue
@@ -67,6 +67,7 @@
addTags()
moveToCurrentTag()
})
+
watch(visible, (value) => {
if (value) {
document.body.addEventListener('click', closeMenu)
@@ -74,6 +75,7 @@
document.body.removeEventListener('click', closeMenu)
}
})
+
onMounted(() => {
initTags()
addTags()
@@ -82,6 +84,7 @@
function isActive(r) {
return r.path === route.path
}
+
function activeStyle(tag) {
if (!isActive(tag)) return {};
return {
@@ -89,9 +92,11 @@
"border-color": theme.value
};
}
+
function isAffix(tag) {
return tag.meta && tag.meta.affix
}
+
function isFirstView() {
try {
return selectedTag.value.fullPath === '/index' || selectedTag.value.fullPath === visitedViews.value[1].fullPath
@@ -99,6 +104,7 @@
return false
}
}
+
function isLastView() {
try {
return selectedTag.value.fullPath === visitedViews.value[visitedViews.value.length - 1].fullPath
@@ -106,6 +112,7 @@
return false
}
}
+
function filterAffixTags(routes, basePath = '') {
let tags = []
routes.forEach(route => {
@@ -127,6 +134,7 @@
})
return tags
}
+
function initTags() {
const res = filterAffixTags(routes.value);
affixTags.value = res;
@@ -137,6 +145,7 @@
}
}
}
+
function addTags() {
const { name } = route
if (name) {
@@ -147,6 +156,7 @@
}
return false
}
+
function moveToCurrentTag() {
nextTick(() => {
for (const r of visitedViews.value) {
@@ -160,12 +170,14 @@
}
})
}
+
function refreshSelectedTag(view) {
proxy.$tab.refreshPage(view);
if (route.meta.link) {
useTagsViewStore().delIframeView(route);
}
}
+
function closeSelectedTag(view) {
proxy.$tab.closePage(view).then(({ visitedViews }) => {
if (isActive(view)) {
@@ -173,6 +185,7 @@
}
})
}
+
function closeRightTags() {
proxy.$tab.closeRightPage(selectedTag.value).then(visitedViews => {
if (!visitedViews.find(i => i.fullPath === route.fullPath)) {
@@ -180,6 +193,7 @@
}
})
}
+
function closeLeftTags() {
proxy.$tab.closeLeftPage(selectedTag.value).then(visitedViews => {
if (!visitedViews.find(i => i.fullPath === route.fullPath)) {
@@ -187,12 +201,14 @@
}
})
}
+
function closeOthersTags() {
router.push(selectedTag.value).catch(() => { });
proxy.$tab.closeOtherPage(selectedTag.value).then(() => {
moveToCurrentTag()
})
}
+
function closeAllTags(view) {
proxy.$tab.closeAllPage().then(({ visitedViews }) => {
if (affixTags.value.some(tag => tag.path === route.path)) {
@@ -201,6 +217,7 @@
toLastView(visitedViews, view)
})
}
+
function toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
@@ -216,6 +233,7 @@
}
}
}
+
function openMenu(tag, e) {
const menuMinWidth = 105
const offsetLeft = proxy.$el.getBoundingClientRect().left // container margin left
@@ -233,9 +251,11 @@
visible.value = true
selectedTag.value = tag
}
+
function closeMenu() {
visible.value = false
}
+
function handleScroll() {
closeMenu()
}
diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue
index 45a7861..1f36520 100644
--- a/src/views/monitor/job/index.vue
+++ b/src/views/monitor/job/index.vue
@@ -331,15 +331,18 @@
loading.value = false;
});
}
+
/** 浠诲姟缁勫悕瀛楀吀缈昏瘧 */
function jobGroupFormat(row, column) {
return proxy.selectDictLabel(sys_job_group.value, row.jobGroup);
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -354,22 +357,26 @@
};
proxy.resetForm("jobRef");
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
// 澶氶�夋閫変腑鏁版嵁
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.jobId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
// 鏇村鎿嶄綔瑙﹀彂
function handleCommand(command, row) {
switch (command) {
@@ -386,6 +393,7 @@
break;
}
}
+
// 浠诲姟鐘舵�佷慨鏀�
function handleStatusChange(row) {
let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
@@ -397,6 +405,7 @@
row.status = row.status === "0" ? "1" : "0";
});
}
+
/* 绔嬪嵆鎵ц涓�娆� */
function handleRun(row) {
proxy.$modal.confirm('纭瑕佺珛鍗虫墽琛屼竴娆�"' + row.jobName + '"浠诲姟鍚�?').then(function () {
@@ -405,6 +414,7 @@
proxy.$modal.msgSuccess("鎵ц鎴愬姛");})
.catch(() => {});
}
+
/** 浠诲姟璇︾粏淇℃伅 */
function handleView(row) {
getJob(row.jobId).then(response => {
@@ -412,26 +422,31 @@
openView.value = true;
});
}
+
/** cron琛ㄨ揪寮忔寜閽搷浣� */
function handleShowCron() {
expression.value = form.value.cronExpression;
openCron.value = true;
}
+
/** 纭畾鍚庡洖浼犲�� */
function crontabFill(value) {
form.value.cronExpression = value;
}
+
/** 浠诲姟鏃ュ織鍒楄〃鏌ヨ */
function handleJobLog(row) {
const jobId = row.jobId || 0;
router.push('/monitor/job-log/index/' + jobId)
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd() {
reset();
open.value = true;
title.value = "娣诲姞浠诲姟";
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -442,6 +457,7 @@
title.value = "淇敼浠诲姟";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["jobRef"].validate(valid => {
@@ -462,6 +478,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const jobIds = row.jobId || ids.value;
@@ -472,6 +489,7 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("monitor/job/export", {
diff --git a/src/views/monitor/job/log.vue b/src/views/monitor/job/log.vue
index 803dbbd..00611df 100644
--- a/src/views/monitor/job/log.vue
+++ b/src/views/monitor/job/log.vue
@@ -209,32 +209,38 @@
loading.value = false;
});
}
+
// 杩斿洖鎸夐挳
function handleClose() {
const obj = { path: "/monitor/job" };
proxy.$tab.closeOpenPage(obj);
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
handleQuery();
}
+
// 澶氶�夋閫変腑鏁版嵁
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.jobLogId);
multiple.value = !selection.length;
}
+
/** 璇︾粏鎸夐挳鎿嶄綔 */
function handleView(row) {
open.value = true;
form.value = row;
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
proxy.$modal.confirm('鏄惁纭鍒犻櫎璋冨害鏃ュ織缂栧彿涓�"' + ids.value + '"鐨勬暟鎹」?').then(function () {
@@ -244,6 +250,7 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 娓呯┖鎸夐挳鎿嶄綔 */
function handleClean() {
proxy.$modal.confirm("鏄惁纭娓呯┖鎵�鏈夎皟搴︽棩蹇楁暟鎹」?").then(function () {
@@ -253,6 +260,7 @@
proxy.$modal.msgSuccess("娓呯┖鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("monitor/jobLog/export", {
diff --git a/src/views/monitor/logininfor/index.vue b/src/views/monitor/logininfor/index.vue
index 3d8ab39..a09d57d 100644
--- a/src/views/monitor/logininfor/index.vue
+++ b/src/views/monitor/logininfor/index.vue
@@ -161,11 +161,13 @@
loading.value = false;
});
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
@@ -173,6 +175,7 @@
queryParams.value.pageNum = 1;
proxy.$refs["logininforRef"].sort(defaultSort.value.prop, defaultSort.value.order);
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.infoId);
@@ -180,12 +183,14 @@
single.value = selection.length != 1;
selectName.value = selection.map(item => item.userName);
}
+
/** 鎺掑簭瑙﹀彂浜嬩欢 */
function handleSortChange(column, prop, order) {
queryParams.value.orderByColumn = column.prop;
queryParams.value.isAsc = column.order;
getList();
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const infoIds = row.infoId || ids.value;
@@ -196,6 +201,7 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 娓呯┖鎸夐挳鎿嶄綔 */
function handleClean() {
proxy.$modal.confirm("鏄惁纭娓呯┖鎵�鏈夌櫥褰曟棩蹇楁暟鎹」?").then(function () {
@@ -205,6 +211,7 @@
proxy.$modal.msgSuccess("娓呯┖鎴愬姛");
}).catch(() => {});
}
+
/** 瑙i攣鎸夐挳鎿嶄綔 */
function handleUnlock() {
const username = selectName.value;
@@ -214,6 +221,7 @@
proxy.$modal.msgSuccess("鐢ㄦ埛" + username + "瑙i攣鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("monitor/logininfor/export", {
diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue
index 2b51340..5f4b268 100644
--- a/src/views/monitor/online/index.vue
+++ b/src/views/monitor/online/index.vue
@@ -82,16 +82,19 @@
loading.value = false;
});
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
pageNum.value = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 寮洪��鎸夐挳鎿嶄綔 */
function handleForceLogout(row) {
proxy.$modal.confirm('鏄惁纭寮洪��鍚嶇О涓�"' + row.userName + '"鐨勭敤鎴�?').then(function () {
diff --git a/src/views/monitor/operlog/index.vue b/src/views/monitor/operlog/index.vue
index f177ed2..5405f4c 100644
--- a/src/views/monitor/operlog/index.vue
+++ b/src/views/monitor/operlog/index.vue
@@ -239,15 +239,18 @@
loading.value = false;
});
}
+
/** 鎿嶄綔鏃ュ織绫诲瀷瀛楀吀缈昏瘧 */
function typeFormat(row, column) {
return proxy.selectDictLabel(sys_oper_type.value, row.businessType);
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
@@ -255,22 +258,26 @@
queryParams.value.pageNum = 1;
proxy.$refs["operlogRef"].sort(defaultSort.value.prop, defaultSort.value.order);
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.operId);
multiple.value = !selection.length;
}
+
/** 鎺掑簭瑙﹀彂浜嬩欢 */
function handleSortChange(column, prop, order) {
queryParams.value.orderByColumn = column.prop;
queryParams.value.isAsc = column.order;
getList();
}
+
/** 璇︾粏鎸夐挳鎿嶄綔 */
function handleView(row) {
open.value = true;
form.value = row;
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const operIds = row.operId || ids.value;
@@ -281,6 +288,7 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 娓呯┖鎸夐挳鎿嶄綔 */
function handleClean() {
proxy.$modal.confirm("鏄惁纭娓呯┖鎵�鏈夋搷浣滄棩蹇楁暟鎹」?").then(function () {
@@ -290,6 +298,7 @@
proxy.$modal.msgSuccess("娓呯┖鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("monitor/operlog/export",{
diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue
index c3a0fbc..f41b66c 100644
--- a/src/views/system/config/index.vue
+++ b/src/views/system/config/index.vue
@@ -208,11 +208,13 @@
loading.value = false;
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -225,29 +227,34 @@
};
proxy.resetForm("configRef");
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.configId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd() {
reset();
open.value = true;
title.value = "娣诲姞鍙傛暟";
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -258,6 +265,7 @@
title.value = "淇敼鍙傛暟";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["configRef"].validate(valid => {
@@ -278,6 +286,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const configIds = row.configId || ids.value;
@@ -288,12 +297,14 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("system/config/export", {
...queryParams.value
}, `config_${new Date().getTime()}.xlsx`);
}
+
/** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
function handleRefreshCache() {
refreshCache().then(() => {
diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue
index 889867d..b483acd 100644
--- a/src/views/system/dept/index.vue
+++ b/src/views/system/dept/index.vue
@@ -180,11 +180,13 @@
loading.value = false;
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -199,15 +201,18 @@
};
proxy.resetForm("deptRef");
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd(row) {
reset();
@@ -220,6 +225,7 @@
open.value = true;
title.value = "娣诲姞閮ㄩ棬";
}
+
/** 灞曞紑/鎶樺彔鎿嶄綔 */
function toggleExpandAll() {
refreshTable.value = false;
@@ -228,6 +234,7 @@
refreshTable.value = true;
});
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -240,6 +247,7 @@
title.value = "淇敼閮ㄩ棬";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["deptRef"].validate(valid => {
@@ -260,6 +268,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
proxy.$modal.confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.deptName + '"鐨勬暟鎹」?').then(function() {
diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue
index f6207dc..3fcb9f6 100644
--- a/src/views/system/dict/data.vue
+++ b/src/views/system/dict/data.vue
@@ -238,6 +238,7 @@
typeOptions.value = response.data;
});
}
+
/** 鏌ヨ瀛楀吀鏁版嵁鍒楄〃 */
function getList() {
loading.value = true;
@@ -247,11 +248,13 @@
loading.value = false;
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -266,22 +269,26 @@
};
proxy.resetForm("dataRef");
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 杩斿洖鎸夐挳鎿嶄綔 */
function handleClose() {
const obj = { path: "/system/dict" };
proxy.$tab.closeOpenPage(obj);
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
queryParams.value.dictType = defaultDictType.value;
handleQuery();
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd() {
reset();
@@ -289,12 +296,14 @@
title.value = "娣诲姞瀛楀吀鏁版嵁";
form.value.dictType = queryParams.value.dictType;
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.dictCode);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -305,6 +314,7 @@
title.value = "淇敼瀛楀吀鏁版嵁";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["dataRef"].validate(valid => {
@@ -327,6 +337,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const dictCodes = row.dictCode || ids.value;
@@ -338,6 +349,7 @@
useDictStore().removeDict(queryParams.value.dictType);
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("system/dict/data/export", {
diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue
index 33fa3c9..7bbd174 100644
--- a/src/views/system/dict/index.vue
+++ b/src/views/system/dict/index.vue
@@ -215,11 +215,13 @@
loading.value = false;
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -231,29 +233,34 @@
};
proxy.resetForm("dictRef");
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd() {
reset();
open.value = true;
title.value = "娣诲姞瀛楀吀绫诲瀷";
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.dictId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -264,6 +271,7 @@
title.value = "淇敼瀛楀吀绫诲瀷";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["dictRef"].validate(valid => {
@@ -284,6 +292,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const dictIds = row.dictId || ids.value;
@@ -294,12 +303,14 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("system/dict/type/export", {
...queryParams.value
}, `dict_${new Date().getTime()}.xlsx`);
}
+
/** 鍒锋柊缂撳瓨鎸夐挳鎿嶄綔 */
function handleRefreshCache() {
refreshCache().then(() => {
diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index 4e44430..1df5fb9 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -316,6 +316,7 @@
loading.value = false;
});
}
+
/** 鏌ヨ鑿滃崟涓嬫媺鏍戠粨鏋� */
function getTreeselect() {
menuOptions.value = [];
@@ -325,11 +326,13 @@
menuOptions.value.push(menu);
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -346,23 +349,28 @@
};
proxy.resetForm("menuRef");
}
+
/** 灞曠ず涓嬫媺鍥炬爣 */
function showSelectIcon() {
iconSelectRef.value.reset();
}
+
/** 閫夋嫨鍥炬爣 */
function selected(name) {
form.value.icon = name;
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd(row) {
reset();
@@ -375,6 +383,7 @@
open.value = true;
title.value = "娣诲姞鑿滃崟";
}
+
/** 灞曞紑/鎶樺彔鎿嶄綔 */
function toggleExpandAll() {
refreshTable.value = false;
@@ -383,6 +392,7 @@
refreshTable.value = true;
});
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
async function handleUpdate(row) {
reset();
@@ -393,6 +403,7 @@
title.value = "淇敼鑿滃崟";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["menuRef"].validate(valid => {
@@ -413,6 +424,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
proxy.$modal.confirm('鏄惁纭鍒犻櫎鍚嶇О涓�"' + row.menuName + '"鐨勬暟鎹」?').then(function() {
diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue
index 55fbc3a..fd74fcd 100644
--- a/src/views/system/notice/index.vue
+++ b/src/views/system/notice/index.vue
@@ -200,11 +200,13 @@
loading.value = false;
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -216,28 +218,33 @@
};
proxy.resetForm("noticeRef");
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.noticeId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd() {
reset();
open.value = true;
title.value = "娣诲姞鍏憡";
}
+
/**淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -248,6 +255,7 @@
title.value = "淇敼鍏憡";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["noticeRef"].validate(valid => {
@@ -268,6 +276,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const noticeIds = row.noticeId || ids.value
diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue
index aee6034..323c574 100644
--- a/src/views/system/post/index.vue
+++ b/src/views/system/post/index.vue
@@ -187,11 +187,13 @@
loading.value = false;
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 琛ㄥ崟閲嶇疆 */
function reset() {
form.value = {
@@ -204,28 +206,33 @@
};
proxy.resetForm("postRef");
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.postId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd() {
reset();
open.value = true;
title.value = "娣诲姞宀椾綅";
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -236,6 +243,7 @@
title.value = "淇敼宀椾綅";
});
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
@@ -256,6 +264,7 @@
}
});
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const postIds = row.postId || ids.value;
@@ -266,6 +275,7 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("system/post/export", {
diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue
index de3efd8..49bbd04 100644
--- a/src/views/system/role/authUser.vue
+++ b/src/views/system/role/authUser.vue
@@ -123,30 +123,36 @@
loading.value = false;
});
}
-// 杩斿洖鎸夐挳
+
+/** 杩斿洖鎸夐挳 */
function handleClose() {
const obj = { path: "/system/role" };
proxy.$tab.closeOpenPage(obj);
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
-// 澶氶�夋閫変腑鏁版嵁
+
+/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
userIds.value = selection.map(item => item.userId);
multiple.value = !selection.length;
}
+
/** 鎵撳紑鎺堟潈鐢ㄦ埛琛ㄥ脊绐� */
function openSelectUser() {
proxy.$refs["selectRef"].show();
}
+
/** 鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */
function cancelAuthUser(row) {
proxy.$modal.confirm('纭瑕佸彇娑堣鐢ㄦ埛"' + row.userName + '"瑙掕壊鍚楋紵').then(function () {
@@ -156,6 +162,7 @@
proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛");
}).catch(() => {});
}
+
/** 鎵归噺鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */
function cancelAuthUserAll(row) {
const roleId = queryParams.roleId;
diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue
index e446ded..22a5fa4 100644
--- a/src/views/system/role/index.vue
+++ b/src/views/system/role/index.vue
@@ -305,17 +305,20 @@
loading.value = false;
});
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const roleIds = row.roleId || ids.value;
@@ -326,18 +329,21 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
}
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("system/role/export", {
...queryParams.value,
}, `role_${new Date().getTime()}.xlsx`);
}
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.roleId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
/** 瑙掕壊鐘舵�佷慨鏀� */
function handleStatusChange(row) {
let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
@@ -349,6 +355,7 @@
row.status = row.status === "0" ? "1" : "0";
});
}
+
/** 鏇村鎿嶄綔 */
function handleCommand(command, row) {
switch (command) {
@@ -362,16 +369,19 @@
break;
}
}
+
/** 鍒嗛厤鐢ㄦ埛 */
function handleAuthUser(row) {
router.push("/system/role-auth/user/" + row.roleId);
}
+
/** 鏌ヨ鑿滃崟鏍戠粨鏋� */
function getMenuTreeselect() {
menuTreeselect().then(response => {
menuOptions.value = response.data;
});
}
+
/** 鎵�鏈夐儴闂ㄨ妭鐐规暟鎹� */
function getDeptAllCheckedKeys() {
// 鐩墠琚�変腑鐨勯儴闂ㄨ妭鐐�
@@ -381,6 +391,7 @@
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
}
+
/** 閲嶇疆鏂板鐨勮〃鍗曚互鍙婂叾浠栨暟鎹� */
function reset() {
if (menuRef.value != undefined) {
@@ -404,6 +415,7 @@
};
proxy.resetForm("roleRef");
}
+
/** 娣诲姞瑙掕壊 */
function handleAdd() {
reset();
@@ -411,6 +423,7 @@
open.value = true;
title.value = "娣诲姞瑙掕壊";
}
+
/** 淇敼瑙掕壊 */
function handleUpdate(row) {
reset();
@@ -433,6 +446,7 @@
title.value = "淇敼瑙掕壊";
});
}
+
/** 鏍规嵁瑙掕壊ID鏌ヨ鑿滃崟鏍戠粨鏋� */
function getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
@@ -440,6 +454,7 @@
return response;
});
}
+
/** 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戠粨鏋� */
function getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
@@ -447,6 +462,7 @@
return response;
});
}
+
/** 鏍戞潈闄愶紙灞曞紑/鎶樺彔锛�*/
function handleCheckedTreeExpand(value, type) {
if (type == "menu") {
@@ -461,6 +477,7 @@
}
}
}
+
/** 鏍戞潈闄愶紙鍏ㄩ��/鍏ㄤ笉閫夛級 */
function handleCheckedTreeNodeAll(value, type) {
if (type == "menu") {
@@ -469,6 +486,7 @@
deptRef.value.setCheckedNodes(value ? deptOptions.value : []);
}
}
+
/** 鏍戞潈闄愶紙鐖跺瓙鑱斿姩锛� */
function handleCheckedTreeConnect(value, type) {
if (type == "menu") {
@@ -477,6 +495,7 @@
form.value.deptCheckStrictly = value ? true : false;
}
}
+
/** 鎵�鏈夎彍鍗曡妭鐐规暟鎹� */
function getMenuAllCheckedKeys() {
// 鐩墠琚�変腑鐨勮彍鍗曡妭鐐�
@@ -486,6 +505,7 @@
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
}
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["roleRef"].validate(valid => {
@@ -508,17 +528,20 @@
}
});
}
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
}
+
/** 閫夋嫨瑙掕壊鏉冮檺鑼冨洿瑙﹀彂 */
function dataScopeSelectChange(value) {
if (value !== "2") {
deptRef.value.setCheckedKeys([]);
}
}
+
/** 鍒嗛厤鏁版嵁鏉冮檺鎿嶄綔 */
function handleDataScope(row) {
reset();
@@ -538,6 +561,7 @@
title.value = "鍒嗛厤鏁版嵁鏉冮檺";
});
}
+
/** 鎻愪氦鎸夐挳锛堟暟鎹潈闄愶級 */
function submitDataScope() {
if (form.value.roleId != undefined) {
@@ -549,6 +573,7 @@
});
}
}
+
/** 鍙栨秷鎸夐挳锛堟暟鎹潈闄愶級*/
function cancelDataScope() {
openDataScope.value = false;
diff --git a/src/views/system/role/selectUser.vue b/src/views/system/role/selectUser.vue
index fb9e362..dd4158c 100644
--- a/src/views/system/role/selectUser.vue
+++ b/src/views/system/role/selectUser.vue
@@ -7,7 +7,7 @@
v-model="queryParams.userName"
placeholder="璇疯緭鍏ョ敤鎴峰悕绉�"
clearable
- style="width: 200px"
+ style="width: 180px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -16,7 +16,7 @@
v-model="queryParams.phonenumber"
placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�"
clearable
- style="width: 200px"
+ style="width: 180px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -91,14 +91,17 @@
getList();
visible.value = true;
}
+
/**閫夋嫨琛� */
function clickRow(row) {
proxy.$refs["refTable"].toggleRowSelection(row);
}
+
// 澶氶�夋閫変腑鏁版嵁
function handleSelectionChange(selection) {
userIds.value = selection.map(item => item.userId);
}
+
// 鏌ヨ琛ㄦ暟鎹�
function getList() {
unallocatedUserList(queryParams).then(res => {
@@ -106,16 +109,19 @@
total.value = res.total;
});
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
const emit = defineEmits(["ok"]);
/** 閫夋嫨鎺堟潈鐢ㄦ埛鎿嶄綔 */
function handleSelectUser() {
@@ -127,10 +133,8 @@
}
authUserSelectAll({ roleId: roleId, userIds: uIds }).then(res => {
proxy.$modal.msgSuccess(res.msg);
- if (res.code === 200) {
- visible.value = false;
- emit("ok");
- }
+ visible.value = false;
+ emit("ok");
});
}
diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue
index 55a71f4..7fcb38d 100644
--- a/src/views/system/user/authRole.vue
+++ b/src/views/system/user/authRole.vue
@@ -67,19 +67,23 @@
function clickRow(row) {
proxy.$refs["roleRef"].toggleRowSelection(row);
};
+
/** 澶氶�夋閫変腑鏁版嵁 */
function handleSelectionChange(selection) {
roleIds.value = selection.map(item => item.roleId);
};
+
/** 淇濆瓨閫変腑鐨勬暟鎹紪鍙� */
function getRowKey(row) {
return row.roleId;
};
+
/** 鍏抽棴鎸夐挳 */
function close() {
const obj = { path: "/system/user" };
proxy.$tab.closeOpenPage(obj);
};
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
const userId = form.value.userId;
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 18f101d..60754e8 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -404,16 +404,19 @@
if (!value) return true;
return data.label.indexOf(value) !== -1;
};
+
/** 鏍规嵁鍚嶇О绛涢�夐儴闂ㄦ爲 */
watch(deptName, val => {
proxy.$refs["deptTreeRef"].filter(val);
});
+
/** 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋� */
function getDeptTree() {
deptTreeSelect().then(response => {
deptOptions.value = response.data;
});
};
+
/** 鏌ヨ鐢ㄦ埛鍒楄〃 */
function getList() {
loading.value = true;
@@ -423,16 +426,19 @@
total.value = res.total;
});
};
+
/** 鑺傜偣鍗曞嚮浜嬩欢 */
function handleNodeClick(data) {
queryParams.value.deptId = data.id;
handleQuery();
};
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
};
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
@@ -441,6 +447,7 @@
proxy.$refs.deptTreeRef.setCurrentKey(null);
handleQuery();
};
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const userIds = row.userId || ids.value;
@@ -451,12 +458,14 @@
proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
}).catch(() => {});
};
+
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
proxy.download("system/user/export", {
...queryParams.value,
},`user_${new Date().getTime()}.xlsx`);
};
+
/** 鐢ㄦ埛鐘舵�佷慨鏀� */
function handleStatusChange(row) {
let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
@@ -468,6 +477,7 @@
row.status = row.status === "0" ? "1" : "0";
});
};
+
/** 鏇村鎿嶄綔 */
function handleCommand(command, row) {
switch (command) {
@@ -481,11 +491,13 @@
break;
}
};
+
/** 璺宠浆瑙掕壊鍒嗛厤 */
function handleAuthRole(row) {
const userId = row.userId;
router.push("/system/user-auth/role/" + userId);
};
+
/** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */
function handleResetPwd(row) {
proxy.$prompt('璇疯緭鍏�"' + row.userName + '"鐨勬柊瀵嗙爜', "鎻愮ず", {
@@ -505,26 +517,31 @@
});
}).catch(() => {});
};
+
/** 閫夋嫨鏉℃暟 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.userId);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
+
/** 瀵煎叆鎸夐挳鎿嶄綔 */
function handleImport() {
upload.title = "鐢ㄦ埛瀵煎叆";
upload.open = true;
};
+
/** 涓嬭浇妯℃澘鎿嶄綔 */
function importTemplate() {
proxy.download("system/user/importTemplate", {
}, `user_template_${new Date().getTime()}.xlsx`);
};
+
/**鏂囦欢涓婁紶涓鐞� */
const handleFileUploadProgress = (event, file, fileList) => {
upload.isUploading = true;
};
+
/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
@@ -533,10 +550,12 @@
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "瀵煎叆缁撴灉", { dangerouslyUseHTMLString: true });
getList();
};
+
/** 鎻愪氦涓婁紶鏂囦欢 */
function submitFileForm() {
proxy.$refs["uploadRef"].submit();
};
+
/** 閲嶇疆鎿嶄綔琛ㄥ崟 */
function reset() {
form.value = {
@@ -555,11 +574,13 @@
};
proxy.resetForm("userRef");
};
+
/** 鍙栨秷鎸夐挳 */
function cancel() {
open.value = false;
reset();
};
+
/** 鏂板鎸夐挳鎿嶄綔 */
function handleAdd() {
reset();
@@ -571,6 +592,7 @@
form.value.password = initPassword.value;
});
};
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
@@ -586,6 +608,7 @@
form.password = "";
});
};
+
/** 鎻愪氦鎸夐挳 */
function submitForm() {
proxy.$refs["userRef"].validate(valid => {
diff --git a/src/views/system/user/profile/resetPwd.vue b/src/views/system/user/profile/resetPwd.vue
index 493c5e4..a70e634 100644
--- a/src/views/system/user/profile/resetPwd.vue
+++ b/src/views/system/user/profile/resetPwd.vue
@@ -34,6 +34,7 @@
callback();
}
};
+
const rules = ref({
oldPassword: [{ required: true, message: "鏃у瘑鐮佷笉鑳戒负绌�", trigger: "blur" }],
newPassword: [{ required: true, message: "鏂板瘑鐮佷笉鑳戒负绌�", trigger: "blur" }, { min: 6, max: 20, message: "闀垮害鍦� 6 鍒� 20 涓瓧绗�", trigger: "blur" }, { pattern: /^[^<>"'|\\]+$/, message: "涓嶈兘鍖呭惈闈炴硶瀛楃锛�< > \" ' \\\ |", trigger: "blur" }],
@@ -50,6 +51,7 @@
}
});
};
+
/** 鍏抽棴鎸夐挳 */
function close() {
proxy.$tab.closePage();
diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue
index edf3016..b99f58d 100644
--- a/src/views/system/user/profile/userAvatar.vue
+++ b/src/views/system/user/profile/userAvatar.vue
@@ -87,25 +87,31 @@
function editCropper() {
open.value = true;
}
+
/** 鎵撳紑寮瑰嚭灞傜粨鏉熸椂鐨勫洖璋� */
function modalOpened() {
visible.value = true;
}
+
/** 瑕嗙洊榛樿涓婁紶琛屼负 */
function requestUpload() {}
+
/** 鍚戝乏鏃嬭浆 */
function rotateLeft() {
proxy.$refs.cropper.rotateLeft();
}
+
/** 鍚戝彸鏃嬭浆 */
function rotateRight() {
proxy.$refs.cropper.rotateRight();
}
+
/** 鍥剧墖缂╂斁 */
function changeScale(num) {
num = num || 1;
proxy.$refs.cropper.changeScale(num);
}
+
/** 涓婁紶棰勫鐞� */
function beforeUpload(file) {
if (file.type.indexOf("image/") == -1) {
@@ -119,6 +125,7 @@
};
}
}
+
/** 涓婁紶鍥剧墖 */
function uploadImg() {
proxy.$refs.cropper.getCropBlob(data => {
@@ -133,10 +140,12 @@
});
});
}
+
/** 瀹炴椂棰勮 */
function realTime(data) {
options.previews = data;
}
+
/** 鍏抽棴绐楀彛 */
function closeDialog() {
options.img = userStore.avatar;
diff --git a/src/views/tool/gen/editTable.vue b/src/views/tool/gen/editTable.vue
index 125fd75..da9bc4a 100644
--- a/src/views/tool/gen/editTable.vue
+++ b/src/views/tool/gen/editTable.vue
@@ -168,6 +168,7 @@
}
});
}
+
function getFormPromise(form) {
return new Promise(resolve => {
form.validate(res => {
@@ -175,6 +176,7 @@
});
});
}
+
function close() {
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } };
proxy.$tab.closeOpenPage(obj);
diff --git a/src/views/tool/gen/genInfoForm.vue b/src/views/tool/gen/genInfoForm.vue
index 85a8777..8f7db37 100644
--- a/src/views/tool/gen/genInfoForm.vue
+++ b/src/views/tool/gen/genInfoForm.vue
@@ -258,15 +258,18 @@
businessName: [{ required: true, message: "璇疯緭鍏ョ敓鎴愪笟鍔″悕", trigger: "blur" }],
functionName: [{ required: true, message: "璇疯緭鍏ョ敓鎴愬姛鑳藉悕", trigger: "blur" }]
});
+
function subSelectChange(value) {
props.info.subTableFkName = "";
}
+
function tplSelectChange(value) {
if (value !== "sub") {
props.info.subTableName = "";
props.info.subTableFkName = "";
}
}
+
function setSubTableColumns(value) {
for (var item in props.tables) {
const name = props.tables[item].tableName;
@@ -276,6 +279,7 @@
}
}
}
+
/** 鏌ヨ鑿滃崟涓嬫媺鏍戠粨鏋� */
function getMenuTreeselect() {
listMenu().then(response => {
diff --git a/src/views/tool/gen/importTable.vue b/src/views/tool/gen/importTable.vue
index 67624e2..49d96c3 100644
--- a/src/views/tool/gen/importTable.vue
+++ b/src/views/tool/gen/importTable.vue
@@ -7,6 +7,7 @@
v-model="queryParams.tableName"
placeholder="璇疯緭鍏ヨ〃鍚嶇О"
clearable
+ style="width: 180px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -15,6 +16,7 @@
v-model="queryParams.tableComment"
placeholder="璇疯緭鍏ヨ〃鎻忚堪"
clearable
+ style="width: 180px"
@keyup.enter="handleQuery"
/>
</el-form-item>
@@ -71,14 +73,17 @@
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 => {
@@ -86,16 +91,19 @@
total.value = res.total;
});
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.pageNum = 1;
getList();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 瀵煎叆鎸夐挳鎿嶄綔 */
function handleImportTable() {
const tableNames = tables.value.join(",");
diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue
index 77e8a80..f8cddbc 100644
--- a/src/views/tool/gen/index.vue
+++ b/src/views/tool/gen/index.vue
@@ -217,11 +217,13 @@
loading.value = false;
});
}
+
/** 鎼滅储鎸夐挳鎿嶄綔 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
+
/** 鐢熸垚浠g爜鎿嶄綔 */
function handleGenTable(row) {
const tbNames = row.tableName || tableNames.value;
@@ -237,6 +239,7 @@
proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "ruoyi.zip");
}
}
+
/** 鍚屾鏁版嵁搴撴搷浣� */
function handleSynchDb(row) {
const tableName = row.tableName;
@@ -246,20 +249,24 @@
proxy.$modal.msgSuccess("鍚屾鎴愬姛");
}).catch(() => {});
}
+
/** 鎵撳紑瀵煎叆琛ㄥ脊绐� */
function openImportTable() {
proxy.$refs["importRef"].show();
}
+
/** 鎵撳紑鍒涘缓琛ㄥ脊绐� */
function openCreateTable() {
proxy.$refs["createRef"].show();
}
+
/** 閲嶇疆鎸夐挳鎿嶄綔 */
function resetQuery() {
dateRange.value = [];
proxy.resetForm("queryRef");
handleQuery();
}
+
/** 棰勮鎸夐挳 */
function handlePreview(row) {
previewTable(row.tableId).then(response => {
@@ -268,10 +275,12 @@
preview.value.activeName = "domain.java";
});
}
+
/** 澶嶅埗浠g爜鎴愬姛 */
function copyTextSuccess() {
proxy.$modal.msgSuccess("澶嶅埗鎴愬姛");
}
+
// 澶氶�夋閫変腑鏁版嵁
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.tableId);
@@ -279,11 +288,13 @@
single.value = selection.length != 1;
multiple.value = !selection.length;
}
+
/** 淇敼鎸夐挳鎿嶄綔 */
function handleEditTable(row) {
const tableId = row.tableId || ids.value[0];
router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } });
}
+
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const tableIds = row.tableId || ids.value;
--
Gitblit v1.9.3