|
@@ -225,7 +225,7 @@
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
<a-input
|
|
|
- v-decorator="['imgXposition', {initialValue:50, rules: [{required: true, message: '图片x轴位置不能为空'}]}]"/>
|
|
|
+ v-decorator="['imgXPosition', {initialValue:50, rules: [{required: true, message: '图片x轴位置不能为空'}]}]"/>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
@@ -236,7 +236,7 @@
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
<a-input
|
|
|
- v-decorator="['imgYposition', {initialValue:50, rules: [{required: true, message: '图片y轴位置不能为空'}]}]"/>
|
|
|
+ v-decorator="['imgYPosition', {initialValue:100, rules: [{required: true, message: '图片y轴位置不能为空'}]}]"/>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
@@ -247,12 +247,14 @@
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
<a-input-number
|
|
|
- style="width: 70%"
|
|
|
+ style="width: 73%"
|
|
|
:min="0.01"
|
|
|
:formatter="BaseTool.Amount.formatter"
|
|
|
:parser="BaseTool.Amount.parser"
|
|
|
- v-decorator="['warnFirst', {initialValue:'red',rules: [{required: false, message: '最低阈值不能为空'}]}]"/>
|
|
|
- <a-button type="primary" style="width: 30%" @click="handleSelectColor(1)">选择颜色</a-button>
|
|
|
+ v-decorator="['warnFirst', {rules: [{required: false, message: '最低阈值不能为空'}]}]"/>
|
|
|
+ <a-tag style="line-height:30px;margin-left: 10px;" :color="colors.warnFirstColor" @click="handleSelectColor('warnFirstColor')">
|
|
|
+ 选择颜色
|
|
|
+ </a-tag>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
@@ -263,12 +265,14 @@
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
<a-input-number
|
|
|
- style="width: 70%"
|
|
|
+ style="width: 73%"
|
|
|
:min="0.01"
|
|
|
:formatter="BaseTool.Amount.formatter"
|
|
|
:parser="BaseTool.Amount.parser"
|
|
|
- v-decorator="['warnSecond', {initialValue:'red',rules: [{required: false, message: '低阈值不能为空'}]}]"/>
|
|
|
- <a-button type="primary" style="width: 30%" @click="handleSelectColor(2)">选择颜色</a-button>
|
|
|
+ v-decorator="['warnSecond', {rules: [{required: false, message: '低阈值不能为空'}]}]"/>
|
|
|
+ <a-tag style="line-height:30px;margin-left: 10px;" :color="colors.warnSecondColor" @click="handleSelectColor('warnSecondColor')">
|
|
|
+ 选择颜色
|
|
|
+ </a-tag>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
@@ -279,12 +283,14 @@
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
<a-input-number
|
|
|
- style="width: 70%"
|
|
|
+ style="width: 73%"
|
|
|
:min="0.01"
|
|
|
:formatter="BaseTool.Amount.formatter"
|
|
|
:parser="BaseTool.Amount.parser"
|
|
|
- v-decorator="['warnThird', {initialValue:'red',rules: [{required: false, message: '高阈值不能为空'}]}]"/>
|
|
|
- <a-button type="primary" style="width: 30%" @click="handleSelectColor(3)">选择颜色</a-button>
|
|
|
+ v-decorator="['warnThird', {rules: [{required: false, message: '高阈值不能为空'}]}]"/>
|
|
|
+ <a-tag style="line-height:30px;margin-left: 10px;" :color="colors.warnThirdColor" @click="handleSelectColor('warnThirdColor')">
|
|
|
+ 选择颜色
|
|
|
+ </a-tag>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
@@ -295,12 +301,14 @@
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol"
|
|
|
>
|
|
|
<a-input-number
|
|
|
- style="width: 70%"
|
|
|
+ style="width: 73%"
|
|
|
:min="0.01"
|
|
|
:formatter="BaseTool.Amount.formatter"
|
|
|
:parser="BaseTool.Amount.parser"
|
|
|
- v-decorator="['warnFour', {initialValue:'red',rules: [{required: false, message: '最高阈值不能为空'}]}]"/>
|
|
|
- <a-button type="primary" style="width: 30%" @click="handleSelectColor(4)">选择颜色</a-button>
|
|
|
+ v-decorator="['warnFour', {rules: [{required: false, message: '最高阈值不能为空'}]}]"/>
|
|
|
+ <a-tag style="line-height:30px;margin-left: 10px;" :color="colors.warnFourColor" @click="handleSelectColor('warnFourColor')">
|
|
|
+ 选择颜色
|
|
|
+ </a-tag>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
@@ -373,6 +381,7 @@
|
|
|
</row-list>
|
|
|
</a-form>
|
|
|
<sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
|
|
|
+ <ColorModal ref="colorModal" @selected="handleColor"/>
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
|
|
@@ -381,10 +390,12 @@ import pick from 'lodash.pick'
|
|
|
import { addRemoteOpc, updateRemoteOpc, fetchRemoteOpcByPositionNumAndLine } from '@/api/remote/opc'
|
|
|
import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
|
|
|
import { getSbPositionTree } from '@/api/sb/position'
|
|
|
+import ColorModal from './ColorModal'
|
|
|
export default {
|
|
|
name: 'BaseRemoteOpc',
|
|
|
components: {
|
|
|
- SbInfoSelectModal
|
|
|
+ SbInfoSelectModal,
|
|
|
+ ColorModal
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -396,8 +407,14 @@ export default {
|
|
|
form: this.$form.createForm(this),
|
|
|
visible: false,
|
|
|
isExisting: false,
|
|
|
- position: {}
|
|
|
- // 下拉框map
|
|
|
+ position: {},
|
|
|
+ color: '',
|
|
|
+ colors: {
|
|
|
+ warnFourColor: '#B71C1C',
|
|
|
+ warnThirdColor: '#F57F17',
|
|
|
+ warnSecondColor: '#F57F17',
|
|
|
+ warnFirstColor: '#B71C1C'
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
props: {},
|
|
@@ -424,7 +441,9 @@ export default {
|
|
|
]),
|
|
|
pick(position, [
|
|
|
'xposition',
|
|
|
- 'yposition'
|
|
|
+ 'yposition',
|
|
|
+ 'imgXPosition',
|
|
|
+ 'imgYPosition'
|
|
|
])
|
|
|
))
|
|
|
})
|
|
@@ -477,18 +496,22 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
// 日期处理
|
|
|
- if (this.BaseTool.String.isBlank(values.id)) {
|
|
|
- addRemoteOpc(values)
|
|
|
+ const params = {
|
|
|
+ ...values,
|
|
|
+ ...this.colors
|
|
|
+ }
|
|
|
+ if (this.BaseTool.String.isBlank(params.id)) {
|
|
|
+ addRemoteOpc(params)
|
|
|
.then(() => {
|
|
|
- this.handleCancel(values)
|
|
|
+ this.handleCancel(params)
|
|
|
}).catch(() => {
|
|
|
this.confirmLoading = false
|
|
|
})
|
|
|
} else {
|
|
|
console.log('..........................')
|
|
|
- updateRemoteOpc(values)
|
|
|
+ updateRemoteOpc(params)
|
|
|
.then(() => {
|
|
|
- this.handleCancel(values)
|
|
|
+ this.handleCancel(params)
|
|
|
}).catch(() => {
|
|
|
this.confirmLoading = false
|
|
|
})
|
|
@@ -524,7 +547,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleSelectColor (type) {
|
|
|
- this.$message.info(type)
|
|
|
+ this.color = type
|
|
|
+ this.$refs.colorModal.base(this.colors[this.color])
|
|
|
+ },
|
|
|
+ handleColor (value) {
|
|
|
+ console.log(value)
|
|
|
+ this.colors[this.color] = value
|
|
|
},
|
|
|
checkPoint (e) {
|
|
|
const { form: { setFieldsValue, getFieldValue } } = this
|