update code

main
lijun 2024-09-24 23:52:42 +08:00
parent b58d556fbe
commit 985c037e7e
3 changed files with 19 additions and 11 deletions

View File

@ -28,7 +28,7 @@
<template v-if="(active == 4 && (state == 0 || state == 3)) || (active == 5 && state == 0)"> <template v-if="(active == 4 && (state == 0 || state == 3)) || (active == 5 && state == 0)">
<el-button type="primary" @click="doPrev"></el-button> <el-button type="primary" @click="doPrev"></el-button>
</template> </template>
<template v-if="active == 4 && state == 3"> <template v-if="active == 4 && (state == 3||state==0)">
<el-button @click="doNext"></el-button> <el-button @click="doNext"></el-button>
</template> </template>
<el-button @click="doNext" v-if="active < 4"></el-button> <el-button @click="doNext" v-if="active < 4"></el-button>
@ -134,7 +134,7 @@ const startComplie = () => {
connection_id: modelInfo.connection_id connection_id: modelInfo.connection_id
}) })
]; ];
addLogs({ msg: "开始编译....", type: "info" }) addLogs({ msg: "开始部署....", type: "info" })
request.all(ajaxs).then(d => { request.all(ajaxs).then(d => {
info.optIds = d.map(it => { info.optIds = d.map(it => {
return { return {
@ -173,9 +173,8 @@ const doGetComplieLogs = () => {
if (info.optIds.filter(d => d.state == 0).length > 0) { if (info.optIds.filter(d => d.state == 0).length > 0) {
setTimeout(doGetComplieLogs, 2000); setTimeout(doGetComplieLogs, 2000);
} else { } else {
//doDeploy();
state.value = 3; state.value = 3;
step4.value.updateState(state.value); step4.value.updateState(0);
} }
}); });
} }
@ -233,8 +232,15 @@ const doNext = () => {
active.value++; active.value++;
} }
} else if (active.value == 4) { } else if (active.value == 4) {
active.value++; let tmp=step4.value.checkForm();
state.value = 0; if(tmp){
active.value++;
info.devices=tmp;
state.value = 0;
}else{
ElMessage.error("请选择设备!");
}
} else if (active.value == 5) { } else if (active.value == 5) {
} else { } else {

View File

@ -118,7 +118,6 @@ const handleChange = (row) => {
return; return;
} }
modelSelection.value = row.device_id + ""; modelSelection.value = row.device_id + "";
emit("selection", row);
} }
const info = reactive({ const info = reactive({
@ -162,11 +161,15 @@ function handleQuery() {
} }
const checkForm = () => { const checkForm = () => {
let rows = info.tableData.filter((d) => d.checked); if (modelSelection.value) {
return rows.length == 0 ? null : rows; let tmps = info.tableData.filter(d => d.device_id == modelSelection.value);
return tmps.length > 0 ? tmps[0] : null;
}
return null;
}; };
const updateState = (s) => { const updateState = (s) => {
info.state = s; info.state = s;
}; };
const updateLogs = (logs) => { const updateLogs = (logs) => {
info.logs = logs; info.logs = logs;

View File

@ -93,8 +93,7 @@ const loadData = () => {
loading.value = true; loading.value = true;
TaskApi.running().then(d => { TaskApi.running().then(d => {
loading.value = false; loading.value = false;
info.dataList = (d.data.data.running_task_list || []).map(it => { info.dataList = (d.data.data.running_task_list || []).map(it => {
it.device_name = (it.device_list || []).map(item => item.device_name).join(",");
it.state = 0; it.state = 0;
return it; return it;
}); });