@ibiz-template/runtime 0.5.0-beta.1 → 0.5.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +21 -4
- package/dist/index.system.min.js +2 -2
- package/out/controller/control/form/edit-form/edit-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/edit-form/edit-form.controller.js +2 -1
- package/out/interface/service/service/i-auth.service.d.ts +17 -0
- package/out/interface/service/service/i-auth.service.d.ts.map +1 -1
- package/out/service/dto/method.dto.d.ts +1 -1
- package/out/service/dto/method.dto.d.ts.map +1 -1
- package/out/service/dto/method.dto.js +4 -4
- package/out/service/service/auth/v7-auth.service.d.ts +2 -0
- package/out/service/service/auth/v7-auth.service.d.ts.map +1 -1
- package/out/service/service/auth/v7-auth.service.js +15 -0
- package/package.json +3 -3
- package/src/controller/control/form/edit-form/edit-form.controller.ts +2 -1
- package/src/interface/service/service/i-auth.service.ts +19 -0
- package/src/service/dto/method.dto.ts +8 -4
- package/src/service/service/auth/v7-auth.service.ts +15 -0
package/dist/index.esm.js
CHANGED
|
@@ -6772,6 +6772,21 @@ var AuthorityService = class {
|
|
|
6772
6772
|
import { CoreConst } from "@ibiz-template/core";
|
|
6773
6773
|
import { clearCookie, getCookie, setCookie } from "qx-util";
|
|
6774
6774
|
var V7AuthService = class {
|
|
6775
|
+
constructor() {
|
|
6776
|
+
this.isAnonymous = false;
|
|
6777
|
+
}
|
|
6778
|
+
async anonymousLogin() {
|
|
6779
|
+
const { anonymousUser, anonymousPwd } = ibiz.env;
|
|
6780
|
+
if (!anonymousUser || !anonymousPwd) {
|
|
6781
|
+
ibiz.log.error("\u672A\u627E\u5230\u533F\u540D\u767B\u5F55\u914D\u7F6E\u7528\u6237\u540D\u6216\u5BC6\u7801");
|
|
6782
|
+
return false;
|
|
6783
|
+
}
|
|
6784
|
+
const result = await this.login(anonymousUser, anonymousPwd);
|
|
6785
|
+
if (result) {
|
|
6786
|
+
this.isAnonymous = true;
|
|
6787
|
+
}
|
|
6788
|
+
return result;
|
|
6789
|
+
}
|
|
6775
6790
|
async login(loginName, password, remember) {
|
|
6776
6791
|
try {
|
|
6777
6792
|
const res = await ibiz.net.post("/v7/login", {
|
|
@@ -6958,7 +6973,7 @@ var MethodDto = class _MethodDto {
|
|
|
6958
6973
|
* @param {IData} data
|
|
6959
6974
|
* @return {*} {Promise<IData>}
|
|
6960
6975
|
*/
|
|
6961
|
-
async get(context, data) {
|
|
6976
|
+
async get(context, data, ignore = false) {
|
|
6962
6977
|
const params = {};
|
|
6963
6978
|
const uiDomain = ibiz.uiDomainManager.get(context.srfsessionid);
|
|
6964
6979
|
for (let i = 0; i < this.fields.length; i++) {
|
|
@@ -6976,7 +6991,7 @@ var MethodDto = class _MethodDto {
|
|
|
6976
6991
|
params[key] = data[key].length === 0 ? null : this.convertArrayToListMap(data[key]);
|
|
6977
6992
|
}
|
|
6978
6993
|
} else {
|
|
6979
|
-
if (data[key] !== void 0) {
|
|
6994
|
+
if (data[key] !== void 0 && ignore === false) {
|
|
6980
6995
|
break;
|
|
6981
6996
|
}
|
|
6982
6997
|
if (!field.refAppDataEntityId) {
|
|
@@ -6999,7 +7014,7 @@ var MethodDto = class _MethodDto {
|
|
|
6999
7014
|
if (items) {
|
|
7000
7015
|
const arr = [];
|
|
7001
7016
|
for (let j = 0; j < items.length; j++) {
|
|
7002
|
-
arr.push(await dto.get(context, items[j]));
|
|
7017
|
+
arr.push(await dto.get(context, items[j], true));
|
|
7003
7018
|
}
|
|
7004
7019
|
params[key] = arr;
|
|
7005
7020
|
}
|
|
@@ -7047,6 +7062,7 @@ var MethodDto = class _MethodDto {
|
|
|
7047
7062
|
item[field.refPickupAppDEFieldId] = pKey;
|
|
7048
7063
|
});
|
|
7049
7064
|
await dto.sets(context, items);
|
|
7065
|
+
delete datum[key];
|
|
7050
7066
|
} else {
|
|
7051
7067
|
await dto.sets(context, []);
|
|
7052
7068
|
}
|
|
@@ -21647,7 +21663,8 @@ var EditFormController = class extends FormController {
|
|
|
21647
21663
|
* @param {IData} data
|
|
21648
21664
|
*/
|
|
21649
21665
|
setSimpleData(data) {
|
|
21650
|
-
const
|
|
21666
|
+
const UIData = this.service.toUIData(data);
|
|
21667
|
+
const cloneData = UIData.clone();
|
|
21651
21668
|
this.formItems.forEach((item) => {
|
|
21652
21669
|
if (!Object.prototype.hasOwnProperty.call(cloneData, item.name)) {
|
|
21653
21670
|
cloneData[item.name] = null;
|