Merge remote-tracking branch 'origin/main' into lichang

This commit is contained in:
TsMask
2024-04-24 15:40:48 +08:00
20 changed files with 790 additions and 63 deletions

View File

@@ -166,12 +166,12 @@ onMounted(() => {
},
]"
>
<a-input
<IntlTelInput
v-model:value="stateForm.form.phonenumber"
allow-clear
:maxlength="11"
:maxlength="16"
:placeholder="t('views.account.settings.phonenumberPleace')"
></a-input>
></IntlTelInput>
</a-form-item>
<a-form-item

View File

@@ -252,6 +252,15 @@ function rowClick(record: any, index: any) {
return false;
} else {
let pronData = toRaw(record);
const totalMemInKB = pronData.memUsage?.totalMem;
const nfUsedMemInKB = pronData.memUsage?.nfUsedMem;
const sysMemUsageInKB = pronData.memUsage?.sysMemUsage;
// 将KB转换为MB
const totalMemInMB = Math.round(totalMemInKB / 1024*100)/100;
const nfUsedMemInMB = Math.round(nfUsedMemInKB / 1024*100)/100;
const sysMemUsageInMB = Math.round(sysMemUsageInKB / 1024*100)/100;
//渲染详细信息
pronInfo = {
hostName: pronData.hostName,
@@ -270,14 +279,14 @@ function rowClick(record: any, index: any) {
'%',
memoryUse:
'Total:' +
pronData.memUsage?.totalMem +
'KB; ' +
totalMemInMB +
'MB; ' +
pronData.name +
':' +
pronData.memUsage?.nfUsedMem +
'KB; SYS:' +
pronData.memUsage?.sysMemUsage +
'KB',
nfUsedMemInMB +
'MB; SYS:' +
sysMemUsageInMB +
'MB',
capability: pronData.capability,
serialNum: pronData.serialNum,
expiryDate: pronData.expiryDate,

View File

@@ -119,6 +119,7 @@ let tableColumns: ColumnsType = [
title: t('common.rowId'),
dataIndex: 'jobLogId',
align: 'center',
width: 100,
},
{
title: t('views.monitor.jobLog.jobName'),
@@ -161,7 +162,7 @@ let tableColumns: ColumnsType = [
dataIndex: 'costTime',
key: 'costTime',
align: 'right',
width: 100,
width: 150,
customRender(opt) {
return `${opt.value} ms`;
},
@@ -470,6 +471,8 @@ onMounted(() => {
v-model:value="queryRangePicker"
allow-clear
bordered
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker>

View File

@@ -40,11 +40,11 @@ let rangePicker = reactive<RangePickerType>({
t('views.monitor.monitor.endTime'),
],
ranges: {
[t('views.monitor.monitor.today')]: [
[t('views.monitor.monitor.yesterday')]: [
dayjs().subtract(1, 'day').startOf('day'),
dayjs().subtract(1, 'day').endOf('day'),
],
[t('views.monitor.monitor.yesterday')]: [dayjs().startOf('day'), dayjs()],
[t('views.monitor.monitor.today')]: [dayjs().startOf('day'), dayjs()],
[t('views.monitor.monitor.week')]: [
dayjs().startOf('week'),
dayjs().endOf('week'),
@@ -66,21 +66,21 @@ let rangePicker = reactive<RangePickerType>({
function fnGetList() {
let startTime = null;
let endTime = null;
const dateString = rangePicker.all;
if (dateString[0]) {
startTime = parseStrToDate(dateString[0], YYYY_MM_DD_HH_MM_SS);
endTime = parseStrToDate(dateString[1], YYYY_MM_DD_HH_MM_SS);
const dateNumber = rangePicker.all;
if (dateNumber[0]) {
startTime = dateNumber[0];
endTime = dateNumber[1];
} else {
const now = new Date();
now.setHours(0, 0, 0, 0);
startTime = now;
endTime = new Date();
startTime = `${now.getTime()}`;
endTime = `${new Date().getTime()}`;
}
getLoad({
type: 'all',
startTime: startTime.getTime(),
endTime: endTime.getTime(),
startTime: startTime,
endTime: endTime,
neType: '#',
neId: '#',
}).then(res => {
@@ -94,10 +94,7 @@ function fnGetList() {
});
// 设置初始时间段
const initRangePicker: [string, string] = [
parseDateToStr(startTime, YYYY_MM_DD_HH_MM_SS),
parseDateToStr(endTime, YYYY_MM_DD_HH_MM_SS),
];
const initRangePicker: [string, string] = [startTime, endTime];
rangePicker.all = initRangePicker;
rangePicker.load = initRangePicker;
rangePicker.cpu = initRangePicker;
@@ -164,7 +161,7 @@ function fnLoadChart(data: Record<string, any>[]) {
type: 'value',
name: `${t('views.monitor.monitor.resourceUsage')} ( % )`,
position: 'right',
alignTicks: false
alignTicks: false,
},
],
grid: { left: '5%', right: '5%', bottom: '20%' },
@@ -446,9 +443,9 @@ onMounted(() => {
v-model:value="rangePicker.all"
:allow-clear="false"
bordered
value-format="YYYY-MM-DD HH:mm:ss"
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
show-time
value-format="x"
:placeholder="rangePicker.placeholder"
:ranges="rangePicker.ranges"
style="width: 100%"
@@ -480,9 +477,9 @@ onMounted(() => {
v-model:value="rangePicker.load"
:allow-clear="false"
bordered
value-format="YYYY-MM-DD HH:mm:ss"
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
show-time
value-format="x"
:placeholder="rangePicker.placeholder"
style="width: 100%"
@change="(_:any, d:[string,string]) => fnGetQuery('load', d)"
@@ -510,9 +507,9 @@ onMounted(() => {
v-model:value="rangePicker.cpu"
:allow-clear="false"
bordered
value-format="YYYY-MM-DD HH:mm:ss"
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
show-time
value-format="x"
:placeholder="rangePicker.placeholder"
style="width: 100%"
@change="(_:any, d:[string,string]) => fnGetQuery('cpu', d)"
@@ -538,9 +535,9 @@ onMounted(() => {
v-model:value="rangePicker.memory"
:allow-clear="false"
bordered
value-format="YYYY-MM-DD HH:mm:ss"
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
show-time
value-format="x"
:placeholder="rangePicker.placeholder"
style="width: 100%"
@change="(_:any, d:[string,string]) => fnGetQuery('memory', d)"
@@ -568,9 +565,9 @@ onMounted(() => {
v-model:value="rangePicker.io"
:allow-clear="false"
bordered
value-format="YYYY-MM-DD HH:mm:ss"
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
show-time
value-format="x"
:placeholder="rangePicker.placeholder"
style="width: 100%"
@change="fnGetQueryIO"
@@ -596,9 +593,9 @@ onMounted(() => {
v-model:value="rangePicker.network"
:allow-clear="false"
bordered
value-format="YYYY-MM-DD HH:mm:ss"
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
show-time
value-format="x"
:placeholder="rangePicker.placeholder"
style="width: 100%"
@change="fnGetQueryNetwork"

View File

@@ -527,6 +527,8 @@ onMounted(() => {
v-model:value="queryRangePicker"
allow-clear
bordered
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker>

View File

@@ -527,6 +527,8 @@ onMounted(() => {
v-model:value="queryRangePicker"
allow-clear
bordered
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker>

View File

@@ -719,7 +719,11 @@ function fnGetList(pageNum?: number) {
}
tablePagination.total = res.total;
tableState.data = res.rows;
if (tablePagination.total <=(queryParams.pageNum - 1) * tablePagination.pageSize &&queryParams.pageNum !== 1) {
if (
tablePagination.total <=
(queryParams.pageNum - 1) * tablePagination.pageSize &&
queryParams.pageNum !== 1
) {
tableState.loading = false;
fnGetList(queryParams.pageNum - 1);
}
@@ -791,6 +795,8 @@ onMounted(() => {
v-model:value="queryRangePicker"
allow-clear
bordered
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker>
@@ -1008,7 +1014,7 @@ onMounted(() => {
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.system.role.roleId')"
:label="t('views.system.role.createTime')"
name="createTime"
>
<span v-if="+modalState.from.createTime > 0">
@@ -1019,7 +1025,10 @@ onMounted(() => {
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.system.role.roleId')" name="roleSort">
<a-form-item
:label="t('views.system.role.roleSort')"
name="roleSort"
>
{{ modalState.from.roleSort }}
</a-form-item>
</a-col>

View File

@@ -58,7 +58,7 @@ let queryParams = reactive({
/**手机号 */
phonenumber: '',
/**部门ID */
deptId: '',
deptId: undefined,
/**用户状态 */
status: undefined,
/**记录开始时间 */
@@ -76,7 +76,7 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, {
userName: '',
phonenumber: '',
deptId: '',
deptId: undefined,
status: undefined,
beginTime: '',
endTime: '',
@@ -434,8 +434,7 @@ function fnModalOk() {
let validateName = ['nickName', 'email', 'phonenumber'];
if (!modalState.from.userId) {
validateName.push('userName', 'password');
}
console.log(validateName);
}
modalStateFrom
.validate(validateName)
.then(() => {
@@ -811,6 +810,7 @@ onMounted(() => {
tree-node-filter-prop="label"
style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
:placeholder="t('common.selectPlease')"
>
</a-tree-select>
</a-form-item>
@@ -877,6 +877,8 @@ onMounted(() => {
v-model:value="queryRangePicker"
allow-clear
bordered
:show-time="{ format: 'HH:mm:ss' }"
format="YYYY-MM-DD HH:mm:ss"
value-format="x"
style="width: 100%"
></a-range-picker>
@@ -1276,6 +1278,7 @@ onMounted(() => {
v-model:value="modalState.from.userName"
allow-clear
:maxlength="30"
:placeholder="t('common.inputPlease')"
>
<template #prefix>
<UserOutlined />
@@ -1292,6 +1295,7 @@ onMounted(() => {
<a-input-password
v-model:value="modalState.from.password"
:maxlength="26"
:placeholder="t('common.inputPlease')"
>
<template #prefix>
<LockOutlined />
@@ -1312,6 +1316,7 @@ onMounted(() => {
v-model:value="modalState.from.nickName"
allow-clear
:maxlength="30"
:placeholder="t('common.inputPlease')"
></a-input>
</a-form-item>
</a-col>
@@ -1329,6 +1334,7 @@ onMounted(() => {
option-label-prop="postName"
:options="modalState.options.posts"
:field-names="{ label: 'postName', value: 'postId' }"
:placeholder="t('common.selectPlease')"
>
</a-select>
</a-form-item>
@@ -1342,11 +1348,12 @@ onMounted(() => {
name="phonenumber"
v-bind="modalStateFrom.validateInfos.phonenumber"
>
<a-input
<IntlTelInput
v-model:value="modalState.from.phonenumber"
allow-clear
:maxlength="16"
></a-input>
:placeholder="t('common.inputPlease')"
></IntlTelInput>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
@@ -1359,6 +1366,7 @@ onMounted(() => {
v-model:value="modalState.from.email"
allow-clear
:maxlength="40"
:placeholder="t('common.inputPlease')"
></a-input>
</a-form-item>
</a-col>
@@ -1371,6 +1379,7 @@ onMounted(() => {
v-model:value="modalState.from.sex"
default-value="1"
:options="dict.sysUserSex"
:placeholder="t('common.selectPlease')"
>
</a-select>
</a-form-item>
@@ -1381,6 +1390,7 @@ onMounted(() => {
v-model:value="modalState.from.status"
default-value="0"
:options="dict.sysNormalDisable"
:placeholder="t('common.selectPlease')"
>
</a-select>
</a-form-item>
@@ -1402,6 +1412,7 @@ onMounted(() => {
option-label-prop="roleName"
:options="modalState.options.roles"
:field-names="{ label: 'roleName', value: 'roleId' }"
:placeholder="t('common.selectPlease')"
>
</a-select>
</a-form-item>
@@ -1425,6 +1436,7 @@ onMounted(() => {
tree-node-filter-prop="label"
style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
:placeholder="t('common.selectPlease')"
>
</a-tree-select>
</a-form-item>
@@ -1439,6 +1451,7 @@ onMounted(() => {
:auto-size="{ minRows: 4, maxRows: 6 }"
:maxlength="450"
:show-count="true"
:placeholder="t('common.inputPlease')"
/>
</a-form-item>
</a-form>