Browse Source

创意素材部分

liuxiaona 1 year ago
parent
commit
cd867e8ec9

+ 17 - 7
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/index.vue

@@ -21,10 +21,10 @@
21 21
 
22 22
       <div class="titleBox flex borCon">
23 23
         <div class="title">创意内容</div>
24
-        <div class="smallTitle lMar20">创意组数量: {{}}组</div>
24
+        <div class="smallTitle lMar20">创意组数量: {{pageInfo.creativeTeamList&&pageInfo.creativeTeamList.length}}组</div>
25 25
         <div class="lMarauto">
26
-          <el-button type="primary">批量添加视频</el-button>
27
-          <el-button type="primary">批量添加封面</el-button>
26
+          <el-button type="primary" @click="openLibraryDialog(1)">批量添加视频</el-button>
27
+          <el-button type="primary" @click="openLibraryDialog(2)">批量添加封面</el-button>
28 28
           <el-button type="primary">一键指定封面</el-button>
29 29
           <el-button type="primary">一键测新</el-button>
30 30
         </div>
@@ -46,8 +46,8 @@
46 46
               </div>
47 47
             </div>
48 48
 
49
-            <Tooltip notes="复制创意组" colorCss="c-theme" :slotFalg="true">
50
-              <template v-slot:content>
49
+            <Tooltip notes="复制创意组" colorCss="c-theme" :iconSlotFalg="true">
50
+              <template v-slot:iconSlot>
51 51
                 <div class="iconBox" @click="copyItemEvent(item)">
52 52
                   <el-icon :size="14" color="#3173FF"><i-ep-DocumentCopy /></el-icon>
53 53
                 </div>
@@ -59,12 +59,14 @@
59 59
       </div>
60 60
 
61 61
 
62
+      <LibraryDialog ref="LibraryDialogRef"></LibraryDialog>
62 63
     </template>
63 64
   </Dialog>
64 65
 </template>
65 66
 <script setup lang="ts">
66 67
 import RadioGroup from '@/components/businessMoudle/batchGdt/configArea/directPacket/common/radioGroup.vue'
67 68
 import CreativeTeam from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/creativeTeam.vue'
69
+import LibraryDialog from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/libraryDialog.vue'
68 70
 import Tooltip from '@/components/capsulationMoudle/_tooltip.vue'
69 71
 import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
70 72
 import {reactiveTableAndAny} from "@/api/ApiModel";
@@ -93,7 +95,8 @@ interface radioFace{
93 95
   name:string,
94 96
   EgName:string,
95 97
   radioVal:string,
96
-  list:Array[]
98
+  haveNotes:boolean,
99
+  list:any
97 100
 }
98 101
 
99 102
 const coverRadioList = ref<radioFace>({
@@ -187,9 +190,16 @@ const loading = ref<boolean>(false)
187 190
 const confirmEvent = () => {
188 191
 
189 192
 }
193
+//打开素材库弹框
194
+const LibraryDialogRef = ref<{switchShow:(val:boolean,mtype:number)=>void}>()
195
+const openLibraryDialog = (type:number) => {
196
+  nextTick(()=>{
197
+    LibraryDialogRef.value!.switchShow(true,type)
198
+  })
199
+}
190 200
 
191 201
 // 切换显隐
192
-const dialogShow = ref<boolean>(true)
202
+const dialogShow = ref<boolean>(false)
193 203
 const switchShow = (val:boolean)=>{
194 204
   dialogShow.value = val
195 205
   if(val){

+ 236 - 28
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/libraryDialog.vue

@@ -1,9 +1,10 @@
1 1
 <template>
2 2
   <el-dialog
3
+      class="library_Dialog"
3 4
       :model-value="dialogShow"
4 5
       top="8px"
5 6
       append-to-body
6
-      :width="width"
7
+      width="1200px"
7 8
       @close="dialogShow = false"
8 9
       :modal="true"
9 10
       :show-close="false"
@@ -12,30 +13,111 @@
12 13
       :destroy-on-close="false"
13 14
       draggable>
14 15
     <template #header="{ close }">
15
-      <div class="flex_between">
16
-        <div class="c-0F161E f18 f-wei-600">{{dialogTitle}}</div>
16
+      <div class="flex dialog-header">
17
+        <div class="typeBorlineBox">
18
+          <div class="item" v-for="item in typeList.list" :key="item.key" :class="item.key == typeAc ? 'itemAc' : ''" @click="switchTypeItem(item.key)">
19
+            <div>{{item.name}}</div>
20
+            <!--          <div class="borLine"></div>-->
21
+          </div>
22
+        </div>
23
+        <div class="c-theme lMarauto f13 pointer" @click="goMaterialLibrary">管理素材</div>
17 24
       </div>
18 25
     </template>
19
-    <div class="container" :style="{ maxHeight: height , minHeight:minheight }" v-loading="loading">
20
-      <slot name="content"></slot>
26
+    <div class="library_body" v-loading="loading">
27
+<!--      搜索框-->
28
+      <div class="flexWrap searchBox">
29
+        <Input ref="InputRef_text" title="素材名称" placeholderTxt="素材名称" class="bMar10" @changeEvent="()=>init()" @clearEvent="()=>init()"/>
30
+        <materialCatalog selectWidth="160px" ref="CataRef" title="素材目录" class="bMar10" @changeEvent="()=>init()" :clearableFlag="true"></materialCatalog>
31
+        <Select ref="sizeTypeRef"
32
+                :clearFlag="true"
33
+                :filterFlag="true"
34
+                title="尺寸"
35
+                selectWidth="160px" class="bMar10"
36
+                @changeEvent="()=>init()" @clearEvent="()=>init()"
37
+                :options="pageInfo.sizeTypeList"/>
38
+        <Select ref="ideaManRef"
39
+                :clearFlag="true"
40
+                title="创意人"
41
+                selectWidth="160px" class="bMar10"
42
+                :optObj="{k:'id',la:'username',val:'id'}"
43
+                @changeEvent="()=>init()" @clearEvent="()=>init()"
44
+                :options="pageInfo.createrList"/>
45
+        <Select ref="designerRef"
46
+                :clearFlag="true"
47
+                title="设计师" class="bMar10"
48
+                selectWidth="160px"
49
+                :optObj="{k:'id',la:'username',val:'id'}"
50
+                @changeEvent="()=>init()" @clearEvent="()=>init()"
51
+                :options="pageInfo.editorList"/>
52
+
53
+        <tagBlock ref="tagRef" title="素材标签" selectWidth="240px" :haveNewTag="false" class="bMar10"
54
+                  @handleChange="val=>{pageInfo.tagChooseVal = val}" @hideChange="()=>init()"></tagBlock>
55
+        <TimeScreen title="时间" selectWidth="260px" :haveQuick="false" :clearFlag="true" :valueIsKong="true"
56
+                    ref="timeRef"
57
+                    :shortcuts="pageInfo.shortList"
58
+                    @init="()=>init()"
59
+                    class="bMar10 lMar10"></TimeScreen>
60
+        <span class="pointer c-theme lMar10 bMar10" @click="init()">刷新</span>
61
+        <div class="flex bMar10 lMar10">
62
+          <Tooltip notes="因媒体接口限制只能使用符合尺寸要求的素材" colorCss="c-d3"  :iconSlotFalg="true">
63
+            <template v-slot:iconSlot>
64
+              <div class="f13 flex">仅显示可投放素材<el-icon class="f13 pointer lMar5" color="#d3d3d3"><i-ep-QuestionFilled/></el-icon></div>
65
+            </template>
66
+          </Tooltip>
67
+          <el-switch v-model="canPutOn" class="lMar5"/>
68
+        </div>
69
+      </div>
70
+<!--      素材区-->
71
+      <div class="materialBox flexWrap">
72
+        <materialBlock v-for="item in pageInfo.materialList"
73
+                         :key="item.id"
74
+                         folderId="folder_id"
75
+                         :paramsObj="item"
76
+                         :checkShow="true"
77
+                         :showCreateTimeFlag="true"
78
+                          :showDetialFlag="false"
79
+                         @init="()=>init()"
80
+                         @checkChange="checkChangeItem"></materialBlock>
81
+
82
+          <noData v-if="(pageInfo.materialList && pageInfo.materialList.length==0) || !pageInfo.materialList"></noData>
83
+      </div>
84
+<!--      分页区-->
85
+      <div class="pageBox flex">
86
+        <el-checkbox v-model="allChecked" @change="allChangeEvent">全选</el-checkbox>
87
+        <div class="c-666 lMar20 f12">使用原生页外顶部视频换内功能时,请筛选640*360,640*480,750*1334等尺寸素材</div>
88
+        <el-pagination
89
+            class="lMarauto"
90
+            :small="true"
91
+            v-model:current-page="currentPage"
92
+            v-model:page-size="pageSize"
93
+            :page-sizes="[10, 20, 50, 100]"
94
+            layout="total, sizes, prev, pager, next, jumper"
95
+            :total="300"
96
+            @current-change="handleCurrentChange"
97
+        />
98
+      </div>
21 99
     </div>
22 100
     <template #footer>
23 101
       <div class="dialog-footer">
24
-        <div>
25
-          <span>已选素材: {{}} / {{}}</span>
102
+        <div class="flex">
103
+          <span>已选素材: {{pageInfo.chooseList_Item&&pageInfo.chooseList_Item.length || 0}} / {{total || 0}}</span>
104
+          <Tooltip notes="素材已根据媒体的要求进行过滤(广点通:支持视频格式:mp4、mov、avi,大小不超过100M)" colorCss="c-d3"/>
26 105
         </div>
27 106
 
28
-        <div class="lMarauto">
29
-          <Tooltip notes="复制创意组" colorCss="c-theme" :slotFalg="true">
107
+        <div class="lMarauto flex">
108
+          <Tooltip notes="复制创意组" colorCss="c-theme" :iconSlotFalg="true" :contentSlotFalg="true">
30 109
             <template v-slot:content>
110
+              <div>1、<b>素材可投放尺寸</b>:1440x2560;1080x1920;720x1280;<a href="https://thoughts.teambition.com/sharespace/5fc77c211dc1b5004618990a/docs/617b899f0a1306004198c393" target="_blank">详细尺寸>></a></div>
111
+              <div>2、<b>创量审核状态</b>:只有素材库素材通过审核才可以使用;</div>
112
+            </template>
113
+            <template v-slot:iconSlot>
31 114
               <div class="flex">
32
-                找不到素材?点这里
33
-                <el-icon size="14" class="f14 pointer"><i-ep-QuestionFilled/></el-icon>
115
+                找不到素材?点这里<el-icon class="f14 pointer lMar5" color="#d3d3d3"><i-ep-QuestionFilled/></el-icon>
34 116
               </div>
35 117
             </template>
36 118
           </Tooltip>
37
-          <el-button plain @click="cancelEVent" size="default">取消</el-button>
38
-          <el-button type="primary" plain @click="submitEVent" size="default" class="lMar10">提交</el-button>
119
+          <el-button plain @click="cancelEVent" size="default" class="lMar10">取消</el-button>
120
+          <el-button type="primary" @click="submitEVent" size="default" class="lMar10">提交</el-button>
39 121
         </div>
40 122
       </div>
41 123
     </template>
@@ -44,14 +126,70 @@
44 126
 <script setup lang="ts">
45 127
 import {getCurrentInstance, nextTick, onMounted, reactive, ref} from "vue";
46 128
 import Tooltip from '@/components/capsulationMoudle/_tooltip.vue'
129
+import Select from '@/components/capsulationMoudle/_select.vue'
130
+import TimeScreen from '@/components/capsulationMoudle/timeScreen.vue'
131
+import Input from '@/components/capsulationMoudle/_input.vue'
132
+import materialCatalog from '@/components/businessMoudle/materialLibrary/materialCatalog.vue'
133
+import tagBlock from '@/components/businessMoudle/materialLibrary/block/tagBlock.vue'
134
+import noData from '@/components/capsulationMoudle/noData.vue'
135
+import materialBlock from '@/components/businessMoudle/materialLibrary/block/materialBlock.vue'
136
+import {searchBoxTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/searchBox'
137
+import {publicSwitchType} from "@/components/businessMoudle/switchType";
138
+import { useRouter } from "vue-router";
139
+
140
+const router = useRouter();
47 141
 
48 142
 const { proxy } = getCurrentInstance() as any;
49 143
 // 全局方法定义
50 144
 const NumberHandle = proxy.$NumberHandle
51 145
 
146
+const canPutOn = ref<boolean>(false)
147
+const allChecked = ref<boolean>(false)
148
+//全选
149
+const allChangeEvent = (val: any) => {
150
+  if(val){
151
+    pageInfo.chooseList_Item = []
152
+    pageInfo.materialList.forEach(item=>{
153
+      item.checked = true
154
+      pageInfo.chooseList_Item.push(item)
155
+    })
156
+  }else{
157
+    pageInfo.chooseList_Item = []
158
+    pageInfo.materialList.forEach(item=>{
159
+      item.checked = false
160
+    })
161
+  }
162
+}
163
+
164
+// 类型切换公共ts
165
+const typeListParams = reactive([
166
+  {name:'素材库',key:'video'},
167
+  {name:'收藏夹',key:'cover'},
168
+])
169
+const {
170
+  typeAc,
171
+  typeList,
172
+  switchTypeItem
173
+} = publicSwitchType(typeListParams)
174
+
175
+
176
+//去素材管理
177
+const goMaterialLibrary = () => {
178
+  let newPage:any = router.resolve({
179
+    path: '/materialLibrary',
180
+    query: { type: 'material'}
181
+  })
182
+  window.open(newPage.href, "_blank")
183
+}
52 184
 
53 185
 // 切换显隐
54 186
 const dialogShow = ref<boolean>(false)
187
+const switchShow = (val:boolean,mtype:number)=>{
188
+  dialogShow.value = val
189
+  if(val){
190
+    initAll(mtype)
191
+  }
192
+}
55 193
 
56 194
 //提交
57 195
 const submitEVent = () => {
@@ -61,32 +199,102 @@ const submitEVent = () => {
61 199
 const cancelEVent = () => {
62 200
   dialogShow.value = false
63 201
 }
64
-//账号列表
65
-// const init = async (page?:any,pageSize?:any) => {
66
-//   tableListRef.value!.loading = true
67
-//   const paramsModel = reactive<expertParam>({})
68
-//   let res:any = await proxy.$http.get(Api.expert_living,paramsModel)
69
-//   tableListRef.value!.loading = false
70
-//   if(res&&res.errNo=='0'){
71
-//     let resNew:any = res.rst
72
-//     tableInfo.tableList = resNew.data
73
-//     total.value = resNew.pageInfo.totalNum
74
-//   }else{
75
-//     ElMessage.error(res.errMsg)
76
-//   }
77
-// }
78 202
 
79 203
 
204
+
205
+
206
+
207
+// 父组件共享值
208
+defineExpose({
209
+  switchShow
210
+});
211
+
212
+//公共ts 和 素材库共用
213
+const {
214
+  pageInfo,
215
+  InputRef_text,
216
+  mtypeRef,
217
+  ctypeRef,
218
+  sizeTypeRef,
219
+  ideaManRef,
220
+  designerRef,
221
+  CataRef,
222
+  tagRef,
223
+  timeRef,
224
+  loading,
225
+  currentPage,
226
+  pageSize,
227
+  total,
228
+  init,
229
+  init_createrList,
230
+  getSizeList,
231
+  handleCurrentChange,
232
+  initAll,
233
+  checkChangeItem
234
+} = searchBoxTs(1)
235
+
80 236
 onMounted(()=>{
81 237
   nextTick(()=>{
82 238
 
83 239
   })
84 240
 })
85 241
 </script>
242
+<style lang="scss">
243
+.library_Dialog{
244
+  .el-dialog__header{
245
+    padding: 10px 30px;
246
+    margin: 0;
247
+  }
248
+  .el-dialog__body{
249
+    padding: 10px 0 0;
250
+    .pageBox{
251
+      .el-input.is-disabled .el-input__inner{
252
+        height: 24px!important;
253
+      }
254
+      .el-input--small .el-input__inner{
255
+        height:24px!important;
256
+      }
257
+    }
258
+  }
259
+  .el-dialog__footer{
260
+    border-top: 1px solid #F2F2F2;
261
+    padding: 10px 30px;
262
+
263
+  }
264
+  //--el-component-size-small: 24px;
265
+}
266
+</style>
86 267
 <style lang="scss" scoped>
268
+.library_body {
269
+  :deep(.spanTitle) {
270
+    font-size: 13px;
271
+  }
272
+  .searchBox{
273
+    border-bottom: 1px solid #F2F2F2;
274
+    padding: 0 30px;
275
+
276
+  }
277
+  .materialBox{
278
+    padding: 10px 30px;
279
+    background-color: #f2f2f2;
280
+    height: calc(100vh - 275px);
281
+    overflow-y: auto;
282
+    //scrollbar-color: transparent transparent;
283
+    &::-webkit-scrollbar{
284
+      width: 2px;
285
+    }
286
+  }
287
+  .pageBox{
288
+    border-top: 1px solid #F2F2F2;
289
+    padding: 10px 30px;
290
+  }
291
+}
292
+
87 293
 .dialog-footer{
88 294
   display: flex;
89 295
   align-items: center;
90
-  padding: 16px 32px 16px 24px;
296
+  color: #666;
297
+  font-size: 13px;
91 298
 }
299
+
92 300
 </style>

+ 206 - 0
src/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/searchBox.ts

@@ -0,0 +1,206 @@
1
+import {getCurrentInstance, nextTick, reactive, ref} from "vue";
2
+import {materialManage, reactiveTableAndAny} from "@/api/ApiModel";
3
+import {Api} from "@/api/api";
4
+import {ElMessage} from "element-plus";
5
+
6
+
7
+
8
+export function searchBoxTs(mType?:number){
9
+    const { proxy } = getCurrentInstance() as any;
10
+    // 全局方法定义
11
+    const NumberHandle = proxy.$NumberHandle
12
+
13
+    const InputRef_text = ref<{value:string}>()
14
+    const mtypeRef = ref<{value:string|number}>()
15
+    const ctypeRef = ref<{value:string|number}>()
16
+    const sizeTypeRef = ref<{value:string|number}>()
17
+    const ideaManRef = ref<{value:string|number}>()
18
+    const designerRef = ref<{value:string|number}>()
19
+    const CataRef = ref<{value:string,idVal:number,initAllAlbum:()=>void}>()
20
+    const tagRef = ref<{init:()=>void}>()
21
+    const timeRef = ref<{dateVal:any}>()
22
+    //图片还是视频
23
+    const m_type = ref<any>()
24
+
25
+    const pageInfo = reactive<reactiveTableAndAny>({
26
+        materialList:[],
27
+        chooseList:[],//选中素材的id
28
+        moreList:[
29
+            {label:'修改标签',value:'1'},
30
+            {label:'修改设计师',value:'3'},
31
+            {label:'修改创意人',value:'4'},
32
+            {label:'迅雷下载',value:'5'},
33
+            {label:'删除',value:'6'},
34
+        ],
35
+        typeList:[
36
+            {label:'视频',value:1},
37
+            {label:'图片',value:2},
38
+        ],
39
+        getTypeList:[
40
+            {label:'本地上传',value:1},
41
+            {label:'媒体下载',value:2},
42
+        ],
43
+        tagChooseVal:[],
44
+        sizeTypeList:[],
45
+        createrList:[],
46
+        editorList:[],
47
+        shortList:[
48
+            {
49
+                text: '近7天',
50
+                value: () => {
51
+                    const end = new Date()
52
+                    const start = new Date()
53
+                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
54
+                    return [start, end]
55
+                },
56
+            },
57
+            {
58
+                text: '近30天',
59
+                value: () => {
60
+                    const end = new Date()
61
+                    const start = new Date()
62
+                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
63
+                    return [start, end]
64
+                },
65
+            },
66
+            {
67
+                text: '近90天',
68
+                value: () => {
69
+                    const end = new Date()
70
+                    const start = new Date()
71
+                    start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
72
+                    return [start, end]
73
+                },
74
+            },
75
+        ],
76
+        tasksList:[],
77
+        chooseList_Item:[],//选中素材的整个obj
78
+    })
79
+
80
+    //创意师
81
+    const init_createrList = async () => {
82
+        let res:any = await proxy.$http.get(Api.account_list)
83
+        if(res&&res.errNo=='0'){
84
+            pageInfo.createrList = res.rst
85
+            pageInfo.editorList = res.rst
86
+        }else{
87
+            ElMessage.error(res.errMsg)
88
+        }
89
+    }
90
+
91
+
92
+    //获取尺寸列表
93
+    const getSizeList = async () => {
94
+        let res:any = await proxy.$http.get(Api.sizeTypeList)
95
+        if(res&&res.errNo=='0'){
96
+            let resNew:any = res.rst
97
+            pageInfo.sizeTypeList = []
98
+            resNew.forEach(item=>{
99
+                pageInfo.sizeTypeList.push({
100
+                    label:item,
101
+                    value:item
102
+                })
103
+            })
104
+        }else{
105
+            ElMessage.error(res.errMsg)
106
+        }
107
+    }
108
+
109
+
110
+    //列表
111
+    const total = ref<number>()
112
+    const currentPage = ref<number>(1)
113
+    const pageSize = ref<number>(20)
114
+    const loading = ref<boolean>(false)
115
+    const handleCurrentChange = (val:number) => {
116
+        init(val)
117
+    }
118
+    const init = async (page?:any) => {
119
+        loading.value = true
120
+        currentPage.value = page ? page : 1
121
+        const paramsModel = reactive<materialManage>({
122
+            name:InputRef_text.value!.value,
123
+            folder_id:CataRef.value!.idVal,
124
+            tags:pageInfo.tagChooseVal,
125
+            start:timeRef.value!.dateVal ? timeRef.value!.dateVal[0] : '',
126
+            end:timeRef.value!.dateVal ? timeRef.value!.dateVal[1] : '',
127
+            size_type:sizeTypeRef.value!.value,
128
+            idea_man:ideaManRef.value!.value,
129
+            designer:designerRef.value!.value,
130
+            page:page?page:currentPage.value,
131
+            pageSize:pageSize.value,
132
+        })
133
+        if(!mType){ // 素材库
134
+            paramsModel.mtype = mtypeRef.value!.value
135
+            paramsModel.ctype = ctypeRef.value!.value
136
+        }else{ //创意 - 素材弹框
137
+            paramsModel.mtype =  m_type.value
138
+        }
139
+        let res:any = await proxy.$http.get(Api.materialManage_list,paramsModel)
140
+        loading.value = false
141
+        if(res&&res.errNo=='0'){
142
+            let resNew:any = res.rst
143
+            if(resNew.data){
144
+                pageInfo.materialList = resNew.data
145
+            }else{
146
+                pageInfo.materialList = []
147
+            }
148
+            total.value = resNew.pageInfo.total
149
+        }else{
150
+            ElMessage.error(res.errMsg)
151
+        }
152
+    }
153
+
154
+    const initAll = (mType?:number) => {
155
+        nextTick(()=>{
156
+            m_type.value = mType || ''
157
+            init()
158
+            getSizeList()
159
+            init_createrList()
160
+            CataRef.value!.initAllAlbum()
161
+            tagRef.value!.init()
162
+        })
163
+    }
164
+
165
+//选择素材
166
+    const checkChangeItem = (flag: any,obj:any) => {
167
+        if(flag){
168
+            pageInfo.chooseList.push(obj.id)
169
+            pageInfo.chooseList_Item.push(obj)
170
+            //迅雷下载的列表
171
+            pageInfo.tasksList.push({
172
+                name:obj.name,
173
+                url:obj.oss_url,
174
+            })
175
+        }else{
176
+            let idx:number = pageInfo.chooseList.findIndex(n=>n==obj.id)
177
+            pageInfo.chooseList.splice(idx,1)
178
+            pageInfo.tasksList.splice(idx,1)
179
+            pageInfo.chooseList_Item.splice(idx,1)
180
+        }
181
+    }
182
+
183
+
184
+    return {
185
+        pageInfo,
186
+        InputRef_text,
187
+        mtypeRef,
188
+        ctypeRef,
189
+        sizeTypeRef,
190
+        ideaManRef,
191
+        designerRef,
192
+        CataRef,
193
+        tagRef,
194
+        timeRef,
195
+        loading,
196
+        currentPage,
197
+        pageSize,
198
+        total,
199
+        init,
200
+        init_createrList,
201
+        getSizeList,
202
+        handleCurrentChange,
203
+        initAll,
204
+        checkChangeItem
205
+    }
206
+}

+ 1 - 1
src/components/businessMoudle/batchGdt/configArea/directPacket/useDirect.vue

@@ -39,7 +39,7 @@
39 39
                 <template #content>
40 40
                   <PreviewInfo :propInfo="{list:slotProps.row.jsonInfo}"></PreviewInfo>
41 41
                 </template>
42
-                <el-icon :size="14" color="#999" class="lMar5"><i-ep-InfoFilled /></el-icon>
42
+                <el-icon :size="14" color="#d3d3d3" class="lMar5"><i-ep-InfoFilled /></el-icon>
43 43
               </el-tooltip>
44 44
             </div>
45 45
           </template>

+ 1 - 1
src/components/businessMoudle/batchGdt/configArea/directPacket/useDirectCon.vue

@@ -33,7 +33,7 @@
33 33
                 <template #content>
34 34
                   <PreviewInfo :propInfo="{list:slotProps.row.jsonInfo}"></PreviewInfo>
35 35
                 </template>
36
-                <el-icon :size="14" color="#999" class="lMar5"><i-ep-InfoFilled /></el-icon>
36
+                <el-icon :size="14" color="#d3d3d3" class="lMar5"><i-ep-InfoFilled /></el-icon>
37 37
               </el-tooltip>
38 38
             </div>
39 39
           </template>

+ 8 - 3
src/components/businessMoudle/materialLibrary/block/materialBlock.vue

@@ -20,8 +20,9 @@
20 20
       <div class="conBox">
21 21
         <div class="flex">
22 22
           <span style="width: 190px" class="clampOne" :title="paramsObj.name">{{paramsObj.name || '-'}}</span>
23
-          <span class="lMarauto c-theme pointer f12" @click="goDetial">详情</span>
23
+          <span class="lMarauto c-theme pointer f12" @click="goDetial" v-if="showDetialFlag">详情</span>
24 24
         </div>
25
+        <div v-if="showCreateTimeFlag" class="tMar6 c-666 f12">上传时间: {{paramsObj.created_at}}</div>
25 26
         <!--     <div class="tMar40 statusCss" :class="paramsObj.status == 1 ? 's2' : 's1'">-->
26 27
         <!--       {{paramsObj.status == 1 ? '无消耗' : '未使用'}}-->
27 28
         <!--     </div>-->
@@ -57,12 +58,16 @@ const props = withDefaults(defineProps<{
57 58
   paramsObj:any,
58 59
   checkShow?:boolean,
59 60
   idName?:string,
60
-  folderIdName?:string
61
+  folderIdName?:string,
62
+  showDetialFlag?:boolean,
63
+  showCreateTimeFlag?:boolean,
61 64
 }>(),{
62 65
   paramsObj:{},
63 66
   checkShow:false,
64 67
   idName:'id',
65
-  folderIdName:'folder_id'
68
+  folderIdName:'folder_id',
69
+  showDetialFlag:true,
70
+  showCreateTimeFlag:false
66 71
 })
67 72
 
68 73
 const changeEvent = (val:any) => {

+ 5 - 0
src/components/businessMoudle/materialLibrary/index.vue

@@ -17,7 +17,9 @@ import {publicSwitchType} from "@/components/businessMoudle/switchType";
17 17
 import album from "./album.vue";
18 18
 import material from "./material.vue";
19 19
 import {getCurrentInstance, nextTick, onMounted, reactive, shallowRef,markRaw} from "vue";
20
+import { useRoute  } from "vue-router";
20 21
 
22
+const route = useRoute();
21 23
 
22 24
 const { proxy } = getCurrentInstance() as any;
23 25
 // 全局方法定义
@@ -42,6 +44,9 @@ const switchTypeItem = (item:any) => {
42 44
   acIdx.value = item.compName
43 45
 }
44 46
 
47
+const {query:{type}}  = route
48
+typeAc.value = type ? type : 'album'
49
+acIdx.value = type&&type=='material' ? markRaw(material) : markRaw(album)
45 50
 onMounted(()=>{
46 51
   nextTick(()=>{
47 52
 

+ 27 - 149
src/components/businessMoudle/materialLibrary/material.vue

@@ -124,6 +124,7 @@ import Select from '@/components/capsulationMoudle/_select.vue'
124 124
 import TimeScreen from '@/components/capsulationMoudle/timeScreen.vue'
125 125
 import Input from '@/components/capsulationMoudle/_input.vue'
126 126
 import Dropdown from '@/components/capsulationMoudle/_dropdown.vue'
127
+import {searchBoxTs} from '@/components/businessMoudle/batchGdt/configArea/creativeMaterial/ts/searchBox'
127 128
 import { collectParam, materialManage, reactiveTableAndAny} from "@/api/ApiModel";
128 129
 import {Api} from "@/api/api";
129 130
 import {ElMessage} from "element-plus";
@@ -132,105 +133,12 @@ const { proxy } = getCurrentInstance() as any;
132 133
 // 全局方法定义
133 134
 const NumberHandle = proxy.$NumberHandle
134 135
 
135
-const pageInfo = reactive<reactiveTableAndAny>({
136
-  materialList:[],
137
-  chooseList:[],
138
-  moreList:[
139
-    {label:'修改标签',value:'1'},
140
-    {label:'修改设计师',value:'3'},
141
-    {label:'修改创意人',value:'4'},
142
-    {label:'迅雷下载',value:'5'},
143
-    {label:'删除',value:'6'},
144
-  ],
145
-  typeList:[
146
-    {label:'视频',value:1},
147
-    {label:'图片',value:2},
148
-  ],
149
-  getTypeList:[
150
-    {label:'本地上传',value:1},
151
-    {label:'媒体下载',value:2},
152
-  ],
153
-  tagChooseVal:[],
154
-  sizeTypeList:[],
155
-  createrList:[],
156
-  editorList:[],
157
-  shortList:[
158
-    {
159
-      text: '近7天',
160
-      value: () => {
161
-        const end = new Date()
162
-        const start = new Date()
163
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
164
-        return [start, end]
165
-      },
166
-    },
167
-    {
168
-      text: '近30天',
169
-      value: () => {
170
-        const end = new Date()
171
-        const start = new Date()
172
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
173
-        return [start, end]
174
-      },
175
-    },
176
-    {
177
-      text: '近90天',
178
-      value: () => {
179
-        const end = new Date()
180
-        const start = new Date()
181
-        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
182
-        return [start, end]
183
-      },
184
-    },
185
-  ],
186
-  tasksList:[]
187
-})
188
-
189
-//创意师
190
-const init_createrList = async () => {
191
-  let res:any = await proxy.$http.get(Api.account_list)
192
-  if(res&&res.errNo=='0'){
193
-    pageInfo.createrList = res.rst
194
-    pageInfo.editorList = res.rst
195
-  }else{
196
-    ElMessage.error(res.errMsg)
197
-  }
198
-}
199 136
 
200
-//获取尺寸列表
201
-const getSizeList = async () => {
202
-  let res:any = await proxy.$http.get(Api.sizeTypeList)
203
-  if(res&&res.errNo=='0'){
204
-    let resNew:any = res.rst
205
-    pageInfo.sizeTypeList = []
206
-    resNew.forEach(item=>{
207
-      pageInfo.sizeTypeList.push({
208
-        label:item,
209
-        value:item
210
-      })
211
-    })
212
-  }else{
213
-    ElMessage.error(res.errMsg)
214
-  }
215
-}
216 137
 
217 138
 //批量操作
218 139
 const batchShow = ref<boolean>(false)
219 140
 const allBatchVal = ref<boolean>(false)
220
-//选择素材
221
-const checkChangeItem = (flag: any,obj:any) => {
222
-  if(flag){
223
-    pageInfo.chooseList.push(obj.id)
224
-    pageInfo.tasksList.push({
225
-      name:obj.name,
226
-      url:obj.oss_url,
227
-    })
228
-  }else{
229
-    let idx:number = pageInfo.chooseList.findIndex(n=>n==obj.id)
230
-    pageInfo.chooseList.splice(idx,1)
231
-    pageInfo.tasksList.splice(idx,1)
232
-  }
233
-}
141
+
234 142
 //全选
235 143
 const allBatchEvent = (val: any) => {
236 144
   if(val){
@@ -333,63 +241,33 @@ const dropdownEvent = (val: string | number | object) => {
333 241
   }
334 242
 }
335 243
 
336
-//列表
337
-const total = ref<number>()
338
-const currentPage = ref<number>(1)
339
-const pageSize = ref<number>(20)
340
-const loading = ref<boolean>(false)
341
-const InputRef_text = ref<{value:string}>()
342
-const mtypeRef = ref<{value:string|number}>()
343
-const ctypeRef = ref<{value:string|number}>()
344
-const sizeTypeRef = ref<{value:string|number}>()
345
-const ideaManRef = ref<{value:string|number}>()
346
-const designerRef = ref<{value:string|number}>()
347
-const CataRef = ref<{value:string,idVal:number,initAllAlbum:()=>void}>()
348
-const tagRef = ref<{init:()=>void}>()
349
-const timeRef = ref<{dateVal:any}>()
350
-const handleCurrentChange = (val:number) => {
351
-    init(val)
352
-}
353
-const init = async (page?:any) => {
354
-  loading.value = true
355
-  currentPage.value = page ? page : 1
356
-  const paramsModel = reactive<materialManage>({
357
-    name:InputRef_text.value!.value,
358
-    folder_id:CataRef.value!.idVal,
359
-    mtype:mtypeRef.value!.value,
360
-    ctype:ctypeRef.value!.value,
361
-    tags:pageInfo.tagChooseVal,
362
-    start:timeRef.value!.dateVal ? timeRef.value!.dateVal[0] : '',
363
-    end:timeRef.value!.dateVal ? timeRef.value!.dateVal[1] : '',
364
-    size_type:sizeTypeRef.value!.value,
365
-    idea_man:ideaManRef.value!.value,
366
-    designer:designerRef.value!.value,
367
-    page:page?page:currentPage.value,
368
-    pageSize:pageSize.value,
369
-  })
370
-  let res:any = await proxy.$http.get(Api.materialManage_list,paramsModel)
371
-  loading.value = false
372
-  if(res&&res.errNo=='0'){
373
-    let resNew:any = res.rst
374
-    if(resNew.data){
375
-      pageInfo.materialList = resNew.data
376
-    }else{
377
-      pageInfo.materialList = []
378
-    }
379
-    total.value = resNew.pageInfo.total
380
-  }else{
381
-    ElMessage.error(res.errMsg)
382
-  }
383
-}
244
+
245
+//公共ts 和 创意-素材库共用
246
+const {
247
+  pageInfo,
248
+  InputRef_text,
249
+  mtypeRef,
250
+  ctypeRef,
251
+  sizeTypeRef,
252
+  ideaManRef,
253
+  designerRef,
254
+  CataRef,
255
+  tagRef,
256
+  timeRef,
257
+  loading,
258
+  currentPage,
259
+  pageSize,
260
+  total,
261
+  init,
262
+  init_createrList,
263
+  getSizeList,
264
+  handleCurrentChange,
265
+  initAll,
266
+  checkChangeItem
267
+} = searchBoxTs()
384 268
 
385 269
 onMounted(()=>{
386
-  nextTick(()=>{
387
-    init()
388
-    getSizeList()
389
-    init_createrList()
390
-    CataRef.value!.initAllAlbum()
391
-    tagRef.value!.init()
392
-  })
270
+  initAll()
393 271
 })
394 272
 </script>
395 273
 <style lang="scss" scoped>

+ 17 - 6
src/components/capsulationMoudle/_tooltip.vue

@@ -1,8 +1,13 @@
1 1
 <template>
2
-  <el-tooltip :effect="effect" raw-content >
3
-    <template #content>{{notes}}</template>
4
-    <template v-if="slotFalg"><slot name="content"></slot></template>
5
-    <i-ep-QuestionFilled v-if="!slotFalg" class="lMar5  f14 pointer" :class="colorCss"/>
2
+  <el-tooltip :effect="effect" raw-content :placement="placement">
3
+    <!--    提示框的内容-->
4
+    <template #content>
5
+      <template v-if="contentSlotFalg"><slot name="content"></slot></template>
6
+      <template v-else>{{notes}}</template>
7
+    </template>
8
+    <!--    提示框的图标-->
9
+    <template v-if="iconSlotFalg"><slot name="iconSlot"></slot></template>
10
+    <i-ep-QuestionFilled v-if="!iconSlotFalg" class="lMar5  f14 pointer" :class="colorCss"/>
6 11
   </el-tooltip>
7 12
 </template>
8 13
 <script lang="ts" setup>
@@ -10,11 +15,17 @@ const props = withDefaults(defineProps<{
10 15
   notes?: string,
11 16
   colorCss?: string,
12 17
   effect?: string,
13
-  slotFalg?:boolean
18
+  iconSlotFalg?:boolean,
19
+  contentFlag?:boolean,
20
+  contentSlotFalg?:boolean,
21
+  placement?:string,
14 22
 }>(), {
15 23
   notes: '',
16 24
   colorCss: 'c-999',
17 25
   effect: 'light',
18
-  slotFalg:false
26
+  iconSlotFalg:false,
27
+  contentFlag:false,
28
+  contentSlotFalg:false,
29
+  placement:'bottom'
19 30
 })
20 31
 </script>