|
@@ -10,7 +10,20 @@
|
|
|
&family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
|
<script>
|
|
|
- var wid = 0, skip = 0
|
|
|
+ var e
|
|
|
+ fetch('/js/e.json', {
|
|
|
+ method: 'GET',
|
|
|
+ headers: {
|
|
|
+ 'Content-type': 'application/json',
|
|
|
+ }
|
|
|
+ }).then(res => {
|
|
|
+ return res.json()
|
|
|
+ }).then(f => {
|
|
|
+ e = f;
|
|
|
+ });
|
|
|
+
|
|
|
+ var wid = 0, skip = 0, only = 0
|
|
|
+
|
|
|
var col = {
|
|
|
'向量': '#337ab7',
|
|
|
'隐': '#b5b5b5'
|
|
@@ -19,6 +32,17 @@
|
|
|
str = str.split(' ')[0]
|
|
|
return col[str] ? col[str] : (pam ? '#6f9f3f' : '#3f3f3f')
|
|
|
}
|
|
|
+ function is11(str) {
|
|
|
+ if(str[str.length-1]==' ')str=str.split(' ')[0]
|
|
|
+ if(str=='向量')return true
|
|
|
+ var queryData = e.data.filter(function (e) {
|
|
|
+ return e.name == str
|
|
|
+ });
|
|
|
+ if(!queryData[0])return false
|
|
|
+ var o = queryData[0].organization
|
|
|
+
|
|
|
+ return o.slice(o.length - 3) == '11班'
|
|
|
+ }
|
|
|
function unique(arr) {
|
|
|
let hash = [];
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -32,6 +56,7 @@
|
|
|
let res = [];
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
if (!arr[i]) continue;
|
|
|
+ if (only && (!is11(arr[i].source) || !is11(arr[i].target))) continue;
|
|
|
res.push({
|
|
|
source: arr[i].source, target: arr[i].target,
|
|
|
value: wid ? 1 : arr.filter(function (e) {
|
|
@@ -52,6 +77,7 @@
|
|
|
if ($('#filter').val()) o = 800
|
|
|
else o = 3000
|
|
|
if (wid) o /= 1.75
|
|
|
+ if (only) o /= 1.75
|
|
|
$("#sanky").css('height', o + 'px')
|
|
|
cc = echarts.init($("#sanky")[0]);
|
|
|
fetch('/a.log', {
|
|
@@ -71,11 +97,11 @@
|
|
|
for (var i = 0; i < f.length; i++) {
|
|
|
if (skip && f[i].source == f[i].target.split(' ')[0]) continue;
|
|
|
if ($('#filter').val() && f[i].source != $('#filter').val()) continue;
|
|
|
- p.push(f[i].source)
|
|
|
- p.push(f[i].target)
|
|
|
+ if (!only || is11(f[i].source)) p.push(f[i].source)
|
|
|
+ if (!only || is11(f[i].target)) p.push(f[i].target)
|
|
|
}
|
|
|
p = unique(p)
|
|
|
-
|
|
|
+ console.log(p)
|
|
|
var ppp = [];
|
|
|
for (let i = 0; i < p.length; i++) {
|
|
|
ppp.push({
|
|
@@ -168,6 +194,7 @@
|
|
|
<div class="input-group-btn">
|
|
|
<button data-toggle="button" class="btn btn-default" onclick="skip=!skip;get()">忽略自环</button>
|
|
|
<button class="btn btn-default" data-toggle="button" onclick="wid=!wid;get()">固定宽度</button>
|
|
|
+ <button class="btn btn-default" data-toggle="button" onclick="only=!only;get()">只看11班</button>
|
|
|
</div>
|
|
|
<span class="input-group-addon">
|
|
|
提示:保持鼠标不动,可以随意滑动滚轮而不改变焦点
|