|
@@ -1,5 +1,9 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
- import { saveTrainingInformation, updateTrainingInformation, queryEducationTrainingPlanCourseDetail } from '@/api/production-education-training-plan-dept';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ saveTrainingInformation,
|
|
|
|
|
+ updateTrainingInformation,
|
|
|
|
|
+ queryEducationTrainingPlanCourseDetail,
|
|
|
|
|
+ } from '@/api/production-education-training-plan-dept';
|
|
|
import { ref, reactive, onMounted, watch, shallowRef, computed, nextTick } from 'vue';
|
|
import { ref, reactive, onMounted, watch, shallowRef, computed, nextTick } from 'vue';
|
|
|
import { UploadFilled, Plus, Delete, Download, ZoomIn } from '@element-plus/icons-vue';
|
|
import { UploadFilled, Plus, Delete, Download, ZoomIn } from '@element-plus/icons-vue';
|
|
|
import { TRAINING_FORM_RULES } from '../configs/form';
|
|
import { TRAINING_FORM_RULES } from '../configs/form';
|
|
@@ -29,7 +33,7 @@
|
|
|
default: null,
|
|
default: null,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const isViewMode = computed(() => props.state === 'view');
|
|
const isViewMode = computed(() => props.state === 'view');
|
|
|
const isEditMode = computed(() => props.state === 'edit');
|
|
const isEditMode = computed(() => props.state === 'edit');
|
|
|
const isCreateMode = computed(() => props.state === 'add');
|
|
const isCreateMode = computed(() => props.state === 'add');
|
|
@@ -37,7 +41,7 @@
|
|
|
const emit = defineEmits(['update:visible', 'refreshList', 'saveSuccess']);
|
|
const emit = defineEmits(['update:visible', 'refreshList', 'saveSuccess']);
|
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
|
const rules = ref(TRAINING_FORM_RULES);
|
|
const rules = ref(TRAINING_FORM_RULES);
|
|
|
- // 富文本编辑器
|
|
|
|
|
|
|
+ // 富文本编辑器
|
|
|
const editorRef = shallowRef();
|
|
const editorRef = shallowRef();
|
|
|
const form = reactive({
|
|
const form = reactive({
|
|
|
courseType: '',
|
|
courseType: '',
|
|
@@ -63,21 +67,21 @@
|
|
|
{ label: '特种作业复训考核', value: 4 },
|
|
{ label: '特种作业复训考核', value: 4 },
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- // 上传文件
|
|
|
|
|
- const formatAttachment = async (data: any) => {
|
|
|
|
|
|
|
+ // 上传文件
|
|
|
|
|
+ const formatAttachment = async (data: any) => {
|
|
|
if (!data) return data;
|
|
if (!data) return data;
|
|
|
const uuid = Math.random().toString(36).substring(2, 9);
|
|
const uuid = Math.random().toString(36).substring(2, 9);
|
|
|
const timestamp = Date.now().toString();
|
|
const timestamp = Date.now().toString();
|
|
|
const random = Math.random().toString(36).substring(2, 4);
|
|
const random = Math.random().toString(36).substring(2, 4);
|
|
|
const fileName = data.name;
|
|
const fileName = data.name;
|
|
|
const res = await uploadFileApi({
|
|
const res = await uploadFileApi({
|
|
|
- bizType: UPLOAD_BIZ_TYPE.ATTACHMENT,
|
|
|
|
|
- fileName: `${uuid}-${timestamp}-${random}`,
|
|
|
|
|
- file: data,
|
|
|
|
|
|
|
+ bizType: UPLOAD_BIZ_TYPE.ATTACHMENT,
|
|
|
|
|
+ fileName: `${uuid}-${timestamp}-${random}`,
|
|
|
|
|
+ file: data,
|
|
|
});
|
|
});
|
|
|
return res;
|
|
return res;
|
|
|
-};
|
|
|
|
|
-const openState = ref(false)
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ const openState = ref(false);
|
|
|
// 打开抽屉时的事件
|
|
// 打开抽屉时的事件
|
|
|
const openDrawerFn = async () => {
|
|
const openDrawerFn = async () => {
|
|
|
await nextTick();
|
|
await nextTick();
|
|
@@ -87,49 +91,49 @@ const openState = ref(false)
|
|
|
await queryEducationTrainingPlanCourseDetail(props.currentId).then((res) => {
|
|
await queryEducationTrainingPlanCourseDetail(props.currentId).then((res) => {
|
|
|
// console.log(res, '课程详情',);
|
|
// console.log(res, '课程详情',);
|
|
|
Object.assign(form, {
|
|
Object.assign(form, {
|
|
|
- courseType: res.courseType,
|
|
|
|
|
- courseName: res.courseName,
|
|
|
|
|
- trainingMethod: res.trainingMethod,
|
|
|
|
|
- trainingTeacher: res.trainingTeacher,
|
|
|
|
|
- planNumOfParticipants: res.planNumOfParticipants,
|
|
|
|
|
- startDate: res.startDate ? new Date(res.startDate) : '',
|
|
|
|
|
- endDate: res.endDate ? new Date(res.endDate) : '',
|
|
|
|
|
- courseIntroduction: res.courseIntroduction,
|
|
|
|
|
- isSign: res.isSign,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ courseType: res.courseType,
|
|
|
|
|
+ courseName: res.courseName,
|
|
|
|
|
+ trainingMethod: res.trainingMethod,
|
|
|
|
|
+ trainingTeacher: res.trainingTeacher,
|
|
|
|
|
+ planNumOfParticipants: res.planNumOfParticipants,
|
|
|
|
|
+ startDate: res.startDate ? new Date(res.startDate) : '',
|
|
|
|
|
+ endDate: res.endDate ? new Date(res.endDate) : '',
|
|
|
|
|
+ courseIntroduction: res.courseIntroduction,
|
|
|
|
|
+ isSign: res.isSign,
|
|
|
|
|
+ });
|
|
|
form.groupOfParticipants = res.groupOfParticipants ? res.groupOfParticipants.split(',').map(Number) : [];
|
|
form.groupOfParticipants = res.groupOfParticipants ? res.groupOfParticipants.split(',').map(Number) : [];
|
|
|
// 编辑和查看时 没有回显
|
|
// 编辑和查看时 没有回显
|
|
|
- if(res.courseImg){
|
|
|
|
|
- form.courseImg = JSON.parse(res.courseImg)
|
|
|
|
|
- courseImgList.value = JSON.parse(res.courseImg) || []
|
|
|
|
|
|
|
+ if (res.courseImg) {
|
|
|
|
|
+ form.courseImg = JSON.parse(res.courseImg);
|
|
|
|
|
+ courseImgList.value = JSON.parse(res.courseImg) || [];
|
|
|
}
|
|
}
|
|
|
- if(res.courseContent){
|
|
|
|
|
- fileList.value = JSON.parse(res.courseContent) || [];
|
|
|
|
|
- form.courseContent = JSON.parse(res.courseContent)
|
|
|
|
|
|
|
+ if (res.courseContent) {
|
|
|
|
|
+ fileList.value = JSON.parse(res.courseContent) || [];
|
|
|
|
|
+ form.courseContent = JSON.parse(res.courseContent);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else if (props.state === 'add') {
|
|
} else if (props.state === 'add') {
|
|
|
- // 新增模式,重置表单
|
|
|
|
|
- fileList.value = [];
|
|
|
|
|
- Object.assign(form, {
|
|
|
|
|
- courseType: '',
|
|
|
|
|
- courseName: '',
|
|
|
|
|
- trainingMethod: '',
|
|
|
|
|
- trainingTeacher: '',
|
|
|
|
|
- planNumOfParticipants: '',
|
|
|
|
|
- groupOfParticipants: [],
|
|
|
|
|
- startDate: '',
|
|
|
|
|
- endDate: '',
|
|
|
|
|
- courseIntroduction: '',
|
|
|
|
|
- courseContent: '', // [] as FileItem[],
|
|
|
|
|
- isSign: 0,
|
|
|
|
|
- courseImg: [] as FileItem[],
|
|
|
|
|
- });
|
|
|
|
|
- courseContentUpload.value?.clearFiles();
|
|
|
|
|
- courseImgRef.value?.clearFiles();
|
|
|
|
|
|
|
+ // 新增模式,重置表单
|
|
|
|
|
+ fileList.value = [];
|
|
|
|
|
+ Object.assign(form, {
|
|
|
|
|
+ courseType: '',
|
|
|
|
|
+ courseName: '',
|
|
|
|
|
+ trainingMethod: '',
|
|
|
|
|
+ trainingTeacher: '',
|
|
|
|
|
+ planNumOfParticipants: '',
|
|
|
|
|
+ groupOfParticipants: [],
|
|
|
|
|
+ startDate: '',
|
|
|
|
|
+ endDate: '',
|
|
|
|
|
+ courseIntroduction: '',
|
|
|
|
|
+ courseContent: '', // [] as FileItem[],
|
|
|
|
|
+ isSign: 0,
|
|
|
|
|
+ courseImg: [] as FileItem[],
|
|
|
|
|
+ });
|
|
|
|
|
+ courseContentUpload.value?.clearFiles();
|
|
|
|
|
+ courseImgRef.value?.clearFiles();
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
const editorConfig = computed(() => ({
|
|
const editorConfig = computed(() => ({
|
|
|
placeholder: '请输入培训课程简述',
|
|
placeholder: '请输入培训课程简述',
|
|
|
}));
|
|
}));
|
|
@@ -143,37 +147,37 @@ const openState = ref(false)
|
|
|
|
|
|
|
|
// 上传图片
|
|
// 上传图片
|
|
|
const handleImageUploadChange = async (file: any, fileLists: any) => {
|
|
const handleImageUploadChange = async (file: any, fileLists: any) => {
|
|
|
- if(file.raw){
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await formatAttachment(file.raw);
|
|
|
|
|
-
|
|
|
|
|
- const targetFile = fileLists.find(f => f.uid === file.uid);
|
|
|
|
|
- if (targetFile) {
|
|
|
|
|
- targetFile.url = res.url;
|
|
|
|
|
- targetFile.contentType = res.contentType
|
|
|
|
|
- }
|
|
|
|
|
- courseImgList.value = fileLists;
|
|
|
|
|
- form.courseImg = JSON.stringify(fileLists);
|
|
|
|
|
- ElMessage.success('上传成功');
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- ElMessage.error('上传失败,请重试');
|
|
|
|
|
- // 上传失败时,可以从 fileLists 中移除该文件
|
|
|
|
|
- courseImgList.value = fileLists.filter(f => f.uid !== file.uid);
|
|
|
|
|
|
|
+ if (file.raw) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await formatAttachment(file.raw);
|
|
|
|
|
+
|
|
|
|
|
+ const targetFile = fileLists.find((f) => f.uid === file.uid);
|
|
|
|
|
+ if (targetFile) {
|
|
|
|
|
+ targetFile.url = res.url;
|
|
|
|
|
+ targetFile.contentType = res.contentType;
|
|
|
}
|
|
}
|
|
|
|
|
+ courseImgList.value = fileLists;
|
|
|
|
|
+ form.courseImg = JSON.stringify(fileLists);
|
|
|
|
|
+ ElMessage.success('上传成功');
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ ElMessage.error('上传失败,请重试');
|
|
|
|
|
+ // 上传失败时,可以从 fileLists 中移除该文件
|
|
|
|
|
+ courseImgList.value = fileLists.filter((f) => f.uid !== file.uid);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
// 替换图片
|
|
// 替换图片
|
|
|
const courseImgRef = ref();
|
|
const courseImgRef = ref();
|
|
|
const handleImageExceed = (files) => {
|
|
const handleImageExceed = (files) => {
|
|
|
- courseImgRef.value!.clearFiles();
|
|
|
|
|
|
|
+ courseImgRef.value!.clearFiles();
|
|
|
const file = files[0] as UploadRawFile;
|
|
const file = files[0] as UploadRawFile;
|
|
|
- console.log(file)
|
|
|
|
|
|
|
+ console.log(file);
|
|
|
if (!validateImage(file)) {
|
|
if (!validateImage(file)) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- courseImgRef.value!.handleStart(file);
|
|
|
|
|
|
|
+ courseImgRef.value!.handleStart(file);
|
|
|
};
|
|
};
|
|
|
-// 图片预览
|
|
|
|
|
|
|
+ // 图片预览
|
|
|
const dialogVisible = ref(false);
|
|
const dialogVisible = ref(false);
|
|
|
const dialogImageUrl = ref('');
|
|
const dialogImageUrl = ref('');
|
|
|
const handlePictureCardPreview = (file: any) => {
|
|
const handlePictureCardPreview = (file: any) => {
|
|
@@ -181,13 +185,13 @@ const openState = ref(false)
|
|
|
dialogVisible.value = true;
|
|
dialogVisible.value = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handlePictureCardDelete = (file, fileLists)=>{
|
|
|
|
|
- courseImgRef.value = fileLists.filter(f => f.uid !== file.uid);
|
|
|
|
|
- console.log(courseImgRef.value)
|
|
|
|
|
|
|
+ const handlePictureCardDelete = (file, fileLists) => {
|
|
|
|
|
+ courseImgRef.value = fileLists.filter((f) => f.uid !== file.uid);
|
|
|
|
|
+ console.log(courseImgRef.value);
|
|
|
form.courseImg = JSON.stringify(courseImgRef.value);
|
|
form.courseImg = JSON.stringify(courseImgRef.value);
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
-// 图片格式校验
|
|
|
|
|
|
|
+ // 图片格式校验
|
|
|
const validateImage = (file) => {
|
|
const validateImage = (file) => {
|
|
|
const validMIME = [
|
|
const validMIME = [
|
|
|
'image/jpeg',
|
|
'image/jpeg',
|
|
@@ -223,14 +227,15 @@ const openState = ref(false)
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 验证文件类型
|
|
// 验证文件类型
|
|
|
- const allowedTypes = [
|
|
|
|
|
- 'application/rar',
|
|
|
|
|
- 'application/zip',
|
|
|
|
|
- 'application/msword',
|
|
|
|
|
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
|
|
|
- 'application/pdf',
|
|
|
|
|
- 'video/mp4',
|
|
|
|
|
- ];
|
|
|
|
|
|
|
+ const allowedTypes = [
|
|
|
|
|
+ 'application/rar',
|
|
|
|
|
+ 'application/zip',
|
|
|
|
|
+ 'application/msword',
|
|
|
|
|
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
|
|
|
|
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
|
|
|
|
+ 'application/pdf',
|
|
|
|
|
+ 'video/mp4',
|
|
|
|
|
+ ];
|
|
|
|
|
|
|
|
const beforeUpload = (file) => {
|
|
const beforeUpload = (file) => {
|
|
|
const isAllowedType = allowedTypes.includes(file.type);
|
|
const isAllowedType = allowedTypes.includes(file.type);
|
|
@@ -256,60 +261,56 @@ const openState = ref(false)
|
|
|
courseContentUpload.value!.handleStart(file); // 手动触发上传
|
|
courseContentUpload.value!.handleStart(file); // 手动触发上传
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// 课程内容文件上传
|
|
// 课程内容文件上传
|
|
|
const handleFileChange = async (file, fileLists) => {
|
|
const handleFileChange = async (file, fileLists) => {
|
|
|
-
|
|
|
|
|
|
|
+ // console.log(file, fileLists, '文件列表')
|
|
|
|
|
|
|
|
- if (!allowedTypes.includes(file.raw.type)) {
|
|
|
|
|
- ElMessage.error('不支持的文件格式');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (!allowedTypes.includes(file.raw.type)) {
|
|
|
|
|
+ // ElMessage.error('不支持的文件格式');
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
if (file.raw.size > 20 * 1024 * 1024) {
|
|
if (file.raw.size > 20 * 1024 * 1024) {
|
|
|
ElMessage.error('文件大小不能超过20MB');
|
|
ElMessage.error('文件大小不能超过20MB');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(file.raw){
|
|
|
|
|
- try {
|
|
|
|
|
- const res = await formatAttachment(file.raw);
|
|
|
|
|
-
|
|
|
|
|
- const targetFile = fileLists.find(f => f.uid === file.uid);
|
|
|
|
|
- if (targetFile) {
|
|
|
|
|
- targetFile.url = res.url;
|
|
|
|
|
- targetFile.contentType = res.contentType
|
|
|
|
|
- }
|
|
|
|
|
- fileList.value = fileLists;
|
|
|
|
|
- form.courseContent = JSON.stringify(fileList.value);
|
|
|
|
|
- ElMessage.success('上传成功');
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- ElMessage.error('上传失败,请重试');
|
|
|
|
|
- // 上传失败时,可以从 fileLists 中移除该文件
|
|
|
|
|
- fileList.value = fileLists.filter(f => f.uid !== file.uid);
|
|
|
|
|
|
|
+ if (file.raw) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await formatAttachment(file.raw);
|
|
|
|
|
+
|
|
|
|
|
+ const targetFile = fileLists.find((f) => f.uid === file.uid);
|
|
|
|
|
+ if (targetFile) {
|
|
|
|
|
+ targetFile.url = res.url;
|
|
|
|
|
+ targetFile.contentType = res.contentType;
|
|
|
}
|
|
}
|
|
|
|
|
+ fileList.value = fileLists;
|
|
|
|
|
+ form.courseContent = JSON.stringify(fileList.value);
|
|
|
|
|
+ ElMessage.success('上传成功');
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ ElMessage.error('上传失败,请重试');
|
|
|
|
|
+ // 上传失败时,可以从 fileLists 中移除该文件
|
|
|
|
|
+ fileList.value = fileLists.filter((f) => f.uid !== file.uid);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
};
|
|
};
|
|
|
// 移除事件
|
|
// 移除事件
|
|
|
- const handleFileRemove = (file, fileLists)=>{
|
|
|
|
|
- fileList.value = fileLists.filter(f => f.uid !== file.uid);
|
|
|
|
|
- form.courseContent = JSON.stringify(fileList.value);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const handleFileRemove = (file, fileLists) => {
|
|
|
|
|
+ fileList.value = fileLists.filter((f) => f.uid !== file.uid);
|
|
|
|
|
+ form.courseContent = JSON.stringify(fileList.value);
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
// 提交保存/编辑
|
|
// 提交保存/编辑
|
|
|
const handleValidate = async () => {
|
|
const handleValidate = async () => {
|
|
|
if (!formRef.value) return;
|
|
if (!formRef.value) return;
|
|
|
try {
|
|
try {
|
|
|
- await formRef.value.validate();
|
|
|
|
|
- return true;
|
|
|
|
|
|
|
+ await formRef.value.validate();
|
|
|
|
|
+ return true;
|
|
|
} catch {
|
|
} catch {
|
|
|
- return false;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
const handleSave = debounce(async () => {
|
|
const handleSave = debounce(async () => {
|
|
|
-
|
|
|
|
|
- if(form.startDate > form.endDate) {
|
|
|
|
|
|
|
+ if (form.startDate > form.endDate) {
|
|
|
ElMessage.error('开始日期不能晚于结束日期');
|
|
ElMessage.error('开始日期不能晚于结束日期');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -321,13 +322,12 @@ const openState = ref(false)
|
|
|
...form,
|
|
...form,
|
|
|
petpiId: props.currentId,
|
|
petpiId: props.currentId,
|
|
|
};
|
|
};
|
|
|
- // console.log('提交的表单数据:', basePayload);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // console.log('提交的表单数据:', basePayload);
|
|
|
|
|
+
|
|
|
if (isCreateMode.value) {
|
|
if (isCreateMode.value) {
|
|
|
// 新增,创建接口
|
|
// 新增,创建接口
|
|
|
await saveTrainingInformation(basePayload);
|
|
await saveTrainingInformation(basePayload);
|
|
|
ElMessage.success('创建成功');
|
|
ElMessage.success('创建成功');
|
|
|
-
|
|
|
|
|
} else if (isEditMode.value && props.currentId) {
|
|
} else if (isEditMode.value && props.currentId) {
|
|
|
// 编辑,更新接口
|
|
// 编辑,更新接口
|
|
|
await updateTrainingInformation({
|
|
await updateTrainingInformation({
|
|
@@ -335,7 +335,6 @@ const openState = ref(false)
|
|
|
...basePayload,
|
|
...basePayload,
|
|
|
});
|
|
});
|
|
|
ElMessage.success('保存成功');
|
|
ElMessage.success('保存成功');
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
emit('saveSuccess');
|
|
emit('saveSuccess');
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -367,7 +366,7 @@ const openState = ref(false)
|
|
|
direction="rtl"
|
|
direction="rtl"
|
|
|
size="45%"
|
|
size="45%"
|
|
|
@opened="openDrawerFn"
|
|
@opened="openDrawerFn"
|
|
|
- :title="state === 'add' ? '新增培训课程': state === 'edit' ? '编辑培训课程' : '查看培训课程'"
|
|
|
|
|
|
|
+ :title="state === 'add' ? '新增培训课程' : state === 'edit' ? '编辑培训课程' : '查看培训课程'"
|
|
|
@close="$emit('update:visible', false)"
|
|
@close="$emit('update:visible', false)"
|
|
|
>
|
|
>
|
|
|
<el-form label-position="right" label-width="150px" :model="form" :rules="rules" ref="formRef">
|
|
<el-form label-position="right" label-width="150px" :model="form" :rules="rules" ref="formRef">
|
|
@@ -451,7 +450,7 @@ const openState = ref(false)
|
|
|
v-if="!isViewMode"
|
|
v-if="!isViewMode"
|
|
|
:on-change="handleFileChange"
|
|
:on-change="handleFileChange"
|
|
|
:on-remove="handleFileRemove"
|
|
:on-remove="handleFileRemove"
|
|
|
- accept=".rar, .zip, .doc, .docx, .pdf, .mp4"
|
|
|
|
|
|
|
+ accept=".rar, .zip, .doc, .docx, .pdf, .mp4, .ppt, .pptx"
|
|
|
:file-list="fileList"
|
|
:file-list="fileList"
|
|
|
>
|
|
>
|
|
|
<el-button type="default" :disabled="isViewMode">
|
|
<el-button type="default" :disabled="isViewMode">
|
|
@@ -465,13 +464,13 @@ const openState = ref(false)
|
|
|
</template>
|
|
</template>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
<div class="file-list" v-else>
|
|
<div class="file-list" v-else>
|
|
|
- <div class="file-item" v-for="file in fileList" :key="file.fileId">
|
|
|
|
|
- <span class="file-item--name">{{ file.name }}</span>
|
|
|
|
|
- <div class="file-item--footer">
|
|
|
|
|
- <el-button link type="primary" @click.stop="downloadFile(file.url, file.name)">下载</el-button>
|
|
|
|
|
|
|
+ <div class="file-item" v-for="file in fileList" :key="file.fileId">
|
|
|
|
|
+ <span class="file-item--name">{{ file.name }}</span>
|
|
|
|
|
+ <div class="file-item--footer">
|
|
|
|
|
+ <el-button link type="primary" @click.stop="downloadFile(file.url, file.name)">下载</el-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="是否需要签名:" prop="isSign">
|
|
<el-form-item label="是否需要签名:" prop="isSign">
|
|
@@ -494,10 +493,11 @@ const openState = ref(false)
|
|
|
:on-remove="handlePictureCardDelete"
|
|
:on-remove="handlePictureCardDelete"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
:on-preview="handlePictureCardPreview"
|
|
|
:before-upload="validateImage"
|
|
:before-upload="validateImage"
|
|
|
- list-type="picture-card">
|
|
|
|
|
- <el-icon>
|
|
|
|
|
- <Plus />
|
|
|
|
|
- </el-icon>
|
|
|
|
|
|
|
+ list-type="picture-card"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <Plus />
|
|
|
|
|
+ </el-icon>
|
|
|
<template #tip>
|
|
<template #tip>
|
|
|
<div class="el-upload__tip"> 支持格式:.jpg .png .jpeg,单个文件不能超过300k,设置一个默认图片。</div>
|
|
<div class="el-upload__tip"> 支持格式:.jpg .png .jpeg,单个文件不能超过300k,设置一个默认图片。</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -516,7 +516,7 @@ const openState = ref(false)
|
|
|
</template> -->
|
|
</template> -->
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
<el-dialog v-model="dialogVisible">
|
|
<el-dialog v-model="dialogVisible">
|
|
|
- <img w-full :src="dialogImageUrl" alt="Preview Image" style="width: 100%;" />
|
|
|
|
|
|
|
+ <img w-full :src="dialogImageUrl" alt="Preview Image" style="width: 100%" />
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
@@ -525,7 +525,7 @@ const openState = ref(false)
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="$emit('update:visible', false)">取消</el-button>
|
|
<el-button @click="$emit('update:visible', false)">取消</el-button>
|
|
|
<el-button type="primary" @click="handleSave" v-if="!isViewMode">
|
|
<el-button type="primary" @click="handleSave" v-if="!isViewMode">
|
|
|
- {{ isEditMode ? '保存' : '新增' }}
|
|
|
|
|
|
|
+ 保存
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -588,12 +588,12 @@ const openState = ref(false)
|
|
|
pre {
|
|
pre {
|
|
|
white-space: pre-wrap;
|
|
white-space: pre-wrap;
|
|
|
}
|
|
}
|
|
|
- .file-item{
|
|
|
|
|
|
|
+ .file-item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
.file-item--name {
|
|
.file-item--name {
|
|
|
- margin-right: 20px;
|
|
|
|
|
|
|
+ margin-right: 20px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|