feat: 图片预览
This commit is contained in:
parent
6a9288a576
commit
05a48c4c14
@ -22,7 +22,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传图片">
|
||||
<!-- <FileUpload v-model="imgUrl" :limit="1" :uploadUrl="'/system/file/upload'" :fileSize="5" :fileType="['png', 'jpg', 'jpeg']" /> -->
|
||||
<el-upload
|
||||
v-model:file-list="uploadFileList"
|
||||
:action="`${data.baseUrl}/system/file/upload`"
|
||||
@ -63,14 +62,13 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="dialogVisible">
|
||||
<img :src="dialogImageUrl" alt="Preview Image" />
|
||||
<el-dialog :width="800" v-model="dialogVisible">
|
||||
<img width="770" :src="dialogImageUrl" alt="Preview Image" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch } from 'vue'
|
||||
import FileUpload from '@/components/FileUpload/index'
|
||||
import { useDict } from '@/utils/dict'
|
||||
import {getToken} from "@/utils/auth.js";
|
||||
import {supportType} from "@/enum/index.js";
|
||||
@ -155,6 +153,13 @@ watch(() => props.visible, (newVal) => {
|
||||
visible.value = newVal
|
||||
if (props.formData.iconUrl) {
|
||||
imgUrl.value = props.formData.iconUrl
|
||||
uploadFileList.value = [{
|
||||
name: 'image',
|
||||
url: props.formData.iconUrl,
|
||||
response: {
|
||||
msg: props.formData.iconUrl
|
||||
}
|
||||
}]
|
||||
}
|
||||
})
|
||||
|
||||
@ -170,6 +175,7 @@ function handleConfirm() {
|
||||
if (imgUrl.value && imgUrl.value.length > 0) {
|
||||
obj.iconUrl = imgUrl.value
|
||||
}
|
||||
uploadFileList.value = []
|
||||
emit('confirm', valid, { ...obj })
|
||||
})
|
||||
}
|
||||
|
||||
@ -317,11 +317,11 @@
|
||||
<script setup>
|
||||
import TableSearch from "@/components/TableSearch/index.vue";
|
||||
import { useContainerHeight } from "@/hooks/tableHeight";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { getTreeDataApi } from '@/api/is/func/index'
|
||||
import { getChildrenByParentIdWithLevelLimitApi } from "@/api/evaluate/indicator.js";
|
||||
import { getFunction } from "@/api/is/func/index.js";
|
||||
import { addProject, getProjectList } from "@/api/is/project/index.js";
|
||||
import { addProject, getProjectList, updateProject } from "@/api/is/project/index.js";
|
||||
|
||||
const topContainerRef = ref();
|
||||
const containerHeight = useContainerHeight(topContainerRef);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user