coolcare-lite-scada-component 1.0.42 → 1.0.43

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.
@@ -22,6 +22,7 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
22
22
  value = _useState2[0],
23
23
  setValue = _useState2[1];
24
24
  var payload = node === null || node === void 0 ? void 0 : node.getData();
25
+ var premission = payload === null || payload === void 0 ? void 0 : payload.premission;
25
26
  var configPoint = payload === null || payload === void 0 ? void 0 : (_payload$pointList = payload.pointList) === null || _payload$pointList === void 0 ? void 0 : _payload$pointList[0];
26
27
  var pointData = usePointWatch(configPoint, payload === null || payload === void 0 ? void 0 : (_payload$mittMeta = payload.mittMeta) === null || _payload$mittMeta === void 0 ? void 0 : _payload$mittMeta.namespace);
27
28
  var tooltipTitle = null;
@@ -50,7 +51,7 @@ var EleSwitchComponent = function EleSwitchComponent(_ref) {
50
51
  pointId: 'pointId' in configPoint ? configPoint.pointId : undefined,
51
52
  deviceId: 'deviceId' in configPoint ? configPoint.deviceId : undefined,
52
53
  value: val ? checkedValue : unCheckedValue
53
- });
54
+ }, premission);
54
55
  setValue(val);
55
56
  }
56
57
  });
@@ -131,6 +131,7 @@ declare namespace Ele {
131
131
  /** 点击选择器-是否禁止选择不可写的点位 */
132
132
  pointSelect_disabledUnWriteable?: boolean;
133
133
  mittMeta?: MittMeta;
134
+ payload?: string[];
134
135
  };
135
136
 
136
137
  export type Size = {
@@ -99,12 +99,11 @@ function _getDevicePoint() {
99
99
  }));
100
100
  return _getDevicePoint.apply(this, arguments);
101
101
  }
102
- export function pointWrite(_x4) {
102
+ export function pointWrite(_x4, _x5) {
103
103
  return _pointWrite.apply(this, arguments);
104
104
  }
105
105
  function _pointWrite() {
106
- _pointWrite = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
107
- var _query$premission;
106
+ _pointWrite = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params, premission) {
108
107
  var query, deviceId, value, pointId, deviceInfo, pointInfo, writeFunction, res;
109
108
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
110
109
  while (1) switch (_context3.prev = _context3.next) {
@@ -116,8 +115,8 @@ function _pointWrite() {
116
115
  }
117
116
  return _context3.abrupt("return");
118
117
  case 3:
119
- console.log(query.premission);
120
- if (!((_query$premission = query.premission) === null || _query$premission === void 0 ? void 0 : _query$premission.split(',').includes('49'))) {
118
+ console.log(premission);
119
+ if (!(premission === null || premission === void 0 ? void 0 : premission.includes('49'))) {
121
120
  _context3.next = 7;
122
121
  break;
123
122
  }
@@ -555,7 +555,9 @@ var Player = function Player(_ref) {
555
555
  var _jsonConfig$cells2;
556
556
  jsonConfig === null || jsonConfig === void 0 ? void 0 : (_jsonConfig$cells2 = jsonConfig.cells) === null || _jsonConfig$cells2 === void 0 ? void 0 : _jsonConfig$cells2.forEach(function (v) {
557
557
  if (v.data) {
558
+ var _query$premission;
558
559
  v.data.mittMeta = mittMeta;
560
+ v.data.premission = ((_query$premission = query.premission) === null || _query$premission === void 0 ? void 0 : _query$premission.split(',')) || [];
559
561
  }
560
562
  });
561
563
  graph.fromJSON(jsonConfig);
package/es/typings.d.ts CHANGED
@@ -144,6 +144,10 @@ type PlayerQuery =
144
144
  token?: string;
145
145
  /** 刷新token */
146
146
  xToken?: string;
147
+ /** 项目 id */
148
+ projectId?: string;
149
+ /** 权限 */
150
+ premission: string
147
151
  };
148
152
 
149
153
  type WindowCommunicateMsg =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coolcare-lite-scada-component",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "scripts": {
5
5
  "start": " umi dev",
6
6
  "build:prod": "UMI_ENV=prod umi build",