feat: 合并Gin_Vue
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
VITE_HISTORY_HASH = false
|
||||
|
||||
# 历史路径-前缀URL如:/h5
|
||||
VITE_HISTORY_BASE_URL = '/'
|
||||
VITE_HISTORY_BASE_URL = "/"
|
||||
|
||||
# 应用名称
|
||||
VITE_APP_NAME = '核心网管理系统'
|
||||
VITE_APP_NAME = "核心网管理系统"
|
||||
|
||||
# 应用标识
|
||||
VITE_APP_CODE = 'CoreNet'
|
||||
VITE_APP_CODE = "CoreNet"
|
||||
|
||||
# 应用版本
|
||||
VITE_APP_VERSION = '0.0.1'
|
||||
VITE_APP_VERSION = "1.23.0"
|
||||
|
||||
# 接口基础URL地址-不带/后缀
|
||||
VITE_API_BASE_URL = '/dev-api'
|
||||
VITE_API_BASE_URL = "/omc-api"
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
VITE_HISTORY_HASH = true
|
||||
|
||||
# 历史路径-前缀URL如:/h5
|
||||
VITE_HISTORY_BASE_URL = '/'
|
||||
VITE_HISTORY_BASE_URL = "/"
|
||||
|
||||
# 应用名称
|
||||
VITE_APP_NAME = '核心网管理系统'
|
||||
VITE_APP_NAME = "核心网管理系统"
|
||||
|
||||
# 应用标识
|
||||
VITE_APP_CODE = 'CoreNet'
|
||||
VITE_APP_CODE = "CoreNet"
|
||||
|
||||
# 应用版本
|
||||
VITE_APP_VERSION = '0.0.1'
|
||||
VITE_APP_VERSION = "1.23.1016"
|
||||
|
||||
# 接口基础URL地址-不带/后缀
|
||||
VITE_API_BASE_URL = '/prod-api'
|
||||
VITE_API_BASE_URL = "/omc-api"
|
||||
|
||||
|
||||
15
public/config.js
Normal file
15
public/config.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* config 临时配置参数
|
||||
*/
|
||||
(function () {
|
||||
// host = ip:prot
|
||||
const host = "192.168.12.12:3030";
|
||||
|
||||
// 服务地址
|
||||
const baseUrl = `http://${host}`
|
||||
sessionStorage.setItem("baseUrl", baseUrl)
|
||||
|
||||
// websocket
|
||||
const wsUrl = `ws://${host}`
|
||||
sessionStorage.setItem("wsUrl", wsUrl)
|
||||
})();
|
||||
@@ -6,8 +6,10 @@ import enUS from 'ant-design-vue/lib/locale/en_US';
|
||||
import dayjs from 'dayjs';
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import { ref, watch } from 'vue';
|
||||
import useAppStore from '@/store/modules/app';
|
||||
import useI18n from '@/hooks/useI18n';
|
||||
const { currentLocale } = useI18n();
|
||||
const appStore = useAppStore();
|
||||
|
||||
dayjs.locale('zh-cn'); // 默认中文
|
||||
usePrimaryColor(); // 载入用户自定义主题色
|
||||
@@ -33,6 +35,13 @@ fnChangeLocale(currentLocale.value);
|
||||
watch(currentLocale, val => {
|
||||
fnChangeLocale(val);
|
||||
});
|
||||
|
||||
// 输出应用版本号
|
||||
console.info(
|
||||
`%c ${appStore.appName} %c ${appStore.appCode} - ${appStore.appVersion} `,
|
||||
'color: #fadfa3; background: #030307; padding: 4px 0;',
|
||||
'color: #030307; background: #fadfa3; padding: 4px 0;'
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function listNeBackup(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/ne_backup`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/ne_backup`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
@@ -61,7 +61,7 @@ export async function listNeBackup(query: Record<string, any>) {
|
||||
*/
|
||||
export async function delNeBackup(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/${data.neType}/neBackup/${data.fileName}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/neBackup/${data.fileName}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -73,7 +73,7 @@ export async function delNeBackup(data: Record<string, any>) {
|
||||
*/
|
||||
export async function downloadNeBackup(data: Record<string, any>) {
|
||||
return await request({
|
||||
url: `/systemManagement/v1/${data.neType}/neBackup/${data.fileName}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/neBackup/${data.fileName}`,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function getConfigInfo(tag: string) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = '${tag}'`,
|
||||
@@ -37,7 +37,7 @@ export async function getConfigInfo(tag: string) {
|
||||
*/
|
||||
export async function updateConfig(tag: string, data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='${tag}'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='${tag}'`,
|
||||
method: 'put',
|
||||
data: { data },
|
||||
});
|
||||
|
||||
@@ -15,7 +15,7 @@ import { parseFirstLower, parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function getParamConfigTopTab(neType: string) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/param_config`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/param_config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT top_display,top_tag FROM param_config WHERE ne_type = '${neType}'`,
|
||||
@@ -45,7 +45,7 @@ export async function getParamConfigTopTab(neType: string) {
|
||||
export async function getParamConfigTopTabJson(neType: string, topTag: string) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/param_config`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/param_config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT param_json FROM param_config WHERE ne_type = '${neType}' AND top_tag='${topTag}'`,
|
||||
@@ -82,7 +82,7 @@ export async function getParamConfigInfo(
|
||||
const { wrRule, dataArr } = await Promise.allSettled([
|
||||
// 获取参数规则
|
||||
request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/param_config`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/param_config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT param_json FROM param_config WHERE ne_type = '${neType}' AND top_tag='${topTag}'`,
|
||||
@@ -90,7 +90,7 @@ export async function getParamConfigInfo(
|
||||
}),
|
||||
// 获取对应信息
|
||||
request({
|
||||
url: `/systemManagement/v1/elementType/${neType.toLowerCase()}/objectType/config/${topTag}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${neType.toLowerCase()}/objectType/config/${topTag}`,
|
||||
method: 'get',
|
||||
params: {
|
||||
ne_id: neId,
|
||||
@@ -284,7 +284,7 @@ export async function getParamConfigInfoChild(
|
||||
) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/elementType/${neType.toLowerCase()}/objectType/config/${topTag}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${neType.toLowerCase()}/objectType/config/${topTag}`,
|
||||
method: 'get',
|
||||
params: {
|
||||
ne_id: neId,
|
||||
@@ -311,7 +311,7 @@ export function updateParamConfigInfo(
|
||||
args: Record<string, any>,
|
||||
data: Record<string, any>
|
||||
) {
|
||||
let url = `/systemManagement/v1/elementType/${args.neType.toLowerCase()}/objectType/config/${
|
||||
let url = `/api/rest/systemManagement/v1/elementType/${args.neType.toLowerCase()}/objectType/config/${
|
||||
args.topTag
|
||||
}?ne_id=${args.neId}`;
|
||||
|
||||
@@ -338,7 +338,7 @@ export function addParamConfigInfo(
|
||||
data: Record<string, any>
|
||||
) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${args.neType.toLowerCase()}/objectType/config/${
|
||||
url: `/api/rest/systemManagement/v1/elementType/${args.neType.toLowerCase()}/objectType/config/${
|
||||
args.topTag
|
||||
}?ne_id=${args.neId}&loc=${args.loc}`,
|
||||
method: 'post',
|
||||
@@ -355,7 +355,7 @@ export function addParamConfigInfo(
|
||||
*/
|
||||
export function delParamConfigInfo(args: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${args.neType.toLowerCase()}/objectType/config/${
|
||||
url: `/api/rest/systemManagement/v1/elementType/${args.neType.toLowerCase()}/objectType/config/${
|
||||
args.topTag
|
||||
}?ne_id=${args.neId}&loc=${args.loc}`,
|
||||
method: 'delete',
|
||||
@@ -371,7 +371,7 @@ export function delParamConfigInfo(args: Record<string, any>) {
|
||||
export async function updateNeConfigReload(neType: string, neId: string) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/operationManagement/v1/elementType/${neType}/objectType/mml?ne_id=${neId}`,
|
||||
url: `/api/rest/operationManagement/v1/elementType/${neType}/objectType/mml?ne_id=${neId}`,
|
||||
method: 'post',
|
||||
data: { mml: ['reload'] },
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/ne_license`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/ne_license`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
@@ -67,7 +67,7 @@ import {
|
||||
*/
|
||||
export async function downloadNeSoftware(data: Record<string, any>) {
|
||||
return await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}`,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
@@ -80,7 +80,7 @@ import {
|
||||
*/
|
||||
export function uploadLicense(data: FormData) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.get('nfType')}/objectType/license?neId=${data.get('nfId')}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.get('nfType')}/objectType/license?neId=${data.get('nfId')}`,
|
||||
method: 'post',
|
||||
data,
|
||||
dataType: 'form-data',
|
||||
@@ -94,7 +94,7 @@ import {
|
||||
*/
|
||||
export async function sendNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
// 解析数据
|
||||
@@ -117,7 +117,7 @@ import {
|
||||
*/
|
||||
export async function runNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'put',
|
||||
});
|
||||
// 解析数据
|
||||
@@ -140,7 +140,7 @@ import {
|
||||
*/
|
||||
export async function backNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'patch',
|
||||
});
|
||||
// 解析数据
|
||||
@@ -183,7 +183,7 @@ import {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/ne_version`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/ne_version`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function listNeInfo(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/ne_info`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/ne_info`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
@@ -62,7 +62,7 @@ export async function listNeInfo(query: Record<string, any>) {
|
||||
export async function getNeInfo(id: string | number) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/ne_info`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/ne_info`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `select * from ne_info where status=0 and id = ${id}`,
|
||||
@@ -86,7 +86,7 @@ export async function getNeInfo(id: string | number) {
|
||||
export function addNeInfo(data: Record<string, any>) {
|
||||
data.port = `${data.port}`;
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/neInfo`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo`,
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -100,7 +100,7 @@ export function addNeInfo(data: Record<string, any>) {
|
||||
export function updateNeInfo(data: Record<string, any>) {
|
||||
data.port = `${data.port}`;
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/neInfo`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo`,
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -113,7 +113,7 @@ export function updateNeInfo(data: Record<string, any>) {
|
||||
*/
|
||||
export async function delNeInfo(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/neInfo?ne_id=${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/neInfo?ne_id=${data.neId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -125,7 +125,7 @@ export async function delNeInfo(data: Record<string, any>) {
|
||||
export async function getNelistAll() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/ne_info`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/ne_info`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT ne_type,ne_name,ne_id,ip FROM ne_info WHERE status = 0`,
|
||||
@@ -148,7 +148,7 @@ export async function getNelistAll() {
|
||||
*/
|
||||
export function exportSet(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/cm?ne_id=${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/cm?ne_id=${data.neId}`,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
headers: {
|
||||
@@ -165,7 +165,7 @@ export function exportSet(data: Record<string, any>) {
|
||||
*/
|
||||
export function startNf(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/service/start?ne_id=${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/service/start?ne_id=${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
@@ -177,7 +177,7 @@ export function startNf(data: Record<string, any>) {
|
||||
*/
|
||||
export function restartNf(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/service/restart?ne_id=${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/service/restart?ne_id=${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
@@ -189,7 +189,7 @@ export function restartNf(data: Record<string, any>) {
|
||||
*/
|
||||
export function stopNf(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/elementType/${data.neType}/objectType/service/stop?ne_id=${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/elementType/${data.neType}/objectType/service/stop?ne_id=${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export async function listNeSoftware(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/ne_software`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/ne_software`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
@@ -65,7 +65,7 @@ export async function listNeSoftware(query: Record<string, any>) {
|
||||
*/
|
||||
export async function delNeSoftware(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -77,7 +77,7 @@ export async function delNeSoftware(data: Record<string, any>) {
|
||||
*/
|
||||
export async function downloadNeSoftware(data: Record<string, any>) {
|
||||
return await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}`,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
@@ -90,7 +90,7 @@ export async function downloadNeSoftware(data: Record<string, any>) {
|
||||
*/
|
||||
export function uploadNeSoftware(data: FormData) {
|
||||
return request({
|
||||
url: `/systemManagement/v1/${data.get('nf')}/software/${data.get(
|
||||
url: `/api/rest/systemManagement/v1/${data.get('nf')}/software/${data.get(
|
||||
'version'
|
||||
)}`,
|
||||
method: 'post',
|
||||
@@ -106,7 +106,7 @@ export function uploadNeSoftware(data: FormData) {
|
||||
*/
|
||||
export async function sendNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'post',
|
||||
});
|
||||
// 解析数据
|
||||
@@ -129,7 +129,7 @@ export async function sendNeSoftware(data: Record<string, any>) {
|
||||
*/
|
||||
export async function runNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'put',
|
||||
});
|
||||
// 解析数据
|
||||
@@ -152,7 +152,7 @@ export async function runNeSoftware(data: Record<string, any>) {
|
||||
*/
|
||||
export async function backNeSoftware(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
url: `/api/rest/systemManagement/v1/${data.neType}/software/${data.version}/${data.neId}`,
|
||||
method: 'patch',
|
||||
});
|
||||
// 解析数据
|
||||
@@ -195,7 +195,7 @@ export async function listNeVersion(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/ne_version`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/ne_version`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { toRaw } from 'vue';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { ConsoleSqlOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
@@ -40,7 +38,7 @@ export async function listAct(query: Record<string, any>, filterSQl: string) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/alarm`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: totalSQL + querySQL,
|
||||
@@ -88,7 +86,7 @@ export function updateConfirm(data: Record<string, any>) {
|
||||
};
|
||||
|
||||
return request({
|
||||
url: `/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`,
|
||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`,
|
||||
method: 'put',
|
||||
data: finalData,
|
||||
});
|
||||
@@ -111,7 +109,7 @@ export function cancelConfirm(data: (string | number)[]) {
|
||||
};
|
||||
|
||||
return request({
|
||||
url: `/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
||||
','
|
||||
)})`,
|
||||
method: 'put',
|
||||
@@ -145,7 +143,7 @@ export function showPass(data: Record<string, any>) {
|
||||
};
|
||||
|
||||
return request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='displayFilter'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='displayFilter'`,
|
||||
method: 'put',
|
||||
data: toBackJson,
|
||||
});
|
||||
@@ -157,7 +155,7 @@ export function showPass(data: Record<string, any>) {
|
||||
*/
|
||||
export function getPass() {
|
||||
return request({
|
||||
url: `/databaseManagement/v1/select/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: "SELECT value_json,value FROM config WHERE config_tag ='displayFilter'",
|
||||
@@ -183,7 +181,7 @@ export function clearAlarm(data: Record<string, any>) {
|
||||
};
|
||||
|
||||
return request({
|
||||
url: `/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
||||
','
|
||||
)})`,
|
||||
method: 'put',
|
||||
@@ -198,7 +196,7 @@ export function clearAlarm(data: Record<string, any>) {
|
||||
*/
|
||||
export function listSync() {
|
||||
return request({
|
||||
url: `/faultManagement/v1/elementType/all/objectType/alarms`,
|
||||
url: `/api/rest/faultManagement/v1/elementType/all/objectType/alarms`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -232,7 +230,7 @@ export async function exportAll(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/alarm`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`,
|
||||
method: 'get',
|
||||
params: {
|
||||
rowsSQL: rowsSQL + querySQL,
|
||||
|
||||
@@ -17,7 +17,7 @@ export async function getAlarmSet() {
|
||||
|
||||
// 历史告警保存时间
|
||||
const logDurationResult = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'historyDuration'`,
|
||||
@@ -26,7 +26,7 @@ export async function getAlarmSet() {
|
||||
arr.push(logDurationResult);
|
||||
// 同步设置
|
||||
const logCapacityResult = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'syncTaskPeriod'`,
|
||||
@@ -43,20 +43,21 @@ export async function getAlarmSet() {
|
||||
}
|
||||
const itemV = item.value;
|
||||
// 解析数据
|
||||
if ( itemV.code === RESULT_CODE_SUCCESS &&Array.isArray(itemV.data.data))
|
||||
{
|
||||
if (
|
||||
itemV.code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(itemV.data.data)
|
||||
) {
|
||||
let itemData = itemV.data.data[0];
|
||||
const v = parseObjLineToHump(itemData['config'][0]);
|
||||
let vJSON:any ={};
|
||||
if(v.configTag=='syncTaskPeriod'){
|
||||
try{
|
||||
vJSON=JSON.parse(v.valueJson);
|
||||
}
|
||||
catch(error){
|
||||
let vJSON: any = {};
|
||||
if (v.configTag == 'syncTaskPeriod') {
|
||||
try {
|
||||
vJSON = JSON.parse(v.valueJson);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
resultData={...resultData,...vJSON};
|
||||
}else{
|
||||
resultData = { ...resultData, ...vJSON };
|
||||
} else {
|
||||
resultData[v.configTag] = parseInt(v.value);
|
||||
}
|
||||
}
|
||||
@@ -80,21 +81,18 @@ export async function getAlarmSet() {
|
||||
*/
|
||||
export async function updateAlarmSet(data: Record<string, any>) {
|
||||
let { historyDuration, ...syncTaskPeriodJson } = data;
|
||||
|
||||
let historyDurationJson = { historyDuration };
|
||||
|
||||
let arr = [];
|
||||
|
||||
// 历史告警保存时间
|
||||
const historyDurationResult = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='historyDuration'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='historyDuration'`,
|
||||
method: 'put',
|
||||
data: { data: { value: data.historyDuration.toString() } },
|
||||
});
|
||||
arr.push(historyDurationResult);
|
||||
// 同步设置
|
||||
const syncTaskPeriodResult = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='syncTaskPeriod'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='syncTaskPeriod'`,
|
||||
method: 'put',
|
||||
data: { data: { value_json: JSON.stringify(syncTaskPeriodJson) } },
|
||||
});
|
||||
@@ -138,7 +136,7 @@ export async function updateAlarmSet(data: Record<string, any>) {
|
||||
export async function getForwardSet() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'forwardAlarm'`,
|
||||
@@ -169,7 +167,7 @@ export async function getForwardSet() {
|
||||
export async function updateForwardSet(data: Record<string, any>) {
|
||||
// return false;
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='forwardAlarm'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='forwardAlarm'`,
|
||||
method: 'put',
|
||||
data: { data: { value_json: JSON.stringify(data) } },
|
||||
});
|
||||
@@ -185,12 +183,3 @@ export async function updateForwardSet(data: Record<string, any>) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { ConsoleSqlOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
@@ -39,7 +38,7 @@ export async function listAct(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/alarm`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: totalSQL + querySQL,
|
||||
@@ -87,7 +86,7 @@ export function updateConfirm(data: Record<string, any>) {
|
||||
};
|
||||
|
||||
return request({
|
||||
url: `/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`,
|
||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id='${data.id}'`,
|
||||
method: 'put',
|
||||
data: finalData,
|
||||
});
|
||||
@@ -100,7 +99,6 @@ export function updateConfirm(data: Record<string, any>) {
|
||||
*/
|
||||
export function cancelConfirm(data: (string | number)[]) {
|
||||
var time = new Date();
|
||||
const userName = useUserStore().userName;
|
||||
let finalData = {
|
||||
alarm: {
|
||||
ack_time: parseDateToStr(time),
|
||||
@@ -110,7 +108,7 @@ export function cancelConfirm(data: (string | number)[]) {
|
||||
};
|
||||
|
||||
return request({
|
||||
url: `/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
||||
url: `/api/rest/databaseManagement/v1/update/omc_db/alarm?WHERE=id in(${data.join(
|
||||
','
|
||||
)})`,
|
||||
method: 'put',
|
||||
@@ -118,10 +116,6 @@ export function cancelConfirm(data: (string | number)[]) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 历史告警导出
|
||||
* @param query 查询参数
|
||||
@@ -151,14 +145,13 @@ export async function exportAll(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/alarm`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm`,
|
||||
method: 'get',
|
||||
params: {
|
||||
rowsSQL: rowsSQL + querySQL,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if (result.code === RESULT_CODE_SUCCESS) {
|
||||
let v = result.data.data[0];
|
||||
const vArr = parseObjLineToHump(v['alarm']);
|
||||
@@ -166,4 +159,3 @@ export async function exportAll(query: Record<string, any>) {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { parseDateToStr } from '@/utils/date-utils';
|
||||
*/
|
||||
export async function listMain() {
|
||||
const result = await request({
|
||||
url: 'systemManagement/v1/elementType/all/objectType/systemState',
|
||||
url: '/api/rest/systemManagement/v1/elementType/all/objectType/systemState',
|
||||
method: 'get',
|
||||
});
|
||||
// console.log(result);
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function listAlarm(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/alarm_log`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_log`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function listForwarding(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/alarm_forward_log`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/alarm_forward_log`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
|
||||
@@ -17,7 +17,7 @@ export async function getLogSet() {
|
||||
|
||||
// 日志保存时间
|
||||
const logDurationResult = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'logDuration'`,
|
||||
@@ -26,7 +26,7 @@ export async function getLogSet() {
|
||||
arr.push(logDurationResult);
|
||||
// 日志最大容量
|
||||
const logCapacityResult = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'logCapacity'`,
|
||||
@@ -75,7 +75,7 @@ export async function updateLogSet(data: Record<string, any>) {
|
||||
for (const key in data) {
|
||||
const value = `${data[key]}`;
|
||||
const result = request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='${key}'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='${key}'`,
|
||||
method: 'put',
|
||||
data: { data: { value } },
|
||||
});
|
||||
@@ -119,7 +119,7 @@ export async function updateLogSet(data: Record<string, any>) {
|
||||
export async function getFtpLogSet() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'ftpLogSet'`,
|
||||
@@ -150,7 +150,7 @@ export async function getFtpLogSet() {
|
||||
*/
|
||||
export async function updateFtpLogSet(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='ftpLogSet'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='ftpLogSet'`,
|
||||
method: 'put',
|
||||
data: { data: { value_json: JSON.stringify(data) } },
|
||||
});
|
||||
@@ -175,7 +175,7 @@ export async function updateFtpLogSet(data: Record<string, any>) {
|
||||
export async function getRemoteOut() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'remoteLogSet'`,
|
||||
@@ -205,7 +205,7 @@ export async function getRemoteOut() {
|
||||
*/
|
||||
export async function updateRemoteOut(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='remoteLogSet'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='remoteLogSet'`,
|
||||
method: 'put',
|
||||
data: { data: { value_json: JSON.stringify(data) } },
|
||||
});
|
||||
@@ -253,7 +253,7 @@ export async function exportLog(query: Record<string, any>) {
|
||||
}
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/${query.logType}`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/${query.logType}`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: querySQL,
|
||||
@@ -276,7 +276,7 @@ export async function exportLog(query: Record<string, any>) {
|
||||
*/
|
||||
export async function backupLog(logType: string) {
|
||||
const result = await request({
|
||||
url: `/dataManagement/v1/omc_db/${logType}/backup`,
|
||||
url: `/api/rest/dataManagement/v1/omc_db/${logType}/backup`,
|
||||
method: 'post',
|
||||
});
|
||||
// 解析数据
|
||||
@@ -299,7 +299,7 @@ export async function backupLog(logType: string) {
|
||||
*/
|
||||
export async function backupDownload(path: string) {
|
||||
return request({
|
||||
url: `/fileManagement/v1/path/file?path=${path}`,
|
||||
url: `/api/rest/fileManagement/v1/path/file?path=${path}`,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
@@ -312,7 +312,7 @@ export async function backupDownload(path: string) {
|
||||
*/
|
||||
export function backupFileList() {
|
||||
return request({
|
||||
url: `/fileManagement/v1/files/listFiles`,
|
||||
url: `/api/rest/fileManagement/v1/files/listFiles`,
|
||||
method: 'post',
|
||||
data: {
|
||||
path: '/usr/local/omc/database',
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function listMML(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/mml_log`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/mml_log`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function listOperationLog(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/operation_log`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/operation_log`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function listSecurityLog(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/security_log`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/security_log`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
// 登录方法
|
||||
export function login(data: Record<string, string>) {
|
||||
return request({
|
||||
url: '/securityManagement/v1/login',
|
||||
url: '/login',
|
||||
method: 'post',
|
||||
data: data,
|
||||
whithToken: false,
|
||||
@@ -30,7 +30,7 @@ export function register(data: Record<string, any>) {
|
||||
*/
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: '/securityManagement/v1/getUserInfo',
|
||||
url: '/getInfo',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -41,8 +41,8 @@ export function getInfo() {
|
||||
*/
|
||||
export function logout() {
|
||||
return request({
|
||||
url: '/securityManagement/v1/oauth/token',
|
||||
method: 'delete',
|
||||
url: '/logout',
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export function logout() {
|
||||
*/
|
||||
export function getCaptchaImage() {
|
||||
return request({
|
||||
url: '/securityManagement/v1/captchaImage',
|
||||
url: '/captchaImage',
|
||||
method: 'get',
|
||||
whithToken: false,
|
||||
});
|
||||
|
||||
@@ -2,7 +2,6 @@ import {
|
||||
RESULT_CODE_ERROR,
|
||||
RESULT_CODE_SUCCESS,
|
||||
RESULT_MSG_ERROR,
|
||||
RESULT_MSG_SUCCESS,
|
||||
} from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
@@ -15,7 +14,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function getOperationSet() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT * FROM config WHERE config_tag = 'operationSet'`,
|
||||
@@ -45,7 +44,7 @@ export async function getOperationSet() {
|
||||
*/
|
||||
export async function updateOperationSet(data: Record<string, any>) {
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/config?WHERE=config_tag='operationSet'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/config?WHERE=config_tag='operationSet'`,
|
||||
method: 'put',
|
||||
data: { data: { value_json: JSON.stringify(data) } },
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function getMMLByNE(neType: string) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/mml_system`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/mml_system`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `select * from mml_system where ne_type = '${neType}'`,
|
||||
@@ -40,7 +40,7 @@ export async function sendMMlByNE(
|
||||
) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/operationManagement/v1/elementType/${neType}/objectType/mml?ne_id=${neId}`,
|
||||
url: `/api/rest/operationManagement/v1/elementType/${neType}/objectType/mml?ne_id=${neId}`,
|
||||
method: 'post',
|
||||
data: { mml: [cmdStr] },
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function getMMLByOMC() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/mml_command`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/mml_command`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `select * from mml_command where ne_type = 'OMC'`,
|
||||
@@ -34,7 +34,7 @@ export async function getMMLByOMC() {
|
||||
export async function sendMMlByOMC(neId: string, cmdStr: string) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/operationManagement/v1/elementType/OMC/objectType/mml?ne_id=${neId}`,
|
||||
url: `/api/rest/operationManagement/v1/elementType/OMC/objectType/mml?ne_id=${neId}`,
|
||||
method: 'post',
|
||||
data: { mml: [cmdStr] },
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function getMMLByUDM() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/mml_subscriber`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/mml_subscriber`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `select * from mml_subscriber where ne_type = 'UDM'`,
|
||||
@@ -37,7 +37,7 @@ export async function sendMMlByUDM(
|
||||
) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/operationManagement/v1/elementType/UDM/objectType/mml?ne_id=${neId}`,
|
||||
url: `/api/rest/operationManagement/v1/elementType/UDM/objectType/mml?ne_id=${neId}`,
|
||||
method: 'post',
|
||||
data: { mml: [cmdStr] },
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function listSession(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/session`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/session`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
@@ -76,7 +76,7 @@ export async function listSession(query: Record<string, any>) {
|
||||
*/
|
||||
export async function logoutSession(id: string) {
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/session?WHERE=id='${id}'`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/session?WHERE=id='${id}'`,
|
||||
method: 'delete',
|
||||
});
|
||||
// 解析数据
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
|
||||
/**获取服务信息 */
|
||||
export function getServer() {
|
||||
/**服务器服务信息 */
|
||||
export function getSystemInfo() {
|
||||
return request({
|
||||
url: '/monitor/server',
|
||||
url: '/monitor/system-info',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
*/
|
||||
export function exportAuth(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/udmUserManage/v1/authExport',
|
||||
url: '/api/rest/udmUserManage/v1/authExport',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob',
|
||||
@@ -22,7 +22,7 @@ export function exportAuth(query: Record<string, any>) {
|
||||
*/
|
||||
export function importAuthData(neId: string, data: FormData) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/authImport/${neId}`,
|
||||
url: `/api/rest/udmUserManage/v1/authImport/${neId}`,
|
||||
method: 'post',
|
||||
data,
|
||||
dataType: 'form-data',
|
||||
@@ -36,7 +36,7 @@ export function importAuthData(neId: string, data: FormData) {
|
||||
*/
|
||||
export function listAuth(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/udmUserManage/v1/auths',
|
||||
url: '/api/rest/udmUserManage/v1/auths',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -49,7 +49,7 @@ export function listAuth(query: Record<string, any>) {
|
||||
*/
|
||||
export function loadAuth(neId: string) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/authSave/${neId}`,
|
||||
url: `/api/rest/udmUserManage/v1/authSave/${neId}`,
|
||||
method: 'post',
|
||||
timeout: 60 * 1000,
|
||||
});
|
||||
@@ -62,7 +62,7 @@ export function loadAuth(neId: string) {
|
||||
*/
|
||||
export function getAuth(neId: string, imsi: string) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/auth/${neId}/${imsi}`,
|
||||
url: `/api/rest/udmUserManage/v1/auth/${neId}/${imsi}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -74,7 +74,7 @@ export function getAuth(neId: string, imsi: string) {
|
||||
*/
|
||||
export function updateAuth(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/auth/${data.neId}`,
|
||||
url: `/api/rest/udmUserManage/v1/auth/${data.neId}`,
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -87,7 +87,7 @@ export function updateAuth(data: Record<string, any>) {
|
||||
*/
|
||||
export function addAuth(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/auth/${data.neId}`,
|
||||
url: `/api/rest/udmUserManage/v1/auth/${data.neId}`,
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -100,7 +100,7 @@ export function addAuth(data: Record<string, any>) {
|
||||
*/
|
||||
export function batchAuth( data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/auth/${data.neID}/${data.num}`,
|
||||
url: `/api/rest/udmUserManage/v1/auth/${data.neID}/${data.num}`,
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -113,7 +113,7 @@ export function batchAuth( data: Record<string, any>) {
|
||||
*/
|
||||
export function delAuth(neId: string, data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/auth/${neId}/${data.imsi}`,
|
||||
url: `/api/rest/udmUserManage/v1/auth/${neId}/${data.imsi}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -127,7 +127,7 @@ export function delAuth(neId: string, data: Record<string, any>) {
|
||||
*/
|
||||
export function batchDelAuth(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/auth/${data.neID}/${data.imsi}/${data.num}`,
|
||||
url: `/api/rest/udmUserManage/v1/auth/${data.neID}/${data.imsi}/${data.num}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function listBase5G(query: Record<string, any>) {
|
||||
query.nbId = query.id;
|
||||
const result = await request({
|
||||
url: '/ueManagement/v1/elementType/amf/objectType/nbInfo',
|
||||
url: '/api/rest/ueManagement/v1/elementType/amf/objectType/nbInfo',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function listIMS(query: Record<string, any>) {
|
||||
query.nbId = query.id;
|
||||
const result = await request({
|
||||
url: '/ueManagement/v1/elementType/ims/objectType/ueInfo',
|
||||
url: '/api/rest/ueManagement/v1/elementType/ims/objectType/ueInfo',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { toRaw } from 'vue';
|
||||
|
||||
/**
|
||||
* 签约列表导出
|
||||
@@ -8,7 +7,7 @@ import { toRaw } from 'vue';
|
||||
*/
|
||||
export function exportSub(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/udmUserManage/v1/subExport',
|
||||
url: '/api/rest/udmUserManage/v1/subExport',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob',
|
||||
@@ -23,7 +22,7 @@ export function exportSub(query: Record<string, any>) {
|
||||
*/
|
||||
export function importSubData(neId: string, data: FormData) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/subImport/${neId}`,
|
||||
url: `/api/rest/udmUserManage/v1/subImport/${neId}`,
|
||||
method: 'post',
|
||||
data,
|
||||
dataType: 'form-data',
|
||||
@@ -37,7 +36,7 @@ export function importSubData(neId: string, data: FormData) {
|
||||
*/
|
||||
export function loadSub(neId: string) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/subSave/${neId}`,
|
||||
url: `/api/rest/udmUserManage/v1/subSave/${neId}`,
|
||||
method: 'post',
|
||||
timeout: 60 * 1000,
|
||||
});
|
||||
@@ -50,7 +49,7 @@ export function loadSub(neId: string) {
|
||||
*/
|
||||
export function listSub(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/udmUserManage/v1/subs',
|
||||
url: '/api/rest/udmUserManage/v1/subs',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -63,20 +62,20 @@ export function listSub(query: Record<string, any>) {
|
||||
*/
|
||||
export function getSub(neId: string, imsi: string) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/subInfo/${neId}/${imsi}`,
|
||||
url: `/api/rest/udmUserManage/v1/subInfo/${neId}/${imsi}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改签约
|
||||
* @param data 签约对象
|
||||
* @param neId 网元ID
|
||||
* @param data 签约对象
|
||||
* @param neId 网元ID
|
||||
* @returns object
|
||||
*/
|
||||
export function updateSub(neId:string,data: Record<string, any>) {
|
||||
export function updateSub(neId: string, data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/sub/${neId}`,
|
||||
url: `/api/rest/udmUserManage/v1/sub/${neId}`,
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -89,7 +88,7 @@ export function updateSub(neId:string,data: Record<string, any>) {
|
||||
*/
|
||||
export function addSub(neID: string, data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/sub/${neID}`,
|
||||
url: `/api/rest/udmUserManage/v1/sub/${neID}`,
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -102,7 +101,7 @@ export function addSub(neID: string, data: Record<string, any>) {
|
||||
*/
|
||||
export function batchAddSub(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/sub/${data.neID}/${data.num}`,
|
||||
url: `/api/rest/udmUserManage/v1/sub/${data.neID}/${data.num}`,
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -115,7 +114,7 @@ export function batchAddSub(data: Record<string, any>) {
|
||||
*/
|
||||
export function delSub(neId: string, imsi: string) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/sub/${neId}/${imsi}`,
|
||||
url: `/api/rest/udmUserManage/v1/sub/${neId}/${imsi}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -127,7 +126,7 @@ export function delSub(neId: string, imsi: string) {
|
||||
*/
|
||||
export function batchDelSub(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/udmUserManage/v1/sub/${data.neID}/${data.imsi}/${data.num}`,
|
||||
url: `/api/rest/udmUserManage/v1/sub/${data.neID}/${data.imsi}/${data.num}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
export async function listUE(query: Record<string, any>) {
|
||||
query.nbId = query.id;
|
||||
const result = await request({
|
||||
url: '/ueManagement/v1/elementType/smf/objectType/ueInfo',
|
||||
url: '/api/rest/ueManagement/v1/elementType/smf/objectType/ueInfo',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
*/
|
||||
export const getRouters = () => {
|
||||
return request({
|
||||
url: '/securityManagement/v1/getRouters',
|
||||
url: '/getRouters',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
|
||||
@@ -5,9 +5,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
* @param query 查询参数
|
||||
* @returns bolb
|
||||
*/
|
||||
export function exportConfig(
|
||||
query: Record<string, any>
|
||||
) {
|
||||
export function exportConfig(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system/config/export',
|
||||
method: 'post',
|
||||
@@ -23,7 +21,7 @@ export function exportConfig(
|
||||
*/
|
||||
export function listConfig(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/configManage/v1/configs',
|
||||
url: '/system/config/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -36,7 +34,7 @@ export function listConfig(query: Record<string, any>) {
|
||||
*/
|
||||
export function getConfig(configId: string | number) {
|
||||
return request({
|
||||
url: `/configManage/v1/config/${configId}`,
|
||||
url: `/system/config/${configId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -48,7 +46,7 @@ export function getConfig(configId: string | number) {
|
||||
*/
|
||||
export function getConfigKey(configKey: string) {
|
||||
return request({
|
||||
url: `/configManage/v1/config/${configKey}`,
|
||||
url: `/system/config/configKey/${configKey}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -60,7 +58,7 @@ export function getConfigKey(configKey: string) {
|
||||
*/
|
||||
export function addConfig(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/configManage/v1/config',
|
||||
url: '/system/config',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -73,7 +71,7 @@ export function addConfig(data: Record<string, any>) {
|
||||
*/
|
||||
export function updateConfig(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/configManage/v1/config',
|
||||
url: '/system/config',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -86,7 +84,7 @@ export function updateConfig(data: Record<string, any>) {
|
||||
*/
|
||||
export function delConfig(configId: string | number) {
|
||||
return request({
|
||||
url: `/configManage/v1/config/${configId}`,
|
||||
url: `/system/config/${configId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -97,7 +95,7 @@ export function delConfig(configId: string | number) {
|
||||
*/
|
||||
export function refreshCache() {
|
||||
return request({
|
||||
url: '/configManage/v1/config/refreshCache',
|
||||
url: '/system/config/refreshCache',
|
||||
method: 'put',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export function exportData(query: Record<string, any>) {
|
||||
*/
|
||||
export function listData(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/dictDataManage/v1/dictDatas',
|
||||
url: '/system/dict/data/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -34,7 +34,7 @@ export function listData(query: Record<string, any>) {
|
||||
*/
|
||||
export function getData(dictCode: string | number) {
|
||||
return request({
|
||||
url: `/dictDataManage/v1/dictData/${dictCode}`,
|
||||
url: `/system/dict/data/${dictCode}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -45,9 +45,8 @@ export function getData(dictCode: string | number) {
|
||||
* @returns object
|
||||
*/
|
||||
export function addData(data: Record<string, any>) {
|
||||
data.dictSort = parseInt(data.dictSort);
|
||||
return request({
|
||||
url: '/dictDataManage/v1/dictData',
|
||||
url: '/system/dict/data',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -59,9 +58,8 @@ export function addData(data: Record<string, any>) {
|
||||
* @returns object
|
||||
*/
|
||||
export function updateData(data: Record<string, any>) {
|
||||
data.dictSort = parseInt(data.dictSort);
|
||||
return request({
|
||||
url: '/dictDataManage/v1/dictData',
|
||||
url: '/system/dict/data',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -74,7 +72,7 @@ export function updateData(data: Record<string, any>) {
|
||||
*/
|
||||
export function delData(dictCode: string | number) {
|
||||
return request({
|
||||
url: `/dictDataManage/v1/dictData/${dictCode}`,
|
||||
url: `/system/dict/data/${dictCode}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -86,7 +84,7 @@ export function delData(dictCode: string | number) {
|
||||
*/
|
||||
export function getDictDataType(dictType: string) {
|
||||
return request({
|
||||
url: `/dictDataManage/v1/dictData/type/${dictType}`,
|
||||
url: `/system/dict/data/type/${dictType}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export function exportType(query: Record<string, any>) {
|
||||
*/
|
||||
export function listType(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/dictTypegManage/v1/dictTypes',
|
||||
url: '/system/dict/type/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -34,7 +34,7 @@ export function listType(query: Record<string, any>) {
|
||||
*/
|
||||
export function getType(dictId: string | number) {
|
||||
return request({
|
||||
url: `/dictTypegManage/v1/dictType/${dictId}`,
|
||||
url: `/system/dict/type/${dictId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export function getType(dictId: string | number) {
|
||||
*/
|
||||
export function addType(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/dictTypegManage/v1/dictType',
|
||||
url: '/system/dict/type',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -59,7 +59,7 @@ export function addType(data: Record<string, any>) {
|
||||
*/
|
||||
export function updateType(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/dictTypegManage/v1/dictType',
|
||||
url: '/system/dict/type',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -72,7 +72,7 @@ export function updateType(data: Record<string, any>) {
|
||||
*/
|
||||
export function delType(dictId: string | number) {
|
||||
return request({
|
||||
url: `/dictTypegManage/v1/dictType/${dictId}`,
|
||||
url: `/system/dict/type/${dictId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -84,7 +84,7 @@ export function delType(dictId: string | number) {
|
||||
*/
|
||||
export function refreshCache() {
|
||||
return request({
|
||||
url: '/dictTypegManage/v1/dictType/refreshCache',
|
||||
url: '/system/dict/type/refreshCache',
|
||||
method: 'put',
|
||||
});
|
||||
}
|
||||
@@ -96,7 +96,7 @@ export function refreshCache() {
|
||||
*/
|
||||
export function getDictOptionselect() {
|
||||
return request({
|
||||
url: '/dictTypegManage/v1/dictTypes/optionselect',
|
||||
url: '/system/dict/type/getDictOptionselect',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import { request } from '@/plugins/http-fetch';
|
||||
* @param query 查询参数
|
||||
* @returns bolb
|
||||
*/
|
||||
export function exportLogininfor(
|
||||
export function exportSysLogLogin(
|
||||
query: Record<string, any>
|
||||
) {
|
||||
return request({
|
||||
url: '/monitor/logininfor/export',
|
||||
url: '/system/log/login/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob',
|
||||
@@ -21,11 +21,11 @@ export function exportLogininfor(
|
||||
* @param query 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export function listLogininfor(
|
||||
export function listSysLogLogin(
|
||||
query: Record<string, any>
|
||||
) {
|
||||
return request({
|
||||
url: '/monitor/logininfor/list',
|
||||
url: '/system/log/login/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -33,12 +33,12 @@ export function listLogininfor(
|
||||
|
||||
/**
|
||||
* 删除登录日志
|
||||
* @param infoId 登录日志Id
|
||||
* @param loginIds 登录Id
|
||||
* @returns object
|
||||
*/
|
||||
export function delLogininfor(infoId: string) {
|
||||
export function delSysLogLogin(loginIds: string) {
|
||||
return request({
|
||||
url: `/monitor/logininfor/${infoId}`,
|
||||
url: `/system/log/login/${loginIds}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -47,9 +47,9 @@ export function delLogininfor(infoId: string) {
|
||||
* 清空登录日志
|
||||
* @returns object
|
||||
*/
|
||||
export function cleanLogininfor() {
|
||||
export function cleanSysLogLogin() {
|
||||
return request({
|
||||
url: '/monitor/logininfor/clean',
|
||||
url: '/system/log/login/clean',
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -59,9 +59,9 @@ export function cleanLogininfor() {
|
||||
* @param userName 登录账号
|
||||
* @returns object
|
||||
*/
|
||||
export function unlockLogininfor(userName: string) {
|
||||
export function unlock(userName: string) {
|
||||
return request({
|
||||
url: `/monitor/logininfor/unlock/${userName}`,
|
||||
url: `/system/log/login/unlock/${userName}`,
|
||||
method: 'put',
|
||||
});
|
||||
}
|
||||
@@ -5,11 +5,11 @@ import { request } from '@/plugins/http-fetch';
|
||||
* @param query 查询参数
|
||||
* @returns bolb
|
||||
*/
|
||||
export function exportOperlog(
|
||||
export function exportSysLogOperate(
|
||||
query: Record<string, any>
|
||||
) {
|
||||
return request({
|
||||
url: '/monitor/operlog/export',
|
||||
url: '/system/log/operate/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
responseType: 'blob',
|
||||
@@ -21,11 +21,11 @@ export function exportOperlog(
|
||||
* @param query 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export function listOperlog(
|
||||
export function listSysLogOperate(
|
||||
query: Record<string, any>
|
||||
) {
|
||||
return request({
|
||||
url: '/monitor/operlog/list',
|
||||
url: '/system/log/operate/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -36,9 +36,9 @@ export function listOperlog(
|
||||
* @param operId 操作日志ID
|
||||
* @returns object
|
||||
*/
|
||||
export function delOperlog(operId: string) {
|
||||
export function delSysLogOperate(operId: string) {
|
||||
return request({
|
||||
url: `/monitor/operlog/${operId}`,
|
||||
url: `/system/log/operate/${operId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -47,9 +47,9 @@ export function delOperlog(operId: string) {
|
||||
* 清空操作日志
|
||||
* @returns object
|
||||
*/
|
||||
export function cleanOperlog() {
|
||||
export function cleanSysLogOperate() {
|
||||
return request({
|
||||
url: '/monitor/operlog/clean',
|
||||
url: '/system/log/operate/clean',
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import { request } from '@/plugins/http-fetch';
|
||||
*/
|
||||
export function listMenu(query?: Record<string, any>) {
|
||||
return request({
|
||||
url: '/menuManage/v1/menus',
|
||||
url: '/system/menu/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -20,7 +20,7 @@ export function listMenu(query?: Record<string, any>) {
|
||||
*/
|
||||
export function getMenu(menuId: string | number) {
|
||||
return request({
|
||||
url: `/menuManage/v1/menu/${menuId}`,
|
||||
url: `/system/menu/${menuId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -31,7 +31,7 @@ export function getMenu(menuId: string | number) {
|
||||
*/
|
||||
export function menuTreeSelect() {
|
||||
return request({
|
||||
url: '/menuManage/v1/menus/treeSelect',
|
||||
url: '/system/menu/treeSelect',
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -43,7 +43,7 @@ export function menuTreeSelect() {
|
||||
*/
|
||||
export function roleMenuTreeSelect(roleId: string | number) {
|
||||
return request({
|
||||
url: `/menuManage/v1/menu/roleMenuTreeSelect/${roleId}`,
|
||||
url: `/system/menu/roleMenuTreeSelect/${roleId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -55,7 +55,7 @@ export function roleMenuTreeSelect(roleId: string | number) {
|
||||
*/
|
||||
export function addMenu(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/menuManage/v1/menu',
|
||||
url: '/system/menu',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -68,7 +68,7 @@ export function addMenu(data: Record<string, any>) {
|
||||
*/
|
||||
export function updateMenu(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/menuManage/v1/menu',
|
||||
url: '/system/menu',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -81,7 +81,7 @@ export function updateMenu(data: Record<string, any>) {
|
||||
*/
|
||||
export function delMenu(menuId: string | number) {
|
||||
return request({
|
||||
url: `/menuManage/v1/menu/${menuId}`,
|
||||
url: `/system/menu/${menuId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
* @param query 查询参数
|
||||
* @returns object
|
||||
*/
|
||||
export function listNotice(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system/notice/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公告详细
|
||||
* @param menuId 公告ID
|
||||
* @returns object
|
||||
*/
|
||||
export function getNotice(noticeId: string | number) {
|
||||
return request({
|
||||
url: `/system/notice/${noticeId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
* @param data 公告对象
|
||||
* @returns object
|
||||
*/
|
||||
export function addNotice(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system/notice',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
* @param data 公告对象
|
||||
* @returns object
|
||||
*/
|
||||
export function updateNotice(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/system/notice',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公告
|
||||
* @param noticeId 公告ID
|
||||
* @returns object
|
||||
*/
|
||||
export function delNotice(noticeId: string | number) {
|
||||
return request({
|
||||
url: `/system/notice/${noticeId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -21,7 +21,7 @@ export function exportRole(query: Record<string, any>) {
|
||||
*/
|
||||
export function listRole(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/roleManage/v1/roles',
|
||||
url: '/system/role/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -34,7 +34,7 @@ export function listRole(query: Record<string, any>) {
|
||||
*/
|
||||
export function getRole(roleId: string | number) {
|
||||
return request({
|
||||
url: `/roleManage/v1/role/${roleId}`,
|
||||
url: `/system/role/${roleId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -46,7 +46,7 @@ export function getRole(roleId: string | number) {
|
||||
*/
|
||||
export function addRole(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/roleManage/v1/role',
|
||||
url: '/system/role',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -59,7 +59,7 @@ export function addRole(data: Record<string, any>) {
|
||||
*/
|
||||
export function updateRole(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/roleManage/v1/role',
|
||||
url: '/system/role',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -72,7 +72,7 @@ export function updateRole(data: Record<string, any>) {
|
||||
*/
|
||||
export function delRole(roleId: string | number) {
|
||||
return request({
|
||||
url: `/roleManage/v1/role/${roleId}`,
|
||||
url: `/system/role/${roleId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -85,7 +85,7 @@ export function delRole(roleId: string | number) {
|
||||
*/
|
||||
export function changeRoleStatus(roleId: string, status: string | number) {
|
||||
return request({
|
||||
url: '/roleManage/v1/role/changeStatus',
|
||||
url: '/system/role/changeStatus',
|
||||
method: 'put',
|
||||
data: {
|
||||
roleId,
|
||||
@@ -101,7 +101,7 @@ export function changeRoleStatus(roleId: string, status: string | number) {
|
||||
*/
|
||||
export function dataScope(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/roleManage/v1/role/dataScope',
|
||||
url: '/system/role/dataScope',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -114,7 +114,7 @@ export function dataScope(data: Record<string, any>) {
|
||||
*/
|
||||
export function authUserAllocatedList(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/roleManage/v1/role/authUser/allocatedList',
|
||||
url: '/system/role/authUser/allocatedList',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -127,7 +127,7 @@ export function authUserAllocatedList(query: Record<string, any>) {
|
||||
*/
|
||||
export function authUserChecked(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/roleManage/v1/role/authUser/checked',
|
||||
url: '/system/role/authUser/checked',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ export function exportUser(query: Record<string, any>) {
|
||||
*/
|
||||
export function listUser(query: Record<string, any>) {
|
||||
return request({
|
||||
url: '/userManage/v1/users',
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
@@ -60,7 +60,7 @@ export function listUser(query: Record<string, any>) {
|
||||
*/
|
||||
export function getUser(userId: string | number = '0') {
|
||||
return request({
|
||||
url: `/userManage/v1/user/${userId}`,
|
||||
url: `/system/user/${userId}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export function getUser(userId: string | number = '0') {
|
||||
*/
|
||||
export function addUser(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/userManage/v1/user',
|
||||
url: '/system/user',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -85,7 +85,7 @@ export function addUser(data: Record<string, any>) {
|
||||
*/
|
||||
export function updateUser(data: Record<string, any>) {
|
||||
return request({
|
||||
url: '/userManage/v1/user',
|
||||
url: '/system/user',
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -98,7 +98,7 @@ export function updateUser(data: Record<string, any>) {
|
||||
*/
|
||||
export function delUser(userId: string | number) {
|
||||
return request({
|
||||
url: `/userManage/v1/user/${userId}`,
|
||||
url: `/system/user/${userId}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -111,7 +111,7 @@ export function delUser(userId: string | number) {
|
||||
*/
|
||||
export function resetUserPwd(userId: string | number, password: string) {
|
||||
return request({
|
||||
url: '/userManage/v1/user/resetPwd',
|
||||
url: '/system/user/resetPwd',
|
||||
method: 'put',
|
||||
data: {
|
||||
userId,
|
||||
@@ -131,7 +131,7 @@ export function changeUserStatus(
|
||||
status: string | number
|
||||
) {
|
||||
return request({
|
||||
url: '/userManage/v1/user/changeStatus',
|
||||
url: '/system/user/changeStatus',
|
||||
method: 'put',
|
||||
data: {
|
||||
userId,
|
||||
|
||||
@@ -26,7 +26,7 @@ export async function listTraceData(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/omc_db/trace_data`,
|
||||
url: `/api/rest/databaseManagement/v1/omc_db/trace_data`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
@@ -64,7 +64,7 @@ export async function listTraceData(query: Record<string, any>) {
|
||||
*/
|
||||
export function getTraceRawInfo(id: Record<string, string>) {
|
||||
return request({
|
||||
url: `/traceManagement/v1/decMessage/${id}`,
|
||||
url: `/api/rest/traceManagement/v1/decMessage/${id}`,
|
||||
method: 'get',
|
||||
responseType: 'text',
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ export function tcpdumpNeTask(
|
||||
data: Record<string, string>
|
||||
) {
|
||||
return request({
|
||||
url: '/traceManagement/v1/tcpdumpNeTask',
|
||||
url: '/api/rest/traceManagement/v1/tcpdumpNeTask',
|
||||
method: 'post',
|
||||
data: data,
|
||||
signal: signal,
|
||||
@@ -16,7 +16,7 @@ export function tcpdumpNeTask(
|
||||
// 网元抓包pcap文件下载
|
||||
export function tcpdumpPcapDownload(data: Record<string, string>) {
|
||||
return request({
|
||||
url: '/traceManagement/v1/tcpdumpPcapDownload',
|
||||
url: '/api/rest/traceManagement/v1/tcpdumpPcapDownload',
|
||||
method: 'post',
|
||||
data: data,
|
||||
responseType: 'blob',
|
||||
@@ -26,7 +26,7 @@ export function tcpdumpPcapDownload(data: Record<string, string>) {
|
||||
// 网元抓包生成pcap
|
||||
export function tcpdumpNeUPFTask(data: Record<string, string>) {
|
||||
return request({
|
||||
url: '/traceManagement/v1/tcpdumpNeUPFTask',
|
||||
url: '/api/rest/traceManagement/v1/tcpdumpNeUPFTask',
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function listTraceTask(query: Record<string, any>) {
|
||||
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/trace_task`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/trace_task`,
|
||||
method: 'get',
|
||||
params: {
|
||||
totalSQL: totalSQL + querySQL,
|
||||
@@ -62,7 +62,7 @@ export async function listTraceTask(query: Record<string, any>) {
|
||||
export async function getTraceTask(id: string | number) {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/select/omc_db/trace_task`,
|
||||
url: `/api/rest/databaseManagement/v1/select/omc_db/trace_task`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `select * from trace_task where id = ${id}`,
|
||||
@@ -85,7 +85,7 @@ export async function getTraceTask(id: string | number) {
|
||||
*/
|
||||
export function addTraceTask(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/traceManagement/v1/subscriptions`,
|
||||
url: `/api/rest/traceManagement/v1/subscriptions`,
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
@@ -98,7 +98,7 @@ export function addTraceTask(data: Record<string, any>) {
|
||||
*/
|
||||
export function updateTraceTask(data: Record<string, any>) {
|
||||
return request({
|
||||
url: `/traceManagement/v1/subscriptions`,
|
||||
url: `/api/rest/traceManagement/v1/subscriptions`,
|
||||
method: 'put',
|
||||
data: data,
|
||||
});
|
||||
@@ -111,7 +111,7 @@ export function updateTraceTask(data: Record<string, any>) {
|
||||
*/
|
||||
export async function delTraceTask(id: string) {
|
||||
return request({
|
||||
url: `/traceManagement/v1/subscriptions?id=${id}`,
|
||||
url: `/api/rest/traceManagement/v1/subscriptions?id=${id}`,
|
||||
method: 'delete',
|
||||
});
|
||||
}
|
||||
@@ -123,7 +123,7 @@ export async function delTraceTask(id: string) {
|
||||
export async function getNeTraceInterfaceAll() {
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
url: `/databaseManagement/v1/elementType/omc_db/objectType/ne_info`,
|
||||
url: `/api/rest/databaseManagement/v1/elementType/omc_db/objectType/ne_info`,
|
||||
method: 'get',
|
||||
params: {
|
||||
SQL: `SELECT ne_type,interface FROM trace_info`,
|
||||
|
||||
@@ -42,7 +42,7 @@ const item = computed(() => {
|
||||
{{ item.label }}
|
||||
</span>
|
||||
</template>
|
||||
<span v-else></span>
|
||||
<span v-else>{{ value }}</span>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**令牌-数据响应字段 */
|
||||
export const TOKEN_RESPONSE_FIELD = 'accessToken';
|
||||
export const TOKEN_RESPONSE_FIELD = 'access_token';
|
||||
|
||||
/**令牌-请求头标识前缀 */
|
||||
export const TOKEN_KEY_PREFIX = '';
|
||||
export const TOKEN_KEY_PREFIX = 'Bearer ';
|
||||
|
||||
/**令牌-请求头标识 */
|
||||
export const TOKEN_KEY = 'Accesstoken';
|
||||
export const TOKEN_KEY = 'Authorization';
|
||||
|
||||
/**令牌-存放Cookie标识 */
|
||||
export const TOKEN_COOKIE = 'AuthOMC';
|
||||
|
||||
@@ -126,7 +126,7 @@ tabsStore.clear();
|
||||
disable-content-margin
|
||||
v-bind="proConfig"
|
||||
:iconfont-url="scriptUrl"
|
||||
:sider-width="256"
|
||||
:sider-width="208"
|
||||
>
|
||||
<!--插槽-菜单头-->
|
||||
<template #menuHeaderRender>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { getToken, removeToken } from '@/plugins/auth-token';
|
||||
import { sessionGetJSON, sessionSetJSON } from '@/utils/cache-session-utils';
|
||||
import {
|
||||
sessionGet,
|
||||
sessionGetJSON,
|
||||
sessionSetJSON,
|
||||
} from '@/utils/cache-session-utils';
|
||||
import { TOKEN_KEY, TOKEN_KEY_PREFIX } from '@/constants/token-constants';
|
||||
import { CACHE_SESSION_FATCH } from '@/constants/cache-keys-constants';
|
||||
import {
|
||||
@@ -74,9 +78,14 @@ type OptionsType = {
|
||||
signal?: AbortSignal;
|
||||
};
|
||||
|
||||
// 兼容旧前端可改配置文件
|
||||
const baseUrl = import.meta.env.PROD
|
||||
? sessionGet('baseUrl') || import.meta.env.VITE_API_BASE_URL
|
||||
: import.meta.env.VITE_API_BASE_URL;
|
||||
|
||||
/**默认请求参数 */
|
||||
const FATCH_OPTIONS: OptionsType = {
|
||||
baseUrl: import.meta.env.VITE_API_BASE_URL,
|
||||
baseUrl: baseUrl,
|
||||
timeout: 10 * 1000,
|
||||
url: '',
|
||||
method: 'get',
|
||||
|
||||
@@ -132,18 +132,24 @@ const useUserStore = defineStore('user', {
|
||||
this.phonenumber = user.phone;
|
||||
this.email = user.email;
|
||||
this.sex = user.gender;
|
||||
// this.profile = JSON.parse(user.profile);
|
||||
// 额外信息
|
||||
try {
|
||||
this.profile = JSON.parse(user.profile);
|
||||
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
this.profile = {
|
||||
critical: '#FF5722',
|
||||
major: '#FFB800',
|
||||
minor: '#393D49',
|
||||
warning: '#009688',
|
||||
event: '#1E9FFF',
|
||||
color: {
|
||||
critical: '#e8994a',
|
||||
event: '#c5d2dc',
|
||||
major: '#494040',
|
||||
minor: '#5f70a8',
|
||||
sound: 'custom',
|
||||
warning: '#b9e1dd',
|
||||
},
|
||||
custom: 'hrxz.com-exz2s3uxhc47391.mp3',
|
||||
pwdErrCount: 0,
|
||||
pwdErrTime: 0,
|
||||
sound: 'custom',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { updateUserProfile, uploadAvatar } from '@/api/profile';
|
||||
import { regExpEmail, regExpMobile, regExpNick } from '@/utils/regular-utils';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const uerStore = useUserStore();
|
||||
const { getDict } = useDictStore();
|
||||
|
||||
@@ -49,7 +50,7 @@ function fnFinish() {
|
||||
updateUserProfile(form).then(res => {
|
||||
hide();
|
||||
stateForm.formClick = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Modal.success({
|
||||
title: '提示',
|
||||
content: `用户基本信息修改成功!`,
|
||||
@@ -97,7 +98,7 @@ function fnUpload(up: UploadRequestOption) {
|
||||
uploadAvatar(formData).then(res => {
|
||||
upState.value = false;
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success('头像上传/变更成功', 3);
|
||||
uerStore.setAvatar(res.data);
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { updateUserPwd } from '@/api/profile';
|
||||
import { regExpPasswd } from '@/utils/regular-utils';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { userName, fnLogOut } = useUserStore();
|
||||
const router = useRouter();
|
||||
|
||||
@@ -48,8 +49,7 @@ function fnFinish() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
updateUserPwd(state.form.oldPassword, state.form.confirmPassword)
|
||||
.then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
Modal.success({
|
||||
title: '提示',
|
||||
content: `恭喜您,${userName} 账号密码修改成功!`,
|
||||
@@ -63,6 +63,7 @@ function fnFinish() {
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
state.formClick = false;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -287,7 +287,7 @@ let backState: ModalStateType = reactive({
|
||||
backFileTree: [],
|
||||
},
|
||||
fromLoading: true,
|
||||
confirmLoading: false,
|
||||
confirmLoading: true,
|
||||
});
|
||||
|
||||
/**日志备份对象保存 */
|
||||
@@ -325,20 +325,16 @@ function fnFormBackFinish() {
|
||||
|
||||
/**日志手动备份文件列表 */
|
||||
function fnBackFileList() {
|
||||
backupFileList()
|
||||
.then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
if (res.data.name === '') {
|
||||
backState.from.backFileTree = [];
|
||||
} else {
|
||||
backState.from.backFileTree = [res.data];
|
||||
}
|
||||
backState.fromLoading = false;
|
||||
backupFileList().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
if (res.data.name === '') {
|
||||
backState.from.backFileTree = [];
|
||||
} else {
|
||||
backState.from.backFileTree = [res.data];
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
backState.confirmLoading = false;
|
||||
});
|
||||
backState.fromLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**日志备份文件下载 */
|
||||
|
||||
@@ -20,9 +20,9 @@ let state = reactive({
|
||||
/**表单属性 */
|
||||
from: {
|
||||
/**账号 */
|
||||
username: 'admin',
|
||||
username: '',
|
||||
/**密码 */
|
||||
password: 'rootaa',
|
||||
password: '',
|
||||
/**验证码 */
|
||||
code: '',
|
||||
/**验证码uuid */
|
||||
|
||||
21
src/views/monitor/cache/index.vue
vendored
21
src/views/monitor/cache/index.vue
vendored
@@ -13,6 +13,7 @@ import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table/Table';
|
||||
import { message } from 'ant-design-vue/lib';
|
||||
import { hasPermissions } from '@/plugins/auth-user';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const route = useRoute();
|
||||
|
||||
/**路由标题 */
|
||||
@@ -43,7 +44,7 @@ function fnCacheKeyInfo(cacheKey: string) {
|
||||
cacheKeyInfo.loading = true;
|
||||
getCacheValue(cacheKeyTable.cacheName, cacheKey).then(res => {
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
cacheKeyInfo.data = Object.assign(cacheKeyInfo.data, res.data);
|
||||
cacheKeyInfo.loading = false;
|
||||
}
|
||||
@@ -106,7 +107,7 @@ function fnCacheKeyClear(cacheKey: string) {
|
||||
clearCacheKey(cacheKeyTable.cacheName, cacheKey).then(res => {
|
||||
hide();
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已删除缓存键名 ${cacheKey}`,
|
||||
duration: 3,
|
||||
@@ -139,7 +140,7 @@ function fnCacheKeyList(cacheName: string = 'load') {
|
||||
cacheKeyTable.loading = true;
|
||||
listCacheKey(cacheName).then(res => {
|
||||
isClick.value = false;
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
cacheKeyTable.cacheName = cacheName;
|
||||
cacheKeyTable.data = res.data;
|
||||
cacheKeyTable.loading = false;
|
||||
@@ -204,7 +205,7 @@ function fnClearCacheSafe() {
|
||||
clearCacheSafe().then(res => {
|
||||
hide();
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: '已完成安全清理缓存',
|
||||
duration: 3,
|
||||
@@ -231,7 +232,7 @@ function fnCacheNameClear(cacheName: string) {
|
||||
clearCacheName(cacheName).then(res => {
|
||||
hide();
|
||||
isClick.value = false;
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已清理缓存名称 ${cacheName}`,
|
||||
duration: 3,
|
||||
@@ -257,7 +258,7 @@ function fnCacheNameList() {
|
||||
cacheNameTable.loading = true;
|
||||
listCacheName().then(res => {
|
||||
isClick.value = false;
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
cacheNameTable.data = res.data;
|
||||
cacheNameTable.loading = false;
|
||||
}
|
||||
@@ -316,11 +317,12 @@ onMounted(() => {
|
||||
:columns="cacheNameTableColumns"
|
||||
:data-source="cacheNameTable.data"
|
||||
:loading="cacheNameTable.loading"
|
||||
:scroll="{ y: 1200 }"
|
||||
:pagination="false"
|
||||
:row-selection="{
|
||||
type: 'radio',
|
||||
onChange: (selectedRowKeys: (string|number)[]) => fnCacheKeyList(selectedRowKeys[0] as string),
|
||||
}"
|
||||
:pagination="false"
|
||||
>
|
||||
<template
|
||||
#customFilterDropdown="{
|
||||
@@ -337,7 +339,7 @@ onMounted(() => {
|
||||
:value="selectedKeys[0]"
|
||||
style="width: 188px; margin-bottom: 8px; display: block"
|
||||
@change="
|
||||
(e:any) => setSelectedKeys(e.target.value ? [e.target.value] : [])
|
||||
(e:any)=> setSelectedKeys(e.target.value ? [e.target.value] : [])
|
||||
"
|
||||
@pressEnter="confirm()"
|
||||
/>
|
||||
@@ -397,11 +399,12 @@ onMounted(() => {
|
||||
:columns="cacheKeyTableColumns"
|
||||
:data-source="cacheKeyTable.data"
|
||||
:loading="cacheKeyTable.loading"
|
||||
:scroll="{ y: 1200 }"
|
||||
:pagination="false"
|
||||
:row-selection="{
|
||||
type: 'radio',
|
||||
onChange: (selectedRowKeys: (string|number)[]) => fnCacheKeyInfo(selectedRowKeys[0] as string),
|
||||
}"
|
||||
:pagination="false"
|
||||
>
|
||||
<template
|
||||
#customFilterDropdown="{
|
||||
|
||||
3
src/views/monitor/cache/info.vue
vendored
3
src/views/monitor/cache/info.vue
vendored
@@ -15,6 +15,7 @@ import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { getCache } from '@/api/monitor/cache';
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const route = useRoute();
|
||||
|
||||
echarts.use([
|
||||
@@ -136,7 +137,7 @@ function commandStatsChart() {
|
||||
onMounted(() => {
|
||||
getCache()
|
||||
.then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
cache.info = res.data.info;
|
||||
cache.dbSize = res.data.dbSize;
|
||||
cache.commandStats = res.data.commandStats;
|
||||
|
||||
@@ -22,6 +22,7 @@ import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { hasPermissions } from '@/plugins/auth-user';
|
||||
import { MENU_PATH_INLINE } from '@/constants/menu-constants';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
@@ -169,7 +170,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -260,7 +261,7 @@ function fnModalVisibleByVive(jobId: string | number) {
|
||||
getJob(jobId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '任务信息';
|
||||
modalState.visibleByView = true;
|
||||
@@ -286,7 +287,7 @@ function fnModalVisibleByEdit(jobId?: string | number) {
|
||||
getJob(jobId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '修改任务';
|
||||
modalState.visibleByEdit = true;
|
||||
@@ -312,7 +313,7 @@ function fnModalOk() {
|
||||
message.loading({ content: '请稍等...', key });
|
||||
job
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
key,
|
||||
@@ -371,7 +372,7 @@ function fnRecordStatus(row: Record<string, string>) {
|
||||
const key = 'changeJobStatus';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
changeJobStatus(row.jobId, row.status).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${row.jobName} ${text}成功`,
|
||||
key,
|
||||
@@ -405,7 +406,7 @@ function fnRecordRunOne(row: Record<string, string>) {
|
||||
const key = 'runJob';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
runJob(row.jobId).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${row.jobName} 执行成功`,
|
||||
key,
|
||||
@@ -438,7 +439,7 @@ function fnRecordDelete(jobId: string = '0') {
|
||||
const key = 'delJob';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
delJob(jobId).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
key,
|
||||
@@ -468,7 +469,7 @@ function fnResetQueueJob() {
|
||||
const key = 'resetQueueJob';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
resetQueueJob().then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `重置成功`,
|
||||
key,
|
||||
@@ -495,7 +496,7 @@ function fnExportList() {
|
||||
const key = 'exportJob';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
exportJob(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
key,
|
||||
@@ -523,7 +524,7 @@ function fnJobLogView(jobId: string | number = '0') {
|
||||
function fnGetList() {
|
||||
tableState.loading = true;
|
||||
listJob(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
@@ -704,9 +705,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
|
||||
@@ -17,6 +17,7 @@ import { saveAs } from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useTabsStore from '@/store/modules/tabs';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const tabsStore = useTabsStore();
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
@@ -198,7 +199,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -262,7 +263,7 @@ function fnRecordDelete() {
|
||||
const key = 'delJobLog';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
delJobLog(ids).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
key,
|
||||
@@ -290,7 +291,7 @@ function fnCleanList() {
|
||||
const key = 'cleanJobLog';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
cleanJobLog().then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `清空成功`,
|
||||
key,
|
||||
@@ -318,7 +319,7 @@ function fnExportList() {
|
||||
const key = 'exportJobLog';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
exportJobLog(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
key,
|
||||
@@ -356,7 +357,7 @@ function fnGetList() {
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listJobLog(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
@@ -384,7 +385,7 @@ onMounted(() => {
|
||||
// 指定任务id数据列表
|
||||
if (jobId && jobId !== '0') {
|
||||
getJob(jobId).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
queryParams.jobName = res.data.jobName;
|
||||
queryParams.jobGroup = res.data.jobGroup;
|
||||
fnGetList();
|
||||
@@ -534,9 +535,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
|
||||
@@ -1,338 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from 'vue-router';
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { message, Modal } from 'ant-design-vue/lib';
|
||||
import { forceLogout, listOnline } from '@/api/monitor/online';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
const route = useRoute();
|
||||
|
||||
/**路由标题 */
|
||||
let title = ref<string>(route.meta.title ?? '标题');
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**登录主机 */
|
||||
ipaddr: '',
|
||||
/**登录账号 */
|
||||
userName: '',
|
||||
});
|
||||
|
||||
/**表格状态类型 */
|
||||
type TabeStateType = {
|
||||
/**加载等待 */
|
||||
loading: boolean;
|
||||
/**紧凑型 */
|
||||
size: SizeType;
|
||||
/**斑马纹 */
|
||||
striped: boolean;
|
||||
/**搜索栏 */
|
||||
seached: boolean;
|
||||
/**记录数据 */
|
||||
data: object[];
|
||||
};
|
||||
|
||||
/**表格状态 */
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
striped: false,
|
||||
seached: false,
|
||||
data: [],
|
||||
});
|
||||
|
||||
/**表格字段列 */
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'num',
|
||||
width: '50px',
|
||||
align: 'center',
|
||||
customRender(opt) {
|
||||
const idxNum = (tablePagination.current - 1) * tablePagination.pageSize;
|
||||
return idxNum + opt.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '会话编号',
|
||||
dataIndex: 'tokenId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录账号',
|
||||
dataIndex: 'userName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '所属部门',
|
||||
dataIndex: 'deptName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录主机',
|
||||
dataIndex: 'ipaddr',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录地点',
|
||||
dataIndex: 'loginLocation',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '操作系统',
|
||||
dataIndex: 'os',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '浏览器',
|
||||
dataIndex: 'browser',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录时间',
|
||||
dataIndex: 'loginTime',
|
||||
align: 'center',
|
||||
customRender(opt) {
|
||||
if (+opt.value <= 0) return '';
|
||||
return parseDateToStr(+opt.value);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'tokenId',
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
/**表格分页器参数 */
|
||||
let tablePagination = {
|
||||
/**当前页数 */
|
||||
current: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
/**默认的每页条数 */
|
||||
defaultPageSize: 20,
|
||||
/**指定每页可以显示多少条 */
|
||||
pageSizeOptions: ['10', '20', '50', '100'],
|
||||
/**只有一页时是否隐藏分页器 */
|
||||
hideOnSinglePage: true,
|
||||
/**是否可以快速跳转至某页 */
|
||||
showQuickJumper: true,
|
||||
/**是否可以改变 pageSize */
|
||||
showSizeChanger: true,
|
||||
/**数据总数 */
|
||||
total: 0,
|
||||
showTotal: (total: number) => `总共 ${total} 条`,
|
||||
onChange: (page: number, pageSize: number) => {
|
||||
tablePagination.current = page;
|
||||
tablePagination.pageSize = pageSize;
|
||||
},
|
||||
};
|
||||
|
||||
/**表格紧凑型变更操作 */
|
||||
function fnTableSize({ key }: MenuInfo) {
|
||||
tableState.size = key as SizeType;
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
/**查询参数重置 */
|
||||
function fnQueryReset() {
|
||||
queryParams.ipaddr = '';
|
||||
queryParams.userName = '';
|
||||
tablePagination.current = 1;
|
||||
tablePagination.pageSize = 20;
|
||||
fnGetList();
|
||||
}
|
||||
|
||||
/** 查询在线用户列表 */
|
||||
function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listOnline(queryParams).then(res => {
|
||||
if (res.code === 200 && Array.isArray(res.rows)) {
|
||||
tableState.data = res.rows;
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 强退按钮操作 */
|
||||
function fnForceLogout(row: Record<string, string>) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确认强退登录账号为 ${row.userName} 的用户?`,
|
||||
onOk() {
|
||||
const hide = message.loading('正在打开...', 0);
|
||||
forceLogout(row.tokenId).finally(() => {
|
||||
hide();
|
||||
message.error({
|
||||
content: `已强退用户 ${row.userName}`,
|
||||
duration: 2,
|
||||
});
|
||||
});
|
||||
fnGetList();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fnGetList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageContainer :title="title">
|
||||
<template #content>
|
||||
<a-typography-paragraph>
|
||||
登录用户
|
||||
<a-typography-text code>Token</a-typography-text>
|
||||
授权标识记录,存储在
|
||||
<a-typography-text code>Redis</a-typography-text>
|
||||
中,可撤销对用户的授权,拒绝用户请求并强制退出。
|
||||
</a-typography-paragraph>
|
||||
</template>
|
||||
|
||||
<a-card
|
||||
v-show="tableState.seached"
|
||||
:bordered="false"
|
||||
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
|
||||
>
|
||||
<!-- 表格搜索栏 -->
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="登录账号" name="userName">
|
||||
<a-input
|
||||
v-model:value="queryParams.userName"
|
||||
allow-clear
|
||||
:maxlength="30"
|
||||
placeholder="请输入登录账号"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="登录主机" name="ipaddr">
|
||||
<a-input
|
||||
v-model:value="queryParams.ipaddr"
|
||||
allow-clear
|
||||
:maxlength="128"
|
||||
placeholder="请输入登录主机"
|
||||
></a-input> </a-form-item
|
||||
></a-col>
|
||||
<a-col :lg="12" :md="24" :xs="24">
|
||||
<a-form-item>
|
||||
<a-space :size="8">
|
||||
<a-button type="primary" @click.prevent="fnGetList">
|
||||
<template #icon><SearchOutlined /></template>
|
||||
搜索
|
||||
</a-button>
|
||||
<a-button type="default" @click.prevent="fnQueryReset">
|
||||
<template #icon><ClearOutlined /></template>
|
||||
重置
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
|
||||
<a-card :bordered="false" :body-style="{ padding: '0px' }">
|
||||
<!-- 插槽-卡片左侧侧 -->
|
||||
<template #title>
|
||||
{{ title }}
|
||||
</template>
|
||||
|
||||
<!-- 插槽-卡片右侧 -->
|
||||
<template #extra>
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>搜索栏</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.seached"
|
||||
checked-children="显"
|
||||
un-checked-children="隐"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>表格斑马纹</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.striped"
|
||||
checked-children="开"
|
||||
un-checked-children="关"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>刷新</template>
|
||||
<a-button type="text" @click.prevent="fnGetList">
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selected-keys="[tableState.size as string]"
|
||||
@click="fnTableSize"
|
||||
>
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="tokenId"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
:size="tableState.size"
|
||||
:row-class-name="fnTableStriped"
|
||||
:pagination="tablePagination"
|
||||
:scroll="{ x: true }"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'tokenId'">
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnForceLogout(record)"
|
||||
v-perms:has="['monitor:online:forceLogout']"
|
||||
>
|
||||
<template #icon><LogoutOutlined /></template>
|
||||
强退
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</PageContainer>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.table :deep(.table-striped) td {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.table :deep(.ant-pagination) {
|
||||
padding: 0 24px;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,8 @@ import { useRoute } from 'vue-router';
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import { getServer } from '@/api/monitor/server';
|
||||
import { getSystemInfo } from '@/api/monitor/system';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const route = useRoute();
|
||||
|
||||
/**路由标题 */
|
||||
@@ -71,8 +72,8 @@ let server: ServerType = reactive({
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
getServer().then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
getSystemInfo().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
// CPU信息
|
||||
let cpu = res.data.cpu;
|
||||
cpu.coreUsed = cpu.coreUsed.map((item: string) => item).join(' / ');
|
||||
@@ -127,14 +128,6 @@ onMounted(() => {
|
||||
<a-descriptions-item label="项目路径">
|
||||
{{ server.project.appDir }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="项目依赖">
|
||||
<a-tag
|
||||
v-for="(value, name) in server.project.dependencies"
|
||||
:key="name"
|
||||
>
|
||||
{{ name }}:{{ value }}
|
||||
</a-tag>
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</a-card>
|
||||
|
||||
@@ -150,25 +143,9 @@ onMounted(() => {
|
||||
:column="{ lg: 2, md: 2, xs: 1 }"
|
||||
:bordered="true"
|
||||
>
|
||||
<a-descriptions-item
|
||||
label="GO版本"
|
||||
:span="2"
|
||||
v-if="server.system && server.system.go"
|
||||
>
|
||||
<a-descriptions-item label="GO版本" :span="2">
|
||||
{{ server.system.go }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item
|
||||
label="Node版本"
|
||||
v-if="server.system && server.system.node"
|
||||
>
|
||||
{{ server.system.node }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item
|
||||
label="V8版本"
|
||||
v-if="server.system && server.system.v8"
|
||||
>
|
||||
{{ server.system.v8 }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="进程PID号">
|
||||
{{ server.system.processId }}
|
||||
</a-descriptions-item>
|
||||
@@ -175,7 +175,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number):any {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -597,9 +597,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
|
||||
@@ -18,6 +18,7 @@ import { parseDateToStr } from '@/utils/date-utils';
|
||||
import { regExpMobile, regExpEmail } from '@/utils/regular-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { parseDataToTree } from '@/utils/parse-tree-utils';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -126,7 +127,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -220,7 +221,7 @@ function fnModalVisibleByVive(deptId: string | number) {
|
||||
getDept(deptId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
if (res.data.parentId === '0') {
|
||||
modalState.treeData = [
|
||||
{ deptId: '0', parentId: '0', deptName: '根节点' },
|
||||
@@ -261,9 +262,12 @@ function fnModalVisibleByEdit(
|
||||
// 获取部门信息同时查询部门列表(排除节点)
|
||||
Promise.all([getDept(deptId), listDeptExcludeChild(deptId)])
|
||||
.then(resArr => {
|
||||
if (resArr[0].code === 200 && resArr[0].data) {
|
||||
if (resArr[0].code === RESULT_CODE_SUCCESS && resArr[0].data) {
|
||||
modalState.from = Object.assign(modalState.from, resArr[0].data);
|
||||
if (resArr[1].code === 200 && Array.isArray(resArr[1].data)) {
|
||||
if (
|
||||
resArr[1].code === RESULT_CODE_SUCCESS &&
|
||||
Array.isArray(resArr[1].data)
|
||||
) {
|
||||
if (resArr[1].data.length === 0) {
|
||||
modalState.treeData = [
|
||||
{ deptId: '0', parentId: '0', deptName: '根节点' },
|
||||
@@ -299,7 +303,7 @@ function fnModalOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
dept
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
duration: 2,
|
||||
@@ -350,7 +354,7 @@ function fnRecordDelete(deptId: string | number) {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
delDept(deptId).then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
duration: 2,
|
||||
@@ -372,7 +376,7 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listDept(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200 && Array.isArray(res.data)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
|
||||
const treeData = parseDataToTree(res.data, 'deptId');
|
||||
// 初始上级部门和展开编号key
|
||||
if (treeDataAll.length <= 0) {
|
||||
@@ -504,9 +508,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
|
||||
@@ -203,7 +203,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number):any {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -595,9 +595,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
@@ -845,11 +845,12 @@ onMounted(() => {
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="数据排序" name="dictSort">
|
||||
<a-input
|
||||
<a-input-number
|
||||
v-model:value="modalState.from.dictSort"
|
||||
allow-clear
|
||||
:min="0"
|
||||
:max="65535"
|
||||
placeholder="请输入数据排序"
|
||||
></a-input>
|
||||
></a-input-number>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@@ -172,7 +172,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number):any {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -608,9 +608,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
|
||||
@@ -7,15 +7,16 @@ import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import {
|
||||
exportLogininfor,
|
||||
listLogininfor,
|
||||
delLogininfor,
|
||||
cleanLogininfor,
|
||||
unlockLogininfor,
|
||||
} from '@/api/monitor/logininfor';
|
||||
exportSysLogLogin,
|
||||
listSysLogLogin,
|
||||
delSysLogLogin,
|
||||
cleanSysLogLogin,
|
||||
unlock,
|
||||
} from '@/api/system/log/login';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -101,7 +102,7 @@ let tableState: TabeStateType = reactive({
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '日志编号',
|
||||
dataIndex: 'infoId',
|
||||
dataIndex: 'loginId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
@@ -185,7 +186,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -194,7 +195,7 @@ function fnTableSelectedRows(
|
||||
_: (string | number)[],
|
||||
rows: Record<string, string>[]
|
||||
) {
|
||||
tableState.selectedRowKeys = rows.map(item => item.infoId);
|
||||
tableState.selectedRowKeys = rows.map(item => item.loginId);
|
||||
// 针对单个登录账号解锁
|
||||
if (rows.length === 1) {
|
||||
tableState.selectedUserName = rows[0].userName;
|
||||
@@ -210,17 +211,19 @@ function fnRecordDelete() {
|
||||
title: '提示',
|
||||
content: `确认删除访问编号为 【${ids}】 的数据项吗?`,
|
||||
onOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
delLogininfor(ids).then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
const key = 'delSysLogLogin';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
delSysLogLogin(ids).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
@@ -236,17 +239,19 @@ function fnCleanList() {
|
||||
title: '提示',
|
||||
content: `确认清空所有登录日志数据项?`,
|
||||
onOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
cleanLogininfor().then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
const key = 'cleanSysLogLogin';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
cleanSysLogLogin().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `清空成功`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
@@ -264,9 +269,9 @@ function fnUnlock() {
|
||||
content: `确认解锁用户 【${username}】 数据项?`,
|
||||
onOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
unlockLogininfor(username).then(res => {
|
||||
unlock(username).then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${username} 解锁成功`,
|
||||
duration: 3,
|
||||
@@ -288,18 +293,20 @@ function fnExportList() {
|
||||
title: '提示',
|
||||
content: `确认根据搜索条件导出xlsx表格文件吗?`,
|
||||
onOk() {
|
||||
const hide = message.loading('正在打开...', 0);
|
||||
exportLogininfor(toRaw(queryParams)).then(res => {
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
const key = 'exportSysLogLogin';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
exportSysLogLogin(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
saveAs(res.data, `logininfor_${Date.now()}.xlsx`);
|
||||
saveAs(res.data, `sys_log_login_${Date.now()}.xlsx`);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
@@ -317,8 +324,8 @@ function fnGetList() {
|
||||
}
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listLogininfor(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200 && Array.isArray(res.rows)) {
|
||||
listSysLogLogin(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
@@ -429,7 +436,7 @@ onMounted(() => {
|
||||
type="primary"
|
||||
:disabled="!tableState.selectedUserName"
|
||||
@click.prevent="fnUnlock()"
|
||||
v-perms:has="['monitor:logininfor:unlock']"
|
||||
v-perms:has="['system:log:login:unlock']"
|
||||
>
|
||||
<template #icon><UnlockOutlined /></template>
|
||||
解锁
|
||||
@@ -439,7 +446,7 @@ onMounted(() => {
|
||||
danger
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
@click.prevent="fnRecordDelete()"
|
||||
v-perms:has="['monitor:logininfor:remove']"
|
||||
v-perms:has="['system:log:login:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
删除
|
||||
@@ -448,7 +455,7 @@ onMounted(() => {
|
||||
type="dashed"
|
||||
danger
|
||||
@click.prevent="fnCleanList()"
|
||||
v-perms:has="['monitor:logininfor:remove']"
|
||||
v-perms:has="['system:log:login:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
清空
|
||||
@@ -456,7 +463,7 @@ onMounted(() => {
|
||||
<a-button
|
||||
type="dashed"
|
||||
@click.prevent="fnExportList()"
|
||||
v-perms:has="['monitor:logininfor:export']"
|
||||
v-perms:has="['system:log:login:export']"
|
||||
>
|
||||
<template #icon><ExportOutlined /></template>
|
||||
导出
|
||||
@@ -491,9 +498,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
@@ -515,7 +522,7 @@ onMounted(() => {
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="infoId"
|
||||
row-key="loginId"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
@@ -7,14 +7,15 @@ import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import {
|
||||
exportOperlog,
|
||||
listOperlog,
|
||||
delOperlog,
|
||||
cleanOperlog,
|
||||
} from '@/api/monitor/operlog';
|
||||
exportSysLogOperate,
|
||||
listSysLogOperate,
|
||||
delSysLogOperate,
|
||||
cleanSysLogOperate,
|
||||
} from '@/api/system/log/operate';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -197,7 +198,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -232,7 +233,7 @@ let modalState: ModalStateType = reactive({
|
||||
operParam: '',
|
||||
operTime: 0,
|
||||
operUrl: '',
|
||||
operatorType: 1,
|
||||
operType: 1,
|
||||
requestMethod: 'PUT',
|
||||
status: 1,
|
||||
title: '',
|
||||
@@ -263,10 +264,10 @@ function fnRecordDelete() {
|
||||
title: '提示',
|
||||
content: `确认删除访问编号为 【${ids}】 的数据项吗?`,
|
||||
onOk() {
|
||||
const key = 'delOperlog';
|
||||
const key = 'delSysLogOperate';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
delOperlog(ids).then(res => {
|
||||
if (res.code === 200) {
|
||||
delSysLogOperate(ids).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: '删除成功',
|
||||
key,
|
||||
@@ -291,10 +292,10 @@ function fnCleanList() {
|
||||
title: '提示',
|
||||
content: `确认清空所有登录日志数据项?`,
|
||||
onOk() {
|
||||
const key = 'cleanOperlog';
|
||||
const key = 'cleanSysLogOperate';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
cleanOperlog().then(res => {
|
||||
if (res.code === 200) {
|
||||
cleanSysLogOperate().then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: '清空成功',
|
||||
key,
|
||||
@@ -319,16 +320,16 @@ function fnExportList() {
|
||||
title: '提示',
|
||||
content: `确认根据搜索条件导出xlsx表格文件吗?`,
|
||||
onOk() {
|
||||
const key = 'exportOperlog';
|
||||
const key = 'exportSysLogOperate';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
exportOperlog(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200) {
|
||||
exportSysLogOperate(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
saveAs(res.data, `operlog_${Date.now()}.xlsx`);
|
||||
saveAs(res.data, `sys_log_operate_${Date.now()}.xlsx`);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
@@ -350,8 +351,8 @@ function fnGetList() {
|
||||
}
|
||||
queryParams.beginTime = queryRangePicker.value[0];
|
||||
queryParams.endTime = queryRangePicker.value[1];
|
||||
listOperlog(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200 && Array.isArray(res.rows)) {
|
||||
listSysLogOperate(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
@@ -416,11 +417,11 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="操作类型" name="businessType">
|
||||
<a-form-item label="业务类型" name="businessType">
|
||||
<a-select
|
||||
v-model:value="queryParams.businessType"
|
||||
allow-clear
|
||||
placeholder="请选择操作类型"
|
||||
placeholder="请选择业务类型"
|
||||
:options="dict.sysBusinessType"
|
||||
>
|
||||
</a-select>
|
||||
@@ -476,7 +477,7 @@ onMounted(() => {
|
||||
danger
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
@click.prevent="fnRecordDelete()"
|
||||
v-perms:has="['monitor:operlog:remove']"
|
||||
v-perms:has="['system:log:operate:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
删除
|
||||
@@ -485,7 +486,7 @@ onMounted(() => {
|
||||
type="dashed"
|
||||
danger
|
||||
@click.prevent="fnCleanList()"
|
||||
v-perms:has="['monitor:operlog:remove']"
|
||||
v-perms:has="['system:log:operate:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
清空
|
||||
@@ -493,7 +494,7 @@ onMounted(() => {
|
||||
<a-button
|
||||
type="dashed"
|
||||
@click.prevent="fnExportList()"
|
||||
v-perms:has="['monitor:operlog:export']"
|
||||
v-perms:has="['system:log:operate:export']"
|
||||
>
|
||||
<template #icon><ExportOutlined /></template>
|
||||
导出
|
||||
@@ -528,9 +529,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="bottomRight">
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
@@ -583,7 +584,7 @@ onMounted(() => {
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByVive(record)"
|
||||
v-perms:has="['monitor:operlog:query']"
|
||||
v-perms:has="['system:log:operate:query']"
|
||||
>
|
||||
<template #icon><ProfileOutlined /></template>
|
||||
详情
|
||||
@@ -161,7 +161,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number):any {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -573,9 +573,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
|
||||
@@ -1,735 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from 'vue-router';
|
||||
import { reactive, ref, onMounted, toRaw } from 'vue';
|
||||
import { PageContainer } from '@ant-design-vue/pro-layout';
|
||||
import { message, Modal, Form } from 'ant-design-vue/lib';
|
||||
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import {
|
||||
listNotice,
|
||||
getNotice,
|
||||
delNotice,
|
||||
addNotice,
|
||||
updateNotice,
|
||||
} from '@/api/system/notice';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
|
||||
/**路由标题 */
|
||||
let title = ref<string>(route.meta.title ?? '标题');
|
||||
|
||||
/**字典数据 */
|
||||
let dict: {
|
||||
/**公告类型 */
|
||||
sysNoticeType: DictType[];
|
||||
/**公告状态 */
|
||||
sysNoticeStatus: DictType[];
|
||||
} = reactive({
|
||||
sysNoticeType: [],
|
||||
sysNoticeStatus: [],
|
||||
});
|
||||
|
||||
/**查询参数 */
|
||||
let queryParams = reactive({
|
||||
/**公告标题 */
|
||||
noticeTitle: '',
|
||||
/**创建者 */
|
||||
createBy: undefined,
|
||||
/**公告类型 */
|
||||
noticeType: undefined,
|
||||
/**公告状态 */
|
||||
status: undefined,
|
||||
/**当前页数 */
|
||||
pageNum: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
});
|
||||
|
||||
/**查询参数重置 */
|
||||
function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
noticeTitle: '',
|
||||
createBy: '',
|
||||
noticeType: undefined,
|
||||
status: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
});
|
||||
tablePagination.current = 1;
|
||||
tablePagination.pageSize = 20;
|
||||
fnGetList();
|
||||
}
|
||||
|
||||
/**表格状态类型 */
|
||||
type TabeStateType = {
|
||||
/**加载等待 */
|
||||
loading: boolean;
|
||||
/**紧凑型 */
|
||||
size: SizeType;
|
||||
/**斑马纹 */
|
||||
striped: boolean;
|
||||
/**搜索栏 */
|
||||
seached: boolean;
|
||||
/**记录数据 */
|
||||
data: object[];
|
||||
/**勾选记录 */
|
||||
selectedRowKeys: (string | number)[];
|
||||
};
|
||||
|
||||
/**表格状态 */
|
||||
let tableState: TabeStateType = reactive({
|
||||
loading: false,
|
||||
size: 'middle',
|
||||
striped: false,
|
||||
seached: false,
|
||||
data: [],
|
||||
selectedRowKeys: [],
|
||||
});
|
||||
|
||||
/**表格字段列 */
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '公告编号',
|
||||
dataIndex: 'noticeId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '公告标题',
|
||||
dataIndex: 'noticeTitle',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '公告类型',
|
||||
dataIndex: 'noticeType',
|
||||
key: 'noticeType',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '创建者',
|
||||
dataIndex: 'createBy',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
align: 'center',
|
||||
customRender(opt) {
|
||||
if(+opt.value <= 0) return ''
|
||||
return parseDateToStr(+opt.value);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'noticeId',
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
/**表格分页器参数 */
|
||||
let tablePagination = reactive({
|
||||
/**当前页数 */
|
||||
current: 1,
|
||||
/**每页条数 */
|
||||
pageSize: 20,
|
||||
/**默认的每页条数 */
|
||||
defaultPageSize: 20,
|
||||
/**指定每页可以显示多少条 */
|
||||
pageSizeOptions: ['10', '20', '50', '100'],
|
||||
/**只有一页时是否隐藏分页器 */
|
||||
hideOnSinglePage: false,
|
||||
/**是否可以快速跳转至某页 */
|
||||
showQuickJumper: true,
|
||||
/**是否可以改变 pageSize */
|
||||
showSizeChanger: true,
|
||||
/**数据总数 */
|
||||
total: 0,
|
||||
showTotal: (total: number) => `总共 ${total} 条`,
|
||||
onChange: (page: number, pageSize: number) => {
|
||||
tablePagination.current = page;
|
||||
tablePagination.pageSize = pageSize;
|
||||
queryParams.pageNum = page;
|
||||
queryParams.pageSize = pageSize;
|
||||
fnGetList();
|
||||
},
|
||||
});
|
||||
|
||||
/**表格紧凑型变更操作 */
|
||||
function fnTableSize({ key }: MenuInfo) {
|
||||
tableState.size = key as SizeType;
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
/**表格多选 */
|
||||
function fnTableSelectedRowKeys(keys: (string | number)[]) {
|
||||
tableState.selectedRowKeys = keys;
|
||||
}
|
||||
|
||||
/**对话框对象信息状态类型 */
|
||||
type ModalStateType = {
|
||||
/**详情框是否显示 */
|
||||
visibleByView: boolean;
|
||||
/**新增框或修改框是否显示 */
|
||||
visibleByEdit: boolean;
|
||||
/**标题 */
|
||||
title: string;
|
||||
/**表单数据 */
|
||||
from: Record<string, any>;
|
||||
/**确定按钮 loading */
|
||||
confirmLoading: boolean;
|
||||
};
|
||||
|
||||
/**对话框对象信息状态 */
|
||||
let modalState: ModalStateType = reactive({
|
||||
visibleByView: false,
|
||||
visibleByEdit: false,
|
||||
title: '公告',
|
||||
from: {
|
||||
noticeId: undefined,
|
||||
noticeTitle: '',
|
||||
noticeContent: '',
|
||||
noticeType: '2',
|
||||
status: '1',
|
||||
delFlag: '0',
|
||||
remark: '',
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
},
|
||||
confirmLoading: false,
|
||||
});
|
||||
|
||||
/**对话框内表单属性和校验规则 */
|
||||
const modalStateFrom = Form.useForm(
|
||||
modalState.from,
|
||||
reactive({
|
||||
noticeTitle: [
|
||||
{ required: true, min: 2, max: 50, message: '请正确输入公告标题' },
|
||||
],
|
||||
noticeType: [{ required: true, message: '请选择公告类型' }],
|
||||
noticeContent: [
|
||||
{
|
||||
required: true,
|
||||
min: 2,
|
||||
max: 3000,
|
||||
message: '请正确输入公告内容,限10-3000个字符',
|
||||
},
|
||||
],
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 查看
|
||||
* @param noticeId 公告id
|
||||
*/
|
||||
function fnModalVisibleByVive(noticeId: string | number) {
|
||||
if (!noticeId) {
|
||||
message.error(`公告记录存在错误`, 2);
|
||||
return;
|
||||
}
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading('正在打开...', 0);
|
||||
modalState.confirmLoading = true;
|
||||
getNotice(noticeId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '公告信息';
|
||||
modalState.visibleByView = true;
|
||||
} else {
|
||||
message.error(`获取公告信息失败`, 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出显示为 新增或者修改
|
||||
* @param noticeId 公告id, 不传为新增
|
||||
*/
|
||||
function fnModalVisibleByEdit(noticeId?: string | number) {
|
||||
if (!noticeId) {
|
||||
modalStateFrom.resetFields();
|
||||
modalState.title = '添加公告';
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
if (modalState.confirmLoading) return;
|
||||
const hide = message.loading('正在打开...', 0);
|
||||
modalState.confirmLoading = true;
|
||||
getNotice(noticeId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '修改公告';
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
message.error(`获取公告信息失败`, 2);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出确认执行函数
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalOk() {
|
||||
modalStateFrom
|
||||
.validate()
|
||||
.then(() => {
|
||||
modalState.confirmLoading = true;
|
||||
const from = toRaw(modalState.from);
|
||||
const notice = from.noticeId ? updateNotice(from) : addNotice(from);
|
||||
const key = 'notice';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
notice
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
modalState.visibleByEdit = false;
|
||||
modalStateFrom.resetFields();
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
modalState.confirmLoading = false;
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
message.error(`请正确填写 ${e.errorFields.length} 处必填信息!`, 2);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 对话框弹出关闭执行函数
|
||||
* 进行表达规则校验
|
||||
*/
|
||||
function fnModalCancel() {
|
||||
modalState.visibleByEdit = false;
|
||||
modalState.visibleByView = false;
|
||||
modalStateFrom.resetFields();
|
||||
}
|
||||
|
||||
/**
|
||||
* 公告删除
|
||||
* @param noticeId 公告编号ID
|
||||
*/
|
||||
function fnRecordDelete(noticeId: string = '0') {
|
||||
if (noticeId === '0') {
|
||||
noticeId = tableState.selectedRowKeys.join(',');
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: `确认删除公告编号为 【${noticeId}】 的数据项?`,
|
||||
onOk() {
|
||||
const key = 'delNotice';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
delNotice(noticeId).then(res => {
|
||||
if (res.code === 200) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key: key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**查询公告列表 */
|
||||
function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listNotice(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200 && Array.isArray(res.rows)) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
}
|
||||
tablePagination.total = res.total;
|
||||
tableState.data = res.rows;
|
||||
}
|
||||
tableState.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// 初始字典数据
|
||||
Promise.allSettled([
|
||||
getDict('sys_notice_type'),
|
||||
getDict('sys_notice_status'),
|
||||
]).then(resArr => {
|
||||
if (resArr[0].status === 'fulfilled') {
|
||||
dict.sysNoticeType = resArr[0].value;
|
||||
}
|
||||
if (resArr[1].status === 'fulfilled') {
|
||||
dict.sysNoticeStatus = resArr[1].value;
|
||||
}
|
||||
});
|
||||
// 获取列表数据
|
||||
fnGetList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PageContainer :title="title">
|
||||
<template #content>
|
||||
<a-typography-paragraph>
|
||||
发布公告给內部用户的通知。
|
||||
</a-typography-paragraph>
|
||||
</template>
|
||||
|
||||
<a-card
|
||||
v-show="tableState.seached"
|
||||
:bordered="false"
|
||||
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
|
||||
>
|
||||
<!-- 表格搜索栏 -->
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="公告标题" name="noticeTitle">
|
||||
<a-input
|
||||
v-model:value="queryParams.noticeTitle"
|
||||
allow-clear
|
||||
placeholder="请输入公告标题"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="创建者" name="createBy">
|
||||
<a-input
|
||||
v-model:value="queryParams.createBy"
|
||||
allow-clear
|
||||
placeholder="请输入创建者"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="公告类型" name="noticeType">
|
||||
<a-select
|
||||
v-model:value="queryParams.noticeType"
|
||||
allow-clear
|
||||
placeholder="请选择公告类型"
|
||||
:options="dict.sysNoticeType"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="公告状态" name="status">
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
allow-clear
|
||||
placeholder="请选择公告状态"
|
||||
:options="dict.sysNoticeStatus"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item>
|
||||
<a-space :size="8">
|
||||
<a-button type="primary" @click.prevent="fnGetList">
|
||||
<template #icon><SearchOutlined /></template>
|
||||
搜索</a-button
|
||||
>
|
||||
<a-button type="default" @click.prevent="fnQueryReset">
|
||||
<template #icon><ClearOutlined /></template>
|
||||
重置</a-button
|
||||
>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
|
||||
<a-card :bordered="false" :body-style="{ padding: '0px' }">
|
||||
<!-- 插槽-卡片左侧侧 -->
|
||||
<template #title>
|
||||
<a-space :size="8" align="center">
|
||||
<a-button
|
||||
type="primary"
|
||||
@click.prevent="fnModalVisibleByEdit()"
|
||||
v-perms:has="['system:notice:add']"
|
||||
>
|
||||
<template #icon><PlusOutlined /></template>
|
||||
新建
|
||||
</a-button>
|
||||
<a-button
|
||||
type="default"
|
||||
danger
|
||||
:disabled="tableState.selectedRowKeys.length <= 0"
|
||||
@click.prevent="fnRecordDelete()"
|
||||
v-perms:has="['system:notice:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
删除
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<!-- 插槽-卡片右侧 -->
|
||||
<template #extra>
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>搜索栏</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.seached"
|
||||
checked-children="显"
|
||||
un-checked-children="隐"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>表格斑马纹</template>
|
||||
<a-switch
|
||||
v-model:checked="tableState.striped"
|
||||
checked-children="开"
|
||||
un-checked-children="关"
|
||||
size="small"
|
||||
/>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>刷新</template>
|
||||
<a-button type="text" @click.prevent="fnGetList">
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
:selected-keys="[tableState.size as string]"
|
||||
@click="fnTableSize"
|
||||
>
|
||||
<a-menu-item key="default">默认</a-menu-item>
|
||||
<a-menu-item key="middle">中等</a-menu-item>
|
||||
<a-menu-item key="small">紧凑</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="noticeId"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
:size="tableState.size"
|
||||
:row-class-name="fnTableStriped"
|
||||
:pagination="tablePagination"
|
||||
:scroll="{ x: true }"
|
||||
:row-selection="{
|
||||
type: 'checkbox',
|
||||
selectedRowKeys: tableState.selectedRowKeys,
|
||||
onChange: fnTableSelectedRowKeys,
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'noticeType'">
|
||||
<DictTag :options="dict.sysNoticeType" :value="record.noticeType" />
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNoticeStatus" :value="record.status" />
|
||||
</template>
|
||||
<template v-if="column.key === 'noticeId'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>查看详情</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByVive(record.noticeId)"
|
||||
v-perms:has="['system:notice:query']"
|
||||
>
|
||||
<template #icon><ProfileOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>编辑</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record.noticeId)"
|
||||
v-perms:has="['system:notice:edit']"
|
||||
>
|
||||
<template #icon><FormOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>删除</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.noticeId)"
|
||||
v-perms:has="['system:notice:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<!-- 详情框 -->
|
||||
<a-modal
|
||||
width="800px"
|
||||
:visible="modalState.visibleByView"
|
||||
:title="modalState.title"
|
||||
@cancel="fnModalCancel"
|
||||
>
|
||||
<a-form layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="公告标题" name="noticeTitle">
|
||||
{{ modalState.from.noticeTitle }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="公告类型" name="noticeType">
|
||||
<DictTag
|
||||
:options="dict.sysNoticeType"
|
||||
:value="modalState.from.noticeType"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="公告状态" name="status">
|
||||
<DictTag
|
||||
:options="dict.sysNoticeStatus"
|
||||
:value="modalState.from.status"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-item label="公告内容" name="noticeContent">
|
||||
{{ modalState.from.noticeContent }}
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
<a-button key="cancel" @click="fnModalCancel">关闭</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
|
||||
<!-- 新增框或修改框 -->
|
||||
<a-modal
|
||||
width="800px"
|
||||
:keyboard="false"
|
||||
:mask-closable="false"
|
||||
:visible="modalState.visibleByEdit"
|
||||
:title="modalState.title"
|
||||
:confirm-loading="modalState.confirmLoading"
|
||||
@ok="fnModalOk"
|
||||
@cancel="fnModalCancel"
|
||||
>
|
||||
<a-form name="modalStateFrom" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item
|
||||
label="公告标题"
|
||||
name="noticeTitle"
|
||||
v-bind="modalStateFrom.validateInfos.noticeTitle"
|
||||
>
|
||||
<a-input
|
||||
v-model:value="modalState.from.noticeTitle"
|
||||
allow-clear
|
||||
placeholder="请输入公告标题"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item
|
||||
label="公告类型"
|
||||
name="noticeType"
|
||||
v-bind="modalStateFrom.validateInfos.noticeType"
|
||||
>
|
||||
<a-select
|
||||
v-model:value="modalState.from.noticeType"
|
||||
default-value="1"
|
||||
placeholder="公告类型"
|
||||
:options="dict.sysNoticeType"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="6" :xs="24">
|
||||
<a-form-item label="公告状态" name="status">
|
||||
<a-select
|
||||
v-model:value="modalState.from.status"
|
||||
default-value="0"
|
||||
placeholder="公告状态"
|
||||
:options="dict.sysNoticeStatus"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-form-item
|
||||
label="公告内容"
|
||||
name="noticeContent"
|
||||
v-bind="modalStateFrom.validateInfos.noticeContent"
|
||||
>
|
||||
<a-textarea
|
||||
v-model:value="modalState.from.noticeContent"
|
||||
:auto-size="{ minRows: 4, maxRows: 14 }"
|
||||
:maxlength="3000"
|
||||
:show-count="true"
|
||||
placeholder="请输入公告内容"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
</PageContainer>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.table :deep(.table-striped) td {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.table :deep(.ant-pagination) {
|
||||
padding: 0 24px;
|
||||
}
|
||||
</style>
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import { saveAs } from 'file-saver';
|
||||
import { parseDateToStr } from '@/utils/date-utils';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
|
||||
@@ -163,7 +164,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number) {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -231,7 +232,7 @@ function fnModalVisibleByVive(postId: string | number) {
|
||||
getPost(postId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '岗位信息';
|
||||
modalState.visibleByView = true;
|
||||
@@ -257,7 +258,7 @@ function fnModalVisibleByEdit(postId?: string | number) {
|
||||
getPost(postId).then(res => {
|
||||
modalState.confirmLoading = false;
|
||||
hide();
|
||||
if (res.code === 200 && res.data) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && res.data) {
|
||||
modalState.from = Object.assign(modalState.from, res.data);
|
||||
modalState.title = '修改岗位信息';
|
||||
modalState.visibleByEdit = true;
|
||||
@@ -283,7 +284,7 @@ function fnModalOk() {
|
||||
message.loading({ content: '请稍等...', key });
|
||||
post
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `${modalState.title}成功`,
|
||||
key,
|
||||
@@ -334,7 +335,7 @@ function fnRecordDelete(postId: string = '0') {
|
||||
const key = 'delPost';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
delPost(postId).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
key,
|
||||
@@ -362,7 +363,7 @@ function fnExportList() {
|
||||
const key = 'exportPost';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
exportPost(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
key,
|
||||
@@ -386,7 +387,7 @@ function fnGetList() {
|
||||
if (tableState.loading) return;
|
||||
tableState.loading = true;
|
||||
listPost(toRaw(queryParams)).then(res => {
|
||||
if (res.code === 200 && Array.isArray(res.rows)) {
|
||||
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
|
||||
// 取消勾选
|
||||
if (tableState.selectedRowKeys.length > 0) {
|
||||
tableState.selectedRowKeys = [];
|
||||
@@ -531,9 +532,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
|
||||
@@ -91,22 +91,22 @@ let tableState: TabeStateType = reactive({
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '用户编号',
|
||||
dataIndex: 'id',
|
||||
dataIndex: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录账号',
|
||||
dataIndex: 'accountId',
|
||||
dataIndex: 'userName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'name',
|
||||
title: '用户昵称',
|
||||
dataIndex: 'nickName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'phone',
|
||||
dataIndex: 'phonenumber',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
@@ -125,13 +125,13 @@ let tableColumns: ColumnsType = [
|
||||
dataIndex: 'createTime',
|
||||
align: 'center',
|
||||
customRender(opt) {
|
||||
if (!opt.value) return '';
|
||||
return parseDateToStr(opt.value);
|
||||
if (+opt.value <= 0) return '';
|
||||
return parseDateToStr(+opt.value);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'id',
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
@@ -170,7 +170,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number):any {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -209,23 +209,25 @@ function fnModalOk(userIds: string[] | number[]) {
|
||||
message.error(`请选择要分配的用户`, 2);
|
||||
return;
|
||||
}
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
const key = 'authUserChecked';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
authUserChecked({
|
||||
checked: true,
|
||||
userIds: userIds.join(','),
|
||||
roleId: roleId,
|
||||
}).then(res => {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
modalState.visibleBySelectUser = false;
|
||||
message.success({
|
||||
content: `授权用户添加成功`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
@@ -244,19 +246,21 @@ function fnRecordDelete(userId: string | number) {
|
||||
title: '提示',
|
||||
content: `确认取消用户编号为 【${userId}】 的数据项授权?`,
|
||||
onOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
const key = 'authUserChecked';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
authUserChecked({ checked: false, userIds: userId, roleId: roleId }).then(
|
||||
res => {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `取消授权成功`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 3,
|
||||
});
|
||||
}
|
||||
@@ -334,7 +338,7 @@ onMounted(() => {
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :lg="6" :md="12" :xs="24">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="手机号码" name="phonenumber">
|
||||
<a-input
|
||||
v-model:value="queryParams.phonenumber"
|
||||
@@ -343,7 +347,7 @@ onMounted(() => {
|
||||
placeholder="请输入手机号码"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="用户状态" name="status">
|
||||
<a-select
|
||||
@@ -429,9 +433,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
@@ -453,7 +457,7 @@ onMounted(() => {
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="id"
|
||||
row-key="userId"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
@@ -471,13 +475,13 @@ onMounted(() => {
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
</template>
|
||||
<template v-if="column.key === 'id'">
|
||||
<template v-if="column.key === 'userId'">
|
||||
<a-space :size="8" align="center">
|
||||
<a-tooltip>
|
||||
<template #title>取消授权</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.id)"
|
||||
@click.prevent="fnRecordDelete(record.userId)"
|
||||
v-perms:has="['system:role:remove']"
|
||||
>
|
||||
<template #icon><UserDeleteOutlined /></template>
|
||||
|
||||
@@ -88,14 +88,24 @@ let tableState: TabeStateType = reactive({
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '用户编号',
|
||||
dataIndex: 'id',
|
||||
dataIndex: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录账号',
|
||||
dataIndex: 'accountId',
|
||||
dataIndex: 'userName',
|
||||
align: 'center',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '用户昵称',
|
||||
dataIndex: 'nickName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'phonenumber',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户状态',
|
||||
dataIndex: 'status',
|
||||
@@ -107,8 +117,8 @@ let tableColumns: ColumnsType = [
|
||||
dataIndex: 'createTime',
|
||||
align: 'center',
|
||||
customRender(opt) {
|
||||
if (!opt.value) return '';
|
||||
return parseDateToStr(opt.value);
|
||||
if (+opt.value <= 0) return '';
|
||||
return parseDateToStr(+opt.value);
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -224,7 +234,7 @@ watch(
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :lg="8" :md="12" :xs="24">
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item label="手机号码" name="phonenumber">
|
||||
<a-input
|
||||
v-model:value="queryParams.phonenumber"
|
||||
@@ -233,7 +243,7 @@ watch(
|
||||
placeholder="请输入手机号码"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
</a-col>
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item label="用户状态" name="status">
|
||||
<a-select
|
||||
@@ -264,7 +274,7 @@ watch(
|
||||
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="id"
|
||||
row-key="userId"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
@@ -277,11 +287,11 @@ watch(
|
||||
onChange: fnTableSelectedRowKeys,
|
||||
}"
|
||||
>
|
||||
<!-- <template #bodyCell="{ column, record }">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag :options="dict.sysNormalDisable" :value="record.status" />
|
||||
</template>
|
||||
</template> -->
|
||||
</template>
|
||||
</a-table>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
@@ -183,7 +183,7 @@ function fnTableSize({ key }: MenuInfo) {
|
||||
}
|
||||
|
||||
/**表格斑马纹 */
|
||||
function fnTableStriped(_record: unknown, index: number):any {
|
||||
function fnTableStriped(_record: unknown, index: number): any {
|
||||
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
|
||||
}
|
||||
|
||||
@@ -624,18 +624,20 @@ function fnRecordDelete(roleId: string = '0') {
|
||||
title: '提示',
|
||||
content: `确认删除角色编号为 【${roleId}】 的数据项?`,
|
||||
onOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
const key = 'delRole';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
delRole(roleId).then(res => {
|
||||
hide();
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `删除成功`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
fnGetList();
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
@@ -650,17 +652,20 @@ function fnExportList() {
|
||||
title: '提示',
|
||||
content: `确认根据搜索条件导出xlsx表格文件吗?`,
|
||||
onOk() {
|
||||
const hide = message.loading('请稍等...', 0);
|
||||
const key = 'exportRole';
|
||||
message.loading({ content: '请稍等...', key });
|
||||
exportRole(toRaw(queryParams)).then(res => {
|
||||
if (res.code === RESULT_CODE_SUCCESS) {
|
||||
message.success({
|
||||
content: `已完成导出`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
saveAs(res.data, `role_${Date.now()}.xlsx`);
|
||||
} else {
|
||||
message.error({
|
||||
content: `${res.msg}`,
|
||||
key,
|
||||
duration: 2,
|
||||
});
|
||||
}
|
||||
@@ -838,9 +843,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
@@ -928,7 +933,7 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<!-- <a-tooltip v-if="record.roleId !== '1'">
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<template #title>分配数据权限</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@@ -937,7 +942,7 @@ onMounted(() => {
|
||||
>
|
||||
<template #icon><SecurityScanOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip> -->
|
||||
</a-tooltip>
|
||||
<a-tooltip v-if="record.roleId !== '1'">
|
||||
<template #title>分配用户</template>
|
||||
<a-button
|
||||
@@ -1099,7 +1104,7 @@ onMounted(() => {
|
||||
<a-input-number
|
||||
v-model:value="modalState.from.roleSort"
|
||||
:min="0"
|
||||
:max="9999"
|
||||
:max="65535"
|
||||
:step="1"
|
||||
placeholder="排序值"
|
||||
></a-input-number>
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue';
|
||||
import { message } from 'ant-design-vue/lib';
|
||||
import { FileType } from 'ant-design-vue/lib/upload/interface';
|
||||
import { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
|
||||
import { ResultType } from '@/plugins/http-fetch';
|
||||
const emit = defineEmits(['close', 'update:visible']);
|
||||
const props = defineProps({
|
||||
/**窗口标题 */
|
||||
title: {
|
||||
type: String,
|
||||
default: '标题',
|
||||
},
|
||||
/**是否弹出显示,必传 */
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
/**文件上传函数方法,必传 */
|
||||
uploadFileMethod: {
|
||||
type: Function,
|
||||
required: true,
|
||||
},
|
||||
/**下载模板函数方法 */
|
||||
downloadTemplateMethod: {
|
||||
type: Function,
|
||||
default: undefined,
|
||||
},
|
||||
/**显示更新已存在数据勾选项 */
|
||||
showUpdateSupport: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
/**允许上传的文件拓展类型,默认 xls、xlsx */
|
||||
fileExt: {
|
||||
type: Array<string>,
|
||||
default: ['xls', 'xlsx'],
|
||||
},
|
||||
/**上传文件大小(单位MB),默认 10 */
|
||||
fileSize: {
|
||||
type: Number,
|
||||
default: 10,
|
||||
},
|
||||
});
|
||||
|
||||
/**上传状态 */
|
||||
let updateState = reactive({
|
||||
/**是否更新已经存在的数据 */
|
||||
updateSupport: false,
|
||||
/**是否上传中 */
|
||||
loading: false,
|
||||
/**是否已上传文件 */
|
||||
isUpload: false,
|
||||
/**上传结果信息 */
|
||||
msg: '',
|
||||
});
|
||||
|
||||
/**重置上传状态 */
|
||||
function fnResetUpdateState() {
|
||||
updateState = Object.assign(updateState, {
|
||||
updateSupport: false,
|
||||
loading: false,
|
||||
isUpload: false,
|
||||
msg: '',
|
||||
});
|
||||
}
|
||||
|
||||
/**上传前检查或转换压缩 */
|
||||
function fnBeforeUpload(file: FileType) {
|
||||
if (updateState.loading) return false;
|
||||
const isAllowType = props.fileExt.some(v => file.name.endsWith(v));
|
||||
if (!isAllowType) {
|
||||
message.error(`只支持上传文件格式 ${props.fileExt.join('、')}`, 3);
|
||||
}
|
||||
const isLtM = file.size / 1024 / 1024 < props.fileSize;
|
||||
if (!isLtM) {
|
||||
message.error(`上传文件大小必须小于 ${props.fileSize}MB`, 3);
|
||||
}
|
||||
return isAllowType && isLtM;
|
||||
}
|
||||
|
||||
/**上传请求发出 */
|
||||
function fnUpload(up: UploadRequestOption) {
|
||||
if (typeof props.uploadFileMethod !== 'function') return;
|
||||
const hide = message.loading('正在上传并解析数据...', 0);
|
||||
updateState.loading = true;
|
||||
let formData = new FormData();
|
||||
formData.append('file', up.file);
|
||||
formData.append('updateSupport', `${updateState.updateSupport}`);
|
||||
props
|
||||
.uploadFileMethod(formData)
|
||||
.then((res: ResultType) => {
|
||||
updateState.loading = false;
|
||||
updateState.isUpload = true;
|
||||
updateState.msg = res.msg?.replaceAll(/<br\/>+/g, '\r');
|
||||
})
|
||||
.catch((err: { code: number; msg: string }) => {
|
||||
message.error(`上传失败 ${err.msg}`);
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
});
|
||||
}
|
||||
|
||||
/**弹框确认按钮事件 */
|
||||
function fnModalOk() {
|
||||
emit('update:visible', false);
|
||||
emit('close', updateState.isUpload);
|
||||
fnResetUpdateState();
|
||||
}
|
||||
|
||||
/**弹框取消按钮事件 */
|
||||
function fnModalCancel() {
|
||||
emit('update:visible', false);
|
||||
emit('close', updateState.isUpload);
|
||||
fnResetUpdateState();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-modal
|
||||
width="500px"
|
||||
:title="props.title"
|
||||
:visible="props.visible"
|
||||
:keyboard="false"
|
||||
:mask-closable="false"
|
||||
@ok="fnModalOk"
|
||||
@cancel="fnModalCancel"
|
||||
>
|
||||
<a-space :size="8" direction="vertical" style="width: 100%">
|
||||
<a-upload-dragger
|
||||
:disabled="updateState.loading"
|
||||
name="file"
|
||||
:max-count="1"
|
||||
:show-upload-list="false"
|
||||
:before-upload="fnBeforeUpload"
|
||||
:custom-request="fnUpload"
|
||||
>
|
||||
<p class="ant-upload-drag-icon">
|
||||
<inbox-outlined></inbox-outlined>
|
||||
</p>
|
||||
<p class="ant-upload-text">点击选择或将文件拖入边框区域进行上传</p>
|
||||
<p class="ant-upload-hint">
|
||||
仅允许导入
|
||||
{{ props.fileExt.join('、') }}
|
||||
格式文件,上传文件大小
|
||||
{{ props.fileSize }}
|
||||
MB。
|
||||
</p>
|
||||
</a-upload-dragger>
|
||||
<a-row :gutter="18" justify="space-between" align="middle">
|
||||
<a-col :span="12">
|
||||
<a-checkbox
|
||||
v-model:checked="updateState.updateSupport"
|
||||
v-if="showUpdateSupport"
|
||||
>
|
||||
是否更新已经存在的数据
|
||||
</a-checkbox>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-button
|
||||
type="link"
|
||||
title="下载模板"
|
||||
@click="downloadTemplateMethod()"
|
||||
v-if="downloadTemplateMethod"
|
||||
>
|
||||
下载模板
|
||||
</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-textarea
|
||||
:disabled="true"
|
||||
:hidden="updateState.msg.length < 1"
|
||||
:value="updateState.msg"
|
||||
:auto-size="{ minRows: 2, maxRows: 8 }"
|
||||
/>
|
||||
</a-space>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.table :deep(.ant-pagination) {
|
||||
padding: 0 24px;
|
||||
}
|
||||
</style>
|
||||
@@ -6,7 +6,7 @@ import { message, Modal, Form } from 'ant-design-vue/lib';
|
||||
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
||||
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
|
||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||
import UploadXlsxImport from './components/UploadXlsxImport.vue';
|
||||
import UploadModal from '@/components/UploadModal/index.vue';
|
||||
import {
|
||||
importData,
|
||||
importTemplate,
|
||||
@@ -32,7 +32,6 @@ import {
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import { DataNode } from 'ant-design-vue/lib/tree';
|
||||
import { hasPermissions } from '@/plugins/auth-user';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const route = useRoute();
|
||||
@@ -60,6 +59,8 @@ let queryParams = reactive({
|
||||
userName: '',
|
||||
/**手机号 */
|
||||
phonenumber: '',
|
||||
/**部门ID */
|
||||
deptId: '',
|
||||
/**用户状态 */
|
||||
status: undefined,
|
||||
/**记录开始时间 */
|
||||
@@ -77,6 +78,7 @@ function fnQueryReset() {
|
||||
queryParams = Object.assign(queryParams, {
|
||||
userName: '',
|
||||
phonenumber: '',
|
||||
deptId: '',
|
||||
status: undefined,
|
||||
beginTime: '',
|
||||
endTime: '',
|
||||
@@ -119,37 +121,43 @@ let tableState: TabeStateType = reactive({
|
||||
let tableColumns: ColumnsType = [
|
||||
{
|
||||
title: '用户编号',
|
||||
dataIndex: 'id',
|
||||
dataIndex: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录账号',
|
||||
dataIndex: 'accountId',
|
||||
dataIndex: 'userName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'name',
|
||||
title: '用户昵称',
|
||||
dataIndex: 'nickName',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'phone',
|
||||
dataIndex: 'phonenumber',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '用户类型',
|
||||
dataIndex: 'groupName',
|
||||
key: 'groupName',
|
||||
title: '部门名称',
|
||||
dataIndex: 'deptId',
|
||||
key: 'deptId',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
title: '登录地址',
|
||||
dataIndex: 'loginIp',
|
||||
key: 'loginIp',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '登录时间',
|
||||
dataIndex: 'loginDate',
|
||||
align: 'center',
|
||||
customRender(opt) {
|
||||
if (!opt.value) return '';
|
||||
return parseDateToStr(opt.value);
|
||||
if (+opt.value <= 0) return '';
|
||||
return parseDateToStr(+opt.value);
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -160,7 +168,7 @@ let tableColumns: ColumnsType = [
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'id',
|
||||
key: 'userId',
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
@@ -209,12 +217,15 @@ function fnTableSelectedRowKeys(keys: (string | number)[]) {
|
||||
}
|
||||
|
||||
type OptionsType = {
|
||||
/**岗位选择列表 */
|
||||
posts: Record<string, any>[];
|
||||
/**角色选择列表 */
|
||||
roles: Record<string, any>[];
|
||||
};
|
||||
|
||||
/**初始用户选择列表 */
|
||||
let options: OptionsType = {
|
||||
posts: [],
|
||||
roles: [],
|
||||
};
|
||||
|
||||
@@ -261,6 +272,7 @@ let modalState: ModalStateType = reactive({
|
||||
},
|
||||
confirmLoading: false,
|
||||
options: {
|
||||
posts: [],
|
||||
roles: [],
|
||||
},
|
||||
});
|
||||
@@ -328,7 +340,13 @@ function fnModalVisibleByVive(userId: string | number) {
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
modalState.options.roles = roles;
|
||||
modalState.options.posts = posts;
|
||||
const { user, roleIds, postIds } = res.data;
|
||||
modalState.from = Object.assign(modalState.from, user);
|
||||
modalState.from.roleIds = roleIds;
|
||||
@@ -352,6 +370,7 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
modalStateFrom.resetFields();
|
||||
if (options.roles.length > 0) {
|
||||
modalState.options.roles = options.roles;
|
||||
modalState.options.posts = options.posts;
|
||||
modalState.title = '添加用户信息';
|
||||
modalState.visibleByEdit = true;
|
||||
} else {
|
||||
@@ -368,8 +387,15 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
options.roles = roles;
|
||||
options.posts = posts;
|
||||
modalState.options.roles = roles;
|
||||
modalState.options.posts = posts;
|
||||
const { user, roleIds, postIds } = res.data;
|
||||
modalState.from = Object.assign(modalState.from, user);
|
||||
modalState.from.roleIds = roleIds;
|
||||
@@ -394,7 +420,13 @@ function fnModalVisibleByEdit(userId?: string | number) {
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
const posts = res.data.posts.map((m: Record<string, any>) => {
|
||||
const disabled = m.status === '0';
|
||||
Reflect.set(m, 'disabled', disabled);
|
||||
return m;
|
||||
});
|
||||
modalState.options.roles = roles;
|
||||
modalState.options.posts = posts;
|
||||
const { user, roleIds, postIds } = res.data;
|
||||
modalState.from = Object.assign(modalState.from, user);
|
||||
modalState.from.roleIds = roleIds;
|
||||
@@ -463,6 +495,7 @@ function fnModalCancel() {
|
||||
modalState.visibleByResetPwd = false;
|
||||
modalStateFrom.resetFields();
|
||||
modalState.options.roles = [];
|
||||
modalState.options.posts = [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -613,41 +646,67 @@ function fnExportList() {
|
||||
}
|
||||
|
||||
/**对话框表格信息导入对象信息状态类型 */
|
||||
type ModalUploadXlsxImportStateType = {
|
||||
type ModalUploadImportStateType = {
|
||||
/**是否显示 */
|
||||
visible: boolean;
|
||||
/**标题 */
|
||||
title: string;
|
||||
/**是否上传中 */
|
||||
loading: boolean;
|
||||
/**是否更新已经存在的数据 */
|
||||
updateSupport: boolean;
|
||||
/**上传结果信息 */
|
||||
msg: string;
|
||||
/**导入模板下载触发 */
|
||||
templateDownload: boolean;
|
||||
};
|
||||
|
||||
/**对话框表格信息导入对象信息状态 */
|
||||
let modalUploadXlsxImportState: ModalUploadXlsxImportStateType = reactive({
|
||||
let uploadImportState: ModalUploadImportStateType = reactive({
|
||||
visible: false,
|
||||
title: '用户导入',
|
||||
loading: false,
|
||||
updateSupport: false,
|
||||
msg: '',
|
||||
templateDownload: false,
|
||||
});
|
||||
|
||||
/**
|
||||
* 对话框表格信息导入确认执行函数
|
||||
* @param isUpload 是否已上传文件
|
||||
*/
|
||||
function fnModalUploadXlsxImportClose(isUpload: boolean) {
|
||||
if (isUpload) {
|
||||
fnGetList();
|
||||
}
|
||||
}
|
||||
|
||||
/**对话框表格信息导入弹出窗口 */
|
||||
function fnModalUploadXlsxImportOpen() {
|
||||
modalUploadXlsxImportState.visible = true;
|
||||
function fnModalUploadImportOpen() {
|
||||
uploadImportState.updateSupport = false;
|
||||
uploadImportState.msg = '';
|
||||
uploadImportState.visible = true;
|
||||
}
|
||||
|
||||
/**列表导入模板 */
|
||||
function fnModalUploadXlsxImportExportTemplate() {
|
||||
if (modalUploadXlsxImportState.templateDownload) return;
|
||||
modalUploadXlsxImportState.templateDownload = true;
|
||||
/**对话框表格信息导入关闭窗口 */
|
||||
function fnModalUploadImportClose() {
|
||||
uploadImportState.visible = false;
|
||||
}
|
||||
|
||||
/**对话框表格信息导入上传 */
|
||||
function fnModalUploadImportUpload(file: File) {
|
||||
const hide = message.loading('正在上传并解析数据...', 0);
|
||||
uploadImportState.loading = true;
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('updateSupport', `${uploadImportState.updateSupport}`);
|
||||
importData(formData)
|
||||
.then(res => {
|
||||
uploadImportState.msg = res.msg?.replaceAll(/<br\/>+/g, '\r');
|
||||
})
|
||||
.catch((err: { code: number; msg: string }) => {
|
||||
message.error(`上传失败 ${err.msg}`);
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
uploadImportState.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**对话框表格信息导入模板 */
|
||||
function fnModalUploadImportExportTemplate() {
|
||||
if (uploadImportState.templateDownload) return;
|
||||
uploadImportState.templateDownload = true;
|
||||
const hide = message.loading('正在下载...', 0);
|
||||
importTemplate()
|
||||
.then(res => {
|
||||
@@ -666,7 +725,7 @@ function fnModalUploadXlsxImportExportTemplate() {
|
||||
})
|
||||
.finally(() => {
|
||||
hide();
|
||||
modalUploadXlsxImportState.templateDownload = false;
|
||||
uploadImportState.templateDownload = false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -739,25 +798,25 @@ onMounted(() => {
|
||||
<!-- 表格搜索栏 -->
|
||||
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="登录账号" name="userName">
|
||||
<a-input
|
||||
v-model:value="queryParams.userName"
|
||||
allow-clear
|
||||
:maxlength="30"
|
||||
placeholder="请输入登录账号"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item label="用户状态" name="status">
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
allow-clear
|
||||
placeholder="请选择"
|
||||
:options="dict.sysNormalDisable"
|
||||
<a-col :lg="18" :md="12" :xs="24">
|
||||
<a-form-item label="部门名称" name="deptId">
|
||||
<a-tree-select
|
||||
v-model:value="queryParams.deptId"
|
||||
placeholder="部门名称"
|
||||
show-search
|
||||
tree-default-expand-all
|
||||
:tree-data="deptTreeData"
|
||||
:field-names="{
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
}"
|
||||
tree-node-label-prop="label"
|
||||
tree-node-filter-prop="label"
|
||||
style="width: 100%"
|
||||
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
||||
>
|
||||
</a-select>
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
@@ -775,6 +834,51 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="登录账号" name="userName">
|
||||
<a-input
|
||||
v-model:value="queryParams.userName"
|
||||
allow-clear
|
||||
:maxlength="30"
|
||||
placeholder="请输入登录账号"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :xs="24">
|
||||
<a-form-item label="手机号码" name="phonenumber">
|
||||
<a-input
|
||||
v-model:value="queryParams.phonenumber"
|
||||
allow-clear
|
||||
:maxlength="11"
|
||||
placeholder="请输入手机号码"
|
||||
></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="4" :md="12" :xs="24">
|
||||
<a-form-item label="用户状态" name="status">
|
||||
<a-select
|
||||
v-model:value="queryParams.status"
|
||||
allow-clear
|
||||
placeholder="请选择"
|
||||
:options="dict.sysNormalDisable"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8" :md="12" :xs="24">
|
||||
<a-form-item label="登录时间" name="queryRangePicker">
|
||||
<a-range-picker
|
||||
v-model:value="queryRangePicker"
|
||||
allow-clear
|
||||
bordered
|
||||
value-format="YYYY-MM-DD"
|
||||
:placeholder="['登录开始', '登录结束']"
|
||||
style="width: 100%"
|
||||
></a-range-picker>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-card>
|
||||
|
||||
@@ -800,9 +904,9 @@ onMounted(() => {
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
删除
|
||||
</a-button>
|
||||
<!-- <a-button
|
||||
<a-button
|
||||
type="dashed"
|
||||
@click.prevent="fnModalUploadXlsxImportOpen()"
|
||||
@click.prevent="fnModalUploadImportOpen()"
|
||||
v-perms:has="['system:user:import']"
|
||||
>
|
||||
<template #icon><ImportOutlined /></template>
|
||||
@@ -815,7 +919,7 @@ onMounted(() => {
|
||||
>
|
||||
<template #icon><ExportOutlined /></template>
|
||||
导出
|
||||
</a-button> -->
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -846,9 +950,9 @@ onMounted(() => {
|
||||
<template #icon><ReloadOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip placement="topRight">
|
||||
<template #title>密度</template>
|
||||
<a-dropdown trigger="click">
|
||||
<a-dropdown placement="bottomRight" trigger="click">
|
||||
<a-button type="text">
|
||||
<template #icon><ColumnHeightOutlined /></template>
|
||||
</a-button>
|
||||
@@ -870,7 +974,7 @@ onMounted(() => {
|
||||
<!-- 表格列表 -->
|
||||
<a-table
|
||||
class="table"
|
||||
row-key="id"
|
||||
row-key="userId"
|
||||
:columns="tableColumns"
|
||||
:loading="tableState.loading"
|
||||
:data-source="tableState.data"
|
||||
@@ -885,10 +989,10 @@ onMounted(() => {
|
||||
}"
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<!-- <template v-if="column.key === 'deptId'">
|
||||
<template v-if="column.key === 'deptId'">
|
||||
{{ record.dept?.deptName }}
|
||||
</template> -->
|
||||
<!-- <template v-if="column.key === 'status'">
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-switch
|
||||
v-if="record.userId !== '1'"
|
||||
v-perms:has="['system:user:edit']"
|
||||
@@ -905,14 +1009,14 @@ onMounted(() => {
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.status"
|
||||
/>
|
||||
</template> -->
|
||||
<template v-if="column.key === 'id'">
|
||||
<a-space :size="8" align="center" v-if="record.id !== '1'">
|
||||
</template>
|
||||
<template v-if="column.key === 'userId'">
|
||||
<a-space :size="8" align="center" v-if="record.userId !== '1'">
|
||||
<a-tooltip>
|
||||
<template #title>查看详情</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByVive(record.id)"
|
||||
@click.prevent="fnModalVisibleByVive(record.userId)"
|
||||
v-perms:has="['system:user:query']"
|
||||
>
|
||||
<template #icon><ProfileOutlined /></template>
|
||||
@@ -922,7 +1026,7 @@ onMounted(() => {
|
||||
<template #title>编辑</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnModalVisibleByEdit(record.id)"
|
||||
@click.prevent="fnModalVisibleByEdit(record.userId)"
|
||||
v-perms:has="['system:user:edit']"
|
||||
>
|
||||
<template #icon><FormOutlined /></template>
|
||||
@@ -932,13 +1036,13 @@ onMounted(() => {
|
||||
<template #title>删除</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@click.prevent="fnRecordDelete(record.id)"
|
||||
@click.prevent="fnRecordDelete(record.userId)"
|
||||
v-perms:has="['system:user:remove']"
|
||||
>
|
||||
<template #icon><DeleteOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<!-- <a-tooltip>
|
||||
<a-tooltip>
|
||||
<template #title>重置密码</template>
|
||||
<a-button
|
||||
type="link"
|
||||
@@ -947,7 +1051,7 @@ onMounted(() => {
|
||||
>
|
||||
<template #icon><SecurityScanOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip> -->
|
||||
</a-tooltip>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
@@ -1064,7 +1168,21 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="24" :md="24" :xs="24">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户岗位" name="postIds">
|
||||
<a-select
|
||||
:value="modalState.from.postIds"
|
||||
disabled
|
||||
mode="multiple"
|
||||
placeholder="请选择用户岗位"
|
||||
option-label-prop="postName"
|
||||
:options="modalState.options.posts"
|
||||
:field-names="{ label: 'postName', value: 'postId' }"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户角色" name="roleIds">
|
||||
<a-select
|
||||
:value="modalState.from.roleIds"
|
||||
@@ -1230,7 +1348,23 @@ onMounted(() => {
|
||||
</a-form-item>
|
||||
|
||||
<a-row :gutter="16">
|
||||
<a-col :lg="24" :md="24" :xs="24">
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户岗位" name="postIds">
|
||||
<a-select
|
||||
v-model:value="modalState.from.postIds"
|
||||
allow-clear
|
||||
mode="multiple"
|
||||
placeholder="请选择用户岗位"
|
||||
show-search
|
||||
option-filter-prop="postName"
|
||||
option-label-prop="postName"
|
||||
:options="modalState.options.posts"
|
||||
:field-names="{ label: 'postName', value: 'postId' }"
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="12" :md="12" :xs="24">
|
||||
<a-form-item label="用户角色" name="roleIds">
|
||||
<a-select
|
||||
v-model:value="modalState.from.roleIds"
|
||||
@@ -1307,14 +1441,40 @@ onMounted(() => {
|
||||
</a-modal>
|
||||
|
||||
<!-- 上传导入表格数据文件框 -->
|
||||
<!-- <UploadXlsxImport
|
||||
:title="modalUploadXlsxImportState.title"
|
||||
v-model:visible="modalUploadXlsxImportState.visible"
|
||||
:show-update-support="true"
|
||||
:upload-file-method="importData"
|
||||
:download-template-method="fnModalUploadXlsxImportExportTemplate"
|
||||
@close="fnModalUploadXlsxImportClose"
|
||||
/> -->
|
||||
<UploadModal
|
||||
:title="uploadImportState.title"
|
||||
:loading="uploadImportState.loading"
|
||||
@upload="fnModalUploadImportUpload"
|
||||
@close="fnModalUploadImportClose"
|
||||
v-model:visible="uploadImportState.visible"
|
||||
:ext="['.xls', '.xlsx']"
|
||||
:size="10"
|
||||
>
|
||||
<template #default>
|
||||
<a-row :gutter="18" justify="space-between" align="middle">
|
||||
<a-col :span="12">
|
||||
<a-checkbox v-model:checked="uploadImportState.updateSupport">
|
||||
是否更新已经存在的数据
|
||||
</a-checkbox>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<a-button
|
||||
type="link"
|
||||
title="下载模板"
|
||||
@click.prevent="fnModalUploadImportExportTemplate"
|
||||
>
|
||||
下载模板
|
||||
</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-textarea
|
||||
:disabled="true"
|
||||
:hidden="!uploadImportState.msg"
|
||||
:value="uploadImportState.msg"
|
||||
:auto-size="{ minRows: 2, maxRows: 8 }"
|
||||
/>
|
||||
</template>
|
||||
</UploadModal>
|
||||
</PageContainer>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import { ref } from 'vue';
|
||||
|
||||
const baseUrl = import.meta.env.VITE_API_BASE_URL;
|
||||
const url = ref<string>(`${baseUrl}/swagger-ui/index.html`);
|
||||
url.value = 'https://mask-api-midwayjs.apifox.cn/';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"typeRoots": ["src/typings", "./node_modules/@types"],
|
||||
"typeRoots": ["./node_modules/@types"],
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
|
||||
@@ -20,8 +20,8 @@ export default defineConfig(({ mode }) => {
|
||||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
[env.VITE_API_BASE_URL]: {
|
||||
target: 'http://192.168.0.229:3186/api/rest',
|
||||
// target: 'http://192.168.30.3:3040/api/rest',
|
||||
target: 'http://192.168.0.229:3186',
|
||||
// target: 'http://192.168.2.114:3040',
|
||||
changeOrigin: true,
|
||||
rewrite: p => p.replace(/^\/dev-api/, ''),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user