feat: config-driven реестр на реальных данных SP
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
self["webpackHotUpdate_459579c7_954c_469e_b707_ca75d808603f_0_0_1"]("ct-forms-portal-web-part",{
|
||||
|
||||
/***/ 633:
|
||||
/*!***************************************************************************!*\
|
||||
!*** ./lib/webparts/ctFormsPortal/components/config/oidDocumentConfig.js ***!
|
||||
\***************************************************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ createOidDocumentConfig: () => (/* binding */ createOidDocumentConfig)
|
||||
/* harmony export */ });
|
||||
var STATUS_LABEL = {
|
||||
'Черновик': 'Сформирована',
|
||||
'formed': 'Сформирована',
|
||||
'На согласовании': 'На согласовании',
|
||||
'on_approval': 'На согласовании',
|
||||
'Согласовано': 'Согласована',
|
||||
'approved': 'Согласована',
|
||||
'Отклонено': 'Отклонена'
|
||||
};
|
||||
var STATUS_VARIANT = {
|
||||
'Черновик': 'neutral',
|
||||
'formed': 'neutral',
|
||||
'На согласовании': 'info',
|
||||
'on_approval': 'info',
|
||||
'Согласовано': 'success',
|
||||
'approved': 'success',
|
||||
'Отклонено': 'error'
|
||||
};
|
||||
function createOidDocumentConfig() {
|
||||
return {
|
||||
typeKey: 'oid',
|
||||
typeLabel: 'СТ ОИД',
|
||||
icon: 'CRMServices',
|
||||
// Списки СТ ОИД — на сайте СЭД. Явно, чтобы портал не зависел от места размещения.
|
||||
siteUrl: 'https://tnsukz.sharepoint.com/sites/sed',
|
||||
myDocsListName: 'Сравнительная таблица ОИД',
|
||||
buildMyDocsFilter: function (userId) { return "AuthorId eq ".concat(userId); },
|
||||
myDocsSelect: 'Id,Title,number,project,status,Created',
|
||||
pendingApproval: {
|
||||
approvalListName: 'Согласование СТ ОИД',
|
||||
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u041D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0438'"); },
|
||||
approvalSelect: 'Id,CTId,status,aproover/Id',
|
||||
approvalExpand: 'aproover',
|
||||
parentIdField: 'CTId',
|
||||
buildParentQuery: function (parentIds) { return ({
|
||||
listName: 'Сравнительная таблица ОИД',
|
||||
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
|
||||
select: 'Id,Title,number,project,status,Created'
|
||||
}); }
|
||||
},
|
||||
approvedByMe: {
|
||||
approvalListName: 'Согласование СТ ОИД',
|
||||
buildPendingFilter: function (userId) { return "aproover/Id eq ".concat(userId, " and status eq '\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u043E'"); },
|
||||
approvalSelect: 'Id,CTId,status,aproover/Id',
|
||||
approvalExpand: 'aproover',
|
||||
parentIdField: 'CTId',
|
||||
buildParentQuery: function (parentIds) { return ({
|
||||
listName: 'Сравнительная таблица ОИД',
|
||||
filter: parentIds.map(function (id) { return "Id eq ".concat(id); }).join(' or '),
|
||||
select: 'Id,Title,number,project,status,Created'
|
||||
}); }
|
||||
},
|
||||
buildLinkUrl: function (row) {
|
||||
var base = 'https://tnsukz.sharepoint.com/sites/sed/SitePages/Сравнительная-таблица-ОИД.aspx';
|
||||
var param = row.status === 'Черновик' || row.status === 'formed' ? 'oidId' : 'oidid';
|
||||
return "".concat(base, "?").concat(param, "=").concat(row.id);
|
||||
},
|
||||
createNewUrl: 'https://tnsukz.sharepoint.com/sites/sed/SitePages/Сравнительная-таблица-ОИД.aspx',
|
||||
createNewLabel: 'Создать новую форму ОИД',
|
||||
mapItem: function (raw) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
var spStatus = String((_a = raw['status']) !== null && _a !== void 0 ? _a : '');
|
||||
return {
|
||||
typeKey: 'oid',
|
||||
id: String(raw['Id']),
|
||||
title: "\u0421\u0422 \u2116".concat((_b = raw['number']) !== null && _b !== void 0 ? _b : raw['Title']),
|
||||
subtitle: String((_c = raw['project']) !== null && _c !== void 0 ? _c : ''),
|
||||
status: spStatus,
|
||||
statusLabel: (_d = STATUS_LABEL[spStatus]) !== null && _d !== void 0 ? _d : spStatus,
|
||||
statusVariant: (_e = STATUS_VARIANT[spStatus]) !== null && _e !== void 0 ? _e : 'neutral',
|
||||
createdDate: raw['Created'] ? String(raw['Created']) : undefined
|
||||
};
|
||||
},
|
||||
columns: [
|
||||
{ key: 'title', label: 'Номер СТ', minWidth: 120 },
|
||||
{ key: 'subtitle', label: 'Проект', minWidth: 180 },
|
||||
{ key: 'status', label: 'Статус', minWidth: 130 },
|
||||
{ key: 'created', label: 'Создана', minWidth: 110 }
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
},
|
||||
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
||||
/******/ /* webpack/runtime/getFullHash */
|
||||
/******/ (() => {
|
||||
/******/ __webpack_require__.h = () => ("28bba40dc5ac93a046a4")
|
||||
/******/ })();
|
||||
/******/
|
||||
/******/ }
|
||||
);
|
||||
//# sourceMappingURL=ct-forms-portal-web-part.c0c82c263a05c3417a10.hot-update.js.map
|
||||
Reference in New Issue
Block a user