cuiqian2004
2024-07-12 effc285be3229af6b77edafcb5ec71b96a35f53a
pages/modal/3037_2.vue
@@ -288,15 +288,64 @@
         }); //设置顶部标题 
         this.$data.title = options.titlename;
         this.$data.param = JSON.parse(options.param);
         console.log(this.$data.param);
         //获取数据类的自定义表单参数
         this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
         this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID);
         this.loadData(options.paramValue)
         //页面初始化获取焦点
         // this.focusMateria=true; 
      },
      methods: {
         setData: function(obj) {
            let that = this;
            let keys = [];
            let val, data;
            Object.keys(obj).forEach(function(key) {
               keys = key.split(".");
               val = obj[key];
               data = that.$data;
               keys.forEach(function(key2, index) {
                  if (index + 1 == keys.length) {
                     that.$set(data, key2, val);
                  } else {
                     if (!data[key2]) {
                        that.$set(data, key2, {});
                     }
                  }
                  data = data[key2];
               });
            });
         },
         async loadData(paramValue) {
            console.log(this.$data.param);
            //获取数据类的自定义表单参数
            await this.Head_UIStyleGetInfo(this.param.Master_Cls?.ID, this.param.Master_Cls?.UI_Style?.ID);
            //传入参数值
            if (paramValue) {
               const attrs = paramValue.attrs || [];
               (this.$data.head_styledef?.form?.items || []).forEach(async (ele, index) => {
                  if (ele.name != "Layout") {
                     attrs.forEach(async (ele2, index2) => {
                        if (ele.fieldId == ele2.name) {
                           ele.value = ele2.value;
                        }
                     });
                  } else {
                     ele.setting.colList.forEach(async (col) => {
                        if (col) {
                           attrs.forEach(async (ele2,
                              index2) => {
                              if (col.fieldId == ele2.name) {
                                 col.value = ele2.value;
                              }
                           });
                        }
                     });
                  }
               })
            }
            await this.Detail1_UIstyleGetInfo(this.param.Sub_Cls?.ID, this.$data.param.Sub_Cls?.UI_Style?.ID);
         },
         async Head_UIStyleGetInfo(class_id, style_id) { //获取自定义表单样式
            var $this = this;
            var dataInfo = {
@@ -491,8 +540,7 @@
                           showCancel: false,
                           confirmText: this.translateSys("cancel")
                        });
                     }
                     else uni.showModal({
                     } else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                        showCancel: false,
@@ -1217,8 +1265,7 @@
                           showCancel: false,
                           confirmText: this.translateSys("cancel")
                        });
                     }
                     else uni.showModal({
                     } else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                        showCancel: false,
@@ -1511,10 +1558,10 @@
                           showCancel: false,
                           confirmText: this.translateSys("cancel")
                        });
                     }
                     else uni.showModal({
                     } else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + this.translateSys('comma')  + this.translate('result') +this.translateSys('colon')  + data.ret,
                        content: tip + this.translateSys('comma') + this.translate('result') + this
                           .translateSys('colon') + data.ret,
                        showCancel: false,
                        confirmText: this.translateSys("cancel")
                     });
@@ -1872,8 +1919,7 @@
                           showCancel: false,
                           confirmText: this.translateSys("cancel")
                        });
                     }
                     else uni.showModal({
                     } else uni.showModal({
                        title: this.translateSys("tip"),
                        content: tip + ',' + this.translateSys('tip') + ':' + data.ret,
                        showCancel: false,