materialList.vue 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999
  1. <style lang="scss" scoped>
  2. .orderDetail{
  3. ul,li{
  4. margin: 0;
  5. padding: 0;
  6. }
  7. width: 100%;
  8. .topBody{
  9. width: 100%;
  10. background: #FFFFFF;
  11. margin-bottom: 12px;
  12. padding: 20px;
  13. box-sizing: border-box;
  14. .breadcrumb{
  15. height: 22px;
  16. font-size: 12px;
  17. font-family: PingFangSC-Regular, PingFang SC;
  18. font-weight: 400;
  19. color: #000000;
  20. line-height: 22px;
  21. }
  22. .bottom{
  23. display: flex;
  24. position: relative;
  25. justify-content: space-between;
  26. // padding: 20px;
  27. .orderIcon{
  28. width: 28px;
  29. height: 28px;
  30. margin-right: 15px;
  31. img{
  32. width: 100%;
  33. }
  34. }
  35. .tip{
  36. .greet{
  37. width: 300px;
  38. height: 28px;
  39. font-size: 20px;
  40. font-family: PingFangSC-Medium, PingFang SC;
  41. font-weight: 500;
  42. color: rgba(0, 0, 0, 0.85);
  43. line-height: 28px;
  44. margin-bottom: 5px;
  45. }
  46. .descPosition{
  47. font-size: 14px;
  48. font-family: PingFangSC-Regular, PingFang SC;
  49. font-weight: 400;
  50. color: rgba(0, 0, 0, 0.45);
  51. overflow: hidden;
  52. margin-bottom: 0;
  53. li{
  54. height: 22px;
  55. line-height: 22px;
  56. margin-top:3px ;
  57. }
  58. span{
  59. width: 250px;
  60. display: inline-block;
  61. }
  62. }
  63. }
  64. .optBody{
  65. width: 200px;
  66. flex-shrink:0;
  67. // justify-content: flex-end;
  68. text-align: right;
  69. .btnBody{
  70. margin-bottom: 10px;
  71. }
  72. .orderInfo{
  73. display: flex;
  74. justify-content: space-between;
  75. text-align: right;
  76. p{
  77. margin-bottom: 0;
  78. }
  79. .markName{
  80. height: 22px;
  81. font-size: 14px;
  82. font-family: PingFangSC-Regular, PingFang SC;
  83. font-weight: 400;
  84. color: rgba(0, 0, 0, 0.45);
  85. line-height: 22px;
  86. }
  87. .big{
  88. height: 28px;
  89. font-size: 20px;
  90. font-family: PingFangSC-Regular, PingFang SC;
  91. font-weight: 400;
  92. color: rgba(0, 0, 0, 0.85);
  93. line-height: 28px;
  94. }
  95. }
  96. }
  97. }
  98. }
  99. .section{
  100. background: white;
  101. padding:20px ;
  102. .breadcrumb{
  103. height: 22px;
  104. font-size: 12px;
  105. font-family: PingFangSC-Regular, PingFang SC;
  106. font-weight: 400;
  107. color: #000000;
  108. line-height: 22px;
  109. }
  110. .sectionBody{
  111. p{
  112. margin-bottom: 0;
  113. }
  114. .section-item{
  115. background: white;
  116. margin-bottom: 20px;
  117. }
  118. .tabBox{
  119. padding: 15px 20px 0;
  120. display: flex;
  121. flex-wrap: wrap;
  122. position: relative;
  123. .search-item{
  124. margin-bottom: 12px;
  125. width: 30%;
  126. }
  127. .opt-item{
  128. position: absolute;
  129. right: 20px;
  130. top: 16px;
  131. }
  132. }
  133. .sectionHead{
  134. padding: 15px 20px;
  135. // height: 24px;
  136. font-size: 16px;
  137. font-family: PingFangSC-Medium, PingFang SC;
  138. font-weight: 500;
  139. color: rgba(0, 0, 0, 0.85);
  140. line-height: 24px;
  141. border-bottom: 1px solid #E9E9E9;;
  142. .allOrder{
  143. float: right;
  144. }
  145. }
  146. .section-box{
  147. margin-top: 30px;
  148. padding: 20px 20px;
  149. border: 1px solid #E9E9E9;
  150. .description{
  151. margin-top: 10px;
  152. .time{
  153. height: 32px;
  154. line-height: 32px;
  155. }
  156. }
  157. ul{
  158. display: flex;
  159. flex-wrap: wrap;
  160. // justify-content: space-around;
  161. }
  162. li{
  163. width: 30%;
  164. height: 22px;
  165. font-size: 14px;
  166. font-family: PingFangSC-Regular, PingFang SC;
  167. font-weight: 400;
  168. color: rgba(0, 0, 0, 0.85);
  169. line-height: 22px;
  170. text-align: left;
  171. margin-bottom: 15px;
  172. }
  173. .top{
  174. margin-bottom: 25px;
  175. }
  176. .bottom{
  177. h4{
  178. font-size: 15px;
  179. font-family: PingFangSC-Medium, PingFang SC;
  180. font-weight: 600;
  181. color: rgba(0, 0, 0, 0.85);
  182. margin-bottom: 25px;
  183. }
  184. }
  185. .shenhe{
  186. width: 6px;
  187. height: 6px;
  188. display: inline-block;
  189. background: #52C41A;
  190. border-radius: 50%;
  191. position: relative;
  192. top: -2px;
  193. }
  194. .wancheng{
  195. width: 6px;
  196. height: 6px;
  197. display: inline-block;
  198. background: #1890FF;
  199. border-radius: 50%;
  200. // margin-right: 3px;
  201. position: relative;
  202. top: -2px;
  203. }
  204. .bohui{
  205. width: 6px;
  206. height: 6px;
  207. display: inline-block;
  208. background: #F5222D;
  209. border-radius: 50%;
  210. position: relative;
  211. top: -2px;
  212. }
  213. }
  214. }
  215. }
  216. }
  217. .videoBox{
  218. height: 240px;
  219. }
  220. .imgBox{
  221. width: 90%;
  222. }
  223. .videomarterialInfo{
  224. position: relative;
  225. // height: 800px;
  226. }
  227. .marterialInfo{
  228. overflow: auto;
  229. // height: 800px;
  230. position: relative;
  231. p{margin-bottom: 0;}
  232. ul,li{
  233. margin: 0;
  234. padding: 0;
  235. }
  236. .info-item{
  237. margin-bottom: 20px;
  238. display: flex;
  239. // justify-content: center;
  240. align-items: flex-start;
  241. span{
  242. display: inline-block;
  243. width: 70px;
  244. text-align: left;
  245. flex-shrink: 0;
  246. }
  247. .ant-tag{
  248. width: auto;
  249. min-width: 50px;
  250. text-align: center;
  251. }
  252. }
  253. .info{
  254. ul{
  255. width: 100%;
  256. display: flex;
  257. justify-content: space-between;
  258. flex-wrap: wrap;
  259. }
  260. li{
  261. width: 33.3%;
  262. margin-bottom: 20px;
  263. }
  264. margin-bottom: 0;
  265. }
  266. // .btnBody{
  267. // width: 100%;
  268. // height: 80px;
  269. // position: relative;
  270. // }
  271. .bottom-btn{
  272. width: 100%;
  273. text-align: center;
  274. position: absolute;
  275. bottom: 0px;
  276. left: 0;
  277. // margin-top: 20px;
  278. }
  279. .scriptbottom-btn{
  280. width: 100%;
  281. // height: 60px;
  282. line-height: 60px;
  283. text-align: center;
  284. position: absolute;
  285. bottom: 0px;
  286. left: 0;
  287. }
  288. }
  289. </style>
  290. <style lang="less">
  291. .orderDetail{
  292. .ant-timeline-item-head{
  293. background: rgb(240,242,245);
  294. }
  295. .muen{
  296. cursor: pointer;
  297. }
  298. .muen:hover{
  299. color: #1890ff;
  300. }
  301. }
  302. </style>
  303. <template>
  304. <div class="orderDetail ">
  305. <div class="section">
  306. <p class="breadcrumb">
  307. <a-breadcrumb style="display:block;width:100%">
  308. <a-breadcrumb-item ><span class="muen" @click="goPlantForm()">工作台</span></a-breadcrumb-item>
  309. <!-- <a-breadcrumb-item>订单列表</a-breadcrumb-item> -->
  310. <a-breadcrumb-item>物料列表</a-breadcrumb-item>
  311. </a-breadcrumb>
  312. </p>
  313. <div class="sectionBody">
  314. <div class="tabBody">
  315. <a-tabs v-model="activeKey" @change='tabChange'>
  316. <a-tab-pane v-for="pane in panes" :key="pane.key" :tab="pane.title" >
  317. <!-- {{ pane.content }}{{pane.role+'-'+roleCode}} -->
  318. </a-tab-pane>
  319. </a-tabs>
  320. </div>
  321. <!-- 素材列表 -->
  322. <div class="section-item">
  323. <div class="tabBox">
  324. <!-- <div class="search-item">
  325. <span>物料名称:</span>
  326. <a-input placeholder="请输入名称" allow-clear v-model="materialName" style="width:300px" />
  327. </div>
  328. <div class="search-item">
  329. <span>物料编号:</span>
  330. <a-input placeholder="请输入编号" allow-clear v-model="materialId" style="width:300px" />
  331. </div>
  332. <div class="search-item">
  333. <span>所属订单:</span>
  334. <a-input placeholder="请输入订单名称" allow-clear v-model="orderName" style="width:300px" />
  335. </div>
  336. <div class="opt-item">
  337. <a-button type='primary' @click="search" style="margin-right:20px">查询</a-button>
  338. <a-button type='default' @click="reset">查询</a-button>
  339. </div> -->
  340. </div>
  341. <div class="section-box">
  342. <a-table
  343. size="middle"
  344. :columns="columns"
  345. :dataSource="data"
  346. id="outTable"
  347. :pagination="ipagination"
  348. :loading="loading"
  349. @change="sort"
  350. style="word-break: break-all;"
  351. >
  352. <div slot="materialStatus" slot-scope="text" >
  353. <span class="wancheng" v-if="text==7"> </span>
  354. <span class="bohui" v-else-if="text==6||text==3"> </span>
  355. <span class="shenhe" v-else> </span>
  356. {{text | handlerMaterialStatus}}
  357. </div>
  358. <div slot="scriptStatus" slot-scope="text,record">
  359. <span v-if="record.materialStatus==0&&role=='design'">-</span>
  360. <a href="javascript:;" v-if="record.materialStatus==0&&role=='designLeader'" @click="scriptAssign(record)">指派</a>
  361. <span v-else>
  362. <a href="javascript:;" @click="scriptViewDetails(record)">{{record.planName}}</a>
  363. </span>
  364. </div>
  365. <div slot="videoStatus" slot-scope="text,record">
  366. <span v-if="record.materialStatus==0&&role=='design'">-</span>
  367. <a href="javascript:;" v-if="record.materialStatus==0&&role=='designLeader'" @click="videoAssign(record)">指派</a>
  368. <span v-else>
  369. <a href="javascript:;" @click="viewDetails(record)">{{record.clipName}}</a>
  370. </span>
  371. </div>
  372. <div slot="orderTitle" slot-scope="text,record">
  373. <a href="javascript:;" @click="goOrderDetail(record)">{{text}}</a>
  374. </div>
  375. </a-table>
  376. </div>
  377. <a-drawer
  378. title="视频详情"
  379. width="700"
  380. :placement="placement"
  381. :closable="false"
  382. :visible="visible"
  383. @close="onClose"
  384. >
  385. <a-spin :spinning="visibleLoading">
  386. <a-drawer
  387. :title="add ? '上传视频' : '修改视频'"
  388. width="600"
  389. :closable="false"
  390. :visible="childrenDrawer"
  391. @close="onChildrenDrawerClose"
  392. >
  393. <a-spin :spinning="videoUploadLoading">
  394. <a-form :form="form" :label-col="labelCol" :wrapper-col="wrapperCol">
  395. <a-form-item label="视频上传">
  396. <uploadFile
  397. :checkFile="file"
  398. :value.sync="urlList.url"
  399. @overUpload="overUpload"
  400. @removeUpload="removeUpload"
  401. :fileCount="1"
  402. uploadType="video"
  403. :multiple="false"
  404. />
  405. <span v-if="repeat" style="color: red">此素材重复,请重新选择上传</span>
  406. <!-- {{urlList.url }} -->
  407. <span v-if="confirmLoading && urlList.url != ''" style="color: green">上传成功</span>
  408. </a-form-item>
  409. <a-form-item
  410. label="封面上传"
  411. class="add-image-material"
  412. v-if="currentMaterial.projectId && add && urlList.url != ''"
  413. >
  414. <uploadFile
  415. :value.sync="urlListImage.url"
  416. :checkFile="fileWater"
  417. @overUpload="overUploadImage"
  418. @removeUpload="deleteImage"
  419. :fileCount="15"
  420. uploadType="image"
  421. />
  422. <span
  423. v-if="material.filter((item) => item == false).length > 0 && urlListImage.url.length > 0"
  424. style="color: red"
  425. >
  426. 上传素材的尺寸不符,请修改(
  427. <span v-for="(item, index) of material" :key="index" v-show="!item">第{{ index + 1 }}张</span>出错)
  428. </span>
  429. <span
  430. v-else-if="urlListImage.url.length > 0 && material.filter((item) => item == false).length == 0"
  431. style="color: green"
  432. >上传成功</span
  433. >
  434. </a-form-item>
  435. <a-form-item
  436. label="形式标签"
  437. v-if="add && visible"
  438. >
  439. <el-cascader
  440. placeholder="搜索你想要的形式标签"
  441. :options="departTreeModality"
  442. v-decorator="[
  443. 'modalityTagList', // 给表单赋值或拉取表单时,该input对应的key
  444. { rules: [{ required: true, message: '请选择形式标签!' }] },
  445. ]"
  446. :props="{ multiple: true, value: 'id', label: 'tagName', emitPath: false }"
  447. filterable
  448. style="width: 100%"
  449. ></el-cascader>
  450. </a-form-item>
  451. <a-form-item
  452. :label-col="labelCol"
  453. :wrapper-col="{
  454. xs: { span: 24 },
  455. sm: { span: 12 },
  456. }"
  457. label="内容标签"
  458. v-if="add && visible"
  459. >
  460. <el-cascader
  461. placeholder="搜索你想要的内容标签"
  462. :options="departTreeContent"
  463. class="only-video-material-disable-modal"
  464. v-decorator="[
  465. 'contentTagList', // 给表单赋值或拉取表单时,该input对应的key
  466. { rules: [{ required: true, message: '请选择内容标签!' }] },
  467. ]"
  468. :props="{
  469. multiple: true,
  470. value: 'id',
  471. label: 'tagName',
  472. emitPath: false,
  473. checkStrictly: true,
  474. expandTrigger: 'hover',
  475. }"
  476. filterable
  477. style="width: 100%"
  478. ></el-cascader>
  479. </a-form-item>
  480. <a-form-item
  481. :label-col="labelCol"
  482. :wrapper-col="{
  483. xs: { span: 24 },
  484. sm: { span: 12 },
  485. }"
  486. label="场景标签"
  487. v-if="add && visible"
  488. >
  489. <el-cascader
  490. placeholder="搜索你想要的场景标签"
  491. :options="departTreeSence"
  492. v-decorator="[
  493. 'senceTagList', // 给表单赋值或拉取表单时,该input对应的key
  494. { rules: [{ required: true, message: '请选择场景标签!' }] },
  495. ]"
  496. :props="{ multiple: true, value: 'id', label: 'tagName', emitPath: false }"
  497. filterable
  498. style="width: 100%"
  499. ></el-cascader>
  500. </a-form-item>
  501. <a-form-item
  502. label="基调标签"
  503. v-if="add && visible"
  504. >
  505. <el-cascader
  506. placeholder="搜索你想要的基调标签"
  507. :options="departTreeMod"
  508. v-decorator="[
  509. 'modTagList', // 给表单赋值或拉取表单时,该input对应的key
  510. { rules: [{ required: true, message: '请选择基调标签!' }] },
  511. ]"
  512. :props="{ multiple: true, value: 'id', label: 'tagName', emitPath: false }"
  513. filterable
  514. style="width: 100%"
  515. ></el-cascader>
  516. </a-form-item>
  517. <a-form-item
  518. label="描述"
  519. v-if="add"
  520. >
  521. <a-textarea
  522. placeholder="请输入描述"
  523. v-decorator="[
  524. 'description', // 给表单赋值或拉取表单时,该input对应的key
  525. ]"
  526. :auto-size="{ minRows: 3, maxRows: 10 }"
  527. />
  528. </a-form-item>
  529. </a-form>
  530. </a-spin>
  531. <div
  532. :style="{
  533. position: 'absolute',
  534. bottom: 0,
  535. width: '100%',
  536. borderTop: '1px solid #e8e8e8',
  537. padding: '10px 16px',
  538. textAlign: 'right',
  539. left: 0,
  540. background: '#fff',
  541. borderRadius: '0 0 4px 4px',
  542. }"
  543. >
  544. <a-button key="back" @click="onChildrenDrawerClose" style="margin-right:15px">取消</a-button>
  545. <a-button type="primary" :disabled="!confirmLoading" @click="onChildrenDrawerOk" :loading="loadingElse">确定</a-button>
  546. </div>
  547. </a-drawer>
  548. <div class="marterialInfo videomarterialInfo">
  549. <div class="info-item">
  550. <span>视频状态:</span>
  551. <p>{{ currentVideo.videoStatus | handlerVideoStatus }}</p>
  552. </div>
  553. <div class="info-item">
  554. <span>视频预览:</span>
  555. <div class="videoBox" v-if="currentVideo.videoStatus>=1">
  556. <video style="height:100%" :src="currentVideo.url" controls v-if="currentVideo.url"></video>
  557. <img :src="defaultPic" alt="" style="width:100px;margin:0 10px 8px 0" v-else>
  558. </div>
  559. <div v-else >
  560. <!-- :disabled="!(currentVideo.clip==userInfo.id)" -->
  561. <a-button type='primary' @click="showChildrenDrawer" :disabled="!(currentVideo.clip==userInfo.id)">上传视频</a-button>
  562. </div>
  563. </div>
  564. <div class="info-item">
  565. <span>封面预览:</span>
  566. <div class="imgBox">
  567. <div v-if="currentVideo.videoStatus!=0">
  568. <template v-if="currentVideo.imgList&&currentVideo.imgList.length">
  569. <img alt="" style="width:100px;margin:0 10px 8px 0" v-for="(item,index) in currentVideo.imgList" :key='index' :src="item">
  570. </template>
  571. <span v-else>暂无封面</span>
  572. </div>
  573. <!-- <img :src="defaultPic" alt="" style="width:100px;margin:0 10px 8px 0" v-else> -->
  574. <span v-else>暂无封面</span>
  575. </div>
  576. </div>
  577. <div class="info-item" v-if="currentVideo.videoStatus>=1">
  578. <span>视频标签:</span>
  579. <p>
  580. <a-tag v-for="(item,index) in currentVideo.tagList" :key="index" style="margin-bottom:8px">{{item}}</a-tag>
  581. <!-- {{currentVideo.tag}} -->
  582. </p>
  583. </div>
  584. <div class="info-item info">
  585. <ul style="position:relative">
  586. <li><span>编导:</span> {{ currentVideo.planName }} </li>
  587. <li><span>拍摄:</span> {{ currentVideo.shotName }} </li>
  588. <li><span>剪辑:</span> {{ currentVideo.clipName }} </li>
  589. <!-- v-if="role=='designLeader'&&currentVideo.videoStatus==0" -->
  590. <a-button type='link' style="margin-left:15px;position:absolute;top:-6px;right:0" @click="updataPeople" v-if="role=='designLeader'&&currentVideo.videoStatus==0">重新指派</a-button>
  591. </ul>
  592. </div>
  593. <div class="info-item" v-if="currentVideo.videoStatus==2">
  594. <span>驳回理由:</span>
  595. <p>{{ currentVideo.videoAdvise }}</p>
  596. </div>
  597. <!-- <div class="info-item btnBody"> -->
  598. <!-- <div class="bottom-btn">
  599. <a-button type='primary' v-if="currentVideo.videoStatus>=1" @click="modifyVideo" :disabled="!(currentVideo.clip==userInfo.id)" style="margin-right:20px">修改视频信息</a-button>
  600. <a-button type='default' @click="onClose">关闭</a-button>
  601. </div> -->
  602. <!-- </div> -->
  603. </div>
  604. </a-spin>
  605. <div
  606. :style="{
  607. position: 'absolute',
  608. right: 0,
  609. bottom: 0,
  610. width: '100%',
  611. borderTop: '1px solid #e9e9e9',
  612. padding: '10px 16px',
  613. background: '#fff',
  614. textAlign: 'right',
  615. zIndex: 1,
  616. }"
  617. >
  618. <a-button type='primary' v-if="currentVideo.videoStatus>=1" @click="modifyVideo" :disabled="!(currentVideo.clip==userInfo.id)" style="margin-right:20px">修改视频信息</a-button>
  619. <a-button type='default' @click="onClose">关闭</a-button>
  620. </div>
  621. </a-drawer>
  622. <a-drawer
  623. title="脚本详情"
  624. width="600"
  625. :placement="placement"
  626. :closable="false"
  627. :visible="scriptVisible"
  628. @close="scriptClose"
  629. >
  630. <a-spin :spinning="visibleLoading">
  631. <div class="marterialInfo">
  632. <div class="info-item">
  633. <span>脚本状态:</span>
  634. <p>{{ currentScript.scriptStatus | handlerVideoStatus }}</p>
  635. </div>
  636. <div class="info-item">
  637. <span>所属项目:</span>
  638. <p>{{currentScript.projectName}}</p>
  639. </div>
  640. <div class="info-item">
  641. <span>所属物料:</span>
  642. <p>{{currentScript.materialName}}</p>
  643. </div>
  644. <div class="info-item">
  645. <span style="height: 32px;line-height: 32px;">编导:</span>
  646. <p style="height:32px;line-height:32px">
  647. {{currentScript.planName}}
  648. <a-button type='link' style="margin-left:15px" @click="updataPeople" v-if="role=='designLeader'&&currentScript.scriptStatus==0">重新指派</a-button>
  649. </p>
  650. </div>
  651. <div class="info-item" v-if="currentScript.scriptStatus==2">
  652. <span>驳回理由:</span>
  653. <p>{{currentScript.scriptAdvise}}</p>
  654. </div>
  655. <div class="info-item">
  656. <span>脚本:</span>
  657. <div v-if="currentScript.scriptStatus>0" style="margin-right:20px">
  658. <a :href="currentScript.url">{{currentScript.scriptName}}</a>
  659. </div>
  660. <div v-if="currentScript.scriptStatus<3">
  661. <p v-if="currentMaterial.plan==userInfo.id">
  662. <a-upload
  663. name="file"
  664. :multiple="false"
  665. :action="uploadAction"
  666. :headers="tokenHeader"
  667. :showUploadList="false"
  668. :beforeUpload="beforeUpload"
  669. @change="handleChange"
  670. style="margin-right:20px"
  671. >
  672. <a-button :disabled="loadDisabled">
  673. <a-icon type="upload" />
  674. {{loadDisabled?'上传中,请稍后':'文件上传'}}
  675. </a-button>
  676. </a-upload>
  677. </p>
  678. <p v-else>
  679. <a-upload
  680. name="file"
  681. :multiple="false"
  682. :action="uploadAction"
  683. :headers="tokenHeader"
  684. :showUploadList="false"
  685. :beforeUpload="beforeUpload"
  686. @change="handleChange"
  687. style="margin-right:20px"
  688. >
  689. <a-button :disabled="true">
  690. <a-icon type="upload" />文件上传</a-button>
  691. </a-upload>
  692. </p>
  693. </div>
  694. </div>
  695. <!-- <div class="scriptbottom-btn">
  696. <a-button type='default' @click="scriptClose">关闭</a-button>
  697. </div> -->
  698. </div>
  699. </a-spin>
  700. <div
  701. :style="{
  702. position: 'absolute',
  703. right: 0,
  704. bottom: 0,
  705. width: '100%',
  706. borderTop: '1px solid #e9e9e9',
  707. padding: '10px 16px',
  708. background: '#fff',
  709. textAlign: 'right',
  710. zIndex: 1,
  711. }"
  712. >
  713. <a-button type='default' @click="scriptClose">关闭</a-button>
  714. </div>
  715. </a-drawer>
  716. <!-- 指派 -->
  717. <a-modal v-model="assignVisible" title="物料指派" width='600px'>
  718. <template slot="footer">
  719. <a-button key="back" @click="quxiao">取消</a-button>
  720. <a-button type="primary" @click="handleOk" :loading="loadingElse">确定</a-button>
  721. </template>
  722. <a-spin :spinning='assignVisibleLoading'>
  723. <a-form-model ref="ruleForm" :rules="rules" :model="formPerson" :label-col="labelCol" :wrapper-col="wrapperCol">
  724. <a-form-model-item label="编导" ref="plan" prop="plan">
  725. <a-select
  726. v-model="formPerson.plan"
  727. showSearch
  728. optionFilterProp="children"
  729. :filterOption="filterOption"
  730. :disabled="currentMaterial.materialStatus>=4"
  731. >
  732. <a-select-option :value="item.userId" v-for="item of ascription" :key="item.userId">{{item.userName}}</a-select-option>
  733. </a-select>
  734. </a-form-model-item>
  735. <a-form-model-item label="拍摄" ref="shot" prop="shot" :rules='[{ required: currentMaterial.materialType==1, message: "拍摄人员必须指派" ,trigger: "change" }]'>
  736. <a-select
  737. v-model="formPerson.shot"
  738. showSearch
  739. optionFilterProp="children"
  740. :filterOption="filterOption"
  741. >
  742. <a-select-option :value="item.userId" v-for="item of ascription" :key="item.userId">{{item.userName}}</a-select-option>
  743. </a-select>
  744. </a-form-model-item>
  745. <a-form-model-item label="剪辑" ref="clip" prop="clip">
  746. <a-select
  747. v-model="formPerson.clip"
  748. showSearch
  749. optionFilterProp="children"
  750. :filterOption="filterOption"
  751. >
  752. <a-select-option :value="item.userId" v-for="item of ascription" :key="item.userId">
  753. {{item.userName}}
  754. </a-select-option>
  755. </a-select>
  756. </a-form-model-item>
  757. </a-form-model>
  758. </a-spin>
  759. </a-modal>
  760. </div>
  761. </div>
  762. </div>
  763. </div>
  764. </template>
  765. <script>
  766. import moment from 'moment';
  767. import qs from 'qs'
  768. import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
  769. import Vue from 'vue'
  770. import {ACCESS_TOKEN} from "@/store/mutation-types"
  771. import BMF from 'browser-md5-file'
  772. import { fileCheck, fileCheckImage, fileEdit, fileEditAll,orderFileInsert} from '@/api/actor'
  773. import uploadFile from '@/components/uploadFile.vue'
  774. import { closeAllVideoFun, stopOtherVideo } from '@/utils/videoControl'
  775. import UploadToAli from '@femessage/upload-to-ali'
  776. import { mapGetters } from 'vuex'
  777. import TrendVue from '../../../components/Trend/Trend.vue';
  778. const fileSuffix = [
  779. 'xls',
  780. 'xlt',
  781. 'et',
  782. 'xlsx',
  783. 'xltx',
  784. 'csv',
  785. 'xlsm',
  786. 'xltm',
  787. 'doc',
  788. 'dot',
  789. 'wps',
  790. 'wpt',
  791. 'docx',
  792. 'dotx',
  793. 'docm',
  794. 'dotm',
  795. 'ppt',
  796. 'pptx',
  797. 'pptm',
  798. 'ppsx',
  799. 'ppsm',
  800. 'pps',
  801. 'potx',
  802. 'potm',
  803. 'dpt',
  804. 'dps',
  805. 'pdf',
  806. ]
  807. const videofileSuffix = [
  808. 'avi',
  809. 'wmv',
  810. 'mpg',
  811. 'mpeg',
  812. 'mov',
  813. 'rm',
  814. 'ram',
  815. 'swf',
  816. 'flv',
  817. 'mp4',
  818. ]
  819. let listColumns=[
  820. {
  821. title: '物料名称',
  822. dataIndex: 'materialName',
  823. align: 'center',
  824. key: 'materialName',
  825. scopedSlots: { customRender: 'materialName' }
  826. },
  827. {
  828. title: '物料编号',
  829. dataIndex: 'materialId',
  830. align: 'center',
  831. key: 'tag',
  832. scopedSlots: { customRender: 'materialId' }
  833. },
  834. {
  835. title: '物料状态',
  836. dataIndex: 'materialStatus',
  837. align: 'center',
  838. key: 'materialStatus',
  839. scopedSlots: { customRender: 'materialStatus' }
  840. },
  841. {
  842. title: '脚本',
  843. dataIndex: 'scriptStatus',
  844. align: 'center',
  845. key: 'scriptStatus',
  846. scopedSlots: { customRender: 'scriptStatus' }
  847. },
  848. {
  849. title: '视频',
  850. dataIndex: 'videoStatus',
  851. align: 'center',
  852. key: 'videoStatus',
  853. width:250,
  854. scopedSlots: { customRender: 'videoStatus' }
  855. },
  856. {
  857. title: '所属订单',
  858. dataIndex: 'orderTitle',
  859. align: 'center',
  860. key: 'orderTitle',
  861. scopedSlots: { customRender: 'orderTitle' }
  862. },
  863. ]
  864. export default {
  865. name:'material-list',
  866. components: {
  867. UploadToAli,
  868. uploadFile,
  869. },
  870. data() {
  871. const operatorPanes = [
  872. { title: '待审核的', content: '', key: 1 , },
  873. { title: '已完成的', content: '', key: 2 ,},
  874. ];
  875. const designLeaderPanes=[
  876. { title: '我参与的', content: '', key: 1 , },
  877. { title: '被驳回的', content: '', key: 2 , },
  878. { title: '待指派的', content: '', key: 4 , },
  879. // { title: '已完成的', content: '', key: 3 ,},
  880. ]
  881. const designPanes=[
  882. { title: '指派给我', content: '', key: 1 , },
  883. { title: '被驳回的', content: '', key: 2 , },
  884. { title: '已完成的', content: '', key: 3 ,},
  885. { title: '全部物料', content: '', key: 4 ,},
  886. ]
  887. return {
  888. videoEchoInfo:{},
  889. videoUploadLoading:false,
  890. videoinfo:{
  891. url: '',
  892. md5: '',
  893. name: '',
  894. width:undefined,
  895. height:undefined,
  896. },
  897. imageinfo:[],
  898. assignVisibleLoading:false,
  899. visibleLoading:false,
  900. loadingElse2:false,
  901. rules: {
  902. clip: [{ required: true, message: '剪辑人员必须指派', trigger: 'change' }],
  903. // shot: [{ required: true, message: '拍摄人员必须指派', trigger: 'change' }],
  904. plan: [{ required: true, message: '编导人员必须指派', trigger: 'change' }],
  905. },
  906. // 上传视频
  907. labelCol: {xs: {span: 24,},sm: {span: 5,},},
  908. wrapperCol: {xs: {span: 24,},sm: {span: 12,},},
  909. form:this.$form.createForm(this),
  910. repeat: false,
  911. confirmLoading: false,
  912. urlList: {
  913. url: '',
  914. md5: '',
  915. name: '',
  916. },
  917. urlListImage: {
  918. url: [],
  919. md5: [],
  920. name: [],
  921. size: [],
  922. },
  923. tags: [],
  924. addImageVisible: false,
  925. addImageData: null,
  926. material: [],
  927. // 标签的数据
  928. labelValue: [],
  929. options: [],
  930. departTree: [],
  931. departTreeModality: [],
  932. departTreeContent: [],
  933. departTreeSence: [],
  934. departTreeMod: [],
  935. departValue: [],
  936. departValueInfo: [],
  937. departValueInfoModality: [],
  938. departValueInfoContent: [],
  939. departValueInfoSence: [],
  940. departValueInfoMod: [],
  941. tagInfoList: [],
  942. tagInfoListVisible: false,
  943. tagCode: null,
  944. loadingTag: false,
  945. showImageChouzhen: false,
  946. showImageStr: null,
  947. add: true,
  948. inputVisible: false,
  949. inputValue: '',
  950. childrenDrawer:false,
  951. videoAdvise:'',
  952. scriptAdvise:'',
  953. defaultPic: require('@/assets/noImg.png') ,
  954. tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
  955. uploadAction:'',
  956. videoLoad:false,
  957. loadDisabled:false,
  958. labelCol: { span: 4 },
  959. wrapperCol: { span: 14 },
  960. loadingElse: false,
  961. formPerson:{
  962. plan:'',
  963. shot:'',
  964. clip:'',
  965. },
  966. ascription: [],
  967. acceptLoading:false,
  968. videoAdvise:'',
  969. scriptAdvise:'',
  970. currentScript:{},
  971. currentVideo:{},
  972. visible: false,
  973. scriptVisible:false,
  974. placement: 'right',
  975. currentMaterial:{},
  976. url:{
  977. assgin:'/platform/designer/assign',
  978. scriptDetail:'/platform/material/scriptDetail',
  979. videoDetail:'/platform/material/videoDetail',
  980. scriptAccept:'/platform/material/script/accept',
  981. scriptReject:'/platform/material/script/reject',
  982. videoAccept:'/platform/material/video/accept',
  983. videoReject:'/platform/material/video/reject',
  984. },
  985. operatorPanes,
  986. designLeaderPanes,
  987. designPanes,
  988. userInfo:{},
  989. roleCode:'',
  990. panes:[],
  991. activeKey: '1',
  992. orderInfo:{ },
  993. columns:[...listColumns],
  994. data:[],
  995. loading:false,
  996. ipagination: {
  997. current: 1,
  998. pageSize: 10,
  999. // pageSizeOptions: ['10', '20', '30'],
  1000. showTotal: (total, range) => {
  1001. return range[0] + "-" + range[1] + " 共" + total + "条"
  1002. },
  1003. showQuickJumper: true,
  1004. showSizeChanger:true,
  1005. pageSizeOptions: ['10', '30', '50'],
  1006. total: 0,
  1007. onChange: (current, pageSize) => {
  1008. // 切换分页时的回调,
  1009. // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
  1010. this.ipagination.current = current;
  1011. this.ipagination.pageSize= pageSize;
  1012. }
  1013. },
  1014. // 订单进度
  1015. orderName:'',
  1016. materialName:'',
  1017. materialId:'',
  1018. sizeType:[],
  1019. size: "4",
  1020. role:"",
  1021. assignVisible:false,
  1022. }
  1023. },
  1024. methods: {
  1025. quxiao(){
  1026. this.assignVisible=false;
  1027. this.$refs.ruleForm.resetFields();
  1028. this.loadingElse=false;
  1029. },
  1030. handleOk(e) {
  1031. console.log(e);
  1032. this.$refs.ruleForm.validate(valid => {
  1033. if (valid) {
  1034. this.loadingElse=true;
  1035. if(this.currentMaterial.clip&&this.currentMaterial.plan&&this.currentMaterial.shot){
  1036. postAction('/platform/designer/assignAgain',{
  1037. id:this.currentMaterial.materialId,
  1038. ...this.formPerson
  1039. }).then(res=>{
  1040. this.loadingElse=false;
  1041. this.assignVisible = false;
  1042. this.$message.success(res.message);
  1043. this.materialHttp(this.activeKey)
  1044. })
  1045. }else{
  1046. postAction(this.url.assgin,{
  1047. id:this.currentMaterial.materialId,
  1048. ...this.formPerson
  1049. }).then(res=>{
  1050. this.loadingElse=false;
  1051. this.assignVisible = false;
  1052. this.$message.success(res.message);
  1053. this.materialHttp(this.activeKey)
  1054. })
  1055. }
  1056. } else {
  1057. console.log('error submit!!');
  1058. return false;
  1059. }
  1060. });
  1061. },
  1062. // 脚本指派
  1063. scriptAssign(record){
  1064. console.log(record)
  1065. this.currentMaterial=record;
  1066. this.assignVisible=true;
  1067. this.formPerson={
  1068. plan:'',
  1069. shot:'',
  1070. clip:'',
  1071. },
  1072. this.getProjectId(record.projectId)
  1073. },
  1074. // 视频指派
  1075. videoAssign(record){
  1076. console.log(record)
  1077. this.formPerson={
  1078. plan:'',
  1079. shot:'',
  1080. clip:'',
  1081. },
  1082. this.currentMaterial=record;
  1083. this.assignVisible=true;
  1084. this.getProjectId(record.projectId)
  1085. },
  1086. updataPeople(){
  1087. this.formPerson={
  1088. plan:this.currentMaterial.plan,
  1089. shot:this.currentMaterial.shot,
  1090. clip:this.currentMaterial.clip,
  1091. },
  1092. this.assignVisible=true;
  1093. this.scriptVisible=false;
  1094. this.visible=false;
  1095. this.assignVisibleLoading=true;
  1096. this.getProjectId(this.currentMaterial.projectId)
  1097. },
  1098. getProjectId(id) {
  1099. this.ascription=[];
  1100. getAction('/ctop/projectMember/getMemberList', {
  1101. projectId: id,
  1102. }).then((res) => {
  1103. this.assignVisibleLoading=false;
  1104. if (res.code == 0) {
  1105. this.ascription = res.result.filter((item) => {
  1106. if (
  1107. item.roleCode == 'clip' ||
  1108. item.roleCode == 'plan' ||
  1109. item.roleCode == 'designTeamLeader' ||
  1110. item.roleCode == 'shot' ||
  1111. item.roleCode == 'plane'
  1112. ) {
  1113. return {
  1114. userId: item.userId,
  1115. userName: item.userName,
  1116. }
  1117. }
  1118. })
  1119. }
  1120. })
  1121. },
  1122. modifyVideo(){
  1123. this.childrenDrawer=true;
  1124. // console.log(this.currentVideo);
  1125. this.videoUploadLoading=true
  1126. getAction('/platform/material/videoEcho',{
  1127. videoId:this.currentVideo.videoId
  1128. }).then(res=>{
  1129. console.log(res)
  1130. console.log(res)
  1131. this.videoUploadLoading=false;
  1132. this.confirmLoading=true;
  1133. if(res.result.video){
  1134. this.urlList=res.result.video
  1135. this.videoinfo=res.result.video;
  1136. this.videoinfo.url=this.videoinfo.url.replace(/https:/g,'')
  1137. }
  1138. if(res.result.covers){
  1139. this.imageinfo=res.result.covers;
  1140. this.urlListImage= {
  1141. url : res.result.covers.map(item=>{return item.url}),
  1142. md5 : res.result.covers.map(item=>item.md5),
  1143. name : res.result.covers.map(item=>item.name),
  1144. size : res.result.covers.map(item=>item.size),
  1145. format : res.result.covers.map(item=>item.format),
  1146. }
  1147. }
  1148. this.form.setFieldsValue({
  1149. contentTagList: res.result.tags.contentTagList.map(item=>{return item.tagId}),
  1150. modalityTagList: res.result.tags.modalityTagList.map(item=>{return item.tagId}),
  1151. modTagList: res.result.tags.modTagList.map(item=>{return item.tagId}),
  1152. senceTagList: res.result.tags.senceTagList.map(item=>{return item.tagId}),
  1153. })
  1154. this.videoEchoInfo=res.result
  1155. })
  1156. },
  1157. goOrderDetail(record){
  1158. console.log(record)
  1159. this.$parent.currentTabComponent='orderDetail';
  1160. this.$parent.orderId=record.orderId
  1161. },
  1162. goPlantForm(){
  1163. if(this.$parent.role=='operator'){
  1164. this.$parent.currentTabComponent='operatorPlatform'
  1165. }else if(this.$parent.role=='designLeader'){
  1166. this.$parent.currentTabComponent='designleaderPlatform'
  1167. }else if(this.$parent.role=='design'){
  1168. this.$parent.currentTabComponent='designPlatform'
  1169. }
  1170. },
  1171. tabChange(key){
  1172. console.log(key)
  1173. this.materialHttp(key)
  1174. },
  1175. handleChange(value) {
  1176. console.log(`selected ${value}`);
  1177. },
  1178. filterOption(input, option) {
  1179. return (
  1180. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  1181. );
  1182. },
  1183. onClose() {
  1184. this.visible = false;
  1185. },
  1186. // 上传素材
  1187. uploadMaterial(){
  1188. },
  1189. sort(pagination, filters, sorter, { currentDataSource }){
  1190. this.ipagination.current=pagination.current;
  1191. this.ipagination.pageSize=pagination.pageSize;
  1192. this.materialHttp(this.activeKey)
  1193. },
  1194. // 请求素材
  1195. materialHttp(type){
  1196. this.loading=true;
  1197. this.data=[];
  1198. let params=this.handlerParams(type)
  1199. params={
  1200. ...params,
  1201. pageNo:this.ipagination.current,
  1202. pageSize:this.ipagination.pageSize
  1203. }
  1204. getAction('/platform/material/listByRole',params).then(res=>{
  1205. console.log(res);
  1206. if(res.success){
  1207. this.loading=false;
  1208. this.data=res.result.list;
  1209. this.ipagination.total=res.result.total;
  1210. }
  1211. })
  1212. },
  1213. onClose() {
  1214. this.visible = false;
  1215. },
  1216. scriptClose() {
  1217. this.scriptVisible = false;
  1218. },
  1219. // 视频查看详情
  1220. viewDetails(record){
  1221. console.log(record)
  1222. this.currentMaterial=record
  1223. if(record.materialStatus>=4){
  1224. this.currentVideo={};
  1225. this.visible = true;
  1226. if(record.videoId){
  1227. this.visibleLoading=true
  1228. getAction(this.url.videoDetail,{
  1229. videoId:record.videoId
  1230. }).then(res=>{
  1231. console.log(res);
  1232. this.visibleLoading=false
  1233. if(res.success){
  1234. if(res.result){
  1235. let tagList=res.result.tag?res.result.tag.split(','):[]
  1236. let imgList=res.result.imageUrl?res.result.imageUrl.split(','):[]
  1237. console.log(tagList)
  1238. this.currentVideo={
  1239. ...res.result,
  1240. tagList,
  1241. imgList
  1242. }
  1243. }
  1244. }else{
  1245. this.currentVideo={};
  1246. }
  1247. })
  1248. }else{
  1249. this.currentVideo=record
  1250. this.visible = true;
  1251. }
  1252. }else{
  1253. this.$message.error('请等待脚本审核通过后,上传视频')
  1254. }
  1255. },
  1256. // 脚本查看详情
  1257. scriptViewDetails(record){
  1258. console.log(record)
  1259. this.currentMaterial=record
  1260. this.currentScript={};
  1261. if(record.scriptId){
  1262. this.visibleLoading=true
  1263. getAction(this.url.scriptDetail,{
  1264. scriptId:record.scriptId
  1265. }).then(res=>{
  1266. console.log(res);
  1267. this.visibleLoading=false
  1268. if(res.success){
  1269. this.currentScript=res.result;
  1270. this.scriptVisible = true;
  1271. }else{
  1272. this.currentScript={};
  1273. }
  1274. })
  1275. }else{
  1276. this.currentScript=record
  1277. this.scriptVisible = true;
  1278. }
  1279. },
  1280. search(){
  1281. },
  1282. reset(){
  1283. this.materialName='';
  1284. this.materialId='';
  1285. this.orderStatus='';
  1286. this.orderParticipants="";
  1287. this.orderSponsor='';
  1288. },
  1289. handlerParams(status){
  1290. if(this.$parent.role=='designLeader'){
  1291. if(status==1){
  1292. return {
  1293. materialStatus:'1234567',
  1294. designUserId:this.userInfo.id
  1295. }
  1296. }else if(status==2){
  1297. return {
  1298. materialStatus:'36',
  1299. designUserId:this.userInfo.id
  1300. }
  1301. }else if(status==4){
  1302. return {
  1303. materialStatus:'0',
  1304. designUserId:this.userInfo.id
  1305. }
  1306. }
  1307. }else if(this.$parent.role=='design'){
  1308. if(status==1){
  1309. return {
  1310. materialStatus:'1346',
  1311. designUserId:this.userInfo.id
  1312. }
  1313. }else if(status==2){
  1314. return {
  1315. materialStatus:'36',
  1316. designUserId:this.userInfo.id
  1317. }
  1318. }else if(status==3){
  1319. return {
  1320. materialStatus:'7',
  1321. designUserId:this.userInfo.id
  1322. }
  1323. }else if(status==4){
  1324. return {
  1325. materialStatus:'1234567',
  1326. designUserId:this.userInfo.id
  1327. }
  1328. }
  1329. }
  1330. },
  1331. handlerParamsRole(role){
  1332. if(this.$parent.role=='operator'){
  1333. this.panes=this.operatorPanes
  1334. }else if(this.$parent.role=='designLeader'){
  1335. this.panes=this.designLeaderPanes
  1336. }
  1337. },
  1338. beforeUpload(file) {
  1339. this.uploadAction= `http://jiaoyangapi.shyouteng.com.cn/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
  1340. // this.uploadAction= `http://139.186.151.174:8804/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
  1341. // this.uploadAction= `http://192.168.1.43:8088/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
  1342. this.loadDisabled = true
  1343. const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
  1344. const fileName = file.name
  1345. const fileStrArr = fileName.split('.')
  1346. const suffix = fileStrArr[fileStrArr.length - 1]
  1347. let result = fileSuffix.some((item) => {
  1348. return item === suffix
  1349. })
  1350. if (!result) {
  1351. this.$message.error('不支持该文件类型')
  1352. this.loadDisabled = false
  1353. return false
  1354. }
  1355. if (size > 10) {
  1356. this.$message.error('文件不能大于10MB')
  1357. this.loadDisabled = false
  1358. return false
  1359. }
  1360. },
  1361. handleChange(info) {
  1362. if (info.file.status !== 'uploading') {
  1363. console.log(info.file, info.fileList)
  1364. }
  1365. if (info.file.status === 'done') {
  1366. this.$message.success(`${info.file.name} 上传成功`)
  1367. this.loadDisabled = false
  1368. this.scriptVisible=false;
  1369. this.materialHttp(this.activeKey)
  1370. } else if (info.file.status === 'error') {
  1371. this.$message.error(`${info.file.name} file upload failed.`)
  1372. this.loadDisabled = false
  1373. this.scriptVisible=false;
  1374. }
  1375. },
  1376. showChildrenDrawer() {
  1377. this.childrenDrawer = true;
  1378. this.getTagListAll()
  1379. },
  1380. onChildrenDrawerClose() {
  1381. this.childrenDrawer = false;
  1382. this.loadingElse=false
  1383. this.dataElse = []
  1384. this.form.resetFields()
  1385. this.urlList = {
  1386. url: '',
  1387. md5: '',
  1388. name: '',
  1389. }
  1390. this.tags = []
  1391. this.urlListImage = {
  1392. url: [],
  1393. md5: [],
  1394. name: [],
  1395. size: [],
  1396. }
  1397. this.imageArrList = [];
  1398. this.videoinfo={
  1399. url: '',
  1400. md5: '',
  1401. name: '',
  1402. width:undefined,
  1403. height:undefined,
  1404. };
  1405. this.imageinfo=[];
  1406. this.form.setFieldsValue({
  1407. contentTagList: null,
  1408. modalityTagList: null,
  1409. modTagList: null,
  1410. senceTagList: null,
  1411. })
  1412. },
  1413. onChildrenDrawerOk(){
  1414. this.form.validateFieldsAndScroll((err, values) => {
  1415. if (!err) {
  1416. console.log(values)
  1417. this.loadingElse = true
  1418. var params = {
  1419. ...values,
  1420. ...this.videoinfo,
  1421. covers:[...this.imageinfo]
  1422. }
  1423. params.id = this.add ? null : this.id
  1424. params.userId = this.userInfo.id
  1425. params.projectId=this.currentMaterial.projectId
  1426. params.materialId=this.currentMaterial.id ||this.currentMaterial.materialId
  1427. params.materialCode=this.currentMaterial.materialCode
  1428. postAction('/platform/file/uploadVideo',params).then(res=>{
  1429. this.loading=false;
  1430. if (res.success) {
  1431. this.form.resetFields()
  1432. this.urlList = {
  1433. url: '',
  1434. md5: '',
  1435. name: '',
  1436. }
  1437. this.urlListImage = {
  1438. url: [],
  1439. md5: [],
  1440. name: [],
  1441. size: [],
  1442. }
  1443. this.imageArrList = []
  1444. this.tags = []
  1445. this.childrenDrawer = false
  1446. this.visible=false;
  1447. this.add = true
  1448. for (const key in this.role) {
  1449. if (key == 'roleCode') {
  1450. this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
  1451. }
  1452. }
  1453. this.$message.success('素材上传成功')
  1454. this.loadingElse = false
  1455. this.videoinfo={
  1456. url: '',
  1457. md5: '',
  1458. name: '',
  1459. width:undefined,
  1460. height:undefined,
  1461. };
  1462. this.imageinfo=[];
  1463. this.materialHttp(this.activeKey)
  1464. // this.departValue = []
  1465. } else {
  1466. this.$message.error(res.message)
  1467. this.loadingElse = false
  1468. // this.childrenDrawer = false
  1469. // this.visible=false;
  1470. }
  1471. })
  1472. } else {
  1473. this.$message.error('请正确填写必填项目')
  1474. }
  1475. })
  1476. },
  1477. // 上传视频相关方法
  1478. removeUpload() {
  1479. this.urlList.url='';
  1480. this.urlList.md5='';
  1481. this.urlList.name='';
  1482. this.form.setFieldsValue({
  1483. contentTagList: null,
  1484. modalityTagList: null,
  1485. modTagList: null,
  1486. senceTagList: null,
  1487. })
  1488. },
  1489. overUpload(urlAll) {
  1490. console.log(urlAll)
  1491. this.confirmLoading = true
  1492. this.repeat = false
  1493. this.urlList.url = urlAll[0].url
  1494. this.videoinfo.url=urlAll[0].url
  1495. this.$message.success('上传成功')
  1496. getAction('/ctop/materialTagInfo/detail', {
  1497. code: this.videoinfo.md5,
  1498. }).then((res) => {
  1499. if (res.success) {
  1500. if (res.modalityTagList.length > 0) {
  1501. this.form.setFieldsValue({
  1502. contentTagList: res.contentTagList.map((item) => {
  1503. return item.tagId
  1504. }),
  1505. modalityTagList: res.modalityTagList.map((item) => {
  1506. return item.tagId
  1507. }),
  1508. modTagList: res.modTagList.map((item) => {
  1509. return item.tagId
  1510. }),
  1511. senceTagList: res.senceTagList.map((item) => {
  1512. return item.tagId
  1513. }),
  1514. })
  1515. }
  1516. }
  1517. })
  1518. },
  1519. deleteImage(url) {
  1520. console.log(url, this.urlListImage.url)
  1521. var index = this.imageArrList.findIndex((v) => v.url === url)
  1522. this.imageArrList.splice(index, 1)
  1523. console.log(index)
  1524. },
  1525. overUploadImage(urlAll) {
  1526. console.log(urlAll)
  1527. var that = this
  1528. that.material = []
  1529. that.imageArrList = []
  1530. var img
  1531. if (urlAll.length > 0) {
  1532. urlAll.forEach((ele,index)=>{
  1533. this.imageinfo.forEach(item=>{
  1534. if(item.name==ele.name){
  1535. item.url=ele.url
  1536. }
  1537. })
  1538. // img = new Image()
  1539. // img.src = urlAll[index].url
  1540. })
  1541. } else {}
  1542. },
  1543. addImage(item) {
  1544. this.addImageVisible = true
  1545. this.addImageData = item
  1546. },
  1547. showImage(item) {
  1548. this.chouzhen = true
  1549. this.chouzhenList = []
  1550. var params = {
  1551. videoSignature: item.code,
  1552. pageSize: 20,
  1553. pageNo: 1,
  1554. }
  1555. getAction('/cutFrame/material/list', params).then((res) => {
  1556. console.log(res)
  1557. if (res.success) {
  1558. this.chouzhenList.push(...res.result.records)
  1559. }
  1560. })
  1561. },
  1562. closeImage() {
  1563. this.addImageVisible = false
  1564. this.urlListImage = {
  1565. url: [],
  1566. md5: [],
  1567. name: [],
  1568. size: [],
  1569. }
  1570. this.imageArrList = []
  1571. },
  1572. file(file) {
  1573. console.log(file)
  1574. var bmf = new BMF()
  1575. var that = this
  1576. return new Promise( (resolve, reject)=> {
  1577. this.getVideoMsg(file).then((videoinfo) => {
  1578. const { duration, height, width } = videoinfo;
  1579. //获取到视频的时长,高度,宽度
  1580. bmf.md5(file, (err, md5) => {
  1581. videoinfo.name = file.name
  1582. videoinfo.md5 = md5
  1583. that.repeat = false
  1584. })
  1585. videoinfo.size=file.size;
  1586. videoinfo.format=file.type
  1587. console.log(videoinfo);
  1588. this.videoinfo=videoinfo
  1589. resolve()
  1590. });
  1591. })
  1592. },
  1593. getVideoMsg(file) {
  1594. // console.log('getVideoMsg')
  1595. return new Promise((resolve) => {
  1596. let videoElement = document.createElement("video");
  1597. videoElement.src = URL.createObjectURL(file);
  1598. videoElement.addEventListener("loadedmetadata", function () {
  1599. let obj={
  1600. duration: videoElement.duration,
  1601. height: videoElement.videoHeight,
  1602. width: videoElement.videoWidth,
  1603. }
  1604. window.URL.revokeObjectURL(videoElement.src);
  1605. videoElement.remove()
  1606. resolve(obj);
  1607. });
  1608. });
  1609. },
  1610. getImageMsg(file){
  1611. return new Promise((resolve) => {
  1612. // let imageElement = document.createElement("image");
  1613. let imageElement = new Image();
  1614. let obj={}
  1615. imageElement.src = URL.createObjectURL(file);
  1616. // console.log(imageElement)
  1617. imageElement.onload=function(){
  1618. // console.log(imageElement.width)
  1619. obj={
  1620. height:imageElement.height,
  1621. width:imageElement.width
  1622. }
  1623. console.log(obj)
  1624. resolve(obj)
  1625. }
  1626. });
  1627. },
  1628. fileWater(file) {
  1629. console.log(file)
  1630. var bmf = new BMF()
  1631. var that = this
  1632. var codeData = that.videoinfo.md5 != '' ? that.videoinfo.md5 : that.addImageData.code
  1633. console.log(codeData)
  1634. this.urlListImage = {
  1635. url: [],
  1636. md5: [],
  1637. name: [],
  1638. size: [],
  1639. }
  1640. this.imageinfo=[]
  1641. return new Promise( (resolve, reject)=> {
  1642. bmf.md5(file, (err, md5) => {
  1643. that.urlListImage.name.push(file.name)
  1644. that.urlListImage.md5.push(md5)
  1645. that.urlListImage.size.push(file.size)})
  1646. this.getImageMsg(file).then((imageinfo) => {
  1647. imageinfo.size=file.size;
  1648. imageinfo.format=file.type;
  1649. imageinfo.name=file.name
  1650. bmf.md5(file, (err, md5) => {
  1651. imageinfo.md5=md5
  1652. this.imageinfo.push({
  1653. ...imageinfo
  1654. })
  1655. resolve()
  1656. })
  1657. });
  1658. })
  1659. },
  1660. getTagListAll() {
  1661. this.departTree = []
  1662. this.departTreeModality = [] //形式
  1663. this.departTreeContent = [] // 内容
  1664. this.departTreeSence = [] // 场景
  1665. this.departTreeMod = [] //基调
  1666. this.getQueryTree(1, 'departTreeModality')
  1667. this.getQueryTree(2, 'departTreeMod')
  1668. this.getQueryTree(3, 'departTreeContent')
  1669. this.getQueryTree(4, 'departTreeSence')
  1670. },
  1671. getQueryTree(type, arr) {
  1672. getAction('/ctop/tagInfo/queryTreeList', {
  1673. categoryId: type,
  1674. }).then((res) => {
  1675. if (res.success) {
  1676. if (res.result) {
  1677. this[arr] = this.getTreeData(res.result)
  1678. }
  1679. }
  1680. })
  1681. },
  1682. getTreeData(data) {
  1683. for (var i = 0; i < data.length; i++) {
  1684. if (data[i].children) {
  1685. if (data[i].children.length < 1) {
  1686. // children若为空数组,则将children设为undefined
  1687. data[i].disabled = false
  1688. } else {
  1689. // // children若不为空数组,则继续 递归调用 本方法
  1690. data[i].disabled = true
  1691. this.getTreeData(data[i].children)
  1692. }
  1693. } else {
  1694. data[i].disabled = false
  1695. }
  1696. }
  1697. return data
  1698. },
  1699. getTagListInfo(md5) {
  1700. this.departValueInfoModality = []
  1701. this.departValueInfoMod = []
  1702. this.departValueInfoContent = []
  1703. this.departValueInfoSence = []
  1704. getAction('/ctop/materialTagInfo/detail', {
  1705. code: md5,
  1706. }).then((res) => {
  1707. if (res.success) {
  1708. this.tagInfoList = [...res.modalityTagList, ...res.contentTagList, ...res.senceTagList, ...res.modTagList]
  1709. if (this.tagInfoListVisible) {
  1710. this.departValueInfoModality = res.modalityTagList.map((item) => {
  1711. return item.tagId
  1712. })
  1713. this.departValueInfoMod = res.modTagList.map((item) => {
  1714. return item.tagId
  1715. })
  1716. this.departValueInfoContent = res.contentTagList.map((item) => {
  1717. return item.tagId
  1718. })
  1719. this.departValueInfoSence = res.senceTagList.map((item) => {
  1720. return item.tagId
  1721. })
  1722. }
  1723. }
  1724. })
  1725. },
  1726. showInput() {
  1727. this.inputVisible = true
  1728. this.$nextTick(function () {
  1729. this.$refs.input.focus()
  1730. })
  1731. },
  1732. handleInputChange(e) {
  1733. this.inputValue = e.target.value
  1734. },
  1735. handleInputConfirm() {
  1736. const inputValue = this.inputValue
  1737. let tags = this.tags
  1738. if (inputValue && tags.indexOf(inputValue) === -1) {
  1739. tags = [...tags, inputValue]
  1740. }
  1741. Object.assign(this, {
  1742. tags,
  1743. inputVisible: false,
  1744. inputValue: '',
  1745. })
  1746. },
  1747. },
  1748. mounted(){
  1749. let userInfo=localStorage.getItem('pro__Login_Userinfo');
  1750. if(userInfo){
  1751. this.userInfo=JSON.parse(userInfo).value
  1752. }
  1753. this.roleCode=localStorage.getItem('roleCode')
  1754. console.log(this.$parent.materialStatus)
  1755. this.role=this.$parent.role;
  1756. this.activeKey=this.$parent.materialStatus
  1757. this.materialHttp(this.$parent.materialStatus)
  1758. this.getTagListAll()
  1759. },
  1760. activated() {
  1761. if(this.$parent.role=='operator'){
  1762. this.panes=this.operatorPanes
  1763. }else if(this.$parent.role=='designLeader'){
  1764. this.panes=this.designLeaderPanes
  1765. }else if(this.$parent.role=='design'){
  1766. this.panes=this.designPanes
  1767. }
  1768. this.activeKey=this.$parent.materialStatus
  1769. this.materialHttp(this.$parent.materialStatus)
  1770. this.getTagListAll()
  1771. },
  1772. filters:{
  1773. handlerMaterialStatus(val){
  1774. let str='';
  1775. switch(val){
  1776. case 0:
  1777. str= '待指派'
  1778. break;
  1779. case 1:
  1780. str= '脚本待上传'
  1781. break;
  1782. case 2:
  1783. str= '脚本待审核'
  1784. break;
  1785. case 3:
  1786. str= '脚本被驳回'
  1787. break;
  1788. case 4:
  1789. str= '视频待上传'
  1790. break;
  1791. case 5:
  1792. str= '视频待审核'
  1793. break;
  1794. case 6:
  1795. str= '视频被驳回'
  1796. break;
  1797. case 7:
  1798. str= '物料已完结'
  1799. break;
  1800. default:
  1801. str='出错了'
  1802. break;
  1803. }
  1804. return str
  1805. },
  1806. handlerVideoStatus(val){
  1807. let str='';
  1808. switch(val){
  1809. case 0:
  1810. str= '待上传'
  1811. break;
  1812. case 1:
  1813. str= '待审核'
  1814. break;
  1815. case 2:
  1816. str= '被驳回'
  1817. break;
  1818. case 3:
  1819. str= '已审核'
  1820. break;
  1821. default:
  1822. str='出错了'
  1823. break;
  1824. }
  1825. return str
  1826. },
  1827. },
  1828. }
  1829. </script>