|
@@ -11,8 +11,8 @@
|
|
|
</el-radio-group>
|
|
|
</div> -->
|
|
|
<div class="t_box" v-if="steps == 1" style="height: 100%">
|
|
|
- <textarea style="height: 100%;width:calc(100% - 260px)" rows="10" class="binfo_input binfo_textarea" cols
|
|
|
- placeholder="请生成大纲" v-model="outline"></textarea>
|
|
|
+ <textarea style="height: 100%;width:calc(100% - 260px)" rows="10" class="binfo_input binfo_textarea"
|
|
|
+ cols placeholder="请生成大纲" v-model="outline"></textarea>
|
|
|
<div class="template_box">
|
|
|
<span class="title">选择模板</span>
|
|
|
<div class="template_list">
|
|
@@ -31,7 +31,7 @@
|
|
|
<el-button @click="aiGet(2)" type="primary" :disabled="loading">重新生成大纲</el-button>
|
|
|
<el-button @click="aiGet(1)" type="primary" :disabled="loading">{{
|
|
|
url ? "重新生成PPT" : "生成PPT"
|
|
|
- }}</el-button>
|
|
|
+ }}</el-button>
|
|
|
<el-button @click="steps = 1" type="primary" v-if="steps == 2">上一步</el-button>
|
|
|
<el-button @click="steps = 2" type="primary" v-else-if="steps == 1 && url">下一步</el-button>
|
|
|
<el-button @click="confirm" type="primary">确 定</el-button>
|
|
@@ -111,17 +111,393 @@ export default {
|
|
|
uJson: {},
|
|
|
outline: "",
|
|
|
steps: 1,
|
|
|
+ // templateList: [
|
|
|
+ // // { 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' },
|
|
|
+ // // { 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' },
|
|
|
+ // // { 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' },
|
|
|
+ // // { 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' },
|
|
|
+ // // { 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' },
|
|
|
+ // { img: require('../../../assets/icon/ppt/model1-1.png'), img2: require('../../../assets/icon/ppt/model1-2.png'),color:'17094F' },
|
|
|
+ // { img: require('../../../assets/icon/ppt/model2-1.png'), img2: require('../../../assets/icon/ppt/model2-2.png'),color:'052B37' },
|
|
|
+ // { img: require('../../../assets/icon/ppt/model3-1.png'), img2: require('../../../assets/icon/ppt/model3-2.png'),color:'1D5869' },
|
|
|
+ // { img: require('../../../assets/icon/ppt/model4-1.png'), img2: require('../../../assets/icon/ppt/model4-2.png'),color:'372213' },
|
|
|
+ // { img: require('../../../assets/icon/ppt/model5-1.png'), img2: require('../../../assets/icon/ppt/model5-2.png'),color:'674D40' },
|
|
|
+ // ],
|
|
|
templateList: [
|
|
|
- // { 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' },
|
|
|
- // { 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' },
|
|
|
- // { 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' },
|
|
|
- // { 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' },
|
|
|
- // { 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' },
|
|
|
- { img: require('../../../assets/icon/ppt/model1-1.png'), img2: require('../../../assets/icon/ppt/model1-2.png'),color:'17094F' },
|
|
|
- { img: require('../../../assets/icon/ppt/model2-1.png'), img2: require('../../../assets/icon/ppt/model2-2.png'),color:'052B37' },
|
|
|
- { img: require('../../../assets/icon/ppt/model3-1.png'), img2: require('../../../assets/icon/ppt/model3-2.png'),color:'1D5869' },
|
|
|
- { img: require('../../../assets/icon/ppt/model4-1.png'), img2: require('../../../assets/icon/ppt/model4-2.png'),color:'372213' },
|
|
|
- { img: require('../../../assets/icon/ppt/model5-1.png'), img2: require('../../../assets/icon/ppt/model5-2.png'),color:'674D40' },
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model1-1.png'),
|
|
|
+ img1: {
|
|
|
+ img: require('../../../assets/icon/ppt/model1-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '17094F',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ img2: [
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model1-2.png'),
|
|
|
+ title: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.1,
|
|
|
+ w: "90%",
|
|
|
+ color: '17094F',
|
|
|
+ bold: true,
|
|
|
+ fontSize: 35, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ subTitle: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.8,
|
|
|
+ w: "90%",
|
|
|
+ color: "222222",
|
|
|
+ fontSize: 20, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ x: "20%", // 横坐标
|
|
|
+ y: 3.2,
|
|
|
+ w: "60%",
|
|
|
+ color: "444444",
|
|
|
+ fontSize: 18, // 字号
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ imgEnd: {
|
|
|
+ img: require('../../../assets/icon/ppt/model1-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '17094F',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model2-1.png'),
|
|
|
+ img1: {
|
|
|
+ img: require('../../../assets/icon/ppt/model2-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '052B37',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ img2: [
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model2-2.png'),
|
|
|
+ title: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.1,
|
|
|
+ w: "90%",
|
|
|
+ color: '052B37',
|
|
|
+ bold: true,
|
|
|
+ fontSize: 35, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ subTitle: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.8,
|
|
|
+ w: "90%",
|
|
|
+ color: "222222",
|
|
|
+ fontSize: 20, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ x: "20%", // 横坐标
|
|
|
+ y: 3.2,
|
|
|
+ w: "60%",
|
|
|
+ color: "444444",
|
|
|
+ fontSize: 18, // 字号
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ imgEnd: {
|
|
|
+ img: require('../../../assets/icon/ppt/model2-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '052B37',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model3-1.png'),
|
|
|
+ img1: {
|
|
|
+ img: require('../../../assets/icon/ppt/model3-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '1D5869',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ img2: [
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model3-2.png'),
|
|
|
+ title: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.1,
|
|
|
+ w: "90%",
|
|
|
+ color: '1D5869',
|
|
|
+ bold: true,
|
|
|
+ fontSize: 35, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ subTitle: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.8,
|
|
|
+ w: "90%",
|
|
|
+ color: "222222",
|
|
|
+ fontSize: 20, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ x: "20%", // 横坐标
|
|
|
+ y: 3.2,
|
|
|
+ w: "60%",
|
|
|
+ color: "444444",
|
|
|
+ fontSize: 18, // 字号
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ imgEnd: {
|
|
|
+ img: require('../../../assets/icon/ppt/model3-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '1D5869',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model4-1.png'),
|
|
|
+ img1: {
|
|
|
+ img: require('../../../assets/icon/ppt/model4-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '372213',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ img2: [
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model4-2.png'),
|
|
|
+ title: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.1,
|
|
|
+ w: "90%",
|
|
|
+ color: '372213',
|
|
|
+ bold: true,
|
|
|
+ fontSize: 35, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ subTitle: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.8,
|
|
|
+ w: "90%",
|
|
|
+ color: "222222",
|
|
|
+ fontSize: 20, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ x: "20%", // 横坐标
|
|
|
+ y: 3.2,
|
|
|
+ w: "60%",
|
|
|
+ color: "444444",
|
|
|
+ fontSize: 18, // 字号
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ imgEnd: {
|
|
|
+ img: require('../../../assets/icon/ppt/model4-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '372213',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ color: '372213'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model5-1.png'),
|
|
|
+ img1: {
|
|
|
+ img: require('../../../assets/icon/ppt/model5-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '674D40',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ img2: [
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model5-2.png'),
|
|
|
+ title: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.1,
|
|
|
+ w: "90%",
|
|
|
+ color: '674D40',
|
|
|
+ bold: true,
|
|
|
+ fontSize: 35, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ subTitle: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.8,
|
|
|
+ w: "90%",
|
|
|
+ color: "222222",
|
|
|
+ fontSize: 20, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ x: "20%", // 横坐标
|
|
|
+ y: 3.2,
|
|
|
+ w: "60%",
|
|
|
+ color: "444444",
|
|
|
+ fontSize: 18, // 字号
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ imgEnd: {
|
|
|
+ img: require('../../../assets/icon/ppt/model5-1.png'),
|
|
|
+ setting: {
|
|
|
+ x: "5%",
|
|
|
+ y: 3,
|
|
|
+ w: "90%",
|
|
|
+ color: '674D40',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model6-1.png'),
|
|
|
+ img1: {
|
|
|
+ img: require('../../../assets/icon/ppt/model6-1-2.png'),
|
|
|
+ setting: {
|
|
|
+ x: "35%",
|
|
|
+ y: 2.3,
|
|
|
+ w: "60%",
|
|
|
+ bold: true,
|
|
|
+ color: 'EA7A93',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ img2: [
|
|
|
+ {
|
|
|
+ img:require('../../../assets/icon/ppt/model6-2.png'),
|
|
|
+ title: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.1,
|
|
|
+ w: "90%",
|
|
|
+ color: '4F73DA',
|
|
|
+ bold: true,
|
|
|
+ fontSize: 35, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ subTitle: {
|
|
|
+ x: "5%", // 横坐标
|
|
|
+ y: 1.8,
|
|
|
+ w: "90%",
|
|
|
+ color: "333333",
|
|
|
+ fontSize: 20, // 字号
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ x: "20%", // 横坐标
|
|
|
+ y: 3.2,
|
|
|
+ w: "60%",
|
|
|
+ color: "333333",
|
|
|
+ fontSize: 18, // 字号
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ img: require('../../../assets/icon/ppt/model6-2.png'),
|
|
|
+ title: {
|
|
|
+ x: "2.5%", // 横坐标
|
|
|
+ y: 2.3,
|
|
|
+ w: "30%",
|
|
|
+ color: 'ffffff',
|
|
|
+ bold: true,
|
|
|
+ fontSize: 35, // 字号
|
|
|
+ align: "left",
|
|
|
+ },
|
|
|
+ subTitle: {
|
|
|
+ x: "2.5%", // 横坐标
|
|
|
+ y: 3.1,
|
|
|
+ w: "30%",
|
|
|
+ color: "ffffff",
|
|
|
+ fontSize: 20, // 字号
|
|
|
+ align: "left",
|
|
|
+ },
|
|
|
+ content: {
|
|
|
+ x: "45%", // 横坐标
|
|
|
+ y: 2.8,
|
|
|
+ w: "45%",
|
|
|
+ color: "333333",
|
|
|
+ fontSize: 18, // 字号
|
|
|
+ align: "left",
|
|
|
+ },
|
|
|
+ square: {
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ w: "35%",
|
|
|
+ h: "100%",
|
|
|
+ fill: { color: "4F73DA" }
|
|
|
+ },
|
|
|
+ square2: {
|
|
|
+ x: "35%",
|
|
|
+ y: 0,
|
|
|
+ w: "2.5%",
|
|
|
+ h: "100%",
|
|
|
+ fill: { color: "C2CFEF" }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ imgEnd: {
|
|
|
+ img: require('../../../assets/icon/ppt/model6-1-2.png'),
|
|
|
+ setting: {
|
|
|
+ x: "35%",
|
|
|
+ y: 2.3,
|
|
|
+ w: "60%",
|
|
|
+ color: 'EA7A93',
|
|
|
+ fontSize: 38,
|
|
|
+ align: "center",
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
],
|
|
|
templateIndex: 0,
|
|
|
};
|
|
@@ -131,6 +507,9 @@ export default {
|
|
|
if (newValue) {
|
|
|
this.loading = false;
|
|
|
this.aiGet(2);
|
|
|
+ // this.templateIndex = 5
|
|
|
+ // this.createPpt();
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
},
|
|
@@ -253,12 +632,12 @@ Instruction: Based on the context, follow "Format example", write content.
|
|
|
- 内容:用亲切的口吻告诉学生本步骤应做什么?或者是用亲切的口吻向学生介绍知识点,多条时可使用bullet point;或者是给学生测试题。
|
|
|
|
|
|
## 大纲内容
|
|
|
-${_this.outline.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
|
|
|
+${_this.outline.replaceAll('#', '').replaceAll('*', '').replaceAll('-', '').replaceAll('\n', '')}
|
|
|
|
|
|
# Format example
|
|
|
[{"page": "页码(数字)","title": "学科概念(请从给你的大纲中摘取)(标题)","task": "知识点(请从给你的大纲中摘取)(子标题)","points": "内容:用亲切的口吻告诉学生本步骤应做什么?或者是用亲切的口吻向学生介绍知识点,多条时可使用bullet point;或者是给学生测试题。"}]`;
|
|
|
} else {
|
|
|
- if(this.courseState == 4){
|
|
|
+ if (this.courseState == 4) {
|
|
|
message = `# 任务
|
|
|
请根据参考资料,生成关于${this.courseName},为教师生成这节课的教学ppt的大纲,大纲的主要内容课程知识点的讲解与相关练习和测试。你的输出应该符合#输出格式
|
|
|
|
|
@@ -272,12 +651,12 @@ ${mclass.length ? "#参考资料\n面向年级:" + mclass.join(",") : ""}
|
|
|
# 限制
|
|
|
- 你不能输出错误的知识,如果你实在不清楚,输出“对不起,我不确定”
|
|
|
- 你不能输出违反伦理的内容`;
|
|
|
- }else if(this.courseState == 5){
|
|
|
+ } else if (this.courseState == 5) {
|
|
|
message = `# 任务
|
|
|
请根据<任务教案>,为教师生成本的教学ppt的大纲,大纲包含各环节的步骤,学科知识点。
|
|
|
|
|
|
# 参考资料
|
|
|
-任务教案:${_this.unitJson[0].chapterInfo[0].taskJson[_this.lineCount].taskDetail3.replaceAll('#','').replaceAll('*','').replaceAll('-','').replaceAll('\n','')}
|
|
|
+任务教案:${_this.unitJson[0].chapterInfo[0].taskJson[_this.lineCount].taskDetail3.replaceAll('#', '').replaceAll('*', '').replaceAll('-', '').replaceAll('\n', '')}
|
|
|
${mclass.length ? "面向年级:" + mclass.join(",") : ""}
|
|
|
|
|
|
# 输出格式
|
|
@@ -400,82 +779,139 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
|
|
|
console.log(error);
|
|
|
});
|
|
|
},
|
|
|
- createPpt(array) {
|
|
|
+ generateRandomNumber(min, max) {
|
|
|
+ // min 是随机数范围的最小值,max 是随机数范围的最大值
|
|
|
+ return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
|
+ },
|
|
|
+ createPpt(arr) {
|
|
|
+ let array = arr
|
|
|
+ // let array = [
|
|
|
+ // {
|
|
|
+ // "page": 1,
|
|
|
+ // "title": "引入阶段",
|
|
|
+ // "task": "课程背景",
|
|
|
+ // "points": "同学们,让我们一起了解一下这门有趣的熊猫课程吧!今天,我们将探索熊猫的生活环境,并尝试去理解这些环境是如何影响熊猫的生存的。"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 2,
|
|
|
+ // "title": "引入阶段",
|
|
|
+ // "task": "整体目标和任务要求",
|
|
|
+ // "points": "这门课程的主要目标是让大家了解熊猫生活的环境以及生存所需的关键因素。我们将完成一个任务,具体要求是观察、记录、绘制和制作模型哦!"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 3,
|
|
|
+ // "title": "引入阶段",
|
|
|
+ // "task": "驱动性问题",
|
|
|
+ // "points": "大家思考一下这样一个问题:‘熊猫的生活环境对它们的生存有何重要影响?’ 我们接下去的活动将帮助大家找到答案。"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 4,
|
|
|
+ // "title": "引入阶段",
|
|
|
+ // "task": "观察与记录技巧",
|
|
|
+ // "points": "今天我们会运用图片和视频,来帮助大家观察熊猫栖息地和它们所吃的竹子等特征。细心观察,并将所见的特征记录下来是非常重要的技能哦!"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 5,
|
|
|
+ // "title": "探究阶段",
|
|
|
+ // "task": "绘图工具和材料",
|
|
|
+ // "points": "现在我们分发绘图工具和材料,来学习基本的绘图和建模技巧吧!熟练掌握这些工具会帮助我们更好地记录和展示我们的观察结果。"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 6,
|
|
|
+ // "title": "探究阶段",
|
|
|
+ // "task": "观察和记录特征",
|
|
|
+ // "points": "让我们好好观察一下身边的常见物体,把它们的特征记录下来。这个过程会训练你们的观察力和手眼协调能力。"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 7,
|
|
|
+ // "title": "探究阶段",
|
|
|
+ // "task": "转换二维图像",
|
|
|
+ // "points": "接下来,我们要把记录的三维物体转化为二维图像。这个步骤非常有趣,大家可以尽情发挥自己的绘画天赋哦!"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 8,
|
|
|
+ // "title": "探究阶段",
|
|
|
+ // "task": "三维模型制作",
|
|
|
+ // "points": "现在我们提供一些简单的材料,比如纸张和纸板,示范一下如何制作三维模型。记住,比例和结构是模型制作的关键!"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 9,
|
|
|
+ // "title": "评估与反馈阶段",
|
|
|
+ // "task": "评估和检查",
|
|
|
+ // "points": "大家完成了任务后,我们来检查和评估你们的二维图像和三维模型。确保它们的结构合理、比例协调。"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 10,
|
|
|
+ // "title": "评估与反馈阶段",
|
|
|
+ // "task": "提出改进建议",
|
|
|
+ // "points": "针对你们完成的作品,我们会提出一些改进建议。大家也可以相互评价,分享制作经验,这样可以互相学习哦!"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 11,
|
|
|
+ // "title": "评估与反馈阶段",
|
|
|
+ // "task": "任务总结",
|
|
|
+ // "points": "最后,我们要总结这次任务的执行情况,并表扬表现特别突出的同学。希望大家都能有所收获,并继续努力!"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 12,
|
|
|
+ // "title": "练习",
|
|
|
+ // "task": "练习1:二维图像绘制",
|
|
|
+ // "points": "选择一件日常物品(如书本、杯子),观察其特征,尝试通过手绘将其转换为二维图像。示例:通过绘制书本的正面、侧面和顶面图,展示其主要特征和比例关系。"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // "page": 13,
|
|
|
+ // "title": "练习",
|
|
|
+ // "task": "练习2:三维模型制作",
|
|
|
+ // "points": "使用纸张和纸板制作简单的模型,比如一个基本的房子或盒子。关注其结构和比例哦! 示例:通过折叠和粘贴纸张,制作一个四面体,确保各个面的比例协调,结构稳定。"
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
// 1. 创建PPT
|
|
|
const pres = new Pptxgen();
|
|
|
const _slideTou = pres.addSlide();
|
|
|
- _slideTou.background = { path: this.templateList[this.templateIndex].img }
|
|
|
+ _slideTou.background = { path: this.templateList[this.templateIndex].img1.img }
|
|
|
let title = ''
|
|
|
- if(this.courseState == 4){
|
|
|
+ if (this.courseState == 4) {
|
|
|
title = this.courseName
|
|
|
- }else if(this.courseState == 5){
|
|
|
+ } else if (this.courseState == 5) {
|
|
|
title = this.unitJson[0].chapterInfo[0].taskJson[this.lineCount].task
|
|
|
}
|
|
|
- _slideTou.addText(title, {
|
|
|
- x: "10%", // 横坐标
|
|
|
- y: 3,
|
|
|
- width: "90%",
|
|
|
- color: this.templateList[this.templateIndex].color,
|
|
|
- fontSize: 38, // 字号
|
|
|
- align: "center",
|
|
|
- });
|
|
|
+ _slideTou.addText(title, this.templateList[this.templateIndex].img1.setting);
|
|
|
for (var i = 0; i < array.length; i++) {
|
|
|
// 2. 创建一个PPT页面,每调用一次 pres.addSlide() 都可以生成一张新的页面
|
|
|
// 建议把每个页面的构造抽成一个个函数,然后通过函数调用生成新页面,代码不会很乱
|
|
|
const _slide = pres.addSlide();
|
|
|
- _slide.background = { path: this.templateList[this.templateIndex].img2 }
|
|
|
+ const randomNum = this.generateRandomNumber(0, (this.templateList[this.templateIndex].img2.length - 1))
|
|
|
+ let pContent = this.templateList[this.templateIndex].img2[randomNum]
|
|
|
+ _slide.background = { path: pContent.img }
|
|
|
|
|
|
// 3. 调用addTetx(),在PPT页面中插入文字“Hello World from PptxGenJS...”
|
|
|
// 括号里面是对文字的配置,文字横坐标x为1.5,纵坐标y为1.5,字体颜色 363636……
|
|
|
// 关于坐标长度与px的转换 x 1 = 127~128px 左右
|
|
|
const page = i + 1 > 10 ? i + 1 : "0" + (i + 1);
|
|
|
+
|
|
|
+ if(pContent.square){
|
|
|
+ _slide.addText("", pContent.square);
|
|
|
+ _slide.addText("", pContent.square2);
|
|
|
+ }
|
|
|
const tempResult1 = page + " " + array[i].title;
|
|
|
- _slide.addText(tempResult1, {
|
|
|
- x: "10%", // 横坐标
|
|
|
- y: 1.1,
|
|
|
- width: "90%",
|
|
|
- color: this.templateList[this.templateIndex].color,
|
|
|
- fontSize: 28, // 字号
|
|
|
- align: "center",
|
|
|
- });
|
|
|
+ _slide.addText(tempResult1, pContent.title);
|
|
|
const tempResult2 = array[i].task;
|
|
|
- _slide.addText(tempResult2, {
|
|
|
- x: "10%", // 横坐标
|
|
|
- y: 1.8,
|
|
|
- width: "90%",
|
|
|
- color: "222222",
|
|
|
- fontSize: 20, // 字号
|
|
|
- align: "center",
|
|
|
- });
|
|
|
+ _slide.addText(tempResult2, pContent.subTitle);
|
|
|
let tempResult3 = '';
|
|
|
if (typeof array[i].points == 'object') {
|
|
|
- if (Array.isArray(array[i].points)) {
|
|
|
+ if (Array.isArray(array[i].points)) {
|
|
|
tempResult3 = array[i].points.join('\n')
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
tempResult3 = JSON.stringify(array[i].points)
|
|
|
}
|
|
|
} else {
|
|
|
tempResult3 = array[i].points
|
|
|
}
|
|
|
- _slide.addText(tempResult3, {
|
|
|
- x: "20%", // 横坐标
|
|
|
- y: 3.2,
|
|
|
- w: "60%",
|
|
|
- color: "444444",
|
|
|
- fontSize: 18, // 字号
|
|
|
- align: "center",
|
|
|
- });
|
|
|
+ _slide.addText(tempResult3, pContent.content);
|
|
|
}
|
|
|
const _slideWei = pres.addSlide();
|
|
|
- _slideWei.background = { path: this.templateList[this.templateIndex].img }
|
|
|
- _slideWei.addText("谢谢观看,下课!", {
|
|
|
- x: "10%", // 横坐标
|
|
|
- y: 3,
|
|
|
- width: "90%",
|
|
|
- color: this.templateList[this.templateIndex].color,
|
|
|
- fontSize: 38, // 字号
|
|
|
- align: "center",
|
|
|
- });
|
|
|
+ _slideWei.background = { path: this.templateList[this.templateIndex].imgEnd.img }
|
|
|
+ _slideWei.addText("谢谢观看,下课!", this.templateList[this.templateIndex].imgEnd.setting);
|
|
|
// 获取PPTX文件的ArrayBuffer
|
|
|
|
|
|
// 保存为 Blob 并处理
|
|
@@ -615,27 +1051,27 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
|
|
|
}
|
|
|
|
|
|
.binfo_textarea:focus-visible {
|
|
|
- border: 1.5px solid #3681fc !important;
|
|
|
+ border: 1.5px solid #3681fc !important;
|
|
|
}
|
|
|
|
|
|
.binfo_textarea::-webkit-scrollbar {
|
|
|
- /*滚动条整体样式*/
|
|
|
- width: 6px;
|
|
|
- /*高宽分别对应横竖滚动条的尺寸*/
|
|
|
- height: 6px;
|
|
|
+ /*滚动条整体样式*/
|
|
|
+ width: 6px;
|
|
|
+ /*高宽分别对应横竖滚动条的尺寸*/
|
|
|
+ height: 6px;
|
|
|
}
|
|
|
|
|
|
/*定义滚动条轨道 内阴影+圆角*/
|
|
|
.binfo_textarea::-webkit-scrollbar {
|
|
|
- border-radius: 10px;
|
|
|
- background-color: #eee;
|
|
|
+ border-radius: 10px;
|
|
|
+ background-color: #eee;
|
|
|
}
|
|
|
|
|
|
/*定义滑块 内阴影+圆角*/
|
|
|
.binfo_textarea::-webkit-scrollbar-thumb {
|
|
|
- border-radius: 10px;
|
|
|
- -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
|
- background-color: rgba(0, 0, 0, 0.1);
|
|
|
+ border-radius: 10px;
|
|
|
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
|
+ background-color: rgba(0, 0, 0, 0.1);
|
|
|
}
|
|
|
|
|
|
.t_box {
|
|
@@ -651,20 +1087,23 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
|
|
|
color: #000;
|
|
|
}
|
|
|
|
|
|
-.template_box{
|
|
|
+.template_box {
|
|
|
width: 250px;
|
|
|
}
|
|
|
-.template_box > .title{
|
|
|
+
|
|
|
+.template_box>.title {
|
|
|
font-size: 18px;
|
|
|
margin-bottom: 10px;
|
|
|
display: block;
|
|
|
}
|
|
|
-.template_list{
|
|
|
+
|
|
|
+.template_list {
|
|
|
overflow: auto;
|
|
|
width: 100%;
|
|
|
height: calc(100% - 31px);
|
|
|
}
|
|
|
-.template_item{
|
|
|
+
|
|
|
+.template_item {
|
|
|
cursor: pointer;
|
|
|
width: 100%;
|
|
|
height: 165px;
|
|
@@ -673,13 +1112,16 @@ ${mclass.length ? "面向年级:" + mclass.join(",") : ""}
|
|
|
box-sizing: border-box;
|
|
|
border: 5px solid #e5e5e5ee;
|
|
|
}
|
|
|
-.template_item + .template_item{
|
|
|
+
|
|
|
+.template_item+.template_item {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
-.template_item.active{
|
|
|
+
|
|
|
+.template_item.active {
|
|
|
border: 5px solid #0061ff;
|
|
|
}
|
|
|
-.template_item > img{
|
|
|
+
|
|
|
+.template_item>img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
object-fit: cover;
|