Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fnFullName = (target, options = {}) => {
let fullname;
if (options.hasOwnProperty("i18n.cab") && options.hasOwnProperty("i18n.name")) {
const cab = options["i18n.cab"];
const name = options["i18n.name"];
if (name && cab) {
// 参数严格检查
Ux.E.fxTerminal(!cab || !cab.hasOwnProperty("ns"), 10061, cab, "ns");
Ux.E.fxTerminal(!name, 10062, name);
fullname = cab['ns'] + "/" + name;
if (target) target.displayName = fullname;
}
}
return fullname;
};
/**
if (this._raft['enabled']) {
if (!this._raft.hasOwnProperty("columns")) {
// 默认4列
this._raft.columns = 4;
}
config.raft = this._raft;
}
// Logger日志专用
if (!this._disableLog) {
if (this._logger) {
config.logger = this._logger;
} else {
const {Logger} = Ux;
const cabFile: String = this._cabFile ? this._cabFile : "";
let isContainer = false;
if (config['i18n.cab']) {
const ns = config['i18n.cab'].ns;
if (0 <= ns.indexOf("container/") && "UI" === cabFile) {
const {Logger} = Ux;
this._logger = Logger.container;
isContainer = true;
}
}
if (!isContainer) {
if ("UI" === cabFile) {
// 如果是UI.json,则直接使用Logger.page打印,一般为根UI.js专用
this._logger = Logger.page;
} else if (0 <= cabFile.indexOf("Form")) {
// 如果包含了Form关键字,则直接使用Logger.form打印
this._logger = Logger.form;
this._form = true;
} else if (
to() {
const config: any = {};
// Cab专用
if (this._cab && this._cabFile) {
config['i18n.name'] = this._cabFile;
config['i18n.cab'] = this._cab;
}
// 是否开启Form
if (this._form) {
config.form = true;
}
// 加载效果
if (this._loading) {
config.loading = this._loading;
}
// 启用了raft模式
if (this._raft['enabled']) {
if (!this._raft.hasOwnProperty("columns")) {
// 默认4列
this._raft.columns = 4;
}
config.raft = this._raft;
const _ixI18n = (target, options = {}) => {
let i18n;
const fullName = _ixI18nName(target, options);
if (fullName) {
const cab = options["i18n.cab"];
i18n = new HocI18n(cab.ns, fullName, {});
}
return i18n;
};
const _ixI18nName = (target, options = {}) => {
let fullName;
if (options.hasOwnProperty("i18n.cab") && options.hasOwnProperty("i18n.name")) {
const cab = options['i18n.cab'];
const name = options['i18n.name'];
if (name && cab) {
fullName = _ixFullName(target, cab, name);
}
}
return fullName;
};
const _ixI18n = (target, options = {}) => {
const fnI18n = (target, options = {}) => {
let i18n;
const fullname = fnFullName(target, options);
if (fullname) {
const cab = options["i18n.cab"];
i18n = new HocI18n(cab.ns, fullname, {});
}
return i18n;
};
/**