pages/modal/3200.vue
@@ -674,6 +674,60 @@
   uni.setNavigationBarTitle({ title: options.titlename}); //设置顶部标题 
   this.$data.title = options.titlename;
   this.$data.param = JSON.parse(options.param);
   this.initial();
   // this.isFilter=true;
   // if(this.param.ShowFilter)
   //   this.isFilter=false;
   // //获取数据类的自定义表单参数
   // if(this.param.Query_Panel){
   //    this.Head_UIStyleGetInfo(this.param.DataCls.id,this.param.Query_Panel.id);
   // }
   // if(this.param.ListPage.ListItem_UIDef?.ui_type=="HTML页面"){
   //    // HTML页面
   //    //获取数据类的HTML页面
   //    await this.Html_UIstyleGetInfo(this.param.DataCls.id,this.param.ListPage.ListItem_UIDef.id);
   // }else{
   //    await this.Detail1_UIstyleGetInfo(this.param.DataCls.id,this.param.ListPage.ListItem_UIDef.id);
   // }
   // this.orderby = this.param.Order?this.param.Order:'T_CREATE Desc';
   // if(this.param.Query_Event){
   //     await this.onSearChange(this.param.DataCls.id,this.param.Query_Event.id);
   // } else{
   //   this.wheres = this.param.Condition;
   //   this.pageindex = 1;
   //   this.page_size = 3;
   //   this.query_id = "";
   //   await this.loadDataGetList();
   // }
   // console.log(this.$data.param);
   //页面初始化获取焦点
   // this.focusMateria=true;
  },
  methods: {
   //初始化
   async initial(){
      this.styledef={};
      this.head_styledef={
            form:{
               items:[]
            }
      };
      this.detail1_styledef={};
      this.detail1StyleDefList=[];
      this.detail2_styledef={};
      this.detail2StyleDefList=[];
      this.items=[];
      this.active_id='';
      this.activelist=[];
      this.ListHtml_Panel="";
      this.ListPageHtml_Show= {
         name: "",
         event: {
            id: "",
            name: ""
         }
      };
   this.isFilter=true;
   if(this.param.ShowFilter)
     this.isFilter=false;
@@ -698,11 +752,7 @@
     this.query_id = "";
     await this.loadDataGetList();
   }
   console.log(this.$data.param);
   //页面初始化获取焦点
   // this.focusMateria=true;
  },   
  methods: {
   //滚动到底部后懒加载数据
   async scrolltolower(e) {
      // console.log(e)
@@ -1071,10 +1121,10 @@
   //刷新
   Refresh(value){
     //刷新当前页面
     // location.reload();
     uni.redirectTo({
        url:'../modal/3200?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title
     });
     this.initial();
     // uni.redirectTo({
     //    url:'../modal/3200?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title,
     // });
   },
   //点击显示浏览对象显示页面
   async onViewPageClick(style){
@@ -1103,6 +1153,7 @@
                       start_transaction: true,
                         class_id: $this.param.DataCls.id,
                         event_id: eventid,
                       data_obj_id:$this.styledef.form.objId,
                         obj_attr,
                         input_param,
                     });
@@ -1511,9 +1562,9 @@
   },
   
   cancel(e){ //取消
      var eventChannel = this.$scope.eventChannel;
      // const eventChannel = this.getOpenerEventChannel();
      eventChannel.emit('view_3201',"");
      // var eventChannel = this.$scope.eventChannel;
      // // const eventChannel = this.getOpenerEventChannel();
      // eventChannel.emit('view_3201',"");
      uni.navigateBack({
         delta:1 ,//返回层数,2则上上页
      });
@@ -1538,33 +1589,34 @@
    *     ]
    * }
    */
   toWhereBase64String(list) {
       if (typeof list == 'string') list = [list]
       var sql = []
       var seps = [' not in', ' in', '<>', '!=', '<=', '>=', '<', '=', '>', ' like']
       list.forEach(ls => {
           var where = ls.trim().toLowerCase()
         var where = ls.trim()
           if (where.startsWith('(') && where.endsWith(')')) where = where.replace(/^\(/, '').replace(/\)$/, '')
           if (where.includes(' and ')) {
         if (where.toLowerCase().includes(' and ')) {
               // 二级and放在第一级数组中
               where.split(' and ').forEach(li => {
            where.split(/ and /i).forEach(li => {
                   var l = li.trim()
                   if (l.startsWith('(') && l.endsWith(')')) l = l.replace(/^\(/, '').replace(/\)$/, '')
                   var sep = ''
                   for (var i = 0; i < seps.length; i++) {
                       if (l.includes(seps[i])) {
                  if (l.toLowerCase().includes(seps[i])) {
                           sep = seps[i]
                           break
                       }
                   }
                   if (sep) {
                       var values = l.split(sep)
                  var values = l.split(new RegExp(sep, 'i'))
                       var field = values[0]?.trim().replace(/^\[/, '').replace(/\]$/, '')
                       var value = ''
                       var op = sep.trim()
   
                       if ([' in', ' not in'].includes(sep) && values[1].includes('select ') && values[1].includes(' from ')) {
                           value = l.replace(field, '').replace(/^\s*(in|not in)\s*/, '').trim()
                  if ([' in', ' not in'].includes(sep) && values[1]?.toLowerCase().includes('select ') && values[1]?.toLowerCase().includes(' from ')) {
                     value = l.replace(field, '').replace(/^\s*(in|not in)\s*/i, '').trim()
                           if (value.startsWith('(') && value.endsWith(')')) value = value.replace(/^\(/, '').replace(/\)$/, '').trim()
                       }
                       else {
@@ -1579,27 +1631,27 @@
                   }
               })
           }
           else if (where.includes(' or ')) {
         else if (where.toLowerCase().includes(' or ')) {
               // 二级or放在第二级同一组数组中
               var s = []
               where.split(' or ').forEach(li => {
            where.split(/ or /i).forEach(li => {
                   var l = li.trim()
                   if (l.startsWith('(') && l.endsWith(')')) l = l.replace(/^\(/, '').replace(/\)$/, '')
                   var sep = ''
                   for (var i = 0; i < seps.length; i++) {
                       if (l.includes(seps[i])) {
                  if (l.toLowerCase().includes(seps[i])) {
                           sep = seps[i]
                           break
                       }
                   }
                   if (sep) {
                       var values = l.split(sep)
                  var values = l.split(new RegExp(sep, 'i'))
                       var field = values[0]?.trim().replace(/^\[/, '').replace(/\]$/, '')
                       var value = ''
                       var op = sep.trim()
   
                       if ([' in', ' not in'].includes(sep) && values[1].includes('select ') && values[1].includes(' from ')) {
                           value = l.replace(field, '').replace(/^\s*(in|not in)\s*/, '').trim()
                  if ([' in', ' not in'].includes(sep) && values[1]?.toLowerCase().includes('select ') && values[1]?.toLowerCase().includes(' from ')) {
                     value = l.replace(field, '').replace(/^\s*(in|not in)\s*/i, '').trim()
                           if (value.startsWith('(') && value.endsWith(')')) value = value.replace(/^\(/, '').replace(/\)$/, '').trim()
                       }
                       else {
@@ -1622,19 +1674,19 @@
               if (l.startsWith('(') && l.endsWith(')')) l = l.replace(/^\(/, '').replace(/\)$/, '')
               var sep = ''
               for (var i = 0; i < seps.length; i++) {
                   if (l.includes(seps[i])) {
               if (l.toLowerCase().includes(seps[i])) {
                       sep = seps[i]
                       break
                   }
               }
               if (sep) {
                   var values = l.split(sep)
               var values = l.split(new RegExp(sep,'i'))
                   var field = values[0]?.trim().replace(/^\[/, '').replace(/\]$/, '')
                   var value = ''
                   var op = sep.trim()
   
                   if ([' in', ' not in'].includes(sep) && values[1].includes('select ') && values[1].includes(' from ')) {
                       value = l.replace(field, '').replace(/^\s*(in|not in)\s*/, '').trim()
               if ([' in', ' not in'].includes(sep) && values[1]?.toLowerCase().includes('select ') && values[1]?.toLowerCase().includes(' from ')) {
                  value = l.replace(field, '').replace(/^\s*(in|not in)\s*/i, '').trim()
                       if (value.startsWith('(') && value.endsWith(')')) value = value.replace(/^\(/, '').replace(/\)$/, '').trim()
                   }
                   else {
@@ -1657,7 +1709,7 @@
           }))
       else
           return ''
   }
   },
  },
};