fix: hostId 变更类型和字段名

This commit is contained in:
TsMask
2025-02-26 09:51:34 +08:00
parent cdc31a9ced
commit 7429a55734
14 changed files with 103 additions and 108 deletions

View File

@@ -52,7 +52,7 @@ let queryParams = reactive({
/**任务组名 */
jobGroup: undefined,
/**任务状态 */
status: undefined,
statusFlag: undefined,
/**当前页数 */
pageNum: 1,
/**每页条数 */
@@ -64,7 +64,7 @@ function fnQueryReset() {
queryParams = Object.assign(queryParams, {
jobName: '',
jobGroup: undefined,
status: undefined,
statusFlag: undefined,
pageNum: 1,
pageSize: 20,
});
@@ -130,8 +130,8 @@ let tableColumns: ColumnsType = [
},
{
title: t('views.monitor.job.status'),
dataIndex: 'status',
key: 'status',
dataIndex: 'statusFlag',
key: 'statusFlag',
align: 'center',
width: 100,
},
@@ -217,7 +217,7 @@ let modalState: ModalStateType = reactive({
misfirePolicy: '3',
concurrent: '0',
jobGroup: 'DEFAULT',
status: '0',
statusFlag: '0',
saveLog: '0',
targetParams: '',
remark: '',
@@ -375,7 +375,7 @@ function fnModalCron(opt: boolean, cronStr?: string) {
*/
function fnRecordStatus(row: Record<string, string>) {
const text =
row.status === '1'
row.statusFlag === '1'
? dict.sysJobStatus.find(s => s.value === '1')?.label
: dict.sysJobStatus.find(s => s.value === '0')?.label;
Modal.confirm({
@@ -384,7 +384,7 @@ function fnRecordStatus(row: Record<string, string>) {
onOk() {
const key = 'changeJobStatus';
message.loading({ content: t('common.loading'), key });
changeJobStatus(row.jobId, row.status).then(res => {
changeJobStatus(row.jobId, row.statusFlag).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('common.msgSuccess', { msg: `${row.jobName} ${text}` }),
@@ -403,10 +403,10 @@ function fnRecordStatus(row: Record<string, string>) {
},
onCancel() {
const value =
row.status === '1'
row.statusFlag === '1'
? dict.sysJobStatus.find(s => s.value === '0')?.value
: dict.sysJobStatus.find(s => s.value === '1')?.value;
row.status = value || '0';
row.statusFlag = value || '0';
},
});
}
@@ -622,9 +622,9 @@ onMounted(() => {
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.monitor.job.status')" name="status">
<a-form-item :label="t('views.monitor.job.status')" name="statusFlag">
<a-select
v-model:value="queryParams.status"
v-model:value="queryParams.statusFlag"
allow-clear
:placeholder="t('common.selectPlease')"
:options="dict.sysJobStatus"
@@ -765,13 +765,13 @@ onMounted(() => {
<template v-if="column.key === 'jobGroup'">
<DictTag :options="dict.sysJobGroup" :value="record.jobGroup" />
</template>
<template v-if="column.key === 'status'">
<template v-if="column.key === 'statusFlag'">
<a-switch
v-if="
dict.sysJobStatus.length > 0 &&
hasPermissions(['monitor:job:changeStatus'])
"
v-model:checked="record.status"
v-model:checked="record.statusFlag"
checked-value="1"
:checked-children="dict.sysJobStatus[0].label"
un-checked-value="0"
@@ -782,7 +782,7 @@ onMounted(() => {
<DictTag
v-else
:options="dict.sysJobStatus"
:value="record.status"
:value="record.statusFlag"
/>
</template>
<template v-if="column.key === 'saveLog'">
@@ -862,9 +862,9 @@ onMounted(() => {
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.monitor.job.status')" name="status">
<a-form-item :label="t('views.monitor.job.status')" name="statusFlag">
{{
dict.sysJobStatus.find(s => s.value === modalState.from.status)
dict.sysJobStatus.find(s => s.value === modalState.from.statusFlag)
?.label
}}
</a-form-item>
@@ -992,9 +992,9 @@ onMounted(() => {
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item :label="t('views.monitor.job.status')" name="status">
<a-form-item :label="t('views.monitor.job.status')" name="statusFlag">
<a-select
v-model:value="modalState.from.status"
v-model:value="modalState.from.statusFlag"
default-value="0"
:placeholder="t('common.selectPlease')"
:options="dict.sysJobStatus"

View File

@@ -52,7 +52,7 @@ let queryParams = reactive({
/**任务组名 */
jobGroup: undefined,
/**执行状态 */
status: undefined,
statusFlag: undefined,
/**记录开始时间 */
beginTime: '',
/**记录结束时间 */
@@ -67,7 +67,7 @@ let queryParams = reactive({
function fnQueryReset() {
if (jobId && jobId !== '0') {
queryParams = Object.assign(queryParams, {
status: undefined,
statusFlag: undefined,
beginTime: '',
endTime: '',
pageNum: 1,
@@ -78,7 +78,7 @@ function fnQueryReset() {
jobId: '',
jobName: '',
jobGroup: undefined,
status: undefined,
statusFlag: undefined,
beginTime: '',
endTime: '',
pageNum: 1,
@@ -142,9 +142,9 @@ let tableColumns: ColumnsType = [
width: 100,
},
{
title: t('views.monitor.jobLog.status'),
dataIndex: 'status',
key: 'status',
title: t('views.monitor.jobLog.statusFlag'),
dataIndex: 'statusFlag',
key: 'statusFlag',
align: 'center',
width: 100,
},
@@ -234,7 +234,7 @@ let modalState: ModalStateType = reactive({
jobGroup: 'DEFAULT',
invokeTarget: '',
targetParams: '',
status: '0',
statusFlag: '0',
jobMsg: '',
createTime: 0,
},
@@ -457,10 +457,10 @@ onMounted(() => {
<a-col :lg="6" :md="12" :xs="24">
<a-form-item
:label="t('views.monitor.jobLog.status')"
name="status"
name="statusFlag"
>
<a-select
v-model:value="queryParams.status"
v-model:value="queryParams.statusFlag"
allow-clear
:placeholder="t('common.selectPlease')"
:options="dict.sysCommonStatus"
@@ -605,13 +605,13 @@ onMounted(() => {
<template v-if="column.key === 'jobGroup'">
<DictTag :options="dict.sysJobGroup" :value="record.jobGroup" />
</template>
<template v-if="column.key === 'status'">
<a-tag :color="+record.status ? 'success' : 'error'">
<template v-if="column.key === 'statusFlag'">
<a-tag :color="+record.statusFlag ? 'success' : 'error'">
{{
[
t('views.monitor.jobLog.status0'),
t('views.monitor.jobLog.status1'),
][+record.status]
][+record.statusFlag]
}}
</a-tag>
</template>
@@ -651,14 +651,14 @@ onMounted(() => {
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.monitor.jobLog.status')"
name="status"
name="statusFlag"
>
<a-tag :color="+modalState.from.status ? 'success' : 'error'">
<a-tag :color="+modalState.from.statusFlag ? 'success' : 'error'">
{{
[
t('views.monitor.jobLog.status0'),
t('views.monitor.jobLog.status1'),
][+modalState.from.status]
][+modalState.from.statusFlag]
}}
</a-tag>
</a-form-item>