cuiqian2004
2024-09-27 030e7b6428e4f01ef33d040df274f63700317166
pages/modal/5601.vue
@@ -65,9 +65,10 @@
                           src="../../images/mobox_log_200x40.png">
                        </image>
                        <checkbox-group @change="checkboxChange">
                           <div class="dv-panel" v-for="(style,ii) in pageData.DefList" @tap="onPanelClick(ii)"
                           <div class="dv-panel" v-for="(style,ii) in pageData.DefList"
                              @tap="onPanelClick(ii,style.form.htmlobjId)"
                              :id="'dvpanel'+style.form.htmlobjId"
                              :class="style.form.htmlobjId==active_id?'bk-active':activelist[ii].active==true?'bk-active':''">
                              :class="style.form.htmlobjId==active_id?'bk-active':''">
                              <div class="dv-panel-input">
                                 <div class="dv-input" v-for="(item,index) in style.form.items">
                                    <!-- 普通布局 -->
@@ -174,7 +175,6 @@
            After_Del_Event: {},
            active_id: '',
            activelist: [],
            selectAttrObj: {},
         };
      },
@@ -223,9 +223,11 @@
               keys.forEach(function(key2, index) {
                  if (index + 1 == keys.length) {
                     that.$set(data, key2, val);
                     console.log("$set", key2, val)
                  } else {
                     if (!data[key2]) {
                        that.$set(data, key2, {});
                        console.log("$set", key2, {})
                     }
                  }
                  data = data[key2];
@@ -454,9 +456,9 @@
               var itemName = '';
               (result.dict_item_list || []).forEach((item) => {
                  if (item.is_default == '1')
                     itemName = item.name;
                     itemName = item.name
                  list.push({
                     text: item.value,
                     text: item.value ? item.value : item.name,
                     value: item.name,
                  });
               });
@@ -861,12 +863,7 @@
                                 if (pageData?.DefList) {
                                    pageData.DefList
                                       .forEach(ele => {
                                          $this
                                             .activelist[
                                                index
                                             ]
                                             .active =
                                             false;
                                          if (ele
                                             .form
                                             .objId ==
@@ -1020,121 +1017,8 @@
                                 "set_dlg_attr") {
                                 // value = {"attr":"xxx", "value":"xxx"}
                                 var data = item.value;
                                 $this.$data.head_styledef
                                    .form.items.forEach(
                                       async (
                                          ele, index
                                       ) => {
                                          if (ele
                                             .name !=
                                             "Layout"
                                          ) {
                                             data.forEach(
                                                async (ele2,
                                                   index
                                                ) => {
                                                   if (ele
                                                      .fieldId ==
                                                      ele2
                                                      .attr
                                                   ) {
                                                      if (ele.name ==
                                                         'Select' &&
                                                         ele2
                                                         .choice_list
                                                      ) {
                                                         const
                                                            dictItemList = [];
                                                         const
                                                            choiceList =
                                                            ele2
                                                            .choice_list ||
                                                            [];
                                                         for (let d in
                                                               choiceList) {
                                                            const
                                                               val =
                                                               choiceList[
                                                                  d
                                                               ];
                                                            dictItemList
                                                               .push({
                                                                  text: val,
                                                                  value: val
                                                               });
                                                         }
                                                         ele.dict =
                                                            dictItemList;
                                                      }
                                                      ele.value =
                                                         ele2
                                                         .value;
                                                   }
                                                });
                                          } else {
                                             ele.setting
                                                .colList
                                                .forEach(
                                                   async (
                                                      col
                                                   ) => {
                                                      if (
                                                         col) {
                                                         data.forEach(
                                                            async (ele2,
                                                               index
                                                            ) => {
                                                               if (col
                                                                  .fieldId ==
                                                                  ele2
                                                                  .attr
                                                               ) {
                                                                  if (col
                                                                     .name ==
                                                                     'Select' &&
                                                                     ele2
                                                                     .choice_list
                                                                  ) {
                                                                     const
                                                                        dictItemList = [];
                                                                     const
                                                                        choiceList =
                                                                        ele2
                                                                        .choice_list ||
                                                                        [];
                                                                     for (
                                                                        let d in
                                                                           choiceList
                                                                     ) {
                                                                        const
                                                                           val =
                                                                           choiceList[
                                                                              d
                                                                           ];
                                                                        dictItemList
                                                                           .push({
                                                                              text: val,
                                                                              value: val
                                                                           });
                                                                     }
                                                                     col.dict =
                                                                        dictItemList;
                                                                  }
                                                                  col.value =
                                                                     ele2
                                                                     .value;
                                                               }
                                                            });
                                                      }
                                                   })
                                          }
                                       })
                                 $this.setFormValues(data)
                              }
                           });
                        } else {
@@ -1202,11 +1086,13 @@
         //更新分页签中的列表项内容
         viewActionSetRow(value) {
            const $this = this
            const pageData = $this.pageDetail.find((page) => {
            const pageIndex = $this.pageDetail.findIndex((
               page, index2, arr) => {
               return value.page_name == page.Name;
            });
            if (!pageData)
            })
            if (pageIndex < 0)
               return
            const pageData = $this.pageDetail[pageIndex]
            var detailStyleDefList = pageData.DefList || []
            detailStyleDefList.forEach(ele => {
               value.row.forEach((rowData) => {
@@ -1262,6 +1148,7 @@
               })
            });
            pageData.DefList = detailStyleDefList
            $this.$set(this.pageDetail, pageIndex, pageData)
         },
         //加载正在码盘内容
@@ -1270,11 +1157,13 @@
            if (JSON.stringify(data.row) == '{}') {
               return;
            }
            const pageData = this.pageDetail.find((page) => {
            const pageIndex = this.pageDetail.findIndex((
               page, index2, arr) => {
               return data.page_name == page.Name;
            });
            if (!pageData)
            })
            if (pageIndex < 0)
               return
            const pageData = this.pageDetail[pageIndex]
            var styleStr = JSON.stringify(pageData.StyleDef);
            var detailStyle = JSON.parse(styleStr);
@@ -1309,6 +1198,7 @@
                  });
                  pageData.DefList.push(detailStyle);
                  this.$set(this.pageDetail, pageIndex, pageData)
               });
            }
@@ -1316,11 +1206,14 @@
         //加载已码盘内容
         viewAceionContent(data) {
            var $this = this;
            const pageData = $this.pageDetail.find((page) => {
            const pageIndex = $this.pageDetail.findIndex((
               page, index2, arr) => {
               return data.page_name == page.Name;
            });
            if (!pageData)
            })
            if (pageIndex < 0)
               return
            const pageData = $this.pageDetail[pageIndex]
            pageData.ExtData = data.ext_data || {}
            if (JSON.stringify(data.content) == '{}') {
@@ -1407,13 +1300,116 @@
                  } else {
                     pageData.DefList.push(detailStyle); //待分拣
                  }
                  $this.activelist.push({
                     active: false
                  });
                  // $this.setData({pageDetail:pageD})
                  $this.$set(this.pageDetail, pageIndex, pageData)
               });
            }
         },
         setFormValues(data) {
            const head_styledef = this.head_styledef
            if (JSON.stringify(data) == '{}') {
               return;
            }
            head_styledef.form.items.forEach(async (ele, index) => {
               if (ele.name != "Layout") {
                  let curIndex = data.findIndex((attr, index2, arr) => {
                     return attr.attr == ele.fieldId;
                  })
                  if (curIndex > -1) {
                     const attr = data[curIndex]
                     if (ele.name ==
                        'Select' &&
                        attr
                        .choice_list
                     ) {
                        const
                           dictItemList = [];
                        const
                           choiceList =
                           attr
                           .choice_list || [];
                        for (let d in
                              choiceList) {
                           const
                              val =
                              choiceList[
                                 d
                              ];
                           dictItemList
                              .push({
                                 text: val,
                                 value: val
                              });
                        }
                        ele.dict =
                           dictItemList;
                     }
                     ele.value =
                        attr
                        .value;
                  }
               } else {
                  ele.setting
                     .colList
                     .forEach(
                        async (
                           col
                        ) => {
                           if (
                              col) {
                              let curIndex = data.findIndex((
                                 attr, index2, arr) => {
                                 return attr.attr == col.fieldId;
                              })
                              if (curIndex > -1) {
                                 const attr = data[curIndex]
                                 if (col.name ==
                                    'Select' &&
                                    attr
                                    .choice_list
                                 ) {
                                    const
                                       dictItemList = [];
                                    const
                                       choiceList =
                                       attr
                                       .choice_list || [];
                                    for (let d in
                                          choiceList) {
                                       const
                                          val =
                                          choiceList[
                                             d
                                          ];
                                       dictItemList
                                          .push({
                                             text: val,
                                             value: val
                                          });
                                    }
                                    col.dict =
                                       dictItemList;
                                 }
                                 col.value =
                                    attr
                                    .value;
                              }
                           }
                        })
               }
            })
            this.setData({
               head_styledef: head_styledef
            })
         },
         onClickItem(e) { //选择页签
            // console.log(e);
            this.current = e.currentIndex
@@ -1525,14 +1521,9 @@
            $this.runCustomEvent(pageData, event, input_param, list);
         },
         onPanelClick(value) {
         onPanelClick(value, id) {
            // console.log(value);
            this.active_id = '';
            this.activelist.forEach(ele => {
               ele.active = false;
            });
            this.activelist[value].active = true;
            // console.log(this.$data.activelist);
            this.active_id = id;
         },
         //确定
         ok(pageData) {
@@ -1838,7 +1829,8 @@
                                          .confirm
                                       ) {
                                          if (
                                             pageData)
                                             pageData
                                          )
                                             pageData
                                             .DefList = [];
                                          $this
@@ -1850,7 +1842,8 @@
                                          .cancel
                                       ) {
                                          if (
                                             pageData)
                                             pageData
                                          )
                                             pageData
                                             .DefList = [];
                                          $this
@@ -1983,121 +1976,8 @@
                              "set_dlg_attr") {
                              // value = {"attr":"xxx", "value":"xxx"}
                              var data = item.value;
                              $this.$data.head_styledef
                                 .form.items.forEach(
                                    async (
                                       ele, index
                                    ) => {
                                       if (ele
                                          .name !=
                                          "Layout"
                                       ) {
                                          data.forEach(
                                             async (ele2,
                                                index
                                             ) => {
                                                if (ele
                                                   .fieldId ==
                                                   ele2
                                                   .attr
                                                ) {
                                                   if (ele.name ==
                                                      'Select' &&
                                                      ele2
                                                      .choice_list
                                                   ) {
                                                      const
                                                         dictItemList = [];
                                                      const
                                                         choiceList =
                                                         ele2
                                                         .choice_list ||
                                                         [];
                                                      for (let d in
                                                            choiceList) {
                                                         const
                                                            val =
                                                            choiceList[
                                                               d
                                                            ];
                                                         dictItemList
                                                            .push({
                                                               text: val,
                                                               value: val
                                                            });
                                                      }
                                                      ele.dict =
                                                         dictItemList;
                                                   }
                                                   ele.value =
                                                      ele2
                                                      .value;
                                                }
                                             });
                                       } else {
                                          ele.setting
                                             .colList
                                             .forEach(
                                                async (
                                                   col
                                                ) => {
                                                   if (
                                                      col) {
                                                      data.forEach(
                                                         async (ele2,
                                                            index
                                                         ) => {
                                                            if (col
                                                               .fieldId ==
                                                               ele2
                                                               .attr
                                                            ) {
                                                               if (col
                                                                  .name ==
                                                                  'Select' &&
                                                                  ele2
                                                                  .choice_list
                                                               ) {
                                                                  const
                                                                     dictItemList = [];
                                                                  const
                                                                     choiceList =
                                                                     ele2
                                                                     .choice_list ||
                                                                     [];
                                                                  for (
                                                                     let d in
                                                                        choiceList
                                                                  ) {
                                                                     const
                                                                        val =
                                                                        choiceList[
                                                                           d
                                                                        ];
                                                                     dictItemList
                                                                        .push({
                                                                           text: val,
                                                                           value: val
                                                                        });
                                                                  }
                                                                  col.dict =
                                                                     dictItemList;
                                                               }
                                                               col.value =
                                                                  ele2
                                                                  .value;
                                                            }
                                                         });
                                                   }
                                                })
                                       }
                                    })
                              $this.setFormValues(data)
                           }
                        });
                     } else {