|
@@ -27,10 +27,12 @@
|
|
|
/>
|
|
|
{{ form }} -->
|
|
|
<div v-if="current == 0">
|
|
|
- <div class="toolbox-automate-rules-create-content_title"><h3>预警值填写</h3></div>
|
|
|
+ <div class="toolbox-automate-rules-create-content_title">
|
|
|
+ <h3>预警值{{ editShow ? '填写' : '表单预览' }}</h3>
|
|
|
+ </div>
|
|
|
<a-spin :spinning="spinLoading">
|
|
|
<div class="toolbox-automate-rules-create-content">
|
|
|
- <a-form-model ref="ruleForm" :model="form" layout="horizontal" v-bind="allCol">
|
|
|
+ <a-form-model ref="ruleForm" :model="form" layout="horizontal">
|
|
|
<div class="moduler">
|
|
|
<template v-for="(item, index) of form.ruleList">
|
|
|
<div class="row-item" v-if="item.ruleType == 'base' && item.isCopy == 0">
|
|
@@ -61,13 +63,17 @@
|
|
|
<a-input-number
|
|
|
v-model="value.threshold"
|
|
|
:min="0"
|
|
|
- style="width: 300px;margin-right:5px"
|
|
|
+ style="width: 100px; margin-right: 5px"
|
|
|
v-if="value.modelType == 'numberText'"
|
|
|
/>
|
|
|
- <a-input v-model="value.threshold" style="width: 300px;margin-right:5px" v-else-if="value.modelType == 'text'" />
|
|
|
+ <a-input
|
|
|
+ v-model="value.threshold"
|
|
|
+ style="width: 300px; margin-right: 5px"
|
|
|
+ v-else-if="value.modelType == 'text'"
|
|
|
+ />
|
|
|
<selectGroup
|
|
|
v-model="value.threshold"
|
|
|
- style="width: 300px;margin-right:5px"
|
|
|
+ style="width: 300px; margin-right: 5px"
|
|
|
:code="value.dictId"
|
|
|
:multiple="value.dataType == 'string' ? false : true"
|
|
|
v-else-if="value.modelType == 'select'"
|
|
@@ -80,9 +86,9 @@
|
|
|
/> -->
|
|
|
<checkBoxGroup
|
|
|
v-model="value.threshold"
|
|
|
- style="width: 300px;margin-right:5px"
|
|
|
+ style="width: 100%; margin-right: 5px"
|
|
|
:code="value.dictId"
|
|
|
- :allValue="value.dataType == 'string' ? true : false"
|
|
|
+ :allValue="true"
|
|
|
:radioStyle="value.dataType == 'string' ? true : false"
|
|
|
v-else-if="value.modelType == 'checkBox'"
|
|
|
/>
|
|
@@ -128,6 +134,8 @@
|
|
|
</div> -->
|
|
|
<div class="input-item">
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
|
|
@@ -138,11 +146,13 @@
|
|
|
}"
|
|
|
v-if="value.modelType == 'numberText'"
|
|
|
>
|
|
|
- <a-input-number style="width: 95%;" v-model="value.threshold" :min="0" />{{
|
|
|
+ <a-input-number style="width: 100px; margin-right: 5px" v-model="value.threshold" :min="0" />{{
|
|
|
value.dataUnit
|
|
|
}}
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
|
|
@@ -153,9 +163,11 @@
|
|
|
}"
|
|
|
v-else-if="value.modelType == 'text'"
|
|
|
>
|
|
|
- <a-input v-model="value.threshold" style="width: 95%;" />
|
|
|
+ <a-input v-model="value.threshold" style="width: 95%" />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
|
|
@@ -175,6 +187,8 @@
|
|
|
/>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="'ruleList.' + index + '.ruleDetail.' + valueIndex + '.threshold'"
|
|
@@ -187,7 +201,7 @@
|
|
|
>
|
|
|
<a-select
|
|
|
mode="tags"
|
|
|
- style="width: 100%"
|
|
|
+ style="width: 95%"
|
|
|
placeholder="按回车生成标签"
|
|
|
v-model="value.threshold"
|
|
|
dropdownClassName="display-none-selset"
|
|
@@ -231,6 +245,8 @@
|
|
|
</div> -->
|
|
|
<div class="input-item">
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="
|
|
@@ -249,11 +265,13 @@
|
|
|
}"
|
|
|
v-if="value.modelType == 'numberText'"
|
|
|
>
|
|
|
- <a-input-number style="width: 95%;" v-model="value.threshold" :min="0" />{{
|
|
|
+ <a-input-number style="width:100px; margin-right: 5px" v-model="value.threshold" :min="0" />{{
|
|
|
value.dataUnit
|
|
|
}}
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="
|
|
@@ -275,6 +293,8 @@
|
|
|
<a-input v-model="value.threshold" style="width: 95%" />
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="
|
|
@@ -302,6 +322,8 @@
|
|
|
/>
|
|
|
</a-form-model-item>
|
|
|
<a-form-model-item
|
|
|
+ :label-col="{ span: 6 }"
|
|
|
+ :wrapper-col="{ span: 18 }"
|
|
|
:label="value.name"
|
|
|
:ref="value.indicatorCode + valueIndex"
|
|
|
:prop="
|
|
@@ -322,7 +344,7 @@
|
|
|
>
|
|
|
<a-select
|
|
|
mode="tags"
|
|
|
- style="width: 100%"
|
|
|
+ style="width: 95%"
|
|
|
placeholder="按回车生成标签"
|
|
|
v-model="value.threshold"
|
|
|
dropdownClassName="display-none-selset"
|
|
@@ -350,8 +372,15 @@
|
|
|
</div>
|
|
|
<div class="moduler">
|
|
|
<div class="opt">
|
|
|
- <a-button type="default" style="margin-right: 15px" @click="goBack">{{editShow?'取消':'返回'}}</a-button>
|
|
|
- <a-button type="primary" style="margin-right: 15px" @click="saveHandler" :loading="saveLoading" v-if="editShow"
|
|
|
+ <a-button type="default" style="margin-right: 15px" @click="goBack">{{
|
|
|
+ editShow ? '取消' : '返回'
|
|
|
+ }}</a-button>
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ style="margin-right: 15px"
|
|
|
+ @click="saveHandler"
|
|
|
+ :loading="saveLoading"
|
|
|
+ v-if="editShow"
|
|
|
>下一步</a-button
|
|
|
>
|
|
|
</div>
|
|
@@ -473,13 +502,13 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- editShow:false,
|
|
|
+ editShow: false,
|
|
|
current: 0,
|
|
|
spinLoading: false,
|
|
|
- allCol: {
|
|
|
- labelCol: { span: 6 },
|
|
|
- wrapperCol: { span: 18 },
|
|
|
- },
|
|
|
+ // allCol: {
|
|
|
+ // labelCol: { span: 6 },
|
|
|
+ // wrapperCol: { span: 18 },
|
|
|
+ // },
|
|
|
wrapperCol: { span: 14 },
|
|
|
ceshi: [],
|
|
|
ceshi2: [],
|
|
@@ -672,7 +701,6 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
addData(valueElse, value, index) {
|
|
|
- console.log(valueElse, value)
|
|
|
// alert(1)
|
|
|
if (index == 0) {
|
|
|
var data = JSON.parse(JSON.stringify(value))
|
|
@@ -686,7 +714,6 @@ export default {
|
|
|
},
|
|
|
// 应用方式改变
|
|
|
applyRangeChange(e) {
|
|
|
- console.log(e.target.value)
|
|
|
this.checkedList = []
|
|
|
this.checkAll = false
|
|
|
this.indeterminate = false
|
|
@@ -704,7 +731,6 @@ export default {
|
|
|
pageNo: 1,
|
|
|
pageSize: 100000,
|
|
|
}).then((res) => {
|
|
|
- console.log(res)
|
|
|
this.plainOptions = []
|
|
|
this.spinning = false
|
|
|
if (res.success) {
|
|
@@ -730,7 +756,6 @@ export default {
|
|
|
pageNo: 1,
|
|
|
pageSize: 100000,
|
|
|
}).then((res) => {
|
|
|
- console.log(res)
|
|
|
this.plainOptions = []
|
|
|
this.spinning = false
|
|
|
if (res.success) {
|
|
@@ -746,7 +771,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
inputCheck(val) {
|
|
|
- console.log(val)
|
|
|
+ // console.log(val)
|
|
|
},
|
|
|
|
|
|
isCost(val) {
|
|
@@ -760,12 +785,10 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleChange(value) {
|
|
|
- console.log(value, this.metricValueCode)
|
|
|
let rulesList = {}
|
|
|
rulesList = this.rulesFieldList.filter((item) => {
|
|
|
return item.metricValueCode == value
|
|
|
})[0]
|
|
|
- console.log(rulesList)
|
|
|
this.rulesList = []
|
|
|
rulesList.childs.forEach((ele, index) => {
|
|
|
this.rulesList.push({
|
|
@@ -878,8 +901,13 @@ export default {
|
|
|
...item,
|
|
|
ruleDetail: item.ruleDetail.map((end) => {
|
|
|
if (isArray(end)) {
|
|
|
- end.threshold = isArray(end.threshold) ? JSON.stringify(end.threshold) : end.threshold
|
|
|
- return [...end]
|
|
|
+ var data = end.map((c) => {
|
|
|
+ return {
|
|
|
+ ...c,
|
|
|
+ threshold: isArray(c.threshold) ? JSON.stringify(c.threshold) : end.threshold,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return [...data]
|
|
|
} else {
|
|
|
return {
|
|
|
...end,
|
|
@@ -896,6 +924,7 @@ export default {
|
|
|
accountId: JSON.parse(localStorage.getItem('getRuleDetail')).accountId,
|
|
|
}
|
|
|
this.saveLoading = true
|
|
|
+
|
|
|
postAction('/ruleAccountThreshold/fillThreshold', params).then((res) => {
|
|
|
if (res.success) {
|
|
|
this.saveLoading = false
|
|
@@ -1083,7 +1112,7 @@ export default {
|
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
|
align-items: center;
|
|
|
- margin-bottom: 32px;
|
|
|
+ margin-bottom: 15px;
|
|
|
}
|
|
|
.row-item:last-of-type {
|
|
|
margin-bottom: 0;
|
|
@@ -1103,11 +1132,11 @@ export default {
|
|
|
line-height: 20px;
|
|
|
height: 20px;
|
|
|
margin-top: 10px;
|
|
|
- width: 105px;
|
|
|
- min-width: 105px;
|
|
|
+ width: 140px;
|
|
|
+ min-width: 140px;
|
|
|
.text-item {
|
|
|
font-size: 14px;
|
|
|
- width: 100px;
|
|
|
+ width: 120px;
|
|
|
}
|
|
|
}
|
|
|
.row-item .required-item {
|
|
@@ -1143,9 +1172,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .toolbox-automate-rules-create-content_rules-and-condition_rules {
|
|
|
- margin-bottom: 24px;
|
|
|
- }
|
|
|
+ // .toolbox-automate-rules-create-content_rules-and-condition_rules {
|
|
|
+ // // margin-bottom: 24px;
|
|
|
+ // }
|
|
|
.toolbox-automate-rules-create-content_rules-and-condition_rules,
|
|
|
.toolbox-automate-rules-create-content_rules-and-condition_condition {
|
|
|
width: 1138px;
|
|
@@ -1171,8 +1200,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.content {
|
|
|
- padding: 24px;
|
|
|
-
|
|
|
.add-rule {
|
|
|
cursor: pointer;
|
|
|
|
|
@@ -1196,10 +1223,9 @@ export default {
|
|
|
.rules-list-item {
|
|
|
box-sizing: border-box;
|
|
|
width: 100%;
|
|
|
- padding: 24px;
|
|
|
+ padding: 10px;
|
|
|
background: #f8f9fa;
|
|
|
border-radius: 4px;
|
|
|
- margin-bottom: 16px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
position: relative;
|