@king-one/antdv 1.1.9 → 1.1.11
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/CHANGELOG.md +12 -0
- package/dist/es/components/collapse-transtion/hooks/use-collapse-transtion.mjs +108 -41
- package/dist/es/components/collapse-transtion/index.mjs +7 -7
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue.mjs +2 -2
- package/dist/es/components/collapse-transtion/src/collapse-transtion.vue2.mjs +24 -19
- package/dist/es/components/collapse-transtion/src/types.mjs +3 -3
- package/dist/es/components/cover-scroll-bar/hooks/use-has-scroll.mjs +25 -12
- package/dist/es/components/cover-scroll-bar/index.mjs +7 -7
- package/dist/es/components/cover-scroll-bar/src/cover-scroll-bar.mjs +198 -123
- package/dist/es/components/cover-scroll-bar/src/types.mjs +2 -2
- package/dist/es/components/form/component/form-item.vue.mjs +2 -2
- package/dist/es/components/form/component/form-item.vue2.mjs +58 -51
- package/dist/es/components/form/component/form.mjs +5 -4
- package/dist/es/components/form/component/form.vue.mjs +2 -2
- package/dist/es/components/form/component/form.vue2.mjs +21 -18
- package/dist/es/components/form/content/form-content.mjs +9 -9
- package/dist/es/components/form/index.mjs +11 -10
- package/dist/es/components/icon/index.mjs +5 -5
- package/dist/es/components/icon/src/icon.vue.mjs +2 -2
- package/dist/es/components/icon/src/icon.vue2.mjs +31 -21
- package/dist/es/components/icon/src/types.mjs +3 -3
- package/dist/es/components/index.mjs +35 -35
- package/dist/es/components/plus-upload/apis/plus-upload.api.mjs +8 -8
- package/dist/es/components/plus-upload/hook/useExtractPlusUpload.mjs +37 -28
- package/dist/es/components/plus-upload/hook/usePlusUpload.mjs +29 -18
- package/dist/es/components/plus-upload/images/pdf-icon.png.mjs +2 -2
- package/dist/es/components/plus-upload/images/word-icon.png.mjs +2 -2
- package/dist/es/components/plus-upload/images/xls-icon.png.mjs +2 -2
- package/dist/es/components/plus-upload/index.mjs +5 -5
- package/dist/es/components/plus-upload/src/plus-upload.vue.mjs +2 -2
- package/dist/es/components/plus-upload/src/plus-upload.vue2.mjs +180 -139
- package/dist/es/components/plus-upload/src/types.mjs +22 -10
- package/dist/es/components/pro-area/apis/pro-area.api.mjs +3 -3
- package/dist/es/components/pro-area/hooks/use-pro-area.mjs +9 -8
- package/dist/es/components/pro-area/index.mjs +9 -9
- package/dist/es/components/pro-area/src/ProArea.vue.mjs +2 -2
- package/dist/es/components/pro-area/src/ProArea.vue2.mjs +116 -82
- package/dist/es/components/pro-area/src/types.mjs +4 -3
- package/dist/es/components/pro-contract-view/apis/pro-contract-view.api.mjs +7 -7
- package/dist/es/components/pro-contract-view/hooks/use-contract-view.mjs +28 -22
- package/dist/es/components/pro-contract-view/index.mjs +7 -7
- package/dist/es/components/pro-contract-view/src/pro-contract-view.vue.mjs +2 -2
- package/dist/es/components/pro-contract-view/src/pro-contract-view.vue2.mjs +127 -103
- package/dist/es/components/pro-contract-view/src/types.mjs +6 -6
- package/dist/es/components/pro-loading/index.mjs +2 -2
- package/dist/es/components/pro-loading/src/pro-loading.mjs +48 -32
- package/dist/es/components/pro-modal/hooks/useProModal.mjs +38 -25
- package/dist/es/components/pro-modal/index.mjs +8 -8
- package/dist/es/components/pro-modal/src/ProModal.vue.mjs +2 -2
- package/dist/es/components/pro-modal/src/ProModal.vue2.mjs +111 -79
- package/dist/es/components/pro-modal/src/types.mjs +4 -4
- package/dist/es/components/pro-overlay/index.mjs +5 -5
- package/dist/es/components/pro-overlay/src/pro-overlay.vue.mjs +2 -2
- package/dist/es/components/pro-overlay/src/pro-overlay.vue2.mjs +36 -29
- package/dist/es/components/pro-picker/apis/pro-picker.api.mjs +6 -6
- package/dist/es/components/pro-picker/index.mjs +8 -8
- package/dist/es/components/pro-picker/src/ProPicker.vue.mjs +2 -2
- package/dist/es/components/pro-picker/src/ProPicker.vue2.mjs +90 -74
- package/dist/es/components/pro-picker/src/types.mjs +10 -4
- package/dist/es/components/pro-signature/index.mjs +7 -7
- package/dist/es/components/pro-signature/src/ProSignature.vue.mjs +2 -2
- package/dist/es/components/pro-signature/src/ProSignature.vue2.mjs +216 -103
- package/dist/es/components/pro-signature/src/types.mjs +4 -4
- package/dist/es/components/pro-table/hooks/use-pro-table.mjs +9 -8
- package/dist/es/components/pro-table/index.mjs +7 -7
- package/dist/es/components/pro-table/src/constants.mjs +8 -6
- package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue2.mjs +22 -17
- package/dist/es/components/pro-table/src/field/field-input/field-input.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-input/field-input.vue2.mjs +22 -17
- package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue2.mjs +50 -43
- package/dist/es/components/pro-table/src/field/field-select/field-select.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field-select/field-select.vue2.mjs +50 -43
- package/dist/es/components/pro-table/src/field/field.css +3 -1
- package/dist/es/components/pro-table/src/field/field.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/field/field.vue2.mjs +127 -102
- package/dist/es/components/pro-table/src/form-render.css +3 -1
- package/dist/es/components/pro-table/src/form-render.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/form-render.vue2.mjs +148 -127
- package/dist/es/components/pro-table/src/hooks/use-form.mjs +20 -17
- package/dist/es/components/pro-table/src/hooks/use-table.mjs +47 -29
- package/dist/es/components/pro-table/src/pro-table.vue.mjs +2 -2
- package/dist/es/components/pro-table/src/pro-table.vue2.mjs +170 -155
- package/dist/es/components/pro-table/utils.mjs +10 -10
- package/dist/es/components/pro-tag/index.mjs +7 -7
- package/dist/es/components/pro-tag/src/ProTag.vue.mjs +2 -2
- package/dist/es/components/pro-tag/src/ProTag.vue2.mjs +28 -19
- package/dist/es/components/pro-tag/src/types.mjs +4 -3
- package/dist/es/components/pro-title/index.mjs +7 -7
- package/dist/es/components/pro-title/src/ProTitle.vue.mjs +2 -2
- package/dist/es/components/pro-title/src/ProTitle.vue2.mjs +47 -36
- package/dist/es/components/pro-title/src/types.mjs +4 -4
- package/dist/es/components/pro-upload/index.mjs +7 -7
- package/dist/es/components/pro-upload/src/assets/images/audio-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/materials-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/pdf-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/ppt-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/video-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/word-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/xls-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/assets/images/zip-icon.png.mjs +2 -2
- package/dist/es/components/pro-upload/src/data.mjs +18 -18
- package/dist/es/components/pro-upload/src/file-list.mjs +70 -55
- package/dist/es/components/pro-upload/src/gd-upload.mjs +163 -132
- package/dist/es/components/pro-upload/src/hooks/index.mjs +4 -4
- package/dist/es/components/pro-upload/src/hooks/useHttp.mjs +8 -8
- package/dist/es/components/pro-upload/src/hooks/useUpload.mjs +66 -36
- package/dist/es/components/pro-upload/src/props.mjs +6 -6
- package/dist/es/components/pro-upload/src/utils/index.mjs +38 -25
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue.mjs +2 -2
- package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +83 -69
- package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +176 -125
- package/dist/es/components/scale-virtual-list/index.mjs +5 -5
- package/dist/es/components/scroll-bar/index.mjs +7 -7
- package/dist/es/components/scroll-bar/src/scroll-bar.mjs +390 -240
- package/dist/es/components/scroll-bar/src/types.mjs +2 -2
- package/dist/es/components/utils/install.mjs +16 -14
- package/dist/es/hooks/index.mjs +3 -3
- package/dist/es/hooks/use-namespace/index.mjs +72 -41
- package/dist/es/hooks/useProForm.mjs +42 -27
- package/dist/es/index.mjs +73 -73
- package/dist/es/installer.mjs +8 -8
- package/dist/lib/components/base/style/index.js +2 -1
- package/dist/lib/components/collapse-transtion/hooks/use-collapse-transtion.js +134 -1
- package/dist/lib/components/collapse-transtion/index.js +11 -1
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue.js +4 -1
- package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue2.js +29 -1
- package/dist/lib/components/collapse-transtion/src/types.js +9 -1
- package/dist/lib/components/collapse-transtion/style/index.js +3 -1
- package/dist/lib/components/cover-scroll-bar/hooks/use-has-scroll.js +30 -1
- package/dist/lib/components/cover-scroll-bar/index.js +10 -1
- package/dist/lib/components/cover-scroll-bar/src/cover-scroll-bar.js +221 -1
- package/dist/lib/components/cover-scroll-bar/src/types.js +17 -1
- package/dist/lib/components/cover-scroll-bar/style/index.js +3 -1
- package/dist/lib/components/form/component/form-item.vue.js +4 -1
- package/dist/lib/components/form/component/form-item.vue2.js +63 -1
- package/dist/lib/components/form/component/form.js +14 -1
- package/dist/lib/components/form/component/form.vue.js +4 -1
- package/dist/lib/components/form/component/form.vue2.js +26 -1
- package/dist/lib/components/form/content/form-content.js +13 -1
- package/dist/lib/components/form/index.js +15 -1
- package/dist/lib/components/icon/index.js +9 -1
- package/dist/lib/components/icon/src/icon.vue.js +4 -1
- package/dist/lib/components/icon/src/icon.vue2.js +36 -1
- package/dist/lib/components/icon/src/types.js +17 -1
- package/dist/lib/components/icon/style/index.js +3 -1
- package/dist/lib/components/index.js +38 -1
- package/dist/lib/components/plus-upload/apis/plus-upload.api.js +21 -1
- package/dist/lib/components/plus-upload/hook/useExtractPlusUpload.js +64 -1
- package/dist/lib/components/plus-upload/hook/usePlusUpload.js +34 -1
- package/dist/lib/components/plus-upload/images/pdf-icon.png.js +4 -1
- package/dist/lib/components/plus-upload/images/word-icon.png.js +4 -1
- package/dist/lib/components/plus-upload/images/xls-icon.png.js +4 -1
- package/dist/lib/components/plus-upload/index.js +9 -1
- package/dist/lib/components/plus-upload/src/plus-upload.vue.js +4 -1
- package/dist/lib/components/plus-upload/src/plus-upload.vue2.js +199 -1
- package/dist/lib/components/plus-upload/src/types.js +37 -1
- package/dist/lib/components/plus-upload/style/index.js +3 -1
- package/dist/lib/components/pro-area/apis/pro-area.api.js +6 -1
- package/dist/lib/components/pro-area/hooks/use-pro-area.js +12 -1
- package/dist/lib/components/pro-area/index.js +13 -1
- package/dist/lib/components/pro-area/src/ProArea.vue.js +4 -1
- package/dist/lib/components/pro-area/src/ProArea.vue2.js +135 -1
- package/dist/lib/components/pro-area/src/types.js +22 -1
- package/dist/lib/components/pro-area/style/index.js +3 -1
- package/dist/lib/components/pro-contract-view/apis/pro-contract-view.api.js +10 -1
- package/dist/lib/components/pro-contract-view/hooks/use-contract-view.js +45 -1
- package/dist/lib/components/pro-contract-view/index.js +11 -1
- package/dist/lib/components/pro-contract-view/src/pro-contract-view.vue.js +4 -1
- package/dist/lib/components/pro-contract-view/src/pro-contract-view.vue2.js +152 -1
- package/dist/lib/components/pro-contract-view/src/types.js +24 -1
- package/dist/lib/components/pro-contract-view/style/index.js +3 -1
- package/dist/lib/components/pro-loading/index.js +5 -1
- package/dist/lib/components/pro-loading/src/pro-loading.js +75 -1
- package/dist/lib/components/pro-modal/hooks/useProModal.js +47 -1
- package/dist/lib/components/pro-modal/index.js +12 -1
- package/dist/lib/components/pro-modal/src/ProModal.vue.js +4 -1
- package/dist/lib/components/pro-modal/src/ProModal.vue2.js +122 -1
- package/dist/lib/components/pro-modal/src/types.js +16 -1
- package/dist/lib/components/pro-modal/style/index.js +3 -1
- package/dist/lib/components/pro-overlay/index.js +9 -1
- package/dist/lib/components/pro-overlay/src/pro-overlay.vue.js +4 -1
- package/dist/lib/components/pro-overlay/src/pro-overlay.vue2.js +41 -1
- package/dist/lib/components/pro-overlay/style/index.js +3 -1
- package/dist/lib/components/pro-picker/apis/pro-picker.api.js +9 -1
- package/dist/lib/components/pro-picker/index.js +11 -1
- package/dist/lib/components/pro-picker/src/ProPicker.vue.js +4 -1
- package/dist/lib/components/pro-picker/src/ProPicker.vue2.js +106 -1
- package/dist/lib/components/pro-picker/src/types.js +28 -1
- package/dist/lib/components/pro-signature/index.js +10 -1
- package/dist/lib/components/pro-signature/src/ProSignature.vue.js +4 -1
- package/dist/lib/components/pro-signature/src/ProSignature.vue2.js +258 -1
- package/dist/lib/components/pro-signature/src/types.js +40 -1
- package/dist/lib/components/pro-table/hooks/use-pro-table.js +12 -1
- package/dist/lib/components/pro-table/index.js +12 -1
- package/dist/lib/components/pro-table/src/constants.js +25 -1
- package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue2.js +31 -1
- package/dist/lib/components/pro-table/src/field/field-input/field-input.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-input/field-input.vue2.js +31 -1
- package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue2.js +59 -1
- package/dist/lib/components/pro-table/src/field/field-select/field-select.vue.js +4 -1
- package/dist/lib/components/pro-table/src/field/field-select/field-select.vue2.js +59 -1
- package/dist/lib/components/pro-table/src/field/field.css +3 -1
- package/dist/lib/components/pro-table/src/field/field.vue.js +5 -1
- package/dist/lib/components/pro-table/src/field/field.vue2.js +149 -1
- package/dist/lib/components/pro-table/src/form-render.css +3 -1
- package/dist/lib/components/pro-table/src/form-render.vue.js +5 -1
- package/dist/lib/components/pro-table/src/form-render.vue2.js +166 -1
- package/dist/lib/components/pro-table/src/hooks/use-form.js +25 -1
- package/dist/lib/components/pro-table/src/hooks/use-table.js +57 -1
- package/dist/lib/components/pro-table/src/pro-table.vue.js +4 -1
- package/dist/lib/components/pro-table/src/pro-table.vue2.js +203 -1
- package/dist/lib/components/pro-table/style/index.js +3 -1
- package/dist/lib/components/pro-table/utils.js +15 -1
- package/dist/lib/components/pro-tag/index.js +10 -1
- package/dist/lib/components/pro-tag/src/ProTag.vue.js +4 -1
- package/dist/lib/components/pro-tag/src/ProTag.vue2.js +46 -1
- package/dist/lib/components/pro-tag/src/types.js +10 -1
- package/dist/lib/components/pro-title/index.js +11 -1
- package/dist/lib/components/pro-title/src/ProTitle.vue.js +4 -1
- package/dist/lib/components/pro-title/src/ProTitle.vue2.js +52 -1
- package/dist/lib/components/pro-title/src/types.js +21 -1
- package/dist/lib/components/pro-title/style/index.js +3 -1
- package/dist/lib/components/pro-upload/index.js +11 -1
- package/dist/lib/components/pro-upload/src/assets/images/audio-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/materials-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/pdf-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/ppt-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/video-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/word-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/xls-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/assets/images/zip-icon.png.js +4 -1
- package/dist/lib/components/pro-upload/src/data.js +49 -1
- package/dist/lib/components/pro-upload/src/file-list.js +160 -1
- package/dist/lib/components/pro-upload/src/gd-upload.js +211 -1
- package/dist/lib/components/pro-upload/src/hooks/index.js +6 -1
- package/dist/lib/components/pro-upload/src/hooks/useHttp.js +23 -1
- package/dist/lib/components/pro-upload/src/hooks/useUpload.js +85 -1
- package/dist/lib/components/pro-upload/src/props.js +50 -1
- package/dist/lib/components/pro-upload/src/utils/index.js +46 -1
- package/dist/lib/components/pro-upload/style/index.js +3 -1
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue.js +4 -1
- package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +93 -1
- package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +220 -1
- package/dist/lib/components/scale-virtual-list/index.js +10 -1
- package/dist/lib/components/scale-virtual-list/style/index.js +3 -1
- package/dist/lib/components/scroll-bar/index.js +10 -1
- package/dist/lib/components/scroll-bar/src/scroll-bar.js +424 -1
- package/dist/lib/components/scroll-bar/src/types.js +13 -1
- package/dist/lib/components/scroll-bar/style/index.js +3 -1
- package/dist/lib/components/utils/install.js +23 -1
- package/dist/lib/hooks/index.js +5 -1
- package/dist/lib/hooks/use-namespace/index.js +80 -1
- package/dist/lib/hooks/useProForm.js +50 -1
- package/dist/lib/index.js +77 -1
- package/dist/lib/installer.js +13 -1
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/package.json +9 -9
|
@@ -1,101 +1,135 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { Form
|
|
3
|
-
import { useNamespace
|
|
4
|
-
import { ProAreaProps
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { defineComponent, useModel, computed, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, createVNode, normalizeClass, mergeModels } from "vue";
|
|
2
|
+
import { Form, Row, Col, Select } from "ant-design-vue";
|
|
3
|
+
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
|
|
4
|
+
import { ProAreaProps } from "./types.mjs";
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...{
|
|
7
|
+
name: "ProArea"
|
|
8
|
+
},
|
|
7
9
|
__name: "ProArea",
|
|
8
|
-
props: /* @__PURE__ */
|
|
9
|
-
modelValue: {
|
|
10
|
-
required:
|
|
10
|
+
props: /* @__PURE__ */ mergeModels(ProAreaProps, {
|
|
11
|
+
"modelValue": {
|
|
12
|
+
required: true
|
|
11
13
|
},
|
|
12
|
-
modelModifiers: {}
|
|
14
|
+
"modelModifiers": {}
|
|
13
15
|
}),
|
|
14
16
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
setup(__props) {
|
|
18
|
+
const props = __props;
|
|
19
|
+
Form.useInjectFormItemContext();
|
|
20
|
+
const model = useModel(__props, "modelValue");
|
|
21
|
+
const { b } = useNamespace("pro-area-select");
|
|
22
|
+
const placeholder = computed(() => {
|
|
23
|
+
return (index) => {
|
|
24
|
+
const title = index === 1 ? "请选择省份" : index === 2 ? "请选择城市" : "请选择区县";
|
|
25
|
+
return `请选择${title}`;
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
const ops = computed(() => {
|
|
29
|
+
return (index) => {
|
|
30
|
+
if (props.options.length > 0) {
|
|
31
|
+
return getOps(index);
|
|
32
|
+
}
|
|
33
|
+
return [];
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
function getOps(level) {
|
|
37
|
+
var _a;
|
|
38
|
+
if (level === 1) {
|
|
39
|
+
return props.options.map((item) => ({
|
|
40
|
+
value: getFieldValue(item, "id"),
|
|
41
|
+
label: getFieldValue(item, "name")
|
|
25
42
|
}));
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
value:
|
|
30
|
-
label:
|
|
43
|
+
} else if (level === 2) {
|
|
44
|
+
const value = model.value.province;
|
|
45
|
+
return value ? findChildrenByvalue(props.options, value).map((item) => ({
|
|
46
|
+
value: getFieldValue(item, "id"),
|
|
47
|
+
label: getFieldValue(item, "name")
|
|
31
48
|
})) : [];
|
|
32
49
|
} else {
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
value:
|
|
36
|
-
label:
|
|
50
|
+
const value = (_a = model.value) == null ? void 0 : _a.city;
|
|
51
|
+
return value ? findChildrenByvalue(props.options, value).map((item) => ({
|
|
52
|
+
value: getFieldValue(item, "id"),
|
|
53
|
+
label: getFieldValue(item, "name")
|
|
37
54
|
})) : [];
|
|
38
55
|
}
|
|
39
56
|
}
|
|
40
|
-
function
|
|
41
|
-
for (const
|
|
42
|
-
if (
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
57
|
+
function findChildrenByvalue(regions, value) {
|
|
58
|
+
for (const item of regions) {
|
|
59
|
+
if (getFieldValue(item, "id") === value) {
|
|
60
|
+
return getFieldValue(item, "children") || [];
|
|
61
|
+
}
|
|
62
|
+
if (getFieldValue(item, "children")) {
|
|
63
|
+
const result = findChildrenByvalue(getFieldValue(item, "children"), value);
|
|
64
|
+
if (result) {
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
48
67
|
}
|
|
49
68
|
}
|
|
69
|
+
return void 0;
|
|
50
70
|
}
|
|
51
|
-
function
|
|
52
|
-
return
|
|
71
|
+
function getFieldValue(opt, key) {
|
|
72
|
+
return opt && key ? opt[(props == null ? void 0 : props.fieldNames[key]) || key] : void 0;
|
|
53
73
|
}
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
const levels = computed(() => {
|
|
75
|
+
let IDX = props.level;
|
|
76
|
+
const arr = [];
|
|
77
|
+
while (IDX--) {
|
|
78
|
+
arr.push(IDX === 2 ? "province" : IDX === 1 ? "city" : "county");
|
|
79
|
+
}
|
|
80
|
+
return arr;
|
|
81
|
+
});
|
|
82
|
+
const c = computed(() => {
|
|
83
|
+
return [b()];
|
|
84
|
+
});
|
|
85
|
+
function handleChange(index) {
|
|
86
|
+
if (index === 1) {
|
|
87
|
+
const list = levels.value.slice(index);
|
|
88
|
+
list.forEach((item) => {
|
|
89
|
+
model.value[item] = void 0;
|
|
90
|
+
});
|
|
91
|
+
} else if (index === 2) {
|
|
92
|
+
const list = levels.value.slice(index);
|
|
93
|
+
list.forEach((item) => {
|
|
94
|
+
model.value[item] = void 0;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
67
97
|
}
|
|
68
|
-
return (
|
|
69
|
-
|
|
70
|
-
(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
return (_ctx, _cache) => {
|
|
99
|
+
return openBlock(), createBlock(unref(Row), { gutter: 10 }, {
|
|
100
|
+
default: withCtx(() => [
|
|
101
|
+
(openBlock(true), createElementBlock(
|
|
102
|
+
Fragment,
|
|
103
|
+
null,
|
|
104
|
+
renderList(levels.value, (item, index) => {
|
|
105
|
+
return openBlock(), createBlock(unref(Col), {
|
|
106
|
+
key: item,
|
|
107
|
+
span: 24 / _ctx.level
|
|
108
|
+
}, {
|
|
109
|
+
default: withCtx(() => [
|
|
110
|
+
createVNode(unref(Select), {
|
|
111
|
+
value: model.value[item],
|
|
112
|
+
"onUpdate:value": ($event) => model.value[item] = $event,
|
|
113
|
+
placeholder: placeholder.value(index + 1),
|
|
114
|
+
class: normalizeClass(c.value),
|
|
115
|
+
options: ops.value(index + 1),
|
|
116
|
+
onChange: () => handleChange(index + 1)
|
|
117
|
+
}, null, 8, ["value", "onUpdate:value", "placeholder", "class", "options", "onChange"])
|
|
118
|
+
]),
|
|
119
|
+
_: 2
|
|
120
|
+
/* DYNAMIC */
|
|
121
|
+
}, 1032, ["span"]);
|
|
122
|
+
}),
|
|
123
|
+
128
|
|
124
|
+
/* KEYED_FRAGMENT */
|
|
125
|
+
))
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
/* STABLE */
|
|
129
|
+
});
|
|
130
|
+
};
|
|
97
131
|
}
|
|
98
132
|
});
|
|
99
133
|
export {
|
|
100
|
-
|
|
134
|
+
_sfc_main as default
|
|
101
135
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const level = [1, 2, 3];
|
|
2
|
+
const ProAreaProps = {
|
|
2
3
|
level: {
|
|
3
4
|
type: Number,
|
|
4
5
|
default: 3
|
|
5
6
|
},
|
|
6
7
|
options: {
|
|
7
8
|
type: Array,
|
|
8
|
-
required:
|
|
9
|
+
required: true
|
|
9
10
|
},
|
|
10
11
|
fieldNames: {
|
|
11
12
|
type: Object,
|
|
@@ -17,5 +18,5 @@ const e = {
|
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
+
ProAreaProps
|
|
21
22
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
getContractPrefix: (
|
|
3
|
-
getSignPrefix: (
|
|
4
|
-
getPreviewUrl: (
|
|
5
|
-
getFileList: (
|
|
6
|
-
getFilePreview: (
|
|
1
|
+
const proContractViewApi = {
|
|
2
|
+
getContractPrefix: (config) => globalThis.$http.get(`/contract/uri/prefix`, config),
|
|
3
|
+
getSignPrefix: (config) => globalThis.$http.get(`/sign/uri/prefix`, config),
|
|
4
|
+
getPreviewUrl: (preFix, config) => globalThis.$http.get(`${preFix}/redirect/contract-preview-url`, config),
|
|
5
|
+
getFileList: (preFix, config) => globalThis.$http.get(`${preFix}/contract/file/detail/list`, config),
|
|
6
|
+
getFilePreview: (signPreFix, config) => globalThis.$http.get(`${signPreFix}//file/preview`, config)
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
proContractViewApi
|
|
10
10
|
};
|
|
@@ -1,39 +1,45 @@
|
|
|
1
|
-
import { ref
|
|
2
|
-
import { proContractViewApi
|
|
3
|
-
function
|
|
4
|
-
contractId
|
|
1
|
+
import { ref, reactive, onMounted } from "vue";
|
|
2
|
+
import { proContractViewApi } from "../apis/pro-contract-view.api.mjs";
|
|
3
|
+
function useProContractView({
|
|
4
|
+
contractId
|
|
5
5
|
}) {
|
|
6
|
-
const
|
|
6
|
+
const pageList = ref([]);
|
|
7
|
+
const fileList = ref([]);
|
|
8
|
+
const viewStatus = reactive({
|
|
7
9
|
contractPrefix: "",
|
|
8
10
|
signPrefix: "",
|
|
9
11
|
appToken: "",
|
|
10
12
|
userIdentity: ""
|
|
11
13
|
});
|
|
12
|
-
|
|
13
|
-
const { data:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
onMounted(async () => {
|
|
15
|
+
const { data: cres } = await proContractViewApi.getContractPrefix();
|
|
16
|
+
const { data: sres } = await proContractViewApi.getSignPrefix();
|
|
17
|
+
if (cres.contractUriPrefix && sres.signUriPrefix) {
|
|
18
|
+
viewStatus.contractPrefix = cres.contractUriPrefix;
|
|
19
|
+
viewStatus.signPrefix = sres.signUriPrefix;
|
|
20
|
+
const { data: previewRes } = await proContractViewApi.getPreviewUrl(viewStatus.contractPrefix, {
|
|
17
21
|
params: {
|
|
18
|
-
contractId
|
|
22
|
+
contractId
|
|
19
23
|
}
|
|
20
24
|
});
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
viewStatus.userIdentity = previewRes.userIdentity;
|
|
26
|
+
viewStatus.appToken = previewRes.appToken;
|
|
27
|
+
const { data: res } = await proContractViewApi.getFileList(viewStatus.signPrefix, {
|
|
23
28
|
headers: {
|
|
24
|
-
"SEAL-APP-TOKEN ":
|
|
25
|
-
userIdentity:
|
|
29
|
+
"SEAL-APP-TOKEN ": viewStatus.appToken,
|
|
30
|
+
"userIdentity": viewStatus.userIdentity
|
|
26
31
|
},
|
|
27
|
-
params: { contractId
|
|
32
|
+
params: { contractId }
|
|
28
33
|
});
|
|
29
|
-
|
|
34
|
+
fileList.value = res;
|
|
30
35
|
}
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
pageList,
|
|
39
|
+
viewStatus,
|
|
40
|
+
fileList
|
|
35
41
|
};
|
|
36
42
|
}
|
|
37
43
|
export {
|
|
38
|
-
|
|
44
|
+
useProContractView
|
|
39
45
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { withInstall
|
|
1
|
+
import { withInstall } from "../utils/install.mjs";
|
|
2
2
|
import "./src/pro-contract-view.vue.mjs";
|
|
3
3
|
import "./style/index.mjs";
|
|
4
|
-
import { useProContractView
|
|
5
|
-
import
|
|
6
|
-
const
|
|
4
|
+
import { useProContractView } from "./hooks/use-contract-view.mjs";
|
|
5
|
+
import _sfc_main from "./src/pro-contract-view.vue2.mjs";
|
|
6
|
+
const KProContractView = withInstall(_sfc_main);
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
KProContractView,
|
|
9
|
+
KProContractView as default,
|
|
10
|
+
useProContractView
|
|
11
11
|
};
|
|
@@ -1,128 +1,152 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { Spin
|
|
3
|
-
import { useNamespace
|
|
1
|
+
import { defineComponent, ref, computed, onMounted, watchEffect, unref, createElementBlock, openBlock, normalizeClass, createVNode, createCommentVNode, withCtx, createElementVNode, normalizeStyle } from "vue";
|
|
2
|
+
import { Spin } from "ant-design-vue";
|
|
3
|
+
import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
|
|
4
4
|
import "../../index.mjs";
|
|
5
|
-
import { proContractViewApi
|
|
6
|
-
import { ProContractViewProps
|
|
7
|
-
import { KScaleVirtualList
|
|
8
|
-
const
|
|
5
|
+
import { proContractViewApi } from "../apis/pro-contract-view.api.mjs";
|
|
6
|
+
import { ProContractViewProps } from "./types.mjs";
|
|
7
|
+
import { KScaleVirtualList } from "../../scale-virtual-list/index.mjs";
|
|
8
|
+
const _hoisted_1 = ["data-page-index"];
|
|
9
|
+
const _hoisted_2 = ["src"];
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
11
|
__name: "pro-contract-view",
|
|
10
|
-
props:
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
props: ProContractViewProps,
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const virtualListRef = ref(null);
|
|
16
|
+
const pages = ref([]);
|
|
17
|
+
const options = {
|
|
18
|
+
itemHeight: (index) => pages.value[index].size,
|
|
14
19
|
overscan: 3
|
|
15
|
-
}
|
|
16
|
-
|
|
20
|
+
};
|
|
21
|
+
const spinning = ref(true);
|
|
22
|
+
const containerRef = ref(null);
|
|
23
|
+
const { b, e } = useNamespace("pro-contract-view");
|
|
24
|
+
const c = computed(() => [
|
|
25
|
+
b()
|
|
17
26
|
]);
|
|
18
|
-
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
!
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
if (containerRef.value) {
|
|
29
|
+
const parentElement = containerRef.value.parentElement;
|
|
30
|
+
if (!containerRef.value.clientHeight && (parentElement == null ? void 0 : parentElement.clientHeight)) {
|
|
31
|
+
containerRef.value.style.height = `${parentElement == null ? void 0 : parentElement.clientHeight}px`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
watchEffect(() => {
|
|
36
|
+
const { signPrefix, userIdentity, appToken } = props.viewStatus;
|
|
37
|
+
if (signPrefix && userIdentity && appToken && props.pageList.length > 0 && props.fileId) {
|
|
38
|
+
render(props.pageList);
|
|
22
39
|
}
|
|
23
|
-
}), z(() => {
|
|
24
|
-
const { signPrefix: e, userIdentity: a, appToken: t } = o.viewStatus;
|
|
25
|
-
e && a && t && o.pageList.length > 0 && o.fileId && F(o.pageList);
|
|
26
40
|
});
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
function render(pageList, width) {
|
|
42
|
+
const list = unref(pageList);
|
|
43
|
+
const maxWidth = Math.max(...list.map((item) => item.width));
|
|
44
|
+
let scale = 1;
|
|
45
|
+
if (width) {
|
|
46
|
+
scale = Number.parseFloat((width / maxWidth).toFixed(2));
|
|
47
|
+
}
|
|
48
|
+
pages.value = list.map((item) => {
|
|
49
|
+
const w = Number.parseFloat((+item.width * scale).toFixed(2));
|
|
50
|
+
const h = Number.parseFloat((+item.height * scale).toFixed(2));
|
|
32
51
|
return {
|
|
33
52
|
url: "",
|
|
34
|
-
loaded:
|
|
35
|
-
width:
|
|
36
|
-
height:
|
|
37
|
-
size:
|
|
38
|
-
pageNum:
|
|
53
|
+
loaded: false,
|
|
54
|
+
width: w,
|
|
55
|
+
height: h,
|
|
56
|
+
size: h + 10,
|
|
57
|
+
pageNum: item.pageNum
|
|
39
58
|
};
|
|
40
|
-
})
|
|
59
|
+
});
|
|
60
|
+
spinning.value = false;
|
|
41
61
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
62
|
+
function handleUpdate(state) {
|
|
63
|
+
loadImg(state.start, state.end);
|
|
44
64
|
}
|
|
45
|
-
async function
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
65
|
+
async function loadImg(start, end) {
|
|
66
|
+
let current = start;
|
|
67
|
+
while (current <= end) {
|
|
68
|
+
const item = pages.value[current];
|
|
69
|
+
if (!item)
|
|
50
70
|
return;
|
|
51
|
-
if (!
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
71
|
+
if (!item.loaded) {
|
|
72
|
+
item.loaded = true;
|
|
73
|
+
const img = await getImgUrl(current + 1);
|
|
74
|
+
item.url = img;
|
|
55
75
|
}
|
|
56
|
-
|
|
76
|
+
current++;
|
|
57
77
|
}
|
|
58
78
|
}
|
|
59
|
-
async function
|
|
60
|
-
const { viewStatus
|
|
61
|
-
|
|
79
|
+
async function getImgUrl(index) {
|
|
80
|
+
const { viewStatus, fileId } = props;
|
|
81
|
+
const res = await proContractViewApi.getFilePreview(viewStatus.signPrefix, {
|
|
62
82
|
headers: {
|
|
63
|
-
"SEAL-APP-TOKEN ":
|
|
64
|
-
userIdentity:
|
|
83
|
+
"SEAL-APP-TOKEN ": viewStatus.appToken,
|
|
84
|
+
"userIdentity": viewStatus.userIdentity
|
|
65
85
|
},
|
|
66
86
|
params: {
|
|
67
|
-
fileId
|
|
68
|
-
pageNum:
|
|
87
|
+
fileId,
|
|
88
|
+
pageNum: index,
|
|
69
89
|
pageSize: 1,
|
|
70
|
-
absoluteEnable:
|
|
90
|
+
absoluteEnable: true
|
|
71
91
|
}
|
|
72
|
-
})
|
|
92
|
+
});
|
|
93
|
+
const img = res.data.pages[index - 1].url;
|
|
94
|
+
return img;
|
|
73
95
|
}
|
|
74
|
-
return (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
96
|
+
return (_ctx, _cache) => {
|
|
97
|
+
return openBlock(), createElementBlock(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
ref_key: "containerRef",
|
|
101
|
+
ref: containerRef,
|
|
102
|
+
class: normalizeClass(c.value)
|
|
103
|
+
},
|
|
104
|
+
[
|
|
105
|
+
createVNode(unref(Spin), {
|
|
106
|
+
tip: "Loading...",
|
|
107
|
+
spinning: spinning.value
|
|
108
|
+
}, null, 8, ["spinning"]),
|
|
109
|
+
!spinning.value ? (openBlock(), createElementBlock(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
key: 0,
|
|
113
|
+
class: normalizeClass(unref(e)("content"))
|
|
114
|
+
},
|
|
115
|
+
[
|
|
116
|
+
createVNode(unref(KScaleVirtualList), {
|
|
117
|
+
ref_key: "virtualListRef",
|
|
118
|
+
ref: virtualListRef,
|
|
119
|
+
list: pages.value,
|
|
120
|
+
option: options,
|
|
121
|
+
"onUpdate:state": handleUpdate
|
|
122
|
+
}, {
|
|
123
|
+
default: withCtx(({ index, item }) => [
|
|
124
|
+
createElementVNode("div", {
|
|
125
|
+
"data-page-index": index + 1,
|
|
126
|
+
class: normalizeClass(unref(e)("content-item")),
|
|
127
|
+
style: normalizeStyle({ height: `${item.data.height}px`, width: `${item.data.width}px`, marginBottom: `10px` })
|
|
128
|
+
}, [
|
|
129
|
+
createElementVNode("img", {
|
|
130
|
+
src: item.data.url,
|
|
131
|
+
width: "100%",
|
|
132
|
+
alt: ""
|
|
133
|
+
}, null, 8, _hoisted_2)
|
|
134
|
+
], 14, _hoisted_1)
|
|
135
|
+
]),
|
|
136
|
+
_: 1
|
|
137
|
+
/* STABLE */
|
|
138
|
+
}, 8, ["list"])
|
|
139
|
+
],
|
|
140
|
+
2
|
|
141
|
+
/* CLASS */
|
|
142
|
+
)) : createCommentVNode("v-if", true)
|
|
143
|
+
],
|
|
144
|
+
2
|
|
145
|
+
/* CLASS */
|
|
146
|
+
);
|
|
147
|
+
};
|
|
124
148
|
}
|
|
125
149
|
});
|
|
126
150
|
export {
|
|
127
|
-
|
|
151
|
+
_sfc_main as default
|
|
128
152
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { definePropType
|
|
2
|
-
const
|
|
1
|
+
import { definePropType } from "../../utils/install.mjs";
|
|
2
|
+
const ProContractViewProps = {
|
|
3
3
|
viewStatus: {
|
|
4
|
-
type:
|
|
5
|
-
required:
|
|
4
|
+
type: definePropType(Object),
|
|
5
|
+
required: true
|
|
6
6
|
},
|
|
7
7
|
fileId: {
|
|
8
8
|
type: String
|
|
9
9
|
},
|
|
10
10
|
pageList: {
|
|
11
|
-
type:
|
|
11
|
+
type: definePropType(Array),
|
|
12
12
|
default: () => []
|
|
13
13
|
}
|
|
14
14
|
// fileId: {
|
|
@@ -20,5 +20,5 @@ const r = {
|
|
|
20
20
|
// }
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
ProContractViewProps
|
|
24
24
|
};
|