bug
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
@@ -208,6 +208,7 @@ const closeFun = () => {
|
||||
.report-content {
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
height: calc(100% - 32px);
|
||||
.no-report {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user