tnx-shared 5.3.334 → 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) {