sh-view 1.5.2
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/.eslintrc.js +21 -0
- package/README.en.md +36 -0
- package/README.md +39 -0
- package/package.json +64 -0
- package/packages/assets/css/animated.scss +33 -0
- package/packages/assets/css/loader.scss +193 -0
- package/packages/assets/css/main.scss +235 -0
- package/packages/assets/css/theme.scss +52 -0
- package/packages/assets/icons/demo.css +539 -0
- package/packages/assets/icons/iconfont.css +415 -0
- package/packages/assets/icons/iconfont.js +1 -0
- package/packages/assets/icons/iconfont.json +709 -0
- package/packages/assets/icons/iconfont.ttf +0 -0
- package/packages/assets/icons/iconfont.woff +0 -0
- package/packages/assets/icons/iconfont.woff2 +0 -0
- package/packages/assets/img/image-error.png +0 -0
- package/packages/assets/img/square-image.png +0 -0
- package/packages/components/global-components/sh-card/index.vue +122 -0
- package/packages/components/global-components/sh-code-editor/index.vue +237 -0
- package/packages/components/global-components/sh-corner/index.vue +236 -0
- package/packages/components/global-components/sh-count-to/index.vue +46 -0
- package/packages/components/global-components/sh-empty/index.vue +43 -0
- package/packages/components/global-components/sh-header/index.vue +269 -0
- package/packages/components/global-components/sh-icon/icons.vue +32 -0
- package/packages/components/global-components/sh-icon/index.vue +27 -0
- package/packages/components/global-components/sh-iv-form/components/iv-group-item.vue +57 -0
- package/packages/components/global-components/sh-iv-form/components/iv-single-item.vue +76 -0
- package/packages/components/global-components/sh-iv-form/index.vue +255 -0
- package/packages/components/global-components/sh-layout/index.vue +142 -0
- package/packages/components/global-components/sh-loading/index.vue +42 -0
- package/packages/components/global-components/sh-noticebar/index.vue +201 -0
- package/packages/components/global-components/sh-preview/index.vue +62 -0
- package/packages/components/global-components/sh-pull-refresh/index.vue +290 -0
- package/packages/components/global-components/sh-result/index.vue +88 -0
- package/packages/components/global-components/sh-sheet/index.vue +173 -0
- package/packages/components/global-components/sh-upload/components/u-img.vue +63 -0
- package/packages/components/global-components/sh-upload/components/u-list.vue +100 -0
- package/packages/components/global-components/sh-upload/index.vue +418 -0
- package/packages/components/global-components/sh-vxe-form/components/form-item.vue +25 -0
- package/packages/components/global-components/sh-vxe-form/css/index.scss +55 -0
- package/packages/components/global-components/sh-vxe-form/index.vue +115 -0
- package/packages/components/global-components/sh-vxe-form/js/methods.js +170 -0
- package/packages/components/global-components/sh-vxe-form/js/props.js +63 -0
- package/packages/components/global-components/sh-vxe-form/mixin/defaultData.js +33 -0
- package/packages/components/global-components/sh-vxe-list/index.vue +129 -0
- package/packages/components/global-components/sh-vxe-modal/index.vue +209 -0
- package/packages/components/global-components/sh-vxe-query/index.vue +286 -0
- package/packages/components/global-components/sh-vxe-table/components/importModal.vue +377 -0
- package/packages/components/global-components/sh-vxe-table/css/index.scss +94 -0
- package/packages/components/global-components/sh-vxe-table/index.vue +350 -0
- package/packages/components/global-components/sh-vxe-table/js/excel_to_json.js +313 -0
- package/packages/components/global-components/sh-vxe-table/js/methods.js +614 -0
- package/packages/components/global-components/sh-vxe-table/js/props.js +311 -0
- package/packages/components/global-components/sh-vxe-table/mixin/defaultData.js +116 -0
- package/packages/components/global-components/sh-vxe-toolbar/index.vue +172 -0
- package/packages/components/global-components/sh-vxe-tree/components/table-tree.vue +251 -0
- package/packages/components/global-components/sh-vxe-tree/css/index.scss +20 -0
- package/packages/components/global-components/sh-vxe-tree/index.vue +85 -0
- package/packages/components/global-components/sh-vxe-tree/js/props.js +120 -0
- package/packages/components/global-components/sh-vxe-tree/js/treeMethods.js +171 -0
- package/packages/components/global-components/sh-vxe-tree/mixin/defaultData.js +48 -0
- package/packages/components/global-components/sh-vxe-tree/vxe-direct-tree.vue +202 -0
- package/packages/components/global-components/sh-vxe-tree/vxe-select-tree.vue +291 -0
- package/packages/components/global-components/sh-water-fall/index.vue +87 -0
- package/packages/components/global-components/sh-word/index.vue +110 -0
- package/packages/components/index.js +64 -0
- package/packages/components/other-components/sh-cron-modal/components/cron-content.vue +287 -0
- package/packages/components/other-components/sh-cron-modal/css/index.scss +45 -0
- package/packages/components/other-components/sh-cron-modal/index.vue +67 -0
- package/packages/components/other-components/sh-cron-modal/mixin/cron-box.js +169 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-day-box.vue +92 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-hour-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-minute-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-month-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-second-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-week-box.vue +115 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-year-box.vue +46 -0
- package/packages/components/other-components/sh-cron-modal/utils/index.js +52 -0
- package/packages/components/other-components/sh-markdown/index.vue +170 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ar.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/az.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/bg_BG.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/bn_BD.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ca.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/cs.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/cy.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/da.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/de.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/dv.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/el.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/eo.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/es.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/es_MX.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/et.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/eu.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/fa.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/fi.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/fr_FR.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ga.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/gl.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/he_IL.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hi.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hr.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hu_HU.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hy.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/id.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/is_IS.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/it.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ja.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/kab.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/kk.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ko_KR.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ku.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/lt.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/lv.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/nb_NO.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ne.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/nl.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/nl_BE.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/oc.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/pl.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/pt_BR.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ro.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ru.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sk.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sl_SI.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sq.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sr.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sv_SE.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ta.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/tg.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/th_TH.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/tr.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ug.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/uk.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/vi.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/zh-Hans.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/dark/content.css +72 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/dark/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/default/content.css +67 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/default/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/document/content.css +72 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/document/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/writer/content.css +68 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/writer/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.css +732 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/packages/components/other-components/sh-menu-card/index.vue +224 -0
- package/packages/components/other-components/sh-menu-card/menu-box.vue +68 -0
- package/packages/components/other-components/sh-system-tip/index.vue +113 -0
- package/packages/css/index.js +6 -0
- package/packages/directive/directives.js +27 -0
- package/packages/directive/index.js +19 -0
- package/packages/directive/module/draggable.js +42 -0
- package/packages/index.js +40 -0
- package/packages/iview/css/index.scss +32 -0
- package/packages/iview/index.js +24 -0
- package/packages/mixin/index.js +87 -0
- package/packages/vxeTable/css/index.scss +454 -0
- package/packages/vxeTable/css/variable.scss +256 -0
- package/packages/vxeTable/index.js +178 -0
- package/packages/vxeTable/render/cell/vxe-render-checkbox.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-checkgroup.vue +36 -0
- package/packages/vxeTable/render/cell/vxe-render-code.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-goption.vue +93 -0
- package/packages/vxeTable/render/cell/vxe-render-href.vue +11 -0
- package/packages/vxeTable/render/cell/vxe-render-img.vue +28 -0
- package/packages/vxeTable/render/cell/vxe-render-input.vue +51 -0
- package/packages/vxeTable/render/cell/vxe-render-money.vue +25 -0
- package/packages/vxeTable/render/cell/vxe-render-progress.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-radio.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-radiogroup.vue +36 -0
- package/packages/vxeTable/render/cell/vxe-render-select.vue +36 -0
- package/packages/vxeTable/render/cell/vxe-render-switch.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-table.vue +78 -0
- package/packages/vxeTable/render/cell/vxe-render-textarea.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-time.vue +34 -0
- package/packages/vxeTable/render/cell/vxe-render-tree.vue +59 -0
- package/packages/vxeTable/render/cell/vxe-render-upload.vue +24 -0
- package/packages/vxeTable/render/filters/vxe-filter-input.vue +43 -0
- package/packages/vxeTable/render/footer/vxe-footer-input.vue +13 -0
- package/packages/vxeTable/render/footer/vxe-footer-money.vue +20 -0
- package/packages/vxeTable/render/globalRenders.js +491 -0
- package/packages/vxeTable/render/header/vxe-header-money.vue +21 -0
- package/packages/vxeTable/render/mixin/cell-mixin.js +195 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<vxe-form
|
|
3
|
+
ref="queryForm"
|
|
4
|
+
:key="renderKey"
|
|
5
|
+
class="sh-query"
|
|
6
|
+
:class="formCollapsed ? 'sh-query-collapsed-open' : 'sh-query-collapsed-close'"
|
|
7
|
+
v-bind="queryFormConfig"
|
|
8
|
+
:items="formItems"
|
|
9
|
+
:data="data"
|
|
10
|
+
:rules="rules"
|
|
11
|
+
:valid-config="validConfig"
|
|
12
|
+
@submit="onFormSubmit"
|
|
13
|
+
@reset="onFormReset"
|
|
14
|
+
@edit-closed="onFormEditClosed">
|
|
15
|
+
<div class="sh-query-buttons">
|
|
16
|
+
<div class="sh-query-buttons-left"><slot name="footLeft"></slot></div>
|
|
17
|
+
<div class="sh-query-buttons-right">
|
|
18
|
+
<slot name="footRight"></slot>
|
|
19
|
+
<vxe-button v-ripple type="submit" status="theme" :size="size" icon="vxe-icon-search">查询</vxe-button>
|
|
20
|
+
<vxe-button v-ripple type="reset" :size="size" icon="vxe-icon-repeat">重置</vxe-button>
|
|
21
|
+
<vxe-button v-if="formToggleBtnShow" v-ripple :size="size" :icon="formCollapsed ? 'vxe-icon-caret-up' : 'vxe-icon-caret-down'" @click="formBtnCollapsed(!formCollapsed)">
|
|
22
|
+
{{ formCollapsed ? '收起' : '展开全部' }}
|
|
23
|
+
</vxe-button>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</vxe-form>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
name: 'ShQuery',
|
|
32
|
+
props: {
|
|
33
|
+
data: {
|
|
34
|
+
type: Object,
|
|
35
|
+
default() {
|
|
36
|
+
return {}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
loading: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
readonly: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'small' // medium / small / mini
|
|
50
|
+
},
|
|
51
|
+
disabled: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false
|
|
54
|
+
},
|
|
55
|
+
items: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default() {
|
|
58
|
+
return []
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
rules: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default() {
|
|
64
|
+
return {}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
validConfig: {
|
|
68
|
+
type: Object,
|
|
69
|
+
default() {
|
|
70
|
+
return {
|
|
71
|
+
autoPos: true,
|
|
72
|
+
showMessage: true
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
formConfig: {
|
|
77
|
+
type: Object,
|
|
78
|
+
default() {
|
|
79
|
+
return {}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
globalConfig: {
|
|
83
|
+
type: Object,
|
|
84
|
+
default() {
|
|
85
|
+
return {}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
transformitem: {
|
|
89
|
+
type: Boolean,
|
|
90
|
+
default: true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
emits: ['submit', 'reset', 'edit-closed', 'submit-invalid', 'collapsed'],
|
|
94
|
+
data() {
|
|
95
|
+
return {
|
|
96
|
+
// 渲染key值
|
|
97
|
+
renderKey: 1,
|
|
98
|
+
// 表单展开状态
|
|
99
|
+
formCollapsed: false,
|
|
100
|
+
// 是否渲染表单展开全部按钮
|
|
101
|
+
formToggleBtnShow: false,
|
|
102
|
+
// 表单初始项
|
|
103
|
+
formOriginItems: [],
|
|
104
|
+
// 表单渲染项
|
|
105
|
+
formItems: [],
|
|
106
|
+
// 表格高级搜索默认配置
|
|
107
|
+
formConfigDefault: {
|
|
108
|
+
titleWidth: 100,
|
|
109
|
+
titleAlign: 'right',
|
|
110
|
+
titleColon: true,
|
|
111
|
+
titleAsterisk: true,
|
|
112
|
+
titleOverflow: true,
|
|
113
|
+
align: 'left',
|
|
114
|
+
span: 6,
|
|
115
|
+
loading: false,
|
|
116
|
+
customLayout: false,
|
|
117
|
+
preventSubmit: false,
|
|
118
|
+
size: this.size
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
computed: {
|
|
123
|
+
queryFormConfig() {
|
|
124
|
+
let mobileTurnConfig = this.mobile ? { span: '24' } : {}
|
|
125
|
+
return Object.assign({}, this.formConfigDefault, this.formConfig, mobileTurnConfig)
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
watch: {
|
|
129
|
+
data: {
|
|
130
|
+
handler(newvalue, oldValue) {
|
|
131
|
+
this.initFormData()
|
|
132
|
+
},
|
|
133
|
+
immediate: true
|
|
134
|
+
},
|
|
135
|
+
items: {
|
|
136
|
+
handler(newvalue, oldValue) {
|
|
137
|
+
this.initFormItems()
|
|
138
|
+
},
|
|
139
|
+
deep: true,
|
|
140
|
+
immediate: false
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
created() {
|
|
144
|
+
this.initCreated()
|
|
145
|
+
},
|
|
146
|
+
methods: {
|
|
147
|
+
queryFormRef() {
|
|
148
|
+
return this.$refs.queryForm
|
|
149
|
+
},
|
|
150
|
+
// 初始化
|
|
151
|
+
initCreated() {
|
|
152
|
+
this.initFormItems()
|
|
153
|
+
},
|
|
154
|
+
// 初始化表单字段
|
|
155
|
+
initFormData() {
|
|
156
|
+
const that = this
|
|
157
|
+
let formItems = that.items.filter(item => item.search && item.search !== '0')
|
|
158
|
+
that.$vUtils.eachTree(formItems, item => {
|
|
159
|
+
let renderProps = item.renderProps || item.itemRender?.props || {}
|
|
160
|
+
if (!that.$vUtils.has(that.data, item.field)) {
|
|
161
|
+
that.$vUtils.set(that.data, item.field, renderProps.defaultValue || null)
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
},
|
|
165
|
+
// 初始化搜索表单
|
|
166
|
+
initFormItems() {
|
|
167
|
+
const that = this
|
|
168
|
+
let formItemsArr = [] // 表单项
|
|
169
|
+
let formItems = that.items.filter(item => item.search && item.search !== '0')
|
|
170
|
+
if (this.transformitem) {
|
|
171
|
+
let { itemsArr, itemsRules } = that.generateFormItem(formItems)
|
|
172
|
+
formItemsArr = itemsArr
|
|
173
|
+
} else {
|
|
174
|
+
formItemsArr = formItems
|
|
175
|
+
}
|
|
176
|
+
formItemsArr.forEach(item => {
|
|
177
|
+
item.visible = true
|
|
178
|
+
item.itemRender.props.disabled = false
|
|
179
|
+
})
|
|
180
|
+
that.formOriginItems = formItemsArr
|
|
181
|
+
that.formItems = formItemsArr
|
|
182
|
+
if (formItemsArr.length > that.globalConfig.formToggleNum && that.globalConfig.formToggle) {
|
|
183
|
+
that.formToggleBtnShow = true // 显示展开全部按钮
|
|
184
|
+
that.formBtnCollapsed(false)
|
|
185
|
+
}
|
|
186
|
+
this.initFormData()
|
|
187
|
+
},
|
|
188
|
+
// 表单展开全部/收起切换事件
|
|
189
|
+
formBtnCollapsed(value) {
|
|
190
|
+
const that = this
|
|
191
|
+
that.formCollapsed = value
|
|
192
|
+
that.formItems = value ? that.formOriginItems : that.formOriginItems.slice(0, that.globalConfig.formToggleNum)
|
|
193
|
+
this.$emit('collapsed', value)
|
|
194
|
+
},
|
|
195
|
+
// -------- 搜索
|
|
196
|
+
async onFormSubmit() {
|
|
197
|
+
let that = this
|
|
198
|
+
let errMap = await that.queryFormRef().validate()
|
|
199
|
+
let data = that.data
|
|
200
|
+
if (!errMap) {
|
|
201
|
+
that.$emit('submit', data)
|
|
202
|
+
} else {
|
|
203
|
+
that.onFormSubmitInvalid({ data, errMap })
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
// 表单重置
|
|
207
|
+
onFormReset(params) {
|
|
208
|
+
this.initFormItems()
|
|
209
|
+
this.$vUtils.clear(this.data)
|
|
210
|
+
this.$emit('reset', params)
|
|
211
|
+
},
|
|
212
|
+
// 表单项编辑回调
|
|
213
|
+
onFormEditClosed(obj, renderbox) {
|
|
214
|
+
this.$emit('edit-closed', obj, renderbox, this)
|
|
215
|
+
},
|
|
216
|
+
// 表单校验不通过
|
|
217
|
+
onFormSubmitInvalid(obj) {
|
|
218
|
+
this.$emit('submit-invalid', obj)
|
|
219
|
+
},
|
|
220
|
+
// 表单重新渲染
|
|
221
|
+
refreshRender() {
|
|
222
|
+
this.renderKey++
|
|
223
|
+
},
|
|
224
|
+
// 自动生成表单渲染项
|
|
225
|
+
generateFormItem(items = []) {
|
|
226
|
+
const that = this
|
|
227
|
+
let itemsArr = []
|
|
228
|
+
let itemsRules = {}
|
|
229
|
+
that.$vUtils.mapTree(items, ori => {
|
|
230
|
+
let tar = Object.assign({}, that.itemConfigDefault, ori)
|
|
231
|
+
let renderConfig = {
|
|
232
|
+
name: ori.renderName || '$vInput',
|
|
233
|
+
props: Object.assign({}, ori.renderProps || {})
|
|
234
|
+
}
|
|
235
|
+
if (that.readonly || that.disabled) {
|
|
236
|
+
renderConfig.props.disabled = true
|
|
237
|
+
}
|
|
238
|
+
tar.itemRender = Object.assign({}, renderConfig, ori.itemRender || {})
|
|
239
|
+
// 首先提取校验配置
|
|
240
|
+
if (that.isTrue(ori['renderRequire'])) {
|
|
241
|
+
// 若配置了校验参数则走校验参数,没配置则给默认校验条件
|
|
242
|
+
if (ori['requireProps'] && Array.isArray(ori['requireProps']) && ori['requireProps'].length > 0) {
|
|
243
|
+
itemsRules[ori['field']] = ori['requireProps']
|
|
244
|
+
} else {
|
|
245
|
+
let dataType = 'string'
|
|
246
|
+
let arrayType = ['$vCheckgroup', '$vUpload', '$vTable']
|
|
247
|
+
if (arrayType.includes(ori['renderName']) || ((ori['renderName'] === '$vSelect' || ori['renderName'] === '$vTree') && that.isTrue(renderConfig.props.multiple))) {
|
|
248
|
+
dataType = 'array'
|
|
249
|
+
}
|
|
250
|
+
itemsRules[ori['field']] = [{ required: true, message: that.getDefaultMessage(ori['renderName'], ori['title']), type: dataType }]
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// 表单不支持编辑渲染过滤
|
|
254
|
+
let notRenderName = ['seq', 'checkbox', 'radio', '$vImg', '$vHref', '$vGlobalOption']
|
|
255
|
+
if (!((ori.renderName && notRenderName.includes(ori.renderName)) || notRenderName.includes(ori.type))) {
|
|
256
|
+
itemsArr.push(tar)
|
|
257
|
+
}
|
|
258
|
+
})
|
|
259
|
+
return { itemsArr, itemsRules }
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
</script>
|
|
264
|
+
|
|
265
|
+
<style lang="scss">
|
|
266
|
+
.sh-query {
|
|
267
|
+
background: var(--theme-weak-color);
|
|
268
|
+
&.sh-query-collapsed-close {
|
|
269
|
+
}
|
|
270
|
+
&.sh-query-collapsed-open {
|
|
271
|
+
}
|
|
272
|
+
.sh-query-buttons {
|
|
273
|
+
border-top: 1px solid var(--border-color);
|
|
274
|
+
padding: 5px;
|
|
275
|
+
box-sizing: border-box;
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
justify-content: space-between;
|
|
279
|
+
.sh-query-buttons-left {
|
|
280
|
+
flex: 1;
|
|
281
|
+
}
|
|
282
|
+
.sh-query-buttons-right {
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
</style>
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sh-modal :visible="visible" title="导入报表" width="900" :loading="modalLoading" :show-footer="false" :transfer="false" @close="onModalClose">
|
|
3
|
+
<div class="import-template-top">
|
|
4
|
+
<transition name="fade">
|
|
5
|
+
<Progress v-if="showProgress" :percent="progressPercent" :stroke-width="2">
|
|
6
|
+
<template v-if="progressPercent === 100"><span>上传成功</span></template>
|
|
7
|
+
</Progress>
|
|
8
|
+
</transition>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="import-template-head">
|
|
11
|
+
<vxe-button :size="size" @click="handleDownloadTemplateBtn">下载导入模板</vxe-button>
|
|
12
|
+
<vxe-button :size="size" status="primary" @click="handleImportFileBtn">选择导入文件</vxe-button>
|
|
13
|
+
<div class="floatright">
|
|
14
|
+
<Poptip v-if="importErrorData.length > 0" trigger="click" title="错误信息" placement="bottom-end">
|
|
15
|
+
<vxe-button :size="size" status="danger"
|
|
16
|
+
>共发现 <strong>{{ importErrorData.length }}</strong> 条不符合规范数据</vxe-button
|
|
17
|
+
>
|
|
18
|
+
<template #content>
|
|
19
|
+
<div class="import-template-error-list">
|
|
20
|
+
<div v-for="(errData, errDataIndex) in importErrorData" :key="errDataIndex" class="error-item">
|
|
21
|
+
第 <strong class="red">{{ errData.rowIndex }}</strong> 行,错误:<span class="red">{{ errData.errMsg }}</span>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
</Poptip>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="import-template-body">
|
|
29
|
+
<sh-table
|
|
30
|
+
ref="shtable"
|
|
31
|
+
:height="height"
|
|
32
|
+
:size="size"
|
|
33
|
+
:columns="tableColumns"
|
|
34
|
+
:data-sourse="importTableData"
|
|
35
|
+
:global-config="tableGlobalConfig"
|
|
36
|
+
:edit-rules="importRules"
|
|
37
|
+
:pager-config="false"
|
|
38
|
+
:disabled="false"></sh-table>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="import-template-foot">
|
|
41
|
+
<div class="foot-left"></div>
|
|
42
|
+
<div class="foot-right">
|
|
43
|
+
<vxe-button :size="size" @click="onModalClose">取消</vxe-button>
|
|
44
|
+
<vxe-button :size="size" status="primary" @click="handleImportDataBtn('all')">全部导入</vxe-button>
|
|
45
|
+
<vxe-button v-if="tableGlobalConfig.checkbox || tableGlobalConfig.radio" :size="size" status="warning" @click="handleImportDataBtn('select')">导入选中</vxe-button>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</sh-modal>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script>
|
|
52
|
+
import * as XLSX from 'xlsx'
|
|
53
|
+
import excelToJson from '../js/excel_to_json'
|
|
54
|
+
export default {
|
|
55
|
+
name: 'TableImport',
|
|
56
|
+
props: {
|
|
57
|
+
visible: {
|
|
58
|
+
type: Boolean
|
|
59
|
+
},
|
|
60
|
+
columns: {
|
|
61
|
+
type: Array
|
|
62
|
+
},
|
|
63
|
+
height: {
|
|
64
|
+
type: [Number, String],
|
|
65
|
+
default: 360
|
|
66
|
+
},
|
|
67
|
+
needValidate: {
|
|
68
|
+
type: Boolean
|
|
69
|
+
},
|
|
70
|
+
importRules: {
|
|
71
|
+
type: Object,
|
|
72
|
+
default() {
|
|
73
|
+
return {}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
importConfig: {
|
|
77
|
+
type: Object,
|
|
78
|
+
default() {
|
|
79
|
+
return {}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
importOption: {
|
|
83
|
+
type: Object,
|
|
84
|
+
default() {
|
|
85
|
+
return {}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
globalConfig: {
|
|
89
|
+
type: Object,
|
|
90
|
+
default() {
|
|
91
|
+
return {}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
size: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: 'mini' // medium / small / mini
|
|
97
|
+
},
|
|
98
|
+
downloadTemplateCallback: {
|
|
99
|
+
type: Function
|
|
100
|
+
},
|
|
101
|
+
downloadTemplateFinished: {
|
|
102
|
+
type: Function
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
emits: ['confirm', 'update:visible'],
|
|
106
|
+
data() {
|
|
107
|
+
return {
|
|
108
|
+
importTableData: [],
|
|
109
|
+
importErrorData: [],
|
|
110
|
+
modalLoading: false,
|
|
111
|
+
showProgress: false,
|
|
112
|
+
progressPercent: 0
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
computed: {
|
|
116
|
+
tableGlobalConfig() {
|
|
117
|
+
return Object.assign({ checkbox: false, seq: true, zoom: false, title: true, tableName: '导入预览' }, this.globalConfig)
|
|
118
|
+
},
|
|
119
|
+
tableColumns() {
|
|
120
|
+
return this.columns.filter(item => !(item.type === 'seq' || item.type === 'checkbox' || item.type === 'radio' || item.renderName === '$vGlobalOption'))
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
watch: {},
|
|
124
|
+
created() {
|
|
125
|
+
this.initCreated()
|
|
126
|
+
},
|
|
127
|
+
mounted() {},
|
|
128
|
+
beforeUnmount() {},
|
|
129
|
+
methods: {
|
|
130
|
+
// 初始化
|
|
131
|
+
initCreated() {
|
|
132
|
+
this.showProgress = false
|
|
133
|
+
this.progressPercent = 0
|
|
134
|
+
this.importTableData = []
|
|
135
|
+
},
|
|
136
|
+
// 弹窗关闭
|
|
137
|
+
onModalClose() {
|
|
138
|
+
this.$emit('update:visible', false)
|
|
139
|
+
},
|
|
140
|
+
// 确认导入数据按钮
|
|
141
|
+
async handleImportDataBtn(type = 'all') {
|
|
142
|
+
const that = this
|
|
143
|
+
let importData = type === 'all' ? this.importTableData : this.$refs.shtable.getSelectionData()
|
|
144
|
+
if (!importData || !Array.isArray(importData) || importData.length < 1) {
|
|
145
|
+
that.msginfo('未导入数据')
|
|
146
|
+
return false
|
|
147
|
+
}
|
|
148
|
+
if (that.needValidate) {
|
|
149
|
+
let validateErrMap = await that.handleImportDataValidate(importData)
|
|
150
|
+
if (validateErrMap) {
|
|
151
|
+
that.msgerror('导入校验失败,请检查数据')
|
|
152
|
+
return validateErrMap
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
that.$emit('confirm', importData)
|
|
156
|
+
that.onModalClose()
|
|
157
|
+
},
|
|
158
|
+
// 导入数据验证
|
|
159
|
+
async handleImportDataValidate(rows) {
|
|
160
|
+
return this.$refs.shtable.validate(rows)
|
|
161
|
+
},
|
|
162
|
+
// 下载导入模板按钮
|
|
163
|
+
handleDownloadTemplateBtn() {
|
|
164
|
+
const that = this
|
|
165
|
+
if (typeof that.downloadTemplateCallback === 'function') {
|
|
166
|
+
that.downloadTemplateCallback()
|
|
167
|
+
} else {
|
|
168
|
+
let defaultOption = {
|
|
169
|
+
filename: '模板',
|
|
170
|
+
sheetName: this.importOption.filename || '模板',
|
|
171
|
+
type: 'xlsx',
|
|
172
|
+
original: false,
|
|
173
|
+
download: true,
|
|
174
|
+
message: false,
|
|
175
|
+
useStyle: false,
|
|
176
|
+
columns: this.$refs.shtable
|
|
177
|
+
.tableRef()
|
|
178
|
+
.getColumns()
|
|
179
|
+
.filter(item => item.type !== 'seq'),
|
|
180
|
+
data: [],
|
|
181
|
+
sheetMethod: ({ options, workbook, worksheet }) => {},
|
|
182
|
+
afterExportMethod: options => {
|
|
183
|
+
this.handleDownloadTemplateFinished(options)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
this.$refs.shtable.tableRef().exportData(Object.assign(defaultOption, this.importOption))
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
// 下载导入模板成功回调
|
|
190
|
+
handleDownloadTemplateFinished(options) {
|
|
191
|
+
this.msgsuccess('下载模板完成!')
|
|
192
|
+
if (typeof this.downloadTemplateCallback === 'function') {
|
|
193
|
+
this.downloadTemplateFinished(options)
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
// 选择导入文件按钮
|
|
197
|
+
handleImportFileBtn() {
|
|
198
|
+
if (typeof this.importFileCallback === 'function') {
|
|
199
|
+
this.importFileCallback()
|
|
200
|
+
} else {
|
|
201
|
+
let defaultOption = {
|
|
202
|
+
mode: 'covering',
|
|
203
|
+
types: ['xlsx', 'csv'],
|
|
204
|
+
message: false,
|
|
205
|
+
remote: true,
|
|
206
|
+
importMethod: obj => {
|
|
207
|
+
this.handleImportFileMethod(obj)
|
|
208
|
+
},
|
|
209
|
+
afterImportMethod: options => {
|
|
210
|
+
this.handleImportFileFinished(options)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
this.$refs.shtable.tableRef().importData(Object.assign(defaultOption, this.importConfig))
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
// 选择导入文件成功回调
|
|
217
|
+
async handleImportFileMethod({ file, options }) {
|
|
218
|
+
const that = this
|
|
219
|
+
const fileExt = file.name.split('.').pop().toLocaleLowerCase()
|
|
220
|
+
if (fileExt === 'xlsx' || fileExt === 'xls') {
|
|
221
|
+
that.file = file
|
|
222
|
+
try {
|
|
223
|
+
let fileRes = await that.readFile(file)
|
|
224
|
+
let { results, errDatas } = that.dealImportTableData(that.tableColumns, fileRes)
|
|
225
|
+
that.importTableData = results
|
|
226
|
+
that.importErrorData = errDatas
|
|
227
|
+
setTimeout(() => {
|
|
228
|
+
that.showProgress = false
|
|
229
|
+
}, 2000)
|
|
230
|
+
} catch (e) {
|
|
231
|
+
that.msgerror(e.message || e)
|
|
232
|
+
}
|
|
233
|
+
} else {
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
// 选择导入文件成功回调
|
|
237
|
+
handleImportFileFinished(options) {},
|
|
238
|
+
// 读取文件
|
|
239
|
+
async readFile(file) {
|
|
240
|
+
return new Promise((resolve, reject) => {
|
|
241
|
+
const reader = new FileReader()
|
|
242
|
+
reader.readAsArrayBuffer(file)
|
|
243
|
+
reader.onloadstart = e => {
|
|
244
|
+
this.modalLoading = true
|
|
245
|
+
this.showProgress = true
|
|
246
|
+
}
|
|
247
|
+
reader.onprogress = e => {
|
|
248
|
+
this.progressPercent = Math.round((e.loaded / e.total) * 100)
|
|
249
|
+
}
|
|
250
|
+
reader.onerror = e => {
|
|
251
|
+
reject(new Error('文件读取出错'))
|
|
252
|
+
}
|
|
253
|
+
reader.onload = e => {
|
|
254
|
+
this.modalLoading = false
|
|
255
|
+
const data = e.target.result
|
|
256
|
+
const workbook = XLSX.read(data, { type: 'binary' })
|
|
257
|
+
let sheetNames = workbook.SheetNames
|
|
258
|
+
let excelJsonMap = {}
|
|
259
|
+
sheetNames.forEach(sheet => {
|
|
260
|
+
excelJsonMap[sheet] = excelToJson.sheet_to_json(workbook.Sheets[sheet])
|
|
261
|
+
})
|
|
262
|
+
let sheetActive = sheetNames.find(item => item === this.$parent.tableExportConfig.sheetName) || sheetNames[0]
|
|
263
|
+
resolve(excelJsonMap[sheetActive])
|
|
264
|
+
}
|
|
265
|
+
})
|
|
266
|
+
},
|
|
267
|
+
// 根据表格读取数据生成表格数据
|
|
268
|
+
dealImportTableData(columns, results) {
|
|
269
|
+
const that = this
|
|
270
|
+
let colsplit = '.'
|
|
271
|
+
let tableAllColumns = that.generateColumnsAll(columns)
|
|
272
|
+
let errDatas = []
|
|
273
|
+
results.map((row, rowIndex) => {
|
|
274
|
+
Object.keys(row).forEach((key, keyIndex) => {
|
|
275
|
+
let fieldObj = tableAllColumns.find(col =>
|
|
276
|
+
key.indexOf(colsplit) === -1 ? key === col.title || key === col.field : key.split(colsplit).includes(col.title) || key.split(colsplit).includes(col.field)
|
|
277
|
+
)
|
|
278
|
+
let fieldName = (fieldObj && fieldObj.field) || ''
|
|
279
|
+
if (fieldName) {
|
|
280
|
+
row[fieldName] = String(row[key])
|
|
281
|
+
delete row[key]
|
|
282
|
+
}
|
|
283
|
+
let fieldRender = (fieldObj && fieldObj.renderName) || ''
|
|
284
|
+
if (fieldRender) {
|
|
285
|
+
let fieldRenderProps = (fieldObj && fieldObj.renderProps) || {}
|
|
286
|
+
switch (fieldRender) {
|
|
287
|
+
case '$vSelect':
|
|
288
|
+
case '$vSwitch':
|
|
289
|
+
case '$vCheckgroup':
|
|
290
|
+
case '$vRadiogroup':
|
|
291
|
+
if (fieldRenderProps.options && Array.isArray(fieldRenderProps.options)) {
|
|
292
|
+
// 如果匹配到选择项则保留,否则删除掉不规范数据
|
|
293
|
+
// 判断导入值为数据源的key or value 去匹配
|
|
294
|
+
let rowsplit = fieldRenderProps.split || ','
|
|
295
|
+
let rowValue = null
|
|
296
|
+
if ((fieldRenderProps.multiple || fieldRender === '$vCheckgroup') && row[fieldName].indexOf(rowsplit) !== -1) {
|
|
297
|
+
let rowValues = row[fieldName].split(rowsplit)
|
|
298
|
+
let values = fieldRenderProps.options.map(opt => {
|
|
299
|
+
if (rowValues.includes(String(opt.value)) || rowValues.includes(opt.label)) {
|
|
300
|
+
return opt.value
|
|
301
|
+
}
|
|
302
|
+
})
|
|
303
|
+
if (values.length > 0) rowValue = values.join(rowsplit)
|
|
304
|
+
} else {
|
|
305
|
+
let opt = fieldRenderProps.options.find(opt => String(row[fieldName]) === String(opt.value) || String(row[fieldName]) === opt.label)
|
|
306
|
+
if (opt) rowValue = opt.value
|
|
307
|
+
}
|
|
308
|
+
if (rowValue === null && row[fieldName]) {
|
|
309
|
+
errDatas.push({
|
|
310
|
+
rowIndex: rowIndex + 1,
|
|
311
|
+
errMsg: `字段【${fieldObj.title}】不符合数据源规范,已被清空`
|
|
312
|
+
})
|
|
313
|
+
delete row[fieldName]
|
|
314
|
+
} else {
|
|
315
|
+
row[fieldName] = rowValue
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
break
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
return { results, errDatas }
|
|
324
|
+
},
|
|
325
|
+
// 生成全表头
|
|
326
|
+
generateColumnsAll(columns, resultColumns = []) {
|
|
327
|
+
columns.forEach((column, index) => {
|
|
328
|
+
if (column.children && Array.isArray(column.children) && column.children.length) {
|
|
329
|
+
this.generateColumnsAll(column.children, resultColumns)
|
|
330
|
+
} else {
|
|
331
|
+
if (column.field) {
|
|
332
|
+
resultColumns.push({
|
|
333
|
+
title: column.title,
|
|
334
|
+
field: column.field,
|
|
335
|
+
renderName: column.renderName,
|
|
336
|
+
renderProps: column.renderProps
|
|
337
|
+
})
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
})
|
|
341
|
+
return resultColumns
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
</script>
|
|
346
|
+
|
|
347
|
+
<style lang="scss" scoped>
|
|
348
|
+
.import-template-head {
|
|
349
|
+
+ .import-template-body,
|
|
350
|
+
+ .import-template-foot {
|
|
351
|
+
margin-top: 10px;
|
|
352
|
+
}
|
|
353
|
+
.floatright {
|
|
354
|
+
float: right;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
.import-template-body {
|
|
358
|
+
+ .import-template-foot,
|
|
359
|
+
+ .import-template-error {
|
|
360
|
+
margin-top: 10px;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
.import-template-foot {
|
|
364
|
+
display: flex;
|
|
365
|
+
align-items: center;
|
|
366
|
+
justify-content: space-between;
|
|
367
|
+
}
|
|
368
|
+
.import-template-error-list {
|
|
369
|
+
max-height: 300px;
|
|
370
|
+
overflow: auto;
|
|
371
|
+
font-size: 13px;
|
|
372
|
+
.error-item {
|
|
373
|
+
display: block;
|
|
374
|
+
margin-bottom: 5px;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
</style>
|