fix:修复场景新增编辑,数据提取问题

This commit is contained in:
2025-05-08 15:22:15 +08:00
parent 09c9c4eaec
commit 56d4a24e81
4 changed files with 349 additions and 80 deletions

View File

@@ -180,15 +180,19 @@ export default {
handleClickSave() { handleClickSave() {
if (this.informationForm.name === null || this.informationForm.name === '') { if (this.informationForm.name === null || this.informationForm.name === '') {
this.$modal.msgWarning("请输入名称!"); this.$modal.msgWarning("请输入名称!");
return
} }
if (this.informationForm.groupId === null || this.informationForm.groupId === '') { if (this.informationForm.groupId === null || this.informationForm.groupId === '') {
this.$modal.msgWarning("请选择模块!"); this.$modal.msgWarning("请选择模块!");
return
} }
if (this.informationForm.status === null || this.informationForm.status === '') { if (this.informationForm.status === null || this.informationForm.status === '') {
this.$modal.msgWarning("请选择状态"); this.$modal.msgWarning("请选择状态");
return
} }
if (this.informationForm.dutyBy === null || this.informationForm.dutyBy === '') { if (this.informationForm.dutyBy === null || this.informationForm.dutyBy === '') {
this.$modal.msgWarning("请输入责任人"); this.$modal.msgWarning("请输入责任人");
return
} }
addAutomation(this.informationForm).then(res => { addAutomation(this.informationForm).then(res => {
if (res.code === 200) { if (res.code === 200) {

View File

@@ -118,18 +118,19 @@
<el-option key="5" label="CSS属性(storeCssAttribute)" value="5"></el-option> <el-option key="5" label="CSS属性(storeCssAttribute)" value="5"></el-option>
<el-option key="6" label="匹配 xpath 的元素数量(storeXpathCount)" value="6"></el-option> <el-option key="6" label="匹配 xpath 的元素数量(storeXpathCount)" value="6"></el-option>
</el-select> </el-select>
<el-button type="primary" plain @click="addBeforeDataExtractionQOList">添加</el-button> <el-button type="primary" plain @click="addBeforeDataExtractionQOList(index)">添加</el-button>
<!-- 提取窗口信息 --> <!-- 提取窗口信息 -->
<div v-if="saveForm.beforeWindowList.length > 0" class="information"> <div v-if="item.dataExtractionQOList.windowExtractions.length > 0" class="information">
<div>提取窗口信息</div> <div>提取窗口信息</div>
<div v-for="row in saveForm.beforeWindowList"> <div v-for="(row, index1) in item.dataExtractionQOList.windowExtractions">
<div class="time"> <div class="time">
<div class="time-left"> <div class="time-left">
<el-select v-model="row.windowType" class="select"> <el-select v-model="row.windowType" class="select">
<el-option key="1" label="窗口 Handle(storeWindowHandle)" value="1"></el-option> <el-option key="1" label="窗口 Handle(storeWindowHandle)" value="1"></el-option>
<el-option key="2" label="网页标题(storeTitle) " value="2"></el-option> <el-option key="2" label="网页标题(storeTitle) " value="2"></el-option>
</el-select> </el-select>
<el-input class="select" style="margin:0px 10px;" placeholder="请输入"></el-input> <el-input class="select" v-model="row.value" style="margin:0px 10px;"
placeholder="请输入"></el-input>
<el-tooltip class="item" effect="dark" <el-tooltip class="item" effect="dark"
content="将提取的内容保存到变量中,如果元素不存在,则返回值为 'NoSuchElementException'" placement="right"> content="将提取的内容保存到变量中,如果元素不存在,则返回值为 'NoSuchElementException'" placement="right">
<i class="el-icon-info"></i> <i class="el-icon-info"></i>
@@ -139,15 +140,15 @@
<el-switch v-model="row.isDisabled" active-value="1" inactive-value="0" <el-switch v-model="row.isDisabled" active-value="1" inactive-value="0"
@click.native.stop></el-switch> @click.native.stop></el-switch>
<el-button type="text" icon="el-icon-delete" style="color: red;" <el-button type="text" icon="el-icon-delete" style="color: red;"
@click="beforeWindowDelete(index)"></el-button> @click="beforeWindowDelete(index, index1)"></el-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- 提取元素信息 --> <!-- 提取元素信息 -->
<div v-if="saveForm.beforeElementList.length > 0" class="information"> <div v-if="item.dataExtractionQOList.elementExtractions.length > 0" class="information">
<div>提取元素信息</div> <div>提取元素信息</div>
<div v-for="row in saveForm.beforeElementList"> <div v-for="(row, index1) in item.dataExtractionQOList.elementExtractions">
<div class="time"> <div class="time">
<div class="time-left"> <div class="time-left">
<el-select v-model="row.elementType" class="select"> <el-select v-model="row.elementType" class="select">
@@ -158,7 +159,8 @@
<el-option key="5" label="CSS属性(storeCssAttribute)" value="5"></el-option> <el-option key="5" label="CSS属性(storeCssAttribute)" value="5"></el-option>
<el-option key="6" label="匹配 xpath 的元素数量(storeXpathCount)" value="6"></el-option> <el-option key="6" label="匹配 xpath 的元素数量(storeXpathCount)" value="6"></el-option>
</el-select> </el-select>
<el-input class="select" style="margin:0px 10px;" placeholder="请输入"></el-input> <el-input class="select" v-model="row.value" style="margin:0px 10px;"
placeholder="请输入变量"></el-input>
<el-tooltip class="item" effect="dark" <el-tooltip class="item" effect="dark"
content="将提取的内容保存到变量中,如果元素不存在,则返回值为 'NoSuchElementException'" placement="right"> content="将提取的内容保存到变量中,如果元素不存在,则返回值为 'NoSuchElementException'" placement="right">
<i class="el-icon-info"></i> <i class="el-icon-info"></i>
@@ -168,7 +170,40 @@
<el-switch v-model="row.isDisabled" active-value="1" inactive-value="0" <el-switch v-model="row.isDisabled" active-value="1" inactive-value="0"
@click.native.stop></el-switch> @click.native.stop></el-switch>
<el-button type="text" icon="el-icon-delete" style="color: red;" <el-button type="text" icon="el-icon-delete" style="color: red;"
@click="beforeWindowDelete(index)"></el-button> @click="beforeElemetDelete(index, index1)"></el-button>
</div>
</div>
<!-- 普通对象(store) -->
<div v-if="row.elementType === '1'" class="time">
<el-input class="select" v-model="row.elementAttribute" placeholder="普通对象"></el-input>
</div>
<!-- -->
<div v-else class="operateObject-wrap" style="padding: 10px;">
<el-select v-model="row.operateObject" class="select">
<el-option key="1" label="元素对象" value="1"></el-option>
<el-option key="2" label="元素定位" value="2"></el-option>
</el-select>
<!-- 元素对象 -->
<div v-show="row.operateObject != '2'" class="operateObject-wrap">
<el-select v-model="row.operateGroupId" class="select" @change="getOperateGroup">
<el-option v-for="item in groupList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
<el-select v-model="row.operateElementId" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 元素定位 -->
<div v-show="row.operateObject === '2'" class="operateObject-wrap">
<el-select v-model="row.operateLocType" class="select" @change="getOperateLoc">
<el-option v-for="item in groupList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
<el-select v-model="row.operateLocValue" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div> </div>
</div> </div>
</div> </div>
@@ -187,6 +222,157 @@
<el-option key="3" label="数据提取" value="3"></el-option> <el-option key="3" label="数据提取" value="3"></el-option>
</el-select> </el-select>
<el-button type="primary" plain style="margin-left: 10px;" @click="addAfter">添加</el-button> <el-button type="primary" plain style="margin-left: 10px;" @click="addAfter">添加</el-button>
<div class="list">
<div v-for="(item, index) in saveForm.afterList">
<!-- 等待时间 -->
<div v-if="item.operateType === '1'" class="time">
<div class="time-left">
<div class="number">{{ index + 1 }}</div>
<div>等待时间</div>
<el-input-number v-model="item.awateTime" :min="0"></el-input-number>
</div>
<div class="time-right">
<el-switch v-model="item.isDisabled" :active-value="1" :inactive-value="0">
</el-switch>
<el-button type="text" icon="el-icon-delete" style="color: red;"
@click="afterDelete(index)"></el-button>
</div>
</div>
<!-- 数据提取 -->
<div v-if="item.operateType === '3'">
<el-collapse v-model="index" accordion>
<el-collapse-item name="1">
<template slot="title">
<div class="time">
<div class="time-left">
<div class="number">{{ index + 1 }}</div>
<div>数据提取</div>
<el-input v-model="item.name" class="select" @click.native.stop></el-input>
</div>
<div class="time-right">
<el-switch v-model="item.isDisabled" active-value="1" inactive-value="0"
@click.native.stop></el-switch>
<el-button type="text" icon="el-icon-delete" style="color: red;"
@click="afterDelete(index)"></el-button>
</div>
</div>
</template>
<div class="collapse-content">
<div style="margin-bottom: 20px;">将提取的内容保存到变量中</div>
<el-select v-model="saveForm.informationType" class="select">
<el-option key="1" label="提取窗口信息" value="1"></el-option>
<el-option key="2" label="提取元素信息" value="2"></el-option>
</el-select>
<el-select v-if="saveForm.informationType === '1'" v-model="saveForm.windowType" class="select"
style="margin: 0 10px;">
<el-option key="1" label="窗口 Handle(storeWindowHandle)" value="1"></el-option>
<el-option key="2" label="网页标题(storeTitle) " value="2"></el-option>
</el-select>
<el-select v-if="saveForm.informationType === '2'" v-model="saveForm.elementType" class="select"
style="margin: 0 10px;">
<el-option key="1" label="普通对象(store)" value="1"></el-option>
<el-option key="2" label="元素文本(storeText)" value="2"></el-option>
<el-option key="3" label="元素值(storeValue)" value="3"></el-option>
<el-option key="4" label="元素属性(storeAttribute)" value="4"></el-option>
<el-option key="5" label="CSS属性(storeCssAttribute)" value="5"></el-option>
<el-option key="6" label="匹配 xpath 的元素数量(storeXpathCount)" value="6"></el-option>
</el-select>
<el-button type="primary" plain @click="addAfterDataExtractionQOList(index)">添加</el-button>
<!-- 提取窗口信息 -->
<div v-if="item.dataExtractionQOList.windowExtractions.length > 0" class="information">
<div>提取窗口信息</div>
<div v-for="(row, index1) in item.dataExtractionQOList.windowExtractions">
<div class="time">
<div class="time-left">
<el-select v-model="row.windowType" class="select">
<el-option key="1" label="窗口 Handle(storeWindowHandle)" value="1"></el-option>
<el-option key="2" label="网页标题(storeTitle) " value="2"></el-option>
</el-select>
<el-input class="select" v-model="row.value" style="margin:0px 10px;"
placeholder="请输入"></el-input>
<el-tooltip class="item" effect="dark"
content="将提取的内容保存到变量中,如果元素不存在,则返回值为 'NoSuchElementException'" placement="right">
<i class="el-icon-info"></i>
</el-tooltip>
</div>
<div class="time-right">
<el-switch v-model="row.isDisabled" active-value="1" inactive-value="0"
@click.native.stop></el-switch>
<el-button type="text" icon="el-icon-delete" style="color: red;"
@click="afterWindowDelete(index, index1)"></el-button>
</div>
</div>
</div>
</div>
<!-- 提取元素信息 -->
<div v-if="item.dataExtractionQOList.elementExtractions.length > 0" class="information">
<div>提取元素信息</div>
<div v-for="(row, index1) in item.dataExtractionQOList.elementExtractions">
<div class="time">
<div class="time-left">
<el-select v-model="row.elementType" class="select">
<el-option key="1" label="普通对象(store)" value="1"></el-option>
<el-option key="2" label="元素文本(storeText)" value="2"></el-option>
<el-option key="3" label="元素值(storeValue)" value="3"></el-option>
<el-option key="4" label="元素属性(storeAttribute)" value="4"></el-option>
<el-option key="5" label="CSS属性(storeCssAttribute)" value="5"></el-option>
<el-option key="6" label="匹配 xpath 的元素数量(storeXpathCount)" value="6"></el-option>
</el-select>
<el-input class="select" v-model="row.value" style="margin:0px 10px;"
placeholder="请输入变量"></el-input>
<el-tooltip class="item" effect="dark"
content="将提取的内容保存到变量中,如果元素不存在,则返回值为 'NoSuchElementException'" placement="right">
<i class="el-icon-info"></i>
</el-tooltip>
</div>
<div class="time-right">
<el-switch v-model="row.isDisabled" active-value="1" inactive-value="0"
@click.native.stop></el-switch>
<el-button type="text" icon="el-icon-delete" style="color: red;"
@click="afterElemetDelete(index, index1)"></el-button>
</div>
</div>
<!-- 普通对象(store) -->
<div v-if="row.elementType === '1'" class="time">
<el-input class="select" v-model="row.elementAttribute" placeholder="普通对象"></el-input>
</div>
<!-- -->
<div v-else class="operateObject-wrap" style="padding: 10px;">
<el-select v-model="row.operateObject" class="select">
<el-option key="1" label="元素对象" value="1"></el-option>
<el-option key="2" label="元素定位" value="2"></el-option>
</el-select>
<!-- 元素对象 -->
<div v-show="row.operateObject != '2'" class="operateObject-wrap">
<el-select v-model="row.operateGroupId" class="select" @change="getOperateGroup">
<el-option v-for="item in groupList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
<el-select v-model="row.operateElementId" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<!-- 元素定位 -->
<div v-show="row.operateObject === '2'" class="operateObject-wrap">
<el-select v-model="row.operateLocType" class="select" @change="getOperateLoc">
<el-option v-for="item in groupList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
<el-select v-model="row.operateLocValue" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>
</div>
</div>
</div>
</el-collapse-item>
</el-collapse>
</div>
</div>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="错误处理" name="forth"> <el-tab-pane label="错误处理" name="forth">
<el-form :model="saveForm"> <el-form :model="saveForm">
@@ -242,7 +428,7 @@ export default {
saveForm: { saveForm: {
errorHandling: '1', // 错误处理 errorHandling: '1', // 错误处理
waitElementTime: 15000, // 等待元素超时时间 waitElementTime: 15000, // 等待元素超时时间
screenshotConfiguration: '1', // 截图配置 screenshotConfiguration: 1, // 截图配置
beforeList: [], // 前置数组 beforeList: [], // 前置数组
afterList: [], // 后置数组 afterList: [], // 后置数组
before: '1', before: '1',
@@ -250,10 +436,6 @@ export default {
informationType: '1', informationType: '1',
windowType: null, windowType: null,
elementType: null, elementType: null,
beforeWindowList: [], // 前置-窗口信息数组
beforeElementList: [], // 前置-元素信息数组
afterWindowList: [], // 后置-窗口信息数组
afterElementList: [], // 后置-元素信息数组
}, },
searchForm: { searchForm: {
pageNum: 1, pageNum: 1,
@@ -279,6 +461,8 @@ export default {
locType: [{ required: true, message: '请选择定位类型', trigger: 'blur' }], locType: [{ required: true, message: '请选择定位类型', trigger: 'blur' }],
elementLoc: [{ required: true, message: '请输入元素定位', trigger: 'blur' }], elementLoc: [{ required: true, message: '请输入元素定位', trigger: 'blur' }],
}, },
groupList: [], // 操作对象分组
elementList: [], // 操作对象分组
} }
}, },
mounted() { mounted() {
@@ -353,42 +537,144 @@ export default {
var param = { var param = {
settingType: '1', // 前置操作 settingType: '1', // 前置操作
operateType: '3', // 数据提取 operateType: '3', // 数据提取
dataExtractionQOList: [], dataExtractionQOList: {
windowExtractions: [], // 提取窗口信息
elementExtractions: [], // 提取元素信息
},
isDisabled: '1', isDisabled: '1',
name: '数据提取', name: '数据提取',
} }
this.saveForm.beforeList.push(param) this.saveForm.beforeList.push(param)
} }
}, },
// 添加 - 后置操作 // 添加 - 后置操作
addAfter() { }, addAfter() {
if (this.saveForm.after === '1') {
// 等待时间
var param = {
settingType: '2', // 后置操作
operateType: '1', // 等待时间
awateTime: 15000,
isDisabled: '1',
}
this.saveForm.afterList.push(param)
} else {
// 数据提取
var param = {
settingType: '2', // 后置操作
operateType: '3', // 数据提取
dataExtractionQOList: {
windowExtractions: [], // 提取窗口信息
elementExtractions: [], // 提取元素信息
},
isDisabled: '1',
name: '数据提取',
}
this.saveForm.afterList.push(param)
}
},
// 删除 // 删除
beforeDelete(val) { beforeDelete(val) {
this.saveForm.beforeList = this.saveForm.beforeList.filter((item, index) => index !== val); this.saveForm.beforeList = this.saveForm.beforeList.filter((item, index) => index !== val);
}, },
afterDelete(val) {
this.saveForm.afterList = this.saveForm.afterList.filter((item, index) => index !== val);
},
// 添加 // 添加
addBeforeDataExtractionQOList() { addBeforeDataExtractionQOList(index) {
if (this.saveForm.informationType === '1' && this.saveForm.windowType != null) { if (this.saveForm.informationType === '1' && this.saveForm.windowType != null) {
// 提取窗口信息且子分类不为空 // 提取窗口信息且子分类不为空
var param = { var param = {
windowType: this.saveForm.windowType, windowType: this.saveForm.windowType,
value: null, value: null,
isDisabled: '1', isDisabled: '1',
informationType: '1',
} }
this.saveForm.beforeWindowList.push(param) this.saveForm.beforeList[index].dataExtractionQOList.windowExtractions.push(param)
} else if (this.saveForm.informationType === '2' && this.saveForm.elementType != null) { } else if (this.saveForm.informationType === '2' && this.saveForm.elementType != null) {
// 提取元素信息且子分类不为空 // 提取元素信息且子分类不为空
var param = {
elementType: this.saveForm.elementType,
value: null,
isDisabled: '1',
elementAttribute: null,
informationType: '2',
operateObject: null, // 操作对象
operateGroupId: null, // 元素对象
operateElementId: null, // 元素对象
operateLocType: null, // 元素定位
operateLocValue: null, // 元素定位
}
this.saveForm.beforeList[index].dataExtractionQOList.elementExtractions.push(param)
} else {
this.$modal.msgError("请选择子分类");
}
},
addAfterDataExtractionQOList(index) {
if (this.saveForm.informationType === '1' && this.saveForm.windowType != null) {
// 提取窗口信息且子分类不为空
var param = {
windowType: this.saveForm.windowType,
value: null,
isDisabled: '1',
informationType: '1',
}
this.saveForm.afterList[index].dataExtractionQOList.windowExtractions.push(param)
} else if (this.saveForm.informationType === '2' && this.saveForm.elementType != null) {
// 提取元素信息且子分类不为空
var param = {
elementType: this.saveForm.elementType,
value: null,
isDisabled: '1',
elementAttribute: null,
informationType: '2',
operateObject: null, // 操作对象
operateGroupId: null, // 元素对象
operateElementId: null, // 元素对象
operateLocType: null, // 元素定位
operateLocValue: null, // 元素定位
}
this.saveForm.afterList[index].dataExtractionQOList.elementExtractions.push(param)
} else {
this.$modal.msgError("请选择子分类");
} }
}, },
// 删除 // 删除
beforeWindowDelete(val) { beforeWindowDelete(val, val1) {
this.saveForm.beforeWindowList = this.saveForm.beforeWindowList.filter((item, index) => index !== val); this.saveForm.beforeList[val].dataExtractionQOList.windowExtractions = this.saveForm.beforeList[val].dataExtractionQOList.windowExtractions.filter((item, index) => index !== val1)
},
beforeElemetDelete(val, val1) {
this.saveForm.beforeList[val].dataExtractionQOList.elementExtractions = this.saveForm.beforeList[val].dataExtractionQOList.elementExtractions.filter((item, index) => index !== val1)
},
afterWindowDelete(val, val1) {
this.saveForm.afterList[val].dataExtractionQOList.windowExtractions = this.saveForm.afterList[val].dataExtractionQOList.windowExtractions.filter((item, index) => index !== val1)
},
afterElemetDelete(val, val1) {
this.saveForm.afterList[val].dataExtractionQOList.elementExtractions = this.saveForm.afterList[val].dataExtractionQOList.elementExtractions.filter((item, index) => index !== val1)
},
// 元素对象
getOperateGroup() {
this.getElementListData(this.saveForm.operateGroupId)
},
// 元素定位
getOperateLoc() {
this.getElementListData(this.saveForm.operateLocType)
},
// 获取元素列表
getElementListData(id) {
getElementList({ groupId: id }).then(res => {
if (res.code === 200) {
this.elementList = res.rows
}
})
}, },
}, },
watch: { watch: {
detail(newVal, oldVal) { detail(newVal, oldVal) {
if (newVal === null) {
return
}
this.saveForm.beforeList = [] this.saveForm.beforeList = []
this.saveForm.afterList = [] this.saveForm.afterList = []
@@ -400,61 +686,30 @@ export default {
if (newVal.uiHighSettingVOList != null) { if (newVal.uiHighSettingVOList != null) {
this.uiHighSettingVOList = newVal.uiHighSettingVOList this.uiHighSettingVOList = newVal.uiHighSettingVOList
} }
this.uiHighSettingVOList.forEach(item => {
switch (item.settingType) {
// 前置操作
case '1':
this.saveForm.beforeList.push(item)
break
// 后置操作
case '2':
this.saveForm.afterList.push(item)
break
// 错误处理
case '3':
this.saveForm.errorHandling = item.errorHandling
break
// 其他设置
case '4':
if (item.otherSettingsQO != null) {
this.saveForm.waitElementTime = item.otherSettingsQO.waitElementTime
this.saveForm.screenshotConfiguration = item.otherSettingsQO.screenshotConfiguration
}
break
}
})
Promise.all([
new Promise((resolve) => {
this.uiHighSettingVOList.forEach(item => {
switch (item.settingType) {
// 前置操作
case '1':
this.saveForm.beforeList.push(item)
break
// 后置操作
case '2':
this.saveForm.afterList.push(item)
break
// 错误处理
case '3':
this.saveForm.errorHandling = item.errorHandling
break
// 其他设置
case '4':
this.saveForm.waitElementTime = item.otherSettingsQO.waitElementTime
this.saveForm.screenshotConfiguration = item.otherSettingsQO.screenshotConfiguration
break
}
})
resolve();
}),
new Promise((resolve) => {
this.saveForm.beforeList.forEach(item => {
if (item.informationType === '1' && item) {
// 提取窗口信息
this.saveForm.beforeWindowList.push(item)
} else {
// 提取元素信息
this.saveForm.beforeElementList.push(item)
}
})
resolve();
}),
new Promise((resolve) => {
this.saveForm.afterList.forEach(item => {
if (item.informationType === '1') {
// 提取窗口信息
this.saveForm.afterWindowList.push(item)
} else {
// 提取元素信息
this.saveForm.afterElementList.push(item)
}
})
resolve();
})
]).then(() => {
console.log('Both arrays have been processed.');
});
console.log(this.saveForm.beforeList)
}, },
saveForm: { saveForm: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
@@ -575,6 +830,12 @@ export default {
padding: 10px; padding: 10px;
} }
} }
}
.operateObject-wrap {
display: flex;
gap: 10px;
} }
} }
</style> </style>

View File

@@ -194,15 +194,19 @@ export default {
handleClickSave() { handleClickSave() {
if (this.informationForm.name === null || this.informationForm.name === '') { if (this.informationForm.name === null || this.informationForm.name === '') {
this.$modal.msgWarning("请输入名称!"); this.$modal.msgWarning("请输入名称!");
return
} }
if (this.informationForm.groupId === null || this.informationForm.groupId === '') { if (this.informationForm.groupId === null || this.informationForm.groupId === '') {
this.$modal.msgWarning("请选择模块!"); this.$modal.msgWarning("请选择模块!");
return
} }
if (this.informationForm.status === null || this.informationForm.status === '') { if (this.informationForm.status === null || this.informationForm.status === '') {
this.$modal.msgWarning("请选择状态"); this.$modal.msgWarning("请选择状态");
return
} }
if (this.informationForm.dutyBy === null || this.informationForm.dutyBy === '') { if (this.informationForm.dutyBy === null || this.informationForm.dutyBy === '') {
this.$modal.msgWarning("请输入责任人"); this.$modal.msgWarning("请输入责任人");
return
} }
updateAutomation(this.informationForm).then(res => { updateAutomation(this.informationForm).then(res => {
if (res.code === 200) { if (res.code === 200) {

View File

@@ -95,7 +95,7 @@
<el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup"> <el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup">
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-select v-model="saveForm.action" class="select"> <el-select v-model="saveForm.operateElementId" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
@@ -149,7 +149,7 @@
<el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup"> <el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup">
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-select v-model="saveForm.action" class="select"> <el-select v-model="saveForm.operateElementId" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
@@ -210,7 +210,7 @@
<el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup"> <el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup">
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-select v-model="saveForm.action" class="select"> <el-select v-model="saveForm.operateElementId" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
@@ -243,7 +243,7 @@
<el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup"> <el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup">
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-select v-model="saveForm.action" class="select"> <el-select v-model="saveForm.operateElementId" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
@@ -283,7 +283,7 @@
<el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup"> <el-select v-model="saveForm.operateGroupId" class="select" @change="getOperateGroup">
<el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-select v-model="saveForm.action" class="select"> <el-select v-model="saveForm.operateElementId" class="select">
<el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option> <el-option v-for="item in elementList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>