xiaohaizhao 2 months ago
parent
commit
6de4be72b8

+ 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-40c1f302.js"></script>
+    <script type="module" crossorigin src="./assets/index-fed60001.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-b8e2bd64.css">

+ 9 - 0
jsconfig.json

@@ -0,0 +1,9 @@
+{
+  "compilerOptions": {
+    "baseUrl": ".",
+    "paths": {
+      "@/*": ["src/*"]
+    }
+  },
+  "exclude": ["node_modules", "dist"]
+}

+ 5 - 0
src/MAR/archivesMag/modules/workManage/add.vue

@@ -51,6 +51,7 @@
                 <a-select-option value="视频">视频</a-select-option>
                 <a-select-option value="图文">图文</a-select-option>
                 <a-select-option value="音频">音频</a-select-option>
+                <a-select-option value="ppt">PPT</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -122,6 +123,10 @@ let typeList = ref({
     label:'音频',
     accept:'audio/*'
   },
+  'ppt':{
+    label:'PPT',
+    accept:'.ppt,.pptx'
+  },
 })
 let bindData = ref({})
 const showDrawer = async ()=>{

+ 5 - 0
src/MAR/archivesMag/modules/workManage/edit.vue

@@ -63,6 +63,7 @@
                 <a-select-option value="视频">视频</a-select-option>
                 <a-select-option value="图文">图文</a-select-option>
                 <a-select-option value="音频">音频</a-select-option>
+                <a-select-option value="ppt">PPT</a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
@@ -126,6 +127,10 @@ let typeList = ref({
     label:'音频',
     accept:'audio/*'
   },
+  'ppt':{
+    label:'PPT',
+    accept:'.ppt,.pptx'
+  },
 })
 let upload = ref()
 let uploadEl = ref()

+ 2 - 3
src/MAR/assetsStore/detail/index.vue

@@ -3,7 +3,7 @@
     <detail-template
       :headData="mainAreaData"
       :title="mainData.title"
-      :tabs="[`${mainData.type == 1 ? '图片管理' : '视频管理'}`, '详细信息']"
+      :tabs="[`${mainData.type == 1 ? '图片管理' : mainData.type == 2 ? '视频管理' : '文档管理'}`, '详细信息']"
       ownertable="sat_sharematerial"
       :disable="utils.isDisabled(mainData.status, ['发布'])"
       :delParam="{
@@ -87,8 +87,7 @@
       <template #tab0>
         <photoWall
           :attinfos="mainData.attinfos_pic"
-          pic
-          fileType="sourcefil"
+          :fileType="mainData.type"
           :disabled="mainData.status == '发布'"
           ownertable="sat_sharematerial"
           :ownerid="mainData.sat_sharematerialid"

+ 6 - 5
src/MAR/assetsStore/modules/Add.vue

@@ -36,11 +36,12 @@
                       </a-form-item>
                     </a-col>
                     <a-col :span="24">
-                      <a-form-item label="类型" name="type" :rules="[{ required: true, message: '请选择类型',trigger:'blur'}]">
-                        <a-select v-model:value="from.type" placeholder="请选择类型">
-                          <a-select-option :value="1">图片</a-select-option>
-                          <a-select-option :value="2">视频</a-select-option>
-                        </a-select>
+                      <a-form-item label="类型" name="type" :rules="[{ required: true, message: '请选择类型',trigger:'change'}]">
+                        <a-radio-group v-model:value="from.type">
+                          <a-radio :value="1">图片</a-radio>
+                          <a-radio :value="2">视频</a-radio>
+                          <a-radio :value="3">文档</a-radio>
+                        </a-radio-group>
                       </a-form-item>
                     </a-col>
                     <a-col :span="24">

+ 6 - 5
src/MAR/assetsStore/modules/Edit.vue

@@ -36,11 +36,12 @@
                       </a-form-item>
                     </a-col>
                     <a-col :span="24">
-                      <a-form-item label="类型" name="type" :rules="[{ required: true, message: '请选择类型',trigger:'blur'}]">
-                        <a-select v-model:value="from.type" placeholder="请选择类型">
-                          <a-select-option :value="1">图片</a-select-option>
-                          <a-select-option :value="2">视频</a-select-option>
-                        </a-select>
+                      <a-form-item label="类型" name="type" :rules="[{ required: true, message: '请选择类型',trigger:'change'}]">
+                        <a-radio-group v-model:value="from.type">
+                          <a-radio :value="1">图片</a-radio>
+                          <a-radio :value="2">视频</a-radio>
+                          <a-radio :value="3">文档</a-radio>
+                        </a-radio-group>
                       </a-form-item>
                     </a-col>
                     <a-col :span="24">

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

@@ -1,7 +1,7 @@
 <template>
   <div class="header">
     <a-upload
-      accept="image/*"
+      :accept="acceptType"
       multiple
       :beforeUpload="beforeUpload"
       :showUploadList="false"
@@ -14,7 +14,7 @@
         type="primary"
         size="samll"
         class="mr-10"
-        >{{ butText }}</a-button
+        >{{ buttonText }}</a-button
       >
     </a-upload>
     <div style="width: 300px" v-if="list.length">
@@ -114,7 +114,7 @@
 </template>
 
 <script setup>
-import { ref, reactive, defineProps, watch } from "vue";
+import { ref, reactive, defineProps, watch, computed } from "vue";
 import Api from "@/api/api";
 import Up from "@/api/upload";
 import utils from "@/utils/utils";
@@ -165,6 +165,32 @@ const props = defineProps({
     type: Boolean,
     default: true,
   },
+  fileType: {
+    type: [String, Number],
+    default: 1, // 1:图片, 2:视频, 3:文档
+  },
+});
+
+// 根据文件类型返回 accept 属性
+const acceptType = computed(() => {
+  const type = Number(props.fileType);
+  if (type === 2) {
+    return 'video/*'; // 视频类型
+  } else if (type === 3) {
+    return '*'; // 文档类型不限制
+  }
+  return 'image/*'; // 默认图片类型
+});
+
+// 根据文件类型返回按钮文字
+const buttonText = computed(() => {
+  const type = Number(props.fileType);
+  if (type === 2) {
+    return '添加视频';
+  } else if (type === 3) {
+    return '添加文档';
+  }
+  return '添加图片';
 });
 
 let baseSize = ref("140"),

+ 5 - 1
tsconfig.json

@@ -6,6 +6,10 @@
     "jsx": "preserve",
     "moduleResolution": "node",
     "esModuleInterop": true,
-    "sourceMap": true
+    "sourceMap": true,
+    "baseUrl": ".",
+    "paths": {
+      "@/*": ["src/*"]
+    }
   }
 }