修改木板上传的样式问题

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

Loading…
Cancel
Save