diff --git a/fr-plugin-hwExcelExport-1.8.3.zip b/fr-plugin-hwExcelExport-1.8.3.zip new file mode 100644 index 0000000..d79b495 Binary files /dev/null and b/fr-plugin-hwExcelExport-1.8.3.zip differ diff --git a/src/main/java/com/fr/plugin/decision/HWUtils.java b/src/main/java/com/fr/plugin/decision/HWUtils.java index ad47f35..c3163d2 100644 --- a/src/main/java/com/fr/plugin/decision/HWUtils.java +++ b/src/main/java/com/fr/plugin/decision/HWUtils.java @@ -65,7 +65,11 @@ public class HWUtils { XSSFCell cell = (XSSFCell) cellIterator.next(); String value = getString(cell); if (StringUtils.isNotBlank(value)) { - JSONObject o = JSONObject.create().put("titleRow", titleRow).put("value", cell.getColumnIndex()).put("text", value); + JSONObject o = JSONObject.create(). + put("titleRow", titleRow). + put("type", "12"). + put("value", cell.getColumnIndex()). + put("text", value); result.add(o); } } diff --git a/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.js b/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.js index 70dc36c..0025e16 100644 --- a/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.js +++ b/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.js @@ -39,39 +39,29 @@ type: "bi.absolute", items: [{ el: { - type: "bi.vtape", - items: [{ - height: 24, - - el: { - type: "bi.button", - textAlign: "center", - disabled: !o.add, - text: "增加", - height: 24, - width: 100, - handler: function () { - self.store.addItems(); - } - } - }, { - el: { - type: "dec.page.table", - header: [{text: "字段名"}, {text: "字段类型"}, {text: "长度"}, {text: "excel列"}, {text: "主键"}, {text: ""}], - columnSize: ["0.2", "0.2", "0.2", "0.2", "0.1", "0.1"], - perPage: 5, - ref: function (_ref) { - self.table = _ref; - }, - items: self.model.perItems, - listeners: [{ - eventName: "EVENT_CHANGE", - action: function (v) { - self.store.setPage(v); - } - }] + type: "dec.page.table", + header: [{text: "字段名"}, {text: "字段类型"}], + columnSize: ["0.6", "0.4"], + perPage: 5, + ref: function (_ref) { + self.table = _ref; + }, + items: self.model.perItems, + listeners: [{ + eventName: "EVENT_CHANGE", + action: function (v) { + self.store.setPage(v); } }] + + // }, { + // type: "bi.components.preview_table", + // items: this._getFieldItems(), + // header: this._getFieldHeader(), + // columnSize: ["0.6", "0.4"], + // ref: function (ref) { + // self.table = _ref; + // } }, top: 0, bottom: 0, left: 0, right: 0 }] @@ -89,110 +79,47 @@ var item = items[index]; self.colName.push(item.colName); var result = []; - var type = "dec.hw.table.col.attr.td"; var colName = { - type: "bi.text_editor", - disabled: !o.add, - widgetType: "bi.text_editor", - value: item.colName, - id: item.id, - listeners: [ - { - eventName: "EVENT_CHANGE", - action: function () { - self.store.updateItemColName(this.options.id,this.getValue()); - } - } - ] + type: "bi.label", + textAlign: "left", + width: "100%", + value: item.colName }; result.push(colName); + // var colType = { + // type: "bi.text_value_combo", + // disabled: !o.add, + // widgetType: "bi.text_value_combo", + // value: item.colType+"", + // items: BI.Constants.getConstant("dec.hw.col.type"), + // id: item.id, + // listeners: [ + // { + // eventName: "EVENT_CHANGE", + // action: function () { + // self.store.updateItemColType(this.options.id,this.getValue()[0]); + // } + // } + // ] + // }; var colType = { - type: "bi.text_value_combo", - disabled: !o.add, - widgetType: "bi.text_value_combo", - value: item.colType+"", - items: BI.Constants.getConstant("dec.hw.col.type"), - id: item.id, - listeners: [ - { - eventName: "EVENT_CHANGE", - action: function () { - self.store.updateItemColType(this.options.id,this.getValue()[0]); - } + type: "bi.component.field_type_combo", + value: item.colType, + listeners: [{ + eventName: "EVENT_CHANGE", + action: function (v) { + self.store.setFieldType(idx, v); } - ] + }] }; + // var colType = { + // type: "bi.icon_text_item", + // cls: "custom-add-group-font bi-list-item", + // text: BI.i18nText("BI-Basic_Add_Group"), + // textRgap: 5 + // value: item.colType + // } result.push(colType); - var colLength = { - type: "bi.text_editor", - widgetType: "bi.text_editor", - disabled: !o.add, - value: item.colLength, - /*validationChecker: function (v) { - return BI.isPositiveInteger(v) && v > 0; - }, - errorText: "必须是数字",*/ - id: item.id, - listeners: [ - { - eventName: "EVENT_CHANGE", - action: function () { - self.store.updateItemColLength(this.options.id,this.getValue()); - } - } - ] - }; - result.push(colLength); - var excelCol = { - type: "bi.text_value_combo", - widgetType: "bi.text_editor", - value: item.excelCol, - items:self.model.excelItems, - id: item.id, - ref: function (_ref) { - self.excelBox.push(_ref); - }, - listeners: [ - { - eventName: "EVENT_CHANGE", - action: function () { - self.store.updateItemExcelCol(this.options.id,this.getValue()[0]); - } - } - ] - }; - result.push(excelCol); - var primaryKey = { - type: "bi.checkbox", - widgetType: "bi.checkbox", - selected: item.primaryKey, - disabled: !o.add, - id: item.id, - ref: function(_ref){ - self.primaryKeyBox.push(_ref); - }, - handler: function () { - var id = this.options.id; - self.store.updateItemPrimaryKey(id, this.isSelected()); - /*this.isSelected() && BI.each(self.primaryKeyBox, function (index, item) { - if (id != item.options.id) { - item.setSelected(false); - } - });*/ - } - }; - result.push(primaryKey); - var deleteButton = { - type: "bi.button", - widgetType: "bi.button", - disabled: !o.add, - value: "删除", - handler: function () { - self.store.removeItems(this.options.id); - }, - id: item.id - }; - result.push(deleteButton); allResult.push(result); } return allResult; diff --git a/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.model.js b/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.model.js index 0f6bd22..079fbdc 100644 --- a/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.model.js +++ b/src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.model.js @@ -19,6 +19,7 @@ var start = (self.model.page - 1) * self.model.perCount; var end = self.model.page * self.model.perCount; var self = this; + console.log("items", self.model.items) return BI.filter(self.model.items, function (index, item) { return index + 1 > start && index + 1 <= end; }) diff --git a/src/main/resources/com/fr/plugin/hw/decision/js/hw.option.js b/src/main/resources/com/fr/plugin/hw/decision/js/hw.option.js index ad3ab3d..3044fdb 100644 --- a/src/main/resources/com/fr/plugin/hw/decision/js/hw.option.js +++ b/src/main/resources/com/fr/plugin/hw/decision/js/hw.option.js @@ -76,7 +76,6 @@ val.colType = 91; } }); - console.log(data); return data; }; @@ -175,7 +174,6 @@ add:true, infoId:"add", onClickConfirm: function (val, callback) { - console.log(val); Dec.HW.importTableData(val,function (res) { debugger; }); @@ -218,7 +216,6 @@ add:false, infoId:"edit", onClickConfirm: function (val, callback) { - console.log(val); Dec.HW.importTableData(val,function (res) { debugger; }); diff --git a/src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js b/src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js index cbcee6f..d18195b 100644 --- a/src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js +++ b/src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js @@ -20,9 +20,6 @@ computed: {}, watch: { - aliasName: function (v) { - //console.log(v) - }, excelItems:function (v) { if (this.model.infoId == "add"){ this.addItems() @@ -54,7 +51,9 @@ val.colType = 91; } });*/ + console.log("queryData", self.model.items) self.model.items = BI.hwColTypeDeal(res.data.colAttr); + console.log("queryData2", self.model.items) self.model.connection = res.data.tableAttr.connection; self.model.schema = res.data.tableAttr.schema; self.model.tableName = res.data.tableAttr.tableName; @@ -144,13 +143,15 @@ var result=BI.map(self.model.excelItems,function (index, item) { return { id:BI.UUID(), - colName:item.text, - colType:"12", + colName: item.text, + colType: item.colType, colLength: 255, - excelCol:item.value + excelCol: item.value } }); - self.model.items=BI.concat(self.model.items,result); + console.log("excelAdd", self.model.items) + self.model.items=BI.concat(self.model.items, result); + console.log("excelAdd2", self.model.items) } } });