cuiqian2004
2025-08-29 7662665a4f88da0f8afa804bd4a34dfbefc1fb56
pages/modal/3202_view.vue
@@ -33,6 +33,10 @@
   import {
      Base64
   } from '@/js/Base64.js';
   import {
      showInfo,
      showError
   } from "@/js/Page.js"
   import classUtils from "@/js/utils.js"
   import {
      appGetInfo,
@@ -234,13 +238,7 @@
               }
            } catch (ex) {
               // console.log(ex);
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
               uni.showModal({
                  title: this.translateSys("error") + "1.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + "1.1")
            }
         },
@@ -265,13 +263,7 @@
               $this.detail1_styledef.SelBut_Checked = false;
            } catch (ex) {
               // console.log(ex);
               let tip = typeof ex.errMsg == "string" ? ex.errMsg : ex
               uni.showModal({
                  title: this.translateSys("error") + "1.1",
                  content: tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + "1.1")
            }
@@ -309,12 +301,7 @@
               }
            } catch (ex) {
               // console.log(ex);
               uni.showModal({
                  title: this.translateSys("error") + "3",
                  content: ex.errMsg,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               showError(ex, this.translateSys('error') + "3")
            }
         },
         viewAceionContent(list) {
@@ -395,7 +382,7 @@
               })
            } catch (ex) {
               this.showError(ex);
               showError(ex, this.translateSys('tip'));
            }
         },
@@ -406,483 +393,297 @@
               var $this = this;
               runCustomEvent(dataInfo).then(result => {
                  console.log(result);
                     console.log(result);
                  if (result.ret != 0&& result.ret != 1) {
                     var tip = result.err_info ? typeof result
                        .err_info ==
                        'string' ?
                        result
                        .err_info : result.err_info.join(
                           '<br/>') : '';
                     if (result.ret == 801) {
                        if (this.param.Only_Script_Error) {
                           let pos = tip.indexOf(":");
                           if (pos > -1) tip = tip.substring(
                              pos + 1);
                        }
                        uni.showModal({
                           title: this.translateSys(
                              "tip"),
                           content: tip,
                           showCancel: false,
                           confirmText: this
                              .translateSys('close')
                        });
                     } else uni.showModal({
                        title: this.translateSys(
                           "tip"),
                        content: tip + ',' + this
                           .translateSys('tip') +
                           ':' +
                           result.ret,
                        showCancel: false,
                        confirmText: this.translateSys(
                           'close')
                     });
                     return false;
                  } else {
                     var tip = result.info ? typeof result
                        .info == 'string' ? result
                        .info : result
                        .info.join('<br/>') : '';
                     tip = tip || result.err_info
                     if (tip) uni.showModal({
                        title: this.translateSys(
                           "tip"),
                        content: tip,
                        showCancel: false,
                        confirmText: this.translateSys(
                           'close')
                     });
                     if ([0, 2, 3, 4, -1].includes(result.result_type)) {
                        if (result.result_type == 2) {
                        } else if (typeof result.result == 'string') {
                           if (result.result) {
                              uni.showModal({
                                 title: this.translateSys('tip'),
                                 content: result.result,
                                 showCancel: false,
                                 confirmText: this.translateSys('close')
                              });
                     if (result.ret != 0 && result.ret != 1) {
                        let cls_name = result.event_info?.cls_name
                        let event_name = result.event_info?.event_name
                        tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result
                           .err_info
                           .join('\n') : ''
                        if (result.ret == 801) {
                           if (this.param.Only_Script_Error) {
                              let pos = tip.indexOf(":");
                              if (pos > -1) tip = tip.substring(pos + 1);
                           }
                        }
                        try {
                           var actionList = result.action || []
                           actionList.forEach(item => {
                              if (item.action_type == "goback_to_pre_page") { //返回上一页
                                 var value = item.value;
                                 uni.navigateBack({
                                    delta: 1, //返回层数,2则上上页
                                 });
                              } else {
                                 uni.showModal({
                                    title: this
                                       .translateSys(
                                          "tip"
                                       ),
                                    content: this
                                       .translateSys(
                                          "quotation_mark_left"
                                       ) +
                                       item
                                       .action_type +
                                       this
                                       .translateSys(
                                          "quotation_mark_right"
                                       ) +
                                       this
                                       .translate(
                                          "tip_action_unprocessed"
                                       ),
                                    showCancel: false,
                                    confirmText: this
                                       .translateSys(
                                          'close'
                                       )
                                 });
                              }
                           });
                        if (cls_name && event_name) tip = `执行“${cls_name}”数据类的“${event_name}”脚本时返回错误:${tip}`
                        if (result.ret == 801) showInfo(tip)
                        else showError(`${tip},提示:${result.ret}`, this.translateSys('tip'))
                        this.saving = false
                        return false
                     } else {
                        var tip = result.info ? typeof result.info == 'string' ? result.info :
                           result.info.join('\n') : '';
                        tip = tip || result.err_info
                        let time = result.info_time || 0
                        if (time)
                           showError(tip, this.translateSys('tip'))
                        else
                        showInfo(tip)
                        if ([0, 2, 3, 4, -1].includes(result.result_type)) {
                           if (result.result_type == 2) {
                           } else if (typeof result.result == 'string') {
                              showInfo(result.result)
                           }
                           try {
                              var actionList = result.action || []
                              actionList.forEach(item => {
                                    if (item.action_type == "goback_to_pre_page") { //返回上一页
                                       var value = item.value;
                                       uni.navigateBack({
                                          delta: 1, //返回层数,2则上上页
                                       });
                                    } else {
                                       showInfo(this
                                          .translateSys(
                                             "quotation_mark_left"
                                          ) +
                                          item
                                          .action_type +
                                          this
                                          .translateSys(
                                             "quotation_mark_right"
                                          ) +
                                          this
                                          .translate(
                                             "tip_action_unprocessed"
                                          ))
                                 }
                              });
                        } catch (ex) {
                           let actionList = (result.action || []).map(a => a.action_type).join(';')
                           let tip = typeof ex == 'string' ? ex : ex.message
                           tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}`
                           uni.showModal({
                              title: this.translateSys('tip'),
                              content: tip,
                              showCancel: false,
                              confirmText: this.translateSys('close')
                           });
                           console.log(ex)
                           showError(tip, this.translateSys('tip'))
                           return
                        }
                     }
                  }
               }).catch(ex => {
                  console.log(ex);
                  uni.showModal({
                     title: this.translateSys("error") +
                        "9.1",
                     content: ex.errMsg,
                     showCancel: false,
                     confirmText: this.translateSys(
                        'close')
                  });
               });
            } catch (ex) {
               var tip = typeof ex == "string" ? ex : ex.message;
               uni.showModal({
                  title: this.translateSys("error") + "9.2",
                  content: this.translate('execute_event_failed') +
                     this.translateSys(
                        "comma") +
                     this.translate('reason') + this.translateSys(
                        "colon") + tip,
                  showCancel: false,
                  confirmText: this.translateSys('close')
               });
               console.log(ex);
               showError(ex, this.translateSys("error") + "9.1")
            }
         },
         //点击按钮列表
         clickDropdownBtns() {
            var that = this
            var itemlist = [];
            this.dropdownBtns.forEach((btn) => {
               itemlist.push(btn.ShowName);
            });
            uni.showActionSheet({
               // title: '按钮列表',
               itemList: itemlist,
               success: (e) => {
                  console.log(e.tapIndex);
                  var btn = that.dropdownBtns[e.tapIndex];
                  that.onButtonClicked(btn);
               }
            })
         },
         onButtonClicked(btn) {
         } catch (ex) {
            showError(ex, this.translateSys('error') + "9.2")
            let enviroment = {
               button: "top",
               button_name: btn.ShowName,
               cls_id: btn.Cls_ID,
               function: "3202",
               master: {},
            };
            if (btn.FunCode == "TriggerEvent") {
               this.onTriggerEvent(btn, enviroment);
            } else {
               this.$Message.warning(this.$t("sys.unrealized"));
         }
      },
      //点击按钮列表
      clickDropdownBtns() {
         var that = this
         var itemlist = [];
         this.dropdownBtns.forEach((btn) => {
            itemlist.push(btn.ShowName);
         });
         uni.showActionSheet({
            // title: '按钮列表',
            itemList: itemlist,
            success: (e) => {
               console.log(e.tapIndex);
               var btn = that.dropdownBtns[e.tapIndex];
               that.onButtonClicked(btn);
            }
         })
      },
      onButtonClicked(btn) {
         },
         async onTriggerEvent(btn, enviroment) {
            let data_json = [];
            let jsonlist = [];
         let enviroment = {
            button: "top",
            button_name: btn.ShowName,
            cls_id: btn.Cls_ID,
            function: "3202",
            master: {},
         };
         if (btn.FunCode == "TriggerEvent") {
            this.onTriggerEvent(btn, enviroment);
         } else {
            this.$Message.warning(this.$t("sys.unrealized"));
         }
            let detailStyleList = this.detail1StyleDefList;
            detailStyleList.forEach((style) => {
               let detail_attr = {};
               style.form.items.forEach((item) => {
                  if (item.name == "Layout") {
                     item.setting.colList.forEach((cols) => {
                        if (cols != null) detail_attr[cols.fieldId] = cols.value;
                     });
                  } else detail_attr[item.fieldId] = item.value;
               });
               jsonlist.push(detail_attr);
            });
            data_json = Base64.encode(JSON.stringify(jsonlist));
      },
      async onTriggerEvent(btn, enviroment) {
         let data_json = [];
         let jsonlist = [];
            let input_param = {};
            this.head_styledef.form.items.forEach((item) => {
         let detailStyleList = this.detail1StyleDefList;
         detailStyleList.forEach((style) => {
            let detail_attr = {};
            style.form.items.forEach((item) => {
               if (item.name == "Layout") {
                  item.setting.colList.forEach((cols) => {
                     if (cols != null) input_param[cols.fieldId] = cols.value;
                     if (cols != null) detail_attr[cols.fieldId] = cols.value;
                  });
               } else input_param[item.fieldId] = item.value;
               } else detail_attr[item.fieldId] = item.value;
            });
            input_param = Base64.encode(JSON.stringify(input_param));
            await this.runCustomEvent({
               ed_type: 0,
               start_transaction: true,
               class_id: btn.Cls_ID,
               event_id: btn.Event.ID,
               input_param,
               data_json,
            });
         },
         navigateBackEvent() {
            if (!this.exit_view_event.id)
               return
            let data_json = [];
            let jsonlist = [];
            let detailStyleList = this.detail1StyleDefList;
            detailStyleList.forEach((style) => {
               let detail_attr = {};
               style.form.items.forEach((item) => {
                  if (item.name == "Layout") {
                     item.setting.colList.forEach((cols) => {
                        if (cols != null) detail_attr[cols.fieldId] = cols.value;
                     });
                  } else detail_attr[item.fieldId] = item.value;
               });
               jsonlist.push(detail_attr);
            });
            data_json = Base64.encode(JSON.stringify(jsonlist));
            jsonlist.push(detail_attr);
         });
         data_json = Base64.encode(JSON.stringify(jsonlist));
            let input_param = {};
            this.head_styledef.form.items.forEach((item) => {
         let input_param = {};
         this.head_styledef.form.items.forEach((item) => {
            if (item.name == "Layout") {
               item.setting.colList.forEach((cols) => {
                  if (cols != null) input_param[cols.fieldId] = cols.value;
               });
            } else input_param[item.fieldId] = item.value;
         });
         input_param = Base64.encode(JSON.stringify(input_param));
         await this.runCustomEvent({
            ed_type: 0,
            start_transaction: true,
            class_id: btn.Cls_ID,
            event_id: btn.Event.ID,
            input_param,
            data_json,
         });
      },
      navigateBackEvent() {
         if (!this.exit_view_event.id)
            return
         let data_json = [];
         let jsonlist = [];
         let detailStyleList = this.detail1StyleDefList;
         detailStyleList.forEach((style) => {
            let detail_attr = {};
            style.form.items.forEach((item) => {
               if (item.name == "Layout") {
                  item.setting.colList.forEach((cols) => {
                     if (cols != null) input_param[cols.fieldId] = cols.value;
                     if (cols != null) detail_attr[cols.fieldId] = cols.value;
                  });
               } else input_param[item.fieldId] = item.value;
               } else detail_attr[item.fieldId] = item.value;
            });
            input_param = Base64.encode(JSON.stringify(input_param));
            const eventChannel = this.getOpenerEventChannel();
            jsonlist.push(detail_attr);
         });
         data_json = Base64.encode(JSON.stringify(jsonlist));
            eventChannel.emit('ExitViewEvent', {
               ed_type: 0,
               start_transaction: true,
               class_id: this.param.ClsID,
               event_id: this.exit_view_event.id,
               input_param,
               data_json,
            });
         },
         cancel(e) { //取消
            this.navigateBackEvent()
            uni.navigateBack({
               delta: 1, //返回层数,2则上上页
            });
         },
         /**
          * 只支持["column1='A' or column2='B'", "column3='C' and column4='D'", "column5='E'"]这种格式
          * {
          *     "model": 0 / 1,
          *     "condition":
          *     [
          *         [
          *             { },
          *             { },
          *             { }
          *         ],
          *         [
          *             { }
          *         ],
          *         [
          *             { }
          *         ]
          *     ]
          * }
          */
         let input_param = {};
         this.head_styledef.form.items.forEach((item) => {
            if (item.name == "Layout") {
               item.setting.colList.forEach((cols) => {
                  if (cols != null) input_param[cols.fieldId] = cols.value;
               });
            } else input_param[item.fieldId] = item.value;
         });
         input_param = Base64.encode(JSON.stringify(input_param));
         const eventChannel = this.getOpenerEventChannel();
         toWhereBase64String(list) {
            if (typeof list == 'string') list = [list]
            var sql = []
            var seps = [' not in', ' in', '<>', '!=', '<=', '>=', '<', '=',
               '>', ' like'
            ]
            list.forEach(ls => {
               var where = ls.trim()
               if (where.startsWith('(') && where.endsWith(')'))
                  where = where.replace(
         eventChannel.emit('ExitViewEvent', {
            ed_type: 0,
            start_transaction: true,
            class_id: this.param.ClsID,
            event_id: this.exit_view_event.id,
            input_param,
            data_json,
         });
      },
      cancel(e) { //取消
         this.navigateBackEvent()
         uni.navigateBack({
            delta: 1, //返回层数,2则上上页
         });
      },
      /**
       * 只支持["column1='A' or column2='B'", "column3='C' and column4='D'", "column5='E'"]这种格式
       * {
       *     "model": 0 / 1,
       *     "condition":
       *     [
       *         [
       *             { },
       *             { },
       *             { }
       *         ],
       *         [
       *             { }
       *         ],
       *         [
       *             { }
       *         ]
       *     ]
       * }
       */
      toWhereBase64String(list) {
         if (typeof list == 'string') list = [list]
         var sql = []
         var seps = [' not in', ' in', '<>', '!=', '<=', '>=', '<', '=',
            '>', ' like'
         ]
         list.forEach(ls => {
            var where = ls.trim()
            if (where.startsWith('(') && where.endsWith(')'))
               where = where.replace(
                  /^\(/,
                  '').replace(
                  /\)$/, '')
            if (where.toLowerCase().includes(' and ')) {
               // 二级and放在第一级数组中
               where.split(/ and /i).forEach(li => {
                  var l = li.trim()
                  if (l.startsWith('(') && l.endsWith(
                        ')')) l = l.replace(
                     /^\(/,
                     '').replace(
                     /\)$/, '')
               if (where.toLowerCase().includes(' and ')) {
                  // 二级and放在第一级数组中
                  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.toLowerCase().includes(seps[
                              i])) {
                           sep = seps[i]
                           break
                        }
                     }
                     if (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]
                           ?.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 {
                           value = values[1]?.trim()
                              .replace(/^\'/, '')
                              .replace(
                                 /\'$/, '')
                           if (['in', 'not in'].includes(
                                 op)) {
                              value = value.replace(
                                 /^\(/, '').replace(
                                 /\)$/,
                                 '')
                              value = value.split(',')
                                 .map(v => v.trim()
                                    .replace(
                                       /^\'/, '')
                                    .replace(/\'$/, '')
                                 )
                           }
                        }
                        sql.push([{
                           field,
                           value,
                           op
                        }])
                     }
                  })
               } else if (where.toLowerCase().includes(' or ')) {
                  // 二级or放在第二级同一组数组中
                  var s = []
                  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.toLowerCase().includes(seps[
                              i])) {
                           sep = seps[i]
                           break
                        }
                     }
                     if (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]
                           ?.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 {
                           value = values[1]?.trim()
                              .replace(/^\'/, '')
                              .replace(
                                 /\'$/, '')
                           if (['in', 'not in'].includes(
                                 op)) {
                              value = value.replace(
                                 /^\(/, '').replace(
                                 /\)$/,
                                 '')
                              value = value.split(',')
                                 .map(v => v.trim()
                                    .replace(
                                       /^\'/, '')
                                    .replace(/\'$/, '')
                                 )
                           }
                        }
                        sql.push([{
                           field,
                           value,
                           op
                        }])
                     }
                  })
                  sql.push(s)
               } else {
                  var li = where
                  // 单一查询条件直接放在第一级数组中
                  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.toLowerCase().includes(seps[i])) {
                     if (l.toLowerCase().includes(seps[
                           i])) {
                        sep = seps[i]
                        break
                     }
                  }
                  if (sep) {
                     var values = l.split(new RegExp(sep, 'i'))
                     var field = values[0]?.trim().replace(/^\[/,
                        '').replace(/\]$/, '')
                     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]?.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
                     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 {
                        value = values[1]?.trim().replace(/^\'/,
                           '').replace(/\'$/, '')
                        value = values[1]?.trim()
                           .replace(/^\'/, '')
                           .replace(
                              /\'$/, '')
                        if (['in', 'not in'].includes(op)) {
                           value = value.replace(/^\(/, '')
                              .replace(/\)$/, '')
                           value = value.split(',').map(v => v
                              .trim().replace(/^\'/,
                                 '')
                              .replace(/\'$/,
                                 ''))
                        if (['in', 'not in'].includes(
                              op)) {
                           value = value.replace(
                              /^\(/, '').replace(
                              /\)$/,
                              '')
                           value = value.split(',')
                              .map(v => v.trim()
                                 .replace(
                                    /^\'/, '')
                                 .replace(/\'$/, '')
                              )
                        }
                     }
                     sql.push([{
@@ -891,27 +692,154 @@
                        op
                     }])
                  }
               })
            } else if (where.toLowerCase().includes(' or ')) {
               // 二级or放在第二级同一组数组中
               var s = []
               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.toLowerCase().includes(seps[
                           i])) {
                        sep = seps[i]
                        break
                     }
                  }
                  if (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]
                        ?.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 {
                        value = values[1]?.trim()
                           .replace(/^\'/, '')
                           .replace(
                              /\'$/, '')
                        if (['in', 'not in'].includes(
                              op)) {
                           value = value.replace(
                              /^\(/, '').replace(
                              /\)$/,
                              '')
                           value = value.split(',')
                              .map(v => v.trim()
                                 .replace(
                                    /^\'/, '')
                                 .replace(/\'$/, '')
                              )
                        }
                     }
                     sql.push([{
                        field,
                        value,
                        op
                     }])
                  }
               })
               sql.push(s)
            } else {
               var li = where
               // 单一查询条件直接放在第一级数组中
               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.toLowerCase().includes(seps[i])) {
                     sep = seps[i]
                     break
                  }
               }
            })
               if (sep) {
                  var values = l.split(new RegExp(sep, 'i'))
                  var field = values[0]?.trim().replace(/^\[/,
                     '').replace(/\]$/, '')
                  var value = ''
                  var op = sep.trim()
            if (sql.length > 0)
               return Base64.encode(JSON.stringify({
                  model: 1,
                  condition: sql
               }))
            else
               return ''
         },
         translate(t) {
            if (typeof this.$t == "function") return this.$t(`page.${t}`)
            else return t;
         },
         translateSys(t) {
            if (typeof this.$t == "function") return this.$t(`sys.${t}`)
            else return t;
         },
                  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 {
                     value = values[1]?.trim().replace(/^\'/,
                        '').replace(/\'$/, '')
                     if (['in', 'not in'].includes(op)) {
                        value = value.replace(/^\(/, '')
                           .replace(/\)$/, '')
                        value = value.split(',').map(v => v
                           .trim().replace(/^\'/,
                              '')
                           .replace(/\'$/,
                              ''))
                     }
                  }
                  sql.push([{
                     field,
                     value,
                     op
                  }])
               }
            }
         })
         if (sql.length > 0)
            return Base64.encode(JSON.stringify({
               model: 1,
               condition: sql
            }))
         else
            return ''
      },
      translate(t) {
         if (typeof this.$t == "function") return this.$t(`page.${t}`)
         else return t;
      },
      translateSys(t) {
         if (typeof this.$t == "function") return this.$t(`sys.${t}`)
         else return t;
      },
   },
   };
</script>
<style lang="scss">