/*md5:5912cdc8056d7c12fd98c24ac69ab209*/ /** * 包装新版万象组件 * https://yuque.antfin-inc.com/nue/everywhere/gdb60g */ import Magix from 'magix'; import * as $ from '$'; import * as View from '../mx-util/view'; import * as Dialog from '../mx-dialog/index'; const { Router } = Magix; export default View.extend({ mixins: [Dialog], getCurSourceId() { let data = this.updater.get(); let sourceList = data.sourceList, defaultSourceId = data.defaultSourceId; let loc = Router.parse(); let path = loc.path; let params = loc.params; let cur = {}; for (let i = 0; i < sourceList.length; i++) { let hash = sourceList[i].hash; // 比较路径 let equal = (hash.path == path); // 比较参数:当前参数包含配置参数即匹配中 for (let key in hash.params) { equal = equal && (hash.params[key] == params[key]); } if (equal) { cur = sourceList[i]; break; } } return $.isEmptyObject(cur) ? defaultSourceId : cur.id; }, 'openDlg'() { let { url } = this.updater.get(); this.mxDialog('@./dlg', { data: { url } }, { width: 960, height: 700, mask: true }); } });