103 lines
2.9 KiB
JavaScript
103 lines
2.9 KiB
JavaScript
var vueDataCache = new Vue({
|
|
el: '#divDataCache',
|
|
data: {
|
|
tables: [],
|
|
tableName: '',
|
|
resultJson: ''
|
|
},
|
|
mounted() {
|
|
this.loadTables();
|
|
},
|
|
methods: {
|
|
loadTables() {
|
|
var self = this;
|
|
main.post('/sysinfo/AjaxGetDataCacheTables').done(function (resp) {
|
|
self.tables = resp.obj || resp.data;
|
|
self.tableName = self.tables[0];
|
|
}).fail(function () {
|
|
self.tables = [];
|
|
self.tableName = '';
|
|
});
|
|
},
|
|
loadData() {
|
|
if (!this.tableName) {
|
|
return main.alert('未选择数据表');
|
|
}
|
|
var self = this;
|
|
main.post('/sysinfo/AjaxGetDataCacheData', { tableName: this.tableName }).done(function (resp) {
|
|
self.resultJson = resp.obj || resp.data;
|
|
});
|
|
},
|
|
copyData() {
|
|
let el = document.getElementById('textarea1');
|
|
el.select(), el.focus();
|
|
}
|
|
}
|
|
});
|
|
|
|
var vueTapConsole = new Vue({
|
|
el: '#divTapConsole',
|
|
data: {
|
|
tables: [],
|
|
tableName: '',
|
|
resultJson: ''
|
|
},
|
|
mounted() {
|
|
|
|
},
|
|
methods: {
|
|
loadTables() {
|
|
var self = this;
|
|
main.post('/TapConsole/AjaxGetDataCacheTables').done(function (resp) {
|
|
self.tables = resp.obj || resp.data;
|
|
self.tableName = self.tables[0];
|
|
}).fail(function () {
|
|
self.tables = [];
|
|
self.tableName = '';
|
|
});
|
|
},
|
|
loadData() {
|
|
if (!this.tableName) {
|
|
return main.alert('未选择数据表');
|
|
}
|
|
var self = this;
|
|
main.post('/TapConsole/AjaxGetDataCacheData', { tableName: this.tableName }).done(function (resp) {
|
|
self.resultJson = resp.obj || resp.data;
|
|
});
|
|
},
|
|
copyData() {
|
|
let el = document.getElementById('textarea2');
|
|
el.select(), el.focus();
|
|
},
|
|
sysinfo() {
|
|
var self = this;
|
|
main.post('/TapConsole/AjaxGetSysInfo').done(function (resp) {
|
|
console.log(resp.obj || resp.data);
|
|
self.resultJson = JSON.stringify(resp.obj || resp.data);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
var vueRealtimeRisk = new Vue({
|
|
el: '#divRealtimeRisk',
|
|
data: {
|
|
resultJson: ''
|
|
},
|
|
methods: {
|
|
loadTradePnlStaticsData() {
|
|
var self = this;
|
|
main.post('/sysinfo/AjaxTradePnlStaticsData').done(function (resp) {
|
|
self.resultJson = JSON.stringify(resp.obj || resp.data);
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
$(function () {
|
|
$('#myTab').one('show.bs.tab', function (event) {
|
|
if (event.target.getAttribute('href') === '#divTapConsole') {
|
|
vueTapConsole.loadTables();
|
|
}
|
|
});
|
|
}); |