| | |
| | | // prefix 前缀;suffix 后缀; |
| | | slots: ['prefix', 'suffix'], |
| | | // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮;collapse 展开收起 |
| | | btns: ['add', 'remove', 'clearSelection'], |
| | | btns: ['add', 'remove', 'clearSelection'] |
| | | })), |
| | | // 是否显示行号 |
| | | rowNumber: PropTypes.bool.def(false), |
| | |
| | | // 最大高度 |
| | | maxHeight: { |
| | | type: Number, |
| | | default: () => null, |
| | | default: () => null |
| | | }, |
| | | // 要禁用的行 TODO 未实现 |
| | | disabledRows: PropTypes.object.def(() => ({})), |
| | |
| | | // 注:该参数不能动态修改;如果行、列字段多的情况下,会根据机器性能造成不同程度的卡顿。 |
| | | alwaysEdit: PropTypes.bool.def(false), |
| | | // 联动配置,数组,详情配置见文档 |
| | | linkageConfig: PropTypes.array.def(() => []), |
| | | linkageConfig: PropTypes.array.def(() => []) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | // gt: 15 |
| | | // }, |
| | | 'radio-config': {highlight: true}, |
| | | 'checkbox-config': {highlight: true}, |
| | | 'checkbox-config': { highlight: true } |
| | | }, |
| | | // 绑定左侧选择框 |
| | | selectedRows: [], |
| | |
| | | statistics: { |
| | | has: false, |
| | | sum: [], |
| | | average: [], |
| | | average: [] |
| | | }, |
| | | // 允许执行刷新特效的行ID |
| | | reloadEffectRowKeysMap: {}, |
| | |
| | | excludeCode:[], |
| | | // 联动下拉选项(用于隔离不同的下拉选项) |
| | | // 内部联动配置,map |
| | | innerLinkageConfig: null, |
| | | innerLinkageConfig: null |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | scrolling: this.scrolling, |
| | | reloadEffect: this.reloadEffect, |
| | | reloadEffectRowKeysMap: this.reloadEffectRowKeysMap, |
| | | listeners: this.cellListeners, |
| | | listeners: this.cellListeners |
| | | } |
| | | if (column.$type === JVXETypes.rowDragSort) { |
| | | renderOptions.dragSortKey = this.dragSortKey |
| | |
| | | config: this.innerLinkageConfig.get(column.key), |
| | | getLinkageOptionsSibling: this.getLinkageOptionsSibling, |
| | | getLinkageOptionsAsync: this.getLinkageOptionsAsync, |
| | | linkageSelectChange: this.linkageSelectChange, |
| | | linkageSelectChange: this.linkageSelectChange |
| | | } |
| | | } |
| | | } |
| | |
| | | // 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 【online】 日期、时间控件长度较小 |
| | | 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; |
| | | 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; |
| | | 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' |
| | | } |
| | |
| | | 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, |
| | |
| | | maxHeight: this.maxHeight, |
| | | border: this.bordered, |
| | | expandConfig: expandConfig, |
| | | footerMethod: this.handleFooterMethod, |
| | | footerMethod: this.handleFooterMethod |
| | | // footerSpanMethod: this.handleFooterSpanMethod, |
| | | }) |
| | | }, |
| | |
| | | '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 => { |
| | |
| | | /** 当前行向下移一位 */ |
| | | rowMoveDown: rowIndex => this.rowResort(rowIndex, rowIndex + 1), |
| | | /** 在当前行下面插入一行 */ |
| | | rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1), |
| | | rowInsertDown: rowIndex => this.insertRows({}, rowIndex + 1) |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | watch: { |
| | | dataSource: { |
| | |
| | | // } |
| | | // } |
| | | // }) |
| | | }, |
| | | } |
| | | }, |
| | | columns: { |
| | | immediate: true, |
| | |
| | | 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'}) |
| | | } |
| | |
| | | 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}) |
| | | } |
| | |
| | | this.innerLinkageConfig = null |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | |
| | | oldValue: oldValue, |
| | | col: column.own, |
| | | column: column, |
| | | isSetValues: true, |
| | | isSetValues: true |
| | | }) |
| | | } |
| | | } else { |
| | |
| | | // 【issues/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() |
| | | }) |
| | | } |
| | | }, |
| | | |
| | |
| | | * @param isOnlJs 是否是onlineJS增强触发的 |
| | | * @return |
| | | */ |
| | | /* async addRows(rows = {}, isOnlJs) { |
| | | async addRows(rows = {}, isOnlJs) { |
| | | return this._addOrInsert(rows, -1, 'added', isOnlJs) |
| | | }, */ |
| | | }, |
| | | |
| | | /** |
| | | * 添加一行或多行 |
| | |
| | | _remove(rows) { |
| | | const xTable = this.$refs.vxe.$refs.xTable |
| | | |
| | | const {afterFullData, tableFullData, tableSourceData, editStore, treeConfig, checkboxOpts, selection, isInsertByRow, scrollYLoad} = xTable |
| | | const { |
| | | afterFullData, |
| | | tableFullData, |
| | | tableSourceData, |
| | | editStore, |
| | | treeConfig, |
| | | checkboxOpts, |
| | | selection, |
| | | isInsertByRow, |
| | | scrollYLoad |
| | | } = xTable |
| | | const {actived, removeList, insertList} = editStore |
| | | const {checkField: property} = checkboxOpts |
| | | let rest = [] |
| | |
| | | this.trigger(triggerName, { |
| | | row: row, |
| | | $table: xTable, |
| | | target: this, |
| | | target: this |
| | | }) |
| | | } |
| | | } |
| | |
| | | props: this.vxeProps, |
| | | on: this.vxeEvents, |
| | | // 作用域插槽的格式为 |
| | | scopedSlots: this.$scopedSlots, |
| | | scopedSlots: this.$scopedSlots |
| | | }) |
| | | }, |
| | | // 渲染工具栏 |
| | |
| | | size: this.size, |
| | | disabled: this.disabled, |
| | | disabledRows: this.disabledRows, |
| | | selectedRowIds: this.selectedRowIds, |
| | | selectedRowIds: this.selectedRowIds |
| | | }, |
| | | on: { |
| | | // 新增事件 |
| | |
| | | // 保存事件 |
| | | save: () => this.trigger('save', { |
| | | $table: this.$refs.vxe, |
| | | target: this, |
| | | target: this |
| | | }), |
| | | // 删除事件 |
| | | remove: () => { |
| | |
| | | }, |
| | | scopedSlots: { |
| | | toolbarPrefix: this.$scopedSlots.toolbarPrefix, |
| | | toolbarSuffix: this.$scopedSlots.toolbarSuffix, |
| | | }, |
| | | toolbarSuffix: this.$scopedSlots.toolbarSuffix |
| | | } |
| | | }) |
| | | } |
| | | return null |
| | |
| | | return h('j-vxe-sub-popover', { |
| | | ref: 'subPopover', |
| | | scopedSlots: { |
| | | subForm: this.$scopedSlots.subForm, |
| | | subForm: this.$scopedSlots.subForm |
| | | } |
| | | }) |
| | | } |
| | |
| | | }, |
| | | on: { |
| | | change: (e) => this.trigger('pageChange', e) |
| | | }, |
| | | } |
| | | }) |
| | | } |
| | | return null |
| | |
| | | this.renderToolbar(h), |
| | | this.renderToolbarAfterSlot(), |
| | | this.renderVxeGrid(h), |
| | | this.renderPagination(h), |
| | | this.renderPagination(h) |
| | | ]) |
| | | }, |
| | | beforeDestroy() { |
| | |
| | | {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: '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: 'money', pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,5}))$/ } |
| | | ] |
| | | |
| | | /** 旧版handler转为新版Validator */ |