xy 5 months ago
commit 1316abe92d
  1. 6
      .env.development
  2. 9
      pnpm-lock.yaml
  3. 12
      src/api/courseChaptersApi.ts
  4. BIN
      src/assets/images/100.png
  5. BIN
      src/assets/images/101.jpg
  6. BIN
      src/assets/images/102.jpg
  7. BIN
      src/assets/images/103.jpg
  8. BIN
      src/assets/images/104.jpg
  9. BIN
      src/assets/images/105.jpg
  10. BIN
      src/assets/images/106.jpg
  11. BIN
      src/assets/images/107.jpg
  12. BIN
      src/assets/images/108.jpg
  13. BIN
      src/assets/images/109.jpg
  14. BIN
      src/assets/images/110.jpg
  15. BIN
      src/assets/images/141.png
  16. BIN
      src/assets/images/142.png
  17. BIN
      src/assets/images/4c.jpeg
  18. BIN
      src/assets/images/R-C.png
  19. BIN
      src/assets/images/a.png
  20. BIN
      src/assets/images/o.jpg
  21. BIN
      src/assets/images/screen (1).png
  22. BIN
      src/assets/images/screen.png
  23. BIN
      src/assets/images/yt.png
  24. BIN
      src/assets/images/zstp.jpg
  25. 10
      src/router/routers.ts
  26. 12
      src/views/course/CourseObjectives.vue
  27. 430
      src/views/course/largeScreen.vue
  28. 1371
      src/views/portal/LearningPathRecommendations.vue

@ -1,4 +1,8 @@
# 变量必须以 VITE_ 为前缀才能暴露给外部读取
NODE_ENV = 'development'
VITE_APP_TITLE = '无糖运营平台'
VITE_APP_BASE_API = 'http://127.0.0.1:8080'
<<<<<<< HEAD
VITE_APP_BASE_API = 'http://127.0.0.1:8008'
=======
VITE_APP_BASE_API = 'http://39.106.16.162:8080'
>>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a

@ -1,8 +1,17 @@
lockfileVersion: '6.0'
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
<<<<<<< HEAD
=======
=======
>>>>>>> 1a620e19de970965f426e07348b1dbc4be900eaf
>>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a
dependencies:
3d-force-graph:

@ -96,8 +96,20 @@ export const deleteCourse = (params: any) => {
// 获取详情
export const getCourseInfo = (params: any) => {
return request({
<<<<<<< HEAD
url: '/objective_contents/' + params.id,
method: 'get',
// params
=======
<<<<<<< HEAD
url: '/api/objective_contents/' + params.id,
method: 'get',
params,
=======
url: '/objective_contents/' + params.id,
method: "get",
// params
>>>>>>> 1a620e19de970965f426e07348b1dbc4be900eaf
>>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a
})
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

@ -299,4 +299,14 @@ export const constantRoute: any = [
},
],
},
{
path: '/curriculumCenter/largeScreen',
component: () => import('@/views/course/largeScreen.vue'),
name: 'LargeScreen', // name 要与权限一致
meta: {
title: '课程图谱',
hidden: true,
icon: 'Notebook',
},
}
]

@ -3,7 +3,12 @@ import { ref, onMounted } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { id } from 'element-plus/es/locales.mjs'
import * as echarts from 'echarts'
<<<<<<< HEAD
// import { useRoute } from 'vue-router'
=======
<<<<<<< HEAD
import { useRoute } from 'vue-router'
>>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a
import {
getCourseList,
addCourse,
@ -11,7 +16,14 @@ import {
deleteCourse,
getCourseInfo,
} from '@/api/courseChaptersApi'
<<<<<<< HEAD
import { useRoute, useRouter } from 'vue-router'
=======
=======
import { useRoute ,useRouter} from 'vue-router'
import { getCourseList, addCourse, editCourse, deleteCourse, getCourseInfo } from '@/api/courseChaptersApi'
>>>>>>> 1a620e19de970965f426e07348b1dbc4be900eaf
>>>>>>> 991fa5ab08c56c84c5a276226f8fbc2ec78f859a
const route = useRoute()
const router = useRouter()
// id id

@ -0,0 +1,430 @@
<template>
<div>
<div class="container">
<div class="goto" @click="goBack">
<p>返回</p>
</div>
</div>
</div>
</template>
<script lang="ts" >
import * as d3 from 'd3';
import { useRouter } from 'vue-router'
// import portal from './portal/LearningPathRecommendations.vue'
// import { onMounted } from 'vue';
export default {
name: 'courseHomepage',
data() {
return {
svgArea: null,
links: [],
nodes: [],
nodesName: [],
linksName: [],
simulation: null,
scale: 1,
width: 800,
height: 635,
colorList: ['#91CC75', '#5470C6', '#FAC858', '#EE6666', '#73C0DE', '#EA7CCC', '#5577FF', '#5577FF', '#9DBFFF', '#78A7FF'],
// colorList: ['#E5A1D6', '#A893F5', '#D0A4FB', '#C3ACF6', '#FBBABB', '#8B81F7', '#A893F5', '#D0A4FB', '#C3ACF6', '#FBBABB'],
testGraph: {
"nodes": [],
"links": []
// "nodes": [
// { "id": "Myriel", "group": 8 },
// { "id": "Napoleon", "group": 2 },
// { "id": "Mlle.Baptistine", "group": 3 },
// { "id": "Mme.Magloire", "group": 1 },
// { "id": "CountessdeLo", "group": 5 },
// { "id": "Geborand", "group": 5 },
// { "id": "Champtercier", "group": 6 },
// { "id": "Cravatte", "group": 7 },
// { "id": "Count", "group": 8 },
// { "id": "OldMan", "group": 9 },
// { "id": "Labarre", "group": 5 },
// { "id": "Valjean", "group": 1 },
// { "id": "Marguerite", "group": 3 },
// { "id": "Mme.deR", "group": 2 },
// { "id": "Isabeau", "group": 5 },
// { "id": "Gervais", "group": 9 },
// { "id": "Tholomyes", "group": 8 },
// { "id": "Listolier", "group": 7 },
// { "id": "Fameuil", "group": 6 },
// { "id": "Blacheville", "group": 5 },
// { "id": "Favourite", "group": 4 },
// { "id": "Dahlia", "group": 3 },
// { "id": "Zephine", "group": 9 },
// { "id": "Fantine", "group": 3 },
// { "id": "Mme.Thenardier", "group": 4 },
// { "id": "Thenardier", "group": 4 },
// { "id": "Cosette", "group": 5 },
// { "id": "Javert", "group": 4 },
// { "id": "Fauchelevent", "group": 0 },
// { "id": "Bamatabois", "group": 2 },
// // { "id": "Mme.Hucheloup", "group": 8 }
// ],
// "links": [
// { "source": "Napoleon", "target": "Myriel", "value": 7 },
// { "source": "Mlle.Baptistine", "target": "Myriel", "value": 7 },
// { "source": "Mme.Magloire", "target": "Myriel", "value": 7 },
// { "source": "Mme.Magloire", "target": "Mlle.Baptistine", "value": 7 },
// { "source": "CountessdeLo", "target": "Myriel", "value": 7 },
// { "source": "Geborand", "target": "Myriel", "value": 7 },
// { "source": "Champtercier", "target": "Myriel", "value": 7 },
// { "source": "Cravatte", "target": "Myriel", "value": 7 },
// { "source": "Count", "target": "Myriel", "value": 7 },
// { "source": "OldMan", "target": "Myriel", "value": 7 },
// { "source": "Valjean", "target": "Labarre", "value": 7 },
// { "source": "Valjean", "target": "Mme.Magloire", "value": 7 },
// { "source": "Valjean", "target": "Mlle.Baptistine", "value": 3 },
// { "source": "Valjean", "target": "Myriel", "value": 5 },
// { "source": "Marguerite", "target": "Valjean", "value": 1 },
// { "source": "Mme.deR", "target": "Valjean", "value": 1 },
// { "source": "Isabeau", "target": "Valjean", "value": 1 },
// { "source": "Gervais", "target": "Valjean", "value": 1 },
// { "source": "Listolier", "target": "Tholomyes", "value": 4 },
// { "source": "Fameuil", "target": "Tholomyes", "value": 4 },
// { "source": "Fameuil", "target": "Listolier", "value": 4 },
// { "source": "Blacheville", "target": "Tholomyes", "value": 4 },
// { "source": "Blacheville", "target": "Listolier", "value": 4 },
// { "source": "Blacheville", "target": "Fameuil", "value": 4 },
// { "source": "Favourite", "target": "Tholomyes", "value": 3 },
// { "source": "Favourite", "target": "Listolier", "value": 3 },
// { "source": "Favourite", "target": "Fameuil", "value": 3 },
// { "source": "Favourite", "target": "Blacheville", "value": 4 },
// { "source": "Dahlia", "target": "Tholomyes", "value": 3 },
// { "source": "Dahlia", "target": "Listolier", "value": 3 },
// { "source": "Dahlia", "target": "Fameuil", "value": 3 },
// { "source": "Dahlia", "target": "Blacheville", "value": 3 },
// { "source": "Dahlia", "target": "Favourite", "value": 5 },
// { "source": "Zephine", "target": "Tholomyes", "value": 3 },
// { "source": "Zephine", "target": "Listolier", "value": 3 },
// { "source": "Zephine", "target": "Fameuil", "value": 3 },
// // { "source": "Mme.Hucheloup", "target": "Enjolras", "value": 1 }
// ]
// "links":[]
}
}
},
created() {
this.getGraphData()
},
// mounted() {
// this.initGraph(this.testGraph);
// },
methods: {
getGraphData(){
var _this = this
this.axios.get("person/"+'Rob Reiner')
// this.axios.get("person/all")
.then(function (response: { data: any; }) {
console.log(response)
_this.testGraph["nodes"] = [response.data]
_this.initGraph(_this.testGraph)
})
.catch(function (error: any) {
console.log(error)
})
},
initGraph(data: {
nodes: { id: string; group: number; }[]; links: { // import { onMounted } from 'vue';
source: string; target: string; value: number;
}[];
}) {
const _this = this;
const links = data.links;
const nodes = data.nodes;
const simulation = d3.forceSimulation(nodes)
.force("link", d3.forceLink(links).id((d: { id: any; }) => d.id))
.force("collide", d3.forceCollide().radius(() => 40))
.force("charge", d3.forceManyBody().strength(30))
.force("center", d3.forceCenter(_this.width / 2, _this.height / 2));
const svg = d3.select(".container")
.append("svg")
.attr("viewBox", `0 0 ${_this.width} ${_this.height}`)
// 线
const defs = svg.append("defs");
// initGraph 线
for (let i = 0; i < links.length; i++) {
const linearGradient = defs.append("linearGradient")
.attr("id", `line-gradient-${i}`)
.attr("x1", "0%")
.attr("y1", "0%")
.attr("x2", "100%")
.attr("y2", "100%");
linearGradient.append("stop")
.attr("offset", "0%")
.attr("stop-color", "#6C9DFC");
linearGradient.append("stop")
.attr("offset", "50%")
.attr("stop-color", "#9BAAFA");
linearGradient.append("stop")
.attr("offset", "100%")
.attr("stop-color", "#F3B1BC");
}
const g = svg.append("g")
// 线
const link = g.append("g")
.attr("stroke-opacity", 0.6)
.selectAll("line")
.data(links)
.join("line")
.style("stroke", (_d: any, i: any) => `url(#line-gradient-${i})`) // 使线
.style("stroke-width", (d: { value: number; }) => Math.sqrt(d.value))
.attr("class", "link")
.attr("marker-end", "url(#arrow)");
// //
// const marker = defs.append("marker")
// .attr("id", "arrow")
// .attr("viewBox", "0 -5 10 10")
// .attr("refX", 31)
// .attr("refY", 0)
// .attr("markerWidth", 6)
// .attr("markerHeight", 6)
// .attr("orient", "auto")
// .append("path")
// .attr("d", "M0,-5L10,0L0,5")
// .attr("fill", "#E0AAED");
svg.call(d3.zoom().on("zoom", function () {
g.attr("transform", d3.event.transform)
}))
//
const linkForce = d3.forceLink(links)
.id((d: { id: any; }) => d.id)
.distance(100); //
simulation.force("link", linkForce);
//
const node = g.append("g")
.selectAll("circle")
.data(nodes)
.join("circle")
.attr("r", 15)
.attr("class", "node")
.attr("fill", (d: { id: any; }) => {
return `url(#node-gradient-${d.id})`;
})
// .attr("fill", _this.color)
.on("click", _this.queryTest)
.call(_this.drag(simulation));
// initGraph 线
for (let i = 0; i < nodes.length; i++) {
const linearGradient = defs.append("linearGradient")
.attr("id", `node-gradient-${nodes[i].id}`)
.attr("x1", "0%")
.attr("y1", "0%")
.attr("x2", "0%")
.attr("y2", "100%");
linearGradient.append("stop")
.attr("offset", "0%")
.attr("stop-color", _this.colorList[nodes[i].group]);
linearGradient.append("stop")
.attr("offset", "100%")
.attr("stop-color", "#9BBCFC");
}
node.append("title")
.text((d: { id: any; }) => d.id);
const nodeNameText = g.append("g")
.selectAll("text")
.data(nodes)
.join("text")
.text(function (d: { id: any; }) {
return d.id
})
.attr("fill", "white")
// .attr("dx", function () {
// return this.getBoundingClientRect().width / 2 * (-1)
// })
.attr('x', (d: { x: any; }) => d.x)
.attr("y", 50)
.attr('text-anchor', 'middle')
.attr('alignment-baseline', 'middle')
.attr("class", "node-name")
.style('pointer-events', 'none')
.style('font-size', '15px')
.style('font-family', 'Arial')
.style('text-shadow', '1px 1px 1px #0052FF')
node.on("mouseover", function (_d: any, _i: any) {
d3.select(this)
.attr("stroke", "white") //
.attr("stroke-width", 5); //
})
.on("mouseout", function (_d: any, _i: any) {
d3.select(this)
.attr("stroke", "none"); //
});
simulation.on("tick", () => {
link
.attr("x1", (d: { source: { x: any; }; }) => d.source.x)
.attr("y1", (d: { source: { y: any; }; }) => d.source.y)
.attr("x2", (d: { target: { x: any; }; }) => d.target.x)
.attr("y2", (d: { target: { y: any; }; }) => d.target.y);
node
.attr("cx", (d: { x: any; }) => d.x)
.attr("cy", (d: { y: any; }) => d.y);
nodeNameText
.attr("x", (d: { x: any; }) => d.x)
.attr("y", (d: { y: any; }) => d.y);
});
},
updateGraph(data: { links: any[]; }) {
// var _this = this
const links = data.links.map((d: object | null) => Object.create(d));
const nodes = data.nodes.map((d: object | null) => Object.create(d));
},
color(d: { group: string | number; }) {
return this.colorList[d.group]
// const scale = d3.scaleOrdinal(d3.schemeCategory10);
// return (d: { group: any; }) => scale(d.group);
},
drag(simulation: { alphaTarget: (arg0: number) => { (): any; new(): any; restart: { (): void; new(): any; }; }; }) {
function dragstarted(event: { active: any; }) {
if (!event.active) simulation.alphaTarget(0.3).restart();
d3.event.subject.fx = d3.event.x;
d3.event.subject.fy = d3.event.y;
}
function dragged(_event: any) {
d3.event.subject.fx = d3.event.x;
d3.event.subject.fy = d3.event.y;
}
function dragended(event: { active: any; }) {
if (!event.active) simulation.alphaTarget(0);
d3.event.subject.fx = null;
d3.event.subject.fy = null;
}
return d3.drag()
.on("start", dragstarted)
.on("drag", dragged)
.on("end", dragended);
},
queryTest(d: { id: any; }) {
// var _this = this
console.log(d.id)
}
},
setup() {
const router = useRouter();
const goBack = () => {
router.go(-1);
};
return {
goBack
};
}
}
</script>
<style lang="scss" scoped>
// d3
.container {
// width: 1000px;
// height: 950px;
// border: 1px solid #2c3e50;
// border-radius: 8px;
// margin-top: 40px;
// margin-left: auto;
// border-radius: 90%;
// margin-right: auto;
border: 1px solid #CFD9EA;
background: linear-gradient(#d5e1f6, #a9c6ff, #d5e1f6);
background-image: url('/src/assets/images/106.jpg');
// background-size: 100% 80%;
background-size: 100% ;
background-attachment: fixed;
// border-radius: 50%; //
// background-color: rgba(0, 0, 0, 0); /* 50% */
}
.goto {
width: 4.5%;
height: 3.4%;
background-color: rgb(255, 255, 255,0.5);
// background-image: url('/src/assets/images/screen (1).png');
// background-size: 100% 100%;
border-radius: 8px;
position: absolute;
top: 5%;
margin-left: 94%;
z-index: 5;
cursor: pointer;
}
.goto p{
text-align: center;
color: #ffffff;
line-height: 30px;
font-size: 14px;
}
// .goto :hover{
// background-color: #a2abbb;
// border-radius: 8px;
// width: 4.5%;
// height: 3.4%;
// }
</style>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save