|
@ -1,11 +1,20 @@ |
|
|
import { cloneDeep, merge } from "lodash"; |
|
|
import { cloneDeep, merge } from "lodash"; |
|
|
import * as PresetFormItems from "@screen/common/PresetFormItems.js"; |
|
|
import * as PresetFormItems from "@screen/common/PresetFormItems.js"; |
|
|
|
|
|
import { formList } from "../../../dispatch/EventDetailDialog/data"; |
|
|
|
|
|
|
|
|
export const searchFormList = [ |
|
|
export const searchFormList = [ |
|
|
PresetFormItems.startStation, |
|
|
PresetFormItems.startStation, |
|
|
PresetFormItems.endStation |
|
|
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 = [ |
|
|
export const addEditFormList = [ |
|
|
{ |
|
|
{ |
|
|
label: "部门:", |
|
|
label: "部门:", |
|
@ -38,9 +47,49 @@ export const addEditFormList = [ |
|
|
|
|
|
|
|
|
merge(cloneDeep(PresetFormItems.startStation), { |
|
|
merge(cloneDeep(PresetFormItems.startStation), { |
|
|
required: true, |
|
|
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), { |
|
|
merge(cloneDeep(PresetFormItems.endStation), { |
|
|
required: true, |
|
|
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); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
}), |
|
|
}), |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|