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

View File

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

View File

@ -94,7 +94,6 @@ const loadData = () => {
TaskApi.running().then(d => {
loading.value = false;
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;
return it;
});