Merge branch 'develop' of https://gitea.joylink.club/joylink/xian-ncc-da-client into develop
This commit is contained in:
commit
199e775f81
@ -6,6 +6,8 @@ const AlertTipUriBase = '/api/alertTip';
|
||||
|
||||
interface AlarmInfoCreateParams {
|
||||
id: number;
|
||||
lineId: number;
|
||||
lineType: string;
|
||||
alertType: string;
|
||||
tipTimeIds: string[];
|
||||
areaConfigId: number;
|
||||
|
@ -73,6 +73,23 @@
|
||||
<div class="text-h6">
|
||||
{{ creatForm.id ? '编辑决策信息' : '新建决策信息' }}
|
||||
</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
|
||||
outlined
|
||||
label="故障类型"
|
||||
@ -169,6 +186,7 @@ import {
|
||||
} from 'src/components/alarm/alarmInfoEnum';
|
||||
import { ApiError } from 'src/boot/axios';
|
||||
import { ShowTipTimeConfig, TipTimeConfig } from 'src/api/AlarmTipTimeConfig';
|
||||
import { pageQuery } from 'src/api/LineInfoApi';
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
@ -191,6 +209,20 @@ const columnDefs: QTableColumn[] = [
|
||||
required: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'lineId',
|
||||
label: '线路',
|
||||
field: 'lineId',
|
||||
required: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'lineType',
|
||||
label: '线路类型',
|
||||
field: 'lineType',
|
||||
required: true,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
name: 'alertType',
|
||||
label: '故障类型',
|
||||
@ -283,6 +315,7 @@ const onRequest: QTable['onRequest'] = async (props) => {
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
queryLineInfo();
|
||||
setTimeout(() => {
|
||||
tableRef.value.requestServerInteraction();
|
||||
});
|
||||
@ -306,6 +339,8 @@ const createFormShow = ref(false);
|
||||
const myForm = ref<QForm | null>(null);
|
||||
const creatForm = reactive({
|
||||
id: '',
|
||||
lineId: '',
|
||||
lineType: 'NCC',
|
||||
alertType: '',
|
||||
tipTimeIds: [],
|
||||
areaConfigId: '',
|
||||
@ -313,6 +348,25 @@ const creatForm = reactive({
|
||||
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 = [
|
||||
'蓝显',
|
||||
'全线蓝显',
|
||||
@ -372,6 +426,8 @@ function onCreate() {
|
||||
});
|
||||
const params = {
|
||||
id: +creatForm.id,
|
||||
lineId: +creatForm.lineId,
|
||||
lineType: creatForm.lineType,
|
||||
alertType: (saveAlertTypeData as never)[creatForm.alertType],
|
||||
tipTimeIds: tipTimeIds,
|
||||
areaConfigId: areaConfigId as number,
|
||||
@ -440,6 +496,8 @@ async function deleteData(row: AlarmInfoListItem) {
|
||||
|
||||
function onReset() {
|
||||
creatForm.id = '';
|
||||
creatForm.lineId = '';
|
||||
creatForm.lineType = 'NCC';
|
||||
creatForm.alertType = '';
|
||||
creatForm.tipTimeIds = [];
|
||||
creatForm.areaConfigId = '';
|
||||
|
Loading…
Reference in New Issue
Block a user