You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
2.7 KiB
100 lines
2.7 KiB
|
|
import request from '@/utils/request'
|
|
|
|
export function submitTaskRequest(id, jobGroup, time, devices, params, others) {
|
|
let functions;
|
|
let deviceType = others.deviceType;
|
|
if (deviceType == '2'){ //情报板
|
|
functions = [
|
|
{
|
|
"functionId": "11",
|
|
"params": {
|
|
"size": "65535",
|
|
"fileName": "play012.lst"
|
|
}
|
|
},
|
|
{
|
|
"functionId": "13",
|
|
"params": {
|
|
parameters: [params]
|
|
}
|
|
},
|
|
{
|
|
"functionId": "1B",
|
|
"params": {
|
|
"fileId": "12"
|
|
}
|
|
}
|
|
|
|
]
|
|
} else if (deviceType == '5'){ //语音广播
|
|
functions = [
|
|
{
|
|
"functionId": "",
|
|
"params": {
|
|
"name": "task-3",
|
|
"outVol": "6",
|
|
"priority": "1",
|
|
"text": params.text,
|
|
"repeatTimes": "3",
|
|
"termList": [
|
|
{
|
|
"zoneld": "6001",
|
|
"termDN": "601"
|
|
}
|
|
],
|
|
"functionType": "startPaTts"
|
|
}
|
|
}
|
|
]
|
|
|
|
} else if (deviceType == '10') { //疲劳唤醒
|
|
functions = [
|
|
{
|
|
"functionId": "SETMD",
|
|
"params": { SET: params.SETMD }
|
|
},
|
|
{
|
|
"functionId": "SETTM",
|
|
"params": { SET: params.SETTM }
|
|
}
|
|
]
|
|
} else if (deviceType == '12') { //行车诱导
|
|
// { mode: "00", onWorkStatus: "01", inWorkStatus: "02" }
|
|
functions = [{ functionId: "51", params }]
|
|
} else if (deviceType == '13') { //智能设备箱
|
|
functions = [
|
|
{
|
|
"functionId": "SETMD",
|
|
"params": { SET: params.SETMD }
|
|
},
|
|
{
|
|
"functionId": "SETTM",
|
|
"params": { SET: params.SETTM }
|
|
}
|
|
]
|
|
}
|
|
|
|
let temp = [{
|
|
...others,
|
|
devices,
|
|
functions
|
|
}];
|
|
let data = {
|
|
jobGroup,
|
|
time,
|
|
invokeTarget: "com.zc.business.task.ScheduledTaskSchedulingTask.invokeTarget()",
|
|
callParameter: JSON.stringify(temp)
|
|
}
|
|
if(id!=undefined){
|
|
data.jobId = id;
|
|
}
|
|
// console.log(JSON.stringify(data));
|
|
return request({
|
|
// url: '/business/board/batch/publish',
|
|
url: `/business/dcBatchFunctionsJob`,
|
|
method: id ? 'put' : 'post',
|
|
// data: data
|
|
data
|
|
})
|
|
}
|