sh-view 2.5.8 → 2.5.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-view",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
4
4
  "description": "基于vxe-table二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -153,7 +153,8 @@ export default function (props, context, proxy, isGrid) {
153
153
  }
154
154
  // 获取全部数据
155
155
  // visible为true获取视图数据
156
- const getFullData = ({ visible }) => {
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 (!isTool) emit('toolbaroption', 'add', newRow, tableRef.value)
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 (!isTool) emit('toolbaroption', 'delete', deleteRows, tableRef.value)
506
+ if (isTool) emit('toolbaroption', 'delete', deleteRows, tableRef.value)
505
507
  }
506
508
 
507
509
  watch(