Commit 7df316df authored by 何虹's avatar 何虹 💬

升级表格组件

parent 118ef195
......@@ -49,8 +49,8 @@
:row-style='setRowStyle'
>
<template v-for='(column,index) in tableColumns'>
<template v-if="!column.childs">
<template v-for='(columnItem,index) in tableColumns'>
<template v-if="!columnItem.childs">
<u-table-column
v-if='tableConfig.expandChild'
:key="index"
......@@ -61,20 +61,20 @@
</template>
</u-table-column>
<u-table-column
v-else-if="column.showType==='index'"
v-else-if="columnItem.showType==='index'"
:key="index"
type="index"
width="55"
/>
<u-table-column
v-else-if="column.showType==='selection'"
v-else-if="columnItem.showType==='selection'"
:key="index"
type="selection"
width="55"
:selectable="selectable"
/>
<u-table-column
v-else-if='column.showType==="handleColumn"'
v-else-if='columnItem.showType==="handleColumn"'
:key="index"
fixed="right"
label="操作"
......@@ -93,43 +93,49 @@
<u-table-column
v-else
:key="index"
:resizable="column.resizable"
:show-overflow-tooltip="column.showOverflow"
:prop="column.prop"
:label="column.label"
:fixed="column.fixed"
:min-width="column.width||80"
:sortable="column.isSort?'custom':false"
:resizable="columnItem.resizable"
:show-overflow-tooltip="columnItem.showOverflow"
:prop="columnItem.prop"
:label="columnItem.label"
:fixed="columnItem.fixed"
:min-width="columnItem.width||80"
:sortable="columnItem.isSort?'custom':false"
>
<template v-slot:header>
<span v-if="columnItem.isRequired" :class="{'is-isRequired': columnItem.isRequired}">
*
</span>
<span>{{ columnItem.label }}</span>
</template>
<template slot-scope="scope">
<i
v-if="column.type==='checkBox'"
:class="rowCellBoolean(scope.row[column.prop])"
v-if="columnItem.type==='checkBox'"
:class="rowCellBoolean(scope.row[columnItem.prop])"
></i>
<childItem
v-else
:editable='editable'
v-bind="$attrs"
v-on="$listeners"
:item='column'
:prop="column.prop"
:item='columnItem'
:prop="columnItem.prop"
:formParms='scope.row'
>
</childItem>
</template>
</u-table-column>
</template>
<template v-else-if='column.childs'>
<template v-else-if='columnItem.childs'>
<u-table-column
:label="column.label"
:label="columnItem.label"
:key="index"
>
<template v-for="item in column.childs">
<template v-for="item in columnItem.childs">
<u-table-column
:prop="item.prop"
:label="item.label"
:key="item.label"
:min-width="column.width||80"
:min-width="item.width||80"
>
<template slot-scope="scope">
<childItem
......@@ -230,6 +236,12 @@
:min-width="column.width||80"
:sortable="column.isSort"
>
<template v-slot:header>
<span v-if="column.isRequired" :class="{'is-isRequired': column.isRequired}">
*
</span>
<span>{{ column.label }}</span>
</template>
<template slot-scope="scope">
<i
v-if="column.type==='checkBox'"
......@@ -432,6 +444,10 @@ export default {
},
mounted() {},
methods: {
getRequired(item) {
console.log(item)
return true
},
tableDoLayout() {
this.$refs.plTable.doLayout()
},
......@@ -1067,5 +1083,8 @@ export default {
td {
height: 35px !important;
}
.is-isRequired{
color: red;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment