|
|
@ -44,19 +44,15 @@ |
|
|
|
<el-table-column prop="updateTime" label="时间" align="center"></el-table-column> |
|
|
|
<el-table-column prop="updateTime" label="时间" align="center"></el-table-column> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template v-if="scope.row.isEnable"> |
|
|
|
|
|
|
|
<el-button v-if="auth('查看')" type="text" @click="showQues(scope.row)">查看</el-button> |
|
|
|
<el-button v-if="auth('查看')" type="text" @click="showQues(scope.row)">查看</el-button> |
|
|
|
</template> |
|
|
|
<el-button v-if="auth('编辑')" type="text" @click="editQues(scope.row)">编辑</el-button> |
|
|
|
<template v-else> |
|
|
|
|
|
|
|
<el-button v-if="auth('修改')" type="text" @click="editQues(scope.row)">修改</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<el-switch |
|
|
|
<el-switch |
|
|
|
v-if="auth('禁用')" |
|
|
|
v-if="auth('禁用')" |
|
|
|
v-model="scope.row.isEnable" |
|
|
|
v-model="scope.row.isEnable" |
|
|
|
:active-text="scope.row.isEnable ? '关闭' : '启用'" |
|
|
|
:active-text="!scope.row.isEnable ? '禁用' : '启用'" |
|
|
|
:active-value="1" |
|
|
|
:active-value="1" |
|
|
|
:inactive-value="0" |
|
|
|
:inactive-value="0" |
|
|
|
style="margin: 0 10px 0 5px" |
|
|
|
style="margin: 0 10px;" |
|
|
|
@change="switchQues($event,scope.row,scope.$index)" |
|
|
|
@change="switchQues($event,scope.row,scope.$index)" |
|
|
|
></el-switch> |
|
|
|
></el-switch> |
|
|
|
<el-button v-if="auth('删除')" type="text" @click="delData(scope.row)">删除</el-button> |
|
|
|
<el-button v-if="auth('删除')" type="text" @click="delData(scope.row)">删除</el-button> |
|
|
@ -395,15 +391,10 @@ export default { |
|
|
|
this.resetForm(); |
|
|
|
this.resetForm(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
switchQues(val, row, index) { |
|
|
|
switchQues(val, row, index) { |
|
|
|
this.$post(`${this.api.questionsIsDisable}?id=${row.id}`) |
|
|
|
this.$post(`${this.api.questionsIsDisable}?id=${row.id}`).then(res => { |
|
|
|
.then(res => { |
|
|
|
util.successMsg("更新状态成功"); |
|
|
|
if (res.status == 400) { |
|
|
|
this.getData(); |
|
|
|
util.errorMsg(res.message); |
|
|
|
}).catch(err => {}); |
|
|
|
row.isEnable = row.isEnable == 1 ? 0 : 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
delData(row) { |
|
|
|
delData(row) { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
@ -664,5 +655,8 @@ export default { |
|
|
|
.check-wrap.checked { |
|
|
|
.check-wrap.checked { |
|
|
|
color: #9076FF; |
|
|
|
color: #9076FF; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-switch__label *{ |
|
|
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|
|
|
|
|
|
|
|
|