Browse Source

temp

master
Zhenfei.Li 5 years ago
parent
commit
2f69704b3d
  1. BIN
      fr-plugin-hwExcelExport-1.8.3.zip
  2. 6
      src/main/java/com/fr/plugin/decision/HWUtils.java
  3. 183
      src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.js
  4. 1
      src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.model.js
  5. 3
      src/main/resources/com/fr/plugin/hw/decision/js/hw.option.js
  6. 15
      src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js

BIN
fr-plugin-hwExcelExport-1.8.3.zip

Binary file not shown.

6
src/main/java/com/fr/plugin/decision/HWUtils.java

@ -65,7 +65,11 @@ public class HWUtils {
XSSFCell cell = (XSSFCell) cellIterator.next(); XSSFCell cell = (XSSFCell) cellIterator.next();
String value = getString(cell); String value = getString(cell);
if (StringUtils.isNotBlank(value)) { 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); result.add(o);
} }
} }

183
src/main/resources/com/fr/plugin/hw/decision/js/attr/col.attr.js

@ -39,39 +39,29 @@
type: "bi.absolute", type: "bi.absolute",
items: [{ items: [{
el: { el: {
type: "bi.vtape", type: "dec.page.table",
items: [{ header: [{text: "字段名"}, {text: "字段类型"}],
height: 24, columnSize: ["0.6", "0.4"],
perPage: 5,
el: { ref: function (_ref) {
type: "bi.button", self.table = _ref;
textAlign: "center", },
disabled: !o.add, items: self.model.perItems,
text: "增加", listeners: [{
height: 24, eventName: "EVENT_CHANGE",
width: 100, action: function (v) {
handler: function () { self.store.setPage(v);
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: "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 top: 0, bottom: 0, left: 0, right: 0
}] }]
@ -89,110 +79,47 @@
var item = items[index]; var item = items[index];
self.colName.push(item.colName); self.colName.push(item.colName);
var result = []; var result = [];
var type = "dec.hw.table.col.attr.td";
var colName = { var colName = {
type: "bi.text_editor", type: "bi.label",
disabled: !o.add, textAlign: "left",
widgetType: "bi.text_editor", width: "100%",
value: item.colName, value: item.colName
id: item.id,
listeners: [
{
eventName: "EVENT_CHANGE",
action: function () {
self.store.updateItemColName(this.options.id,this.getValue());
}
}
]
}; };
result.push(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 = { var colType = {
type: "bi.text_value_combo", type: "bi.component.field_type_combo",
disabled: !o.add, value: item.colType,
widgetType: "bi.text_value_combo", listeners: [{
value: item.colType+"", eventName: "EVENT_CHANGE",
items: BI.Constants.getConstant("dec.hw.col.type"), action: function (v) {
id: item.id, self.store.setFieldType(idx, v);
listeners: [
{
eventName: "EVENT_CHANGE",
action: function () {
self.store.updateItemColType(this.options.id,this.getValue()[0]);
}
} }
] }]
}; };
// 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); 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); allResult.push(result);
} }
return allResult; return allResult;

1
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 start = (self.model.page - 1) * self.model.perCount;
var end = self.model.page * self.model.perCount; var end = self.model.page * self.model.perCount;
var self = this; var self = this;
console.log("items", self.model.items)
return BI.filter(self.model.items, function (index, item) { return BI.filter(self.model.items, function (index, item) {
return index + 1 > start && index + 1 <= end; return index + 1 > start && index + 1 <= end;
}) })

3
src/main/resources/com/fr/plugin/hw/decision/js/hw.option.js

@ -76,7 +76,6 @@
val.colType = 91; val.colType = 91;
} }
}); });
console.log(data);
return data; return data;
}; };
@ -175,7 +174,6 @@
add:true, add:true,
infoId:"add", infoId:"add",
onClickConfirm: function (val, callback) { onClickConfirm: function (val, callback) {
console.log(val);
Dec.HW.importTableData(val,function (res) { Dec.HW.importTableData(val,function (res) {
debugger; debugger;
}); });
@ -218,7 +216,6 @@
add:false, add:false,
infoId:"edit", infoId:"edit",
onClickConfirm: function (val, callback) { onClickConfirm: function (val, callback) {
console.log(val);
Dec.HW.importTableData(val,function (res) { Dec.HW.importTableData(val,function (res) {
debugger; debugger;
}); });

15
src/main/resources/com/fr/plugin/hw/decision/js/table.info.model.js

@ -20,9 +20,6 @@
computed: {}, computed: {},
watch: { watch: {
aliasName: function (v) {
//console.log(v)
},
excelItems:function (v) { excelItems:function (v) {
if (this.model.infoId == "add"){ if (this.model.infoId == "add"){
this.addItems() this.addItems()
@ -54,7 +51,9 @@
val.colType = 91; val.colType = 91;
} }
});*/ });*/
console.log("queryData", self.model.items)
self.model.items = BI.hwColTypeDeal(res.data.colAttr); self.model.items = BI.hwColTypeDeal(res.data.colAttr);
console.log("queryData2", self.model.items)
self.model.connection = res.data.tableAttr.connection; self.model.connection = res.data.tableAttr.connection;
self.model.schema = res.data.tableAttr.schema; self.model.schema = res.data.tableAttr.schema;
self.model.tableName = res.data.tableAttr.tableName; self.model.tableName = res.data.tableAttr.tableName;
@ -144,13 +143,15 @@
var result=BI.map(self.model.excelItems,function (index, item) { var result=BI.map(self.model.excelItems,function (index, item) {
return { return {
id:BI.UUID(), id:BI.UUID(),
colName:item.text, colName: item.text,
colType:"12", colType: item.colType,
colLength: 255, 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)
} }
} }
}); });

Loading…
Cancel
Save