aiCreateDialog.vue 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396
  1. <template>
  2. <el-dialog title="AI生成PPT" :visible.sync="dialogVisibleAiCreate" :append-to-body="true" width="700px"
  3. :before-close="handleClose" class="dialog_diy">
  4. <div style="height: 500px; padding: 15px" v-loading="loading" element-loading-text="小可正在努力生成中,请稍等...">
  5. <div class="c_pub_button_confirm stopBtn" v-if="loading && stopPpt" @click="cancelAjax()">停止</div>
  6. <!-- <div class="t_box">
  7. <span>选择:</span>
  8. <el-radio-group v-model="radio" @change="changeRadio">
  9. <el-radio :label="0">PPT</el-radio>
  10. <el-radio :label="1">教案</el-radio>
  11. <el-radio :label="2">视频</el-radio>
  12. </el-radio-group>
  13. </div> -->
  14. <div class="t_box" v-if="steps == 1" style="height: 100%">
  15. <textarea style="height: 100%;width:calc(100% - 260px)" rows="10" class="binfo_input binfo_textarea"
  16. cols placeholder="请生成大纲" v-model="outline"></textarea>
  17. <div class="template_box">
  18. <span class="title">选择模板</span>
  19. <div class="template_list">
  20. <div class="template_item" :class="{ active: index == templateIndex }"
  21. v-for="(item, index) in templateList" :key="index" @click="changeTemplate(index)">
  22. <img :src="item.img" alt="" />
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <div style="height: 100%" v-else>
  28. <wOffice v-if="url" :url="url"></wOffice>
  29. </div>
  30. </div>
  31. <span slot="footer" class="dialog-footer">
  32. <el-button @click="aiGet(2)" type="primary" :disabled="loading">重新生成大纲</el-button>
  33. <el-button @click="aiGet(1)" type="primary" :disabled="loading">{{
  34. url ? "重新生成PPT" : "生成PPT"
  35. }}</el-button>
  36. <el-button @click="steps = 1" type="primary" v-if="steps == 2">上一步</el-button>
  37. <el-button @click="steps = 2" type="primary" v-else-if="steps == 1 && url">下一步</el-button>
  38. <el-button @click="confirm" type="primary">确 定</el-button>
  39. <el-button @click="close">关 闭</el-button>
  40. </span>
  41. </el-dialog>
  42. </template>
  43. <script>
  44. import Pptxgen from "pptxgenjs";
  45. import wOffice from "../components/wOffice.vue";
  46. import { v4 as uuidv4 } from "uuid";
  47. export default {
  48. components: {
  49. wOffice,
  50. },
  51. props: {
  52. dialogVisibleAiCreate: {
  53. type: Boolean,
  54. default: false,
  55. },
  56. courseName: {
  57. type: String,
  58. default: "",
  59. },
  60. infoData: {
  61. type: Array,
  62. default: "",
  63. },
  64. courseTypeId: {
  65. type: Array,
  66. default: "",
  67. },
  68. CourseTypeJson: {
  69. type: Object,
  70. default: () => ({}),
  71. },
  72. courseState: {
  73. type: Number,
  74. },
  75. lineCount: {
  76. type: Number,
  77. },
  78. unitJson: {
  79. type: Array,
  80. }
  81. },
  82. // 根据用户给你的参考资料
  83. data() {
  84. return {
  85. userid: this.$route.query.userid,
  86. radio: 0,
  87. aiJson: {
  88. ppt: `## 任务
  89. 请生成关于${this.courseName},为教师生成这节课的教学ppt,页数在20页左右。PPT的内容主要是讲解该课程中所有可能涉及到的知识点。
  90. ## 工作流
  91. 1. 从用户提供的参考资料中提取10个最重要的知识点(知识点水平限制在小学和初中),并输出。
  92. 2. 针对10个知识点中的每个,你使用1~3页ppt详细的对知识点进行讲解。你的讲解词应该在100token左右
  93. 3. 讲解完所有知识点后,再根据知识点出5道单选题(放在5页ppt中)
  94. ## 限制
  95. - 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
  96. - 你不能输出违反伦理的内容`,
  97. word: "",
  98. video: "",
  99. },
  100. aiUrl: {
  101. ppt: "",
  102. word: "",
  103. video: "",
  104. },
  105. detail: "",
  106. loading: false,
  107. stopPpt: null,
  108. url: "",
  109. uJson: {},
  110. outline: "",
  111. steps: 1,
  112. // templateList: [
  113. // // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model1-11719468995661.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model1-21719469026755.png',color:'17094F' },
  114. // // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model2-11719469051869.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model2-21719469040181.png',color:'052B37' },
  115. // // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model3-11719469071576.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model3-21719469092087.png',color:'1D5869' },
  116. // // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model4-11719469106190.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model-4-21719469125318.png',color:'372213' },
  117. // // { img: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model5-11719295908696.png', img2: 'https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/model5-21719295930345.png',color:'674D40' },
  118. // { img: require('../../../assets/icon/ppt/model1-1.png'), img2: require('../../../assets/icon/ppt/model1-2.png'),color:'17094F' },
  119. // { img: require('../../../assets/icon/ppt/model2-1.png'), img2: require('../../../assets/icon/ppt/model2-2.png'),color:'052B37' },
  120. // { img: require('../../../assets/icon/ppt/model3-1.png'), img2: require('../../../assets/icon/ppt/model3-2.png'),color:'1D5869' },
  121. // { img: require('../../../assets/icon/ppt/model4-1.png'), img2: require('../../../assets/icon/ppt/model4-2.png'),color:'372213' },
  122. // { img: require('../../../assets/icon/ppt/model5-1.png'), img2: require('../../../assets/icon/ppt/model5-2.png'),color:'674D40' },
  123. // ],
  124. templateList: [
  125. {
  126. img: require('../../../assets/icon/ppt/model1-1.png'),
  127. img1: {
  128. img: require('../../../assets/icon/ppt/model1-1.png'),
  129. setting: {
  130. x: "5%",
  131. y: 3,
  132. w: "90%",
  133. color: '17094F',
  134. fontSize: 38,
  135. fontFace: '黑体',
  136. align: "center",
  137. }
  138. },
  139. img2: [
  140. {
  141. img: require('../../../assets/icon/ppt/model1-2.png'),
  142. title: {
  143. x: "5%", // 横坐标
  144. y: 1.1,
  145. w: "90%",
  146. color: '17094F',
  147. bold: true,
  148. fontSize: 35, // 字号
  149. fontFace: '黑体',
  150. align: "center",
  151. },
  152. subTitle: {
  153. x: "5%", // 横坐标
  154. y: 1.8,
  155. w: "90%",
  156. color: "222222",
  157. fontSize: 20, // 字号
  158. fontFace: '黑体',
  159. align: "center",
  160. },
  161. content: {
  162. x: "20%", // 横坐标
  163. y: 3.2,
  164. w: "60%",
  165. color: "444444",
  166. fontSize: 18, // 字号
  167. fontFace: '黑体',
  168. align: "left",
  169. }
  170. }
  171. ],
  172. imgEnd: {
  173. img: require('../../../assets/icon/ppt/model1-1.png'),
  174. setting: {
  175. x: "5%",
  176. y: 3,
  177. w: "90%",
  178. color: '17094F',
  179. fontSize: 38,
  180. fontFace: '黑体',
  181. align: "center",
  182. }
  183. }
  184. },
  185. {
  186. img: require('../../../assets/icon/ppt/model2-1.png'),
  187. img1: {
  188. img: require('../../../assets/icon/ppt/model2-1.png'),
  189. setting: {
  190. x: "5%",
  191. y: 3,
  192. w: "90%",
  193. color: '052B37',
  194. fontSize: 38,
  195. fontFace: '黑体',
  196. align: "center",
  197. }
  198. },
  199. img2: [
  200. {
  201. img: require('../../../assets/icon/ppt/model2-2.png'),
  202. title: {
  203. x: "5%", // 横坐标
  204. y: 1.1,
  205. w: "90%",
  206. color: '052B37',
  207. bold: true,
  208. fontSize: 35, // 字号
  209. fontFace: '黑体',
  210. align: "center",
  211. },
  212. subTitle: {
  213. x: "5%", // 横坐标
  214. y: 1.8,
  215. w: "90%",
  216. color: "222222",
  217. fontSize: 20, // 字号
  218. fontFace: '黑体',
  219. align: "center",
  220. },
  221. content: {
  222. x: "20%", // 横坐标
  223. y: 3.2,
  224. w: "60%",
  225. color: "444444",
  226. fontSize: 18, // 字号
  227. fontFace: '黑体',
  228. align: "left",
  229. }
  230. }
  231. ],
  232. imgEnd: {
  233. img: require('../../../assets/icon/ppt/model2-1.png'),
  234. setting: {
  235. x: "5%",
  236. y: 3,
  237. w: "90%",
  238. color: '052B37',
  239. fontSize: 38,
  240. fontFace: '黑体',
  241. align: "center",
  242. }
  243. }
  244. },
  245. {
  246. img: require('../../../assets/icon/ppt/model3-1.png'),
  247. img1: {
  248. img: require('../../../assets/icon/ppt/model3-1.png'),
  249. setting: {
  250. x: "5%",
  251. y: 3,
  252. w: "90%",
  253. color: '1D5869',
  254. fontSize: 38,
  255. fontFace: '黑体',
  256. align: "center",
  257. }
  258. },
  259. img2: [
  260. {
  261. img: require('../../../assets/icon/ppt/model3-2.png'),
  262. title: {
  263. x: "5%", // 横坐标
  264. y: 1.1,
  265. w: "90%",
  266. color: '1D5869',
  267. bold: true,
  268. fontSize: 35, // 字号
  269. fontFace: '黑体',
  270. align: "center",
  271. },
  272. subTitle: {
  273. x: "5%", // 横坐标
  274. y: 1.8,
  275. w: "90%",
  276. color: "222222",
  277. fontSize: 20, // 字号
  278. fontFace: '黑体',
  279. align: "center",
  280. },
  281. content: {
  282. x: "20%", // 横坐标
  283. y: 3.2,
  284. w: "60%",
  285. color: "444444",
  286. fontSize: 18, // 字号
  287. fontFace: '黑体',
  288. align: "left",
  289. }
  290. }
  291. ],
  292. imgEnd: {
  293. img: require('../../../assets/icon/ppt/model3-1.png'),
  294. setting: {
  295. x: "5%",
  296. y: 3,
  297. w: "90%",
  298. color: '1D5869',
  299. fontSize: 38,
  300. fontFace: '黑体',
  301. align: "center",
  302. }
  303. }
  304. },
  305. {
  306. img: require('../../../assets/icon/ppt/model4-1.png'),
  307. img1: {
  308. img: require('../../../assets/icon/ppt/model4-1.png'),
  309. setting: {
  310. x: "5%",
  311. y: 3,
  312. w: "90%",
  313. color: '372213',
  314. fontSize: 38,
  315. fontFace: '黑体',
  316. align: "center",
  317. }
  318. },
  319. img2: [
  320. {
  321. img: require('../../../assets/icon/ppt/model4-2.png'),
  322. title: {
  323. x: "5%", // 横坐标
  324. y: 1.1,
  325. w: "90%",
  326. color: '372213',
  327. bold: true,
  328. fontSize: 35, // 字号
  329. fontFace: '黑体',
  330. align: "center",
  331. },
  332. subTitle: {
  333. x: "5%", // 横坐标
  334. y: 1.8,
  335. w: "90%",
  336. color: "222222",
  337. fontSize: 20, // 字号
  338. fontFace: '黑体',
  339. align: "center",
  340. },
  341. content: {
  342. x: "20%", // 横坐标
  343. y: 3.2,
  344. w: "60%",
  345. color: "444444",
  346. fontSize: 18, // 字号
  347. fontFace: '黑体',
  348. align: "left",
  349. }
  350. }
  351. ],
  352. imgEnd: {
  353. img: require('../../../assets/icon/ppt/model4-1.png'),
  354. setting: {
  355. x: "5%",
  356. y: 3,
  357. w: "90%",
  358. color: '372213',
  359. fontSize: 38,
  360. fontFace: '黑体',
  361. align: "center",
  362. }
  363. },
  364. color: '372213'
  365. },
  366. {
  367. img: require('../../../assets/icon/ppt/model5-1.png'),
  368. img1: {
  369. img: require('../../../assets/icon/ppt/model5-1.png'),
  370. setting: {
  371. x: "5%",
  372. y: 3,
  373. w: "90%",
  374. color: '674D40',
  375. fontSize: 38,
  376. fontFace: '黑体',
  377. align: "center",
  378. }
  379. },
  380. img2: [
  381. {
  382. img: require('../../../assets/icon/ppt/model5-2.png'),
  383. title: {
  384. x: "5%", // 横坐标
  385. y: 1.1,
  386. w: "90%",
  387. color: '674D40',
  388. bold: true,
  389. fontSize: 35, // 字号
  390. fontFace: '黑体',
  391. align: "center",
  392. },
  393. subTitle: {
  394. x: "5%", // 横坐标
  395. y: 1.8,
  396. w: "90%",
  397. color: "222222",
  398. fontSize: 20, // 字号
  399. fontFace: '黑体',
  400. align: "center",
  401. },
  402. content: {
  403. x: "20%", // 横坐标
  404. y: 3.2,
  405. w: "60%",
  406. color: "444444",
  407. fontSize: 18, // 字号
  408. fontFace: '黑体',
  409. align: "left",
  410. }
  411. }
  412. ],
  413. imgEnd: {
  414. img: require('../../../assets/icon/ppt/model5-1.png'),
  415. setting: {
  416. x: "5%",
  417. y: 3,
  418. w: "90%",
  419. color: '674D40',
  420. fontSize: 38,
  421. fontFace: '黑体',
  422. align: "center",
  423. }
  424. },
  425. },
  426. {
  427. img: require('../../../assets/icon/ppt/model6-1.png'),
  428. img1: {
  429. img: require('../../../assets/icon/ppt/model6-1-2.png'),
  430. setting: {
  431. x: "35%",
  432. y: 2.3,
  433. w: "60%",
  434. bold: true,
  435. color: 'EA7A93',
  436. fontSize: 38,
  437. fontFace: '黑体',
  438. align: "center",
  439. }
  440. },
  441. img2: [
  442. {
  443. img:require('../../../assets/icon/ppt/model6-2.png'),
  444. title: {
  445. x: "5%", // 横坐标
  446. y: 1.1,
  447. w: "90%",
  448. color: '4F73DA',
  449. bold: true,
  450. fontSize: 35, // 字号
  451. fontFace: '黑体',
  452. align: "center",
  453. },
  454. subTitle: {
  455. x: "5%", // 横坐标
  456. y: 1.8,
  457. w: "90%",
  458. color: "333333",
  459. fontSize: 20, // 字号
  460. fontFace: '黑体',
  461. align: "center",
  462. },
  463. content: {
  464. x: "20%", // 横坐标
  465. y: 3.2,
  466. w: "60%",
  467. color: "333333",
  468. fontSize: 18, // 字号
  469. fontFace: '黑体',
  470. align: "left",
  471. }
  472. },//内容页1
  473. {
  474. img: require('../../../assets/icon/ppt/model6-2.png'),
  475. title: {
  476. x: "2.5%", // 横坐标
  477. y: 2.3,
  478. w: "30%",
  479. color: 'ffffff',
  480. bold: true,
  481. fontSize: 35, // 字号
  482. fontFace: '黑体',
  483. align: "left",
  484. },
  485. subTitle: {
  486. x: "2.5%", // 横坐标
  487. y: 3.1,
  488. w: "30%",
  489. color: "ffffff",
  490. fontSize: 20, // 字号
  491. fontFace: '黑体',
  492. align: "left",
  493. },
  494. content: {
  495. x: "45%", // 横坐标
  496. y: 2.8,
  497. w: "45%",
  498. color: "333333",
  499. fontSize: 18, // 字号
  500. fontFace: '黑体',
  501. align: "left",
  502. },
  503. square: {
  504. x: 0,
  505. y: 0,
  506. w: "35%",
  507. h: "100%",
  508. fill: { color: "4F73DA" }
  509. },
  510. square2: {
  511. x: "35%",
  512. y: 0,
  513. w: "2.5%",
  514. h: "100%",
  515. fill: { color: "C2CFEF" }
  516. }
  517. },//内容页2
  518. {
  519. img: require('../../../assets/icon/ppt/model6-2.png'),
  520. title: {
  521. x: "5%", // 横坐标
  522. y: 1,
  523. w: "60%",
  524. color: '4F73DA',
  525. bold: true,
  526. fontSize: 35, // 字号
  527. fontFace: '黑体',
  528. align: "left",
  529. },
  530. subTitle: {
  531. x: "5%", // 横坐标
  532. y: 1.7,
  533. w: "60%",
  534. color: "333333",
  535. fontSize: 20, // 字号
  536. fontFace: '黑体',
  537. align: "left",
  538. },
  539. content: {
  540. x: "5%", // 横坐标
  541. y: 2.5,
  542. w: "60%",
  543. color: "333333",
  544. fontSize: 18, // 字号
  545. fontFace: '黑体',
  546. align: "left",
  547. },
  548. image: {
  549. x: "70%",
  550. y: "22%",
  551. w: "30%",
  552. h: "56%",
  553. sizing: "contain",
  554. path: require('../../../assets/icon/ppt/model6-3.png')
  555. },
  556. },//内容页3
  557. {
  558. img: require('../../../assets/icon/ppt/model6-2.png'),
  559. title: {
  560. x: "10%", // 横坐标
  561. y: "4%",
  562. h: 0.75,
  563. w: "80%",
  564. color: 'ffffff',
  565. fill: { color: "4F73DA"},
  566. bold: true,
  567. fontSize: 35, // 字号
  568. fontFace: '黑体',
  569. align: "center",
  570. },
  571. subTitle: {
  572. x: "10%", // 横坐标
  573. y: 1.5,
  574. w: "80%",
  575. color: "333333",
  576. fontSize: 20, // 字号
  577. fontFace: '黑体',
  578. align: "left",
  579. },
  580. content: {
  581. x: "10%", // 横坐标
  582. y: 2.3,
  583. w: "80%",
  584. color: "333333",
  585. fontSize: 18, // 字号
  586. fontFace: '黑体',
  587. align: "left",
  588. },
  589. image: {
  590. x: "2.5%",
  591. y: "10%",
  592. w: "95%",
  593. h: "80%",
  594. sizing: "contain",
  595. path: require('../../../assets/icon/ppt/model6-4.png')
  596. },
  597. },//内容页4
  598. {
  599. img: require('../../../assets/icon/ppt/model6-2.png'),
  600. title: {
  601. x: 0, // 横坐标
  602. y: "30%",
  603. w: "35%",
  604. h: "40%",
  605. color: 'ffffff',
  606. bold: true,
  607. fontSize: 30, // 字号
  608. fontFace: '黑体',
  609. align: "right",
  610. fill: { color: "4F73DA"},
  611. margin: 10,
  612. },
  613. subTitle: {
  614. x: "37.5%", // 横坐标
  615. y: 1,
  616. w: "53%",
  617. color: "333333",
  618. fontSize: 20, // 字号
  619. fontFace: '黑体',
  620. align: "left",
  621. },
  622. content: {
  623. x: "37.5%", // 横坐标
  624. y: 2,
  625. w: "53%",
  626. color: "333333",
  627. fontSize: 18, // 字号
  628. fontFace: '黑体',
  629. align: "left",
  630. },
  631. square: {
  632. x: "5%",
  633. y: "10%",
  634. w: "90%",
  635. h: "80%",
  636. fill: { color: "ffffff" },
  637. line: {
  638. width: '2',
  639. color: "3B4564"
  640. }
  641. },
  642. }, //内容页5
  643. {
  644. img: require('../../../assets/icon/ppt/model6-2.png'),
  645. title: {
  646. x: "17%", // 横坐标
  647. y: "20%",
  648. h: 0.75,
  649. w: "66%",
  650. color: 'ffffff',
  651. fill: { color: "4F73DA"},
  652. bold: true,
  653. fontSize: 35, // 字号
  654. fontFace: '黑体',
  655. align: "center",
  656. },
  657. subTitle: {
  658. x: "5%", // 横坐标
  659. y: 3,
  660. w: "90%",
  661. color: "333333",
  662. fontSize: 20, // 字号
  663. fontFace: '黑体',
  664. align: "left",
  665. },
  666. content: {
  667. x: "5%", // 横坐标
  668. y: 3.8,
  669. w: "90%",
  670. color: "333333",
  671. fontSize: 18, // 字号
  672. fontFace: '黑体',
  673. align: "left",
  674. },
  675. image: {
  676. x: 0,
  677. y: 0,
  678. w: "100%",
  679. h: "45%",
  680. sizing: "contain",
  681. path: require('../../../assets/icon/ppt/model6-6.png')
  682. },
  683. },//内容页6
  684. {
  685. img: require('../../../assets/icon/ppt/model6-7-1.png'),
  686. title: {
  687. x: "45%", // 横坐标
  688. y: 1.3,
  689. w: "50%",
  690. color: '4F73DA',
  691. bold: true,
  692. fontSize: 35, // 字号
  693. fontFace: '黑体',
  694. align: "left",
  695. },
  696. subTitle: {
  697. x: "45%", // 横坐标
  698. y: 2,
  699. w: "50%",
  700. color: "333333",
  701. fontSize: 20, // 字号
  702. fontFace: '黑体',
  703. align: "left",
  704. },
  705. content: {
  706. x: "45%", // 横坐标
  707. y: 3.2,
  708. w: "50%",
  709. color: "333333",
  710. fontSize: 18, // 字号
  711. fontFace: '黑体',
  712. align: "left",
  713. },
  714. image: {
  715. x: "20%",
  716. y: 0,
  717. w: "80%",
  718. h: "100%",
  719. sizing: "contain",
  720. path: require('../../../assets/icon/ppt/model6-7-2.png')
  721. },
  722. },//内容页7
  723. ],
  724. imgEnd: {
  725. img: require('../../../assets/icon/ppt/model6-1-2.png'),
  726. setting: {
  727. x: "35%",
  728. y: 2.3,
  729. w: "60%",
  730. color: 'EA7A93',
  731. fontSize: 38,
  732. fontFace: '黑体',
  733. align: "center",
  734. }
  735. },
  736. },
  737. ],
  738. templateIndex: 0,
  739. };
  740. },
  741. watch: {
  742. dialogVisibleAiCreate(newValue, oldValue) {
  743. if (newValue) {
  744. this.loading = false;
  745. this.aiGet(2);
  746. // this.templateIndex = 5
  747. // let array = [
  748. // {
  749. // "page": 1,
  750. // "title": "引入阶段",
  751. // "task": "课程背景",
  752. // "points": "同学们,让我们一起了解一下这门有趣的熊猫课程吧!今天,我们将探索熊猫的生活环境,并尝试去理解这些环境是如何影响熊猫的生存的。"
  753. // },
  754. // {
  755. // "page": 2,
  756. // "title": "引入阶段",
  757. // "task": "整体目标和任务要求",
  758. // "points": "这门课程的主要目标是让大家了解熊猫生活的环境以及生存所需的关键因素。我们将完成一个任务,具体要求是观察、记录、绘制和制作模型哦!"
  759. // },
  760. // {
  761. // "page": 3,
  762. // "title": "引入阶段",
  763. // "task": "驱动性问题",
  764. // "points": "大家思考一下这样一个问题:‘熊猫的生活环境对它们的生存有何重要影响?’ 我们接下去的活动将帮助大家找到答案。"
  765. // },
  766. // {
  767. // "page": 4,
  768. // "title": "引入阶段",
  769. // "task": "观察与记录技巧",
  770. // "points": "今天我们会运用图片和视频,来帮助大家观察熊猫栖息地和它们所吃的竹子等特征。细心观察,并将所见的特征记录下来是非常重要的技能哦!"
  771. // },
  772. // {
  773. // "page": 5,
  774. // "title": "探究阶段",
  775. // "task": "绘图工具和材料",
  776. // "points": "现在我们分发绘图工具和材料,来学习基本的绘图和建模技巧吧!熟练掌握这些工具会帮助我们更好地记录和展示我们的观察结果。"
  777. // },
  778. // {
  779. // "page": 6,
  780. // "title": "探究阶段",
  781. // "task": "观察和记录特征",
  782. // "points": "让我们好好观察一下身边的常见物体,把它们的特征记录下来。这个过程会训练你们的观察力和手眼协调能力。"
  783. // },
  784. // {
  785. // "page": 7,
  786. // "title": "探究阶段",
  787. // "task": "转换二维图像",
  788. // "points": "接下来,我们要把记录的三维物体转化为二维图像。这个步骤非常有趣,大家可以尽情发挥自己的绘画天赋哦!"
  789. // },
  790. // {
  791. // "page": 8,
  792. // "title": "探究阶段",
  793. // "task": "三维模型制作",
  794. // "points": "现在我们提供一些简单的材料,比如纸张和纸板,示范一下如何制作三维模型。记住,比例和结构是模型制作的关键!"
  795. // },
  796. // {
  797. // "page": 9,
  798. // "title": "评估与反馈阶段",
  799. // "task": "评估和检查",
  800. // "points": "大家完成了任务后,我们来检查和评估你们的二维图像和三维模型。确保它们的结构合理、比例协调。"
  801. // },
  802. // {
  803. // "page": 10,
  804. // "title": "评估与反馈阶段",
  805. // "task": "提出改进建议",
  806. // "points": "针对你们完成的作品,我们会提出一些改进建议。大家也可以相互评价,分享制作经验,这样可以互相学习哦!"
  807. // },
  808. // {
  809. // "page": 11,
  810. // "title": "评估与反馈阶段",
  811. // "task": "任务总结",
  812. // "points": "最后,我们要总结这次任务的执行情况,并表扬表现特别突出的同学。希望大家都能有所收获,并继续努力!"
  813. // },
  814. // {
  815. // "page": 12,
  816. // "title": "练习",
  817. // "task": "练习1:二维图像绘制",
  818. // "points": "选择一件日常物品(如书本、杯子),观察其特征,尝试通过手绘将其转换为二维图像。示例:通过绘制书本的正面、侧面和顶面图,展示其主要特征和比例关系。"
  819. // },
  820. // {
  821. // "page": 13,
  822. // "title": "练习",
  823. // "task": "练习2:三维模型制作",
  824. // "points": "使用纸张和纸板制作简单的模型,比如一个基本的房子或盒子。关注其结构和比例哦! 示例:通过折叠和粘贴纸张,制作一个四面体,确保各个面的比例协调,结构稳定。"
  825. // }
  826. // ]
  827. // this.createPpt(array);
  828. }
  829. },
  830. },
  831. methods: {
  832. cancelAjax(){
  833. this.$message.success("已经成功停止")
  834. this.stopPpt.cancel('Request canceled by the user.');
  835. this.stopPpt = null;
  836. this.loading = false
  837. },
  838. handleClose(done) {
  839. this.close();
  840. done();
  841. },
  842. close() {
  843. this.$emit("update:dialogVisibleAiCreate", false);
  844. },
  845. confirm() {
  846. if (this.url) {
  847. this.$emit("createAiPpt", this.uJson);
  848. } else {
  849. this.$message.error("请点击“生成PPT”按钮");
  850. }
  851. },
  852. changeRadio() {
  853. if (this.radio == 0) {
  854. this.detail = this.aiJson.ppt;
  855. }
  856. if (this.radio == 1) {
  857. this.detail = this.aiJson.word;
  858. }
  859. if (this.radio == 2) {
  860. this.detail = this.aiJson.video;
  861. }
  862. },
  863. createFileid(url) {
  864. let _this = this;
  865. return new Promise((resolve, reject) => {
  866. try {
  867. _this.ajax
  868. .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
  869. url: url,
  870. })
  871. .then((res) => {
  872. let _data = res.data.FunctionResponse;
  873. if (_data.result && _data.result.id) {
  874. resolve(_data.result.id);
  875. }
  876. })
  877. .catch(function (error) {
  878. resolve("");
  879. });
  880. } catch (e) {
  881. resolve();
  882. }
  883. });
  884. },
  885. async aiGet(type) {
  886. if (this.loading) {
  887. this.$message.error("正在生成中,请稍后");
  888. return;
  889. }
  890. let _this = this;
  891. let fileid = [];
  892. if (_this.infoData.length) {
  893. for (var i = 0; i < _this.infoData.length; i++) {
  894. if (_this.infoData[i].fileid) {
  895. fileid.push(_this.infoData[i].fileid);
  896. } else {
  897. let _fileid = await _this.createFileid(_this.infoData[i].url);
  898. if (_fileid) {
  899. _this.infoData[i].fileid = _fileid;
  900. _this.$forceUpdate();
  901. fileid.push(_fileid);
  902. }
  903. }
  904. }
  905. }
  906. console.log("fileid=========", fileid);
  907. let mclass = [];
  908. if (_this.courseTypeId.length) {
  909. for (var i = 0; i < _this.courseTypeId.length; i++) {
  910. let _sid = _this.courseTypeId[i];
  911. for (
  912. var j = 0;
  913. j <
  914. _this.CourseTypeJson["34628934-d02f-11ec-8c78-005056b86db5"].length;
  915. j++
  916. ) {
  917. if (
  918. _sid ==
  919. _this.CourseTypeJson["34628934-d02f-11ec-8c78-005056b86db5"][j].id
  920. ) {
  921. mclass.push(
  922. _this.CourseTypeJson["34628934-d02f-11ec-8c78-005056b86db5"][j]
  923. .name
  924. );
  925. }
  926. }
  927. }
  928. }
  929. let message = "";
  930. if (type == 1) {
  931. if(!_this.outline){
  932. _this.$message.error("请先生成大纲内容");
  933. return;
  934. }
  935. message = `NOTICE
  936. Role: 你是ppt内容设计大师,能力是从用户提供的文件资料中提取最重要的学科概念作为ppt参考内容,最后根据Context要求的流程要求输出ppt内容。
  937. Output: Provide your output in json format.
  938. Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.
  939. ATTENTION: Use '##' to SPLIT SECTIONS, not '#'. Output format carefully referenced "Format example".
  940. Instruction: Based on the context, follow "Format example", write content.
  941. # Context
  942. ## 任务
  943. 你会收到一节课的教学ppt大纲<大纲内容>,你需要细化大纲每个部分(除了测试题部分),生成详细每一页ppt的内容参考#每一页输出格式。
  944. # 目标
  945. 生成教师可用直接拿来上课的ppt,ppt中用亲切的口吻告诉学生,他们该做什么,以及介绍相关的知识点(知识点需要详细的说明)。必要时使用bullet point。最终生成12页左右的ppt。
  946. # 每一页输出格式
  947. - 页数:序列数字
  948. - 标题:环节
  949. - 子标题:步骤或者知识点或测试题序号
  950. - 内容:用亲切的口吻告诉学生本步骤应做什么?或者是用亲切的口吻向学生介绍知识点,多条时可使用bullet point;或者是给学生测试题。
  951. ## 大纲内容
  952. ${_this.outline.replaceAll('#', '').replaceAll('*', '').replaceAll('-', '').replaceAll('\n', '')}
  953. # Format example
  954. [{"page": "页码(数字)","title": "学科概念(请从给你的大纲中摘取)(标题)","task": "知识点(请从给你的大纲中摘取)(子标题)","points": "内容:用亲切的口吻告诉学生本步骤应做什么?或者是用亲切的口吻向学生介绍知识点,多条时可使用bullet point;或者是给学生测试题。"}]`;
  955. } else {
  956. if (this.courseState == 4) {
  957. message = `# 任务
  958. 请根据参考资料,生成关于${this.courseName},为教师生成这节课的教学ppt的大纲,大纲的主要内容课程知识点的讲解与相关练习和测试。你的输出应该符合#输出格式
  959. ${mclass.length ? "#参考资料\n面向年级:" + mclass.join(",") : ""}
  960. # 输出格式
  961. - 标题:
  962. --步骤
  963. --知识点
  964. # 限制
  965. - 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
  966. - 你不能输出违反伦理的内容`;
  967. } else if (this.courseState == 5) {
  968. message = `# 任务
  969. 请根据<任务教案>,为教师生成本的教学ppt的大纲,大纲包含各环节的步骤,学科知识点。
  970. # 参考资料
  971. 任务教案:${_this.unitJson[0].chapterInfo[0].taskJson[_this.lineCount].taskDetail3.replaceAll('#', '').replaceAll('*', '').replaceAll('-', '').replaceAll('\n', '')}
  972. ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
  973. # 输出格式
  974. - 标题:
  975. --步骤
  976. --知识点
  977. # 限制
  978. - 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
  979. - 你不能输出违反伦理的内容
  980. `
  981. }
  982. }
  983. this.url = "";
  984. this.uJson = {};
  985. // let params = JSON.stringify({
  986. // // "model": "Chat",
  987. // model: 'gpt-3.5-turbo',
  988. // temperature: 0,
  989. // max_tokens: 4096,
  990. // top_p: 1,
  991. // frequency_penalty: 0,
  992. // presence_penalty: 0,
  993. // messages: [{
  994. // content: message,
  995. // role: 'user'
  996. // }],
  997. // stream: false,
  998. // uid: this.userid,
  999. // mind_map_question: "",
  1000. // })
  1001. // _this.loading = true
  1002. // _this.ajax.post('https://gpt4.cocorobo.cn/chat', params).then(function (response) {
  1003. // console.log(response);
  1004. // let data = response.data.FunctionResponse
  1005. // if (data.choices && data.choices.length && data.choices[0].message) {
  1006. // console.log(data.choices[0].message.content);
  1007. // try {
  1008. // let _data = JSON.parse(data.choices[0].message.content)
  1009. // _this.createPpt(_data)
  1010. // } catch (e) {
  1011. // console.log('error_________________'+e);
  1012. // _this.$message.error(data.choices[0].message.content)
  1013. // _this.loading = false
  1014. // }
  1015. // }
  1016. // }).catch(function (error) {
  1017. // _this.loading = false
  1018. // console.log(error);
  1019. // });
  1020. _this.stopPpt = _this.ajax.setCancelSource();
  1021. let parm = {
  1022. assistant_id:
  1023. type == 1
  1024. ? "6063369f-289a-11ef-8bf4-12e77c4cb76b"
  1025. : "f8e1ebb2-2e0d-11ef-8bf4-12e77c4cb76b",
  1026. message: [{ type: "text", text: message.replaceAll('\n', " ") }],
  1027. session_name: uuidv4(),
  1028. userId: this.userid,
  1029. file_ids: fileid.length ? [...fileid] : "",
  1030. model: 'gpt-4o-2024-08-06',
  1031. };
  1032. _this.loading = true;
  1033. this.ajax
  1034. .post("https://gpt4.cocorobo.cn/ai_agent_park_chat", parm, _this.stopPpt)
  1035. .then((response) => {
  1036. console.log(response);
  1037. let data = response.data.FunctionResponse;
  1038. if (data.message) {
  1039. console.log(data.message);
  1040. if (type == 1) {
  1041. try {
  1042. let _data = JSON.parse(
  1043. data.message.replaceAll("```json", "").replaceAll("```", "")
  1044. );
  1045. _this.createPpt(_data);
  1046. _this.steps = 2;
  1047. } catch (e) {
  1048. console.log("error_________________" + e);
  1049. // _this.$message.error(data.message)
  1050. try {
  1051. let regex = new RegExp("(?<=```json)([\\s\\S]*?)(?=```)");
  1052. let match = data.message.match(regex);
  1053. let _data2 = JSON.parse(match[0]);
  1054. _this.createPpt(_data2);
  1055. _this.steps = 2;
  1056. // let _data = JSON.parse(data.message.match(/(?<=```json).*?(?=```)/)[0])
  1057. // var message = data.message;
  1058. // var jsonStart = message.indexOf("```json") + 7; // `+ 7` 是为了跳过 ```json
  1059. // var jsonEnd = message.indexOf("```", jsonStart);
  1060. // if (jsonStart !== -1 && jsonEnd !== -1) {
  1061. // var jsonString = message
  1062. // .substring(jsonStart, jsonEnd)
  1063. // .trim();
  1064. // var _data2 = JSON.parse(jsonString);
  1065. // _this.createPpt(_data2);
  1066. // _this.steps = 2;
  1067. // } else {
  1068. // _this.$message.error("生成失败,正在重新生成");
  1069. // _this.aiGet(type);
  1070. // }
  1071. } catch (error) {
  1072. _this.$message.error("生成失败,正在重新生成");
  1073. _this.loading = false;
  1074. _this.stopPpt = null
  1075. _this.aiGet(type);
  1076. }
  1077. }
  1078. } else {
  1079. _this.outline = data.message;
  1080. _this.steps = 1;
  1081. _this.stopPpt = null
  1082. _this.loading = false;
  1083. }
  1084. }
  1085. })
  1086. .catch((error) => {
  1087. _this.loading = false;
  1088. _this.stopPpt = null
  1089. console.log(error);
  1090. });
  1091. },
  1092. generateRandomNumber(min, max) {
  1093. // min 是随机数范围的最小值,max 是随机数范围的最大值
  1094. return Math.floor(Math.random() * (max - min + 1)) + min;
  1095. },
  1096. createPpt(arr) {
  1097. let array = arr
  1098. // 1. 创建PPT
  1099. const pres = new Pptxgen();
  1100. const _slideTou = pres.addSlide();
  1101. _slideTou.background = { path: this.templateList[this.templateIndex].img1.img }
  1102. let title = ''
  1103. if (this.courseState == 4) {
  1104. title = this.courseName
  1105. } else if (this.courseState == 5) {
  1106. title = this.unitJson[0].chapterInfo[0].taskJson[this.lineCount].task
  1107. }
  1108. _slideTou.addText(title, this.templateList[this.templateIndex].img1.setting);
  1109. for (var i = 0; i < array.length; i++) {
  1110. // 2. 创建一个PPT页面,每调用一次 pres.addSlide() 都可以生成一张新的页面
  1111. // 建议把每个页面的构造抽成一个个函数,然后通过函数调用生成新页面,代码不会很乱
  1112. const _slide = pres.addSlide();
  1113. const randomNum = this.generateRandomNumber(0, (this.templateList[this.templateIndex].img2.length - 1))
  1114. let pContent = this.templateList[this.templateIndex].img2[randomNum]
  1115. _slide.background = { path: pContent.img }
  1116. // 3. 调用addTetx(),在PPT页面中插入文字“Hello World from PptxGenJS...”
  1117. // 括号里面是对文字的配置,文字横坐标x为1.5,纵坐标y为1.5,字体颜色 363636……
  1118. // 关于坐标长度与px的转换 x 1 = 127~128px 左右
  1119. const page = i + 1 > 10 ? i + 1 : "0" + (i + 1);
  1120. if(pContent.square){
  1121. _slide.addText("", pContent.square);
  1122. _slide.addText("", pContent.square2);
  1123. }
  1124. if(pContent.image){
  1125. _slide.addImage(pContent.image);
  1126. }
  1127. const tempResult1 = page + " " + array[i].title;
  1128. _slide.addText(tempResult1, pContent.title);
  1129. const tempResult2 = array[i].task;
  1130. _slide.addText(tempResult2, pContent.subTitle);
  1131. let tempResult3 = '';
  1132. if (typeof array[i].points == 'object') {
  1133. if (Array.isArray(array[i].points)) {
  1134. for(var k = 0; k < array[i].points.length; k++){
  1135. array[i].points[k] = '· '+array[i].points[k]
  1136. }
  1137. tempResult3 = array[i].points.join('\n')
  1138. } else {
  1139. tempResult3 = JSON.stringify(array[i].points)
  1140. }
  1141. } else {
  1142. tempResult3 = array[i].points
  1143. }
  1144. _slide.addText(tempResult3, pContent.content);
  1145. }
  1146. const _slideWei = pres.addSlide();
  1147. _slideWei.background = { path: this.templateList[this.templateIndex].imgEnd.img }
  1148. _slideWei.addText("谢谢观看,下课!", this.templateList[this.templateIndex].imgEnd.setting);
  1149. // 获取PPTX文件的ArrayBuffer
  1150. // 保存为 Blob 并处理
  1151. pres.write("blob").then((blob) => {
  1152. // 现在你有了一个 Blob 对象
  1153. console.log(blob);
  1154. const file = new File([blob], title + ".pptx", {
  1155. type: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
  1156. });
  1157. console.log(pres);
  1158. this.beforeUpload(file);
  1159. });
  1160. },
  1161. beforeUpload(event) {
  1162. var file = event;
  1163. var credentials = {
  1164. accessKeyId: "AKIATLPEDU37QV5CHLMH",
  1165. secretAccessKey: "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",
  1166. }; //秘钥形式的登录上传
  1167. window.AWS.config.update(credentials);
  1168. window.AWS.config.region = "cn-northwest-1"; //设置区域
  1169. var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
  1170. var _this = this;
  1171. if (file) {
  1172. var params = {
  1173. Key:
  1174. file.name.split(".")[0] +
  1175. new Date().getTime() +
  1176. "." +
  1177. file.name.split(".")[file.name.split(".").length - 1],
  1178. ContentType: file.type,
  1179. Body: file,
  1180. "Access-Control-Allow-Credentials": "*",
  1181. ACL: "public-read",
  1182. }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
  1183. var options = {
  1184. partSize: 2048 * 1024 * 1024,
  1185. queueSize: 2,
  1186. leavePartsOnError: true,
  1187. };
  1188. bucket
  1189. .upload(params, options)
  1190. .on("httpUploadProgress", function (evt) {
  1191. //这里可以写进度条
  1192. // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
  1193. })
  1194. .send(function (err, data) {
  1195. _this.loading = false;
  1196. if (err) {
  1197. _this.$message.error("上传失败");
  1198. } else {
  1199. _this.url = data.Location;
  1200. _this.uJson = {
  1201. name: file.name,
  1202. url: data.Location,
  1203. type: 3,
  1204. };
  1205. console.log(data.Location);
  1206. }
  1207. });
  1208. }
  1209. },
  1210. changeTemplate(index) {
  1211. this.templateIndex = index;
  1212. }
  1213. },
  1214. };
  1215. </script>
  1216. <style scoped>
  1217. .dialog_diy>>>.el-dialog {
  1218. height: auto;
  1219. margin: 15vh auto 0 !important;
  1220. }
  1221. .dialog_diy>>>.el-dialog__header {
  1222. background: #454545 !important;
  1223. padding: 15px 20px;
  1224. }
  1225. .dialog_diy>>>.el-dialog__body {
  1226. height: calc(100% - 124px);
  1227. box-sizing: border-box;
  1228. padding: 0px;
  1229. }
  1230. .dialog_diy>>>.el-dialog__title {
  1231. color: #fff;
  1232. }
  1233. .dialog_diy>>>.el-dialog__headerbtn {
  1234. top: 19px;
  1235. }
  1236. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  1237. color: #fff;
  1238. }
  1239. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  1240. color: #fff;
  1241. }
  1242. .dialog_diy>>>.el-dialog__body,
  1243. .dialog_diy>>>.el-dialog__footer {
  1244. background: #fafafa;
  1245. }
  1246. .binfo_input {
  1247. width: 100%;
  1248. margin: 0;
  1249. padding: 5px 7px;
  1250. display: block;
  1251. min-width: 0;
  1252. outline: none;
  1253. box-sizing: border-box;
  1254. background: none;
  1255. border: none;
  1256. border-radius: 4px;
  1257. background: #fff;
  1258. font-size: 15px;
  1259. resize: none;
  1260. font-family: "Microsoft YaHei";
  1261. min-height: 48px;
  1262. /* border: 1px solid #3682fc00; */
  1263. border: 1.5px solid #cad1dc;
  1264. }
  1265. .binfo_textarea {
  1266. border: 1.5px solid #cad1dc;
  1267. font-size: 15px;
  1268. resize: none;
  1269. /* background: #f6f6f6; */
  1270. font-family: "Microsoft YaHei";
  1271. }
  1272. .binfo_textarea:focus-visible {
  1273. border: 1.5px solid #3681fc !important;
  1274. }
  1275. .binfo_textarea::-webkit-scrollbar {
  1276. /*滚动条整体样式*/
  1277. width: 6px;
  1278. /*高宽分别对应横竖滚动条的尺寸*/
  1279. height: 6px;
  1280. }
  1281. /*定义滚动条轨道 内阴影+圆角*/
  1282. .binfo_textarea::-webkit-scrollbar {
  1283. border-radius: 10px;
  1284. background-color: #eee;
  1285. }
  1286. /*定义滑块 内阴影+圆角*/
  1287. .binfo_textarea::-webkit-scrollbar-thumb {
  1288. border-radius: 10px;
  1289. -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  1290. background-color: rgba(0, 0, 0, 0.1);
  1291. }
  1292. .t_box {
  1293. display: flex;
  1294. margin-bottom: 15px;
  1295. display: flex;
  1296. justify-content: space-between;
  1297. }
  1298. .t_box>span:nth-child(1) {
  1299. min-width: 80px;
  1300. font-size: 16px;
  1301. color: #000;
  1302. }
  1303. .template_box {
  1304. width: 250px;
  1305. }
  1306. .template_box>.title {
  1307. font-size: 18px;
  1308. margin-bottom: 10px;
  1309. display: block;
  1310. }
  1311. .template_list {
  1312. overflow: auto;
  1313. width: 100%;
  1314. height: calc(100% - 31px);
  1315. }
  1316. .template_item {
  1317. cursor: pointer;
  1318. width: 100%;
  1319. height: 165px;
  1320. overflow: hidden;
  1321. border-radius: 5px;
  1322. box-sizing: border-box;
  1323. border: 5px solid #e5e5e5ee;
  1324. }
  1325. .template_item+.template_item {
  1326. margin-top: 10px;
  1327. }
  1328. .template_item.active {
  1329. border: 5px solid #0061ff;
  1330. }
  1331. .template_item>img {
  1332. width: 100%;
  1333. height: 100%;
  1334. object-fit: cover;
  1335. }
  1336. .stopBtn{
  1337. z-index: 999999;
  1338. position: absolute;
  1339. left: 50%;
  1340. top: calc(50% + 70px);
  1341. transform: translateX(-50%);
  1342. }
  1343. </style>