zs
2025-05-20 1772504da433bec2f1695d47e5946c1192e876fb
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Templete/Web/Controllers/EntityModeQueryDrawerÄ£°å.txt
@@ -99,12 +99,26 @@
    const check = isEqual(initiateData.value, data)
    return check
  }
  const commonGetFormData=()=>{
    const data = {
      $Save_PageAddFormAttributes_Query$
  /**
 * èŽ·å–è¡¨å•æ•°æ® - ä¼˜åŒ–版
 */
const commonGetFormData = () => {
  const data = {};
  // éåŽ†è¡¨å•é…ç½®æ”¶é›†æ•°æ®
  formItems.forEach(item => {
    // æ”¶é›†åŸºç¡€å­—段
    data[item.prop] = formData.value[item.prop] || '';
    // æ”¶é›†è¿‡æ»¤æ¨¡å¼å­—段
    if (item.highSelectAttrs && item.highSelectAttrs.prop) {
      const filterModeProp = item.highSelectAttrs.prop;
      data[filterModeProp] = formData.value[filterModeProp] || '';
    }
    return data;
  }
  });
  return data;
}
  const onClose = (done: () => void) => {
    if (visible.value) {
      visible.value = false
@@ -122,19 +136,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 = {