tnx-shared 5.3.333 → 5.3.335

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.
@@ -22127,6 +22127,14 @@
22127
22127
  case 0:
22128
22128
  if (callBackWhenNotHaveStatus == null) {
22129
22129
  callBackWhenNotHaveStatus = function (itemStatus, rowItem) {
22130
+ if (rowItem[fieldKey]
22131
+ && rowItem.workflowCode
22132
+ && rowItem.currentStateCode) {
22133
+ itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
22134
+ itemStatus.trangThai = rowItem.currentStateCode;
22135
+ itemStatus.workflowCode = rowItem.workflowCode;
22136
+ itemStatus.permission = exports.PermissionBase.READ;
22137
+ }
22130
22138
  };
22131
22139
  }
22132
22140
  itemId = data[fieldKey];
@@ -22141,7 +22149,7 @@
22141
22149
  else {
22142
22150
  sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }));
22143
22151
  }
22144
- return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', sorts)];
22152
+ return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', sorts, 'ForCrudList')];
22145
22153
  case 1:
22146
22154
  dataStatus = (_a.sent()).data;
22147
22155
  if (dataStatus == null) {
@@ -22160,10 +22168,11 @@
22160
22168
  textTrangThai: 'Chưa chạy quy trình'
22161
22169
  };
22162
22170
  if (itemId) {
22163
- var lstItemStatus = dataStatus.filter(function (q) { return q.itemId == itemId && q.userId == userIdCurrent; });
22164
- if (ignoreWorkflow === true && lstItemStatus.length === 0) {
22165
- lstItemStatus.push.apply(lstItemStatus, __spreadArray([], __read(dataStatus.filter(function (q) { return q.itemId === itemId; }))));
22166
- }
22171
+ // const lstItemStatus = dataStatus.filter(q => q.itemId == itemId && q.userId == userIdCurrent);
22172
+ // if (ignoreWorkflow === true && lstItemStatus.length === 0) {
22173
+ // lstItemStatus.push(...dataStatus.filter(q => q.itemId === itemId));
22174
+ // }
22175
+ var lstItemStatus = dataStatus.filter(function (q) { return q.itemId === itemId; });
22167
22176
  // let itemStatus = null;
22168
22177
  if (lstItemStatus.length) {
22169
22178
  itemStatus = lstItemStatus.find(function (q) { return (q.permission & exports.PermissionBase.EDIT) == exports.PermissionBase.EDIT; });
@@ -22216,6 +22225,14 @@
22216
22225
  case 0:
22217
22226
  if (callBackWhenNotHaveStatus == null) {
22218
22227
  callBackWhenNotHaveStatus = function (itemStatus, rowItem) {
22228
+ if (rowItem[fieldKey]
22229
+ && rowItem.workflowCode
22230
+ && rowItem.currentStateCode) {
22231
+ itemStatus.textTrangThai = 'Đã bắt đầu quy trình';
22232
+ itemStatus.trangThai = rowItem.currentStateCode;
22233
+ itemStatus.workflowCode = rowItem.workflowCode;
22234
+ itemStatus.permission = exports.PermissionBase.READ;
22235
+ }
22219
22236
  };
22220
22237
  }
22221
22238
  lstItemId = data.filter(function (q) { return q[fieldKey]; }).map(function (q) { return q[fieldKey]; });
@@ -22227,13 +22244,11 @@
22227
22244
  filters.push(this.newFilter('tableName', exports.Operator.equal, this.tableName));
22228
22245
  }
22229
22246
  sorts = [];
22230
- if (!ignoreWorkflow) {
22231
- filters.push(this.newFilter('userId', exports.Operator.equal, userIdCurrent));
22232
- }
22233
- else {
22234
- sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }));
22235
- }
22236
- return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', sorts)];
22247
+ // if (!ignoreWorkflow) {
22248
+ // filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
22249
+ // }
22250
+ sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }));
22251
+ return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', sorts, 'ForCrudList')];
22237
22252
  case 1:
22238
22253
  dataStatus = (_a.sent()).data;
22239
22254
  if (dataStatus == null) {
@@ -22966,7 +22981,7 @@
22966
22981
  }
22967
22982
  };
22968
22983
  ListComponentBase.prototype.initColumnSchema = function (cols) {
22969
- var _a, _b, _c, _d;
22984
+ var _a, _b, _c, _d, _e;
22970
22985
  if (!cols || !cols.length)
22971
22986
  return;
22972
22987
  var colFunction = null, colGroup = null, colHasToggleIcon = null;
@@ -22989,7 +23004,7 @@
22989
23004
  colHasToggleIcon = this.setting.cols[0];
22990
23005
  }
22991
23006
  colHasToggleIcon.colHasToggleIcon = true;
22992
- this.componentKey = location.pathname + "/" + (((_d = (_c = (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.closest('crud-list').parentNode) === null || _c === void 0 ? void 0 : _c.tagName) === null || _d === void 0 ? void 0 : _d.toLowerCase()) || '') + (this.setting.settingKey ? '/' + this.setting.settingKey : '');
23007
+ this.componentKey = location.pathname + "/" + (((_e = (_d = (_c = (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.closest('crud-list')) === null || _c === void 0 ? void 0 : _c.parentNode) === null || _d === void 0 ? void 0 : _d.tagName) === null || _e === void 0 ? void 0 : _e.toLowerCase()) || '') + (this.setting.settingKey ? '/' + this.setting.settingKey : '');
22993
23008
  this.getColorSetting();
22994
23009
  this.getColumnSetting(colGroup);
22995
23010
  this.getPageSetting();