|
@@ -14,33 +14,14 @@
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
|
- head: '',
|
|
|
- data: '<i class="fa fa-sort" data-toggle="tooltip" data-placement="top" title="长安拖动"></i>',
|
|
|
- static: true,
|
|
|
- width: '40'
|
|
|
- },
|
|
|
- {
|
|
|
head: '工程列表',
|
|
|
data: 'name',
|
|
|
static: false,
|
|
|
- width: '78%',
|
|
|
- url: '/tender',
|
|
|
- urlParam: [{
|
|
|
- name: 'id',
|
|
|
- value: 'id'
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- head: '最近使用',
|
|
|
- data: 'lastDateTime',
|
|
|
- static: false,
|
|
|
- width: '10%'
|
|
|
- },
|
|
|
- {
|
|
|
- head: '创建日期',
|
|
|
- data: 'createDateTime',
|
|
|
- static: false,
|
|
|
- width: '10%'
|
|
|
+ width: '100%',
|
|
|
+ event: {
|
|
|
+ getText: null,
|
|
|
+ getIcon: null
|
|
|
+ }
|
|
|
}
|
|
|
],
|
|
|
dataTemp: {
|
|
@@ -445,67 +426,31 @@
|
|
|
obj.append(tbody);
|
|
|
return tbody;
|
|
|
},
|
|
|
- /*_makeTreeExpandBtn: function (obj, node){
|
|
|
- var span = $('<a href="#" class="tree-open" title="收起"><i class="fa fa-minus-square-o mr-1"></i></a>'),
|
|
|
- btn = $('i', span);
|
|
|
- obj.append(span);
|
|
|
- node.expandBtn = span;
|
|
|
- btn.bind('click', {node: node}, function(e){
|
|
|
- e.data.node.expand(!e.data.proj.expand());
|
|
|
- });
|
|
|
- if (node.children.length === 0) {
|
|
|
- span.hide();
|
|
|
- } else {
|
|
|
- span.show();
|
|
|
- }
|
|
|
- return span;
|
|
|
- },*/
|
|
|
_makeTableRowCell: function (obj, node, columns, index) {
|
|
|
- var html = [], td, i;
|
|
|
+ var html = [], td, i, url;
|
|
|
|
|
|
html.push('<td ');
|
|
|
if (index === node.setting.tree.btnColumn){
|
|
|
html.push('class=', 'in-', node.depth().toString(), '>');
|
|
|
- // to Do 此部分中Folder与Tender的区别应由外部控制
|
|
|
- if (node.children.length !== 0) {
|
|
|
- html.push('<a href="#" class="tree-open" title="收起"><i class="fa fa-minus-square-o mr-1"></i></a>');
|
|
|
- } else if (node.data.projType === 'Folder') {
|
|
|
- html.push('<a href="#" class="tree-open" title="收起"><i class="in-2"></i></a>');
|
|
|
- } else {
|
|
|
- if (node.parent === node.tree._root) {
|
|
|
- html.push('<span class="in-1 poj-icon">└</span>');
|
|
|
- } else {
|
|
|
- html.push('<span class="in-3 poj-icon">└</span>');
|
|
|
- }
|
|
|
- }
|
|
|
- if (node.data.projType === 'Folder') {
|
|
|
- html.push('<i class="tree-icon fa fa-folder-open-o"></i>');
|
|
|
+ if (node.children.length !== 0) {
|
|
|
+ html.push('<a href="#" class="tree-open" title="收起"><i class="fa fa-minus-square-o mr-1"></i></a>');
|
|
|
} else {
|
|
|
- html.push('<i class="tree-icon"></i>');
|
|
|
+ html.push('<a href="#" class="tree-open" title="收起"><i></i></a>');
|
|
|
}
|
|
|
} else {
|
|
|
html.push('>');
|
|
|
}
|
|
|
|
|
|
- if (!columns.static) {
|
|
|
- //html.push(' ', node.data[columns.data]);
|
|
|
- if (node.data.projType === 'Folder') {
|
|
|
- html.push(' ');
|
|
|
+ if (columns.event.getIcon) {
|
|
|
+ columns.event.getIcon(html, node);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (columns.name !== '') {
|
|
|
+ if (columns.event.getText) {
|
|
|
+ columns.event.getText(html, node, node.data[columns.data]);
|
|
|
+ } else {
|
|
|
+ html.push(node.data[columns.name]);
|
|
|
}
|
|
|
- html.push('<a ');
|
|
|
- if (columns.url) {
|
|
|
- html.push('href="', columns.url);
|
|
|
- if (columns.urlParam){
|
|
|
- html.push('?');
|
|
|
- columns.urlParam.forEach(function(item){
|
|
|
- html.push(item.name, '=', node.data[item.value]);
|
|
|
- })
|
|
|
- }
|
|
|
- html.push('"');
|
|
|
- }
|
|
|
- html.push('>');
|
|
|
- html.push(node.data[columns.data]);
|
|
|
- html.push('</a>');
|
|
|
}
|
|
|
html.push('</td>');
|
|
|
|
|
@@ -535,7 +480,6 @@
|
|
|
tr.attr('id', node.domId());
|
|
|
node.row = tr;
|
|
|
_view._makeTableRowCells(tr, node);
|
|
|
- //tr.click(_event._selectProj(node));
|
|
|
tr.click(function(){
|
|
|
_event._selectProj(node);
|
|
|
});
|
|
@@ -558,7 +502,7 @@
|
|
|
}); */
|
|
|
return tr;
|
|
|
},
|
|
|
- _moveRowDomBefore(node, destination) {
|
|
|
+ _moveRowDomBefore: function (node, destination) {
|
|
|
var moveNodesRowDomBefore = function (nodes) {
|
|
|
nodes.forEach(function (node) {
|
|
|
node.row.insertBefore(destination);
|