修改触发条件

This commit is contained in:
闫晓茹 2024-06-25 11:30:15 +08:00
parent 43b9124dc1
commit ba60f7537b
2 changed files with 72 additions and 54 deletions

View File

@ -22,9 +22,10 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<!-- 包含 -->
<el-select <el-select
disabled disabled
v-model="updata.triggerConditionOperatorName" v-model="updata.triggerConditionOperator"
style="width: 100px" style="width: 100px"
@change="changetriggerLogic($event, index)" @change="changetriggerLogic($event, index)"
> >
@ -38,8 +39,8 @@
</el-select> </el-select>
<el-input <el-input
disabled
v-if="updata.dictDataType == 'STRING'" v-if="updata.dictDataType == 'STRING'"
disabled
v-model="updata.triggerConditionValue" v-model="updata.triggerConditionValue"
style="width: 300px" style="width: 300px"
placeholder="请输入触发条件" placeholder="请输入触发条件"
@ -69,7 +70,7 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
<!-- {{ item }} -->
<el-input <el-input
disabled disabled
v-if="updata.dictDataType == 'DECIMAL'" v-if="updata.dictDataType == 'DECIMAL'"
@ -113,36 +114,35 @@
> >
<el-option <el-option
v-for="item in optionsname" v-for="item in optionsname"
:key="item.value" :key="item.dictValue"
:label="item.label" :label="item.dictLabel"
:value="item.value" :value="item.dictValue"
> >
</el-option> </el-option>
</el-select> </el-select>
<el-select <el-select
disabled disabled
v-model="item.triggerConditionOperatorName" v-model="item.triggerConditionOperator"
style="width: 100px" style="width: 100px"
@change="changetriggerLogic($event, index)" @change="changetriggerLogic($event, index)"
> >
<el-option <el-option
v-for="item in optionstriggerConditionOperator" v-for="item in optionstriggerConditionOperator"
:key="item.value" :key="item.dictValue"
:label="item.label" :label="item.dictLabel"
:value="item.value" :value="item.dictValue"
> >
</el-option> </el-option>
</el-select> </el-select>
<el-input <el-input
disabled
v-if="item.dictDataType == 'STRING'" v-if="item.dictDataType == 'STRING'"
disabled
v-model="item.triggerConditionValue" v-model="item.triggerConditionValue"
style="width: 300px" style="width: 300px"
placeholder="请输入触发条件" placeholder="请输入触发条件"
maxlength="100" maxlength="100"
></el-input> ></el-input>
<el-select <el-select
disabled
v-if="item.dictDataType == 'SELECT'" v-if="item.dictDataType == 'SELECT'"
v-model="item.triggerConditionValue" v-model="item.triggerConditionValue"
style="width: 300px" style="width: 300px"
@ -155,6 +155,7 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<el-date-picker <el-date-picker
disabled disabled
v-if="item.dictDataType == 'DATE'" v-if="item.dictDataType == 'DATE'"
@ -165,7 +166,6 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
> >
</el-date-picker> </el-date-picker>
<!-- {{ item }} -->
<el-input <el-input
disabled disabled
v-if="item.dictDataType == 'DECIMAL'" v-if="item.dictDataType == 'DECIMAL'"
@ -926,12 +926,9 @@ export default {
e.routeId = this.$route.query.id; e.routeId = this.$route.query.id;
e.routeName = this.$route.query.routeName; e.routeName = this.$route.query.routeName;
}); });
console.log(
this.openlist.triggerConditionList,
" this.openlist.triggerConditionList"
);
loading.close();
loading.close();
// return;
triggerCondition(this.openlist).then((res) => { triggerCondition(this.openlist).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$notify({ this.$notify({
@ -939,10 +936,13 @@ export default {
title: "提示", title: "提示",
message: "修改触发条件成功", message: "修改触发条件成功",
}); });
this.routeName = res.data; this.routeName = res.data;
Cookies.remove("routeName"); Cookies.remove("routeName");
Cookies.set("routeName", this.routeName); Cookies.set("routeName", this.routeName);
// this.$router.go(0);
// window.location.reload();
} }
this.infolist(); this.infolist();
// this.handlelist(); // this.handlelist();
@ -958,7 +958,7 @@ export default {
triggerConditionName: "", triggerConditionName: "",
triggerConditionOperator: "", triggerConditionOperator: "",
triggerConditionValue: "", triggerConditionValue: "",
triggerConditionName: "",
triggerConditionOperatorName: "", triggerConditionOperatorName: "",
dictDataType: "STRING", dictDataType: "STRING",
@ -978,7 +978,7 @@ export default {
triggerConditionName: "", triggerConditionName: "",
triggerConditionOperator: "", triggerConditionOperator: "",
triggerConditionValue: "", triggerConditionValue: "",
triggerConditionName: "",
triggerConditionOperatorName: "", triggerConditionOperatorName: "",
dictDataType: "STRING", dictDataType: "STRING",
triggerLogic: "AND", triggerLogic: "AND",
@ -1203,13 +1203,15 @@ export default {
getList(dictType, this.dictDataType).then((res) => { getList(dictType, this.dictDataType).then((res) => {
this.optionstriggerConditionOperator = res.data; this.optionstriggerConditionOperator = res.data;
console.log(
this.optionstriggerConditionOperator,
" this.optionstriggerConditionOperator "
);
}); });
}, },
// //
changetriggerLogic(e, index) { changetriggerLogic(e, index) {
console.log(e, index, "e包含,index");
this.openlist.triggerConditionList[index].triggerConditionOperatorName = this.openlist.triggerConditionList[index].triggerConditionOperatorName =
this.optionstriggerConditionOperator.find( this.optionstriggerConditionOperator.find(
(el) => el.dictValue == e (el) => el.dictValue == e
@ -1254,17 +1256,29 @@ export default {
this.routeId = this.$route.query.id; this.routeId = this.$route.query.id;
triggerConditionList(this.routeId).then((res) => { triggerConditionList(this.routeId).then((res) => {
this.openlist.triggerConditionList = res.data; this.openlist.triggerConditionList = res.data;
this.openlist.triggerConditionList.forEach((p) => { res.data.forEach((p) => {
this.optiononditionOperators(); this.optiononditionOperators();
p.dictDataType = this.optionsname.find( p.dictDataType = this.optionsname.find(
(el) => el.dictValue == p.triggerConditionCode (el) => el.dictValue == p.triggerConditionCode
)?.dictDataType; )?.dictDataType;
console.log(p, "0000000000000000"); var dictType = p.triggerConditionCode;
getAgencytype(dictType).then((res) => {
this.ConditionValue = res.data;
});
// console.log(this.ConditionValue,'ConditionValueConditionValueConditionValueConditionValue')
// this.handlelist();
// var dictType = "trigger_condition_operator";
// getList(dictType, this.dictDataType).then((res) => {
// this.optionstriggerConditionOperator = res.data;
// });
}); });
this.handlelist();
if (res.data.length == 1) { if (res.data.length == 1) {
// //
this.updata = res.data[0]; this.updata = res.data[0];
console.log(this.updata, " this.updata");
this.updata.triggerConditionOperatorName = this.updata.triggerConditionOperatorName =
this.optionstriggerConditionOperator.find( this.optionstriggerConditionOperator.find(
(el) => el.dictValue == this.updata.triggerConditionOperator (el) => el.dictValue == this.updata.triggerConditionOperator
@ -1277,8 +1291,11 @@ export default {
this.optionstriggerConditionOperator.find( this.optionstriggerConditionOperator.find(
(el) => el.dictValue == this.updata.triggerConditionOperator (el) => el.dictValue == this.updata.triggerConditionOperator
)?.dictLabel; )?.dictLabel;
console.log(this.updata, " this.updata");
res.data.splice(0, 1); res.data.splice(0, 1);
this.updatalist = res.data; this.updatalist = res.data;
console.log(this.updatalist, " this.updatalist");
this.updatalist.forEach((e) => { this.updatalist.forEach((e) => {
e.triggerConditionOperatorName = e.triggerConditionOperatorName =
this.optionstriggerConditionOperator.find( this.optionstriggerConditionOperator.find(
@ -1303,12 +1320,12 @@ export default {
o.dictDataType = this.optionsname.find( o.dictDataType = this.optionsname.find(
(el) => el.dictValue == o.triggerConditionCode (el) => el.dictValue == o.triggerConditionCode
)?.dictDataType; )?.dictDataType;
if (o.triggerConditionCode.includes("SEX")) { // if (o.triggerConditionCode.includes("SEX")) {
var dictType = "SEX"; // var dictType = "SEX";
getAgencytype(dictType).then((res) => { // getAgencytype(dictType).then((res) => {
this.ConditionValue = res.data; // this.ConditionValue = res.data;
}); // });
} // }
}); });
this.$set(this.updata, "suitRange", this.openlist.suitRange); this.$set(this.updata, "suitRange", this.openlist.suitRange);
}); });

View File

@ -93,6 +93,7 @@
v-for="(uitem, uindex) in list.childrenRouteList" v-for="(uitem, uindex) in list.childrenRouteList"
:key="uindex" :key="uindex"
> >
<!-- {{ uitem }} -->
<div class="title"> <div class="title">
<el-tag type="success">触发条件</el-tag> <el-tag type="success">触发条件</el-tag>
<span> <span>
@ -473,10 +474,10 @@ export default {
).dictDataType; ).dictDataType;
this.updata.triggerConditionList[index].dictDataType = this.updata.triggerConditionList[index].dictDataType =
this.optionsname.find((el) => el.dictValue == e).dictDataType; this.optionsname.find((el) => el.dictValue == e).dictDataType;
console.log( // console.log(
this.updata.triggerConditionList[index].dictDataType, // this.updata.triggerConditionList[index].dictDataType,
"this.dictDataType" // "this.dictDataType"
); // );
this.handlelist(); this.handlelist();
}, },
// //
@ -595,24 +596,24 @@ export default {
this.editopen = false; this.editopen = false;
this.resetForm("updataform"); this.resetForm("updataform");
}, },
editupload() { // editupload() {
// const loading = this.$loading({ // // const loading = this.$loading({
// lock: true, // // lock: true,
// text: "Loading", // // text: "Loading",
// spinner: "el-icon-loading", // // spinner: "el-icon-loading",
// background: "rgba(0, 0, 0, 0.7)", // // background: "rgba(0, 0, 0, 0.7)",
// }); // // });
triggerConditionedit(this.updataform).then((res) => { // triggerConditionedit(this.updataform).then((res) => {
// loading.close(); // // loading.close();
this.$notify({ // this.$notify({
type: "success", // type: "success",
title: "提示", // title: "",
message: "修改触发条件成功", // message: "",
}); // });
this.info(); // this.info();
this.editopenfalse(); // this.editopenfalse();
}); // });
}, // },
openfalse() { openfalse() {
this.updata.triggerConditionList = [ this.updata.triggerConditionList = [
{ {
@ -651,7 +652,7 @@ export default {
title: "提示", title: "提示",
message: "新增触发条件成功", message: "新增触发条件成功",
}); });
this.info(); // this.info();
this.openfalse(); this.openfalse();
} }
}); });