Files

40 lines
969 B
Vue
Raw Normal View History

2023-06-07 10:44:31 +08:00
<template>
<div class="app-container">
<el-card shadow="always" style="width: 55%; margin: 0 auto">
2023-06-13 13:40:54 +08:00
<agent-form ref="agentFormRef" v-model="form" is-add />
2023-06-07 10:44:31 +08:00
<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>
2023-06-13 13:40:54 +08:00
import AgentForm from "@/views/components/AgentForm";
import { reactive, ref, toRefs } from "vue";
2023-06-07 10:44:31 +08:00
const props = defineProps({
labelWidth: {
type: Number,
2023-06-13 13:40:54 +08:00
default: 120,
},
});
2023-06-07 10:44:31 +08:00
const data = reactive({
form: {
industrys: [],
2023-06-13 13:40:54 +08:00
id_image: {},
},
});
const { form } = toRefs(data);
const agentFormRef = ref();
2023-06-07 10:44:31 +08:00
const submitForm = async () => {
2023-06-13 13:40:54 +08:00
if (!agentFormRef.value) return;
const valid = await agentFormRef.value.validateForm();
2023-06-07 10:44:31 +08:00
if (valid) {
2023-06-09 17:31:39 +08:00
// TODO: submit agent
2023-06-07 10:44:31 +08:00
}
2023-06-13 13:40:54 +08:00
};
2023-06-07 10:44:31 +08:00
</script>
2023-06-13 13:40:54 +08:00
<style lang="scss" scoped></style>