案例编辑、查看

zqqdev
CherrysChang 5 years ago
parent 788dfa3125
commit 969e592cb0
  1. 2
      src/api/server.js
  2. 23
      src/views/train/case-detail.vue
  3. 2
      src/views/train/case-list.vue

@ -57,7 +57,7 @@ export const Train = new (class {
//修改
updateCase(params) {
return axios
.post(this.updateCaseApi, qs.stringify(params))
.post(this.updateCaseApi, qs.stringify(params,{allowDots: true }))
.then(res => res.data);
}
//删除

@ -25,7 +25,7 @@
<el-col :span="1" style="text-align:center;padding-top: 182px;width: 88px;" class="item-required">量化指标</el-col>
<el-col :span="7">
<el-table ref="leftTable" :data="getFilterDataBySearchName" :row-key="getRowKey" height="400" border highlight-current-row tooltip-effect="dark" @selection-change="leftSelectionChange">
<el-table-column type="selection" :reserve-selection="true" width="55"></el-table-column>
<el-table-column type="selection" :reserve-selection="true" width="55" :selectable="checkboxIsEnabled"></el-table-column>
<el-table-column header-align="right" :label="leftSumLabel">
<el-table-column prop="name" label="名称" show-overflow-tooltip>
<template slot="header" slot-scope="scope">
@ -41,7 +41,7 @@
</el-col>
<el-col :span="14" class="rightTable">
<el-table ref="rightTable" :data="dataForm.taskList" height="400" border highlight-current-row tooltip-effect="dark" :summary-method="getScoreSummaries" show-summary @selection-change="rightSelectionChange">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column type="selection" width="55" :selectable="checkboxIsEnabled"></el-table-column>
<el-table-column header-align="right" :label="rightSumLabel">
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="target" label="任务目标" width="226">
@ -49,7 +49,7 @@
<el-row>
<el-col :span="12">
<el-form-item :prop="'taskList.'+scope.$index+'.taskOperate'" :rules="dataRule.taskOperate" class="score-input" >
<el-select v-model="scope.row.taskOperate" size="small" style="width: 100px;">
<el-select v-model="scope.row.taskOperate" size="small" :disabled="formAction == 2" style="width: 100px;">
<el-option label="大于" value="1"></el-option>
<el-option label="小于" value="2"></el-option>
</el-select>
@ -72,7 +72,7 @@
</el-form-item>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="50">
<el-table-column fixed="right" label="操作" width="50" v-if="formAction !=2">
<template slot-scope="scope">
<el-button @click.native.prevent="removeToLeftByRow(scope.$index,scope.row)" type="text" size="small">移除</el-button>
</template>
@ -83,7 +83,7 @@
</el-row>
</div>
</el-card>
<div class="form-btn" style="text-align: center;">
<div class="form-btn" style="text-align: center;" v-if="formAction !=2">
<el-form-item>
<el-button type="primary" @click="submitForm()">确定</el-button>
<el-button @click="goBackList">取消</el-button>
@ -253,6 +253,13 @@
getRowKey (row) {// key
return row.id //idrowdatatableData
},
checkboxIsEnabled() { //
if (this.formAction === 2) {
return false;
} else {
return true;
}
},
leftSelectionChange(selection) {
this.leftSelectedRows = selection;
},
@ -412,6 +419,12 @@
.el-form-item.is-required .el-form-item__label:after {
content: '';
}
.el-form-item.is-success .el-input__inner{
border-color: #DCDFE6 !important;
}
.el-form-item.is-success .el-input__inner:focus{
border-color: #409EFF !important;
}
.target-set{
/*.el-table__header .el-table-column--selection .cell .el-checkbox:after {*/
/* content: "全选";*/

@ -46,7 +46,7 @@
</template>
</el-table-column>
<el-table-column prop="updateTime" label="编辑时间" width="240"></el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" min-width="140">
<template slot-scope="scope">
<el-button @click="toInputForm(scope.row,0)" type="text" size="small">查看</el-button>
<el-button @click="toInputForm(scope.row,1)" type="text" size="small" v-if="isShowEditOrDelBtn(scope.row)">编辑</el-button>

Loading…
Cancel
Save