Commit ad1dec32 by 周海峰

Merge branch 'master' of https://code.palacesun.com/wuchao/nse-ui

parents ebb848ed 06c747fd
import request from '@/utils/request'
/**
* License管理 - 查询信息
* @param {*} query
* @returns
*/
export function getlicinfo(query) {
return request({
url: '/getlicinfo',
method: 'get',
params: query
})
}
/**
* License管理 - 上传文件
* @param {*} data
* @returns
*/
export function uploadlic(data) {
return request({
url: '/uploadlic',
method: 'post',
data: data,
headers: {
'Content-Type': 'multipart/form-data'
}
})
}
\ No newline at end of file
import request from '@/utils/request'
/**
* 系统控制台 - 查询信息
* @param {*} data
* @returns
*/
export function command(data) {
return request({
url: '/system/console/command',
method: 'post',
data: data
})
}
/**
* 系统控制台 - 查询log
* @param {*} data
* @returns
*/
export function commandlog(data) {
return request({
url: '/system/console/commandlog',
method: 'post',
data: data
})
}
\ No newline at end of file
import request from '@/utils/request'
/**
* 系统日志管理 - 查询月份
* @param {*} data
* @returns
*/
export function query(data) {
return request({
url: '/system/logconfig/query',
method: 'post',
data: data
})
}
/**
* 系统日志管理 - 保留月份
* @param {*} data
* @returns
*/
export function save(data) {
return request({
url: '/system/logconfig/save',
method: 'post',
data: data
})
}
/**
* 系统日志管理 - 查询日志
* @param {*} data
* @returns
*/
export function querylog(data) {
return request({
url: '/system/logconfig/querylog',
method: 'post',
data: data
})
}
/**
* 系统日志管理 - 下载日志
* @param {*} data
* @returns
*/
export function download(data) {
return request({
url: '/system/logconfig/download',
method: 'post',
data: data,
responseType: 'blob'
})
}
......@@ -204,7 +204,6 @@ const getTableData = () => {
// 导出excel
const exportExcelFunc = () => {
exportExcel({ typecode: queryParams.value.typecode }).then(response => {
const { data } = response;
const blob = new Blob([response], { type: 'application/vnd.ms-excel,charset=utf-8' });
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
......
++ "b/src/views/systemConfig/License/License\347\256\241\347\220\206.md"
<script setup name="License">
import { onMounted, ref, toRefs } from 'vue'
import { ElMessage } from "element-plus";
import CustomUpload from "@/components/CustomUpload/index.vue";
import { getlicinfo, uploadlic } from '@/api/systemConfig/license.js'
const infoData = ref({})
const uploadLoading = ref(false)
// 获取数据
const getlicinfoFunc = async () => {
const { data } = await getlicinfo({})
infoData.value = data
}
// 获取状态说明
const getHeaderName = () => {
const { status, msg } = infoData.value
if (status === '1') {
return '您未上传License'
} else if (status === '2') {
return `您上传License有误(${msg})`
} else if (status === '3') {
return '您已上传有效的License'
}
}
// 上传回调
const handleFileChange = (file) => {
uploadLoading.value = true;
const formData = new FormData();
formData.append('file', file.raw);
uploadlic(formData).then(res => {
const { flag } = res
if (flag) {
uploadLoading.value = false;
ElMessage.success((infoData.status === '2' || infoData.status === '3') ? '文件更新成功' : '文件上传成功');
getlicinfoFunc()
}
uploadLoading.value = false;
}).catch(err => {
uploadLoading.value = false;
})
}
onMounted(() => {
getlicinfoFunc()
})
</script>
<template>
<div class="app-container scroller">
<PageTitle>
<template #title>License管理</template>
</PageTitle>
<div class="app-container__body">
<div class="infoContainer">
<div class="document">
<div class="document-left">
<img class="licenseBg" src="@/assets/images/license/Lisencebg.png" alt="license" />
<img class="mask" v-if="infoData.status === '3'" src="@/assets/images/license/rightMask.png" alt="mask" />
</div>
<div class="document-right">
<div class="title-header">{{ getHeaderName() }}</div>
<div class="title-item">有效期:
{{ ( infoData.startDatelicensekey && infoData.endDatelicensekey ) ? `${ infoData.startDatelicensekey } 至 ${ infoData.endDatelicensekey }` : '--' }}
</div>
<div class="title-item">名称:{{ infoData.licname ? infoData.licname : '--' }}</div>
<div class="title-item">硬盘号:{{ infoData.licInfoIp ? infoData.licInfoIp : '--' }}</div>
<div class="title-item">MAC地址:{{ infoData.licInfoMac ? infoData.licInfoMac : '--' }}</div>
<div class="but">
<el-button :icon="(infoData.status === '2' || infoData.status === '3') ? 'Refresh' : 'Upload'"
:loading="uploadLoading"
type="primary">{{ (infoData.status === '2' || infoData.status === '3') ? '更新授权文件' : '上传授权文件' }}</el-button>
<div class="upload">
<CustomUpload @file-change="handleFileChange" />
</div>
</div>
</div>
</div>
<div class="ipMacContent" v-if="infoData && infoData.ipMacList && infoData.ipMacList.length > 0">
<div class="title">申请License所需信息</div>
<div class="tips">您需要提供应用所在服务器的硬盘号和MAC地址,我们再向您提供License</div>
<div class="point_content">
<el-row class="title_row">
<el-col :span="6">序号</el-col>
<el-col :span="10">当前服务器IP地址</el-col>
<el-col :span="8">当前服务器MAC地址</el-col>
</el-row>
<el-row class="content_row" v-for="(item,index) in infoData.ipMacList" :key="index">
<el-col :span="6">{{ index + 1 }}</el-col>
<el-col :span="10">{{ item.ip }}</el-col>
<el-col :span="8">{{ item.mac }}</el-col>
</el-row>
</div>
</div>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.app-container__body {
align-items: center;
justify-content: center;
.infoContainer {
margin-top: -8%;
min-width: 668px;
.document {
width: 100%;
display: flex;
&-left {
margin-right: 84px;
position: relative;
height: 310px;
.licenseBg {
height: 100%;
}
.mask {
position: absolute;
bottom: 6px;
right: 6px;
width: 70px;
height: 70px;
}
}
&-right {
padding-top: 50px;
.title-header {
font-weight: 700;
font-size: 18px;
color: #333;
position: relative;
margin-bottom: 20px;
}
.title-item {
color: #333;
margin-bottom: 10px;
}
.but {
position: relative;
margin-top: 20px;
position: relative;
overflow: hidden;
.upload {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
}
}
}
}
.ipMacContent {
margin-top: 100px;
.title {
font-size: 16px;
color: #333;
margin-bottom: 4px;
}
.tips {
color: #858f9e;
margin-bottom: 11px;
}
.point_content {
border: 1px solid #d8d8d8;
border-radius: 4px;
background: hsla(0, 0%, 100%, 0.6);
padding: 10px 30px 2px;
.title_row {
color: #333;
margin-bottom: 10px;
}
.content_row {
color: #858f9e;
margin-bottom: 8px;
}
}
}
}
}
</style>
\ No newline at end of file
<script setup name="SystemConsole">
import { onMounted, ref, toRefs, onBeforeUnmount } from 'vue'
import { ElMessage } from "element-plus";
import { command, commandlog } from '@/api/systemConfig/systemConsole.js'
const enterValue = ref('') // 命令内容
const requestOptions = ref('') // 返回结果
const timeRef = ref()
// 执行命令
const handelExecute = async () => {
if (!enterValue.value) {
ElMessage.warning('请输入命令')
return false
}
const { flag, msg } = await command({ command: enterValue.value })
if (flag) {
IntervalRequest()
} else {
ElMessage.error(msg)
}
}
const IntervalRequest = async () => {
const { flag, data, msg } = await commandlog({})
if (flag) {
requestOptions.value = data
timeRef.value = setTimeout(() => {
IntervalRequest()
}, 5000)
} else {
timeRef.value && clearTimeout(timeRef.value)
ElMessage.error(msg)
}
}
onBeforeUnmount(() => {
timeRef.value && clearTimeout(timeRef.value)
})
</script>
<template>
<div class="app-container scroller">
<PageTitle>
<template #title>系统控制台</template>
</PageTitle>
<div class="app-container__body">
<el-form-item label="" prop="">
<div style="display: flex;width: 100%;">
<el-input v-model="enterValue" placeholder="请输入命令"></el-input>
<el-button type="primary" style="width: 120px; margin-left: 10px;" @click="handelExecute()">执行</el-button>
</div>
</el-form-item>
<el-input type="textarea" v-model="requestOptions" rows="20" placeholder="返回结果..." disabled></el-input>
</div>
</div>
</template>
<style lang="scss" scoped>
.app-container__body {
:deep(.el-input__wrapper){
background: #f3f5fa;
}
}
</style>
\ No newline at end of file
++ "b/src/views/systemConfig/SystemConsole/\347\263\273\347\273\237\346\216\247\345\210\266\345\217\260.md"
<script setup name="SystemLogManage">
import { onMounted, ref, reactive } from 'vue'
import { ElMessage } from "element-plus";
import { query, save, querylog, download } from '@/api/systemConfig/systemLogManage.js'
const monthOptions = ref([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]) // 保留月份
const keepMonth = ref('') // 月份值
const queryData = reactive({
count: '',
date: ''
}) // 查询条件
const resultStr = ref('') // 日志值
// 查询月份
const handelQuery = async () => {
const { flag, data, msg } = await query({})
if (flag) {
keepMonth.value = data !== '0' ? data : ''
} else {
ElMessage.error(msg)
}
}
// 保存月份
const handelSave = async () => {
if (!keepMonth.value) {
ElMessage.warning('保留月份不能为空!')
return false
}
const { flag, msg } = await save({ reservemonth: keepMonth.value })
if (flag) {
ElMessage.success('保存成功')
} else {
ElMessage.error(msg)
}
}
// 查询日志
const querylogFunc = async () => {
if (!queryData.date) {
ElMessage.warning('请选择日志日期!')
return false
}
if (!queryData.count) {
ElMessage.warning('请填写查询条数!')
return false
}
const dataObj = {
count: Number(queryData.count),
date: queryData.date
}
const { flag, data, msg } = await querylog(dataObj)
if (flag) {
resultStr.value = data
ElMessage.success('查询成功')
} else {
ElMessage.error(msg)
}
}
// 下载日志
const downloadFunc = async () => {
if (!queryData.date) {
ElMessage.warning('请选择日志日期!')
return false
}
const response = await download({ date: queryData.date })
const blob = new Blob([response]);
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = `系统日志${queryData.date}.log`
link.click()
URL.revokeObjectURL(link.href)
ElMessage.success('下载成功')
}
onMounted(() => {
handelQuery()
})
</script>
<template>
<div class="app-container scroller">
<PageTitle>
<template #title>系统控制台</template>
</PageTitle>
<div class="app-container__body">
<div class="formBox">
<el-form-item label="保留月份:" prop="">
<div style="display: flex;">
<el-select v-model="keepMonth" placeholder="请选择">
<el-option v-for="item in monthOptions" :key="item" :label="item" :value="item">
</el-option>
</el-select>
<el-button type="primary" style="width: 120px; margin-left: 10px;" @click="handelSave()">保存</el-button>
</div>
</el-form-item>
<el-form-item label="日志日期:" prop="">
<div style="width: 100%;justify-content: space-between;display: flex;">
<div style="display: flex;">
<el-date-picker v-model="queryData.date" type="date" placeholder="请选择日志日期"
value-format="YYYY-MM-DD"></el-date-picker>
<div style="display: flex;align-items: center;margin-left: 30px;">
<span></span>
<el-input v-model="queryData.count" style="width: 80px;margin: 0px 6px;"></el-input>
<span></span>
</div>
</div>
<div>
<el-button type="primary" @click="querylogFunc()">查询</el-button>
<el-button type="primary" style="margin-left: 10px;" @click="downloadFunc()">下载</el-button>
</div>
</div>
</el-form-item>
<el-input type="textarea" v-model="resultStr" rows="20" placeholder="" readonly></el-input>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.app-container__body {
:deep(.el-form-item__label){
font-weight: 400;
}
:deep(.el-input__wrapper) {
background: #f3f5fa;
}
:deep(.el-select__wrapper) {
background: #f3f5fa;
}
:deep(.el-textarea__inner) {
background: #f3f5fa;
}
.formBox {
width: 800px;
margin: 0px auto;
}
}
</style>
\ No newline at end of file
++ "b/src/views/systemConfig/SystemLogManage/\347\263\273\347\273\237\346\227\245\345\277\227\347\256\241\347\220\206.md"
++ "b/src/views/systemConfig/\347\263\273\347\273\237\350\256\276\347\275\256.md"
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论