fragmentMatemal.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475
  1. <style>
  2. #material-card .ant-tabs-tab {
  3. border: 1px solid gainsboro !important;
  4. }
  5. #material-card .ant-tabs-top-bar {
  6. position: relative;
  7. z-index: 100;
  8. }
  9. #material-card .ant-badge-count {
  10. top: -10px;
  11. }
  12. .detail .ant-form-item {
  13. margin-bottom: 10px !important;
  14. }
  15. </style>
  16. <style lang="scss" scoped>
  17. @media (min-width: 1024px) {
  18. .home-item {
  19. border-style: solid;
  20. border-width: 1px;
  21. border-color: #e4e4e4;
  22. width: calc(50% - 10px);
  23. padding: 10px;
  24. margin-right: 10px;
  25. margin-bottom: 10px;
  26. display: flex;
  27. align-items: center;
  28. background: #fff;
  29. position: relative;
  30. z-index: 99;
  31. }
  32. }
  33. /*>=1024的设备*/
  34. // @media (min-width: 1100px) {
  35. // .checkbox_item_container {
  36. // width:70%
  37. // }
  38. // } /*>=1100的设备*/
  39. @media (min-width: 1280px) {
  40. .home-item {
  41. border-style: solid;
  42. border-width: 1px;
  43. border-color: #e4e4e4;
  44. width: calc(25% - 10px);
  45. padding: 10px;
  46. margin-right: 10px;
  47. margin-bottom: 10px;
  48. display: flex;
  49. align-items: center;
  50. background: #fff;
  51. position: relative;
  52. z-index: 99;
  53. }
  54. }
  55. /*>=1280的设备*/
  56. // @media (min-width: 1366px) {
  57. // }
  58. // @media (min-width: 1440px) {
  59. // }
  60. // @media (min-width: 1680px) {
  61. // }
  62. @media (min-width: 1920px) {
  63. .home-item {
  64. border-style: solid;
  65. border-width: 1px;
  66. border-color: #e4e4e4;
  67. width: calc(25% - 10px);
  68. padding: 10px;
  69. margin-right: 10px;
  70. margin-bottom: 10px;
  71. display: flex;
  72. align-items: center;
  73. background: #fff;
  74. position: relative;
  75. z-index: 99;
  76. cursor: pointer;
  77. }
  78. }
  79. .actor-photo-list {
  80. display: flex;
  81. padding-left: 0;
  82. li {
  83. width: 25%;
  84. margin: 10px;
  85. position: relative;
  86. height: 250px;
  87. border: 1px solid #f2f2f2;
  88. img,
  89. video {
  90. width: 100%;
  91. margin-top: auto;
  92. margin-bottom: auto;
  93. top: 0;
  94. bottom: 0;
  95. position: absolute;
  96. max-height: 250px;
  97. }
  98. }
  99. }
  100. .home-card {
  101. width: 100%;
  102. overflow: hidden;
  103. padding: 10px 0px;
  104. display: flex;
  105. flex-wrap: wrap;
  106. margin-right: -10px;
  107. .home-right {
  108. width: 100%;
  109. }
  110. .bg:after {
  111. content: '';
  112. width: 110%;
  113. height: 110%;
  114. position: absolute;
  115. left: -5%;
  116. top: -5%;
  117. background: inherit;
  118. filter: blur(10px);
  119. z-index: 2;
  120. }
  121. }
  122. .bh {
  123. height: 60px;
  124. line-height: 30px;
  125. overflow: hidden;
  126. text-overflow: ellipsis;
  127. -webkit-line-clamp: 2;
  128. display: -webkit-box;
  129. -webkit-box-orient: vertical;
  130. }
  131. a {
  132. font-size: 14px;
  133. }
  134. .actor-photo-list {
  135. display: flex;
  136. padding-left: 0;
  137. li {
  138. width: 25%;
  139. margin: 10px;
  140. position: relative;
  141. height: 250px;
  142. border: 1px solid #f2f2f2;
  143. img,
  144. video {
  145. width: 100%;
  146. margin-top: auto;
  147. margin-bottom: auto;
  148. top: 0;
  149. bottom: 0;
  150. position: absolute;
  151. max-height: 250px;
  152. }
  153. }
  154. }
  155. </style>
  156. <template>
  157. <a-card :bordered="false">
  158. <!-- 查询区域 -->
  159. <div class="table-page-search-wrapper">
  160. <a-form layout="inline">
  161. <a-row :gutter="24">
  162. <a-col :md="6" :sm="8">
  163. <a-form-item label="选择项目">
  164. <a-select placeholder="请输入项目名称" v-model="queryParam.projectId" @change="getList">
  165. <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
  166. {{ item.projectName }}
  167. </a-select-option>
  168. </a-select>
  169. </a-form-item>
  170. </a-col>
  171. <a-col :md="6" :sm="8">
  172. <a-form-item label="时间选择">
  173. <a-date-picker v-model="queryParam.createTime" format="YYYY-MM-DD" style="width:100%" />
  174. </a-form-item>
  175. </a-col>
  176. <a-col :md="6" :sm="8">
  177. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  178. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  179. <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
  180. </span>
  181. </a-col>
  182. </a-row>
  183. </a-form>
  184. </div>
  185. <!-- table区域-begin -->
  186. <!-- <div> -->
  187. <!-- 操作按钮区域 -->
  188. <div class="table-operator" style="position:relative;z-index:100">
  189. <a-button @click="dirVideoGet" type="primary" icon="plus">新增</a-button>
  190. <a-button @click="onCheckAllChange" v-if="active == 'VIDEO_PART'">{{
  191. checkAll ? '取消 ( ' + checkArr.length + ' )' : '全选'
  192. }}</a-button>
  193. </div>
  194. <!-- :show-upload-list="false" -->
  195. <!-- <a-upload name="file" :multiple="true" list-type="picture-card" class="avatar-uploader"
  196. action="https://media-1301855440.cos.ap-chongqing.myqcloud.com/" :before-upload="beforeUpload"
  197. @change="handleChange" accept='image/*' :file-list="fileList" :remove="removeFile" @preview="handlePreview">
  198. <div>
  199. <a-progress v-if='loadingElse' :percent="percent" :show-info="false" />
  200. <div class="ant-upload-text">
  201. Upload
  202. </div>
  203. </div>
  204. </a-upload> -->
  205. <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
  206. <img alt="example" style="width: 100%" :src="previewImage" />
  207. </a-modal>
  208. <a-tabs @change="callbackTwo" v-model="active" type="card" id="material-card">
  209. <a-tab-pane :tab="item.tab" v-for="item of examinelList" :key="item.value">
  210. <div v-if="item.value != 'join' && item.value != 'job' && item.value != 'success'">
  211. <div v-if="dataSource.length > 0">
  212. <a-checkbox-group @change="onChangeCheck" v-model="checkArr" class="home-card">
  213. <div class="home-item" v-for="(items, index) in dataSource" :key="index" @click="showDetail(items)">
  214. <div class="home-right">
  215. <a-badge v-if="active == 'VIDEO_PART'"
  216. :count="checkArr.indexOf(items.id) > -1 ? checkArr.indexOf(items.id) + 1 : 0"
  217. :numberStyle="{ backgroundColor: '#52c41a' }" style="width:100%">
  218. <span
  219. style="color: #999; fontSize: 16px;padding-bottom:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;">
  220. {{ items.materialName }}
  221. </span>
  222. </a-badge>
  223. <span v-else
  224. style="color: #999; fontSize: 16px;padding-bottom:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;">
  225. {{ items.materialName }}
  226. </span>
  227. <div style="display:flex;justify-content:center;width:100%;height:200px;position:relative">
  228. <video :src="items.url" @canplay="a(items)"
  229. style="height:200px;max-width:100%;position:absolute;z-index:10;" />
  230. <img src="./timg.gif" v-if="!items.showVideo" alt=""
  231. style="height:200px;max-width:100%;position:absolute;z-index:11;" @click.stop />
  232. </div>
  233. <!-- <div v-if="active == '2'" class="bh">驳回原因:{{ items.refuseReason }}</div> -->
  234. <span style="color: black; fontSize: 16px;padding-top:10px;display:block;width:100%" @click.stop>
  235. {{ items.createTime | getDate }}
  236. <a-checkbox :value="items.id" style="float:right"></a-checkbox></span>
  237. </div>
  238. </div>
  239. </a-checkbox-group>
  240. <a-pagination size="small" :showTotal="ipagination.showTotal" style="float:right"
  241. v-if="dataSource.length > 0" showQuickJumper :pageSize.sync="ipagination.pageSize"
  242. :total="ipagination.total" v-model="ipagination.current" @change="getDataSource" />
  243. </div>
  244. <div v-else style="width:100%;height:400px;display:flex;justify-content: center;align-items: center;">
  245. <img
  246. src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
  247. alt="" />
  248. </div>
  249. </div>
  250. <div v-else-if="item.value == 'join'">
  251. <div style="margin-bottom:20px">
  252. <a-button @click="addMatemal" type="primary" icon="plus" style="margin-right:15px">新增一行</a-button>
  253. <a-button type="primary" @click="joinMatemal">开始拼接</a-button>
  254. </div>
  255. <a-table :columns="columns" :dataSource="dataList" :pagination="false">
  256. <span slot="action" slot-scope="text, record, index">
  257. <a @click="removeMatemal(index)">删除</a>
  258. </span>
  259. <span slot="VIDEO_HEAD" slot-scope="text, record, index">
  260. <div v-if="text != ''" style="position:relative">
  261. <video class="video" :src="text.url" controls="controls" style="height:160px">
  262. 您的浏览器不支持 video 标签。
  263. </video>
  264. <a-icon type="close-circle"
  265. style="position:absolute;top:-5px;right:30%;color:red;z-index:10;cursor: pointer;"
  266. @click="deteleVideo('VIDEO_HEAD', record)" />
  267. </div>
  268. <a-button @click="checkMatemal('VIDEO_HEAD', index, record)" type="primary" icon="plus" v-else>选择素材
  269. </a-button>
  270. </span>
  271. <span slot="VIDEO_PART" slot-scope="text, record, index">
  272. <div>
  273. <video class="video" :src="item.url" controls="controls" style="height:160px" v-for="item of text"
  274. :key="item.id" draggable="true" @dragstart="handleDragStart($event, item.code)"
  275. @dragover.prevent="handleDragOver($event, item.code)" @dragenter="handleDragEnter($event, item.code)"
  276. @dragend="handleDragEnd($event, item.code)">
  277. > 您的浏览器不支持 video 标签。
  278. </video>
  279. </div>
  280. <a-button @click="checkMatemal('VIDEO_PART', index, record)" type="primary" icon="plus">选择素材</a-button>
  281. </span>
  282. <span slot="VIDEO_TAIL" slot-scope="text, record, index">
  283. <div v-if="text != ''" style="position:relative">
  284. <video class="video" :src="text.url" controls="controls" style="height:160px">
  285. 您的浏览器不支持 video 标签。
  286. </video>
  287. <a-icon type="close-circle"
  288. style="position:absolute;top:-5px;right:30%;color:red;z-index:10;cursor: pointer;"
  289. @click="deteleVideo('VIDEO_TAIL', record)" />
  290. </div>
  291. <a-button @click="checkMatemal('VIDEO_TAIL', index, record)" type="primary" icon="plus" v-else>选择素材
  292. </a-button>
  293. </span>
  294. </a-table>
  295. </div>
  296. <div v-else-if="item.value == 'job'">
  297. <a-table :columns="columnsJob" :dataSource="dataSource" :pagination="false" :loading="loading" bordered>
  298. <span slot="status" slot-scope="text">
  299. {{ text == 'TranscodeSuccess' ? '已完成' : '提交中' }}
  300. </span>
  301. </a-table>
  302. </div>
  303. <div v-else-if="item.value == 'success'">
  304. <a-button @click="dirVideoGetPublish" type="primary">发布到项目</a-button>
  305. <div v-if="dataSource.length > 0">
  306. <a-checkbox-group @change="onChangeCheck" v-model="checkArr" class="home-card">
  307. <div class="home-item" v-for="(items, index) in dataSource" :key="index" @click="showDetailElse(items)">
  308. <div class="home-right">
  309. <span
  310. style="color: #999; fontSize: 16px;padding-bottom:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;">
  311. {{ items.jobId }}
  312. </span>
  313. <div style="display:flex;justify-content:center;width:100%;height:200px;position:relative">
  314. <video :src="items.videoUrl" @canplay="a(items)"
  315. style="height:200px;max-width:100%;position:absolute;z-index:10;" />
  316. <img src="./timg.gif" v-if="!items.showVideo" alt=""
  317. style="height:200px;max-width:100%;position:absolute;z-index:11;" @click.stop />
  318. </div>
  319. <span style="color: black; fontSize: 16px;padding-top:10px;display:block;width:100%" @click.stop>
  320. {{ items.createTime | getDate }}
  321. <a-checkbox :value="items.videoId" style="float:right"></a-checkbox></span>
  322. </div>
  323. </div>
  324. </a-checkbox-group>
  325. <a-pagination size="small" :showTotal="ipagination.showTotal" style="float:right"
  326. v-if="dataSource.length > 0" showQuickJumper :pageSize.sync="ipagination.pageSize"
  327. :total="ipagination.total" v-model="ipagination.current" @change="getDataSource" />
  328. </div>
  329. <div v-else style="width:100%;height:400px;display:flex;justify-content: center;align-items: center;">
  330. <img
  331. src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1575627350102&di=02972956f2243933bffc0d85099adbfe&imgtype=jpg&src=http%3A%2F%2Fimg0.imgtn.bdimg.com%2Fit%2Fu%3D1095310825%2C1528244349%26fm%3D214%26gp%3D0.jpg"
  332. alt="" />
  333. </div>
  334. </div>
  335. </a-tab-pane>
  336. </a-tabs>
  337. <a-modal title="添加素材" v-model="visible" @ok="handleOk" @cancel="close" :maskClosable="false">
  338. <a-form :form="form">
  339. <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="选择项目">
  340. <a-select v-decorator="[
  341. 'projectId', // 给表单赋值或拉取表单时,该input对应的key
  342. { rules: [{ required: true, message: '请选择项目!' }] }
  343. ]" @change="getProjectId">
  344. <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
  345. {{ item.projectName }}
  346. </a-select-option>
  347. </a-select>
  348. </a-form-item>
  349. <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="片段种类">
  350. <a-select v-decorator="[
  351. 'type', // 给表单赋值或拉取表单时,该input对应的key
  352. { rules: [{ required: true, message: '请选择片段种类!' }], initialValue: 'VIDEO_HEAD' }
  353. ]" @change="getDir">
  354. <a-select-option value="VIDEO_HEAD">片头</a-select-option>
  355. <a-select-option value="VIDEO_PART">片段</a-select-option>
  356. <a-select-option value="VIDEO_TAIL">片尾</a-select-option>
  357. </a-select>
  358. </a-form-item>
  359. <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="视频素材上传">
  360. <uploadFile :value.sync="urlList.url" :fileCount="1" uploadType="video" :multiple="false" />
  361. <!-- <upload-to-ali :customDomain="customDomain" preview :region="region" :bucket="bucket" :accept="acceptVideo"
  362. :max="10" :size="1024000" :accessKeyId="accessKeyId" :accessKeySecret="accessKeySecret"
  363. :before-upload="file" :dir="dirVideo" @loaded="overUpload" v-decorator="[
  364. 'url', // 给表单赋值或拉取表单时,该input对应的key
  365. { rules: [{ required: true, message: '请上传图片!' }] }
  366. ]"></upload-to-ali> -->
  367. </a-form-item>
  368. <a-form-item :label-col="labelCol" :wrapper-col="{
  369. xs: { span: 24 },
  370. sm: { span: 18 }
  371. }" label="标签">
  372. <template v-for="(tag, index) in tags">
  373. <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
  374. <a-tag :key="tag" :closable="index !== 0" :afterClose="() => handleClose(tag)">
  375. {{ `${tag.slice(0, 20)}...` }}
  376. </a-tag>
  377. </a-tooltip>
  378. <a-tag v-else :key="tag" :closable="true" :afterClose="() => handleClose(tag)">
  379. {{ tag }}
  380. </a-tag>
  381. </template>
  382. <a-input v-if="inputVisible" ref="input" type="text" size="small" :style="{ width: '78px' }"
  383. :value="inputValue" @change="handleInputChange" @blur="handleInputConfirm"
  384. @keyup.enter="$event.target.blur" />
  385. <a-tag v-else @click="showInput" style="background: #fff; borderStyle: dashed;">
  386. <a-icon type="plus" /> New Tag
  387. </a-tag>
  388. </a-form-item>
  389. <a-form-item :label-col="labelCol" :wrapper-col="{
  390. xs: { span: 24 },
  391. sm: { span: 18 }
  392. }" label="描述">
  393. <a-textarea placeholder="请输入描述" v-decorator="[
  394. 'materialDescribe' // 给表单赋值或拉取表单时,该input对应的key
  395. ]" :autosize="{ minRows: 3, maxRows: 10 }" />
  396. </a-form-item>
  397. </a-form>
  398. </a-modal>
  399. <a-modal title="发布到项目" v-model="visiblePublish" @ok="handleOkPublich" @cancel="closePublish" :maskClosable="false">
  400. <a-form :form="form">
  401. <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="选择项目">
  402. <a-select v-decorator="[
  403. 'projectId', // 给表单赋值或拉取表单时,该input对应的key
  404. { rules: [{ required: true, message: '请选择项目!' }] }
  405. ]" @change="getProjectId">
  406. <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
  407. {{ item.projectName }}
  408. </a-select-option>
  409. </a-select>
  410. </a-form-item>
  411. </a-form>
  412. </a-modal>
  413. <a-modal title="素材详情" v-model="visibleDetail" width="70%">
  414. <div style="display:flex;height:700px">
  415. <div
  416. style="width:50%;padding:10px;box-sizing:border-box;display:flex;justify-content:center;border-right:1px solid #f2f2f2">
  417. <video class="video" :src="showUrl" controls="controls" style="width:100%">
  418. 您的浏览器不支持 video 标签。
  419. </video>
  420. </div>
  421. <div style="flex:3;padding:10px;box-sizing:border-box;">
  422. <a-form v-if="detail" class="detail">
  423. <div v-if="detail.parameter">
  424. <a-form-item label="视频时长" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }"
  425. v-if="detail.parameter.second">
  426. {{ detail.parameter.second }}秒
  427. </a-form-item>
  428. <a-form-item label="尺寸" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }"
  429. v-if="detail.parameter.width">
  430. {{ detail.parameter.width }}*{{ detail.parameter.height }}
  431. </a-form-item>
  432. <a-form-item label="大小" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="detail.parameter.size">
  433. {{ detail.parameter.size }}
  434. </a-form-item>
  435. </div>
  436. <a-form-item label="标签" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="detail.tag">
  437. <a-tag v-for="(item, index) of detail.tag" :key="index">{{ item }}</a-tag>
  438. </a-form-item>
  439. </a-form>
  440. </div>
  441. </div>
  442. </a-modal>
  443. <account-check ref="check" @synchro="implement"></account-check>
  444. <check-matemal ref="matemal" @showVideo="showVideoFun" />
  445. </a-card>
  446. </template>
  447. <script>
  448. import {
  449. JeecgListMixin
  450. } from '@/mixins/JeecgListMixin'
  451. import JEllipsis from '@/components/jeecg/JEllipsis'
  452. import UploadToAli from '@femessage/upload-to-ali'
  453. import uploadFile from '@/components/uploadFile.vue'
  454. import {
  455. fileCheck,
  456. fileInsert,
  457. fileEdit
  458. } from '@/api/actor'
  459. import {
  460. getAction,
  461. postAction,
  462. postFile
  463. } from '@/api/manage'
  464. import {
  465. stopOtherVideo,
  466. closeAllVideoFun
  467. } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
  468. import {
  469. mapGetters
  470. } from 'vuex'
  471. import moment from 'moment'
  472. import BMF from 'browser-md5-file'
  473. import qs from 'qs'
  474. import accountCheck from './accountCheck'
  475. import checkMatemal from './checkMatemal'
  476. var COS = require('cos-js-sdk-v5');
  477. var cos = new COS({
  478. SecretId: 'AKIDE6IpMi8fJQRCg1iuWzFajjRs43kbbets',
  479. SecretKey: 'tXzuwMfplTTK3c9GFUyETilasvQfePu9',
  480. });
  481. var i = 0
  482. function getBase64(file) {
  483. return new Promise((resolve, reject) => {
  484. const reader = new FileReader();
  485. reader.readAsDataURL(file);
  486. reader.onload = () => resolve(reader.result);
  487. reader.onerror = error => reject(error);
  488. });
  489. }
  490. export default {
  491. name: 'YardList',
  492. mixins: [JeecgListMixin],
  493. components: {
  494. JEllipsis,
  495. UploadToAli,
  496. accountCheck,
  497. checkMatemal,
  498. uploadFile
  499. },
  500. data() {
  501. return {
  502. fileList: [],
  503. dragging: null,
  504. dataKey: 0,
  505. columns: [{
  506. title: '片头',
  507. dataIndex: 'VIDEO_HEAD',
  508. scopedSlots: {
  509. customRender: 'VIDEO_HEAD'
  510. },
  511. align: 'center'
  512. },
  513. {
  514. title: '内容',
  515. dataIndex: 'VIDEO_PART',
  516. scopedSlots: {
  517. customRender: 'VIDEO_PART'
  518. },
  519. align: 'center'
  520. },
  521. {
  522. title: '片尾',
  523. dataIndex: 'VIDEO_TAIL',
  524. scopedSlots: {
  525. customRender: 'VIDEO_TAIL'
  526. },
  527. align: 'center'
  528. },
  529. {
  530. title: '操作',
  531. dataIndex: 'action',
  532. scopedSlots: {
  533. customRender: 'action'
  534. },
  535. align: 'center'
  536. }
  537. ],
  538. columnsJob: [{
  539. title: '',
  540. dataIndex: '',
  541. key: 'rowIndex',
  542. width: 50,
  543. align: 'center',
  544. customRender: function (t, r, index) {
  545. return parseInt(index) + 1
  546. }
  547. },
  548. {
  549. title: '任务Id',
  550. dataIndex: 'jobId',
  551. scopedSlots: {
  552. customRender: 'jobId'
  553. },
  554. align: 'center'
  555. },
  556. {
  557. title: '状态',
  558. dataIndex: 'status',
  559. scopedSlots: {
  560. customRender: 'status'
  561. },
  562. align: 'center'
  563. }
  564. ],
  565. dataJob: [],
  566. dataList: [{
  567. key: 1,
  568. VIDEO_HEAD: '',
  569. VIDEO_PART: [],
  570. VIDEO_TAIL: ''
  571. }],
  572. inputVisible: false,
  573. inputValue: '',
  574. labelCol: {
  575. xs: {
  576. span: 24
  577. },
  578. sm: {
  579. span: 6
  580. }
  581. },
  582. wrapperCol: {
  583. xs: {
  584. span: 24
  585. },
  586. sm: {
  587. span: 12
  588. }
  589. },
  590. noImgUrl: require('@/assets/img/noImg.png'),
  591. queryParam: {},
  592. dataElse: [],
  593. ascription: {
  594. clipId: [], //剪辑人id
  595. shotId: [], //拍摄人id
  596. planId: [], //策划id
  597. planeId: [] //平面id
  598. },
  599. show: true,
  600. visible: false,
  601. visibleDetail: false,
  602. visiblePublish: false,
  603. activeKey: 'video',
  604. active: 'VIDEO_HEAD',
  605. examinelList: [{
  606. value: 'VIDEO_HEAD',
  607. tab: '片头'
  608. },
  609. {
  610. value: 'VIDEO_PART',
  611. tab: '片段'
  612. },
  613. {
  614. value: 'VIDEO_TAIL',
  615. tab: '片尾'
  616. },
  617. {
  618. value: 'join',
  619. tab: '视频拼接'
  620. },
  621. {
  622. value: 'job',
  623. tab: '任务列表'
  624. },
  625. {
  626. value: 'success',
  627. tab: '成品'
  628. }
  629. ],
  630. // 表头
  631. urlList: {
  632. url: '',
  633. md5: '',
  634. name: ''
  635. },
  636. url: {
  637. list: '/ctop/materialInfo/list'
  638. },
  639. detail: false,
  640. form: this.$form.createForm(this),
  641. tags: [],
  642. refuseFile: [],
  643. refuseReason: '',
  644. creativeCopywriter: '',
  645. customDomain: '',
  646. region: 'oss-cn-beijing',
  647. bucket: 'ctop-part',
  648. acceptVideo: 'video/mpeg,video/mp4',
  649. acceptImage: 'image/jpeg,image/jpg,image/png',
  650. accessKeyId: 'LTAIbNbqWzSOklQV',
  651. accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
  652. checkArr: [],
  653. checkAll: false,
  654. showUrl: '',
  655. showUrlWater: '',
  656. materialDescribe: '',
  657. name: '',
  658. detail: null,
  659. add: true,
  660. id: '',
  661. role: {
  662. roleCode: '',
  663. roleName: ''
  664. },
  665. key: '0',
  666. mediaId: null,
  667. dirVideo: '',
  668. defaultDir: 'VIDEO_HEAD',
  669. joinVideo: {
  670. head: '',
  671. content: [],
  672. foot: ''
  673. },
  674. loadingElse: false,
  675. imageUrl: '',
  676. percent: 0,
  677. previewVisible: false,
  678. previewImage: '',
  679. }
  680. },
  681. filters: {
  682. getDate(value) {
  683. let date = new Date(value)
  684. let y = date.getFullYear()
  685. let MM = date.getMonth() + 1
  686. MM = MM < 10 ? '0' + MM : MM
  687. let d = date.getDate()
  688. d = d < 10 ? '0' + d : d
  689. return y + '-' + MM + '-' + d
  690. }
  691. },
  692. updated() {
  693. stopOtherVideo()
  694. },
  695. computed: {
  696. dirImg() {
  697. let date = new Date()
  698. let y = date.getFullYear()
  699. let MM = date.getMonth() + 1
  700. MM = MM < 10 ? '0' + MM : MM
  701. let d = date.getDate()
  702. d = d < 10 ? '0' + d : d
  703. return 'image/' + y + '-' + MM + '-' + d + '/'
  704. }
  705. },
  706. created() {
  707. this.queryParam.type = this.active
  708. this.queryParam.userId = this.userInfo().id
  709. this.ipagination.pageSize = 8
  710. this.getParticipateList()
  711. // /sys/user/getRoleInfo
  712. getAction('/sys/user/getRoleInfo', {
  713. userId: this.userInfo().id
  714. }).then(res => {
  715. this.role = res
  716. })
  717. },
  718. watch: {
  719. $route: function (n, o) {
  720. if (n.path == '/modules/material/materialList') {
  721. this.queryParam.userId = this.userInfo().id
  722. this.queryParam.type = this.active
  723. this.loadData()
  724. }
  725. }
  726. },
  727. methods: {
  728. handleCancel() {
  729. this.previewVisible = false;
  730. },
  731. handleChange(info) {
  732. if (info.file.status === 'uploading') {
  733. this.loading = true;
  734. return;
  735. }
  736. if (info.file.status === 'done') {
  737. // Get this url from response in real world.
  738. getBase64(info.file.originFileObj, imageUrl => {
  739. this.imageUrl = imageUrl;
  740. this.loading = false;
  741. });
  742. }
  743. },
  744. removeFile(file) {
  745. console.log(file)
  746. var index = this.fileList.findIndex(v => v.uid === file.uid)
  747. this.fileList.splice(index, 1)
  748. },
  749. async handlePreview(file) {
  750. if (!file.url && !file.preview) {
  751. file.preview = await getBase64(file.originFileObj);
  752. }
  753. this.previewImage = file.url || file.preview;
  754. this.previewVisible = true;
  755. },
  756. beforeUpload(file) {
  757. console.log(file)
  758. this.loadingElse = true
  759. var that = this
  760. let date = new Date()
  761. let y = date.getFullYear()
  762. let MM = date.getMonth() + 1
  763. MM = MM < 10 ? '0' + MM : MM
  764. let d = date.getDate()
  765. d = d < 10 ? '0' + d : d
  766. return new Promise(function (resolve, reject) {
  767. cos.putObject({
  768. Bucket: 'media-1301855440',
  769. /* 必须 */
  770. Region: 'ap-chongqing',
  771. /* 存储桶所在地域,必须字段 */
  772. Key: 'image/' + y + '-' + MM + '-' + d + '/' + file.name,
  773. /* 必须 */
  774. StorageClass: 'STANDARD',
  775. Body: file, // 上传文件对象
  776. onProgress: function (progressData) {
  777. console.log(typeof JSON.stringify(progressData));
  778. console.log(progressData.percent);
  779. that.percent = (progressData.percent * 100)
  780. },
  781. onTaskReady: function (tid) {
  782. console.log('onTaskReady', tid);
  783. },
  784. onTaskStart: function (info) {
  785. console.log('onTaskStart', info);
  786. },
  787. }, function (err, data) {
  788. if (err) {
  789. console.log(err);
  790. return;
  791. }
  792. console.log('成功', data)
  793. // alert('成功')
  794. that.loadingElse = false
  795. that.fileList.push({
  796. uid: i++,
  797. name: file.name,
  798. status: 'done',
  799. url: 'http://' + data.Location,
  800. })
  801. });
  802. })
  803. reject()
  804. },
  805. startConcat() {
  806. console.log(this.dataList)
  807. },
  808. handleDragStart(e, item) {
  809. this.dragging = item
  810. },
  811. handleDragEnd(e, item) {
  812. this.dragging = null
  813. },
  814. //首先把div变成可以放置的元素,即重写dragenter/dragover
  815. handleDragOver(e) {
  816. e.dataTransfer.dropEffect = 'move' // e.dataTransfer.dropEffect="move";//在dragenter中针对放置目标来设置!
  817. },
  818. handleDragEnter(e, item) {
  819. e.dataTransfer.effectAllowed = 'move' //为需要移动的元素设置dragstart事件
  820. if (item === this.dragging) {
  821. return
  822. }
  823. console.log(this.dataKey)
  824. const newItems = [...this.dataList[this.dataKey].VIDEO_PART]
  825. console.log(newItems)
  826. const src = newItems.indexOf(this.dragging)
  827. const dst = newItems.indexOf(item)
  828. newItems.splice(dst, 0, ...newItems.splice(src, 1))
  829. this.dataList[this.dataKey].VIDEO_PART = newItems
  830. },
  831. checkMatemal(type, number, item) {
  832. this.$refs.matemal.showCheck(type, number, item)
  833. },
  834. addMatemal() {
  835. var num = this.dataList.length + 1
  836. this.dataList.push({
  837. key: num,
  838. VIDEO_HEAD: '',
  839. VIDEO_PART: [],
  840. VIDEO_TAIL: ''
  841. })
  842. },
  843. removeMatemal(index) {
  844. this.dataList.splice(index, 1)
  845. },
  846. deteleVideo(type, item) {
  847. item[type] = ''
  848. },
  849. moment,
  850. a(item) {
  851. item.showVideo = true
  852. },
  853. getDir(value) {
  854. this.defaultDir = value
  855. this.setDir()
  856. },
  857. joinMatemal() {
  858. console.log(this.dataList)
  859. var data = this.dataList.filter(item => {
  860. return item.VIDEO_PART.length > 0
  861. })
  862. console.log(data)
  863. if (data.length > 0) {
  864. // {"startPart":"","endPart":"","parts":["",""]}
  865. var params = this.dataList.map(item => {
  866. return {
  867. startPart: item.VIDEO_HEAD.id,
  868. parts: item.VIDEO_PART.map(item => {
  869. return item.id
  870. }),
  871. endPart: item.VIDEO_TAIL.id
  872. }
  873. })
  874. // var paramsString = qs.stringify({ videoMergeList: params })
  875. postAction('/ctop/materialpart/merge', params).then(res => {
  876. console.log(res)
  877. if (res.success) {
  878. that.$message.error(res.message)
  879. this.dataList = []
  880. }
  881. })
  882. } else {
  883. that.$message.error('还未选择素材片段')
  884. }
  885. },
  886. dirVideoGet() {
  887. this.visible = true
  888. console.log(this.defaultDir)
  889. this.setDir()
  890. },
  891. dirVideoGetPublish() {
  892. if (this.checkArr.length > 0) {
  893. this.visiblePublish = true
  894. } else {
  895. this.$message.error('请选择需要发布的视频')
  896. }
  897. },
  898. setDir() {
  899. let date = new Date()
  900. let y = date.getFullYear()
  901. let MM = date.getMonth() + 1
  902. MM = MM < 10 ? '0' + MM : MM
  903. let d = date.getDate()
  904. d = d < 10 ? '0' + d : d
  905. this.dirVideo = 'input/' + this.defaultDir + '/' + y + '-' + MM + '-' + d + '/'
  906. },
  907. tongbu() {
  908. this.$refs.check.getData('/ctop/userAllocation/getAccountList', {
  909. userId: this.userInfo().id,
  910. projectId: this.queryParam.projectId
  911. })
  912. },
  913. implement(data) {
  914. var params = {}
  915. params.mediaId = this.mediaId
  916. params.materialArray = JSON.stringify(this.checkArr)
  917. params.accountArray = JSON.stringify(data)
  918. postAction('/ctop/materialUpload/uploadAccount', params).then(res => {
  919. if (res.code == 0) {
  920. this.checkArr = []
  921. this.checkAll = false
  922. }
  923. })
  924. },
  925. showVideoFun(data, typeName) {
  926. console.log(data)
  927. if (typeName == 'VIDEO_HEAD') {
  928. //片头
  929. this.dataList[data.key].VIDEO_HEAD = data.head
  930. } else if (typeName == 'VIDEO_TAIL') {
  931. this.dataList[data.key].VIDEO_TAIL = data.foot
  932. } else {
  933. this.dataList[data.key].VIDEO_PART = data.content
  934. this.dataKey = data.key
  935. }
  936. },
  937. downloadByBlob() {
  938. fetch(this.showUrlWater)
  939. .then(res => res.blob())
  940. .then(blob => {
  941. const a = document.createElement('a')
  942. document.body.appendChild(a)
  943. a.style.display = 'none'
  944. // 使用获取到的blob对象创建的url
  945. const url = window.URL.createObjectURL(blob)
  946. a.href = url
  947. // 指定下载的文件名
  948. a.download = this.name
  949. a.click()
  950. document.body.removeChild(a)
  951. // 移除blob对象的url
  952. window.URL.revokeObjectURL(url)
  953. })
  954. },
  955. download(href, name) {
  956. let eleLink = document.createElement('a')
  957. eleLink.download = name
  958. eleLink.href = href
  959. eleLink.click()
  960. eleLink.remove()
  961. },
  962. ...mapGetters(['nickname', 'avatar', 'userInfo']),
  963. onCheckAllChange() {
  964. if (this.checkAll) {
  965. this.checkArr = []
  966. } else {
  967. this.checkArr = this.dataSource.map(item => {
  968. return item.id
  969. })
  970. }
  971. this.checkAll = !this.checkAll
  972. this.onChangeCheck(this.checkArr)
  973. },
  974. searchRe() {
  975. this.queryParam = {
  976. projectId: '',
  977. createTime: ''
  978. }
  979. this.loadData()
  980. },
  981. getList(value) {
  982. this.mediaId = this.dataElse.filter(item => {
  983. if (value == item.projectId) {
  984. return item
  985. }
  986. })[0].mediaId
  987. this.loadData()
  988. },
  989. onChangeCheck(checkedList) {
  990. // { value: 'VIDEO_HEAD', tab: '片头' },
  991. // { value: 'VIDEO_PART', tab: '片段' },
  992. // { value: 'VIDEO_TAIL', tab: '片尾' }
  993. if (this.active == 'VIDEO_HEAD') {
  994. //片头
  995. if (this.checkArr.length > 1) {
  996. this.checkArr.shift()
  997. this.joinVideo.head = checkedList[0]
  998. } else if (this.checkArr.length == 1) {
  999. this.joinVideo.head = checkedList[0]
  1000. } else if (this.checkArr.length == 0) {
  1001. this.joinVideo.head = ''
  1002. }
  1003. } else if (this.active == 'VIDEO_TAIL') {
  1004. //片尾
  1005. if (this.checkArr.length > 1) {
  1006. this.checkArr.shift()
  1007. this.joinVideo.foot = checkedList[0]
  1008. } else if (this.checkArr.length == 1) {
  1009. this.joinVideo.foot = checkedList[0]
  1010. } else if (this.checkArr.length == 0) {
  1011. this.joinVideo.foot = ''
  1012. }
  1013. } else {
  1014. //内容
  1015. if (checkedList.length == 0) {
  1016. this.checkAll = false
  1017. }
  1018. this.joinVideo.content = checkedList
  1019. }
  1020. },
  1021. handleClose(removedTag) {
  1022. const tags = this.tags.filter(tag => tag !== removedTag)
  1023. this.tags = tags
  1024. },
  1025. showInput() {
  1026. this.inputVisible = true
  1027. this.$nextTick(function () {
  1028. this.$refs.input.focus()
  1029. })
  1030. },
  1031. handleInputChange(e) {
  1032. this.inputValue = e.target.value
  1033. },
  1034. handleInputConfirm() {
  1035. const inputValue = this.inputValue
  1036. let tags = this.tags
  1037. if (inputValue && tags.indexOf(inputValue) === -1) {
  1038. tags = [...tags, inputValue]
  1039. }
  1040. Object.assign(this, {
  1041. tags,
  1042. inputVisible: false,
  1043. inputValue: ''
  1044. })
  1045. },
  1046. showDetail(item) {
  1047. this.visibleDetail = true
  1048. this.showUrl = item.url
  1049. this.showUrlWater = item.watermarkUrl ? item.watermarkUrl : null
  1050. this.name = item.watermarkMaterialName ? item.watermarkMaterialName : null
  1051. this.id = item.id
  1052. if (this.active == '2') {
  1053. this.refuseReason = item.refuseReason
  1054. this.refuseFile = item.refuseFile ? JSON.parse(item.refuseFile) : null
  1055. } else if (this.active == '1') {
  1056. this.creativeCopywriter = item.creativeCopywriter
  1057. this.refuseReason = ''
  1058. this.refuseFile = []
  1059. } else {
  1060. this.refuseReason = ''
  1061. this.refuseFile = []
  1062. }
  1063. getAction('/ctop/materialInfo/getDetail', {
  1064. materialId: item.id
  1065. }).then(res => {
  1066. this.detail = res
  1067. })
  1068. },
  1069. showDetailElse(item) {
  1070. this.visibleDetail = true
  1071. this.showUrl = item.videoUrl
  1072. this.id = item.id
  1073. getAction('/ctop/materialInfo/getDetail', {
  1074. materialId: item.videoId
  1075. }).then(res => {
  1076. this.detail = res
  1077. })
  1078. },
  1079. okEditShow(item, editStatus) {
  1080. if (editStatus == '2') {
  1081. var params = {}
  1082. params.id = item.id
  1083. params.auditorId = this.userInfo().id
  1084. params.refuseReason = this.refuseReason
  1085. var data = this.refuseFile.map(item => {
  1086. return 'https:' + item
  1087. })
  1088. params.refuseFile = JSON.stringify(data)
  1089. params.status = editStatus
  1090. fileEdit(params).then(res => {
  1091. this.refuseFile = []
  1092. this.refuseReason = ''
  1093. this.loadData()
  1094. })
  1095. } else if (editStatus == '1') {
  1096. var params = {}
  1097. params.id = item.id
  1098. params.auditorId = this.userInfo().id
  1099. params.creativeCopywriter = this.refuseReason
  1100. params.status = editStatus
  1101. fileEdit(params).then(res => {
  1102. this.refuseReason = ''
  1103. this.loadData()
  1104. })
  1105. }
  1106. },
  1107. okEdit(e) {
  1108. this.edit(null, this.active, '2')
  1109. },
  1110. edit(item, status, editStatus) {
  1111. if (status == '0' || status == '1') {
  1112. if (editStatus == '2') {
  1113. var params = {}
  1114. params.id = this.id
  1115. params.auditorId = this.userInfo().id
  1116. params.refuseReason = this.refuseReason
  1117. var data = this.refuseFile.map(item => {
  1118. return 'https:' + item
  1119. })
  1120. params.refuseFile = JSON.stringify(data)
  1121. params.status = editStatus
  1122. fileEdit(params).then(res => {
  1123. this.refuseFile = []
  1124. this.refuseReason = ''
  1125. this.loadData()
  1126. this.visibleDetail = false
  1127. })
  1128. } else {
  1129. fileEdit({
  1130. id: this.id,
  1131. status: editStatus,
  1132. auditorId: this.userInfo().id
  1133. }).then(res => {
  1134. this.refuseFile = []
  1135. this.refuseReason = ''
  1136. this.loadData()
  1137. this.visibleDetail = false
  1138. })
  1139. }
  1140. } else {
  1141. this.add = false
  1142. this.visible = true
  1143. this.getProjectId(item.projectId)
  1144. getAction('/ctop/materialInfo/getDetail', {
  1145. materialId: item.id
  1146. }).then(res => {
  1147. if (this.activeKey == 'image') {
  1148. this.form.setFieldsValue({
  1149. projectId: item.projectId,
  1150. clipId: res.ascription.clipId,
  1151. planeId: res.ascription.planeId,
  1152. materialDescribe: item.materialDescribe
  1153. })
  1154. } else {
  1155. this.form.setFieldsValue({
  1156. projectId: item.projectId,
  1157. clipId: res.ascription.clipId,
  1158. planId: res.ascription.planId,
  1159. shotId: res.ascription.shotId,
  1160. materialDescribe: item.materialDescribe
  1161. })
  1162. }
  1163. this.tags = res.tag
  1164. this.urlList.url = item.url
  1165. this.urlList.md5 = item.code
  1166. this.urlList.name = item.materialName
  1167. this.watermarkUrl.url = item.watermarkUrl
  1168. this.watermarkUrl.md5 = item.watermarkCode
  1169. this.watermarkUrl.name = item.watermarkMaterialName
  1170. this.id = item.id
  1171. })
  1172. }
  1173. },
  1174. handleOkPublich() {
  1175. console.log(this.checkArr)
  1176. this.form.validateFieldsAndScroll((err, values) => {
  1177. console.log(values)
  1178. if (!err) {
  1179. var params = {}
  1180. params.materialIds = this.checkArr
  1181. params.projectId = values.projectId
  1182. postAction('/ctop/materialInfo/batchEdit', params).then(res => {
  1183. if (res.success) {
  1184. this.visiblePublish = false
  1185. } else {
  1186. that.$message.error(res.message)
  1187. }
  1188. })
  1189. }
  1190. })
  1191. },
  1192. closePublish() {
  1193. this.visiblePublish = false
  1194. },
  1195. handleOk() {
  1196. this.form.validateFieldsAndScroll((err, values) => {
  1197. if (err) {
  1198. // 这里做逻辑处理
  1199. } else {
  1200. var params = {}
  1201. var roleCode = {}
  1202. for (const key in this.role) {
  1203. if (key == 'roleCode') {
  1204. this.role[key] = this.role[key] + 'Id'
  1205. roleCode[this.role[key]] = this.userInfo().id
  1206. }
  1207. }
  1208. params.id = this.add ? null : this.id
  1209. params.code = this.urlList.md5
  1210. params.url = this.urlList.url
  1211. params.materialName = this.urlList.name
  1212. params.userId = this.userInfo().id
  1213. params.projectId = values.projectId
  1214. params.materialDescribe = values.materialDescribe
  1215. params.ascription = roleCode
  1216. params.type = values.type
  1217. params.tag = this.tags
  1218. if (this.add) {
  1219. fileInsert(params).then(res => {
  1220. this.form.resetFields()
  1221. this.urlList = {
  1222. url: '',
  1223. md5: '',
  1224. name: ''
  1225. }
  1226. this.watermarkUrl = {
  1227. url: '',
  1228. md5: '',
  1229. name: ''
  1230. }
  1231. this.tags = []
  1232. this.loadData()
  1233. this.visible = false
  1234. this.add = true
  1235. for (const key in this.role) {
  1236. if (key == 'roleCode') {
  1237. this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
  1238. }
  1239. }
  1240. })
  1241. } else {
  1242. fileEdit({
  1243. ...params,
  1244. status: '0'
  1245. }).then(res => {
  1246. this.form.resetFields()
  1247. this.urlList = {
  1248. url: '',
  1249. md5: '',
  1250. name: ''
  1251. }
  1252. this.watermarkUrl = {
  1253. url: '',
  1254. md5: '',
  1255. name: ''
  1256. }
  1257. this.tags = []
  1258. this.loadData()
  1259. this.visible = false
  1260. this.add = true
  1261. for (const key in this.role) {
  1262. if (key == 'roleCode') {
  1263. this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
  1264. }
  1265. }
  1266. })
  1267. }
  1268. }
  1269. })
  1270. },
  1271. close() {
  1272. var that = this
  1273. that.form.resetFields()
  1274. that.urlList = {
  1275. url: '',
  1276. md5: '',
  1277. name: ''
  1278. }
  1279. that.watermarkUrl = {
  1280. url: '',
  1281. md5: '',
  1282. name: ''
  1283. }
  1284. that.tags = []
  1285. },
  1286. onChange(date, dateString) {},
  1287. callbackTwo(key) {
  1288. this.checkArr = []
  1289. // if (key == 'VIDEO_HEAD') {
  1290. // this.checkArr[0] = this.joinVideo.head
  1291. // } else if (key == 'VIDEO_TAIL') {
  1292. // this.checkArr[0] = this.joinVideo.foot
  1293. // } else if (key == 'VIDEO_PART') {
  1294. // this.checkArr = this.joinVideo.content
  1295. // } else
  1296. if (key == 'job') {
  1297. this.queryParam.type = ''
  1298. this.queryParam.jobId = ''
  1299. this.queryParam.status = ''
  1300. this.url.list = '/ctop/videoMergeTask/list'
  1301. this.loadData()
  1302. } else if (key == 'success') {
  1303. this.queryParam.type = ''
  1304. this.queryParam.status = 'TranscodeSuccess'
  1305. // this.queryParam.jobId = '8ed27f6a9e7b456db0dde2ac4081e6c9'
  1306. // this.url.list = '/ctop/videoPart/list'
  1307. this.url.list = '/ctop/videoMergeTask/list'
  1308. this.loadData()
  1309. } else {
  1310. this.url.list = '/ctop/materialInfo/list'
  1311. this.queryParam.status = ''
  1312. this.queryParam.type = key
  1313. this.loadData()
  1314. }
  1315. if (this.form.getFieldValue('projectId')) {
  1316. this.form.setFieldsValue({
  1317. projectId: ''
  1318. })
  1319. }
  1320. },
  1321. overUpload(urlAll) {
  1322. console.log(urlAll)
  1323. this.form.setFieldsValue({
  1324. url: urlAll
  1325. })
  1326. },
  1327. file(file) {
  1328. var bmf = new BMF()
  1329. var that = this
  1330. return new Promise(function (resolve, reject) {
  1331. bmf.md5(file[0], (err, md5) => {
  1332. that.urlList.name = file[0].name
  1333. that.urlList.md5 = md5
  1334. fileCheck({
  1335. code: md5
  1336. }).then(res => {
  1337. if (res.code == 0) {
  1338. that.$message.error('此素材已经上传')
  1339. reject()
  1340. } else {
  1341. resolve()
  1342. // reject()
  1343. }
  1344. })
  1345. })
  1346. })
  1347. },
  1348. fileWater(file) {
  1349. var bmf = new BMF()
  1350. var that = this
  1351. return new Promise(function (resolve, reject) {
  1352. bmf.md5(file[0], (err, md5) => {
  1353. that.watermarkUrl.name = file[0].name
  1354. that.watermarkUrl.md5 = md5
  1355. fileCheck({
  1356. code: md5
  1357. }).then(res => {
  1358. if (res.code == 0) {
  1359. that.$message.error('此素材已经上传')
  1360. reject()
  1361. } else {
  1362. resolve()
  1363. }
  1364. })
  1365. })
  1366. })
  1367. },
  1368. getParticipateList() {
  1369. getAction('/ctop/projectMember/participateList', {
  1370. userId: this.userInfo().id
  1371. }).then(res => {
  1372. if (res.code == 0) {
  1373. this.dataElse = res.result
  1374. }
  1375. })
  1376. },
  1377. getProjectId(items) {
  1378. getAction('/ctop/projectMember/getMemberList', {
  1379. projectId: items
  1380. }).then(res => {
  1381. if (res.code == 0) {
  1382. this.ascription.clipId = res.result.filter(item => {
  1383. if (item.roleCode == 'clip') {
  1384. return {
  1385. userId: item.userId,
  1386. userName: item.userName
  1387. }
  1388. }
  1389. })
  1390. this.ascription.shotId = res.result.filter(item => {
  1391. if (item.roleCode == 'shot') {
  1392. return {
  1393. userId: item.userId,
  1394. userName: item.userName
  1395. }
  1396. }
  1397. })
  1398. this.ascription.planId = res.result.filter(item => {
  1399. if (item.roleCode == 'plan') {
  1400. return {
  1401. userId: item.userId,
  1402. userName: item.userName
  1403. }
  1404. }
  1405. })
  1406. this.ascription.planeId = res.result.filter(item => {
  1407. if (item.roleCode == 'plane') {
  1408. return {
  1409. userId: item.userId,
  1410. userName: item.userName
  1411. }
  1412. }
  1413. })
  1414. }
  1415. })
  1416. },
  1417. getDataSource(page, pageSize) {
  1418. this.ipagination.current = page
  1419. this.checkArr = []
  1420. this.checkAll = false
  1421. this.loadData()
  1422. }
  1423. }
  1424. }
  1425. </script>
  1426. <style scoped>
  1427. @import '~@assets/less/common.less';
  1428. </style>