提交 f9da5f7c 编写于 作者: vino's avatar vino

云鹊专区中应用配置增加自定义积木需求

上级 c30a451b
......@@ -25,7 +25,7 @@
<el-table :data="settingForm.settingData" class="customer-table" style="margin-left:70px;"
:header-cell-style="{background:'#ffffff'}">
<el-table-column label="" prop="appType" width="120"></el-table-column>
<el-table-column label="" prop="appType" width="150"></el-table-column>
<el-table-column label="" width="180">
<template slot-scope="scope">
<el-radio-group size="small" v-model="scope.row.showOff">
......@@ -56,16 +56,16 @@
:value="item2.id">
</el-option>
</el-select>
<img v-if="scope.row.appTag == 10"
@click="add(scope.$index)"
class="edit-img"
src="../../assets/image/plus.png"
/>
<img v-if="scope.row.appTag == 10 && count > 0"
@click="del(scope.$index, scope.row)"
class="edit-img"
src="../../assets/image/trash.png"
/>
<!-- <img v-if="scope.row.appTag == 10"-->
<!-- @click="add(scope.$index)"-->
<!-- class="edit-img"-->
<!-- src="../../assets/image/plus.png"-->
<!-- />-->
<!-- <img v-if="scope.row.appTag == 10 && count > 0"-->
<!-- @click="del(scope.$index, scope.row)"-->
<!-- class="edit-img"-->
<!-- src="../../assets/image/trash.png"-->
<!-- />-->
</template>
</el-table-column>
......@@ -143,10 +143,28 @@ export default {
// 自定义积木
if(this.settingForm.settingData[i].appTag == 10){
this.count ++;
this.settingForm.settingData[i].appUrl = parseInt(this.settingForm.settingData[i].appUrl);
if(this.settingForm.settingData[i].appUrl != ""){
this.settingForm.settingData[i].appUrl = parseInt(this.settingForm.settingData[i].appUrl);
}
}
}
this.count --;
let tempList = this.settingForm.settingData.filter(function (item) {
return item.appTag == 10;
});
if(tempList.length == 0){
let row = {
appName: "",
appTag: 10,
appType: "自定义H5积木页",
appUrl: "",
ecoAppParams: [],
id: "",
seqNo: this.settingForm.settingData.length + 1,
showOff: 0,
}
this.settingForm.settingData.push(row);
}
}
} else {
this.settingForm.settingData = [];
......@@ -159,7 +177,7 @@ export default {
checkSubmitData() {
for(let i=0; i<this.settingForm.settingData.length; i++) {
if (isEmptyUtils(this.settingForm.settingData[i].appName)) {
if (this.settingForm.settingData[i].showOff == 1 && isEmptyUtils(this.settingForm.settingData[i].appName)) {
this.$message.error("重命名输入框中的值不可为空,请检查");
return;
}
......@@ -167,16 +185,20 @@ export default {
this.$message.error("序号不可为空,请检查");
return;
}
if (this.settingForm.settingData[i].appTag == 10 && isEmptyUtils(this.settingForm.settingData[i].appUrl)) {
if (this.settingForm.settingData[i].showOff == 1
&& this.settingForm.settingData[i].appTag == 10
&& isEmptyUtils(this.settingForm.settingData[i].appUrl)) {
this.$message.error("请选择积木页");
return;
}
const r = /^\+?[1-9][0-9]*$/; // 正整数
// 如果判断不符合正则,则不是正整数不能提交
if (!r.test(this.settingForm.settingData[i].seqNo)) {
this.$message.error("序号应为正整数,请检查");
return;
}
if (this.settingForm.settingData[i].seqNo < 1 || this.settingForm.settingData[i].seqNo > 50) {
if (this.settingForm.settingData[i].seqNo < 1 || this.settingForm.settingData[i].seqNo > 10) {
this.$message.error('请输入 1~10 的正整数');
return;
}
if (this.settingForm.settingData[i].seqNo > this.settingForm.settingData.length) {
......@@ -222,11 +244,11 @@ export default {
BlurText(e) {
console.log("BlurText() : e = " + e.target.value)
let b = new RegExp("^[1-9][0-9]*$").test(e.target.value)
if (e.target.value >= 50) {
if (e.target.value >= 10) {
b = false
}
if (!b) {
this.$message.warning('请输入 1~50 的正整数')
this.$message.warning('请输入 1~10 的正整数')
e.target.value = ''
}
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册