sbd-npm 1.4.21 → 1.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/constant.js +2 -1
- package/package.json +2 -2
- package/status.js +85 -85
- package/stock_basics.js +143 -143
- package/summary_daily.js +56 -56
- package/util.js +295 -293
package/util.js
CHANGED
@@ -132,23 +132,25 @@ const Util = {
|
|
132
132
|
* 初始目录
|
133
133
|
*/
|
134
134
|
init_menu: function () {
|
135
|
-
let
|
136
|
-
|
137
|
-
|
135
|
+
let html = [];
|
136
|
+
html.push('<div class="menu_section">');
|
137
|
+
html.push('<ul class="nav side-menu">');
|
138
138
|
if (typeof MenuList != "undefined") {
|
139
139
|
MenuList.forEach(function (menu) {
|
140
|
-
|
141
|
-
|
140
|
+
html.push('<li><a><i class="fa fa-', menu["icon"], '"></i> ', menu["name"], ' <span class="fa fa-chevron-down"></span></a>');
|
141
|
+
html.push('<ul class="nav child_menu">');
|
142
142
|
menu["menu"].forEach(function (m) {
|
143
|
-
|
143
|
+
if (!("is_hide" in m)) {
|
144
|
+
html.push('<li><a href="', m["url"], '">', m["name"], '</a></li>');
|
145
|
+
}
|
144
146
|
});
|
145
|
-
|
146
|
-
|
147
|
+
html.push('</ul>');
|
148
|
+
html.push('</li>');
|
147
149
|
});
|
148
150
|
}
|
149
|
-
|
150
|
-
|
151
|
-
$("#sidebar-menu").html(
|
151
|
+
html.push('</div>');
|
152
|
+
html.push('</div>');
|
153
|
+
$("#sidebar-menu").html(html.join(""));
|
152
154
|
},
|
153
155
|
|
154
156
|
/**
|
@@ -803,39 +805,39 @@ const Util = {
|
|
803
805
|
if (!$("#" + page_id).length) {
|
804
806
|
$("#" + data_id).parent().after('<div id="' + page_id + '" class="text-center"></div>');
|
805
807
|
}
|
806
|
-
let
|
808
|
+
let html = [];
|
807
809
|
let total_page = Math.ceil(total_num / per_page);
|
808
|
-
|
810
|
+
html.push("<ul class='pagination'>");
|
809
811
|
if (total_num > 0) {
|
810
|
-
|
812
|
+
html.push("<li class='disabled'><a href='#'><b>共 ", total_num, " 条,", total_page, " 页</b></a></li>");
|
811
813
|
current_page = current_page ? current_page : 1;
|
812
814
|
let range = 5;
|
813
815
|
let show_items = (range * 2) + 1;
|
814
816
|
if (current_page > 2 && current_page - range > 1) {
|
815
|
-
|
817
|
+
html.push("<li data-page='1'><a href='#'>最前</a></li>");
|
816
818
|
}
|
817
819
|
if (current_page > 1 && show_items < total_page) {
|
818
|
-
|
820
|
+
html.push("<li data-page='", current_page - 1, "'><a href='#'>上一页</a></li>");
|
819
821
|
}
|
820
822
|
for (let i = 1; i <= total_page; i++) {
|
821
823
|
if (1 !== total_page && (!(i >= current_page + range + 1 || i <= current_page - range - 1) || total_page <= show_items)) {
|
822
824
|
if (current_page === i) {
|
823
|
-
|
825
|
+
html.push("<li class='active'><a href='#'>", i, "</a></li>");
|
824
826
|
} else {
|
825
|
-
|
827
|
+
html.push("<li data-page='", i, "'><a href='#'>", i, "</a></li>");
|
826
828
|
}
|
827
829
|
}
|
828
830
|
}
|
829
831
|
if (current_page < total_page && show_items < total_page) {
|
830
|
-
|
832
|
+
html.push("<li data-page='", current_page + 1, "'><a href='#'>下一页</a></li>");
|
831
833
|
}
|
832
834
|
if (current_page < total_page - 1 && current_page + range - 1 < total_page && show_items < total_page) {
|
833
|
-
|
835
|
+
html.push("<li data-page='", total_page, "'><a href='#'>最后</a></li>");
|
834
836
|
}
|
835
837
|
}
|
836
|
-
|
838
|
+
html.push("</ul>");
|
837
839
|
let fg = $("#" + page_id);
|
838
|
-
fg.html(
|
840
|
+
fg.html(html.join(""));
|
839
841
|
fg.find("li").each(function () {
|
840
842
|
let click_page = $(this).attr("data-page");
|
841
843
|
if (click_page) {
|
@@ -853,23 +855,23 @@ const Util = {
|
|
853
855
|
*/
|
854
856
|
init_modal_skeleton: function (modal_id, modal_content_html = "") {
|
855
857
|
if (!$("#" + modal_id).length) {
|
856
|
-
let
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
858
|
+
let html = [];
|
859
|
+
html.push('<div class="modal fade ', modal_id, '" id="', modal_id, '" tabindex="-1" role="dialog" aria-hidden="true">');
|
860
|
+
html.push('<div class="modal-dialog modal-lg modal-xlg"><div class="modal-content">');
|
861
|
+
html.push('<div class="modal-header">');
|
862
|
+
html.push('<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>');
|
863
|
+
html.push('<h4 class="modal-title" id="', modal_id, '_title">Loading...</h4>');
|
864
|
+
html.push('</div>');
|
863
865
|
if (Util.is_mobile()) {
|
864
|
-
|
866
|
+
html.push('<div id="', modal_id, '_body" class="modal-body table-responsive">');
|
865
867
|
} else {
|
866
|
-
|
868
|
+
html.push('<div id="', modal_id, '_body" class="modal-body">');
|
867
869
|
}
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
$("body").append(
|
870
|
+
html.push(modal_content_html);
|
871
|
+
html.push('</div>');
|
872
|
+
html.push('</div></div>');
|
873
|
+
html.push('</div>');
|
874
|
+
$("body").append(html.join(""));
|
873
875
|
}
|
874
876
|
},
|
875
877
|
|
@@ -879,26 +881,26 @@ const Util = {
|
|
879
881
|
*/
|
880
882
|
init_table_skeleton: function (options) {
|
881
883
|
if (options["head_cols"]) {
|
882
|
-
let is_table_sort = 0, is_tooltip = 0,
|
884
|
+
let is_table_sort = 0, is_tooltip = 0, html = [];
|
883
885
|
let head_length = options["head_cols"].length;
|
884
886
|
if (options["alert"]) {
|
885
|
-
|
886
|
-
|
887
|
-
|
887
|
+
html.push('<div class="alert alert-info" role="alert">');
|
888
|
+
html.push(options["alert"]);
|
889
|
+
html.push('</div>');
|
888
890
|
}
|
889
891
|
let table_class = options["table_class"] ? options["table_class"] : "table table-bordered table-hover table-striped text-center";
|
890
|
-
|
892
|
+
html.push('<table class="' + table_class + '">');
|
891
893
|
if (options["caption"]) {
|
892
894
|
if (/<[^>]+>$/.test(options["caption"])) { // 正则匹配所有HTML闭合(<caption></caption>)标签内容
|
893
|
-
|
895
|
+
html.push(options["caption"]);
|
894
896
|
}
|
895
897
|
} else {
|
896
|
-
|
898
|
+
html.push("<caption></caption>");
|
897
899
|
}
|
898
900
|
if (options["head_id"]) {
|
899
|
-
|
901
|
+
html.push('<thead id="', options["head_id"], '"><tr>');
|
900
902
|
} else {
|
901
|
-
|
903
|
+
html.push('<thead><tr>');
|
902
904
|
}
|
903
905
|
options["head_cols"].forEach(function (col) {
|
904
906
|
let td_attr = "", td_class = [];
|
@@ -932,7 +934,7 @@ const Util = {
|
|
932
934
|
if (td_class.length > 0) {
|
933
935
|
td_attr += ' class="' + td_class.join(" ") + '"';
|
934
936
|
}
|
935
|
-
|
937
|
+
html.push('<td', td_attr, '><label for="' + col["select_id"] + '"></label><select id="' + col["select_id"] + '">' + option_html + '</select></td>');
|
936
938
|
} else {
|
937
939
|
if (col["table_sort"]) {
|
938
940
|
is_table_sort = 1;
|
@@ -954,25 +956,25 @@ const Util = {
|
|
954
956
|
tooltip = ' <i class="glyphicon glyphicon-info-sign" data-html="true" data-toggle="tooltip" data-container="body" data-original-title="' + col["tooltip"] + '"></i>';
|
955
957
|
}
|
956
958
|
if (col["sort_type"]) {
|
957
|
-
|
959
|
+
html.push('<td', td_attr, '><a class="sort_type" href="#" data-val="', col["sort_type"], '">', col["name"], tooltip, '</a></td>');
|
958
960
|
} else {
|
959
|
-
|
961
|
+
html.push('<td', td_attr, '>', col["name"], tooltip, '</td>');
|
960
962
|
}
|
961
963
|
}
|
962
964
|
});
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
965
|
+
html.push('</tr></thead>');
|
966
|
+
html.push('<tbody id="', options["element_id"], '_body"><tr>');
|
967
|
+
html.push('<td class="text-center" colspan="', head_length, '">', (options["body_tips"] ? options["body_tips"] : "Loading..."), '</td>');
|
968
|
+
html.push('</tr></tbody>');
|
969
|
+
html.push('</table>');
|
968
970
|
let tz_obj = $("#" + options["element_id"]);
|
969
971
|
if (tz_obj.hasClass("panel")) {
|
970
972
|
tz_obj.find("table").each(function () {
|
971
973
|
$(this).remove();
|
972
974
|
});
|
973
|
-
tz_obj.append(
|
975
|
+
tz_obj.append(html.join(""));
|
974
976
|
} else {
|
975
|
-
tz_obj.html(
|
977
|
+
tz_obj.html(html.join(""));
|
976
978
|
}
|
977
979
|
if ((Util.is_mobile() || Util.is_small_screen()) && !tz_obj.hasClass("table-responsive")) {
|
978
980
|
if (tz_obj.hasClass("panel")) {
|
@@ -1031,17 +1033,17 @@ const Util = {
|
|
1031
1033
|
* @param callback_func
|
1032
1034
|
*/
|
1033
1035
|
render_classify_html: function (classify_id, classify_data, callback_func) {
|
1034
|
-
let
|
1035
|
-
|
1036
|
+
let html = [];
|
1037
|
+
html.push('<option value="0">板块</option>');
|
1036
1038
|
classify_data.forEach(function (d) {
|
1037
1039
|
let num = "";
|
1038
1040
|
if (d["num"] > 0) {
|
1039
1041
|
num = "(" + d["num"] + ")";
|
1040
1042
|
}
|
1041
|
-
|
1043
|
+
html.push('<option value="', d["name"], '">', d["name"], num, '</option>');
|
1042
1044
|
});
|
1043
1045
|
let classify_obj = $("#" + classify_id);
|
1044
|
-
classify_obj.html(
|
1046
|
+
classify_obj.html(html.join(""));
|
1045
1047
|
classify_obj.change(function () {
|
1046
1048
|
callback_func();
|
1047
1049
|
return false;
|
@@ -1100,19 +1102,19 @@ const Util = {
|
|
1100
1102
|
});
|
1101
1103
|
}
|
1102
1104
|
Util.post("/stock/" + code, {action: "rps"}, function (j) {
|
1103
|
-
let
|
1105
|
+
let html = [];
|
1104
1106
|
j["data"].forEach(function (item) {
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1107
|
+
html.push("<tr>");
|
1108
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
1109
|
+
html.push("<td style='background-color: ", item["rps20_color"], "'>", item["rps20"], "</td>");
|
1110
|
+
html.push("<td>", Util.parse_ratio(item["change_percent20"] * 100, 2), "</td>");
|
1111
|
+
html.push("<td style='background-color: ", item["rps60_color"], "'>", item["rps60"], "</td>");
|
1112
|
+
html.push("<td>", Util.parse_ratio(item["change_percent60"] * 100, 2), "</td>");
|
1113
|
+
html.push("<td style='background-color: ", item["rps120_color"], "'>", item["rps120"], "</td>");
|
1114
|
+
html.push("<td>", Util.parse_ratio(item["change_percent120"] * 100, 2), "</td>");
|
1115
|
+
html.push("</tr>");
|
1114
1116
|
});
|
1115
|
-
Util.render_table_html("rps_table_body",
|
1117
|
+
Util.render_table_html("rps_table_body", html);
|
1116
1118
|
Util.hide_tips();
|
1117
1119
|
});
|
1118
1120
|
},
|
@@ -1217,7 +1219,7 @@ const Util = {
|
|
1217
1219
|
* 基金数据渲染
|
1218
1220
|
*/
|
1219
1221
|
render_public_fund: function(j) {
|
1220
|
-
let
|
1222
|
+
let html = [], total_public_fund = 0, total_stock_num = 0, total_market_capital = 0;
|
1221
1223
|
j["data"] = j["data"] ? j["data"] : [];
|
1222
1224
|
j["data"].forEach(function (item) {
|
1223
1225
|
total_public_fund++;
|
@@ -1232,22 +1234,22 @@ const Util = {
|
|
1232
1234
|
if (cls !== "") {
|
1233
1235
|
net = "<b class='" + cls + "'>" + net + "(" + Util.to_float(item["change_percent"], 2) + "%)</b>";
|
1234
1236
|
}
|
1235
|
-
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1237
|
+
html.push("<tr class='", (($.inArray(item["fund_code"], j["etf_code_list"]) > -1) ? "danger" : ""), "'>");
|
1238
|
+
html.push("<td>", total_public_fund, "</td>");
|
1239
|
+
html.push("<td>", Util.pack_html_link('https://fund.eastmoney.com/' + item["fund_code"] + '.html', item["fund_code"]), "</td>");
|
1240
|
+
html.push("<td title='基金概况'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + item["fund_code"] + '.html', item["fund_name"]), "</td>");
|
1241
|
+
html.push("<td>", net, "</td>");
|
1242
|
+
html.push("<td>", item["assets"], "亿</td>");
|
1243
|
+
html.push("<td>", item["fund_type"], "</td>");
|
1244
|
+
html.push("<td>", item["invest_type"], "</td>");
|
1245
|
+
html.push("<td>", Util.pack_fund_manager(item), "</td>");
|
1246
|
+
html.push("<td>", public_date, "</td>");
|
1247
|
+
html.push("<td data-val='", item["stock_num"], "' title='", item["stock_num"], "'>", Util.to_unit(item["stock_num"], 3), "股</td>");
|
1248
|
+
html.push("<td data-val='", item["market_capital"], "' title='", item["market_capital"], "'>", Util.to_unit(item["market_capital"], 3), "</td>");
|
1249
|
+
html.push("<td><a class='link_cls' data-toggle='modal' data-target='.public_fund_modal' data-val='", item["fund_code"], "'>详细</a></td>");
|
1250
|
+
html.push("</tr>");
|
1249
1251
|
});
|
1250
|
-
Util.render_table_html("public_fund_table_body",
|
1252
|
+
Util.render_table_html("public_fund_table_body", html);
|
1251
1253
|
let public_fund_tips = "";
|
1252
1254
|
if (j["cur_fund_num"]) {
|
1253
1255
|
total_public_fund = Util.pack_html_link(Util.get_url("trend_fund_hold"), '<span class="label label-info">' + j["cur_fund_num"] + '</span>');
|
@@ -1304,7 +1306,7 @@ const Util = {
|
|
1304
1306
|
}
|
1305
1307
|
Util.post("/stock/" + code, {action: "public_fund_change"}, function (j) {
|
1306
1308
|
Util["pfc_stock_chart"].hideLoading();
|
1307
|
-
let date_data = [], fund_num_data = [], stock_num_data = [], value_data = [], price_data = [],
|
1309
|
+
let date_data = [], fund_num_data = [], stock_num_data = [], value_data = [], price_data = [], html = [], is_fund10_num = 0;
|
1308
1310
|
if ($("#is_fund10_num").length > 0) {
|
1309
1311
|
is_fund10_num = $("#is_fund10_num").prop("checked") ? 1 : 0;
|
1310
1312
|
}
|
@@ -1320,30 +1322,30 @@ const Util = {
|
|
1320
1322
|
let hold_value = Util.to_hundred_million(item["hold_value"], 3);
|
1321
1323
|
value_data.push(hold_value);
|
1322
1324
|
price_data.push(item["price"]);
|
1323
|
-
|
1324
|
-
|
1325
|
+
html.push("<tr>");
|
1326
|
+
html.push("<td>", Util.pack_html_link("https://data.eastmoney.com/zlsj/detail/" + date_format + "-1-" + code + ".html", date_format), "</td>");
|
1325
1327
|
if (item["pre_price"]) {
|
1326
|
-
|
1328
|
+
html.push("<td>", Util.digit_compare_trend(item["price"], item["pre_price"]), "</td>");
|
1327
1329
|
} else {
|
1328
|
-
|
1330
|
+
html.push("<td>", item["price"], "</td>");
|
1329
1331
|
}
|
1330
1332
|
let stock_num_rate = "";
|
1331
1333
|
if (item["pre_stock_num"]) {
|
1332
1334
|
stock_num_rate = "(" + Util.year_price_rate(item["stock_num"], item["pre_stock_num"], 1) + ")";
|
1333
1335
|
}
|
1334
|
-
|
1336
|
+
html.push("<td data-val='", item["stock_num"], "' title='", item["stock_num"], "'>", Util.to_unit(item["stock_num"], 3), "股", stock_num_rate, "</td>");
|
1335
1337
|
let fund_num_rate = "";
|
1336
1338
|
if (item["pre_fund_num"]) {
|
1337
1339
|
fund_num_rate = "(" + Util.year_price_rate(item["fund_num"], item["pre_fund_num"], 1) + ")";
|
1338
1340
|
}
|
1339
|
-
|
1341
|
+
html.push("<td data-val='", item["fund_num"], "'>", item["fund_num"], fund_num_rate, "</td>");
|
1340
1342
|
let fund_rank_num_rate = "";
|
1341
1343
|
if (item["pre_fund_rank_num"]) {
|
1342
1344
|
fund_rank_num_rate = "(" + Util.year_price_rate(item["fund_rank_num"], item["pre_fund_rank_num"], 1) + ")";
|
1343
1345
|
}
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1346
|
+
html.push("<td data-val='", item["fund_rank_num"], "'>", item["fund_rank_num"], fund_rank_num_rate, "</td>");
|
1347
|
+
html.push("<td data-val='", item["hold_value"], "' title='", item["hold_value"], "'>", hold_value, "亿</td>");
|
1348
|
+
html.push("</tr>");
|
1347
1349
|
});
|
1348
1350
|
date_data = date_data.reverse();
|
1349
1351
|
fund_num_data = fund_num_data.reverse();
|
@@ -1370,7 +1372,7 @@ const Util = {
|
|
1370
1372
|
$("#pfc_value_tips").html("(当前持仓市值: <b class='text-info'>" + Util.to_unit(cur_value_num) + "</b>, 环比: " + Util.year_price_rate(cur_value_num, pre_value_num) + ")");
|
1371
1373
|
}
|
1372
1374
|
}
|
1373
|
-
Util.render_table_html("pfc_fund_table_body",
|
1375
|
+
Util.render_table_html("pfc_fund_table_body", html);
|
1374
1376
|
Util.hide_tips();
|
1375
1377
|
});
|
1376
1378
|
},
|
@@ -1431,7 +1433,7 @@ const Util = {
|
|
1431
1433
|
|
1432
1434
|
render_portfolio_html: function () {
|
1433
1435
|
if (Util["portfolio_table_id"]) {
|
1434
|
-
let
|
1436
|
+
let html = [], total_num = 0;
|
1435
1437
|
let is_us = $("#portfolio_remark_title").length === 0 ? 1 : 0;
|
1436
1438
|
if (Util["portfolio_data"]) {
|
1437
1439
|
let industry = $("#portfolio_industry").val();
|
@@ -1439,30 +1441,30 @@ const Util = {
|
|
1439
1441
|
Util["portfolio_data"].forEach(function (item) {
|
1440
1442
|
if (Util.is_industry_area(item, industry, area)) {
|
1441
1443
|
total_num++;
|
1442
|
-
|
1444
|
+
html.push("<tr>");
|
1443
1445
|
item["code"] = item["code"].toLowerCase();
|
1444
1446
|
if (is_us === 1) {
|
1445
|
-
|
1447
|
+
html.push('<td>', Util.us_logo_html(item["code"]), '</td>');
|
1446
1448
|
}
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1449
|
+
html = Util.stock_basics_html(html, item);
|
1450
|
+
html.push("<td id='high_", item["code"], "'>0</td>");
|
1451
|
+
html.push("<td id='low_", item["code"], "'>0</td>");
|
1452
|
+
html.push("<td class='year_price_", item["code"], "'>", (item["stock_price"] ? Util.year_price_rate(item["stock_price"], item["year_price"]) : "--"), "</td>");
|
1453
|
+
html.push("<td class='d5_price_", item["code"], "'>", (item["stock_price"] ? Util.year_price_rate(item["stock_price"], item["d5_price"]) : "--"), "</td>");
|
1454
|
+
html.push("<td class='high_52week_", item["code"], "'>--</td>");
|
1453
1455
|
if (is_us === 0) {
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1456
|
+
html.push("<td id='amount_", item["code"], "'>--</td>");
|
1457
|
+
html.push("<td id='average_", item["code"], "'>--</td>");
|
1458
|
+
html.push("<td class='holder_", item["code"], "'>--</td>");
|
1459
|
+
html.push("<td class='fund_", item["code"], "'>--</td>");
|
1460
|
+
html.push("<td id='remark_", item["code"], "'></td>");
|
1459
1461
|
}
|
1460
|
-
|
1462
|
+
html.push("</tr>");
|
1461
1463
|
}
|
1462
1464
|
});
|
1463
1465
|
}
|
1464
1466
|
let table_body_id = Util["portfolio_table_id"] + "_body";
|
1465
|
-
Util.render_table_html(table_body_id,
|
1467
|
+
Util.render_table_html(table_body_id, html);
|
1466
1468
|
if (is_us === 1) {
|
1467
1469
|
$("img").on("error", function () {
|
1468
1470
|
$(this).attr("src", "https://storage.googleapis.com/iex/api/logos/LI.png");
|
@@ -1518,7 +1520,7 @@ const Util = {
|
|
1518
1520
|
$("#" + component_id + "_body_body").html("<tr><td colspan='15'>Loading...</td></tr>");
|
1519
1521
|
$("#" + component_id + "_title").html(fund_code);
|
1520
1522
|
Util.post(Util.get_url("fund_public"), {action: "public_fund_detail", fund_code: fund_code}, function (j) {
|
1521
|
-
let
|
1523
|
+
let html = [];
|
1522
1524
|
if (j["fund_code"]) {
|
1523
1525
|
$("#" + component_id + "_title").html(Util.pack_html_link("http://fundf10.eastmoney.com/jbgk_" + j["fund_code"] + ".html", j["fund_name"]));
|
1524
1526
|
let net = "--";
|
@@ -1532,29 +1534,29 @@ const Util = {
|
|
1532
1534
|
let assets = j["assets"] > 0 ? (j["assets"] + "亿") : "--";
|
1533
1535
|
let public_date = j["public_date"] > 0 ? Util.seconds_to_format(j["public_date"], "%Y-%m-%d") : "--";
|
1534
1536
|
let issue_date = j["issue_date"] > 0 ? Util.seconds_to_format(j["issue_date"], "%Y-%m-%d") : "--";
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
Util.render_table_html(component_id + "_body_body",
|
1537
|
+
html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j["update_time"], "%Y-%m-%d"), "' class='info'><th colspan='15' style='text-align: center;'>基金概况</th></tr>");
|
1538
|
+
html.push("<tr><td colspan='3'>基金代码</td><td colspan='4'>", Util.pack_html_link('https://xueqiu.com/S/' + Util.code_to_fund_symbol(j["fund_code"]), j["fund_code"]), "</td><td colspan='3'>基金名</td><td colspan='5'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + j["fund_code"] + '.html', j["fund_name"]), "</td></tr>");
|
1539
|
+
html.push("<tr><td colspan='3'>基金类型</td><td colspan='4'>", j["fund_type"], "</td><td colspan='3'>投资类型</td><td colspan='5'>", j["invest_type"], "</td></tr>");
|
1540
|
+
html.push("<tr><td colspan='3'>单位净值</td><td colspan='4'>", net, "</td><td colspan='3'>资产规模</td><td colspan='5'>", assets, "</td></tr>");
|
1541
|
+
html.push("<tr><td colspan='3'>成立日期</td><td colspan='4'>", public_date, "</td><td colspan='3'>发行日期</td><td colspan='5'>", issue_date, "</td></tr>");
|
1542
|
+
html.push("<tr><td colspan='3'>基金管理公司</td><td colspan='4'>", Util.pack_fund_administrator(j), "</td><td colspan='3'>基金经理</td><td colspan='5'>", Util.pack_fund_manager(j), "</td></tr>");
|
1543
|
+
html.push("<tr><td colspan='3'>基金托管人</td><td colspan='4'>", (j["custodian"] ? j["custodian"] : "--"), "</td><td colspan='3'>经办律师事务所</td><td colspan='5'>", (j["lawyer"] ? j["lawyer"] : "--"), "</td></tr>");
|
1544
|
+
html.push("<tr><td colspan='3'>会计师事务所</td><td colspan='4'>", (j["accounting"] ? j["accounting"] : "--"), "</td><td colspan='3'>注册地址</td><td colspan='5'>", Util.map_url(j["location"], j["location"]), "</td></tr>");
|
1545
|
+
html.push("<tr><td colspan='3'>近一周</td><td colspan='4'>", Util.parse_ratio(j["one_week_change"]), "</td><td colspan='3'>近一月</td><td colspan='5'>", Util.parse_ratio(j["one_month_change"]), "</td></tr>");
|
1546
|
+
html.push("<tr><td colspan='3'>近一年</td><td colspan='4'>", Util.parse_ratio(j["one_year_change"]), "</td><td colspan='3'>年初至今</td><td colspan='5'>", Util.pack_html_link('https://fundf10.eastmoney.com/jdzf_' + j["fund_code"] + '.html', Util.parse_ratio(j["ytd_change"])), "</td></tr>");
|
1547
|
+
html.push("<tr><td colspan='5'>成立以来</td><td colspan='10'>", Util.parse_ratio(j["establish_change"]), "</td></tr>");
|
1548
|
+
html.push("<tr class='info'><th colspan='15' style='text-align: center;'>", Util.pack_html_link("http://fund.eastmoney.com/f10/ccmx_" + j["fund_code"] + ".html", "持股明细"), " <span id='fund_stock_date_zone'></span></th></tr>");
|
1549
|
+
html.push("<tr id='" + component_id + "_head'><th>序号</th><th>股票代码</th><th>股票名</th><th>PE</th><th>总市值</th><th>行业</th><th>地区</th><th>价格</th><th>年初至今</th><th>近5日</th><th>股东数</th><th>持有量</th><th class='info'>占比</th><th>占比变化</th><th>持仓市值</th></tr>");
|
1550
|
+
html.push("<tr class='" + component_id + "_tr'><td colspan='15'>暂无数据</td></tr>");
|
1551
|
+
Util.render_table_html(component_id + "_body_body", html);
|
1550
1552
|
if (j["date_list"]) {
|
1551
|
-
|
1552
|
-
|
1553
|
+
html = [];
|
1554
|
+
html.push("<select id='fund_stock_date'>");
|
1553
1555
|
j["date_list"].forEach(function (date) {
|
1554
|
-
|
1556
|
+
html.push("<option value='", date, "'>", Util.seconds_to_format(date, "%Y-%m-%d"), "</option>");
|
1555
1557
|
});
|
1556
|
-
|
1557
|
-
$("#fund_stock_date_zone").html(
|
1558
|
+
html.push("</select>");
|
1559
|
+
$("#fund_stock_date_zone").html(html.join(""));
|
1558
1560
|
let fsd_obj = $("#fund_stock_date");
|
1559
1561
|
fsd_obj.change(function () {
|
1560
1562
|
Util.fetch_public_fund_stock(j["fund_code"], $("#fund_stock_date").val(), component_id);
|
@@ -1562,8 +1564,8 @@ const Util = {
|
|
1562
1564
|
Util.fetch_public_fund_stock(j["fund_code"], fsd_obj.val(), component_id);
|
1563
1565
|
}
|
1564
1566
|
} else {
|
1565
|
-
|
1566
|
-
Util.render_table_html(component_id + "_body_body",
|
1567
|
+
html.push("<tr><td colspan='15'>暂无数据</td></tr>");
|
1568
|
+
Util.render_table_html(component_id + "_body_body", html);
|
1567
1569
|
}
|
1568
1570
|
});
|
1569
1571
|
},
|
@@ -1601,15 +1603,15 @@ const Util = {
|
|
1601
1603
|
$("." + component_tr).each(function () {
|
1602
1604
|
$(this).remove();
|
1603
1605
|
});
|
1604
|
-
let
|
1606
|
+
let html = [];
|
1605
1607
|
if (j["data"]) {
|
1606
1608
|
j["data"].forEach(function (item, index) {
|
1607
|
-
|
1608
|
-
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1609
|
+
html.push("<tr class='" + component_tr + "'>");
|
1610
|
+
html.push("<td>", index + 1, "</td>");
|
1611
|
+
html = Util.stock_basics_html(html, item);
|
1612
|
+
html.push("<td>", Util.year_price_rate(item["stock_price"], item["year_price"]), "</td>");
|
1613
|
+
html.push("<td>", Util.year_price_rate(item["stock_price"], item["d5_price"]), "</td>");
|
1614
|
+
html.push("<td>", Util.pack_holder_num(item), "</td>");
|
1613
1615
|
let stock_num_tips = "";
|
1614
1616
|
if (item["stock_num"] > 0 && item["pre_stock_num"] > 0) {
|
1615
1617
|
let gap_stock_num = item["stock_num"] - item["pre_stock_num"];
|
@@ -1619,7 +1621,7 @@ const Util = {
|
|
1619
1621
|
stock_num_tips = "<b class='text-success'>(" + Util.to_unit(gap_stock_num) + ")</b>";
|
1620
1622
|
}
|
1621
1623
|
}
|
1622
|
-
|
1624
|
+
html.push("<td>", Util.to_unit(item["stock_num"]), stock_num_tips, "</td>");
|
1623
1625
|
let rate_tips = "", rate_change = "--";
|
1624
1626
|
if (item["rate"] > 0 && item["rate"] > item["pre_rate"]) {
|
1625
1627
|
rate_tips = "<b class='text-danger'>(+" + Util.to_float(item["rate"] - item["pre_rate"], 2) + "%)</b>";
|
@@ -1629,15 +1631,15 @@ const Util = {
|
|
1629
1631
|
if (item["pre_rate"] && item["pre_rate"] > 0) {
|
1630
1632
|
rate_change = Util.year_price_rate(item["rate"], item["pre_rate"], 1);
|
1631
1633
|
}
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1634
|
+
html.push("<td>", item["rate"], "%", rate_tips, "</td>");
|
1635
|
+
html.push("<td>", rate_change, "</td>");
|
1636
|
+
html.push("<td>", Util.to_unit(item["fund_market_capital"]), "</td>");
|
1637
|
+
html.push("</tr>");
|
1636
1638
|
});
|
1637
1639
|
} else {
|
1638
|
-
|
1640
|
+
html.push("<tr class='" + component_tr + "'><td colspan='15'>暂无数据</td></tr>");
|
1639
1641
|
}
|
1640
|
-
$(
|
1642
|
+
$(html.join("")).insertAfter("#" + component_id + "_head");
|
1641
1643
|
Util.hide_tips();
|
1642
1644
|
if (j["data"]) {
|
1643
1645
|
Util.refresh_price(component_id + "_body");
|
@@ -1677,10 +1679,10 @@ const Util = {
|
|
1677
1679
|
Util.show_loading();
|
1678
1680
|
let category_top_type = parseInt($("#category_top_type").val());
|
1679
1681
|
Util.post(location.pathname, {"action": "category_top_statistics", "type": category_top_type}, function (j) {
|
1680
|
-
let
|
1682
|
+
let html = [];
|
1681
1683
|
j["data"].forEach(function (item) {
|
1682
1684
|
let date_data = [], cole_url = "";
|
1683
|
-
|
1685
|
+
html.push("<tr>");
|
1684
1686
|
item["name"] = item["name"] + "(" + item["code"] + ")";
|
1685
1687
|
if (category_top_type === 2) {
|
1686
1688
|
cole_url = "http://q.10jqka.com.cn/thshy/detail/code/" + item["code"];
|
@@ -1689,13 +1691,13 @@ const Util = {
|
|
1689
1691
|
} else {
|
1690
1692
|
cole_url = "https://xueqiu.com/S/" + Util.code_to_fund_symbol(item["code"]);
|
1691
1693
|
}
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1694
|
+
html.push("<td>", Util.pack_html_link(cole_url, item["name"]), "</td>");
|
1695
|
+
html.push("<td>", item["num"], "</td>");
|
1696
|
+
html.push("<td data-val='", item["interval_day"], "'>", (item["interval_day"] < 10000 ? (item["interval_day"] + "天") : "--"), "</td>");
|
1695
1697
|
if (item["dist_day"] < item["interval_day"]) {
|
1696
|
-
|
1698
|
+
html.push("<td data-val='", item["dist_day"], "'>", item["dist_day"], "天</td>");
|
1697
1699
|
} else {
|
1698
|
-
|
1700
|
+
html.push("<td class='danger' data-val='", item["dist_day"], "'>", item["dist_day"], "天</td>");
|
1699
1701
|
}
|
1700
1702
|
item["data"].forEach(function (d) {
|
1701
1703
|
let date_format = Util.seconds_to_format(d["date"], "%Y-%m-%d");
|
@@ -1708,10 +1710,10 @@ const Util = {
|
|
1708
1710
|
if (item["num"] > 6) {
|
1709
1711
|
date_data += "...";
|
1710
1712
|
}
|
1711
|
-
|
1712
|
-
|
1713
|
+
html.push("<td class='text-left'>", date_data, "</td>");
|
1714
|
+
html.push("</tr>");
|
1713
1715
|
});
|
1714
|
-
Util.render_table_html("category_top_modal_body_body",
|
1716
|
+
Util.render_table_html("category_top_modal_body_body", html);
|
1715
1717
|
Util.hide_tips();
|
1716
1718
|
});
|
1717
1719
|
},
|
@@ -1769,7 +1771,7 @@ const Util = {
|
|
1769
1771
|
action: "currency_data"
|
1770
1772
|
};
|
1771
1773
|
Util.post(Util.get_url("macro_currency"), payload, function (j) {
|
1772
|
-
let
|
1774
|
+
let html = [], low_exchange_rate = 0, high_exchange_rate = 0;
|
1773
1775
|
j["data"].forEach(function (item) {
|
1774
1776
|
if (low_exchange_rate === 0 || item["exchange_rate"] < low_exchange_rate) {
|
1775
1777
|
low_exchange_rate = item["exchange_rate"];
|
@@ -1778,19 +1780,19 @@ const Util = {
|
|
1778
1780
|
});
|
1779
1781
|
j["data"].forEach(function (item) {
|
1780
1782
|
if (item["exchange_rate"] === high_exchange_rate) {
|
1781
|
-
|
1783
|
+
html.push("<tr class='danger'>");
|
1782
1784
|
} else if (item["exchange_rate"] === low_exchange_rate) {
|
1783
|
-
|
1785
|
+
html.push("<tr class='success'>");
|
1784
1786
|
} else {
|
1785
|
-
|
1787
|
+
html.push("<tr>");
|
1786
1788
|
}
|
1787
|
-
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1791
|
-
|
1789
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
1790
|
+
html.push("<td>", item["exchange_rate"], "</td>");
|
1791
|
+
html.push("<td>", item["low_exchange_rate"], "</td>");
|
1792
|
+
html.push("<td>", item["high_exchange_rate"], "</td>");
|
1793
|
+
html.push("</tr>");
|
1792
1794
|
});
|
1793
|
-
Util.render_table_html("currency_modal_body_body",
|
1795
|
+
Util.render_table_html("currency_modal_body_body", html);
|
1794
1796
|
let currency_modal_summary = "历史最低:<span class='label label-success'>" + j["hist_low"] +
|
1795
1797
|
"</span> 历史最高:<span class='label label-danger'>" + j["hist_high"] +
|
1796
1798
|
"</span> 年初至今:" + Util.digit_compare_trend1(j["exchange_rate"], j["year_exchange_rate"]) +
|
@@ -1862,7 +1864,7 @@ const Util = {
|
|
1862
1864
|
"currency_type": $("#currency_type").val()
|
1863
1865
|
};
|
1864
1866
|
Util.post(Util.get_url("coin_price"), payload, function (j) {
|
1865
|
-
let
|
1867
|
+
let html = [], low_price = 0, high_price = 0;
|
1866
1868
|
j["data"].forEach(function (item) {
|
1867
1869
|
if (low_price === 0 || item["price"] < low_price) {
|
1868
1870
|
low_price = item["price"];
|
@@ -1871,23 +1873,23 @@ const Util = {
|
|
1871
1873
|
});
|
1872
1874
|
j["data"].forEach(function (item) {
|
1873
1875
|
if (item["price"] === high_price) {
|
1874
|
-
|
1876
|
+
html.push("<tr class='danger'>");
|
1875
1877
|
} else if (item["price"] === low_price) {
|
1876
|
-
|
1878
|
+
html.push("<tr class='success'>");
|
1877
1879
|
} else {
|
1878
|
-
|
1880
|
+
html.push("<tr>");
|
1879
1881
|
}
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1882
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
1883
|
+
html.push("<td>", item["open"], "</td>");
|
1884
|
+
html.push("<td>", item["low"], "</td>");
|
1885
|
+
html.push("<td>", item["high"], "</td>");
|
1886
|
+
html.push("<td>", item["price"], "</td>");
|
1887
|
+
html.push("<td>", Util.parse_ratio(item["p_change"]), "</td>");
|
1888
|
+
html.push("<td>", Util.to_unit(item["amount"]), "</td>");
|
1889
|
+
html.push("<td>", Util.to_unit(item["market_capital"]), "</td>");
|
1890
|
+
html.push("</tr>");
|
1889
1891
|
});
|
1890
|
-
Util.render_table_html("btc_modal_body_body",
|
1892
|
+
Util.render_table_html("btc_modal_body_body", html);
|
1891
1893
|
let btc_title = j["cn_name"] + "(" + Util.pack_html_link('https://www.binance.com/zh-CN/trade/' + j["short_name"] + '_USDT?theme=dark', j["short_name"]) + ", " + Util.pack_html_link("https://www.feixiaohao.com/currencies/" + j["coin"], j["coin"]) + ")";
|
1892
1894
|
btc_title += " <small>历史最低:<span class='label label-success'>" + j["hist_low"] + "</span> 历史最高:<span class='label label-danger'>" + j["hist_high"] +
|
1893
1895
|
"</span> 年初至今:" + Util.digit_compare_trend1(j["price"], j["year_price"]) +
|
@@ -1927,7 +1929,7 @@ const Util = {
|
|
1927
1929
|
end_date: $("#statistics_end_date").val(),
|
1928
1930
|
};
|
1929
1931
|
Util.post(Util.get_url("hsgt_trade_stock"), payload, function (j) {
|
1930
|
-
let
|
1932
|
+
let html = [];
|
1931
1933
|
let summary_inflow = 0;
|
1932
1934
|
let buy_times = 0;
|
1933
1935
|
let sell_times = 0;
|
@@ -1941,16 +1943,16 @@ const Util = {
|
|
1941
1943
|
}
|
1942
1944
|
let inflow = item["buy"] - item["sell"];
|
1943
1945
|
summary_inflow += inflow;
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1946
|
+
html.push("<tr>");
|
1947
|
+
html.push("<td>", total_times, "</td>");
|
1948
|
+
html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
|
1949
|
+
html.push("<td title='", item["buy"], "'>", Util.to_unit(item["buy"]), "</td>");
|
1950
|
+
html.push("<td title='", item["sell"], "'>", Util.to_unit(item["sell"]), "</td>");
|
1951
|
+
html.push("<td title='", inflow, "'><b class='", Util.text_color(inflow), "'>", Util.to_unit(inflow), "</b></td>");
|
1952
|
+
html.push("<td>", Util.to_unit(item["buy"] + item["sell"]), "</td>");
|
1953
|
+
html.push("</tr>");
|
1952
1954
|
});
|
1953
|
-
Util.render_table_html(component_id + "_body_body",
|
1955
|
+
Util.render_table_html(component_id + "_body_body", html);
|
1954
1956
|
$("#" + component_id + "_title").html("[" + Util.stock_url(code, j["stock_name"]) + "]资金流向明细(<span>净买入:<b title='" + summary_inflow + "' class='" + Util.text_color(summary_inflow) + "'>" + Util.to_unit(summary_inflow) + "</b>, 上榜次数:<b class='text-info'>" + total_times + "</b>, 买入次数:<b class='text-danger'>" + buy_times + "</b>, 卖出次数:<b class='text-success'>" + sell_times + "</b></span>)");
|
1955
1957
|
});
|
1956
1958
|
}
|
@@ -1975,13 +1977,13 @@ const Util = {
|
|
1975
1977
|
$("#" + element_id).html(show_profile);
|
1976
1978
|
$('#' + modal_id).on('shown.bs.modal', function () {
|
1977
1979
|
let p_arr = profile.split("。");
|
1978
|
-
let
|
1980
|
+
let html = [];
|
1979
1981
|
p_arr.forEach(function (p) {
|
1980
1982
|
if (p.length > 0) {
|
1981
|
-
|
1983
|
+
html.push("<p>", p.replace(/,/g, ","), "。</p>");
|
1982
1984
|
}
|
1983
1985
|
});
|
1984
|
-
Util.render_table_html(modal_id + "_body",
|
1986
|
+
Util.render_table_html(modal_id + "_body", html);
|
1985
1987
|
});
|
1986
1988
|
}
|
1987
1989
|
},
|
@@ -2266,23 +2268,23 @@ const Util = {
|
|
2266
2268
|
|
2267
2269
|
init_time_select_range: function (Obj, select_id, start_id, end_id, callback_func) {
|
2268
2270
|
let select_obj = $("#" + select_id);
|
2269
|
-
let
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
select_obj.html(
|
2271
|
+
let html = [];
|
2272
|
+
html.push('<option value="0">时间区间选择</option>');
|
2273
|
+
html.push('<option value="1">这周</option>');
|
2274
|
+
html.push('<option value="2">这月</option>');
|
2275
|
+
html.push('<option value="3">上一周</option>');
|
2276
|
+
html.push('<option value="4">上一月</option>');
|
2277
|
+
html.push('<option value="5">年初至今</option>');
|
2278
|
+
html.push('<option value="6">最近7日</option>');
|
2279
|
+
html.push('<option value="7">最近30日</option>');
|
2280
|
+
html.push('<option value="8">最近60日</option>');
|
2281
|
+
html.push('<option value="9">最近90日</option>');
|
2282
|
+
html.push('<option value="10">最近半年</option>');
|
2283
|
+
html.push('<option value="11">最近一年</option>');
|
2284
|
+
html.push('<option value="99">所有时间</option>');
|
2285
|
+
html.push('<option value="100">还原</option>');
|
2286
|
+
html.push('<option value="101">置空</option>');
|
2287
|
+
select_obj.html(html.join(""));
|
2286
2288
|
select_obj.change(function () {
|
2287
2289
|
let select_val = $("#" + select_id).val();
|
2288
2290
|
let sd_obj = $('#' + start_id);
|
@@ -3172,7 +3174,7 @@ const Util = {
|
|
3172
3174
|
* @returns {string}
|
3173
3175
|
*/
|
3174
3176
|
parse_index_data: function (index_data) {
|
3175
|
-
let
|
3177
|
+
let html = [];
|
3176
3178
|
if (index_data) {
|
3177
3179
|
let is_small = Util.is_small_screen();
|
3178
3180
|
index_data.forEach(function (item) {
|
@@ -3187,12 +3189,12 @@ const Util = {
|
|
3187
3189
|
if (item["code"]) {
|
3188
3190
|
title = item["name"] + "(" + item["code"] + ")";
|
3189
3191
|
}
|
3190
|
-
|
3191
|
-
|
3192
|
-
|
3192
|
+
html.push("<span title='", title, "'>", short_name, ":");
|
3193
|
+
html.push(Util.pack_index_data(item["value"], item["change_rate"]));
|
3194
|
+
html.push("</span> ");
|
3193
3195
|
});
|
3194
3196
|
}
|
3195
|
-
return
|
3197
|
+
return html.join("");
|
3196
3198
|
},
|
3197
3199
|
|
3198
3200
|
/**
|
@@ -3382,30 +3384,30 @@ const Util = {
|
|
3382
3384
|
* @param data
|
3383
3385
|
*/
|
3384
3386
|
render_summary_period_price_up_down: function(data) {
|
3385
|
-
let
|
3387
|
+
let html = [];
|
3386
3388
|
let price_market_type = $("#price_market_type").val();
|
3387
3389
|
data.forEach(function (item) {
|
3388
|
-
|
3389
|
-
|
3390
|
+
html.push("<tr>");
|
3391
|
+
html.push("<td>", Util.snowball_url(item["code"]), "</td>");
|
3390
3392
|
let stock_name = item["name"];
|
3391
3393
|
if (price_market_type !== "cn") {
|
3392
3394
|
stock_name = Util.strip_bracket_string(stock_name);
|
3393
3395
|
stock_name = stock_name.substring(0, 6);
|
3394
3396
|
}
|
3395
|
-
|
3396
|
-
|
3397
|
-
|
3397
|
+
html.push("<td>", Util.stock_url(item["code"], stock_name), "</td>");
|
3398
|
+
html.push("<td>", (item["market_capital"] ? (item["market_capital"] + "亿") : "--"), "</td>");
|
3399
|
+
html.push("<td>", Util.industry_url(item["code"], item["industry"]), "</td>");
|
3398
3400
|
let p_color = Util.text_color(item["close"], item["open"]);
|
3399
|
-
|
3401
|
+
html.push("<td><b class='", p_color, "'>", Util.to_float(item["close"], 2), "<b></td>");
|
3400
3402
|
let p_change_rate = Util.calc_change_rate(item["close"], item["open"], 4);
|
3401
3403
|
p_change_rate = Util.to_float(p_change_rate * 100, 2)
|
3402
3404
|
if (p_change_rate > 0) {
|
3403
3405
|
p_change_rate = "+" + p_change_rate;
|
3404
3406
|
}
|
3405
|
-
|
3406
|
-
|
3407
|
+
html.push("<td><b class='", p_color, "'>", p_change_rate, "%<b></td>");
|
3408
|
+
html.push("</tr>");
|
3407
3409
|
});
|
3408
|
-
Util.render_table_html("price_up_down_table_body",
|
3410
|
+
Util.render_table_html("price_up_down_table_body", html);
|
3409
3411
|
},
|
3410
3412
|
|
3411
3413
|
/**
|
@@ -3413,17 +3415,17 @@ const Util = {
|
|
3413
3415
|
* @param data
|
3414
3416
|
*/
|
3415
3417
|
render_summary_period_industry_data: function(data) {
|
3416
|
-
let
|
3418
|
+
let html = [];
|
3417
3419
|
let industry_url = Util.get_url("summary_industry");
|
3418
3420
|
data.forEach(function (item) {
|
3419
|
-
|
3420
|
-
|
3421
|
-
|
3422
|
-
|
3423
|
-
|
3424
|
-
|
3421
|
+
html.push("<tr>");
|
3422
|
+
html.push("<td>", Util.pack_html_link("http://q.10jqka.com.cn/thshy/detail/code/" + item["code"], item["code"]), "</td>");
|
3423
|
+
html.push("<td>", Util.pack_html_link(industry_url + "?code=" + item["code"], item["name"]), "</td>");
|
3424
|
+
html.push("<td>", Util.year_price_rate(item["current_close"], item["year_close"], 1), "</td>");
|
3425
|
+
html.push("<td>", Util.year_price_rate(item["current_close"], item["start_close"], 1), "</td>");
|
3426
|
+
html.push("</tr>");
|
3425
3427
|
});
|
3426
|
-
Util.render_table_html("industry_table_body",
|
3428
|
+
Util.render_table_html("industry_table_body", html);
|
3427
3429
|
},
|
3428
3430
|
|
3429
3431
|
/**
|
@@ -3431,11 +3433,11 @@ const Util = {
|
|
3431
3433
|
* @param data
|
3432
3434
|
*/
|
3433
3435
|
render_summary_period_etf_data: function(data) {
|
3434
|
-
let
|
3436
|
+
let html = [];
|
3435
3437
|
data.forEach(function (item) {
|
3436
|
-
|
3437
|
-
|
3438
|
-
|
3438
|
+
html.push("<tr>");
|
3439
|
+
html.push("<td>", Util.pack_html_link("https://fund.eastmoney.com/" + item["code"] + ".html", item["code"]), "</td>");
|
3440
|
+
html.push("<td><a class='link_cls' data-toggle='modal' data-target='.public_fund_modal' data-val='", item["code"], "'>", item["name"], "</a></td>");
|
3439
3441
|
let change_quotient = "--";
|
3440
3442
|
if (item["start_quotient"] && item["end_quotient"]) {
|
3441
3443
|
let title = Util.strip_html(Util.to_unit(item["start_quotient"], 3)) + " - " + Util.strip_html(Util.to_unit(item["end_quotient"], 3));
|
@@ -3447,12 +3449,12 @@ const Util = {
|
|
3447
3449
|
change_quotient = "<b title='" + title + "'>0.00</b>";
|
3448
3450
|
}
|
3449
3451
|
}
|
3450
|
-
|
3451
|
-
|
3452
|
-
|
3453
|
-
|
3452
|
+
html.push("<td>", change_quotient, "</td>");
|
3453
|
+
html.push("<td>", Util.year_price_rate(item["current_close"], item["year_close"], 1), "</td>");
|
3454
|
+
html.push("<td>", Util.year_price_rate(item["current_close"], item["start_close"], 1), "</td>");
|
3455
|
+
html.push("</tr>");
|
3454
3456
|
});
|
3455
|
-
Util.render_table_html("etf_table_body",
|
3457
|
+
Util.render_table_html("etf_table_body", html);
|
3456
3458
|
},
|
3457
3459
|
|
3458
3460
|
/**
|
@@ -3460,18 +3462,18 @@ const Util = {
|
|
3460
3462
|
* @param data
|
3461
3463
|
*/
|
3462
3464
|
render_summary_period_index_data: function(data) {
|
3463
|
-
let
|
3465
|
+
let html = [];
|
3464
3466
|
let index_url = Util.get_url("summary_index");
|
3465
3467
|
data.forEach(function (item) {
|
3466
|
-
|
3467
|
-
|
3468
|
-
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3472
|
-
|
3468
|
+
html.push("<tr>");
|
3469
|
+
html.push("<td>", Util.pack_html_link(item["url"], item["code"].toUpperCase()), "</td>");
|
3470
|
+
html.push("<td>", Util.pack_html_link(index_url + "?index_code=" + item["code"], item["name"]), "</td>");
|
3471
|
+
html.push("<td><b class='", Util.text_color(item["current_close"], item["start_close"]), "'>", Util.to_float(item["current_close"], 2), "</b></td>");
|
3472
|
+
html.push("<td>", Util.year_price_rate(item["current_close"], item["year_close"], 1), "</td>");
|
3473
|
+
html.push("<td>", Util.year_price_rate(item["current_close"], item["start_close"], 1), "</td>");
|
3474
|
+
html.push("</tr>");
|
3473
3475
|
});
|
3474
|
-
Util.render_table_html("index_table_body",
|
3476
|
+
Util.render_table_html("index_table_body", html);
|
3475
3477
|
},
|
3476
3478
|
|
3477
3479
|
/**
|
@@ -3526,26 +3528,26 @@ const Util = {
|
|
3526
3528
|
if (!Util.regexp_date_yyyy_mm_dd(end_date)) {
|
3527
3529
|
end_date = "";
|
3528
3530
|
}
|
3529
|
-
let
|
3530
|
-
|
3531
|
-
|
3532
|
-
|
3533
|
-
|
3534
|
-
|
3535
|
-
|
3536
|
-
|
3537
|
-
|
3538
|
-
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
3543
|
-
|
3544
|
-
|
3545
|
-
|
3546
|
-
|
3547
|
-
|
3548
|
-
$("#" + element_id).html(
|
3531
|
+
let html = [];
|
3532
|
+
html.push('<div class="form-group">');
|
3533
|
+
html.push('<label for="', select_id, '"></label>');
|
3534
|
+
html.push('<select id="', select_id, '" class="form-control"></select>');
|
3535
|
+
html.push('</div>');
|
3536
|
+
html.push('<div class="form-group">');
|
3537
|
+
html.push('<label for="', start_id, '"></label>');
|
3538
|
+
html.push('<div class="col-md-6 col-sm-6 col-xs-12 form-group">');
|
3539
|
+
html.push('<input type="text" class="form-control has-feedback-left" id="', start_id, '" name="', start_id, '" title="开始时间" placeholder="开始时间" value="', start_date, '">');
|
3540
|
+
html.push('<span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>');
|
3541
|
+
html.push('</div>');
|
3542
|
+
html.push('</div>');
|
3543
|
+
html.push('<div class="form-group" style="margin-left: -15px;">');
|
3544
|
+
html.push('<label for="', end_id, '"></label>');
|
3545
|
+
html.push('<div class="col-md-6 col-sm-6 col-xs-12 form-group">');
|
3546
|
+
html.push('<input type="text" class="form-control has-feedback-left" id="', end_id, '" name="', end_id, '" title="结束时间" placeholder="结束时间" value="', end_date, '">');
|
3547
|
+
html.push('<span class="fa fa-calendar-o form-control-feedback left" aria-hidden="true"></span>');
|
3548
|
+
html.push('</div>');
|
3549
|
+
html.push('</div>');
|
3550
|
+
$("#" + element_id).html(html.join(""));
|
3549
3551
|
Util.init_range_picker_date(start_id, end_id, nth_day);
|
3550
3552
|
Util.init_time_select_range(Obj, select_id, start_id, end_id, callback_func);
|
3551
3553
|
},
|
@@ -3865,16 +3867,16 @@ const Util = {
|
|
3865
3867
|
init_metrics_statistics: function (metrics, title, callback_func) {
|
3866
3868
|
let metrics_drop_down_id = metrics + "_time_drop_down";
|
3867
3869
|
if ($("#" + metrics_drop_down_id).length === 0) {
|
3868
|
-
let
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
3872
|
-
|
3873
|
-
|
3874
|
-
|
3875
|
-
|
3876
|
-
|
3877
|
-
$("#metrics_" + metrics).html(
|
3870
|
+
let html = [];
|
3871
|
+
html.push('<div class="x_panel">');
|
3872
|
+
html.push('<div class="x_title"><div class="form-inline">');
|
3873
|
+
html.push('<div class="form-group"><h2 class="form-control-static" id="' + metrics + '_title">' + title + '<small id="' + metrics + '_tips"></small></h2></div>');
|
3874
|
+
html.push('<div class="form-group pull-right" id="' + metrics_drop_down_id + '" style="margin-right: 25px;">');
|
3875
|
+
html.push('</div>');
|
3876
|
+
html.push('</div><div class="clearfix"></div></div>');
|
3877
|
+
html.push('<div class="x_content" style="height:350px;"><div id="' + metrics + '_bar_canvas"></div></div>');
|
3878
|
+
html.push('</div>');
|
3879
|
+
$("#metrics_" + metrics).html(html.join(""));
|
3878
3880
|
Util.init_time_drop_down(metrics, metrics_drop_down_id, "daily", callback_func);
|
3879
3881
|
Util.init_time_drop_down(metrics, metrics_drop_down_id, "week", callback_func);
|
3880
3882
|
Util.init_time_drop_down(metrics, metrics_drop_down_id, "month", callback_func);
|
@@ -3895,16 +3897,16 @@ const Util = {
|
|
3895
3897
|
time_arr = ["20日", "60日", "120日", "200日"];
|
3896
3898
|
}
|
3897
3899
|
let default_time = (date_type === "daily" || date_type === "week") ? time_arr[1] : time_arr[0];
|
3898
|
-
let
|
3899
|
-
|
3900
|
-
|
3901
|
-
|
3902
|
-
|
3900
|
+
let html = [];
|
3901
|
+
html.push('<div class="btn-group">');
|
3902
|
+
html.push('<button id="' + metrics_drop_down_btn_id + '" data-val="' + date_type + '" type="button" class="btn btn-default ' + metrics + '_bar_btn">' + default_time + '</button>');
|
3903
|
+
html.push('<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button>');
|
3904
|
+
html.push('<ul style="margin-top: 5px;" class="dropdown-menu" id="' + metrics_drop_down_type_id + '">');
|
3903
3905
|
time_arr.forEach(function (t) {
|
3904
|
-
|
3906
|
+
html.push('<li><a href="javacript:void(0);">', t, '</a></li>');
|
3905
3907
|
});
|
3906
|
-
|
3907
|
-
$("#" + metrics_drop_down_id).append(
|
3908
|
+
html.push('</ul></div> ');
|
3909
|
+
$("#" + metrics_drop_down_id).append(html.join(""));
|
3908
3910
|
$("#" + metrics_drop_down_type_id + " li a").click(function () {
|
3909
3911
|
$("#" + metrics_drop_down_btn_id).text($(this).text());
|
3910
3912
|
callback_func(metrics, date_type);
|