| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <template>
- <Base-dialog
- title="操作提示:"
- :disabledBtn="disabledBtn"
- :isShow.sync="isShow"
- @submit="submitForm"
- @close="close"
- >
- <el-form
- :model="formData"
- ref="formData"
- label-width="80px"
- label-position="right"
- >
- <el-form-item
- label="作弊原因"
- prop="cheating_reason"
- :rules="[
- {
- required: true,
- message: '请填写作弊原因',
- trigger: ['blur', 'change'],
- },
- ]"
- >
- <el-input
- v-model="formData.cheating_reason"
- type="textarea"
- :rows="4"
- placeholder="请输入作弊原因"
- ></el-input>
- </el-form-item>
- <ul style="padding-left: 80px">
- <li
- class="li_sty"
- @click="uploadText(item.label)"
- v-for="(item, index) in msgTitle"
- :key="index"
- >
- {{ item.label }}
- </li>
- </ul>
- </el-form>
- </Base-dialog>
- </template>
- <script>
- export default {
- props: {
- vidBoxHours: {
- type: Boolean,
- default: false,
- },
- disabledBtn: {
- type: Boolean,
- default: false,
- },
- },
- data() {
- return {
- msgTitle: [
- { label: "学习拍照异常", value: 1 },
- {
- label: "学习拍照太黑无法识别人像,请确保拍照光线充足并拍到全脸",
- value: 2,
- },
- {
- label: "学习拍照太模糊无法识别人像,请确保拍照光线充足并拍到全脸",
- value: 3,
- },
- {
- label: "学习拍照人像不全无法识别,请确保拍照光线充足并拍到全脸",
- value: 4,
- },
- ],
- formData: {
- cheating_reason: "",
- },
- };
- },
- methods: {
- submitForm() {
- this.$refs.formData.validate((valid) => {
- if (valid) {
- this.$emit("submit", this.formData.cheating_reason);
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- uploadText(msg) {
- this.formData.cheating_reason = msg;
- },
- close() {
- this.$emit("close");
- },
- },
- computed: {
- isShow: {
- get() {
- return this.vidBoxHours;
- },
- set(val) {
- this.$emit("update:vidBoxHours", false);
- },
- },
- },
- watch: {
- vidBoxHours(val) {
- if (val === false) {
- this.uploadText("");
- } else {
- this.$nextTick(() => {
- this.$refs.formData.clearValidate();
- });
- }
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .li_sty {
- cursor: pointer;
- transition: all 0.3s;
- background-color: #eee;
- padding: 0px 10px;
- margin-bottom: 6px;
- font-size: 12px;
- line-height: 26px;
- display: table;
- &:hover {
- box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.2);
- }
- }
- </style>
|