fix:机组系统子系统下拉框空则全部适配 #88

Merged
xiaojinfei merged 2 commits from dev-xjf into master 3 weeks ago
  1. 10
      src/views/exa/config/HistoryModal.vue
  2. 14
      src/views/exa/exa.data.ts
  3. 4
      src/views/warn/alarm/TrendModal.vue
  4. 72
      src/views/warn/alarm/alarm.data.ts

10
src/views/exa/config/HistoryModal.vue

@ -10,6 +10,7 @@ import { BasicModal, useModalInner } from '@/components/Modal'
import { BasicForm, useForm } from '@/components/Form' import { BasicForm, useForm } from '@/components/Form'
import { getExaHistorys } from '@/api/alert/exa' import { getExaHistorys } from '@/api/alert/exa'
import {EXAHistoryReqVO} from "@/api/alert/warn";
const props = defineProps({ const props = defineProps({
itemName: { itemName: {
@ -65,14 +66,9 @@ const [registerHistoryModal, { setModalProps }] = useModalInner(async (data) =>
}) })
async function handleSubmitR() { async function handleSubmitR() {
const serachFormData = getFieldsValue() const exaHistoryReqVO = getFieldsValue() as EXAHistoryReqVO
loading.value = true loading.value = true
const exaHistoryReqVO = { exaHistoryReqVO.itemName = props.itemName
startTime: serachFormData.startTime,
endTime: serachFormData.endTime,
itemName: props.itemName,
interval: 100,
}
historyData.value = await getExaHistorys(exaHistoryReqVO) historyData.value = await getExaHistorys(exaHistoryReqVO)
loading.value = false loading.value = false

14
src/views/exa/exa.data.ts

@ -127,4 +127,18 @@ export const formHistory: FormSchema[] = [
}, },
}, },
}, },
{
label: '时间间隔',
field: 'interval',
component: 'Select',
defaultValue: 60,
labelWidth:100,
componentProps: {
options: [{ value: 60, label: '60秒' }, { value: 100, label: '100秒' }, { value: 300, label: '300秒' }],
},
required: true,
colProps: {
span: 5,
},
},
] ]

4
src/views/warn/alarm/TrendModal.vue

@ -3,7 +3,7 @@ import { ref } from 'vue'
import moment from 'moment' import moment from 'moment'
import { Card } from 'ant-design-vue' import { Card } from 'ant-design-vue'
import { formTrend } from './alarm.data' import { formHistory } from '../../exa/exa.data'
import HistoryLine from '../../exa/HistoryLine.vue' import HistoryLine from '../../exa/HistoryLine.vue'
import { BasicModal, useModalInner } from '@/components/Modal' import { BasicModal, useModalInner } from '@/components/Modal'
@ -21,7 +21,7 @@ const loading = ref(true)
const [registerForm, { getFieldsValue }] = useForm({ const [registerForm, { getFieldsValue }] = useForm({
labelWidth: 100, labelWidth: 100,
// baseColProps: { span: 24 }, // baseColProps: { span: 24 },
schemas: formTrend, schemas: formHistory,
showResetButton: false, showResetButton: false,
layout: 'horizontal', layout: 'horizontal',
model: { time: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')] }, model: { time: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')] },

72
src/views/warn/alarm/alarm.data.ts

@ -208,40 +208,40 @@ export const columns: BasicColumn[] = [
] ]
export const formTrend: FormSchema[] = [ // export const formTrend: FormSchema[] = [
{ // {
label: '时间', // label: '时间',
field: 'time', // field: 'time',
show: true, // show: true,
component: 'RangePicker', // component: 'RangePicker',
componentProps: { // componentProps: {
placeholder: ['开始时间', '结束时间'], // placeholder: ['开始时间', '结束时间'],
defaultValue: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')], // defaultValue: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')],
valueFormat: 'YYYY-MM-DD HH:mm:ss', // valueFormat: 'YYYY-MM-DD HH:mm:ss',
showTime: { // showTime: {
defaultValue: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')], // defaultValue: [moment().subtract(1, 'day').format('YYYY-MM-DD HH:mm:ss'), moment().format('YYYY-MM-DD HH:mm:ss')],
}, // },
onChange: (e: any) => { // onChange: (e: any) => {
console.log(e) // console.log(e)
}, // },
colProps: { // colProps: {
span: 8, // span: 8,
}, // },
}, // },
}, // },
{ // {
label: '时间间隔', // label: '时间间隔',
field: 'interval', // field: 'interval',
component: 'Select', // component: 'Select',
defaultValue: 60, // defaultValue: 60,
labelWidth:100, // labelWidth:100,
componentProps: { // componentProps: {
options: [{ value: 60, label: '60秒' }, { value: 100, label: '100秒' }, { value: 300, label: '300秒' }], // options: [{ value: 60, label: '60秒' }, { value: 100, label: '100秒' }, { value: 300, label: '300秒' }],
}, // },
required: true, // required: true,
colProps: { // colProps: {
span: 5, // span: 5,
}, // },
}, // },
] // ]

Loading…
Cancel
Save