|
@@ -65,6 +65,7 @@
|
|
|
:w="Number(item.w)"
|
|
|
:h="Number(item.h)"
|
|
|
:i="item.i"
|
|
|
+ :class="{gridActived:index===currentCpn}"
|
|
|
@dblclick.native="showSeting(index)"
|
|
|
>
|
|
|
<div class="box-canvs-main-span">
|
|
@@ -156,7 +157,7 @@ export default {
|
|
|
return {
|
|
|
layoutKey:0,
|
|
|
// tab
|
|
|
- activeName: 'first',
|
|
|
+ activeName: 'second',
|
|
|
cpnsList,
|
|
|
// 数据对象
|
|
|
fromData:{},
|
|
@@ -403,14 +404,25 @@ export default {
|
|
|
async handleBeforeClose(type) {
|
|
|
if (type !== 'ok') {
|
|
|
return true
|
|
|
+ };
|
|
|
+ // 按钮配置项校验
|
|
|
+ let validateResult = null
|
|
|
+ for(let index = 0; index <= this.pageArray.length-1; index++) {
|
|
|
+ validateResult = this.validateBtn(this.pageArray[index])
|
|
|
+ if (validateResult !== true) {
|
|
|
+ this.isShowSeting = true
|
|
|
+ this.currentCpn = index
|
|
|
+ this.activeName = 'first'
|
|
|
+ this.$message({
|
|
|
+ message: validateResult,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
+ // 布局配置项
|
|
|
const validate = await this.$refs.ruleForm.validate();
|
|
|
- if (!validate) return false
|
|
|
-
|
|
|
- // 数据验证
|
|
|
- if (!this.validateList()) {
|
|
|
- return false
|
|
|
- }
|
|
|
+ if (!validate) return false;
|
|
|
|
|
|
const params = {
|
|
|
...this.fromData,
|
|
@@ -451,6 +463,8 @@ export default {
|
|
|
newItem.bootCodeSend = bootCodeSend
|
|
|
newItem.dateCode = dateCode
|
|
|
newItem.overCode = overCode
|
|
|
+ newItem.addSubMax = ''
|
|
|
+ newItem.addSubMin = ''
|
|
|
}
|
|
|
}
|
|
|
this.pageArray.push(newItem)
|
|
@@ -469,9 +483,14 @@ export default {
|
|
|
},
|
|
|
// 校验按钮属性
|
|
|
validateBtn(obj) {
|
|
|
- Object.keys(btnRules).find(item => {
|
|
|
- // if (obj[item])
|
|
|
- })
|
|
|
+ if (obj.type != 'button') return true
|
|
|
+ for(const item of Object.keys(this.btnRules)) {
|
|
|
+ if (!obj[item]) return this.btnRules[item][0].message
|
|
|
+ if (obj.typeNum == '0' && !obj?.addSubMax) return '加减型需输入最大值'
|
|
|
+ if (obj.typeNum == '0' && !obj?.addSubMin) return '加减型需输入最小值'
|
|
|
+ if (obj.typeNum == '0' && obj?.addSubMax <= obj?.addSubMin) return '加减型最大值要大于最小值'
|
|
|
+ }
|
|
|
+ return true
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -623,4 +642,7 @@ h3 {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.gridActived {
|
|
|
+ box-shadow: #ff0000eb 0px 0px 4px 1px;
|
|
|
+}
|
|
|
</style>
|