@kyfe/fms-vue2-components 0.0.11 → 0.0.15
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/dist/{date-picker-bottom.deb0334b.js → date-picker-bottom.5688d83c.js} +1 -1
- package/dist/{date-picker-dropdown.8820ef37.js → date-picker-dropdown.c082cbff.js} +1 -1
- package/dist/{date-picker-right.90fb4b93.js → date-picker-right.511a96e2.js} +1 -1
- package/dist/{date-picker-top.535bf0c5.js → date-picker-top.17ea98f4.js} +1 -1
- package/dist/{date-week-month.f258023a.js → date-week-month.7daaa52f.js} +1 -1
- package/dist/fms-ks-components/index.js +2 -2
- package/dist/{fms-ks-components.c4804aac.js → fms-ks-components.af0aec1f.js} +6 -6
- package/dist/fms-ks-form-grid/index.js +1 -1
- package/dist/fms-ks-picker/index.js +2 -2
- package/dist/fms-ks-picker.906d4deb.js +99 -0
- package/dist/fms-money-split/index.js +62 -0
- package/dist/fms-money-split/style.css +1 -0
- package/dist/fms-text-more/index.js +11603 -0
- package/dist/fms-text-more/style.css +1 -0
- package/dist/index.js +58 -52
- package/dist/{mixin.ce520697.js → mixin.4e154332.js} +1 -1
- package/dist/oa-datetime-picker-new/style.css +1 -1
- package/package.json +2 -2
- package/src/components/fms-ks-picker/fms-ks-picker.vue +61 -5
- package/src/components/fms-money-split/fms-money-split.vue +76 -0
- package/src/components/fms-money-split/index.js +7 -0
- package/src/components/fms-text-more/fms-text-more.vue +353 -0
- package/src/components/fms-text-more/index.js +7 -0
- package/src/index.js +6 -0
- package/dist/fms-ks-picker.766b55f9.js +0 -61
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.fms-text-more[data-v-dc67b7a5]{display:flex}.fms-text-more .fms-text-more-content[data-v-dc67b7a5]{flex:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:var(--expandLine);-webkit-box-orient:vertical;word-break:break-all}.fms-text-more .fms-text-more-content.expanded[data-v-dc67b7a5]{-webkit-line-clamp:unset}.fms-text-more .fms-text-more-icon[data-v-dc67b7a5]{margin-left:4px;flex-shrink:0;flex-grow:0}.fms-text-more-expand[data-v-dc67b7a5]{margin-top:12px;display:flex;align-items:center;width:100%;justify-content:center;color:#9e9cb0;font-size:12px;height:16px;cursor:pointer}.fms-text-more-expand .van-icon[data-v-dc67b7a5]{margin-left:4px}.fms-text-more-more[data-v-dc67b7a5]{display:flex;margin-top:12px;color:#9e9cb0;align-items:center;justify-content:center;cursor:pointer}.fms-text-more-more .fms-text-more-more-text[data-v-dc67b7a5]{margin-right:4px}.fms-text-more-popup .fms-text-more-popup-title[data-v-dc67b7a5]{height:40px;display:flex;align-items:center;justify-content:space-between;font-size:18px;padding:16px;border-radius:16px 16px 0 0}.fms-text-more-popup .fms-text-more-popup-content[data-v-dc67b7a5]{line-height:24px;font-size:15px;padding:0 16px 16px;overflow:auto;color:#18153a;word-break:break-word}
|
package/dist/index.js
CHANGED
|
@@ -1,77 +1,83 @@
|
|
|
1
1
|
import './fms-copy-box/style.css';
|
|
2
2
|
import m from "./fms-copy-box/index.js";
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as mo } from "./fms-copy-box/index.js";
|
|
4
4
|
import "./fms-ks-clamp-text/index.js";
|
|
5
5
|
import s from "./fms-ks-more-lines/index.js";
|
|
6
|
-
import { default as
|
|
6
|
+
import { default as to } from "./fms-ks-more-lines/index.js";
|
|
7
7
|
import t from "./fms-ks-page-popup/index.js";
|
|
8
|
-
import { default as
|
|
8
|
+
import { default as po } from "./fms-ks-page-popup/index.js";
|
|
9
9
|
import "./fms-ks-select/index.js";
|
|
10
10
|
import "./fms-ks-select-box/index.js";
|
|
11
11
|
import e from "./fms-ks-block-title/index.js";
|
|
12
|
-
import { default as
|
|
12
|
+
import { default as Fo } from "./fms-ks-block-title/index.js";
|
|
13
13
|
import p from "./fms-ks-warn-drawer/index.js";
|
|
14
|
-
import { default as
|
|
14
|
+
import { default as io } from "./fms-ks-warn-drawer/index.js";
|
|
15
15
|
import a from "./fms-empty/index.js";
|
|
16
|
-
import { default as
|
|
16
|
+
import { default as xo } from "./fms-empty/index.js";
|
|
17
17
|
import "./fms-ks-decrypt/index.js";
|
|
18
18
|
import F from "./fms-ks-file-upload/index.js";
|
|
19
|
-
import { default as
|
|
19
|
+
import { default as co } from "./fms-ks-file-upload/index.js";
|
|
20
20
|
import f from "./fms-ks-file-view/index.js";
|
|
21
|
-
import { default as
|
|
21
|
+
import { default as no } from "./fms-ks-file-view/index.js";
|
|
22
22
|
import i from "./fms-scroll-list/index.js";
|
|
23
|
-
import { default as
|
|
23
|
+
import { default as To } from "./fms-scroll-list/index.js";
|
|
24
24
|
import l from "./fms-ks-form-grid/index.js";
|
|
25
|
-
import { default as
|
|
25
|
+
import { default as wo } from "./fms-ks-form-grid/index.js";
|
|
26
26
|
import "./fms-ks-search-tips/index.js";
|
|
27
27
|
import "./fms-ks-search-tips-new/index.js";
|
|
28
28
|
import x from "./fms-ks-upload/index.js";
|
|
29
|
-
import { default as
|
|
29
|
+
import { default as Mo } from "./fms-ks-upload/index.js";
|
|
30
30
|
import "./fms-ks-picker/index.js";
|
|
31
|
-
import { default as
|
|
31
|
+
import { default as ho } from "./fms-ks-uploader/index.js";
|
|
32
32
|
import K from "./fms-approval-header/index.js";
|
|
33
|
-
import { default as
|
|
34
|
-
import
|
|
35
|
-
import {
|
|
36
|
-
import
|
|
37
|
-
import {
|
|
38
|
-
import { F as u } from "./fms-ks-
|
|
39
|
-
import { F as
|
|
40
|
-
import { F as n } from "./fms-ks-
|
|
41
|
-
import { F as
|
|
42
|
-
import { F as S } from "./fms-ks-
|
|
43
|
-
import { F as
|
|
44
|
-
import { F as T } from "./fms-ks-
|
|
45
|
-
import { F as
|
|
46
|
-
import { F as
|
|
47
|
-
import { F as
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
import { default as ko } from "./fms-approval-header/index.js";
|
|
34
|
+
import d from "./fms-money-split/index.js";
|
|
35
|
+
import { default as Do } from "./fms-money-split/index.js";
|
|
36
|
+
import c from "./fms-text-more/index.js";
|
|
37
|
+
import { default as Eo } from "./fms-text-more/index.js";
|
|
38
|
+
import { F as u } from "./fms-ks-clamp-text.29353cc2.js";
|
|
39
|
+
import { F as vo } from "./fms-ks-clamp-text.29353cc2.js";
|
|
40
|
+
import { F as n } from "./fms-ks-select.002b6536.js";
|
|
41
|
+
import { F as Go } from "./fms-ks-select.002b6536.js";
|
|
42
|
+
import { F as S } from "./fms-ks-select-box.b75cf9d8.js";
|
|
43
|
+
import { F as No } from "./fms-ks-select-box.b75cf9d8.js";
|
|
44
|
+
import { F as T } from "./fms-ks-decrypt.e9bc1873.js";
|
|
45
|
+
import { F as Wo } from "./fms-ks-decrypt.e9bc1873.js";
|
|
46
|
+
import { F as y } from "./fms-ks-search-tips.d36859c3.js";
|
|
47
|
+
import { F as jo } from "./fms-ks-search-tips.d36859c3.js";
|
|
48
|
+
import { F as w } from "./fms-ks-search-tips-new.d68b86e6.js";
|
|
49
|
+
import { F as zo } from "./fms-ks-search-tips-new.d68b86e6.js";
|
|
50
|
+
import { F as B } from "./fms-ks-picker.906d4deb.js";
|
|
51
|
+
import { F as Jo } from "./fms-ks-picker.906d4deb.js";
|
|
52
|
+
const M = [m, u, s, t, n, S, e, p, a, T, F, f, i, l, y, x, w, B, K, d, c], P = function(r) {
|
|
53
|
+
M.forEach((o) => {
|
|
50
54
|
r.component(o.name, o);
|
|
51
55
|
});
|
|
52
|
-
},
|
|
53
|
-
install:
|
|
56
|
+
}, $ = {
|
|
57
|
+
install: P
|
|
54
58
|
};
|
|
55
59
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
ko as FmsApprovalHeader,
|
|
61
|
+
mo as FmsCopyBox,
|
|
62
|
+
xo as FmsEmpty,
|
|
63
|
+
Fo as FmsKsBlockTitle,
|
|
64
|
+
vo as FmsKsClampText,
|
|
65
|
+
Wo as FmsKsDecrypt,
|
|
66
|
+
co as FmsKsFileUpload,
|
|
67
|
+
no as FmsKsFileView,
|
|
68
|
+
wo as FmsKsFormGrid,
|
|
69
|
+
to as FmsKsMoreLines,
|
|
70
|
+
po as FmsKsPagePopup,
|
|
71
|
+
Jo as FmsKsPicker,
|
|
72
|
+
jo as FmsKsSearchTips,
|
|
73
|
+
zo as FmsKsSearchTipsNew,
|
|
74
|
+
Go as FmsKsSelect,
|
|
75
|
+
No as FmsKsSelectBox,
|
|
76
|
+
Mo as FmsKsUpload,
|
|
77
|
+
ho as FmsKsUploader,
|
|
78
|
+
io as FmsKsWarnDrawer,
|
|
79
|
+
Do as FmsMoneySplit,
|
|
80
|
+
To as FmsScrollList,
|
|
81
|
+
Eo as FmsTextMore,
|
|
82
|
+
$ as default
|
|
77
83
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as s } from "./utils.159fba19.js";
|
|
2
|
-
import { D as a, a as n, M as r, b as i, W as l, Q as h, c as o } from "./fms-ks-components.
|
|
2
|
+
import { D as a, a as n, M as r, b as i, W as l, Q as h, c as o } from "./fms-ks-components.af0aec1f.js";
|
|
3
3
|
const m = {
|
|
4
4
|
components: {
|
|
5
5
|
DateSelect: a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ks-
|
|
1
|
+
.ks-daterange-select .van-calendar__day{margin:3px 0}.ks-daterange-select .van-calendar__day--middle{color:#7972fe!important}.ks-daterange-select .van-calendar__day--middle:after{top:0!important;bottom:0!important}.ks-daterange-select .van-calendar__day--start,.ks-daterange-select .van-calendar__day--end{margin-left:calc((14.285% - 44px)/2);margin-right:calc((14.285% - 44px)/2)}.ks-daterange-select .van-calendar__day--start-end{margin-left:calc((14.285% - 54px)/2);margin-right:calc((14.285% - 54px)/2)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyfe/fms-vue2-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@kyfe/decrypt": "^0.0.7",
|
|
24
|
-
"@kyfe/fms-utils": "
|
|
24
|
+
"@kyfe/fms-utils": "1.0.1",
|
|
25
25
|
"dayjs": "^1.11.13",
|
|
26
26
|
"vant": "2.5.6"
|
|
27
27
|
},
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
error-message-align="right"
|
|
9
9
|
:required="required"
|
|
10
10
|
name="picker"
|
|
11
|
-
:value="
|
|
11
|
+
:value="displayValue"
|
|
12
12
|
:label="label"
|
|
13
13
|
right-icon="arrow"
|
|
14
14
|
:rules="[{ required: required, message: `请选择${label}` }]"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
<ks-popup v-model="showPicker"
|
|
18
18
|
position="bottom">
|
|
19
19
|
<ks-picker show-toolbar
|
|
20
|
-
:columns="
|
|
20
|
+
:columns="pickerColumns"
|
|
21
21
|
@confirm="onConfirm"
|
|
22
22
|
@cancel="showPicker = false" />
|
|
23
23
|
</ks-popup>
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
type: Array,
|
|
44
44
|
default: () => []
|
|
45
45
|
},
|
|
46
|
+
// 新增:支持数组或函数
|
|
47
|
+
options: {
|
|
48
|
+
type: [Array, Function],
|
|
49
|
+
default: () => []
|
|
50
|
+
},
|
|
46
51
|
required: {
|
|
47
52
|
type: Boolean,
|
|
48
53
|
default: false
|
|
@@ -53,13 +58,64 @@
|
|
|
53
58
|
showPicker: false
|
|
54
59
|
}
|
|
55
60
|
},
|
|
61
|
+
computed: {
|
|
62
|
+
// 计算原始 options
|
|
63
|
+
rawOptions () {
|
|
64
|
+
if (typeof this.options === 'function') {
|
|
65
|
+
return this.options() || []
|
|
66
|
+
}
|
|
67
|
+
return this.options || []
|
|
68
|
+
},
|
|
69
|
+
// 有 options 优先用 options,否则用 columns
|
|
70
|
+
pickerColumns () {
|
|
71
|
+
return this.rawOptions.length ? this.rawOptions : this.columns
|
|
72
|
+
},
|
|
73
|
+
// 回显:根据 code 找 text(支持多级)
|
|
74
|
+
displayValue () {
|
|
75
|
+
return this.findTextByCode(this.pickerColumns, this.value) || this.value
|
|
76
|
+
}
|
|
77
|
+
},
|
|
56
78
|
methods: {
|
|
79
|
+
// 递归根据 code 找 text
|
|
80
|
+
findTextByCode (list, code) {
|
|
81
|
+
for (const item of list || []) {
|
|
82
|
+
if (String(item.code) === String(code)) {
|
|
83
|
+
return item.text
|
|
84
|
+
}
|
|
85
|
+
if (Array.isArray(item.children) && item.children.length) {
|
|
86
|
+
const text = this.findTextByCode(item.children, code)
|
|
87
|
+
if (text) return text
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return ''
|
|
91
|
+
},
|
|
92
|
+
// 根据各级索引取出最后一级节点
|
|
93
|
+
getSelectedNode (indexes) {
|
|
94
|
+
let list = this.pickerColumns
|
|
95
|
+
let node = null
|
|
96
|
+
for (const index of indexes || []) {
|
|
97
|
+
if (!list || !list[index]) {
|
|
98
|
+
return null
|
|
99
|
+
}
|
|
100
|
+
node = list[index]
|
|
101
|
+
list = node.children || []
|
|
102
|
+
}
|
|
103
|
+
return node
|
|
104
|
+
},
|
|
57
105
|
showPickerFn () {
|
|
58
106
|
this.showPicker = true
|
|
59
107
|
},
|
|
60
|
-
onConfirm (value) {
|
|
61
|
-
|
|
62
|
-
|
|
108
|
+
onConfirm (value, arr) {
|
|
109
|
+
let node = null
|
|
110
|
+
// 单列(非级联):value 直接是选中项对象
|
|
111
|
+
if (value && !Array.isArray(value) && typeof value === 'object') {
|
|
112
|
+
node = value
|
|
113
|
+
} else {
|
|
114
|
+
// 级联:arr 是各级索引数组,逐级定位到叶子节点
|
|
115
|
+
node = this.getSelectedNode(Array.isArray(arr) ? arr : [])
|
|
116
|
+
}
|
|
117
|
+
const code = node ? node.code : ''
|
|
118
|
+
this.$emit('input', code, node)
|
|
63
119
|
this.showPicker = false
|
|
64
120
|
}
|
|
65
121
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="fms-money-split">
|
|
3
|
+
<template v-for="(item, index) in moneyUnits">
|
|
4
|
+
<span :key="`amount-${index}`"
|
|
5
|
+
class="fms-money-split__amount"
|
|
6
|
+
:style="amountStyle">{{ item.amount }}</span>
|
|
7
|
+
<span :key="`unit-${index}`"
|
|
8
|
+
class="fms-money-split__unit"
|
|
9
|
+
:style="unitStyle">{{ item.unit }}</span>
|
|
10
|
+
</template>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
import * as filter from '@kyfe/fms-utils/filter'
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 提取金额和中文单位
|
|
19
|
+
* @param {string} moneyStr - 金额字符串,如 '2092万3249元'
|
|
20
|
+
* @returns {Array} - 返回金额和单位的数组,如 [{ amount: '2092', unit: '万' }, { amount: '3249', unit: '元' }]
|
|
21
|
+
*/
|
|
22
|
+
function extractMoneyAndUnits (moneyStr) {
|
|
23
|
+
// 正则表达式匹配金额和中文单位(支持亿、万、元单位)
|
|
24
|
+
const regex = /([\d.]+)([亿万元]+)?/g
|
|
25
|
+
const matches = []
|
|
26
|
+
let match
|
|
27
|
+
|
|
28
|
+
while ((match = regex.exec(moneyStr)) !== null) {
|
|
29
|
+
matches.push({
|
|
30
|
+
amount: match[1],
|
|
31
|
+
unit: match[2]
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return matches
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
name: 'FmsMoneySplit',
|
|
40
|
+
props: {
|
|
41
|
+
amount: {
|
|
42
|
+
type: [Number, String],
|
|
43
|
+
default: ''
|
|
44
|
+
},
|
|
45
|
+
// 金额部分样式,可传入自定义样式覆盖默认
|
|
46
|
+
amountStyle: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => ({
|
|
49
|
+
fontSize: '22px',
|
|
50
|
+
fontWeight: 'bold'
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
// 单位部分样式,可传入自定义样式覆盖默认
|
|
54
|
+
unitStyle: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: () => ({
|
|
57
|
+
fontSize: '12px'
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
moneyUnits () {
|
|
63
|
+
return extractMoneyAndUnits(filter.numberSplitInt(this.amount))
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style lang="less" scoped>
|
|
70
|
+
.fms-money-split {
|
|
71
|
+
height: 26px;
|
|
72
|
+
display: flex;
|
|
73
|
+
align-items: baseline;
|
|
74
|
+
color: #ff8600;
|
|
75
|
+
}
|
|
76
|
+
</style>
|