riku
2024-08-14 f2a0ea849099f49a3d2a9c7e5c44d033df22468f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
 * 街镇类型下拉选择
 */
import { choseTownList, toLabel } from '../../../common/dataTowns';
import { getDistrictTypes } from '../../../common/dataDistricts';
import { behaviorOptions } from '../basePicker';
 
function getDefaultDistrict() {
  return getDistrictTypes()[0];
}
 
const options = behaviorOptions(
  'town',
  choseTownList(getDefaultDistrict().value),
  toLabel,
);
options.properties.districtCode = {
  type: String,
  observer(value) {
    this.setSelectOptions('town', choseTownList(value));
    this.onInitialValue('town');
  },
};
const useTownPicker = Behavior(options);
 
export { useTownPicker };