cyy
2024-08-26 41e6159cfa12416155adcd6747e48fab28ffc534
pages/modal/5601.vue
@@ -116,8 +116,9 @@
                     <view class="view-bottom" v-if="pageData.OK_Button==true">
                        <button type="default" @tap="cancel"
                           class="btn_cancel">{{translateSys('cancel')}}</button>
                        <button type="primary" @tap="ok(pageData)"
                           class="btn_add" :class="pageData.okLoading?'btn_disabled':''" :disabled="pageData.okLoading? true:false">{{translateSys('ok')}}</button>
                        <button type="primary" @tap="ok(pageData)" class="btn_add"
                           :class="pageData.okLoading?'btn_disabled':''"
                           :disabled="pageData.okLoading? true:false">{{translateSys('ok')}}</button>
                     </view>
                  </view>
               </swiper-item>
@@ -260,8 +261,9 @@
            //加载Tab页签
            const pageList = this.param.Sub_Page || []
            for (let i in pageList) {
               page.DefList = [];
               const page = pageList[i]
               page.DefList = [];
               page.StyleDef = await this.Detail_UIstyleGetInfo(
                  this.ClsID,
                  page.UI_Style.ID
@@ -376,14 +378,13 @@
         },
         async Detail_UIstyleGetInfo(class_id, style_id) { //获取自定义表单样式
            try {
            var $this = this;
            var dataInfo = {
               class_id: class_id,
               ui_style_id: style_id,
            };
            this.$store.dispatch('UIStyleGetInfo', dataInfo).then(async (ret) => {
               // console.log(ret);
               if (ret.err_code == 0) {
               const ret = await this.getUIStyleInfo(dataInfo)
                  var styledef = "";
                  if (ret.result.style_def) {
                     //mobox2的style_def是json字符串
@@ -397,8 +398,8 @@
                  const detailstyledef = ret.result.style_def ? JSON.parse(
                     styledef) : {};
                  detailstyledef.SelBut_Checked = true;
                  for (let index in styledefHead.form.items) {
                     const ele = styledefHead.form.items[index]
               for (let index in detailstyledef.form.items) {
                  const ele = detailstyledef.form.items[index]
                     if (ele.name != "Layout") {
                        if (ele.useDict == true) { //判断useDict是否使用字典
@@ -420,25 +421,74 @@
                  }
                  console.log("Detail_UIstyleGetInfo", detailstyledef);
                  return detailstyledef
               } else {
                  return {}
                  uni.showModal({
                     title: this.translateSys("error") + "2",
                     content: ret.err_msg,
                     showCancel: false,
                     confirmText: this.translateSys("cancel")
                  });
               }
            }).catch(ex => {
            } catch (ex) {
               // console.log(ex);
               uni.showModal({
                  title: this.translateSys("error") + "2.1",
                  title: this.translateSys("error") + "2",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: this.translateSys("cancel")
               });
               return {}
            });
            }
            // this.$store.dispatch('UIStyleGetInfo', dataInfo).then(async (ret) => {
            //    // console.log(ret);
            //    if (ret.err_code == 0) {
            //       var styledef = "";
            //       if (ret.result.style_def) {
            //          //mobox2的style_def是json字符串
            //          styledef = ret.result.style_def.replace(/\\/g, "");
            //          //mobox3的style_def是base64字符串
            //          if (!ret.result.style_def.includes('"')) styledef = Base64
            //             .decode(ret.result
            //                .style_def);
            //       }
            //       const detailstyledef = ret.result.style_def ? JSON.parse(
            //          styledef) : {};
            //       detailstyledef.SelBut_Checked = true;
            //       for (let index in detailstyledef.form.items) {
            //          const ele = detailstyledef.form.items[index]
            //          if (ele.name != "Layout") {
            //             if (ele.useDict == true) { //判断useDict是否使用字典
            //                await this.DictGetInfo(ele.bind.dict,
            //                   detailstyledef.form
            //                   .model, ele);
            //             }
            //          } else {
            //             for (let j in ele.setting.colList) {
            //                const col = ele.setting.colList[j]
            //                if (col?.useDict == true) {
            //                   await this.DictGetInfo(col
            //                      .bind.dict,
            //                      detailstyledef.form
            //                      .model, col);
            //                }
            //             }
            //          }
            //       }
            //       console.log("Detail_UIstyleGetInfo", detailstyledef);
            //       return detailstyledef
            //    } else {
            //       return {}
            //       uni.showModal({
            //          title: this.translateSys("error") + "2",
            //          content: ret.err_msg,
            //          showCancel: false,
            //          confirmText: this.translateSys("cancel")
            //       });
            //    }
            // }).catch(ex => {
            //    // console.log(ex);
            //    uni.showModal({
            //       title: this.translateSys("error") + "2.1",
            //       content: ex.errMsg,
            //       showCancel: false,
            //       confirmText: this.translateSys("cancel")
            //    });
            //    return {}
            // });
         },
@@ -481,12 +531,42 @@
            }
         },
         getDictInfo(info) { //Mobox3得到得到字典信息字典项列表
         getDictInfo(info) { //Mobox3得到字典信息字典项列表
            const loginInfo = this.$store.getters.loginid
            const mobxoSApi = this.$store.getters.getMobxoSApi
            return new Promise((resolve, reject) => {
               uni.request({
                  url: mobxoSApi + 'api/dict/GetInfo2?sessionid=' + loginInfo.result.session_id,
                  data: info,
                  method: 'POST',
                  dataType: "json",
                  success: (_res) => {
                     // console.log(_res);
                     const ret = _res.data
                     if (ret.err_code == 0) {
                        resolve(ret);
                     } else {
                        reject({
                           "errMsg": ret.err_msg
                        });
                     }
                  },
                  fail: (err) => {
                     // console.log(err);
                     reject(err);
                  }
               })
            })
         },
         getUIStyleInfo(info) { //Mobox3数据类界面样式
            const loginInfo = this.$store.getters.loginid
            const dataSApi = this.$store.getters.getDataSApi
            return new Promise((resolve, reject) => {
               uni.request({
                  url: dataSApi + 'api/class/uistyle/GetInfo?sessionid=' + loginInfo.result
                     .session_id,
                  data: info,
                  method: 'POST',
                  dataType: "json",
@@ -628,6 +708,7 @@
         },
         getDetailAttrList(pageData) {
            const detailAttrList = [];
            if (pageData.DefList) {
            pageData.DefList.forEach(style => {
               var detail_attr = {};
               style.form.items.forEach(item => {
@@ -668,7 +749,7 @@
                  }
               });
            });
            }
            const jsonlist = [];
            detailAttrList.forEach(attr => {
               jsonlist.push({
@@ -711,6 +792,7 @@
                  var $this = this;
                  const jsonList = []
                  this.pageDetail.forEach((page) => {
                     jsonList.push({
                        page_name: page.Name,
                        item_list: $this.getDetailAttrList(page
@@ -718,6 +800,7 @@
                           .Select_Button),
                        ext_data: page.ExtData || {}
                     })
                  })
                  const data_json = Base64.encode(
                     JSON.stringify(jsonList)
@@ -742,7 +825,7 @@
                     input_param: input_param,
                  };
                  this.$store.dispatch('runCustomEvent', dataInfo).then(ret => {
                     // console.log(ret);
                     console.log(ret);
                     if (ret.err_code == 0) {
                        var result = ret.result;
                        if (result.ret != 0) {
@@ -789,6 +872,7 @@
                           if (result.result_type == 0 && result.action) {
                              result.action.forEach(item => {
                                 if (item.action_type ==
                                    "insert_subtable_page_row"
                                 ) { //码盘中
@@ -1310,7 +1394,7 @@
               return;
            }
            const pageData = this.pageDetail.find((page) => {
               return value.page_name == page.Name;
               return data.page_name == page.Name;
            });
            if (!pageData)
               return
@@ -1353,11 +1437,11 @@
         viewAceionContent(data) {
            var $this = this;
            const pageData = $this.pageDetail.find((page) => {
               return value.page_name == page.Name;
               return data.page_name == page.Name;
            });
            if (!pageData)
               return
            console.log("viewAceionContent", pageData)
            pageData.ExtData = data.ext_data || {}
            if (JSON.stringify(data.content) == '{}') {
@@ -1365,7 +1449,7 @@
            }
            data.content.forEach(cont => {
               var styleStr = JSON.stringify(pageData.StyleDef);
               console.log("viewAceionContent2", pageData)
               var detailStyle = JSON.parse(styleStr);
               detailStyle.SelBut_Checked = data.checkbox ?? true;
               detailStyle.form.objId = cont.id;
@@ -2211,6 +2295,7 @@
                  color: #fff;
                  display: inline-block;
               }
               .btn_disabled {
                  background-color: #ddd;
                  color: #888;