<template>
    <Drawer ref="drawerRef" v-model="visible">
        <a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
            <a-form-model-item label="名称" prop="jobName">
                <a-input v-model="form.jobName" :disabled="isView" />
            </a-form-model-item>
            <a-form-model-item label="描述" prop="jobDescription">
                <a-textarea v-model="form.jobDescription" :disabled="isView" :rows="4" />
            </a-form-model-item>
        </a-form-model>
    </Drawer>
</template>

<script>
import Drawer from '@/components/table/drawer.vue';
import JobsApi from '@/api/organization';
import FormMixin from '@/components/FormMixin';
export default {
    components: { Drawer },
    mixins: [FormMixin],
    data() {
        return {
            visible: false,
            rules: {
                jobName: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
                jobDescription: [
                    { required: true, message: 'Please select Activity zone', trigger: 'change' },
                ],
            },
        };
    },
    methods: {
        open() {
            this.visible = true;
        },
        add() {
            return JobsApi.addJobs({ ...this.form });
        },
        edit() {
            return JobsApi.updateJobs({ ...this.form });
        },
    },
};
</script>
