YF-yuan 3 years ago
parent
commit
f48ee433fb
1 changed files with 11 additions and 4 deletions
  1. +11
    -4
      src/utils/mixin.js

+ 11
- 4
src/utils/mixin.js View File



let getNumber = (item, index, arr, props) => { let getNumber = (item, index, arr, props) => {
let number = 1 let number = 1

while (arr[++index]) { while (arr[++index]) {
for (let prop of props) { for (let prop of props) {
if (arr[index][prop].trim() != item[prop].trim()) { if (arr[index][prop].trim() != item[prop].trim()) {
* @param {*} params * @param {*} params
* [{name: 'quota, col: [1,2]}] * [{name: 'quota, col: [1,2]}]
*/ */
export function mergeSpan(params) {
export function mergeSpan(params) {
return { return {
methods: { methods: {
reduceData(data) { reduceData(data) {
} }
item[param.name + 'Row'] = getNumber(item, index, arr, spans) item[param.name + 'Row'] = getNumber(item, index, arr, spans)
} }
if (params[ind + 1]) {
prev[ind+1] = item[params[ind+1].name].trim();
let spans = [];
for (let i = 0; i <= ind+1; i++) {
spans.push(params[i].name)
}
item[params[ind+1].name + 'Row'] = getNumber(item, index, arr, spans)
}
} }
}) })
return item; return item;

Loading…
Cancel
Save