import {designComponent, PropType} from "@peryl/react-compose"; import {iAddressService} from "../../$address/createAddressService"; import {nextPlcBindId} from "../plc/utils/plc.utils"; import {PlcAddressItem} from "./PlcAddressItem"; import {AddressCascade} from "../../AddressCascade"; import i18n from "../../i18n"; export const PlcAddress = designComponent({ name: 'plc-address', props: { types: { type: String, default: 'pcd' }, service: { type: Object as PropType }, provinceTitle: { type: String }, provinceField: { type: String, default: 'province' }, cityTitle: { type: String }, cityField: { type: String, default: 'city' }, districtTitle: { type: String }, districtField: { type: String, default: 'district' }, }, setup({ props }) { const plcBindIds = { province: nextPlcBindId(), city: nextPlcBindId(), }; return () => { const renderList: any[] = []; if (props.types.indexOf('p') > -1) { renderList.push( ( ) }} /> ); } if (props.types.indexOf('c') > -1) { renderList.push( ); } if (props.types.indexOf('d') > -1) { renderList.push( ); } return renderList; }; }, });