<template>
    <div>
        <div class="add-knowledge-wrapper">
            <!-- 新增知识产权 -->
            <div class="dialog-content">
                <div class="dialog-header">新增知识产权</div>
                <div class="contents">
                    <div class="container">
                        <table class="department-table">               
                            <tr>
                                <td class="th1">知识产权类型</td>
                                <td>
                                    <el-select v-model="value" style="width: 100%;" placeholder="请选择">
                                        <el-option
                                            v-for="item in options"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                        </el-option>
                                    </el-select>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="dialog-footer">
                    <el-button @click="handleCancel" size="small">取 消</el-button>
                    <el-button type="primary" style="background-color: #5165f7;" @click="btnAdds" size="small" :disabled="!value">前往添加</el-button>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            value: null,
            options: [
                {
                    value: 1,
                    label: "发明专利"
                },
                {
                    value: 2,
                    label: "植物新品种"
                },
                {
                    value: 3,
                    label: "国家新药"
                },
                {
                    value: 4,
                    label: "集成电路布图设计专有权"
                },
                {
                    value: 5,
                    label: "实用新型专利"
                },
                {
                    value: 6,
                    label: "软件著作权"
                },
                {
                    value: 7,
                    label: "外观设计专利"
                },
                {
                    value: 8,
                    label: "商标信息"
                }
            ]
        }
    },
    methods: {
        handleCancel() {
            this.value = null
        },
        btnAdds() {
            if (this.value) {
                this.$router.push({
                    path: '/knowledgeEdit',
                    query: { type: this.value }
                })
            }
        }
    }
}
</script>
<style scoped>
.add-knowledge-wrapper {
    width: 100%;
    min-height: 400px;
    background: white;
    padding: 20px;
}

.dialog-content {
    width: 50%;
    margin: 0 auto;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.dialog-header {
    width: 100%;
    height: 54px;
    background: #F7F7FA;
    text-align: center;
    line-height: 54px;
    color: #363636;
    font-weight: bold;
    font-size: 18px;
}

.contents {
    width: 90%;
    margin: 0 auto;
    padding: 20px 0;
}

.container {
    width: 72%;
    margin: 0 auto;
}

.department-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.department-table tr {
    border: 1px solid #DCE0FD;
    cursor: pointer;
}

.department-table td {
    background-color: white;
    padding: 5px 20px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.department-table td:first-child {
    width: 120px;
}

.department-table tr:last-child td {
    border-bottom: none;
}

.department-table tr:hover td {
    background-color: #f9f9f9;
    transition: background-color 0.2s;
}

.th1 {
    width: 120px;
    font-size: 13px;
    text-align: right;
    padding-right: 8px;
    border-right: 1px solid #DCE0FD;
    background: #EDEFFE !important;
    border-bottom: 1px solid #DCE0FD !important;
}

.dialog-footer {
    text-align: center;
    margin: 0 auto;
    margin-top: 12px;
    padding-bottom: 20px;
}

:deep .el-dialog__body {
    padding: 0 !important;
}
</style>
