This commit is contained in:
刘旋 2023-04-20 16:56:48 +08:00
commit 83fbd59ade
1 changed files with 42 additions and 50 deletions

View File

@ -2,17 +2,8 @@
<el-dialog title="upload" v-model="state.isShowDialog" width="700px"> <el-dialog title="upload" v-model="state.isShowDialog" width="700px">
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef"> <el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef">
<el-form-item label="upload picture" prop="img"> <el-form-item label="upload picture" prop="img">
<el-upload <el-upload ref="upFileRef" class="upload-demo" drag accept="image/*" action="#" multiple :http-request="uploadPic"
ref="upFileRef" :on-remove="removePic" :before-upload="beforeUpload">
class="upload-demo"
drag
accept="image/*"
action="#"
multiple
:http-request="uploadPic"
:on-remove="removePic"
:before-upload="beforeUpload"
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon> <el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text"> <div class="el-upload__text">
Drop file here or <em>click to upload</em> Drop file here or <em>click to upload</em>
@ -26,16 +17,18 @@
</el-form-item> </el-form-item>
<el-form-item prop="type" label="data type"> <el-form-item prop="type" label="data type">
<el-select v-model="state.ruleForm.type" class="m-2" placeholder="please select data type"> <el-select v-model="state.ruleForm.type" class="m-2" placeholder="please select data type">
<el-option <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
v-for="item in options" </el-select>
:key="item.value" </el-form-item>
:label="item.label" <el-form-item prop="visualFlag" label="data visualFlag">
:value="item.value" <el-select v-model="state.ruleForm.visualFlag" placeholder="please select data visualFlag" size="default" >
/> <el-option label="Visualization" value= 1></el-option>
<el-option label="B Visualization" value= 0></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="remark" label="data details"> <el-form-item prop="remark" label="data details">
<el-input v-model="state.ruleForm.remark" class="m-2" placeholder="please enter data details" :rows="3" type="textarea" style="width:220px;"/> <el-input v-model="state.ruleForm.remark" class="m-2" placeholder="please enter data details" :rows="3"
type="textarea" style="width:220px;" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
@ -155,6 +148,7 @@ const onSubmit = () => {
state.dataForm.append('type', state.ruleForm.type); state.dataForm.append('type', state.ruleForm.type);
state.dataForm.append('remark', state.ruleForm.remark); state.dataForm.append('remark', state.ruleForm.remark);
state.dataForm.append('disasterId', state.disasterId); state.dataForm.append('disasterId', state.disasterId);
state.dataForm.append('visualFlag', state.ruleForm.visualFlag);
for (let [a, b] of state.dataForm.entries()) { for (let [a, b] of state.dataForm.entries()) {
console.log(a, b, '--------------'); console.log(a, b, '--------------');
} }
@ -176,6 +170,4 @@ defineExpose({
}); });
</script> </script>
<style scoped> <style scoped></style>
</style>