123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <template>
- <div class="comment-ability">
- <el-table ref="TableList" :data="dataList">
- <el-table-column
- prop="levelCode"
- label="等级"
- width="60"
- ></el-table-column>
- <el-table-column label="划分规划" width="300">
- <div
- slot-scope="scope"
- :class="[
- 'rate-input',
- { 'rate-input-offset-left': scope.$index === 0 }
- ]"
- >
- <el-input-number
- v-if="scope.$index !== 0"
- v-model="scope.row.startRate"
- placeholder="请输入"
- :min="0"
- :max="100"
- :step="1"
- step-strictly
- size="small"
- :controls="false"
- @change="rateChange"
- ></el-input-number>
- <span v-if="scope.$index !== 0">≤</span>
- <span>百分位等级TOP</span>
- <span>≤</span>
- <el-input-number
- v-model="scope.row.endRate"
- placeholder="请输入"
- :min="0"
- :max="100"
- :step="1"
- step-strictly
- size="small"
- :controls="false"
- @change="rateChange"
- ></el-input-number>
- </div>
- </el-table-column>
- <el-table-column
- prop="levelName"
- label="水平层次"
- width="140"
- ></el-table-column>
- <el-table-column prop="result" label="诊断结果"></el-table-column>
- <el-table-column prop="advice" label="学习建议"></el-table-column>
- <el-table-column
- class-name="action-column"
- label="操作"
- width="80px"
- align="center"
- >
- <template slot-scope="scope">
- <el-button class="btn-primary" type="text" @click="toEdit(scope.row)"
- >编辑</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <!-- ModifyAbilityComment -->
- <modify-ability-comment
- ref="ModifyAbilityComment"
- :instance="curRow"
- :modified="modified"
- ></modify-ability-comment>
- </div>
- </template>
- <script>
- import ModifyAbilityComment from "./ModifyAbilityComment.vue";
- export default {
- name: "comment-ability",
- components: { ModifyAbilityComment },
- props: {
- rates: {
- type: Array,
- default() {
- return [];
- }
- }
- },
- data() {
- return {
- dataList: [],
- curRow: {},
- errorMsg: ""
- };
- },
- mounted() {
- this.dataList = this.rates.map(item => {
- return { ...item };
- });
- },
- methods: {
- toEdit(row) {
- this.curRow = row;
- this.$refs.ModifyAbilityComment.open();
- },
- modified(data) {
- const ind = this.dataList.findIndex(item => item.level === data.level);
- this.dataList[ind] = this.$objAssign(this.dataList[ind], data);
- },
- rateChange() {
- this.$emit("data-change", this.dataList);
- }
- }
- };
- </script>
|