ns-base-module 2.0.1 → 2.0.3

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