sh-view 2.5.9 → 2.6.1
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/package.json +1 -1
- package/packages/components/global-components/sh-form/js/useForm.js +3 -8
- package/packages/components/global-components/sh-result/index.vue +3 -8
- package/packages/components/global-components/sh-table/components/importModal.vue +26 -23
- package/packages/components/global-components/sh-table/grid.vue +2 -60
- package/packages/components/global-components/sh-table/js/useTable.js +45 -15
- package/packages/components/global-components/sh-table/table.vue +2 -58
- package/packages/components/global-components/sh-tree/components/table-tree.vue +3 -6
- package/packages/components/global-components/sh-water-mark/index.vue +1 -1
- package/packages/vxeTable/render/mixin/cell-hooks.js +1 -1
package/package.json
CHANGED
|
@@ -86,10 +86,6 @@ export default function (props, context, proxy, isForm) {
|
|
|
86
86
|
const validate = callback => {
|
|
87
87
|
return formRef.value.validate(callback)
|
|
88
88
|
}
|
|
89
|
-
// 初始化
|
|
90
|
-
const initCreated = () => {
|
|
91
|
-
initFormItems()
|
|
92
|
-
}
|
|
93
89
|
// 初始化表单字段
|
|
94
90
|
const initFormData = () => {
|
|
95
91
|
let initItems = isForm ? props.items : props.items.filter(item => item.search && item.search !== '0')
|
|
@@ -193,7 +189,8 @@ export default function (props, context, proxy, isForm) {
|
|
|
193
189
|
initFormItems()
|
|
194
190
|
},
|
|
195
191
|
{
|
|
196
|
-
deep: true
|
|
192
|
+
deep: true,
|
|
193
|
+
immediate: true
|
|
197
194
|
}
|
|
198
195
|
)
|
|
199
196
|
watch(
|
|
@@ -207,9 +204,7 @@ export default function (props, context, proxy, isForm) {
|
|
|
207
204
|
}
|
|
208
205
|
)
|
|
209
206
|
|
|
210
|
-
onBeforeMount(() => {
|
|
211
|
-
initCreated()
|
|
212
|
-
})
|
|
207
|
+
onBeforeMount(() => {})
|
|
213
208
|
|
|
214
209
|
return {
|
|
215
210
|
slots,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
<div v-if="isicon || slots.icon" class="sh-result-icon" :class="resultType">
|
|
4
4
|
<slot name="icon"><sh-icon :type="resultIcon" :size="iconSize" /></slot>
|
|
5
5
|
</div>
|
|
6
|
-
<div v-if="
|
|
7
|
-
<slot name="title">{{
|
|
6
|
+
<div v-if="title || slots.title" class="sh-result-title" :title="title">
|
|
7
|
+
<slot name="title">{{ title }}</slot>
|
|
8
8
|
</div>
|
|
9
9
|
<div v-if="text || slots.text" v-line-clamp="clamp" class="sh-result-text" :title="text">
|
|
10
10
|
<slot name="text">{{ text }}</slot>
|
|
@@ -35,8 +35,7 @@ export default defineComponent({
|
|
|
35
35
|
default: 50
|
|
36
36
|
},
|
|
37
37
|
title: {
|
|
38
|
-
type:
|
|
39
|
-
default: true
|
|
38
|
+
type: String
|
|
40
39
|
},
|
|
41
40
|
text: {
|
|
42
41
|
type: String,
|
|
@@ -66,9 +65,6 @@ export default defineComponent({
|
|
|
66
65
|
const resultType = computed(() => {
|
|
67
66
|
return types.includes(props.type) ? props.type : 'info'
|
|
68
67
|
})
|
|
69
|
-
const resultTitle = computed(() => {
|
|
70
|
-
return props.title ? props.title || resultTitleMap[resultType.value] : false
|
|
71
|
-
})
|
|
72
68
|
const resultIcon = computed(() => {
|
|
73
69
|
return resultIconMap[resultType.value]
|
|
74
70
|
})
|
|
@@ -76,7 +72,6 @@ export default defineComponent({
|
|
|
76
72
|
return {
|
|
77
73
|
slots,
|
|
78
74
|
resultType,
|
|
79
|
-
resultTitle,
|
|
80
75
|
resultIcon
|
|
81
76
|
}
|
|
82
77
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<sh-modal
|
|
2
|
+
<sh-modal v-bind="modalConfig" :loading="modalLoading" @close="onModalClose">
|
|
3
3
|
<div class="import-template-top">
|
|
4
4
|
<transition name="fade">
|
|
5
5
|
<sh-progress v-if="showProgress" :percent="progressPercent" :stroke-width="2">
|
|
@@ -26,23 +26,14 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
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>
|
|
29
|
+
<sh-table ref="shtable" v-bind="tableConfig"></sh-table>
|
|
39
30
|
</div>
|
|
40
31
|
<div class="import-template-foot">
|
|
41
32
|
<div class="foot-left"></div>
|
|
42
33
|
<div class="foot-right">
|
|
43
34
|
<sh-button :size="size" @click="onModalClose">取消</sh-button>
|
|
44
35
|
<sh-button :size="size" status="primary" @click="handleImportDataBtn('all')">全部导入</sh-button>
|
|
45
|
-
<sh-button v-if="tableGlobalConfig.
|
|
36
|
+
<sh-button v-if="tableGlobalConfig.selectType" :size="size" status="warning" @click="handleImportDataBtn('select')">导入选中</sh-button>
|
|
46
37
|
</div>
|
|
47
38
|
</div>
|
|
48
39
|
</sh-modal>
|
|
@@ -54,8 +45,11 @@ import ExcelJS from 'exceljs'
|
|
|
54
45
|
export default defineComponent({
|
|
55
46
|
name: 'TableImport',
|
|
56
47
|
props: {
|
|
57
|
-
|
|
58
|
-
type:
|
|
48
|
+
modalConfig: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default() {
|
|
51
|
+
return {}
|
|
52
|
+
}
|
|
59
53
|
},
|
|
60
54
|
columns: {
|
|
61
55
|
type: Array
|
|
@@ -102,10 +96,10 @@ export default defineComponent({
|
|
|
102
96
|
type: Function
|
|
103
97
|
}
|
|
104
98
|
},
|
|
105
|
-
emits: ['confirm', '
|
|
99
|
+
emits: ['confirm', 'cancel'],
|
|
106
100
|
setup(props, context) {
|
|
107
101
|
const { proxy } = getCurrentInstance()
|
|
108
|
-
const { $vUtils } = proxy
|
|
102
|
+
const { $vUtils, $vTable } = proxy
|
|
109
103
|
const { emit, slots } = context
|
|
110
104
|
const shtable = ref()
|
|
111
105
|
|
|
@@ -115,9 +109,18 @@ export default defineComponent({
|
|
|
115
109
|
const showProgress = ref(false)
|
|
116
110
|
const progressPercent = ref(0)
|
|
117
111
|
|
|
118
|
-
const tableGlobalConfig = computed(() => Object.assign({
|
|
112
|
+
const tableGlobalConfig = computed(() => Object.assign({ seq: true, title: true, tableName: '导入预览' }, props.globalConfig))
|
|
119
113
|
const tableColumns = computed(() => props.columns.filter(item => !(['seq', 'checkbox', 'radio'].includes(item.type) || item.renderName === '$vGlobalOption')))
|
|
120
|
-
|
|
114
|
+
const tableConfig = computed(() => {
|
|
115
|
+
return {
|
|
116
|
+
height: props.height,
|
|
117
|
+
size: props.size,
|
|
118
|
+
editRules: props.importRules,
|
|
119
|
+
columns: tableColumns.value,
|
|
120
|
+
data: importTableData.value,
|
|
121
|
+
globalConfig: tableGlobalConfig.value
|
|
122
|
+
}
|
|
123
|
+
})
|
|
121
124
|
// 初始化
|
|
122
125
|
const initCreated = () => {
|
|
123
126
|
showProgress.value = false
|
|
@@ -126,7 +129,8 @@ export default defineComponent({
|
|
|
126
129
|
}
|
|
127
130
|
// 弹窗关闭
|
|
128
131
|
const onModalClose = () => {
|
|
129
|
-
|
|
132
|
+
$vUtils.set(props.modalConfig, 'modelValue', false)
|
|
133
|
+
emit('cancel')
|
|
130
134
|
}
|
|
131
135
|
// 确认导入数据按钮
|
|
132
136
|
const handleImportDataBtn = async (type = 'all') => {
|
|
@@ -157,7 +161,7 @@ export default defineComponent({
|
|
|
157
161
|
}
|
|
158
162
|
let defaultOption = {
|
|
159
163
|
filename: '模板',
|
|
160
|
-
sheetName: props.globalConfig
|
|
164
|
+
sheetName: props.globalConfig?.filename || '模板',
|
|
161
165
|
type: 'xlsx',
|
|
162
166
|
original: false,
|
|
163
167
|
download: true,
|
|
@@ -181,7 +185,7 @@ export default defineComponent({
|
|
|
181
185
|
// 选择导入文件按钮
|
|
182
186
|
const handleImportFileBtn = async () => {
|
|
183
187
|
try {
|
|
184
|
-
const { file } = await
|
|
188
|
+
const { file } = await $vTable.readFile({
|
|
185
189
|
types: ['xlsx', 'xls']
|
|
186
190
|
})
|
|
187
191
|
if (typeof props.importFileCallback === 'function') {
|
|
@@ -315,8 +319,7 @@ export default defineComponent({
|
|
|
315
319
|
showProgress,
|
|
316
320
|
progressPercent,
|
|
317
321
|
importErrorData,
|
|
318
|
-
|
|
319
|
-
importTableData,
|
|
322
|
+
tableConfig,
|
|
320
323
|
tableGlobalConfig,
|
|
321
324
|
onModalClose,
|
|
322
325
|
handleDownloadTemplateBtn,
|
|
@@ -5,59 +5,8 @@
|
|
|
5
5
|
ref="tableRef"
|
|
6
6
|
:key="renderKey"
|
|
7
7
|
:class="{ 'is--hasfooter': showFooter }"
|
|
8
|
+
v-bind="tableBindConfig"
|
|
8
9
|
:columns="tableColumns"
|
|
9
|
-
:data="tableViewData"
|
|
10
|
-
:width="width"
|
|
11
|
-
:height="height"
|
|
12
|
-
:min-height="minHeight"
|
|
13
|
-
:max-height="maxHeight"
|
|
14
|
-
:auto-resize="autoResize"
|
|
15
|
-
:sync-resize="syncResize"
|
|
16
|
-
:stripe="stripe && !tableTreeConfig"
|
|
17
|
-
:border="border"
|
|
18
|
-
:round="round"
|
|
19
|
-
:size="size"
|
|
20
|
-
:loading="loading"
|
|
21
|
-
:align="align"
|
|
22
|
-
:header-align="headerAlign"
|
|
23
|
-
:show-header="showHeader"
|
|
24
|
-
:row-class-name="rowClassName"
|
|
25
|
-
:cell-class-name="cellClassName"
|
|
26
|
-
:header-row-class-name="headerRowClassName"
|
|
27
|
-
:header-cell-class-name="headerCellClassName"
|
|
28
|
-
:footer-row-class-name="footerRowClassName"
|
|
29
|
-
:footer-cell-class-name="footerCellClassName"
|
|
30
|
-
:show-footer="showFooter"
|
|
31
|
-
:footer-method="footerMethod || tableFooterMethod"
|
|
32
|
-
:footer-span-method="footerSpanMethod || tableFooterSpanMethod"
|
|
33
|
-
:merge-cells="mergeCells"
|
|
34
|
-
:merge-footer-items="mergeFooterItems"
|
|
35
|
-
:show-overflow="showOverflow"
|
|
36
|
-
:show-header-overflow="showHeaderOverflow"
|
|
37
|
-
:show-footer-overflow="showFooterOverflow"
|
|
38
|
-
:keep-source="keepSource"
|
|
39
|
-
:empty-text="emptyText"
|
|
40
|
-
:row-config="rowConfig"
|
|
41
|
-
:column-config="tableColumnConfig"
|
|
42
|
-
:checkbox-config="tableCheckboxConfig"
|
|
43
|
-
:radio-config="radioConfig"
|
|
44
|
-
:tree-config="tableTreeConfig"
|
|
45
|
-
:seq-config="seqConfig"
|
|
46
|
-
:expand-config="expandConfig"
|
|
47
|
-
:tooltip-config="tooltipConfig"
|
|
48
|
-
:edit-config="tableEditConfig"
|
|
49
|
-
:valid-config="validConfig"
|
|
50
|
-
:edit-rules="tableEditRules"
|
|
51
|
-
:toolbar-config="toolbarConfig"
|
|
52
|
-
:pager-config="tablePagerConfig"
|
|
53
|
-
:keyboard-config="keyboardConfig"
|
|
54
|
-
:sort-config="sortConfig"
|
|
55
|
-
:mouse-config="mouseConfig"
|
|
56
|
-
:custom-config="customConfig"
|
|
57
|
-
:export-config="tableExportConfig"
|
|
58
|
-
:print-config="tablePrintConfig"
|
|
59
|
-
:scroll-x="scrollX"
|
|
60
|
-
:scroll-y="scrollY"
|
|
61
10
|
@current-change="onCurrentChange"
|
|
62
11
|
@radio-change="onRadioChange"
|
|
63
12
|
@checkbox-change="onSelectionChange"
|
|
@@ -138,14 +87,7 @@
|
|
|
138
87
|
</template>
|
|
139
88
|
</vxe-grid>
|
|
140
89
|
<!--导入弹窗-->
|
|
141
|
-
<importModal
|
|
142
|
-
v-if="importVisible"
|
|
143
|
-
v-model:visible="importVisible"
|
|
144
|
-
need-validate
|
|
145
|
-
:columns="tableColumns"
|
|
146
|
-
:import-config="importConfig"
|
|
147
|
-
:import-rules="tableEditRules"
|
|
148
|
-
@confirm="setImportData"></importModal>
|
|
90
|
+
<importModal v-if="importBindConfig.modalConfig.modelValue" v-bind="importBindConfig" @confirm="setImportData"></importModal>
|
|
149
91
|
</div>
|
|
150
92
|
</template>
|
|
151
93
|
|
|
@@ -1,6 +1,21 @@
|
|
|
1
|
-
import { computed, ref, watch } from 'vue'
|
|
1
|
+
import { computed, reactive, ref, watch } from 'vue'
|
|
2
2
|
import { columnDefaultFilterMethod, tableFooterCompute, getTransfarFields, getFieldsRules, turnColumnItemFilters } from './tableMethods'
|
|
3
3
|
|
|
4
|
+
// 记录自定义参数,传给vxe要过滤掉
|
|
5
|
+
let omitProps = [
|
|
6
|
+
'dataSourse',
|
|
7
|
+
'disabled',
|
|
8
|
+
'customLayout',
|
|
9
|
+
'columnObj',
|
|
10
|
+
'globalConfig',
|
|
11
|
+
'footerCalculate',
|
|
12
|
+
'tableName',
|
|
13
|
+
'queryData',
|
|
14
|
+
'onToolbarBtnAddBefore',
|
|
15
|
+
'onToolbarBtnDeleteBefore',
|
|
16
|
+
'onExportMethod',
|
|
17
|
+
'onPrintMethod'
|
|
18
|
+
]
|
|
4
19
|
const globalConfigDefault = {
|
|
5
20
|
tableName: '',
|
|
6
21
|
title: false, // 是否显示 tableName
|
|
@@ -57,7 +72,6 @@ export default function (props, context, proxy, isGrid) {
|
|
|
57
72
|
const tableEditRules = ref({}) // 表格根据表头自动生成验证规则
|
|
58
73
|
const tableFilterText = ref('') // 全局过滤关键字
|
|
59
74
|
const tableCurrentRowData = ref(null) // 表格当前高亮行
|
|
60
|
-
const importVisible = ref(false) // 导出入弹窗开关
|
|
61
75
|
const tableRowDefaultData = ref({}) // 根据表头生成行默认值
|
|
62
76
|
|
|
63
77
|
const wrapHeight = computed(() => ([100, '100%', 'auto'].includes(props.height) ? '100%' : 'auto'))
|
|
@@ -146,6 +160,32 @@ export default function (props, context, proxy, isGrid) {
|
|
|
146
160
|
let disSlots = ['head', 'form', 'formLeft', 'formRight', 'toolbar', 'toolbarLeft', 'toolbarRight', 'pagerLeft', 'pagerRight']
|
|
147
161
|
return Object.keys(slots).filter(key => !disSlots.includes(key))
|
|
148
162
|
})
|
|
163
|
+
const tableBindConfig = computed(() => {
|
|
164
|
+
let defaultProps = { footerMethod: tableFooterMethod, footerSpanMethod: tableFooterSpanMethod }
|
|
165
|
+
let tableProps = $vUtils.omit(props, (val, key) => {
|
|
166
|
+
return omitProps.includes(key) || $vUtils.isNone(val)
|
|
167
|
+
})
|
|
168
|
+
let shProps = {
|
|
169
|
+
data: tableViewData.value,
|
|
170
|
+
stripe: props.stripe && !tableTreeConfig.value,
|
|
171
|
+
columnConfig: tableColumnConfig.value,
|
|
172
|
+
checkboxConfig: tableCheckboxConfig.value,
|
|
173
|
+
treeConfig: tableTreeConfig.value,
|
|
174
|
+
seqConfig: tableSeqConfig.value,
|
|
175
|
+
editConfig: tableEditConfig.value,
|
|
176
|
+
editRules: tableEditRules.value,
|
|
177
|
+
exportConfig: tableExportConfig.value,
|
|
178
|
+
printConfig: tablePrintConfig.value
|
|
179
|
+
}
|
|
180
|
+
return Object.assign(defaultProps, tableProps, shProps)
|
|
181
|
+
})
|
|
182
|
+
const importBindConfig = reactive({
|
|
183
|
+
modalConfig: { modelValue: false, title: '导入报表', width: '900', showFooter: false, transfer: false },
|
|
184
|
+
needValidate: true,
|
|
185
|
+
columns: props.columns,
|
|
186
|
+
importConfig: props.importConfig,
|
|
187
|
+
importRules: tableEditRules.value
|
|
188
|
+
})
|
|
149
189
|
|
|
150
190
|
// 获取选中数据
|
|
151
191
|
const getSelectionData = () => {
|
|
@@ -447,7 +487,7 @@ export default function (props, context, proxy, isGrid) {
|
|
|
447
487
|
}
|
|
448
488
|
// 表格导入按钮
|
|
449
489
|
const handleTableImportBtn = () => {
|
|
450
|
-
|
|
490
|
+
importBindConfig.modalConfig.modelValue = true
|
|
451
491
|
}
|
|
452
492
|
// 表格打印按鈕
|
|
453
493
|
const handleTablePrintBtn = options => {
|
|
@@ -545,27 +585,17 @@ export default function (props, context, proxy, isGrid) {
|
|
|
545
585
|
tableGlobalConfig,
|
|
546
586
|
tablePrevColumns,
|
|
547
587
|
tableColumns,
|
|
548
|
-
tableColumnConfig,
|
|
549
588
|
tableColumnObjConfig,
|
|
550
|
-
tableCheckboxConfig,
|
|
551
|
-
tableTreeConfig,
|
|
552
|
-
tableSeqConfig,
|
|
553
|
-
tableEditConfig,
|
|
554
|
-
tableEditRules,
|
|
555
589
|
tablePagerConfig,
|
|
556
|
-
tableExportConfig,
|
|
557
|
-
tablePrintConfig,
|
|
558
590
|
tableQueryConfig,
|
|
559
591
|
tableFilterText,
|
|
560
592
|
tableFilterConfig,
|
|
561
593
|
tableFilterData,
|
|
562
|
-
tableViewData,
|
|
563
594
|
tableTools,
|
|
564
595
|
tableSlots,
|
|
565
596
|
selectionRows,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
tableFooterSpanMethod,
|
|
597
|
+
tableBindConfig,
|
|
598
|
+
importBindConfig,
|
|
569
599
|
onCurrentChange,
|
|
570
600
|
onRadioChange,
|
|
571
601
|
onSelectionChange,
|
|
@@ -46,57 +46,8 @@
|
|
|
46
46
|
ref="tableRef"
|
|
47
47
|
:key="renderKey"
|
|
48
48
|
:class="{ 'is--hasfooter': showFooter }"
|
|
49
|
-
|
|
50
|
-
:width="width"
|
|
49
|
+
v-bind="tableBindConfig"
|
|
51
50
|
:height="tableHeight"
|
|
52
|
-
:min-height="minHeight"
|
|
53
|
-
:max-height="maxHeight"
|
|
54
|
-
:auto-resize="autoResize"
|
|
55
|
-
:sync-resize="syncResize"
|
|
56
|
-
:stripe="stripe && !tableTreeConfig"
|
|
57
|
-
:border="border"
|
|
58
|
-
:round="round"
|
|
59
|
-
:size="size"
|
|
60
|
-
:loading="loading"
|
|
61
|
-
:align="align"
|
|
62
|
-
:header-align="headerAlign"
|
|
63
|
-
:show-header="showHeader"
|
|
64
|
-
:row-class-name="rowClassName"
|
|
65
|
-
:cell-class-name="cellClassName"
|
|
66
|
-
:header-row-class-name="headerRowClassName"
|
|
67
|
-
:header-cell-class-name="headerCellClassName"
|
|
68
|
-
:footer-row-class-name="footerRowClassName"
|
|
69
|
-
:footer-cell-class-name="footerCellClassName"
|
|
70
|
-
:show-footer="showFooter"
|
|
71
|
-
:footer-method="footerMethod || tableFooterMethod"
|
|
72
|
-
:footer-span-method="footerSpanMethod || tableFooterSpanMethod"
|
|
73
|
-
:merge-cells="mergeCells"
|
|
74
|
-
:merge-footer-items="mergeFooterItems"
|
|
75
|
-
:show-overflow="showOverflow"
|
|
76
|
-
:show-header-overflow="showHeaderOverflow"
|
|
77
|
-
:show-footer-overflow="showFooterOverflow"
|
|
78
|
-
:keep-source="keepSource"
|
|
79
|
-
:empty-text="emptyText"
|
|
80
|
-
:row-config="rowConfig"
|
|
81
|
-
:column-config="tableColumnConfig"
|
|
82
|
-
:checkbox-config="tableCheckboxConfig"
|
|
83
|
-
:radio-config="radioConfig"
|
|
84
|
-
:tree-config="tableTreeConfig"
|
|
85
|
-
:seq-config="tableSeqConfig"
|
|
86
|
-
:expand-config="expandConfig"
|
|
87
|
-
:tooltip-config="tooltipConfig"
|
|
88
|
-
:edit-config="tableEditConfig"
|
|
89
|
-
:valid-config="validConfig"
|
|
90
|
-
:edit-rules="tableEditRules"
|
|
91
|
-
:toolbar-config="toolbarConfig"
|
|
92
|
-
:keyboard-config="keyboardConfig"
|
|
93
|
-
:sort-config="sortConfig"
|
|
94
|
-
:mouse-config="mouseConfig"
|
|
95
|
-
:custom-config="customConfig"
|
|
96
|
-
:export-config="tableExportConfig"
|
|
97
|
-
:print-config="tablePrintConfig"
|
|
98
|
-
:scroll-x="scrollX"
|
|
99
|
-
:scroll-y="scrollY"
|
|
100
51
|
@current-change="onCurrentChange"
|
|
101
52
|
@radio-change="onRadioChange"
|
|
102
53
|
@checkbox-change="onSelectionChange"
|
|
@@ -147,14 +98,7 @@
|
|
|
147
98
|
</div>
|
|
148
99
|
<div v-if="isBottomSlot" ref="bottomSlotRef" v-resize="handleResize" class="sh-table-bottom"><slot name="bottom"></slot></div>
|
|
149
100
|
<!--导入弹窗-->
|
|
150
|
-
<importModal
|
|
151
|
-
v-if="importVisible"
|
|
152
|
-
v-model:visible="importVisible"
|
|
153
|
-
need-validate
|
|
154
|
-
:columns="columns"
|
|
155
|
-
:import-config="importConfig"
|
|
156
|
-
:import-rules="tableEditRules"
|
|
157
|
-
@confirm="setImportData"></importModal>
|
|
101
|
+
<importModal v-if="importBindConfig.modalConfig.modelValue" v-bind="importBindConfig" @confirm="setImportData"></importModal>
|
|
158
102
|
</div>
|
|
159
103
|
</template>
|
|
160
104
|
|
|
@@ -208,12 +208,9 @@ export default defineComponent({
|
|
|
208
208
|
})
|
|
209
209
|
searchData = $vUtils.searchTree(treeData.value, row => {
|
|
210
210
|
return searchProps.some(item => {
|
|
211
|
-
let cellValue =
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return String(rtext).toLowerCase().indexOf(filterText) > -1
|
|
215
|
-
}
|
|
216
|
-
return $vUtils.trim(cellValue).toLowerCase().indexOf(filterText) > -1
|
|
211
|
+
let cellValue = $vUtils.get(row, item.rkey)
|
|
212
|
+
let { rtext } = $vUtils.formatRender(cellValue, item.rkey, row, item.rname, item.rprops, proxy)
|
|
213
|
+
return $vUtils.trim(rtext).toLowerCase().indexOf(filterText) > -1
|
|
217
214
|
})
|
|
218
215
|
})
|
|
219
216
|
}
|
|
@@ -102,7 +102,7 @@ export default function (props, context, proxy) {
|
|
|
102
102
|
const setRenderValue = (value, isCall) => {
|
|
103
103
|
let cellValue = value || renderValue.value
|
|
104
104
|
if (!isCall) {
|
|
105
|
-
if (['$vMoney'].includes(props.rname) && cellValue
|
|
105
|
+
if (['$vMoney'].includes(props.rname) && !$vUtils.isNone(cellValue)) cellValue = $vUtils.multiply(cellValue, props.rprops.moneyUnit || 1)
|
|
106
106
|
let { rvalue, rtext } = formatValueFun(cellValue, true)
|
|
107
107
|
cellValue = rvalue
|
|
108
108
|
}
|