0.13.4 • Published 9 months ago

@wbiokr/vue2 v0.13.4

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

1. 组件列表

1.1 WMarker

基于阿里iconfont的Icon组件

PropertyType默认值Description
colorString#333Icon填充色
widthNumber16Icon宽度
heightNumber16Icon高度
loadingBooleanfalse是否加载中
isUseBooleanfalse是否使用symbol标记
isBtnBooleanfalse是否为按钮
disabledBooleanfalse是否不可点击
typeString预制的icon(loading、close、layer、copy)
dStringArray来自iconfont的d属性(当d和type同时存在,则d的优先级更高)
<template>
    <div>
        <WMarker type='close' />
        <WMarker d='M853.32992 102.4H170.67008C133.13024 102.4 102.4 133.13024 102.4 170.67008v682.65984C102.4 890.86976 133.13024 921.6 170.67008 921.6h682.65984C890.86976 921.6 921.6 890.86976 921.6 853.32992V170.67008C921.6 133.13024 890.86976 102.4 853.32992 102.4zM819.2 546.12992H546.12992V819.2h-68.25984V546.12992H204.8v-68.25984h273.07008V204.8h68.25984v273.07008H819.2v68.25984z' />
    </div>
</template>

1.2 WWhite

文本省略组件

PropertyType默认值Description
placementStringtoptooltip的位置
textString文本主体
maxWidthString100%最大宽度
whiteNumber1省略的行数
directionStringcenterflex布局的justify-content属性,start end center around between
<template>
    <div style='width: 50px'>
        <WWhite text='我是省略号我是省略号我是省略号我是省略号我是省略号' />
    </div>
</template>

1.3 WCopy

复制组件

PropertyType默认值Description
copyTitleString复制按钮的title
copyMsgString复制成功复制成功后的提示语,为空的时候则不提示
colorString#189fff按钮颜色
sizeNumber16按钮尺寸
contentString要复制的内容
disabledBooleanfalse是否置灰
<template>
    <div style='width: 50px'>
        <WCopy content='复制我吧复制我吧复制我吧' />
    </div>
</template>

1.4 WFullScreen

全屏组件

PropertyType默认值Description
typeStringprimary按钮的类型(ant)
sizeString'small'按钮尺寸
closeTxtString退出全屏关闭提示语
openTxtString打开全屏开启提示语
placementStringtop提示语位置
<template>
    <div style='width: 50px'>
        <WFullScreen />
    </div>
</template>

1.5 WToast

toast提示语组件

PropertyType默认值Description
contentString提示语
leftNumber0业务计算位置-left
topNumber0业务计算位置-top
autoEventBooleantrue是否开启组件内部自动计算位置,当开启的时候left、top无效
<template>
    <div style='width: 50px'>
        <WToast content='跟随鼠标拖拽' />
    </div>
</template>

1.6 WRangePicker

时间(开始、结束)选择组件

PropertyType默认值Description是否必填
value/v-modelObject{}包含开始、结束属性的参数对象true
fieldInfoObject{}Field相关信息true
<template>
    <div style='width: 150px'>
        <WRangePicker v-model='params' :fieldInfo='fieldInfo' />
    </div>
</template>
<script>
    export default {
        data() {
            return {
                params: {
                    sDate: '',
                    eDate: '',
                },
                fieldInfo: {
                    key: 'sDate,eDate',
                    extraAttrs: {
                        class: 'w-200',
                        showTime: true,
                        format: 'YYYY-MM-DD HH:mm:ss',
                        placeholder: ['开始时间', '结束时间'],
                    },
                },
            }
        },
    }
</script>

1.7 WDatePicker

时间(开始、结束)选择组件

PropertyType默认值Description是否必填
value/v-modelString''字符串时间true
fieldInfoObject{}Field相关信息true
<template>
    <div style='width: 150px'>
        <WDatePicker v-model='params.date' :fieldInfo='fieldInfo' />
    </div>
</template>
<script>
    export default {
        data() {
            return {
                params: {
                    date: '',
                },
                fieldInfo: {
                    key: 'date',
                    extraAttrs: {
                        class: 'w-200',
                        format: 'YYYY-MM-DD',
                    },
                },
            }
        },
    }
</script>

1.8 WArea

区域选择组件(省、市、区)

PropertyType默认值Description是否必填
value/v-modelObject{}包含省市区的参数对象true
fieldInfoObject{}Field相关信息true
httpOptionsObject{}Http相关信息当需要动态请求省市区选项的时候必传
provinceOptionsObjectAreaSelect省份配置信息false
cityOptionsObjectAreaSelect城市配置信息false
countyOptionsObjectAreaSelect区县配置信息false
<template>
    <a-form layout="inline">
        <WArea v-model="params" :httpOptions="httpOptions" :fieldInfo="fieldInfo" />
    </a-form>
</template>
<script>
    export default {
        data() {
            return {
                httpOptions: {
                    baseURL: 'http://localhost:8855',
                    error: message.error,
                    dataKey: 'result',
                    beforeRequest(config) {
                        config.headers['Token'] = '12fsfsafafsfafsfsfsa'
                    },
                },
                params: {
                    cityCode: '140300',
                    countyCode: '140311',
                    provinceCode: '140000',
                },
                fieldInfo: {
                    type: 'county',
                    extraAttrs: {
                        mode: 'multiple',
                        class: 'w-400',
                    },
                    actions: [
                        {
                             url: '/conf/city/provinceList',
                        },
                        {
                            url: '/conf/city/cityList',
                            params(o) {
                                return { id: o.id }
                            },
                        },
                        {
                            url: '/conf/city/district',
                            params(o) {
                                return { id: o.id }
                            },
                        },
                    ],
                },
            }
        },
    }
</script>

1.9 WFields

搜索条件组件

PropertyType默认值Description是否必填
fields<Field>[][]true
httpOptionsObject{}Http相关信息当需要动态请求省市区选项的时候必传
buttonOptionsObjectButtonOptions按钮配置信息false
commonParamsObject{}公共参数false
columns<Column>[][]当需要列设置的时候false
isSearchingBooleanfalse是否搜索中false
emit('search')Eventnull搜索事件false
emit('fields')Eventnull整理fields事件false
slot('beforeField')SlotnullbeforeField插槽,位于整个组件开始位置---slot-scoped='{params}'false
slot('afterField')SlotnullafterField插槽,位于整个组件结束位置---slot-scoped='{params}'false
slot('button')Slotnullbutton插槽,位于导出按钮后面---slot-scoped='{params}'false
<template>
    <Fields
        :fields="fields"
        :commonParams="{app: 'haha'}"
        :httpOptions="httpOptions"
        @search="onList(1)"
        @fields="(v) => (newFields = v)"
    >
        <a-form-item slot="afterField">
            <a-button>afterField</a-button>
        </a-form-item>
    </Fields>
</template>
<script>
    export default {
        data() {
            return {
                httpOptions: {
                    baseURL: 'http://localhost:8855',
                    error: message.error,
                    dataKey: 'result',
                    beforeRequest(config) {
                        config.headers['Token'] = '12fsfsafafsfafsfsfsa'
                    },
                },
                params: {
                    cityCode: '140300',
                    countyCode: '140311',
                    provinceCode: '140000',
                },
                fields: [
                    {
                        key: 'date',
                        extraAttrs: {
                            class: 'w-200',
                            format: 'YYYY-MM-DD',
                        },
                    },
                    {
                        type: 'county',
                        key: 'area',
                        label: '区域',
                        extraAttrs: {
                            // mode: 'multiple',
                            class: 'w-400',
                            provinceKey: 'pcode',
                            cityKey: 'ccode',
                            countyKey: 'tcode',
                        },
                    },
                    {
                        type: 'select',
                        label: '用户',
                        key: 'username',
                        extraAttrs: {
                            class: 'w-130',
                        },
                        actions: [
                            {
                                url: '/sys/user/getListByUserName',
                                labelKey: 'realname',
                                valueKey: 'username',
                            },
                        ],
                    },
                ]
            }
        },
    }
</script>

1.10 WDownload

下载组件

PropertyType默认值Description必填
extraAttrsObject{ disabled: false, ghost: false, icon: 'download', size: 'default', type: 'primary', nameOrKey: '' }button组件配置+nameOrKey(优先级最低)false
httpOptionsObject{}Http相关信息当url参数不为function时候必传
urlString, Function, Object''请求主体true
slot(默认)Slot下载false
<template>
    <WDownload
        :httpOptions="httpOptions"
        :extraAttrs="{
            type: 'primary',
            ghost: true,
            icon: 'export',
            nameOrKey: 'hahah.xls',
        }"
        url="/export/abc"
        class="m-r-10"
        >导出</WDownload
    >
</template>

1.11 WTable

下载组件

PropertyType默认值Description必填
httpOptionsObject{}Http相关信息true
buttonOptionsObjectButtonOptionsFields部分的buttonOptions参数false
fieldsField[][]Field部分配置主体false
pageOptionsObjectPageOptions分页配置false
tableOptionsObjectTableOptionslist配置true
slot('beforeField')SlotnullbeforeField插槽,位于整个组件开始位置---slot-scoped='{params}'false
slot('afterField')SlotnullafterField插槽,位于整个组件结束位置---slot-scoped='{params}'false
slot('button')Slotnullbutton插槽,位于导出按钮后面---slot-scoped='{params}'false
<template>
    <WTable
        :fields="fields"
        :httpOptions="httpOptions"
        :pageOptions="{
            pageKey: 'current',
        }"
        :tableOptions="{
            listUrl: '/abc',
            columns: columns,
            bottomOffset: 200,
        }"
        :buttonOptions="{
            exportUrl: '/export',
        }"
    >
        <a-form-item slot="afterField">
            <a-button>afterField</a-button>
        </a-form-item>
    </WTable>
</template>

1.12 WDelete

删除组件

PropertyType默认值Description必填
extraAttrsObject{ }button组件配置+nameOrKey(优先级最低)false
httpOptionsObject{}Http相关信息true>
urlString, Function, Object''请求主体true
titleString'删除'tooltip的titlefalse
noticeString'确定要删除吗?'弹窗确认提示false
recordObject{}行数据true
methodString'get'方法类型false
disabledBoolean'false'是否不可点击false
slot(默认)Slot''true
<template>
    <WDownload
        :httpOptions="httpOptions"
        :extraAttrs="{
            type: 'primary',
            ghost: true,
            icon: 'export',
            nameOrKey: 'hahah.xls',
        }"
        url="/export/abc"
        class="m-r-10"
        >导出</WDownload
    >
</template>

1.12 WNotice

提示组件

PropertyType默认值Description必填
sizeNumber16icon大小false
colorString#aaaicon颜色false
placementStringtoppopover位置false
titleString''popover的titlefalse
contentString,Array''提示内容true
<template>
    <WNotice content="哈喽哈喽" />
    <WNotice :content="['哈喽哈喽', 'hihihi']" />
</template>

2 公共参数

2.1 Field参数

PropertyType默认值Description是否必填
typeStringinput类型(被用到WFields组件的时候有用), W_TYPES为所有常量(input、range、date、select、province、city、county等类型)使用在WFields时必填
labelString使用在WFields组件上时候的属性名称使用在WFields时必填
keyString格式必须为逗号隔开的开始、结束属性集合(如startDate,endDate)true
defaultValueStringArray默认值false
optionsArray[]当类型为select,treeSelect等时候的下拉选项false
extraAttrsObject对应ant组件上的其他属性false
slotString当使用自定义组件时候的slot名称false
actionsArray[]当类型为select,treeSelect等组件需要动态获取options时候的配置false

2.2 Action参数

PropertyType默认值Description是否必填
urlString获取options的接口true
methodStringget请求方法false
paramsObject{}请求参数false
optionPathString字段路径,组件会自动识别data、result、record、list、results、records响应属性false
labelKeyStringlabel下拉框名称false
valueKeyStringvalue选中项目的值false
callbacknullfunctionnull回调函数false

2.3 AreaSelect参数

PropertyType默认值Description是否必填
labelString分别为省份、城市、区县名称false
widthString100%select宽度false
labelColObject{}label 标签布局false
wrapperColObject{}控件 布局false
labelAlignStringrightlabel的文本对齐方式false
requiredBooleanfalse是否必填false

2.4 ButtonOptions参数

PropertyType默认值Description是否必填
searchTxtString搜索搜索按钮名称false
resetTxtString重置重置按钮名称false
exportTxtString导出导出按钮名称false
showResetBooleantrue是否展示重置false
showExportBooleantrue是否展示导出false
exportUrlStringObjectFunction导出url配置false

2.5 url参数

exportUrl类型解释: 
1、当为string类型的时候,表示带query参数的get请求导出/其他地址;
2、当为object类型的时候,表示post请求/详细的get请求,里面包含
    {
        type: 'post',
        url: '', 
        params: {}, 
        headers: {}, 
        nameOrKey: '' 
    }
    其中nameOrKey可以表示名称或接口返回字段(非必填)
3、当为function类型的时候,表示自定义导出/其他行为

2.6 PageOptions参数

PropertyType默认值Description是否必填
isPageBooleantrue是否分页false
defaultSizeNumber20分页默认大小false
exportTxtString导出导出按钮名称false
sizeString''分页组件的sizefalse
pageKeyStringpageNo传给后台的分页数keyfalse
sizeKeyStringpageSize传给后台的分页大小keyfalse
totalKeyStringtotal后台响应基于response的总数keyfalse
recordKeyString''后台响应基于response的list主体key(默认情况下会自动找出最合适的数组,不准的情况下请自己手动传入)false

2.7 TableOptions参数

PropertyType默认值Description是否必填
listUrlString''请求list地址true
listMethodStringget请求方式false
listParamsObjectFunction{}外部单独业务参数/处理参数false
autoLoadBooleantrue页面打开是否自动请求第一页数据false
bottomOffsetNumber0table组件距离底部留白距离(用于自动计算滚动使用)false
columnsColumn[][]table组件的列配置true
extraAttrsObject{}AntTable其他想要自定义的属性false
afterListnullFunctionnull请求完数据后的钩子false

2.8 Column参数

PropertyType默认值Description是否必填
dataIndexString''唯一keytrue
titleString''标题false
templateString''有内置的label、index、white、tag、其他自定义slotfalse
textFilterFunctionnullnulltag组件的时候需要自定义内容时候的配置false
fieldKeyStringnullnulllabel组件的时候dataIndex在Field里面的可以不一致的情况下手动配置项false
hiddenBooleanfalse设置column是否隐藏false
extraAttrsObject{}各个自定义组件tag、label等的自定义属性false
0.13.3

10 months ago

0.13.4

9 months ago

0.13.0

12 months ago

0.13.1

12 months ago

0.13.2

12 months ago

0.12.7

1 year ago

0.12.8

1 year ago

0.12.9

1 year ago

0.12.5

1 year ago

0.12.6

1 year ago

0.11.8

1 year ago

0.11.9

1 year ago

0.12.0

1 year ago

0.12.1

1 year ago

0.12.2

1 year ago

0.12.3

1 year ago

0.12.4

1 year ago

0.11.10

1 year ago

0.11.4

1 year ago

0.11.5

1 year ago

0.11.6

1 year ago

0.11.7

1 year ago

0.11.3

1 year ago

0.11.1-temp

1 year ago

0.11.2

1 year ago

0.11.0-temp

1 year ago

0.10.0

1 year ago

0.9.2

1 year ago

0.7.6

1 year ago

0.7.5

1 year ago

0.9.0

1 year ago

0.9.1

1 year ago

0.7.2

1 year ago

0.7.1

1 year ago

0.7.4

1 year ago

0.7.3

1 year ago

0.7.0

1 year ago

0.6.2

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.5.0

1 year ago

0.3.2

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.3.1

1 year ago

0.2.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.1-temp

1 year ago