Authored by 陈峰

modal-size-edit => render

... ... @@ -10,7 +10,8 @@
"html"
],
"rules": {
"camelcase": "off"
"camelcase": "off",
"max-len": "off"
}
}
... ...
... ... @@ -72,23 +72,40 @@ export default {
columns.push({
width: 70,
render(row, col, index) {
if (index === 0) {
return '尺码';
render: (h, params) => {
if (params.index === 0) {
return (
<span>尺码</span>
);
} else {
return row.sizeName;
return (
<span>{params.row.sizeName}</span>
);
}
},
fixed: 'left'
});
columns.push({
width: 220,
render(row, col, index) {
if (index === 0) {
return `参考尺码(${sizeInfo.genderName})`;
render: (h, params) => {
if (params.index === 0) {
return (
<span>参考尺码({sizeInfo.genderName})</span>
);
} else {
return `<i-input class="size-inpt" v-model="row.referenceNameA"></i-input>/
<i-input class="size-inpt" width="50" v-model="row.referenceNameB"></i-input>`;
return (
<div>
<i-input
class="size-inpt"
value={params.row.referenceNameA}
onInput={val => (params.row.referenceNameA = val)} />
/
<i-input
class="size-inpt"
value={params.row.referenceNameB}
onInput={val => (params.row.referenceNameB = val)} />
</div>
);
}
},
fixed: 'left'
... ... @@ -98,14 +115,26 @@ export default {
width: 120,
noMeasure: _.some(noMeasureIds, id => +id === attr.sizeAttributeId),
sizeAttributeId: attr.sizeAttributeId,
render(row, col, index) {
if (index === 0) {
return `<span>${attr.sizeAttributeName}</span>
<Checkbox v-model="column.noMeasure">无需测量</Checkbox>`;
render: (h, params) => {
if (params.index === 0) {
return h('div', {}, [
h('span', {}, attr.sizeAttributeName),
h('Checkbox', {
props: {
value: params.column.noMeasure
},
on: {
input: val => (params.column.noMeasure = val)
}
}, '无需测量')]);
} else {
return `<i-input class="size-inpt"
v-model="row.prdSizeAttributeBoList[${colIndex}].sizeValue"
:disabled="column.noMeasure"></i-input>`;
return (
<i-input
class="size-inpt"
value={params.row.prdSizeAttributeBoList[colIndex].sizeValue}
onInput={val => (params.row.prdSizeAttributeBoList[colIndex].sizeValue = val)}
disabled={params.column.noMeasure}></i-input>
);
}
}
});
... ...