You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2469 lines
76 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <div style="padding:10px;">
  3. <!-- 搜索栏 -->
  4. <div class="search">
  5. <el-form :inline="true">
  6. <el-form-item label="剧本标题:" style="margin-right:50px;">
  7. <el-input
  8. v-model="queryParams.query.title"
  9. style="height:30px;"
  10. placeholder="请输入剧本标题"
  11. />
  12. </el-form-item>
  13. <el-form-item label="工作室:" style="margin-right:50px;">
  14. <el-input
  15. v-model="queryParams.query.studioName"
  16. style="height:30px;"
  17. placeholder="请输入工作室"
  18. />
  19. </el-form-item>
  20. <el-form-item label="标签:" style="margin-right:50px;">
  21. <el-input
  22. v-model="queryParams.query.labelName"
  23. style="height:30px;"
  24. placeholder="请输入标签"
  25. />
  26. </el-form-item>
  27. </el-form>
  28. <div class="search-button">
  29. <el-button
  30. size="medium"
  31. type="primary"
  32. style="height:36px;width:100px;"
  33. @click="search"
  34. >搜索</el-button
  35. >
  36. <el-button
  37. size="medium"
  38. style="margin-left:20px;height:36px;width:100px;"
  39. @click="refresh"
  40. >重置</el-button
  41. >
  42. </div>
  43. <!-- <div class="about">
  44. <el-button @click="getWangyi">获取链接</el-button>
  45. </div> -->
  46. </div>
  47. <div class="add-button">
  48. <el-button
  49. size="medium"
  50. type="primary"
  51. style="height:36px;width:100px;"
  52. @click="handleAdd"
  53. >新建</el-button
  54. >
  55. </div>
  56. <!-- 列表 -->
  57. <div class="content">
  58. <el-table
  59. v-loading="loading"
  60. ref="singleTable"
  61. :data="tableData"
  62. border
  63. style="width: 100%"
  64. >
  65. <el-table-column align="center" type="index" label="序号" width="50" />
  66. <el-table-column align="center" property="title" label="剧本标题" />
  67. <el-table-column align="center" property="studioName" label="工作室" />
  68. <el-table-column align="center" property="labelName" label="标签" />
  69. <el-table-column
  70. align="center"
  71. property="createTime"
  72. label="创建时间"
  73. />
  74. <el-table-column align="center" label="操作">
  75. <template slot-scope="scope">
  76. <el-button type="text" size="mini" @click="handleView(scope.row)"
  77. ><div style="color:#000;">查看</div></el-button
  78. >
  79. <el-button type="text" size="mini" @click="handleEdit(scope.row)"
  80. ><div style="color:#02A7F0;">编辑</div></el-button
  81. >
  82. <el-button type="text" size="mini" @click="handleTips(scope.row)"
  83. >Tips维护</el-button
  84. >
  85. <el-button type="text" size="mini" @click="hanDel(scope.row)"
  86. ><div style="color:#D9001B;">删除</div></el-button
  87. >
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <pagination
  92. v-show="total > 0"
  93. :total="total"
  94. :page.sync="queryParams.pageNum"
  95. :limit.sync="queryParams.pageSize"
  96. @pagination="queryList"
  97. />
  98. </div>
  99. <!-- 新增表单 -->
  100. <el-dialog
  101. @open="openDialog"
  102. @close="closeDialog"
  103. :title="dialog.title"
  104. :visible.sync="dialog.Visible"
  105. width="1000px"
  106. :before-close="handleClose"
  107. >
  108. <el-form
  109. ref="ruleForm"
  110. :model="ruleForm"
  111. :rules="rules"
  112. :inline="true"
  113. label-width="100px"
  114. class="demo-ruleForm"
  115. >
  116. <h3 class="form-title">基本信息</h3>
  117. <el-form-item label="剧本标题:" prop="title" style="width:45%">
  118. <el-input
  119. :disabled="disabled"
  120. v-model="ruleForm.title"
  121. style="width:300px;"
  122. />
  123. </el-form-item>
  124. <el-form-item label="工作室:" prop="studioName" style="width:45%">
  125. <el-input
  126. :disabled="disabled"
  127. v-model="ruleForm.studioName"
  128. style="width:300px;"
  129. />
  130. </el-form-item>
  131. <el-form-item label="标签:" prop="labelName" style="width:100%">
  132. <el-input
  133. :disabled="disabled"
  134. v-model="ruleForm.labelName"
  135. style="width:300px;"
  136. />
  137. </el-form-item>
  138. <h3 class="form-title">剧本图片</h3>
  139. <el-form-item label="封面" prop="cover">
  140. <el-image
  141. v-if="type == 'view'"
  142. style="width: 146px; height: 146px"
  143. :src="ruleForm.cover"
  144. fit="fill"
  145. >
  146. </el-image>
  147. <el-upload
  148. v-if="type == 'add' || type == 'edit'"
  149. class="avatar-uploader"
  150. action
  151. list-type="picture-card"
  152. :show-file-list="false"
  153. :on-progress="uploadImg"
  154. :on-success="handleAvatar"
  155. :before-upload="beforeAvatarUpload"
  156. element-loading-text="正在上传..."
  157. v-loading="loadingCover"
  158. >
  159. <!-- :on-change="uploadImg" -->
  160. <!-- :auto-upload="false" -->
  161. <!-- <el-upload class="avatar-uploader" :show-file-list="false" action list-type="picture-card"
  162. :on-progress="uploadChange" > -->
  163. <img v-if="ruleForm.cover" :src="ruleForm.cover" class="avatar" />
  164. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  165. </el-upload>
  166. </el-form-item>
  167. <el-progress :percentage="jinduCoverNum" v-if="jinduShowCover"></el-progress>
  168. <el-form-item label="其它图片" style="width:100%">
  169. <div
  170. v-for="(item, l) in dataImg"
  171. :key="l"
  172. class="imgdata"
  173. style="margin-left:10px;"
  174. >
  175. <el-image
  176. style="width: 146px; height: 146px"
  177. :src="item"
  178. fit="fill"
  179. >
  180. </el-image>
  181. <div class="imgdialog" v-if="type == 'add' || type == 'edit'">
  182. <p>
  183. <i
  184. class="el-icon-delete"
  185. @click="delDataImg(item, l)"
  186. style="font-size: 20px;"
  187. ></i>
  188. </p>
  189. </div>
  190. </div>
  191. <el-upload
  192. v-if="type == 'add' || type == 'edit'"
  193. class="avatar-uploader"
  194. style="float:left;margin-left: 10px;"
  195. action
  196. list-type="picture-card"
  197. :http-request="changeImgs"
  198. :show-file-list="false"
  199. element-loading-text="正在上传..."
  200. v-loading="loadingOtherImg"
  201. >
  202. <!-- :on-progress="changeImgs" -->
  203. <i class="el-icon-plus"></i>
  204. </el-upload>
  205. <!-- <el-upload
  206. v-if="type == 'add' || type == 'edit'"
  207. action
  208. class="avatar-uploader"
  209. list-type="picture-card"
  210. :auto-upload="false"
  211. :on-change="changeImgs"
  212. :on-success="handleAvatarSuccess"
  213. :before-upload="beforeAvatarUpload"
  214. :file-list="dataImgs"
  215. >
  216. <i class="el-icon-plus" />
  217. <div slot="file" slot-scope="{ file }">
  218. <img
  219. class="el-upload-list__item-thumbnail"
  220. :src="file.url"
  221. alt=""
  222. />
  223. <span class="el-upload-list__item-actions">
  224. <span
  225. v-if="!disabled"
  226. class="el-upload-list__item-delete"
  227. @click="handleRemove(file)"
  228. >
  229. <i class="el-icon-delete"></i>
  230. </span>
  231. </span>
  232. </div>
  233. </el-upload> -->
  234. </el-form-item>
  235. <el-progress :percentage="jinduOtherImgNum" v-if="jinduShowOtherImg"></el-progress>
  236. <h3 class="form-title">剧本简介</h3>
  237. <el-form-item label="简介" prop="introduction" style="width:100%">
  238. <!-- <el-input
  239. v-if="type == 'view'"
  240. :disabled="disabled"
  241. v-model="ruleForm.introduction"
  242. style="width:700px"
  243. rows="10"
  244. type="textarea"
  245. /> -->
  246. <div
  247. v-if="type == 'view'"
  248. style="width:700px;height:400px;border:1px solid #ddd;padding:10px;"
  249. v-html="ruleForm.introduction"
  250. ></div>
  251. <!-- <Tinymce
  252. v-if="type == 'add' || type == 'edit'"
  253. ref="editor"
  254. v-model="ruleForm.introduction"
  255. :height="400"
  256. :width="700"
  257. /> -->
  258. <el-input
  259. type="textarea"
  260. v-if="type == 'add' || type == 'edit'"
  261. style="width:700px"
  262. rows="10"
  263. placeholder="请输入内容"
  264. v-model="ruleForm.introduction"
  265. ></el-input>
  266. </el-form-item>
  267. <h3 class="form-title">开本流程</h3>
  268. <div v-if="type == 'add' || type == 'edit'">
  269. <el-table
  270. :header-cell-style="{ background: '#eee', color: '#606266' }"
  271. :data="ruleForm.processesList"
  272. border
  273. style="width: 90%;margin-left:30px;"
  274. >
  275. <el-table-column
  276. align="center"
  277. type="index"
  278. label="序号"
  279. width="50"
  280. />
  281. <el-table-column
  282. align="center"
  283. property="title"
  284. label="流程标题"
  285. width="130"
  286. >
  287. <template slot-scope="scope">
  288. <el-input
  289. v-model="ruleForm.processesList[scope.$index].title"
  290. />
  291. </template>
  292. </el-table-column>
  293. <el-table-column
  294. align="center"
  295. property="code"
  296. label="流程编号"
  297. width="100"
  298. >
  299. <template slot-scope="scope">
  300. <el-input
  301. disabled
  302. @input="changCode"
  303. v-model.number="ruleForm.processesList[scope.$index].code"
  304. />
  305. </template>
  306. </el-table-column>
  307. <el-table-column
  308. align="center"
  309. property="introduction"
  310. label="简介"
  311. >
  312. <template slot-scope="scope">
  313. <el-input
  314. v-model="ruleForm.processesList[scope.$index].introduction"
  315. />
  316. </template>
  317. </el-table-column>
  318. <el-table-column
  319. align="center"
  320. property="sort"
  321. label="排序"
  322. width="100"
  323. >
  324. <template slot-scope="scope">
  325. <el-input
  326. type="number"
  327. @input="changSort"
  328. @mousewheel.native.prevent
  329. @keyup.native="prevent($event)"
  330. v-model="ruleForm.processesList[scope.$index].sort"
  331. />
  332. </template>
  333. </el-table-column>
  334. <el-table-column align="center" label="操作" width="100">
  335. <template slot-scope="scope">
  336. <el-button type="text" size="mini" @click="Del(scope.$index)"
  337. >删除</el-button
  338. >
  339. </template>
  340. </el-table-column>
  341. </el-table>
  342. </div>
  343. <div v-if="type == 'view'">
  344. <el-table
  345. :header-cell-style="{ background: '#eee', color: '#606266' }"
  346. :data="ruleForm.processesList"
  347. border
  348. style="width: 90%;margin-left:30px;"
  349. >
  350. <el-table-column
  351. align="center"
  352. type="index"
  353. label="序号"
  354. width="50"
  355. />
  356. <el-table-column align="center" property="title" label="流程标题">
  357. </el-table-column>
  358. <el-table-column align="center" property="code" label="流程编号">
  359. </el-table-column>
  360. <el-table-column
  361. align="center"
  362. property="introduction"
  363. label="简介"
  364. >
  365. </el-table-column>
  366. <el-table-column
  367. align="center"
  368. property="sort"
  369. label="排序"
  370. width="50"
  371. >
  372. </el-table-column>
  373. </el-table>
  374. </div>
  375. <div style="margin-top:15px;" v-if="type == 'add' || type == 'edit'">
  376. <el-button
  377. type="success"
  378. :disabled="disabledButton"
  379. style="height:36px;width:100px;margin-left:30px;color:#fff;background:#33DB99"
  380. @click="handleAddK"
  381. >新增</el-button
  382. >
  383. </div>
  384. <h3 class="form-title">剧本资源</h3>
  385. <!-- <el-form-item label="图片" prop="imgUrls" style="width: 100%;">
  386. <el-radio-group
  387. :disabled="disabled"
  388. v-model="radioImg"
  389. @change="changeImg"
  390. >
  391. <el-radio :label="1">本地上传</el-radio>
  392. <el-radio :label="2">网易云地址</el-radio>
  393. </el-radio-group>
  394. </el-form-item> -->
  395. <el-form-item
  396. label="图片"
  397. prop="imgUrls"
  398. style="width: 100%;"
  399. :style="dialog.title != '查看剧本' ? '' : 'pointer-events:none'"
  400. v-if="radioImg == 1"
  401. >
  402. <div v-for="(item, s) in imgData" :key="s" class="imgdata">
  403. <el-image
  404. style="width: 146px; height: 146px"
  405. :src="item.url"
  406. fit="fill"
  407. >
  408. </el-image>
  409. <div class="imgdialog">
  410. <p>
  411. <i
  412. class="el-icon-delete"
  413. @click="deldialogimg(item, s, 'img')"
  414. style="font-size: 20px;"
  415. ></i>
  416. </p>
  417. </div>
  418. <div class="sz_container" style="text-align:center">
  419. <span>{{ item.processNames }}</span>
  420. </div>
  421. <div v-if="type == 'add' || type == 'edit'" class="sz_container" style="text-align:center" >
  422. <el-button size="mini" type="text" @click="setLc(item, s, 'img')">关联流程</el-button
  423. >
  424. </div>
  425. <div style="display:flex;width:130px">
  426. <div style="flex:1;">标题:</div>
  427. <el-input v-model="imgData[s].title" placeholder="请输入标题" style="flex:2;"></el-input>
  428. </div>
  429. </div>
  430. <el-upload
  431. v-if="type == 'add' || type == 'edit'"
  432. class="avatar-uploader"
  433. style="float:left;margin-left:60px"
  434. action
  435. list-type="picture-card"
  436. :show-file-list="false"
  437. :http-request="labeluploadimg"
  438. element-loading-text="正在上传..."
  439. v-loading="loadingImg"
  440. >
  441. <!-- :on-progress="labeluploadimg" -->
  442. <i class="el-icon-plus"></i>
  443. </el-upload>
  444. <el-dialog :visible.sync="dialogVisible">
  445. <img width="100%" :src="dialogImageUrl" alt="" />
  446. </el-dialog>
  447. </el-form-item>
  448. <el-progress :percentage="jinduImgNum" v-if="jinduShowImg"></el-progress>
  449. <el-form-item
  450. v-if="radioImg == 2"
  451. style="width: 100%;"
  452. class="urlTable"
  453. >
  454. <el-table
  455. ref="img"
  456. v-if="type == 'add' || type == 'edit'"
  457. :data="ruleForm.radioImg"
  458. border
  459. style="width: 80%;margin-left:100px;"
  460. >
  461. <el-table-column
  462. align="center"
  463. type="index"
  464. label="序号"
  465. width="50"
  466. />
  467. <el-table-column align="center" property="date" label="资源标题">
  468. <template slot-scope="scope">
  469. <el-input v-model="ruleForm.radioImg[scope.$index].title" />
  470. </template>
  471. </el-table-column>
  472. <el-table-column align="center" property="url" label="资源URL">
  473. <template slot-scope="scope">
  474. <el-input v-model="ruleForm.radioImg[scope.$index].neteaseUrl" />
  475. </template>
  476. </el-table-column>
  477. <el-table-column
  478. align="center"
  479. property="processId"
  480. label="关联流程"
  481. >
  482. <template slot-scope="scope">
  483. <el-select
  484. v-model="ruleForm.radioImg[scope.$index].processId"
  485. clearable
  486. multiple
  487. @change="changePro('img')"
  488. placeholder="请选择流程"
  489. >
  490. <el-option
  491. v-for="(item, o) in ruleForm.processesList"
  492. :key="o"
  493. :label="item.title"
  494. :value="item.code"
  495. >
  496. </el-option>
  497. </el-select>
  498. </template>
  499. </el-table-column>
  500. <el-table-column align="center" label="操作">
  501. <template slot-scope="scope">
  502. <el-button type="text" size="mini" @click="DelImg(scope.$index)"
  503. >删除</el-button
  504. >
  505. </template>
  506. </el-table-column>
  507. </el-table>
  508. <el-table
  509. v-if="type == 'view'"
  510. :data="ruleForm.radioImg"
  511. border
  512. style="width: 80%;margin-left:100px;"
  513. >
  514. <el-table-column
  515. align="center"
  516. type="index"
  517. label="序号"
  518. width="50"
  519. />
  520. <el-table-column align="center" property="title" label="资源标题" />
  521. <el-table-column align="center" property="url" label="资源URL" />
  522. <el-table-column
  523. align="center"
  524. property="processId"
  525. label="关联流程"
  526. >
  527. <template slot-scope="scope">
  528. {{ scope.row.processNames }}
  529. </template>
  530. </el-table-column>
  531. </el-table>
  532. <div style="margin-top:15px;" v-if="type == 'add' || type == 'edit'">
  533. <el-button
  534. type="success"
  535. style="height:36px;width:100px;margin-left:30px;color:#fff;background:#33DB99"
  536. @click="handleAddImg"
  537. >新增</el-button
  538. >
  539. </div>
  540. </el-form-item>
  541. <el-form-item label="音频" prop="imgUrls" style="width: 100%;">
  542. <el-radio-group
  543. v-model="radioMusic"
  544. @change="changeMusic"
  545. >
  546. <el-radio :label="1">本地上传</el-radio>
  547. <el-radio :label="2">网易云地址</el-radio>
  548. </el-radio-group>
  549. </el-form-item>
  550. <el-form-item
  551. style="margin-left: 100px;"
  552. class="audioUpload"
  553. v-if="radioMusic == 1"
  554. >
  555. <div v-for="(item, i) in musicData" :key="i" class="imgdata">
  556. <!-- <el-image
  557. style="width: 146px; height: 146px"
  558. :src="item.url"
  559. fit="fill"
  560. >
  561. </el-image> -->
  562. <audio
  563. :src="item.url"
  564. width="178px"
  565. height="178px"
  566. controls="controls"
  567. v-if="musicData.length > 0"
  568. ></audio>
  569. <!-- <audio
  570. style="width: 146px; height: 146px"
  571. :src="item.url"
  572. v-if="musicData.length > 0 "
  573. ></audio> -->
  574. <!-- <div class="imgdialog">
  575. <p>
  576. <i class="el-icon-zoom-in" style="font-size: 20px"></i>
  577. <i
  578. class="el-icon-delete"
  579. @click="deldialogimg(item, i, 'music')"
  580. style="font-size: 20px; padding-left: 30px"
  581. ></i>
  582. </p>
  583. </div> -->
  584. <div class="sz_container" style="text-align:center">
  585. <span>{{ item.processNames }}</span>
  586. </div>
  587. <div
  588. v-if="type == 'add' || type == 'edit'"
  589. class="sz_container"
  590. style="display: flex;justify-content: space-around;"
  591. >
  592. <el-button
  593. size="mini"
  594. type="text"
  595. @click="setLc(item, i, 'music')"
  596. >关联流程</el-button
  597. >
  598. <el-button
  599. size="mini"
  600. type="text"
  601. @click="deldialogimg(item, i, 'music')"
  602. >删除音频</el-button
  603. >
  604. </div>
  605. <div style="display:flex;width:280px">
  606. <div style="width:70px;">标题:</div>
  607. <el-input v-model="item.title" placeholder="请输入标题" :disabled='disabled'></el-input>
  608. </div>
  609. </div>
  610. <el-upload
  611. v-if="type == 'add' || type == 'edit'"
  612. class="avatar-uploader"
  613. style="float:left;margin-left:60px"
  614. action
  615. list-type="picture-card"
  616. :show-file-list="false"
  617. :before-upload="uploadAudio"
  618. :http-request="labeluploadmusic"
  619. element-loading-text="正在上传..."
  620. v-loading="loadingAudio"
  621. >
  622. <!-- :on-progress='labeluploadmusic' -->
  623. <i class="el-icon-plus"></i>
  624. </el-upload>
  625. <el-dialog :visible.sync="dialogVisible">
  626. <img width="100%" :src="dialogImageUrl" alt="" />
  627. </el-dialog>
  628. </el-form-item>
  629. <el-progress :percentage="jinduAudioNum" v-if="jinduShowAudio"></el-progress>
  630. <el-form-item
  631. v-if="radioMusic == 2"
  632. style="width: 100%;"
  633. class="urlTable"
  634. >
  635. <el-table
  636. ref="music"
  637. v-if="type == 'add' || type == 'edit'"
  638. :data="ruleForm.radioMusic"
  639. border
  640. style="width: 80%;margin-left:100px;"
  641. >
  642. <el-table-column
  643. align="center"
  644. type="index"
  645. label="序号"
  646. width="50"
  647. />
  648. <el-table-column align="center" property="title" label="资源标题">
  649. <template slot-scope="scope">
  650. <el-input v-model="ruleForm.radioMusic[scope.$index].title" />
  651. </template>
  652. </el-table-column>
  653. <el-table-column align="center" property="url" label="资源URL">
  654. <template slot-scope="scope">
  655. <el-input v-model="ruleForm.radioMusic[scope.$index].url" />
  656. </template>
  657. </el-table-column>
  658. <el-table-column
  659. align="center"
  660. property="processId"
  661. label="关联流程"
  662. >
  663. <template slot-scope="scope">
  664. <el-select
  665. v-model="ruleForm.radioMusic[scope.$index].processId"
  666. clearable
  667. multiple
  668. @change="changePro('music')"
  669. placeholder="请选择流程"
  670. >
  671. <el-option
  672. v-for="item in ruleForm.processesList"
  673. :key="item.value"
  674. :label="item.title"
  675. :value="item.code"
  676. >
  677. </el-option>
  678. </el-select>
  679. </template>
  680. </el-table-column>
  681. <el-table-column align="center" label="操作">
  682. <template slot-scope="scope">
  683. <el-button
  684. type="text"
  685. size="mini"
  686. @click="DelMusic(scope.$index)"
  687. >删除</el-button
  688. >
  689. </template>
  690. </el-table-column>
  691. </el-table>
  692. <el-table
  693. v-if="type == 'view'"
  694. :data="ruleForm.radioMusic"
  695. border
  696. style="width: 80%;margin-left:100px;"
  697. >
  698. <el-table-column
  699. align="center"
  700. type="index"
  701. label="序号"
  702. width="50"
  703. />
  704. <el-table-column align="center" property="title" label="资源标题">
  705. <template slot-scope="scope">
  706. {{ scope.row.title }}
  707. </template>
  708. </el-table-column>
  709. <el-table-column align="center" property="url" label="资源URL" />
  710. <el-table-column
  711. align="center"
  712. property="processId"
  713. label="关联流程"
  714. >
  715. <template slot-scope="scope">
  716. {{ scope.row.processNames }}
  717. </template>
  718. </el-table-column>
  719. </el-table>
  720. <div style="margin-top:15px;" v-if="type == 'add' || type == 'edit'">
  721. <el-button
  722. type="success"
  723. style="height:36px;width:100px;margin-left:30px;color:#fff;background:#33DB99"
  724. @click="handleAddMusic"
  725. >新增</el-button
  726. >
  727. </div>
  728. </el-form-item>
  729. <!-- <el-form-item label="视频" prop="imgUrls" style="width: 100%;">
  730. <el-radio-group
  731. :disabled="disabled"
  732. v-model="radioVideo"
  733. @change="changeVideo"
  734. >
  735. <el-radio :label="1">本地上传</el-radio>
  736. <el-radio :label="2">网易云地址</el-radio>
  737. </el-radio-group>
  738. </el-form-item> -->
  739. <el-form-item
  740. label="视频"
  741. prop="imgUrls"
  742. style="width: 100%;"
  743. class="videoUpload"
  744. v-if="radioVideo == 1"
  745. >
  746. <div v-for="(item, idx) in videoData" :key="idx" class="imgdata">
  747. <!-- <el-image
  748. style="width: 146px; height: 146px"
  749. :src="item.url"
  750. fit="fill"
  751. >
  752. </el-image> -->
  753. <video
  754. :src="item.url"
  755. width="178px"
  756. height="178px"
  757. controls="controls"
  758. v-if="videoData.length > 0"
  759. ></video>
  760. <!-- <div class="imgdialog">
  761. <p>
  762. <i class="el-icon-zoom-in" @click="handleView(item,idx)" style="font-size: 20px"></i>
  763. <i
  764. class="el-icon-delete"
  765. @click="deldialogimg(item, idx, 'video')"
  766. style="font-size: 20px; padding-left: 30px"
  767. ></i>
  768. </p>
  769. </div> -->
  770. <div
  771. class="sz_container"
  772. style="width:178px; text-align:center;margin-right:20px;"
  773. >
  774. <span>{{ item.processNames }}</span>
  775. </div>
  776. <div
  777. v-if="type == 'add' || type == 'edit'"
  778. class="sz_container"
  779. style="width:178px"
  780. >
  781. <el-button
  782. style="margin-right:60px;"
  783. size="mini"
  784. type="text"
  785. @click="setLc(item, idx, 'video')"
  786. >关联流程</el-button
  787. >
  788. <el-button
  789. size="mini"
  790. type="text"
  791. @click="deldialogimg(item, idx, 'video')"
  792. >删除视频</el-button
  793. >
  794. <div style="display:flex;width:170px">
  795. <div style="flex:1;">标题:</div>
  796. <el-input v-model="item.title" placeholder="请输入标题" style="flex:2;"></el-input>
  797. </div>
  798. </div>
  799. </div>
  800. <el-upload
  801. v-if="type == 'add' || type == 'edit'"
  802. class="avatar-uploader"
  803. style="float:left;margin-left:60px"
  804. action
  805. list-type="picture-card"
  806. :show-file-list="false"
  807. :http-request="labeluploadvideo"
  808. :before-upload="uploadVideo"
  809. element-loading-text="正在上传..."
  810. v-loading="loading"
  811. >
  812. <!-- :on-progress='labeluploadvideo' -->
  813. <!-- :on-progress='startVideo' -->
  814. <i class="el-icon-plus"></i>
  815. </el-upload>
  816. <!-- <el-dialog :visible.sync="dialogVideo"> </el-dialog> -->
  817. </el-form-item>
  818. <el-progress :percentage="jinduVideoNum" v-if="jinduShowVideo"></el-progress>
  819. <el-form-item
  820. v-if="radioVideo == 2"
  821. style="width: 100%;"
  822. class="urlTable"
  823. >
  824. <el-table
  825. ref="video"
  826. v-if="type == 'add' || type == 'edit'"
  827. :data="ruleForm.radioVideo"
  828. border
  829. style="width: 80%;margin-left:100px;"
  830. >
  831. <el-table-column
  832. align="center"
  833. type="index"
  834. label="序号"
  835. width="50"
  836. />
  837. <el-table-column align="center" property="title" label="资源标题">
  838. <template slot-scope="scope">
  839. <el-input v-model="ruleForm.radioVideo[scope.$index].title" />
  840. </template>
  841. </el-table-column>
  842. <el-table-column align="center" property="url" label="资源URL">
  843. <template slot-scope="scope">
  844. <el-input v-model="ruleForm.radioVideo[scope.$index].url" />
  845. </template>
  846. </el-table-column>
  847. <el-table-column
  848. align="center"
  849. property="processId"
  850. label="关联流程"
  851. >
  852. <template slot-scope="scope">
  853. <el-select
  854. v-model="ruleForm.radioVideo[scope.$index].processId"
  855. clearable
  856. multiple
  857. @change="changePro('video')"
  858. placeholder="请选择流程"
  859. >
  860. <el-option
  861. v-for="(item, u) in ruleForm.processesList"
  862. :key="u"
  863. :label="item.title"
  864. :value="item.code"
  865. >
  866. </el-option>
  867. </el-select>
  868. </template>
  869. </el-table-column>
  870. <el-table-column align="center" label="操作">
  871. <template slot-scope="scope">
  872. <el-button
  873. type="text"
  874. size="mini"
  875. @click="DelVideo(scope.$index)"
  876. >删除</el-button
  877. >
  878. </template>
  879. </el-table-column>
  880. </el-table>
  881. <el-table
  882. v-if="type == 'view'"
  883. :data="ruleForm.radioVideo"
  884. border
  885. style="width: 80%;margin-left:100px;"
  886. >
  887. <el-table-column
  888. align="center"
  889. type="index"
  890. label="序号"
  891. width="50"
  892. />
  893. <el-table-column align="center" property="title" label="资源标题" />
  894. <el-table-column align="center" property="url" label="资源URL" />
  895. <el-table-column
  896. align="center"
  897. property="processId"
  898. label="关联流程"
  899. >
  900. <template slot-scope="scope">
  901. {{ scope.row.processNames }}
  902. </template>
  903. </el-table-column>
  904. </el-table>
  905. <div v-if="type == 'add' || type == 'edit'" style="margin-top:15px;">
  906. <el-button
  907. type="success"
  908. style="height:36px;width:100px;margin-left:30px;color:#fff;background:#33DB99"
  909. @click="handleAddVideo"
  910. >新增</el-button
  911. >
  912. </div>
  913. </el-form-item>
  914. <!-- <el-form-item>
  915. <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
  916. <el-button @click="resetForm('ruleForm')">重置</el-button>
  917. </el-form-item> -->
  918. </el-form>
  919. <span slot="footer" class="dialog-footer">
  920. <el-button @click="subEsc"> </el-button>
  921. <el-button
  922. v-if="type == 'add' || type == 'edit'"
  923. type="primary"
  924. @click="subMit"
  925. > </el-button
  926. >
  927. </span>
  928. </el-dialog>
  929. <!-- 关联流程 -->
  930. <el-dialog
  931. title="关联流程"
  932. :visible.sync="process.Visible"
  933. width="30%"
  934. center
  935. >
  936. <el-form>
  937. <el-form-item label="关联流程">
  938. <el-select
  939. v-model="processId"
  940. clearable
  941. multiple
  942. placeholder="请选择流程"
  943. @change="changeLiuc"
  944. >
  945. <el-option
  946. v-for="(item, y) in ruleForm.processesList"
  947. :key="y"
  948. :label="item.title"
  949. :value="item.code"
  950. >
  951. </el-option>
  952. </el-select>
  953. </el-form-item>
  954. </el-form>
  955. <span slot="footer" class="dialog-footer">
  956. <el-button @click="process.Visible = false"> </el-button>
  957. <el-button type="primary" @click="subMitLc"> </el-button>
  958. </span>
  959. </el-dialog>
  960. </div>
  961. </template>
  962. <script>
  963. import Tinymce from "@/components/Tinymce";
  964. import {
  965. queryJbInfo,
  966. addJbInfo,
  967. updateJbInfo,
  968. queryJbDetail,
  969. deleteJbInfo,
  970. queryFindList //获取流程列表
  971. } from "@/api/sce/sce.js";
  972. import { uploadFile, delFile } from "@/api/upload/upload.js";
  973. import axios from '@/api/axios.js' /*引入封装的axios*/
  974. const baseUrl = process.env.VUE_APP_BASE_API;
  975. export default {
  976. components: { Tinymce },
  977. data() {
  978. return {
  979. imgTitle:"",//上传的图片标题
  980. audioTitle:'',//上传音频标题
  981. videoTitle:'',//上传音频标题
  982. jindu:0,
  983. jinduCoverNum:0,//封面图片进度
  984. jinduOtherImgNum:0,//其他图片进度
  985. jinduImgNum:0,
  986. jinduAudioNum:0,
  987. jinduVideoNum:0,
  988. jinduShowCover:false,//封面进度条是否显示
  989. jinduShowOtherImg:false,//其他进度条显示
  990. jinduShowImg:false,
  991. jinduShowAudio:false,
  992. jinduShowVideo:false,
  993. imgTime:null,
  994. audioTime:null,
  995. videoTime:null,
  996. liuChengLeixingType:'',
  997. loadingOtherImg:false,//其他图片加载圈
  998. loadingCover:false,//封面加载圈
  999. loadingAudio: false,
  1000. loadingImg:false,
  1001. baseUrl,
  1002. loading: true,
  1003. queryParams: {
  1004. pageNum: 1,
  1005. pageSize: 10,
  1006. query: {
  1007. title: undefined,
  1008. studioName: undefined,
  1009. labelName: undefined
  1010. }
  1011. },
  1012. tableData: [],
  1013. rules: {
  1014. title: [{ required: true, message: "请输入标题名称", trigger: "blur" }],
  1015. labelName: [
  1016. { required: true, message: "请输入标签名称", trigger: "blur" }
  1017. ],
  1018. cover: [{ required: true, message: "请选择封面", trigger: "blur" }],
  1019. introduction: [
  1020. { required: true, message: "请输入简介", trigger: "blur" }
  1021. ]
  1022. },
  1023. dialog: {
  1024. title: "新增剧本",
  1025. Visible: false
  1026. },
  1027. ruleForm: {
  1028. processesList: [],
  1029. imgUrl: "",
  1030. imgUrls: [],
  1031. radioImg: [],
  1032. radioMusic: [],
  1033. radioVideo: [],
  1034. resourcesList: []
  1035. },
  1036. dialogVisible: false,
  1037. active: "",
  1038. imageUrl: "",
  1039. total: 0,
  1040. dialogVisible: false,
  1041. dialogImageUrl: "",
  1042. dataImg: [],
  1043. dataImgs: [],
  1044. lcData: [],
  1045. radioImg: "1",
  1046. radioMusic: "1",
  1047. radioVideo: "1",
  1048. type: "",
  1049. imgData: [],
  1050. musicData: [],
  1051. videoData: [],
  1052. processId: [],
  1053. process: {
  1054. Visible: false
  1055. },
  1056. list: {},
  1057. typeUrl: "",
  1058. imgType: false,
  1059. musicType: false,
  1060. videoType: false,
  1061. imgIndex: "",
  1062. musicIdnex: "",
  1063. videoIndex: "",
  1064. dataList: {},
  1065. disabled: false,
  1066. disabledButton: false,
  1067. dialogVideo: false
  1068. };
  1069. },
  1070. mounted() {
  1071. this.queryList();
  1072. // this.queryFindList();
  1073. },
  1074. watch:{
  1075. jinduCoverNum(newV,oldV){
  1076. console.log('新',newV);
  1077. console.log('旧',oldV);
  1078. },
  1079. jinduVideoNum(newV,oldV){
  1080. console.log('新',newV);
  1081. console.log('旧',oldV);
  1082. }
  1083. },
  1084. methods: {
  1085. format(percentage) {
  1086. console.log(percentage);
  1087. return percentage === 100 ? `${percentage}%` : `${percentage}%`;
  1088. },
  1089. uploadChange(e){
  1090. console.log('123');
  1091. console.log('e',e.percent); //文件上传进度
  1092. },
  1093. getWangyi () {
  1094. axios({
  1095. url: '/song/url?id=38358820', /*热门音乐链接接口地址*/
  1096. method: 'post'
  1097. })
  1098. .then(res => {
  1099. console.log("我拿到的数据:", res.data)
  1100. })
  1101. .catch(err => {
  1102. console.log(err)
  1103. })
  1104. },
  1105. changeLiuc(e){
  1106. // console.log(e);
  1107. },
  1108. //音频校验
  1109. uploadAudio(file) {
  1110. console.log(file);
  1111. if (
  1112. [
  1113. "audio/mpeg"
  1114. // "video/ogg",
  1115. // "video/flv",
  1116. // "video/avi",
  1117. // "video/rmvb",
  1118. // "video/mkv",
  1119. // "video/x-matroska"
  1120. ].indexOf(file.type) == -1
  1121. ) {
  1122. this.$message.error("上传视频只能是 mp3格式!");
  1123. return false;
  1124. }
  1125. const isLt2G = file.size / 1024 / 1024 < 2000000;
  1126. if (!isLt2G) {
  1127. this.$message.error("上传文件大小不能超过 2GB!");
  1128. }
  1129. return isLt2G;
  1130. },
  1131. //视频上传格式校验
  1132. uploadVideo(file) {
  1133. if (
  1134. [
  1135. "video/mp4",
  1136. "video/ogg",
  1137. "video/flv",
  1138. "video/avi",
  1139. "video/rmvb",
  1140. "video/mkv",
  1141. "video/x-matroska"
  1142. ].indexOf(file.type) == -1
  1143. ) {
  1144. this.$message.error(
  1145. "上传视频只能是 mp4、ogg、flv、avi、rmvb 、x-matroska格式!"
  1146. );
  1147. return false;
  1148. }
  1149. const isLt2G = file.size / 1024 / 1024 < 2000000;
  1150. if (!isLt2G) {
  1151. this.$message.error("上传文件大小不能超过 2GB!");
  1152. }
  1153. return isLt2G;
  1154. },
  1155. //关闭弹窗
  1156. closeDialog(){
  1157. console.log('关闭');
  1158. // uploadFile=null;
  1159. // var uploadFile=null;
  1160. this.ruleForm = {
  1161. processesList: [],
  1162. imgUrl: "",
  1163. imgUrls: [],
  1164. radioImg: [],
  1165. radioMusic: [],
  1166. radioVideo: [],
  1167. resourcesList: []
  1168. };
  1169. },
  1170. //新增剧本流程数据
  1171. openDialog() {
  1172. if (this.dialog.title == "新增剧本") {
  1173. //随机生成4位数函数
  1174. function rand(min, max) {
  1175. return Math.floor(Math.random() * (max - min)) + min;
  1176. }
  1177. this.queryFindList();
  1178. this.ruleForm.processesList.push(
  1179. {
  1180. title: "开场", //标题
  1181. // code: 1233, //随机4位数
  1182. code: rand(1000, 9999), //随机4位数
  1183. introduction: "开场", //介绍
  1184. sort: "1", //排序
  1185. type: "1" //类型
  1186. },
  1187. {
  1188. title: "选角",
  1189. code: rand(1000, 9999),
  1190. introduction: "选角",
  1191. sort: "2",
  1192. type: "2"
  1193. },
  1194. {
  1195. title: "复盘",
  1196. code: rand(1000, 9999),
  1197. introduction: "复盘",
  1198. sort: "99",
  1199. type: "9"
  1200. }
  1201. );
  1202. console.log('type',this.ruleForm.processesList)
  1203. }
  1204. },
  1205. mapForChannel(e) {
  1206. for (var i = 0; i < this.lcData.length; i++) {
  1207. if (this.lcData[i].id == e) {
  1208. return this.lcData[i].title;
  1209. }
  1210. }
  1211. },
  1212. ForChannel(e) {
  1213. var a = e.split(",");
  1214. var tmp = [];
  1215. for (var i = 0; i < this.ruleForm.processesList.length; i++) {
  1216. for (var s = 0; s < a.length; s++) {
  1217. if (this.ruleForm.processesList[i].code == e[s]) {
  1218. tmp.push(this.ruleForm.processesList[i].title);
  1219. return tmp;
  1220. }
  1221. }
  1222. }
  1223. },
  1224. handleClose(done) {
  1225. this.$confirm("确认关闭?")
  1226. .then(_ => {
  1227. done();
  1228. this.type = "";
  1229. })
  1230. .catch(_ => {});
  1231. },
  1232. changSort(val) {
  1233. if (this.ruleForm.processesList.length > 1) {
  1234. for (var i = 0; i < this.ruleForm.processesList.length; i++) {
  1235. let s = i + 1;
  1236. if (
  1237. s < this.ruleForm.processesList.length ||
  1238. s == this.ruleForm.processesList.length
  1239. ) {
  1240. if (
  1241. this.ruleForm.processesList[i].sort ==
  1242. this.ruleForm.processesList[s].sort
  1243. ) {
  1244. // this.$message({
  1245. // message: "输入的流程排序有重复,请重新输入",
  1246. // type: "error"
  1247. // });
  1248. // this.ruleForm.processesList[s].sort = "";
  1249. // console.log(val);
  1250. // this.disabledButton = true;
  1251. } else {
  1252. this.disabledButton = false;
  1253. }
  1254. }
  1255. }
  1256. }
  1257. },
  1258. changCode(val) {
  1259. if (this.ruleForm.processesList.length > 1) {
  1260. for (var i = 0; i < this.ruleForm.processesList.length; i++) {
  1261. let s = i + 1;
  1262. if (
  1263. s < this.ruleForm.processesList.length ||
  1264. s == this.ruleForm.processesList.length
  1265. ) {
  1266. if (
  1267. this.ruleForm.processesList[i].code ==
  1268. this.ruleForm.processesList[s].code
  1269. ) {
  1270. this.$message({
  1271. message: "输入的流程编号有重复,请重新输入",
  1272. type: "error"
  1273. });
  1274. this.ruleForm.processesList[s].code = "";
  1275. console.log(val);
  1276. this.disabledButton = true;
  1277. } else {
  1278. this.disabledButton = false;
  1279. }
  1280. }
  1281. }
  1282. }
  1283. },
  1284. //获取列表
  1285. async queryList() {
  1286. this.loading = true;
  1287. try {
  1288. let res = await queryJbInfo(this.queryParams);
  1289. this.tableData = res.data.rows;
  1290. this.total = res.data.total;
  1291. this.loading = false;
  1292. } catch (err) {}
  1293. },
  1294. //搜索
  1295. search() {
  1296. this.queryList();
  1297. },
  1298. //重置
  1299. refresh() {
  1300. this.queryParams = {
  1301. pageNum: 1,
  1302. pageSize: 10,
  1303. query: {
  1304. title: undefined,
  1305. studioName: undefined,
  1306. labelName: undefined
  1307. }
  1308. };
  1309. this.queryList();
  1310. },
  1311. //跳转Tips维护
  1312. handleTips(row) {
  1313. this.$router.push({
  1314. name: "Tips/index",
  1315. query: { scenarioId: row.id, type: "sceinfo" }
  1316. });
  1317. },
  1318. //获取流程
  1319. async queryFindList() {
  1320. try {
  1321. let res = await queryFindList({});
  1322. this.lcData = res.data;
  1323. } catch (err) {}
  1324. },
  1325. //获取详情
  1326. async queryListDetail(id) {
  1327. try {
  1328. this.ruleForm = {
  1329. studioName: "",
  1330. title: "",
  1331. labelName: "",
  1332. imgUrl: "",
  1333. cover: "",
  1334. introduction: "",
  1335. processesList: [],
  1336. imgUrl: "",
  1337. radioImg: [],
  1338. radioMusic: [],
  1339. radioVideo: [],
  1340. resourcesList: []
  1341. };
  1342. this.imgData = [];
  1343. this.musicData = [];
  1344. this.videoData = [];
  1345. this.radioMusic = 1;
  1346. this.radioVideo = 1;
  1347. this.radioImg = 1;
  1348. let res = await queryJbDetail(id);
  1349. this.ruleForm = res.data;
  1350. if (this.ruleForm.imgUrl != null) {
  1351. this.dataImg = this.ruleForm.imgUrl.split(",");
  1352. }
  1353. var img = [];
  1354. var music = [];
  1355. var musicBendi = [];//本地音乐回显
  1356. var musicWangyi = [];//网易云回显
  1357. var video = [];
  1358. for (var i in res.data.resourcesList) {
  1359. if (
  1360. res.data.resourcesList[i].mediaType == 1 &&
  1361. res.data.resourcesList[i].sourceType == 2
  1362. ) {
  1363. this.radioImg = 2;
  1364. img.push(res.data.resourcesList[i]);
  1365. }
  1366. if (
  1367. res.data.resourcesList[i].mediaType == 1 &&
  1368. res.data.resourcesList[i].sourceType == 1
  1369. ) { //图片
  1370. this.radioImg = 1;
  1371. img.push(res.data.resourcesList[i]);
  1372. }
  1373. }
  1374. if (this.radioImg == 1) {
  1375. this.imgData = img;
  1376. } else if (this.radioImg == 2) {
  1377. this.ruleForm.radioImg = img.map(n => {
  1378. return {
  1379. mediaType: n.mediaType,
  1380. sourceType: n.sourceType,
  1381. title: n.title,
  1382. url: n.url,
  1383. processNames: n.processNames,
  1384. processId: n.processId.split(",")
  1385. };
  1386. });
  1387. }
  1388. for (var i in res.data.resourcesList) {
  1389. if (
  1390. res.data.resourcesList[i].mediaType == 2 && //音乐类型
  1391. res.data.resourcesList[i].sourceType == 2 //网易云
  1392. ) { //网易云回显
  1393. this.radioMusic = 2;
  1394. this.wangyiyunType = 'wangyiyun'
  1395. musicWangyi.push(res.data.resourcesList[i]);
  1396. }
  1397. if ( //本地音乐回显
  1398. res.data.resourcesList[i].mediaType == 2 && //音乐类型
  1399. res.data.resourcesList[i].sourceType == 1 //本地
  1400. ) {
  1401. this.radioMusic = 1;
  1402. musicBendi.push(res.data.resourcesList[i]);
  1403. // console.log('本地音乐',music);
  1404. }
  1405. }
  1406. if (this.radioMusic == 1) { //本地回显
  1407. this.musicData = musicBendi;
  1408. }
  1409. if (this.wangyiyunType == 'wangyiyun') { //网易云回显
  1410. console.log('wangyiyun',musicWangyi);
  1411. this.ruleForm.radioMusic = musicWangyi.map(n => {
  1412. return {
  1413. mediaType: n.mediaType,
  1414. sourceType: n.sourceType,
  1415. title: n.title,
  1416. // url: n.url,
  1417. url: n.neteaseUrl,
  1418. processNames: n.processNames,
  1419. processId: n.processId.split(",")
  1420. };
  1421. });
  1422. }
  1423. for (var i in res.data.resourcesList) {
  1424. if (
  1425. res.data.resourcesList[i].mediaType == 3 &&
  1426. res.data.resourcesList[i].sourceType == 2
  1427. ) {
  1428. this.radioVideo = 2;
  1429. video.push(res.data.resourcesList[i]);
  1430. }
  1431. if (
  1432. res.data.resourcesList[i].mediaType == 3 &&
  1433. res.data.resourcesList[i].sourceType == 1
  1434. ) {
  1435. this.radioVideo = 1;
  1436. video.push(res.data.resourcesList[i]);
  1437. }
  1438. }
  1439. if (this.radioVideo == 1) {
  1440. this.videoData = video;
  1441. } else if (this.radioVideo == 2) {
  1442. this.ruleForm.radioVideo = video.map(n => {
  1443. return {
  1444. mediaType: n.mediaType,
  1445. sourceType: n.sourceType,
  1446. title: n.title,
  1447. url: n.url,
  1448. processNames: n.processNames,
  1449. processId: n.processId.split(",")
  1450. };
  1451. });
  1452. }
  1453. // res.data.resourcesList.map(n => {
  1454. // var a = [];
  1455. // var b = [];
  1456. // var c = [];
  1457. // if (n.mediaType == 2 && n.sourceType == 1) {
  1458. // consooe.log(1111);
  1459. // b.push(n);
  1460. // this.musicData = b;
  1461. // this.radioMusic = 1;
  1462. // }
  1463. // if (n.mediaType == 2 && n.sourceType == 2) {
  1464. // b.push(n);
  1465. // this.ruleForm.radioMusic = b.map(n => {
  1466. // return {
  1467. // mediaType: n.mediaType,
  1468. // sourceType: n.sourceType,
  1469. // title: n.title,
  1470. // url: n.url,
  1471. // processNames: n.processNames,
  1472. // processId: n.processId.split(",")
  1473. // };
  1474. // });
  1475. // this.radioMusic = 2;
  1476. // }
  1477. // if (n.mediaType == 3 && n.sourceType == 1) {
  1478. // c.push(n);
  1479. // this.videoData = c;
  1480. // this.radioVideo = 1;
  1481. // }
  1482. // if (n.mediaType == 3 && n.sourceType == 2) {
  1483. // c.push(n);
  1484. // this.ruleForm.radioVideo = c.map(n => {
  1485. // return {
  1486. // mediaType: n.mediaType,
  1487. // sourceType: n.sourceType,
  1488. // title: n.title,
  1489. // url: n.url,
  1490. // processNames: n.processNames,
  1491. // processId: n.processId.split(",")
  1492. // };
  1493. // });
  1494. // this.radioVideo = 2;
  1495. // }
  1496. // });
  1497. } catch (err) {}
  1498. },
  1499. // 新增
  1500. handleAdd() {
  1501. this.type = "add";
  1502. this.ruleForm = {
  1503. studioName: "",
  1504. title: "",
  1505. labelName: "",
  1506. imgUrl: "",
  1507. cover: "",
  1508. introduction: "",
  1509. processesList: [],
  1510. imgUrl: "",
  1511. radioImg: [],
  1512. radioMusic: [],
  1513. radioVideo: [],
  1514. resourcesList: []
  1515. };
  1516. this.dataImg = [];
  1517. this.imgData = [];
  1518. this.musicData = [];
  1519. this.videoData = [];
  1520. this.radioMusic = 1;
  1521. this.radioVideo = 1;
  1522. this.radioImg = 1;
  1523. this.disabled = false;
  1524. this.dialog.title = "新增剧本";
  1525. setTimeout(() => {
  1526. this.dialog.Visible = true;
  1527. }, 500);
  1528. },
  1529. async subMit() {
  1530. // if (this.imgType == true && this.radioImg == 1) {
  1531. // this.$message({
  1532. // message: "请绑定图片相关流程",
  1533. // type: "error"
  1534. // });
  1535. // return false;
  1536. // }
  1537. // if (this.musicType == true && this.radioMusic == 1) {
  1538. // this.$message({
  1539. // message: "请绑定音频相关流程",
  1540. // type: "error"
  1541. // });
  1542. // return false;
  1543. // }
  1544. // if (this.videoType == true && this.radioVideo == 1) {
  1545. // this.$message({
  1546. // message: "请绑定视频相关流程",
  1547. // type: "error"
  1548. // });
  1549. // return false;
  1550. // }
  1551. this.ruleForm.imgUrl = this.dataImg.join(",");
  1552. if (this.radioImg == 1) {
  1553. this.ruleForm.radioImg = this.imgData;
  1554. }
  1555. // if (this.radioMusic == 1) {
  1556. // this.ruleForm.radioMusic = this.musicData;
  1557. // }
  1558. if (this.radioVideo == 1) {
  1559. this.ruleForm.radioVideo = this.videoData;
  1560. }
  1561. let data = this.ruleForm.radioImg //图片,音乐,视频给后端传的值
  1562. .concat(this.ruleForm.radioMusic?this.ruleForm.radioMusic:[])
  1563. .concat(this.musicData)
  1564. .concat(this.ruleForm.radioVideo);
  1565. let a = [];
  1566. let b = this.ruleForm.processesList.map(n => {
  1567. if (n.title != "") {
  1568. a.push(n);
  1569. }
  1570. });
  1571. this.ruleForm.processesList = a.map(n => {
  1572. return {
  1573. title: n.title,
  1574. code: n.code,
  1575. introduction: n.introduction,
  1576. sort: n.sort,
  1577. type:n.type,
  1578. };
  1579. });
  1580. let list = [];
  1581. data.map(n => {
  1582. if (n.url != "") {
  1583. list.push(n);
  1584. }
  1585. });
  1586. this.ruleForm.resourcesList = list.map(n => {
  1587. let type = typeof n.processId;
  1588. var processId = "";
  1589. if (type == "string") {
  1590. processId = n.processId;
  1591. } else if (type == "object") {
  1592. processId = n.processId.join(",");
  1593. }
  1594. return {
  1595. mediaType: n.mediaType,
  1596. sourceType: n.sourceType,
  1597. title: n.title,
  1598. url: n.url,
  1599. processId: processId
  1600. };
  1601. });
  1602. try {
  1603. this.$refs["ruleForm"].validate(async valid => {
  1604. if (valid) {
  1605. if (this.type == "add") {
  1606. // return;
  1607. var res = await addJbInfo(this.ruleForm);
  1608. if (res.code == 200) {
  1609. this.$message.success("新增成功");
  1610. this.dialog.Visible = false;
  1611. this.queryList();
  1612. } else {
  1613. // console.log('新增提交失败');
  1614. // this.$message({
  1615. // message: res.msg,
  1616. // type: "error"
  1617. // });
  1618. }
  1619. } else if (this.type == "edit") {
  1620. var res = await updateJbInfo(this.ruleForm);
  1621. if (res.code == 200) {
  1622. this.$message.success("编辑成功");
  1623. this.dialog.Visible = false;
  1624. this.queryList();
  1625. } else {
  1626. console.log('编辑提交失败');
  1627. this.$message({
  1628. // message: res.msg,
  1629. type: "error"
  1630. });
  1631. }
  1632. }
  1633. }
  1634. });
  1635. } catch (err) {}
  1636. },
  1637. subEsc() {
  1638. this.type = "";
  1639. this.ruleForm = {
  1640. studioName: "",
  1641. title: "",
  1642. labelName: "",
  1643. imgUrl: "",
  1644. cover: "",
  1645. introduction: "",
  1646. processesList: [],
  1647. imgUrl: "",
  1648. radioImg: [],
  1649. radioMusic: [],
  1650. radioVideo: [],
  1651. resourcesList: []
  1652. };
  1653. this.radioImg = 1;
  1654. this.radioMusic = 1;
  1655. this.radioVideo = 1;
  1656. this.dialog.Visible = false;
  1657. },
  1658. dealRdata(attchments, keyname) {
  1659. //attchments:数组,键值
  1660. let list = [...attchments];
  1661. let result = [];
  1662. let obj = {};
  1663. for (let i = 0; i < list.length; i++) {
  1664. if (!obj[list[i][keyname]]) {
  1665. result.push(list[i]);
  1666. obj[list[i].wjDx] = true;
  1667. }
  1668. }
  1669. return result;
  1670. },
  1671. // 编辑
  1672. handleEdit(row) {
  1673. this.queryListDetail(row.id);
  1674. this.type = "edit";
  1675. this.disabled = false;
  1676. this.dialog.title = "编辑剧本";
  1677. setTimeout(() => {
  1678. this.dialog.Visible = true;
  1679. }, 500);
  1680. },
  1681. // 查看
  1682. handleView(row) {
  1683. console.log(this.type, 41231);
  1684. this.type = "view";
  1685. this.dialog.title = "查看剧本";
  1686. console.log(this.type, 41231222);
  1687. this.queryListDetail(row.id);
  1688. this.disabled = true;
  1689. setTimeout(() => {
  1690. this.dialog.Visible = true;
  1691. }, 500);
  1692. },
  1693. // 删除
  1694. async hanDel(row) {
  1695. try {
  1696. await this.$confirm("此操作将永久删除该剧本,是否继续?", "提示", {
  1697. confirmButtonText: "确定",
  1698. cancelButtonText: "取消",
  1699. type: "warning"
  1700. });
  1701. let res = await deleteJbInfo(row.id);
  1702. if (res.code == 200) {
  1703. this.$message.success("删除成功");
  1704. this.queryList();
  1705. } else {
  1706. this.$message({
  1707. message: res.msg,
  1708. type: "error"
  1709. });
  1710. }
  1711. } catch (err) {}
  1712. },
  1713. handleAvatar(res, file, fileList) {
  1714. // console.log(res, file, "整个");
  1715. },
  1716. handleAvatarSuccess(res, file) {
  1717. // console.log(res, file, "成功了吗");
  1718. },
  1719. //上传图片
  1720. async uploadImg(e,file, fileList) {
  1721. console.log('进度',parseInt(e.percent));
  1722. this.loadingCover=true;//显示加载
  1723. // this.jinduCoverNum= parseInt(e.percent);//进度从0开始
  1724. this.jinduCoverNum = Math.floor(e.percent);//进度从0开始
  1725. this.jinduShowCover=true;//显示进度条
  1726. try {
  1727. let formData = new FormData();
  1728. let type = file.raw.type;
  1729. formData.append("file", file.raw);
  1730. formData.append("type", type);
  1731. let res = await uploadFile(formData);
  1732. // this.ruleForm.cover = res.data.wjUrl;
  1733. this.$set(this.ruleForm, "cover", res.data.wjUrl);
  1734. this.loadingCover=false;
  1735. if (this.jinduCoverNum >= 100) {
  1736. this.jinduCoverNum = 100
  1737. setTimeout(() => {
  1738. this.jinduShowCover = false;
  1739. }, 1000) // 一秒后关闭进度条
  1740. }
  1741. // this.successVideo('cover')
  1742. } catch (err) {}
  1743. },
  1744. //其他图片
  1745. changeImgs({ file }) {
  1746. // changeImgs(e,file) {
  1747. // console.log('其他图片进度',parseInt(e.percent));
  1748. this.loadingOtherImg = true; //显示加载
  1749. this.jinduOtherImgNum = 0;//进度条从0开始
  1750. this.jinduShowOtherImg = true; //是否显示进度条
  1751. let formData = new FormData();
  1752. formData.append("file", file);
  1753. formData.append("type", "product");
  1754. uploadFile(formData).then(res => {
  1755. this.dataImg.push(res.data.wjUrl);
  1756. this.loadingOtherImg = false; //显示加载
  1757. this.jinduOtherImgNum = 100;
  1758. if (this.jinduOtherImgNum >= 100) {
  1759. this.jinduOtherImgNum = 100
  1760. setTimeout(() => {
  1761. this.jinduShowOtherImg = false;
  1762. }, 1000) // 一秒后关闭进度条
  1763. }
  1764. });
  1765. },
  1766. beforeAvatarUpload(file) {
  1767. const isJPG = file.type;
  1768. const isLt2M = file.size / 1024 / 1024 < 2;
  1769. if (!isLt2M) {
  1770. this.$message.error("上传头像图片大小不能超过 2MB!");
  1771. }
  1772. return isJPG && isLt2M;
  1773. },
  1774. // 开本流程新增
  1775. handleAddK() {
  1776. //为空不能进行添加
  1777. let list = this.ruleForm.processesList;
  1778. if(list.length!=0){
  1779. if (list[list.length-1].title=="" || list[list.length-1].code=="" ||list[list.length-1].introduction=="" ||list[list.length-1].sort=="" ) {
  1780. this.$message({
  1781. message: '一次只能添加一条',
  1782. type: 'warning'
  1783. });
  1784. return false
  1785. }
  1786. }
  1787. //随机生成4位数函数
  1788. // let thit = this;
  1789. function rand(min, max) {
  1790. // thit.ruleForm.processesList.forEach(item=>{
  1791. // let num = Math.floor(Math.random() * (max - min)) + min;
  1792. // console.log(num);
  1793. // if(item.code == num){
  1794. // rand(1000,9999);
  1795. // }
  1796. // if(item.code != num){
  1797. // return num;
  1798. // }
  1799. // })
  1800. return Math.floor(Math.random() * (max - min)) + min;
  1801. }
  1802. this.ruleForm.processesList.push({
  1803. title: "",
  1804. code: rand(1000,9999),
  1805. introduction: "",
  1806. sort: "",
  1807. type: "5"
  1808. });
  1809. },
  1810. //同步流程
  1811. tongbuliuchen(){
  1812. try{
  1813. //删除图片
  1814. this.imgData.forEach((item,index)=>{
  1815. let imgProcessId=this.imgData[index].processId?this.imgData[index].processId.split(","):[]
  1816. let data=[]
  1817. let name=[]
  1818. if(this.ruleForm.processesList.length<1){ //this.ruleForm.processesList table上的数据
  1819. this.imgData[index].processId=null //this.imgData 图片的关联流程
  1820. this.imgData[index].processNames=null
  1821. }else{
  1822. console.log('else');
  1823. for(let x=0;x<this.ruleForm.processesList.length;x++){ //遍历table有数据
  1824. for(let y=0;y<imgProcessId.length;y++){ //遍历图片关联流程数据
  1825. if(this.ruleForm.processesList[x].code.indexOf(imgProcessId[y])>-1 ){ //如果table上的code在图片的关联数据上,就把图片的关联放到data中
  1826. data.push(imgProcessId[y])
  1827. console.log(data);
  1828. };
  1829. if(this.ruleForm.processesList[x].code==imgProcessId[y]){ //如果图片关联的数据中有table上的code,就把table上的title放到name上
  1830. name.push(this.ruleForm.processesList[x].title)
  1831. console.log(name);
  1832. }
  1833. }
  1834. }
  1835. this.imgData[index].processId=data.join(","); //把data上的数据变成字符串赋值到当前图片的下拉框上
  1836. this.imgData[index].processNames=name.join(',')
  1837. console.log(this.imgData);
  1838. }
  1839. })
  1840. //删除音频
  1841. this.musicData.forEach((item,index)=>{
  1842. let musicProcessId=this.musicData[index].processId?this.musicData[index].processId.split(","):[]
  1843. let data=[]
  1844. let name=[]
  1845. if(this.ruleForm.processesList.length<1){
  1846. this.musicData[index].processId=null
  1847. this.musicData[index].processNames=null
  1848. }else{
  1849. for(let x=0;x<this.ruleForm.processesList.length;x++){
  1850. for(let y=0;y<musicProcessId.length;y++){
  1851. if(this.ruleForm.processesList[x].code.indexOf(musicProcessId[y])>-1 ){
  1852. data.push(musicProcessId[y])
  1853. }
  1854. if(this.ruleForm.processesList[x].code==musicProcessId[y]){
  1855. name.push(this.ruleForm.processesList[x].title)
  1856. }
  1857. }
  1858. this.musicData[index].processId=data.join(",")
  1859. this.musicData[index].processNames=name.join(",")
  1860. }
  1861. }
  1862. })
  1863. //删除视频
  1864. this.videoData.forEach((item,index)=>{
  1865. let videoProcessId=this.videoData[index].processId?this.videoData[index].processId.split(","):[]
  1866. let data=[]
  1867. let name=[]
  1868. if(this.ruleForm.processesList.length<1){
  1869. this.videoData[index].processId=null
  1870. this.videoData[index].processNames=null
  1871. }else{
  1872. for(let x=0;x<this.ruleForm.processesList.length;x++){
  1873. for(let y=0;y<videoProcessId.length;y++){
  1874. if(this.ruleForm.processesList[x].code.indexOf(videoProcessId[y])>-1 ){
  1875. data.push(videoProcessId[y])
  1876. }
  1877. if(this.ruleForm.processesList[x].code==videoProcessId[y]){
  1878. name.push(this.ruleForm.processesList[x].title)
  1879. }
  1880. }
  1881. this.videoData[index].processId=data.join(",")
  1882. this.videoData[index].processNames=name.join(",")
  1883. }
  1884. }
  1885. })
  1886. }catch(err){}
  1887. },
  1888. // 开本流程删除
  1889. Del(index) {
  1890. this.$confirm("此操作将永久删除该剧本流程,是否继续?", "提示", {
  1891. confirmButtonText: "确定",
  1892. cancelButtonText: "取消",
  1893. type: "warning"
  1894. })
  1895. .then(() => {
  1896. console.log('点击删除');
  1897. this.ruleForm.processesList.splice(index, 1),
  1898. this.tongbuliuchen();
  1899. this.$message({
  1900. type: "success",
  1901. message: "删除成功!"
  1902. });
  1903. })
  1904. .catch(() => {
  1905. this.$message({
  1906. type: "error",
  1907. message: "已取消删除"
  1908. });
  1909. });
  1910. },
  1911. // 图片预览
  1912. dialogimg(e) {
  1913. this.dialogVisible = true;
  1914. this.dialogImageUrl = this.ruleForm.imgUrls[e];
  1915. },
  1916. //资源删除
  1917. DelImg(index) {
  1918. this.ruleForm.radioImg.splice(index, 1);
  1919. },
  1920. //网易云删除按钮
  1921. DelMusic(index) {
  1922. // this.ruleForm.radioMusic.splice(index, 1);
  1923. this.$confirm("您确定要删除吗?", "提示", {
  1924. confirmButtonText: "确定",
  1925. cancelButtonText: "取消",
  1926. type: "warning"
  1927. })
  1928. .then(() => {
  1929. this.ruleForm.radioMusic.splice(index, 1);
  1930. this.tongbuliuchen();
  1931. this.$message({
  1932. type: "success",
  1933. message: "删除成功!"
  1934. });
  1935. })
  1936. .catch(() => {
  1937. this.$message({
  1938. type: "error",
  1939. message: "已取消删除"
  1940. });
  1941. });
  1942. },
  1943. DelVideo(index) {
  1944. this.ruleForm.radioVideo.splice(index, 1);
  1945. },
  1946. handleRemove(file) {
  1947. // delFile({ wjUrl: item.url }).then(res => {
  1948. // if (res.code == 200) {
  1949. // this.$message.success("删除成功");
  1950. // }
  1951. // });
  1952. },
  1953. // 图片删除
  1954. deldialogimg(index) {
  1955. this.ruleForm.imgUrls.splice(index, 1);
  1956. var img = this.ruleForm.imgUrl[index];
  1957. // proUpdate({ wjUrl: img }).then((res) => {
  1958. // if (res.code == 200) {
  1959. // that.back();
  1960. // }
  1961. // });
  1962. },
  1963. changeImg(val) {
  1964. this.radioImg = val;
  1965. this.ruleForm.radioImg = [];
  1966. this.imgData = [];
  1967. },
  1968. changeMusic(val) {
  1969. this.radioMusic = val;
  1970. if(this.ruleForm.radioMusic.length<=0){
  1971. this.ruleForm.radioMusic = [];
  1972. }
  1973. // this.musicData = [];
  1974. },
  1975. changeVideo(val) {
  1976. this.radioVideo = val;
  1977. this.ruleForm.radioVideo = [];
  1978. this.videoData = [];
  1979. },
  1980. changePro(type) {
  1981. if (type == "img") {
  1982. this.imgType = false;
  1983. } else if (type == "music") {
  1984. this.musicType = false;
  1985. } else if (type == "video") {
  1986. this.videoType = false;
  1987. }
  1988. },
  1989. //新增图片资源
  1990. handleAddImg() {
  1991. this.ruleForm.radioImg.push({
  1992. title: "",
  1993. url: "",
  1994. processId: [],
  1995. mediaType: 1,
  1996. sourceType: this.radioImg
  1997. });
  1998. if (this.$refs.img.data.length == 0) {
  1999. this.$refs.img.data = this.ruleForm.radioImg;
  2000. }
  2001. },
  2002. //新增网易云新增按钮
  2003. handleAddMusic() {
  2004. // console.log('新增',this.ruleForm.radioMusic);
  2005. // console.log(this);
  2006. // console.log('ruleForm',this.ruleForm);
  2007. // console.log(this.ruleForm.radioMusic);
  2008. // if(this.ruleForm.radioMusic){
  2009. // this.ruleForm.radioMusic = [];
  2010. // }
  2011. if(!Array.isArray(this.ruleForm.radioMusic)){
  2012. this.ruleForm.radioMusic = [];
  2013. }
  2014. let list = this.ruleForm.radioMusic;
  2015. if(list.length!=0){
  2016. if(list[list.length-1].title==''||list[list.length-1].url==''||list[list.length-1].processId==''){
  2017. this.$message.warning('一次只能添加一条')
  2018. return false;
  2019. }
  2020. }
  2021. this.ruleForm.radioMusic.push({
  2022. title: "",
  2023. url: "",
  2024. processId: [],
  2025. mediaType: 2,
  2026. sourceType: this.radioMusic
  2027. });
  2028. if (this.$refs.music.data.length == 0) {
  2029. this.$refs.music.data = this.ruleForm.radioMusic;
  2030. }
  2031. },
  2032. handleAddVideo() {
  2033. this.ruleForm.radioVideo.push({
  2034. title: "",
  2035. url: "",
  2036. processId: [],
  2037. mediaType: 3,
  2038. sourceType: this.radioVideo
  2039. });
  2040. if (this.$refs.video.data.length == 0) {
  2041. this.$refs.video.data = this.ruleForm.radioVideo;
  2042. }
  2043. },
  2044. // 上传资源图片
  2045. labeluploadimg({ file }) {
  2046. // labeluploadimg(e, file ) {
  2047. // console.log('上传资源图片进度',parseInt(e.percent));
  2048. // console.log(file);
  2049. const formdata = new FormData();
  2050. formdata.append("file", file);
  2051. formdata.append("type", "product");
  2052. this.loadingImg = true;
  2053. this.jinduShowImg = true;
  2054. this.jinduImgNum = 0;
  2055. this.radioImg = 1;
  2056. uploadFile(formdata).then(res => {
  2057. this.imgData.push({
  2058. name:res.data.wjCsmc,
  2059. url: res.data.wjUrl,
  2060. processNames: "",
  2061. // title: res.data.wjDx,
  2062. title: '',
  2063. mediaType: 1,
  2064. sourceType: 1
  2065. });
  2066. this.imgType = true;
  2067. this.loadingImg = false;
  2068. this.jinduImgNum = 100;
  2069. if (this.jinduImgNum >= 100) {
  2070. this.jinduImgNum = 100
  2071. setTimeout(() => {
  2072. this.jinduShowImg = false;
  2073. }, 1000) // 一秒后关闭进度条
  2074. }
  2075. });
  2076. },
  2077. //音频
  2078. labeluploadmusic({ file }) {
  2079. // labeluploadmusic(e,file) {
  2080. this.radioMusic = 1;
  2081. this.loadingAudio = true;
  2082. this.jinduShowAudio = true;
  2083. this.jinduAudioNum = 0;
  2084. const formdata = new FormData();
  2085. formdata.append("file", file);
  2086. formdata.append("type", "product");
  2087. uploadFile(formdata).then(res => {
  2088. this.musicData.push({
  2089. url: res.data.wjUrl,
  2090. processNames: "",
  2091. // title: res.data.wjDx,
  2092. title: '',
  2093. mediaType: 2,
  2094. sourceType: 1
  2095. });
  2096. this.jinduAudioNum = 100;
  2097. this.loadingAudio = false;
  2098. this.musicType = true;
  2099. if (this.jinduAudioNum >= 100) {
  2100. this.jinduAudioNum = 100
  2101. setTimeout(() => {
  2102. this.jinduShowAudio = false;
  2103. }, 1000) // 一秒后关闭进度条
  2104. }
  2105. });
  2106. },
  2107. //视频
  2108. labeluploadvideo({ file }) {
  2109. // labeluploadvideo( e,file ) {
  2110. this.jinduVideoNum = 0;
  2111. this.loading = true;
  2112. this.radioVideo = 1;
  2113. this.jinduShowVideo = true;
  2114. // console.log(file.raw, 'file.rawfile.rawfile.raw');
  2115. // this.jinduVideoNum = 0;
  2116. const formdata = new FormData();
  2117. formdata.append("file", file);
  2118. formdata.append("type", "product");
  2119. uploadFile(formdata).then(res => {
  2120. console.log(res);
  2121. this.videoData.push({
  2122. url: res.data.wjUrl,
  2123. processNames: "",
  2124. // title: res.data.wjDx,
  2125. title: '',
  2126. mediaType: 3,
  2127. sourceType: 1
  2128. });
  2129. this.jinduVideoNum = 100;
  2130. this.loading = false; //取消加载
  2131. this.radioType = true;
  2132. if (this.jinduVideoNum >= 100) {
  2133. this.jinduVideoNum = 100
  2134. setTimeout(() => {
  2135. this.jinduShowVideo = false;
  2136. }, 1000) // 一秒后关闭进度条
  2137. }
  2138. })
  2139. },
  2140. delDataImg(item, index) {
  2141. this.$confirm("此操作将永久删除图片,是否继续?", "提示", {
  2142. confirmButtonText: "确定",
  2143. cancelButtonText: "取消",
  2144. type: "warning"
  2145. })
  2146. .then(() => {
  2147. this.dataImg.splice(index, 1);
  2148. delFile({ wjUrl: item }).then(res => {
  2149. if (res.code == 200) {
  2150. this.$message.success("删除成功");
  2151. }
  2152. });
  2153. this.$message({
  2154. type: "success",
  2155. message: "删除成功!"
  2156. });
  2157. })
  2158. .catch(() => {
  2159. this.$message({
  2160. type: "error",
  2161. message: "已取消删除"
  2162. });
  2163. });
  2164. },
  2165. // 图片删除
  2166. deldialogimg(item, index, type) {
  2167. this.$confirm("此您确定要删除吗,是否继续?", "提示", {
  2168. confirmButtonText: "确定",
  2169. cancelButtonText: "取消",
  2170. type: "warning"
  2171. })
  2172. .then(() => {
  2173. switch (type) {
  2174. case "img":
  2175. this.imgData.splice(index, 1);
  2176. break;
  2177. case "music":
  2178. this.musicData.splice(index, 1);
  2179. break;
  2180. case "video":
  2181. this.videoData.splice(index, 1);
  2182. break;
  2183. default:
  2184. break;
  2185. }
  2186. delFile({ wjUrl: item.url }).then(res => {
  2187. if (res.code == 200) {
  2188. this.$message.success("删除成功");
  2189. }
  2190. });
  2191. })
  2192. .catch(() => {
  2193. this.$message({
  2194. type: "error",
  2195. message: "已取消删除"
  2196. });
  2197. });
  2198. },
  2199. //关联流程
  2200. setLc(item, i, type) {
  2201. if (this.ruleForm.processesList.length == 0) {
  2202. this.$message({
  2203. message: "请新建流程",
  2204. type: "error"
  2205. });
  2206. return false;
  2207. }
  2208. if (type == "img") {
  2209. this.liuChengLeixingType = 'img'
  2210. this.imgIndex = i;
  2211. console.log('musicIndex',this.imgIndex);
  2212. try{
  2213. if(this.imgData[i].processNames == ''){
  2214. this.processId = "";
  2215. }else{
  2216. // this.processId = this.imgData[i].processId.split(',') //数组
  2217. let processId = this.imgData[i].processId.split(',') //数组
  2218. //图片添加的时候下拉多选框回显
  2219. this.ruleForm.resourcesList.forEach(item=>{
  2220. if(item.processId == processId) {
  2221. this.processId = processId;
  2222. }
  2223. })
  2224. }
  2225. }catch(err){}
  2226. } else if (type == "music") {
  2227. this.liuChengLeixingType = 'music'
  2228. this.musicIndex = i;
  2229. console.log('musicIndex',this.musicIndex);
  2230. try{
  2231. if(this.musicData[i].processNames == ''){
  2232. this.processId = "";
  2233. }else{
  2234. // this.processId = this.musicData[i].processId.split(',')
  2235. let processId = this.musicData[i].processId.split(',')
  2236. //音频添加的时候下拉多选框回显
  2237. this.ruleForm.resourcesList.forEach(item=>{
  2238. if(item.processId == processId) {
  2239. this.processId = processId;
  2240. }
  2241. })
  2242. }
  2243. }catch(err){}
  2244. } else if (type == "video") {
  2245. this.liuChengLeixingType = 'video'
  2246. this.videoIndex = i;
  2247. console.log('videoIndex',this.videoIndex);
  2248. try{
  2249. if(this.videoData[i].processNames == ''){
  2250. this.processId = "";
  2251. }else{
  2252. // this.processId = this.videoData[i].processId.split(',')
  2253. let processId = this.videoData[i].processId.split(',')
  2254. //视频添加的时候下拉多选框回显
  2255. this.ruleForm.resourcesList.forEach(item=>{
  2256. if(item.processId == processId) {
  2257. this.processId = processId;
  2258. }
  2259. })
  2260. }
  2261. }catch(err){}
  2262. }
  2263. this.list = item;
  2264. this.typeUrl = type;
  2265. if(this.dialog.title == "新增剧本"){
  2266. this.processId = "";
  2267. }
  2268. this.process.Visible = true;
  2269. },
  2270. subMitLc() {
  2271. this.process.Visible = false;
  2272. if (this.typeUrl == "img") {
  2273. this.imgType = false;
  2274. var tmp = [];
  2275. for (var i = 0; i < this.ruleForm.processesList.length; i++) {
  2276. for (var s = 0; s < this.processId.length; s++) {
  2277. if (this.ruleForm.processesList[i].code == this.processId[s]) {
  2278. tmp.push(this.ruleForm.processesList[i].title);
  2279. }
  2280. }
  2281. }
  2282. this.imgData[this.imgIndex].processNames = tmp.join(",");
  2283. this.imgData[this.imgIndex].processId = this.processId.join(',');
  2284. this.imgData[this.imgIndex].mediaType = 1;
  2285. this.imgData[this.imgIndex].sourceType = this.radioImg;
  2286. this.imgData[this.imgIndex].title = this.imgTitle;
  2287. }
  2288. if (this.typeUrl == "music") {
  2289. this.musicType = false;
  2290. var tmp = [];
  2291. for (var i = 0; i < this.ruleForm.processesList.length; i++) {
  2292. for (var s = 0; s < this.processId.length; s++) {
  2293. if (this.ruleForm.processesList[i].code == this.processId[s]) {
  2294. tmp.push(this.ruleForm.processesList[i].title);
  2295. }
  2296. }
  2297. }
  2298. this.musicData[this.musicIndex].processNames = tmp.join(",");
  2299. this.musicData[this.musicIndex].processId = this.processId.join(',');
  2300. this.musicData[this.musicIndex].mediaType = 2;
  2301. this.musicData[this.musicIndex].sourceType = this.radioMusic;
  2302. this.musicData[this.musicIndex].title = this.audioTitle;
  2303. }
  2304. if (this.typeUrl == "video") {
  2305. this.videoType = false;
  2306. var tmp = [];
  2307. for (var i = 0; i < this.ruleForm.processesList.length; i++) {
  2308. for (var s = 0; s < this.processId.length; s++) {
  2309. if (this.ruleForm.processesList[i].code == this.processId[s]) {
  2310. tmp.push(this.ruleForm.processesList[i].title);
  2311. }
  2312. }
  2313. }
  2314. this.videoData[this.videoIndex].processNames = tmp.join(",");
  2315. this.videoData[this.videoIndex].processId = this.processId.join(',');
  2316. this.videoData[this.videoIndex].mediaType = 3;
  2317. this.videoData[this.videoIndex].sourceType = this.radioVideo;
  2318. this.videoData[this.videoIndex].title = this.videoTitle;
  2319. }
  2320. },
  2321. prevent(e) {
  2322. var keynum = window.event ? e.keyCode : e.which; //获取键盘码
  2323. if (keynum == 189 || keynum == 190 || keynum == 109 || keynum == 110) {
  2324. this.$message.warning("禁止输入小数以及负数");
  2325. e.target.value = "";
  2326. }
  2327. },
  2328. //查看视频
  2329. // handleView(item) {
  2330. // console.log(item, "视频地址");
  2331. // }
  2332. }
  2333. };
  2334. </script>
  2335. <style scoped>
  2336. .content {
  2337. background: #fff;
  2338. margin-top: 15px;
  2339. }
  2340. .add-button {
  2341. margin-top: 15px;
  2342. }
  2343. /deep/ .el-input__inner {
  2344. height: 30px;
  2345. }
  2346. .search-button {
  2347. display: flex;
  2348. }
  2349. .form-title {
  2350. margin-left: 30px;
  2351. padding-bottom: 10px;
  2352. border-bottom: 1px solid #000;
  2353. }
  2354. /deep/ .avatar-uploader .el-upload {
  2355. border: 1px dashed #000;
  2356. border-radius: 6px;
  2357. cursor: pointer;
  2358. position: relative;
  2359. overflow: hidden;
  2360. }
  2361. /deep/ .avatar-uploader .el-upload:hover {
  2362. border-color: #409eff;
  2363. }
  2364. /deep/ input::-webkit-outer-spin-button,
  2365. /deep/ input::-webkit-inner-spin-button {
  2366. -webkit-appearance: none !important;
  2367. }
  2368. /deep/ input[type="number"] {
  2369. -moz-appearance: textfield !important;
  2370. }
  2371. .avatar-uploader-icon {
  2372. font-size: 28px;
  2373. color: #8c939d;
  2374. /* width: 178px;
  2375. height: 178px;
  2376. line-height: 178px; */
  2377. text-align: center;
  2378. }
  2379. .avatar {
  2380. width: 178px;
  2381. height: 178px;
  2382. display: block;
  2383. }
  2384. .urlTable /deep/ .el-form-item__content {
  2385. width: 100%;
  2386. }
  2387. </style>
  2388. <style lang="scss" scope>
  2389. .imgdata {
  2390. position: relative;
  2391. // display: inline-block;
  2392. float: left;
  2393. margin-left: 60px;
  2394. .imgdialog {
  2395. width: 146px;
  2396. height: 146px;
  2397. display: none;
  2398. position: absolute;
  2399. background: rgba(127, 127, 127, 0.5);
  2400. top: 0;
  2401. left: 0;
  2402. justify-content: space-between;
  2403. align-content: center;
  2404. p {
  2405. margin: auto;
  2406. i {
  2407. cursor: pointer;
  2408. color: white;
  2409. }
  2410. }
  2411. }
  2412. }
  2413. .imgdata:hover .imgdialog {
  2414. display: flex !important;
  2415. }
  2416. .audioUpload {
  2417. .el-form-item__content {
  2418. display: flex;
  2419. // flex-direction: column-reverse;
  2420. flex-wrap: wrap;
  2421. .imgdata {
  2422. margin-top: 20px;
  2423. }
  2424. }
  2425. }
  2426. .videoUpload {
  2427. .el-form-item__content {
  2428. margin-left: 100px;
  2429. display: flex;
  2430. // flex-direction: column-reverse;
  2431. flex-wrap: wrap;
  2432. .imgdata {
  2433. margin-top: 20px;
  2434. display: block !important;
  2435. flex-wrap: nowrap;
  2436. }
  2437. }
  2438. }
  2439. </style>