diff --git a/business-css/frontend/src/api/business/project/index.ts b/business-css/frontend/src/api/business/project/index.ts index 8e948d5..fcd9685 100644 --- a/business-css/frontend/src/api/business/project/index.ts +++ b/business-css/frontend/src/api/business/project/index.ts @@ -53,7 +53,7 @@ export function deleteBatchProjects (queryParams:any){ export function topologyDevicesLsit(queryParams:any){ return request({ - url: `/projects/search/${queryParams.id}/topology/devices` , + url: `/projects/${queryParams.id}/topology/devices` , method: 'get', params:queryParams }); diff --git a/business-css/frontend/src/api/business/scenario/index.ts b/business-css/frontend/src/api/business/scenario/index.ts index ceffd06..7c082f1 100644 --- a/business-css/frontend/src/api/business/scenario/index.ts +++ b/business-css/frontend/src/api/business/scenario/index.ts @@ -15,7 +15,7 @@ export function searchScenariosLsit(queryParams:any){ //新增项目 export function addScenarios(data:any){ return request({ - url:'/scenarios' , + url:'/scenarios/createAndReturn' , method: 'Post', data: data }); diff --git a/business-css/frontend/src/assets/add.png b/business-css/frontend/src/assets/add.png new file mode 100644 index 0000000..3e54e29 Binary files /dev/null and b/business-css/frontend/src/assets/add.png differ diff --git a/business-css/frontend/src/views/component/scenario/condition.vue b/business-css/frontend/src/views/component/scenario/condition.vue new file mode 100644 index 0000000..35181af --- /dev/null +++ b/business-css/frontend/src/views/component/scenario/condition.vue @@ -0,0 +1,649 @@ + + + + + + + + + + {{ item.label }} + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.segmentId }} + + + + + 新增分段 + + + + + 时间段 + + s + + - + + s + + + + + + 序号 + 时间(s) + 数值 + 操作 + + + + + {{ Number(indexs) + 1 }} + + + + + + + + + + 删除 + + + + + + 添加一行 + + + + + + + + 配置结果 + + + {{ devicename }} + {{ deviceMaterial }} + + + + 时间(s) + 数值 + + + {{ item.t }} + {{ item.value }} + + + + + + + + + + + \ No newline at end of file diff --git a/business-css/frontend/src/views/component/scenario/index.vue b/business-css/frontend/src/views/component/scenario/index.vue index 1773b04..26fbf66 100644 --- a/business-css/frontend/src/views/component/scenario/index.vue +++ b/business-css/frontend/src/views/component/scenario/index.vue @@ -10,6 +10,7 @@ import { ElForm, ElMessage, ElMessageBox } from "element-plus"; import { searchScenariosLsit,addScenarios,updateScenarios,deleteScenarios,deleteBatchScenarios} from "@/api/business/scenario"; import Page from '@/components/Pagination/page.vue' import { getDictItemById } from '@/api/dict'; +import ConditionModel from '@/views/component/scenario/condition.vue' const algorithmTypeData: any = ref([]); // 算法类型数据 const stepsActive = ref(0); // 步骤导航栏当前激活的步骤索引 const props = defineProps({ // 接收父组件传递的项目信息 @@ -65,7 +66,7 @@ const info: any = ref({ code: "", description: "", }); - +const scenarioId = ref(""); // 事故情景id const dialogVisible = ref(false); function addClick() { title.value = "新增事故情景"; @@ -77,6 +78,8 @@ function addClick() { stepsActive.value = 0; dialogVisible.value = true; } + +const isSwitch = ref(false); // 事故情景id //新建事故情景-确认按钮/修改按钮 function confirmClick(formEl: any) { console.log(info.value) @@ -90,8 +93,14 @@ function confirmClick(formEl: any) { algorithmType: info.value.algorithmType, description: info.value.description, }; + if(isSwitch.value == true){ + return ; + } + isSwitch.value = true addScenarios(params).then((res:any) => { - if(res == true) { + isSwitch.value = false; + if(res && res.code == 0) { + scenarioId.value = res.scenarioId; gettableData(); ElMessage({ type: "success", @@ -104,7 +113,9 @@ function confirmClick(formEl: any) { message: "新增失败", }); } - }); + }).catch(() => { + isSwitch.value = false; + }) } else if (info.value.scenarioId) { const params = { scenarioId: info.value.scenarioId, @@ -222,6 +233,10 @@ const getAlgorithmType = async () => { } catch (error) { } } +const conditionModel = ref() +function submitClick(){ + conditionModel.value?.submitClick() +} onMounted(() => { getAlgorithmType() gettableData(); @@ -289,7 +304,7 @@ onMounted(() => { @@ -299,7 +314,8 @@ onMounted(() => { - + @@ -311,15 +327,12 @@ onMounted(() => { - + - 下一步 + 下一步 + 下一步2