Merge branch 'master' of http://47.115.223.229:8888/yangjun/nursing_unit_vue
This commit is contained in:
commit
0dbac564c9
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,366 @@
|
||||||
|
<template>
|
||||||
|
<div class="clearfix">
|
||||||
|
<a-upload :listType="listType" accept="image/*" :multiple="multiple" :action="currentUploadUrl"
|
||||||
|
:data="{ biz: bizPath, ...extraUploadData }" :headers="headers" v-model:fileList="uploadFileList"
|
||||||
|
:beforeUpload="beforeUpload" :disabled="disabled" @change="handleChange" @preview="handlePreview">
|
||||||
|
<div v-if="uploadVisible">
|
||||||
|
<div v-if="listType == 'picture-card'">
|
||||||
|
<LoadingOutlined v-if="loading" />
|
||||||
|
<UploadOutlined v-else />
|
||||||
|
<div class="ant-upload-text">{{ text }}</div>
|
||||||
|
</div>
|
||||||
|
<a-button v-if="listType == 'picture'" :disabled="disabled">
|
||||||
|
<UploadOutlined></UploadOutlined>
|
||||||
|
{{ text }}
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
|
</a-upload>
|
||||||
|
<!-- <img alt="example" style="width: 100%" :src="previewImage" /> -->
|
||||||
|
<!-- <a-modal :open="previewVisible" width="70%" class="imgView" :footer="null" @cancel="handleCancel()">
|
||||||
|
<div class="img-container">
|
||||||
|
<img
|
||||||
|
alt="example"
|
||||||
|
class="preview-img"
|
||||||
|
:src="previewImage"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</a-modal> -->
|
||||||
|
|
||||||
|
<a-modal :open="previewVisible" :width="modalWidth"
|
||||||
|
:bodyStyle="{ padding: 0, display: 'flex', justifyContent: 'center', alignItems: 'center' }" :footer="null"
|
||||||
|
@cancel="handleCancel">
|
||||||
|
<img ref="previewImgRef" class="preview-img" :src="opeMediaAddress + previewImage" @load="handleImageLoad" />
|
||||||
|
</a-modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { defineComponent, PropType, ref, reactive, watchEffect, computed, unref, watch, onMounted, nextTick } from 'vue';
|
||||||
|
import { LoadingOutlined, UploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
|
||||||
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { getFileAccessHttpUrl, getHeaders, getRandom } from '/@/utils/common/compUtils';
|
||||||
|
import { uploadUrl, uploadPre } from '/@/api/common/api';
|
||||||
|
import { getToken } from '/@/utils/auth';
|
||||||
|
import { Upload } from 'ant-design-vue';
|
||||||
|
|
||||||
|
const { createMessage, createErrorModal } = useMessage();
|
||||||
|
export default defineComponent({
|
||||||
|
name: 'JImageUpload',
|
||||||
|
components: { LoadingOutlined, UploadOutlined },
|
||||||
|
inheritAttrs: false,
|
||||||
|
props: {
|
||||||
|
//绑定值
|
||||||
|
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
||||||
|
//按钮文本
|
||||||
|
listType: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'picture-card',
|
||||||
|
},
|
||||||
|
//按钮文本
|
||||||
|
text: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: '上传',
|
||||||
|
},
|
||||||
|
//这个属性用于控制文件上传的业务路径
|
||||||
|
bizPath: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'temp',
|
||||||
|
},
|
||||||
|
//是否禁用
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
//上传数量
|
||||||
|
fileMax: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 1,
|
||||||
|
},
|
||||||
|
// 是否上传至管理平台
|
||||||
|
toOpe: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
emits: ['options-change', 'change', 'update:value'],
|
||||||
|
setup(props, { emit, refs }) {
|
||||||
|
const emitData = ref<any[]>([]);
|
||||||
|
const attrs = useAttrs();
|
||||||
|
const [state] = useRuleFormItem(props, 'value', 'change', emitData);
|
||||||
|
//获取文件名
|
||||||
|
const getFileName = (path) => {
|
||||||
|
if (path.lastIndexOf('\\') >= 0) {
|
||||||
|
let reg = new RegExp('\\\\', 'g');
|
||||||
|
path = path.replace(reg, '/');
|
||||||
|
}
|
||||||
|
return path.substring(path.lastIndexOf('/') + 1);
|
||||||
|
};
|
||||||
|
//token
|
||||||
|
const headers = getHeaders();
|
||||||
|
//上传状态
|
||||||
|
const loading = ref<boolean>(false);
|
||||||
|
//是否是初始化加载
|
||||||
|
const initTag = ref<boolean>(true);
|
||||||
|
//文件列表
|
||||||
|
let uploadFileList = ref<any[]>([]);
|
||||||
|
//预览图
|
||||||
|
const previewImage = ref<string | undefined>('');
|
||||||
|
//预览框状态
|
||||||
|
const previewVisible = ref<boolean>(false);
|
||||||
|
|
||||||
|
|
||||||
|
//计算是否开启多图上传
|
||||||
|
const multiple = computed(() => {
|
||||||
|
return props['fileMax'] > 1 || props['fileMax'] === 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
//计算是否可以继续上传
|
||||||
|
const uploadVisible = computed(() => {
|
||||||
|
if (props['fileMax'] === 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return uploadFileList.value.length < props['fileMax'];
|
||||||
|
});
|
||||||
|
const currentUploadUrl = ref(uploadUrl);
|
||||||
|
const extraUploadData = ref<Record<string, any>>({});
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
|
/**
|
||||||
|
* 监听value变化
|
||||||
|
*/
|
||||||
|
watch(
|
||||||
|
() => props.value,
|
||||||
|
(val, prevCount) => {
|
||||||
|
//update-begin---author:liusq ---date:20230601 for:【issues/556】JImageUpload组件value赋初始值没显示图片------------
|
||||||
|
if (val && val instanceof Array) {
|
||||||
|
val = val.join(',');
|
||||||
|
}
|
||||||
|
if (initTag.value == true) {
|
||||||
|
initFileList(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
//update-end---author:liusq ---date:20230601 for:【issues/556】JImageUpload组件value赋初始值没显示图片------------
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化文件列表
|
||||||
|
*/
|
||||||
|
function initFileList(paths) {
|
||||||
|
if (!paths || paths.length == 0) {
|
||||||
|
uploadFileList.value = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let files = [];
|
||||||
|
let arr = paths.split(',');
|
||||||
|
arr.forEach((value) => {
|
||||||
|
let url = getFileAccessHttpUrl(value);
|
||||||
|
files.push({
|
||||||
|
uid: getRandom(10),
|
||||||
|
name: getFileName(value),
|
||||||
|
status: 'done',
|
||||||
|
url: url,
|
||||||
|
response: {
|
||||||
|
status: 'history',
|
||||||
|
message: value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
uploadFileList.value = files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传前校验
|
||||||
|
*/
|
||||||
|
async function beforeUpload(file) {
|
||||||
|
let fileType = file.type;
|
||||||
|
if (fileType.indexOf('image') < 0) {
|
||||||
|
createMessage.info('请上传图片');
|
||||||
|
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 = { name: res.result, size: file.size };
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 恢复默认
|
||||||
|
currentUploadUrl.value = uploadUrl;
|
||||||
|
extraUploadData.value = {};
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 文件上传结果回调
|
||||||
|
*/
|
||||||
|
function handleChange({ file, fileList, event }) {
|
||||||
|
initTag.value = false;
|
||||||
|
// update-begin--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
||||||
|
// uploadFileList.value = fileList;
|
||||||
|
if (file.status === 'error') {
|
||||||
|
createMessage.error(`${file.name} 上传失败.`);
|
||||||
|
}
|
||||||
|
// update-begin--author:liaozhiyang---date:20240704---for:【TV360X-1640】上传图片大小超出限制显示优化
|
||||||
|
if (file.status === 'done' && file.response.success === false) {
|
||||||
|
const failIndex = uploadFileList.value.findIndex((item) => item.uid === file.uid);
|
||||||
|
if (failIndex != -1) {
|
||||||
|
uploadFileList.value.splice(failIndex, 1);
|
||||||
|
}
|
||||||
|
createMessage.warning(file.response.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20240704---for:【TV360X-1640】上传图片大小超出限制显示优化
|
||||||
|
let fileUrls = [];
|
||||||
|
let noUploadingFileCount = 0;
|
||||||
|
if (file.status != 'uploading') {
|
||||||
|
fileList.forEach((file) => {
|
||||||
|
if (file.status === 'done') {
|
||||||
|
fileUrls.push(file.response.message);
|
||||||
|
}
|
||||||
|
if (file.status != 'uploading') {
|
||||||
|
noUploadingFileCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (file.status === 'removed') {
|
||||||
|
handleDelete(file);
|
||||||
|
}
|
||||||
|
if (noUploadingFileCount == fileList.length) {
|
||||||
|
state.value = fileUrls.join(',');
|
||||||
|
emit('update:value', fileUrls.join(','));
|
||||||
|
// update-begin---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||||
|
nextTick(() => {
|
||||||
|
initTag.value = true;
|
||||||
|
});
|
||||||
|
// update-end---author:wangshuai ---date:20221121 for:[issues/248]原生表单内使用图片组件,关闭弹窗图片组件值不会被清空------------
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// update-end--author:liaozhiyang---date:20231116---for:【issues/846】上传多个列表只显示一个
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除图片
|
||||||
|
*/
|
||||||
|
function handleDelete(file) {
|
||||||
|
//如有需要新增 删除逻辑
|
||||||
|
console.log(file);
|
||||||
|
}
|
||||||
|
const previewImgRef = ref<HTMLImageElement | null>(null);
|
||||||
|
const modalWidth = ref('auto');
|
||||||
|
/**
|
||||||
|
* 预览图片
|
||||||
|
*/
|
||||||
|
async function handlePreview(file) {
|
||||||
|
if (!file.url && !file.preview) {
|
||||||
|
file.preview = (await getBase64(file.originFileObj)) as string;
|
||||||
|
}
|
||||||
|
previewImage.value = file.url || file.preview;
|
||||||
|
previewVisible.value = true;
|
||||||
|
}
|
||||||
|
function getBase64(file: File) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
reader.onload = () => resolve(reader.result);
|
||||||
|
reader.onerror = error => reject(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAvatarView() {
|
||||||
|
if (uploadFileList.length > 0) {
|
||||||
|
let url = uploadFileList[0].url;
|
||||||
|
return getFileAccessHttpUrl(url, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleCancel() {
|
||||||
|
previewVisible.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 图片加载完成后计算宽高
|
||||||
|
const handleImageLoad = () => {
|
||||||
|
if (!previewImgRef.value) return;
|
||||||
|
|
||||||
|
const img = previewImgRef.value;
|
||||||
|
const maxWidth = window.innerWidth * 0.9; // 最大宽度为屏幕90%
|
||||||
|
const maxHeight = window.innerHeight * 0.8; // 最大高度为屏幕80%
|
||||||
|
|
||||||
|
// 计算适应比例
|
||||||
|
const ratio = Math.min(maxWidth / img.naturalWidth, maxHeight / img.naturalHeight, 1);
|
||||||
|
modalWidth.value = `${img.naturalWidth * ratio}px`;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
state,
|
||||||
|
attrs,
|
||||||
|
previewImage,
|
||||||
|
previewVisible,
|
||||||
|
uploadFileList,
|
||||||
|
multiple,
|
||||||
|
headers,
|
||||||
|
loading,
|
||||||
|
uploadUrl,
|
||||||
|
beforeUpload,
|
||||||
|
uploadVisible,
|
||||||
|
handlePreview,
|
||||||
|
handleCancel,
|
||||||
|
handleChange,
|
||||||
|
handleImageLoad,
|
||||||
|
previewImgRef,
|
||||||
|
modalWidth,
|
||||||
|
currentUploadUrl,
|
||||||
|
extraUploadData,
|
||||||
|
opeMediaAddress,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.ant-upload-select-picture-card i {
|
||||||
|
font-size: 32px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-upload-select-picture-card .ant-upload-text {
|
||||||
|
margin-top: 8px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 确保 Modal 内容区域填满 */
|
||||||
|
.imgView .ant-modal-body {
|
||||||
|
height: 80vh;
|
||||||
|
/* 限制模态框高度,避免超出屏幕 */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 图片容器 */
|
||||||
|
.img-container {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 图片自适应 */
|
||||||
|
.preview-img {
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
object-fit: contain;
|
||||||
|
/* 保持比例,不拉伸 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -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" />
|
||||||
|
|
@ -42,10 +32,11 @@
|
||||||
</a-upload-dragger>
|
</a-upload-dragger>
|
||||||
<!-- 文件回显 -->
|
<!-- 文件回显 -->
|
||||||
<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;">
|
||||||
<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>
|
||||||
|
|
@ -61,25 +52,27 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
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';
|
||||||
import { useAttrs } from '/@/hooks/core/useAttrs';
|
import { useAttrs } from '/@/hooks/core/useAttrs';
|
||||||
import { useDesign } from '/@/hooks/web/useDesign';
|
import { useDesign } from '/@/hooks/web/useDesign';
|
||||||
import { UploadTypeEnum } from './upload.data';
|
import { UploadTypeEnum } from './upload.data';
|
||||||
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 { createMessage, createConfirm } = useMessage();
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
const { prefixCls } = useDesign('j-upload');
|
const { createMessage, createConfirm } = useMessage();
|
||||||
const attrs = useAttrs();
|
const { prefixCls } = useDesign('j-upload');
|
||||||
const emit = defineEmits(['change', 'update:value']);
|
const attrs = useAttrs();
|
||||||
const props = defineProps({
|
const emit = defineEmits(['change', 'update:value']);
|
||||||
|
const props = defineProps({
|
||||||
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
value: propTypes.oneOfType([propTypes.string, propTypes.array]),
|
||||||
text: propTypes.string.def('上传'),
|
text: propTypes.string.def('上传'),
|
||||||
fileType: propTypes.string.def(UploadTypeEnum.all),
|
fileType: propTypes.string.def(UploadTypeEnum.all),
|
||||||
|
|
@ -105,33 +98,41 @@
|
||||||
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);
|
||||||
// refs
|
const currentUploadUrl = ref(uploadUrl);
|
||||||
const containerRef = ref();
|
const extraUploadData = ref<Record<string, any>>({});
|
||||||
// 是否达到了最大上传数量
|
// refs
|
||||||
const isMaxCount = computed(() => props.maxCount > 0 && fileList.value.length >= props.maxCount);
|
const containerRef = ref();
|
||||||
// 当前是否是上传图片模式
|
// 是否达到了最大上传数量
|
||||||
const isImageMode = computed(() => props.fileType === UploadTypeEnum.image);
|
const isMaxCount = computed(() => props.maxCount > 0 && fileList.value.length >= props.maxCount);
|
||||||
// 上传按钮是否禁用
|
// 当前是否是上传图片模式
|
||||||
const buttonDisabled = computed(()=>{
|
const isImageMode = computed(() => props.fileType === UploadTypeEnum.image);
|
||||||
if(props.disabled === true){
|
// 上传按钮是否禁用
|
||||||
|
const buttonDisabled = computed(() => {
|
||||||
|
if (props.disabled === true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(isMaxCount.value === true){
|
if (isMaxCount.value === true) {
|
||||||
if(props.replaceLastOne === true){
|
if (props.replaceLastOne === true) {
|
||||||
return false
|
return false
|
||||||
}else{
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
});
|
});
|
||||||
// 合并 props 和 attrs
|
// 合并 props 和 attrs
|
||||||
const bindProps = computed(() => {
|
const bindProps = computed(() => {
|
||||||
//update-begin-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
//update-begin-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
||||||
const bind: any = Object.assign({}, props, unref(attrs));
|
const bind: any = Object.assign({}, props, unref(attrs));
|
||||||
//update-end-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
//update-end-author:liusq date:20220411 for: [issue/455]上传组件传入accept限制上传文件类型无效
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -150,12 +151,12 @@
|
||||||
bind.accept = 'image/*';
|
bind.accept = 'image/*';
|
||||||
}
|
}
|
||||||
return bind;
|
return bind;
|
||||||
});
|
});
|
||||||
function removeFile(index) {
|
function removeFile(index) {
|
||||||
fileList.value.splice(index, 1);
|
fileList.value.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.value,
|
() => props.value,
|
||||||
(val) => {
|
(val) => {
|
||||||
if (Array.isArray(val)) {
|
if (Array.isArray(val)) {
|
||||||
|
|
@ -175,14 +176,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(fileList, () => nextTick(() => addActionsListener()), { immediate: true });
|
watch(fileList, () => nextTick(() => addActionsListener()), { immediate: true });
|
||||||
|
|
||||||
const antUploadItemCls = 'ant-upload-list-item';
|
const antUploadItemCls = 'ant-upload-list-item';
|
||||||
|
|
||||||
// Listener
|
// Listener
|
||||||
function addActionsListener() {
|
function addActionsListener() {
|
||||||
if (!isImageMode.value) {
|
if (!isImageMode.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -196,12 +197,12 @@
|
||||||
uploadItem.addEventListener('mouseover', onAddActionsButton);
|
uploadItem.addEventListener('mouseover', onAddActionsButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传前校验
|
* 上传前校验
|
||||||
*/
|
*/
|
||||||
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,9 +210,26 @@
|
||||||
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 {
|
||||||
function onAddActionsButton(event) {
|
// 恢复默认
|
||||||
|
currentUploadUrl.value = uploadUrl;
|
||||||
|
extraUploadData.value = { biz: props.bizPath };
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// 添加可左右移动的按钮
|
||||||
|
function onAddActionsButton(event) {
|
||||||
const getUploadItem = () => {
|
const getUploadItem = () => {
|
||||||
for (const path of event.path) {
|
for (const path of event.path) {
|
||||||
if (path.classList.contains(antUploadItemCls)) {
|
if (path.classList.contains(antUploadItemCls)) {
|
||||||
|
|
@ -243,10 +261,10 @@
|
||||||
actions[0].appendChild(div);
|
actions[0].appendChild(div);
|
||||||
uploadItem.setAttribute('data-has-actions', 'true');
|
uploadItem.setAttribute('data-has-actions', 'true');
|
||||||
uploadItem.removeEventListener('mouseover', onAddActionsButton);
|
uploadItem.removeEventListener('mouseover', onAddActionsButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解析数据库存储的逗号分割
|
// 解析数据库存储的逗号分割
|
||||||
function parsePathsValue(paths) {
|
function parsePathsValue(paths) {
|
||||||
if (!paths || paths.length == 0) {
|
if (!paths || paths.length == 0) {
|
||||||
fileList.value = [];
|
fileList.value = [];
|
||||||
return;
|
return;
|
||||||
|
|
@ -263,7 +281,7 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
fileList.value = list;
|
fileList.value = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
function transUrl(record) {
|
function transUrl(record) {
|
||||||
console.log("🚀 ~ transUrl ~ record:", record)
|
console.log("🚀 ~ transUrl ~ record:", record)
|
||||||
|
|
@ -273,8 +291,8 @@ function transUrl(record) {
|
||||||
return record
|
return record
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 解析数组值
|
// 解析数组值
|
||||||
function parseArrayValue(array) {
|
function parseArrayValue(array) {
|
||||||
if (!array || array.length == 0) {
|
if (!array || array.length == 0) {
|
||||||
fileList.value = [];
|
fileList.value = [];
|
||||||
return;
|
return;
|
||||||
|
|
@ -291,10 +309,10 @@ function transUrl(record) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
fileList.value = list;
|
fileList.value = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 文件上传之前的操作
|
// 文件上传之前的操作
|
||||||
function onBeforeUpload(file) {
|
function onBeforeUpload(file) {
|
||||||
uploadGoOn.value = true;
|
uploadGoOn.value = true;
|
||||||
if (isImageMode.value) {
|
if (isImageMode.value) {
|
||||||
if (file.type.indexOf('image') < 0) {
|
if (file.type.indexOf('image') < 0) {
|
||||||
|
|
@ -308,10 +326,10 @@ function transUrl(record) {
|
||||||
return props.beforeUpload(file);
|
return props.beforeUpload(file);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除处理事件
|
// 删除处理事件
|
||||||
function onRemove() {
|
function onRemove() {
|
||||||
if (props.removeConfirm) {
|
if (props.removeConfirm) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
createConfirm({
|
createConfirm({
|
||||||
|
|
@ -324,10 +342,10 @@ function transUrl(record) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// upload组件change事件
|
// upload组件change事件
|
||||||
function onFileChange(info) {
|
function onFileChange(info) {
|
||||||
var file = info.file;
|
var file = info.file;
|
||||||
let fileType = file.type;
|
let fileType = file.type;
|
||||||
if (fileType.indexOf('video') < 0) {
|
if (fileType.indexOf('video') < 0) {
|
||||||
|
|
@ -360,9 +378,9 @@ function transUrl(record) {
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
successFileList = fileListTemp.filter(item=>{
|
successFileList = fileListTemp.filter(item => {
|
||||||
return item.uid!=info.file.uid;
|
return item.uid != info.file.uid;
|
||||||
});
|
});
|
||||||
createMessage.error(`${info.file.name} 上传失败.`);
|
createMessage.error(`${info.file.name} 上传失败.`);
|
||||||
}
|
}
|
||||||
|
|
@ -389,7 +407,7 @@ function transUrl(record) {
|
||||||
fileSize: item.size,
|
fileSize: item.size,
|
||||||
};
|
};
|
||||||
newFileList.push(fileJson);
|
newFileList.push(fileJson);
|
||||||
}else{
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -398,9 +416,9 @@ function transUrl(record) {
|
||||||
//update-end---author:liusq ---date:20230914 for:[issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
//update-end---author:liusq ---date:20230914 for:[issues/5327]Upload组件returnUrl为false时上传的字段值返回了一个'[object Object]' ------------
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handlePathChange() {
|
function handlePathChange() {
|
||||||
let uploadFiles = fileList.value;
|
let uploadFiles = fileList.value;
|
||||||
let path = '';
|
let path = '';
|
||||||
if (!uploadFiles || uploadFiles.length == 0) {
|
if (!uploadFiles || uploadFiles.length == 0) {
|
||||||
|
|
@ -418,51 +436,51 @@ function transUrl(record) {
|
||||||
path = pathList.join(',');
|
path = pathList.join(',');
|
||||||
}
|
}
|
||||||
emitValue(path);
|
emitValue(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 预览文件、图片
|
// 预览文件、图片
|
||||||
function onFilePreview(file) {
|
function onFilePreview(file) {
|
||||||
if (isImageMode.value) {
|
if (isImageMode.value) {
|
||||||
createImgPreview({ imageList: [file.url], maskClosable: true });
|
createImgPreview({ imageList: [file.url], maskClosable: true });
|
||||||
} else {
|
} else {
|
||||||
window.open(file.url);
|
window.open(file.url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitValue(value) {
|
function emitValue(value) {
|
||||||
emit('change', value);
|
emit('change', value);
|
||||||
emit('update:value', value);
|
emit('update:value', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function uidGenerator() {
|
function uidGenerator() {
|
||||||
return '-' + parseInt(Math.random() * 10000 + 1, 10);
|
return '-' + parseInt(Math.random() * 10000 + 1, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFileName(path) {
|
function getFileName(path) {
|
||||||
if (path.lastIndexOf('\\') >= 0) {
|
if (path.lastIndexOf('\\') >= 0) {
|
||||||
let reg = new RegExp('\\\\', 'g');
|
let reg = new RegExp('\\\\', 'g');
|
||||||
path = path.replace(reg, '/');
|
path = path.replace(reg, '/');
|
||||||
}
|
}
|
||||||
return path.substring(path.lastIndexOf('/') + 1);
|
return path.substring(path.lastIndexOf('/') + 1);
|
||||||
}
|
}
|
||||||
//计算是否可以继续上传
|
//计算是否可以继续上传
|
||||||
const uploadVisible = computed(() => {
|
const uploadVisible = computed(() => {
|
||||||
if (props['maxCount'] === 0) {
|
if (props['maxCount'] === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return fileList.value.length < props['maxCount'];
|
return fileList.value.length < props['maxCount'];
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
addActionsListener,
|
addActionsListener,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
//noinspection LessUnresolvedVariable
|
//noinspection LessUnresolvedVariable
|
||||||
@prefix-cls: ~'@{namespace}-j-upload';
|
@prefix-cls: ~'@{namespace}-j-upload';
|
||||||
|
|
||||||
.@{prefix-cls} {
|
.@{prefix-cls} {
|
||||||
&-container {
|
&-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
|
@ -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;
|
||||||
|
|
@ -532,26 +553,32 @@ 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{
|
|
||||||
font-size:12px;color:rgb(189, 189, 189);
|
.divider {
|
||||||
|
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) {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 240px !important;
|
height: 240px !important;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
@ -563,7 +590,8 @@ 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;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import { FormSchema } from '/@/components/Table';
|
||||||
import { rules } from '/@/utils/helper/validator';
|
import { rules } from '/@/utils/helper/validator';
|
||||||
import { render } from '/@/utils/common/renderUtils';
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS;
|
||||||
|
|
||||||
//列表数据
|
//列表数据
|
||||||
export const columns: BasicColumn[] = [
|
export const columns: BasicColumn[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -32,10 +34,10 @@ export const columns: BasicColumn[] = [
|
||||||
customRender: ({ text, record }) => {
|
customRender: ({ text, record }) => {
|
||||||
// 如果 text 为空或 null/undefined,使用默认图片
|
// 如果 text 为空或 null/undefined,使用默认图片
|
||||||
const imageUrl = text
|
const imageUrl = text
|
||||||
? text
|
? opeMediaAddress + text
|
||||||
: record.type == 'tx'
|
: record.type == 'tx'
|
||||||
? import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
? opeMediaAddress + import.meta.env.VITE_DEFAULT_ELDER_TAG_BODY_PIC
|
||||||
: import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC;
|
: opeMediaAddress + import.meta.env.VITE_DEFAULT_ELDER_TAG_EMO_PIC;
|
||||||
return render.renderImage({ text: imageUrl });
|
return render.renderImage({ text: imageUrl });
|
||||||
},
|
},
|
||||||
// customRender: render.renderImage,
|
// customRender: render.renderImage,
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,11 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="图标" v-bind="validateInfos.pic" id="ElderTagForm-pic" name="pic">
|
<a-form-item label="图标" v-bind="validateInfos.pic" id="ElderTagForm-pic" name="pic">
|
||||||
<JImageUpload v-if="opeType == 'dmlook'" :fileMax="1" v-model:value="dmlookVal">
|
<!-- <JImageUploadToOpe v-if="opeType == 'dmlook'" :fileMax="1" v-model:value="dmlookVal">
|
||||||
</JImageUpload>
|
</JImageUploadToOpe> -->
|
||||||
<JImageUpload v-else :fileMax="1" v-model:value="formData.pic" :disabled="!!formData.id || !isMain">
|
<JImageUploadToOpe :toOpe="true" :bizPath="'eldertag'" :fileMax="1" v-model:value="formData.pic"
|
||||||
</JImageUpload>
|
:disabled="!!formData.id || !isMain">
|
||||||
|
</JImageUploadToOpe>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<!-- <a-col :span="24">
|
<!-- <a-col :span="24">
|
||||||
|
|
@ -64,7 +65,9 @@ import { Form } from 'ant-design-vue';
|
||||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||||
|
import JImageUploadToOpe from '/@/components/Form/src/jeecg/components/JImageUploadToOpe.vue';
|
||||||
|
|
||||||
|
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
formDisabled: { type: Boolean, default: false },
|
formDisabled: { type: Boolean, default: false },
|
||||||
formData: { type: Object, default: () => ({}) },
|
formData: { type: Object, default: () => ({}) },
|
||||||
|
|
|
||||||
|
|
@ -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 : opeMediaAddress + 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 : opeMediaAddress + 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 : opeMediaAddress + import.meta.env.VITE_DEFAULT_DIRECTIVE_IM_PIC;
|
||||||
return render.renderImage({ text: imageUrl });
|
return render.renderImage({ text: imageUrl });
|
||||||
},
|
},
|
||||||
// customRender: render.renderImage,
|
// customRender: render.renderImage,
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
<template v-for="item in treeData">
|
<template v-for="item in treeData">
|
||||||
<!-- 第一层判断是否有下级 -->
|
<!-- 第一层判断是否有下级 -->
|
||||||
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.key"
|
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.key"
|
||||||
@titleClick="handleTreeSelect([], {node:item})">
|
@titleClick="handleTreeSelect([], { node: item })">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
|
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
|
||||||
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
||||||
|
|
@ -81,7 +81,7 @@
|
||||||
<!-- 第二层判断是否有下级 -->
|
<!-- 第二层判断是否有下级 -->
|
||||||
<template v-for="child in item.children">
|
<template v-for="child in item.children">
|
||||||
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0"
|
<a-sub-menu :key="child.key" v-if="child.children && child.children.length > 0"
|
||||||
@titleClick="handleTreeSelect([], {node:child})">
|
@titleClick="handleTreeSelect([], { node: child })">
|
||||||
<!-- <template #icon>
|
<!-- <template #icon>
|
||||||
<Icon icon="ant-design:border-verticle-outlined" :size="20" />
|
<Icon icon="ant-design:border-verticle-outlined" :size="20" />
|
||||||
</template> -->
|
</template> -->
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
<!-- 第三层判断是否有下级 -->
|
<!-- 第三层判断是否有下级 -->
|
||||||
<template v-for="childThree in child.children">
|
<template v-for="childThree in child.children">
|
||||||
<a-sub-menu :key="childThree.key" v-if="childThree.children && childThree.children.length > 0"
|
<a-sub-menu :key="childThree.key" v-if="childThree.children && childThree.children.length > 0"
|
||||||
@titleClick="handleTreeSelect([], {node:childThree})">
|
@titleClick="handleTreeSelect([], { node: childThree })">
|
||||||
<!-- <template #icon>
|
<!-- <template #icon>
|
||||||
<Icon icon="ant-design:border-bottom-outlined" :size="20" />
|
<Icon icon="ant-design:border-bottom-outlined" :size="20" />
|
||||||
</template> -->
|
</template> -->
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
</template>
|
</template>
|
||||||
<!-- 第四层判断是否有下级 -->
|
<!-- 第四层判断是否有下级 -->
|
||||||
<a-menu-item :key="childFour.key" v-for="childFour in childThree.children"
|
<a-menu-item :key="childFour.key" v-for="childFour in childThree.children"
|
||||||
@click="handleTreeSelect([], {node:childFour})">
|
@click="handleTreeSelect([], { node: childFour })">
|
||||||
<span @mouseenter="childFour.showContent = true" @mouseleave="childFour.showContent = false"
|
<span @mouseenter="childFour.showContent = true" @mouseleave="childFour.showContent = false"
|
||||||
class="auto-wrap">{{ childFour?.title + '(' + childFour?.cycleTypeName + ')' }}
|
class="auto-wrap">{{ childFour?.title + '(' + childFour?.cycleTypeName + ')' }}
|
||||||
<span v-if="childFour?.izEnabled == '1' && childFour.level != 5"
|
<span v-if="childFour?.izEnabled == '1' && childFour.level != 5"
|
||||||
|
|
@ -175,7 +175,7 @@
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-sub-menu>
|
</a-sub-menu>
|
||||||
<a-menu-item :key="childThree.key" v-if="!childThree.children || childThree.children.length < 1"
|
<a-menu-item :key="childThree.key" v-if="!childThree.children || childThree.children.length < 1"
|
||||||
@click="handleTreeSelect([], {node:childThree})">
|
@click="handleTreeSelect([], { node: childThree })">
|
||||||
<!-- <template #icon>
|
<!-- <template #icon>
|
||||||
<Icon icon="ant-design:border-bottom-outlined" :size="20" />
|
<Icon icon="ant-design:border-bottom-outlined" :size="20" />
|
||||||
</template> -->
|
</template> -->
|
||||||
|
|
@ -208,7 +208,7 @@
|
||||||
</template>
|
</template>
|
||||||
</a-sub-menu>
|
</a-sub-menu>
|
||||||
<a-menu-item :key="child.key" v-if="!child.children || child.children.length < 1"
|
<a-menu-item :key="child.key" v-if="!child.children || child.children.length < 1"
|
||||||
@click="handleTreeSelect([], {node:child})">
|
@click="handleTreeSelect([], { node: child })">
|
||||||
<!-- <template #icon>
|
<!-- <template #icon>
|
||||||
<Icon icon="ant-design:border-verticle-outlined" :size="20" />
|
<Icon icon="ant-design:border-verticle-outlined" :size="20" />
|
||||||
</template> -->
|
</template> -->
|
||||||
|
|
@ -238,7 +238,7 @@
|
||||||
</template>
|
</template>
|
||||||
</a-sub-menu>
|
</a-sub-menu>
|
||||||
<a-menu-item :key="item.key" v-if="!item.children || item.children.length < 1"
|
<a-menu-item :key="item.key" v-if="!item.children || item.children.length < 1"
|
||||||
@click="handleTreeSelect([], {node:item})">
|
@click="handleTreeSelect([], { node: item })">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
|
<Icon :icon="item.icon" :size="20" v-if="item.icon" />
|
||||||
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
<Icon icon="ant-design:appstore-add-outlined" :size="20" v-else />
|
||||||
|
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -116,26 +116,26 @@
|
||||||
<a-row style="padding: 0px 20px;">
|
<a-row style="padding: 0px 20px;">
|
||||||
<a-col :span="24" v-show="directiveMediaBtnValue == 0">
|
<a-col :span="24" v-show="directiveMediaBtnValue == 0">
|
||||||
<JImageUploadtz v-if="opeType == 'dmlook'"
|
<JImageUploadtz v-if="opeType == 'dmlook'"
|
||||||
:value="!!formData.previewFile ? opeMediaAddress + formData.previewFile : defaultPrePic" maxCount="1"
|
:value="!!formData.previewFile ? formData.previewFile : defaultPrePic" maxCount="1"
|
||||||
:disabled="disabled || !isMain" />
|
:disabled="disabled || !isMain" />
|
||||||
<JImageUploadtz v-else v-model:value="formData.previewFile" maxCount="1" :toOpe="true"
|
<JImageUploadtz v-else v-model:value="formData.previewFile" maxCount="1" :toOpe="true"
|
||||||
:bizPath="formComputedData.mediaFileSavePath" :disabled="disabled || !isMain" />
|
:bizPath="formComputedData.mediaFileSavePath" :disabled="disabled || !isMain" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-show="directiveMediaBtnValue == 1">
|
<a-col :span="24" v-show="directiveMediaBtnValue == 1">
|
||||||
<JImageUploadtz v-if="opeType == 'dmlook'"
|
<JImageUploadtz v-if="opeType == 'dmlook'"
|
||||||
:value="!!formData.previewFileSmall ? opeMediaAddress + formData.previewFileSmall : defaultPreSmallPic"
|
:value="!!formData.previewFileSmall ? formData.previewFileSmall : defaultPreSmallPic"
|
||||||
maxCount="1" :disabled="disabled || !isMain" />
|
maxCount="1" :disabled="disabled || !isMain" />
|
||||||
<JImageUploadtz v-else v-model:value="formData.previewFileSmall" maxCount="1" :toOpe="true"
|
<JImageUploadtz v-else v-model:value="formData.previewFileSmall" maxCount="1" :toOpe="true"
|
||||||
:bizPath="formComputedData.mediaFileSavePath" :disabled="disabled || !isMain" />
|
:bizPath="formComputedData.mediaFileSavePath" :disabled="disabled || !isMain" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-show="directiveMediaBtnValue == 2">
|
<a-col :span="24" v-show="directiveMediaBtnValue == 2">
|
||||||
<JUploadMP3 v-if="opeType == 'dmlook'" :value="opeMediaAddress + formData.mp3File" maxCount="1"
|
<JUploadMP3 v-if="opeType == 'dmlook'" :value=" formData.mp3File" maxCount="1"
|
||||||
:disabled="disabled || !isMain" />
|
:disabled="disabled || !isMain" />
|
||||||
<JUploadMP3 v-else v-model:value="formData.mp3File" :toOpe="true"
|
<JUploadMP3 v-else v-model:value="formData.mp3File" :toOpe="true"
|
||||||
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
|
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-show="directiveMediaBtnValue == 3">
|
<a-col :span="24" v-show="directiveMediaBtnValue == 3">
|
||||||
<JUploadMP4 v-if="opeType == 'dmlook'" :value="opeMediaAddress + formData.mp4File" maxCount="1"
|
<JUploadMP4 v-if="opeType == 'dmlook'" :value=" formData.mp4File" maxCount="1"
|
||||||
fileType="mp4" :disabled="disabled || !isMain" />
|
fileType="mp4" :disabled="disabled || !isMain" />
|
||||||
<JUploadMP4 v-else v-model:value="formData.mp4File" :toOpe="true"
|
<JUploadMP4 v-else v-model:value="formData.mp4File" :toOpe="true"
|
||||||
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" fileType="mp4"
|
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" fileType="mp4"
|
||||||
|
|
@ -143,14 +143,14 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-show="directiveMediaBtnValue == 4">
|
<a-col :span="24" v-show="directiveMediaBtnValue == 4">
|
||||||
<JImageUploadtz v-if="opeType == 'dmlook'"
|
<JImageUploadtz v-if="opeType == 'dmlook'"
|
||||||
:value="!!formData.immediateFile ? opeMediaAddress + formData.immediateFile : defaultImmediatePic"
|
:value="!!formData.immediateFile ? formData.immediateFile : defaultImmediatePic"
|
||||||
maxCount="1" :disabled="disabled || !isMain" />
|
maxCount="1" :disabled="disabled || !isMain" />
|
||||||
<JImageUploadtz v-else v-model:value="formData.immediateFile" :toOpe="true"
|
<JImageUploadtz v-else v-model:value="formData.immediateFile" :toOpe="true"
|
||||||
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
|
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-show="directiveMediaBtnValue == 5">
|
<a-col :span="24" v-show="directiveMediaBtnValue == 5">
|
||||||
<JImageUploadtz v-if="opeType == 'dmlook'"
|
<JImageUploadtz v-if="opeType == 'dmlook'"
|
||||||
:value="!!formData.immediateFileFocus ? opeMediaAddress + formData.immediateFileFocus : defaultImmediatePic"
|
:value="!!formData.immediateFileFocus ? formData.immediateFileFocus : defaultImmediatePic"
|
||||||
maxCount="1" :disabled="disabled || !isMain" />
|
maxCount="1" :disabled="disabled || !isMain" />
|
||||||
<JImageUploadtz v-else v-model:value="formData.immediateFileFocus" :toOpe="true"
|
<JImageUploadtz v-else v-model:value="formData.immediateFileFocus" :toOpe="true"
|
||||||
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
|
:bizPath="formComputedData.mediaFileSavePath" maxCount="1" :disabled="disabled || !isMain" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue