WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2024-05-08 eadcece83dde52c4a7dbaf58cf1e8157b2e5969d
forms/select/CSelect.vue
@@ -43,8 +43,8 @@
        </view>
        <!-- 跳转页面模式 -->
        <view
            v-else-if="selectByPage.length > 5"
            @tap="evt => onGoToSelectorPage()"
            v-else-if="selectByPage.length > 5 || selectByPage === 'on'"
            @tap="evt => onGoSelectorPage()"
        >
            <AtInput
                :name="itemRes.name"
@@ -53,7 +53,7 @@
                :disabled="itemRes.disabled"
                :error="itemRes.error"
                :placeholder="placeholder"
                :value="choose.name"
                :value="choose.name || selected"
            >
                <view
                    v-show="!readOnly"
@@ -82,15 +82,18 @@
        options: Array,
        // 占位提示
        placeholder: String,
        // 开启选择菜单跳转选择页面模式,并指定功能页面
        selectByPage: String,
        // 页面模式下,选择完成后的回调
        onSelectFromPage: Function,
        // 只读模式
        readOnly: {
            type: Boolean,
            default: false,
        },
        // 开启选择菜单跳转选择页面模式,并指定功能页面,url or 'on'
        //   url 模式已经废弃,即将删除代码,请勿再使用
        selectByPage: String,
        // 页面跳转URL模式下,选择完成后的回调
        onSelectFromPage: Function,
        // 页面跳转on模式下,发起选择的回调
        onOpenSelectorPage: Function,
    },
    data() {
        return {
@@ -132,7 +135,13 @@
                this.itemRes.onChange(item[this.optionKey]);
            }
        },
        onGoToSelectorPage() {
        onGoSelectorPage() {
            if (this.selectByPage === 'on') {
                this.onOpenSelectorPage && this.onOpenSelectorPage();
                return;
            }
            // 页面跳转URL模式,已废弃,即将删除代码
            console.warn('CSelect:警告,url跳转已废弃,即将删除代码,请勿使用!');
            let url = this.selectByPage;
            if (this.selectByPage.indexOf('?') > 0) {
                url += '&mode=CSelect';