ns-base-module 1.1.58 → 1.1.59
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.
|
@@ -52,6 +52,20 @@ var Index = function Index(props) {
|
|
|
52
52
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
53
53
|
curItem = _useState10[0],
|
|
54
54
|
setCurItem = _useState10[1];
|
|
55
|
+
var _useState11 = useState(function () {
|
|
56
|
+
var _user = localStorage.getItem("userInfo");
|
|
57
|
+
if (_user) {
|
|
58
|
+
try {
|
|
59
|
+
var _JSON$parse;
|
|
60
|
+
return ((_JSON$parse = JSON.parse(_user)) === null || _JSON$parse === void 0 || (_JSON$parse = _JSON$parse.userPreferenceConfig) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.mode) === "DEV";
|
|
61
|
+
} catch (error) {
|
|
62
|
+
return "";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return "";
|
|
66
|
+
}),
|
|
67
|
+
_useState12 = _slicedToArray(_useState11, 1),
|
|
68
|
+
userMode = _useState12[0];
|
|
55
69
|
|
|
56
70
|
// console.log("commonRequest", commonRequest);
|
|
57
71
|
|
|
@@ -264,23 +278,7 @@ var Index = function Index(props) {
|
|
|
264
278
|
}();
|
|
265
279
|
var renderTemplate = function renderTemplate(_template, _code) {
|
|
266
280
|
return _template.map(function (item) {
|
|
267
|
-
|
|
268
|
-
className: "list-radio",
|
|
269
|
-
key: item.value
|
|
270
|
-
}, /*#__PURE__*/React.createElement(Radio, {
|
|
271
|
-
value: item.value,
|
|
272
|
-
className: "list-radio-label"
|
|
273
|
-
}, item.label), item.owner === "N" && _code !== "trans" && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
274
|
-
placement: "top",
|
|
275
|
-
title: initLang({
|
|
276
|
-
id: "prompt.copyTemplate"
|
|
277
|
-
})
|
|
278
|
-
}, /*#__PURE__*/React.createElement(CopyOutlined, {
|
|
279
|
-
className: "set-icon",
|
|
280
|
-
onClick: function onClick() {
|
|
281
|
-
return handleCopy(item);
|
|
282
|
-
}
|
|
283
|
-
}))), item.owner === "Y" && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Popconfirm, {
|
|
281
|
+
var deleteDom = /*#__PURE__*/React.createElement(Popconfirm, {
|
|
284
282
|
title: initLang({
|
|
285
283
|
id: "message.confirm.delete"
|
|
286
284
|
}),
|
|
@@ -302,7 +300,19 @@ var Index = function Index(props) {
|
|
|
302
300
|
onClick: function onClick() {
|
|
303
301
|
return handleDel(item);
|
|
304
302
|
}
|
|
305
|
-
})))
|
|
303
|
+
})));
|
|
304
|
+
var copyDom = /*#__PURE__*/React.createElement(Tooltip, {
|
|
305
|
+
placement: "top",
|
|
306
|
+
title: initLang({
|
|
307
|
+
id: "prompt.copyTemplate"
|
|
308
|
+
})
|
|
309
|
+
}, /*#__PURE__*/React.createElement(CopyOutlined, {
|
|
310
|
+
className: "set-icon",
|
|
311
|
+
onClick: function onClick() {
|
|
312
|
+
return handleCopy(item);
|
|
313
|
+
}
|
|
314
|
+
}));
|
|
315
|
+
var setDom = /*#__PURE__*/React.createElement(Tooltip, {
|
|
306
316
|
placement: "top",
|
|
307
317
|
title: initLang({
|
|
308
318
|
id: "prompt.setTemplate"
|
|
@@ -312,7 +322,24 @@ var Index = function Index(props) {
|
|
|
312
322
|
onClick: function onClick() {
|
|
313
323
|
return handleSet(item);
|
|
314
324
|
}
|
|
315
|
-
}))
|
|
325
|
+
}));
|
|
326
|
+
var doms = [];
|
|
327
|
+
if (item.perms_type === "private" || _code === "trans") {
|
|
328
|
+
doms = [deleteDom, setDom];
|
|
329
|
+
} else if (item.perms_type === "public") {
|
|
330
|
+
if (item.owner == "Y" || userMode === "DEV") {
|
|
331
|
+
doms = [deleteDom, copyDom, setDom];
|
|
332
|
+
} else {
|
|
333
|
+
doms.push(copyDom);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
337
|
+
className: "list-radio",
|
|
338
|
+
key: item.value
|
|
339
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
340
|
+
value: item.value,
|
|
341
|
+
className: "list-radio-label"
|
|
342
|
+
}, item.label), (item.owner === "Y" || userMode === "DEV") && /*#__PURE__*/React.createElement("span", null, doms));
|
|
316
343
|
});
|
|
317
344
|
};
|
|
318
345
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Radio.Group, {
|