schangxiang@126.com
2025-05-20 bb46e7c37ddbdf44e4a7b729b608b39a3561f1e4
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Templete/Web/Controllers/EntityModeQueryDrawerÄ£°å.txt
@@ -122,19 +122,42 @@
  /** 
   * é‡ç½®å…¬å…±select查询 
   */ 
  const onResetForHighSelect = async () => {
    $Save_PageAddFormAttributes_Query_Clear_HighSelect$
  }
  /**
   * é‡ç½®æŸ¥è¯¢
   */
  const onReset = async () => {
    formData.value = {}
    onResetForHighSelect();//重置公共select查询
    $Save_PageAddFormAttributes_Query_Clear$
    //向父组件发送自定义事件
    ctx.emit('restQuery');
  }
  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 () => {
        // 1. æ¸…空所有基础字段(不包含过滤模式字段)
        const baseFields = formItems.reduce((acc, item) => {
        acc[item.prop] = '';
        return acc;
        }, {});
        // 2. åº”用基础字段初始值
        formData.value = { ...baseFields };
        // 3. ä½¿ç”¨åŽŸæœ‰æ–¹æ³•é‡ç½®è¿‡æ»¤æ¨¡å¼å­—æ®µ
        onResetForHighSelect(); // ä¿ç•™åŽŸæœ‰æ–¹æ³•è°ƒç”¨
        // 4. å‘父组件发送自定义事件
        ctx.emit('restQuery');
    }
  const updateCheckData = () => {
    initiateData.value = {