materialList.vue 79 KB

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