/** * Created by Jacky.gao on 2016/9/19. */ import {MsgBox} from 'flowdesigner'; import Cell from './Cell.js'; export default class ConditionCell extends Cell{ constructor(row,col,cellData){ super(row,col,cellData); this.type="condition"; } initCell(cellData){ const _this=this; const container=$(`
`); this.td.append(container); const conditionContainer=$('无'); container.append(conditionContainer); const configCondition=$(``); container.append(configCondition); if(cellData){ this.cellCondition=new urule.CellCondition(""); this.cellCondition.initData(cellData.joint); conditionContainer.empty(); conditionContainer.append(this.cellCondition.getDisplayContainer()); } configCondition.click(function () { const dialogContent=$(""); if(!_this.cellCondition){ _this.cellCondition=new urule.CellCondition(""); } _this.cellCondition.renderTo(dialogContent); const caption="配置条件"; MsgBox.showDialog(caption,dialogContent,[],[{ name:'hide.bs.modal', callback:function(){ conditionContainer.empty(); conditionContainer.append(_this.cellCondition.getDisplayContainer()); } }],true); }); if(this.row.rowType && this.row.rowType==='condition'){ const _this=this; const del=$(``); container.append(del); del.click(function () { bootbox.confirm("真的要删除?",function (result) { if(!result)return; _this.row.remove(); }); }); } } }