<template>
    <div class="app-container">
        <el-dialog title="查询" :visible.sync="query" width="50%" append-to-body>
            <el-form ref="queryParams" :model="queryParams" label-width="96px" class="search">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="学科" prop="sub">
                            <el-select v-model="queryParams.sub" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.teaching_subjects" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖级别" prop="awardRank">
                            <el-select v-model="queryParams.awardRank" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.awards_level" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="获奖类别" prop="awardType">
                            <el-select v-model="queryParams.awardType" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.award_categoriesjs" :key="dict.value"
                                    :label="dict.label" :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖等级" prop="awardLevel">
                            <el-select v-model="queryParams.awardLevel" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.award_rank" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="获奖人" prop="userName">
                            <el-input v-model="queryParams.userName" placeholder="请输入获奖人" clearable
                                @keyup.enter.native="handleQuery" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖开始时间" prop="awardTime">
                            <el-date-picker clearable v-model="queryParams.startTime" type="date" value-format="yyyy-MM-dd"
                                placeholder="请选择" style="width: 100%;">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="获奖结束时间" prop="awardTime">
                            <el-date-picker clearable v-model="queryParams.endTime" type="date" value-format="yyyy-MM-dd"
                                placeholder="请选择" style="width: 100%;">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-form-item class="dialog-footer" style="display: flex; justify-content: center; align-items: center">
                    <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                    <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                </el-form-item>
            </el-form>
        </el-dialog>
        <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
                <el-button type="primary" plain icon="el-icon-search" size="mini" @click="handleQuerycx">查询</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
                    v-hasPermi="['school:teacherAwards:add']">新增</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
                    v-hasPermi="['school:teacherAwards:edit']">修改</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
                    v-hasPermi="['school:teacherAwards:remove']">删除</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
                    v-hasPermi="['school:teacherAwards:export']">导出</el-button>
            </el-col>
            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>

        <el-table :row-style="{ height: '1px' }" :cell-style="{ padding: '0px' }"
            :header-cell-style="{ height: '50px', fontSize: '12px', padding: '0 0' }" :data="awardsList"
            @selection-change="handleSelectionChange" :default-sort="{ prop: 'awardTime', order: 'descending' }">
            <el-table-column type="selection" width="30" align="center" />
            <el-table-column type="index" label="序号" width="30" align="center" sortable fixed="left" />
            <el-table-column label="成长类型" align="center" fixed="left" width="80px" show-overflow-tooltip>
                <template>
                    <span>教学获奖</span>
                </template>
            </el-table-column>
            <el-table-column label="学科" align="center" prop="sub" sortable fixed="left" show-overflow-tooltip width="60px">
                <template slot-scope="scope">
                    <dict-tag :options="dict.type.teaching_subjects" :value="scope.row.sub" />
                </template>
            </el-table-column>
            <el-table-column label="获奖类别" align="center" prop="awardType" sortable width="100px" show-overflow-tooltip>
                <template slot-scope="scope">
                    <dict-tag :options="dict.type.award_categoriesjs" :value="scope.row.awardType" />
                </template>
            </el-table-column>
            <el-table-column label="获奖等级" align="center" prop="awardLevel" sortable width="80px" show-overflow-tooltip>
                <template slot-scope="scope">
                    <dict-tag :options="dict.type.award_rank" :value="scope.row.awardLevel" />
                </template>
            </el-table-column>
            <el-table-column label="获奖级别" align="center" prop="awardRank" sortable width="80px" show-overflow-tooltip>
                <template slot-scope="scope">
                    <dict-tag :options="dict.type.awards_level" :value="scope.row.awardRank" />
                </template>
            </el-table-column>
            <el-table-column label="教学获奖-成果名称" align="center" prop="resultName" sortable width="140px"
                show-overflow-tooltip />
            <el-table-column label="获奖人" align="center" prop="userName" sortable width="80px" show-overflow-tooltip />
            <el-table-column label="主办单位" align="center" prop="org" sortable width="100px" show-overflow-tooltip />
            <el-table-column label="获奖时间" align="center" prop="awardTime" sortable show-overflow-tooltip>
                <template slot-scope="scope">
                    <span>{{ parseTime(scope.row.awardTime, '{y}-{m}-{d}') }}</span>
                </template>
            </el-table-column>
            <el-table-column label="审核状态" align="center" prop="auditState" sortable width="80" fixed="right">
                <template slot-scope="scope">
                    <dict-tag :options="dict.type.audit_states" :value="scope.row.auditState" />
                </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="160px">
                <template slot-scope="scope">
                    <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
                        v-hasPermi="['school:teacherAwards:edit']"
                        v-if="scope.row.auditState === '1' || scope.row.auditState === '2' || scope.row.auditState === '3'">修改</el-button>
                    <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
                        v-hasPermi="['school:teacherAwards:remove']"
                        v-if="scope.row.auditState === '1' || scope.row.auditState === '2' || scope.row.auditState === '3'">删除</el-button>
                    <el-button size="mini" type="text" icon="el-icon-s-check" @click="handleExamine(scope.row)"
                        v-hasPermi="['school:teacherAwards:audit']" v-if="scope.row.auditState === '1'">审核</el-button>
                </template>
            </el-table-column>
        </el-table>

        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
            @pagination="getList" />

        <!-- 添加或修改教师获奖对话框 -->
        <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
            <el-form ref="form" :model="form" :rules="rules" label-width="80px">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="学科" prop="sub">
                            <el-select v-model="form.sub" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.teaching_subjects" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖类别" prop="awardType">
                            <el-select v-model="form.awardType" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.award_categoriesjs" :key="dict.value"
                                    :label="dict.label" :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="获奖级别" prop="awardRank">
                            <el-select v-model="form.awardRank" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.awards_level" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖等级" prop="awardLevel">
                            <el-select v-model="form.awardLevel" clearable placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.award_rank" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="成果名称" prop="resultName">
                            <el-input v-model="form.resultName" placeholder="请输入" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖人" prop="userName">
                            <el-input v-model="form.userName" placeholder="请选择" clearable
                                @input="openSelect('选择分管领导', 'leaderList', 2)"
                                @focus="openSelect('选择分管领导', 'leaderList', 2)"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="主办单位" prop="org">
                            <el-input v-model="form.org" placeholder="请输入" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖时间" prop="awardTime">
                            <el-date-picker clearable v-model="form.awardTime" type="date" value-format="yyyy-MM-dd"
                                placeholder="请选择" style="width: 100%;">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="备注" prop="remark">
                            <el-input v-model="form.remark" placeholder="请输入" clearable />
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12" class="custom-margin">
                        <el-form-item label="证书图片" prop="pictureUrl"
                            :rules="[{ required: true, message: '证书图片不能为空', trigger: 'blur' }]">
                            <el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"
                                :show-file-list="false" :on-success="handleAvatarSuccess"
                                :before-upload="beforeAvatarUpload" :http-request="uploadImage">
                                <img v-if="form.pictureUrl" :src="baseUrl + form.pictureUrl"
                                    style="max-width: 100%; max-height: 100%" class="avatar" alt="" />
                                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                            </el-upload>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitForm">确 定</el-button>
                <el-button @click="cancel">取 消</el-button>
            </div>
        </el-dialog>
        <!-- 审核综合荣誉对话框 -->
        <el-dialog title="详细信息" :visible.sync="look" width="1000px" append-to-body>
            <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="isEdit">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="学科" prop="sub">
                            <el-select v-model="form.sub" placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.teaching_subjects" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖类别" prop="awardType">
                            <el-input v-model="form.awardType" placeholder="请输入" clearable
                                @keyup.enter.native="handleQuery" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="获奖级别" prop="awardRank">
                            <el-select v-model="form.awardRank" placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.awards_level" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖等级" prop="awardLevel">
                            <el-select v-model="form.awardLevel" placeholder="请选择" style="width: 100%;">
                                <el-option v-for="dict in dict.type.award_rank" :key="dict.value" :label="dict.label"
                                    :value="dict.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="成果名称" prop="resultName">
                            <el-input v-model="form.resultName" placeholder="请输入" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖人" prop="userName">
                            <el-input v-model="form.userName" placeholder="请选择"
                                @input="openSelect('选择分管领导', 'leaderList', 2)"
                                @focus="openSelect('选择分管领导', 'leaderList', 2)"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="主办单位" prop="org">
                            <el-input v-model="form.org" placeholder="请输入" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="获奖时间" prop="awardTime">
                            <el-date-picker clearable v-model="form.awardTime" type="date" value-format="yyyy-MM-dd"
                                placeholder="请选择" style="width: 100%;">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="备注" prop="remark">
                            <el-input v-model="form.remark" placeholder="请输入" />
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12" class="custom-margin">
                        <el-form-item label="证书图片" prop="pictureUrl"
                            :rules="[{ required: true, message: '证书图片不能为空', trigger: 'blur' }]">
                            <el-upload v-loading="uploadLoading" class="avatar-uploader" action="#" accept="image/*"
                                :show-file-list="false" :on-success="handleAvatarSuccess"
                                :before-upload="beforeAvatarUpload" :http-request="uploadImage">
                                <img v-if="form.pictureUrl" :src="baseUrl + form.pictureUrl"
                                    style="max-width: 100%; max-height: 100%" class="avatar" alt="" />
                                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                            </el-upload>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer" style="display: flex;justify-content: center;">
                <el-button @click="handleAgree" type="primary" size="small">同意</el-button>
                <el-button @click="handleDisagree" type="danger" size="small">不同意</el-button>
            </div>
        </el-dialog>
        <SelectUser :id="selectHandles.id" :open.sync="selectHandles.open" :title="selectHandles.title"
            :width="selectHandles.width" :execute="selectHandles.method" @select="selectUser"></SelectUser>
    </div>
</template>

<script>
import { listAwards, getAwards, delAwards, addAwards, updateAwards, audit } from "@/api/smartSchool/electronicArchives/professionalDevelopment/teacherAwards";
import { uploadImage as commonUpload } from "@/api/common";
import SelectUser from "./components/SelectUser";
export default {
    name: "Awards",
    components: {
        SelectUser,
    },
    dicts: ["teaching_subjects", 'award_categoriesjs', 'awards_level', 'award_rank', 'audit_states'],
    data() {
        return {
            // 选择对应处理人
            selectHandles: {
                id: null,
                open: false,
                title: '',
                width: '50%',
                method: null,
                type: null // 处理类型： 1 级部/处室； 2 分管； 3 主管
            },
            // 图片上传遮罩层
            uploadLoading: false,
            baseUrl: [process.env.VUE_APP_BASE_API],
            // 遮罩层
            loading: true,
            // 选中数组
            ids: [],
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,
            // 显示搜索条件
            showSearch: true,
            // 总条数
            total: 0,
            // 教师获奖表格数据
            awardsList: [],
            // 弹出层标题
            title: "",
            // 是否显示弹出层
            open: false,
            look: false,
            isEdit: false,
            query: false,
            // 查询参数
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                sub: null,
                awardType: null,
                awardRank: null,
                awardLevel: null,
                resultName: null,
                userId: null,
                userName: null,
                org: null,
                awardTime: null,
                pictureName: null,
                pictureUrl: null,
                endTime: null,
                startTime: null,
            },
            // 表单参数
            form: {},
            // 表单校验
            rules: {
                sub: [
                    { required: true, message: "学科不能为空", trigger: "change" }
                ],
                awardType: [
                    { required: true, message: "获奖类别不能为空", trigger: "change" }
                ],
                awardRank: [
                    { required: true, message: "获奖级别不能为空", trigger: "change" }
                ],
                awardLevel: [
                    { required: true, message: "获奖等级不能为空", trigger: "change" }
                ],
                resultName: [
                    { required: true, message: "成果名称不能为空", trigger: "blur" }
                ],
                userId: [
                    { required: true, message: "获奖人id不能为空", trigger: "blur" }
                ],
                userName: [
                    { required: true, message: "获奖人不能为空", trigger: "blur" }
                ],
                org: [
                    { required: true, message: "主办单位不能为空", trigger: "blur" }
                ],
                awardTime: [
                    { required: true, message: "获奖时间不能为空", trigger: "blur" }
                ],
                pictureName: [
                    { required: true, message: "证书图片名称不能为空", trigger: "blur" }
                ],
                pictureUrl: [
                    { required: true, message: "证书图片地址不能为空", trigger: "blur" }
                ],

            }
        };
    },
    created() {
        this.getList();
    },
    methods: {
        /** 查询教师获奖列表 */
        getList() {
            this.loading = true;
            listAwards(this.queryParams).then(response => {
                this.awardsList = response.rows;
                this.total = response.total;
                this.loading = false;
            });
        },
        // 选择处理人:打开对话框
        openSelect(title, method, type) {
            console.log('form.userName', this.form.userName);

            if (this.form.userName) {
                console.log('有值', this.form.userName == "");
            } else {
                console.log('没值', this.form.userName);
                this.selectHandles.open = true;
                this.selectHandles.title = title;
                this.selectHandles.method = method;
                this.selectHandles.type = type;
            }
        },
        // 选择处理人
        selectUser(select) {
            this.$set(this.form, `userName${this.selectHandles.type}`, select.name);
            console.log(select.name);
            this.$set(this.form, `userId${this.selectHandles.type}`, select.id);
            console.log(select.id);
            // 设置顶层的 userName 和 userId 字段
            this.form.userName = select.name;
            console.log(124, this.form.userName);
            console.log(select);
            this.form.userId = select.id;
            console.log(this.form.userId, 'this.form.userId');

            // 重新赋值选中的 id
            this.selectUser.id = select.id;
        },
        //审核
        handleExamine(row) {
            const id = row.id || this.ids;
            getAwards(id).then(response => {
                this.look = true;
                this.isEdit = true,
                    this.form = response.data;
                this.pictureUrl = this.pev + this.form.pictureUrl
                this.title = "综合荣誉";
            });
        },
        // 同意
        handleAgree() {
            const params = {
                id: this.form.id,
                auditState: '2'  // 表示同意
            };
            audit(params).then(({ code }) => {
                console.log(this.form, 'this.form');
                if (code == 200) {
                    this.$modal.msgSuccess('操作成功')
                    this.look = false;
                    this.getList()
                }
            })
        },

        // 不同意
        handleDisagree() {
            const params = {
                id: this.form.id,
                auditState: '3'  // 表示不同意
            };
            audit(params).then(({ code }) => {
                console.log(this.form, 'this.form');
                if (code == 200) {
                    this.$modal.msgSuccess('操作成功')
                    this.look = false
                    this.getList()
                }
            })
        },
        // 上传成功回调
        handleAvatarSuccess(res, file) {
            this.pictureUrl = res.data.url;
            this.commonUpload(file);
        },

        // 上传前格式和图片大小限制
        beforeAvatarUpload(file) {
            const type =
                file.type === "image/jpeg" ||
                "image/jpg" ||
                "image/webp" ||
                "image/png";
            const isLt2M = file.size / 1024 / 1024 < 2;
            if (!type) {
                this.$message.error("图片格式不正确!(只能包含jpg，png，webp，JPEG)");
            }
            if (!isLt2M) {
                this.$message.error("上传图片大小不能超过 2MB!");
            }
            return type && isLt2M;
        },
        // 上传图片
        uploadImage(file) {
            const fileData = file.file;
            const formData = new FormData();
            formData.append("file", fileData);
            this.uploadLoading = true;
            commonUpload(formData)
                .then((response) => {
                    this.uploadLoading = false;
                    this.$modal.msgSuccess("上传成功");
                    this.pictureUrl = this.pev + response.url;
                    this.form.pictureUrl = response.url;
                })
                .catch((error) => {
                    this.uploadLoading = false;
                });
        },
        // 取消按钮
        cancel() {
            this.open = false;
            this.reset();
        },
        // 表单重置
        reset() {
            this.form = {
                id: null,
                sub: null,
                awardType: null,
                awardRank: null,
                awardLevel: null,
                resultName: null,
                userId: null,
                userName: null,
                org: null,
                awardTime: null,
                remark: null,
                pictureName: null,
                pictureUrl: null,
                createBy: null,
                createTime: null,
                updateBy: null,
                updateTime: null,
                delFlag: null
            };
            this.resetForm("form");
        },
        /** 搜索按钮操作 */
        handleQuerycx() {
            this.query = true;
            this.resetcx();
        },
        handleQuery() {
            this.query = true;
            this.getList();
            this.query = false;
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.queryParams.startTime = "";
            this.queryParams.endTime = "";
            this.resetForm("queryParams");
            this.handleQuery();
        },
        // 多选框选中数据
        handleSelectionChange(selection) {
            this.ids = selection.map(item => item.id)
            this.single = selection.length !== 1
            this.multiple = !selection.length
        },
        /** 新增按钮操作 */
        handleAdd() {
            this.reset();
            this.open = true;
            this.title = "添加教师获奖";
        },
        /** 修改按钮操作 */
        handleUpdate(row) {
            this.reset();
            this.open = true;
            const id = row.id || this.ids
            getAwards(id).then(response => {
                this.form = response.data;
                this.title = "修改教师获奖";
            });
        },
        /** 提交按钮 */
        submitForm() {
            this.$refs["form"].validate(valid => {
                this.form.auditState = '2';
                if (valid) {
                    if (this.form.id != null) {
                        updateAwards(this.form).then(response => {
                            this.$modal.msgSuccess("修改成功");
                            this.open = false;
                            this.getList();
                        });
                    } else {
                        addAwards(this.form).then(response => {
                            this.$modal.msgSuccess("新增成功");
                            this.open = false;
                            this.getList();
                        });
                    }
                }
            });
        },
        /** 删除按钮操作 */
        handleDelete(row) {
            const ids = row.id || this.ids;
            this.$modal.confirm('是否确认删除教师获奖编号为"' + ids + '"的数据项？').then(function () {
                return delAwards(ids);
            }).then(() => {
                this.getList();
                this.$modal.msgSuccess("删除成功");
            }).catch(() => { });
        },
        /** 导出按钮操作 */
        handleExport() {
            this.download('/school/teacherAwards/export', {
                ...this.queryParams
            }, `教师获奖_${new Date().getTime()}.xlsx`)
        }
    }
};
</script>
<style scoped lang="scss" >
.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.avatar-uploader .el-upload:hover {
    border-color: #409eff;
}

.avatar-uploader-icon {
    font-size: 30px;
    color: #8c939d;
    width: 70px;
    height: 70px;
    line-height: 70px;
    text-align: center;
}

.avatar {
    width: 300px;
    height: 220px;
    display: block;
}

::v-deep .el-form-item {
    margin-bottom: 0px;
}

::v-deep .el-input--medium .el-input__inner {
    height: 26px;
    line-height: 26px;
}

::v-deep .el-dialog__body {
    padding: 10px 20px
}

::v-deep .el-dialog:not(.is-fullscreen) {
    margin-top: 4vh !important;
}

.search ::v-deep .el-form-item__content {
    width: 200px
}

::v-deep .el-table .el-table__cell {
    padding: 0;
}

::v-deep .el-table .cell {
    padding: 0;
}

::v-deep .el-table th.el-table__cell>.cell {
    padding: 0;

}
</style>
