index.html 1.9 KB
<style>
    .custom-row {
        min-height: 28px;
        overflow: initial;
    }
    .custom-row:not(:last-child) {
        margin-bottom: 6px;
    }
    .custom-row [role="button"] {
        display: none;
    }
    .el-input-number--small {
        width: 100%;
    }
    .el-input-number.is-controls-right .el-input__inner {
        padding-right: 15px;
    }
</style>
<div id="app" hidden>
    <div>总分: {{totalScore}}</div>
    <template>
        <el-table :data="tableData" border stripe style="width: 100%">
            <el-table-column prop="item_name" label="评分项目" width="180">
            </el-table-column>
            <el-table-column prop="points" label="评分要点" width="400">
                <template slot-scope="{row}">
                    <div class="custom-row" v-for="(item, index) in row.item_details" :key="index">{{item['name']}}</div>
                </template>
            </el-table-column>
            <el-table-column prop="score_area" label="打分区间">
                <template slot-scope="{row}">
                    <div class="custom-row" v-for="(item, index) in row.item_details" :key="index">0-{{item['score']}}分</div>
                </template>
            </el-table-column>
            <el-table-column prop="address" label="评分分值">
                <template slot-scope="{row, $index}">
                    <div v-for="(v, i) in row.item_details" class="custom-row">
                        <el-input-number v-model="scores[row.id+'_'+$index+'_'+i]" controls-position="right" :min="0" :max="v.score" size="small" placeholder="请打分"></el-input-number>
                    </div>
                </template>
            </el-table-column>
        </el-table>
    </template>

    <el-row type="flex" justify="center" style="margin: 40px 0 30px">
        <el-button type="primary" @click="onSave">保存</el-button>
    </el-row>
</div>