修改批量修改
This commit is contained in:
parent
6c85a844dd
commit
a4a8ed9535
50
business-css/frontend/src/api/business/event/index.ts
Normal file
50
business-css/frontend/src/api/business/event/index.ts
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
// //获取所有项目列表
|
||||||
|
// export function searchScenariosLsit(queryParams:any){
|
||||||
|
// return request({
|
||||||
|
// url: '/events/by-project' ,
|
||||||
|
// method: 'get',
|
||||||
|
// params:queryParams
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//批量新增或修改事件
|
||||||
|
export function eventsBatchSave(data:any){
|
||||||
|
return request({
|
||||||
|
url:'/events/batchSave' ,
|
||||||
|
method: 'Post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// //更新项目信息
|
||||||
|
// export function updateScenarios(queryParams:any){
|
||||||
|
// return request({
|
||||||
|
// url:'/events' ,
|
||||||
|
// method: 'PUT',
|
||||||
|
// data: queryParams
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// //单个删除项目
|
||||||
|
// export function deleteScenarios(queryParams:any){
|
||||||
|
// return request({
|
||||||
|
// url:'/events/'+queryParams.id ,
|
||||||
|
// method: 'delete'
|
||||||
|
// // params: queryParams
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// //多选删除项目
|
||||||
|
// export function deleteBatchScenarios(queryParams:any){
|
||||||
|
// return request({
|
||||||
|
// url:'/events',
|
||||||
|
// method: 'delete',
|
||||||
|
// data: queryParams
|
||||||
|
// });
|
||||||
|
// }
|
||||||
@ -32,7 +32,7 @@ const props = defineProps({ // 接收父组件传递的项目信息
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
function submitClick() {
|
function submitClick() {
|
||||||
return
|
return menuList.value
|
||||||
}
|
}
|
||||||
function initDeviceData(){
|
function initDeviceData(){
|
||||||
console.log(props.projectInfo)
|
console.log(props.projectInfo)
|
||||||
@ -53,7 +53,7 @@ const attributeData:any = ref([]) // 设备属性数据
|
|||||||
const materialData:any = ref([]) // 变化物料数据
|
const materialData:any = ref([]) // 变化物料数据
|
||||||
const menuList:any = ref([
|
const menuList:any = ref([
|
||||||
{
|
{
|
||||||
label: '条件一',
|
label: '条件1',
|
||||||
target:{
|
target:{
|
||||||
entityType: '',
|
entityType: '',
|
||||||
entityId: '',
|
entityId: '',
|
||||||
@ -169,7 +169,6 @@ function changeMaterial(e:any){ // 设备属性改变时,清空变化物料
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
menuList.value[menuIndex.value].target.property = e
|
menuList.value[menuIndex.value].target.property = e
|
||||||
debugger
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getDeviceInfo(e)
|
getDeviceInfo(e)
|
||||||
@ -191,7 +190,6 @@ function getTimelineList(){
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
function getDeviceInfo(e:any){ // 获取设备信息
|
function getDeviceInfo(e:any){ // 获取设备信息
|
||||||
debugger
|
|
||||||
devicename.value = ""
|
devicename.value = ""
|
||||||
deviceMaterial.value = ""
|
deviceMaterial.value = ""
|
||||||
deviceData.value.forEach((item:any) => {
|
deviceData.value.forEach((item:any) => {
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import { searchScenariosLsit,addScenarios,updateScenarios,deleteScenarios,delete
|
|||||||
import Page from '@/components/Pagination/page.vue'
|
import Page from '@/components/Pagination/page.vue'
|
||||||
import { getDictItemById } from '@/api/dict';
|
import { getDictItemById } from '@/api/dict';
|
||||||
import ConditionModel from '@/views/component/scenario/condition.vue'
|
import ConditionModel from '@/views/component/scenario/condition.vue'
|
||||||
|
import { eventsBatchSave } from '@/api/business/event';
|
||||||
const algorithmTypeData: any = ref([]); // 算法类型数据
|
const algorithmTypeData: any = ref([]); // 算法类型数据
|
||||||
const stepsActive = ref(0); // 步骤导航栏当前激活的步骤索引
|
const stepsActive = ref(0); // 步骤导航栏当前激活的步骤索引
|
||||||
const props = defineProps({ // 接收父组件传递的项目信息
|
const props = defineProps({ // 接收父组件传递的项目信息
|
||||||
@ -235,7 +236,28 @@ const getAlgorithmType = async () => {
|
|||||||
}
|
}
|
||||||
const conditionModel = ref()
|
const conditionModel = ref()
|
||||||
function submitClick(){
|
function submitClick(){
|
||||||
conditionModel.value?.submitClick()
|
const tempData = conditionModel.value?.submitClick()
|
||||||
|
let data:any = []
|
||||||
|
|
||||||
|
tempData.forEach((item: any) => {
|
||||||
|
data.push({
|
||||||
|
triggerTime:'0',
|
||||||
|
attrChanges:JSON.stringify(item) ,
|
||||||
|
scenarioId: scenarioId.value
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
eventsBatchSave(data).then((res:any) => {
|
||||||
|
if (res.code == '0') {
|
||||||
|
// ElMessage({
|
||||||
|
// type: "success",
|
||||||
|
// message: "保存成功",
|
||||||
|
// });
|
||||||
|
dialogVisible.value = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getAlgorithmType()
|
getAlgorithmType()
|
||||||
@ -315,7 +337,7 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="scenario-setting-bottombox">
|
<div class="scenario-setting-bottombox">
|
||||||
<el-form ref="infoForm" :model="info" :rules="rules" label-width="140px" style="width:600px"
|
<el-form ref="infoForm" :model="info" :rules="rules" label-width="140px" style="width:600px"
|
||||||
v-if="stepsActive == 1">
|
v-if="stepsActive == 0">
|
||||||
<el-form-item label="事故情景名称:" prop="name">
|
<el-form-item label="事故情景名称:" prop="name">
|
||||||
<el-input v-model="info.name" style="width: 100%" placeholder="输入事故情景名称" ></el-input>
|
<el-input v-model="info.name" style="width: 100%" placeholder="输入事故情景名称" ></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -328,10 +350,10 @@ onMounted(() => {
|
|||||||
<el-input type="textarea" v-model="info.description" :rows="6" style="width: 100%" placeholder="请输入事故情景描述"></el-input>
|
<el-input type="textarea" v-model="info.description" :rows="6" style="width: 100%" placeholder="请输入事故情景描述"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<ConditionModel v-if="stepsActive == 0" ref="conditionModel" :projectInfo="projectInfo" :scenarioId="scenarioId" />
|
<ConditionModel v-if="stepsActive == 1" ref="conditionModel" :projectInfo="projectInfo" :scenarioId="scenarioId" />
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<el-button v-if="stepsActive == 1" type="primary" @click="confirmClick(infoForm)">下一步</el-button>
|
<el-button v-if="stepsActive == 0" type="primary" @click="confirmClick(infoForm)">下一步</el-button>
|
||||||
<el-button v-else type="primary" @click="submitClick">下一步2</el-button>
|
<el-button v-else type="primary" @click="submitClick">下一步2</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user