优化代码
This commit is contained in:
parent
49d0fc0bdc
commit
6666ce5526
@ -110,10 +110,12 @@ function themeChange(val) {
|
|||||||
settingsStore.theme = val;
|
settingsStore.theme = val;
|
||||||
handleThemeStyle(val);
|
handleThemeStyle(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleTheme(val) {
|
function handleTheme(val) {
|
||||||
settingsStore.sideTheme = val;
|
settingsStore.sideTheme = val;
|
||||||
sideTheme.value = val;
|
sideTheme.value = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveSetting() {
|
function saveSetting() {
|
||||||
proxy.$modal.loading("正在保存到本地,请稍候...");
|
proxy.$modal.loading("正在保存到本地,请稍候...");
|
||||||
let layoutSetting = {
|
let layoutSetting = {
|
||||||
@ -128,11 +130,13 @@ function saveSetting() {
|
|||||||
localStorage.setItem("layout-setting", JSON.stringify(layoutSetting));
|
localStorage.setItem("layout-setting", JSON.stringify(layoutSetting));
|
||||||
setTimeout(proxy.$modal.closeLoading(), 1000)
|
setTimeout(proxy.$modal.closeLoading(), 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetSetting() {
|
function resetSetting() {
|
||||||
proxy.$modal.loading("正在清除设置缓存并刷新,请稍候...");
|
proxy.$modal.loading("正在清除设置缓存并刷新,请稍候...");
|
||||||
localStorage.removeItem("layout-setting")
|
localStorage.removeItem("layout-setting")
|
||||||
setTimeout("window.location.reload()", 1000)
|
setTimeout("window.location.reload()", 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
function openSetting() {
|
function openSetting() {
|
||||||
showSettings.value = true;
|
showSettings.value = true;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ const scrollWrapper = computed(() => proxy.$refs.scrollContainer.$refs.wrapRef);
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
scrollWrapper.value.addEventListener('scroll', emitScroll, true)
|
scrollWrapper.value.addEventListener('scroll', emitScroll, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
scrollWrapper.value.removeEventListener('scroll', emitScroll)
|
scrollWrapper.value.removeEventListener('scroll', emitScroll)
|
||||||
})
|
})
|
||||||
@ -29,6 +30,7 @@ function handleScroll(e) {
|
|||||||
const $scrollWrapper = scrollWrapper.value;
|
const $scrollWrapper = scrollWrapper.value;
|
||||||
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
|
$scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4
|
||||||
}
|
}
|
||||||
|
|
||||||
const emits = defineEmits()
|
const emits = defineEmits()
|
||||||
const emitScroll = () => {
|
const emitScroll = () => {
|
||||||
emits('scroll')
|
emits('scroll')
|
||||||
|
@ -67,6 +67,7 @@ watch(route, () => {
|
|||||||
addTags()
|
addTags()
|
||||||
moveToCurrentTag()
|
moveToCurrentTag()
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(visible, (value) => {
|
watch(visible, (value) => {
|
||||||
if (value) {
|
if (value) {
|
||||||
document.body.addEventListener('click', closeMenu)
|
document.body.addEventListener('click', closeMenu)
|
||||||
@ -74,6 +75,7 @@ watch(visible, (value) => {
|
|||||||
document.body.removeEventListener('click', closeMenu)
|
document.body.removeEventListener('click', closeMenu)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
initTags()
|
initTags()
|
||||||
addTags()
|
addTags()
|
||||||
@ -82,6 +84,7 @@ onMounted(() => {
|
|||||||
function isActive(r) {
|
function isActive(r) {
|
||||||
return r.path === route.path
|
return r.path === route.path
|
||||||
}
|
}
|
||||||
|
|
||||||
function activeStyle(tag) {
|
function activeStyle(tag) {
|
||||||
if (!isActive(tag)) return {};
|
if (!isActive(tag)) return {};
|
||||||
return {
|
return {
|
||||||
@ -89,9 +92,11 @@ function activeStyle(tag) {
|
|||||||
"border-color": theme.value
|
"border-color": theme.value
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function isAffix(tag) {
|
function isAffix(tag) {
|
||||||
return tag.meta && tag.meta.affix
|
return tag.meta && tag.meta.affix
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFirstView() {
|
function isFirstView() {
|
||||||
try {
|
try {
|
||||||
return selectedTag.value.fullPath === '/index' || selectedTag.value.fullPath === visitedViews.value[1].fullPath
|
return selectedTag.value.fullPath === '/index' || selectedTag.value.fullPath === visitedViews.value[1].fullPath
|
||||||
@ -99,6 +104,7 @@ function isFirstView() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLastView() {
|
function isLastView() {
|
||||||
try {
|
try {
|
||||||
return selectedTag.value.fullPath === visitedViews.value[visitedViews.value.length - 1].fullPath
|
return selectedTag.value.fullPath === visitedViews.value[visitedViews.value.length - 1].fullPath
|
||||||
@ -106,6 +112,7 @@ function isLastView() {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterAffixTags(routes, basePath = '') {
|
function filterAffixTags(routes, basePath = '') {
|
||||||
let tags = []
|
let tags = []
|
||||||
routes.forEach(route => {
|
routes.forEach(route => {
|
||||||
@ -127,6 +134,7 @@ function filterAffixTags(routes, basePath = '') {
|
|||||||
})
|
})
|
||||||
return tags
|
return tags
|
||||||
}
|
}
|
||||||
|
|
||||||
function initTags() {
|
function initTags() {
|
||||||
const res = filterAffixTags(routes.value);
|
const res = filterAffixTags(routes.value);
|
||||||
affixTags.value = res;
|
affixTags.value = res;
|
||||||
@ -137,6 +145,7 @@ function initTags() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addTags() {
|
function addTags() {
|
||||||
const { name } = route
|
const { name } = route
|
||||||
if (name) {
|
if (name) {
|
||||||
@ -147,6 +156,7 @@ function addTags() {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveToCurrentTag() {
|
function moveToCurrentTag() {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
for (const r of visitedViews.value) {
|
for (const r of visitedViews.value) {
|
||||||
@ -160,12 +170,14 @@ function moveToCurrentTag() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshSelectedTag(view) {
|
function refreshSelectedTag(view) {
|
||||||
proxy.$tab.refreshPage(view);
|
proxy.$tab.refreshPage(view);
|
||||||
if (route.meta.link) {
|
if (route.meta.link) {
|
||||||
useTagsViewStore().delIframeView(route);
|
useTagsViewStore().delIframeView(route);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeSelectedTag(view) {
|
function closeSelectedTag(view) {
|
||||||
proxy.$tab.closePage(view).then(({ visitedViews }) => {
|
proxy.$tab.closePage(view).then(({ visitedViews }) => {
|
||||||
if (isActive(view)) {
|
if (isActive(view)) {
|
||||||
@ -173,6 +185,7 @@ function closeSelectedTag(view) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeRightTags() {
|
function closeRightTags() {
|
||||||
proxy.$tab.closeRightPage(selectedTag.value).then(visitedViews => {
|
proxy.$tab.closeRightPage(selectedTag.value).then(visitedViews => {
|
||||||
if (!visitedViews.find(i => i.fullPath === route.fullPath)) {
|
if (!visitedViews.find(i => i.fullPath === route.fullPath)) {
|
||||||
@ -180,6 +193,7 @@ function closeRightTags() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeLeftTags() {
|
function closeLeftTags() {
|
||||||
proxy.$tab.closeLeftPage(selectedTag.value).then(visitedViews => {
|
proxy.$tab.closeLeftPage(selectedTag.value).then(visitedViews => {
|
||||||
if (!visitedViews.find(i => i.fullPath === route.fullPath)) {
|
if (!visitedViews.find(i => i.fullPath === route.fullPath)) {
|
||||||
@ -187,12 +201,14 @@ function closeLeftTags() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeOthersTags() {
|
function closeOthersTags() {
|
||||||
router.push(selectedTag.value).catch(() => { });
|
router.push(selectedTag.value).catch(() => { });
|
||||||
proxy.$tab.closeOtherPage(selectedTag.value).then(() => {
|
proxy.$tab.closeOtherPage(selectedTag.value).then(() => {
|
||||||
moveToCurrentTag()
|
moveToCurrentTag()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeAllTags(view) {
|
function closeAllTags(view) {
|
||||||
proxy.$tab.closeAllPage().then(({ visitedViews }) => {
|
proxy.$tab.closeAllPage().then(({ visitedViews }) => {
|
||||||
if (affixTags.value.some(tag => tag.path === route.path)) {
|
if (affixTags.value.some(tag => tag.path === route.path)) {
|
||||||
@ -201,6 +217,7 @@ function closeAllTags(view) {
|
|||||||
toLastView(visitedViews, view)
|
toLastView(visitedViews, view)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function toLastView(visitedViews, view) {
|
function toLastView(visitedViews, view) {
|
||||||
const latestView = visitedViews.slice(-1)[0]
|
const latestView = visitedViews.slice(-1)[0]
|
||||||
if (latestView) {
|
if (latestView) {
|
||||||
@ -216,6 +233,7 @@ function toLastView(visitedViews, view) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function openMenu(tag, e) {
|
function openMenu(tag, e) {
|
||||||
const menuMinWidth = 105
|
const menuMinWidth = 105
|
||||||
const offsetLeft = proxy.$el.getBoundingClientRect().left // container margin left
|
const offsetLeft = proxy.$el.getBoundingClientRect().left // container margin left
|
||||||
@ -233,9 +251,11 @@ function openMenu(tag, e) {
|
|||||||
visible.value = true
|
visible.value = true
|
||||||
selectedTag.value = tag
|
selectedTag.value = tag
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeMenu() {
|
function closeMenu() {
|
||||||
visible.value = false
|
visible.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleScroll() {
|
function handleScroll() {
|
||||||
closeMenu()
|
closeMenu()
|
||||||
}
|
}
|
||||||
|
@ -331,15 +331,18 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 任务组名字典翻译 */
|
/** 任务组名字典翻译 */
|
||||||
function jobGroupFormat(row, column) {
|
function jobGroupFormat(row, column) {
|
||||||
return proxy.selectDictLabel(sys_job_group.value, row.jobGroup);
|
return proxy.selectDictLabel(sys_job_group.value, row.jobGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -354,22 +357,26 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("jobRef");
|
proxy.resetForm("jobRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.jobId);
|
ids.value = selection.map(item => item.jobId);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更多操作触发
|
// 更多操作触发
|
||||||
function handleCommand(command, row) {
|
function handleCommand(command, row) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
@ -386,6 +393,7 @@ function handleCommand(command, row) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 任务状态修改
|
// 任务状态修改
|
||||||
function handleStatusChange(row) {
|
function handleStatusChange(row) {
|
||||||
let text = row.status === "0" ? "启用" : "停用";
|
let text = row.status === "0" ? "启用" : "停用";
|
||||||
@ -397,6 +405,7 @@ function handleStatusChange(row) {
|
|||||||
row.status = row.status === "0" ? "1" : "0";
|
row.status = row.status === "0" ? "1" : "0";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 立即执行一次 */
|
/* 立即执行一次 */
|
||||||
function handleRun(row) {
|
function handleRun(row) {
|
||||||
proxy.$modal.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?').then(function () {
|
proxy.$modal.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?').then(function () {
|
||||||
@ -405,6 +414,7 @@ function handleRun(row) {
|
|||||||
proxy.$modal.msgSuccess("执行成功");})
|
proxy.$modal.msgSuccess("执行成功");})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 任务详细信息 */
|
/** 任务详细信息 */
|
||||||
function handleView(row) {
|
function handleView(row) {
|
||||||
getJob(row.jobId).then(response => {
|
getJob(row.jobId).then(response => {
|
||||||
@ -412,26 +422,31 @@ function handleView(row) {
|
|||||||
openView.value = true;
|
openView.value = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** cron表达式按钮操作 */
|
/** cron表达式按钮操作 */
|
||||||
function handleShowCron() {
|
function handleShowCron() {
|
||||||
expression.value = form.value.cronExpression;
|
expression.value = form.value.cronExpression;
|
||||||
openCron.value = true;
|
openCron.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 确定后回传值 */
|
/** 确定后回传值 */
|
||||||
function crontabFill(value) {
|
function crontabFill(value) {
|
||||||
form.value.cronExpression = value;
|
form.value.cronExpression = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 任务日志列表查询 */
|
/** 任务日志列表查询 */
|
||||||
function handleJobLog(row) {
|
function handleJobLog(row) {
|
||||||
const jobId = row.jobId || 0;
|
const jobId = row.jobId || 0;
|
||||||
router.push('/monitor/job-log/index/' + jobId)
|
router.push('/monitor/job-log/index/' + jobId)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加任务";
|
title.value = "添加任务";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -442,6 +457,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改任务";
|
title.value = "修改任务";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["jobRef"].validate(valid => {
|
proxy.$refs["jobRef"].validate(valid => {
|
||||||
@ -462,6 +478,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const jobIds = row.jobId || ids.value;
|
const jobIds = row.jobId || ids.value;
|
||||||
@ -472,6 +489,7 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("monitor/job/export", {
|
proxy.download("monitor/job/export", {
|
||||||
|
@ -209,32 +209,38 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回按钮
|
// 返回按钮
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
const obj = { path: "/monitor/job" };
|
const obj = { path: "/monitor/job" };
|
||||||
proxy.$tab.closeOpenPage(obj);
|
proxy.$tab.closeOpenPage(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.jobLogId);
|
ids.value = selection.map(item => item.jobLogId);
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 详细按钮操作 */
|
/** 详细按钮操作 */
|
||||||
function handleView(row) {
|
function handleView(row) {
|
||||||
open.value = true;
|
open.value = true;
|
||||||
form.value = row;
|
form.value = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
proxy.$modal.confirm('是否确认删除调度日志编号为"' + ids.value + '"的数据项?').then(function () {
|
proxy.$modal.confirm('是否确认删除调度日志编号为"' + ids.value + '"的数据项?').then(function () {
|
||||||
@ -244,6 +250,7 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 清空按钮操作 */
|
/** 清空按钮操作 */
|
||||||
function handleClean() {
|
function handleClean() {
|
||||||
proxy.$modal.confirm("是否确认清空所有调度日志数据项?").then(function () {
|
proxy.$modal.confirm("是否确认清空所有调度日志数据项?").then(function () {
|
||||||
@ -253,6 +260,7 @@ function handleClean() {
|
|||||||
proxy.$modal.msgSuccess("清空成功");
|
proxy.$modal.msgSuccess("清空成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("monitor/jobLog/export", {
|
proxy.download("monitor/jobLog/export", {
|
||||||
|
@ -161,11 +161,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
@ -173,6 +175,7 @@ function resetQuery() {
|
|||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
proxy.$refs["logininforRef"].sort(defaultSort.value.prop, defaultSort.value.order);
|
proxy.$refs["logininforRef"].sort(defaultSort.value.prop, defaultSort.value.order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.infoId);
|
ids.value = selection.map(item => item.infoId);
|
||||||
@ -180,12 +183,14 @@ function handleSelectionChange(selection) {
|
|||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
selectName.value = selection.map(item => item.userName);
|
selectName.value = selection.map(item => item.userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 排序触发事件 */
|
/** 排序触发事件 */
|
||||||
function handleSortChange(column, prop, order) {
|
function handleSortChange(column, prop, order) {
|
||||||
queryParams.value.orderByColumn = column.prop;
|
queryParams.value.orderByColumn = column.prop;
|
||||||
queryParams.value.isAsc = column.order;
|
queryParams.value.isAsc = column.order;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const infoIds = row.infoId || ids.value;
|
const infoIds = row.infoId || ids.value;
|
||||||
@ -196,6 +201,7 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 清空按钮操作 */
|
/** 清空按钮操作 */
|
||||||
function handleClean() {
|
function handleClean() {
|
||||||
proxy.$modal.confirm("是否确认清空所有登录日志数据项?").then(function () {
|
proxy.$modal.confirm("是否确认清空所有登录日志数据项?").then(function () {
|
||||||
@ -205,6 +211,7 @@ function handleClean() {
|
|||||||
proxy.$modal.msgSuccess("清空成功");
|
proxy.$modal.msgSuccess("清空成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 解锁按钮操作 */
|
/** 解锁按钮操作 */
|
||||||
function handleUnlock() {
|
function handleUnlock() {
|
||||||
const username = selectName.value;
|
const username = selectName.value;
|
||||||
@ -214,6 +221,7 @@ function handleUnlock() {
|
|||||||
proxy.$modal.msgSuccess("用户" + username + "解锁成功");
|
proxy.$modal.msgSuccess("用户" + username + "解锁成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("monitor/logininfor/export", {
|
proxy.download("monitor/logininfor/export", {
|
||||||
|
@ -82,16 +82,19 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
pageNum.value = 1;
|
pageNum.value = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 强退按钮操作 */
|
/** 强退按钮操作 */
|
||||||
function handleForceLogout(row) {
|
function handleForceLogout(row) {
|
||||||
proxy.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function () {
|
proxy.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function () {
|
||||||
|
@ -239,15 +239,18 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 操作日志类型字典翻译 */
|
/** 操作日志类型字典翻译 */
|
||||||
function typeFormat(row, column) {
|
function typeFormat(row, column) {
|
||||||
return proxy.selectDictLabel(sys_oper_type.value, row.businessType);
|
return proxy.selectDictLabel(sys_oper_type.value, row.businessType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
@ -255,22 +258,26 @@ function resetQuery() {
|
|||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
proxy.$refs["operlogRef"].sort(defaultSort.value.prop, defaultSort.value.order);
|
proxy.$refs["operlogRef"].sort(defaultSort.value.prop, defaultSort.value.order);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.operId);
|
ids.value = selection.map(item => item.operId);
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 排序触发事件 */
|
/** 排序触发事件 */
|
||||||
function handleSortChange(column, prop, order) {
|
function handleSortChange(column, prop, order) {
|
||||||
queryParams.value.orderByColumn = column.prop;
|
queryParams.value.orderByColumn = column.prop;
|
||||||
queryParams.value.isAsc = column.order;
|
queryParams.value.isAsc = column.order;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 详细按钮操作 */
|
/** 详细按钮操作 */
|
||||||
function handleView(row) {
|
function handleView(row) {
|
||||||
open.value = true;
|
open.value = true;
|
||||||
form.value = row;
|
form.value = row;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const operIds = row.operId || ids.value;
|
const operIds = row.operId || ids.value;
|
||||||
@ -281,6 +288,7 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 清空按钮操作 */
|
/** 清空按钮操作 */
|
||||||
function handleClean() {
|
function handleClean() {
|
||||||
proxy.$modal.confirm("是否确认清空所有操作日志数据项?").then(function () {
|
proxy.$modal.confirm("是否确认清空所有操作日志数据项?").then(function () {
|
||||||
@ -290,6 +298,7 @@ function handleClean() {
|
|||||||
proxy.$modal.msgSuccess("清空成功");
|
proxy.$modal.msgSuccess("清空成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("monitor/operlog/export",{
|
proxy.download("monitor/operlog/export",{
|
||||||
|
@ -208,11 +208,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -225,29 +227,34 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("configRef");
|
proxy.resetForm("configRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.configId);
|
ids.value = selection.map(item => item.configId);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加参数";
|
title.value = "添加参数";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -258,6 +265,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改参数";
|
title.value = "修改参数";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["configRef"].validate(valid => {
|
proxy.$refs["configRef"].validate(valid => {
|
||||||
@ -278,6 +286,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const configIds = row.configId || ids.value;
|
const configIds = row.configId || ids.value;
|
||||||
@ -288,12 +297,14 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("system/config/export", {
|
proxy.download("system/config/export", {
|
||||||
...queryParams.value
|
...queryParams.value
|
||||||
}, `config_${new Date().getTime()}.xlsx`);
|
}, `config_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 刷新缓存按钮操作 */
|
/** 刷新缓存按钮操作 */
|
||||||
function handleRefreshCache() {
|
function handleRefreshCache() {
|
||||||
refreshCache().then(() => {
|
refreshCache().then(() => {
|
||||||
|
@ -180,11 +180,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -199,15 +201,18 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("deptRef");
|
proxy.resetForm("deptRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd(row) {
|
function handleAdd(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -220,6 +225,7 @@ function handleAdd(row) {
|
|||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加部门";
|
title.value = "添加部门";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
function toggleExpandAll() {
|
function toggleExpandAll() {
|
||||||
refreshTable.value = false;
|
refreshTable.value = false;
|
||||||
@ -228,6 +234,7 @@ function toggleExpandAll() {
|
|||||||
refreshTable.value = true;
|
refreshTable.value = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -240,6 +247,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改部门";
|
title.value = "修改部门";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["deptRef"].validate(valid => {
|
proxy.$refs["deptRef"].validate(valid => {
|
||||||
@ -260,6 +268,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
proxy.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
|
proxy.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
|
||||||
|
@ -238,6 +238,7 @@ function getTypeList() {
|
|||||||
typeOptions.value = response.data;
|
typeOptions.value = response.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询字典数据列表 */
|
/** 查询字典数据列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@ -247,11 +248,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -266,22 +269,26 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("dataRef");
|
proxy.resetForm("dataRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 返回按钮操作 */
|
/** 返回按钮操作 */
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
const obj = { path: "/system/dict" };
|
const obj = { path: "/system/dict" };
|
||||||
proxy.$tab.closeOpenPage(obj);
|
proxy.$tab.closeOpenPage(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
queryParams.value.dictType = defaultDictType.value;
|
queryParams.value.dictType = defaultDictType.value;
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
@ -289,12 +296,14 @@ function handleAdd() {
|
|||||||
title.value = "添加字典数据";
|
title.value = "添加字典数据";
|
||||||
form.value.dictType = queryParams.value.dictType;
|
form.value.dictType = queryParams.value.dictType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.dictCode);
|
ids.value = selection.map(item => item.dictCode);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -305,6 +314,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改字典数据";
|
title.value = "修改字典数据";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["dataRef"].validate(valid => {
|
proxy.$refs["dataRef"].validate(valid => {
|
||||||
@ -327,6 +337,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const dictCodes = row.dictCode || ids.value;
|
const dictCodes = row.dictCode || ids.value;
|
||||||
@ -338,6 +349,7 @@ function handleDelete(row) {
|
|||||||
useDictStore().removeDict(queryParams.value.dictType);
|
useDictStore().removeDict(queryParams.value.dictType);
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("system/dict/data/export", {
|
proxy.download("system/dict/data/export", {
|
||||||
|
@ -215,11 +215,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -231,29 +233,34 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("dictRef");
|
proxy.resetForm("dictRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加字典类型";
|
title.value = "添加字典类型";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.dictId);
|
ids.value = selection.map(item => item.dictId);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -264,6 +271,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改字典类型";
|
title.value = "修改字典类型";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["dictRef"].validate(valid => {
|
proxy.$refs["dictRef"].validate(valid => {
|
||||||
@ -284,6 +292,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const dictIds = row.dictId || ids.value;
|
const dictIds = row.dictId || ids.value;
|
||||||
@ -294,12 +303,14 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("system/dict/type/export", {
|
proxy.download("system/dict/type/export", {
|
||||||
...queryParams.value
|
...queryParams.value
|
||||||
}, `dict_${new Date().getTime()}.xlsx`);
|
}, `dict_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 刷新缓存按钮操作 */
|
/** 刷新缓存按钮操作 */
|
||||||
function handleRefreshCache() {
|
function handleRefreshCache() {
|
||||||
refreshCache().then(() => {
|
refreshCache().then(() => {
|
||||||
|
@ -316,6 +316,7 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询菜单下拉树结构 */
|
/** 查询菜单下拉树结构 */
|
||||||
function getTreeselect() {
|
function getTreeselect() {
|
||||||
menuOptions.value = [];
|
menuOptions.value = [];
|
||||||
@ -325,11 +326,13 @@ function getTreeselect() {
|
|||||||
menuOptions.value.push(menu);
|
menuOptions.value.push(menu);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -346,23 +349,28 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("menuRef");
|
proxy.resetForm("menuRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 展示下拉图标 */
|
/** 展示下拉图标 */
|
||||||
function showSelectIcon() {
|
function showSelectIcon() {
|
||||||
iconSelectRef.value.reset();
|
iconSelectRef.value.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 选择图标 */
|
/** 选择图标 */
|
||||||
function selected(name) {
|
function selected(name) {
|
||||||
form.value.icon = name;
|
form.value.icon = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd(row) {
|
function handleAdd(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -375,6 +383,7 @@ function handleAdd(row) {
|
|||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加菜单";
|
title.value = "添加菜单";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 展开/折叠操作 */
|
/** 展开/折叠操作 */
|
||||||
function toggleExpandAll() {
|
function toggleExpandAll() {
|
||||||
refreshTable.value = false;
|
refreshTable.value = false;
|
||||||
@ -383,6 +392,7 @@ function toggleExpandAll() {
|
|||||||
refreshTable.value = true;
|
refreshTable.value = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
async function handleUpdate(row) {
|
async function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -393,6 +403,7 @@ async function handleUpdate(row) {
|
|||||||
title.value = "修改菜单";
|
title.value = "修改菜单";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["menuRef"].validate(valid => {
|
proxy.$refs["menuRef"].validate(valid => {
|
||||||
@ -413,6 +424,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
proxy.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
|
proxy.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
|
||||||
|
@ -200,11 +200,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -216,28 +218,33 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("noticeRef");
|
proxy.resetForm("noticeRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.noticeId);
|
ids.value = selection.map(item => item.noticeId);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加公告";
|
title.value = "添加公告";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**修改按钮操作 */
|
/**修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -248,6 +255,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改公告";
|
title.value = "修改公告";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["noticeRef"].validate(valid => {
|
proxy.$refs["noticeRef"].validate(valid => {
|
||||||
@ -268,6 +276,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const noticeIds = row.noticeId || ids.value
|
const noticeIds = row.noticeId || ids.value
|
||||||
|
@ -187,11 +187,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 表单重置 */
|
/** 表单重置 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -204,28 +206,33 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("postRef");
|
proxy.resetForm("postRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.postId);
|
ids.value = selection.map(item => item.postId);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加岗位";
|
title.value = "添加岗位";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -236,6 +243,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改岗位";
|
title.value = "修改岗位";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["postRef"].validate(valid => {
|
proxy.$refs["postRef"].validate(valid => {
|
||||||
@ -256,6 +264,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const postIds = row.postId || ids.value;
|
const postIds = row.postId || ids.value;
|
||||||
@ -266,6 +275,7 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("system/post/export", {
|
proxy.download("system/post/export", {
|
||||||
|
@ -123,30 +123,36 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 返回按钮
|
|
||||||
|
/** 返回按钮 */
|
||||||
function handleClose() {
|
function handleClose() {
|
||||||
const obj = { path: "/system/role" };
|
const obj = { path: "/system/role" };
|
||||||
proxy.$tab.closeOpenPage(obj);
|
proxy.$tab.closeOpenPage(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.pageNum = 1;
|
queryParams.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
// 多选框选中数据
|
|
||||||
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
userIds.value = selection.map(item => item.userId);
|
userIds.value = selection.map(item => item.userId);
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开授权用户表弹窗 */
|
/** 打开授权用户表弹窗 */
|
||||||
function openSelectUser() {
|
function openSelectUser() {
|
||||||
proxy.$refs["selectRef"].show();
|
proxy.$refs["selectRef"].show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消授权按钮操作 */
|
/** 取消授权按钮操作 */
|
||||||
function cancelAuthUser(row) {
|
function cancelAuthUser(row) {
|
||||||
proxy.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function () {
|
proxy.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function () {
|
||||||
@ -156,6 +162,7 @@ function cancelAuthUser(row) {
|
|||||||
proxy.$modal.msgSuccess("取消授权成功");
|
proxy.$modal.msgSuccess("取消授权成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 批量取消授权按钮操作 */
|
/** 批量取消授权按钮操作 */
|
||||||
function cancelAuthUserAll(row) {
|
function cancelAuthUserAll(row) {
|
||||||
const roleId = queryParams.roleId;
|
const roleId = queryParams.roleId;
|
||||||
|
@ -305,17 +305,20 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const roleIds = row.roleId || ids.value;
|
const roleIds = row.roleId || ids.value;
|
||||||
@ -326,18 +329,21 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("system/role/export", {
|
proxy.download("system/role/export", {
|
||||||
...queryParams.value,
|
...queryParams.value,
|
||||||
}, `role_${new Date().getTime()}.xlsx`);
|
}, `role_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.roleId);
|
ids.value = selection.map(item => item.roleId);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 角色状态修改 */
|
/** 角色状态修改 */
|
||||||
function handleStatusChange(row) {
|
function handleStatusChange(row) {
|
||||||
let text = row.status === "0" ? "启用" : "停用";
|
let text = row.status === "0" ? "启用" : "停用";
|
||||||
@ -349,6 +355,7 @@ function handleStatusChange(row) {
|
|||||||
row.status = row.status === "0" ? "1" : "0";
|
row.status = row.status === "0" ? "1" : "0";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 更多操作 */
|
/** 更多操作 */
|
||||||
function handleCommand(command, row) {
|
function handleCommand(command, row) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
@ -362,16 +369,19 @@ function handleCommand(command, row) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 分配用户 */
|
/** 分配用户 */
|
||||||
function handleAuthUser(row) {
|
function handleAuthUser(row) {
|
||||||
router.push("/system/role-auth/user/" + row.roleId);
|
router.push("/system/role-auth/user/" + row.roleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询菜单树结构 */
|
/** 查询菜单树结构 */
|
||||||
function getMenuTreeselect() {
|
function getMenuTreeselect() {
|
||||||
menuTreeselect().then(response => {
|
menuTreeselect().then(response => {
|
||||||
menuOptions.value = response.data;
|
menuOptions.value = response.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 所有部门节点数据 */
|
/** 所有部门节点数据 */
|
||||||
function getDeptAllCheckedKeys() {
|
function getDeptAllCheckedKeys() {
|
||||||
// 目前被选中的部门节点
|
// 目前被选中的部门节点
|
||||||
@ -381,6 +391,7 @@ function getDeptAllCheckedKeys() {
|
|||||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||||
return checkedKeys;
|
return checkedKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置新增的表单以及其他数据 */
|
/** 重置新增的表单以及其他数据 */
|
||||||
function reset() {
|
function reset() {
|
||||||
if (menuRef.value != undefined) {
|
if (menuRef.value != undefined) {
|
||||||
@ -404,6 +415,7 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("roleRef");
|
proxy.resetForm("roleRef");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加角色 */
|
/** 添加角色 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
@ -411,6 +423,7 @@ function handleAdd() {
|
|||||||
open.value = true;
|
open.value = true;
|
||||||
title.value = "添加角色";
|
title.value = "添加角色";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改角色 */
|
/** 修改角色 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -433,6 +446,7 @@ function handleUpdate(row) {
|
|||||||
title.value = "修改角色";
|
title.value = "修改角色";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 根据角色ID查询菜单树结构 */
|
/** 根据角色ID查询菜单树结构 */
|
||||||
function getRoleMenuTreeselect(roleId) {
|
function getRoleMenuTreeselect(roleId) {
|
||||||
return roleMenuTreeselect(roleId).then(response => {
|
return roleMenuTreeselect(roleId).then(response => {
|
||||||
@ -440,6 +454,7 @@ function getRoleMenuTreeselect(roleId) {
|
|||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 根据角色ID查询部门树结构 */
|
/** 根据角色ID查询部门树结构 */
|
||||||
function getDeptTree(roleId) {
|
function getDeptTree(roleId) {
|
||||||
return deptTreeSelect(roleId).then(response => {
|
return deptTreeSelect(roleId).then(response => {
|
||||||
@ -447,6 +462,7 @@ function getDeptTree(roleId) {
|
|||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 树权限(展开/折叠)*/
|
/** 树权限(展开/折叠)*/
|
||||||
function handleCheckedTreeExpand(value, type) {
|
function handleCheckedTreeExpand(value, type) {
|
||||||
if (type == "menu") {
|
if (type == "menu") {
|
||||||
@ -461,6 +477,7 @@ function handleCheckedTreeExpand(value, type) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 树权限(全选/全不选) */
|
/** 树权限(全选/全不选) */
|
||||||
function handleCheckedTreeNodeAll(value, type) {
|
function handleCheckedTreeNodeAll(value, type) {
|
||||||
if (type == "menu") {
|
if (type == "menu") {
|
||||||
@ -469,6 +486,7 @@ function handleCheckedTreeNodeAll(value, type) {
|
|||||||
deptRef.value.setCheckedNodes(value ? deptOptions.value : []);
|
deptRef.value.setCheckedNodes(value ? deptOptions.value : []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 树权限(父子联动) */
|
/** 树权限(父子联动) */
|
||||||
function handleCheckedTreeConnect(value, type) {
|
function handleCheckedTreeConnect(value, type) {
|
||||||
if (type == "menu") {
|
if (type == "menu") {
|
||||||
@ -477,6 +495,7 @@ function handleCheckedTreeConnect(value, type) {
|
|||||||
form.value.deptCheckStrictly = value ? true : false;
|
form.value.deptCheckStrictly = value ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 所有菜单节点数据 */
|
/** 所有菜单节点数据 */
|
||||||
function getMenuAllCheckedKeys() {
|
function getMenuAllCheckedKeys() {
|
||||||
// 目前被选中的菜单节点
|
// 目前被选中的菜单节点
|
||||||
@ -486,6 +505,7 @@ function getMenuAllCheckedKeys() {
|
|||||||
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
||||||
return checkedKeys;
|
return checkedKeys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["roleRef"].validate(valid => {
|
proxy.$refs["roleRef"].validate(valid => {
|
||||||
@ -508,17 +528,20 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 选择角色权限范围触发 */
|
/** 选择角色权限范围触发 */
|
||||||
function dataScopeSelectChange(value) {
|
function dataScopeSelectChange(value) {
|
||||||
if (value !== "2") {
|
if (value !== "2") {
|
||||||
deptRef.value.setCheckedKeys([]);
|
deptRef.value.setCheckedKeys([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 分配数据权限操作 */
|
/** 分配数据权限操作 */
|
||||||
function handleDataScope(row) {
|
function handleDataScope(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -538,6 +561,7 @@ function handleDataScope(row) {
|
|||||||
title.value = "分配数据权限";
|
title.value = "分配数据权限";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交按钮(数据权限) */
|
/** 提交按钮(数据权限) */
|
||||||
function submitDataScope() {
|
function submitDataScope() {
|
||||||
if (form.value.roleId != undefined) {
|
if (form.value.roleId != undefined) {
|
||||||
@ -549,6 +573,7 @@ function submitDataScope() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 取消按钮(数据权限)*/
|
/** 取消按钮(数据权限)*/
|
||||||
function cancelDataScope() {
|
function cancelDataScope() {
|
||||||
openDataScope.value = false;
|
openDataScope.value = false;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
v-model="queryParams.userName"
|
v-model="queryParams.userName"
|
||||||
placeholder="请输入用户名称"
|
placeholder="请输入用户名称"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px"
|
style="width: 180px"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
v-model="queryParams.phonenumber"
|
v-model="queryParams.phonenumber"
|
||||||
placeholder="请输入手机号码"
|
placeholder="请输入手机号码"
|
||||||
clearable
|
clearable
|
||||||
style="width: 200px"
|
style="width: 180px"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -91,14 +91,17 @@ function show() {
|
|||||||
getList();
|
getList();
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**选择行 */
|
/**选择行 */
|
||||||
function clickRow(row) {
|
function clickRow(row) {
|
||||||
proxy.$refs["refTable"].toggleRowSelection(row);
|
proxy.$refs["refTable"].toggleRowSelection(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
userIds.value = selection.map(item => item.userId);
|
userIds.value = selection.map(item => item.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询表数据
|
// 查询表数据
|
||||||
function getList() {
|
function getList() {
|
||||||
unallocatedUserList(queryParams).then(res => {
|
unallocatedUserList(queryParams).then(res => {
|
||||||
@ -106,16 +109,19 @@ function getList() {
|
|||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.pageNum = 1;
|
queryParams.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(["ok"]);
|
const emit = defineEmits(["ok"]);
|
||||||
/** 选择授权用户操作 */
|
/** 选择授权用户操作 */
|
||||||
function handleSelectUser() {
|
function handleSelectUser() {
|
||||||
@ -127,10 +133,8 @@ function handleSelectUser() {
|
|||||||
}
|
}
|
||||||
authUserSelectAll({ roleId: roleId, userIds: uIds }).then(res => {
|
authUserSelectAll({ roleId: roleId, userIds: uIds }).then(res => {
|
||||||
proxy.$modal.msgSuccess(res.msg);
|
proxy.$modal.msgSuccess(res.msg);
|
||||||
if (res.code === 200) {
|
visible.value = false;
|
||||||
visible.value = false;
|
emit("ok");
|
||||||
emit("ok");
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,19 +67,23 @@ const form = ref({
|
|||||||
function clickRow(row) {
|
function clickRow(row) {
|
||||||
proxy.$refs["roleRef"].toggleRowSelection(row);
|
proxy.$refs["roleRef"].toggleRowSelection(row);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
roleIds.value = selection.map(item => item.roleId);
|
roleIds.value = selection.map(item => item.roleId);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 保存选中的数据编号 */
|
/** 保存选中的数据编号 */
|
||||||
function getRowKey(row) {
|
function getRowKey(row) {
|
||||||
return row.roleId;
|
return row.roleId;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 关闭按钮 */
|
/** 关闭按钮 */
|
||||||
function close() {
|
function close() {
|
||||||
const obj = { path: "/system/user" };
|
const obj = { path: "/system/user" };
|
||||||
proxy.$tab.closeOpenPage(obj);
|
proxy.$tab.closeOpenPage(obj);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
const userId = form.value.userId;
|
const userId = form.value.userId;
|
||||||
|
@ -404,16 +404,19 @@ const filterNode = (value, data) => {
|
|||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.label.indexOf(value) !== -1;
|
return data.label.indexOf(value) !== -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 根据名称筛选部门树 */
|
/** 根据名称筛选部门树 */
|
||||||
watch(deptName, val => {
|
watch(deptName, val => {
|
||||||
proxy.$refs["deptTreeRef"].filter(val);
|
proxy.$refs["deptTreeRef"].filter(val);
|
||||||
});
|
});
|
||||||
|
|
||||||
/** 查询部门下拉树结构 */
|
/** 查询部门下拉树结构 */
|
||||||
function getDeptTree() {
|
function getDeptTree() {
|
||||||
deptTreeSelect().then(response => {
|
deptTreeSelect().then(response => {
|
||||||
deptOptions.value = response.data;
|
deptOptions.value = response.data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 查询用户列表 */
|
/** 查询用户列表 */
|
||||||
function getList() {
|
function getList() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@ -423,16 +426,19 @@ function getList() {
|
|||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 节点单击事件 */
|
/** 节点单击事件 */
|
||||||
function handleNodeClick(data) {
|
function handleNodeClick(data) {
|
||||||
queryParams.value.deptId = data.id;
|
queryParams.value.deptId = data.id;
|
||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
@ -441,6 +447,7 @@ function resetQuery() {
|
|||||||
proxy.$refs.deptTreeRef.setCurrentKey(null);
|
proxy.$refs.deptTreeRef.setCurrentKey(null);
|
||||||
handleQuery();
|
handleQuery();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const userIds = row.userId || ids.value;
|
const userIds = row.userId || ids.value;
|
||||||
@ -451,12 +458,14 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
function handleExport() {
|
function handleExport() {
|
||||||
proxy.download("system/user/export", {
|
proxy.download("system/user/export", {
|
||||||
...queryParams.value,
|
...queryParams.value,
|
||||||
},`user_${new Date().getTime()}.xlsx`);
|
},`user_${new Date().getTime()}.xlsx`);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 用户状态修改 */
|
/** 用户状态修改 */
|
||||||
function handleStatusChange(row) {
|
function handleStatusChange(row) {
|
||||||
let text = row.status === "0" ? "启用" : "停用";
|
let text = row.status === "0" ? "启用" : "停用";
|
||||||
@ -468,6 +477,7 @@ function handleStatusChange(row) {
|
|||||||
row.status = row.status === "0" ? "1" : "0";
|
row.status = row.status === "0" ? "1" : "0";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 更多操作 */
|
/** 更多操作 */
|
||||||
function handleCommand(command, row) {
|
function handleCommand(command, row) {
|
||||||
switch (command) {
|
switch (command) {
|
||||||
@ -481,11 +491,13 @@ function handleCommand(command, row) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 跳转角色分配 */
|
/** 跳转角色分配 */
|
||||||
function handleAuthRole(row) {
|
function handleAuthRole(row) {
|
||||||
const userId = row.userId;
|
const userId = row.userId;
|
||||||
router.push("/system/user-auth/role/" + userId);
|
router.push("/system/user-auth/role/" + userId);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 重置密码按钮操作 */
|
/** 重置密码按钮操作 */
|
||||||
function handleResetPwd(row) {
|
function handleResetPwd(row) {
|
||||||
proxy.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
proxy.$prompt('请输入"' + row.userName + '"的新密码', "提示", {
|
||||||
@ -505,26 +517,31 @@ function handleResetPwd(row) {
|
|||||||
});
|
});
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 选择条数 */
|
/** 选择条数 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.userId);
|
ids.value = selection.map(item => item.userId);
|
||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 导入按钮操作 */
|
/** 导入按钮操作 */
|
||||||
function handleImport() {
|
function handleImport() {
|
||||||
upload.title = "用户导入";
|
upload.title = "用户导入";
|
||||||
upload.open = true;
|
upload.open = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 下载模板操作 */
|
/** 下载模板操作 */
|
||||||
function importTemplate() {
|
function importTemplate() {
|
||||||
proxy.download("system/user/importTemplate", {
|
proxy.download("system/user/importTemplate", {
|
||||||
}, `user_template_${new Date().getTime()}.xlsx`);
|
}, `user_template_${new Date().getTime()}.xlsx`);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**文件上传中处理 */
|
/**文件上传中处理 */
|
||||||
const handleFileUploadProgress = (event, file, fileList) => {
|
const handleFileUploadProgress = (event, file, fileList) => {
|
||||||
upload.isUploading = true;
|
upload.isUploading = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 文件上传成功处理 */
|
/** 文件上传成功处理 */
|
||||||
const handleFileSuccess = (response, file, fileList) => {
|
const handleFileSuccess = (response, file, fileList) => {
|
||||||
upload.open = false;
|
upload.open = false;
|
||||||
@ -533,10 +550,12 @@ const handleFileSuccess = (response, file, fileList) => {
|
|||||||
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||||
getList();
|
getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交上传文件 */
|
/** 提交上传文件 */
|
||||||
function submitFileForm() {
|
function submitFileForm() {
|
||||||
proxy.$refs["uploadRef"].submit();
|
proxy.$refs["uploadRef"].submit();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 重置操作表单 */
|
/** 重置操作表单 */
|
||||||
function reset() {
|
function reset() {
|
||||||
form.value = {
|
form.value = {
|
||||||
@ -555,11 +574,13 @@ function reset() {
|
|||||||
};
|
};
|
||||||
proxy.resetForm("userRef");
|
proxy.resetForm("userRef");
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 取消按钮 */
|
/** 取消按钮 */
|
||||||
function cancel() {
|
function cancel() {
|
||||||
open.value = false;
|
open.value = false;
|
||||||
reset();
|
reset();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
reset();
|
reset();
|
||||||
@ -571,6 +592,7 @@ function handleAdd() {
|
|||||||
form.value.password = initPassword.value;
|
form.value.password = initPassword.value;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
reset();
|
reset();
|
||||||
@ -586,6 +608,7 @@ function handleUpdate(row) {
|
|||||||
form.password = "";
|
form.password = "";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
function submitForm() {
|
function submitForm() {
|
||||||
proxy.$refs["userRef"].validate(valid => {
|
proxy.$refs["userRef"].validate(valid => {
|
||||||
|
@ -34,6 +34,7 @@ const equalToPassword = (rule, value, callback) => {
|
|||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
oldPassword: [{ required: true, message: "旧密码不能为空", trigger: "blur" }],
|
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" }],
|
newPassword: [{ required: true, message: "新密码不能为空", trigger: "blur" }, { min: 6, max: 20, message: "长度在 6 到 20 个字符", trigger: "blur" }, { pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }],
|
||||||
@ -50,6 +51,7 @@ function submit() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 关闭按钮 */
|
/** 关闭按钮 */
|
||||||
function close() {
|
function close() {
|
||||||
proxy.$tab.closePage();
|
proxy.$tab.closePage();
|
||||||
|
@ -87,25 +87,31 @@ const options = reactive({
|
|||||||
function editCropper() {
|
function editCropper() {
|
||||||
open.value = true;
|
open.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开弹出层结束时的回调 */
|
/** 打开弹出层结束时的回调 */
|
||||||
function modalOpened() {
|
function modalOpened() {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 覆盖默认上传行为 */
|
/** 覆盖默认上传行为 */
|
||||||
function requestUpload() {}
|
function requestUpload() {}
|
||||||
|
|
||||||
/** 向左旋转 */
|
/** 向左旋转 */
|
||||||
function rotateLeft() {
|
function rotateLeft() {
|
||||||
proxy.$refs.cropper.rotateLeft();
|
proxy.$refs.cropper.rotateLeft();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 向右旋转 */
|
/** 向右旋转 */
|
||||||
function rotateRight() {
|
function rotateRight() {
|
||||||
proxy.$refs.cropper.rotateRight();
|
proxy.$refs.cropper.rotateRight();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 图片缩放 */
|
/** 图片缩放 */
|
||||||
function changeScale(num) {
|
function changeScale(num) {
|
||||||
num = num || 1;
|
num = num || 1;
|
||||||
proxy.$refs.cropper.changeScale(num);
|
proxy.$refs.cropper.changeScale(num);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 上传预处理 */
|
/** 上传预处理 */
|
||||||
function beforeUpload(file) {
|
function beforeUpload(file) {
|
||||||
if (file.type.indexOf("image/") == -1) {
|
if (file.type.indexOf("image/") == -1) {
|
||||||
@ -119,6 +125,7 @@ function beforeUpload(file) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 上传图片 */
|
/** 上传图片 */
|
||||||
function uploadImg() {
|
function uploadImg() {
|
||||||
proxy.$refs.cropper.getCropBlob(data => {
|
proxy.$refs.cropper.getCropBlob(data => {
|
||||||
@ -133,10 +140,12 @@ function uploadImg() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 实时预览 */
|
/** 实时预览 */
|
||||||
function realTime(data) {
|
function realTime(data) {
|
||||||
options.previews = data;
|
options.previews = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 关闭窗口 */
|
/** 关闭窗口 */
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
options.img = userStore.avatar;
|
options.img = userStore.avatar;
|
||||||
|
@ -168,6 +168,7 @@ function submitForm() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFormPromise(form) {
|
function getFormPromise(form) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
form.validate(res => {
|
form.validate(res => {
|
||||||
@ -175,6 +176,7 @@ function getFormPromise(form) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } };
|
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: route.query.pageNum } };
|
||||||
proxy.$tab.closeOpenPage(obj);
|
proxy.$tab.closeOpenPage(obj);
|
||||||
|
@ -258,15 +258,18 @@ const rules = ref({
|
|||||||
businessName: [{ required: true, message: "请输入生成业务名", trigger: "blur" }],
|
businessName: [{ required: true, message: "请输入生成业务名", trigger: "blur" }],
|
||||||
functionName: [{ required: true, message: "请输入生成功能名", trigger: "blur" }]
|
functionName: [{ required: true, message: "请输入生成功能名", trigger: "blur" }]
|
||||||
});
|
});
|
||||||
|
|
||||||
function subSelectChange(value) {
|
function subSelectChange(value) {
|
||||||
props.info.subTableFkName = "";
|
props.info.subTableFkName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function tplSelectChange(value) {
|
function tplSelectChange(value) {
|
||||||
if (value !== "sub") {
|
if (value !== "sub") {
|
||||||
props.info.subTableName = "";
|
props.info.subTableName = "";
|
||||||
props.info.subTableFkName = "";
|
props.info.subTableFkName = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSubTableColumns(value) {
|
function setSubTableColumns(value) {
|
||||||
for (var item in props.tables) {
|
for (var item in props.tables) {
|
||||||
const name = props.tables[item].tableName;
|
const name = props.tables[item].tableName;
|
||||||
@ -276,6 +279,7 @@ function setSubTableColumns(value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询菜单下拉树结构 */
|
/** 查询菜单下拉树结构 */
|
||||||
function getMenuTreeselect() {
|
function getMenuTreeselect() {
|
||||||
listMenu().then(response => {
|
listMenu().then(response => {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
v-model="queryParams.tableName"
|
v-model="queryParams.tableName"
|
||||||
placeholder="请输入表名称"
|
placeholder="请输入表名称"
|
||||||
clearable
|
clearable
|
||||||
|
style="width: 180px"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -15,6 +16,7 @@
|
|||||||
v-model="queryParams.tableComment"
|
v-model="queryParams.tableComment"
|
||||||
placeholder="请输入表描述"
|
placeholder="请输入表描述"
|
||||||
clearable
|
clearable
|
||||||
|
style="width: 180px"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -71,14 +73,17 @@ function show() {
|
|||||||
getList();
|
getList();
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 单击选择行 */
|
/** 单击选择行 */
|
||||||
function clickRow(row) {
|
function clickRow(row) {
|
||||||
proxy.$refs.table.toggleRowSelection(row);
|
proxy.$refs.table.toggleRowSelection(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
tables.value = selection.map(item => item.tableName);
|
tables.value = selection.map(item => item.tableName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查询表数据 */
|
/** 查询表数据 */
|
||||||
function getList() {
|
function getList() {
|
||||||
listDbTable(queryParams).then(res => {
|
listDbTable(queryParams).then(res => {
|
||||||
@ -86,16 +91,19 @@ function getList() {
|
|||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.pageNum = 1;
|
queryParams.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导入按钮操作 */
|
/** 导入按钮操作 */
|
||||||
function handleImportTable() {
|
function handleImportTable() {
|
||||||
const tableNames = tables.value.join(",");
|
const tableNames = tables.value.join(",");
|
||||||
|
@ -217,11 +217,13 @@ function getList() {
|
|||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
queryParams.value.pageNum = 1;
|
queryParams.value.pageNum = 1;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 生成代码操作 */
|
/** 生成代码操作 */
|
||||||
function handleGenTable(row) {
|
function handleGenTable(row) {
|
||||||
const tbNames = row.tableName || tableNames.value;
|
const tbNames = row.tableName || tableNames.value;
|
||||||
@ -237,6 +239,7 @@ function handleGenTable(row) {
|
|||||||
proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "ruoyi.zip");
|
proxy.$download.zip("/tool/gen/batchGenCode?tables=" + tbNames, "ruoyi.zip");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 同步数据库操作 */
|
/** 同步数据库操作 */
|
||||||
function handleSynchDb(row) {
|
function handleSynchDb(row) {
|
||||||
const tableName = row.tableName;
|
const tableName = row.tableName;
|
||||||
@ -246,20 +249,24 @@ function handleSynchDb(row) {
|
|||||||
proxy.$modal.msgSuccess("同步成功");
|
proxy.$modal.msgSuccess("同步成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开导入表弹窗 */
|
/** 打开导入表弹窗 */
|
||||||
function openImportTable() {
|
function openImportTable() {
|
||||||
proxy.$refs["importRef"].show();
|
proxy.$refs["importRef"].show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 打开创建表弹窗 */
|
/** 打开创建表弹窗 */
|
||||||
function openCreateTable() {
|
function openCreateTable() {
|
||||||
proxy.$refs["createRef"].show();
|
proxy.$refs["createRef"].show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
dateRange.value = [];
|
dateRange.value = [];
|
||||||
proxy.resetForm("queryRef");
|
proxy.resetForm("queryRef");
|
||||||
handleQuery();
|
handleQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 预览按钮 */
|
/** 预览按钮 */
|
||||||
function handlePreview(row) {
|
function handlePreview(row) {
|
||||||
previewTable(row.tableId).then(response => {
|
previewTable(row.tableId).then(response => {
|
||||||
@ -268,10 +275,12 @@ function handlePreview(row) {
|
|||||||
preview.value.activeName = "domain.java";
|
preview.value.activeName = "domain.java";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 复制代码成功 */
|
/** 复制代码成功 */
|
||||||
function copyTextSuccess() {
|
function copyTextSuccess() {
|
||||||
proxy.$modal.msgSuccess("复制成功");
|
proxy.$modal.msgSuccess("复制成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
ids.value = selection.map(item => item.tableId);
|
ids.value = selection.map(item => item.tableId);
|
||||||
@ -279,11 +288,13 @@ function handleSelectionChange(selection) {
|
|||||||
single.value = selection.length != 1;
|
single.value = selection.length != 1;
|
||||||
multiple.value = !selection.length;
|
multiple.value = !selection.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleEditTable(row) {
|
function handleEditTable(row) {
|
||||||
const tableId = row.tableId || ids.value[0];
|
const tableId = row.tableId || ids.value[0];
|
||||||
router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } });
|
router.push({ path: "/tool/gen-edit/index/" + tableId, query: { pageNum: queryParams.value.pageNum } });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const tableIds = row.tableId || ids.value;
|
const tableIds = row.tableId || ids.value;
|
||||||
|
Loading…
Reference in New Issue
Block a user