@kyfe/ks-query-table 0.0.21 → 0.0.22
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/.bitmap +38 -0
- package/.editorconfig +5 -0
- package/.env.dev +2 -0
- package/.env.gray +2 -0
- package/.env.prod +2 -0
- package/.env.stg +3 -0
- package/.env.uat +2 -0
- package/.eslintignore +1 -0
- package/.eslintrc.js +25 -0
- package/.gitmodules +4 -0
- package/.prettierrc +11 -0
- package/README.md +15 -0
- package/babel.config.js +10 -0
- package/build-apm.sh +9 -0
- package/build.sh +16 -0
- package/config/index.js +20 -0
- package/jsconfig.json +7 -0
- package/kuasheng-sdk/index.js +80 -0
- package/kuasheng-sdk/lib/assets.js +304 -0
- package/kuasheng-sdk/lib/context.js +199 -0
- package/kuasheng-sdk/lib/layout.js +346 -0
- package/kuasheng-sdk/lib/location.js +46 -0
- package/kuasheng-sdk/lib/media.js +342 -0
- package/kuasheng-sdk/lib/navigation.js +30 -0
- package/kuasheng-sdk/lib/request.js +76 -0
- package/kuasheng-sdk/lib/system.js +190 -0
- package/kuasheng-sdk/lib/userinfo.js +98 -0
- package/kuasheng-sdk/util/check.js +102 -0
- package/kuasheng-sdk/util/config.js +47 -0
- package/kuasheng-sdk/util/device.js +25 -0
- package/kuasheng-sdk/util/error.js +19 -0
- package/kuasheng-sdk/util/funtional.js +153 -0
- package/kuasheng-sdk/util/mixin.js +36 -0
- package/kuasheng-sdk/util/requestUtil.js +41 -0
- package/kuasheng-sdk/util/response.js +33 -0
- package/kuasheng-sdk/util/warn.js +35 -0
- package/kuasheng-ui/CHANGELOG.md +9 -0
- package/kuasheng-ui/components/card.vue +57 -0
- package/kuasheng-ui/components/ks-area-select/README.md +43 -0
- package/kuasheng-ui/components/ks-area-select/area-picker.vue +554 -0
- package/kuasheng-ui/components/ks-area-select/area-search.vue +363 -0
- package/kuasheng-ui/components/ks-area-select/areas-pop.vue +56 -0
- package/kuasheng-ui/components/ks-area-select/common.js +183 -0
- package/kuasheng-ui/components/ks-area-select/index.vue +355 -0
- package/kuasheng-ui/components/ks-area-select/mixins.js +216 -0
- package/kuasheng-ui/components/ks-area-single-select/README.md +50 -0
- package/kuasheng-ui/components/ks-area-single-select/hot-city.js +45 -0
- package/kuasheng-ui/components/ks-area-single-select/index.vue +324 -0
- package/kuasheng-ui/components/ks-calendar/index.vue +269 -0
- package/kuasheng-ui/components/ks-call-phone/call-tips.vue +70 -0
- package/kuasheng-ui/components/ks-call-phone/call.vue +178 -0
- package/kuasheng-ui/components/ks-call-phone/index.js +48 -0
- package/kuasheng-ui/components/ks-call-phone/index.vue +131 -0
- 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 +23 -0
- package/kuasheng-ui/components/ks-date-picker/date-picker-bottom.vue +123 -0
- package/kuasheng-ui/components/ks-date-picker/date-picker-dropdown.vue +80 -0
- package/kuasheng-ui/components/ks-date-picker/date-picker-right.vue +87 -0
- package/kuasheng-ui/components/ks-date-picker/date-picker-top.vue +88 -0
- package/kuasheng-ui/components/ks-date-picker/date-picker.js +15 -0
- package/kuasheng-ui/components/ks-date-picker/date-range-select.vue +92 -0
- package/kuasheng-ui/components/ks-date-picker/date-select.vue +65 -0
- package/kuasheng-ui/components/ks-date-picker/date-week-month.vue +131 -0
- package/kuasheng-ui/components/ks-date-picker/index.js +12 -0
- package/kuasheng-ui/components/ks-date-picker/mixin.js +92 -0
- package/kuasheng-ui/components/ks-date-picker/month-range-select.vue +129 -0
- package/kuasheng-ui/components/ks-date-picker/month-select.vue +85 -0
- package/kuasheng-ui/components/ks-date-picker/quarter-select.vue +94 -0
- package/kuasheng-ui/components/ks-date-picker/style.less +121 -0
- package/kuasheng-ui/components/ks-date-picker/utils.js +109 -0
- package/kuasheng-ui/components/ks-date-picker/week-select.vue +99 -0
- package/kuasheng-ui/components/ks-decrypt/index.vue +159 -0
- package/kuasheng-ui/components/ks-employee/README.md +78 -0
- package/kuasheng-ui/components/ks-employee/employee-input.vue +173 -0
- package/kuasheng-ui/components/ks-employee/employee-list.vue +662 -0
- package/kuasheng-ui/components/ks-employee/employee-popup.vue +197 -0
- package/kuasheng-ui/components/ks-employee/employee-search.vue +250 -0
- package/kuasheng-ui/components/ks-employee/employee-selected.vue +173 -0
- package/kuasheng-ui/components/ks-employee/index.js +17 -0
- package/kuasheng-ui/components/ks-employee/package-lock.json +5 -0
- package/kuasheng-ui/components/ks-employee/package.json +15 -0
- package/kuasheng-ui/components/ks-employee/yarn.lock +4 -0
- package/kuasheng-ui/components/ks-field-money/index.js +8 -0
- package/kuasheng-ui/components/ks-field-money/index.vue +212 -0
- package/kuasheng-ui/components/ks-field-money/package.json +11 -0
- package/kuasheng-ui/components/ks-field-money/utils.js +65 -0
- 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 +131 -0
- package/kuasheng-ui/components/ks-history-search/history-list.vue +188 -0
- package/kuasheng-ui/components/ks-history-search/img/delete.png +0 -0
- package/kuasheng-ui/components/ks-history-search/index.js +9 -0
- package/kuasheng-ui/components/ks-history-search/index.vue +125 -0
- package/kuasheng-ui/components/ks-history-search/package-lock.json +5 -0
- package/kuasheng-ui/components/ks-history-search/package.json +15 -0
- package/kuasheng-ui/components/ks-history-search/utils.js +35 -0
- package/kuasheng-ui/components/ks-input-search/index.vue +106 -0
- package/kuasheng-ui/components/ks-list/index.vue +75 -0
- package/kuasheng-ui/components/ks-loading/index.js +16 -0
- package/kuasheng-ui/components/ks-month/index.vue +47 -0
- package/kuasheng-ui/components/ks-month/package.json +3 -0
- package/kuasheng-ui/components/ks-month/range.vue +172 -0
- package/kuasheng-ui/components/ks-month/single.vue +136 -0
- package/kuasheng-ui/components/ks-month/style.less +125 -0
- package/kuasheng-ui/components/ks-month/utils.js +35 -0
- package/kuasheng-ui/components/ks-nav/index.vue +264 -0
- package/kuasheng-ui/components/ks-nav-bar.js +35 -0
- package/kuasheng-ui/components/ks-org/ks-org-tree.vue +247 -0
- package/kuasheng-ui/components/ks-org/ks-popup-tree.vue +154 -0
- package/kuasheng-ui/components/ks-org/ks-tree-input.vue +240 -0
- package/kuasheng-ui/components/ks-org/ks-tree-node.vue +94 -0
- package/kuasheng-ui/components/ks-org/ks-tree.vue +229 -0
- package/kuasheng-ui/components/ks-org/utils.js +54 -0
- package/kuasheng-ui/components/ks-popover/index.vue +457 -0
- package/kuasheng-ui/components/ks-popover/mixin.js +28 -0
- package/kuasheng-ui/components/ks-popover/utils.js +60 -0
- package/kuasheng-ui/components/ks-pull-refresh/index.vue +43 -0
- package/kuasheng-ui/components/ks-quarter/index.vue +256 -0
- package/kuasheng-ui/components/ks-table/README.md +103 -0
- package/kuasheng-ui/components/ks-table/cell.vue +31 -0
- package/kuasheng-ui/components/ks-table/index.js +8 -0
- package/kuasheng-ui/components/ks-table/index.less +486 -0
- package/kuasheng-ui/components/ks-table/index.vue +1088 -0
- package/kuasheng-ui/components/ks-table/package.json +12 -0
- package/kuasheng-ui/components/ks-table/release.md +7 -0
- package/kuasheng-ui/components/ks-toast.js +35 -0
- package/kuasheng-ui/components/ks-upload/index.vue +174 -0
- package/kuasheng-ui/components/ks-user-access.vue +229 -0
- package/kuasheng-ui/components/no-data/README.md +45 -0
- package/kuasheng-ui/components/no-data/image.js +1 -0
- package/kuasheng-ui/components/no-data/index.vue +83 -0
- package/kuasheng-ui/components/notice-bar.vue +16 -0
- package/kuasheng-ui/components/steps.js +11 -0
- package/kuasheng-ui/components/tabs.vue +40 -0
- package/kuasheng-ui/index.js +239 -0
- package/kuasheng-ui/patch/datetime-picker/datetimePicker.md +0 -0
- package/kuasheng-ui/patch/datetime-picker/index.js +46 -0
- package/kuasheng-ui/patch/datetime-picker/utils.js +78 -0
- package/kuasheng-ui/patch/field/field.md +1 -0
- package/kuasheng-ui/patch/field/index.js +122 -0
- package/kuasheng-ui/patch/field/utils.js +36 -0
- package/kuasheng-ui/patch/form/form.md +7 -0
- package/kuasheng-ui/patch/form/index.js +106 -0
- package/kuasheng-ui/patch/index.js +12 -0
- package/kuasheng-ui/patch/pagination/index.js +78 -0
- package/kuasheng-ui/style/animation-ui.less +31 -0
- 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 +1 -0
- package/kuasheng-ui/style/images/success.svg +1 -0
- package/kuasheng-ui/style/index.less +6 -0
- package/kuasheng-ui/style/kuasheng-ui.less +207 -0
- package/kuasheng-ui/style/reset-vant.less +307 -0
- package/kuasheng-ui/style/vant-var.less +138 -0
- package/kuasheng-ui/utils/apis.js +17 -0
- package/kuasheng-ui/utils/axios-adapter.js +47 -0
- package/kuasheng-ui/utils/bem.js +39 -0
- package/kuasheng-ui/utils/bus.js +97 -0
- package/kuasheng-ui/utils/common.js +88 -0
- package/kuasheng-ui/utils/decrypt/config.js +12 -0
- package/kuasheng-ui/utils/decrypt/decrypt-api.js +139 -0
- package/kuasheng-ui/utils/decrypt/index.js +6 -0
- package/kuasheng-ui/utils/decrypt/mask.js +36 -0
- package/kuasheng-ui/utils/decrypt/virtual.js +44 -0
- package/kuasheng-ui/utils/directive.js +57 -0
- package/kuasheng-ui/utils/directive.md +23 -0
- package/kuasheng-ui/utils/drcheck-plugin.js +219 -0
- package/kuasheng-ui/utils/error-plugin.js +88 -0
- package/kuasheng-ui/utils/filter.js +149 -0
- package/kuasheng-ui/utils/http-interceptors.js +18 -0
- package/kuasheng-ui/utils/http.js +140 -0
- package/kuasheng-ui/utils/index.js +5 -0
- package/kuasheng-ui/utils/init-event.js +20 -0
- package/kuasheng-ui/utils/log.js +309 -0
- package/kuasheng-ui/utils/token.js +9 -0
- package/kuasheng-ui/utils/type.js +45 -0
- package/kuasheng-ui/utils/validate.js +20 -0
- package/kuasheng-ui/utils/watermark.js +67 -0
- package/kuasheng-ui/version.js +1 -0
- package/ky-apm/client.js +37 -0
- package/ky-apm/customHttp.js +38 -0
- package/ky-apm/index.js +68 -0
- package/ky-apm/plugins/performance.js +84 -0
- package/ky-apm/plugins/self-error.js +26 -0
- package/ky-apm/warn-log.js +3 -0
- package/package.json +81 -10
- package/plugin/ks-chii-webpack-html/index.js +53 -0
- package/plugin/ks-chii-webpack-html/package.json +16 -0
- package/postcss.config.js +15 -0
- package/public/capsule-positon.js +50 -0
- package/public/fonts/DingTalkJinBuTi.ttf +0 -0
- package/public/framework/axios@0.19.0.min.js +9 -0
- package/public/framework/fastclick@1.0.6.min.js +1 -0
- package/public/framework/iconfont/iconfont.css +91 -0
- package/public/framework/iconfont/iconfont.js +1 -0
- package/public/framework/iconfont/iconfont.json +142 -0
- 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 +7 -0
- package/public/framework/vue-router@3.1.3.min.js +6 -0
- package/public/framework/vue@2.6.10.runtime.min.js +6 -0
- package/public/framework/vuex@3.1.1.min.js +6 -0
- package/public/index.html +260 -0
- package/public/ks@3.0.8.umd.min.js +1 -0
- package/public/ksui@4.0.27.umd.min.js +10 -0
- package/public/status-bar-preset.js +39 -0
- package/{index.js → qt-npm/index.js} +3 -3
- package/qt-npm/package.json +13 -0
- package/src/App.vue +204 -0
- package/src/README.md +15 -0
- package/src/common/README.md +94 -0
- package/src/common/http/axios-adapter.js +47 -0
- package/src/common/http/common.js +88 -0
- package/src/common/http/http-interceptors.js +18 -0
- package/src/common/http/http-lock.js +45 -0
- package/src/common/http/index.js +163 -0
- package/src/common/http/token.js +9 -0
- package/src/common/styles/font/AlibabaSans102Ver2-Md.ttf +0 -0
- package/src/common/styles/font.less +12 -0
- package/src/common/styles/variables.less +43 -0
- package/src/common/utils/index.js +1 -0
- package/src/common/utils/platform/README.md +1 -0
- package/src/common/utils/platform/android/.gitkeep +0 -0
- package/src/common/utils/platform/core/index.js +24 -0
- package/src/common/utils/platform/index.js +164 -0
- package/src/common/utils/platform/ios/.gitkeep +0 -0
- package/src/common/utils/platform/subscribe/helper.js +38 -0
- package/src/common/utils/platform/subscribe/index.js +204 -0
- package/src/common/utils/platform/subscribe/table-animation.js +75 -0
- package/src/config/index.js +31 -0
- package/src/config.js +1 -0
- package/src/main.js +73 -0
- package/src/router.js +52 -0
- package/src/view/home/config.js +101 -0
- package/src/view/home/demo1.vue +223 -0
- package/src/view/home/demo2.vue +124 -0
- package/src/view/home/demo3.vue +51 -0
- package/src/view/home/demo4.vue +140 -0
- package/src/view/home/index.vue +97 -0
- package/src/view/home/query-table/README.md +45 -0
- package/src/view/home/query-table/api/index.js +12 -0
- package/src/view/home/query-table/assets/horizontal-back.svg +1 -0
- package/src/view/home/query-table/components/pe-table/cell.js +181 -0
- package/src/view/home/query-table/components/pe-table/collapse.js +334 -0
- package/src/view/home/query-table/components/pe-table/empty.vue +48 -0
- package/src/view/home/query-table/components/pe-table/header.js +328 -0
- 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 +1 -0
- package/src/view/home/query-table/components/pe-table/images/sort.svg +1 -0
- package/src/view/home/query-table/components/pe-table/images/sorting.svg +1 -0
- package/src/view/home/query-table/components/pe-table/images/unfold.svg +1 -0
- package/src/view/home/query-table/components/pe-table/index.vue +847 -0
- package/src/view/home/query-table/components/pe-table/load-more.js +46 -0
- package/src/view/home/query-table/components/pe-table/props/index.js +193 -0
- package/src/view/home/query-table/components/pe-table/row.vue +118 -0
- package/src/view/home/query-table/components/pe-table/scrollbar.js +424 -0
- package/src/view/home/query-table/components/pe-table/stretch-damping.js +112 -0
- package/src/view/home/query-table/components/pe-table/style/cell.less +89 -0
- package/src/view/home/query-table/components/pe-table/style/empty.less +48 -0
- package/src/view/home/query-table/components/pe-table/style/header.less +141 -0
- package/src/view/home/query-table/components/pe-table/style/index.less +88 -0
- package/src/view/home/query-table/components/pe-table/style/load-more.less +61 -0
- package/src/view/home/query-table/components/pe-table/style/row.less +6 -0
- package/src/view/home/query-table/components/pe-table/table-loading.vue +120 -0
- package/src/view/home/query-table/components/pe-table/table-total.vue +57 -0
- package/src/view/home/query-table/components/pe-table/utils/animate.js +80 -0
- package/src/view/home/query-table/components/pe-table/utils/columns.js +290 -0
- package/src/view/home/query-table/components/pe-table/utils/data.js +12 -0
- package/src/view/home/query-table/components/pe-table/utils/fixed.js +69 -0
- package/src/view/home/query-table/components/pe-table/utils/formatter.js +327 -0
- package/src/view/home/query-table/components/pe-table/utils/render-cells.js +424 -0
- package/src/view/home/query-table/components/pe-table/utils/slot.js +28 -0
- package/src/view/home/query-table/components/pe-table/utils/tools.js +84 -0
- package/src/view/home/query-table/components/pe-table/utils/touch-scroll.js +417 -0
- package/src/view/home/query-table/components/query-table/index.vue +497 -0
- package/src/view/home/query-table/components/query-table/mixins/column-mixin.js +102 -0
- package/src/view/home/query-table/components/query-table/mixins/column-setting.js +143 -0
- package/src/view/home/query-table/components/query-table/mixins/data-mixin.js +519 -0
- package/src/view/home/query-table/components/query-table/mixins/pagination-mixin.js +26 -0
- package/src/view/home/query-table/components/query-table/mixins/table-fixed.js +130 -0
- package/src/view/home/query-table/components/query-table/mixins/table-horizontal.js +119 -0
- package/src/view/home/query-table/components/table-horizontal.vue +99 -0
- package/src/view/home/query-table/components/table-pagination.vue +32 -0
- package/src/view/home/query-table/components/table-settings/assets/arrpw-up.svg +1 -0
- package/src/view/home/query-table/components/table-settings/assets/disabled-down.svg +1 -0
- package/src/view/home/query-table/components/table-settings/assets/disabled-up.svg +1 -0
- package/src/view/home/query-table/components/table-settings/assets/down.svg +1 -0
- package/src/view/home/query-table/components/table-settings/assets/up.svg +1 -0
- package/src/view/home/query-table/components/table-settings/index.less +294 -0
- package/src/view/home/query-table/components/table-settings/index.vue +260 -0
- package/src/view/home/query-table/components/table-settings/settings.vue +479 -0
- package/src/view/home/query-table/components/table-settings/test.js +626 -0
- 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 +124 -0
- package/src/view/home/query-table/hooks/use-cache-promise.js +27 -0
- package/src/view/home/query-table/hooks/use-column-config.js +190 -0
- package/src/view/home/query-table/hooks/use-encryption.js +0 -0
- package/src/view/home/query-table/hooks/use-generic-search.js +95 -0
- package/src/view/home/query-table/index.js +7 -0
- package/src/view/home/query-table/store/column-store.js +0 -0
- package/src/view/home/query-table/styles/table.less +24 -0
- package/src/view/home/query-table/utils/column.js +36 -0
- package/src/view/home/query-table/utils/config.js +12 -0
- package/src/view/home/query-table/utils/encryption.js +32 -0
- package/src/view/home/query-table/utils/http.js +1 -0
- package/src/view/home/query-table/utils/localStorage.js +35 -0
- package/src/view/home//351/246/226/351/241/265.md +0 -0
- package/src/web.js +99 -0
- package/vue.config.js +131 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// 品牌色
|
|
2
|
+
@red: #FD4948;
|
|
3
|
+
@field-error: #FF706D;
|
|
4
|
+
@orange: #FE743C;
|
|
5
|
+
@orange-light: #FFEDDD;
|
|
6
|
+
@purple: #165DFF;
|
|
7
|
+
@purple-light: #F1F0FF;
|
|
8
|
+
@green: #3CD081;
|
|
9
|
+
@tab-active: #03050D;
|
|
10
|
+
@base-size: 4px;
|
|
11
|
+
@button-disabled-opacity: 0.5;
|
|
12
|
+
|
|
13
|
+
// font
|
|
14
|
+
@font-size-md: 16px;
|
|
15
|
+
|
|
16
|
+
// border
|
|
17
|
+
@border-color: #D9D9D9;
|
|
18
|
+
|
|
19
|
+
// 按钮
|
|
20
|
+
@button-default-height: @base-size * 8;
|
|
21
|
+
@button-default-line-height: @base-size * 8 - 2;
|
|
22
|
+
@button-primary-background-color: @purple;
|
|
23
|
+
@button-primary-border-color: @purple;
|
|
24
|
+
@button-info-background-color: @green;
|
|
25
|
+
@button-info-border-color: @green;
|
|
26
|
+
@button-border-radius: @border-radius-md;
|
|
27
|
+
@button-large-height: @base-size * 10;
|
|
28
|
+
@button-large-line-height: @base-size * 10 - 2;
|
|
29
|
+
@button-small-height: @base-size * 6;
|
|
30
|
+
@button-small-line-height:@base-size * 6 - 2;
|
|
31
|
+
// 导航栏
|
|
32
|
+
@nav-bar-text-color: @purple;
|
|
33
|
+
@nav-bar-icon-color: @purple;
|
|
34
|
+
|
|
35
|
+
// 弹出层
|
|
36
|
+
@popup-round-border-radius: 12px;
|
|
37
|
+
|
|
38
|
+
// cell
|
|
39
|
+
@cell-vertical-padding: 11px;
|
|
40
|
+
@cell-font-size: 14px;
|
|
41
|
+
|
|
42
|
+
// Field
|
|
43
|
+
@field-error-message-color: @field-error;
|
|
44
|
+
@field-input-error-text-color: @field-error;
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
// dialog
|
|
48
|
+
@dialog-border-radius: @border-radius-lg;
|
|
49
|
+
@dialog-confirm-button-text-color: @purple;
|
|
50
|
+
|
|
51
|
+
// 标签页
|
|
52
|
+
@tabs-default-color: @purple;
|
|
53
|
+
@tabs-line-height: @base-size * 11;
|
|
54
|
+
|
|
55
|
+
// 标签栏
|
|
56
|
+
@tabbar-item-active-color: @purple;
|
|
57
|
+
|
|
58
|
+
// 选择器
|
|
59
|
+
@picker-action-text-color: @purple;
|
|
60
|
+
|
|
61
|
+
// tab
|
|
62
|
+
@tab-active-text-color: @tab-active;
|
|
63
|
+
|
|
64
|
+
// TabBar
|
|
65
|
+
@tabbar-height: 60px;
|
|
66
|
+
|
|
67
|
+
// TabBar-item
|
|
68
|
+
@tabbar-item-text-color: #B0B3BF;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// tag
|
|
72
|
+
@tag-border-radius: 4px;
|
|
73
|
+
@tag-primary-color: @purple;
|
|
74
|
+
@tag-dander-color: @red;
|
|
75
|
+
|
|
76
|
+
// stepper
|
|
77
|
+
@stepper-button-icon-color:#6B6E7D;
|
|
78
|
+
@stepper-input-text-color: #03050D;
|
|
79
|
+
|
|
80
|
+
// steps
|
|
81
|
+
@step-finish-line-color: @purple;
|
|
82
|
+
|
|
83
|
+
// checkbox
|
|
84
|
+
@checkbox-checked-icon-color: @purple;
|
|
85
|
+
|
|
86
|
+
// radio
|
|
87
|
+
@radio-checked-icon-color: @purple;
|
|
88
|
+
@radio-size: 18px;
|
|
89
|
+
|
|
90
|
+
// switch
|
|
91
|
+
@switch-on-background-color: @purple;
|
|
92
|
+
|
|
93
|
+
// pagination
|
|
94
|
+
@pagination-item-default-color: @purple;
|
|
95
|
+
@pagination-font-size: 14px;
|
|
96
|
+
@pagination-height: 32px;
|
|
97
|
+
@pagination-item-width: 32px;
|
|
98
|
+
@pagination-item-disabled-color: #D7D7DB;
|
|
99
|
+
@pagination-item-disabled-background-color: #f2f3f8;
|
|
100
|
+
|
|
101
|
+
// progress
|
|
102
|
+
@progress-color: @purple;
|
|
103
|
+
@progress-pivot-background-color: @purple;
|
|
104
|
+
|
|
105
|
+
// sidebar
|
|
106
|
+
@sidebar-selected-border-color: @purple;
|
|
107
|
+
@sidebar-line-height: @base-size * 6;
|
|
108
|
+
@sidebar-padding: @base-size * 3 @padding-sm @base-size * 3 0;
|
|
109
|
+
|
|
110
|
+
// info
|
|
111
|
+
// @info-background-color: @purple;
|
|
112
|
+
// @info-dot-color: @purple;
|
|
113
|
+
|
|
114
|
+
// noticeBar
|
|
115
|
+
@notice-bar-text-color: @purple;
|
|
116
|
+
@notice-bar-background-color: @purple-light;
|
|
117
|
+
@notice-bar-height: 44px;
|
|
118
|
+
|
|
119
|
+
// tree-select
|
|
120
|
+
@tree-select-item-active-color: @purple;
|
|
121
|
+
@tree-select-nav-item-padding: 10px 0px;
|
|
122
|
+
@tree-select-font-size: 14px;
|
|
123
|
+
|
|
124
|
+
// action-sheet
|
|
125
|
+
@action-sheet-max-height: 60%;
|
|
126
|
+
@action-sheet-cancel-padding-top: 6px;
|
|
127
|
+
@action-sheet-item-line-height: 56px;
|
|
128
|
+
@action-sheet-cancel-padding-color: #f3f4f6;
|
|
129
|
+
@action-sheet-item-text-color: #000000;
|
|
130
|
+
|
|
131
|
+
// 日历
|
|
132
|
+
@calendar-range-edge-background-color: @purple;
|
|
133
|
+
@calendar-range-middle-color: @purple;
|
|
134
|
+
|
|
135
|
+
.ks-safe-area-top {
|
|
136
|
+
padding-top: constant(safe-area-inset-top);
|
|
137
|
+
padding-top: env(safe-area-inset-top);
|
|
138
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { http } from './http'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 请求接口获取菜单下按钮(接口)权限
|
|
5
|
+
* @param {array} ids
|
|
6
|
+
*/
|
|
7
|
+
export const getMenuAuth = (ids = []) => {
|
|
8
|
+
return http('auth.menu.resources.userPermissionCode', 10132, {ids})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 请求接口获取数据字典
|
|
13
|
+
* @param {array} codes
|
|
14
|
+
*/
|
|
15
|
+
export const getLookup = (codes = []) => {
|
|
16
|
+
return http('system.lookupValue.BatchByCode', 10124, codes)
|
|
17
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
export default function xhrAdapter(config) {
|
|
4
|
+
const isProd = navigator.userAgent.includes('ks_prod')
|
|
5
|
+
if (config._debug !== false && !isProd) {
|
|
6
|
+
console.log(`[request] ${config.headers.method}`, config)
|
|
7
|
+
}
|
|
8
|
+
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
9
|
+
// 超时定时器
|
|
10
|
+
let timer = setTimeout(() => {
|
|
11
|
+
const error = {message: `timeout of ${config.timeout}ms exceeded`}
|
|
12
|
+
error._config = config
|
|
13
|
+
reject(error)
|
|
14
|
+
}, config.timeout)
|
|
15
|
+
|
|
16
|
+
config.headers['appkey'] = config.headers.appkey && String(config.headers.appkey)
|
|
17
|
+
ks.request(config.headers.method,JSON.parse(config.data), config.headers).then(function(res){
|
|
18
|
+
|
|
19
|
+
// 请求成功清除定时器
|
|
20
|
+
clearTimeout(timer)
|
|
21
|
+
|
|
22
|
+
if (config._debug !== false && !isProd) {
|
|
23
|
+
console.log(`[response] ${config.headers.method}`, res)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let responseData = res
|
|
27
|
+
let response = {
|
|
28
|
+
data: responseData,
|
|
29
|
+
status: 200,
|
|
30
|
+
statusText: 'OK',
|
|
31
|
+
headers: config.headers,
|
|
32
|
+
config: config,
|
|
33
|
+
request: config
|
|
34
|
+
}
|
|
35
|
+
resolve(response)
|
|
36
|
+
}).catch(function(error){
|
|
37
|
+
|
|
38
|
+
clearTimeout(timer)
|
|
39
|
+
|
|
40
|
+
if (config._debug !== false && !isProd) {
|
|
41
|
+
console.log(`[failed] ${config.headers.method}`, error)
|
|
42
|
+
}
|
|
43
|
+
error._config = config
|
|
44
|
+
reject(error)
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const ELEMENT = '__'
|
|
2
|
+
const MODS = '--'
|
|
3
|
+
|
|
4
|
+
function join(name, el, symbol) {
|
|
5
|
+
return el ? name + symbol + el : name
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function prefix(name, mods) {
|
|
9
|
+
if (typeof mods === 'string') {
|
|
10
|
+
return [join(name, mods, MODS)]
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (Array.isArray(mods)) {
|
|
14
|
+
return mods.map(item => prefix(name, item))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const res = []
|
|
18
|
+
if (mods) {
|
|
19
|
+
Object.keys(mods).forEach(key => {
|
|
20
|
+
if(mods[key]){
|
|
21
|
+
res.push(name + MODS + key)
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return res
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function createBEM(name) {
|
|
30
|
+
return function(el, mods) {
|
|
31
|
+
if (el && typeof el !== 'string') {
|
|
32
|
+
mods = el
|
|
33
|
+
el = ''
|
|
34
|
+
}
|
|
35
|
+
el = join(name, el, ELEMENT)
|
|
36
|
+
const bemClass = mods ? [el, ...prefix(el, mods)] : [el]
|
|
37
|
+
return bemClass
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
function Bus () {
|
|
2
|
+
this._events = Object.create(null)
|
|
3
|
+
}
|
|
4
|
+
function toArray (list, start) {
|
|
5
|
+
start = start || 0
|
|
6
|
+
var i = list.length - start
|
|
7
|
+
var ret = new Array(i)
|
|
8
|
+
while (i--) {
|
|
9
|
+
ret[i] = list[i + start]
|
|
10
|
+
}
|
|
11
|
+
return ret
|
|
12
|
+
}
|
|
13
|
+
let hookRE = /^hook:/
|
|
14
|
+
Bus.prototype.$on = function (event, fn) {
|
|
15
|
+
var vm = this
|
|
16
|
+
if (Array.isArray(event)) {
|
|
17
|
+
for (var i = 0, l = event.length; i < l; i++) {
|
|
18
|
+
vm.$on(event[i], fn)
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
(vm._events[event] || (vm._events[event] = [])).push(fn)
|
|
22
|
+
// optimize hook:event cost by using a boolean flag marked at registration
|
|
23
|
+
// instead of a hash lookup
|
|
24
|
+
if (hookRE.test(event)) {
|
|
25
|
+
vm._hasHookEvent = true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return vm
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Bus.prototype.$once = function (event, fn) {
|
|
32
|
+
var vm = this
|
|
33
|
+
function on () {
|
|
34
|
+
vm.$off(event, on)
|
|
35
|
+
fn.apply(vm, arguments)
|
|
36
|
+
}
|
|
37
|
+
on.fn = fn
|
|
38
|
+
vm.$on(event, on)
|
|
39
|
+
return vm
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
Bus.prototype.$off = function (event, fn) {
|
|
43
|
+
var vm = this
|
|
44
|
+
// all
|
|
45
|
+
if (!arguments.length) {
|
|
46
|
+
vm._events = Object.create(null)
|
|
47
|
+
return vm
|
|
48
|
+
}
|
|
49
|
+
// array of events
|
|
50
|
+
if (Array.isArray(event)) {
|
|
51
|
+
for (var i = 0, l = event.length; i < l; i++) {
|
|
52
|
+
vm.$off(event[i], fn)
|
|
53
|
+
}
|
|
54
|
+
return vm
|
|
55
|
+
}
|
|
56
|
+
// specific event
|
|
57
|
+
var cbs = vm._events[event]
|
|
58
|
+
if (!cbs) {
|
|
59
|
+
return vm
|
|
60
|
+
}
|
|
61
|
+
if (!fn) {
|
|
62
|
+
vm._events[event] = null
|
|
63
|
+
return vm
|
|
64
|
+
}
|
|
65
|
+
if (fn) {
|
|
66
|
+
// specific handler
|
|
67
|
+
var cb
|
|
68
|
+
var i$1 = cbs.length
|
|
69
|
+
while (i$1--) {
|
|
70
|
+
cb = cbs[i$1]
|
|
71
|
+
if (cb === fn || cb.fn === fn) {
|
|
72
|
+
cbs.splice(i$1, 1)
|
|
73
|
+
break
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return vm
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
Bus.prototype.$emit = function (event) {
|
|
81
|
+
var vm = this
|
|
82
|
+
var cbs = vm._events[event]
|
|
83
|
+
if (cbs) {
|
|
84
|
+
cbs = cbs.length > 1 ? toArray(cbs) : cbs
|
|
85
|
+
var args = toArray(arguments, 1)
|
|
86
|
+
for (var i = 0, l = cbs.length; i < l; i++) {
|
|
87
|
+
try {
|
|
88
|
+
cbs[i].apply(vm, args)
|
|
89
|
+
} catch (e) {
|
|
90
|
+
console.error(e, vm, ('event handler for "' + event + '"'))
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return vm
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export default new Bus()
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import md5 from "js-md5"
|
|
2
|
+
|
|
3
|
+
const ENV_TYPES = {
|
|
4
|
+
prd: 'ks_prod',
|
|
5
|
+
uat: 'ks_uat',
|
|
6
|
+
stg: 'ks_stg',
|
|
7
|
+
dev: 'ks_dev'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const KS_URL_CONFIG = {
|
|
11
|
+
[ENV_TYPES.prd]: 'https://api.ycfm-erp.com',
|
|
12
|
+
[ENV_TYPES.uat]: 'http://api-uat.baoguozs.com',
|
|
13
|
+
[ENV_TYPES.stg]: 'http://api-stg.kyeapi.com',
|
|
14
|
+
[ENV_TYPES.dev]: 'http://api-dev.baoguozs.com'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const random = (count) => {
|
|
18
|
+
let num = Date.now() + Math.floor(1000 * Math.random() + 1000)
|
|
19
|
+
if (count) {
|
|
20
|
+
return num.toString().substr(-count)
|
|
21
|
+
}
|
|
22
|
+
return num.toString()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const md5Http = (token, timestamp, body) => {
|
|
26
|
+
return md5(md5(token).toUpperCase() + timestamp + JSON.stringify(body || {})).toUpperCase()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const getXWebTraceId = (userId, menuId, now) => {
|
|
30
|
+
let log = window.ksui && window.ksui.log
|
|
31
|
+
let startTime = log && log.initTime || now
|
|
32
|
+
return `${userId}-${menuId || 'xxxx'}-${startTime}-${log && log.lastActionId || ''}-${random(4)}`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 判断是否在环境
|
|
36
|
+
export const isKSClient = () => {
|
|
37
|
+
return navigator.userAgent.toLowerCase().indexOf('kuasheng-2.0') >= 0
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 获取当前环境
|
|
41
|
+
export const getKsEnv = () => {
|
|
42
|
+
return Object.keys(ENV_TYPES).find(type =>
|
|
43
|
+
navigator.userAgent.includes(ENV_TYPES[type])
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 获取当前环境对应的请求域名
|
|
48
|
+
export const getKsEnvUrl = () => {
|
|
49
|
+
const envType = getKsEnv()
|
|
50
|
+
const url = envType ? KS_URL_CONFIG[ENV_TYPES[envType]] : null
|
|
51
|
+
console.info(`当前轻应用走的是 XHR 请求,代理地址为${url}`)
|
|
52
|
+
return url
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const getValue = (key, obj, getSourceOfKey) => {
|
|
56
|
+
if (!key) {
|
|
57
|
+
return ''
|
|
58
|
+
}
|
|
59
|
+
let source = null
|
|
60
|
+
// 解析键的属性和数组索引
|
|
61
|
+
const parseKey = (k) => {
|
|
62
|
+
const index = k.indexOf('[')
|
|
63
|
+
return {
|
|
64
|
+
prop: index > 0 ? k.substr(0, index) : k,
|
|
65
|
+
arrayIndex: index > 0 ? +k.substring(index + 1, k.length - 1) : undefined,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 处理每个键的情况
|
|
70
|
+
const handleKey = (s, k, isLast) => {
|
|
71
|
+
const { prop, arrayIndex } = parseKey(k)
|
|
72
|
+
const value = s[prop]
|
|
73
|
+
source = s
|
|
74
|
+
if (isLast) {
|
|
75
|
+
return arrayIndex !== undefined ? (value || [])[arrayIndex] : value
|
|
76
|
+
}
|
|
77
|
+
return arrayIndex !== undefined ? (value || [])[arrayIndex] || {} : value || {}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (key.includes('.')) {
|
|
81
|
+
const keys = key.split('.')
|
|
82
|
+
const value = keys.reduce((s, k, i) => handleKey(s, k, i === keys.length - 1), obj)
|
|
83
|
+
return getSourceOfKey ? { source, value } : value
|
|
84
|
+
} else {
|
|
85
|
+
const value = handleKey(obj, key, true)
|
|
86
|
+
return getSourceOfKey ? { source, value } : value
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const sysAppKey = '10124'
|
|
2
|
+
const virtualAppKey = '55041'
|
|
3
|
+
|
|
4
|
+
export const DECRYPT_CONFIG = {
|
|
5
|
+
maskTips: '如非必要请勿查看,此操作会联动风控系统监控!',
|
|
6
|
+
maskTitle: '温馨提示',
|
|
7
|
+
maskDecryptUrl: 'syslog.sensitiveFieldViewLog.save',
|
|
8
|
+
maskAppKey: sysAppKey,
|
|
9
|
+
// 虚拟
|
|
10
|
+
virtualDecryptUrl: 'basevirtual.virtualPhone.getVirtualNumber',
|
|
11
|
+
virtualAppKey,
|
|
12
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { isString } from '../type'
|
|
2
|
+
import { getValue } from '../common'
|
|
3
|
+
import { decryptMask } from './mask'
|
|
4
|
+
import { decryptVirtual } from './virtual'
|
|
5
|
+
|
|
6
|
+
const getMaskVal = (data = {}, key) => getValue(key, data)
|
|
7
|
+
const getMaskSecVal = (data = {}, key) => getValue(key, data)
|
|
8
|
+
const getVirtualVal = (data = {}, key) => getValue(key, data)
|
|
9
|
+
const matchEncrypteSymbol = (t, encrypteSymbol) => t.includes(encrypteSymbol)
|
|
10
|
+
|
|
11
|
+
export class DecryptApi {
|
|
12
|
+
constructor() {
|
|
13
|
+
/**
|
|
14
|
+
* @overview 加密配置
|
|
15
|
+
*/
|
|
16
|
+
this.config = {
|
|
17
|
+
ENCRYPTE_MASK_SYMBOL: '*',
|
|
18
|
+
ENCRYPTE_MASKSEC_SYMBOL: '✽',
|
|
19
|
+
MASK_KEY: 'Mask',
|
|
20
|
+
VIRTUAL_KEY: 'Virtual',
|
|
21
|
+
MASKSEC_KEY: 'MaskSec'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @overview 获取不同加密类型key
|
|
27
|
+
* @param {key} 数据key名称
|
|
28
|
+
*/
|
|
29
|
+
getMaskKey(key) {
|
|
30
|
+
const { MASK_KEY } = this.config
|
|
31
|
+
return `${key}${MASK_KEY}`
|
|
32
|
+
}
|
|
33
|
+
getVirtualkey(key) {
|
|
34
|
+
const { VIRTUAL_KEY } = this.config
|
|
35
|
+
return `${key}${VIRTUAL_KEY}`
|
|
36
|
+
}
|
|
37
|
+
getMaskSeckey(key) {
|
|
38
|
+
const { MASKSEC_KEY } = this.config
|
|
39
|
+
return `${key}${MASKSEC_KEY}`
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
isEncryptedByString(d = {}, key) {
|
|
43
|
+
const val = isString(d) ? d : getValue(key, d)
|
|
44
|
+
if (!val) return
|
|
45
|
+
const { ENCRYPTE_MASK_SYMBOL, ENCRYPTE_MASKSEC_SYMBOL } = this.config
|
|
46
|
+
return !!matchEncrypteSymbol(val, ENCRYPTE_MASK_SYMBOL) || matchEncrypteSymbol(val, ENCRYPTE_MASKSEC_SYMBOL)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @overview 是否加密类型
|
|
51
|
+
* @param {d} 数据对象
|
|
52
|
+
* @param {key} 数据key名称
|
|
53
|
+
*/
|
|
54
|
+
isEncrypted(d, key) {
|
|
55
|
+
if (d && isString(d)) {
|
|
56
|
+
return this.isEncryptedByString(d)
|
|
57
|
+
} else {
|
|
58
|
+
return !!this.getEncrypteText(d, key)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @overview 获取密文
|
|
64
|
+
* @param {d} 数据对象
|
|
65
|
+
* @param {key} 数据key名称
|
|
66
|
+
*/
|
|
67
|
+
getEncrypteText(d, key) {
|
|
68
|
+
return this.getMaskVal(d, key) || this.getVirtualVal(d, key) || this.getMaskSecVal(d, key)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @overview 判断是否加密字段
|
|
73
|
+
* @param {d} 数据对象
|
|
74
|
+
* @param {key} 数据key名称
|
|
75
|
+
*/
|
|
76
|
+
isMask(d, key) {
|
|
77
|
+
return !!this.getMaskVal(d, key)
|
|
78
|
+
}
|
|
79
|
+
getMaskVal(d, key) {
|
|
80
|
+
return getMaskVal(d, this.getMaskKey(key))
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @overview 判断是否虚拟号
|
|
85
|
+
* @param {d} 数据对象
|
|
86
|
+
* @param {key} 数据key名称
|
|
87
|
+
*/
|
|
88
|
+
isVirtual(d, key) {
|
|
89
|
+
return !!this.getVirtualVal(d, key)
|
|
90
|
+
}
|
|
91
|
+
getVirtualVal(d, key) {
|
|
92
|
+
return getVirtualVal(d, this.getVirtualkey(key))
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @overview 判断是否敏感字段
|
|
97
|
+
* @param {d} 数据对象
|
|
98
|
+
* @param {key} 数据key名称
|
|
99
|
+
*/
|
|
100
|
+
isMaskSec(d, key) {
|
|
101
|
+
return !!this.getMaskSecVal(d, key)
|
|
102
|
+
}
|
|
103
|
+
getMaskSecVal(d, key) {
|
|
104
|
+
return getMaskSecVal(d, this.getMaskSeckey(key))
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @overview 解密方法
|
|
109
|
+
* @returnType {Promise}
|
|
110
|
+
* @param {type} 解密类型 ['mask', 'virtual']
|
|
111
|
+
* @param {params} 加密对象
|
|
112
|
+
* @property {params.fieldName} 字段名(必填)
|
|
113
|
+
* @property {params.fieldContent} 字段内容,加密值(必填)
|
|
114
|
+
* @property {params.dataId} 唯一值,通常用的数据id(必填)
|
|
115
|
+
* @property {params.buttonName} 按钮名称(必填)
|
|
116
|
+
* @property {params.fieldNameStr} 字段中文名,类似from表单的label
|
|
117
|
+
*/
|
|
118
|
+
async decrypt(params, type, options) {
|
|
119
|
+
if(!params) return
|
|
120
|
+
const maskKey = this.config.MASK_KEY.toLowerCase()
|
|
121
|
+
const virtualKey = this.config.VIRTUAL_KEY.toLowerCase()
|
|
122
|
+
// 加密字段
|
|
123
|
+
if (!type || type === maskKey) {
|
|
124
|
+
return decryptMask(params, options)
|
|
125
|
+
// 虚拟字段
|
|
126
|
+
} else if (type === virtualKey) {
|
|
127
|
+
return decryptVirtual(params, options)
|
|
128
|
+
}
|
|
129
|
+
return ''
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @overview 批量解密
|
|
134
|
+
*/
|
|
135
|
+
batchDecrypt() {
|
|
136
|
+
console.log('批量解密')
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { http } from '../http'
|
|
2
|
+
import { DECRYPT_CONFIG } from './config'
|
|
3
|
+
|
|
4
|
+
export async function decryptMask(params = {}, options = {}) {
|
|
5
|
+
try {
|
|
6
|
+
if (options.showTips !== false) {
|
|
7
|
+
await vant.Dialog.confirm({
|
|
8
|
+
title: options.maskTitle || DECRYPT_CONFIG.maskTitle,
|
|
9
|
+
message: options.maskTips || DECRYPT_CONFIG.maskTips
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
const {
|
|
13
|
+
dataId = crypto && crypto.randomUUID(),
|
|
14
|
+
moduleCode,
|
|
15
|
+
fieldName,
|
|
16
|
+
fieldContent,
|
|
17
|
+
} = params
|
|
18
|
+
|
|
19
|
+
const _params = {
|
|
20
|
+
dataId: dataId,
|
|
21
|
+
moduleCode,
|
|
22
|
+
fieldName,
|
|
23
|
+
fieldContent,
|
|
24
|
+
fieldNameStr: params.fieldNameStr || '',
|
|
25
|
+
buttonName: params.buttonName || ''
|
|
26
|
+
}
|
|
27
|
+
return http(
|
|
28
|
+
DECRYPT_CONFIG.maskDecryptUrl,
|
|
29
|
+
DECRYPT_CONFIG.maskAppKey,
|
|
30
|
+
_params
|
|
31
|
+
)
|
|
32
|
+
} catch (err) {
|
|
33
|
+
console.log(err)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { http } from '../http'
|
|
2
|
+
import { DECRYPT_CONFIG } from './config'
|
|
3
|
+
|
|
4
|
+
export async function decryptVirtual(params = {}) {
|
|
5
|
+
try {
|
|
6
|
+
const user = params.userInfo || {}
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
dataId = crypto && crypto.randomUUID(),
|
|
10
|
+
moduleCode,
|
|
11
|
+
fieldName,
|
|
12
|
+
fieldContent,
|
|
13
|
+
calloutPhone,
|
|
14
|
+
business='SYS'
|
|
15
|
+
} = params
|
|
16
|
+
|
|
17
|
+
const _params = {
|
|
18
|
+
dataId,
|
|
19
|
+
moduleCode,
|
|
20
|
+
fieldName,
|
|
21
|
+
fieldContent,
|
|
22
|
+
fieldNameStr: params.fieldNameStr || '',
|
|
23
|
+
buttonName: params.buttonName || '',
|
|
24
|
+
source: '10', // 内部app标识
|
|
25
|
+
company: 'kye-xkj',
|
|
26
|
+
proposerId: user.id,
|
|
27
|
+
proposer: user.name,
|
|
28
|
+
position: user.duty,
|
|
29
|
+
departmentId: user.departmentId,
|
|
30
|
+
department: user.departmentInfo ? user.departmentInfo.departmentRoute : user.department,
|
|
31
|
+
calloutPhone,
|
|
32
|
+
business
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return http(
|
|
36
|
+
DECRYPT_CONFIG.virtualDecryptUrl,
|
|
37
|
+
DECRYPT_CONFIG.virtualAppKey,
|
|
38
|
+
_params
|
|
39
|
+
)
|
|
40
|
+
} catch (err) {
|
|
41
|
+
console.log(err)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|