uploadMultimediaImg.blade.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992
  1. <template id="ImgMul">
  2. <div styl="width:800px">
  3. <el-dialog
  4. :visible.sync="uploadShow"
  5. width="800px"
  6. :before-close="beforeClose"
  7. v-if="imgLoading"
  8. >
  9. <el-tabs v-model="activeName" @tab-click="handleClick">
  10. <el-tab-pane :label="'选取' + tabPan" name="first">
  11. <div class="clearfix con-box">
  12. <div class="scroll-box fl">
  13. <div class="left-group fl" :class="groupList.length > 17?'bor-right':''" >
  14. <p class="D-gro" v-for="(item,index) in groupList" :class="item.id == groupId && index == groupIndex ? 'text-bg' : ''" @click="handleGroup(item.id,index)">[[item.title]]([[item.source_count]])</p>
  15. </div>
  16. </div>
  17. <div class="right-img" :class="groupList.length <= 17?'bor-left':''">
  18. <div style="margin:10px 0 10px 10px">
  19. <el-date-picker
  20. v-model="filterDate"
  21. type="month"
  22. placeholder="选择月"
  23. @change="getMultimediaList('',page_size,1)"
  24. >
  25. </el-date-picker>
  26. </div>
  27. <!-- <div class="img-hint"> -->
  28. <!-- <span style="margin-right:20px">[[type == 1?'大小不超过4M,已关闭图片水印':'']]<i v-if="type == 1" class="el-icon-question"></i></span> -->
  29. <!-- <el-upload
  30. :action="uploadLink"
  31. ref="upload"
  32. multiple
  33. :on-success="handleSucesss"
  34. :on-exceed="handleExceed"
  35. :on-preview="handlePreview"
  36. :before-upload="beforeUpload"
  37. >
  38. <el-button size="small" type="primary">点击上传</el-button>
  39. </el-upload>
  40. </div> -->
  41. <!-- 没有数据 -->
  42. <div v-if="resourceList.length <= 0" style="text-align:center;margin-top:20px">
  43. 暂没有数据~
  44. </div>
  45. <!-- 图片 type:1 -->
  46. <div v-if="type == 1" class='img-source fl' v-for="(item,index) in resourceList" @click.stop="handChecked($event,item.id,item)">
  47. <img :src="item.url" alt="">
  48. <p>[[item.filename]]</p>
  49. <div class="img-mark" :style="{ display: item.is_choose ? 'block' : '' }">
  50. <!-- @change="handChecked($event,item.id,item)" -->
  51. <el-checkbox v-model="item.is_choose" class="sle-img"></el-checkbox>
  52. </div>
  53. </div>
  54. <!-- 视频 type:3 -->
  55. <div class="vedio-source fl" v-for="(item,index) in resourceList" v-if="type == 3" @click.stop="handChecked($event,item.id,item)">
  56. <div class="vedio-upload fl">
  57. <video :src="item.url"></video>
  58. </div>
  59. <p class="fl ellipsis" style="margin:20px 0 0 15px;width:110px;">[[item.filename]]</p>
  60. <p class="fl ellipsis" style="margin:20px 0 0 15px">[[item.created_at]]</p>
  61. <div class="video-mark" :style="{ display: item.is_choose ? 'block' : '' }">
  62. <el-checkbox v-model="item.is_choose" class="sle-img"></el-checkbox>
  63. </div>
  64. <span class="video-time"><i class="play-triangle"></i>[[Math.floor(item.timeline / 60)]]:[[Math.floor(item.timeline % 60) >= 10?Math.floor(item.timeline % 60):'0' + Math.floor(item.timeline % 60)]]</span>
  65. </div>
  66. <!-- 音频 type: 2 -->
  67. <div class="audio-source fl" v-for="(item,index) in resourceList" v-if="type == 2" @click.stop="handChecked($event,item.id,item)">
  68. <div class="fl">
  69. <p style="margin:8px 0 0 30px;width:180px;" class="ellipsis">[[item.filename]]</p>
  70. <p style="margin:20px 0 0 30px;" >[[item.created_at]]</p>
  71. </div>
  72. <div class="fr play-box" @click="playClic()">
  73. <img src="../../../../static/images/play.png" alt="">
  74. <!-- <img src="../../../../static/images/puse.png" alt=""> -->
  75. <p>[[Math.floor(Number(item.timeline) / 60)]]:[[Math.floor(Number(item.timeline) % 60)]]</p>
  76. </div>
  77. <div class="video-mark" :style="{ display: item.is_choose ? 'block' : '' }">
  78. <el-checkbox v-model="item.is_choose" class="sle-img"></el-checkbox>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="handel clearfix">
  84. <el-popover placement="top" width="300" trigger="click">
  85. <span style="color:#409eff;cursor: pointer;" class="fl" slot="reference" >新建分组</span>
  86. <p class="gro-inp">请输入分组名称</p>
  87. <el-input v-model="newGroupName" placeholder="" style="margin-bottom:15px" maxlength="6"show-word-limit></el-input>
  88. <el-button type="primary" class="gro-sure" @click="handAddGroup()" style="margin-left:30px">确定</el-button>
  89. <el-button class="gro-cancel" @click="handCancelGroup()" style="margin-left:50px">取消</el-button>
  90. </el-popover>
  91. <div class="fr">
  92. <el-pagination
  93. background
  94. @current-change="currentChange"
  95. layout="prev, pager, next"
  96. :current-page="current_page"
  97. :page-size.sync="Number(page_size)"
  98. :total="page_total">
  99. </el-pagination>
  100. </div>
  101. </div>
  102. </el-tab-pane>
  103. <el-tab-pane :label="tanPanNet" name="second" class="getNet" v-if="type == 1 || type == 3">
  104. <div class="getnetimg" v-if="type == 1">
  105. <el-image
  106. class="defaultImg"
  107. :src="previewUrl"
  108. >
  109. <div slot="error" class="image-slot">
  110. <i class="el-icon-picture-outline" style="font-size:40px"></i>
  111. </div>
  112. </el-image>
  113. <div>
  114. <p>输入图片链接</p>
  115. <el-input v-model="imgLink" placeholder="图片链接" style="width:60%;margin:20px"></el-input>
  116. <p>
  117. <el-button style="margin-bottom:20px;width:100px" @click="conversion()">转化</el-button>
  118. </p>
  119. </div>
  120. </div>
  121. <div class="getnetvideo" v-if="type == 3">
  122. <span>视频链接</span>
  123. <el-input v-model="videoLink" placeholder="视频链接" style="width:60%;margin:20px"></el-input>
  124. <el-button type="primary" style="width:80px" @click="getNetVideo()">确定</el-button>
  125. <!-- <div v-if="viewVideoLink != ''">
  126. <video :src="viewVideoLink" controls></video>
  127. </div> -->
  128. </div>
  129. <!-- <div class="getnetaudio" v-if="type == 3">
  130. <span>音频链接</span>
  131. <el-input v-model="imgLink" placeholder="音频链接" style="width:60%;margin:20px"></el-input>
  132. <el-button type="primary" style="width:80px">确定</el-button>
  133. </div> -->
  134. </el-tab-pane>
  135. </el-tabs>
  136. <div class="img-hint">
  137. <!-- <span style="margin-right:20px">[[type == 1?'大小不超过4M,已关闭图片水印':'']]<i v-if="type == 1" class="el-icon-question"></i></span> -->
  138. <el-upload
  139. :action="uploadLink"
  140. ref="upload"
  141. :accept="uploadAccept"
  142. :multiple = "multipleTag"
  143. :on-success="handleSucesss"
  144. :on-exceed="handleExceed"
  145. :on-preview="handlePreview"
  146. :before-upload="beforeUpload"
  147. >
  148. <el-button size="small" type="primary">点击上传</el-button>
  149. </el-upload>
  150. </div>
  151. <div class="uploading-btn">
  152. <span>已选择</span>
  153. <span v-if="type == 1" style="color:#409eff;">[[selectCount]]/[[resourceTotal]]个图片</span>
  154. <span v-if="type == 3" style="color:#409eff;">[[selectCount]]/[[resourceTotal]]个视频</span>
  155. <span v-if="type == 2" style="color:#409eff;">[[selectCount]]/[[resourceTotal]]个音频</span>
  156. <span slot="footer" class="dialog-footer">
  157. <el-button type="primary" @click="sureImg" style="margin-left:20%;width:100px">确 定</el-button>
  158. <el-button @click="beforeClose" style="margin-left:5%;width:100px;">取 消</el-button>
  159. </span>
  160. </div>
  161. </el-dialog>
  162. </div>
  163. </template>
  164. <script>
  165. Vue.component('uploadMultimediaImg', {
  166. props: {
  167. uploadShow:Boolean,
  168. type:{
  169. type:String,
  170. default:1
  171. },
  172. name:{
  173. type:String,
  174. default:""
  175. },
  176. sourceType:{
  177. type:String,
  178. default:"image"
  179. },
  180. selNum:{
  181. type:String,
  182. default:"one"
  183. },
  184. platformType:{
  185. type:String,
  186. default:'1'
  187. },
  188. },
  189. delimiters: ['[[', ']]'],
  190. data(){
  191. return{
  192. imgLoading: false,
  193. activeName:'first',
  194. imgChecked:'',
  195. newGroupName:'',
  196. currentPage3:0,
  197. netUrl:'',
  198. imgLink:'',
  199. groupList:[],
  200. groupId:'',
  201. groupIndex:'',
  202. imgList:[],
  203. page_size:12,//
  204. page:1,//默认请求第一页
  205. current_page:0,
  206. page_total:0,
  207. file:{},
  208. vedioList:[],
  209. audioList:[],
  210. tanPanNet:'',
  211. tabPan:'',
  212. resourceTotal:0,
  213. tabPanStatus:'',
  214. selectArr:[],
  215. netImg:{},
  216. previewUrl:'',
  217. fileList:[],
  218. resourceList:[],
  219. uploadType:'',
  220. uploadLink:'',
  221. selectCount:0,
  222. videoLink:'',
  223. viewVideoLink:'',
  224. currentPage:1,
  225. multipleTag:null,
  226. filterDate:null,
  227. uploadAccept:""
  228. }
  229. },
  230. watch:{
  231. uploadShow() {
  232. if(this.uploadShow) {
  233. this.getGroupList(this.type)
  234. this.getMultimediaList('',this.page_size,this.page)
  235. }
  236. },
  237. type() {
  238. if(this.type ==1) {
  239. this.uploadAccept = "image/*";
  240. this.tabPan = '图片'
  241. this.tanPanNet = '提取网络图片'
  242. this.uploadLink = "{!! yzWebFullUrl('upload.uploadV3.upload') !!}"+'&upload_type='+'image'+'&tag_id='+ ''
  243. this.page_size = 12
  244. } else if(this.type == 3) {
  245. this.uploadAccept = ".mp4,.mov,.avi";
  246. this.tabPan = '视频'
  247. this.tanPanNet ='提取网络视频'
  248. this.uploadLink = "{!! yzWebFullUrl('upload.uploadV3.upload') !!}"+'&upload_type='+'video'+'&tag_id='+ ''
  249. this.page_size = 8
  250. } else {
  251. this.uploadAccept = "audio/*";
  252. this.tabPan = '音频'
  253. this.tanPanNet = '提取网络音频'
  254. this.uploadLink = "{!! yzWebFullUrl('upload.uploadV3.upload') !!}"+'&upload_type='+'audio'+'&tag_id='+ ''
  255. this.page_size = 8
  256. }
  257. },
  258. selNum() {
  259. if(this.selNum == 'one') {
  260. this.multipleTag = false//单个选择的不支持多个同时上传
  261. }
  262. // alert(this.selNum);
  263. if(this.selNum == 'more') {
  264. this.multipleTag = true//单个选择的不支持多个同时上传
  265. }
  266. }
  267. },
  268. methods:{
  269. // 获取分组列表
  270. getGroupList(type) {
  271. this.type = type;//存储父组件传过来的资源类型,方便新建分组的时候使用
  272. this.$http.post("{!! yzWebFullUrl('setting.media.tags') !!}", {
  273. source_type: type
  274. }).then(response => {
  275. if (response.data.result) {
  276. this.groupList = response.data.data;
  277. this.groupId = this.groupList[0].id
  278. this.imgLoading = true
  279. } else {
  280. this.$message({
  281. message: response.data.msg,
  282. type: 'error'
  283. });
  284. }
  285. }, response => {
  286. this.$message({
  287. message: response.data.msg,
  288. type: 'error'
  289. });
  290. });
  291. },
  292. getMultimediaList(id,pageSize,page) {
  293. let url = ''
  294. if(this.type == 1) {//图片
  295. url = "{!! yzWebFullUrl('upload.uploadV3.getImage') !!}"
  296. this.page_size = 12
  297. } else if(this.type == 3) {//视频
  298. url = "{!! yzWebFullUrl('upload.uploadV3.getVideo') !!}"
  299. this.page_size = 8
  300. console.log(this.page_size,'34567890')
  301. } else {//音频
  302. url = "{!! yzWebFullUrl('upload.uploadV3.getAudio') !!}"
  303. this.page_size = 8
  304. }
  305. let filterDate={
  306. year:null,
  307. month:null
  308. }
  309. if (this.platformType == '1') {
  310. url += "&platform_type=1";
  311. } else {
  312. url += "&platform_type=2";
  313. }
  314. if(this.filterDate){
  315. let d=new Date(this.filterDate);
  316. filterDate.year=d.getFullYear();
  317. filterDate.month=d.getMonth()+1;
  318. }
  319. this.$http.post(url, {
  320. tag_id: id,
  321. pageSize:this.page_size,
  322. page:page,
  323. date:filterDate
  324. }).then(response => {
  325. if (response.data.result) {
  326. this.page_total= response.data.data.total
  327. // this.page_size = response.data.per_page;
  328. this.current_page = response.data.data.current_page;
  329. this.resourceTotal = response.data.data.total
  330. this.resourceList = response.data.data.data
  331. this.imgLoading = true
  332. this.resourceList.forEach((item, index) => {
  333. item['is_choose'] = 0
  334. });
  335. } else {
  336. this.$message({
  337. message: response.data.msg,
  338. type: 'error'
  339. });
  340. }
  341. }, response => {
  342. this.$message({
  343. message: response.data.msg,
  344. type: 'error'
  345. });
  346. });
  347. },
  348. // 添加分组
  349. addGroup(sourceType, groupName) {
  350. this.$http.post("{!! yzWebFullUrl('setting.media.addTag') !!}", {
  351. source_type: sourceType,
  352. title: groupName
  353. }).then(response => {
  354. if (response.data.result) {
  355. this.closePopover()
  356. this.$message({
  357. message: '添加分组成功',
  358. type: 'success'
  359. });
  360. } else {
  361. this.$message({
  362. message: response.data.msg,
  363. type: 'error'
  364. });
  365. }
  366. }, response => {
  367. this.$message({
  368. message: response.data.msg,
  369. type: 'error'
  370. });
  371. });
  372. },
  373. // 提取网络图片
  374. getNetImg(url,tag_id) {
  375. this.$http.post("{!! yzWebFullUrl('upload.uploadV3.fetch') !!}", {
  376. url,
  377. tag_id
  378. }).then(response => {
  379. if (response.data.result) {
  380. this.netImg = response.data.data
  381. console.log(this.netImg,'网络图片')
  382. this.imgLink = '',
  383. this.$message({
  384. message: '图片已提取到未分组',
  385. type: 'success'
  386. });
  387. } else {
  388. this.$message({
  389. message: response.data.msg,
  390. type: 'error'
  391. });
  392. }
  393. }, response => {
  394. this.$message({
  395. message: response.data.msg,
  396. type: 'error'
  397. });
  398. });
  399. },
  400. handleGroup(id,ind) {
  401. this.groupIndex = ind;
  402. this.groupId = id
  403. this.getMultimediaList(id,this.page_size,this.page)//请求每一个分组的资源
  404. this.selectArr = []
  405. if(this.type == 1) {
  406. this.uploadLink = "{!! yzWebFullUrl('upload.uploadV3.upload') !!}"+'&upload_type='+'image'+'&tag_id='+ this.groupId
  407. } else if(this.type == 3) {
  408. this.uploadLink = "{!! yzWebFullUrl('upload.uploadV3.upload') !!}"+'&upload_type='+'video'+'&tag_id='+ this.groupId
  409. } else {
  410. this.uploadLink = "{!! yzWebFullUrl('upload.uploadV3.upload') !!}"+'&upload_type='+'audio'+'&tag_id='+ this.groupId
  411. }
  412. this.selectCount = 0
  413. },
  414. // 新建分组
  415. handAddGroup() {
  416. if (this.newGroupName == '') {
  417. this.$message({
  418. message: '分组名不能为空',
  419. type: 'error'
  420. });
  421. return
  422. }
  423. console.log(this.type);
  424. this.addGroup(this.type, this.newGroupName)
  425. this.newGroupName = ''
  426. // 新建完分组后重新请求分组列表接口
  427. setTimeout(() => {
  428. this.getGroupList(this.type)
  429. }, 800);
  430. this.closePopover()
  431. },
  432. handCancelGroup() {
  433. this.newGroupName = ''
  434. this.closePopover()
  435. },
  436. closePopover() {
  437. if (document.all) {
  438. document.getElementById('ImgMul').click();
  439. } else {// 其它浏览器
  440. var e = document.createEvent('MouseEvents')
  441. e.initEvent('click', true, true)
  442. document.getElementById('ImgMul').dispatchEvent(e)
  443. }
  444. },
  445. // 弹窗的关闭事件
  446. handleClose(done) {
  447. },
  448. handleClick(tab, event) {
  449. this.tabPanStatus = tab.paneName
  450. this.imgLink = ''
  451. this.previewUrl = ''
  452. },
  453. handleSizeChange() {
  454. },
  455. currentChange(val){
  456. this.currentPage = val
  457. this.getMultimediaList(this.groupId,this.page_size,val)
  458. this.selectCount = 0
  459. },
  460. // 取消按钮
  461. beforeClose() {
  462. this.activeName == 'first'
  463. this.$emit('replace', this.uploadShow);
  464. this.fileList = []
  465. this.resourceList=[]//弹窗退出清空数据,取消勾选状态
  466. this.groupId = ''
  467. this.groupIndex=''
  468. this.activeName = 'first'
  469. },
  470. // 确定按钮
  471. sureImg(){
  472. if( this.activeName == 'first') {
  473. let list = []
  474. this.resourceList.forEach(item => {
  475. if(item.is_choose == true) {
  476. list.push(item)
  477. }
  478. })
  479. this.fileList = list
  480. this.$emit('sure',this.name, this.uploadShow,this.fileList);
  481. this.beforeClose();
  482. this.fileList = []
  483. this.resourceList=[]//弹窗退出清空数据,取消勾选状态
  484. } else if(this.fileList.length <= 0) {
  485. // 提取网络视频
  486. if(this.type == '3' && this.viewVideoLink) {
  487. this.$emit('sure',this.name, this.uploadShow,this.viewVideoLink);
  488. this.videoLink = '';
  489. this.beforeClose();
  490. return
  491. };
  492. this.beforeClose();
  493. } else {
  494. this.$emit('sure',this.name, this.uploadShow)
  495. this.beforeClose();
  496. this.fileList = []
  497. }
  498. this.activeName = 'first'
  499. },
  500. beforeUpload(file) {
  501. console.log(file,'12456783456789')
  502. this.resourceList.forEach(item => {
  503. return item.is_choose = false
  504. })
  505. // this.imgLoading = true;
  506. // const isLt2M = file.size / 1024 / 1024 < 4;
  507. // if (!isLt2M) {
  508. // this.$message.error("上传文件大小不能超过 4MB!");
  509. // // this.imgLoading = false;
  510. // }
  511. // return isLt2M;
  512. },
  513. //上传成功的回调
  514. handleSucesss(response, file, fileList) {
  515. // console.log(response,'aaaaaaaaaaaaaaaaaa')
  516. if(response.result == 1) {
  517. response.data.is_choose = true
  518. this.resourceList.unshift(response.data)
  519. let arr = this.resourceList.slice(0,this.page_size)
  520. this.resourceList = arr
  521. console.log(this.resourceList,'12435435')
  522. // this.$refs.upload.clearFiles()
  523. // if(this.resourceList.length >= 8) {
  524. // this.page_total += fileList.length
  525. // }
  526. let url = ''
  527. if(this.type == 1) {//图片
  528. url = "{!! yzWebFullUrl('upload.uploadV3.getImage') !!}"
  529. } else if(this.type == 3) {//视频
  530. url = "{!! yzWebFullUrl('upload.uploadV3.getVideo') !!}"
  531. } else {//音频
  532. url = "{!! yzWebFullUrl('upload.uploadV3.getAudio') !!}"
  533. }
  534. if (this.platformType == '1') {
  535. url += "&platform_type=1";
  536. } else {
  537. url += "&platform_type=2";
  538. }
  539. this.$http.post(url, {
  540. tag_id: this.groupId,
  541. pageSize:this.page_size,
  542. page:this.current_page
  543. }).then(response => {
  544. if (response.data.result) {
  545. this.page_total= response.data.data.total
  546. // this.page_size = response.data.per_page;
  547. this.current_page = response.data.data.current_page;
  548. this.resourceTotal = response.data.data.total
  549. // this.resourceList = response.data.data.data
  550. // this.imgLoading = true
  551. // this.resourceList.forEach((item, index) => {
  552. // item['is_choose'] = 0
  553. // });
  554. } else {
  555. this.$message({
  556. message: response.data.msg,
  557. type: 'error'
  558. });
  559. }
  560. }, response => {
  561. this.$message({
  562. message: response.data.msg,
  563. type: 'error'
  564. });
  565. });
  566. this.getSelect()
  567. this.getGroupList(this.type)
  568. this.$message({
  569. message: response.msg,
  570. type: 'success'
  571. });
  572. // this.resourceTotal += fileList.length
  573. }else {
  574. this.$message.error(response.msg);
  575. }
  576. },
  577. // // 文件超出个数限制时的钩子
  578. handleExceed(files) {
  579. if(files.length > 5) {
  580. this.$message.error("不能一次上传超过5个文件!");
  581. return
  582. }
  583. },
  584. // 点击文件列表中已上传的文件时的钩子
  585. handlePreview(file){
  586. },
  587. handChecked(val,id,item) {
  588. let arr = []
  589. let data = []
  590. let list = []
  591. item.is_choose = !item.is_choose;
  592. this.resourceList.forEach(item => {
  593. if(this.selNum=='one') {
  594. if(item.id!==id) {
  595. item.is_choose = false
  596. }
  597. }
  598. if(item.is_choose == true) {
  599. arr.push(item.id)
  600. list.push(item)
  601. }
  602. })
  603. this.selectArr = arr
  604. this.fileList = list
  605. this.$forceUpdate()
  606. this.getSelect()
  607. },
  608. getSelect() {
  609. let count = 0
  610. this.resourceList.forEach(item => {
  611. if(item.is_choose) {
  612. count++
  613. }
  614. })
  615. this.selectCount = count;
  616. },
  617. //转换网络图片事件
  618. conversion(){
  619. this.previewUrl = this.imgLink;
  620. console.log(this.groupId);
  621. this.getNetImg(this.imgLink,this.groupId)
  622. console.log(this.imgLink);
  623. },
  624. playClic() {
  625. },
  626. getNetVideo() {
  627. this.viewVideoLink = this.videoLink
  628. this.$emit('videoclik', this.viewVideoLink);
  629. }
  630. },
  631. template: '#ImgMul'
  632. });
  633. </script>
  634. <style scoped>
  635. .ellipsis {
  636. width: 100px;
  637. text-overflow: ellipsis;
  638. white-space: nowrap;
  639. vertical-align:middle;
  640. overflow:hidden
  641. }
  642. /* 上传 */
  643. .aduio-box {
  644. margin-top:20px
  645. }
  646. .aduio-item {
  647. padding:10px;
  648. margin:0 15px 15px 0;
  649. width:280px;
  650. height:130px;
  651. border:1px solid #c8cede;
  652. }
  653. .audio-title {
  654. display:inline-block;
  655. width:150px;
  656. overflow: hidden;
  657. text-overflow: ellipsis;
  658. white-space: nowrap;
  659. vertical-align:middle
  660. }
  661. .aduio-right {
  662. width:60px;
  663. height:60px;
  664. }
  665. .aduio-right {
  666. margin-top:30px;
  667. text-align:center;
  668. }
  669. .aduio-right img {
  670. width:40px;
  671. height:40px;
  672. }
  673. .play-box {
  674. position:relative;
  675. margin:15px 15px 0 0;
  676. text-align:center;
  677. z-index:100;
  678. }
  679. .play-box img {
  680. width:40px;
  681. height:40px;
  682. }
  683. .uploading-btn {
  684. margin-top: 10px;
  685. /* text-align:center; */
  686. }
  687. .video-box {
  688. margin:20px 0 30px 0;
  689. width:100%;
  690. }
  691. .video-box .video-item {
  692. position: relative;
  693. padding:10px;
  694. margin-right:15px;
  695. width:40%;
  696. height:130px;
  697. border:1px solid #c8cede;
  698. }
  699. .checked-pos {
  700. position: absolute;
  701. top:10px;
  702. left:10px;
  703. }
  704. .vedio-file {
  705. width:150px;
  706. height:100%
  707. }
  708. .vedio-file video {
  709. width:150px;
  710. height:100%
  711. }
  712. .vedio-right {
  713. text-align:left
  714. }
  715. .vedio-right p{
  716. margin:20px 0 0 15px;
  717. }
  718. .getNetWork {
  719. margin:30px 0;
  720. text-align:center
  721. }
  722. .con-box {
  723. position: relative;
  724. }
  725. .left-group {
  726. /* position: relative; */
  727. /* left:-20px; */
  728. /* position: absolute; */
  729. /* height: 500px; */
  730. /* overflow: scroll; */
  731. padding: 10px 0;
  732. left: 0;
  733. top: 0;
  734. width:180px;
  735. max-width:150px;
  736. min-width:110px;
  737. text-overflow: ellipsis;
  738. white-space: nowrap;
  739. vertical-align:middle;
  740. overflow:hidden;
  741. }
  742. .D-gro {
  743. margin:0;
  744. padding:3px 0 3px 0px;
  745. cursor: pointer;
  746. }
  747. .left-group .gro-bg {
  748. background: rgb(41, 186, 156);
  749. color:#fff;
  750. }
  751. .right-img {
  752. /* min-width: 350px; */
  753. margin-left: 150px;
  754. /* width:80%; */
  755. min-height:475px;
  756. /* border-left:1px solid #c8cede */
  757. }
  758. .handel {
  759. margin-top:10px;
  760. }
  761. .img-hint {
  762. position: absolute;
  763. width: 200px;
  764. top: 10px;
  765. right: 21px;
  766. margin-bottom:15px;
  767. height:40px;
  768. line-height:40px;
  769. text-align:right;
  770. z-index: 9999;
  771. }
  772. .img-hint>div {
  773. float:right
  774. }
  775. /* 隐藏上传组件的默认样式 */
  776. .img-hint input{
  777. display:none;
  778. }
  779. .img-hint .el-upload-list {
  780. display:none
  781. }
  782. .img-source {
  783. position: relative;
  784. margin: 10px 0 0 10px;
  785. width:140px;
  786. height:150px;
  787. }
  788. .img-source img {
  789. width:100%;
  790. height:110px;
  791. }
  792. .img-source p {
  793. padding:0 5px;
  794. width:100%;
  795. text-overflow: ellipsis;
  796. white-space: nowrap;
  797. vertical-align:middle;
  798. overflow:hidden;
  799. }
  800. .img-source .sle-img {
  801. position:absolute;
  802. /* display:none; */
  803. top:5px;
  804. left:5px;
  805. }
  806. .img-source p {
  807. margin-top:15px;
  808. text-align:center;
  809. }
  810. .img-mark {
  811. position:absolute;
  812. display:none;
  813. width:100%;
  814. height:110px;
  815. top:0px;
  816. left:0px;
  817. background: rgba(41, 186, 156, 0.3);
  818. border:1px solid rgb(41, 186, 156);
  819. }
  820. .img-source:hover .img-mark {
  821. display:block
  822. }
  823. .vedio-source,.audio-source{
  824. position: relative;
  825. margin:10px 0 0px 23px;
  826. width:280px;
  827. height:102px;
  828. border:1px solid #c8cede;
  829. }
  830. .video-mark {
  831. position:absolute;
  832. padding:5px;
  833. display:none;
  834. width:100%;
  835. height:100%;
  836. top:0px;
  837. left:0px;
  838. background: rgba(41, 186, 156, 0.3);
  839. border:1px solid rgb(41, 186, 156);
  840. }
  841. .vedio-upload {
  842. width:150px;
  843. height:100%;
  844. }
  845. .vedio-upload video {
  846. width:150px;
  847. height:100%;
  848. vertical-align: top;
  849. }
  850. .vedio-source:hover .video-mark {
  851. display:block
  852. }
  853. .audio-source:hover .video-mark {
  854. display:block
  855. }
  856. .defaultImg {
  857. margin-top: 20px;
  858. width: 150px;
  859. height: 150px;
  860. line-height:150px;
  861. border:1px solid #c8cede;
  862. text-align:center;
  863. }
  864. .getNet {
  865. text-align:center;
  866. }
  867. .getnetvideo, .getnetaudio {
  868. min-height:300px
  869. }
  870. #multimedia-material .el-tabs__content {
  871. overflow:initial;
  872. }
  873. .video-time {
  874. position:absolute;
  875. padding-right:8px;
  876. bottom:10px;
  877. left:10px;
  878. color:#fff;
  879. width:50px;
  880. height:20px;
  881. font-size:12px;
  882. line-height:20px;
  883. border-radius:5px;
  884. text-align:right;
  885. background:rgba(0,0,0,0.5)
  886. }
  887. .play-triangle {
  888. position:absolute;
  889. top:3px;
  890. left:6px;
  891. /* padding-left:5px; */
  892. height:0;
  893. width:0;
  894. overflow: hidden; /* 这里设置overflow, font-size, line-height */
  895. font-size: 0; /*是因为, 虽然宽高度为0, 但在IE6下会具有默认的 */
  896. line-height: 0; /* 字体大小和行高, 导致盒子呈现被撑开的长矩形 */
  897. border-color:transparent transparent transparent #fff;
  898. border-style:solid;
  899. border-width:7px;
  900. }
  901. .bor-right {
  902. border-right: 1px solid #c8cede;
  903. }
  904. .text-bg {
  905. background:#29BA9C;
  906. color:#fff;
  907. }
  908. .scroll-box {
  909. width: 152px;
  910. height: 475px;
  911. overflow-y: scroll;
  912. }
  913. /*滚动条整体样式*/
  914. .scroll-box::-webkit-scrollbar {
  915. width: 2px;
  916. }
  917. /*滚动条滑块*/
  918. .scroll-box::-webkit-scrollbar-thumb {
  919. border-radius: 30px;
  920. background: #29BA9C;
  921. }
  922. /*滚动条轨道*/
  923. .scroll-box::-webkit-scrollbar-track {
  924. box-shadow: inset 0 0 1px rgba(0,0,0,0);
  925. border-radius: 30px;
  926. background: #ccc;
  927. }
  928. .scroll-box::-webkit-scrollbar-track{
  929. background:#fff;
  930. }
  931. .el-tabs__header {
  932. margin-bottom: 0;
  933. }
  934. .el-dialog__header {
  935. padding: 25px;
  936. }
  937. .el-dialog__body {
  938. position: relative;
  939. padding: 10px 20px;
  940. }
  941. .image-slot {
  942. margin-top: 20px;
  943. }
  944. </style>