schangxiang@126.com
2025-05-20 36fc063fec47f54b4cc3eedd5ddb85a5ac5c6cd8
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Templete/Web/Controllers/EntityModeQueryDrawerÄ£°å.txt
@@ -14,6 +14,15 @@
import isEqual from 'lodash/isEqual'
import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
import { cloneDeep } from 'lodash'
// å¼•入公共选项配置
import {
  FILTER_MODE_OPTIONS_STRING,
  FILTER_MODE_OPTIONS_NUM,
  FILTER_MODE_OPTIONS_BOOL
} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions';
import {
  BOOLEAN_OPTIONS
} from '@/utils/commonOptionConstants';
export const use$EntityName$QueryDrawer = (props: any, ctx?: any) => {
  const $PageMenuInstanceName$Drawer = injectModel<$EntityName$Drawer>('$EntityName$Drawer')
@@ -75,7 +84,7 @@
    },
  })
  /**
   * æ·»åŠ çš„form字段
   * é«˜çº§æŸ¥è¯¢çš„form字段
   */
  const formItems = reactive([
    $PageAddFormAttributes_Query$
@@ -110,11 +119,32 @@
    const data =commonGetFormData();
    ctx.emit('confirmQuery', data)
  }
  /**
   * é‡ç½®å…¬å…±select查询
   */
  const onResetForHighSelect = () => {
      // éåŽ†æ‰€æœ‰è¡¨å•å­—æ®µ
      formItems.forEach(item => {
        // æ£€æŸ¥å­—段是否有高级查询的过滤模式配置
        if (item.highSelectAttrs && item.highSelectAttrs.prop) {
          const filterModeProp = item.highSelectAttrs.prop;
          const options = item.highSelectAttrs.options || [];
          // å¦‚果存在选项,则设置为第一个选项的值
          if (options.length > 0) {
            // å‡è®¾é€‰é¡¹æ ¼å¼ä¸º { value, label } æˆ–类似结构
            const firstValue = options[0].value !== undefined ? options[0].value : options[0];
            formData.value[filterModeProp] = firstValue;
          }
        }
      });
  }
  /**
   * é‡ç½®æŸ¥è¯¢
   */
  const onReset = async () => {
    formData.value = {}
    onResetForHighSelect();//重置公共select查询
    $Save_PageAddFormAttributes_Query_Clear$
    //向父组件发送自定义事件
    ctx.emit('restQuery');
@@ -143,6 +173,7 @@
    $CommonQueryEnumForFrom$
  }
  commonQueryEnumForFrom()
  onResetForHighSelect();//重置公共select查询
  /**
   * å¼¹çª—打开获取详情
   */