projectProcess.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  1. <template>
  2. <!-- 项目安排 -->
  3. <div class="pb_content">
  4. <div class="race_content_body">
  5. <div class="raceBox">
  6. <div class="stepBg">
  7. <div
  8. class="steps"
  9. v-for="(sta, staIndex) in racePro.stageBox"
  10. :key="staIndex"
  11. >
  12. <div>
  13. <img src="../../../../assets/icon/race/progress.png" alt="" />
  14. </div>
  15. <div class="stepRightNav" @click="jump('jd' + staIndex + 1)">
  16. <div>阶段{{ staIndex + 1 }}</div>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="right">
  21. <div v-for="(sa, saIndex) in racePro.stageBox" :key="saIndex" :id="'jd' + saIndex + 1">
  22. <div class="jdTop">
  23. <div class="jdTopFirst">
  24. <div class="right_title">
  25. 阶段{{ saIndex + 1 }}
  26. </div>
  27. <el-input
  28. v-model="sa.staTitle"
  29. @input="upRacePro"
  30. placeholder="阶段标题"
  31. ></el-input>
  32. </div>
  33. <div class="jdTopFirst">
  34. <div>总课时</div>
  35. <el-input
  36. v-model="sa.allTime"
  37. @input="upRacePro"
  38. placeholder="请输入阶段总课时"
  39. ></el-input>
  40. </div>
  41. </div>
  42. <div
  43. class="raceProBox"
  44. v-for="(race, raIndex) in sa.actBox"
  45. :key="raIndex"
  46. >
  47. <div class="raceTop allBox">
  48. <div style="color: #a1a4a8; font-size: 18px">
  49. 任务{{ raIndex + 1 }}
  50. </div>
  51. <div class="titleTop">
  52. <div class="leftBox"></div>
  53. <div class="hdName">任务名称</div>
  54. <div style="width: 58%">
  55. <el-input
  56. v-model="race.actName"
  57. placeholder="输入任务名称"
  58. @input="upRacePro"
  59. ></el-input>
  60. </div>
  61. <div
  62. style="
  63. display: flex;
  64. flex-direction: row;
  65. flex-wrap: nowrap;
  66. align-items: center;
  67. margin-left: 10px;
  68. "
  69. >
  70. <div style="min-width: 45px">课时</div>
  71. <el-input
  72. v-model="race.actTime"
  73. placeholder="输入任务名称"
  74. @input="upRacePro"
  75. ></el-input>
  76. </div>
  77. <div
  78. class="remove"
  79. v-if="racePro.stageBox[saIndex].actBox.length > 1"
  80. @click="deleteTask(raIndex)"
  81. style="position: absolute; right: 0"
  82. ></div>
  83. </div>
  84. </div>
  85. <div class="raceTop allBox">
  86. <div class="lineBox">
  87. <div class="lineTitle">活动目标</div>
  88. <div class="strLine"></div>
  89. </div>
  90. <div class="editorCss">
  91. <editor-bar
  92. v-model="race.driQuestion.brief"
  93. @change="upRacePro"
  94. ></editor-bar>
  95. </div>
  96. <!-- <div>
  97. <div class="basic_box">
  98. <div class="lineBox">
  99. <div class="lineTitleTwo">资料补充</div>
  100. <div class="strLine"></div>
  101. </div>
  102. <div>
  103. <div
  104. class="add_chapters_box"
  105. v-if="
  106. race.driQuestion.data &&
  107. race.driQuestion.data.length == 0
  108. "
  109. style="height: 185px"
  110. ></div>
  111. <div
  112. v-else
  113. class="add_chapters_box"
  114. style="display: flex; flex-direction: column"
  115. >
  116. <div
  117. class="chapter_upload"
  118. v-for="(item, index) in race.driQuestion.data"
  119. :key="item.id"
  120. >
  121. <div class="chapter_upload_t"></div>
  122. <div class="chapter_upload_o">
  123. <div class="chapter_upload_l">
  124. <div
  125. v-if="item.type == 2"
  126. class="chapter_upload_l_i1"
  127. ></div>
  128. <div
  129. v-if="item.type == 1 || item.type == 3"
  130. class="chapter_upload_l_i5"
  131. ></div>
  132. </div>
  133. <div class="chapter_upload_ic">
  134. <div class="chapter_upload_ic_l"></div>
  135. <div
  136. class="chapter_upload_ic_r"
  137. @click.stop="
  138. deleteChapterData(
  139. $event,
  140. sindex,
  141. index,
  142. raIndex,
  143. 0
  144. )
  145. "
  146. >
  147. <div></div>
  148. </div>
  149. </div>
  150. <div class="chapter_upload_n">
  151. <input
  152. class="first"
  153. v-if="item.type == 1 || item.type == 3"
  154. :placeholder="item.name"
  155. />
  156. <input
  157. class="first"
  158. v-if="item.type == 2"
  159. :placeholder="item.name"
  160. />
  161. <div class="chapter_upload_ud">
  162. <div class="chapter_upload_up"></div>
  163. <div class="chapter_upload_down"></div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="add_info_box">
  171. <button class="info_btn" @click="addImg($event)">
  172. 上传附件
  173. <input
  174. type="file"
  175. accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
  176. style="display: none"
  177. @change="
  178. beforeUpload($event, null, saIndex, raIndex, 0)
  179. "
  180. />
  181. </button>
  182. </div>
  183. <div v-if="race.driQuestion.data.proVisible" class="mask">
  184. <div class="progressBox">
  185. <div class="lbox">
  186. <img
  187. src="../../../../assets/loading.gif"
  188. />上传中,请稍后
  189. </div>
  190. <el-progress
  191. :text-inside="true"
  192. :stroke-width="20"
  193. :percentage="
  194. race.driQuestion.data.progress
  195. ? race.driQuestion.data.progress
  196. : 0
  197. "
  198. style="width: 80%"
  199. ></el-progress>
  200. </div>
  201. </div>
  202. </div>
  203. </div> -->
  204. </div>
  205. <div class="raceTop allBox">
  206. <div class="lineBox">
  207. <div class="lineTitle">活动内容</div>
  208. <div class="strLine"></div>
  209. </div>
  210. <div class="editorCss">
  211. <editor-bar
  212. v-model="race.tarDesign.brief"
  213. @change="upRacePro"
  214. ></editor-bar>
  215. </div>
  216. <!-- <div>
  217. <div class="basic_box">
  218. <div class="lineBox">
  219. <div class="lineTitleTwo">资料补充</div>
  220. <div class="strLine"></div>
  221. </div>
  222. <div>
  223. <div
  224. class="add_chapters_box"
  225. v-if="
  226. race.tarDesign.data && race.tarDesign.data.length == 0
  227. "
  228. style="height: 185px"
  229. ></div>
  230. <div
  231. v-else
  232. class="add_chapters_box"
  233. style="display: flex; flex-direction: column"
  234. >
  235. <div
  236. class="chapter_upload"
  237. v-for="(item, index) in race.tarDesign.data"
  238. :key="item.id"
  239. >
  240. <div class="chapter_upload_t"></div>
  241. <div class="chapter_upload_o">
  242. <div class="chapter_upload_l">
  243. <div
  244. v-if="item.type == 2"
  245. class="chapter_upload_l_i1"
  246. ></div>
  247. <div
  248. v-if="item.type == 1 || item.type == 3"
  249. class="chapter_upload_l_i5"
  250. ></div>
  251. </div>
  252. <div class="chapter_upload_ic">
  253. <div class="chapter_upload_ic_l"></div>
  254. <div
  255. class="chapter_upload_ic_r"
  256. @click.stop="
  257. deleteChapterData(
  258. $event,
  259. sindex,
  260. index,
  261. raIndex,
  262. 1
  263. )
  264. "
  265. >
  266. <div></div>
  267. </div>
  268. </div>
  269. <div class="chapter_upload_n">
  270. <input
  271. class="first"
  272. v-if="item.type == 1 || item.type == 3"
  273. :placeholder="item.name"
  274. />
  275. <input
  276. class="first"
  277. v-if="item.type == 2"
  278. :placeholder="item.name"
  279. />
  280. <div class="chapter_upload_ud">
  281. <div class="chapter_upload_up"></div>
  282. <div class="chapter_upload_down"></div>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. <div class="add_info_box">
  290. <button class="info_btn" @click="addImg($event)">
  291. 上传附件
  292. <input
  293. type="file"
  294. accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
  295. style="display: none"
  296. @change="
  297. beforeUpload($event, null, saIndex, raIndex, 1)
  298. "
  299. />
  300. </button>
  301. </div>
  302. <div v-if="race.tarDesign.data.proVisible" class="mask">
  303. <div class="progressBox">
  304. <div class="lbox">
  305. <img
  306. src="../../../../assets/loading.gif"
  307. />上传中,请稍后
  308. </div>
  309. <el-progress
  310. :text-inside="true"
  311. :stroke-width="20"
  312. :percentage="
  313. race.tarDesign.data.progress
  314. ? race.tarDesign.data.progress
  315. : 0
  316. "
  317. style="width: 80%"
  318. ></el-progress>
  319. </div>
  320. </div>
  321. </div>
  322. </div> -->
  323. </div>
  324. <div class="raceTop allBox">
  325. <div class="lineBox">
  326. <div class="lineTitle">预期成果</div>
  327. <div class="strLine"></div>
  328. </div>
  329. <div class="editorCss">
  330. <editor-bar
  331. v-model="race.actiDesign.brief"
  332. @change="upRacePro"
  333. ></editor-bar>
  334. </div>
  335. <!-- <div>
  336. <div class="basic_box">
  337. <div class="lineBox">
  338. <div class="lineTitleTwo">资料补充</div>
  339. <div class="strLine"></div>
  340. </div>
  341. <div>
  342. <div
  343. class="add_chapters_box"
  344. v-if="
  345. race.actiDesign.data &&
  346. race.actiDesign.data.length == 0
  347. "
  348. style="height: 185px"
  349. ></div>
  350. <div
  351. v-else
  352. class="add_chapters_box"
  353. style="display: flex; flex-direction: column"
  354. >
  355. <div
  356. class="chapter_upload"
  357. v-for="(item, index) in race.actiDesign.data"
  358. :key="item.id"
  359. >
  360. <div class="chapter_upload_t"></div>
  361. <div class="chapter_upload_o">
  362. <div class="chapter_upload_l">
  363. <div
  364. v-if="item.type == 2"
  365. class="chapter_upload_l_i1"
  366. ></div>
  367. <div
  368. v-if="item.type == 1 || item.type == 3"
  369. class="chapter_upload_l_i5"
  370. ></div>
  371. </div>
  372. <div class="chapter_upload_ic">
  373. <div class="chapter_upload_ic_l"></div>
  374. <div
  375. class="chapter_upload_ic_r"
  376. @click.stop="
  377. deleteChapterData(
  378. $event,
  379. sindex,
  380. index,
  381. raIndex,
  382. 2
  383. )
  384. "
  385. >
  386. <div></div>
  387. </div>
  388. </div>
  389. <div class="chapter_upload_n">
  390. <input
  391. class="first"
  392. v-if="item.type == 1 || item.type == 3"
  393. :placeholder="item.name"
  394. />
  395. <input
  396. class="first"
  397. v-if="item.type == 2"
  398. :placeholder="item.name"
  399. />
  400. <div class="chapter_upload_ud">
  401. <div class="chapter_upload_up"></div>
  402. <div class="chapter_upload_down"></div>
  403. </div>
  404. </div>
  405. </div>
  406. </div>
  407. </div>
  408. </div>
  409. <div class="add_info_box">
  410. <button class="info_btn" @click="addImg($event)">
  411. 上传附件
  412. <input
  413. type="file"
  414. accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
  415. style="display: none"
  416. @change="
  417. beforeUpload($event, null, saIndex, raIndex, 2)
  418. "
  419. />
  420. </button>
  421. </div>
  422. <div v-if="race.actiDesign.data.proVisible" class="mask">
  423. <div class="progressBox">
  424. <div class="lbox">
  425. <img
  426. src="../../../../assets/loading.gif"
  427. />上传中,请稍后
  428. </div>
  429. <el-progress
  430. :text-inside="true"
  431. :stroke-width="20"
  432. :percentage="
  433. race.actiDesign.data.progress
  434. ? race.actiDesign.data.progress
  435. : 0
  436. "
  437. style="width: 80%"
  438. ></el-progress>
  439. </div>
  440. </div>
  441. </div>
  442. </div> -->
  443. </div>
  444. <div class="raceTop allBox">
  445. <div class="lineBox">
  446. <div class="lineTitle">活动评价</div>
  447. <div class="strLine"></div>
  448. </div>
  449. <div class="editorCss">
  450. <editor-bar
  451. v-model="race.evaDesign.brief"
  452. @change="upRacePro"
  453. ></editor-bar>
  454. </div>
  455. <!-- <div>
  456. <div class="basic_box">
  457. <div class="lineBox">
  458. <div class="lineTitleTwo">资料补充</div>
  459. <div class="strLine"></div>
  460. </div>
  461. <div>
  462. <div
  463. class="add_chapters_box"
  464. v-if="
  465. race.evaDesign.data && race.evaDesign.data.length == 0
  466. "
  467. style="height: 185px"
  468. ></div>
  469. <div
  470. v-else
  471. class="add_chapters_box"
  472. style="display: flex; flex-direction: column"
  473. >
  474. <div
  475. class="chapter_upload"
  476. v-for="(item, index) in race.evaDesign.data"
  477. :key="item.id"
  478. >
  479. <div class="chapter_upload_t"></div>
  480. <div class="chapter_upload_o">
  481. <div class="chapter_upload_l">
  482. <div
  483. v-if="item.type == 2"
  484. class="chapter_upload_l_i1"
  485. ></div>
  486. <div
  487. v-if="item.type == 1 || item.type == 3"
  488. class="chapter_upload_l_i5"
  489. ></div>
  490. </div>
  491. <div class="chapter_upload_ic">
  492. <div class="chapter_upload_ic_l"></div>
  493. <div
  494. class="chapter_upload_ic_r"
  495. @click.stop="
  496. deleteChapterData(
  497. $event,
  498. sindex,
  499. index,
  500. raIndex,
  501. 3
  502. )
  503. "
  504. >
  505. <div></div>
  506. </div>
  507. </div>
  508. <div class="chapter_upload_n">
  509. <input
  510. class="first"
  511. v-if="item.type == 1 || item.type == 3"
  512. :placeholder="item.name"
  513. />
  514. <input
  515. class="first"
  516. v-if="item.type == 2"
  517. :placeholder="item.name"
  518. />
  519. <div class="chapter_upload_ud">
  520. <div class="chapter_upload_up"></div>
  521. <div class="chapter_upload_down"></div>
  522. </div>
  523. </div>
  524. </div>
  525. </div>
  526. </div>
  527. </div>
  528. <div class="add_info_box">
  529. <button class="info_btn" @click="addImg($event)">
  530. 上传附件
  531. <input
  532. type="file"
  533. accept="application/pdf, application/.ppt, .ppt, .pptx, .xlsx, .xls, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document,video/mp4, video/quicktime, video/x-msvideo,image/*"
  534. style="display: none"
  535. @change="
  536. beforeUpload($event, null, saIndex, raIndex, 3)
  537. "
  538. />
  539. </button>
  540. </div>
  541. <div v-if="race.evaDesign.data.proVisible" class="mask">
  542. <div class="progressBox">
  543. <div class="lbox">
  544. <img
  545. src="../../../../assets/loading.gif"
  546. />上传中,请稍后
  547. </div>
  548. <el-progress
  549. :text-inside="true"
  550. :stroke-width="20"
  551. :percentage="
  552. race.evaDesign.data.progress
  553. ? race.evaDesign.data.progress
  554. : 0
  555. "
  556. style="width: 80%"
  557. ></el-progress>
  558. </div>
  559. </div>
  560. </div>
  561. </div> -->
  562. </div>
  563. <div
  564. class="addTaskBorder"
  565. @click="addTaskBorder(saIndex)"
  566. v-if="raIndex == racePro.stageBox[saIndex].actBox.length - 1"
  567. >
  568. <div>
  569. <img src="../../../../assets/icon/addHw.png" alt />
  570. <span>添加任务</span>
  571. </div>
  572. </div>
  573. </div>
  574. <div
  575. class="addTaskBorder"
  576. @click="addStageBorder()"
  577. v-if="saIndex == racePro.stageBox.length - 1"
  578. >
  579. <div>
  580. <img src="../../../../assets/icon/addHw.png" alt />
  581. <span>添加阶段</span>
  582. </div>
  583. </div>
  584. </div>
  585. </div>
  586. </div>
  587. </div>
  588. </div>
  589. </template>
  590. <script>
  591. import EditorBar from "../../../tools/wangEnduit";
  592. export default {
  593. components: { EditorBar },
  594. props: ["raceProcess"],
  595. data() {
  596. return {
  597. racePro: {
  598. stageBox: [
  599. {
  600. staTitle: "",
  601. allTime: "",
  602. brief: "",
  603. data: [],
  604. actBox: [
  605. {
  606. actName: "",
  607. actTime: "",
  608. driQuestion: { brief: "", data: [] },
  609. tarDesign: { brief: "", data: [] },
  610. actiDesign: { brief: "", data: [] },
  611. evaDesign: { brief: "", data: [] },
  612. },
  613. ],
  614. },
  615. ],
  616. },
  617. };
  618. },
  619. methods: {
  620. change(val) {
  621. console.log(val);
  622. },
  623. addImg(e) {
  624. var el = e.currentTarget;
  625. el.getElementsByTagName("input")[0].click();
  626. },
  627. jump(t) {
  628. var a = document.getElementById(t);
  629. var b = document.getElementsByClassName("right")[0];
  630. b.scrollTop = a.offsetTop;
  631. },
  632. getChapterData(e, i, j, ic, type) {
  633. e.stopPropagation();
  634. if ((type == 2 || type == 3) && e.target.tagName !== "INPUT") {
  635. console.log("还不能下载图片喔");
  636. }
  637. },
  638. time() {
  639. if (!this.now) {
  640. this.now = new Date().getTime();
  641. return true;
  642. } else {
  643. let time = new Date().getTime();
  644. if (time - this.now > 3000) {
  645. this.now = time;
  646. return true;
  647. } else {
  648. return false;
  649. }
  650. }
  651. },
  652. upRacePro() {
  653. this.$emit("upRacePro", this.racePro);
  654. },
  655. deleteChapterData(e, si, i, j, t) {
  656. e.stopPropagation();
  657. if (t == 0) {
  658. this.racePro.stageBox[si].actBox[j].driQuestion.data.splice(i, 1);
  659. } else if (t == 1) {
  660. this.racePro.stageBox[si].actBox[j].tarDesign.data.splice(i, 1);
  661. } else if (t == 2) {
  662. this.racePro.stageBox[si].actBox[j].actiDesign.data.splice(i, 1);
  663. } else {
  664. this.racePro.stageBox[si].actBox[j].evaDesign.data.splice(i, 1);
  665. }
  666. this.upRacePro();
  667. },
  668. imgChange(file, fileList, type, sindex, index, jT) {
  669. if (jT == 0) {
  670. var _tmp = this.racePro.stageBox[sindex].actBox[index].driQuestion.data;
  671. } else if (jT == 1) {
  672. var _tmp = this.racePro.stageBox[sindex].actBox[index].tarDesign.data;
  673. } else if (jT == 2) {
  674. var _tmp = this.racePro.stageBox[sindex].actBox[index].actiDesign.data;
  675. } else {
  676. var _tmp = this.racePro.stageBox[sindex].actBox[index].evaDesign.data;
  677. }
  678. this.noneBtnImg = _tmp.length >= 1;
  679. },
  680. beforeUpload(event, type, sindex, index, jsonType) {
  681. var file = event.target.files[0];
  682. var credentials = {
  683. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  684. secretAccessKey: "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",
  685. }; //秘钥形式的登录上传
  686. window.AWS.config.update(credentials);
  687. window.AWS.config.region = "cn-northwest-1"; //设置区域
  688. var type1 = type;
  689. var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
  690. var _this = this;
  691. var b = [
  692. "DOC",
  693. "DOCX",
  694. "DOCM",
  695. "DOTM",
  696. "DOTX",
  697. "PPTX",
  698. "PPSX",
  699. "PPT",
  700. "PPS",
  701. "PPTM",
  702. "POTM",
  703. "PPAM",
  704. "POTX",
  705. "PPSM",
  706. ];
  707. var c = ["PDF", "DOT", "DOC", "DOCX", "PPT", "PPTX", "XLSX", "XLS"];
  708. var d = [
  709. "BMP",
  710. "PJP",
  711. "APNG",
  712. "PNG",
  713. "JPG",
  714. "GIF",
  715. "SVG",
  716. "JPEG",
  717. "JPG",
  718. "ICO",
  719. "PGPEG",
  720. "AVIF",
  721. ];
  722. if (
  723. b.indexOf(
  724. file.name
  725. .split(".")
  726. [file.name.split(".").length - 1].toLocaleUpperCase()
  727. ) != -1
  728. ) {
  729. if (file.size / 1024 / 1024 > 10) {
  730. this.$message.error("上传文件大于10兆,请重新选择文件!");
  731. return;
  732. }
  733. } else if (
  734. file.name
  735. .split(".")
  736. [file.name.split(".").length - 1].toLocaleUpperCase() != "PDF"
  737. ) {
  738. if (file.size / 1024 / 1024 > 5) {
  739. this.$message.error("添加成上传文件大于5兆,请重新选择文件!");
  740. return;
  741. }
  742. }
  743. if (
  744. c.indexOf(
  745. file.name
  746. .split(".")
  747. [file.name.split(".").length - 1].toLocaleUpperCase()
  748. ) != -1
  749. ) {
  750. type1 = 1;
  751. } else if (
  752. d.indexOf(
  753. file.name
  754. .split(".")
  755. [file.name.split(".").length - 1].toLocaleUpperCase()
  756. ) != -1
  757. ) {
  758. type1 = 3;
  759. } else {
  760. type1 = 2;
  761. }
  762. if (jsonType == 0) {
  763. _this.racePro.stageBox[sindex].actBox[
  764. index
  765. ].driQuestion.data.progress = 0;
  766. _this.racePro.stageBox[sindex].actBox[
  767. index
  768. ].driQuestion.data.proVisible = true;
  769. } else if (jsonType == 1) {
  770. _this.racePro.stageBox[sindex].actBox[
  771. index
  772. ].tarDesign.data.progress = 0;
  773. _this.racePro.stageBox[sindex].actBox[
  774. index
  775. ].tarDesign.data.proVisible = true;
  776. } else if (jsonType == 2) {
  777. _this.racePro.stageBox[sindex].actBox[
  778. index
  779. ].actiDesign.data.progress = 0;
  780. _this.racePro.stageBox[sindex].actBox[
  781. index
  782. ].actiDesign.data.proVisible = true;
  783. } else {
  784. _this.racePro.stageBox[sindex].actBox[
  785. index
  786. ].evaDesign.data.progress = 0;
  787. _this.racePro.stageBox[sindex].actBox[
  788. index
  789. ].evaDesign.data.proVisible = true;
  790. }
  791. if (file) {
  792. var params = {
  793. Key:
  794. file.name.split(".")[0] +
  795. new Date().getTime() +
  796. "." +
  797. file.name.split(".")[file.name.split(".").length - 1],
  798. ContentType: file.type,
  799. Body: file,
  800. "Access-Control-Allow-Credentials": "*",
  801. ACL: "public-read",
  802. }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
  803. var options = {
  804. partSize: 2048 * 1024 * 1024,
  805. queueSize: 2,
  806. leavePartsOnError: true,
  807. };
  808. bucket
  809. .upload(params, options)
  810. .on("httpUploadProgress", function (evt) {
  811. //这里可以写进度条
  812. // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
  813. if (jsonType == 0) {
  814. _this.racePro.stageBox[sindex].actBox[
  815. index
  816. ].driQuestion.data.progress = parseInt(
  817. (evt.loaded * 80) / evt.total
  818. );
  819. } else if (jsonType == 1) {
  820. _this.racePro.stageBox[sindex].actBox[
  821. index
  822. ].tarDesign.data.progress = parseInt(
  823. (evt.loaded * 80) / evt.total
  824. );
  825. } else if (jsonType == 2) {
  826. _this.racePro.stageBox[sindex].actBox[
  827. index
  828. ].actiDesign.data.progress = parseInt(
  829. (evt.loaded * 80) / evt.total
  830. );
  831. } else {
  832. _this.racePro.stageBox[sindex].actBox[
  833. index
  834. ].evaDesign.data.progress = parseInt(
  835. (evt.loaded * 80) / evt.total
  836. );
  837. }
  838. })
  839. .send(function (err, data) {
  840. if (jsonType == 0) {
  841. _this.racePro.stageBox[sindex].actBox[
  842. index
  843. ].driQuestion.data.progress = 100;
  844. } else if (jsonType == 1) {
  845. _this.racePro.stageBox[sindex].actBox[
  846. index
  847. ].tarDesign.data.progress = 100;
  848. } else if (jsonType == 2) {
  849. _this.racePro.stageBox[sindex].actBox[
  850. index
  851. ].actiDesign.data.progress = 100;
  852. } else {
  853. _this.racePro.stageBox[sindex].actBox[
  854. index
  855. ].evaDesign.data.progress = 100;
  856. }
  857. setTimeout(() => {
  858. if (jsonType == 0) {
  859. _this.racePro.stageBox[sindex].actBox[
  860. index
  861. ].driQuestion.data.proVisible = false;
  862. } else if (jsonType == 1) {
  863. _this.racePro.stageBox[sindex].actBox[
  864. index
  865. ].tarDesign.data.proVisible = false;
  866. } else if (jsonType == 2) {
  867. _this.racePro.stageBox[sindex].actBox[
  868. index
  869. ].actiDesign.data.proVisible = false;
  870. } else {
  871. _this.racePro.stageBox[sindex].actBox[
  872. index
  873. ].evaDesign.data.proVisible = false;
  874. }
  875. _this.$forceUpdate();
  876. }, 1000);
  877. if (err) {
  878. _this.$message.error("上传失败");
  879. } else {
  880. if (jsonType == 0) {
  881. _this.racePro.stageBox[sindex].actBox[
  882. index
  883. ].driQuestion.data.push({
  884. name: file.name,
  885. url: data.Location,
  886. uid: file.uid,
  887. type: type1,
  888. });
  889. _this.imgChange(null, null, type1, sindex, index, jsonType);
  890. } else if (jsonType == 1) {
  891. _this.racePro.stageBox[sindex].actBox[
  892. index
  893. ].tarDesign.data.push({
  894. name: file.name,
  895. url: data.Location,
  896. uid: file.uid,
  897. type: type1,
  898. });
  899. _this.imgChange(null, null, type1, sindex, index, jsonType);
  900. } else if (jsonType == 2) {
  901. _this.racePro.stageBox[sindex].actBox[
  902. index
  903. ].actiDesign.data.push({
  904. name: file.name,
  905. url: data.Location,
  906. uid: file.uid,
  907. type: type1,
  908. });
  909. _this.imgChange(null, null, type1, sindex, index, jsonType);
  910. } else if (jsonType == 3) {
  911. _this.racePro.stageBox[sindex].actBox[
  912. index
  913. ].evaDesign.data.push({
  914. name: file.name,
  915. url: data.Location,
  916. uid: file.uid,
  917. type: type1,
  918. });
  919. _this.imgChange(null, null, type1, sindex, index, jsonType);
  920. }
  921. _this.upRacePro();
  922. console.log(data.Location);
  923. }
  924. });
  925. }
  926. },
  927. addTaskBorder(si) {
  928. this.racePro.stageBox[si].actBox.push({
  929. actName: "",
  930. actTime: "",
  931. driQuestion: { brief: "", data: [] },
  932. tarDesign: { brief: "", data: [] },
  933. actiDesign: { brief: "", data: [] },
  934. evaDesign: { brief: "", data: [] },
  935. });
  936. this.upRacePro();
  937. },
  938. addStageBorder() {
  939. this.racePro.stageBox.push({
  940. staTitle: "",
  941. allTime: "",
  942. brief: "",
  943. data: [],
  944. actBox: [
  945. {
  946. actName: "",
  947. actTime: "",
  948. driQuestion: { brief: "", data: [] },
  949. tarDesign: { brief: "", data: [] },
  950. actiDesign: { brief: "", data: [] },
  951. evaDesign: { brief: "", data: [] },
  952. },
  953. ],
  954. });
  955. },
  956. deleteTask(si, i) {
  957. var _this = this;
  958. if (_this.time()) {
  959. _this
  960. .$confirm("确定删除此活动吗?", "提示", {
  961. confirmButtonText: "确定",
  962. cancelButtonText: "取消",
  963. type: "warning",
  964. })
  965. .then(() => {
  966. _this.racePro.stageBox[si].actBox.splice(i, 1);
  967. _this.$message.success("删除成功");
  968. this.upRacePro();
  969. })
  970. .catch(() => {
  971. return;
  972. });
  973. }
  974. },
  975. },
  976. created() {
  977. this.racePro = this.raceProcess;
  978. },
  979. };
  980. </script>
  981. <style scoped>
  982. @media screen and (max-width: 1280px) {
  983. .jdTop > .jdTopFirst:nth-child(2) {
  984. padding-left: 5% !important;
  985. }
  986. .jdTopFirst >>> .el-input {
  987. width: 60% !important;
  988. }
  989. }
  990. .pb_content {
  991. width: 100%;
  992. height: 100%;
  993. }
  994. .race_content_body {
  995. width: 100%;
  996. position: relative;
  997. margin: 0;
  998. height: 100%;
  999. }
  1000. .raceBox {
  1001. width: 100%;
  1002. height: 100%;
  1003. display: flex;
  1004. flex-direction: row;
  1005. flex-wrap: nowrap;
  1006. align-items: flex-start;
  1007. }
  1008. .stepBg {
  1009. padding: 80px 0 0 0;
  1010. margin: 0 25px 0 0;
  1011. width: 20%;
  1012. display: flex;
  1013. justify-content: flex-start;
  1014. align-items: center;
  1015. flex-wrap: nowrap;
  1016. background: #fff;
  1017. /* min-height: 800px; */
  1018. height: calc(100% - 80px);
  1019. border-radius: 15px;
  1020. overflow: auto;
  1021. min-width: 260px;
  1022. flex-direction: column;
  1023. }
  1024. .steps {
  1025. display: flex;
  1026. flex-direction: row;
  1027. flex-wrap: nowrap;
  1028. position: relative;
  1029. width: 145px;
  1030. height: 130px;
  1031. }
  1032. .steps > div:nth-child(1) > img {
  1033. z-index: 9;
  1034. position: relative;
  1035. }
  1036. .stepRightNav {
  1037. display: flex;
  1038. flex-direction: column;
  1039. flex-wrap: nowrap;
  1040. justify-content: space-between;
  1041. align-items: flex-start;
  1042. margin-left: 10px;
  1043. height: 50px;
  1044. cursor: pointer;
  1045. }
  1046. .right {
  1047. width: calc(100% - 20%);
  1048. background: rgb(255, 255, 255);
  1049. border-radius: 10px;
  1050. overflow: auto;
  1051. height: 100%;
  1052. border-radius: 15px;
  1053. /* max-height: 800px; */
  1054. }
  1055. .raceProBox {
  1056. background: #f6f9fe;
  1057. width: 90%;
  1058. margin: 20px 0 0 20px;
  1059. border-radius: 10px;
  1060. border: 2px solid #c4d9f3;
  1061. }
  1062. .allBox {
  1063. padding: 25px 25px 0 25px;
  1064. }
  1065. .allBox > div:nth-child(1) {
  1066. font-size: 18px;
  1067. }
  1068. .raceTop > div:nth-child(2) {
  1069. width: 100%;
  1070. margin-top: 10px;
  1071. }
  1072. .titleTop {
  1073. display: flex;
  1074. flex-direction: row;
  1075. flex-wrap: nowrap;
  1076. align-items: center;
  1077. width: 100%;
  1078. position: relative;
  1079. }
  1080. .titleTop > div:nth-child(2) {
  1081. margin-left: 10px;
  1082. }
  1083. .leftBox {
  1084. width: 5px;
  1085. height: 15px;
  1086. background: #5499e6;
  1087. }
  1088. .editorCss {
  1089. width: 90% !important;
  1090. }
  1091. .basic_box {
  1092. position: relative;
  1093. margin: 0;
  1094. min-height: 0;
  1095. width: 90%;
  1096. }
  1097. .add_info_box {
  1098. margin: 20px 0;
  1099. }
  1100. .add_info_box button {
  1101. margin: 0 10px 10px 0;
  1102. }
  1103. .add_chapters_box {
  1104. text-align: left;
  1105. background-color: rgb(232 234 237);
  1106. width: 100%;
  1107. padding: 0px 15px;
  1108. border-radius: 15px;
  1109. font-size: 16px;
  1110. box-sizing: border-box;
  1111. position: relative;
  1112. padding: 0 10px 5px 10px;
  1113. height: 140px;
  1114. overflow-y: auto;
  1115. overflow-x: hidden;
  1116. }
  1117. .chapter_upload {
  1118. height: 50px;
  1119. margin-top: 12px;
  1120. position: relative;
  1121. display: flex;
  1122. align-items: center;
  1123. width: 100%;
  1124. min-height: 50px;
  1125. }
  1126. .chapter_upload_t {
  1127. background-color: #fff;
  1128. position: absolute;
  1129. height: 100%;
  1130. top: 0px;
  1131. left: 0px;
  1132. border-radius: 40px;
  1133. box-sizing: border-box;
  1134. box-shadow: 0 0 3px 3px #dfdfdf;
  1135. width: 100%;
  1136. }
  1137. .chapter_upload_o {
  1138. width: 100%;
  1139. height: 100%;
  1140. position: relative;
  1141. z-index: 1;
  1142. display: flex;
  1143. align-items: center;
  1144. }
  1145. .chapter_upload_ic {
  1146. height: 30px;
  1147. float: right;
  1148. cursor: pointer;
  1149. position: absolute;
  1150. width: 45px;
  1151. right: 0;
  1152. top: 0;
  1153. }
  1154. .chapter_upload_ic_l {
  1155. width: 50px;
  1156. height: 50px;
  1157. float: left;
  1158. }
  1159. .chapter_upload_ic_l div {
  1160. width: 30px;
  1161. height: 35px;
  1162. background: url("../../../../assets/icon/icon.png");
  1163. }
  1164. .chapter_upload_ic_r {
  1165. width: 50px;
  1166. height: 50px;
  1167. float: left;
  1168. margin-left: 0px;
  1169. display: flex;
  1170. align-items: center;
  1171. position: absolute;
  1172. }
  1173. .chapter_upload_ic_r div {
  1174. width: 25px;
  1175. height: 25px;
  1176. background-image: url("../../../../assets/delete.png");
  1177. background-size: 100% 100%;
  1178. }
  1179. .chapter_upload_n {
  1180. display: flex;
  1181. text-indent: 10px;
  1182. text-decoration: none;
  1183. text-overflow: ellipsis;
  1184. white-space: nowrap;
  1185. overflow: hidden;
  1186. width: 55%;
  1187. margin-left: 10px;
  1188. cursor: pointer;
  1189. margin-top: 2px;
  1190. }
  1191. .chapter_upload_l_i1 {
  1192. background-image: url("../../../../assets/icon/video.png");
  1193. width: 28px;
  1194. height: 28px;
  1195. background-size: 100% 100%;
  1196. }
  1197. .chapter_upload_l_i5 {
  1198. background-image: url("../../../../assets/icon/word.png");
  1199. width: 24px;
  1200. height: 24px;
  1201. background-size: 100% 100%;
  1202. margin-left: 1px;
  1203. }
  1204. .chapter_upload_l_i8 {
  1205. background-image: url("../../../../assets/icon/line.png");
  1206. width: 24px;
  1207. height: 24px;
  1208. background-size: 100% 100%;
  1209. margin-left: 1px;
  1210. }
  1211. .chapter_upload_ud {
  1212. display: flex;
  1213. flex-direction: column;
  1214. margin-left: 5px;
  1215. justify-content: center;
  1216. z-index: 99;
  1217. }
  1218. .chapter_upload_up {
  1219. background-image: url("../../../../assets/icon/up.png");
  1220. width: 17px;
  1221. height: 15px;
  1222. background-size: 100% 100%;
  1223. cursor: pointer;
  1224. }
  1225. .chapter_upload_down {
  1226. background-image: url("../../../../assets/icon/down.png");
  1227. width: 17px;
  1228. height: 15px;
  1229. margin: 2px auto 0 auto;
  1230. background-size: 100% 100%;
  1231. cursor: pointer;
  1232. }
  1233. .chapter_upload_l {
  1234. padding: 1px 0 0 10px;
  1235. }
  1236. .first {
  1237. border: none;
  1238. outline: none;
  1239. width: 80%;
  1240. min-width: 215px;
  1241. z-index: 99;
  1242. font-size: 14px;
  1243. white-space: nowrap;
  1244. overflow: hidden;
  1245. text-overflow: ellipsis;
  1246. }
  1247. .info_btn {
  1248. color: #fff;
  1249. background-color: #0f7eff;
  1250. padding: 8px 24px;
  1251. font-size: 0.9375rem;
  1252. box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 20%), 0px 2px 2px 0px rgb(0 0 0 / 14%),
  1253. 0px 3px 1px -2px rgb(0 0 0 / 12%);
  1254. min-width: 64px;
  1255. font-weight: 500;
  1256. border-radius: 4px;
  1257. box-sizing: border-box;
  1258. border: none;
  1259. cursor: pointer;
  1260. }
  1261. .info_btn:hover {
  1262. background-color: #4f7cd5 !important;
  1263. }
  1264. .hdName {
  1265. font-size: 22px;
  1266. color: #407eef;
  1267. min-width: 90px;
  1268. margin: 0 10px;
  1269. }
  1270. .lineBox {
  1271. display: flex;
  1272. margin: 0 0 20px 0;
  1273. flex-direction: row;
  1274. justify-content: flex-start;
  1275. align-items: center;
  1276. }
  1277. .lineTitle,
  1278. .lineTitleTwo {
  1279. margin-top: 15px;
  1280. width: 110px;
  1281. }
  1282. .lineTitle {
  1283. color: #407eef;
  1284. font-size: 22px;
  1285. }
  1286. .strLine {
  1287. width: 85%;
  1288. margin: 0 auto;
  1289. border-top: 1px solid #e5e5e5;
  1290. margin-top: 20px;
  1291. }
  1292. .addTaskBorder {
  1293. border: 2px solid #e1e1e1;
  1294. border-radius: 10px;
  1295. width: 90%;
  1296. margin: 20px 0 20px 20px;
  1297. cursor: pointer;
  1298. }
  1299. .addTaskBorder > div {
  1300. margin: 0 auto;
  1301. display: flex;
  1302. align-items: center;
  1303. justify-content: center;
  1304. }
  1305. .addTaskBorder > div > img {
  1306. width: 100px;
  1307. }
  1308. .addTaskBorder > div > span {
  1309. font-size: 23px;
  1310. color: #dbdbdb;
  1311. }
  1312. .remove {
  1313. background-image: url(../../../../assets/remove.png);
  1314. cursor: pointer;
  1315. opacity: 0.5;
  1316. width: 40px;
  1317. height: 50px;
  1318. background-repeat: no-repeat;
  1319. background-position: 5px 10px;
  1320. }
  1321. .stepBg .steps::after {
  1322. content: "";
  1323. height: 100%;
  1324. background: #eee;
  1325. width: 4px;
  1326. position: absolute;
  1327. left: 15px;
  1328. top: calc(50% + (35px / 2));
  1329. transform: translateY(-50%);
  1330. z-index: 1;
  1331. }
  1332. .mask {
  1333. background-color: rgb(0 0 0 / 30%);
  1334. /* position: fixed; */
  1335. position: absolute;
  1336. top: 0;
  1337. left: 0;
  1338. width: 100%;
  1339. height: 100%;
  1340. z-index: 20000;
  1341. display: flex;
  1342. align-items: center;
  1343. justify-content: center;
  1344. }
  1345. .progressBox {
  1346. width: 300px;
  1347. height: 150px;
  1348. background: #fff;
  1349. border-radius: 10px;
  1350. box-shadow: 0 0 6px 1px #bfbfbf;
  1351. display: flex;
  1352. align-items: center;
  1353. justify-content: center;
  1354. flex-direction: column;
  1355. }
  1356. .progressBox .lbox {
  1357. height: 100px;
  1358. font-size: 16px;
  1359. display: flex;
  1360. align-items: center;
  1361. }
  1362. .progressBox .lbox img {
  1363. width: 40px;
  1364. margin-right: 20px;
  1365. }
  1366. .progressBox >>> .el-progress-bar__outer {
  1367. background-color: #d1dfff !important;
  1368. }
  1369. .progressBox .lbox {
  1370. height: 100px;
  1371. font-size: 19px;
  1372. display: flex;
  1373. align-items: center;
  1374. }
  1375. .progressBox .lbox img {
  1376. width: 40px;
  1377. margin-right: 20px;
  1378. }
  1379. .jdTop {
  1380. display: flex;
  1381. flex-direction: row;
  1382. flex-wrap: nowrap;
  1383. align-items: center;
  1384. justify-content: flex-start;
  1385. padding: 20px 0 0 25px;
  1386. position: relative;
  1387. width: 90%;
  1388. }
  1389. .jdTopFirst {
  1390. display: flex;
  1391. flex-direction: row;
  1392. flex-wrap: nowrap;
  1393. align-items: center;
  1394. }
  1395. .jdTop > .jdTopFirst:nth-child(2) {
  1396. padding-left: 20%;
  1397. }
  1398. .jdTop > .jdTopFirst:nth-child(2) > div:nth-child(1) {
  1399. min-width: 60px;
  1400. }
  1401. .jdTopFirst > input {
  1402. width: 200px;
  1403. height: 25px;
  1404. }
  1405. .firstTop {
  1406. display: flex;
  1407. flex-direction: row;
  1408. flex-wrap: nowrap;
  1409. align-items: center;
  1410. width: 90%;
  1411. }
  1412. .rightNav {
  1413. width: 87%;
  1414. margin-left: 15px;
  1415. }
  1416. .right_title {
  1417. height: 30px;
  1418. font-size: 1.5em;
  1419. font-weight: bold;
  1420. color: #0f7eff;
  1421. width: 100px;
  1422. }
  1423. </style>