Files
2023-06-09 17:31:39 +08:00

41 lines
953 B
Vue

<template>
<div class="app-container">
<el-card shadow="always" style="width: 55%; margin: 0 auto">
<agent-form ref="agentFormRef" v-model="form" is-add/>
<div :style="{ marginLeft: labelWidth + 'px' }">
<el-button @click="$router.go(-1)">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</div>
</el-card>
</div>
</template>
<script setup>
import AgentForm from '@/views/components/AgentForm'
import {reactive, ref, toRefs} from "vue";
const props = defineProps({
labelWidth: {
type: Number,
default: 120
}
})
const data = reactive({
form: {
industrys: [],
id_image: {}
}
})
const {form} = toRefs(data)
const agentFormRef = ref()
const submitForm = async () => {
if (!agentFormRef.value) return
const valid = await agentFormRef.value.validateForm()
if (valid) {
// TODO: submit agent
}
}
</script>
<style lang="scss" scoped>
</style>