<template>
  <div class="page-box" style="position: relative;">
    <el-form
      ref="formTourHouseRentInfoRef"
      :model="formData"
      :size="layoutStore.defaultFormItemSize"
      label-width="120px"
      label-position="right"
      @submit.prevent
    >
      <filter-box :item-width="350" @search="refreshFormTourHouseRentInfo()" @reset="resetFormTourHouseRentInfo">
        <el-form-item label="所属地区类型">
          <el-cascader
            class="filter-item"
            v-model="areaIdFilterPath"
            :options="areaIdFilterWidgetDropdownList"
            placeholder=""
            :clearable="true"
            :filterable="true"
            :show-all-levels="false"
            :props="{ value: 'id', label: 'name', children: 'children', checkStrictly: true }"
            @change="onAreaIdFilterValueChange"
          />
        </el-form-item>
        <el-form-item label="租赁方式">
          <el-select
            class="filter-item"
            v-model="formFilter.rentTypeFilter"
            placeholder=""
            :clearable="true"
            :filterable="true"
            @visible-change="rentTypeFilterWidget.onVisibleChange"
          >
            <el-option
              v-for="item in rentTypeFilterWidgetDropdownList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="厅室类型">
          <el-select
            class="filter-item"
            v-model="formFilter.officeTypeFilter"
            placeholder=""
            :clearable="true"
            :filterable="true"
            @visible-change="officeTypeFilterWidget.onVisibleChange"
          >
            <el-option
              v-for="item in officeTypeFilterWidgetDropdownList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="面积范围">
          <input-number-range
            class="filter-item"
            v-model="formFilter.areaFilter"
            startPlaceholder=""
            endPlaceholder=""
            :step="1"
          />
        </el-form-item>
        <el-form-item label="房屋类型">
          <el-select
            class="filter-item"
            v-model="formFilter.houseTypeFilter"
            placeholder=""
            :clearable="true"
            :filterable="true"
            @visible-change="houseTypeFilterWidget.onVisibleChange"
          >
            <el-option
              v-for="item in houseTypeFilterWidgetDropdownList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="朝向类型">
          <el-select
            class="filter-item"
            v-model="formFilter.orientationFilter"
            placeholder=""
            :clearable="true"
            :filterable="true"
            @visible-change="orientationFilterWidget.onVisibleChange"
          >
            <el-option
              v-for="item in orientationFilterWidgetDropdownList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="装修类型">
          <el-select
            class="filter-item"
            v-model="formFilter.decorationFilter"
            placeholder=""
            :clearable="true"
            :filterable="true"
            @visible-change="decorationFilterWidget.onVisibleChange"
          >
            <el-option
              v-for="item in decorationFilterWidgetDropdownList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <!-- <el-form-item label="租房状态">
          <el-select
            class="filter-item"
            v-model="formFilter.rentStateFilter"
            placeholder=""
            :clearable="true"
            :filterable="true"
            @visible-change="rentStateFilterWidget.onVisibleChange"
          >
            <el-option
              v-for="item in rentStateFilterWidgetDropdownList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item> -->
        <el-form-item label="租金范围">
          <input-number-range
            class="filter-item"
            v-model="formFilter.rentPriceFilter"
            startPlaceholder=""
            endPlaceholder=""
            :step="1"
          />
        </el-form-item>
        <el-form-item label="是否热推房源">
          <el-select
            class="filter-item"
            v-model="formFilter.isHotPushFilter"
            placeholder=""
            :clearable="true"
            :filterable="true"
            @visible-change="isHotPushFilterWidget.onVisibleChange"
          >
            <el-option
              v-for="item in isHotPushFilterWidgetDropdownList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
      </filter-box>
    </el-form>
    <table-box
      ref="tourHouseRentInfo"
      class="page-table"
      :data="tourHouseRentInfoWidgetDataList"
      :size="layoutStore.defaultFormItemSize"
      :row-config="{isCurrent: false, isHover: true}"
      :seq-config="{startIndex: ((tourHouseRentInfoWidgetCurrentPage - 1) * tourHouseRentInfoWidgetPageSize)}"
      :sort-config="{remote: true}"
      :hasExtend="true"
      @sort-change="tourHouseRentInfoWidget.onSortChange"
      @refresh="tourHouseRentInfoWidget.refreshTable()"
    >
      <template #operator>
        <el-button
          type="primary"
          :size="layoutStore.defaultFormItemSize"
          :disabled="!checkPermCodeExist('formTourHouseRentInfo:formTourHouseRentInfo:add')"
          @click="onAddClick()"
          >
          新增
        </el-button>
      </template>
      <vxe-column title="序号" type="seq" :index="tourHouseRentInfoWidget.getTableIndex" :width="80" />
      <vxe-column title="房屋标题" field="houseTitle" />
      <!-- <vxe-column title="租房状态" field="rentStateDictMap.name" /> -->
      <vxe-column title="所属地区类型" field="areaIdDictMap.name" />
      <vxe-column title="楼盘名称/所属小区" field="communityName" />
      <vxe-column title="所在楼层" field="currentFloor" />
      <vxe-column title="厅室类型" field="officeTypeDictMap.name" />
      <vxe-column title="租赁方式" field="rentTypeDictMap.name" />
      <vxe-column title="租金" field="rentPrice" />
      <vxe-column title="货币单位" field="currency" />
      <vxe-column title="面积" field="area" />
      <vxe-column title="首页封面图" min-width="100px">
        <template v-slot="scope">
          <el-image v-for="item in parseUploadData(scope.row.coverUrl, { id: scope.row.id, fieldName: 'coverUrl', asImage: true })"
            :preview-src-list="getPictureList(scope.row.coverUrl, { id: scope.row.id, fieldName: 'coverUrl', asImage: true })"
            class="table-cell-image" :key="item.url" :src="item.url" fit="fill">
            <template #error>
              <div class="table-cell-image">
                <i class="el-icon-picture-outline"></i>
              </div>
            </template>
          </el-image>
        </template>
      </vxe-column>
      <vxe-column title="是否热推房源" field="isHotPushDictMap.name" />
      <vxe-column title="操作" fixed="right">
        <template v-slot="scope">
          <el-button
            link
            type="primary"
            :size="layoutStore.defaultFormItemSize"
            @click.stop="onEditClick(scope.row)"
            :disabled="!checkPermCodeExist('formTourHouseRentInfo:formTourHouseRentInfo:edit')"
          >
            编辑
          </el-button>
          <el-button
            link
            type="primary"
            :size="layoutStore.defaultFormItemSize"
            @click.stop="onDeleteClick(scope.row)"
            :disabled="!checkPermCodeExist('formTourHouseRentInfo:formTourHouseRentInfo:delete')"
          >
            删除
          </el-button>
        </template>
      </vxe-column>
      <template slot="empty">
        <div class="table-empty unified-font">
          <img src="@/assets/img/empty.png">
          <span>暂无数据</span>
        </div>
      </template>
      <!-- 分页 -->
      <template #pagination>
        <el-row type="flex" justify="end" style="margin-top: 10px;">
          <el-pagination
            :total="tourHouseRentInfoWidgetTotalCount"
            :current-page="tourHouseRentInfoWidgetCurrentPage"
            :page-size="tourHouseRentInfoWidgetPageSize"
            :page-sizes="[10, 20, 50, 100]"
            layout="total, prev, pager, next, sizes"
            @current-change="tourHouseRentInfoWidget.onCurrentPageChange"
            @size-change="tourHouseRentInfoWidget.onPageSizeChange">
          </el-pagination>
        </el-row>
      </template>
    </table-box>
    <label v-if="subPage" class="page-close-box" @click="onCancel()">
      <img src="@/assets/img/back2.png" alt="">
    </label>
  </div>
</template>

<script lang="ts">
export default {
  name: 'formTourHouseRentInfo',
};
</script>

<script setup lang="ts">
import { VxeColumn, VxeTable } from 'vxe-table';
import { ANY_OBJECT } from '@/types/generic';
import { DictData, DictionaryBase } from '@/common/staticDict/types';
import { ElMessage, ElMessageBox, UploadFile } from 'element-plus';
import { useRoute, useRouter } from 'vue-router';
import { useCommon } from '@/common/hooks/useCommon';
import { useLayoutStore, useStaticDictStore } from '@/store';
import { useDownload } from '@/common/hooks/useDownload';
import { useDropdown } from '@/common/hooks/useDropdown';
import { DropdownOptions, ListData } from '@/common/types/list';
import { useTable } from '@/common/hooks/useTable';
import { TableOptions } from '@/common/types/pagination';
import { useUpload } from '@/common/hooks/useUpload';
import { useUploadWidget } from '@/common/hooks/useUploadWidget';
import { DictionaryController } from '@/api/system';
import { treeDataTranslate, findItemFromList, findTreeNodePath, findTreeNode, stringCase } from '@/common/utils';
import { TourHouseRentInfoData } from '@/api/generated/tourHouseRentInfoController';
import { TourHouseEquipmentData } from '@/api/generated/tourHouseEquipmentController';
import { TourHouseAdvisorInfoData } from '@/api/generated/tourHouseAdvisorInfoController';
import { TourHouseRentInfoController, TourHouseEquipmentController, TourHouseAdvisorInfoController } from '@/api/generated';
import FormEditTourHouseRentInfo from '@/pages/tourHouseRentInfo/formEditTourHouseRentInfo.vue';

const router = useRouter();
const route = useRoute();
const layoutStore = useLayoutStore();
const { downloadFile } = useDownload();
const { getUploadHeaders, getUploadActionUrl, fileListToJson, parseUploadData, getPictureList } = useUpload();
const {
  Delete,
  Search,
  Edit,
  Plus,
  Refresh,
  Picture,
  Dialog,
  mainContextHeight,
  clientHeight,
  checkPermCodeExist,
  parseParams,
  parseArrayParams,
  formatDateByStatsType,
  getDateRangeFilter,
} = useCommon();
// 静态字典
const { staticDict: StaticDict } = useStaticDictStore();

const props = withDefaults(
  defineProps<{
    subPage?: number | string | boolean;
  }>(),
  {
    subPage: 0,
  },
);

const formFilter = reactive({
  // 所属地区类型
  areaIdFilter: undefined,
  // 租赁方式
  rentTypeFilter: undefined,
  // 厅室类型
  officeTypeFilter: undefined,
  // 面积范围
  areaFilter: [],
  // 房屋类型
  houseTypeFilter: undefined,
  // 朝向类型
  orientationFilter: undefined,
  // 装修类型
  decorationFilter: undefined,
  // 租房状态
  rentStateFilter: undefined,
  // 租金范围
  rentPriceFilter: [],
  // 是否热推房源
  isHotPushFilter: undefined,
});
const formFilterCopy = reactive({
  // 所属地区类型
  areaIdFilter: undefined,
  // 租赁方式
  rentTypeFilter: undefined,
  // 厅室类型
  officeTypeFilter: undefined,
  // 面积范围
  areaFilter: [],
  // 房屋类型
  houseTypeFilter: undefined,
  // 朝向类型
  orientationFilter: undefined,
  // 装修类型
  decorationFilter: undefined,
  // 租房状态
  rentStateFilter: undefined,
  // 租金范围
  rentPriceFilter: [],
  // 是否热推房源
  isHotPushFilter: undefined,
});

const onCancel = () => {
  layoutStore.removeCachePage(route.name as string);
  route.meta.refreshParentCachedPage = true;
  router.go(-1);
};

const onResume = () => {
  refreshFormTourHouseRentInfo();
};

/**
 * 表格组件数据获取函数，返回Promise
 */
const loadTourHouseRentInfoWidgetData = (params: ANY_OBJECT) => {
  if (params == null) params = {};
  params = {
    ...params,
    tourHouseRentInfoDtoFilter: {
      areaId: formFilter.areaIdFilter,
      rentType: formFilter.rentTypeFilter,
      officeType: formFilter.officeTypeFilter,
      rentPriceStart: Array.isArray(formFilter.rentPriceFilter) ? formFilter.rentPriceFilter[0] : formFilter.rentPriceFilter,
      rentPriceEnd: Array.isArray(formFilter.rentPriceFilter) ? formFilter.rentPriceFilter[1] : formFilter.rentPriceFilter,
      areaStart: Array.isArray(formFilter.areaFilter) ? formFilter.areaFilter[0] : formFilter.areaFilter,
      areaEnd: Array.isArray(formFilter.areaFilter) ? formFilter.areaFilter[1] : formFilter.areaFilter,
      houseType: formFilter.houseTypeFilter,
      orientation: formFilter.orientationFilter,
      decoration: formFilter.decorationFilter,
      rentState: formFilter.rentStateFilter,
      isHotPush: formFilter.isHotPushFilter,
    }
  };
  return new Promise((resolve, reject) => {
    TourHouseRentInfoController.list(params).then(res => {
      resolve({
        dataList: res.data.dataList,
        totalCount: res.data.totalCount
      });
    }).catch(e => {
      reject(e);
    });
  });
};
/**
 * 表格组件数据获取检测函数，返回true正常获取数据，返回false停止获取数据
 */
const loadTourHouseRentInfoVerify = () => {
  formFilterCopy.areaIdFilter = formFilter.areaIdFilter;
  formFilterCopy.rentTypeFilter = formFilter.rentTypeFilter;
  formFilterCopy.officeTypeFilter = formFilter.officeTypeFilter;
  formFilterCopy.areaFilter = formFilter.areaFilter;
  formFilterCopy.houseTypeFilter = formFilter.houseTypeFilter;
  formFilterCopy.orientationFilter = formFilter.orientationFilter;
  formFilterCopy.decorationFilter = formFilter.decorationFilter;
  formFilterCopy.rentStateFilter = formFilter.rentStateFilter;
  formFilterCopy.rentPriceFilter = formFilter.rentPriceFilter;
  formFilterCopy.isHotPushFilter = formFilter.isHotPushFilter;
  return true;
};
/**
 * 新增
 */
const onAddClick = (row?: TourHouseRentInfoData) => {
  let params: ANY_OBJECT = {
  };

  Dialog
    .show('新增', FormEditTourHouseRentInfo, { area: ['900px', '700px'] }, { ...params, subPage: true })
    .then(res => {
      tourHouseRentInfoWidget.refreshTable();
    }).catch(e => {
      // TODO: 异常处理
      console.error(e);
    });
};
/**
 * 编辑
 */
const onEditClick = (row?: TourHouseRentInfoData) => {
  let params: ANY_OBJECT = {
    id: row?.id,
  };

  Dialog
    .show('编辑', FormEditTourHouseRentInfo, { area: ['900px', '700px'] }, { ...params, subPage: true })
    .then(res => {
      tourHouseRentInfoWidget.refreshTable();
    }).catch(e => {
      // TODO: 异常处理
      console.error(e);
    });
};
/**
 * 删除
 */
const onDeleteClick = (row?: TourHouseRentInfoData) => {
  let params: ANY_OBJECT = {
    id: row?.id,
  };

  TourHouseRentInfoController.delete(params).then(res => {
    ElMessage.success('删除成功');
    tourHouseRentInfoWidget.refreshTable(false, 1);
  }).catch(e => {
    // TODO: 异常处理
    console.error(e);
  });
};
// 表格组件表格组件参数
const tourHouseRentInfoOptions: TableOptions<TourHouseRentInfoData> = {
  loadTableData: loadTourHouseRentInfoWidgetData,
  verifyTableParameter: loadTourHouseRentInfoVerify,
  paged: true,
  rowSelection: false,
  orderFieldName: undefined,
  ascending: true,
};
// 表格组件表格组件
const tourHouseRentInfo = ref();
const tourHouseRentInfoWidget = useTable(tourHouseRentInfoOptions);
const {
  dataList: tourHouseRentInfoWidgetDataList,
  currentPage: tourHouseRentInfoWidgetCurrentPage,
  pageSize: tourHouseRentInfoWidgetPageSize,
  totalCount: tourHouseRentInfoWidgetTotalCount,
} = tourHouseRentInfoWidget;
/**
 * 所属地区类型下拉数据获取函数
 */
const loadAreaIdFilterDropdownList = (): Promise<ListData<DictData>> => {
  return new Promise((resolve, reject) => {
    const params = {
    };
    DictionaryController.dictTourHouseAreaMenu(params).then(res => {
      resolve({
        dataList: res.getList(),
      });
    }).catch(e => {
      reject(e);
    });
  });
};
/**
 * 所属地区类型选中值改变
 */
const onAreaIdFilterValueChange = (value) => {
  formFilter.areaIdFilter = Array.isArray(value) ? value[value.length - 1] : value;
};
// 所属地区类型配置参数
const areaIdFilterOptions: DropdownOptions<DictData> = {
  loadData: loadAreaIdFilterDropdownList,
  isTree: true,
};
// 所属地区类型选中数据
const areaIdFilterPath = ref<Array<string | number>>([]);
// 所属地区类型下拉组件
const areaIdFilterWidget = useDropdown(areaIdFilterOptions);
const { dropdownList: areaIdFilterWidgetDropdownList } = areaIdFilterWidget
/**
 * 租赁方式下拉数据获取函数
 */
const loadRentTypeFilterDropdownList = (): Promise<ListData<DictData>> => {
  return new Promise((resolve, reject) => {
    DictionaryController.dictGlobalDict({ dictCode: 'HouseRentType', itemIdType: 'Integer' }).then(res => {
      resolve({
        dataList: res.getList(),
      });
    }).catch(e => {
      reject(e);
    });
  });
};
// 租赁方式配置参数
const rentTypeFilterOptions: DropdownOptions<DictData> = {
  loadData: loadRentTypeFilterDropdownList,
  isTree: false,
};
// 租赁方式下拉组件
const rentTypeFilterWidget = useDropdown(rentTypeFilterOptions);
const { dropdownList: rentTypeFilterWidgetDropdownList } = rentTypeFilterWidget
/**
 * 厅室类型下拉数据获取函数
 */
const loadOfficeTypeFilterDropdownList = (): Promise<ListData<DictData>> => {
  return new Promise((resolve, reject) => {
    DictionaryController.dictGlobalDict({ dictCode: 'OfficeType', itemIdType: 'Integer' }).then(res => {
      resolve({
        dataList: res.getList(),
      });
    }).catch(e => {
      reject(e);
    });
  });
};
// 厅室类型配置参数
const officeTypeFilterOptions: DropdownOptions<DictData> = {
  loadData: loadOfficeTypeFilterDropdownList,
  isTree: false,
};
// 厅室类型下拉组件
const officeTypeFilterWidget = useDropdown(officeTypeFilterOptions);
const { dropdownList: officeTypeFilterWidgetDropdownList } = officeTypeFilterWidget
/**
 * 房屋类型下拉数据获取函数
 */
const loadHouseTypeFilterDropdownList = (): Promise<ListData<DictData>> => {
  return new Promise((resolve, reject) => {
    DictionaryController.dictGlobalDict({ dictCode: 'HouseType', itemIdType: 'Integer' }).then(res => {
      resolve({
        dataList: res.getList(),
      });
    }).catch(e => {
      reject(e);
    });
  });
};
// 房屋类型配置参数
const houseTypeFilterOptions: DropdownOptions<DictData> = {
  loadData: loadHouseTypeFilterDropdownList,
  isTree: false,
};
// 房屋类型下拉组件
const houseTypeFilterWidget = useDropdown(houseTypeFilterOptions);
const { dropdownList: houseTypeFilterWidgetDropdownList } = houseTypeFilterWidget
/**
 * 朝向类型下拉数据获取函数
 */
const loadOrientationFilterDropdownList = (): Promise<ListData<DictData>> => {
  return new Promise((resolve, reject) => {
    DictionaryController.dictGlobalDict({ dictCode: 'Orientation', itemIdType: 'Integer' }).then(res => {
      resolve({
        dataList: res.getList(),
      });
    }).catch(e => {
      reject(e);
    });
  });
};
// 朝向类型配置参数
const orientationFilterOptions: DropdownOptions<DictData> = {
  loadData: loadOrientationFilterDropdownList,
  isTree: false,
};
// 朝向类型下拉组件
const orientationFilterWidget = useDropdown(orientationFilterOptions);
const { dropdownList: orientationFilterWidgetDropdownList } = orientationFilterWidget
/**
 * 装修类型下拉数据获取函数
 */
const loadDecorationFilterDropdownList = (): Promise<ListData<DictData>> => {
  return new Promise((resolve, reject) => {
    DictionaryController.dictGlobalDict({ dictCode: 'Decoration', itemIdType: 'Integer' }).then(res => {
      resolve({
        dataList: res.getList(),
      });
    }).catch(e => {
      reject(e);
    });
  });
};
// 装修类型配置参数
const decorationFilterOptions: DropdownOptions<DictData> = {
  loadData: loadDecorationFilterDropdownList,
  isTree: false,
};
// 装修类型下拉组件
const decorationFilterWidget = useDropdown(decorationFilterOptions);
const { dropdownList: decorationFilterWidgetDropdownList } = decorationFilterWidget
/**
 * 租房状态下拉数据获取函数
 */
const loadRentStateFilterDropdownList = (): Promise<ListData<DictData>> => {
  return Promise.resolve({
    dataList: StaticDict.RentState.getList(),
  });
};
// 租房状态配置参数
const rentStateFilterOptions: DropdownOptions<DictData> = {
  loadData: loadRentStateFilterDropdownList,
  isTree: false,
};
// 租房状态下拉组件
const rentStateFilterWidget = useDropdown(rentStateFilterOptions);
const { dropdownList: rentStateFilterWidgetDropdownList } = rentStateFilterWidget
/**
 * 是否热推房源下拉数据获取函数
 */
const loadIsHotPushFilterDropdownList = (): Promise<ListData<DictData>> => {
  return Promise.resolve({
    dataList: StaticDict.IsTrue.getList(),
  });
};
// 是否热推房源配置参数
const isHotPushFilterOptions: DropdownOptions<DictData> = {
  loadData: loadIsHotPushFilterDropdownList,
  isTree: false,
};
// 是否热推房源下拉组件
const isHotPushFilterWidget = useDropdown(isHotPushFilterOptions);
const { dropdownList: isHotPushFilterWidgetDropdownList } = isHotPushFilterWidget
const refreshFormTourHouseRentInfo = () => {
  // 刷新段落
  tourHouseRentInfoWidget.refreshTable();
};
/**
 * 重置过滤值
 */
const resetFormTourHouseRentInfo = () => {
  formFilter.areaIdFilter = undefined;
  formFilterCopy.areaIdFilter = undefined;
  areaIdFilterPath.value = [];
  formFilter.rentTypeFilter = undefined;
  formFilterCopy.rentTypeFilter = undefined;
  formFilter.officeTypeFilter = undefined;
  formFilterCopy.officeTypeFilter = undefined;
  formFilter.areaFilter = undefined;
  formFilterCopy.areaFilter = undefined;
  formFilter.houseTypeFilter = undefined;
  formFilterCopy.houseTypeFilter = undefined;
  formFilter.orientationFilter = undefined;
  formFilterCopy.orientationFilter = undefined;
  formFilter.decorationFilter = undefined;
  formFilterCopy.decorationFilter = undefined;
  formFilter.rentStateFilter = undefined;
  formFilterCopy.rentStateFilter = undefined;
  formFilter.rentPriceFilter = undefined;
  formFilterCopy.rentPriceFilter = undefined;
  formFilter.isHotPushFilter = undefined;
  formFilterCopy.isHotPushFilter = undefined;
  refreshFormTourHouseRentInfo();
};
/**
 * 重置所有过滤值
 */
const resetFilter = () => {
  resetFormTourHouseRentInfo();
};
const formInit = () => {
  areaIdFilterWidget.onVisibleChange(true).then(res => {
    // TODO: 获取级联选中路径
    areaIdFilterPath.value = findTreeNodePath(res, formFilter.areaIdFilter);
  }).catch(e => {
    // TODO: 异常处理
    console.error(e);
  });
  rentTypeFilterWidget.onVisibleChange(true).catch(e => {console.error(e)});
  officeTypeFilterWidget.onVisibleChange(true).catch(e => {console.error(e)});
  houseTypeFilterWidget.onVisibleChange(true).catch(e => {console.error(e)});
  orientationFilterWidget.onVisibleChange(true).catch(e => {console.error(e)});
  decorationFilterWidget.onVisibleChange(true).catch(e => {console.error(e)});
  rentStateFilterWidget.onVisibleChange(true).catch(e => {console.error(e)});
  isHotPushFilterWidget.onVisibleChange(true).catch(e => {console.error(e)});
  refreshFormTourHouseRentInfo();
};

onMounted(() => {
  formInit();
});
</script>
