浏览代码

Merge branch 'dev2/luolei' into test

Luolei 6 年之前
父节点
当前提交
e331cf1a98
共有 2 个文件被更改,包括 10 次插入0 次删除
  1. 8 0
      src/components/icss/CommonTemplate.vue
  2. 2 0
      src/components/icss/PubTemplateGroup.vue

+ 8 - 0
src/components/icss/CommonTemplate.vue

@@ -308,6 +308,13 @@ export default {
       let tmpArr4 = this.Adscriptions.filter(item => item.id == tmpRegion);
       let tmpTag = Object.assign({},this.addTag);     //深度复制obj
       if(sign == 0){         //添加子模板
+        if(tmpArr3.length > 0){
+          this.$message({
+            message:'模板中只能添加一个子模板',
+            type:'warning'
+          })
+          return
+        }
         if(tmpArr4.length == 0){
           this.$message({
             message:'请选择子模板',
@@ -316,6 +323,7 @@ export default {
           return false;
         }
         tmpTag.type = 'sub'
+        tmpTag.flag = '3'
         tmpArr3.push(tmpRegion)
         tmpTag.tagName = tmpArr4[0].name
         tmpTag.id = tmpArr4[0].id + 'sub'

+ 2 - 0
src/components/icss/PubTemplateGroup.vue

@@ -120,9 +120,11 @@ export default {
   },
   mounted() {
     const editData = this.$props.editData;
+    let templateOwn = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleTypeEnum : []
     if(editData.id){      //修改
       // const trans = utils.transformKeys(editData,2);
       this.form = Object.assign({},this.form,editData);
+      this.Adscriptions = templateOwn
       this.form.region1 = (editData.type+'')
       this.form.region2 = editData.name
     }