修改木板上传的样式问题

main
于阔 9 months ago
parent b55a799331
commit 390727400b

@ -28,7 +28,7 @@ export const delRepDataProblemApi = (pId?: string): Promise<IResponse> => {
/** 保存 */ /** 保存 */
export const saveRepDataProblemApi = (data: Partial<TableData>): Promise<IResponse> => { export const saveRepDataProblemApi = (data: Partial<TableData>): Promise<IResponse> => {
return request.postJson({ url: '/RepDataProblem/spi/reporting/RepDataProblem/RepDataProblemSave', data }); return request.doImport({ url: '/RepDataProblem/spi/reporting/RepDataProblem/RepDataProblemSave', data });
}; };
/** 查询单条数据 */ /** 查询单条数据 */

@ -4,10 +4,13 @@ import { useForm } from '@/hooks/web/useForm'
import { PropType, reactive, watch } from 'vue' import { PropType, reactive, watch } from 'vue'
import { useValidator } from '@/hooks/web/useValidator' import { useValidator } from '@/hooks/web/useValidator'
import { ElButton, ElMessage, ElMessageBox } from 'element-plus'; import { ElButton, ElMessage, ElMessageBox } from 'element-plus';
import { getCategory } from '@/api/reporting/RepTemplate/RepTemplate';
import { transfDictList } from '@/utils';
import { REPORTING_STATUS_LIST } from '../constants';
const { required } = useValidator() const { required } = useValidator()
let fileData = null;
const props = defineProps({ const props = defineProps({
currentRow: { currentRow: {
type: Object as PropType<any>, type: Object as PropType<any>,
@ -33,9 +36,11 @@ const formSchema = reactive<FormSchema[]>([
field: 'tCategory', field: 'tCategory',
label: '报告分类', label: '报告分类',
component: 'Select', component: 'Select',
componentProps: { optionApi: async () => {
const res = await getCategory({ paramName: 'reportingType_param', systemCode: 'ordb' }).catch(err=>{return {body:{result:[]}}});
return transfDictList(res.body.result);
}, },
value: '1'
}, },
{ {
field: 'createUser', field: 'createUser',
@ -58,8 +63,9 @@ const formSchema = reactive<FormSchema[]>([
label: '报告状态', label: '报告状态',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options:REPORTING_STATUS_LIST
}, },
value:'1'
}, },
{ {
field: 'tDescription', field: 'tDescription',
@ -74,42 +80,39 @@ const formSchema = reactive<FormSchema[]>([
field: 'organCode', field: 'organCode',
label: '报告模版', label: '报告模版',
component: 'Upload', component: 'Upload',
colProps: { span: 160 }, colProps: { span: 24 },
componentProps: { componentProps: {
limit: 1, limit: 1,
drag:true, drag:true,
accept:".doc,.docx", accept:".doc,.docx",
action: 'https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15', action: null,
multiple: true, autoUpload:false,
onPreview: (uploadFile) => { fileList:[],
console.log(uploadFile)
},
onRemove: (file) => {
console.log(file)
},
beforeRemove: (uploadFile) => { beforeRemove: (uploadFile) => {
return ElMessageBox.confirm(`Cancel the transfer of ${uploadFile.name} ?`).then( return ElMessageBox.confirm(`是否取消上传${uploadFile.name}模板文件 ?`).then(
() => true, () => true,
() => false () => false
) )
}, },
onExceed: (files, uploadFiles) => { onExceed: () => {
ElMessage.warning( ElMessage.warning("上传模板失败,当前已有模板,只能上传一个模板")
`The limit is 1, you selected ${files.length} files this time, add up to ${
files.length + uploadFiles.length
} 总共`
)
}, },
slots: { slots: {
default: () =><div class="el-upload"><div class="el-upload__text">拖曳报告模版到这里或<em>上传报告模版</em></div></div>, default: () =><div class="el-upload"><i class="fa fa-upload cursor-pointer"></i><br/><h1 class="el-upload__text">拖拽报告模版到这里...<br/><em>上传报告模版</em></h1></div>,
tip: () => <div class="el-upload__tip">doc,docx文件</div> tip: () => <div class="el-upload__tip">doc,docx文件</div>,
file:(file)=>{
fileData = file.file.raw;
}
},
style:{
width:"100%",
} }
}, },
} }
]) ])
const rules = reactive({ const rules = reactive({
// tStatus:[required()],//
}) })
@ -120,6 +123,7 @@ const submit = async () => {
}) })
if (valid) { if (valid) {
const formData = await getFormData() const formData = await getFormData()
formData.organCode = fileData;
return formData return formData
} }
} }

Loading…
Cancel
Save