|
@ -3,40 +3,40 @@ import { reactive, ref } from "vue"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
template: html`<div class="app-table el-table" ref="tableRef">
|
|
|
template: html`<div class="app-table el-table" ref="tableRef">
|
|
|
<div class="row"> |
|
|
<div class="row header"> |
|
|
<template v-for="(item,key) in columns.properties"> |
|
|
<template v-for="(item,key) in columns.properties"> |
|
|
<div class="cell el-table__cell" v-if="item.input==='selection'"> |
|
|
<div class="cell el-table__cell selection" v-if="item.input==='selection'"> |
|
|
<div class="cell" style="text-align:center;"> |
|
|
<div class="cell" style="text-align:center;"> |
|
|
<input class="el-checkbox__input" type="checkbox" v-model="checkAll" :indeterminate="checkAllIndeterminate" @click="checkAllClick($event)" /> |
|
|
<input class="el-checkbox__input" type="checkbox" v-model="checkAll" :indeterminate="checkAllIndeterminate" @click="checkAllClick($event)" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<template v-else-if="item.type==='object'"> |
|
|
<template v-else-if="item.type==='object'"> |
|
|
<template v-for="(item2,key2) in item.properties"> |
|
|
<template v-for="(item2,key2) in item.properties"> |
|
|
<div class="cell el-table__cell" v-if="!item2.hidden"> |
|
|
<div class="cell el-table__cell" :class="key+'.'+key2" v-if="!item2.hidden"> |
|
|
<div class="cell">{{item2.title}}</div> |
|
|
<div class="cell">{{item2.title}}</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
<div class="cell el-table__cell" v-else-if="!item.hidden"> |
|
|
<div class="cell el-table__cell" :class="key" v-else-if="!item.hidden"> |
|
|
<div class="cell">{{item.title}}</div> |
|
|
<div class="cell">{{item.title}}</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</div> |
|
|
</div> |
|
|
<div v-for="(row,index) in data" class="row"> |
|
|
<div v-for="(row,index) in data" class="row"> |
|
|
<template v-for="(item,key) in columns.properties"> |
|
|
<template v-for="(item,key) in columns.properties"> |
|
|
<div class="cell el-table__cell" v-if="item.input==='selection'"> |
|
|
<div class="cell el-table__cell selection" v-if="item.input==='selection'"> |
|
|
<div class="cell" style="text-align:center;" v-if="item.input==='selection'"> |
|
|
<div class="cell" style="text-align:center;" v-if="item.input==='selection'"> |
|
|
<input class="el-checkbox__input row" type="checkbox" :value="index" @click="checkClick" /> |
|
|
<input class="el-checkbox__input row" type="checkbox" :value="index" @click="checkClick" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<template v-else-if="item.type==='object'"> |
|
|
<template v-else-if="item.type==='object'"> |
|
|
<template v-for="(item2,key2) in item.properties"> |
|
|
<template v-for="(item2,key2) in item.properties"> |
|
|
<div class="cell el-table__cell" v-if="!item2.hidden"> |
|
|
<div class="cell el-table__cell" :class="key+'.'+key2" v-if="!item2.hidden"> |
|
|
<div class="cell" v-if="row[key]&&!item.hidden">{{row[key][key2]}}</div> |
|
|
<div class="cell" v-if="row[key]&&!item.hidden">{{row[key][key2]}}</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
</template> |
|
|
<div class="cell el-table__cell" v-else-if="!item.hidden"> |
|
|
<div class="cell el-table__cell" :class="key" v-else-if="!item.hidden"> |
|
|
<div class="cell">{{row[key]}}</div> |
|
|
<div class="cell">{{row[key]}}</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|