cuiqian2004
2025-07-31 fe10cf437b17a2ea0ef63373cae2e5790ebc3930
pages/modal/3018.vue
@@ -1,5 +1,5 @@
<template>
   <view class="uni-page-modal-3018">
   <view class="uni-page-modal-3018" :class="largeMode?'large-mode':''">
      <view class="v-area" v-for="(classattr,index) in classAttrList">
         <div class="class_attr_title" style="display: none;">
            <div class="title_line"></div>
@@ -304,7 +304,7 @@
<script>
   import {
      Base64
   } from  '@/js/Base64.js';
   } from '@/js/Base64.js';
   import pickerAddress from '../../js/pickerAddress/pickerAddress.vue'
   import utils from "@/js/utils.js"
   import {
@@ -338,6 +338,7 @@
      },
      data() {
         return {
            largeMode: getApp().globalData.largeMode || false,
            title: this.translateSys('ok'),
            editMode: false,
            objAttr: {},
@@ -1001,12 +1002,9 @@
            //console.log(e.target)
            getApp().onScan((result) => {
               console.log(result);
               this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
                     'iindex']]
                  .Value =
                  result.decodedata;
               this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result;
               uni.hideKeyboard();
               this.onevent($ele, result.decodedata);
               this.onevent($ele, result);
            })
         },
         onarrow(index, open) {
@@ -1136,14 +1134,14 @@
         },
         onevent(e, decodedata) {
         onevent(e, value) {
            // console.log(e.target);
            var data_attr = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset[
               'iindex']];
            // console.log(decodedata);
            // console.log(value);
            if (e.detail.value != data_attr.Value) {
               this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value =
                  decodedata ? decodedata : e.detail.value;
                  value ? value : e.detail.value;
               var eventid = this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].action;
               if (eventid) {
                  // self.event_no_sub = 1;
@@ -1847,29 +1845,15 @@
                     .info
                     .join(
                        '<br/>') : '';
                  tip = tip || result.err_info
                  if (tip) uni.showModal({
                     title: this.translateSys('tip'),
                     content: tip,
                     showCancel: false,
                     confirmText: this.translateSys('close')
                  });
                  var actionlist = data.action;
                  if (actionlist) {
                     console.log(actionlist);
                     for (var i = 0; i < actionlist.length; i++) {
                        var action = actionlist[i];
                        if (action.action_type == 'set_dlg_attr') {
                           var result = action.value;
                           this.setFormValues(action.value)
                        } else if (data.action[i].action_type == 'set_global_attr') {
                           $this.global_attr = data.action[i].value || [];
                        }
                     }
                  }
                  if (data.result_type == 2 && data.result) {
                     var result = data.result;
                  if (data.result_type == 2) {
                     var result = data.result || []
                     for (var i = 0; i < result.length; i++) {
                        for (var c = 0; c < $this.classAttrList.length; c++) {
                           var attr = $this.classAttrList[c].Attr;
@@ -1897,7 +1881,45 @@
                           }
                        }
                     }
                  } else if (typeof data.result == 'string') {
                     if (data.result) {
                     uni.showModal({
                        title: this.translateSys('tip'),
                        content: data.result,
                        showCancel: false,
                        confirmText: this.translateSys('close')
                     });
                     }
                  }
                  try {
                     var actionlist = data.action || [];
                     if (actionlist) {
                        console.log(actionlist);
                        for (var i = 0; i < actionlist.length; i++) {
                           var action = actionlist[i];
                           if (action.action_type == 'set_dlg_attr') {
                              var result = action.value;
                              this.setFormValues(action.value)
                           } else if (data.action[i].action_type == 'set_global_attr') {
                              $this.global_attr = data.action[i].value || [];
                           }
                        }
                     }
                  } catch (ex) {
                     let actionList = (data.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)
                     return
                  }
               }
            }).catch(ex => {
@@ -2814,4 +2836,18 @@
         transform: translateX(0);
      }
   }
   .uni-page-modal-3018.large-mode {
      font-size: 24px;
      .tx_title,
      .tx_title2 {
         font-size: 24px;
      }
      .class_attr_title {
         font-size: 24px;
      }
   }
</style>