sh-view 2.5.8 → 2.6.0
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-result/index.vue +3 -8
- package/packages/components/global-components/sh-table/js/useTable.js +5 -3
- 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
|
@@ -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
|
}
|
|
@@ -153,7 +153,8 @@ export default function (props, context, proxy, isGrid) {
|
|
|
153
153
|
}
|
|
154
154
|
// 获取全部数据
|
|
155
155
|
// visible为true获取视图数据
|
|
156
|
-
const getFullData =
|
|
156
|
+
const getFullData = params => {
|
|
157
|
+
const { visible = false, deleteXid = false } = params || {}
|
|
157
158
|
let data = $vUtils.clone(tableRef.value.getTableData().fullData, true)
|
|
158
159
|
const columns = tableRef.value.getColumns()
|
|
159
160
|
let rnameColumns = columns.filter(col => col.rname)
|
|
@@ -165,6 +166,7 @@ export default function (props, context, proxy, isGrid) {
|
|
|
165
166
|
let { rvalue, rtext } = $vUtils.formatRender(cellValue, property, row, rname, rprops, proxy)
|
|
166
167
|
$vUtils.set(row, property, visible || ['$vMoney'].includes(rname) ? rtext : rvalue)
|
|
167
168
|
}
|
|
169
|
+
if (deleteXid) delete row._XID
|
|
168
170
|
})
|
|
169
171
|
})
|
|
170
172
|
return data
|
|
@@ -479,7 +481,7 @@ export default function (props, context, proxy, isGrid) {
|
|
|
479
481
|
}
|
|
480
482
|
let { row: newRow } = await tableRef.value.insertAt(addRows, index)
|
|
481
483
|
await tableRef.value.setActiveRow(newRow)
|
|
482
|
-
if (
|
|
484
|
+
if (isTool) emit('toolbaroption', 'add', newRow, tableRef.value)
|
|
483
485
|
}
|
|
484
486
|
// 删除行按钮
|
|
485
487
|
const handleTableDeleteRow = async (rows, isTool = false) => {
|
|
@@ -501,7 +503,7 @@ export default function (props, context, proxy, isGrid) {
|
|
|
501
503
|
let keyField = props.rowConfig.keyField || proxy.$vTableSetup.table.rowConfig.keyField
|
|
502
504
|
selectionRows.value = selectionRows.value.filter(sr => !deleteRows.find(dr => dr[keyField] === sr[keyField]))
|
|
503
505
|
}
|
|
504
|
-
if (
|
|
506
|
+
if (isTool) emit('toolbaroption', 'delete', deleteRows, tableRef.value)
|
|
505
507
|
}
|
|
506
508
|
|
|
507
509
|
watch(
|
|
@@ -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
|
}
|