图片上传改造
This commit is contained in:
parent
8bc85d9d15
commit
bd49a00b84
@ -12,5 +12,9 @@ VITE_APP_ROUTER_PREFIX = '/'
|
||||
# 默认上传地址
|
||||
VITE_APP_UPLOAD_URL = '/Common/UploadFile'
|
||||
|
||||
|
||||
#设备检查项
|
||||
MES_DEVICE_INSPECT ="/device/inspect"
|
||||
|
||||
#socket API
|
||||
VITE_APP_SOCKET_API = '/msghub'
|
||||
@ -83,22 +83,26 @@ const props = defineProps({
|
||||
// 上传携带的参数
|
||||
data: {
|
||||
type: Object
|
||||
},
|
||||
baseUrl: {
|
||||
type: String,
|
||||
default: import.meta.env.VITE_APP_BASE_API
|
||||
}
|
||||
})
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emit = defineEmits()
|
||||
const number = ref(0)
|
||||
const uploadList = ref([])
|
||||
const dialogImageUrl = ref('')
|
||||
const dialogVisible = ref(false)
|
||||
const baseUrl = import.meta.env.VITE_APP_BASE_API
|
||||
const uploadImgUrl = ref(baseUrl + import.meta.env.VITE_APP_UPLOAD_URL) // 上传的图片服务器地址
|
||||
//const baseUrl = import.meta.env.VITE_APP_BASE_API
|
||||
const uploadImgUrl = ref(props.baseUrl + import.meta.env.VITE_APP_UPLOAD_URL) // 上传的图片服务器地址
|
||||
|
||||
const headers = ref({ Authorization: 'Bearer ' + getToken() })
|
||||
const fileList = ref([])
|
||||
const showTip = computed(() => props.isShowTip && (props.fileType || props.fileSize))
|
||||
const uploadData = computed(() => props.data)
|
||||
|
||||
// 文件上传地址
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val) => {
|
||||
|
||||
@ -82,6 +82,7 @@
|
||||
<el-step title="基本信息"> </el-step>
|
||||
<el-step title="配置表单"></el-step>
|
||||
</el-steps>
|
||||
<!-- 基本信息 -->
|
||||
<template v-if="active == 0">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
@ -98,7 +99,7 @@
|
||||
|
||||
<el-col :lg="24">
|
||||
<el-form-item label="图片" prop="image">
|
||||
<UploadImage v-model="form.image" :data="{ uploadType: 1 }" />
|
||||
<UploadImage v-model="form.image" :data="{ uploadType: 1, filePath: 'device/inspect' }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
@ -114,13 +115,13 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item label="检查类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择检查项类型">
|
||||
<el-option v-for="item in options.typeOptions" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
@ -131,7 +132,7 @@
|
||||
</div>
|
||||
<template #footer v-if="opertype != 3">
|
||||
<el-button text @click="cancel">{{ $t('btn.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm">{{ $t('btn.submit') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-if="active > 0">{{ $t('btn.submit') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -141,6 +142,9 @@
|
||||
import { listDeviceInspect, addDeviceInspect, delDeviceInspect, updateDeviceInspect, getDeviceInspect } from '@/api/deviceManagement/deviceinspect'
|
||||
|
||||
import { default as formconfig } from '@/views/deviceManagement/deviceformconfig/index'
|
||||
|
||||
//const baseUrl = import.meta.env.MES_DEVICE_INSPECT
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
const ids = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user