|
|
@ -1,11 +1,20 @@ |
|
|
|
import { cloneDeep, merge } from "lodash"; |
|
|
|
import * as PresetFormItems from "@screen/common/PresetFormItems.js"; |
|
|
|
import { formList } from "../../../dispatch/EventDetailDialog/data"; |
|
|
|
|
|
|
|
export const searchFormList = [ |
|
|
|
PresetFormItems.startStation, |
|
|
|
PresetFormItems.endStation |
|
|
|
]; |
|
|
|
|
|
|
|
//里程计算
|
|
|
|
const mileCal = (data) => { |
|
|
|
const { startStakeMark, endStakeMark } = data; |
|
|
|
const start = startStakeMark[0] + "." + Number(startStakeMark[1]); |
|
|
|
const end = endStakeMark[0] + "." + Number(endStakeMark[1]); |
|
|
|
data.mileage = (Number(end) - Number(start)).toFixed(3); |
|
|
|
} |
|
|
|
|
|
|
|
export const addEditFormList = [ |
|
|
|
{ |
|
|
|
label: "部门:", |
|
|
@ -38,11 +47,51 @@ export const addEditFormList = [ |
|
|
|
|
|
|
|
merge(cloneDeep(PresetFormItems.startStation), { |
|
|
|
required: true, |
|
|
|
options: { |
|
|
|
options: [ |
|
|
|
{ |
|
|
|
ons: { |
|
|
|
input(value, ...args) { |
|
|
|
const { data, formList } = args.slice(-1)[0]; |
|
|
|
mileCal(data); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
ons: { |
|
|
|
input(value, ...args) { |
|
|
|
const { data, formList } = args.slice(-1)[0]; |
|
|
|
mileCal(data); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
} |
|
|
|
}), |
|
|
|
merge(cloneDeep(PresetFormItems.endStation), { |
|
|
|
required: true, |
|
|
|
options: { |
|
|
|
options: [ |
|
|
|
{ |
|
|
|
ons: { |
|
|
|
input(value, ...args) { |
|
|
|
const { data, formList } = args.slice(-1)[0]; |
|
|
|
mileCal(data); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
ons: { |
|
|
|
input(value, ...args) { |
|
|
|
const { data, formList } = args.slice(-1)[0]; |
|
|
|
mileCal(data); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
} |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
label: "辖区路段编号:", |
|
|
|
key: "roadCode", |
|
|
|