决策信息暂提
This commit is contained in:
parent
012340628a
commit
00da31059b
@ -6,6 +6,8 @@ const AlertTipUriBase = '/api/alertTip';
|
|||||||
|
|
||||||
interface AlarmInfoCreateParams {
|
interface AlarmInfoCreateParams {
|
||||||
id: number;
|
id: number;
|
||||||
|
lineId: number;
|
||||||
|
lineType: string;
|
||||||
alertType: string;
|
alertType: string;
|
||||||
tipTimeIds: string[];
|
tipTimeIds: string[];
|
||||||
areaConfigId: number;
|
areaConfigId: number;
|
||||||
|
@ -73,6 +73,23 @@
|
|||||||
<div class="text-h6">
|
<div class="text-h6">
|
||||||
{{ creatForm.id ? '编辑决策信息' : '新建决策信息' }}
|
{{ creatForm.id ? '编辑决策信息' : '新建决策信息' }}
|
||||||
</div>
|
</div>
|
||||||
|
<q-select
|
||||||
|
outlined
|
||||||
|
label="线路ID"
|
||||||
|
v-model="creatForm.lineId"
|
||||||
|
:options="optionsLineId"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
options-dense
|
||||||
|
lazy-rules
|
||||||
|
:rules="[(val) => val > 0 || '请选择线路ID!']"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
outlined
|
||||||
|
label="线路类型"
|
||||||
|
v-model="creatForm.lineType"
|
||||||
|
:options="optionsLineType"
|
||||||
|
/>
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
label="故障类型"
|
label="故障类型"
|
||||||
@ -169,6 +186,7 @@ import {
|
|||||||
} from 'src/components/alarm/alarmInfoEnum';
|
} from 'src/components/alarm/alarmInfoEnum';
|
||||||
import { ApiError } from 'src/boot/axios';
|
import { ApiError } from 'src/boot/axios';
|
||||||
import { ShowTipTimeConfig, TipTimeConfig } from 'src/api/AlarmTipTimeConfig';
|
import { ShowTipTimeConfig, TipTimeConfig } from 'src/api/AlarmTipTimeConfig';
|
||||||
|
import { pageQuery } from 'src/api/LineInfoApi';
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
@ -191,6 +209,20 @@ const columnDefs: QTableColumn[] = [
|
|||||||
required: true,
|
required: true,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'lineId',
|
||||||
|
label: '线路',
|
||||||
|
field: 'lineId',
|
||||||
|
required: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'lineType',
|
||||||
|
label: '线路类型',
|
||||||
|
field: 'lineType',
|
||||||
|
required: true,
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'alertType',
|
name: 'alertType',
|
||||||
label: '故障类型',
|
label: '故障类型',
|
||||||
@ -283,6 +315,7 @@ const onRequest: QTable['onRequest'] = async (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
queryLineInfo();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
tableRef.value.requestServerInteraction();
|
tableRef.value.requestServerInteraction();
|
||||||
});
|
});
|
||||||
@ -306,6 +339,8 @@ const createFormShow = ref(false);
|
|||||||
const myForm = ref<QForm | null>(null);
|
const myForm = ref<QForm | null>(null);
|
||||||
const creatForm = reactive({
|
const creatForm = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
|
lineId: '',
|
||||||
|
lineType: 'NCC',
|
||||||
alertType: '',
|
alertType: '',
|
||||||
tipTimeIds: [],
|
tipTimeIds: [],
|
||||||
areaConfigId: '',
|
areaConfigId: '',
|
||||||
@ -313,6 +348,25 @@ const creatForm = reactive({
|
|||||||
submissionInfo: '',
|
submissionInfo: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const optionsLineId = ref<{ label: string; value: number }[]>([]);
|
||||||
|
async function queryLineInfo() {
|
||||||
|
try {
|
||||||
|
let response = await pageQuery({
|
||||||
|
current: 1,
|
||||||
|
size: 50,
|
||||||
|
});
|
||||||
|
response.records.forEach((info) => {
|
||||||
|
optionsLineId.value.push({ label: info.name, value: info.lineId });
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
const error = err as ApiError;
|
||||||
|
$q.notify({
|
||||||
|
type: 'negative',
|
||||||
|
message: error.title,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const optionsLineType = ['NCC', 'OCC'];
|
||||||
const optionsAlertType = [
|
const optionsAlertType = [
|
||||||
'蓝显',
|
'蓝显',
|
||||||
'全线蓝显',
|
'全线蓝显',
|
||||||
@ -372,6 +426,8 @@ function onCreate() {
|
|||||||
});
|
});
|
||||||
const params = {
|
const params = {
|
||||||
id: +creatForm.id,
|
id: +creatForm.id,
|
||||||
|
lineId: +creatForm.lineId,
|
||||||
|
lineType: creatForm.lineType,
|
||||||
alertType: (saveAlertTypeData as never)[creatForm.alertType],
|
alertType: (saveAlertTypeData as never)[creatForm.alertType],
|
||||||
tipTimeIds: tipTimeIds,
|
tipTimeIds: tipTimeIds,
|
||||||
areaConfigId: areaConfigId as number,
|
areaConfigId: areaConfigId as number,
|
||||||
@ -440,6 +496,8 @@ async function deleteData(row: AlarmInfoListItem) {
|
|||||||
|
|
||||||
function onReset() {
|
function onReset() {
|
||||||
creatForm.id = '';
|
creatForm.id = '';
|
||||||
|
creatForm.lineId = '';
|
||||||
|
creatForm.lineType = 'NCC';
|
||||||
creatForm.alertType = '';
|
creatForm.alertType = '';
|
||||||
creatForm.tipTimeIds = [];
|
creatForm.tipTimeIds = [];
|
||||||
creatForm.areaConfigId = '';
|
creatForm.areaConfigId = '';
|
||||||
|
Loading…
Reference in New Issue
Block a user