From 2637821cb7466330f5c612be809531cb65790219 Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期五, 04 七月 2025 20:01:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/components/jeecg/JVxeTable/components/JVxeTable.js | 248 +++++++++++++++++++++++++++----------------------
1 files changed, 138 insertions(+), 110 deletions(-)
diff --git a/src/components/jeecg/JVxeTable/components/JVxeTable.js b/src/components/jeecg/JVxeTable/components/JVxeTable.js
index 3532194..7d60fbb 100644
--- a/src/components/jeecg/JVxeTable/components/JVxeTable.js
+++ b/src/components/jeecg/JVxeTable/components/JVxeTable.js
@@ -23,7 +23,7 @@
}
},
mixins: [VxeWebSocketMixins],
- components: {JVxeToolbar, JVxeSubPopover, JVxeDetailsModal, JVxePagination},
+ components: { JVxeToolbar, JVxeSubPopover, JVxeDetailsModal, JVxePagination },
props: {
rowKey: PropTypes.string.def('id'),
// 鍒椾俊鎭�
@@ -48,7 +48,7 @@
// prefix 鍓嶇紑锛泂uffix 鍚庣紑锛�
slots: ['prefix', 'suffix'],
// add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳锛沜ollapse 灞曞紑鏀惰捣
- btns: ['add', 'remove', 'clearSelection'],
+ btns: ['add', 'remove', 'clearSelection']
})),
// 鏄惁鏄剧ず琛屽彿
rowNumber: PropTypes.bool.def(false),
@@ -66,7 +66,7 @@
// 鏈�澶ч珮搴�
maxHeight: {
type: Number,
- default: () => null,
+ default: () => null
},
// 瑕佺鐢ㄧ殑琛� TODO 鏈疄鐜�
disabledRows: PropTypes.object.def(() => ({})),
@@ -99,7 +99,7 @@
// 娉細璇ュ弬鏁颁笉鑳藉姩鎬佷慨鏀癸紱濡傛灉琛屻�佸垪瀛楁澶氱殑鎯呭喌涓嬶紝浼氭牴鎹満鍣ㄦ�ц兘閫犳垚涓嶅悓绋嬪害鐨勫崱椤裤��
alwaysEdit: PropTypes.bool.def(false),
// 鑱斿姩閰嶇疆锛屾暟缁勶紝璇︽儏閰嶇疆瑙佹枃妗�
- linkageConfig: PropTypes.array.def(() => []),
+ linkageConfig: PropTypes.array.def(() => [])
},
data() {
return {
@@ -111,7 +111,7 @@
// 鍐呯疆 EditRules
innerEditRules: [],
// 璁板綍婊氬姩鏉′綅缃�
- scroll: {top: 0, left: 0},
+ scroll: { top: 0, left: 0 },
// 褰撳墠鏄惁姝e湪婊氬姩
scrolling: false,
// vxe 榛樿閰嶇疆
@@ -125,7 +125,7 @@
'show-header-overflow': true,
'show-footer-overflow': true,
// 鍙紪杈戦厤缃�
- 'edit-config': {trigger: 'click', mode: 'cell', showStatus: true},
+ 'edit-config': { trigger: 'click', mode: 'cell', showStatus: true },
'expand-config': {
iconClose: 'ant-table-row-expand-icon ant-table-row-collapsed',
iconOpen: 'ant-table-row-expand-icon ant-table-row-expanded'
@@ -137,8 +137,8 @@
// 'scroll-x': {
// gt: 15
// },
- 'radio-config': {highlight: true},
- 'checkbox-config': {highlight: true},
+ 'radio-config': { highlight: true },
+ 'checkbox-config': { highlight: true }
},
// 缁戝畾宸︿晶閫夋嫨妗�
selectedRows: [],
@@ -148,15 +148,15 @@
statistics: {
has: false,
sum: [],
- average: [],
+ average: []
},
// 鍏佽鎵ц鍒锋柊鐗规晥鐨勮ID
reloadEffectRowKeysMap: {},
//閰嶇疆浜嗕絾鏄病鏈夋巿鏉冪殑鎸夐挳鍜屽垪 闆嗗悎
- excludeCode:[],
+ excludeCode: [],
// 鑱斿姩涓嬫媺閫夐」锛堢敤浜庨殧绂讳笉鍚岀殑涓嬫媺閫夐」锛�
// 鍐呴儴鑱斿姩閰嶇疆锛宮ap
- innerLinkageConfig: null,
+ innerLinkageConfig: null
}
},
computed: {
@@ -171,7 +171,7 @@
scrolling: this.scrolling,
reloadEffect: this.reloadEffect,
reloadEffectRowKeysMap: this.reloadEffectRowKeysMap,
- listeners: this.cellListeners,
+ listeners: this.cellListeners
}
if (column.$type === JVXETypes.rowDragSort) {
renderOptions.dragSortKey = this.dragSortKey
@@ -191,7 +191,7 @@
config: this.innerLinkageConfig.get(column.key),
getLinkageOptionsSibling: this.getLinkageOptionsSibling,
getLinkageOptionsAsync: this.getLinkageOptionsAsync,
- linkageSelectChange: this.linkageSelectChange,
+ linkageSelectChange: this.linkageSelectChange
}
}
}
@@ -204,21 +204,21 @@
// update--begin--autor:lvdandan-----date:20201019------for:LOWCOD-882 銆愭柊琛岀紪杈戙�戝垪琛ㄤ笂甯︽寜閽殑閬尅闂
if (column.$type === JVXETypes.file || column.$type === JVXETypes.image) {
if (column.width && column.width.endsWith('px')) {
- column.width = Number.parseInt(column.width.substr(0,column.width.length-2))+Number.parseInt(1)+'px';
+ column.width = Number.parseInt(column.width.substr(0, column.width.length - 2)) + Number.parseInt(1) + 'px'
}
}
// update--begin--autor:lvdandan-----date:20201019------for:LOWCOD-882 銆愭柊琛岀紪杈戙�戝垪琛ㄤ笂甯︽寜閽殑閬尅闂
// update--begin--autor:lvdandan-----date:20201211------for:JT-118 銆恛nline銆� 鏃ユ湡銆佹椂闂存帶浠堕暱搴﹁緝灏�
if (column.$type === JVXETypes.datetime || column.$type === JVXETypes.userSelect || column.$type === JVXETypes.departSelect) {
- let width = column.width && column.width.endsWith('px')?Number.parseInt(column.width.substr(0,column.width.length-2)):0;
- if(width <= 190){
+ let width = column.width && column.width.endsWith('px') ? Number.parseInt(column.width.substr(0, column.width.length - 2)) : 0
+ if (width <= 190) {
column.width = '190px'
}
}
if (column.$type === JVXETypes.date) {
- let width = column.width && column.width.endsWith('px')?Number.parseInt(column.width.substr(0,column.width.length-2)):0;
- if(width <= 135){
+ let width = column.width && column.width.endsWith('px') ? Number.parseInt(column.width.substr(0, column.width.length - 2)) : 0
+ if (width <= 135) {
column.width = '135px'
}
}
@@ -235,7 +235,7 @@
let expandConfig = Object.assign({}, this.defaultVxeProps['expand-config'], this.expandConfig)
return Object.assign({}, this.defaultVxeProps, {
- showFooter: this.statistics.has,
+ showFooter: this.statistics.has
}, this.$attrs, {
loading: this.loading,
columns: this.vxeColumns,
@@ -245,7 +245,7 @@
maxHeight: this.maxHeight,
border: this.bordered,
expandConfig: expandConfig,
- footerMethod: this.handleFooterMethod,
+ footerMethod: this.handleFooterMethod
// footerSpanMethod: this.handleFooterSpanMethod,
})
},
@@ -259,7 +259,7 @@
'edit-actived': this.handleEditActived,
'radio-change': this.handleVxeRadioChange,
'checkbox-all': this.handleVxeCheckboxAll,
- 'checkbox-change': this.handleVxeCheckboxChange,
+ 'checkbox-change': this.handleVxeCheckboxChange
}
// 鐢ㄦ埛浼犻�掔殑浜嬩欢锛岃繘琛屽悎骞舵搷浣�
Object.keys(this.$listeners).forEach(key => {
@@ -285,9 +285,9 @@
/** 褰撳墠琛屽悜涓嬬Щ涓�浣� */
rowMoveDown: rowIndex => this.rowResort(rowIndex, rowIndex + 1),
/** 鍦ㄥ綋鍓嶈涓嬮潰鎻掑叆涓�琛� */
- rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1),
+ rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1)
}
- },
+ }
},
watch: {
dataSource: {
@@ -334,7 +334,7 @@
// }
// }
// })
- },
+ }
},
columns: {
immediate: true,
@@ -343,7 +343,7 @@
this.loadExcludeCode()
let innerColumns = []
let innerEditRules = {}
- let {rowNumber, rowSelection, rowExpand, dragSort} = this
+ let { rowNumber, rowSelection, rowExpand, dragSort } = this
let expandColumn, seqColumn, checkboxColumn, radioColumn, dragSortColumn
if (Array.isArray(columns)) {
this.statistics.has = false
@@ -352,11 +352,11 @@
// 澶勭悊鎴恦xe鍙瘑鍒殑columns
columns.forEach(column => {
- if(this.excludeCode.indexOf(column.key)>=0){
+ if (this.excludeCode.indexOf(column.key) >= 0) {
return false
}
- let col = {...column}
- let {type} = col
+ let col = { ...column }
+ let { type } = col
const enhanced = getEnhancedMixins(type)
if (type === JVXETypes.rowNumber) {
seqColumn = col
@@ -373,7 +373,7 @@
// 闃叉鍜寁xeTable鑷甫鐨則ype璧峰啿绐�
col.$type = col.type
delete col.type
- let renderName = 'cellRender', renderOptions = {name: JVXETypes._prefix + type}
+ let renderName = 'cellRender', renderOptions = { name: JVXETypes._prefix + type }
if (type) {
// hidden 鏄壒娈婄殑缁勪欢
if (type === JVXETypes.hidden) {
@@ -441,9 +441,9 @@
}
// 鍒ゆ柇鏄惁寮�鍚簡搴忓彿
if (rowNumber) {
- let col = {type: 'seq', title: '#', width: 60, fixed: 'left', align: 'center'}
+ let col = { type: 'seq', title: '#', width: 60, fixed: 'left', align: 'center' }
if (seqColumn) {
- col = Object.assign(col, seqColumn, {type: 'seq'})
+ col = Object.assign(col, seqColumn, { type: 'seq' })
}
innerColumns.unshift(col)
}
@@ -453,14 +453,14 @@
if (this.statistics.has && !rowExpand && !dragSort) {
width = 60
}
- let col = {type: this.rowSelectionType, width, fixed: 'left', align: 'center'}
+ let col = { type: this.rowSelectionType, width, fixed: 'left', align: 'center' }
// radio
if (this.rowSelectionType === 'radio' && radioColumn) {
- col = Object.assign(col, radioColumn, {type: 'radio'})
+ col = Object.assign(col, radioColumn, { type: 'radio' })
}
// checkbox
if (this.rowSelectionType === 'checkbox' && checkboxColumn) {
- col = Object.assign(col, checkboxColumn, {type: 'checkbox'})
+ col = Object.assign(col, checkboxColumn, { type: 'checkbox' })
}
innerColumns.unshift(col)
}
@@ -470,9 +470,16 @@
if (this.statistics.has && !dragSort) {
width = 60
}
- let col = {type: 'expand', title: '', width, fixed: 'left', align: 'center', slots: {content: 'expandContent'}}
+ let col = {
+ type: 'expand',
+ title: '',
+ width,
+ fixed: 'left',
+ align: 'center',
+ slots: { content: 'expandContent' }
+ }
if (expandColumn) {
- col = Object.assign(col, expandColumn, {type: 'expand'})
+ col = Object.assign(col, expandColumn, { type: 'expand' })
}
innerColumns.unshift(col)
}
@@ -482,9 +489,16 @@
if (this.statistics.has) {
width = 60
}
- let col = {type: JVXETypes.rowDragSort, title: '', width, fixed: 'left', align: 'center', cellRender: {name: JVXETypes._prefix + JVXETypes.rowDragSort}}
+ let col = {
+ type: JVXETypes.rowDragSort,
+ title: '',
+ width,
+ fixed: 'left',
+ align: 'center',
+ cellRender: { name: JVXETypes._prefix + JVXETypes.rowDragSort }
+ }
if (dragSortColumn) {
- col = Object.assign(col, dragSortColumn, {type: JVXETypes.rowDragSort})
+ col = Object.assign(col, dragSortColumn, { type: JVXETypes.rowDragSort })
}
innerColumns.unshift(col)
}
@@ -525,7 +539,7 @@
this.innerLinkageConfig = null
}
}
- },
+ }
},
created() {
},
@@ -559,7 +573,7 @@
},
handleVxeScroll(event) {
- let {$refs, scroll} = this
+ let { $refs, scroll } = this
// 璁板綍婊氬姩鏉$殑浣嶇疆
scroll.top = event.scrollTop
@@ -609,8 +623,8 @@
// 鐐瑰嚮鍗曞厓鏍兼椂瑙﹀彂鐨勪簨浠�
handleCellClick(event) {
- let {row, column, $event, $table} = event
- let {$refs} = this
+ let { row, column, $event, $table } = event
+ let { $refs } = this
// 鐐瑰嚮浜嗗彲缂栬緫鐨�
if (column.editRender) {
@@ -651,20 +665,20 @@
},
// 鍗曞厓鏍肩紪杈戠姸鎬佷笅琚叧闂椂浼氳Е鍙戣浜嬩欢
- handleEditClosed({column}) {
+ handleEditClosed({ column }) {
// 鎵ц澧炲己
getEnhancedMixins(column.own.$type, 'aopEvents').editClosed.apply(this, arguments)
},
// 鍗曞厓鏍艰婵�娲荤紪杈戞椂浼氳Е鍙戣浜嬩欢
- handleEditActived({column}) {
+ handleEditActived({ column }) {
// 鎵ц澧炲己
getEnhancedMixins(column.own.$type, 'aopEvents').editActived.apply(this, arguments)
},
/** 琛ㄥ熬鏁版嵁澶勭悊鏂规硶锛岀敤浜庢樉绀虹粺璁′俊鎭� */
- handleFooterMethod({columns, data}) {
- const {statistics} = this
+ handleFooterMethod({ columns, data }) {
+ const { statistics } = this
let footers = []
if (statistics.has) {
if (statistics.sum.length > 0) {
@@ -687,7 +701,7 @@
return footers
},
- getFooterStatisticsMap({columns, title, checks, method}) {
+ getFooterStatisticsMap({ columns, title, checks, method }) {
return columns.map((column, columnIndex) => {
if (columnIndex === 0) {
return title
@@ -702,7 +716,7 @@
/** 琛ㄥ熬鍗曞厓鏍煎悎骞舵柟娉� */
handleFooterSpanMethod(event) {
if (event.columnIndex === 0) {
- return {colspan: 2}
+ return { colspan: 2 }
}
},
@@ -716,10 +730,10 @@
this.scrollTo(null, (top == null || top === '') ? this.scroll.top : top)
},
clearAllData() {
- let {xTable} = this.$refs.vxe.$refs
- // issues/2784
- // 鍏堟竻绌烘墍鏈夋暟鎹�
- xTable.loadData([])
+ let { xTable } = this.$refs.vxe.$refs
+ // issues/2784
+ // 鍏堟竻绌烘墍鏈夋暟鎹�
+ xTable.loadData([])
},
/**
* 鍔犺浇鏂版暟鎹紝鍜� loadData 涓嶅悓鐨勬槸锛岀敤璇ユ柟娉曞姞杞界殑鏁版嵁閮芥槸鐩稿綋浜庣偣鏂板鎸夐挳鏂板鐨勬暟鎹��
@@ -728,7 +742,7 @@
*/
async loadNewData(dataSource) {
if (Array.isArray(dataSource)) {
- let {xTable} = this.$refs.vxe.$refs
+ let { xTable } = this.$refs.vxe.$refs
// issues/2784
// 鍏堟竻绌烘墍鏈夋暟鎹�
xTable.loadData([])
@@ -771,8 +785,8 @@
// 鏄惁鏇存柊浜嗘暟鎹�
let updated = false
values.forEach((item, idx) => {
- let {rowKey, values: record} = item
- let {row} = this.getIfRowById(rowKey)
+ let { rowKey, values: record } = item
+ let { row } = this.getIfRowById(rowKey)
if (!row) {
return
}
@@ -791,7 +805,7 @@
oldValue: oldValue,
col: column.own,
column: column,
- isSetValues: true,
+ isSetValues: true
})
}
} else {
@@ -799,13 +813,13 @@
}
})
})
- // 銆恑ssues/3828銆戞暟鎹洿鏂板悗锛岄噸鏂拌绠楃粺璁″垪
+ // 銆恑ssues/3828銆戞暟鎹洿鏂板悗锛岄噸鏂拌绠楃粺璁″垪
if (updated && this.statistics.has) {
this.$nextTick(async () => {
- let {xTable} = this.$refs.vxe.$refs;
- await xTable.updateCache(true);
- await xTable.updateData();
- });
+ let { xTable } = this.$refs.vxe.$refs
+ await xTable.updateCache(true)
+ await xTable.updateData()
+ })
}
},
@@ -818,18 +832,18 @@
},
/** 鑾峰彇琛ㄦ牸琛ㄥ崟閲岀殑鍊� */
getValues(callback, rowIds) {
- let tableData = this.getTableData({rowIds: rowIds})
+ let tableData = this.getTableData({ rowIds: rowIds })
callback('', tableData)
},
/** 鑾峰彇琛ㄦ牸鏁版嵁 */
getTableData(options = {}) {
- let {rowIds} = options
+ let { rowIds } = options
let tableData
// 浠呮煡璇㈡寚瀹歩d鐨勮
if (Array.isArray(rowIds) && rowIds.length > 0) {
tableData = []
rowIds.forEach(rowId => {
- let {row} = this.getIfRowById(rowId)
+ let { row } = this.getIfRowById(rowId)
if (row) {
tableData.push(row)
}
@@ -858,11 +872,11 @@
row = this.getNewRowById(id)
if (!row) {
console.warn(`JVxeTable.getIfRowById锛氭病鏈夋壘鍒癷d涓�"${id}"鐨勮`)
- return {row: null}
+ return { row: null }
}
isNew = true
}
- return {row, isNew}
+ return { row, isNew }
},
/** 閫氳繃涓存椂ID鑾峰彇鏂板鐨勮 */
getNewRowById(id) {
@@ -910,8 +924,8 @@
* @param options.setActive 鏄惁婵�娲绘渶鍚庝竴琛岀殑缂栬緫妯″紡
*/
async pushRows(rows = {}, options = {}) {
- let {xTable} = this.$refs.vxe.$refs
- let {setActive, index} = options
+ let { xTable } = this.$refs.vxe.$refs
+ let { setActive, index } = options
setActive = setActive == null ? false : !!setActive
index = index == null ? -1 : index
index = index === -1 ? index : xTable.tableFullData[index]
@@ -927,7 +941,7 @@
/** 娓呯┖閫夋嫨琛� */
clearSelection() {
- let event = {$table: this.$refs.vxe, target: this}
+ let event = { $table: this.$refs.vxe, target: this }
if (this.rowSelectionType === JVXETypes.rowRadio) {
this.$refs.vxe.clearRadioRow()
this.handleVxeRadioChange(event)
@@ -953,7 +967,7 @@
rowIds = [rowId]
}
let rows = rowIds.map((id) => {
- let {row} = this.getIfRowById(id)
+ let { row } = this.getIfRowById(id)
if (!row) {
return
}
@@ -1061,7 +1075,7 @@
values[config.keys[i]] = ''
}
// 娓呯┖鍚庡嚑鍒楃殑鏁版嵁
- this.setValues([{rowKey: row.id, values}])
+ this.setValues([{ rowKey: row.id, values }])
}
},
@@ -1084,12 +1098,12 @@
})
},
//options鑷畾涔夎祴鍊� 鍒锋柊
- virtualRefresh(){
+ virtualRefresh() {
this.scrolling = true
this.closeScrolling()
},
// 璁剧疆 this.scrolling 闃叉姈妯″紡
- closeScrolling: simpleDebounce(function () {
+ closeScrolling: simpleDebounce(function() {
this.scrolling = false
}, 100),
@@ -1105,7 +1119,7 @@
for (let row of rows) {
let item = cloneObject(row)
if (insertRecords.includes(row)) {
- handler ? handler({item, row, insertRecords}) : null
+ handler ? handler({ item, row, insertRecords }) : null
if (remove) {
continue
@@ -1134,9 +1148,19 @@
_remove(rows) {
const xTable = this.$refs.vxe.$refs.xTable
- const {afterFullData, tableFullData, tableSourceData, editStore, treeConfig, checkboxOpts, selection, isInsertByRow, scrollYLoad} = xTable
- const {actived, removeList, insertList} = editStore
- const {checkField: property} = checkboxOpts
+ const {
+ afterFullData,
+ tableFullData,
+ tableSourceData,
+ editStore,
+ treeConfig,
+ checkboxOpts,
+ selection,
+ isInsertByRow,
+ scrollYLoad
+ } = xTable
+ const { actived, removeList, insertList } = editStore
+ const { checkField: property } = checkboxOpts
let rest = []
const nowData = afterFullData
if (treeConfig) {
@@ -1187,7 +1211,7 @@
}
return xTable.$nextTick().then(() => {
xTable.recalculate()
- return {row: rest.length ? rest[rest.length - 1] : null, rows: rest}
+ return { row: rest.length ? rest[rest.length - 1] : null, rows: rest }
})
},
@@ -1220,7 +1244,7 @@
},
async _addOrInsert(rows = {}, index, triggerName, isOnlJs) {
- let {xTable} = this.$refs.vxe.$refs
+ let { xTable } = this.$refs.vxe.$refs
let records
if (Array.isArray(rows)) {
records = rows
@@ -1229,7 +1253,7 @@
}
// 閬嶅巻娣诲姞榛樿鍊�
records.forEach(record => this._createRow(record))
- let result = await this.pushRows(records, {index: index, setActive: true})
+ let result = await this.pushRows(records, { index: index, setActive: true })
// 閬嶅巻鎻掑叆鐨勮
// update--begin--autor:lvdandan-----date:20201117------for:LOWCOD-987 銆愭柊琛岀紪杈戙�慾s澧炲己闄勮〃鍐呯疆鏂规硶璋冪敤闂 #1819
// online js澧炲己鏃朵互浼犺繃鏉ュ�间负鍑嗭紝涓嶅啀璧嬮粯璁ゅ��
@@ -1239,7 +1263,7 @@
this.trigger(triggerName, {
row: row,
$table: xTable,
- target: this,
+ target: this
})
}
}
@@ -1248,14 +1272,14 @@
},
// 鍒涘缓鏂拌锛岃嚜鍔ㄦ坊鍔犻粯璁ゅ��
_createRow(record = {}) {
- let {xTable} = this.$refs.vxe.$refs
+ let { xTable } = this.$refs.vxe.$refs
// 娣诲姞榛樿鍊�
xTable.tableFullColumn.forEach(column => {
let col = column.own
if (col.key && (record[col.key] == null || record[col.key] === '')) {
// 璁剧疆榛樿鍊�
let createValue = getEnhancedMixins(col.$type || col.type, 'createValue')
- record[col.key] = createValue({row: record, column, $table: xTable})
+ record[col.key] = createValue({ row: record, column, $table: xTable })
}
// update-begin--author:sunjianlei---date:20210819------for: 澶勭悊鑱斿姩鍒楋紝鑱斿姩鍒楀彧鑳戒綔鐢ㄤ簬 select 缁勪欢
if (col.$type === JVXETypes.select && this.innerLinkageConfig != null) {
@@ -1280,7 +1304,7 @@
props: this.vxeProps,
on: this.vxeEvents,
// 浣滅敤鍩熸彃妲界殑鏍煎紡涓�
- scopedSlots: this.$scopedSlots,
+ scopedSlots: this.$scopedSlots
})
},
// 娓叉煋宸ュ叿鏍�
@@ -1293,7 +1317,7 @@
size: this.size,
disabled: this.disabled,
disabledRows: this.disabledRows,
- selectedRowIds: this.selectedRowIds,
+ selectedRowIds: this.selectedRowIds
},
on: {
// 鏂板浜嬩欢
@@ -1301,7 +1325,7 @@
// 淇濆瓨浜嬩欢
save: () => this.trigger('save', {
$table: this.$refs.vxe,
- target: this,
+ target: this
}),
// 鍒犻櫎浜嬩欢
remove: () => {
@@ -1309,7 +1333,7 @@
let deleteRows = this.filterNewRows(this.selectedRows)
// 瑙﹀彂鍒犻櫎浜嬩欢
if (deleteRows.length > 0) {
- let removeEvent = {deleteRows, $table, target: this}
+ let removeEvent = { deleteRows, $table, target: this }
if (this.asyncRemove) {
// 纭鍒犻櫎锛屽彧鏈夎皟鐢ㄨ繖涓柟娉曟墠浼氱湡鍒犻櫎
removeEvent.confirmRemove = () => this.removeSelection()
@@ -1326,8 +1350,8 @@
},
scopedSlots: {
toolbarPrefix: this.$scopedSlots.toolbarPrefix,
- toolbarSuffix: this.$scopedSlots.toolbarSuffix,
- },
+ toolbarSuffix: this.$scopedSlots.toolbarSuffix
+ }
})
}
return null
@@ -1345,7 +1369,7 @@
return h('j-vxe-sub-popover', {
ref: 'subPopover',
scopedSlots: {
- subForm: this.$scopedSlots.subForm,
+ subForm: this.$scopedSlots.subForm
}
})
}
@@ -1374,17 +1398,17 @@
},
on: {
change: (e) => this.trigger('pageChange', e)
- },
+ }
})
}
return null
},
- loadExcludeCode(){
- if(!this.authPre || this.authPre.length==0){
+ loadExcludeCode() {
+ if (!this.authPre || this.authPre.length == 0) {
this.excludeCode = []
- }else{
+ } else {
let pre = this.authPre
- if(!pre.endsWith(':')){
+ if (!pre.endsWith(':')) {
pre += ':'
}
this.excludeCode = getNoAuthCols(pre)
@@ -1401,7 +1425,7 @@
this.renderToolbar(h),
this.renderToolbarAfterSlot(),
this.renderVxeGrid(h),
- this.renderPagination(h),
+ this.renderPagination(h)
])
},
beforeDestroy() {
@@ -1411,23 +1435,27 @@
// 鍏煎 online 鐨勮鍒�
const fooPatterns = [
- {title: '闈炵┖', value: '*', pattern: /^.+$/},
- {title: '6鍒�16浣嶆暟瀛�', value: 'n6-16', pattern: /^\d{6,16}$/},
- {title: '6鍒�16浣嶄换鎰忓瓧绗�', value: '*6-16', pattern: /^.{6,16}$/},
- {title: '6鍒�18浣嶅瓧姣�', value: 's6-18', pattern: /^[a-z|A-Z]{6,18}$/},
- {title: '缃戝潃', value: 'url', pattern: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/},
- {title: '鐢靛瓙閭欢', value: 'e', pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/},
- {title: '鎵嬫満鍙风爜', value: 'm', pattern: /^1[3456789]\d{9}$/},
- {title: '閭斂缂栫爜', value: 'p', pattern: /^[0-9]{6}$/},
- {title: '瀛楁瘝', value: 's', pattern: /^[A-Z|a-z]+$/},
- {title: '鏁板瓧', value: 'n', pattern: /^-?\d+(\.?\d+|\d?)$/},
- {title: '鏁存暟', value: 'z', pattern: /^-?\d+$/},
- {title: '閲戦', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,5}))$/},
+ { title: '闈炵┖', value: '*', pattern: /^.+$/ },
+ { title: '6鍒�16浣嶆暟瀛�', value: 'n6-16', pattern: /^\d{6,16}$/ },
+ { title: '6鍒�16浣嶄换鎰忓瓧绗�', value: '*6-16', pattern: /^.{6,16}$/ },
+ { title: '6鍒�18浣嶅瓧姣�', value: 's6-18', pattern: /^[a-z|A-Z]{6,18}$/ },
+ {
+ title: '缃戝潃',
+ value: 'url',
+ pattern: /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/
+ },
+ { title: '鐢靛瓙閭欢', value: 'e', pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/ },
+ { title: '鎵嬫満鍙风爜', value: 'm', pattern: /^1[3456789]\d{9}$/ },
+ { title: '閭斂缂栫爜', value: 'p', pattern: /^[0-9]{6}$/ },
+ { title: '瀛楁瘝', value: 's', pattern: /^[A-Z|a-z]+$/ },
+ { title: '鏁板瓧', value: 'n', pattern: /^-?\d+(\.?\d+|\d?)$/ },
+ { title: '鏁存暟', value: 'z', pattern: /^-?\d+$/ },
+ { title: '閲戦', value: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,5}))$/ }
]
/** 鏃х増handler杞负鏂扮増Validator */
function handlerConvertToValidator(event) {
- const {column, rule} = event
+ const { column, rule } = event
return new Promise((resolve, reject) => {
rule.handler(event, (flag, msg) => {
let message = rule.message
@@ -1447,7 +1475,7 @@
/** 鍞竴鏍¢獙鍣� */
function uniqueValidator(event) {
- const {cellValue, column, rule} = event
+ const { cellValue, column, rule } = event
let tableData = this.getTableData()
let findCount = 0
for (let rowData of tableData) {
--
Gitblit v1.9.3