This commit is contained in:
2026-03-03 16:18:55 +08:00
parent 243a056ca7
commit 3b5706fce7
3 changed files with 15 additions and 2 deletions

View File

@@ -144,6 +144,8 @@ import CompForm from './components/form.vue';
import CompImg from './components/img.vue';
import CompTable from './components/table.vue';
const emit = defineEmits(['update:data']);
defineOptions({
name: 'EditItem',
});
@@ -174,6 +176,15 @@ const titleMap = ref<any>({
img: '图片',
table: '表格',
});
watch(
() => documentData.value,
(val: any) => {
emit('update:data', val);
},
{ deep: true }
);
watch(
() => props.data,
(val: any, oldVal) => {

View File

@@ -108,11 +108,12 @@ const formatFun = (data: any) => {
};
if (item.type === 'img') {
(itemData.value || []).forEach((val: any, valIndex: number) => {
const randNum = Math.floor(Math.random() * 900000) + 100000;
let picName = '';
if (val.title) {
picName = `${val.title.replace(/\s/g, '')}_${new Date().getTime()}_${index + 1}_${valIndex + 1}`;
picName = `${val.title.replace(/\s/g, '')}_${randNum}_${index + 1}_${valIndex + 1}`;
} else {
picName = `图片_${new Date().getTime()}_${index + 1}_${valIndex + 1}`;
picName = `图片_${randNum}_${index + 1}_${valIndex + 1}`;
}
val.picName = picName;
});

View File

@@ -208,6 +208,7 @@ const closeFun = () => {
.report-content {
width: 100%;
flex: 1;
height: calc(100% - 32px);
.no-report {
width: 100%;
height: 100%;