coolcare-lite-scada-component 1.0.30 → 1.0.31

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.
@@ -12,9 +12,9 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
12
12
  import React from "react";
13
13
  import { useCallback, useEffect, useState } from 'react';
14
14
  import { Modal, Button, Form, Space, message, Select } from 'antd';
15
- import { GetDevicePage, GetDevicePoint } from "../../services/gateway/Device";
15
+ import { GetDevicePoint } from "../../services/gateway/Device";
16
16
  import { GetColdChainPermissionDevicePage } from "../../services/project/ProjectUserPermission";
17
- import { useModel } from 'umi';
17
+ import { useQuery } from "../../hooks";
18
18
  var Option = Select.Option;
19
19
  var tailLayout = {
20
20
  wrapperCol: {
@@ -42,15 +42,7 @@ var ModalChoosePoint = function ModalChoosePoint(_ref) {
42
42
  _useState4 = _slicedToArray(_useState3, 2),
43
43
  pointList = _useState4[0],
44
44
  setPointList = _useState4[1];
45
- var _useModel = useModel('@@initialState', function (model) {
46
- var _model$initialState, _model$initialState2;
47
- return {
48
- platform: (_model$initialState = model.initialState) === null || _model$initialState === void 0 ? void 0 : _model$initialState.platform,
49
- currentProject: (_model$initialState2 = model.initialState) === null || _model$initialState2 === void 0 ? void 0 : _model$initialState2.currentProject
50
- };
51
- }),
52
- platform = _useModel.platform,
53
- currentProject = _useModel.currentProject;
45
+ var query = useQuery();
54
46
  var closeModal = function closeModal() {
55
47
  onCancel === null || onCancel === void 0 ? void 0 : onCancel();
56
48
  };
@@ -99,46 +91,31 @@ var ModalChoosePoint = function ModalChoosePoint(_ref) {
99
91
  while (1) switch (_context2.prev = _context2.next) {
100
92
  case 0:
101
93
  _context2.prev = 0;
102
- if (!(platform === 'project')) {
103
- _context2.next = 7;
104
- break;
105
- }
106
- _context2.next = 4;
94
+ _context2.next = 3;
107
95
  return GetColdChainPermissionDevicePage({
108
96
  companyId: companyId,
109
- projectId: currentProject === null || currentProject === void 0 ? void 0 : currentProject.projectId,
97
+ projectId: projectId,
110
98
  isPermission: true
111
99
  });
112
- case 4:
113
- res = _context2.sent;
114
- _context2.next = 10;
115
- break;
116
- case 7:
117
- _context2.next = 9;
118
- return GetDevicePage({
119
- companyId: companyId
120
- });
121
- case 9:
100
+ case 3:
122
101
  res = _context2.sent;
123
- case 10:
124
102
  if (res.success) {
125
103
  setDeviceList(((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || []);
126
104
  } else {
127
105
  message.error(res.message);
128
106
  }
129
- _context2.next = 16;
107
+ _context2.next = 10;
130
108
  break;
131
- case 13:
132
- _context2.prev = 13;
109
+ case 7:
110
+ _context2.prev = 7;
133
111
  _context2.t0 = _context2["catch"](0);
134
112
  message.error('获取设备列表失败');
135
- case 16:
113
+ case 10:
136
114
  case "end":
137
115
  return _context2.stop();
138
116
  }
139
- }, _callee2, null, [[0, 13]]);
140
- })), [companyId, platform, currentProject]);
141
-
117
+ }, _callee2, null, [[0, 7]]);
118
+ })), [companyId, projectId]);
142
119
  /** 提交表单且数据验证成功后回调事件 */
143
120
  var onFinish = /*#__PURE__*/function () {
144
121
  var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(val) {
@@ -181,8 +158,8 @@ var ModalChoosePoint = function ModalChoosePoint(_ref) {
181
158
  maskClosable: true,
182
159
  footer: null,
183
160
  onCancel: closeModal,
184
- visible: visible,
185
- wrapClassName: 'form-modal'
161
+ open: visible,
162
+ getContainer: false
186
163
  }, /*#__PURE__*/React.createElement(Form, {
187
164
  layout: "vertical",
188
165
  form: form,
@@ -194,6 +171,7 @@ var ModalChoosePoint = function ModalChoosePoint(_ref) {
194
171
  }, /*#__PURE__*/React.createElement(Form.Item, {
195
172
  name: "deviceId",
196
173
  label: "\u8BBE\u5907",
174
+ className: "temperatureSelect",
197
175
  rules: [{
198
176
  required: true,
199
177
  message: '请选择'
@@ -206,6 +184,9 @@ var ModalChoosePoint = function ModalChoosePoint(_ref) {
206
184
  form.setFieldsValue({
207
185
  pointIdList: []
208
186
  });
187
+ },
188
+ getPopupContainer: function getPopupContainer() {
189
+ return document.querySelector(".temperatureSelect") || document.body;
209
190
  }
210
191
  }, deviceList.map(function (item) {
211
192
  return /*#__PURE__*/React.createElement(Option, {
@@ -231,7 +212,10 @@ var ModalChoosePoint = function ModalChoosePoint(_ref) {
231
212
  showSearch: true,
232
213
  optionFilterProp: "label",
233
214
  placeholder: "\u8BF7\u9009\u62E9",
234
- disabled: !getFieldValue('deviceId')
215
+ disabled: !getFieldValue('deviceId'),
216
+ getPopupContainer: function getPopupContainer() {
217
+ return document.querySelector(".temperature2Select") || document.body;
218
+ }
235
219
  }, pointList.map(function (item) {
236
220
  return /*#__PURE__*/React.createElement(Option, {
237
221
  value: item.pointId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coolcare-lite-scada-component",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "scripts": {
5
5
  "start": "umi dev",
6
6
  "build:prod": "UMI_ENV=prod umi build",