调整服务指令资源上传位置:统一上传到管理平台所在服务器
This commit is contained in:
parent
279bdc20bc
commit
2f946c4361
|
|
@ -24,15 +24,15 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8091'
|
||||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
||||||
|
|
||||||
# 长者标签-体型标签默认图片
|
# 长者标签-体型标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'https://www.focusnu.com/media/default/bodyDefault.png'
|
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||||
# 长者标签-情绪标签默认图片
|
# 长者标签-情绪标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'https://www.focusnu.com/media/default/emoDefault.png'
|
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||||
# 服务指令-服务指令图片(大)默认图片
|
# 服务指令-服务指令图片(大)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/predefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||||
# 服务指令-服务指令图片(小)默认图片
|
# 服务指令-服务指令图片(小)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/presmalldefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'default/presmalldefault.png'
|
||||||
# 服务指令-即时指令图标默认图片
|
# 服务指令-即时指令图标默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/imdefault.png'
|
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'default/imdefault.png'
|
||||||
|
|
||||||
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
||||||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,15 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8092'
|
||||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
||||||
|
|
||||||
# 长者标签-体型标签默认图片
|
# 长者标签-体型标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'https://www.focusnu.com/media/default/bodyDefault.png'
|
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||||
# 长者标签-情绪标签默认图片
|
# 长者标签-情绪标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'https://www.focusnu.com/media/default/emoDefault.png'
|
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||||
# 服务指令-服务指令图片(大)默认图片
|
# 服务指令-服务指令图片(大)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/predefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||||
# 服务指令-服务指令图片(小)默认图片
|
# 服务指令-服务指令图片(小)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/presmalldefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'default/presmalldefault.png'
|
||||||
# 服务指令-即时指令图标默认图片
|
# 服务指令-即时指令图标默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/imdefault.png'
|
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'default/imdefault.png'
|
||||||
|
|
||||||
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
||||||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,15 @@ VITE_APP_SUB_jeecg-app-1 = '//localhost:8092'
|
||||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
||||||
|
|
||||||
# 长者标签-体型标签默认图片
|
# 长者标签-体型标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'https://www.focusnu.com/media/default/bodyDefault.png'
|
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||||
# 长者标签-情绪标签默认图片
|
# 长者标签-情绪标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'https://www.focusnu.com/media/default/emoDefault.png'
|
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||||
# 服务指令-服务指令图片(大)默认图片
|
# 服务指令-服务指令图片(大)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/predefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||||
# 服务指令-服务指令图片(小)默认图片
|
# 服务指令-服务指令图片(小)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/presmalldefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'default/presmalldefault.png'
|
||||||
# 服务指令-即时指令图标默认图片
|
# 服务指令-即时指令图标默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/imdefault.png'
|
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'default/imdefault.png'
|
||||||
|
|
||||||
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
||||||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
VITE_USE_MOCK = false
|
VITE_USE_MOCK = false
|
||||||
|
|
||||||
# 发布路径
|
# 发布路径
|
||||||
VITE_PUBLIC_PATH = /biz101
|
VITE_PUBLIC_PATH = /biz103
|
||||||
|
|
||||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||||
VITE_PROXY = [["/opeexup","https://www.focusnu.com/opeapi/"]]
|
VITE_PROXY = [["/opeexup","https://www.focusnu.com/opeapi/"]]
|
||||||
|
|
@ -16,10 +16,10 @@ VITE_BUILD_COMPRESS = 'gzip'
|
||||||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
||||||
|
|
||||||
#后台接口父地址(必填)
|
#后台接口父地址(必填)
|
||||||
VITE_GLOB_API_URL=/nursingunit101
|
VITE_GLOB_API_URL=/nursingunit103
|
||||||
|
|
||||||
#后台接口全路径地址(必填)
|
#后台接口全路径地址(必填)
|
||||||
VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursingunit101
|
VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursingunit103
|
||||||
|
|
||||||
# 接口父路径前缀
|
# 接口父路径前缀
|
||||||
VITE_GLOB_API_URL_PREFIX=
|
VITE_GLOB_API_URL_PREFIX=
|
||||||
|
|
@ -28,15 +28,15 @@ VITE_GLOB_API_URL_PREFIX=
|
||||||
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
VITE_OPE_MEDIA_ADDRESS = 'https://www.focusnu.com/media/upFiles/'
|
||||||
|
|
||||||
# 长者标签-体型标签默认图片
|
# 长者标签-体型标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'https://www.focusnu.com/media/default/bodyDefault.png'
|
VITE_DEFAULT_ELDER_TAG_BODY_PIC = 'default/bodyDefault.png'
|
||||||
# 长者标签-情绪标签默认图片
|
# 长者标签-情绪标签默认图片
|
||||||
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'https://www.focusnu.com/media/default/emoDefault.png'
|
VITE_DEFAULT_ELDER_TAG_EMO_PIC = 'default/emoDefault.png'
|
||||||
# 服务指令-服务指令图片(大)默认图片
|
# 服务指令-服务指令图片(大)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'https://www.focusnu.com/media/default/predefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRE_PIC = 'default/predefault.png'
|
||||||
# 服务指令-服务指令图片(小)默认图片
|
# 服务指令-服务指令图片(小)默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'https://www.focusnu.com/media/default/presmalldefault.png'
|
VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC = 'default/presmalldefault.png'
|
||||||
# 服务指令-即时指令图标默认图片
|
# 服务指令-即时指令图标默认图片
|
||||||
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'https://www.focusnu.com/media/default/imdefault.png'
|
VITE_DEFAULT_DIRECTIVE_IM_PIC = 'default/imdefault.png'
|
||||||
|
|
||||||
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
# 填写后将作为乾坤子应用启动,主应用注册时AppName需保持一致(放开 VITE_GLOB_QIANKUN_MICRO_APP_NAME 参数表示jeecg-vue3将以乾坤子应用模式启动)
|
||||||
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
#VITE_GLOB_QIANKUN_MICRO_APP_NAME=jeecg-vue3
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@
|
||||||
<div class="custom-upload-list" v-if="uploadFileList.length > 0">
|
<div class="custom-upload-list" v-if="uploadFileList.length > 0">
|
||||||
<div v-for="(file, index) in uploadFileList" :key="file.uid">
|
<div v-for="(file, index) in uploadFileList" :key="file.uid">
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
<img :src="file.url ? file.url : file.r" style="width: 200px; height: 200px;">
|
<img v-if="!!file?.response?.message" :src="opeMediaAddress + file?.response?.message" style="width: 200px; height: 200px;"></img>
|
||||||
|
<img v-else :src="file.url ? opeMediaAddress + file.url : file.r" style="width: 200px; height: 200px;">
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
{{ file.name }}
|
{{ file.name }}
|
||||||
|
|
@ -117,7 +118,7 @@ export default defineComponent({
|
||||||
const [state] = useRuleFormItem(props, 'value', 'change', emitData);
|
const [state] = useRuleFormItem(props, 'value', 'change', emitData);
|
||||||
const currentUploadUrl = ref(uploadUrl);
|
const currentUploadUrl = ref(uploadUrl);
|
||||||
const extraUploadData = ref<Record<string, any>>({});
|
const extraUploadData = ref<Record<string, any>>({});
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
//获取文件名
|
//获取文件名
|
||||||
const getFileName = (path) => {
|
const getFileName = (path) => {
|
||||||
if (path.lastIndexOf('\\') >= 0) {
|
if (path.lastIndexOf('\\') >= 0) {
|
||||||
|
|
@ -360,6 +361,7 @@ export default defineComponent({
|
||||||
removeFile,
|
removeFile,
|
||||||
currentUploadUrl,
|
currentUploadUrl,
|
||||||
extraUploadData,
|
extraUploadData,
|
||||||
|
opeMediaAddress,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,8 @@
|
||||||
<div class="custom-upload-list" v-if="fileList.length > 0">
|
<div class="custom-upload-list" v-if="fileList.length > 0">
|
||||||
<div v-for="(file, index) in fileList" :key="file.uid">
|
<div v-for="(file, index) in fileList" :key="file.uid">
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
<audio ref="audioPlayer" controls :src="file.url"></audio>
|
<audio ref="audioPlayer" controls v-if="!!file?.response?.message" :src="opeMediaAddress + file?.response?.message" ></audio>
|
||||||
|
<audio ref="audioPlayer" controls v-else :src="file.url ? opeMediaAddress + file.url : file.r" ></audio>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
{{ file.name }}
|
{{ file.name }}
|
||||||
|
|
@ -63,6 +64,7 @@ import UploadItemActions from './components/UploadItemActions.vue';
|
||||||
import { InboxOutlined } from '@ant-design/icons-vue';
|
import { InboxOutlined } from '@ant-design/icons-vue';
|
||||||
import { Upload } from 'ant-design-vue';
|
import { Upload } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
const { createMessage, createConfirm } = useMessage();
|
const { createMessage, createConfirm } = useMessage();
|
||||||
const { prefixCls } = useDesign('j-upload');
|
const { prefixCls } = useDesign('j-upload');
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
|
|
@ -135,7 +137,7 @@ const bindProps = computed(() => {
|
||||||
bind.name = 'file';
|
bind.name = 'file';
|
||||||
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
||||||
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
||||||
bind.data = { biz: props.bizPath, ...bind.data };
|
bind.data = { biz: props.bizPath, ...bind.data, ...extraUploadData.value };
|
||||||
//update-begin-author:taoyan date:20220407 for: 自定义beforeUpload return false,并不能中断上传过程
|
//update-begin-author:taoyan date:20220407 for: 自定义beforeUpload return false,并不能中断上传过程
|
||||||
if (!bind.beforeUpload) {
|
if (!bind.beforeUpload) {
|
||||||
bind.beforeUpload = onBeforeUpload;
|
bind.beforeUpload = onBeforeUpload;
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div ref="containerRef" :class="`${prefixCls}-container`">
|
<div ref="containerRef" :class="`${prefixCls}-container`">
|
||||||
<a-upload-dragger
|
<a-upload-dragger accept="video/mp4" :headers="headers" :multiple="multiple" :action="currentUploadUrl"
|
||||||
accept="video/mp4"
|
:data="{ biz: bizPath, ...extraUploadData }" :fileList="fileList" :disabled="disabled" v-bind="bindProps"
|
||||||
:headers="headers"
|
:beforeUpload="beforeUpload" :showUploadList="false" @remove="onRemove" @change="onFileChange"
|
||||||
:multiple="multiple"
|
@preview="onFilePreview">
|
||||||
:action="uploadUrl"
|
|
||||||
:fileList="fileList"
|
|
||||||
:disabled="disabled"
|
|
||||||
v-bind="bindProps"
|
|
||||||
:beforeUpload="beforeUpload"
|
|
||||||
:showUploadList="false"
|
|
||||||
@remove="onRemove"
|
|
||||||
@change="onFileChange"
|
|
||||||
@preview="onFilePreview"
|
|
||||||
>
|
|
||||||
<template v-if="isImageMode">
|
<template v-if="isImageMode">
|
||||||
<div v-if="!isMaxCount">
|
<div v-if="!isMaxCount">
|
||||||
<Icon icon="ant-design:plus-outlined" />
|
<Icon icon="ant-design:plus-outlined" />
|
||||||
|
|
@ -45,7 +35,8 @@
|
||||||
<div v-for="(file, index) in fileList" :key="file.uid">
|
<div v-for="(file, index) in fileList" :key="file.uid">
|
||||||
<div style="margin-top: 20px;">
|
<div style="margin-top: 20px;">
|
||||||
<video controls style="max-width: 100%; max-height: 300px;">
|
<video controls style="max-width: 100%; max-height: 300px;">
|
||||||
<source :src="transUrl(file.url)" type="video/mp4">
|
<source v-if="!!file?.response?.message" :src="opeMediaAddress + file?.response?.message" type="video/mp4">
|
||||||
|
<source v-else :src="opeMediaAddress + file.url" type="video/mp4">
|
||||||
您的浏览器不支持视频播放
|
您的浏览器不支持视频播放
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -64,7 +55,7 @@
|
||||||
import { ref, reactive, computed, watch, nextTick, createApp, unref } from 'vue';
|
import { ref, reactive, computed, watch, nextTick, createApp, unref } from 'vue';
|
||||||
import { Icon } from '/@/components/Icon';
|
import { Icon } from '/@/components/Icon';
|
||||||
import { getToken } from '/@/utils/auth';
|
import { getToken } from '/@/utils/auth';
|
||||||
import { uploadUrl } from '/@/api/common/api';
|
import { uploadUrl, uploadPre } from '/@/api/common/api';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { createImgPreview } from '/@/components/Preview/index';
|
import { createImgPreview } from '/@/components/Preview/index';
|
||||||
|
|
@ -74,7 +65,9 @@
|
||||||
import { getFileAccessHttpUrl, getHeaders } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl, getHeaders } from '/@/utils/common/compUtils';
|
||||||
import UploadItemActions from './components/UploadItemActions.vue';
|
import UploadItemActions from './components/UploadItemActions.vue';
|
||||||
import { InboxOutlined } from '@ant-design/icons-vue';
|
import { InboxOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { Upload } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
const { createMessage, createConfirm } = useMessage();
|
const { createMessage, createConfirm } = useMessage();
|
||||||
const { prefixCls } = useDesign('j-upload');
|
const { prefixCls } = useDesign('j-upload');
|
||||||
const attrs = useAttrs();
|
const attrs = useAttrs();
|
||||||
|
|
@ -105,11 +98,19 @@
|
||||||
disabled: propTypes.bool.def(false),
|
disabled: propTypes.bool.def(false),
|
||||||
// 替换前一个文件,用于超出最大数量依然允许上传
|
// 替换前一个文件,用于超出最大数量依然允许上传
|
||||||
replaceLastOne: propTypes.bool.def(false),
|
replaceLastOne: propTypes.bool.def(false),
|
||||||
|
// 是否上传至管理平台
|
||||||
|
toOpe: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const headers = getHeaders();
|
const headers = getHeaders();
|
||||||
const fileList = ref<any[]>([]);
|
const fileList = ref<any[]>([]);
|
||||||
const uploadGoOn = ref<boolean>(true);
|
const uploadGoOn = ref<boolean>(true);
|
||||||
|
const currentUploadUrl = ref(uploadUrl);
|
||||||
|
const extraUploadData = ref<Record<string, any>>({});
|
||||||
// refs
|
// refs
|
||||||
const containerRef = ref();
|
const containerRef = ref();
|
||||||
// 是否达到了最大上传数量
|
// 是否达到了最大上传数量
|
||||||
|
|
@ -139,7 +140,7 @@
|
||||||
bind.name = 'file';
|
bind.name = 'file';
|
||||||
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
bind.listType = isImageMode.value ? 'picture-card' : 'text';
|
||||||
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
|
||||||
bind.data = { biz: props.bizPath, ...bind.data };
|
bind.data = { biz: props.bizPath, ...bind.data, ...extraUploadData.value };
|
||||||
//update-begin-author:taoyan date:20220407 for: 自定义beforeUpload return false,并不能中断上传过程
|
//update-begin-author:taoyan date:20220407 for: 自定义beforeUpload return false,并不能中断上传过程
|
||||||
if (!bind.beforeUpload) {
|
if (!bind.beforeUpload) {
|
||||||
bind.beforeUpload = onBeforeUpload;
|
bind.beforeUpload = onBeforeUpload;
|
||||||
|
|
@ -201,7 +202,7 @@
|
||||||
/**
|
/**
|
||||||
* 上传前校验
|
* 上传前校验
|
||||||
*/
|
*/
|
||||||
function beforeUpload(file) {
|
async function beforeUpload(file) {
|
||||||
let fileType = file.type;
|
let fileType = file.type;
|
||||||
console.log("🚀 ~ beforeUpload ~ fileType:", fileType)
|
console.log("🚀 ~ beforeUpload ~ fileType:", fileType)
|
||||||
if (fileType.indexOf('video') < 0) {
|
if (fileType.indexOf('video') < 0) {
|
||||||
|
|
@ -209,6 +210,23 @@
|
||||||
fileList.value = [];
|
fileList.value = [];
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (props.toOpe) {
|
||||||
|
let res = await uploadPre({ fileName: file.name, fileSize: file.size });
|
||||||
|
if (res.result == 500) {
|
||||||
|
createMessage.info('服务暂时不可用,请稍后重试');
|
||||||
|
return Upload.LIST_IGNORE;
|
||||||
|
} else {
|
||||||
|
// 切换上传地址和参数
|
||||||
|
currentUploadUrl.value = '/opeexup/sys/common/static/upload/export';
|
||||||
|
extraUploadData.value = { biz: props.bizPath, name: res.result, size: file.size };
|
||||||
|
console.log("🌊 ~ beforeUpload ~ extraUploadData.value:", extraUploadData.value)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 恢复默认
|
||||||
|
currentUploadUrl.value = uploadUrl;
|
||||||
|
extraUploadData.value = { biz: props.bizPath };
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
// 添加可左右移动的按钮
|
// 添加可左右移动的按钮
|
||||||
function onAddActionsButton(event) {
|
function onAddActionsButton(event) {
|
||||||
|
|
@ -481,11 +499,14 @@ function transUrl(record) {
|
||||||
.upload-download-handler {
|
.upload-download-handler {
|
||||||
right: 6px !important;
|
right: 6px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update-end-author:taoyan date:2022-5-24 for:VUEN-1093详情界面 图片下载按钮显示不全*/
|
/* update-end-author:taoyan date:2022-5-24 for:VUEN-1093详情界面 图片下载按钮显示不全*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-upload-text-icon {
|
.ant-upload-text-icon {
|
||||||
color: @primary-color;
|
color: @primary-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-upload-list-item {
|
.ant-upload-list-item {
|
||||||
.upload-actions-container {
|
.upload-actions-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
@ -533,22 +554,28 @@ function transUrl(record) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-upload-wrapper .ant-upload-drag .ant-upload {
|
.ant-upload-wrapper .ant-upload-drag .ant-upload {
|
||||||
padding: 0px !important;
|
padding: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-upload-drag {
|
.ant-upload-drag {
|
||||||
border: 0px !important;
|
border: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-text {
|
.upload-text {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: rgba(74, 69, 69, 0.85);
|
color: rgba(74, 69, 69, 0.85);
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.upload-icon {
|
.upload-icon {
|
||||||
margin: 16px;
|
margin: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divider {
|
.divider {
|
||||||
font-size:12px;color:rgb(189, 189, 189);
|
font-size: 12px;
|
||||||
|
color: rgb(189, 189, 189);
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.ant-upload-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item) {
|
:deep(.ant-upload-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item) {
|
||||||
|
|
@ -563,6 +590,7 @@ function transUrl(record) {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.ant-upload-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item .ant-upload-list-item-thumbnail) {
|
:deep(.ant-upload-wrapper .ant-upload-list.ant-upload-list-picture-card .ant-upload-list-item .ant-upload-list-item-thumbnail) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
@ -573,6 +601,7 @@ function transUrl(record) {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
flex: none;
|
flex: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.ant-upload-wrapper .ant-upload-list .ant-upload-list-item .ant-upload-list-item-name) {
|
:deep(.ant-upload-wrapper .ant-upload-list .ant-upload-list-item .ant-upload-list-item-name) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
@ -589,5 +618,4 @@ function transUrl(record) {
|
||||||
background: #f1f7ff;
|
background: #f1f7ff;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { BasicColumn } from '/@/components/Table';
|
import { BasicColumn } from '/@/components/Table';
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS;
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -119,7 +120,7 @@ export const columns: BasicColumn[] = [
|
||||||
dataIndex: 'previewFile',
|
dataIndex: 'previewFile',
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
// 如果 text 为空或 null/undefined,使用默认图片
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
const imageUrl = text ? text : import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
|
const imageUrl = text ? opeMediaAddress + text : import.meta.env.VITE_DEFAULT_DIRECTIVE_PRE_PIC;
|
||||||
return render.renderImage({ text: imageUrl });
|
return render.renderImage({ text: imageUrl });
|
||||||
},
|
},
|
||||||
// customRender: render.renderImage,
|
// customRender: render.renderImage,
|
||||||
|
|
@ -130,7 +131,7 @@ export const columns: BasicColumn[] = [
|
||||||
dataIndex: 'previewFileSmall',
|
dataIndex: 'previewFileSmall',
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
// 如果 text 为空或 null/undefined,使用默认图片
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
const imageUrl = text ? text : import.meta.env.VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC;
|
const imageUrl = text ? opeMediaAddress + text : import.meta.env.VITE_DEFAULT_DIRECTIVE_PRESMALL_PIC;
|
||||||
return render.renderImage({ text: imageUrl });
|
return render.renderImage({ text: imageUrl });
|
||||||
},
|
},
|
||||||
// customRender: render.renderImage,
|
// customRender: render.renderImage,
|
||||||
|
|
@ -159,7 +160,7 @@ export const columns: BasicColumn[] = [
|
||||||
dataIndex: 'immediateFile',
|
dataIndex: 'immediateFile',
|
||||||
customRender: ({ text }) => {
|
customRender: ({ text }) => {
|
||||||
// 如果 text 为空或 null/undefined,使用默认图片
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
const imageUrl = text ? text : import.meta.env.VITE_DEFAULT_DIRECTIVE_IM_PIC;
|
const imageUrl = text ? opeMediaAddress + text : import.meta.env.VITE_DEFAULT_DIRECTIVE_IM_PIC;
|
||||||
return render.renderImage({ text: imageUrl });
|
return render.renderImage({ text: imageUrl });
|
||||||
},
|
},
|
||||||
// customRender: render.renderImage,
|
// customRender: render.renderImage,
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,8 @@
|
||||||
</template>
|
</template>
|
||||||
</a-tree> -->
|
</a-tree> -->
|
||||||
</div>
|
</div>
|
||||||
<div style="width:calc(100% - 370px);float: left; background-color: white;border-radius: 8px;" class="container-height">
|
<div style="width:calc(100% - 370px);float: left; background-color: white;border-radius: 8px;"
|
||||||
|
class="container-height">
|
||||||
<!--引用表格-->
|
<!--引用表格-->
|
||||||
<BasicTable @register="registerTable">
|
<BasicTable @register="registerTable">
|
||||||
<!--插槽:table标题-->
|
<!--插槽:table标题-->
|
||||||
|
|
@ -531,6 +532,7 @@ import CanAddDirectiveList from '/@/views/services/canadddirective/CanAddDirecti
|
||||||
|
|
||||||
|
|
||||||
const { createMessage, createConfirm } = useMessage();
|
const { createMessage, createConfirm } = useMessage();
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
const canAddDirectiveRef = ref()
|
const canAddDirectiveRef = ref()
|
||||||
const existDirectiveIds = ref([])//指令库已存在指令id
|
const existDirectiveIds = ref([])//指令库已存在指令id
|
||||||
const insRegisterModal = ref();
|
const insRegisterModal = ref();
|
||||||
|
|
@ -888,7 +890,7 @@ const audioPlayer = ref(null);
|
||||||
|
|
||||||
// 打开音频模态框
|
// 打开音频模态框
|
||||||
const openAudioModal = (url) => {
|
const openAudioModal = (url) => {
|
||||||
audioUrl.value = getFileAccessHttpUrl(url);
|
audioUrl.value = opeMediaAddress + url;
|
||||||
showAudioModal.value = true;
|
showAudioModal.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -908,7 +910,7 @@ const videoPlayer = ref(null);
|
||||||
|
|
||||||
// 打开视频模态框
|
// 打开视频模态框
|
||||||
const openVideoModal = (url) => {
|
const openVideoModal = (url) => {
|
||||||
videoUrl.value = getFileAccessHttpUrl(url);
|
videoUrl.value = opeMediaAddress + url;
|
||||||
showVideoModal.value = true;
|
showVideoModal.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue