编辑报告优化,参数库bug修复
This commit is contained in:
@@ -24,22 +24,27 @@
|
||||
@paste="pasteFun"
|
||||
>
|
||||
<template v-if="fileList.length > 0">
|
||||
<div v-for="(item, index) in fileList" :key="index" class="img-item">
|
||||
<div class="img">
|
||||
<img :src="item.src" />
|
||||
</div>
|
||||
<div class="tip">
|
||||
<el-input
|
||||
v-model="item.title"
|
||||
:placeholder="params.placeholder || '请输入图例名称'"
|
||||
clearable
|
||||
@input="inputFun"
|
||||
/>
|
||||
</div>
|
||||
<div class="del-btn" @click.stop="delFun(index)">
|
||||
<el-icon :size="22"><DeleteFilled /></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="20">
|
||||
<el-col v-for="(item, index) in fileList" :key="index" :span="24 / paramsData.colNum">
|
||||
<div class="img-item">
|
||||
<div class="img">
|
||||
<img :src="item.src" />
|
||||
</div>
|
||||
<div class="tip">
|
||||
<el-input
|
||||
class="img-tip-inp"
|
||||
v-model="item.title"
|
||||
:placeholder="params.placeholder || '请输入图例名称'"
|
||||
clearable
|
||||
@input="inputFun"
|
||||
/>
|
||||
</div>
|
||||
<div class="del-btn" @click.stop="delFun(index)">
|
||||
<el-icon :size="22"><DeleteFilled /></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<div v-else class="preview">
|
||||
<div class="no-data">单击此处粘贴图片...</div>
|
||||
@@ -220,6 +225,16 @@ const closeFun = () => {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.img-content {
|
||||
.img-tip-inp {
|
||||
.el-input__inner {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.img-content {
|
||||
position: relative;
|
||||
@@ -280,7 +295,8 @@ const closeFun = () => {
|
||||
}
|
||||
}
|
||||
.tip {
|
||||
width: 300px;
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
}
|
||||
.del-btn {
|
||||
opacity: 0;
|
||||
|
||||
@@ -376,7 +376,7 @@ const getFormatDataFun = () => {
|
||||
unitData.value.forEach((u: any, uIndex: number) => {
|
||||
let picName = '';
|
||||
if (u.title) {
|
||||
picName = `${u.title.replace(/\s/g, '')}_${unitIndex + 1}_${uIndex + 1}`;
|
||||
picName = `${u.title.replace(/\s/g, '')}_${new Date().getTime()}_${unitIndex + 1}_${uIndex + 1}`;
|
||||
} else {
|
||||
picName = `图片_${new Date().getTime()}_${unitIndex + 1}_${uIndex + 1}`;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,9 @@ import { ref, watch } from 'vue';
|
||||
import TableForm from '@/components/common/table/tableForm.vue';
|
||||
import ParamClass from '@/components/common/paramClass/index.vue';
|
||||
import ParamUnit from '@/components/common/paramUnit/index.vue';
|
||||
import { getUserData } from '@/utils/user';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
interface Props {
|
||||
modelValue: boolean;
|
||||
@@ -74,6 +76,8 @@ watch(
|
||||
const submitFun = async () => {
|
||||
const valid = await tableFormRef.value.validateFun();
|
||||
if (valid) {
|
||||
paramData.value.createName = getUserData().nickname;
|
||||
paramData.value.createTime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
if (!props.data.parameterName) {
|
||||
emit('add', cloneDeep(paramData.value));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user