ProgrammeOrgList.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  1. <template>
  2. <div class="list-view">
  3. <div class="filters-container">
  4. <el-form :model="form" inline size="mini" label-width="100px">
  5. <el-row>
  6. <el-col :span="8">
  7. <el-form-item label="活动名称">
  8. <el-select
  9. v-model="performanceId"
  10. clearable
  11. filterable
  12. placeholder="活动名称"
  13. style="width: 100%"
  14. >
  15. <el-option
  16. v-for="item in performances"
  17. :key="item.id"
  18. :label="item.name"
  19. :value="item.id"
  20. >
  21. </el-option>
  22. </el-select>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="8">
  26. <el-form-item label="考级机构名称">
  27. <el-select
  28. v-model="form.gradingOrganizationId"
  29. clearable
  30. filterable
  31. placeholder="考级机构"
  32. style="width: 100%"
  33. >
  34. <el-option
  35. v-for="item in gradingOrganizationIdOptions"
  36. :key="item.value"
  37. :label="item.label"
  38. :value="item.value"
  39. >
  40. </el-option>
  41. </el-select>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :span="8"
  45. ><el-form-item label="考级点名称">
  46. <el-input placeholder="考级点名称" v-model="search" clearable></el-input> </el-form-item
  47. ></el-col>
  48. </el-row>
  49. <el-row>
  50. <el-col :span="8">
  51. <el-form-item label="参赛专业">
  52. <el-cascader
  53. ref="artCascader"
  54. style="width: 100%"
  55. v-model="form.specialtyId"
  56. :props="optionProps"
  57. :options="artTypes"
  58. :show-all-levels="false"
  59. placeholder="请选择专业"
  60. clearable
  61. >
  62. </el-cascader>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="8"
  66. ><el-form-item label="参赛组别">
  67. <el-select v-model="form.competitionGroup" clearable filterable placeholder="参赛组别">
  68. <el-option
  69. v-for="item in competitionGroupOptions"
  70. :key="item.value"
  71. :label="item.label"
  72. :value="item.value"
  73. >
  74. </el-option>
  75. </el-select> </el-form-item
  76. ></el-col>
  77. <el-col :span="8"
  78. ><el-form-item label="参赛级别" v-if="form.competitionGroup">
  79. <el-select
  80. v-model="form.levelSettingId"
  81. clearable
  82. filterable
  83. placeholder="参赛级别"
  84. style="width: 100%"
  85. v-if="form.competitionGroup == 'SINGLE'"
  86. >
  87. <el-option
  88. v-for="item in levelSingleOptions"
  89. :key="item.value"
  90. :label="item.label"
  91. :value="item.value"
  92. >
  93. <span style="float: left">{{ item.label }}</span>
  94. <span style="float: right; color: #8492a6; font-size: 13px">{{ item.desc }}</span>
  95. </el-option>
  96. </el-select>
  97. <el-select
  98. v-model="form.levelSettingId"
  99. clearable
  100. filterable
  101. placeholder="请选择"
  102. style="width: 100%"
  103. v-else
  104. >
  105. <el-option
  106. v-for="item in levelCollectiveOptions"
  107. :key="item.value"
  108. :label="item.label"
  109. :value="item.value"
  110. >
  111. <span style="float: left">{{ item.label }}</span>
  112. <span style="float: right; color: #8492a6; font-size: 13px">{{ item.desc }}</span>
  113. </el-option>
  114. </el-select>
  115. </el-form-item>
  116. </el-col>
  117. </el-row>
  118. <el-row>
  119. <el-col :span="8">
  120. <el-form-item label="节目名称">
  121. <el-input placeholder="节目名称" v-model="form.name" clearable></el-input>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="8">
  125. <el-form-item label="指导老师">
  126. <el-input placeholder="指导老师" v-model="form.instructor" clearable></el-input>
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. <el-form-item>
  131. <el-button @click="canAdd" type="primary" icon="el-icon-search">查询 </el-button>
  132. <el-button @click="addRow" type="primary" icon="el-icon-plus" v-if="add">添加 </el-button>
  133. <!-- <el-button @click="addRow" type="primary" icon="el-icon-plus">添加 </el-button> -->
  134. <el-upload
  135. :action="uploadUrl"
  136. :before-upload="beforeUpload"
  137. :headers="headers"
  138. :show-file-list="false"
  139. ref="upload"
  140. :on-success="onSuccess"
  141. class="uploader"
  142. :on-error="onfail"
  143. :loading="loading"
  144. :disabled="loading"
  145. >
  146. <el-button
  147. slot="trigger"
  148. type="primary"
  149. icon="el-icon-upload2"
  150. v-if="add"
  151. :loading="loading"
  152. :disabled="loading"
  153. >批量上传</el-button
  154. >
  155. </el-upload>
  156. <!-- <el-upload
  157. :action="uploadUrl"
  158. :before-upload="beforeUpload"
  159. :headers="headers"
  160. :show-file-list="false"
  161. ref="upload"
  162. :on-success="onSuccess"
  163. class="uploader"
  164. :on-error="onfail"
  165. :loading="loading"
  166. :disabled="loading"
  167. >
  168. <el-button
  169. slot="trigger"
  170. type="primary"
  171. icon="el-icon-upload2"
  172. :loading="loading"
  173. :disabled="loading"
  174. >批量上传</el-button
  175. >
  176. </el-upload> -->
  177. <el-button
  178. @click="download"
  179. type="primary"
  180. icon="el-icon-download"
  181. :loading="downloading"
  182. :disabled="totalElements < 1"
  183. >导出
  184. </el-button>
  185. <el-button @click="downloadTemp" type="primary" icon="el-icon-tickets" :loading="downloading"
  186. >模版下载
  187. </el-button>
  188. </el-form-item>
  189. </el-form>
  190. </div>
  191. <el-table
  192. :data="tableData"
  193. row-key="id"
  194. ref="table"
  195. header-row-class-name="table-header-row"
  196. header-cell-class-name="table-header-cell"
  197. row-class-name="table-row"
  198. cell-class-name="table-cell"
  199. :height="tableHeight"
  200. >
  201. <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
  202. <el-table-column prop="id" label="编号" width="70" fixed="left"> </el-table-column>
  203. <el-table-column prop="name" label="节目名称" fixed="left" show-overflow-tooltip> </el-table-column>
  204. <el-table-column prop="specialty" label="参赛专业"> </el-table-column>
  205. <el-table-column
  206. prop="competitionGroup"
  207. label="参赛组别"
  208. :formatter="competitionGroupFormatter"
  209. min-width="70"
  210. >
  211. </el-table-column>
  212. <el-table-column prop="level" label="参赛级别" min-width="70"> </el-table-column>
  213. <!-- <el-table-column prop="durationOfWork" label="作品时长" min-width="70"> </el-table-column> -->
  214. <el-table-column prop="quantity" label="参赛人数" min-width="70"> </el-table-column>
  215. <el-table-column prop="contact" label="联系人" min-width="68"> </el-table-column>
  216. <!-- <el-table-column prop="phone" label="联系电话" min-width="95"> </el-table-column> -->
  217. <el-table-column prop="gradingOrganizationId" label="考级机构" show-overflow-tooltip min-width="160">
  218. <template slot="header" slot-scope="{ column }">
  219. <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
  220. </template>
  221. <template slot-scope="{ row }">
  222. <span>{{ row.gradingOrganization }}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column prop="organizationId" label="承办单位" min-width="180">
  226. <template slot="header" slot-scope="{ column }">
  227. <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
  228. </template>
  229. <template slot-scope="{ row }">
  230. <span>{{ row.organization }}</span>
  231. </template>
  232. </el-table-column>
  233. <el-table-column prop="examPoint" label="考级点" min-width="160">
  234. <template slot="header" slot-scope="{ column }">
  235. <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
  236. </template>
  237. </el-table-column>
  238. <el-table-column prop="programmeStatus" label="节目状态" min-width="100">
  239. <template slot="header" slot-scope="{ column }">
  240. <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
  241. </template>
  242. <template slot-scope="{ row }">
  243. <span v-if="row.process == 0 && row.programmeStatus == 'SUBMIT'">初审中</span>
  244. <span v-if="row.process == 1 && row.programmeStatus == 'SUBMIT'">初审通过</span>
  245. <span v-if="row.process == 2 && row.programmeStatus == 'SUBMIT'">复审中</span>
  246. <span v-if="row.process == 3 && row.programmeStatus == 'SUBMIT'">复审通过</span>
  247. <span v-if="row.programmeStatus == 'INITIAL'">未提交</span>
  248. <span v-if="row.programmeStatus == 'AUDIT_FAILED'">初审未通过</span>
  249. <span v-if="row.programmeStatus == 'REVIEW_FAILED'">复审未通过</span>
  250. </template>
  251. </el-table-column>
  252. <el-table-column prop="award" label="奖项" min-width="80" v-if="showAward"> </el-table-column>
  253. <el-table-column label="操作" align="center" fixed="right" min-width="300">
  254. <template slot-scope="{ row, $index }">
  255. <el-button @click="showRow(row)" size="mini" plain>查看</el-button>
  256. <el-button
  257. type="success"
  258. @click="editRow(row)"
  259. size="mini"
  260. plain
  261. v-if="row.programmeStatus == 'INITIAL' && add"
  262. >编辑</el-button
  263. >
  264. <el-button type="warning" @click="playVideo(row, $index)" size="mini" plain>查看作品</el-button>
  265. <el-button
  266. @click="showCode(row)"
  267. type="primary"
  268. size="mini"
  269. plain
  270. v-if="row.programmeStatus != 'INITIAL'"
  271. >查看二维码</el-button
  272. >
  273. </template>
  274. </el-table-column>
  275. </el-table>
  276. <div class="pagination-wrapper">
  277. <!-- <div class="multiple-mode-wrapper">
  278. <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
  279. <el-button-group v-else>
  280. <el-button @click="operation1">批量操作1</el-button>
  281. <el-button @click="operation2">批量操作2</el-button>
  282. <el-button @click="toggleMultipleMode(false)">取消</el-button>
  283. </el-button-group>
  284. </div> -->
  285. <el-pagination
  286. background
  287. @size-change="onSizeChange"
  288. @current-change="onCurrentChange"
  289. :current-page="page"
  290. :page-sizes="[10, 20, 30, 40, 50]"
  291. :page-size="pageSize"
  292. layout="total, sizes, prev, pager, next, jumper"
  293. :total="totalElements"
  294. >
  295. </el-pagination>
  296. </div>
  297. <el-dialog title="二维码" :visible.sync="dialogCode" width="400px" center>
  298. <div style="margin-left: 70px;">
  299. <qrcode-vue :value="dialogUrl" :size="200" level="H" />
  300. </div>
  301. </el-dialog>
  302. <el-dialog
  303. :title="programme.name"
  304. class="videoDialog"
  305. destroy-on-close
  306. center
  307. append-to-body
  308. :visible.sync="showViedo"
  309. width="auto"
  310. >
  311. <video
  312. :src="programme.video"
  313. controls
  314. style="max-height: 600px; max-width: 100%; margin: 0 auto"
  315. v-if="programme.video"
  316. >
  317. 您的浏览器不支持 video 标签。
  318. </video>
  319. <img
  320. style="max-height: 600px; max-width: 100%; display: block; margin: auto"
  321. :src="programme.annex"
  322. alt=""
  323. v-if="programme.annex"
  324. />
  325. <div style="display: block; margin: 10px">
  326. <el-button size="mini" @click="move(-1)" :disabled="index == 0">上一个</el-button>
  327. <el-button
  328. size="mini"
  329. @click="move(1)"
  330. :disabled="(page - 1) * pageSize + index == totalElements - 1 || index >= pageSize - 1"
  331. >下一个</el-button
  332. >
  333. <el-button @click="showViedo = false" size="mini">关闭</el-button>
  334. </div>
  335. </el-dialog>
  336. </div>
  337. </template>
  338. <script>
  339. import delChild from '@/mixins/delChild';
  340. import { mapState } from 'vuex';
  341. import pageableTable from '@/mixins/pageableTable';
  342. import QrcodeVue from 'qrcode.vue';
  343. import resolveUrl from 'resolve-url';
  344. import { format } from 'date-fns';
  345. export default {
  346. name: 'ProgrammeOrgList',
  347. mixins: [pageableTable, delChild],
  348. data() {
  349. return {
  350. multipleMode: false,
  351. search: '',
  352. url: '/programme/backAll',
  353. downloading: false,
  354. competitionGroupOptions: [
  355. { label: '个人', value: 'SINGLE' },
  356. { label: '集体', value: 'COLLECTIVE' }
  357. ],
  358. form: {},
  359. levelSingleOptions: [],
  360. levelCollectiveOptions: [],
  361. dialogUrl: '',
  362. dialogCode: false,
  363. gradingOrganizationIdOptions: [],
  364. performanceId: '',
  365. performances: [],
  366. artTypes: [],
  367. optionProps: {
  368. value: 'id',
  369. label: 'name',
  370. children: 'children',
  371. multiple: false,
  372. emitPath: false,
  373. checkStrictly: true,
  374. expandTrigger: 'hover'
  375. },
  376. showViedo: false,
  377. showImg: false,
  378. videoUrl: '',
  379. annex: '',
  380. uploadUrl: '',
  381. currentTime: '',
  382. add: false,
  383. programmeStatusOptions: [
  384. { label: '未提交', value: 'INITIAL' },
  385. { label: '已提交', value: 'SUBMIT' },
  386. { label: '初选未通过', value: 'AUDIT_FAILED' },
  387. { label: '审核未通过', value: 'REVIEW_FAILED' },
  388. { label: '已评奖', value: 'COMPLETE' }
  389. ],
  390. loading: false,
  391. programme: {},
  392. index: 0,
  393. showAward: false
  394. };
  395. },
  396. created() {
  397. this.uploadUrl = resolveUrl(this.$baseUrl, 'programme/upload');
  398. this.currentTime = format(new Date(), 'yyyy-MM-dd');
  399. this.$http
  400. .post('/setting/byFlag', { flag: 3 })
  401. .then(res => {
  402. if (res.length > 0) {
  403. res.forEach(item => {
  404. this.levelSingleOptions.push({
  405. label: item.name,
  406. value: item.id,
  407. desc: item.code
  408. });
  409. });
  410. }
  411. })
  412. .catch(e => {
  413. console.log(e);
  414. this.$message.error(e.error);
  415. });
  416. if (this.$route.query.pid) {
  417. this.performanceId = Number(this.$route.query.pid);
  418. }
  419. this.$http
  420. .post('/setting/byFlag', { flag: 4 })
  421. .then(res => {
  422. if (res.length > 0) {
  423. res.forEach(item => {
  424. this.levelCollectiveOptions.push({
  425. label: item.name,
  426. value: item.id,
  427. desc: item.code
  428. });
  429. });
  430. }
  431. })
  432. .catch(e => {
  433. console.log(e);
  434. this.$message.error(e.error);
  435. });
  436. this.$http
  437. .post('/gradingOrganization/all', { size: 1000, query: { del: false } }, { body: 'json' })
  438. .then(res => {
  439. if (res.content.length > 0) {
  440. res.content.forEach(item => {
  441. this.gradingOrganizationIdOptions.push({
  442. label: item.name,
  443. value: item.id
  444. });
  445. });
  446. }
  447. })
  448. .catch(e => {
  449. console.log(e);
  450. this.$message.error(e.error);
  451. });
  452. this.$http
  453. .post(
  454. '/performance/all',
  455. {
  456. size: 1000,
  457. sort: 'year,desc',
  458. query: {
  459. publish: true
  460. }
  461. },
  462. { body: 'json' }
  463. )
  464. .then(res => {
  465. if (res.content.length > 0) {
  466. // res.content.forEach(item => {
  467. // this.performances.push({
  468. // label: item.name,
  469. // value: item.id
  470. // });
  471. // });
  472. this.performances = res.content;
  473. if (!this.$route.query.pid) {
  474. this.performanceId = res.content[0].id;
  475. }
  476. this.canAdd();
  477. }
  478. })
  479. .catch(e => {
  480. console.log(e);
  481. this.$message.error(e.error);
  482. });
  483. this.$http
  484. .post('/artType/allList')
  485. .then(res => {
  486. this.artTypes = this.delChild(res);
  487. })
  488. .catch(e => {
  489. console.log(e);
  490. });
  491. },
  492. components: {
  493. QrcodeVue
  494. },
  495. computed: {
  496. selection() {
  497. return this.$refs.table.selection.map(i => i.id);
  498. },
  499. ...mapState(['organization']),
  500. headers() {
  501. return {
  502. Authorization: 'Bearer ' + sessionStorage.getItem('token')
  503. };
  504. }
  505. },
  506. methods: {
  507. programmeStatusFormatter(row, column, cellValue, index) {
  508. let selectedOption = this.programmeStatusOptions.find(i => i.value === cellValue);
  509. if (selectedOption) {
  510. return selectedOption.label;
  511. }
  512. return '';
  513. },
  514. competitionGroupFormatter(row, column, cellValue, index) {
  515. let selectedOption = this.competitionGroupOptions.find(i => i.value === cellValue);
  516. if (selectedOption) {
  517. return selectedOption.label;
  518. }
  519. return '';
  520. },
  521. beforeGetData() {
  522. let data = {
  523. query: {
  524. organizationId: this.organization.id,
  525. performanceId: Number(this.$route.query.pid)
  526. }
  527. };
  528. if (this.form.competitionGroup) {
  529. data.query.competitionGroup = this.form.competitionGroup;
  530. }
  531. if (this.form.levelSettingId) {
  532. data.query.levelSettingId = this.form.levelSettingId;
  533. }
  534. if (this.form.gradingOrganizationId) {
  535. data.query.gradingOrganizationId = this.form.gradingOrganizationId;
  536. }
  537. if (this.performanceId) {
  538. data.query.performanceId = this.performanceId;
  539. }
  540. if (this.form.specialtyId) {
  541. data.query.code = this.getCode(this.form.specialtyId);
  542. }
  543. if (this.form.name) {
  544. data.query.name = this.form.name;
  545. }
  546. if (this.form.instructor) {
  547. data.query.instructor = this.form.instructor;
  548. }
  549. return data;
  550. },
  551. toggleMultipleMode(multipleMode) {
  552. this.multipleMode = multipleMode;
  553. if (!multipleMode) {
  554. this.$refs.table.clearSelection();
  555. }
  556. },
  557. addRow() {
  558. this.$router.push({
  559. path: '/programmeEdit',
  560. query: {
  561. ...this.$route.query
  562. }
  563. });
  564. },
  565. editRow(row) {
  566. this.$router.push({
  567. path: '/programmeEdit',
  568. query: {
  569. id: row.id
  570. }
  571. });
  572. },
  573. showRow(row) {
  574. this.$router.push({
  575. path: '/programmeShow',
  576. query: {
  577. id: row.id
  578. }
  579. });
  580. },
  581. download() {
  582. this.downloading = true;
  583. let data = {
  584. sort: 'programmeStatus,desc',
  585. size: 1000,
  586. query: {
  587. organizationId: this.organization.id
  588. }
  589. };
  590. if (this.form.competitionGroup) {
  591. data.query.competitionGroup = this.form.competitionGroup;
  592. }
  593. if (this.form.levelSettingId) {
  594. data.query.levelSettingId = this.form.levelSettingId;
  595. }
  596. if (this.form.gradingOrganizationId) {
  597. data.query.gradingOrganizationId = this.form.gradingOrganizationId;
  598. }
  599. if (this.form.specialtyId) {
  600. data.query.code = this.getCode(this.form.specialtyId);
  601. }
  602. if (this.form.name) {
  603. data.query.name = this.form.name;
  604. }
  605. if (this.form.instructor) {
  606. data.query.instructor = this.form.instructor;
  607. }
  608. if (this.performanceId) {
  609. data.query.performanceId = this.performanceId;
  610. }
  611. this.$axios
  612. .get('/programme/excel', {
  613. responseType: 'blob',
  614. params: data
  615. })
  616. .then(res => {
  617. console.log(res);
  618. this.downloading = false;
  619. const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
  620. const link = document.createElement('a');
  621. link.href = downloadUrl;
  622. link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
  623. document.body.appendChild(link);
  624. link.click();
  625. link.remove();
  626. })
  627. .catch(e => {
  628. console.log(e);
  629. this.downloading = false;
  630. this.$message.error(e.error);
  631. });
  632. },
  633. downloadTemp() {
  634. this.downloading = true;
  635. this.$axios
  636. .get('/programme/excelTemp', {
  637. responseType: 'blob'
  638. })
  639. .then(res => {
  640. this.downloading = false;
  641. const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
  642. const link = document.createElement('a');
  643. link.href = downloadUrl;
  644. link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
  645. document.body.appendChild(link);
  646. link.click();
  647. link.remove();
  648. })
  649. .catch(e => {
  650. console.log(e);
  651. this.downloading = false;
  652. this.$message.error(e.error);
  653. });
  654. },
  655. operation1() {
  656. this.$notify({
  657. title: '提示',
  658. message: this.selection
  659. });
  660. },
  661. operation2() {
  662. this.$message('操作2');
  663. },
  664. deleteRow(row) {
  665. this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
  666. .then(() => {
  667. return this.$http.post(`/programme/del/${row.id}`);
  668. })
  669. .then(() => {
  670. this.$message.success('删除成功');
  671. this.getData();
  672. })
  673. .catch(e => {
  674. if (e !== 'cancel') {
  675. this.$message.error(e.error);
  676. }
  677. });
  678. },
  679. showCode(row) {
  680. this.dialogCode = true;
  681. this.dialogUrl =
  682. 'http://yskj.njlyw.cn:8081/h5/home?performanceId=' + row.performanceId + '&programmeId=' + row.id;
  683. },
  684. clearSearch() {
  685. this.form = {};
  686. this.getData();
  687. },
  688. getCode(value) {
  689. return this.forTree(this.artTypes, value).code;
  690. },
  691. forTree(list, value) {
  692. var result = null;
  693. if (!list) {
  694. return;
  695. }
  696. for (var i in list) {
  697. if (result !== null) {
  698. break;
  699. }
  700. var item = list[i];
  701. if (item.id == value) {
  702. result = item;
  703. break;
  704. } else if (item.children && item.children.length > 0) {
  705. result = this.forTree(item.children, value);
  706. }
  707. }
  708. return result;
  709. },
  710. // closeEvent() {
  711. // document.exitPictureInPicture();
  712. // },
  713. // playVideo(row) {
  714. // console.log(row);
  715. // this.showViedo = true;
  716. // this.videoUrl = row.video;
  717. // },
  718. playImg(row) {
  719. console.log(row);
  720. this.showImg = true;
  721. this.annex = row.annex;
  722. },
  723. upload() {},
  724. onfail(e) {
  725. console.log(e);
  726. this.$message.error('失败:' + e);
  727. this.loading = false;
  728. this.getData();
  729. },
  730. onSuccess() {
  731. this.$message.success('上传成功');
  732. this.loading = false;
  733. this.getData();
  734. },
  735. beforeUpload() {
  736. return this.$confirm('确认要上传文件吗?', '提示', {
  737. confirmButtonText: '确定',
  738. cancelButtonText: '取消',
  739. type: 'warning'
  740. }).then(() => {
  741. this.loading = true;
  742. });
  743. },
  744. canAdd() {
  745. let data = this.performances.find(item => {
  746. return item.id == this.performanceId;
  747. });
  748. // if (data.endDate >= this.currentTime) {
  749. // this.add = true;
  750. // } else {
  751. // this.add = false;
  752. // }
  753. this.add = data.close;
  754. this.showAward = data.showAward;
  755. this.getData();
  756. },
  757. playVideo(row, index) {
  758. this.index = index;
  759. this.showViedo = true;
  760. this.programme = row;
  761. },
  762. move(direction) {
  763. const end = direction + this.index;
  764. this.programme = { ...this.tableData[end] };
  765. this.index = end;
  766. }
  767. }
  768. };
  769. </script>
  770. <style lang="less" scoped>
  771. .right {
  772. float: right;
  773. }
  774. /deep/ .el-form-item__label {
  775. font-weight: bold;
  776. }
  777. /deep/ .el-input__inner {
  778. border: 1px solid #00000069 !important;
  779. }
  780. /deep/.el-form-item--mini.el-form-item,
  781. .el-form-item--small.el-form-item {
  782. margin-bottom: 10px;
  783. }
  784. .videoDialog {
  785. display: flex;
  786. align-items: center;
  787. justify-content: center;
  788. .el-dialog {
  789. max-width: 900px;
  790. margin-top: 0px;
  791. .close {
  792. position: absolute;
  793. right: 0px;
  794. top: -42px;
  795. width: 71px;
  796. height: 32px;
  797. background: #00000015;
  798. font-size: 12px;
  799. color: #fdffff;
  800. line-height: 32px;
  801. text-align: center;
  802. cursor: pointer;
  803. &:hover {
  804. background: #00000055;
  805. }
  806. }
  807. }
  808. .el-dialog__header {
  809. display: none;
  810. }
  811. .el-dialog__body {
  812. padding: 0;
  813. video {
  814. display: block;
  815. height: auto;
  816. width: 100%;
  817. outline: none;
  818. }
  819. }
  820. }
  821. .uploader {
  822. display: inline-block;
  823. margin: 0 10px;
  824. }
  825. </style>