1.table代码
需注意的是显示的时间信息什么的都是后端的接口 动态拿的
<el-table :data="tableData" ref="table" row-key="id" border lazy :tree-props="{ children: 'children' }" default-expand-all > <el-table-column label="人员名称" header-align="center" :cell-style="tablrow" > <template #default="scope"> <span> <span v-if="scope.row.children">单位:</span>{ { scope.row.name }} </span> <div class="btn" v-if="!scope.row.name"> <i @click="batchclick(scope)" title="批量排班" class="el-icon-s-custom" style="font-size: 14px; font-weight: bold; margin-right: 5px" ></i> </div> </template> </el-table-column> <el-table-column header-align="center" v-for="(item, index) in column" :key="index" > <template #header> <div :class="['table-header', item.prop == today ? 'current' : '']"> <div>{ { item.label }}</div> <div>{ { item.prop }}</div> </div> </template> <template #default="scope"> <div style="text-align: center; min-height: 35px"> <div v-for="(itemOne, index) in scope.row.list" :key="index"> <span v-if="item.prop === itemOne.date">{ { itemOne.name.replace(/\$[^,]+/g, '').replace(/\$/, '').replace(/\s*/g,"") }}</span> </div> </div> <div class="btn" v-if="!scope.row.children"> <i title="添加" @click="tableadd(scope, item.prop)" v-if="!scope.row[item.prop]" class="el-icon-plus blue" style="font-size: 14px; font-weight: bold; margin-right: 5px" ></i> <i title="修改"