materialList.vue 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024
  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="{ checkStrictly: true, value: 'tagCode', label: 'tagName', expandTrigger: 'hover' }"
  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',
  466. { rules: [{ required: true, message: '请选择内容标签!' }] },
  467. ]"
  468. :props="{
  469. checkStrictly: true, value: 'tagCode', label: 'tagName', expandTrigger: 'hover'
  470. }"
  471. filterable
  472. style="width: 100%"
  473. ></el-cascader>
  474. </a-form-item> -->
  475. <a-form-item
  476. :label-col="labelCol"
  477. :wrapper-col="{
  478. xs: { span: 24 },
  479. sm: { span: 12 },
  480. }"
  481. label="场景标签"
  482. v-if="add && visible"
  483. >
  484. <el-cascader
  485. placeholder="搜索你想要的场景标签"
  486. :options="departTreeSence"
  487. v-decorator="[
  488. 'senceTagList', // 给表单赋值或拉取表单时,该input对应的key
  489. { rules: [{ required: true, message: '请选择场景标签!' }] },
  490. ]"
  491. :props="{ checkStrictly: true, value: 'tagCode', label: 'tagName', expandTrigger: 'hover' }"
  492. filterable
  493. style="width: 100%"
  494. ></el-cascader>
  495. </a-form-item>
  496. <a-form-item
  497. label="基调标签"
  498. v-if="add && visible"
  499. >
  500. <el-cascader
  501. placeholder="搜索你想要的基调标签"
  502. :options="departTreeMod"
  503. v-decorator="[
  504. 'modTagList', // 给表单赋值或拉取表单时,该input对应的key
  505. { rules: [{ required: true, message: '请选择基调标签!' }] },
  506. ]"
  507. :props="{ checkStrictly: true, value: 'tagCode', label: 'tagName', expandTrigger: 'hover' }"
  508. filterable
  509. style="width: 100%"
  510. ></el-cascader>
  511. </a-form-item>
  512. <a-form-item
  513. label="描述"
  514. v-if="add"
  515. >
  516. <div style="position:relative">
  517. <a-textarea
  518. placeholder="请输入描述"
  519. v-decorator="[
  520. 'description', // 给表单赋值或拉取表单时,该input对应的key
  521. ]"
  522. :maxLength='50'
  523. :auto-size="{ minRows: 5, maxRows: 6 }"
  524. @change="descriptionChange"
  525. />
  526. <span style="position:absolute;bottom:5px;right:10px;line-height:24px"><span style="color:#1890ff">{{descriptionlength.length || 0}}</span>/50</span>
  527. </div>
  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" @click="openBigImage(item)" :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&&currentVideo.videoStatus<3" @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. <a-modal v-model="viewImgVisiable" title="封面预览" width='600px' :footer=null>
  761. <div style="position:relative;text-align:center">
  762. <img :src="viewImgUrl" alt="" width="250">
  763. </div>
  764. </a-modal>
  765. </div>
  766. </div>
  767. </div>
  768. </div>
  769. </template>
  770. <script>
  771. import moment from 'moment';
  772. import qs from 'qs'
  773. import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
  774. import Vue from 'vue'
  775. import {ACCESS_TOKEN} from "@/store/mutation-types"
  776. import BMF from 'browser-md5-file'
  777. import { fileCheck, fileCheckImage, fileEdit, fileEditAll,orderFileInsert} from '@/api/actor'
  778. import uploadFile from '@/components/uploadFile.vue'
  779. import { closeAllVideoFun, stopOtherVideo } from '@/utils/videoControl'
  780. import UploadToAli from '@femessage/upload-to-ali'
  781. import { mapGetters } from 'vuex'
  782. import TrendVue from '../../../components/Trend/Trend.vue';
  783. const fileSuffix = [
  784. 'xls',
  785. 'xlt',
  786. 'et',
  787. 'xlsx',
  788. 'xltx',
  789. 'csv',
  790. 'xlsm',
  791. 'xltm',
  792. 'doc',
  793. 'dot',
  794. 'wps',
  795. 'wpt',
  796. 'docx',
  797. 'dotx',
  798. 'docm',
  799. 'dotm',
  800. 'ppt',
  801. 'pptx',
  802. 'pptm',
  803. 'ppsx',
  804. 'ppsm',
  805. 'pps',
  806. 'potx',
  807. 'potm',
  808. 'dpt',
  809. 'dps',
  810. 'pdf',
  811. ]
  812. const videofileSuffix = [
  813. 'avi',
  814. 'wmv',
  815. 'mpg',
  816. 'mpeg',
  817. 'mov',
  818. 'rm',
  819. 'ram',
  820. 'swf',
  821. 'flv',
  822. 'mp4',
  823. ]
  824. let listColumns=[
  825. {
  826. title: '物料名称',
  827. dataIndex: 'materialName',
  828. align: 'center',
  829. key: 'materialName',
  830. scopedSlots: { customRender: 'materialName' }
  831. },
  832. {
  833. title: '物料编号',
  834. dataIndex: 'materialId',
  835. align: 'center',
  836. key: 'tag',
  837. scopedSlots: { customRender: 'materialId' }
  838. },
  839. {
  840. title: '物料状态',
  841. dataIndex: 'materialStatus',
  842. align: 'center',
  843. key: 'materialStatus',
  844. scopedSlots: { customRender: 'materialStatus' }
  845. },
  846. {
  847. title: '脚本',
  848. dataIndex: 'scriptStatus',
  849. align: 'center',
  850. key: 'scriptStatus',
  851. scopedSlots: { customRender: 'scriptStatus' }
  852. },
  853. {
  854. title: '视频',
  855. dataIndex: 'videoStatus',
  856. align: 'center',
  857. key: 'videoStatus',
  858. width:250,
  859. scopedSlots: { customRender: 'videoStatus' }
  860. },
  861. {
  862. title: '所属订单',
  863. dataIndex: 'orderTitle',
  864. align: 'center',
  865. key: 'orderTitle',
  866. scopedSlots: { customRender: 'orderTitle' }
  867. },
  868. ]
  869. export default {
  870. name:'material-list',
  871. components: {
  872. UploadToAli,
  873. uploadFile,
  874. },
  875. data() {
  876. const operatorPanes = [
  877. { title: '待审核的', content: '', key: 1 , },
  878. { title: '已完成的', content: '', key: 2 ,},
  879. ];
  880. const designLeaderPanes=[
  881. { title: '我参与的', content: '', key: 1 , },
  882. { title: '被驳回的', content: '', key: 2 , },
  883. { title: '待指派的', content: '', key: 4 , },
  884. // { title: '已完成的', content: '', key: 3 ,},
  885. ]
  886. const designPanes=[
  887. { title: '指派给我', content: '', key: 1 , },
  888. { title: '被驳回的', content: '', key: 2 , },
  889. { title: '已完成的', content: '', key: 3 ,},
  890. { title: '全部物料', content: '', key: 4 ,},
  891. ]
  892. return {
  893. descriptionlength:'',
  894. viewImgUrl:'',
  895. viewImgVisiable:false,
  896. videoEchoInfo:{},
  897. videoUploadLoading:false,
  898. videoinfo:{
  899. url: '',
  900. md5: '',
  901. name: '',
  902. width:undefined,
  903. height:undefined,
  904. },
  905. imageinfo:[],
  906. assignVisibleLoading:false,
  907. visibleLoading:false,
  908. loadingElse2:false,
  909. rules: {
  910. clip: [{ required: true, message: '剪辑人员必须指派', trigger: 'change' }],
  911. // shot: [{ required: true, message: '拍摄人员必须指派', trigger: 'change' }],
  912. plan: [{ required: true, message: '编导人员必须指派', trigger: 'change' }],
  913. },
  914. // 上传视频
  915. labelCol: {xs: {span: 24,},sm: {span: 5,},},
  916. wrapperCol: {xs: {span: 24,},sm: {span: 12,},},
  917. form:this.$form.createForm(this),
  918. repeat: false,
  919. confirmLoading: false,
  920. urlList: {
  921. url: '',
  922. md5: '',
  923. name: '',
  924. },
  925. urlListImage: {
  926. url: [],
  927. md5: [],
  928. name: [],
  929. size: [],
  930. },
  931. tags: [],
  932. addImageVisible: false,
  933. addImageData: null,
  934. material: [],
  935. // 标签的数据
  936. labelValue: [],
  937. options: [],
  938. departTree: [],
  939. departTreeModality: [],
  940. departTreeContent: [],
  941. departTreeSence: [],
  942. departTreeMod: [],
  943. departValue: [],
  944. departValueInfo: [],
  945. departValueInfoModality: [],
  946. departValueInfoContent: [],
  947. departValueInfoSence: [],
  948. departValueInfoMod: [],
  949. tagInfoList: [],
  950. tagInfoListVisible: false,
  951. tagCode: null,
  952. loadingTag: false,
  953. showImageChouzhen: false,
  954. showImageStr: null,
  955. add: true,
  956. inputVisible: false,
  957. inputValue: '',
  958. childrenDrawer:false,
  959. videoAdvise:'',
  960. scriptAdvise:'',
  961. defaultPic: require('@/assets/noImg.png') ,
  962. tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
  963. uploadAction:'',
  964. videoLoad:false,
  965. loadDisabled:false,
  966. labelCol: { span: 4 },
  967. wrapperCol: { span: 14 },
  968. loadingElse: false,
  969. formPerson:{
  970. plan:'',
  971. shot:'',
  972. clip:'',
  973. },
  974. ascription: [],
  975. acceptLoading:false,
  976. videoAdvise:'',
  977. scriptAdvise:'',
  978. currentScript:{},
  979. currentVideo:{},
  980. visible: false,
  981. scriptVisible:false,
  982. placement: 'right',
  983. currentMaterial:{},
  984. url:{
  985. assgin:'/platform/designer/assign',
  986. scriptDetail:'/platform/material/scriptDetail',
  987. videoDetail:'/platform/material/videoDetail',
  988. scriptAccept:'/platform/material/script/accept',
  989. scriptReject:'/platform/material/script/reject',
  990. videoAccept:'/platform/material/video/accept',
  991. videoReject:'/platform/material/video/reject',
  992. },
  993. operatorPanes,
  994. designLeaderPanes,
  995. designPanes,
  996. userInfo:{},
  997. roleCode:'',
  998. panes:[],
  999. activeKey: '1',
  1000. orderInfo:{ },
  1001. columns:[...listColumns],
  1002. data:[],
  1003. loading:false,
  1004. ipagination: {
  1005. current: 1,
  1006. pageSize: 10,
  1007. // pageSizeOptions: ['10', '20', '30'],
  1008. showTotal: (total, range) => {
  1009. return range[0] + "-" + range[1] + " 共" + total + "条"
  1010. },
  1011. showQuickJumper: true,
  1012. showSizeChanger:true,
  1013. pageSizeOptions: ['10', '30', '50'],
  1014. total: 0,
  1015. onChange: (current, pageSize) => {
  1016. // 切换分页时的回调,
  1017. // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
  1018. this.ipagination.current = current;
  1019. this.ipagination.pageSize= pageSize;
  1020. }
  1021. },
  1022. // 订单进度
  1023. orderName:'',
  1024. materialName:'',
  1025. materialId:'',
  1026. sizeType:[],
  1027. size: "4",
  1028. role:"",
  1029. assignVisible:false,
  1030. }
  1031. },
  1032. methods: {
  1033. descriptionChange(e){
  1034. this.descriptionlength=e.target.value
  1035. },
  1036. openBigImage(item){
  1037. this.viewImgVisiable=true;
  1038. this.viewImgUrl=item
  1039. },
  1040. quxiao(){
  1041. this.assignVisible=false;
  1042. this.$refs.ruleForm.resetFields();
  1043. this.loadingElse=false;
  1044. },
  1045. handleOk(e) {
  1046. console.log(e);
  1047. this.$refs.ruleForm.validate(valid => {
  1048. if (valid) {
  1049. this.loadingElse=true;
  1050. if(this.currentMaterial.clip&&this.currentMaterial.plan&&this.currentMaterial.shot){
  1051. postAction('/platform/designer/assignAgain',{
  1052. id:this.currentMaterial.materialId,
  1053. ...this.formPerson
  1054. }).then(res=>{
  1055. this.loadingElse=false;
  1056. this.assignVisible = false;
  1057. this.$message.success(res.message);
  1058. this.materialHttp(this.activeKey)
  1059. })
  1060. }else{
  1061. postAction(this.url.assgin,{
  1062. id:this.currentMaterial.materialId,
  1063. ...this.formPerson
  1064. }).then(res=>{
  1065. this.loadingElse=false;
  1066. this.assignVisible = false;
  1067. this.$message.success(res.message);
  1068. this.materialHttp(this.activeKey)
  1069. })
  1070. }
  1071. } else {
  1072. console.log('error submit!!');
  1073. return false;
  1074. }
  1075. });
  1076. },
  1077. // 脚本指派
  1078. scriptAssign(record){
  1079. console.log(record)
  1080. this.currentMaterial=record;
  1081. this.assignVisible=true;
  1082. this.formPerson={
  1083. plan:'',
  1084. shot:'',
  1085. clip:'',
  1086. },
  1087. this.getProjectId(record.projectId)
  1088. },
  1089. // 视频指派
  1090. videoAssign(record){
  1091. console.log(record)
  1092. this.formPerson={
  1093. plan:'',
  1094. shot:'',
  1095. clip:'',
  1096. },
  1097. this.currentMaterial=record;
  1098. this.assignVisible=true;
  1099. this.getProjectId(record.projectId)
  1100. },
  1101. updataPeople(){
  1102. this.formPerson={
  1103. plan:this.currentMaterial.plan,
  1104. shot:this.currentMaterial.shot,
  1105. clip:this.currentMaterial.clip,
  1106. },
  1107. this.assignVisible=true;
  1108. this.scriptVisible=false;
  1109. this.visible=false;
  1110. this.assignVisibleLoading=true;
  1111. this.getProjectId(this.currentMaterial.projectId)
  1112. },
  1113. getProjectId(id) {
  1114. this.ascription=[];
  1115. getAction('/ctop/projectMember/getMemberList', {
  1116. projectId: id,
  1117. }).then((res) => {
  1118. this.assignVisibleLoading=false;
  1119. if (res.code == 0) {
  1120. this.ascription = res.result.filter((item) => {
  1121. if (
  1122. item.roleCode == 'clip' ||
  1123. item.roleCode == 'plan' ||
  1124. item.roleCode == 'designTeamLeader' ||
  1125. item.roleCode == 'shot' ||
  1126. item.roleCode == 'plane'
  1127. ) {
  1128. return {
  1129. userId: item.userId,
  1130. userName: item.userName,
  1131. }
  1132. }
  1133. })
  1134. }
  1135. })
  1136. },
  1137. modifyVideo(){
  1138. this.childrenDrawer=true;
  1139. // console.log(this.currentVideo);
  1140. this.videoUploadLoading=true
  1141. getAction('/platform/material/videoEcho',{
  1142. videoId:this.currentVideo.videoId
  1143. }).then(res=>{
  1144. console.log(res)
  1145. console.log(res)
  1146. this.videoUploadLoading=false;
  1147. this.confirmLoading=true;
  1148. if(res.result.video){
  1149. this.urlList=res.result.video
  1150. this.videoinfo=res.result.video;
  1151. this.videoinfo.url=this.videoinfo.url.replace(/https:/g,'')
  1152. }
  1153. if(res.result.covers){
  1154. this.imageinfo=res.result.covers;
  1155. this.urlListImage= {
  1156. url : res.result.covers.map(item=>{return item.url}),
  1157. md5 : res.result.covers.map(item=>item.md5),
  1158. name : res.result.covers.map(item=>item.name),
  1159. size : res.result.covers.map(item=>item.size),
  1160. format : res.result.covers.map(item=>item.format),
  1161. }
  1162. }
  1163. this.form.setFieldsValue({
  1164. // contentTagList: res.result.tags.contentTagList.map(item=>{return item.tagId}),
  1165. modalityTagList: res.result.tags.modalityTagList.map(item=>{return item.tagId}),
  1166. modTagList: res.result.tags.modTagList.map(item=>{return item.tagId}),
  1167. senceTagList: res.result.tags.senceTagList.map(item=>{return item.tagId}),
  1168. description:res.result.video.description
  1169. })
  1170. this.descriptionlength=res.result.video.description
  1171. this.videoEchoInfo=res.result
  1172. })
  1173. },
  1174. goOrderDetail(record){
  1175. console.log(record)
  1176. this.$parent.currentTabComponent='orderDetail';
  1177. this.$parent.orderId=record.orderId
  1178. },
  1179. goPlantForm(){
  1180. if(this.$parent.role=='operator'){
  1181. this.$parent.currentTabComponent='operatorPlatform'
  1182. }else if(this.$parent.role=='designLeader'){
  1183. this.$parent.currentTabComponent='designleaderPlatform'
  1184. }else if(this.$parent.role=='design'){
  1185. this.$parent.currentTabComponent='designPlatform'
  1186. }
  1187. },
  1188. tabChange(key){
  1189. console.log(key)
  1190. this.materialHttp(key)
  1191. },
  1192. handleChange(value) {
  1193. console.log(`selected ${value}`);
  1194. },
  1195. filterOption(input, option) {
  1196. return (
  1197. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  1198. );
  1199. },
  1200. onClose() {
  1201. this.visible = false;
  1202. },
  1203. // 上传素材
  1204. uploadMaterial(){
  1205. },
  1206. sort(pagination, filters, sorter, { currentDataSource }){
  1207. this.ipagination.current=pagination.current;
  1208. this.ipagination.pageSize=pagination.pageSize;
  1209. this.materialHttp(this.activeKey)
  1210. },
  1211. // 请求素材
  1212. materialHttp(type){
  1213. this.loading=true;
  1214. this.data=[];
  1215. let params=this.handlerParams(type)
  1216. params={
  1217. ...params,
  1218. pageNo:this.ipagination.current,
  1219. pageSize:this.ipagination.pageSize
  1220. }
  1221. getAction('/platform/material/listByRole',params).then(res=>{
  1222. console.log(res);
  1223. if(res.success){
  1224. this.loading=false;
  1225. this.data=res.result.list;
  1226. this.ipagination.total=res.result.total;
  1227. }
  1228. })
  1229. },
  1230. onClose() {
  1231. this.visible = false;
  1232. },
  1233. scriptClose() {
  1234. this.scriptVisible = false;
  1235. },
  1236. // 视频查看详情
  1237. viewDetails(record){
  1238. console.log(record)
  1239. this.currentMaterial=record
  1240. if(record.materialStatus>=4){
  1241. this.currentVideo={};
  1242. this.visible = true;
  1243. if(record.videoId){
  1244. this.visibleLoading=true
  1245. getAction(this.url.videoDetail,{
  1246. videoId:record.videoId
  1247. }).then(res=>{
  1248. console.log(res);
  1249. this.visibleLoading=false
  1250. if(res.success){
  1251. if(res.result){
  1252. let tagList=res.result.tag?res.result.tag.split(','):[]
  1253. let imgList=res.result.imageUrl?res.result.imageUrl.split(','):[]
  1254. console.log(tagList)
  1255. this.currentVideo={
  1256. ...res.result,
  1257. tagList,
  1258. imgList
  1259. }
  1260. }
  1261. }else{
  1262. this.currentVideo={};
  1263. }
  1264. })
  1265. }else{
  1266. this.currentVideo=record
  1267. this.visible = true;
  1268. }
  1269. }else{
  1270. this.$message.error('请等待脚本审核通过后,上传视频')
  1271. }
  1272. },
  1273. // 脚本查看详情
  1274. scriptViewDetails(record){
  1275. console.log(record)
  1276. this.currentMaterial=record
  1277. this.currentScript={};
  1278. if(record.scriptId){
  1279. this.visibleLoading=true
  1280. getAction(this.url.scriptDetail,{
  1281. scriptId:record.scriptId
  1282. }).then(res=>{
  1283. console.log(res);
  1284. this.visibleLoading=false
  1285. if(res.success){
  1286. this.currentScript=res.result;
  1287. this.scriptVisible = true;
  1288. }else{
  1289. this.currentScript={};
  1290. }
  1291. })
  1292. }else{
  1293. this.currentScript=record
  1294. this.scriptVisible = true;
  1295. }
  1296. },
  1297. search(){
  1298. },
  1299. reset(){
  1300. this.materialName='';
  1301. this.materialId='';
  1302. this.orderStatus='';
  1303. this.orderParticipants="";
  1304. this.orderSponsor='';
  1305. },
  1306. handlerParams(status){
  1307. if(this.$parent.role=='designLeader'){
  1308. if(status==1){
  1309. return {
  1310. materialStatus:'1234567',
  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==4){
  1319. return {
  1320. materialStatus:'0',
  1321. designUserId:this.userInfo.id
  1322. }
  1323. }
  1324. }else if(this.$parent.role=='design'){
  1325. if(status==1){
  1326. return {
  1327. materialStatus:'1346',
  1328. designUserId:this.userInfo.id
  1329. }
  1330. }else if(status==2){
  1331. return {
  1332. materialStatus:'36',
  1333. designUserId:this.userInfo.id
  1334. }
  1335. }else if(status==3){
  1336. return {
  1337. materialStatus:'7',
  1338. designUserId:this.userInfo.id
  1339. }
  1340. }else if(status==4){
  1341. return {
  1342. materialStatus:'1234567',
  1343. designUserId:this.userInfo.id
  1344. }
  1345. }
  1346. }
  1347. },
  1348. handlerParamsRole(role){
  1349. if(this.$parent.role=='operator'){
  1350. this.panes=this.operatorPanes
  1351. }else if(this.$parent.role=='designLeader'){
  1352. this.panes=this.designLeaderPanes
  1353. }
  1354. },
  1355. beforeUpload(file) {
  1356. this.uploadAction= `http://jiaoyangapi.shyouteng.com.cn/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
  1357. // this.uploadAction= `http://139.186.151.174:8804/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
  1358. // this.uploadAction= `http://192.168.1.43:8088/jeecg-boot/platform/file/uploadScript?materialId=${this.currentMaterial.materialId}&projectId=${this.currentMaterial.projectId}`
  1359. this.loadDisabled = true
  1360. const size = (Number(file.size) / (1024 * 1024)).toFixed(2)
  1361. const fileName = file.name
  1362. const fileStrArr = fileName.split('.')
  1363. const suffix = fileStrArr[fileStrArr.length - 1]
  1364. let result = fileSuffix.some((item) => {
  1365. return item === suffix
  1366. })
  1367. if (!result) {
  1368. this.$message.error('不支持该文件类型')
  1369. this.loadDisabled = false
  1370. return false
  1371. }
  1372. if (size > 10) {
  1373. this.$message.error('文件不能大于10MB')
  1374. this.loadDisabled = false
  1375. return false
  1376. }
  1377. },
  1378. handleChange(info) {
  1379. if (info.file.status !== 'uploading') {
  1380. console.log(info.file, info.fileList)
  1381. }
  1382. if (info.file.status === 'done') {
  1383. this.$message.success(`${info.file.name} 上传成功`)
  1384. this.loadDisabled = false
  1385. this.scriptVisible=false;
  1386. this.materialHttp(this.activeKey)
  1387. } else if (info.file.status === 'error') {
  1388. this.$message.error(`${info.file.name} file upload failed.`)
  1389. this.loadDisabled = false
  1390. this.scriptVisible=false;
  1391. }
  1392. },
  1393. showChildrenDrawer() {
  1394. this.childrenDrawer = true;
  1395. this.getTagListAll()
  1396. },
  1397. onChildrenDrawerClose() {
  1398. this.descriptionlength=''
  1399. this.childrenDrawer = false;
  1400. this.loadingElse=false
  1401. this.dataElse = []
  1402. this.form.resetFields()
  1403. this.urlList = {
  1404. url: '',
  1405. md5: '',
  1406. name: '',
  1407. }
  1408. this.tags = []
  1409. this.urlListImage = {
  1410. url: [],
  1411. md5: [],
  1412. name: [],
  1413. size: [],
  1414. }
  1415. this.imageArrList = [];
  1416. this.videoinfo={
  1417. url: '',
  1418. md5: '',
  1419. name: '',
  1420. width:undefined,
  1421. height:undefined,
  1422. };
  1423. this.imageinfo=[];
  1424. this.form.setFieldsValue({
  1425. // contentTagList: null,
  1426. modalityTagList: null,
  1427. modTagList: null,
  1428. senceTagList: null,
  1429. })
  1430. },
  1431. onChildrenDrawerOk(){
  1432. this.form.validateFieldsAndScroll((err, values) => {
  1433. if (!err) {
  1434. console.log(values)
  1435. this.loadingElse = true
  1436. var params = {
  1437. ...values,
  1438. ...this.videoinfo,
  1439. covers:[...this.imageinfo]
  1440. }
  1441. params.id = this.add ? null : this.id
  1442. params.userId = this.userInfo.id
  1443. params.projectId=this.currentMaterial.projectId
  1444. params.materialId=this.currentMaterial.id ||this.currentMaterial.materialId
  1445. params.materialCode=this.currentMaterial.materialCode
  1446. postAction('/platform/file/uploadVideo',params).then(res=>{
  1447. this.loading=false;
  1448. if (res.success) {
  1449. this.descriptionlength=''
  1450. this.form.resetFields()
  1451. this.urlList = {
  1452. url: '',
  1453. md5: '',
  1454. name: '',
  1455. }
  1456. this.urlListImage = {
  1457. url: [],
  1458. md5: [],
  1459. name: [],
  1460. size: [],
  1461. }
  1462. this.imageArrList = []
  1463. this.tags = []
  1464. this.childrenDrawer = false
  1465. this.visible=false;
  1466. this.add = true
  1467. for (const key in this.role) {
  1468. if (key == 'roleCode') {
  1469. this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
  1470. }
  1471. }
  1472. this.$message.success('素材上传成功')
  1473. this.loadingElse = false
  1474. this.videoinfo={
  1475. url: '',
  1476. md5: '',
  1477. name: '',
  1478. width:undefined,
  1479. height:undefined,
  1480. };
  1481. this.imageinfo=[];
  1482. this.materialHttp(this.activeKey)
  1483. // this.departValue = []
  1484. } else {
  1485. this.$message.error(res.message)
  1486. this.loadingElse = false
  1487. // this.childrenDrawer = false
  1488. // this.visible=false;
  1489. }
  1490. })
  1491. } else {
  1492. this.$message.error('请正确填写必填项目')
  1493. }
  1494. })
  1495. },
  1496. // 上传视频相关方法
  1497. removeUpload() {
  1498. this.urlList.url='';
  1499. this.urlList.md5='';
  1500. this.urlList.name='';
  1501. this.form.setFieldsValue({
  1502. // contentTagList: null,
  1503. modalityTagList: null,
  1504. modTagList: null,
  1505. senceTagList: null,
  1506. })
  1507. },
  1508. overUpload(urlAll) {
  1509. console.log(urlAll)
  1510. this.confirmLoading = true
  1511. this.repeat = false
  1512. this.urlList.url = urlAll[0].url
  1513. this.videoinfo.url=urlAll[0].url
  1514. this.$message.success('上传成功')
  1515. getAction('/ctop/materialTagInfo/detail', {
  1516. code: this.videoinfo.md5,
  1517. }).then((res) => {
  1518. if (res.success) {
  1519. if (res.modalityTagList.length > 0) {
  1520. this.form.setFieldsValue({
  1521. // contentTagList: res.contentTagList.map((item) => {
  1522. // return item.tagId
  1523. // }),
  1524. modalityTagList: res.modalityTagList.map((item) => {
  1525. return item.tagId
  1526. }),
  1527. modTagList: res.modTagList.map((item) => {
  1528. return item.tagId
  1529. }),
  1530. senceTagList: res.senceTagList.map((item) => {
  1531. return item.tagId
  1532. }),
  1533. })
  1534. }
  1535. }
  1536. })
  1537. },
  1538. deleteImage(url) {
  1539. console.log(url, this.urlListImage.url)
  1540. var index = this.imageArrList.findIndex((v) => v.url === url)
  1541. this.imageArrList.splice(index, 1)
  1542. console.log(index)
  1543. },
  1544. overUploadImage(urlAll) {
  1545. console.log(urlAll)
  1546. var that = this
  1547. that.material = []
  1548. that.imageArrList = []
  1549. var img
  1550. if (urlAll.length > 0) {
  1551. urlAll.forEach((ele,index)=>{
  1552. this.imageinfo.forEach(item=>{
  1553. if(item.name==ele.name){
  1554. item.url=ele.url
  1555. }
  1556. })
  1557. // img = new Image()
  1558. // img.src = urlAll[index].url
  1559. })
  1560. } else {}
  1561. },
  1562. addImage(item) {
  1563. this.addImageVisible = true
  1564. this.addImageData = item
  1565. },
  1566. showImage(item) {
  1567. this.chouzhen = true
  1568. this.chouzhenList = []
  1569. var params = {
  1570. videoSignature: item.code,
  1571. pageSize: 20,
  1572. pageNo: 1,
  1573. }
  1574. getAction('/cutFrame/material/list', params).then((res) => {
  1575. console.log(res)
  1576. if (res.success) {
  1577. this.chouzhenList.push(...res.result.records)
  1578. }
  1579. })
  1580. },
  1581. closeImage() {
  1582. this.addImageVisible = false
  1583. this.urlListImage = {
  1584. url: [],
  1585. md5: [],
  1586. name: [],
  1587. size: [],
  1588. }
  1589. this.imageArrList = []
  1590. },
  1591. file(file) {
  1592. console.log(file)
  1593. var bmf = new BMF()
  1594. var that = this
  1595. return new Promise( (resolve, reject)=> {
  1596. this.getVideoMsg(file).then((videoinfo) => {
  1597. const { duration, height, width } = videoinfo;
  1598. //获取到视频的时长,高度,宽度
  1599. bmf.md5(file, (err, md5) => {
  1600. videoinfo.name = file.name
  1601. videoinfo.md5 = md5
  1602. that.repeat = false
  1603. })
  1604. videoinfo.size=file.size;
  1605. videoinfo.format=file.type
  1606. console.log(videoinfo);
  1607. this.videoinfo=videoinfo
  1608. resolve()
  1609. });
  1610. })
  1611. },
  1612. getVideoMsg(file) {
  1613. // console.log('getVideoMsg')
  1614. return new Promise((resolve) => {
  1615. let videoElement = document.createElement("video");
  1616. videoElement.src = URL.createObjectURL(file);
  1617. videoElement.addEventListener("loadedmetadata", function () {
  1618. let obj={
  1619. duration: videoElement.duration,
  1620. height: videoElement.videoHeight,
  1621. width: videoElement.videoWidth,
  1622. }
  1623. window.URL.revokeObjectURL(videoElement.src);
  1624. videoElement.remove()
  1625. resolve(obj);
  1626. });
  1627. });
  1628. },
  1629. getImageMsg(file){
  1630. return new Promise((resolve) => {
  1631. // let imageElement = document.createElement("image");
  1632. let imageElement = new Image();
  1633. let obj={}
  1634. imageElement.src = URL.createObjectURL(file);
  1635. // console.log(imageElement)
  1636. imageElement.onload=function(){
  1637. // console.log(imageElement.width)
  1638. obj={
  1639. height:imageElement.height,
  1640. width:imageElement.width
  1641. }
  1642. console.log(obj)
  1643. resolve(obj)
  1644. }
  1645. });
  1646. },
  1647. fileWater(file) {
  1648. console.log(file)
  1649. var bmf = new BMF()
  1650. var that = this
  1651. var codeData = that.videoinfo.md5 != '' ? that.videoinfo.md5 : that.addImageData.code
  1652. console.log(codeData)
  1653. this.urlListImage = {
  1654. url: [],
  1655. md5: [],
  1656. name: [],
  1657. size: [],
  1658. }
  1659. this.imageinfo=[]
  1660. return new Promise( (resolve, reject)=> {
  1661. bmf.md5(file, (err, md5) => {
  1662. that.urlListImage.name.push(file.name)
  1663. that.urlListImage.md5.push(md5)
  1664. that.urlListImage.size.push(file.size)})
  1665. this.getImageMsg(file).then((imageinfo) => {
  1666. imageinfo.size=file.size;
  1667. imageinfo.format=file.type;
  1668. imageinfo.name=file.name
  1669. bmf.md5(file, (err, md5) => {
  1670. imageinfo.md5=md5
  1671. this.imageinfo.push({
  1672. ...imageinfo
  1673. })
  1674. resolve()
  1675. })
  1676. });
  1677. })
  1678. },
  1679. getTagListAll() {
  1680. this.departTree = []
  1681. this.departTreeModality = [] //形式
  1682. this.departTreeContent = [] // 内容
  1683. this.departTreeSence = [] // 场景
  1684. this.departTreeMod = [] //基调
  1685. this.getQueryTree(1, 'departTreeModality')
  1686. this.getQueryTree(2, 'departTreeMod')
  1687. this.getQueryTree(3, 'departTreeContent')
  1688. this.getQueryTree(4, 'departTreeSence')
  1689. },
  1690. getQueryTree(type, arr) {
  1691. getAction('/ctop/tagInfo/queryTreeList', {
  1692. categoryId: type,
  1693. }).then((res) => {
  1694. if (res.success) {
  1695. if (res.result) {
  1696. this[arr] = this.getTreeData(res.result)
  1697. }
  1698. }
  1699. })
  1700. },
  1701. getTreeData(data) {
  1702. for (var i = 0; i < data.length; i++) {
  1703. if (data[i].children) {
  1704. if (data[i].children.length < 1) {
  1705. // children若为空数组,则将children设为undefined
  1706. data[i].disabled = false
  1707. } else {
  1708. // // children若不为空数组,则继续 递归调用 本方法
  1709. data[i].disabled = true
  1710. this.getTreeData(data[i].children)
  1711. }
  1712. } else {
  1713. data[i].disabled = false
  1714. }
  1715. }
  1716. return data
  1717. },
  1718. getTagListInfo(md5) {
  1719. this.departValueInfoModality = []
  1720. this.departValueInfoMod = []
  1721. this.departValueInfoContent = []
  1722. this.departValueInfoSence = []
  1723. getAction('/ctop/materialTagInfo/detail', {
  1724. code: md5,
  1725. }).then((res) => {
  1726. if (res.success) {
  1727. // , ...res.contentTagList
  1728. this.tagInfoList = [...res.modalityTagList, ...res.senceTagList, ...res.modTagList]
  1729. if (this.tagInfoListVisible) {
  1730. this.departValueInfoModality = res.modalityTagList.map((item) => {
  1731. return item.tagId
  1732. })
  1733. this.departValueInfoMod = res.modTagList.map((item) => {
  1734. return item.tagId
  1735. })
  1736. // this.departValueInfoContent = res.contentTagList.map((item) => {
  1737. // return item.tagId
  1738. // })
  1739. this.departValueInfoSence = res.senceTagList.map((item) => {
  1740. return item.tagId
  1741. })
  1742. }
  1743. }
  1744. })
  1745. },
  1746. showInput() {
  1747. this.inputVisible = true
  1748. this.$nextTick(function () {
  1749. this.$refs.input.focus()
  1750. })
  1751. },
  1752. handleInputChange(e) {
  1753. this.inputValue = e.target.value
  1754. },
  1755. handleInputConfirm() {
  1756. const inputValue = this.inputValue
  1757. let tags = this.tags
  1758. if (inputValue && tags.indexOf(inputValue) === -1) {
  1759. tags = [...tags, inputValue]
  1760. }
  1761. Object.assign(this, {
  1762. tags,
  1763. inputVisible: false,
  1764. inputValue: '',
  1765. })
  1766. },
  1767. },
  1768. mounted(){
  1769. let userInfo=localStorage.getItem('pro__Login_Userinfo');
  1770. if(userInfo){
  1771. this.userInfo=JSON.parse(userInfo).value
  1772. }
  1773. this.roleCode=localStorage.getItem('roleCode')
  1774. console.log(this.$parent.materialStatus)
  1775. this.role=this.$parent.role;
  1776. this.activeKey=this.$parent.materialStatus
  1777. this.materialHttp(this.$parent.materialStatus)
  1778. this.getTagListAll()
  1779. },
  1780. activated() {
  1781. if(this.$parent.role=='operator'){
  1782. this.panes=this.operatorPanes
  1783. }else if(this.$parent.role=='designLeader'){
  1784. this.panes=this.designLeaderPanes
  1785. }else if(this.$parent.role=='design'){
  1786. this.panes=this.designPanes
  1787. }
  1788. this.activeKey=this.$parent.materialStatus
  1789. this.materialHttp(this.$parent.materialStatus)
  1790. this.getTagListAll()
  1791. },
  1792. filters:{
  1793. handlerMaterialStatus(val){
  1794. let str='';
  1795. switch(val){
  1796. case 0:
  1797. str= '待指派'
  1798. break;
  1799. case 1:
  1800. str= '脚本待上传'
  1801. break;
  1802. case 2:
  1803. str= '脚本待审核'
  1804. break;
  1805. case 3:
  1806. str= '脚本被驳回'
  1807. break;
  1808. case 4:
  1809. str= '视频待上传'
  1810. break;
  1811. case 5:
  1812. str= '视频待审核'
  1813. break;
  1814. case 6:
  1815. str= '视频被驳回'
  1816. break;
  1817. case 7:
  1818. str= '物料已完结'
  1819. break;
  1820. default:
  1821. str='出错了'
  1822. break;
  1823. }
  1824. return str
  1825. },
  1826. handlerVideoStatus(val){
  1827. let str='';
  1828. switch(val){
  1829. case 0:
  1830. str= '待上传'
  1831. break;
  1832. case 1:
  1833. str= '待审核'
  1834. break;
  1835. case 2:
  1836. str= '被驳回'
  1837. break;
  1838. case 3:
  1839. str= '已审核'
  1840. break;
  1841. default:
  1842. str='出错了'
  1843. break;
  1844. }
  1845. return str
  1846. },
  1847. },
  1848. }
  1849. </script>