1
0
forked from ruoyi/RuoYi-Vue

remove all semicolons

This commit is contained in:
RuoYi
2025-04-27 10:05:55 +08:00
parent f30e737be2
commit 62630a5a95
92 changed files with 2285 additions and 2287 deletions

View File

@@ -1024,14 +1024,14 @@ export default {
return {
// 版本号
version: "3.8.9"
};
}
},
methods: {
goTarget(href) {
window.open(href, "_blank");
window.open(href, "_blank")
}
}
};
}
</script>
<style scoped lang="scss">

View File

@@ -62,8 +62,8 @@
</template>
<script>
import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie";
import { getCodeImg } from "@/api/login"
import Cookies from "js-cookie"
import { encrypt, decrypt } from '@/utils/jsencrypt'
export default {
@@ -94,66 +94,66 @@ export default {
// 注册开关
register: false,
redirect: undefined
};
}
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect;
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
created() {
this.getCode();
this.getCookie();
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.img
this.loginForm.uuid = res.uuid
}
});
})
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");
const username = Cookies.get("username")
const password = Cookies.get("password")
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
};
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true;
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 });
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 });
Cookies.set("username", this.loginForm.username, { expires: 30 })
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove("username");
Cookies.remove("password");
Cookies.remove('rememberMe');
Cookies.remove("username")
Cookies.remove("password")
Cookies.remove('rememberMe')
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
this.$router.push({ path: this.redirect || "/" }).catch(()=>{})
}).catch(() => {
this.loading = false;
this.loading = false
if (this.captchaEnabled) {
this.getCode();
this.getCode()
}
});
})
}
});
})
}
}
};
}
</script>
<style rel="stylesheet/scss" lang="scss">

View File

@@ -65,8 +65,8 @@
</template>
<script>
import { getCache } from "@/api/monitor/cache";
import * as echarts from "echarts";
import { getCache } from "@/api/monitor/cache"
import * as echarts from "echarts"
export default {
name: "Cache",
@@ -81,17 +81,17 @@ export default {
}
},
created() {
this.getList();
this.openLoading();
this.getList()
this.openLoading()
},
methods: {
/** 查缓存询信息 */
getList() {
getCache().then((response) => {
this.cache = response.data;
this.$modal.closeLoading();
this.cache = response.data
this.$modal.closeLoading()
this.commandstats = echarts.init(this.$refs.commandstats, "macarons");
this.commandstats = echarts.init(this.$refs.commandstats, "macarons")
this.commandstats.setOption({
tooltip: {
trigger: "item",
@@ -109,8 +109,8 @@ export default {
animationDuration: 1000,
}
]
});
this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons");
})
this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons")
this.usedmemory.setOption({
tooltip: {
formatter: "{b} <br/>{a} : " + this.cache.info.used_memory_human,
@@ -132,17 +132,17 @@ export default {
]
}
]
});
})
window.addEventListener("resize", () => {
this.commandstats.resize();
this.usedmemory.resize();
});
});
this.commandstats.resize()
this.usedmemory.resize()
})
})
},
// 打开加载层
openLoading() {
this.$modal.loading("正在加载缓存监控数据,请稍候!");
this.$modal.loading("正在加载缓存监控数据,请稍候!")
}
}
};
}
</script>

View File

@@ -152,7 +152,7 @@
</template>
<script>
import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from "@/api/monitor/cache";
import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from "@/api/monitor/cache"
export default {
name: "CacheList",
@@ -165,77 +165,77 @@ export default {
subLoading: false,
nowCacheName: "",
tableHeight: window.innerHeight - 200
};
}
},
created() {
this.getCacheNames();
this.getCacheNames()
},
methods: {
/** 查询缓存名称列表 */
getCacheNames() {
this.loading = true;
this.loading = true
listCacheName().then(response => {
this.cacheNames = response.data;
this.loading = false;
});
this.cacheNames = response.data
this.loading = false
})
},
/** 刷新缓存名称列表 */
refreshCacheNames() {
this.getCacheNames();
this.$modal.msgSuccess("刷新缓存列表成功");
this.getCacheNames()
this.$modal.msgSuccess("刷新缓存列表成功")
},
/** 清理指定名称缓存 */
handleClearCacheName(row) {
clearCacheName(row.cacheName).then(response => {
this.$modal.msgSuccess("清理缓存名称[" + row.cacheName + "]成功");
this.getCacheKeys();
});
this.$modal.msgSuccess("清理缓存名称[" + row.cacheName + "]成功")
this.getCacheKeys()
})
},
/** 查询缓存键名列表 */
getCacheKeys(row) {
const cacheName = row !== undefined ? row.cacheName : this.nowCacheName;
const cacheName = row !== undefined ? row.cacheName : this.nowCacheName
if (cacheName === "") {
return;
return
}
this.subLoading = true;
this.subLoading = true
listCacheKey(cacheName).then(response => {
this.cacheKeys = response.data;
this.subLoading = false;
this.nowCacheName = cacheName;
});
this.cacheKeys = response.data
this.subLoading = false
this.nowCacheName = cacheName
})
},
/** 刷新缓存键名列表 */
refreshCacheKeys() {
this.getCacheKeys();
this.$modal.msgSuccess("刷新键名列表成功");
this.getCacheKeys()
this.$modal.msgSuccess("刷新键名列表成功")
},
/** 清理指定键名缓存 */
handleClearCacheKey(cacheKey) {
clearCacheKey(cacheKey).then(response => {
this.$modal.msgSuccess("清理缓存键名[" + cacheKey + "]成功");
this.getCacheKeys();
});
this.$modal.msgSuccess("清理缓存键名[" + cacheKey + "]成功")
this.getCacheKeys()
})
},
/** 列表前缀去除 */
nameFormatter(row) {
return row.cacheName.replace(":", "");
return row.cacheName.replace(":", "")
},
/** 键名前缀去除 */
keyFormatter(cacheKey) {
return cacheKey.replace(this.nowCacheName, "");
return cacheKey.replace(this.nowCacheName, "")
},
/** 查询缓存内容详细 */
handleCacheValue(cacheKey) {
getCacheValue(this.nowCacheName, cacheKey).then(response => {
this.cacheForm = response.data;
});
this.cacheForm = response.data
})
},
/** 清理全部缓存 */
handleClearCacheAll() {
clearCacheAll().then(response => {
this.$modal.msgSuccess("清理全部缓存成功");
});
this.$modal.msgSuccess("清理全部缓存成功")
})
}
},
};
}
}
</script>

View File

@@ -2,14 +2,14 @@
<i-frame :src="url" />
</template>
<script>
import iFrame from "@/components/iFrame/index";
import iFrame from "@/components/iFrame/index"
export default {
name: "Druid",
components: { iFrame },
data() {
return {
url: process.env.VUE_APP_BASE_API + "/druid/login.html"
};
},
};
}
}
}
</script>

View File

@@ -291,7 +291,7 @@
</template>
<script>
import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job";
import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job"
import Crontab from '@/components/Crontab'
export default {
@@ -346,29 +346,29 @@ export default {
{ required: true, message: "cron执行表达式不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询定时任务列表 */
getList() {
this.loading = true;
this.loading = true
listJob(this.queryParams).then(response => {
this.jobList = response.rows;
this.total = response.total;
this.loading = false;
});
this.jobList = response.rows
this.total = response.total
this.loading = false
})
},
// 任务组名字典翻译
jobGroupFormat(row, column) {
return this.selectDictLabel(this.dict.type.sys_job_group, row.jobGroup);
return this.selectDictLabel(this.dict.type.sys_job_group, row.jobGroup)
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -381,96 +381,96 @@ export default {
misfirePolicy: 1,
concurrent: 1,
status: "0"
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.jobId);
this.single = selection.length != 1;
this.multiple = !selection.length;
this.ids = selection.map(item => item.jobId)
this.single = selection.length != 1
this.multiple = !selection.length
},
// 更多操作触发
handleCommand(command, row) {
switch (command) {
case "handleRun":
this.handleRun(row);
break;
this.handleRun(row)
break
case "handleView":
this.handleView(row);
break;
this.handleView(row)
break
case "handleJobLog":
this.handleJobLog(row);
break;
this.handleJobLog(row)
break
default:
break;
break
}
},
// 任务状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
let text = row.status === "0" ? "启用" : "停用"
this.$modal.confirm('确认要"' + text + '""' + row.jobName + '"任务吗?').then(function() {
return changeJobStatus(row.jobId, row.status);
return changeJobStatus(row.jobId, row.status)
}).then(() => {
this.$modal.msgSuccess(text + "成功");
this.$modal.msgSuccess(text + "成功")
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
row.status = row.status === "0" ? "1" : "0"
})
},
/* 立即执行一次 */
handleRun(row) {
this.$modal.confirm('确认要立即执行一次"' + row.jobName + '"任务吗?').then(function() {
return runJob(row.jobId, row.jobGroup);
return runJob(row.jobId, row.jobGroup)
}).then(() => {
this.$modal.msgSuccess("执行成功");
}).catch(() => {});
this.$modal.msgSuccess("执行成功")
}).catch(() => {})
},
/** 任务详细信息 */
handleView(row) {
getJob(row.jobId).then(response => {
this.form = response.data;
this.openView = true;
});
this.form = response.data
this.openView = true
})
},
/** cron表达式按钮操作 */
handleShowCron() {
this.expression = this.form.cronExpression;
this.openCron = true;
this.expression = this.form.cronExpression
this.openCron = true
},
/** 确定后回传值 */
crontabFill(value) {
this.form.cronExpression = value;
this.form.cronExpression = value
},
/** 任务日志列表查询 */
handleJobLog(row) {
const jobId = row.jobId || 0;
const jobId = row.jobId || 0
this.$router.push('/monitor/job-log/index/' + jobId)
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加任务";
this.reset()
this.open = true
this.title = "添加任务"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const jobId = row.jobId || this.ids;
this.reset()
const jobId = row.jobId || this.ids
getJob(jobId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改任务";
});
this.form = response.data
this.open = true
this.title = "修改任务"
})
},
/** 提交按钮 */
submitForm: function() {
@@ -478,29 +478,29 @@ export default {
if (valid) {
if (this.form.jobId != undefined) {
updateJob(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addJob(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const jobIds = row.jobId || this.ids;
const jobIds = row.jobId || this.ids
this.$modal.confirm('是否确认删除定时任务编号为"' + jobIds + '"的数据项?').then(function() {
return delJob(jobIds);
return delJob(jobIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -509,5 +509,5 @@ export default {
}, `job_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@@ -180,8 +180,8 @@
</template>
<script>
import { getJob} from "@/api/monitor/job";
import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog";
import { getJob} from "@/api/monitor/job"
import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog"
export default {
name: "JobLog",
@@ -214,75 +214,75 @@ export default {
jobGroup: undefined,
status: undefined
}
};
}
},
created() {
const jobId = this.$route.params && this.$route.params.jobId;
const jobId = this.$route.params && this.$route.params.jobId
if (jobId !== undefined && jobId != 0) {
getJob(jobId).then(response => {
this.queryParams.jobName = response.data.jobName;
this.queryParams.jobGroup = response.data.jobGroup;
this.getList();
});
this.queryParams.jobName = response.data.jobName
this.queryParams.jobGroup = response.data.jobGroup
this.getList()
})
} else {
this.getList();
this.getList()
}
},
methods: {
/** 查询调度日志列表 */
getList() {
this.loading = true;
this.loading = true
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.jobLogList = response.rows;
this.total = response.total;
this.loading = false;
this.jobLogList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 返回按钮
handleClose() {
const obj = { path: "/monitor/job" };
this.$tab.closeOpenPage(obj);
const obj = { path: "/monitor/job" }
this.$tab.closeOpenPage(obj)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.jobLogId);
this.multiple = !selection.length;
this.ids = selection.map(item => item.jobLogId)
this.multiple = !selection.length
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
this.open = true
this.form = row
},
/** 删除按钮操作 */
handleDelete(row) {
const jobLogIds = this.ids;
const jobLogIds = this.ids
this.$modal.confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?').then(function() {
return delJobLog(jobLogIds);
return delJobLog(jobLogIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 清空按钮操作 */
handleClean() {
this.$modal.confirm('是否确认清空所有调度日志数据项?').then(function() {
return cleanJobLog();
return cleanJobLog()
}).then(() => {
this.getList();
this.$modal.msgSuccess("清空成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("清空成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -291,5 +291,5 @@ export default {
}, `log_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@@ -130,7 +130,7 @@
</template>
<script>
import { list, delLogininfor, cleanLogininfor, unlockLogininfor } from "@/api/monitor/logininfor";
import { list, delLogininfor, cleanLogininfor, unlockLogininfor } from "@/api/monitor/logininfor"
export default {
name: "Logininfor",
@@ -165,32 +165,32 @@ export default {
userName: undefined,
status: undefined
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询登录日志列表 */
getList() {
this.loading = true;
this.loading = true
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
this.list = response.rows
this.total = response.total
this.loading = false
}
);
)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.queryParams.pageNum = 1;
this.dateRange = []
this.resetForm("queryForm")
this.queryParams.pageNum = 1
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
},
/** 多选框选中数据 */
@@ -198,41 +198,41 @@ export default {
this.ids = selection.map(item => item.infoId)
this.single = selection.length!=1
this.multiple = !selection.length
this.selectName = selection.map(item => item.userName);
this.selectName = selection.map(item => item.userName)
},
/** 排序触发事件 */
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
this.queryParams.orderByColumn = column.prop
this.queryParams.isAsc = column.order
this.getList()
},
/** 删除按钮操作 */
handleDelete(row) {
const infoIds = row.infoId || this.ids;
const infoIds = row.infoId || this.ids
this.$modal.confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?').then(function() {
return delLogininfor(infoIds);
return delLogininfor(infoIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 清空按钮操作 */
handleClean() {
this.$modal.confirm('是否确认清空所有登录日志数据项?').then(function() {
return cleanLogininfor();
return cleanLogininfor()
}).then(() => {
this.getList();
this.$modal.msgSuccess("清空成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("清空成功")
}).catch(() => {})
},
/** 解锁按钮操作 */
handleUnlock() {
const username = this.selectName;
const username = this.selectName
this.$modal.confirm('是否确认解锁用户"' + username + '"数据项?').then(function() {
return unlockLogininfor(username);
return unlockLogininfor(username)
}).then(() => {
this.$modal.msgSuccess("用户" + username + "解锁成功");
}).catch(() => {});
this.$modal.msgSuccess("用户" + username + "解锁成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -241,6 +241,6 @@ export default {
}, `logininfor_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@@ -63,7 +63,7 @@
</template>
<script>
import { list, forceLogout } from "@/api/monitor/online";
import { list, forceLogout } from "@/api/monitor/online"
export default {
name: "Online",
@@ -82,41 +82,41 @@ export default {
ipaddr: undefined,
userName: undefined
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询登录日志列表 */
getList() {
this.loading = true;
this.loading = true
list(this.queryParams).then(response => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
});
this.list = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.pageNum = 1;
this.getList();
this.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 强退按钮操作 */
handleForceLogout(row) {
this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户?').then(function() {
return forceLogout(row.tokenId);
return forceLogout(row.tokenId)
}).then(() => {
this.getList();
this.$modal.msgSuccess("强退成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("强退成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@@ -207,7 +207,7 @@
</template>
<script>
import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog";
import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog"
export default {
name: "Operlog",
@@ -244,36 +244,36 @@ export default {
businessType: undefined,
status: undefined
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询登录日志 */
getList() {
this.loading = true;
this.loading = true
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
this.list = response.rows;
this.total = response.total;
this.loading = false;
this.list = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 操作日志类型字典翻译
typeFormat(row, column) {
return this.selectDictLabel(this.dict.type.sys_oper_type, row.businessType);
return this.selectDictLabel(this.dict.type.sys_oper_type, row.businessType)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.queryParams.pageNum = 1;
this.dateRange = []
this.resetForm("queryForm")
this.queryParams.pageNum = 1
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
},
/** 多选框选中数据 */
@@ -283,33 +283,33 @@ export default {
},
/** 排序触发事件 */
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
this.queryParams.orderByColumn = column.prop
this.queryParams.isAsc = column.order
this.getList()
},
/** 详细按钮操作 */
handleView(row) {
this.open = true;
this.form = row;
this.open = true
this.form = row
},
/** 删除按钮操作 */
handleDelete(row) {
const operIds = row.operId || this.ids;
const operIds = row.operId || this.ids
this.$modal.confirm('是否确认删除日志编号为"' + operIds + '"的数据项?').then(function() {
return delOperlog(operIds);
return delOperlog(operIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 清空按钮操作 */
handleClean() {
this.$modal.confirm('是否确认清空所有操作日志数据项?').then(function() {
return cleanOperlog();
return cleanOperlog()
}).then(() => {
this.getList();
this.$modal.msgSuccess("清空成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("清空成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -318,6 +318,6 @@ export default {
}, `operlog_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@@ -176,7 +176,7 @@
</template>
<script>
import { getServer } from "@/api/monitor/server";
import { getServer } from "@/api/monitor/server"
export default {
name: "Server",
@@ -184,24 +184,24 @@ export default {
return {
// 服务器信息
server: []
};
}
},
created() {
this.getList();
this.openLoading();
this.getList()
this.openLoading()
},
methods: {
/** 查询服务器信息 */
getList() {
getServer().then(response => {
this.server = response.data;
this.$modal.closeLoading();
});
this.server = response.data
this.$modal.closeLoading()
})
},
// 打开加载层
openLoading() {
this.$modal.loading("正在加载服务监控数据,请稍候!");
this.$modal.loading("正在加载服务监控数据,请稍候!")
}
}
};
}
</script>

View File

@@ -67,18 +67,18 @@
</template>
<script>
import { getCodeImg, register } from "@/api/login";
import { getCodeImg, register } from "@/api/login"
export default {
name: "Register",
data() {
const equalToPassword = (rule, value, callback) => {
if (this.registerForm.password !== value) {
callback(new Error("两次输入的密码不一致"));
callback(new Error("两次输入的密码不一致"))
} else {
callback();
callback()
}
};
}
return {
title: process.env.VUE_APP_TITLE,
codeUrl: "",
@@ -107,44 +107,44 @@ export default {
},
loading: false,
captchaEnabled: true
};
}
},
created() {
this.getCode();
this.getCode()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled;
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img;
this.registerForm.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.img
this.registerForm.uuid = res.uuid
}
});
})
},
handleRegister() {
this.$refs.registerForm.validate(valid => {
if (valid) {
this.loading = true;
this.loading = true
register(this.registerForm).then(res => {
const username = this.registerForm.username;
const username = this.registerForm.username
this.$alert("<font color='red'>恭喜你,您的账号 " + username + " 注册成功!</font>", '系统提示', {
dangerouslyUseHTMLString: true,
type: 'success'
}).then(() => {
this.$router.push("/login");
}).catch(() => {});
this.$router.push("/login")
}).catch(() => {})
}).catch(() => {
this.loading = false;
this.loading = false
if (this.captchaEnabled) {
this.getCode();
this.getCode()
}
})
}
});
})
}
}
};
}
</script>
<style rel="stylesheet/scss" lang="scss">

View File

@@ -181,7 +181,7 @@
</template>
<script>
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config"
export default {
name: "Config",
@@ -230,26 +230,26 @@ export default {
{ required: true, message: "参数键值不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询参数列表 */
getList() {
this.loading = true;
this.loading = true
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.configList = response.rows;
this.total = response.total;
this.loading = false;
this.configList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -260,25 +260,25 @@ export default {
configValue: undefined,
configType: "Y",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加参数";
this.reset()
this.open = true
this.title = "添加参数"
},
// 多选框选中数据
handleSelectionChange(selection) {
@@ -288,13 +288,13 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const configId = row.configId || this.ids
getConfig(configId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改参数";
});
this.form = response.data
this.open = true
this.title = "修改参数"
})
},
/** 提交按钮 */
submitForm: function() {
@@ -302,29 +302,29 @@ export default {
if (valid) {
if (this.form.configId != undefined) {
updateConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addConfig(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const configIds = row.configId || this.ids;
const configIds = row.configId || this.ids
this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
return delConfig(configIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
return delConfig(configIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -335,9 +335,9 @@ export default {
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
});
this.$modal.msgSuccess("刷新成功")
})
}
}
};
}
</script>

View File

@@ -158,9 +158,9 @@
</template>
<script>
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept"
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
export default {
name: "Dept",
@@ -217,35 +217,35 @@ export default {
}
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询部门列表 */
getList() {
this.loading = true;
this.loading = true
listDept(this.queryParams).then(response => {
this.deptList = this.handleTree(response.data, "deptId");
this.loading = false;
});
this.deptList = this.handleTree(response.data, "deptId")
this.loading = false
})
},
/** 转换部门数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.deptId,
label: node.deptName,
children: node.children
};
}
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -258,53 +258,53 @@ export default {
phone: undefined,
email: undefined,
status: "0"
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.reset()
if (row != undefined) {
this.form.parentId = row.deptId;
this.form.parentId = row.deptId
}
this.open = true;
this.title = "添加部门";
this.open = true
this.title = "添加部门"
listDept().then(response => {
this.deptOptions = this.handleTree(response.data, "deptId");
});
this.deptOptions = this.handleTree(response.data, "deptId")
})
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.refreshTable = false
this.isExpandAll = !this.isExpandAll
this.$nextTick(() => {
this.refreshTable = true;
});
this.refreshTable = true
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
getDept(row.deptId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改部门";
this.form = response.data
this.open = true
this.title = "修改部门"
listDeptExcludeChild(row.deptId).then(response => {
this.deptOptions = this.handleTree(response.data, "deptId");
this.deptOptions = this.handleTree(response.data, "deptId")
if (this.deptOptions.length == 0) {
const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] };
this.deptOptions.push(noResultsOptions);
const noResultsOptions = { deptId: this.form.parentId, deptName: this.form.parentName, children: [] }
this.deptOptions.push(noResultsOptions)
}
});
});
})
})
},
/** 提交按钮 */
submitForm: function() {
@@ -312,29 +312,29 @@ export default {
if (valid) {
if (this.form.deptId != undefined) {
updateDept(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addDept(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.deptName + '"的数据项?').then(function() {
return delDept(row.deptId);
return delDept(row.deptId)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@@ -190,8 +190,8 @@
</template>
<script>
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type";
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data"
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type"
export default {
name: "Data",
@@ -269,41 +269,41 @@ export default {
{ required: true, message: "数据顺序不能为空", trigger: "blur" }
]
}
};
}
},
created() {
const dictId = this.$route.params && this.$route.params.dictId;
this.getType(dictId);
this.getTypeList();
const dictId = this.$route.params && this.$route.params.dictId
this.getType(dictId)
this.getTypeList()
},
methods: {
/** 查询字典类型详细 */
getType(dictId) {
getType(dictId).then(response => {
this.queryParams.dictType = response.data.dictType;
this.defaultDictType = response.data.dictType;
this.getList();
});
this.queryParams.dictType = response.data.dictType
this.defaultDictType = response.data.dictType
this.getList()
})
},
/** 查询字典类型列表 */
getTypeList() {
getDictOptionselect().then(response => {
this.typeOptions = response.data;
});
this.typeOptions = response.data
})
},
/** 查询字典数据列表 */
getList() {
this.loading = true;
this.loading = true
listData(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
this.dataList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -316,31 +316,31 @@ export default {
dictSort: 0,
status: "0",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 返回按钮操作 */
handleClose() {
const obj = { path: "/system/dict" };
this.$tab.closeOpenPage(obj);
const obj = { path: "/system/dict" }
this.$tab.closeOpenPage(obj)
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.queryParams.dictType = this.defaultDictType;
this.handleQuery();
this.resetForm("queryForm")
this.queryParams.dictType = this.defaultDictType
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加字典数据";
this.form.dictType = this.queryParams.dictType;
this.reset()
this.open = true
this.title = "添加字典数据"
this.form.dictType = this.queryParams.dictType
},
// 多选框选中数据
handleSelectionChange(selection) {
@@ -350,13 +350,13 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const dictCode = row.dictCode || this.ids
getData(dictCode).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改字典数据";
});
this.form = response.data
this.open = true
this.title = "修改字典数据"
})
},
/** 提交按钮 */
submitForm: function() {
@@ -364,32 +364,32 @@ export default {
if (valid) {
if (this.form.dictCode != undefined) {
updateData(this.form).then(response => {
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$store.dispatch('dict/removeDict', this.queryParams.dictType)
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addData(this.form).then(response => {
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$store.dispatch('dict/removeDict', this.queryParams.dictType)
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictCodes = row.dictCode || this.ids;
const dictCodes = row.dictCode || this.ids
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
return delData(dictCodes);
return delData(dictCodes)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
this.$store.dispatch('dict/removeDict', this.queryParams.dictType);
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
this.$store.dispatch('dict/removeDict', this.queryParams.dictType)
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -398,5 +398,5 @@ export default {
}, `data_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@@ -188,7 +188,7 @@
</template>
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"
export default {
name: "Dict",
@@ -234,26 +234,26 @@ export default {
{ required: true, message: "字典类型不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询字典类型列表 */
getList() {
this.loading = true;
this.loading = true
listType(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.typeList = response.rows;
this.total = response.total;
this.loading = false;
this.typeList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -263,25 +263,25 @@ export default {
dictType: undefined,
status: "0",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加字典类型";
this.reset()
this.open = true
this.title = "添加字典类型"
},
// 多选框选中数据
handleSelectionChange(selection) {
@@ -291,13 +291,13 @@ export default {
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const dictId = row.dictId || this.ids
getType(dictId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改字典类型";
});
this.form = response.data
this.open = true
this.title = "修改字典类型"
})
},
/** 提交按钮 */
submitForm: function() {
@@ -305,29 +305,29 @@ export default {
if (valid) {
if (this.form.dictId != undefined) {
updateType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
const dictIds = row.dictId || this.ids
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
return delType(dictIds);
return delType(dictIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -338,10 +338,10 @@ export default {
/** 刷新缓存按钮操作 */
handleRefreshCache() {
refreshCache().then(() => {
this.$modal.msgSuccess("刷新成功");
this.$store.dispatch('dict/cleanDict');
});
this.$modal.msgSuccess("刷新成功")
this.$store.dispatch('dict/cleanDict')
})
}
}
};
}
</script>

View File

@@ -299,10 +299,10 @@
</template>
<script>
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import IconSelect from "@/components/IconSelect";
import { listMenu, getMenu, delMenu, addMenu, updateMenu } from "@/api/system/menu"
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
import IconSelect from "@/components/IconSelect"
export default {
name: "Menu",
@@ -345,48 +345,48 @@ export default {
{ required: true, message: "路由地址不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
// 选择图标
selected(name) {
this.form.icon = name;
this.form.icon = name
},
/** 查询菜单列表 */
getList() {
this.loading = true;
this.loading = true
listMenu(this.queryParams).then(response => {
this.menuList = this.handleTree(response.data, "menuId");
this.loading = false;
});
this.menuList = this.handleTree(response.data, "menuId")
this.loading = false
})
},
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.menuId,
label: node.menuName,
children: node.children
};
}
},
/** 查询菜单下拉树结构 */
getTreeselect() {
listMenu().then(response => {
this.menuOptions = [];
const menu = { menuId: 0, menuName: '主类目', children: [] };
menu.children = this.handleTree(response.data, "menuId");
this.menuOptions.push(menu);
});
this.menuOptions = []
const menu = { menuId: 0, menuName: '主类目', children: [] }
menu.children = this.handleTree(response.data, "menuId")
this.menuOptions.push(menu)
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -401,47 +401,47 @@ export default {
isCache: "0",
visible: "0",
status: "0"
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
this.reset()
this.getTreeselect()
if (row != null && row.menuId) {
this.form.parentId = row.menuId;
this.form.parentId = row.menuId
} else {
this.form.parentId = 0;
this.form.parentId = 0
}
this.open = true;
this.title = "添加菜单";
this.open = true
this.title = "添加菜单"
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.refreshTable = false
this.isExpandAll = !this.isExpandAll
this.$nextTick(() => {
this.refreshTable = true;
});
this.refreshTable = true
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
this.reset()
this.getTreeselect()
getMenu(row.menuId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改菜单";
});
this.form = response.data
this.open = true
this.title = "修改菜单"
})
},
/** 提交按钮 */
submitForm: function() {
@@ -449,29 +449,29 @@ export default {
if (valid) {
if (this.form.menuId != undefined) {
updateMenu(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addMenu(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.menuName + '"的数据项?').then(function() {
return delMenu(row.menuId);
return delMenu(row.menuId)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@@ -170,7 +170,7 @@
</template>
<script>
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"
export default {
name: "Notice",
@@ -214,25 +214,25 @@ export default {
{ required: true, message: "公告类型不能为空", trigger: "change" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询公告列表 */
getList() {
this.loading = true;
this.loading = true
listNotice(this.queryParams).then(response => {
this.noticeList = response.rows;
this.total = response.total;
this.loading = false;
});
this.noticeList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -242,18 +242,18 @@ export default {
noticeType: undefined,
noticeContent: undefined,
status: "0"
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@@ -263,19 +263,19 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加公告";
this.reset()
this.open = true
this.title = "添加公告"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const noticeId = row.noticeId || this.ids
getNotice(noticeId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改公告";
});
this.form = response.data
this.open = true
this.title = "修改公告"
})
},
/** 提交按钮 */
submitForm: function() {
@@ -283,30 +283,30 @@ export default {
if (valid) {
if (this.form.noticeId != undefined) {
updateNotice(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addNotice(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const noticeIds = row.noticeId || this.ids
this.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?').then(function() {
return delNotice(noticeIds);
return delNotice(noticeIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@@ -157,7 +157,7 @@
</template>
<script>
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post"
export default {
name: "Post",
@@ -204,25 +204,25 @@ export default {
{ required: true, message: "岗位顺序不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询岗位列表 */
getList() {
this.loading = true;
this.loading = true
listPost(this.queryParams).then(response => {
this.postList = response.rows;
this.total = response.total;
this.loading = false;
});
this.postList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -233,18 +233,18 @@ export default {
postSort: 0,
status: "0",
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@@ -254,19 +254,19 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加岗位";
this.reset()
this.open = true
this.title = "添加岗位"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const postId = row.postId || this.ids
getPost(postId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改岗位";
});
this.form = response.data
this.open = true
this.title = "修改岗位"
})
},
/** 提交按钮 */
submitForm: function() {
@@ -274,29 +274,29 @@ export default {
if (valid) {
if (this.form.postId != undefined) {
updatePost(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addPost(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const postIds = row.postId || this.ids;
const postIds = row.postId || this.ids
this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function() {
return delPost(postIds);
return delPost(postIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -305,5 +305,5 @@ export default {
}, `post_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@@ -100,8 +100,8 @@
</template>
<script>
import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role";
import selectUser from "./selectUser";
import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role"
import selectUser from "./selectUser"
export default {
name: "AuthUser",
@@ -129,40 +129,40 @@ export default {
userName: undefined,
phonenumber: undefined
}
};
}
},
created() {
const roleId = this.$route.params && this.$route.params.roleId;
const roleId = this.$route.params && this.$route.params.roleId
if (roleId) {
this.queryParams.roleId = roleId;
this.getList();
this.queryParams.roleId = roleId
this.getList()
}
},
methods: {
/** 查询授权用户列表 */
getList() {
this.loading = true;
this.loading = true
allocatedUserList(this.queryParams).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
this.userList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
// 返回按钮
handleClose() {
const obj = { path: "/system/role" };
this.$tab.closeOpenPage(obj);
const obj = { path: "/system/role" }
this.$tab.closeOpenPage(obj)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@@ -171,29 +171,29 @@ export default {
},
/** 打开授权用户表弹窗 */
openSelectUser() {
this.$refs.select.show();
this.$refs.select.show()
},
/** 取消授权按钮操作 */
cancelAuthUser(row) {
const roleId = this.queryParams.roleId;
const roleId = this.queryParams.roleId
this.$modal.confirm('确认要取消该用户"' + row.userName + '"角色吗?').then(function() {
return authUserCancel({ userId: row.userId, roleId: roleId });
return authUserCancel({ userId: row.userId, roleId: roleId })
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("取消授权成功")
}).catch(() => {})
},
/** 批量取消授权按钮操作 */
cancelAuthUserAll(row) {
const roleId = this.queryParams.roleId;
const userIds = this.userIds.join(",");
const roleId = this.queryParams.roleId
const userIds = this.userIds.join(",")
this.$modal.confirm('是否取消选中用户授权数据项?').then(function() {
return authUserCancelAll({ roleId: roleId, userIds: userIds });
return authUserCancelAll({ roleId: roleId, userIds: userIds })
}).then(() => {
this.getList();
this.$modal.msgSuccess("取消授权成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("取消授权成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@@ -252,8 +252,8 @@
</template>
<script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
export default {
name: "Role",
@@ -339,85 +339,85 @@ export default {
{ required: true, message: "角色顺序不能为空", trigger: "blur" }
]
}
};
}
},
created() {
this.getList();
this.getList()
},
methods: {
/** 查询角色列表 */
getList() {
this.loading = true;
this.loading = true
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.roleList = response.rows;
this.total = response.total;
this.loading = false;
this.roleList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
/** 查询菜单树结构 */
getMenuTreeselect() {
menuTreeselect().then(response => {
this.menuOptions = response.data;
});
this.menuOptions = response.data
})
},
// 所有菜单节点数据
getMenuAllCheckedKeys() {
// 目前被选中的菜单节点
let checkedKeys = this.$refs.menu.getCheckedKeys();
let checkedKeys = this.$refs.menu.getCheckedKeys()
// 半选中的菜单节点
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
let halfCheckedKeys = this.$refs.menu.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
// 所有部门节点数据
getDeptAllCheckedKeys() {
// 目前被选中的部门节点
let checkedKeys = this.$refs.dept.getCheckedKeys();
let checkedKeys = this.$refs.dept.getCheckedKeys()
// 半选中的部门节点
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys();
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
return checkedKeys;
let halfCheckedKeys = this.$refs.dept.getHalfCheckedKeys()
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys)
return checkedKeys
},
/** 根据角色ID查询菜单树结构 */
getRoleMenuTreeselect(roleId) {
return roleMenuTreeselect(roleId).then(response => {
this.menuOptions = response.menus;
return response;
});
this.menuOptions = response.menus
return response
})
},
/** 根据角色ID查询部门树结构 */
getDeptTree(roleId) {
return deptTreeSelect(roleId).then(response => {
this.deptOptions = response.depts;
return response;
});
this.deptOptions = response.depts
return response
})
},
// 角色状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
let text = row.status === "0" ? "启用" : "停用"
this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function() {
return changeRoleStatus(row.roleId, row.status);
return changeRoleStatus(row.roleId, row.status)
}).then(() => {
this.$modal.msgSuccess(text + "成功");
this.$modal.msgSuccess(text + "成功")
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
row.status = row.status === "0" ? "1" : "0"
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 取消按钮(数据权限)
cancelDataScope() {
this.openDataScope = false;
this.reset();
this.openDataScope = false
this.reset()
},
// 表单重置
reset() {
if (this.$refs.menu != undefined) {
this.$refs.menu.setCheckedKeys([]);
this.$refs.menu.setCheckedKeys([])
}
this.menuExpand = false,
this.menuNodeAll = false,
@@ -434,19 +434,19 @@ export default {
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
@@ -458,141 +458,141 @@ export default {
handleCommand(command, row) {
switch (command) {
case "handleDataScope":
this.handleDataScope(row);
break;
this.handleDataScope(row)
break
case "handleAuthUser":
this.handleAuthUser(row);
break;
this.handleAuthUser(row)
break
default:
break;
break
}
},
// 树权限(展开/折叠)
handleCheckedTreeExpand(value, type) {
if (type == 'menu') {
let treeList = this.menuOptions;
let treeList = this.menuOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value;
this.$refs.menu.store.nodesMap[treeList[i].id].expanded = value
}
} else if (type == 'dept') {
let treeList = this.deptOptions;
let treeList = this.deptOptions
for (let i = 0; i < treeList.length; i++) {
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value;
this.$refs.dept.store.nodesMap[treeList[i].id].expanded = value
}
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll(value, type) {
if (type == 'menu') {
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: []);
this.$refs.menu.setCheckedNodes(value ? this.menuOptions: [])
} else if (type == 'dept') {
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: []);
this.$refs.dept.setCheckedNodes(value ? this.deptOptions: [])
}
},
// 树权限(父子联动)
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? true: false;
this.form.menuCheckStrictly = value ? true: false
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? true: false;
this.form.deptCheckStrictly = value ? true: false
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.getMenuTreeselect();
this.open = true;
this.title = "添加角色";
this.reset()
this.getMenuTreeselect()
this.open = true
this.title = "添加角色"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
const roleId = row.roleId || this.ids
const roleMenu = this.getRoleMenuTreeselect(roleId);
const roleMenu = this.getRoleMenuTreeselect(roleId)
getRole(roleId).then(response => {
this.form = response.data;
this.open = true;
this.form = response.data
this.open = true
this.$nextTick(() => {
roleMenu.then(res => {
let checkedKeys = res.checkedKeys
checkedKeys.forEach((v) => {
this.$nextTick(()=>{
this.$refs.menu.setChecked(v, true ,false);
this.$refs.menu.setChecked(v, true ,false)
})
})
});
});
});
this.title = "修改角色";
})
})
})
this.title = "修改角色"
},
/** 选择角色权限范围触发 */
dataScopeSelectChange(value) {
if(value !== '2') {
this.$refs.dept.setCheckedKeys([]);
this.$refs.dept.setCheckedKeys([])
}
},
/** 分配数据权限操作 */
handleDataScope(row) {
this.reset();
const deptTreeSelect = this.getDeptTree(row.roleId);
this.reset()
const deptTreeSelect = this.getDeptTree(row.roleId)
getRole(row.roleId).then(response => {
this.form = response.data;
this.openDataScope = true;
this.form = response.data
this.openDataScope = true
this.$nextTick(() => {
deptTreeSelect.then(res => {
this.$refs.dept.setCheckedKeys(res.checkedKeys);
});
});
});
this.title = "分配数据权限";
this.$refs.dept.setCheckedKeys(res.checkedKeys)
})
})
})
this.title = "分配数据权限"
},
/** 分配用户操作 */
handleAuthUser: function(row) {
const roleId = row.roleId;
this.$router.push("/system/role-auth/user/" + roleId);
const roleId = row.roleId
this.$router.push("/system/role-auth/user/" + roleId)
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.roleId != undefined) {
this.form.menuIds = this.getMenuAllCheckedKeys();
this.form.menuIds = this.getMenuAllCheckedKeys()
updateRole(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
this.form.menuIds = this.getMenuAllCheckedKeys();
this.form.menuIds = this.getMenuAllCheckedKeys()
addRole(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 提交按钮(数据权限) */
submitDataScope: function() {
if (this.form.roleId != undefined) {
this.form.deptIds = this.getDeptAllCheckedKeys();
this.form.deptIds = this.getDeptAllCheckedKeys()
dataScope(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.openDataScope = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.openDataScope = false
this.getList()
})
}
},
/** 删除按钮操作 */
handleDelete(row) {
const roleIds = row.roleId || this.ids;
const roleIds = row.roleId || this.ids
this.$modal.confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?').then(function() {
return delRole(roleIds);
return delRole(roleIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -601,5 +601,5 @@ export default {
}, `role_${new Date().getTime()}.xlsx`)
}
}
};
}
</script>

View File

@@ -57,7 +57,7 @@
</template>
<script>
import { unallocatedUserList, authUserSelectAll } from "@/api/system/role";
import { unallocatedUserList, authUserSelectAll } from "@/api/system/role"
export default {
dicts: ['sys_normal_disable'],
props: {
@@ -84,53 +84,53 @@ export default {
userName: undefined,
phonenumber: undefined
}
};
}
},
methods: {
// 显示弹框
show() {
this.queryParams.roleId = this.roleId;
this.getList();
this.visible = true;
this.queryParams.roleId = this.roleId
this.getList()
this.visible = true
},
clickRow(row) {
this.$refs.table.toggleRowSelection(row);
this.$refs.table.toggleRowSelection(row)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.userIds = selection.map(item => item.userId);
this.userIds = selection.map(item => item.userId)
},
// 查询表数据
getList() {
unallocatedUserList(this.queryParams).then(res => {
this.userList = res.rows;
this.total = res.total;
});
this.userList = res.rows
this.total = res.total
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 选择授权用户操作 */
handleSelectUser() {
const roleId = this.queryParams.roleId;
const userIds = this.userIds.join(",");
const roleId = this.queryParams.roleId
const userIds = this.userIds.join(",")
if (userIds == "") {
this.$modal.msgError("请选择要分配的用户");
return;
this.$modal.msgError("请选择要分配的用户")
return
}
authUserSelectAll({ roleId: roleId, userIds: userIds }).then(res => {
this.$modal.msgSuccess(res.msg);
this.visible = false;
this.$emit("ok");
});
this.$modal.msgSuccess(res.msg)
this.visible = false
this.$emit("ok")
})
}
}
};
}
</script>

View File

@@ -46,7 +46,7 @@
</template>
<script>
import { getAuthRole, updateAuthRole } from "@/api/system/user";
import { getAuthRole, updateAuthRole } from "@/api/system/user"
export default {
name: "AuthRole",
@@ -64,60 +64,60 @@ export default {
roles: [],
// 用户信息
form: {}
};
}
},
created() {
const userId = this.$route.params && this.$route.params.userId;
const userId = this.$route.params && this.$route.params.userId
if (userId) {
this.loading = true;
this.loading = true
getAuthRole(userId).then((response) => {
this.form = response.user;
this.roles = response.roles;
this.total = this.roles.length;
this.form = response.user
this.roles = response.roles
this.total = this.roles.length
this.$nextTick(() => {
this.roles.forEach((row) => {
if (row.flag) {
this.$refs.table.toggleRowSelection(row);
this.$refs.table.toggleRowSelection(row)
}
});
});
this.loading = false;
});
})
})
this.loading = false
})
}
},
methods: {
/** 单击选中行数据 */
clickRow(row) {
if (this.checkSelectable(row)) {
this.$refs.table.toggleRowSelection(row);
this.$refs.table.toggleRowSelection(row)
}
},
// 多选框选中数据
handleSelectionChange(selection) {
this.roleIds = selection.map((item) => item.roleId);
this.roleIds = selection.map((item) => item.roleId)
},
// 保存选中的数据编号
getRowKey(row) {
return row.roleId;
return row.roleId
},
// 检查角色状态
checkSelectable(row) {
return row.status === "0" ? true : false;
return row.status === "0" ? true : false
},
/** 提交按钮 */
submitForm() {
const userId = this.form.userId;
const roleIds = this.roleIds.join(",");
const userId = this.form.userId
const roleIds = this.roleIds.join(",")
updateAuthRole({ userId: userId, roleIds: roleIds }).then((response) => {
this.$modal.msgSuccess("授权成功");
this.close();
});
this.$modal.msgSuccess("授权成功")
this.close()
})
},
/** 关闭按钮 */
close() {
const obj = { path: "/system/user" };
this.$tab.closeOpenPage(obj);
},
},
};
const obj = { path: "/system/user" }
this.$tab.closeOpenPage(obj)
}
}
}
</script>

View File

@@ -201,12 +201,12 @@
</template>
<script>
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user";
import { getToken } from "@/utils/auth";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { Splitpanes, Pane } from "splitpanes";
import "splitpanes/dist/splitpanes.css";
import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUserStatus, deptTreeSelect } from "@/api/system/user"
import { getToken } from "@/utils/auth"
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
import { Splitpanes, Pane } from "splitpanes"
import "splitpanes/dist/splitpanes.css"
export default {
name: "User",
@@ -315,76 +315,76 @@ export default {
}
]
}
};
}
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
this.$refs.tree.filter(val)
}
},
created() {
this.getList();
this.getDeptTree();
this.getList()
this.getDeptTree()
this.getConfigKey("sys.user.initPassword").then(response => {
this.initPassword = response.msg;
});
this.initPassword = response.msg
})
},
methods: {
/** 查询用户列表 */
getList() {
this.loading = true;
this.loading = true
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
this.userList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then(response => {
this.deptOptions = response.data;
this.enabledDeptOptions = this.filterDisabledDept(JSON.parse(JSON.stringify(response.data)));
});
this.deptOptions = response.data
this.enabledDeptOptions = this.filterDisabledDept(JSON.parse(JSON.stringify(response.data)))
})
},
// 过滤禁用的部门
filterDisabledDept(deptList) {
return deptList.filter(dept => {
if (dept.disabled) {
return false;
return false
}
if (dept.children && dept.children.length) {
dept.children = this.filterDisabledDept(dept.children);
dept.children = this.filterDisabledDept(dept.children)
}
return true;
});
return true
})
},
// 筛选节点
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 节点单击事件
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
this.queryParams.deptId = data.id
this.handleQuery()
},
// 用户状态修改
handleStatusChange(row) {
let text = row.status === "0" ? "启用" : "停用";
let text = row.status === "0" ? "启用" : "停用"
this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() {
return changeUserStatus(row.userId, row.status);
return changeUserStatus(row.userId, row.status)
}).then(() => {
this.$modal.msgSuccess(text + "成功");
this.$modal.msgSuccess(text + "成功")
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
row.status = row.status === "0" ? "1" : "0"
})
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
// 表单重置
reset() {
@@ -401,66 +401,66 @@ export default {
remark: undefined,
postIds: [],
roleIds: []
};
this.resetForm("form");
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.queryParams.deptId = undefined;
this.$refs.tree.setCurrentKey(null);
this.handleQuery();
this.dateRange = []
this.resetForm("queryForm")
this.queryParams.deptId = undefined
this.$refs.tree.setCurrentKey(null)
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.userId);
this.single = selection.length != 1;
this.multiple = !selection.length;
this.ids = selection.map(item => item.userId)
this.single = selection.length != 1
this.multiple = !selection.length
},
// 更多操作触发
handleCommand(command, row) {
switch (command) {
case "handleResetPwd":
this.handleResetPwd(row);
break;
this.handleResetPwd(row)
break
case "handleAuthRole":
this.handleAuthRole(row);
break;
this.handleAuthRole(row)
break
default:
break;
break
}
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.reset()
getUser().then(response => {
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.open = true;
this.title = "添加用户";
this.form.password = this.initPassword;
});
this.postOptions = response.posts
this.roleOptions = response.roles
this.open = true
this.title = "添加用户"
this.form.password = this.initPassword
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const userId = row.userId || this.ids;
this.reset()
const userId = row.userId || this.ids
getUser(userId).then(response => {
this.form = response.data;
this.postOptions = response.posts;
this.roleOptions = response.roles;
this.$set(this.form, "postIds", response.postIds);
this.$set(this.form, "roleIds", response.roleIds);
this.open = true;
this.title = "修改用户";
this.form.password = "";
});
this.form = response.data
this.postOptions = response.posts
this.roleOptions = response.roles
this.$set(this.form, "postIds", response.postIds)
this.$set(this.form, "roleIds", response.roleIds)
this.open = true
this.title = "修改用户"
this.form.password = ""
})
},
/** 重置密码按钮操作 */
handleResetPwd(row) {
@@ -477,14 +477,14 @@ export default {
},
}).then(({ value }) => {
resetUserPwd(row.userId, value).then(response => {
this.$modal.msgSuccess("修改成功,新密码是:" + value);
});
}).catch(() => {});
this.$modal.msgSuccess("修改成功,新密码是:" + value)
})
}).catch(() => {})
},
/** 分配角色操作 */
handleAuthRole: function(row) {
const userId = row.userId;
this.$router.push("/system/user-auth/role/" + userId);
const userId = row.userId
this.$router.push("/system/user-auth/role/" + userId)
},
/** 提交按钮 */
submitForm: function() {
@@ -492,29 +492,29 @@ export default {
if (valid) {
if (this.form.userId != undefined) {
updateUser(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addUser(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
const userIds = row.userId || this.ids
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
return delUser(userIds);
return delUser(userIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
@@ -524,8 +524,8 @@ export default {
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "用户导入";
this.upload.open = true;
this.upload.title = "用户导入"
this.upload.open = true
},
/** 下载模板操作 */
importTemplate() {
@@ -534,20 +534,20 @@ export default {
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.getList();
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
this.getList()
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
this.$refs.upload.submit()
}
}
};
}
</script>

View File

@@ -59,10 +59,10 @@
</template>
<script>
import userAvatar from "./userAvatar";
import userInfo from "./userInfo";
import resetPwd from "./resetPwd";
import { getUserProfile } from "@/api/system/user";
import userAvatar from "./userAvatar"
import userInfo from "./userInfo"
import resetPwd from "./resetPwd"
import { getUserProfile } from "@/api/system/user"
export default {
name: "Profile",
@@ -73,19 +73,19 @@ export default {
roleGroup: {},
postGroup: {},
activeTab: "userinfo"
};
}
},
created() {
this.getUser();
this.getUser()
},
methods: {
getUser() {
getUserProfile().then(response => {
this.user = response.data;
this.roleGroup = response.roleGroup;
this.postGroup = response.postGroup;
});
this.user = response.data
this.roleGroup = response.roleGroup
this.postGroup = response.postGroup
})
}
}
};
}
</script>

View File

@@ -17,17 +17,17 @@
</template>
<script>
import { updateUserPwd } from "@/api/system/user";
import { updateUserPwd } from "@/api/system/user"
export default {
data() {
const equalToPassword = (rule, value, callback) => {
if (this.user.newPassword !== value) {
callback(new Error("两次输入的密码不一致"));
callback(new Error("两次输入的密码不一致"))
} else {
callback();
callback()
}
};
}
return {
user: {
oldPassword: undefined,
@@ -49,21 +49,21 @@ export default {
{ required: true, validator: equalToPassword, trigger: "blur" }
]
}
};
}
},
methods: {
submit() {
this.$refs["form"].validate(valid => {
if (valid) {
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
this.$modal.msgSuccess("修改成功");
});
this.$modal.msgSuccess("修改成功")
})
}
});
})
},
close() {
this.$tab.closePage();
this.$tab.closePage()
}
}
};
}
</script>

View File

@@ -54,9 +54,9 @@
</template>
<script>
import store from "@/store";
import { VueCropper } from "vue-cropper";
import { uploadAvatar } from "@/api/system/user";
import store from "@/store"
import { VueCropper } from "vue-cropper"
import { uploadAvatar } from "@/api/system/user"
import { debounce } from '@/utils'
export default {
@@ -80,16 +80,16 @@ export default {
},
previews: {},
resizeHandler: null
};
}
},
methods: {
// 编辑头像
editCropper() {
this.open = true;
this.open = true
},
// 打开弹出层结束时的回调
modalOpened() {
this.visible = true;
this.visible = true
if (!this.resizeHandler) {
this.resizeHandler = debounce(() => {
this.refresh()
@@ -99,63 +99,63 @@ export default {
},
// 刷新组件
refresh() {
this.$refs.cropper.refresh();
this.$refs.cropper.refresh()
},
// 覆盖默认的上传行为
requestUpload() {
},
// 向左旋转
rotateLeft() {
this.$refs.cropper.rotateLeft();
this.$refs.cropper.rotateLeft()
},
// 向右旋转
rotateRight() {
this.$refs.cropper.rotateRight();
this.$refs.cropper.rotateRight()
},
// 图片缩放
changeScale(num) {
num = num || 1;
this.$refs.cropper.changeScale(num);
num = num || 1
this.$refs.cropper.changeScale(num)
},
// 上传预处理
beforeUpload(file) {
if (file.type.indexOf("image/") == -1) {
this.$modal.msgError("文件格式错误,请上传图片类型,如JPGPNG后缀的文件。");
this.$modal.msgError("文件格式错误,请上传图片类型,如JPGPNG后缀的文件。")
} else {
const reader = new FileReader();
reader.readAsDataURL(file);
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => {
this.options.img = reader.result;
this.options.filename = file.name;
};
this.options.img = reader.result
this.options.filename = file.name
}
}
},
// 上传图片
uploadImg() {
this.$refs.cropper.getCropBlob(data => {
let formData = new FormData();
formData.append("avatarfile", data, this.options.filename);
let formData = new FormData()
formData.append("avatarfile", data, this.options.filename)
uploadAvatar(formData).then(response => {
this.open = false;
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
store.commit('SET_AVATAR', this.options.img);
this.$modal.msgSuccess("修改成功");
this.visible = false;
});
});
this.open = false
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl
store.commit('SET_AVATAR', this.options.img)
this.$modal.msgSuccess("修改成功")
this.visible = false
})
})
},
// 实时预览
realTime(data) {
this.previews = data;
this.previews = data
},
// 关闭窗口
closeDialog() {
this.options.img = store.getters.avatar
this.visible = false;
this.visible = false
window.removeEventListener("resize", this.resizeHandler)
}
}
};
}
</script>
<style scoped lang="scss">
.user-info-head {

View File

@@ -23,7 +23,7 @@
</template>
<script>
import { updateUserProfile } from "@/api/system/user";
import { updateUserProfile } from "@/api/system/user"
export default {
props: {
@@ -56,13 +56,13 @@ export default {
}
]
}
};
}
},
watch: {
user: {
handler(user) {
if (user) {
this.form = { nickName: user.nickName, phonenumber: user.phonenumber, email: user.email, sex: user.sex };
this.form = { nickName: user.nickName, phonenumber: user.phonenumber, email: user.email, sex: user.sex }
}
},
immediate: true
@@ -73,16 +73,16 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
updateUserProfile(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.user.phonenumber = this.form.phonenumber;
this.user.email = this.form.email;
});
this.$modal.msgSuccess("修改成功")
this.user.phonenumber = this.form.phonenumber
this.user.email = this.form.email
})
}
});
})
},
close() {
this.$tab.closePage();
this.$tab.closePage()
}
}
};
}
</script>

View File

@@ -54,7 +54,7 @@ export default {
{ required: true, message: "请输入作者", trigger: "blur" }
]
}
};
}
}
};
}
</script>

View File

@@ -11,7 +11,7 @@
</template>
<script>
import { createTable } from "@/api/tool/gen";
import { createTable } from "@/api/tool/gen"
export default {
data() {
return {
@@ -19,27 +19,27 @@ export default {
visible: false,
// 文本内容
content: ""
};
}
},
methods: {
// 显示弹框
show() {
this.visible = true;
this.visible = true
},
/** 创建按钮操作 */
handleCreateTable() {
if (this.content === "") {
this.$modal.msgError("请输入建表语句");
return;
this.$modal.msgError("请输入建表语句")
return
}
createTable({ sql: this.content }).then(res => {
this.$modal.msgSuccess(res.msg);
this.$modal.msgSuccess(res.msg)
if (res.code === 200) {
this.visible = false;
this.$emit("ok");
this.visible = false
this.$emit("ok")
}
});
})
}
}
};
}
</script>

View File

@@ -127,11 +127,11 @@
</template>
<script>
import { getGenTable, updateGenTable } from "@/api/tool/gen";
import { optionselect as getDictOptionselect } from "@/api/system/dict/type";
import { listMenu as getMenuTreeselect } from "@/api/system/menu";
import basicInfoForm from "./basicInfoForm";
import genInfoForm from "./genInfoForm";
import { getGenTable, updateGenTable } from "@/api/tool/gen"
import { optionselect as getDictOptionselect } from "@/api/system/dict/type"
import { listMenu as getMenuTreeselect } from "@/api/system/menu"
import basicInfoForm from "./basicInfoForm"
import genInfoForm from "./genInfoForm"
import Sortable from 'sortablejs'
export default {
@@ -156,79 +156,79 @@ export default {
menus: [],
// 表详细信息
info: {}
};
}
},
created() {
const tableId = this.$route.params && this.$route.params.tableId;
const tableId = this.$route.params && this.$route.params.tableId
if (tableId) {
// 获取表详细信息
getGenTable(tableId).then(res => {
this.columns = res.data.rows;
this.info = res.data.info;
this.tables = res.data.tables;
});
this.columns = res.data.rows
this.info = res.data.info
this.tables = res.data.tables
})
/** 查询字典下拉列表 */
getDictOptionselect().then(response => {
this.dictOptions = response.data;
});
this.dictOptions = response.data
})
/** 查询菜单下拉列表 */
getMenuTreeselect().then(response => {
this.menus = this.handleTree(response.data, "menuId");
});
this.menus = this.handleTree(response.data, "menuId")
})
}
},
methods: {
/** 提交按钮 */
submitForm() {
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
const genForm = this.$refs.genInfo.$refs.genInfoForm;
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm
const genForm = this.$refs.genInfo.$refs.genInfoForm
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
const validateResult = res.every(item => !!item);
const validateResult = res.every(item => !!item)
if (validateResult) {
const genTable = Object.assign({}, basicForm.model, genForm.model);
genTable.columns = this.columns;
const genTable = Object.assign({}, basicForm.model, genForm.model)
genTable.columns = this.columns
genTable.params = {
treeCode: genTable.treeCode,
treeName: genTable.treeName,
treeParentCode: genTable.treeParentCode,
parentMenuId: genTable.parentMenuId
};
}
updateGenTable(genTable).then(res => {
this.$modal.msgSuccess(res.msg);
this.$modal.msgSuccess(res.msg)
if (res.code === 200) {
this.close();
this.close()
}
});
})
} else {
this.$modal.msgError("表单校验未通过,请重新检查提交内容");
this.$modal.msgError("表单校验未通过,请重新检查提交内容")
}
});
})
},
getFormPromise(form) {
return new Promise(resolve => {
form.validate(res => {
resolve(res);
});
});
resolve(res)
})
})
},
/** 关闭按钮 */
close() {
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } };
this.$tab.closeOpenPage(obj);
const obj = { path: "/tool/gen", query: { t: Date.now(), pageNum: this.$route.query.pageNum } }
this.$tab.closeOpenPage(obj)
}
},
mounted() {
const el = this.$refs.dragTable.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0];
const el = this.$refs.dragTable.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0]
const sortable = Sortable.create(el, {
handle: ".allowDrag",
onEnd: evt => {
const targetRow = this.columns.splice(evt.oldIndex, 1)[0];
this.columns.splice(evt.newIndex, 0, targetRow);
const targetRow = this.columns.splice(evt.oldIndex, 1)[0]
this.columns.splice(evt.newIndex, 0, targetRow)
for (let index in this.columns) {
this.columns[index].sort = parseInt(index) + 1;
this.columns[index].sort = parseInt(index) + 1
}
}
});
})
}
};
}
</script>

View File

@@ -223,8 +223,8 @@
</template>
<script>
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect"
import "@riophae/vue-treeselect/dist/vue-treeselect.css"
export default {
components: { Treeselect },
@@ -240,7 +240,7 @@ export default {
menus: {
type: Array,
default: []
},
}
},
data() {
return {
@@ -260,17 +260,17 @@ export default {
],
functionName: [
{ required: true, message: "请输入生成功能名", trigger: "blur" }
],
]
}
};
}
},
watch: {
'info.subTableName': function(val) {
this.setSubTableColumns(val);
this.setSubTableColumns(val)
},
'info.tplWebType': function(val) {
if (val === '') {
this.info.tplWebType = "element-ui";
this.info.tplWebType = "element-ui"
}
}
},
@@ -278,35 +278,35 @@ export default {
/** 转换菜单数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
delete node.children
}
return {
id: node.menuId,
label: node.menuName,
children: node.children
};
}
},
/** 选择子表名触发 */
subSelectChange(value) {
this.info.subTableFkName = '';
this.info.subTableFkName = ''
},
/** 选择生成模板触发 */
tplSelectChange(value) {
if(value !== 'sub') {
this.info.subTableName = '';
this.info.subTableFkName = '';
this.info.subTableName = ''
this.info.subTableFkName = ''
}
},
/** 设置关联外键 */
setSubTableColumns(value) {
for (var item in this.tables) {
const name = this.tables[item].tableName;
const name = this.tables[item].tableName
if (value === name) {
this.subColumns = this.tables[item].columns;
break;
this.subColumns = this.tables[item].columns
break
}
}
}
}
};
}
</script>

View File

@@ -47,7 +47,7 @@
</template>
<script>
import { listDbTable, importTable } from "@/api/tool/gen";
import { listDbTable, importTable } from "@/api/tool/gen"
export default {
data() {
return {
@@ -66,55 +66,55 @@ export default {
tableName: undefined,
tableComment: undefined
}
};
}
},
methods: {
// 显示弹框
show() {
this.getList();
this.visible = true;
this.getList()
this.visible = true
},
clickRow(row) {
this.$refs.table.toggleRowSelection(row);
this.$refs.table.toggleRowSelection(row)
},
// 多选框选中数据
handleSelectionChange(selection) {
this.tables = selection.map(item => item.tableName);
this.tables = selection.map(item => item.tableName)
},
// 查询表数据
getList() {
listDbTable(this.queryParams).then(res => {
if (res.code === 200) {
this.dbTableList = res.rows;
this.total = res.total;
this.dbTableList = res.rows
this.total = res.total
}
});
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm("queryForm")
this.handleQuery()
},
/** 导入按钮操作 */
handleImportTable() {
const tableNames = this.tables.join(",");
const tableNames = this.tables.join(",")
if (tableNames == "") {
this.$modal.msgError("请选择要导入的表");
return;
this.$modal.msgError("请选择要导入的表")
return
}
importTable({ tables: tableNames }).then(res => {
this.$modal.msgSuccess(res.msg);
this.$modal.msgSuccess(res.msg)
if (res.code === 200) {
this.visible = false;
this.$emit("ok");
this.visible = false
this.$emit("ok")
}
});
})
}
}
};
}
</script>

View File

@@ -170,17 +170,17 @@
</template>
<script>
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
import importTable from "./importTable";
import createTable from "./createTable";
import hljs from "highlight.js/lib/highlight";
import "highlight.js/styles/github-gist.css";
hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml"));
hljs.registerLanguage("html", require("highlight.js/lib/languages/xml"));
hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml"));
hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript"));
hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"
import importTable from "./importTable"
import createTable from "./createTable"
import hljs from "highlight.js/lib/highlight"
import "highlight.js/styles/github-gist.css"
hljs.registerLanguage("java", require("highlight.js/lib/languages/java"))
hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml"))
hljs.registerLanguage("html", require("highlight.js/lib/languages/xml"))
hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml"))
hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript"))
hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"))
export default {
name: "Gen",
@@ -223,125 +223,125 @@ export default {
data: {},
activeName: "domain.java"
}
};
}
},
created() {
this.queryParams.orderByColumn = this.defaultSort.prop;
this.queryParams.isAsc = this.defaultSort.order;
this.getList();
this.queryParams.orderByColumn = this.defaultSort.prop
this.queryParams.isAsc = this.defaultSort.order
this.getList()
},
activated() {
const time = this.$route.query.t;
const time = this.$route.query.t
if (time != null && time != this.uniqueId) {
this.uniqueId = time;
this.queryParams.pageNum = Number(this.$route.query.pageNum);
this.getList();
this.uniqueId = time
this.queryParams.pageNum = Number(this.$route.query.pageNum)
this.getList()
}
},
methods: {
/** 查询表集合 */
getList() {
this.loading = true;
this.loading = true
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.tableList = response.rows;
this.total = response.total;
this.loading = false;
this.tableList = response.rows
this.total = response.total
this.loading = false
}
);
)
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 生成代码操作 */
handleGenTable(row) {
const tableNames = row.tableName || this.tableNames;
const tableNames = row.tableName || this.tableNames
if (tableNames == "") {
this.$modal.msgError("请选择要生成的数据");
return;
this.$modal.msgError("请选择要生成的数据")
return
}
if(row.genType === "1") {
genCode(row.tableName).then(response => {
this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath);
});
this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath)
})
} else {
this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi.zip");
this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi.zip")
}
},
/** 同步数据库操作 */
handleSynchDb(row) {
const tableName = row.tableName;
const tableName = row.tableName
this.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function() {
return synchDb(tableName);
return synchDb(tableName)
}).then(() => {
this.$modal.msgSuccess("同步成功");
}).catch(() => {});
this.$modal.msgSuccess("同步成功")
}).catch(() => {})
},
/** 打开导入表弹窗 */
openImportTable() {
this.$refs.import.show();
this.$refs.import.show()
},
/** 打开创建表弹窗 */
openCreateTable() {
this.$refs.create.show();
this.$refs.create.show()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.queryParams.pageNum = 1;
this.dateRange = []
this.resetForm("queryForm")
this.queryParams.pageNum = 1
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
},
/** 预览按钮 */
handlePreview(row) {
previewTable(row.tableId).then(response => {
this.preview.data = response.data;
this.preview.open = true;
this.preview.activeName = "domain.java";
});
this.preview.data = response.data
this.preview.open = true
this.preview.activeName = "domain.java"
})
},
/** 高亮显示 */
highlightedCode(code, key) {
const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm"));
var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length);
const result = hljs.highlight(language, code || "", true);
return result.value || '&nbsp;';
const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm"))
var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length)
const result = hljs.highlight(language, code || "", true)
return result.value || '&nbsp;'
},
/** 复制代码成功 */
clipboardSuccess() {
this.$modal.msgSuccess("复制成功");
this.$modal.msgSuccess("复制成功")
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.tableId);
this.tableNames = selection.map(item => item.tableName);
this.single = selection.length != 1;
this.multiple = !selection.length;
this.ids = selection.map(item => item.tableId)
this.tableNames = selection.map(item => item.tableName)
this.single = selection.length != 1
this.multiple = !selection.length
},
/** 排序触发事件 */
handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order;
this.getList();
this.queryParams.orderByColumn = column.prop
this.queryParams.isAsc = column.order
this.getList()
},
/** 修改按钮操作 */
handleEditTable(row) {
const tableId = row.tableId || this.ids[0];
const tableName = row.tableName || this.tableNames[0];
const params = { pageNum: this.queryParams.pageNum };
this.$tab.openPage("修改[" + tableName + "]生成配置", '/tool/gen-edit/index/' + tableId, params);
const tableId = row.tableId || this.ids[0]
const tableName = row.tableName || this.tableNames[0]
const params = { pageNum: this.queryParams.pageNum }
this.$tab.openPage("修改[" + tableName + "]生成配置", '/tool/gen-edit/index/' + tableId, params)
},
/** 删除按钮操作 */
handleDelete(row) {
const tableIds = row.tableId || this.ids;
const tableIds = row.tableId || this.ids
this.$modal.confirm('是否确认删除表编号为"' + tableIds + '"的数据项?').then(function() {
return delTable(tableIds);
return delTable(tableIds)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
}
}
};
}
</script>

View File

@@ -2,14 +2,14 @@
<i-frame :src="url" />
</template>
<script>
import iFrame from "@/components/iFrame/index";
import iFrame from "@/components/iFrame/index"
export default {
name: "Swagger",
components: { iFrame },
data() {
return {
url: process.env.VUE_APP_BASE_API + "/swagger-ui/index.html"
};
},
};
}
}
}
</script>