-
Notifications
You must be signed in to change notification settings - Fork 21
/
gn.html
202 lines (149 loc) · 5.7 KB
/
gn.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<!-- Vendor CSS Files -->
<!-- Template Main CSS File -->
<!-- Vendor CSS Files -->
<link href="https://klang.org.cn/assets/vendor/aos/aos.css" rel="stylesheet">
<link href="https://klang.org.cn/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="https://klang.org.cn/assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="https://klang.org.cn/assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="https://klang.org.cn/assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<title>Klang(金浪)板块实时数据</title>
</head>
<body>
<div id="app">
<div class="row" style="width:80%;margin:100px;" id="content">
</div>
<div class="row" style="width:80%;margin:100px;" id="gnblock" >
<div v-for="a,index in gn50list">
<div class="alert alert-primary" role="alert">
<a @click="getbkcode(a.href,index)">{{index+1}}、 {{a.name}} </a>
</div>
<div v-bind:id="'bk'+index">
</div>
</div> <!-- for -->
</div>
<div id="window2" class="row" style="width:80%;margin:100px;min-height:600px;">
<iframe id="win2_iframe" src=""></iframe>
</div>
<div style="z-index: 9999; position:fixed; right: 50px; bottom: 50px;">
<button class="btn btn-primary" @click="refresh">刷</button>
</div>
</div> <!--app -->
<script crossorigin="anonymous" integrity="sha512-n/4gHW3atM3QqRcbCn6ewmpxcLAHGaDjpEBu4xZd47N0W2oQ+6q7oc3PXstrJYXcbNU1OHdQ1T7pAP+gi5Yu8g==" src="https://lib.baomitu.com/jquery/3.6.0/jquery.js"></script>
<script type="text/javascript" src="https://klang.org.cn/js/vendors.min.js"></script>
<!-- Template Main JS File -->
<script src="https://klang.org.cn/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="https://klang.org.cn/assets/vendor/glightbox/js/glightbox.min.js"></script>
<script crossorigin="anonymous" integrity="sha512-KvaXQuRkPKYVQnd5RtRnFPR51W3+Vz+uq0IX8/TYaA2F6hDS2VQQv11BjdHES9boHiHXmqT9oC4H3AJLbq2Szg==" src="https://lib.baomitu.com/vue/3.2.31/vue.global.js"></script>
<script crossorigin="anonymous" integrity="sha512-bPh3uwgU5qEMipS/VOmRqynnMXGGSRv+72H/N260MQeXZIK4PG48401Bsby9Nq5P5fz7hy5UGNmC/W1Z51h2GQ==" src="https://lib.baomitu.com/axios/0.26.1/axios.min.js"></script>
<script crossorigin="anonymous" integrity="sha512-GtM/5c/Ie0lStj6QwEG0HkpMQuGr9vrOAgFD4nNmImviyZvsJxN7TYU7b+R7Kthob0zFBUpuxfl3R3Mn1qekTw==" src="https://lib.baomitu.com/socket.io/4.5.3/socket.io.min.js"></script>
<script>
var codetree={}
function savemain(code){
codetree1 = localStorage.getItem("klangcodelist")
if (codetree1 != null){
codetree = JSON.parse(codetree1)
}
if (codetree[code]) {
return
}
codetree[code] = []
localStorage.setItem("klangcodelist",JSON.stringify(codetree))
}
function savesub(code,subcode){
savemain(code)
if (codetree[code].includes(subcode) == false){
codetree[code].push(subcode)
}
localStorage.setItem("klangcodelist",JSON.stringify(codetree))
}
</script>
<script>
var win = window
function tableClass(){
tables = document.getElementsByTagName('table')
for (i=0;i<tables.length;i++){
tables[i].className = 'table table-bordered'
tables[i].border = '1'
}
}
function getgn50(){
gn50data = $("#content table tr").slice(1,51)
for (i=0;i<50;i++){
var tr = gn50data[i]
var td = tr.cells[1]
var a = td.firstElementChild
vue.$data.gn50list.push({"href":a.href,"name":a.text})
}
//setTimeout("getblock(0)",1500)
}
function winiframe(href){
$("#win2_iframe").attr('src',href)
}
async function getbkdata(code,index){
axios.get(apihost+"/gn/detail/field/199112/order/desc/page/1/ajax/1/code/"+code).then((response) => {
$('#bk'+index).html(response.data)
tableClass()
setTimeout("tableClass()",1000 );
})
.catch((error) => {
console.log(error.response.status);
if (error.response.status == 401){
winiframe(apihost+"/gncookie.html")
}
});
}
async function getDatas(that){
response = await axios.get(apihost+"/funds/gnzjl/")
content = document.getElementById('content')
content.innerHTML = response.data
that.load = 1
that.$nextTick(function(){
tableClass()
getgn50()
});
tableClass()
setTimeout("tableClass()",1000 );
}
var hostname = window.location.hostname
var host = window.location.host
if (hostname == ""){
hostname = "127.0.0.1"
apihost = "http://127.0.0.1:9999"
} else {
apihost = "http://"+host
}
//apihost="https://api.klang.org.cn"
const VueApp = {
data() {
return {
load:0,
result:{},
gn50list:[],
}
},
created() {
},
mounted () {
var that = this
getDatas(that)
},
methods: {
refresh(e){
var that = this
getDatas(that)
},
getbkcode(href,index){
var reg = /\d+\/$/
var code = reg.exec(href)[0].replace('/','')
//winiframe(href)
getbkdata(code,index)
}
}
}//VueApp
window.vue = Vue.createApp(VueApp).mount('#app')
</script>
</body>
</html>