import addInfoModal from '../components-control/add-info-modal.vue';
export default {
	execute: function (bill, param) {
		if (param) {
            let component = null;
			let name = GMS.$hideContainer.addComponent(addInfoModal, {}, function (c) {
				component = c;
				c.bill = bill;
				c.actionParam = param;
				c.getAssetsModal();
				c.detailItem=param.param.subTableName;
				let arr=bill.getGlobalParam(`__gms__${c.detailItem}__`);
				arr.map(a => {
					if (a.type != 'ACTION') {
						a.control = GMS.getContext().getCollector().getElement('billControl', a.valueType);
						a.config.field = a.field;
						a.define = {
							config: a.config,
							layout: {},
							name: a.valueType,
							type: a.valueType,
						};
					}
				});
		        c.tableColnum = arr.filter(a => a.type != 'ACTION')
				c.currentRowData = {};
				c.modal_visible = true;
				c.$nextTick(function () {
					component.addListener({
						close: function () {
							GMS.$hideContainer.remove(name);
						}
					});
				});
			});
		} else {
			GAMS.Common.messagePrompt('缺少参数');
		}
	}
}