Browse Source

文档支持图片和视频

xiaohaizhao 1 day ago
parent
commit
0e2b5974e1

+ 0 - 1
dist/assets/index-0499ce02.css

@@ -1 +0,0 @@
-.fieldPanel{margin-bottom:10px}#components-form-demo-advanced-search .ant-form{max-width:none}#components-form-demo-advanced-search .search-result-list{margin-top:16px;border:1px dashed #e9e9e9;border-radius:2px;background-color:#fafafa;min-height:200px;text-align:center;padding-top:80px}[data-theme=dark] .ant-advanced-search-form{background:rgba(255,255,255,.04);border:1px solid #434343;padding:24px;border-radius:2px}[data-theme=dark] #components-form-demo-advanced-search .search-result-list{border:1px dashed #434343;background:rgba(255,255,255,.04)}.formItemBottom{margin-bottom:10px}.custompickername .ant-picker-header{display:none!important}.btn-link[data-v-c6ee58b2]{text-decoration:underline}.ant-table-small[data-v-c6ee58b2] td{font-size:12px}.ant-table-small[data-v-c6ee58b2] .table-striped td{background-color:#f8f9fd}.ant-table-small[data-v-c6ee58b2] .table-striped-red td{color:#d9363e}.flex[data-v-c6ee58b2]{display:flex;justify-content:space-between;align-items:center}.pointer[data-v-c6ee58b2]{cursor:pointer;flex:1;text-align:right}.ant-dropdown-link[data-v-c6ee58b2]{color:#333}.flex-between[data-v-c6ee58b2]{display:flex;align-items:center;justify-content:space-between}

+ 1 - 1
dist/index.html

@@ -5,7 +5,7 @@
     <link rel="icon" type="image/svg+xml" href="./vite.svg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>营销宝</title>
-    <script type="module" crossorigin src="./assets/index-76313010.js"></script>
+    <script type="module" crossorigin src="./assets/index-78b0f29b.js"></script>
     <link rel="modulepreload" crossorigin href="./assets/vue-8259307b.js">
     <link rel="modulepreload" crossorigin href="./assets/vue-router-55bfd43b.js">
     <link rel="stylesheet" href="./assets/index-77018d0f.css">

+ 1 - 1
src/MAR/assetsStore/detail/index.vue

@@ -148,7 +148,7 @@ function filterByType(list, type) {
   if (type == 1) return list.filter(v => v.fileType === 'image');
   if (type == 2) return list.filter(v => v.fileType === 'video');
   if (type == 3) return [];
-  return list.filter(v => v.fileType !== 'image' && v.fileType !== 'video');
+  return list;
 }
 
 // 处理附件:过滤 → 去重 → 类型筛选 → 新上传排序

+ 28 - 2
src/MAR/productManage/modules/Edit.vue

@@ -4,7 +4,7 @@
     ref="drawer"
     v-model:open="modeVisible"
     placement="right"
-    :width="'800px'"
+    :width="'1200px'"
     :closable="false"
     title="编辑单品"
     v-if="modeVisible"
@@ -106,6 +106,29 @@
       </a-form>
       <a-divider orientation="left" orientation-margin="0">产品介绍</a-divider>
       <wangEditor ref="editor" v-model="form.contentstr" :id="form.sa_fadid" style="margin-bottom: 10px"></wangEditor>
+
+      <a-divider orientation="left" orientation-margin="0">图集管理</a-divider>
+      <AddImg :id="form.sa_fadid" @onSuccess="$refs.table.listData()"></AddImg>
+      <normalTable :sequence="true" rowKey="sys_attachment_linksid" sequenceKey="linksid" :is-select="false" ref="table" size="small" :columns="utils.TBLayout('imgManageTable')" :param="imgParam">
+        <template #tb_cell="{data}">
+          <template v-if="data.column.dataIndex === 'attinfos'">
+            <a-image v-if="data.record.attinfos && data.record.attinfos.length" :src=" data.record.attinfos[0].fileType=='video' ? data.record.attinfos[0].subfiles[0].url:data.record.attinfos[0].url" style="width:100px;height: 100px;"></a-image>
+          </template>
+          <template v-else-if="data.column.dataIndex == 'operation'">
+            <CustomButton
+              btnName="删除"
+              idName="20240407135902"
+              keyName="linksids"
+              :id="[data.record.linksid]"
+              type="link"
+              message="确定删除当前资源吗?"
+              @onSuccess="$refs.table.listData()"
+              size="middle"
+            />
+          </template>
+        </template>
+      </normalTable>
+
       <template #extra>
         <a-space>
           <CustomButton type="primary" @click="submit">保存</CustomButton>
@@ -179,10 +202,12 @@ watch(() => modeVisible.value,(val) => {
   if (!val) emit('back')
 })
 
-//新建
+//编辑
+let table = ref()
 const addClass = async () => {
   form.value = Object.assign({}, form.value, props.rowData)
   form.value.contentstr = form.value.content
+  imgParam.value.content.ownerid = form.value.sa_fadid
   modeVisible.value = true
   console.log(form.value,props.rowData);
 }
@@ -190,6 +215,7 @@ const addClass = async () => {
 //保存
 const submit = async () => {
   const values = await formRef.value.validateFields()
+  if (!table.value.data.length)return message.warning('图集至少上传一个!!')
   if (form.value.contentstr == '<p><br></p>') form.value.contentstr = ''
   form.value.sa_fadclassid = form.value.sa_fadclassids[form.value.sa_fadclassids.length - 1]
   const res = await Api.requested({

+ 3 - 11
src/components/photoWall/index.vue

@@ -245,8 +245,8 @@ const acceptType = computed(() => {
   if (type === 2) {
     return 'video/*'; // 视频类型
   } else if (type === 4) {
-    // 文档类型:排除图片和视频,支持工程文件
-    return '.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.rtf,.csv,.zip,.rar,.7z,.tar,.gz,.epub,.mobi,.json,.xml,.html,.css,.js,.ts,.java,.py,.php,.c,.cpp,.h,.hpp,.md,.log,.sql,.psd,.cdr,.ai,.sketch,.fig,.xd,.indd,.aep,.prproj,.fla,.dwg,.dxf,.step,.stp,.iges,.stl,.obj,.3ds,.max,.blend,.c4d';
+    // 文档类型:支持图片、视频及工程文件
+    return 'image/*,video/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.rtf,.csv,.zip,.rar,.7z,.tar,.gz,.epub,.mobi,.json,.xml,.html,.css,.js,.ts,.java,.py,.php,.c,.cpp,.h,.hpp,.md,.log,.sql,.psd,.cdr,.ai,.sketch,.fig,.xd,.indd,.aep,.prproj,.fla,.dwg,.dxf,.step,.stp,.iges,.stl,.obj,.3ds,.max,.blend,.c4d';
   }
   // 图片类型:仅允许上传常规的图片类型
   return 'image/jpeg,image/jpg,image/png,image/gif,image/bmp,image/webp';
@@ -388,15 +388,7 @@ function beforeUpload(file) {
   const type = Number(props.fileType);
   const ext = file.name.toLowerCase().split('.').pop();
 
-  // 文档类型(type === 4):禁止上传图片和视频
-  if (type === 4) {
-    const videoExts = ['mp4', 'webm', 'ogg', 'mov', 'avi', 'mkv', 'flv', 'wmv'];
-    const imageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'ico', 'tif', 'tiff'];
-    if (videoExts.includes(ext) || imageExts.includes(ext)) {
-      utils.message({ code: 0 }, '文档管理不支持上传图片或视频文件');
-      return false;
-    }
-  } else if (type === 1) {
+  if (type === 1) {
     // 图片类型:仅允许上传常规的图片类型
     const allowedImageExts = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'];
     if (!allowedImageExts.includes(ext)) {