@kyfe/fms-vue2-components 0.0.3 → 0.0.5
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/assets/css/fms-ks-clamp-text.css +1 -0
- package/dist/assets/css/fms-ks-components.css +1 -0
- package/dist/assets/css/fms-ks-popover.css +1 -0
- package/dist/assets/css/fms-ks-search-tips-new.css +1 -0
- package/dist/assets/css/fms-ks-search-tips.css +1 -0
- package/dist/assets/css/fms-ks-select-box.css +1 -0
- package/dist/assets/css/fms-ks-select.css +1 -0
- package/dist/date-picker-bottom.17e75dc0.js +45 -0
- package/dist/date-picker-dropdown.1d8e9f00.js +34 -0
- package/dist/date-picker-right.b939e886.js +23 -0
- package/dist/date-picker-top.c38046f7.js +23 -0
- package/dist/date-range-select.647edaf6.js +69 -0
- package/dist/date-select.96eb3a9d.js +60 -0
- package/dist/date-week-month.169b98bc.js +57 -0
- package/dist/datetime-popup/index.js +411 -0
- package/dist/filter.c93f4ddb.js +45 -0
- package/dist/fms-copy-box/index.js +1 -1
- package/dist/fms-ks-block-title/index.js +38 -0
- package/dist/fms-ks-block-title/style.css +1 -0
- package/dist/fms-ks-clamp-text/index.js +9 -0
- package/dist/fms-ks-clamp-text.24eb5e8d.js +53 -0
- package/dist/fms-ks-components/index.js +9 -0
- package/dist/fms-ks-components.a5d9329b.js +4392 -0
- package/dist/fms-ks-decrypt/index.js +2 -2
- package/dist/fms-ks-decrypt.2f88e659.js +312 -0
- package/dist/fms-ks-file-upload/index.js +32 -31
- package/dist/fms-ks-file-upload/style.css +1 -1
- package/dist/fms-ks-form-grid/index.js +101 -0
- package/dist/fms-ks-form-grid/style.css +1 -0
- package/dist/fms-ks-more-lines/index.js +31 -0
- package/dist/fms-ks-more-lines/style.css +1 -0
- package/dist/fms-ks-page-popup/index.js +68 -0
- package/dist/fms-ks-page-popup/style.css +1 -0
- package/dist/fms-ks-picker/index.js +9 -0
- package/dist/fms-ks-picker.766b55f9.js +61 -0
- package/dist/fms-ks-popover/index.js +9 -0
- package/dist/fms-ks-popover.55ab4b82.js +95 -0
- package/dist/fms-ks-search-tips/index.js +9 -0
- package/dist/fms-ks-search-tips-new/index.js +9 -0
- package/dist/fms-ks-search-tips-new.7d08f710.js +125 -0
- package/dist/fms-ks-search-tips.d36859c3.js +142 -0
- package/dist/fms-ks-select/index.js +9 -0
- package/dist/fms-ks-select-box/index.js +9 -0
- package/dist/fms-ks-select-box.a00f0f08.js +43 -0
- package/dist/fms-ks-select.59416fd8.js +157 -0
- package/dist/fms-ks-warn-drawer/index.js +37 -0
- package/dist/fms-ks-warn-drawer/style.css +1 -0
- package/dist/fms-scroll-list/index.js +3 -1
- package/dist/index.js +30 -30
- package/dist/mixin.f4bc60f0.js +59 -0
- package/dist/month-range-select.374653da.js +97 -0
- package/dist/month-select.30ae7335.js +71 -0
- package/dist/oa-datetime-picker-new/style.css +1 -0
- package/dist/quarter-select.b6256880.js +73 -0
- package/dist/utils.159fba19.js +64 -0
- package/dist/week-select.27efca5c.js +70 -0
- package/package.json +31 -31
- package/src/assets/images/attachment/icon_default.svg +23 -0
- package/src/assets/images/attachment/icon_default_new.png +0 -0
- package/src/assets/images/attachment/icon_excel.svg +20 -0
- package/src/assets/images/attachment/icon_excel_new.png +0 -0
- package/src/assets/images/attachment/icon_file.png +0 -0
- package/src/assets/images/attachment/icon_pdf_new.png +0 -0
- package/src/assets/images/attachment/icon_ppt.svg +20 -0
- package/src/assets/images/attachment/icon_ppt_new.png +0 -0
- package/src/assets/images/attachment/icon_preview_file.png +0 -0
- package/src/assets/images/attachment/icon_txt.png +0 -0
- package/src/assets/images/attachment/icon_word.svg +19 -0
- package/src/assets/images/attachment/icon_word_new.png +0 -0
- package/src/assets/images/attachment/icon_xmind.png +0 -0
- package/src/assets/images/icon-arrow.png +0 -0
- package/src/assets/images/icon-forewarning.svg +1 -0
- package/src/components/date-picker/index.vue +205 -0
- package/src/components/datetime-picker-general/index.vue +161 -0
- package/src/components/datetime-popup/date-picker.js +217 -0
- package/src/components/datetime-popup/index.js +37 -0
- package/src/components/datetime-popup/index.vue +111 -0
- package/src/components/datetime-popup/mixin.js +125 -0
- package/src/components/datetime-popup/time-picker.js +102 -0
- package/src/components/datetime-popup/utils.js +124 -0
- package/src/components/datetime-popup//347/244/272/344/276/213/345/233/276.png +0 -0
- package/src/components/decrypt/README.md +0 -0
- package/src/components/decrypt/index.vue +73 -0
- package/src/components/fms-ks-block-title/fms-ks-block-title.vue +75 -0
- package/src/components/fms-ks-block-title/index.js +7 -0
- package/src/components/fms-ks-block-title//346/240/207/351/242/230.md +0 -0
- package/src/components/fms-ks-clamp-text/fms-ks-clamp-text.vue +66 -0
- package/src/components/fms-ks-clamp-text/images/icon-clamp.png +0 -0
- package/src/components/fms-ks-clamp-text/index.js +7 -0
- package/src/components/fms-ks-clamp-text//346/226/207/346/234/254/346/224/266/350/265/267/345/261/225/345/274/200.md +0 -0
- package/src/components/fms-ks-components/fms-ks-components.vue +699 -0
- package/src/components/fms-ks-components/index.js +7 -0
- package/src/components/fms-ks-components/money-directive.js +73 -0
- package/src/components/fms-ks-components//350/241/250/345/215/225/351/205/215/347/275/256/347/273/204/344/273/266/350/257/264/346/230/216.md +10 -0
- package/src/components/fms-ks-file-upload/fms-ks-file-upload.vue +8 -1
- package/src/components/fms-ks-form-grid/fields-conversion.js +107 -0
- package/src/components/fms-ks-form-grid/fms-ks-form-grid.vue +127 -0
- package/src/components/fms-ks-form-grid/index.js +7 -0
- package/src/components/fms-ks-more-lines/fms-ks-more-lines.vue +108 -0
- package/src/components/fms-ks-more-lines/index.js +7 -0
- package/src/components/fms-ks-more-lines//346/233/264/345/244/232.md +0 -0
- package/src/components/fms-ks-page-popup/fms-ks-page-popup.vue +153 -0
- package/src/components/fms-ks-page-popup/index.js +7 -0
- package/src/components/fms-ks-page-popup//345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-picker/fms-ks-picker.vue +67 -0
- package/src/components/fms-ks-picker/index.js +7 -0
- package/src/components/fms-ks-picker//351/200/211/346/213/251/345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-popover/click-outside.js +68 -0
- package/src/components/fms-ks-popover/fms-ks-popover.vue +89 -0
- package/src/components/fms-ks-popover/index.js +7 -0
- package/src/components/fms-ks-popover//345/274/271/345/207/272/345/261/202.md +0 -0
- package/src/components/fms-ks-search-tips/fms-ks-search-tips.vue +296 -0
- package/src/components/fms-ks-search-tips/index.js +7 -0
- package/src/components/fms-ks-search-tips//350/277/234/347/250/213/346/220/234/347/264/242.md +118 -0
- package/src/components/fms-ks-search-tips-new/fms-ks-search-tips-new.vue +242 -0
- package/src/components/fms-ks-search-tips-new/index.js +7 -0
- package/src/components/fms-ks-search-tips-new/style.less +137 -0
- package/src/components/fms-ks-search-tips-new//350/277/234/347/250/213/346/220/234/347/264/242-/346/226/260.md +118 -0
- package/src/components/fms-ks-select/fms-ks-select.vue +421 -0
- package/src/components/fms-ks-select/index.js +7 -0
- package/src/components/fms-ks-select//351/200/211/346/213/251/346/241/206.md +0 -0
- package/src/components/fms-ks-select-box/fms-ks-select-box.vue +84 -0
- package/src/components/fms-ks-select-box/index.js +7 -0
- package/src/components/fms-ks-select-box//344/270/215/351/234/200/350/246/201popup/347/232/204select.md +0 -0
- package/src/components/fms-ks-warn-drawer/fms-ks-warn-drawer.vue +111 -0
- package/src/components/fms-ks-warn-drawer/index.js +7 -0
- package/src/components/fms-ks-warn-drawer//351/242/204/350/255/246/346/217/220/347/244/272.md +0 -0
- package/src/components/ks-decrypt/README.md +140 -0
- package/src/components/ks-decrypt/index.vue +155 -0
- package/src/components/ks-popover/index.vue +483 -0
- package/src/components/ks-popover/mixin.js +28 -0
- package/src/components/ks-popover/utils.js +60 -0
- package/src/components/oa-datetime-picker/index.vue +169 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/README.md +21 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-bottom.vue +121 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-dropdown.vue +78 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-right.vue +86 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker-top.vue +82 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-picker.js +12 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-range-select.vue +106 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-select.vue +66 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/date-week-month.vue +131 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/index.js +39 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/mixin.js +85 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/month-range-select.vue +127 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/month-select.vue +87 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/quarter-select.vue +95 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/style.less +117 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/utils.js +109 -0
- package/src/components/oa-datetime-picker-new/components/date-picker/week-select.vue +100 -0
- package/src/components/oa-datetime-picker-new/index.vue +212 -0
- package/src/index.js +8 -2
- package/vite.config.js +12 -1
- package/dist/fms-ks-decrypt.bcc12f44.js +0 -335
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function getTextWidth (str, fontSize) {
|
|
2
|
+
var width = 0
|
|
3
|
+
var html = document.createElement('span')
|
|
4
|
+
html.innerText = str
|
|
5
|
+
html.style.fontSize = `${fontSize}px`
|
|
6
|
+
html.className = 'getTextWidth'
|
|
7
|
+
document.querySelector('body').appendChild(html)
|
|
8
|
+
width = document.querySelector('.getTextWidth').offsetWidth
|
|
9
|
+
document.querySelector('.getTextWidth').remove()
|
|
10
|
+
return width
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
update: function (el, binding, vNode) {
|
|
15
|
+
// 显示提示
|
|
16
|
+
// binding.value = 123
|
|
17
|
+
let data = binding.value
|
|
18
|
+
let oldData = binding.oldValue
|
|
19
|
+
const offset = el.querySelector('.van-cell__right-icon') ? 21 : 0
|
|
20
|
+
if (data.value === oldData.value) {
|
|
21
|
+
return // 新旧值相同
|
|
22
|
+
}
|
|
23
|
+
const integerLength = String(parseInt(data.value || 0)).length
|
|
24
|
+
const VERNIER_FONTSIZE = '8'
|
|
25
|
+
let content = ''
|
|
26
|
+
if (integerLength < 3) {
|
|
27
|
+
content = ''
|
|
28
|
+
} else if (integerLength >= 3 && integerLength < 4) {
|
|
29
|
+
content = '百'
|
|
30
|
+
} else if (integerLength >= 4 && integerLength < 5) {
|
|
31
|
+
content = '千'
|
|
32
|
+
} else if (integerLength >= 5 && integerLength < 6) {
|
|
33
|
+
content = '万'
|
|
34
|
+
} else if (integerLength >= 6 && integerLength < 7) {
|
|
35
|
+
content = '十万'
|
|
36
|
+
} else if (integerLength >= 7 && integerLength < 8) {
|
|
37
|
+
content = '百万'
|
|
38
|
+
} else if (integerLength >= 8) {
|
|
39
|
+
// 超长不能输入
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
let valuePixel = getTextWidth(data.value, 15)
|
|
43
|
+
let rightSpace = valuePixel + 8
|
|
44
|
+
if (content.length > 1) {
|
|
45
|
+
rightSpace = rightSpace - (content.length / 2) * VERNIER_FONTSIZE + 6
|
|
46
|
+
}
|
|
47
|
+
rightSpace = rightSpace + offset
|
|
48
|
+
const tag = Array.from(el.childNodes).find(item => item.className === 'tag')
|
|
49
|
+
const arrowStyle = 'width: 6px;height: 6px;text-align: center;border: .5px solid transparent;border-top: .5px solid #888;border-right: .5px solid #888;position:absolute;top:-7px;left:50%;transform: rotateZ(-45deg) translateX(-50%);'
|
|
50
|
+
if (tag) {
|
|
51
|
+
tag.style.right = `${rightSpace}px`
|
|
52
|
+
const innerText = content ? `${content}<div class="arrow" style="${arrowStyle}"></div>` : ''
|
|
53
|
+
tag.innerHTML = innerText
|
|
54
|
+
} else if (content) {
|
|
55
|
+
const dom = document.createElement('div')
|
|
56
|
+
dom.style.color = '#666'
|
|
57
|
+
dom.style.fontSize = `${VERNIER_FONTSIZE}px`
|
|
58
|
+
dom.style.position = 'absolute'
|
|
59
|
+
dom.style.right = `${rightSpace}px`
|
|
60
|
+
dom.style.bottom = '3px'
|
|
61
|
+
// dom.style.border = '1px solid #666'
|
|
62
|
+
dom.style.lineHeight = `${VERNIER_FONTSIZE}px`
|
|
63
|
+
dom.classList.add('tag')
|
|
64
|
+
const innerText = content ? `${content}<div class="arrow" style="${arrowStyle}"></div>` : ''
|
|
65
|
+
dom.innerHTML = innerText
|
|
66
|
+
el.appendChild(dom)
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
unbind () {
|
|
70
|
+
const tag = document.querySelector('.tag')
|
|
71
|
+
tag && tag.remove()
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -84,7 +84,8 @@ export default {
|
|
|
84
84
|
canDelete: {
|
|
85
85
|
type: Boolean,
|
|
86
86
|
default: true
|
|
87
|
-
}
|
|
87
|
+
},
|
|
88
|
+
onPreviewBefore: Function, // 点击上传按钮之前的操作,可终止唤起弹框
|
|
88
89
|
},
|
|
89
90
|
data() {
|
|
90
91
|
return {
|
|
@@ -112,6 +113,12 @@ export default {
|
|
|
112
113
|
},
|
|
113
114
|
methods: {
|
|
114
115
|
onPreview() {
|
|
116
|
+
if (this.onPreviewBefore && typeof this.onPreviewBefore === 'function') {
|
|
117
|
+
const flag = this.onPreviewBefore()
|
|
118
|
+
if (flag) {
|
|
119
|
+
return
|
|
120
|
+
}
|
|
121
|
+
}
|
|
115
122
|
if (this.disabled) {
|
|
116
123
|
return
|
|
117
124
|
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Description: fms-form-grid.vue formFileds处理类
|
|
3
|
+
* @Date: 2024-07-18 10:35:05
|
|
4
|
+
*/
|
|
5
|
+
import { get } from 'lodash'
|
|
6
|
+
|
|
7
|
+
export default class {
|
|
8
|
+
constructor(cols) {
|
|
9
|
+
this.cols = cols
|
|
10
|
+
return this.cols.reduce((acc, col) => {
|
|
11
|
+
let newCol = {
|
|
12
|
+
...col,
|
|
13
|
+
component: this.getComponent(col),
|
|
14
|
+
componentProps: this.getComponentProps(col),
|
|
15
|
+
// 字段提示处理
|
|
16
|
+
headerTips: get(col, 'headerTips') || get(col, 'tipsContent'),
|
|
17
|
+
// 必填
|
|
18
|
+
required: this.getRequired(col),
|
|
19
|
+
}
|
|
20
|
+
acc.push(newCol)
|
|
21
|
+
return acc
|
|
22
|
+
}, [])
|
|
23
|
+
}
|
|
24
|
+
// 组件component处理
|
|
25
|
+
getComponent (col) {
|
|
26
|
+
let comp = get(col, 'component')
|
|
27
|
+
// 远程搜索处理
|
|
28
|
+
if (['kye-search-tips', 'fms-search-tips'].includes(comp)) {
|
|
29
|
+
comp = 'search-tips-new'
|
|
30
|
+
}
|
|
31
|
+
// 下拉选项处理
|
|
32
|
+
if (['kye-select', 'el-select'].includes(comp)) {
|
|
33
|
+
comp = 'select'
|
|
34
|
+
}
|
|
35
|
+
// 输入组件
|
|
36
|
+
if (['kye-input', 'el-input', 'kye-textarea', 'kye-number'].includes(comp)) {
|
|
37
|
+
comp = 'van-field'
|
|
38
|
+
}
|
|
39
|
+
// 日期组件,datetime用旧版组件,其它的用新版
|
|
40
|
+
if (['kye-date-picker', 'el-date-picker'].includes(comp)) {
|
|
41
|
+
let type = get(col, 'componentProps.type')
|
|
42
|
+
comp = type === 'datetime' ? 'date' : 'date-new'
|
|
43
|
+
}
|
|
44
|
+
return comp
|
|
45
|
+
}
|
|
46
|
+
// componentProps处理
|
|
47
|
+
getComponentProps (col) {
|
|
48
|
+
let props = get(col, 'componentProps') || {}
|
|
49
|
+
let maxlength = get(props, 'maxLength') || get(props, 'maxlength')
|
|
50
|
+
// options处理
|
|
51
|
+
let options = get(col, 'options')
|
|
52
|
+
let columns = null
|
|
53
|
+
if (typeof options === 'function') {
|
|
54
|
+
columns = options().map(x => {
|
|
55
|
+
return {
|
|
56
|
+
text: x.label,
|
|
57
|
+
code: x.value
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
// 是否显示全选
|
|
62
|
+
let showSelectAll = get(props, 'showSwitch')
|
|
63
|
+
// 是否显示数字统计
|
|
64
|
+
let showWordLimit = false
|
|
65
|
+
if (props.hasOwnProperty('showWordLimit') || props.hasOwnProperty('show-word-limit')) {
|
|
66
|
+
showWordLimit = props.showWordLimit || props['show-word-limit']
|
|
67
|
+
}
|
|
68
|
+
let obj = {
|
|
69
|
+
...props,
|
|
70
|
+
maxlength,
|
|
71
|
+
showSelectAll,
|
|
72
|
+
type: this.getPropsType(col),
|
|
73
|
+
showWordLimit,
|
|
74
|
+
}
|
|
75
|
+
if (columns) {
|
|
76
|
+
obj.columns = columns
|
|
77
|
+
}
|
|
78
|
+
return obj
|
|
79
|
+
}
|
|
80
|
+
// 必填处理
|
|
81
|
+
getRequired (col) {
|
|
82
|
+
let required = get(col, 'required')
|
|
83
|
+
if (typeof required === 'boolean') {
|
|
84
|
+
return required
|
|
85
|
+
}
|
|
86
|
+
if (typeof required === 'function') {
|
|
87
|
+
return required()
|
|
88
|
+
}
|
|
89
|
+
let rules = get(col, 'rules')
|
|
90
|
+
return get(rules, '[0].required') || get(rules, 'required')
|
|
91
|
+
}
|
|
92
|
+
getPropsType (col) {
|
|
93
|
+
// 设置type
|
|
94
|
+
let comp = this.getComponent(col)
|
|
95
|
+
let props = get(col, 'componentProps') || {}
|
|
96
|
+
let type = get(col, 'componentProps.type')
|
|
97
|
+
if (comp === 'select') {
|
|
98
|
+
type = props.hasOwnProperty('multiple') || type === 'multiple' ? 'multiple' : 'single'
|
|
99
|
+
}
|
|
100
|
+
if (col.component === 'kye-number') {
|
|
101
|
+
let precision = get(props, 'precision')
|
|
102
|
+
// 精度为0是,设置type为digit,不为0时,设置为number
|
|
103
|
+
type = +precision === 0 ? 'digit' : 'number'
|
|
104
|
+
}
|
|
105
|
+
return type
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Description: form组件集合:根据配置生成页面
|
|
3
|
+
* @Date: 2022-04-08 11:36:27
|
|
4
|
+
-->
|
|
5
|
+
<template>
|
|
6
|
+
<div class="flow-fms-form-grid">
|
|
7
|
+
<!-- <van-form validate-first ref="form"> -->
|
|
8
|
+
<template v-for="(col, i) in fields">
|
|
9
|
+
<template v-if="col.slot">
|
|
10
|
+
<slot :name="col.slot"
|
|
11
|
+
:props="col"></slot>
|
|
12
|
+
</template>
|
|
13
|
+
<template v-else-if="col.render">
|
|
14
|
+
<RenderComponent :render="col.render"
|
|
15
|
+
:model="formModel || model"
|
|
16
|
+
:col="col"
|
|
17
|
+
:index="index"
|
|
18
|
+
:key="col.key" />
|
|
19
|
+
</template>
|
|
20
|
+
<fms-component v-else
|
|
21
|
+
:col="col"
|
|
22
|
+
:model="formModel || model"
|
|
23
|
+
:key="col.key"
|
|
24
|
+
:index="i">
|
|
25
|
+
<template v-for="slot in Object.keys($slots)"
|
|
26
|
+
:slot="slot">
|
|
27
|
+
<slot :name="slot"></slot>
|
|
28
|
+
</template>
|
|
29
|
+
</fms-component>
|
|
30
|
+
</template>
|
|
31
|
+
<!-- </van-form> -->
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<script>
|
|
35
|
+
import { get } from 'lodash'
|
|
36
|
+
import FmsComponent from '../fms-ks-components/fms-ks-components.vue'
|
|
37
|
+
import FieldsConversion from './fields-conversion.js'
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
name: 'FmsKsFormGrid',
|
|
41
|
+
components: {
|
|
42
|
+
FmsComponent,
|
|
43
|
+
RenderComponent: {
|
|
44
|
+
functional: true,
|
|
45
|
+
props: { render: { type: Function, required: true } },
|
|
46
|
+
render (h, c) {
|
|
47
|
+
return c.props.render(h, c)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
props: {
|
|
52
|
+
formFields: Array,
|
|
53
|
+
formModel: Object,
|
|
54
|
+
grid: Object,
|
|
55
|
+
model: Object,
|
|
56
|
+
},
|
|
57
|
+
computed: {
|
|
58
|
+
fields () {
|
|
59
|
+
let cols = get(this.grid, 'cols') || []
|
|
60
|
+
let fields = new FieldsConversion(this.formFields || cols)
|
|
61
|
+
// show处理
|
|
62
|
+
fields.map(x => {
|
|
63
|
+
if (typeof x.show === 'function') {
|
|
64
|
+
x.show = x.show(this.formModel)
|
|
65
|
+
}
|
|
66
|
+
// 不存在show属性时,默认show为true
|
|
67
|
+
if (!x.hasOwnProperty('show')) {
|
|
68
|
+
x.show = true
|
|
69
|
+
}
|
|
70
|
+
return x
|
|
71
|
+
})
|
|
72
|
+
// 过滤掉show为false列表
|
|
73
|
+
return fields.filter(x => x.show)
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="less" scoped>
|
|
80
|
+
.flow-fms-form-grid {
|
|
81
|
+
// 时间实在不够优化,先用css的样式处理textarea的样式,后续有规范后再改成组件属性
|
|
82
|
+
/deep/ .fms-field-textarea {
|
|
83
|
+
display: block;
|
|
84
|
+
border-radius: 0 0 4px 4px;
|
|
85
|
+
&:after {
|
|
86
|
+
border: none !important;
|
|
87
|
+
}
|
|
88
|
+
.van-field__value {
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
background-color: #f7f8fa;
|
|
91
|
+
margin-top: 8px;
|
|
92
|
+
.van-field__body {
|
|
93
|
+
.van-field__control {
|
|
94
|
+
padding: 12px;
|
|
95
|
+
}
|
|
96
|
+
.van-field__right-icon {
|
|
97
|
+
position: absolute;
|
|
98
|
+
bottom: 0;
|
|
99
|
+
right: 16px;
|
|
100
|
+
height: 32px;
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
padding: 0;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
.van-field__word-limit {
|
|
107
|
+
margin-right: 10px;
|
|
108
|
+
color: #858793;
|
|
109
|
+
padding-bottom: 8px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/deep/.van-cell--required:before {
|
|
114
|
+
content: none;
|
|
115
|
+
}
|
|
116
|
+
/deep/.van-cell--required .van-cell__title::after {
|
|
117
|
+
position: absolute;
|
|
118
|
+
margin-top: 2px;
|
|
119
|
+
margin-left: 4px;
|
|
120
|
+
color: #f99257;
|
|
121
|
+
font-size: 16px;
|
|
122
|
+
content: "*";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
</style>
|
|
127
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="fms-more-lines-warp">
|
|
3
|
+
<div class="fms-more-lines">
|
|
4
|
+
<input id="exp" class="fms-more-lines_exp" type="checkbox">
|
|
5
|
+
<div class="fms-more-lines_text">
|
|
6
|
+
<label class="fms-more-lines_btn" for="exp"></label>
|
|
7
|
+
<span v-html="text"></span>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
name: 'FmsKsMoreLines',
|
|
16
|
+
props: {
|
|
17
|
+
text: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ''
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<style lang="less" scoped>
|
|
26
|
+
.fms-more-lines-warp {
|
|
27
|
+
max-height: 220px;
|
|
28
|
+
overflow-y: auto;
|
|
29
|
+
}
|
|
30
|
+
.fms-more-lines {
|
|
31
|
+
display: flex;
|
|
32
|
+
font-family: PingFang SC;
|
|
33
|
+
font-weight: 500;
|
|
34
|
+
color: #03050D;
|
|
35
|
+
font-size: 12px;
|
|
36
|
+
font-weight: normal;
|
|
37
|
+
line-height: 18px;
|
|
38
|
+
&_text {
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
text-overflow: ellipsis;
|
|
42
|
+
text-align: justify;
|
|
43
|
+
position: relative;
|
|
44
|
+
line-height: 1.5;
|
|
45
|
+
max-height: 36px;
|
|
46
|
+
transition: .3s max-height;
|
|
47
|
+
word-break: break-all;
|
|
48
|
+
&::before {
|
|
49
|
+
content: '';
|
|
50
|
+
height: calc(100% - 18px);
|
|
51
|
+
float: right;
|
|
52
|
+
}
|
|
53
|
+
&:after {
|
|
54
|
+
content: '';
|
|
55
|
+
width: 999vw;
|
|
56
|
+
height: 999vw;
|
|
57
|
+
position: absolute;
|
|
58
|
+
box-shadow: inset calc(100px - 999vw) calc(18px - 999vw) 0 0 #fff;
|
|
59
|
+
margin-left: -100px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&_btn {
|
|
64
|
+
position: relative;
|
|
65
|
+
float: right;
|
|
66
|
+
clear: both;
|
|
67
|
+
font-family: PingFang SC;
|
|
68
|
+
font-weight: 400;
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
line-height: 18px;
|
|
71
|
+
font-variation-settings: "opsz" auto;
|
|
72
|
+
color: #7972FE;
|
|
73
|
+
padding-left: 18px;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
&::after {
|
|
76
|
+
content: '展开'
|
|
77
|
+
}
|
|
78
|
+
&::before{
|
|
79
|
+
content: '...';
|
|
80
|
+
position: absolute;
|
|
81
|
+
left: 12px;
|
|
82
|
+
color: #333;
|
|
83
|
+
transform: translateX(-100%)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
&_exp {
|
|
87
|
+
display: none;
|
|
88
|
+
&:checked+.fms-more-lines_text {
|
|
89
|
+
max-height: none;
|
|
90
|
+
&::after {
|
|
91
|
+
visibility: hidden;
|
|
92
|
+
}
|
|
93
|
+
&::before {
|
|
94
|
+
height: calc(100% - 17px);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
&:checked+.fms-more-lines_text .fms-more-lines_btn {
|
|
98
|
+
padding-left: 0px;
|
|
99
|
+
&::before {
|
|
100
|
+
visibility: hidden;
|
|
101
|
+
}
|
|
102
|
+
&::after{
|
|
103
|
+
content:'收起';
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</style>
|
|
File without changes
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Description: 需要满屏铺满的popup场景可以使用这个,从报销申请-草稿箱组件抽出来的
|
|
3
|
+
-->
|
|
4
|
+
<template>
|
|
5
|
+
<div class="flow-fms__page-popup">
|
|
6
|
+
<van-popup v-model="showDetailSelect"
|
|
7
|
+
class="apply-pop apply-style"
|
|
8
|
+
position="right"
|
|
9
|
+
get-container="#ksui-app"
|
|
10
|
+
:duration="isDraftRN ? 0 : 0.3"
|
|
11
|
+
:style="{width:'100%', height: '100%' }">
|
|
12
|
+
<div class="fms-popup-box">
|
|
13
|
+
<div class="fms-popup-header">
|
|
14
|
+
<div class="back-btn"
|
|
15
|
+
@click="back">
|
|
16
|
+
<van-icon size="24"
|
|
17
|
+
style="padding-right: 5px;display: inline-block;vertical-align: middle;"
|
|
18
|
+
name="arrow-left" />
|
|
19
|
+
{{ title }}
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="fms-popup-content">
|
|
23
|
+
<slot />
|
|
24
|
+
</div>
|
|
25
|
+
<!-- 用于处理异形屏 -->
|
|
26
|
+
<div class="fms-popup-inset-bottom"></div>
|
|
27
|
+
</div>
|
|
28
|
+
</van-popup>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
name: 'FmsKsPagePopup',
|
|
35
|
+
model: {
|
|
36
|
+
prop: 'show',
|
|
37
|
+
event: 'update:show'
|
|
38
|
+
},
|
|
39
|
+
props: {
|
|
40
|
+
show: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
isDraftRN: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
title: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ''
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
computed: {
|
|
54
|
+
showDetailSelect: {
|
|
55
|
+
get () {
|
|
56
|
+
return this.show
|
|
57
|
+
},
|
|
58
|
+
set (val) {
|
|
59
|
+
this.$emit('update:show', val)
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
data () {
|
|
64
|
+
return {
|
|
65
|
+
isNoData: false,
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
back () {
|
|
70
|
+
if (this.isDraftRN) {
|
|
71
|
+
ks.forceBack()
|
|
72
|
+
} else {
|
|
73
|
+
this.$emit('update:show', false)
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
closePop () {
|
|
77
|
+
this.$emit('update:show', false)
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="less" scoped>
|
|
85
|
+
.ios .fms-popup-header {
|
|
86
|
+
padding-top: 20px !important;
|
|
87
|
+
}
|
|
88
|
+
// 不同机型的特殊样式处理,状态栏额头的高度不同
|
|
89
|
+
.ipx {
|
|
90
|
+
.fms-popup-header {
|
|
91
|
+
padding-top: 46px !important;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
.ipx .fms-footer-btn {
|
|
95
|
+
padding-bottom: 24px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ipx .fms-popup-box .invoice-folder__btn {
|
|
99
|
+
padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iOS < 11.2 */
|
|
100
|
+
padding-bottom: env(safe-area-inset-bottom); /* 兼容 iOS >= 11.2 */
|
|
101
|
+
}
|
|
102
|
+
.fms-popup-box {
|
|
103
|
+
height: 100%;
|
|
104
|
+
width: 100%;
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
background-color: #f3f4f6;
|
|
108
|
+
.fms-popup-header {
|
|
109
|
+
width: 100%;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
padding: 0 16px 17px 16px;
|
|
114
|
+
font-size: 18px;
|
|
115
|
+
justify-content: space-between;
|
|
116
|
+
align-items: center;
|
|
117
|
+
font-family: PingFangSC-Medium;
|
|
118
|
+
font-weight: 500;
|
|
119
|
+
background-color: #7972fe;
|
|
120
|
+
color: #fff;
|
|
121
|
+
|
|
122
|
+
.back-btn {
|
|
123
|
+
display: flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
height: 44px;
|
|
126
|
+
}
|
|
127
|
+
.img-box {
|
|
128
|
+
width: 40px;
|
|
129
|
+
height: 40px;
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: row-reverse;
|
|
132
|
+
align-items: center;
|
|
133
|
+
line-height: 40px;
|
|
134
|
+
}
|
|
135
|
+
img {
|
|
136
|
+
width: 22px;
|
|
137
|
+
height: 22px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
font-size: 12px;
|
|
141
|
+
.fms-popup-content {
|
|
142
|
+
flex-grow: 1;
|
|
143
|
+
overflow: scroll;
|
|
144
|
+
}
|
|
145
|
+
.fms-popup-inset-bottom {
|
|
146
|
+
width: 100%;
|
|
147
|
+
height: 0;
|
|
148
|
+
background: #f3f4f6;
|
|
149
|
+
padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iOS < 11.2 */
|
|
150
|
+
padding-bottom: env(safe-area-inset-bottom); /* 兼容 iOS >= 11.2 */
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
File without changes
|