updata new code

This commit is contained in:
2024-05-24 15:05:08 +08:00
parent 569fc6f985
commit d9a218317d
8 changed files with 770 additions and 135 deletions
+2
View File
@@ -92,6 +92,8 @@
<body>
<div class="comment_post"> {# 提交评论区域的div #}
{% for front in front_code %}
{{ front|safe }}
+17 -1
View File
@@ -106,6 +106,7 @@
if (page_tag === 'b9b101e') {
sub_btn = `<a class="dropdown-item" href="javascript:void(0);" onclick="window.open('2_d?id=${item.id}&s_p=b9b101e')">协同脑图</a>
<a class="dropdown-item" href="javascript:void(0);" onclick="window.open('http://106.54.50.78:9001/p/${item.id}')"> 协同编辑 </a>
<a class="dropdown-item" href="javascript:void(0);" onclick="window.open('qunti?id=${item.id}')">群体感知</a>
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.open_pinglun(${item.id})">评论</a>
<a class="dropdown-item" href="javascript:void(0);" onclick="mind.del_mind(${item.id},'card_${uuid}')">删除</a>`
@@ -234,7 +235,22 @@
async: false
});
},
open_pinglun: function (mind_id) {
open_qunti: function (mind_id) {
const me = this
$.ajax({
type: "post",
url: "qunti",
headers: {"X-CSRFToken": $.cookie("csrftoken")},
data: {'id': mind_id},
dataType: "json",
success: function (resp) {
window.location.href = resp.data;
console.log(resp)
},
async: false
});
},
open_qunti: function (mind_id) {
const me = this
$.ajax({
type: "post",
+98 -132
View File
@@ -617,11 +617,10 @@
</div>
</nav>
<!-- 左侧菜单 end-->
<main class="col-md-10 ml-sm-auto col-lg-10 px-md-4">
<div id="main" style="width: 600px;height:400px;"></div>
<div id="app2" style="width: 600px;height:400px;"></div>
<div id="app3" style="width: 600px;height:400px;"></div>
<div id="app4" style="width: 600px;height:400px;"></div>
<main >
<div id="main" style="width: 1000px;height:500px;"></div>
<div id="app2" style="width: 1000px;height:500px;"></div>
<div id="app3" style="width: 1300px;height:500px;"></div>
</main>
<!-- 右侧内容 start-->
@@ -639,17 +638,17 @@
option = {
color: ['#67F9D8', '#FFE434', '#56A3F1', '#FF917C'],
title: {
text: '贡献度雷达图'
text: '{{ name }}雷达贡献图'
},
legend: {},
radar: [
{
indicator: [
{ text: '1' },
{ text: '2' },
{ text: '3' },
{ text: '4' },
{ text: '5' }
{text: '协作参与度'},
{text: '问答活跃度'},
{text: '内容贡献度'},
{text: '小组配合度'},
{text: '机器人使用'}
],
center: ['25%', '50%'],
radius: 120,
@@ -680,12 +679,11 @@
},
{
indicator: [
{ text: '1', max: 150 },
{ text: '2', max: 150 },
{ text: '3', max: 150 },
{ text: '4', max: 120 },
{ text: '5', max: 108 },
{ text: '6', max: 72 }
{text: '协作参与度', max:200},
{text: '问答活跃度', max:200},
{text: '内容贡献度', max:200},
{text: '小组配合度', max:200},
{text: '机器人使用', max:200}
],
center: ['75%', '50%'],
radius: 120,
@@ -706,54 +704,28 @@
}
},
data: [
{
value: [100, 8, 0.4, -80, 2000],
name: 'Data A'
},
{
value: [60, 5, 0.3, -100, 1500],
name: 'Data B',
areaStyle: {
color: 'rgba(255, 228, 52, 0.6)'
}
}
{% for stu,data in datas %}
{% if forloop.counter|divisibleby:2 %}
{
value: {{ data }},
name: '{{ stu }}',
},
{% endif %}
{% endfor %}
]
},
{
type: 'radar',
radarIndex: 1,
data: [
{
value: [120, 118, 130, 100, 99, 70],
name: 'Data C',
symbol: 'rect',
symbolSize: 12,
lineStyle: {
type: 'dashed'
},
label: {
show: true,
formatter: function (params) {
return params.value;
}
}
},
{
value: [100, 93, 50, 90, 70, 60],
name: 'Data D',
areaStyle: {
color: new echarts.graphic.RadialGradient(0.1, 0.6, 1, [
{
color: 'rgba(255, 145, 124, 0.1)',
offset: 0
},
{
color: 'rgba(255, 145, 124, 0.9)',
offset: 1
}
])
}
}
{% for stu,data in datas2 %}
{% if forloop.counter|divisibleby:2 == 0 %}
{
value: {{ data }},
name: '{{ stu }}',
},
{% endif %}
{% endfor %}
]
}
]
@@ -768,7 +740,7 @@
var myChart = echarts.init(document.getElementById('app2'));
option = {
title: {
text: '社会感知图'
text: '{{ name }}社会感知图'
},
tooltip: {},
animationDurationUpdate: 1500,
@@ -788,32 +760,20 @@
fontSize: 20
},
data: [
{
name: '郭安',
x: 300,
y: 300
{% for stu,x,y in datas3 %}
{
name: '{{ stu }}',
x: {{x}},
y: {{y}}
},
{
name: '组员1',
x: 800,
y: 300
},
{
name: '组员2',
x: 550,
y: 100
},
{
name: '组员3',
x: 550,
y: 500
}
{% endfor %}
],
// links: [],
links: [
{% for stu1,stu2 in student4 %}
{
source: 0,
target: 1,
source: "{{ stu1 }}",
target: "{{ stu2 }}",
symbolSize: [5, 20],
label: {
show: true
@@ -823,32 +783,14 @@
curveness: 0.2
}
},
{
source: '组员1',
target: '郭安',
label: {
show: true
},
lineStyle: {
curveness: 0.2
}
{% endfor %}
{% for stu1,stu2 in student4 %}
{
source: '{stu2}',
target: '{stu1}'
},
{
source: '组员2',
target: '组员3'
},
{
source: '组员2',
target: '郭安'
},
{
source: '郭安',
target: '组员3'
},
{
source: '组员1',
target: '组员3'
}
{% endfor %}
],
lineStyle: {
opacity: 0.9,
@@ -866,13 +808,16 @@
// 基于准备好的dom,初始化echarts实例
var myChart = echarts.init(document.getElementById('app3'));
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
option = {
title: {
text: '{{ name }}贡献活跃度'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
legend: {},
grid: {
left: '3%',
@@ -883,7 +828,10 @@ option = {
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
data: [{% for stu in student %}
'{{ stu }}',
{% endfor %}]
}
],
yAxis: [
@@ -893,44 +841,54 @@ option = {
],
series: [
{
name: 'Direct',
name: '发言热度',
type: 'bar',
emphasis: {
focus: 'series'
},
data: [320, 332, 301, 334, 390, 330, 320]
data: [{% for stu in sui1 %}
'{{ stu }}',
{% endfor %}]
},
{
name: 'Email',
name: '活跃热度',
type: 'bar',
stack: 'Ad',
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 90, 230, 210]
data: [{% for stu in sui2 %}
'{{ stu }}',
{% endfor %}]
},
{
name: 'Union Ads',
name: '贡献热度',
type: 'bar',
stack: 'Ad',
emphasis: {
focus: 'series'
},
data: [220, 182, 191, 234, 290, 330, 310]
data: [{% for stu in sui3 %}
'{{ stu }}',
{% endfor %}]
},
{
name: 'Video Ads',
name: '评价热度',
type: 'bar',
stack: 'Ad',
emphasis: {
focus: 'series'
},
data: [150, 232, 201, 154, 190, 330, 410]
data: [{% for stu in sui4 %}
'{{ stu }}',
{% endfor %}]
},
{
name: 'Search Engine',
name: '交流热度',
type: 'bar',
data: [862, 1018, 964, 1026, 1679, 1600, 1570],
data: [{% for stu in sui5 %}
'{{ stu }}',
{% endfor %}],
emphasis: {
focus: 'series'
},
@@ -942,41 +900,49 @@ option = {
}
},
{
name: 'Baidu',
name: '讨论热度',
type: 'bar',
barWidth: 5,
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [620, 732, 701, 734, 1090, 1130, 1120]
data: [{% for stu in sui6 %}
'{{ stu }}',
{% endfor %}]
},
{
name: 'Google',
name: '情感热度',
type: 'bar',
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 290, 230, 220]
data: [{% for stu in sui7 %}
'{{ stu }}',
{% endfor %}]
},
{
name: 'Bing',
name: '交互热度',
type: 'bar',
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [60, 72, 71, 74, 190, 130, 110]
data: [{% for stu in sui8 %}
'{{ stu }}',
{% endfor %}]
},
{
name: 'Others',
name: '其他',
type: 'bar',
stack: 'Search Engine',
emphasis: {
focus: 'series'
},
data: [62, 82, 91, 84, 109, 110, 120]
data: [{% for stu in sui9 %}
'{{ stu }}',
{% endfor %}]
}
]
};
+2 -2
View File
@@ -653,8 +653,8 @@
{#var uname = prompt('请输入用户名', 'user' + uuid(8, 16));#}
var uname = document.getElementById('username').className
console.log(uname)
var ws = new WebSocket("ws://106.54.50.78:10001/");
var ws = new WebSocket("ws://106.54.50.78:10001/");
var ws = new WebSocket("ws://127.0.0.1:9001/");
var ws = new WebSocket("ws://127.0.0.1:9001/");
ws.onopen = function() {
var data = "系统消息:建立连接成功";
listMsg(data);