scriptMaterial.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  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. .home-item {
  18. overflow: hidden;
  19. }
  20. @media (min-width: 1024px) {
  21. .home-item {
  22. border-style: solid;
  23. border-width: 1px;
  24. border-color: #e4e4e4;
  25. width: calc(50% - 10px);
  26. padding: 10px;
  27. margin-right: 10px;
  28. margin-bottom: 10px;
  29. display: flex;
  30. align-items: center;
  31. background: #fff;
  32. position: relative;
  33. z-index: 99;
  34. }
  35. }
  36. /*>=1024的设备*/
  37. // @media (min-width: 1100px) {
  38. // .checkbox_item_container {
  39. // width:70%
  40. // }
  41. // } /*>=1100的设备*/
  42. @media (min-width: 1280px) {
  43. .home-item {
  44. border-style: solid;
  45. border-width: 1px;
  46. border-color: #e4e4e4;
  47. width: calc(25% - 10px);
  48. padding: 10px;
  49. margin-right: 10px;
  50. margin-bottom: 10px;
  51. display: flex;
  52. align-items: center;
  53. background: #fff;
  54. position: relative;
  55. z-index: 99;
  56. }
  57. }
  58. /*>=1280的设备*/
  59. // @media (min-width: 1366px) {
  60. // }
  61. // @media (min-width: 1440px) {
  62. // }
  63. // @media (min-width: 1680px) {
  64. // }
  65. @media (min-width: 1920px) {
  66. .home-item {
  67. border-style: solid;
  68. border-width: 1px;
  69. border-color: #e4e4e4;
  70. width: calc(25% - 10px);
  71. padding: 10px;
  72. margin-right: 10px;
  73. margin-bottom: 10px;
  74. display: flex;
  75. align-items: center;
  76. background: #fff;
  77. position: relative;
  78. z-index: 99;
  79. cursor: pointer;
  80. }
  81. }
  82. .actor-photo-list {
  83. display: flex;
  84. padding-left: 0;
  85. li {
  86. width: 25%;
  87. margin: 10px;
  88. position: relative;
  89. height: 250px;
  90. border: 1px solid #f2f2f2;
  91. img,
  92. video {
  93. width: 100%;
  94. margin-top: auto;
  95. margin-bottom: auto;
  96. top: 0;
  97. bottom: 0;
  98. position: absolute;
  99. max-height: 250px;
  100. }
  101. }
  102. }
  103. .home-card {
  104. width: 100%;
  105. overflow: hidden;
  106. padding: 10px 0px;
  107. display: flex;
  108. flex-wrap: wrap;
  109. margin-right: -10px;
  110. .home-right {
  111. width: 100%;
  112. }
  113. .bg:after {
  114. content: '';
  115. width: 110%;
  116. height: 110%;
  117. position: absolute;
  118. left: -5%;
  119. top: -5%;
  120. background: inherit;
  121. filter: blur(10px);
  122. z-index: 2;
  123. }
  124. }
  125. .bh {
  126. height: 60px;
  127. line-height: 30px;
  128. overflow: hidden;
  129. text-overflow: ellipsis;
  130. -webkit-line-clamp: 2;
  131. display: -webkit-box;
  132. -webkit-box-orient: vertical;
  133. }
  134. a {
  135. font-size: 14px;
  136. }
  137. </style>
  138. <template>
  139. <a-card :bordered="false">
  140. <!-- 查询区域 -->
  141. <div class="table-page-search-wrapper">
  142. <a-form layout="inline">
  143. <a-row :gutter="24">
  144. <a-col :md="8" :sm="8">
  145. <selectTable :projectId.sync="queryParam.projectId"></selectTable>
  146. </a-col>
  147. <a-col :md="8" :sm="8">
  148. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  149. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  150. <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
  151. </span>
  152. </a-col>
  153. </a-row>
  154. </a-form>
  155. </div>
  156. <!-- table区域-begin -->
  157. <!-- <div> -->
  158. <!-- 操作按钮区域 -->
  159. <div class="table-operator" style="position:relative;z-index:100">
  160. <a-button
  161. type="primary"
  162. icon="plus"
  163. @click="
  164. visible = true
  165. confirmLoading = false
  166. "
  167. >新增</a-button
  168. >
  169. </div>
  170. <div v-if="dataSource.length > 0">
  171. <a-checkbox-group @change="onChangeCheck" v-model="checkArr" class="home-card">
  172. <div class="home-item" v-for="(items, index) in dataSource" :key="index" @click="showDetail(items)">
  173. <div class="home-right">
  174. <span
  175. @click.stop
  176. style="color: #999; fontSize: 16px;padding-bottom:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;"
  177. >
  178. {{ items.dramaName }}
  179. </span>
  180. <div style="display:flex;justify-content:space-between;width:100%;position:relative">
  181. <span>类型:{{ items.category }}</span>
  182. <!-- <span>题材:未设置</span>
  183. <span>时代:未设置</span> -->
  184. </div>
  185. <div class="bh">
  186. 创作者:{{ items.userName }}<br />
  187. {{ items.introduction }}
  188. </div>
  189. <!-- <div class="bh">大纲:无</div>
  190. <div class="bh">字数:0 </div> -->
  191. <span style="color: black; fontSize: 16px;padding-top:10px;display:block;width:100%" @click.stop>
  192. {{ items.createTime }}
  193. </span>
  194. </div>
  195. </div>
  196. </a-checkbox-group>
  197. <a-pagination
  198. size="small"
  199. :showTotal="ipagination.showTotal"
  200. style="float:right"
  201. v-if="dataSource.length > 0"
  202. showQuickJumper
  203. :pageSize.sync="ipagination.pageSize"
  204. :total="ipagination.total"
  205. v-model="ipagination.current"
  206. @change="getDataSource"
  207. />
  208. </div>
  209. <div v-else style="width:100%;height:400px;display:flex;justify-content: center;align-items: center;">
  210. <img
  211. 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"
  212. alt=""
  213. />
  214. </div>
  215. <a-modal title="添加素材" v-model="visible" :maskClosable="false" :width="800">
  216. <template slot="footer">
  217. <a-button key="back" @click="close">取消</a-button>
  218. <a-button key="submit" type="primary" @click="handleOk">
  219. 确定
  220. </a-button>
  221. </template>
  222. <a-form :form="form">
  223. <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="剧本名称">
  224. <a-input v-decorator="['dramaName', { rules: [{ required: true, message: '请输入剧本名称' }] }]" />
  225. </a-form-item>
  226. <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="行业类型">
  227. <j-tree-select
  228. ref="treeSelect"
  229. placeholder="请选择行业"
  230. v-decorator="['category', { rules: [{ required: true, message: '请选择行业' }] }]"
  231. dict="sys_category,name,id"
  232. pidField="pid"
  233. pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
  234. >
  235. </j-tree-select>
  236. </a-form-item>
  237. <a-form-item
  238. :label-col="labelCol"
  239. :wrapper-col="{
  240. xs: { span: 24 },
  241. sm: { span: 18 }
  242. }"
  243. label="标签"
  244. >
  245. <template v-for="(tag, index) in tags">
  246. <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
  247. <a-tag :key="tag" :closable="index !== 0" :afterClose="() => handleClose(tag)">
  248. {{ `${tag.slice(0, 20)}...` }}
  249. </a-tag>
  250. </a-tooltip>
  251. <a-tag v-else :key="tag" :closable="true" :afterClose="() => handleClose(tag)">
  252. {{ tag }}
  253. </a-tag>
  254. </template>
  255. <a-input
  256. v-if="inputVisible"
  257. ref="input"
  258. type="text"
  259. size="small"
  260. :style="{ width: '78px' }"
  261. :value="inputValue"
  262. @change="handleInputChange"
  263. @blur="handleInputConfirm"
  264. @keyup.enter="handleInputConfirm"
  265. />
  266. <a-tag v-else @click="showInput" style="background: #fff; borderStyle: dashed;">
  267. <a-icon type="plus" /> New Tag
  268. </a-tag>
  269. </a-form-item>
  270. <a-form-item
  271. :label-col="labelCol"
  272. :wrapper-col="{
  273. xs: { span: 24 },
  274. sm: { span: 12 }
  275. }"
  276. label="描述"
  277. >
  278. <a-textarea
  279. placeholder="请输入描述"
  280. v-decorator="[
  281. 'introduction' // 给表单赋值或拉取表单时,该input对应的key
  282. ]"
  283. :autosize="{ minRows: 3, maxRows: 10 }"
  284. />
  285. </a-form-item>
  286. <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="是否公用">
  287. <a-radio-group
  288. v-decorator="[
  289. 'nonpublic',
  290. { initialValue: 0 } // 给表单赋值或拉取表单时,该input对应的key
  291. ]"
  292. >
  293. <a-radio-button :value="0">
  294. </a-radio-button>
  295. <a-radio-button :value="1">
  296. </a-radio-button>
  297. </a-radio-group>
  298. </a-form-item>
  299. </a-form>
  300. </a-modal>
  301. </a-card>
  302. </template>
  303. <script>
  304. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  305. import JEllipsis from '@/components/jeecg/JEllipsis'
  306. import UploadToAli from '@femessage/upload-to-ali'
  307. import { fileCheck, fileInsert, fileEdit } from '@/api/actor'
  308. import { getAction, postAction, postFile, deleteAction } from '@/api/manage'
  309. import qs from 'qs'
  310. import { mapGetters } from 'vuex'
  311. import moment from 'moment'
  312. import JTreeSelect from '@/components/jeecg/JTreeSelect'
  313. import selectTable from '@/views/modules/Statistics/components/selecTable.vue'
  314. import BMF from 'browser-md5-file'
  315. import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl'
  316. import accountCheck from './accountCheck'
  317. export default {
  318. name: 'YardList',
  319. mixins: [JeecgListMixin],
  320. components: {
  321. JEllipsis,
  322. UploadToAli,
  323. accountCheck,
  324. selectTable,
  325. JTreeSelect
  326. },
  327. data() {
  328. return {
  329. projectId: '',
  330. inputVisible: false,
  331. inputValue: '',
  332. labelCol: {
  333. xs: {
  334. span: 24
  335. },
  336. sm: {
  337. span: 5
  338. }
  339. },
  340. wrapperCol: {
  341. xs: {
  342. span: 24
  343. },
  344. sm: {
  345. span: 12
  346. }
  347. },
  348. noImgUrl: require('@/assets/img/noImg.png'),
  349. queryParam: {},
  350. dataElse: [],
  351. ascription: {
  352. clipId: [], //剪辑人id
  353. shotId: [], //拍摄人id
  354. planId: [], //策划id
  355. planeId: [] //平面id
  356. },
  357. show: true,
  358. visible: false,
  359. visibleDetail: false,
  360. url: {
  361. list: '/ctop/dramaInfo/list'
  362. },
  363. detail: false,
  364. form: this.$form.createForm(this),
  365. tags: [],
  366. refuseFile: [],
  367. refuseReason: '',
  368. creativeCopywriter: '',
  369. customDomain: '',
  370. region: 'oss-cn-beijing',
  371. bucket: 'ctop-media',
  372. acceptVideo: 'video/mpeg,video/mp4',
  373. acceptImage: 'image/jpeg,image/jpg,image/png',
  374. accessKeyId: 'LTAIbNbqWzSOklQV',
  375. accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
  376. checkArr: [],
  377. checkAll: false,
  378. showUrl: '',
  379. showUrlWater: '',
  380. materialName: '',
  381. materialDescribe: '',
  382. name: '',
  383. detail: null,
  384. add: true,
  385. id: '',
  386. role: {
  387. roleCode: '',
  388. roleName: ''
  389. },
  390. key: '0',
  391. mediaId: null,
  392. sizeType: [],
  393. size: 4,
  394. repeat: false,
  395. excellent: 0,
  396. code: ''
  397. }
  398. },
  399. filters: {
  400. getDate(value) {
  401. let date = new Date(value)
  402. let y = date.getFullYear()
  403. let MM = date.getMonth() + 1
  404. MM = MM < 10 ? '0' + MM : MM
  405. let d = date.getDate()
  406. d = d < 10 ? '0' + d : d
  407. return y + '-' + MM + '-' + d
  408. }
  409. },
  410. computed: {
  411. dirImg() {
  412. let date = new Date()
  413. let y = date.getFullYear()
  414. let MM = date.getMonth() + 1
  415. MM = MM < 10 ? '0' + MM : MM
  416. let d = date.getDate()
  417. d = d < 10 ? '0' + d : d
  418. return 'image/' + y + '-' + MM + '-' + d + '/'
  419. },
  420. dirVideo() {
  421. let date = new Date()
  422. let y = date.getFullYear()
  423. let MM = date.getMonth() + 1
  424. MM = MM < 10 ? '0' + MM : MM
  425. let d = date.getDate()
  426. d = d < 10 ? '0' + d : d
  427. return 'video/' + y + '-' + MM + '-' + d + '/'
  428. }
  429. },
  430. created() {
  431. this.ipagination.pageSize = 8
  432. },
  433. updated() {
  434. stopOtherVideo()
  435. },
  436. watch: {},
  437. methods: {
  438. handleInputConfirm() {
  439. const inputValue = this.inputValue
  440. let tags = this.tags
  441. if (inputValue && tags.indexOf(inputValue) === -1) {
  442. tags = [...tags, inputValue]
  443. }
  444. Object.assign(this, {
  445. tags,
  446. inputVisible: false,
  447. inputValue: ''
  448. })
  449. },
  450. close() {
  451. // this.form.resetFields()
  452. // this.urlList = { url: '', md5: '', name: '' }
  453. // this.watermarkUrl = { url: '', md5: '', name: '' }
  454. // this.tags = []
  455. },
  456. showInput() {
  457. this.inputVisible = true
  458. this.$nextTick(function() {
  459. this.$refs.input.focus()
  460. })
  461. },
  462. onChangeCheck() {},
  463. ...mapGetters(['nickname', 'avatar', 'userInfo']),
  464. searchRe() {
  465. this.queryParam.projectId = ''
  466. if (this.queryParam.createTime) {
  467. this.queryParam.createTime = ''
  468. }
  469. this.loadData(1)
  470. },
  471. handleClose(removedTag) {
  472. const tags = this.tags.filter(tag => tag !== removedTag)
  473. this.tags = tags
  474. },
  475. handleInputChange(e) {
  476. this.inputValue = e.target.value
  477. },
  478. handleOk() {
  479. this.form.validateFieldsAndScroll((err, values) => {
  480. if (err) {
  481. // 这里做逻辑处理
  482. } else {
  483. var params = { ...values }
  484. params.tag = this.tags.join()
  485. if (this.add) {
  486. postAction('/ctop/dramaInfo/add', params).then(res => {
  487. if (res.success) {
  488. this.form.resetFields()
  489. this.tags = []
  490. this.loadData()
  491. this.visible = false
  492. this.add = true
  493. } else {
  494. this.$message.error(res.message)
  495. }
  496. })
  497. } else {
  498. fileEdit({
  499. ...params,
  500. status: '0'
  501. }).then(res => {
  502. this.form.resetFields()
  503. this.urlList = {
  504. url: '',
  505. md5: '',
  506. name: ''
  507. }
  508. this.watermarkUrl = {
  509. url: '',
  510. md5: '',
  511. name: ''
  512. }
  513. this.tags = []
  514. this.loadData()
  515. this.visible = false
  516. this.add = true
  517. for (const key in this.role) {
  518. if (key == 'roleCode') {
  519. this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
  520. }
  521. }
  522. })
  523. }
  524. }
  525. })
  526. },
  527. getDataSource(page, pageSize) {
  528. this.ipagination.current = page
  529. this.checkArr = []
  530. this.checkAll = false
  531. this.loadData()
  532. }
  533. }
  534. }
  535. </script>
  536. <style scoped>
  537. @import '~@assets/less/common.less';
  538. </style>