|
|
|
@ -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; |
|
|
|
|