@kyfe/ks-query-table 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -0
- package/package.json +10 -81
- package/.bitmap +0 -38
- package/.editorconfig +0 -5
- package/.env.dev +0 -2
- package/.env.gray +0 -2
- package/.env.prod +0 -2
- package/.env.stg +0 -3
- package/.env.uat +0 -2
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -25
- package/.gitmodules +0 -4
- package/.prettierrc +0 -11
- package/README.md +0 -15
- package/babel.config.js +0 -10
- package/build-apm.sh +0 -9
- package/build.sh +0 -16
- package/config/index.js +0 -20
- package/jsconfig.json +0 -7
- package/kuasheng-sdk/index.js +0 -80
- package/kuasheng-sdk/lib/assets.js +0 -304
- package/kuasheng-sdk/lib/context.js +0 -199
- package/kuasheng-sdk/lib/layout.js +0 -346
- package/kuasheng-sdk/lib/location.js +0 -46
- package/kuasheng-sdk/lib/media.js +0 -342
- package/kuasheng-sdk/lib/navigation.js +0 -30
- package/kuasheng-sdk/lib/request.js +0 -76
- package/kuasheng-sdk/lib/system.js +0 -190
- package/kuasheng-sdk/lib/userinfo.js +0 -98
- package/kuasheng-sdk/util/check.js +0 -102
- package/kuasheng-sdk/util/config.js +0 -47
- package/kuasheng-sdk/util/device.js +0 -25
- package/kuasheng-sdk/util/error.js +0 -19
- package/kuasheng-sdk/util/funtional.js +0 -153
- package/kuasheng-sdk/util/mixin.js +0 -36
- package/kuasheng-sdk/util/requestUtil.js +0 -41
- package/kuasheng-sdk/util/response.js +0 -33
- package/kuasheng-sdk/util/warn.js +0 -35
- package/kuasheng-ui/CHANGELOG.md +0 -9
- package/kuasheng-ui/components/card.vue +0 -57
- package/kuasheng-ui/components/ks-area-select/README.md +0 -43
- package/kuasheng-ui/components/ks-area-select/area-picker.vue +0 -554
- package/kuasheng-ui/components/ks-area-select/area-search.vue +0 -363
- package/kuasheng-ui/components/ks-area-select/areas-pop.vue +0 -56
- package/kuasheng-ui/components/ks-area-select/common.js +0 -183
- package/kuasheng-ui/components/ks-area-select/index.vue +0 -355
- package/kuasheng-ui/components/ks-area-select/mixins.js +0 -216
- package/kuasheng-ui/components/ks-area-single-select/README.md +0 -50
- package/kuasheng-ui/components/ks-area-single-select/hot-city.js +0 -45
- package/kuasheng-ui/components/ks-area-single-select/index.vue +0 -324
- package/kuasheng-ui/components/ks-calendar/index.vue +0 -269
- package/kuasheng-ui/components/ks-call-phone/call-tips.vue +0 -70
- package/kuasheng-ui/components/ks-call-phone/call.vue +0 -178
- package/kuasheng-ui/components/ks-call-phone/index.js +0 -48
- package/kuasheng-ui/components/ks-call-phone/index.vue +0 -131
- package/kuasheng-ui/components/ks-call-phone//345/221/274/345/217/253/347/273/204/344/273/266.md +0 -0
- package/kuasheng-ui/components/ks-date-picker/README.md +0 -23
- package/kuasheng-ui/components/ks-date-picker/date-picker-bottom.vue +0 -123
- package/kuasheng-ui/components/ks-date-picker/date-picker-dropdown.vue +0 -80
- package/kuasheng-ui/components/ks-date-picker/date-picker-right.vue +0 -87
- package/kuasheng-ui/components/ks-date-picker/date-picker-top.vue +0 -88
- package/kuasheng-ui/components/ks-date-picker/date-picker.js +0 -15
- package/kuasheng-ui/components/ks-date-picker/date-range-select.vue +0 -92
- package/kuasheng-ui/components/ks-date-picker/date-select.vue +0 -65
- package/kuasheng-ui/components/ks-date-picker/date-week-month.vue +0 -131
- package/kuasheng-ui/components/ks-date-picker/index.js +0 -12
- package/kuasheng-ui/components/ks-date-picker/mixin.js +0 -92
- package/kuasheng-ui/components/ks-date-picker/month-range-select.vue +0 -129
- package/kuasheng-ui/components/ks-date-picker/month-select.vue +0 -85
- package/kuasheng-ui/components/ks-date-picker/quarter-select.vue +0 -94
- package/kuasheng-ui/components/ks-date-picker/style.less +0 -121
- package/kuasheng-ui/components/ks-date-picker/utils.js +0 -109
- package/kuasheng-ui/components/ks-date-picker/week-select.vue +0 -99
- package/kuasheng-ui/components/ks-decrypt/index.vue +0 -159
- package/kuasheng-ui/components/ks-employee/README.md +0 -78
- package/kuasheng-ui/components/ks-employee/employee-input.vue +0 -173
- package/kuasheng-ui/components/ks-employee/employee-list.vue +0 -662
- package/kuasheng-ui/components/ks-employee/employee-popup.vue +0 -197
- package/kuasheng-ui/components/ks-employee/employee-search.vue +0 -250
- package/kuasheng-ui/components/ks-employee/employee-selected.vue +0 -173
- package/kuasheng-ui/components/ks-employee/index.js +0 -17
- package/kuasheng-ui/components/ks-employee/package-lock.json +0 -5
- package/kuasheng-ui/components/ks-employee/package.json +0 -15
- package/kuasheng-ui/components/ks-employee/yarn.lock +0 -4
- package/kuasheng-ui/components/ks-field-money/index.js +0 -8
- package/kuasheng-ui/components/ks-field-money/index.vue +0 -212
- package/kuasheng-ui/components/ks-field-money/package.json +0 -11
- package/kuasheng-ui/components/ks-field-money/utils.js +0 -65
- package/kuasheng-ui/components/ks-field-money//351/207/221/351/242/235/350/275/254/346/215/242/345/231/250.md +0 -0
- package/kuasheng-ui/components/ks-history-search/history-input.vue +0 -131
- package/kuasheng-ui/components/ks-history-search/history-list.vue +0 -188
- package/kuasheng-ui/components/ks-history-search/img/delete.png +0 -0
- package/kuasheng-ui/components/ks-history-search/index.js +0 -9
- package/kuasheng-ui/components/ks-history-search/index.vue +0 -125
- package/kuasheng-ui/components/ks-history-search/package-lock.json +0 -5
- package/kuasheng-ui/components/ks-history-search/package.json +0 -15
- package/kuasheng-ui/components/ks-history-search/utils.js +0 -35
- package/kuasheng-ui/components/ks-input-search/index.vue +0 -106
- package/kuasheng-ui/components/ks-list/index.vue +0 -75
- package/kuasheng-ui/components/ks-loading/index.js +0 -16
- package/kuasheng-ui/components/ks-month/index.vue +0 -47
- package/kuasheng-ui/components/ks-month/package.json +0 -3
- package/kuasheng-ui/components/ks-month/range.vue +0 -172
- package/kuasheng-ui/components/ks-month/single.vue +0 -136
- package/kuasheng-ui/components/ks-month/style.less +0 -125
- package/kuasheng-ui/components/ks-month/utils.js +0 -35
- package/kuasheng-ui/components/ks-nav/index.vue +0 -264
- package/kuasheng-ui/components/ks-nav-bar.js +0 -35
- package/kuasheng-ui/components/ks-org/ks-org-tree.vue +0 -247
- package/kuasheng-ui/components/ks-org/ks-popup-tree.vue +0 -154
- package/kuasheng-ui/components/ks-org/ks-tree-input.vue +0 -240
- package/kuasheng-ui/components/ks-org/ks-tree-node.vue +0 -94
- package/kuasheng-ui/components/ks-org/ks-tree.vue +0 -229
- package/kuasheng-ui/components/ks-org/utils.js +0 -54
- package/kuasheng-ui/components/ks-popover/index.vue +0 -457
- package/kuasheng-ui/components/ks-popover/mixin.js +0 -28
- package/kuasheng-ui/components/ks-popover/utils.js +0 -60
- package/kuasheng-ui/components/ks-pull-refresh/index.vue +0 -43
- package/kuasheng-ui/components/ks-quarter/index.vue +0 -256
- package/kuasheng-ui/components/ks-table/README.md +0 -103
- package/kuasheng-ui/components/ks-table/cell.vue +0 -31
- package/kuasheng-ui/components/ks-table/index.js +0 -8
- package/kuasheng-ui/components/ks-table/index.less +0 -486
- package/kuasheng-ui/components/ks-table/index.vue +0 -1088
- package/kuasheng-ui/components/ks-table/package.json +0 -12
- package/kuasheng-ui/components/ks-table/release.md +0 -7
- package/kuasheng-ui/components/ks-toast.js +0 -35
- package/kuasheng-ui/components/ks-upload/index.vue +0 -174
- package/kuasheng-ui/components/ks-user-access.vue +0 -229
- package/kuasheng-ui/components/no-data/README.md +0 -45
- package/kuasheng-ui/components/no-data/image.js +0 -1
- package/kuasheng-ui/components/no-data/index.vue +0 -83
- package/kuasheng-ui/components/notice-bar.vue +0 -16
- package/kuasheng-ui/components/steps.js +0 -11
- package/kuasheng-ui/components/tabs.vue +0 -40
- package/kuasheng-ui/index.js +0 -239
- package/kuasheng-ui/patch/datetime-picker/datetimePicker.md +0 -0
- package/kuasheng-ui/patch/datetime-picker/index.js +0 -46
- package/kuasheng-ui/patch/datetime-picker/utils.js +0 -78
- package/kuasheng-ui/patch/field/field.md +0 -1
- package/kuasheng-ui/patch/field/index.js +0 -122
- package/kuasheng-ui/patch/field/utils.js +0 -36
- package/kuasheng-ui/patch/form/form.md +0 -7
- package/kuasheng-ui/patch/form/index.js +0 -106
- package/kuasheng-ui/patch/index.js +0 -12
- package/kuasheng-ui/patch/pagination/index.js +0 -78
- package/kuasheng-ui/style/animation-ui.less +0 -31
- package/kuasheng-ui/style/font/number/font-number1.otf +0 -0
- package/kuasheng-ui/style/font/number/font-number2.ttf +0 -0
- package/kuasheng-ui/style/images/checked.svg +0 -1
- package/kuasheng-ui/style/images/success.svg +0 -1
- package/kuasheng-ui/style/index.less +0 -6
- package/kuasheng-ui/style/kuasheng-ui.less +0 -207
- package/kuasheng-ui/style/reset-vant.less +0 -307
- package/kuasheng-ui/style/vant-var.less +0 -138
- package/kuasheng-ui/utils/apis.js +0 -17
- package/kuasheng-ui/utils/axios-adapter.js +0 -47
- package/kuasheng-ui/utils/bem.js +0 -39
- package/kuasheng-ui/utils/bus.js +0 -97
- package/kuasheng-ui/utils/common.js +0 -88
- package/kuasheng-ui/utils/decrypt/config.js +0 -12
- package/kuasheng-ui/utils/decrypt/decrypt-api.js +0 -139
- package/kuasheng-ui/utils/decrypt/index.js +0 -6
- package/kuasheng-ui/utils/decrypt/mask.js +0 -36
- package/kuasheng-ui/utils/decrypt/virtual.js +0 -44
- package/kuasheng-ui/utils/directive.js +0 -57
- package/kuasheng-ui/utils/directive.md +0 -23
- package/kuasheng-ui/utils/drcheck-plugin.js +0 -219
- package/kuasheng-ui/utils/error-plugin.js +0 -88
- package/kuasheng-ui/utils/filter.js +0 -149
- package/kuasheng-ui/utils/http-interceptors.js +0 -18
- package/kuasheng-ui/utils/http.js +0 -140
- package/kuasheng-ui/utils/index.js +0 -5
- package/kuasheng-ui/utils/init-event.js +0 -20
- package/kuasheng-ui/utils/log.js +0 -309
- package/kuasheng-ui/utils/token.js +0 -9
- package/kuasheng-ui/utils/type.js +0 -45
- package/kuasheng-ui/utils/validate.js +0 -20
- package/kuasheng-ui/utils/watermark.js +0 -67
- package/kuasheng-ui/version.js +0 -1
- package/ky-apm/client.js +0 -37
- package/ky-apm/customHttp.js +0 -38
- package/ky-apm/index.js +0 -68
- package/ky-apm/plugins/performance.js +0 -84
- package/ky-apm/plugins/self-error.js +0 -26
- package/ky-apm/warn-log.js +0 -3
- package/plugin/ks-chii-webpack-html/index.js +0 -53
- package/plugin/ks-chii-webpack-html/package.json +0 -16
- package/postcss.config.js +0 -15
- package/public/capsule-positon.js +0 -50
- package/public/fonts/DingTalkJinBuTi.ttf +0 -0
- package/public/framework/axios@0.19.0.min.js +0 -9
- package/public/framework/fastclick@1.0.6.min.js +0 -1
- package/public/framework/iconfont/iconfont.css +0 -91
- package/public/framework/iconfont/iconfont.js +0 -1
- package/public/framework/iconfont/iconfont.json +0 -142
- package/public/framework/iconfont/iconfont.ttf +0 -0
- package/public/framework/iconfont/iconfont.woff +0 -0
- package/public/framework/iconfont/iconfont.woff2 +0 -0
- package/public/framework/vant@2.5.6.min.js +0 -7
- package/public/framework/vue-router@3.1.3.min.js +0 -6
- package/public/framework/vue@2.6.10.runtime.min.js +0 -6
- package/public/framework/vuex@3.1.1.min.js +0 -6
- package/public/index.html +0 -260
- package/public/ks@3.0.8.umd.min.js +0 -1
- package/public/ksui@4.0.27.umd.min.js +0 -10
- package/public/status-bar-preset.js +0 -39
- package/qt-npm/index.js +0 -11
- package/qt-npm/package.json +0 -13
- package/src/App.vue +0 -204
- package/src/README.md +0 -15
- package/src/common/README.md +0 -94
- package/src/common/http/axios-adapter.js +0 -47
- package/src/common/http/common.js +0 -88
- package/src/common/http/http-interceptors.js +0 -18
- package/src/common/http/http-lock.js +0 -45
- package/src/common/http/index.js +0 -163
- package/src/common/http/token.js +0 -9
- package/src/common/styles/font/AlibabaSans102Ver2-Md.ttf +0 -0
- package/src/common/styles/font.less +0 -12
- package/src/common/styles/variables.less +0 -43
- package/src/common/utils/index.js +0 -1
- package/src/common/utils/platform/README.md +0 -1
- package/src/common/utils/platform/android/.gitkeep +0 -0
- package/src/common/utils/platform/core/index.js +0 -24
- package/src/common/utils/platform/index.js +0 -164
- package/src/common/utils/platform/ios/.gitkeep +0 -0
- package/src/common/utils/platform/subscribe/helper.js +0 -38
- package/src/common/utils/platform/subscribe/index.js +0 -204
- package/src/common/utils/platform/subscribe/table-animation.js +0 -75
- package/src/config/index.js +0 -31
- package/src/config.js +0 -1
- package/src/main.js +0 -73
- package/src/router.js +0 -52
- package/src/view/home/config.js +0 -101
- package/src/view/home/demo1.vue +0 -223
- package/src/view/home/demo2.vue +0 -124
- package/src/view/home/demo3.vue +0 -51
- package/src/view/home/demo4.vue +0 -140
- package/src/view/home/index.vue +0 -97
- package/src/view/home/query-table/README.md +0 -45
- package/src/view/home/query-table/api/index.js +0 -12
- package/src/view/home/query-table/assets/horizontal-back.svg +0 -1
- package/src/view/home/query-table/components/pe-table/cell.js +0 -181
- package/src/view/home/query-table/components/pe-table/collapse.js +0 -334
- package/src/view/home/query-table/components/pe-table/empty.vue +0 -48
- package/src/view/home/query-table/components/pe-table/header.js +0 -328
- package/src/view/home/query-table/components/pe-table/images/abnormal.png +0 -0
- package/src/view/home/query-table/components/pe-table/images/empty.png +0 -0
- package/src/view/home/query-table/components/pe-table/images/fold.svg +0 -1
- package/src/view/home/query-table/components/pe-table/images/sort.svg +0 -1
- package/src/view/home/query-table/components/pe-table/images/sorting.svg +0 -1
- package/src/view/home/query-table/components/pe-table/images/unfold.svg +0 -1
- package/src/view/home/query-table/components/pe-table/index.vue +0 -847
- package/src/view/home/query-table/components/pe-table/load-more.js +0 -46
- package/src/view/home/query-table/components/pe-table/props/index.js +0 -193
- package/src/view/home/query-table/components/pe-table/row.vue +0 -118
- package/src/view/home/query-table/components/pe-table/scrollbar.js +0 -424
- package/src/view/home/query-table/components/pe-table/stretch-damping.js +0 -112
- package/src/view/home/query-table/components/pe-table/style/cell.less +0 -89
- package/src/view/home/query-table/components/pe-table/style/empty.less +0 -48
- package/src/view/home/query-table/components/pe-table/style/header.less +0 -141
- package/src/view/home/query-table/components/pe-table/style/index.less +0 -88
- package/src/view/home/query-table/components/pe-table/style/load-more.less +0 -61
- package/src/view/home/query-table/components/pe-table/style/row.less +0 -6
- package/src/view/home/query-table/components/pe-table/table-loading.vue +0 -120
- package/src/view/home/query-table/components/pe-table/table-total.vue +0 -57
- package/src/view/home/query-table/components/pe-table/utils/animate.js +0 -80
- package/src/view/home/query-table/components/pe-table/utils/columns.js +0 -290
- package/src/view/home/query-table/components/pe-table/utils/data.js +0 -12
- package/src/view/home/query-table/components/pe-table/utils/fixed.js +0 -69
- package/src/view/home/query-table/components/pe-table/utils/formatter.js +0 -327
- package/src/view/home/query-table/components/pe-table/utils/render-cells.js +0 -424
- package/src/view/home/query-table/components/pe-table/utils/slot.js +0 -28
- package/src/view/home/query-table/components/pe-table/utils/tools.js +0 -84
- package/src/view/home/query-table/components/pe-table/utils/touch-scroll.js +0 -417
- package/src/view/home/query-table/components/query-table/index.vue +0 -497
- package/src/view/home/query-table/components/query-table/mixins/column-mixin.js +0 -102
- package/src/view/home/query-table/components/query-table/mixins/column-setting.js +0 -143
- package/src/view/home/query-table/components/query-table/mixins/data-mixin.js +0 -519
- package/src/view/home/query-table/components/query-table/mixins/pagination-mixin.js +0 -26
- package/src/view/home/query-table/components/query-table/mixins/table-fixed.js +0 -130
- package/src/view/home/query-table/components/query-table/mixins/table-horizontal.js +0 -119
- package/src/view/home/query-table/components/table-horizontal.vue +0 -99
- package/src/view/home/query-table/components/table-pagination.vue +0 -32
- package/src/view/home/query-table/components/table-settings/assets/arrpw-up.svg +0 -1
- package/src/view/home/query-table/components/table-settings/assets/disabled-down.svg +0 -1
- package/src/view/home/query-table/components/table-settings/assets/disabled-up.svg +0 -1
- package/src/view/home/query-table/components/table-settings/assets/down.svg +0 -1
- package/src/view/home/query-table/components/table-settings/assets/up.svg +0 -1
- package/src/view/home/query-table/components/table-settings/index.less +0 -294
- package/src/view/home/query-table/components/table-settings/index.vue +0 -260
- package/src/view/home/query-table/components/table-settings/settings.vue +0 -479
- package/src/view/home/query-table/components/table-settings/test.js +0 -626
- package/src/view/home/query-table/components/table-settings//344/270/252/346/200/247/350/256/276/347/275/256.md +0 -0
- package/src/view/home/query-table/components/tooltip.js +0 -124
- package/src/view/home/query-table/hooks/use-cache-promise.js +0 -27
- package/src/view/home/query-table/hooks/use-column-config.js +0 -190
- package/src/view/home/query-table/hooks/use-encryption.js +0 -0
- package/src/view/home/query-table/hooks/use-generic-search.js +0 -95
- package/src/view/home/query-table/index.js +0 -7
- package/src/view/home/query-table/store/column-store.js +0 -0
- package/src/view/home/query-table/styles/table.less +0 -24
- package/src/view/home/query-table/utils/column.js +0 -36
- package/src/view/home/query-table/utils/config.js +0 -12
- package/src/view/home/query-table/utils/encryption.js +0 -32
- package/src/view/home/query-table/utils/http.js +0 -1
- package/src/view/home/query-table/utils/localStorage.js +0 -35
- package/src/view/home//351/246/226/351/241/265.md +0 -0
- package/src/web.js +0 -99
- package/vue.config.js +0 -131
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- <div :style="{ width: '100%', height: '100%' }" style="z-index: 10001"> -->
|
|
3
|
-
<div class="ks-area-select-multi">
|
|
4
|
-
<area-search ref="areaSearch" v-model="searchListShow" @closeDropdown="closeDropdown" @searchSelect="searchSelect" :placeholder="placeholder" />
|
|
5
|
-
<div class="formItem-input" v-show="!searchListShow">
|
|
6
|
-
<div class="formItem-input-content">
|
|
7
|
-
<van-dropdown-menu active-color="#03050D" z-index="10002" :overlay="false" v-show="textOver">
|
|
8
|
-
<van-dropdown-item
|
|
9
|
-
class="areapop-dropdown"
|
|
10
|
-
ref="areaPopDropdownItem"
|
|
11
|
-
title-class="ks-area-txt-icon"
|
|
12
|
-
@opened="showAreaPop = true"
|
|
13
|
-
@close="showAreaPop = false"
|
|
14
|
-
>
|
|
15
|
-
<template #title>
|
|
16
|
-
<div class="nav-item">
|
|
17
|
-
<img v-if="showAreaPop" src="https://erphostjs.kye-erp.com/kuasheng-h5/assets/ks-area-select/arrow-up@2x.png" alt="收起" />
|
|
18
|
-
<img v-else src="https://erphostjs.kye-erp.com/kuasheng-h5/assets/ks-area-select/arrow-down@2x.png" alt="展开" />
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
<area-list-pop :areaList="selectDisplayData" @remove="remove" :style="{ height: selectedPopHeight + 'px' }" />
|
|
22
|
-
</van-dropdown-item>
|
|
23
|
-
</van-dropdown-menu>
|
|
24
|
-
<div class="formItem-input-content-tags" v-if="!showAreaPop" ref="areaNamesBox">
|
|
25
|
-
<div v-if="selectDisplayData && selectDisplayData.length" class="formItem-input-value" ref="areaNames">
|
|
26
|
-
<span class="txtItem" v-for="item in selectDisplayData" :key="item.districtID">{{ item.name }} <ks-icon name="cross" @click="remove(item)"/></span>
|
|
27
|
-
</div>
|
|
28
|
-
<div v-else class="formItem-input-placeholder">{{ selectPlaceholder }}</div>
|
|
29
|
-
</div>
|
|
30
|
-
<div v-else class="area-pop-tip">已选区域</div>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
<div class="ks-area-picker-wrap" v-show="!searchListShow">
|
|
34
|
-
<areaPicker :level="levelOptions.length" :isArea="isArea" ref="areaPickerRef" />
|
|
35
|
-
</div>
|
|
36
|
-
<div class="bot-btn-wrap">
|
|
37
|
-
<van-button type="primary" plain round @click="onReset" class="btn-normal">重置</van-button>
|
|
38
|
-
<van-button type="primary" round @click="onSubmit">确定{{ selectDisplayData.length ? `(${selectDisplayData.length})` : '' }}</van-button>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
<!-- </div> -->
|
|
42
|
-
</template>
|
|
43
|
-
<script>
|
|
44
|
-
import { HOT_CITY_LIST } from './common'
|
|
45
|
-
import areaSearch from './area-search.vue'
|
|
46
|
-
import areaListPop from './areas-pop.vue'
|
|
47
|
-
import areaPicker from './area-picker.vue'
|
|
48
|
-
|
|
49
|
-
// const districtLevels = ['province', 'city', 'zone', 'street']
|
|
50
|
-
const getRouteName = (node, key = 'simpleName', join = '') => {
|
|
51
|
-
const routeNames = [node[key]]
|
|
52
|
-
let currentNode = node._parent
|
|
53
|
-
while (currentNode && currentNode.districtID && currentNode.districtID !== 'all') {
|
|
54
|
-
routeNames.push(currentNode[key])
|
|
55
|
-
currentNode = currentNode._parent
|
|
56
|
-
}
|
|
57
|
-
return routeNames.reverse().join(join)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export default {
|
|
61
|
-
props: {
|
|
62
|
-
// 最多可选择
|
|
63
|
-
maxlength: {
|
|
64
|
-
type: Number
|
|
65
|
-
},
|
|
66
|
-
placeholder: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: '请输入搜索内容'
|
|
69
|
-
},
|
|
70
|
-
selectPlaceholder: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: '请选择区域'
|
|
73
|
-
},
|
|
74
|
-
// 是否包括大区
|
|
75
|
-
isArea: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: false
|
|
78
|
-
},
|
|
79
|
-
// 热门城市列表
|
|
80
|
-
hotList: {
|
|
81
|
-
type: Array,
|
|
82
|
-
default: () => {
|
|
83
|
-
return HOT_CITY_LIST
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
// 地址树数据
|
|
87
|
-
areaData: {
|
|
88
|
-
type: Array,
|
|
89
|
-
default: () => {
|
|
90
|
-
return []
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
// 只读状态
|
|
94
|
-
readOnly: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false
|
|
97
|
-
},
|
|
98
|
-
levelOptions: {
|
|
99
|
-
type: Array,
|
|
100
|
-
default: () => {
|
|
101
|
-
return [{ name: '省/直辖市', disabled: false }, { name: '城市' }, { name: '区/县' }, { name: '镇/街道' }]
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
name: 'ks-area-select-multi',
|
|
106
|
-
components: {
|
|
107
|
-
areaSearch,
|
|
108
|
-
areaListPop,
|
|
109
|
-
areaPicker
|
|
110
|
-
},
|
|
111
|
-
data() {
|
|
112
|
-
return {
|
|
113
|
-
idMap: null,
|
|
114
|
-
selectedPopHeight: 200,
|
|
115
|
-
checkedData: [],
|
|
116
|
-
searchListShow: false,
|
|
117
|
-
showAreaPop: false,
|
|
118
|
-
textOver: false
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
computed: {
|
|
122
|
-
selectDisplayData() {
|
|
123
|
-
const displayData =
|
|
124
|
-
this.checkedData.map(node => {
|
|
125
|
-
return { districtID: node.districtID, name: getRouteName(node) }
|
|
126
|
-
}) || []
|
|
127
|
-
return displayData
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
watch: {
|
|
131
|
-
selectDisplayData() {
|
|
132
|
-
setTimeout(() => {
|
|
133
|
-
if (this.$refs.areaNames) {
|
|
134
|
-
this.textOver = this.$refs.areaNames.clientWidth > this.$refs.areaNamesBox.clientWidth
|
|
135
|
-
if (this.textOver) {
|
|
136
|
-
this.selectedPopHeight = this.$refs.areaPickerRef.$el.clientHeight + 56
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}, 0)
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
// updated() {
|
|
143
|
-
// this.$refs.areaSearch.handleCancel()
|
|
144
|
-
// },
|
|
145
|
-
methods: {
|
|
146
|
-
closeDropdown() {
|
|
147
|
-
this.$refs.areaPopDropdownItem && this.$refs.areaPopDropdownItem.toggle(false)
|
|
148
|
-
},
|
|
149
|
-
closePop() {
|
|
150
|
-
// this.searchListShow = false
|
|
151
|
-
this.$refs.areaSearch && this.$refs.areaSearch.handleCancel()
|
|
152
|
-
this.closeDropdown()
|
|
153
|
-
},
|
|
154
|
-
remove(item) {
|
|
155
|
-
if (this.idMap) {
|
|
156
|
-
const mapItem = this.idMap.get(item.districtID)
|
|
157
|
-
// console.error(mapItem, 'mapItem')
|
|
158
|
-
this.$refs.areaPickerRef.checkboxClick(mapItem, mapItem.index, mapItem._erpZoom)
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
async searchSelect(item) {
|
|
162
|
-
if (!item.isChecked) {
|
|
163
|
-
await this.$refs.areaPickerRef.showHistoryDataChecked([
|
|
164
|
-
{
|
|
165
|
-
districtID: item.districtID,
|
|
166
|
-
districtName: item.districAllName,
|
|
167
|
-
simpleName: item.districtName
|
|
168
|
-
}
|
|
169
|
-
])
|
|
170
|
-
} else {
|
|
171
|
-
if (this.idMap) {
|
|
172
|
-
const mapItem = this.idMap.get(item.districtID)
|
|
173
|
-
await this.$refs.areaPickerRef.checkboxClick(mapItem, mapItem.index, mapItem._erpZoom)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
this.$nextTick(() => {
|
|
177
|
-
this.$refs.areaSearch.updatedData()
|
|
178
|
-
})
|
|
179
|
-
},
|
|
180
|
-
onSubmit() {
|
|
181
|
-
this.$emit(
|
|
182
|
-
'change',
|
|
183
|
-
this.checkedData.map(item => {
|
|
184
|
-
return {
|
|
185
|
-
districtLevel: item.districtLevel,
|
|
186
|
-
districtID: item.districtID,
|
|
187
|
-
allDistrictID: getRouteName(item, 'districtID', '/'),
|
|
188
|
-
districtName: item.simpleName,
|
|
189
|
-
allDistrictName: getRouteName(item, 'simpleName', '/')
|
|
190
|
-
}
|
|
191
|
-
})
|
|
192
|
-
)
|
|
193
|
-
this.$emit('close')
|
|
194
|
-
},
|
|
195
|
-
onReset() {
|
|
196
|
-
this.textOver = false
|
|
197
|
-
this.searchListShow = false
|
|
198
|
-
this.closeDropdown()
|
|
199
|
-
this.$refs.areaPickerRef.clearAll()
|
|
200
|
-
this.$refs.areaSearch.updatedData()
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
</script>
|
|
205
|
-
<style lang="less" scoped>
|
|
206
|
-
.ks-area-select-multi {
|
|
207
|
-
position: relative;
|
|
208
|
-
height: 100%;
|
|
209
|
-
overflow: hidden;
|
|
210
|
-
.titleWrap {
|
|
211
|
-
width: 100%;
|
|
212
|
-
height: 28px;
|
|
213
|
-
margin-top: 52px;
|
|
214
|
-
margin-left: 16px;
|
|
215
|
-
.word {
|
|
216
|
-
display: inline-block;
|
|
217
|
-
font-size: 18px;
|
|
218
|
-
display: flex;
|
|
219
|
-
align-items: center;
|
|
220
|
-
.icon {
|
|
221
|
-
width: 20px;
|
|
222
|
-
height: 20px;
|
|
223
|
-
display: inline-block;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
.formItem-input {
|
|
228
|
-
height: 24px;
|
|
229
|
-
margin: 10px 0;
|
|
230
|
-
color: #888ea6;
|
|
231
|
-
font-size: 12px;
|
|
232
|
-
font-family: PingFangSC, PingFangSC-Regular;
|
|
233
|
-
font-weight: 400;
|
|
234
|
-
overflow: hidden;
|
|
235
|
-
padding: 0 0 0 16px;
|
|
236
|
-
line-height: 24px;
|
|
237
|
-
/deep/ .van-overlay {
|
|
238
|
-
height: 100vh !important;
|
|
239
|
-
}
|
|
240
|
-
.formItem-input-content {
|
|
241
|
-
position: relative;
|
|
242
|
-
-webkit-overflow-scrolling: unset;
|
|
243
|
-
/deep/ .van-dropdown-menu {
|
|
244
|
-
position: absolute;
|
|
245
|
-
z-index: 999;
|
|
246
|
-
height: 36px;
|
|
247
|
-
width: 58px;
|
|
248
|
-
top: -6px;
|
|
249
|
-
right: 0;
|
|
250
|
-
background: linear-gradient(90deg, rgba(255, 255, 255, 0) 12%, #ffffff 35%);
|
|
251
|
-
.van-dropdown-menu__title {
|
|
252
|
-
&::after {
|
|
253
|
-
display: none;
|
|
254
|
-
}
|
|
255
|
-
.van-ellipsis {
|
|
256
|
-
.nav-item {
|
|
257
|
-
position: relative;
|
|
258
|
-
width: 10px;
|
|
259
|
-
height: 18px;
|
|
260
|
-
img {
|
|
261
|
-
width: 10px;
|
|
262
|
-
height: 5px;
|
|
263
|
-
position: absolute;
|
|
264
|
-
top: 7px;
|
|
265
|
-
left: 0;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
.arrow-down-icon-active {
|
|
271
|
-
display: none;
|
|
272
|
-
}
|
|
273
|
-
.van-dropdown-item--down {
|
|
274
|
-
border-radius: 0;
|
|
275
|
-
}
|
|
276
|
-
.van-dropdown-item__content {
|
|
277
|
-
border-radius: 0 0 12px 12px;
|
|
278
|
-
border-start-end-radius: 0;
|
|
279
|
-
border-start-start-radius: 0;
|
|
280
|
-
max-height: unset !important;
|
|
281
|
-
border-end-end-radius: 20px;
|
|
282
|
-
border-end-start-radius: 20px;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
.area-pop-tip {
|
|
286
|
-
color: #03050d;
|
|
287
|
-
font-size: 12px;
|
|
288
|
-
}
|
|
289
|
-
.formItem-input-content-tags {
|
|
290
|
-
overflow-x: auto;
|
|
291
|
-
width: calc(100% - 40px);
|
|
292
|
-
&::-webkit-scrollbar {
|
|
293
|
-
display: none;
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
.formItem-input-value {
|
|
298
|
-
color: #165DFF;
|
|
299
|
-
font-size: 12px;
|
|
300
|
-
width: max-content;
|
|
301
|
-
.txtItem {
|
|
302
|
-
display: inline-block;
|
|
303
|
-
background: #f1f0fe;
|
|
304
|
-
color: #165DFF;
|
|
305
|
-
border-radius: 4px;
|
|
306
|
-
padding: 6px 28px 6px 12px;
|
|
307
|
-
margin-left: 8px;
|
|
308
|
-
font-size: 12px;
|
|
309
|
-
font-family: PingFangSC, PingFangSC-Regular;
|
|
310
|
-
font-weight: 400;
|
|
311
|
-
line-height: 12px;
|
|
312
|
-
position: relative;
|
|
313
|
-
.van-icon {
|
|
314
|
-
position: absolute;
|
|
315
|
-
padding: 6px;
|
|
316
|
-
right: 0;
|
|
317
|
-
top: 0;
|
|
318
|
-
}
|
|
319
|
-
&:first-child {
|
|
320
|
-
margin-left: 0px;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
.ks-area-picker-wrap {
|
|
326
|
-
position: relative;
|
|
327
|
-
width: 100%;
|
|
328
|
-
height: calc(100% - 145px);
|
|
329
|
-
}
|
|
330
|
-
.bot-btn-wrap {
|
|
331
|
-
width: 100%;
|
|
332
|
-
position: absolute;
|
|
333
|
-
left: 0;
|
|
334
|
-
bottom: 0px;
|
|
335
|
-
box-sizing: border-box;
|
|
336
|
-
display: flex;
|
|
337
|
-
justify-content: space-around;
|
|
338
|
-
background-color: #fff;
|
|
339
|
-
padding: 10px 16px;
|
|
340
|
-
.van-button {
|
|
341
|
-
width: 50%;
|
|
342
|
-
height: 36px;
|
|
343
|
-
line-height: 34px;
|
|
344
|
-
border-radius: 6px !important;
|
|
345
|
-
}
|
|
346
|
-
.van-button--primary {
|
|
347
|
-
margin-left: 6px;
|
|
348
|
-
}
|
|
349
|
-
.van-button--plain {
|
|
350
|
-
margin-right: 6px;
|
|
351
|
-
margin-left: 0;
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
</style>
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { cloneDeep } from './common'
|
|
2
|
-
|
|
3
|
-
const APPKEY = 10205
|
|
4
|
-
const setChildrenData = (data, item, idMap, key, rootChecked = false) => {
|
|
5
|
-
const cloneData = cloneDeep(data)
|
|
6
|
-
const childrenData = cloneData.map((v, index) => {
|
|
7
|
-
const splitName = v.districtName.split('-')
|
|
8
|
-
v.simpleName = splitName[splitName.length - 1]
|
|
9
|
-
v.isChecked = false
|
|
10
|
-
v.index = index + 1
|
|
11
|
-
v.isIndeterminate = false
|
|
12
|
-
v._erpZoom = key
|
|
13
|
-
v._parent = item
|
|
14
|
-
v.childrenNode = []
|
|
15
|
-
idMap.set(v.districtID, v)
|
|
16
|
-
return v
|
|
17
|
-
})
|
|
18
|
-
const childrenList = [
|
|
19
|
-
{
|
|
20
|
-
simpleName: '不限',
|
|
21
|
-
index: 0,
|
|
22
|
-
isChecked: rootChecked,
|
|
23
|
-
isChoose: false,
|
|
24
|
-
isIndeterminate: false,
|
|
25
|
-
districtLevel: item.districtLevel,
|
|
26
|
-
_erpZoom: key,
|
|
27
|
-
_parent: item
|
|
28
|
-
},
|
|
29
|
-
...childrenData
|
|
30
|
-
]
|
|
31
|
-
item.childrenNode = childrenList
|
|
32
|
-
return childrenList
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default {
|
|
36
|
-
methods: {
|
|
37
|
-
/**
|
|
38
|
-
* 获取子节点数据
|
|
39
|
-
* @param: item key
|
|
40
|
-
* **/
|
|
41
|
-
async getAreaChildren(idMap, item, key, rootChecked) {
|
|
42
|
-
try {
|
|
43
|
-
let method = 'address.addressBgTerritory.getMultiLevelThinkList'
|
|
44
|
-
let param = {
|
|
45
|
-
method: method,
|
|
46
|
-
jsonrpc: '2.0',
|
|
47
|
-
params: {
|
|
48
|
-
districtID: item.districtID,
|
|
49
|
-
showParam: 0
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const data = await this.$http(method, APPKEY, param)
|
|
53
|
-
if (data && data.districtList) {
|
|
54
|
-
return setChildrenData(data.districtList, item, idMap, key, rootChecked)
|
|
55
|
-
}
|
|
56
|
-
} catch (error) {
|
|
57
|
-
// console.log(error)
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
async getAreaLinkData(idArry, idMap, areaTree) {
|
|
61
|
-
try {
|
|
62
|
-
if (!idArry || !idArry.length) {
|
|
63
|
-
return
|
|
64
|
-
}
|
|
65
|
-
const data = await this.$http('address.regionInfo.getInfoByDistrictId', '50243', { districtIds: idArry })
|
|
66
|
-
if (data) {
|
|
67
|
-
// 大区对象
|
|
68
|
-
const treeData = data.childrenNode
|
|
69
|
-
const newMap = new Map()
|
|
70
|
-
const loopSetMap = function(mapData) {
|
|
71
|
-
newMap.set(mapData.districtID, mapData)
|
|
72
|
-
mapData.childrenNode &&
|
|
73
|
-
mapData.childrenNode.map(item => {
|
|
74
|
-
loopSetMap(item)
|
|
75
|
-
})
|
|
76
|
-
}
|
|
77
|
-
treeData.map(item => {
|
|
78
|
-
loopSetMap(item)
|
|
79
|
-
})
|
|
80
|
-
const loopAreaSet = function(areaItem) {
|
|
81
|
-
if (areaItem.districtID) {
|
|
82
|
-
if (!areaItem.childrenNode || !areaItem.childrenNode.length) {
|
|
83
|
-
// 排除不限
|
|
84
|
-
const childrenData = newMap.get(areaItem.districtID)
|
|
85
|
-
if (!childrenData || !childrenData.childrenNode) {
|
|
86
|
-
return
|
|
87
|
-
}
|
|
88
|
-
setChildrenData(childrenData.childrenNode, areaItem, idMap, areaItem._erpZoom + 1)
|
|
89
|
-
}
|
|
90
|
-
areaItem.childrenNode.map(item => {
|
|
91
|
-
loopAreaSet(item)
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
areaTree.childrenNode.map(areaItem => {
|
|
96
|
-
loopAreaSet(areaItem)
|
|
97
|
-
})
|
|
98
|
-
}
|
|
99
|
-
} catch (error) {
|
|
100
|
-
// console.log(error)
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* 向上(父级)递归数据处理
|
|
105
|
-
* @param: item
|
|
106
|
-
* **/
|
|
107
|
-
setFather(item) {
|
|
108
|
-
if (item._parent && item._erpZoom !== 0) {
|
|
109
|
-
const bortherItem = item._parent.childrenNode.slice(1, item._parent.childrenNode.length)
|
|
110
|
-
const allChecked = bortherItem.every(item => {
|
|
111
|
-
return item.isChecked
|
|
112
|
-
})
|
|
113
|
-
const allNoChecked = item._parent.childrenNode.every(item => {
|
|
114
|
-
return item.isChecked === false
|
|
115
|
-
})
|
|
116
|
-
const someIndeterminate = item._parent.childrenNode.some(item => {
|
|
117
|
-
return item.isIndeterminate === true
|
|
118
|
-
})
|
|
119
|
-
const firstItem = item._parent.childrenNode[0].isChecked
|
|
120
|
-
item._parent._parent &&
|
|
121
|
-
item._parent._parent.childrenNode.map(item => {
|
|
122
|
-
item.isChoose = false
|
|
123
|
-
})
|
|
124
|
-
item._parent.isChoose = true
|
|
125
|
-
item._parent.isChecked = firstItem || allChecked
|
|
126
|
-
item._parent.isIndeterminate = firstItem ? false : someIndeterminate || !(allNoChecked || allChecked)
|
|
127
|
-
if (item._parent._parent && item._erpZoom !== 1) {
|
|
128
|
-
item._parent._parent.childrenNode[0].isChecked = false
|
|
129
|
-
}
|
|
130
|
-
this.setFather(item._parent)
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
/**
|
|
134
|
-
* 同级数据处理
|
|
135
|
-
* @param: item itemIndex type
|
|
136
|
-
* **/
|
|
137
|
-
setPeer(item, itemIndex, type) {
|
|
138
|
-
if (itemIndex === 0) {
|
|
139
|
-
item._parent &&
|
|
140
|
-
item._parent.childrenNode.map((v, vIndex) => {
|
|
141
|
-
if (v.isChoose || v.isChecked || v.isIndeterminate) {
|
|
142
|
-
this.clearChildren(v)
|
|
143
|
-
}
|
|
144
|
-
if (vIndex === 0) {
|
|
145
|
-
v.isChecked = type
|
|
146
|
-
} else {
|
|
147
|
-
v.isChecked = false
|
|
148
|
-
v.isIndeterminate = false
|
|
149
|
-
}
|
|
150
|
-
v.isChoose = false
|
|
151
|
-
})
|
|
152
|
-
} else {
|
|
153
|
-
if (item._erpZoom !== 0) {
|
|
154
|
-
type && item._parent && (item._parent.childrenNode[0].isChecked = false)
|
|
155
|
-
} else {
|
|
156
|
-
item._parent && (item._parent.isChecked = false)
|
|
157
|
-
}
|
|
158
|
-
item._parent &&
|
|
159
|
-
item._parent.childrenNode.map(v => {
|
|
160
|
-
v.isChoose = false
|
|
161
|
-
})
|
|
162
|
-
item.isChoose = type
|
|
163
|
-
}
|
|
164
|
-
item.isChecked = type
|
|
165
|
-
item.isIndeterminate = false
|
|
166
|
-
},
|
|
167
|
-
/**
|
|
168
|
-
* 向下递归数据处理
|
|
169
|
-
* @param: item
|
|
170
|
-
* **/
|
|
171
|
-
clearChildren(item) {
|
|
172
|
-
item.childrenNode &&
|
|
173
|
-
item.childrenNode.map(v => {
|
|
174
|
-
if (v.isChoose || v.isChecked || v.isIndeterminate) {
|
|
175
|
-
this.clearChildren(v)
|
|
176
|
-
v.isChoose = false
|
|
177
|
-
v.isChecked = false
|
|
178
|
-
v.isIndeterminate = false
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
},
|
|
182
|
-
/**
|
|
183
|
-
* 清除子节点的choose checked Indeterminate状态
|
|
184
|
-
* @param {*} data
|
|
185
|
-
*/
|
|
186
|
-
clearStatus(data) {
|
|
187
|
-
const clearLoop = item => {
|
|
188
|
-
item.childrenNode &&
|
|
189
|
-
item.childrenNode.map(v => {
|
|
190
|
-
if (v.isChoose || v.isChecked || v.isIndeterminate) {
|
|
191
|
-
clearLoop(v)
|
|
192
|
-
}
|
|
193
|
-
})
|
|
194
|
-
item.isChoose = false
|
|
195
|
-
item.isChecked = false
|
|
196
|
-
item.isIndeterminate = false
|
|
197
|
-
}
|
|
198
|
-
clearLoop(data)
|
|
199
|
-
},
|
|
200
|
-
/**
|
|
201
|
-
* 打开当前节点的相关链路
|
|
202
|
-
* @param {*} item
|
|
203
|
-
* @param {*} selectData 链路二维数组
|
|
204
|
-
*/
|
|
205
|
-
openAddressLink(item, selectData) {
|
|
206
|
-
const openFatherLink = currentItem => {
|
|
207
|
-
const _parent = currentItem._parent
|
|
208
|
-
if (currentItem && currentItem._erpZoom !== 0) {
|
|
209
|
-
_parent.childrenNode && (selectData[currentItem._erpZoom] = _parent.childrenNode)
|
|
210
|
-
openFatherLink(_parent)
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
openFatherLink(item)
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#### 参数
|
|
2
|
-
参数名 | 说明 | 默认值
|
|
3
|
-
-----------|--------|--------
|
|
4
|
-
level | 地址选择级数(1-5) | 4
|
|
5
|
-
|
|
6
|
-
#### 事件
|
|
7
|
-
事件名 | 说明
|
|
8
|
-
-----------|--------
|
|
9
|
-
select | 选择到最后一级时触发
|
|
10
|
-
|
|
11
|
-
#### 用法
|
|
12
|
-
- 使用组件的open方法打开显示(通过ref调用open方法),如果有初始值可以在调用open方法时传入,没有初始值不用传入参数
|
|
13
|
-
|
|
14
|
-
```javascript
|
|
15
|
-
<template>
|
|
16
|
-
<div>
|
|
17
|
-
<ks-button @click="openArea">四级地址选择</ks-button>
|
|
18
|
-
<area-select ref="area" @select="handleSelect" />
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script>
|
|
23
|
-
import AreaSelect from '../components/area-select/index'
|
|
24
|
-
export default {
|
|
25
|
-
components: {AreaSelect},
|
|
26
|
-
methods: {
|
|
27
|
-
openArea () {
|
|
28
|
-
let arr = [{"id":"XZ1-08","name":"四川省","level":"province"},{"id":"XZ2-043","name":"成都市","level":"city"},{"id":"XZ3-2611","name":"成华区","level":"zone"},{"id":"XZ4-035231","name":"保和街道","level":"street"}]
|
|
29
|
-
this.$refs.area.open(arr)
|
|
30
|
-
// this.$refs.area.open() //无参数
|
|
31
|
-
},
|
|
32
|
-
handleSelect (e) {
|
|
33
|
-
console.log(e)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
- 数据结构(open方法传入的参数和select事件返回的参数结构一样)
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
[
|
|
45
|
-
{"id":"XZ1-08","name":"四川省","level":"province"},
|
|
46
|
-
{"id":"XZ2-043","name":"成都市","level":"city"},
|
|
47
|
-
{"id":"XZ3-2611","name":"成华区","level":"zone"},
|
|
48
|
-
{"id":"XZ4-035231","name":"保和街道","level":"street"}
|
|
49
|
-
]
|
|
50
|
-
```
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export const hotCity = () => {
|
|
2
|
-
return [
|
|
3
|
-
{
|
|
4
|
-
title: '北京',
|
|
5
|
-
id: 'XZ2-174',
|
|
6
|
-
value: [{id: 'XZ1-06', name: '北京', level: 'province'}, {id: 'XZ2-174', name: '北京市', level: 'city'}]
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
title: '上海',
|
|
10
|
-
id: 'XZ2-040',
|
|
11
|
-
value: [{id: 'XZ1-01', name: '上海', level: 'province'}, {id: 'XZ2-040', name: '上海市', level: 'city'}]
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
title: '广州',
|
|
15
|
-
id: 'XZ2-042',
|
|
16
|
-
value: [{id: 'XZ1-31', name: '广东省', level: 'province'}, {id: 'XZ2-042', name: '广州市', level: 'city'}]
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
title: '深圳',
|
|
20
|
-
id: 'XZ2-229',
|
|
21
|
-
value: [{id: 'XZ1-31', name: '广东省', level: 'province'}, {id: 'XZ2-229', name: '深圳市', level: 'city'}]
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: '杭州',
|
|
25
|
-
id: 'XZ2-213',
|
|
26
|
-
value: [{id: 'XZ1-22', name: '浙江省', level: 'province'}, {id: 'XZ2-213', name: '杭州市', level: 'city'}]
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
title: '武汉',
|
|
30
|
-
id: 'XZ2-342',
|
|
31
|
-
value: [{id: 'XZ1-23', name: '湖北省', level: 'province'}, {id: 'XZ2-342', name: '武汉市', level: 'city'}]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
title: '成都',
|
|
35
|
-
id: 'XZ2-043',
|
|
36
|
-
value: [{id: 'XZ1-08', name: '四川省', level: 'province'}, {id: 'XZ2-043', name: '成都市', level: 'city'}]
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const createTitles = (level = 4) => {
|
|
42
|
-
let arr = new Array(level)
|
|
43
|
-
arr[0] = '请选择'
|
|
44
|
-
return arr
|
|
45
|
-
}
|