|
@@ -193,11 +193,11 @@ $(document).ready(function () {
|
|
|
let iRow = 2;
|
|
|
SpreadJsObj.massOperationSheet(this.sheet, function () {
|
|
|
self.sheet.setRowCount(2);
|
|
|
- for (const node of self.showData) {
|
|
|
+ for (const sd of self.showData) {
|
|
|
self.sheet.addRows(iRow, 1);
|
|
|
- loadNode(node, iRow);
|
|
|
+ loadNode(sd, iRow);
|
|
|
iRow += 1;
|
|
|
- for (const index of node.indexes) {
|
|
|
+ for (const index of sd.indexes) {
|
|
|
self.sheet.addRows(iRow, 1);
|
|
|
loadIndex(index, iRow);
|
|
|
iRow += 1;
|
|
@@ -216,6 +216,13 @@ $(document).ready(function () {
|
|
|
self.loadData(datas);
|
|
|
});
|
|
|
}
|
|
|
+ searchClass (data) {
|
|
|
+ const self = this;
|
|
|
+ data.tenders = this.tenders;
|
|
|
+ postData('/compare/searchClass', data, function (datas) {
|
|
|
+ self.loadData(datas);
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
const compareObj = new CompareObj($('#compare-spread')[0]);
|
|
|
|
|
@@ -235,6 +242,27 @@ $(document).ready(function () {
|
|
|
|
|
|
$('#search').click(function () {
|
|
|
compareObj.searchIndex($('#keyword').val());
|
|
|
+ $('.btn-secondary').removeClass('btn-secondary').addClass('btn-primary');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#index-zh').click(function () {
|
|
|
+ $('.btn-secondary').removeClass('btn-secondary').addClass('btn-primary');
|
|
|
+ $(this).removeClass('btn-primary').addClass('btn-secondary');
|
|
|
+ $('#index-dy').text('单元指标');
|
|
|
+ compareObj.searchClass(JSON.parse($(this).attr('data')));
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#index-fx').click(function () {
|
|
|
+ $('.btn-secondary').removeClass('btn-secondary').addClass('btn-primary');
|
|
|
+ $(this).removeClass('btn-primary').addClass('btn-secondary');
|
|
|
+ $('#index-dy').text('单元指标');
|
|
|
+ compareObj.searchClass(JSON.parse($(this).attr('data')));
|
|
|
+ });
|
|
|
+
|
|
|
+ $('a[data]').click(function () {
|
|
|
+ $('.btn-secondary').removeClass('btn-secondary').addClass('btn-primary');
|
|
|
+ $('#index-dy').removeClass('btn-primary').addClass('btn-secondary').text($(this).text());
|
|
|
+ compareObj.searchClass(JSON.parse($(this).attr('data')));
|
|
|
});
|
|
|
|
|
|
$('#export-excel').click(function () {
|
|
@@ -245,7 +273,7 @@ $(document).ready(function () {
|
|
|
excelIo.save(sJson, function(blob) {
|
|
|
saveAs(blob, fileName);
|
|
|
});
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
// $.contextMenu({
|
|
|
// selector: '#compare-spread',
|