@kyfe/fms-vue2-components 0.0.14 → 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.
@@ -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 _ } from "./fms-copy-box/index.js";
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 oo } from "./fms-ks-more-lines/index.js";
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 mo } from "./fms-ks-page-popup/index.js";
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 to } from "./fms-ks-block-title/index.js";
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 po } from "./fms-ks-warn-drawer/index.js";
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 Fo } from "./fms-empty/index.js";
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 io } from "./fms-ks-file-upload/index.js";
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 xo } from "./fms-ks-file-view/index.js";
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 co } from "./fms-scroll-list/index.js";
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 no } from "./fms-ks-form-grid/index.js";
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 To } from "./fms-ks-upload/index.js";
29
+ import { default as Mo } from "./fms-ks-upload/index.js";
30
30
  import "./fms-ks-picker/index.js";
31
- import { default as yo } from "./fms-ks-uploader/index.js";
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 Po } from "./fms-approval-header/index.js";
34
- import { F as d } from "./fms-ks-clamp-text.29353cc2.js";
35
- import { F as Uo } from "./fms-ks-clamp-text.29353cc2.js";
36
- import { F as c } from "./fms-ks-select.002b6536.js";
37
- import { F as Co } from "./fms-ks-select.002b6536.js";
38
- import { F as u } from "./fms-ks-select-box.b75cf9d8.js";
39
- import { F as Lo } from "./fms-ks-select-box.b75cf9d8.js";
40
- import { F as n } from "./fms-ks-decrypt.e9bc1873.js";
41
- import { F as go } from "./fms-ks-decrypt.e9bc1873.js";
42
- import { F as S } from "./fms-ks-search-tips.d36859c3.js";
43
- import { F as Ao } from "./fms-ks-search-tips.d36859c3.js";
44
- import { F as T } from "./fms-ks-search-tips-new.d68b86e6.js";
45
- import { F as Ho } from "./fms-ks-search-tips-new.d68b86e6.js";
46
- import { F as w } from "./fms-ks-picker.766b55f9.js";
47
- import { F as No } from "./fms-ks-picker.766b55f9.js";
48
- const y = [m, d, s, t, c, u, e, p, a, n, F, f, i, l, S, x, T, w, K], B = function(r) {
49
- y.forEach((o) => {
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
- }, X = {
53
- install: B
56
+ }, $ = {
57
+ install: P
54
58
  };
55
59
  export {
56
- Po as FmsApprovalHeader,
57
- _ as FmsCopyBox,
58
- Fo as FmsEmpty,
59
- to as FmsKsBlockTitle,
60
- Uo as FmsKsClampText,
61
- go as FmsKsDecrypt,
62
- io as FmsKsFileUpload,
63
- xo as FmsKsFileView,
64
- no as FmsKsFormGrid,
65
- oo as FmsKsMoreLines,
66
- mo as FmsKsPagePopup,
67
- No as FmsKsPicker,
68
- Ao as FmsKsSearchTips,
69
- Ho as FmsKsSearchTipsNew,
70
- Co as FmsKsSelect,
71
- Lo as FmsKsSelectBox,
72
- To as FmsKsUpload,
73
- yo as FmsKsUploader,
74
- po as FmsKsWarnDrawer,
75
- co as FmsScrollList,
76
- X as default
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.c4804aac.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.af0aec1f.js";
3
3
  const m = {
4
4
  components: {
5
5
  DateSelect: a,
@@ -1 +1 @@
1
- .ks-date-picker__body{flex:1;overflow:hidden;height:100%;position:relative}.ks-date-picker .van-calendar__body{height:100%;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.ks-date-picker .van-calendar__month-title{height:40px;line-height:40px;color:#333}.ks-date-picker .van-calendar__day{color:#333}.ks-date-picker .van-calendar__day.van-calendar__day--disabled{color:#ccc}.ks-date-picker .van-calendar__selected-day,.ks-date-picker .van-calendar__day--start,.ks-date-picker .van-calendar__day--end{color:#fff;background-color:#7972fe;border-radius:50%;width:44px;height:44px;line-height:44px;display:flex;align-items:center;justify-content:center}.ks-date-picker .van-calendar__day--start-end{color:#fff;background-color:#7972fe;width:54px;height:44px;line-height:44px;display:flex;align-items:center;justify-content:center;position:relative}.ks-date-picker .van-calendar__day--middle:after{top:3px;bottom:3px}.ks-date-picker .van-calendar__day--start,.ks-date-picker .van-calendar__day--end{position:relative}.ks-date-picker .van-calendar__day--start:after{position:absolute;left:50%;top:0;bottom:0;width:85%;content:" ";background-color:#7972fe1a}.ks-date-picker .van-calendar__day--end:after{position:absolute;right:50%;top:0;bottom:0;width:85%;content:" ";background-color:#7972fe1a}.ks-date-picker .van-calendar__bottom-info{font-size:10px;line-height:10px;font-weight:300;bottom:3px;position:absolute;right:0;left:0}.ks-date-picker .van-calendar__confirm{height:44px;line-height:44px;margin-top:0}.ks-date-picker-right-popup{width:70%}.ks-date-picker-right-popup .van-popup__close-icon--top-left{top:10px}.ks-date-picker-right{height:100vh;overflow:hidden;display:flex;flex-direction:column}.ks-date-picker-right__header{height:40px;width:375px;margin:0 auto}.ks-date-picker-right__header-title{text-align:center;height:40px;line-height:40px;font-size:14px;color:#7972fe;box-shadow:0 3px 10px #ebebeb4d}.ks-date-picker-right__header-title-split{color:#333}.ks-date-picker-right__header-title-end-not{color:#ddd}.ks-date-picker-right .ks-date-picker__body{width:375px;margin:0 auto}.ks-date-picker-right__footer{height:60px;padding:16px 80px 0;box-shadow:0 0 4px #9e9bda38;z-index:1}
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.14",
3
+ "version": "0.0.15",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -8,7 +8,7 @@
8
8
  error-message-align="right"
9
9
  :required="required"
10
10
  name="picker"
11
- :value="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="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
- const { code = '' } = value
62
- this.$emit('input', code, value)
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>
@@ -0,0 +1,7 @@
1
+ import FmsMoneySplit from './fms-money-split.vue'
2
+
3
+ FmsMoneySplit.install = function(Vue) {
4
+ Vue.component(FmsMoneySplit.name, FmsMoneySplit)
5
+ }
6
+
7
+ export default FmsMoneySplit