@aplus-frontend/ui 0.1.25 → 0.1.27
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/es/src/ap-download/ap-download.vue.d.ts +7 -3
- package/es/src/ap-download/ap-download.vue.mjs +50 -35
- package/es/src/ap-download/interface.d.ts +3 -11
- package/es/src/ap-download/style/ap-download.css +3 -0
- package/es/src/ap-form/ap-form-item.vue.mjs +26 -26
- package/es/src/ap-table/ap-table.vue.mjs +231 -183
- package/es/src/ap-table/components/interface.d.ts +33 -1
- package/es/src/ap-table/components/setting/images/icon_carst_down.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/images/icon_fill_right.svg.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/es/src/ap-table/components/setting/modal/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +152 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/select-group/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +96 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/sortable/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +51 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/es/src/ap-table/components/setting/sortable/item.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +140 -0
- package/es/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/es/src/ap-table/components/setting/sorter/context.mjs +20 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/es/src/ap-table/components/setting/sorter/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/sorter/index.vue2.mjs +199 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue.mjs +4 -0
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +75 -0
- package/es/src/ap-table/components/setting/utils.d.ts +17 -0
- package/es/src/ap-table/components/setting/utils.mjs +48 -0
- package/es/src/ap-table/components/style/setting/modal.css +39 -0
- package/es/src/ap-table/components/style/setting/select-group.css +7 -0
- package/es/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/es/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/es/src/ap-table/components/style/setting/sorter.css +26 -0
- package/es/src/ap-table/constants.d.ts +31 -8
- package/es/src/ap-table/constants.mjs +41 -53
- package/es/src/ap-table/context.d.ts +31 -0
- package/es/src/ap-table/context.mjs +20 -0
- package/es/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/es/src/ap-table/hooks/use-table-column-state.mjs +46 -0
- package/es/src/ap-table/hooks/use-table-content-height.mjs +19 -19
- package/es/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/es/src/ap-table/hooks/use-table-paging.mjs +87 -82
- package/es/src/ap-table/interface.d.ts +51 -1
- package/es/src/ap-table/style/ap-table.css +29 -1
- package/es/src/ap-table/utils.d.ts +1 -1
- package/es/src/ap-table/utils.mjs +82 -82
- package/es/src/ap-upload/components/MultipleFile.vue2.mjs +91 -89
- package/es/src/ap-upload/components/Picture.vue2.mjs +114 -112
- package/es/src/ap-upload/components/SingleFile.vue2.mjs +10 -7
- package/es/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/es/src/business/ap-attachment/ApAttachment.mjs +45 -42
- package/es/src/business/ap-attachment/style.css +2 -0
- package/es/src/business/ap-ladder/ApLadder.vue2.mjs +114 -84
- package/es/src/business/ap-ladder/interface.d.ts +42 -0
- package/es/src/business/ap-ladder/interface.mjs +10 -0
- package/es/src/business/hooks/usePageListApTable.d.ts +8 -3
- package/es/src/business/hooks/usePageListApTable.mjs +27 -17
- package/es/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/es/src/business/hooks/useTableRefresh.mjs +9 -9
- package/es/src/business/index.d.ts +4 -4
- package/es/src/editable-table/interface.d.ts +1 -1
- package/es/src/locale/lang/en.mjs +14 -0
- package/es/src/locale/lang/zh-cn.mjs +14 -0
- package/es/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/es/src/theme/ap-download/ap-download.css +3 -0
- package/es/src/theme/ap-table/ap-table.css +29 -1
- package/es/src/theme/ap-table/setting/modal.css +39 -0
- package/es/src/theme/ap-table/setting/select-group.css +7 -0
- package/es/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/es/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/es/src/theme/ap-table/setting/sorter.css +26 -0
- package/es/src/theme/css-var/index.mjs +22 -12
- package/lib/src/ap-download/ap-download.vue.d.ts +7 -3
- package/lib/src/ap-download/ap-download.vue.js +1 -1
- package/lib/src/ap-download/interface.d.ts +3 -11
- package/lib/src/ap-download/style/ap-download.css +3 -0
- package/lib/src/ap-form/ap-form-item.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/components/interface.d.ts +33 -1
- package/lib/src/ap-table/components/setting/images/icon_carst_down.svg.js +1 -0
- package/lib/src/ap-table/components/setting/images/icon_fill_right.svg.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.d.ts +28 -0
- package/lib/src/ap-table/components/setting/modal/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.d.ts +20 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/context.d.ts +11 -0
- package/lib/src/ap-table/components/setting/sorter/context.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.d.ts +18 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/sorter/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.d.ts +13 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue.js +1 -0
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -0
- package/lib/src/ap-table/components/setting/utils.d.ts +17 -0
- package/lib/src/ap-table/components/setting/utils.js +1 -0
- package/lib/src/ap-table/components/style/setting/modal.css +39 -0
- package/lib/src/ap-table/components/style/setting/select-group.css +7 -0
- package/lib/src/ap-table/components/style/setting/sortable-item-meta.css +50 -0
- package/lib/src/ap-table/components/style/setting/sortable-item.css +3 -0
- package/lib/src/ap-table/components/style/setting/sorter.css +26 -0
- package/lib/src/ap-table/constants.d.ts +31 -8
- package/lib/src/ap-table/constants.js +1 -1
- package/lib/src/ap-table/context.d.ts +31 -0
- package/lib/src/ap-table/context.js +1 -0
- package/lib/src/ap-table/hooks/use-table-column-state.d.ts +18 -0
- package/lib/src/ap-table/hooks/use-table-column-state.js +1 -0
- package/lib/src/ap-table/hooks/use-table-content-height.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging.d.ts +1 -0
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +51 -1
- package/lib/src/ap-table/style/ap-table.css +29 -1
- package/lib/src/ap-table/utils.d.ts +1 -1
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/ap-upload/components/MultipleFile.vue2.js +1 -1
- package/lib/src/ap-upload/components/Picture.vue2.js +1 -1
- package/lib/src/ap-upload/components/SingleFile.vue2.js +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.d.ts +1 -1
- package/lib/src/business/ap-attachment/ApAttachment.js +1 -1
- package/lib/src/business/ap-attachment/style.css +2 -0
- package/lib/src/business/ap-ladder/ApLadder.vue2.js +1 -1
- package/lib/src/business/ap-ladder/interface.d.ts +42 -0
- package/lib/src/business/ap-ladder/interface.js +1 -0
- package/lib/src/business/hooks/usePageListApTable.d.ts +8 -3
- package/lib/src/business/hooks/usePageListApTable.js +1 -1
- package/lib/src/business/hooks/useTableRefresh.d.ts +3 -4
- package/lib/src/business/hooks/useTableRefresh.js +1 -1
- package/lib/src/business/index.d.ts +4 -4
- package/lib/src/editable-table/interface.d.ts +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/theme/ap-attachment/ap-attachment.css +2 -0
- package/lib/src/theme/ap-download/ap-download.css +3 -0
- package/lib/src/theme/ap-table/ap-table.css +29 -1
- package/lib/src/theme/ap-table/setting/modal.css +39 -0
- package/lib/src/theme/ap-table/setting/select-group.css +7 -0
- package/lib/src/theme/ap-table/setting/sortable-item-meta.css +50 -0
- package/lib/src/theme/ap-table/setting/sortable-item.css +3 -0
- package/lib/src/theme/ap-table/setting/sorter.css +26 -0
- package/lib/src/theme/css-var/index.js +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ColumnsType } from 'ant-design-vue/es/table';
|
|
2
|
+
import { ApColumnState } from '../../interface';
|
|
3
|
+
/**
|
|
4
|
+
* 根据列状态重新生成表格列配置
|
|
5
|
+
* @param columns 表格列数组
|
|
6
|
+
* @param columnStateList 表格列状态数组
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export default function generateColumnsByColumnState(columns: ColumnsType, columnStateList: ApColumnState[]): ColumnsType;
|
|
10
|
+
export declare function customCloneColumnStates<T extends ApColumnState | ApColumnState[]>(columnStates: T): T;
|
|
11
|
+
/**
|
|
12
|
+
* 克隆列设置用的label,并为其添加额外的props
|
|
13
|
+
* @param node
|
|
14
|
+
* @param overrideProps
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function cloneLabelNode(node: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("lodash-unified"),s=require("vue");function r(e,l){var u;const n=[];for(const t of l){const i=e.find(o=>o.key===t.key);if((u=t.children)!=null&&u.length){const o=r(i.children,t.children);o.length&&n.push({...i,fixed:t.fixed,children:o})}else{if(!t.show)continue;n.push({...i,fixed:t.fixed})}}return n}function f(e){return c.cloneDeepWith(e,(l,n)=>{if(n==="label")return l})}const a={display:"inline","-webkit-line-clamp":"unset","-webkit-box-orient":"unset",overflow:"unset","text-overflow":"unset","white-space":"unset",wordBreak:"unset"};function d(e){return s.isVNode(e)?s.cloneVNode(e,{style:a}):e}exports.cloneLabelNode=d;exports.customCloneColumnStates=f;exports.default=r;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.aplus-ap-column-setting-wrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
flex-wrap: nowrap;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
.aplus-ap-column-setting-left {
|
|
8
|
+
flex: 1;
|
|
9
|
+
flex-shrink: 1;
|
|
10
|
+
min-width: 0;
|
|
11
|
+
padding-inline: 20px;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
.aplus-ap-column-setting-left__header {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
flex-wrap: nowrap;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
padding: 12px;
|
|
22
|
+
}
|
|
23
|
+
.aplus-ap-column-setting-left__content {
|
|
24
|
+
flex: 1;
|
|
25
|
+
padding-inline: 12px;
|
|
26
|
+
padding-block: 16px;
|
|
27
|
+
overflow-y: auto;
|
|
28
|
+
}
|
|
29
|
+
.aplus-ap-column-setting-left__content .ant-checkbox-wrapper {
|
|
30
|
+
max-width: 100%;
|
|
31
|
+
}
|
|
32
|
+
.aplus-ap-column-setting-left__content .ant-checkbox-wrapper > span:last-child {
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
text-overflow: ellipsis;
|
|
36
|
+
}
|
|
37
|
+
.aplus-ap-column-setting-right {
|
|
38
|
+
width: 240px;
|
|
39
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.aplus-sortable-item-meta {
|
|
2
|
+
padding: 6px 8px;
|
|
3
|
+
margin-top: 4px;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: row;
|
|
6
|
+
flex-wrap: nowrap;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
.aplus-sortable-item-meta:hover {
|
|
11
|
+
background-color: #F1F7FF;
|
|
12
|
+
border-radius: 2px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
.aplus-sortable-item-meta:hover .aplus-sortable-item-meta-right {
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
.aplus-sortable-item-meta:hover .aplus-sortable-item-meta-left__holder {
|
|
19
|
+
color: var(--basic-color-primary, #0070ff) !important;
|
|
20
|
+
}
|
|
21
|
+
.aplus-sortable-item-meta-left {
|
|
22
|
+
flex: 1;
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
min-width: 0;
|
|
26
|
+
}
|
|
27
|
+
.aplus-sortable-item-meta-left__indicator {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
align-items: center;
|
|
31
|
+
width: 16px;
|
|
32
|
+
height: 16px;
|
|
33
|
+
margin-right: 4px;
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
}
|
|
36
|
+
.aplus-sortable-item-meta-left__label-wrapper {
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
}
|
|
41
|
+
.aplus-sortable-item-meta-right {
|
|
42
|
+
display: none;
|
|
43
|
+
padding-left: 12px;
|
|
44
|
+
}
|
|
45
|
+
.aplus-sortable-item-meta .is-level2 {
|
|
46
|
+
margin-left: 16px;
|
|
47
|
+
}
|
|
48
|
+
.aplus-sortable-item-meta-action-icon:hover {
|
|
49
|
+
color: var(--basic-color-primary, #0070ff);
|
|
50
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.aplus-column-setting-sorter {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
height: 100%;
|
|
5
|
+
}
|
|
6
|
+
.aplus-column-setting-sorter-section-title {
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
line-height: 20px;
|
|
9
|
+
color: #8896b0;
|
|
10
|
+
padding: 2px 8px;
|
|
11
|
+
margin: 4px;
|
|
12
|
+
}
|
|
13
|
+
.aplus-column-setting-sorter-header {
|
|
14
|
+
padding: 16px 20px;
|
|
15
|
+
}
|
|
16
|
+
.aplus-column-setting-sorter-header-title {
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
line-height: 22px;
|
|
19
|
+
font-weight: bold;
|
|
20
|
+
color: #182948;
|
|
21
|
+
}
|
|
22
|
+
.aplus-column-setting-sorter-content {
|
|
23
|
+
flex: 1;
|
|
24
|
+
overflow-y: auto;
|
|
25
|
+
padding: 8px 12px 12px 8px;
|
|
26
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApFieldPassword } from '../ap-field';
|
|
2
2
|
import { ApTableValueFields, ValueEnum } from './interface';
|
|
3
|
-
import {
|
|
3
|
+
import { CreateComponentPublicInstance, ExtractPropTypes, PropType, HTMLAttributes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComponentOptionsBase, VNode, RendererNode, RendererElement, CSSProperties, DefineComponent, PublicProps, ComputedRef } from 'vue';
|
|
4
4
|
import { ColSize } from 'ant-design-vue/es/grid';
|
|
5
5
|
import { ApFieldDateProps, ApFormItemSlots, ApFieldDateRangeProps, ApFieldNumberProps, ApFieldRadioProps, ApFieldSelectProps, ApFieldSwitchProps, ApFieldTextProps, ApFormItemTextPassword, ApFieldTextAreaProps, ApFieldCheckboxProps, ApFieldTextPasswordProps, FieldMode, GroupActionTypes } from '..';
|
|
6
6
|
import { RuleObject } from 'ant-design-vue/es/form';
|
|
@@ -5242,7 +5242,11 @@ export declare const apTableFormItemMap: {
|
|
|
5242
5242
|
focus: (options?: InputFocusOptions) => void;
|
|
5243
5243
|
blur: () => void;
|
|
5244
5244
|
input: any;
|
|
5245
|
-
setSelectionRange: (start: number, end: number, direction
|
|
5245
|
+
setSelectionRange: (start: number, end: number, direction
|
|
5246
|
+
/**
|
|
5247
|
+
* 不需要渲染到Form表单的valueType字段
|
|
5248
|
+
*/
|
|
5249
|
+
?: "forward" | "backward" | "none") => void;
|
|
5246
5250
|
select: () => void;
|
|
5247
5251
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
5248
5252
|
label: {
|
|
@@ -5653,7 +5657,11 @@ export declare const apTableFormItemMap: {
|
|
|
5653
5657
|
focus: (options?: InputFocusOptions) => void;
|
|
5654
5658
|
blur: () => void;
|
|
5655
5659
|
input: any;
|
|
5656
|
-
setSelectionRange: (start: number, end: number, direction
|
|
5660
|
+
setSelectionRange: (start: number, end: number, direction
|
|
5661
|
+
/**
|
|
5662
|
+
* 不需要渲染到Form表单的valueType字段
|
|
5663
|
+
*/
|
|
5664
|
+
?: "forward" | "backward" | "none") => void;
|
|
5657
5665
|
select: () => void;
|
|
5658
5666
|
}, {}, {}, {}, {
|
|
5659
5667
|
disabled: boolean;
|
|
@@ -5866,7 +5874,11 @@ export declare const apTableFormItemMap: {
|
|
|
5866
5874
|
focus: (options?: InputFocusOptions) => void;
|
|
5867
5875
|
blur: () => void;
|
|
5868
5876
|
input: any;
|
|
5869
|
-
setSelectionRange: (start: number, end: number, direction
|
|
5877
|
+
setSelectionRange: (start: number, end: number, direction
|
|
5878
|
+
/**
|
|
5879
|
+
* 不需要渲染到Form表单的valueType字段
|
|
5880
|
+
*/
|
|
5881
|
+
?: "forward" | "backward" | "none") => void;
|
|
5870
5882
|
select: () => void;
|
|
5871
5883
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {
|
|
5872
5884
|
disabled: boolean;
|
|
@@ -13919,7 +13931,11 @@ export declare const apTableRenderItemMap: {
|
|
|
13919
13931
|
focus: (options?: InputFocusOptions) => void;
|
|
13920
13932
|
blur: () => void;
|
|
13921
13933
|
input: any;
|
|
13922
|
-
setSelectionRange: (start: number, end: number, direction
|
|
13934
|
+
setSelectionRange: (start: number, end: number, direction
|
|
13935
|
+
/**
|
|
13936
|
+
* 不需要渲染到Form表单的valueType字段
|
|
13937
|
+
*/
|
|
13938
|
+
?: "forward" | "backward" | "none") => void;
|
|
13923
13939
|
select: () => void;
|
|
13924
13940
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
13925
13941
|
"update:value": (...args: any[]) => void;
|
|
@@ -14229,7 +14245,11 @@ export declare const apTableRenderItemMap: {
|
|
|
14229
14245
|
focus: (options?: InputFocusOptions) => void;
|
|
14230
14246
|
blur: () => void;
|
|
14231
14247
|
input: any;
|
|
14232
|
-
setSelectionRange: (start: number, end: number, direction
|
|
14248
|
+
setSelectionRange: (start: number, end: number, direction
|
|
14249
|
+
/**
|
|
14250
|
+
* 不需要渲染到Form表单的valueType字段
|
|
14251
|
+
*/
|
|
14252
|
+
?: "forward" | "backward" | "none") => void;
|
|
14233
14253
|
select: () => void;
|
|
14234
14254
|
}, {}, {}, {}, {
|
|
14235
14255
|
type: "number" | "reset" | "submit" | "button" | "search" | "time" | "month" | "date" | "week" | "hidden" | "checkbox" | "radio" | "color" | "text" | "range" | "image" | "tel" | "url" | "email" | "datetime-local" | "file" | "password";
|
|
@@ -14390,7 +14410,11 @@ export declare const apTableRenderItemMap: {
|
|
|
14390
14410
|
focus: (options?: InputFocusOptions) => void;
|
|
14391
14411
|
blur: () => void;
|
|
14392
14412
|
input: any;
|
|
14393
|
-
setSelectionRange: (start: number, end: number, direction
|
|
14413
|
+
setSelectionRange: (start: number, end: number, direction
|
|
14414
|
+
/**
|
|
14415
|
+
* 不需要渲染到Form表单的valueType字段
|
|
14416
|
+
*/
|
|
14417
|
+
?: "forward" | "backward" | "none") => void;
|
|
14394
14418
|
select: () => void;
|
|
14395
14419
|
}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
14396
14420
|
"update:value": (...args: any[]) => void;
|
|
@@ -15632,4 +15656,3 @@ export declare const apTableRenderItemMap: {
|
|
|
15632
15656
|
* 不需要渲染到Form表单的valueType字段
|
|
15633
15657
|
*/
|
|
15634
15658
|
export declare const noRenderAsFormItemValueList: (keyof ApTableValueFields)[];
|
|
15635
|
-
export declare const ellipsisTitleStyle: CSSProperties;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../ap-action/index.js");require("../ap-field/index.js");require("../ap-form/index.js");require("./components/index/index.vue.js");require("./components/status/index.vue.js");const t=require("../ap-form/items/date/index.vue.js"),_=require("../ap-form/items/date-range/index.vue.js"),u=require("../ap-form/items/number/index.vue.js"),r=require("../ap-form/items/radio/index.vue.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../ap-action/index.js");require("../ap-field/index.js");require("../ap-form/index.js");require("./components/index/index.vue.js");require("./components/status/index.vue.js");const t=require("../ap-form/items/date/index.vue.js"),_=require("../ap-form/items/date-range/index.vue.js"),u=require("../ap-form/items/number/index.vue.js"),r=require("../ap-form/items/radio/index.vue.js"),s=require("../ap-form/items/select/index.vue.js"),i=require("../ap-form/items/switch/index.vue.js"),e=require("../ap-form/items/text/index.js"),n=require("../ap-form/items/text-area/index.vue.js"),p=require("../ap-form/items/checkbox/index.vue.js"),a=require("../ap-field/date/index.vue.js"),d=require("../ap-field/date-range/index.vue.js"),c=require("../ap-field/number/index.vue.js"),l=require("../ap-field/radio/index.vue.js"),o=require("../ap-field/select/index.vue.js"),v=require("../ap-field/switch/index.vue.js"),x=require("../ap-field/text/index.js"),q=require("../ap-field/text-area/index.vue.js"),g=require("../ap-field/checkbox/index.vue.js"),f=require("../ap-action/group/index.vue.js"),y=require("./components/index/index.vue2.js"),$=require("./components/status/index.vue2.js"),m=require("../ap-field/text/password.vue.js"),b={date:t.default,dateRange:_.default,number:u.default,radio:r.default,select:s.default,switch:i.default,text:e.ApFormItemText,textArea:n.default,checkbox:p.default,password:e.ApFormItemText.Password},I={date:a.default,dateRange:d.default,number:c.default,radio:l.default,select:o.default,switch:v.default,text:x.ApFieldText,textArea:q.default,checkbox:g.default,action:f.default,index:y.default,status:$.default,password:m.default},T=["action","index"];exports.apTableFormItemMap=b;exports.apTableRenderItemMap=I;exports.noRenderAsFormItemValueList=T;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ColumnType } from 'ant-design-vue/es/table';
|
|
2
|
+
import { ComputedRef, InjectionKey } from 'vue';
|
|
3
|
+
import { ApTableProps } from './interface';
|
|
4
|
+
type TableSize = ApTableProps['size'];
|
|
5
|
+
type ApTableContextProps<RecordType> = {
|
|
6
|
+
/**
|
|
7
|
+
* 表格列配置
|
|
8
|
+
*/
|
|
9
|
+
columns?: ComputedRef<ColumnType<RecordType>[]>;
|
|
10
|
+
/**
|
|
11
|
+
* 表格列配置备份(只有在props变更后才会变更)
|
|
12
|
+
*/
|
|
13
|
+
columnsBackup?: ComputedRef<ColumnType<RecordType>[]>;
|
|
14
|
+
/**
|
|
15
|
+
* 更新数据源的方法
|
|
16
|
+
* @param name
|
|
17
|
+
* @param value
|
|
18
|
+
* @param triggerChange 是否触发外部的`onValuesChange`函数
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
updateColumns?: (nextColumns: ColumnType<RecordType>[]) => void;
|
|
22
|
+
/**
|
|
23
|
+
* ApForm内部实例
|
|
24
|
+
*/
|
|
25
|
+
size?: ComputedRef<TableSize>;
|
|
26
|
+
updateSize?: (nextSize: TableSize) => void;
|
|
27
|
+
};
|
|
28
|
+
export declare const ApTableContextKey: InjectionKey<ApTableContextProps<any>>;
|
|
29
|
+
export declare function useProvideApTable<ModelType>(state: ApTableContextProps<ModelType>): void;
|
|
30
|
+
export declare function useInjectApTable(): ApTableContextProps<any>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=Symbol("apTableContextKey");function u(o){e.provide(t,o)}function n(){return e.inject(t,{columns:e.computed(()=>[]),updateColumns:()=>{},size:e.computed(()=>"middle"),updateSize:()=>{}})}exports.ApTableContextKey=t;exports.useInjectApTable=n;exports.useProvideApTable=u;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ApColumnState } from '../interface';
|
|
2
|
+
import { Ref, ComputedRef } from 'vue';
|
|
3
|
+
export declare const useTableColumnState: (initialColumnState: ApColumnState[]) => {
|
|
4
|
+
columnState: Ref<{
|
|
5
|
+
key: string | number;
|
|
6
|
+
show?: boolean | undefined;
|
|
7
|
+
fixed?: ("left" | "right") | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
label?: any;
|
|
10
|
+
children?: any[] | undefined;
|
|
11
|
+
}[]>;
|
|
12
|
+
selectAll: () => void;
|
|
13
|
+
unSelectAll: () => void;
|
|
14
|
+
toggleSelect: (key: string, show?: boolean) => void;
|
|
15
|
+
setColumnState: (nextColumnState: ApColumnState[]) => void;
|
|
16
|
+
isAllSelected: ComputedRef<boolean>;
|
|
17
|
+
toggleSelectAll: () => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),d=require("../../utils/index.js");function r(s,e){s.forEach(u=>{var o;e(u),(o=u.children)!=null&&o.length&&r(u.children,e)})}const h=s=>{const e=l.ref(s),u=l.computed(()=>l.unref(e).every(t=>t.show));function o(){const t=l.unref(e);r(t,n=>{!n.disabled&&(n.show=!0)})}function f(){const t=l.unref(e);r(t,n=>{!n.disabled&&(n.show=!1)})}function i(){l.unref(u)?f():o()}function a(t,n){r(l.unref(e),c=>{c.key===t&&(c.show=d.isDef(n)?n:!c.show)})}function S(t){e.value=t}return{columnState:e,selectAll:o,unSelectAll:f,toggleSelect:a,setColumnState:S,isAllSelected:u,toggleSelectAll:i}};exports.useTableColumnState=h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const S=require("@vueuse/core"),r=require("vue");function f(t){if(!t)return 0;const e=parseFloat(t);return Number.isNaN(e)?0:e}function d(t){if(!t)return 0;const e=getComputedStyle(t);return t.clientHeight+f(e.marginTop)+f(e.marginBottom)}const b=t=>{const e=r.ref(),{height:p}=S.useElementSize(e),i=r.ref();let u=!1;const H=r.computed(()=>{var c,l,g,s,h;const n=((l=(c=e.value)==null?void 0:c.querySelector(".aplus-ap-table-header-wrapper"))==null?void 0:l.clientHeight)||0,a=((s=(g=e.value)==null?void 0:g.querySelector(".ant-table-header"))==null?void 0:s.clientHeight)||47,o=(h=e.value)==null?void 0:h.querySelector(".ant-pagination"),m=o?d(o):r.unref(i);return o&&(u=!0),Math.ceil(r.unref(p)-a-n-(m||0)-((t==null?void 0:t.offset)||0))});return r.onUpdated(()=>{var a;if(u)return;const n=(a=e.value)==null?void 0:a.querySelector(".ant-pagination");if(!n){i.value=0;return}i.value=d(n),u=!0}),{contentRef:e,height:H}};exports.default=b;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),O=require("../utils.js"),Y=require("lodash-unified");require("../../config-provider/index.js");const Z=require("../../config-provider/hooks/use-locale.js"),_=require("../../config-provider/hooks/use-namespace.js"),I=({manual:j=!1,defaultCurrent:D=1,defaultPageSize:V=10,request:R,defaultParams:M={},defaultData:A=[],formatParams:x,paramsValueTypeMap:z,resetFieldsIgnores:q,filterFields:B,sortFields:E,showLessItems:P=!1,showTotal:L=!0})=>{let S=0,f={};const $=e=>x?x(e):e,l=t.ref(),i=t.ref(D),g=t.ref(V),{t:T}=Z.useLocale(),{b:F}=_.useNamespace("ap-table"),r=t.ref({total:0,records:A,loading:!1}),y=async e=>{var o;const n=$(e),a=Date.now();S=a,r.value.loading=!0;try{const s=await R({...M,...n});S===a&&(r.value.total=s.total||((o=s.data)==null?void 0:o.length)||0,r.value.records=[...s.data||[]])}catch{S===a&&(r.value.records=[],r.value.total=0)}finally{r.value.loading=!1}},N=e=>{const n={};return Object.entries(e).forEach(([a,o])=>{if(n[a]=o,z&&o){const s=z[a];s&&(n[a]=O.parseFieldValue(s,o))}}),n},J=async e=>{var o,s,p,d,h,c,v;const n=((s=(o=l.value)==null?void 0:o.apForm)==null?void 0:s.getFieldsValue())||{},a={};Object.entries(n).forEach(([m,u])=>{q&&q.indexOf(m)>-1&&(a[m]=u)}),await((d=(p=l.value)==null?void 0:p.apForm)==null?void 0:d.resetFields()),(v=(c=(h=l.value)==null?void 0:h.apForm)==null?void 0:c.setFieldsValue)==null||v.call(c,a),t.nextTick(()=>{e==null||e()})},b=e=>{f=e;const n=N(e);y(n)},Q=e=>{b({...f,...e})},w=()=>{var n,a;const e=((a=(n=l.value)==null?void 0:n.apForm)==null?void 0:a.getFieldsValue(!0))||{};i.value=1,b({...e,current:1,pageSize:f.pageSize||V})},U=()=>{J(w)},G=()=>{b(f)},H=e=>{const n=t.unref(r).total-e,a=Math.ceil(n/t.unref(g)),o=t.unref(i)>a?a:t.unref(i);Q({current:o>0?o:1})},C=(e,n,a)=>{var h,c,v,m;const o=((c=(h=l.value)==null?void 0:h.apForm)==null?void 0:c.getFieldsValue(!0))||{};i.value=e.current,g.value=e.pageSize;const s=Y.isArray(a)?[...a]:[a],p={};for(const u of s)(v=t.unref(E))!=null&&v.includes(u.field)&&(p[O.dataIndexToStr(u.field)]=u.order);const d={};for(const u of Object.keys(n))(m=t.unref(B))!=null&&m.includes(u)&&(d[u]=n[u]);b({...o,filter:d,sort:p,current:e.current,pageSize:e.pageSize})};t.onMounted(()=>{var n,a;const e=((a=(n=l.value)==null?void 0:n.apForm)==null?void 0:a.getFieldsValue(!0))||{};if(f={current:t.unref(i),pageSize:t.unref(g),...e},!j){const o=N(f);y(o)}});const K=t.computed(()=>t.unref(r).total===0?"-":`${t.unref(i.value)}/${Math.ceil(t.unref(r).total/t.unref(g))}`);function W(e){e!=null&&e.length&&(r.value.records=e,r.value.total=e.length)}const X=t.computed(()=>({loading:t.unref(r).loading,pagination:{current:t.unref(i),pageSize:t.unref(g),total:t.unref(r).total,showSizeChanger:!P,showQuickJumper:!P,showLessItems:P,size:"default",showTotal:L?e=>t.createVNode("span",{class:F("pagination-total-wrapper")},[T("ap.apTable.pagination.totalLeftPrefix")," ",t.createVNode("span",{class:F("pagination-count-text")},[e])," ",T("ap.apTable.pagination.totalLeftSuffix"),t.createVNode("span",{class:F("pagination--total-right")},[T("ap.apTable.pagination.totalRightPrefix")," ",t.createVNode("span",{class:F("pagination-count-text")},[t.unref(K)])," ",T("ap.apTable.pagination.totalRightSuffix")])]):void 0},onChange:C,dataSource:t.unref(r).records}));return{formRef:l,submit:w,reset:U,refresh:G,refreshByDelete:H,data:r,current:i,pageSize:g,handleTableChange:C,tableProps:X,dataSource:t.computed(()=>t.unref(r).records),setDataSource:W}};exports.useTablePaging=I;
|
|
@@ -72,6 +72,52 @@ export type CommonFieldReturnType = ApFormItemProps & {
|
|
|
72
72
|
placeholder?: string;
|
|
73
73
|
disabled?: boolean;
|
|
74
74
|
};
|
|
75
|
+
export type ApTableSettingType = {
|
|
76
|
+
/**
|
|
77
|
+
* 用于持久化缓存的key
|
|
78
|
+
*/
|
|
79
|
+
persistenceKey?: string;
|
|
80
|
+
/**
|
|
81
|
+
* 持久化类型
|
|
82
|
+
*/
|
|
83
|
+
persistenceType?: 'localStorage' | 'sessionStorage';
|
|
84
|
+
/**
|
|
85
|
+
* 列的默认状态
|
|
86
|
+
*/
|
|
87
|
+
defaultValue?: Recordable<Omit<ApColumnState, 'children' | 'key'>>;
|
|
88
|
+
/**
|
|
89
|
+
* 列状态变更时的回调(注意,返回的是全量状态)
|
|
90
|
+
* @param val
|
|
91
|
+
* @returns
|
|
92
|
+
*/
|
|
93
|
+
onChange?: (val: ApColumnState[]) => void;
|
|
94
|
+
};
|
|
95
|
+
export type ApColumnState = {
|
|
96
|
+
/**
|
|
97
|
+
* 列的唯一标识
|
|
98
|
+
*/
|
|
99
|
+
key: string | number;
|
|
100
|
+
/**
|
|
101
|
+
* 列是否显示
|
|
102
|
+
*/
|
|
103
|
+
show?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* 列的固定状态
|
|
106
|
+
*/
|
|
107
|
+
fixed?: 'left' | 'right';
|
|
108
|
+
/**
|
|
109
|
+
* 是否可以修改列状态
|
|
110
|
+
*/
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* 列对应显示的文本
|
|
114
|
+
*/
|
|
115
|
+
label?: any;
|
|
116
|
+
/**
|
|
117
|
+
* 子节点状态
|
|
118
|
+
*/
|
|
119
|
+
children?: ApColumnState[];
|
|
120
|
+
};
|
|
75
121
|
export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType extends ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType> = ReturnType | ((opt: Partial<{
|
|
76
122
|
value: any;
|
|
77
123
|
text: any;
|
|
@@ -81,7 +127,7 @@ export type FieldPropsType<ReturnType, RecordType, ExtraValueType, ValueType ext
|
|
|
81
127
|
column: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>;
|
|
82
128
|
}>) => ReturnType);
|
|
83
129
|
export type ApColumnType<RecordType = any, ExtraValueType = 'text', ValueType extends ApTableValueTypes = ApTableValueTypes, MergedValueType extends ExtraValueType | ValueType = ExtraValueType | ValueType> = MergedValueType extends ExtraValueType | ValueType ? ExtraProColumnType<RecordType> & {
|
|
84
|
-
children?: ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>[];
|
|
130
|
+
children?: Omit<ApColumnType<RecordType, ExtraValueType, ValueType, MergedValueType>, 'fixed'>[];
|
|
85
131
|
/**
|
|
86
132
|
* 表单项所占据的格子数(1-24格)
|
|
87
133
|
*/
|
|
@@ -267,6 +313,10 @@ export type ApTableProps<RecordType = any, ParamsType = any> = Omit<TableProps<R
|
|
|
267
313
|
* 设置表格列是否可以resize
|
|
268
314
|
*/
|
|
269
315
|
columnResizable?: ColumnType['resizable'];
|
|
316
|
+
/**
|
|
317
|
+
* 是否开启表格设置
|
|
318
|
+
*/
|
|
319
|
+
settings?: true | ApTableSettingType;
|
|
270
320
|
};
|
|
271
321
|
export type ApTableExpose<SearchParamsType = Recordable, RecordType = any> = {
|
|
272
322
|
/**
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
}
|
|
10
|
-
.aplus-ap-table-adaptive .ant-table-wrapper
|
|
10
|
+
.aplus-ap-table-adaptive .ant-table-wrapper {
|
|
11
|
+
flex: 1;
|
|
12
|
+
}
|
|
11
13
|
.aplus-ap-table-adaptive .ant-spin-nested-loading,
|
|
12
14
|
.aplus-ap-table-adaptive .ant-spin-container {
|
|
13
15
|
height: 100%;
|
|
@@ -35,6 +37,8 @@
|
|
|
35
37
|
.aplus-ap-table__table-wrapper {
|
|
36
38
|
flex: 1;
|
|
37
39
|
max-height: 100%;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
38
42
|
}
|
|
39
43
|
.aplus-ap-table__table-wrapper-card {
|
|
40
44
|
padding: 16px;
|
|
@@ -98,3 +102,27 @@
|
|
|
98
102
|
.aplus-ap-table-pagination-total-wrapper {
|
|
99
103
|
color: var(--ap-table-pagination-total-color, #526A90);
|
|
100
104
|
}
|
|
105
|
+
.aplus-ap-table-header {
|
|
106
|
+
padding-bottom: 16px;
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: space-between;
|
|
109
|
+
align-items: center;
|
|
110
|
+
flex-wrap: nowrap;
|
|
111
|
+
}
|
|
112
|
+
.aplus-ap-table-header__title {
|
|
113
|
+
flex: 1;
|
|
114
|
+
flex-shrink: 1;
|
|
115
|
+
min-width: 0;
|
|
116
|
+
}
|
|
117
|
+
.aplus-ap-table-table-header__title {
|
|
118
|
+
display: -webkit-inline-box;
|
|
119
|
+
-webkit-line-clamp: 2;
|
|
120
|
+
-webkit-box-orient: vertical;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
white-space: normal;
|
|
124
|
+
max-width: 100%;
|
|
125
|
+
vertical-align: middle;
|
|
126
|
+
word-break: break-all;
|
|
127
|
+
flex: 1;
|
|
128
|
+
}
|
|
@@ -8423,7 +8423,7 @@ export declare function updateFormProps(item: ApColumnType<any, any>, fieldProps
|
|
|
8423
8423
|
* @returns
|
|
8424
8424
|
*/
|
|
8425
8425
|
export declare function objectToString(value: any): any;
|
|
8426
|
-
export declare function getTableTitle(column: ApColumnType<any>, slot?: (props: {
|
|
8426
|
+
export declare function getTableTitle(column: ApColumnType<any>, titleNodeClassName: string, slot?: (props: {
|
|
8427
8427
|
title: any;
|
|
8428
8428
|
column: ApColumnType<any>;
|
|
8429
8429
|
}) => any, tooltipColor?: string): number | boolean | void | VNodeArrayChildren | import("vue/jsx-runtime").JSX.Element | ((props: ColumnTitleProps<any>) => VNodeArrayChildren | VueNode) | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),i=require("lodash-unified"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),i=require("lodash-unified"),d=require("./constants.js"),g=require("@fruits-chain/utils");require("../ap-form/index.js");const b=require("ant-design-vue"),y=require("@ant-design/icons-vue"),h=require("../ap-form/ap-form-item.vue.js");function j(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!u.isVNode(e)}const f=(e,t,n)=>{let o={};return i.isObject(e)?Object.keys(e).forEach(r=>{i.isObject(e[r])?o[r]=f(e[r],t[r],n):o[r]=n(e[r],t)}):o=n(e,t),o},F=(e,t)=>{switch(e){case"dayjs":return t.valueOf();case"dayjsRange":return t.map(n=>n.valueOf());case"dayjsDayRange":{const[n,o]=t;return[n.startOf("day").valueOf(),o.endOf("day").valueOf()]}case"multiple":case"multipleNumber":return i.isArray(t)?t:[t];case"boolean":return t;case"object":return t;default:return t}};function N(e){return i.isArray(e)?e.join("."):e}function O(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const p=e=>O(e)==="map"?e:new Map(Object.entries(e||{})),c=e=>{const t=[],n=p(e);return n.forEach((o,r)=>{const s=n.get(r)||n.get(`${r}`);if(s){if(typeof s=="object"&&(s!=null&&s.text)){t.push({text:s==null?void 0:s.text,value:r,label:s==null?void 0:s.text,disabled:s.disabled});return}t.push({text:s,label:s,value:r})}}),t},S=e=>i.isUndefined(e)||e<0?0:e,V=(e,t,n)=>{if(n)return n;const o=["select","date"],r=["text","textArea","number"];if(t==="dateRange")return[e("ap.common.chooseText"),e("ap.common.chooseText")];if(o.includes(t))return e("ap.common.chooseText");if(r.includes(t))return e("ap.common.inputText")};function m(e,t){return!e||!i.isFunction(e)?e:e(t)}function E(e){let t=e.valueType||"text";return e.valueEnum&&(t="status"),t}function P(e,t,n,o){var l;const r=d.apTableRenderItemMap[e];if(r)return u.createVNode(r,u.mergeProps(t,{mode:"read"}),null);const s=o==null?void 0:o[e];return((l=s==null?void 0:s.render)==null?void 0:l.call(s,t.value,n,t))||t.value}function v(e,t){if(e.customRenderFormItem)return()=>{const r=e.customRenderFormItem(e);return u.cloneVNode(r,{...e.fieldProps,span:e.span,...r.props||{}})};const n=d.apTableFormItemMap[e.valueType];if(n)return n;const o=t==null?void 0:t[e.valueType];return()=>{var s;const r=(s=o==null?void 0:o.renderFormItem)==null?void 0:s.call(o,e.fieldProps.field);return r?u.createVNode(h.default,u.mergeProps(e.fieldProps,{span:e.span}),j(r)?r:{default:()=>[r]}):null}}function I(e,t){const n=m(e.fieldProps,t),o=(n==null?void 0:n.field)||n||{},r=e.valueType==="switch",s=e.valueType==="index",l=r?{checked:t.value}:{value:s?t.index+1:t.value};return e.valueEnum&&(o.valueEnum=e.valueEnum),{...i.omit(o,["request"]),...l}}function q(e){const t={...e};return i.isBoolean(e.filters)&&e.filters&&e.valueEnum&&(t.filters=c(e.valueEnum)),t}function x(e,t){var o;const n=t||{};return e.valueEnum&&!((o=n.field)!=null&&o.options)&&(n.field={...n.field,options:c(e.valueEnum)}),n}function C(e){if(!g.isType("Object")(e))return e;try{return JSON.stringify(e)}catch{return e}}function _(e,t,n,o){const r=n==null?void 0:n({title:e.title,column:e});if(r&&(r.length>1||r[0].children&&r[0].children!=="v-if"))return r;const l=i.isString(e.title)?u.createVNode("span",{class:t,title:e.title},[e.title]):e.title,a=e.tooltip?i.isString(e.tooltip)?u.createVNode(u.Fragment,null,[e.tooltip]):e.tooltip(e):null,T=u.createVNode("span",{style:{display:"inline-flex",alignItems:"center"}},[l,u.createVNode(b.Tooltip,{title:a,placement:"bottom"},{default:()=>[u.createVNode(y.QuestionCircleOutlined,{style:{padding:"4px",color:o,verticalAlign:"middle"}},null)]})]);return a?T:l}exports.apColumnToColumn=q;exports.dataIndexToStr=N;exports.formatParamsValueType=f;exports.getColumnOrder=S;exports.getFieldProps=m;exports.getPlaceholder=V;exports.getSearchFormItemRenderNode=v;exports.getTableCellRenderNode=P;exports.getTableRenderProps=I;exports.getTableRenderType=E;exports.getTableTitle=_;exports.objectToMap=p;exports.objectToString=C;exports.parseFieldValue=F;exports.updateFormProps=x;exports.valueEnumToArray=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const f=require("../utils/returnData.js"),q=require("../hooks/useOss.js"),c=require("ant-design-vue"),R=require("@ant-design/icons-vue"),T=require("../utils/accept.js");require("../styles/multiple-file.css");const I=require("../../config-provider/hooks/use-locale.js"),P=require("../../config-provider/hooks/use-namespace.js"),O={class:"multiple-file-context"},z={key:0},M={key:1},V=e.defineComponent({__name:"MultipleFile",setup($){const{t:o}=I.useLocale(),{b:y}=P.useNamespace("ap-upload-multiple-file"),{put:U}=q.useOss(),A=e.inject("theme"),B=e.inject("dirName"),x=e.inject("accept")||"*",w=e.inject("maxSize")??500,E=e.inject("title")||o("ap.apUpload.uploadFile"),v=e.inject("subTitle"),i=e.inject("maxCount")??10,p=e.inject("uploadingCount"),C=e.inject("beforeUpload"),_=e.inject("customRequest"),F=e.inject("getOssAccess"),s=e.inject("value"),g=[],d=e.inject("needName"),l=e.ref(null);e.watch(()=>s==null?void 0:s.value,function(t){var n,a;!((a=(n=l==null?void 0:l.value)==null?void 0:n.fileList)!=null&&a.length)&&t&&e.nextTick(()=>{const r=t.map(u=>{const j=f.getPath(d,u),L=f.getName(d,u),k=new File([u],L,{});return k.response=j,k.uid=j,k});if(i&&r.length>i){c.message.warning(o("ap.apUpload.fileInitializationException",{maxCount:i}));return}r.forEach(u=>{m.push(u),g.push({uid:u.uid,path:u.response})}),l.value.fileList=r})},{immediate:!0});let m=[],N;function h(t){setTimeout(()=>{const n=l.value.fileList.findIndex(a=>a.uid===t.uid);n>=0&&l.value.fileList.splice(n,1)})}function S(t){if(i&&i>1&&m.length>=i)return clearTimeout(N),N=setTimeout(()=>{c.message.warning(o("ap.apUpload.maxUploadFiles",{maxCount:i}))}),h(t),!1;if(typeof C=="function"){if(C(t)===!1)return h(t),!1}else{if(t.size>w*1024*1024)return c.message.warning(o("ap.apUpload.maxUploadFileSize",{maxSize:w})),h(t),!1;if(!T.fileMatchesAccept(t,x))return c.message.warning(o("ap.apUpload.fileFormatNotSupported")),h(t),!1}i&&i===1&&(m=[],s.value=void 0),m.push(t)}async function b(t){if(p.value++,typeof _=="function"){_({onProgress:n=>{setTimeout(()=>{t.onProgress({percent:n})})},onError:n=>{c.message.warning(n||o("ap.apUpload.networkAnomaly")),setTimeout(()=>{t.onError({name:n,message:n})}),p.value--},onSuccess:n=>{setTimeout(()=>{t.onSuccess(n)}),s.value?s.value.push(f.getReturnData(d,n,t.file.name)):s.value=[f.getReturnData(d,n,t.file.name)],g.push({uid:t.file.uid,path:n}),p.value--},file:t.file});return}try{const n=await q.getOssInstance(F);t.file.oss=n,U({file:t.file,dirName:B,oss:n,successCallBack(a){t.onSuccess(a),s.value?s.value.push(f.getReturnData(d,a,t.file.name)):s.value=[f.getReturnData(d,a,t.file.name)],g.push({uid:t.file.uid,path:a}),p.value--},errorCallBack(a){c.message.warning(a||o("ap.apUpload.networkAnomaly")),t.onError({name:a,message:a}),p.value--},progressCallBack(a){t.onProgress({percent:a})}})}catch(n){c.message.warning(typeof(n==null?void 0:n.message)=="string"?n.message:o("ap.apUpload.networkAnomaly")),t.onError({name:(n==null?void 0:n.message)||o("ap.apUpload.networkAnomaly"),message:(n==null?void 0:n.message)||o("ap.apUpload.networkAnomaly")}),p.value--}}function D(t){var a;if(t.response){if(Array.isArray(s.value)){const r=g.findIndex(u=>u.uid===t.uid);r>=0&&(s==null||s.value.splice(r,1),g.splice(r,1)),s.value.length===0&&(s.value=void 0)}}else(a=t==null?void 0:t.oss)==null||a.pauseUpload();const n=m.findIndex(r=>r.uid===t.uid);return m.splice(n,1),Promise.resolve(!0)}return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(y)()]:!0,[e.unref(y)("admin")]:e.unref(A)==="admin"})},[e.createVNode(e.unref(c.Upload),{ref_key:"uploadRef",ref:l,accept:e.unref(x),multiple:"",maxCount:e.unref(i),progress:{strokeWidth:3,showInfo:!1,strokeColor:"#0070FF"},beforeUpload:S,customRequest:b,onRemove:D},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(e.unref(c.Button),{class:"file-btn"},{default:e.withCtx(()=>[e.createVNode(e.unref(R.UploadOutlined)),e.createTextVNode(" "+e.toDisplayString(e.unref(E)),1)]),_:1}),e.createElementVNode("div",{class:"sub-title",onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},[typeof e.unref(v)=="string"?(e.openBlock(),e.createElementBlock("div",z,e.toDisplayString(e.unref(v)||`${e.unref(o)("ap.apUpload.supportExtension")}:${e.unref(T.getAcceptText)(e.unref(x))}`),1)):e.unref(v)?(e.openBlock(),e.createElementBlock("div",M,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v))))])):e.createCommentVNode("",!0)])])]),_:1},8,["accept","maxCount"])],2))}});exports.default=V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const m=require("../utils/returnData.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../config-provider/index.js");const m=require("../utils/returnData.js"),U=require("@ant-design/icons-vue"),_=require("../hooks/useOss.js"),S=require("../utils/accept.js"),l=require("ant-design-vue");require("../styles/picture.css");const $=require("../../config-provider/hooks/use-locale.js"),T=require("../../config-provider/hooks/use-namespace.js"),M=["accept"],L={class:"picture-context"},G={class:"picture-item-box"},H=["src"],J={class:"picture-item-shadow"},K=["onClick"],Q={key:0,class:"picture-item-uploading"},W={class:"picture-title"},X={key:0},Y={key:1},Z=e.defineComponent({__name:"Picture",setup(F){const{t:u}=$.useLocale(),{b:y}=T.useNamespace("ap-upload-picture"),{put:j}=_.useOss(),q=e.inject("theme"),D=e.inject("dirName"),v=e.inject("accept")||"image/*",k=e.inject("maxSize")??5,x=e.inject("title"),r=e.inject("maxCount")??10,p=e.inject("uploadingCount"),w=e.inject("beforeUpload"),N=e.inject("customRequest"),C=e.inject("getOssAccess"),h=e.ref(null),i=e.inject("value"),f=e.inject("needName");let o=e.ref([]);const g=[];e.watch(()=>i==null?void 0:i.value,async function(t){var s;if(!((s=o==null?void 0:o.value)!=null&&s.length)&&t){const a=[];for(let n of t){const c=m.getPath(f,n),d=m.getName(f,n),B=await _.getOssInstance(C),z=await B.getSignatureUrl(c),O={...new File([n],d,{}),uid:`${new Date().getTime()}-${Math.random()}`,thumbUrl:z,status:"success",percent:100,path:c};a.push(O),B.destroy()}if(r&&a.length>r){l.message.warning(u("ap.apUpload.fileInitializationException",{maxCount:r}));return}a.forEach(n=>{o.value.push(n),g.push({uid:n.uid,path:n.path})})}},{immediate:!0});function V(){var t;(t=h.value)==null||t.click()}function P(t){const s=t.target;R(s==null?void 0:s.files)}function R(t){if(t!=null&&t.length)for(let s=0;s<t.length;s++)b(t[s]);h.value&&(h.value.value="")}let E;function b(t){if(r&&r>1&&o.value.length>=r)return clearTimeout(E),E=setTimeout(()=>{l.message.warning(u("ap.apUpload.maxUploadPicture",{maxCount:r}))}),!1;if(typeof w=="function"){if(w(t)===!1)return!1}else{if(t.size>k*1024*1024)return l.message.warning(u("ap.apUpload.maxUploadFileSize",{maxSize:k})),!1;if(!/image\/\w+/.test(t.type)||!S.fileMatchesAccept(t,v))return l.message.warning(u("ap.apUpload.pictureFormatNotSupported")),!1}const s=new FileReader;s.readAsDataURL(t),s.onload=function(){const a={...t,uid:`${new Date().getTime()}-${Math.random()}`,thumbUrl:this.result,status:"uploading",percent:0};A(a,t)},s.onerror=function(){l.message.warning(u("ap.apUpload.imageParsingFailed"))}}async function A(t,s){if(p.value++,typeof N=="function"){N({onProgress:a=>{const n=o.value.find(c=>c.uid===t.uid);n&&(n.percent=a)},onError:a=>{l.message.warning(a||u("ap.apUpload.networkAnomaly"));const n=o.value.findIndex(c=>c.uid===t.uid);n>-1&&o.value.splice(n,1),p.value--},onSuccess:a=>{const n=o.value.find(c=>c.uid===t.uid);n&&(n.status="success",n.path=a),i.value?i.value.push(m.getReturnData(f,a,s.name)):i.value=[m.getReturnData(f,a,s.name)],g.push({uid:t.uid,path:a}),p.value--},file:s});return}try{const a=await _.getOssInstance(C);t.oss=a,o.value.push(t),j({file:s,dirName:D,oss:a,successCallBack(n){const c=o.value.find(d=>d.uid===t.uid);c&&(c.status="success",c.path=n),i.value?i.value.push(m.getReturnData(f,n,s.name)):i.value=[m.getReturnData(f,n,s.name)],g.push({uid:t.uid,path:n}),p.value--},errorCallBack(n){l.message.warning(n||u("ap.apUpload.networkAnomaly"));const c=o.value.findIndex(d=>d.uid===t.uid);c>-1&&o.value.splice(c,1),p.value--},progressCallBack(n){const c=o.value.find(d=>d.uid===t.uid);c&&(c.percent=n)}})}catch(a){l.message.warning(typeof(a==null?void 0:a.message)=="string"?a.message:u("ap.apUpload.networkAnomaly"));const n=o.value.findIndex(c=>c.uid===t.uid);n>-1&&o.value.splice(n,1),p.value--}}function I(t){var a;if(t.path){if(Array.isArray(i.value)){const n=g.findIndex(c=>c.uid===t.uid);n>=0&&(i==null||i.value.splice(n,1),g.splice(n,1)),i.value.length===0&&(i.value=void 0)}}else(a=t==null?void 0:t.oss)==null||a.pauseUpload();const s=o.value.findIndex(n=>n.uid===t.uid);return o.value.splice(s,1),Promise.resolve(!0)}return(t,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({[e.unref(y)()]:!0,[e.unref(y)("admin")]:e.unref(q)==="admin"})},[e.createElementVNode("input",{style:{display:"none"},type:"file",ref_key:"fileRef",ref:h,accept:e.unref(v),onChange:P},null,40,M),e.createElementVNode("div",L,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),a=>(e.openBlock(),e.createElementBlock("div",{class:"picture-item",key:a.uid},[e.createElementVNode("div",G,[e.createElementVNode("img",{src:a.thumbUrl,alt:""},null,8,H),e.withDirectives(e.createElementVNode("div",J,[e.createElementVNode("div",{class:"picture-item-close",onClick:n=>I(a)},[e.createVNode(e.unref(U.CloseOutlined))],8,K),a.status==="uploading"?(e.openBlock(),e.createElementBlock("div",Q,[e.createVNode(e.unref(l.Progress),{percent:a.percent,strokeColor:"#ffffff",trailColor:"rgba(255, 255, 255, 0.3)",size:4,showInfo:!1},null,8,["percent"])])):e.createCommentVNode("",!0)],512),[[e.vShow,a.status==="uploading"]])])]))),128)),e.unref(r)===void 0||e.unref(o).length<e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"picture-upload",onClick:V},[e.createVNode(e.unref(U.PlusOutlined)),e.createElementVNode("div",null,e.toDisplayString(e.unref(u)("ap.apUpload.update")),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",W,[e.unref(x)?(e.openBlock(),e.createElementBlock("div",X,e.toDisplayString(e.unref(x)),1)):(e.openBlock(),e.createElementBlock("div",Y,e.toDisplayString(`${e.unref(u)("ap.apUpload.supportExtension")}:${e.unref(S.getAcceptText)(e.unref(v))},${e.unref(u)("ap.apUpload.maxUploadPictureSize",{maxSize:e.unref(k)})}`),1))])],2))}});exports.default=Z;
|