kmkf-work-order-service-component 0.4.0-alpha.29 → 0.4.0-alpha.30

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.
@@ -42,10 +42,11 @@ function CustomizeWorkOrderCard(props) {
42
42
  var _item$handlerList, _item$handlerList$map;
43
43
 
44
44
  var item = props.item,
45
- enabledTemplateList = props.enabledTemplateList;
45
+ enabledTemplateList = props.enabledTemplateList,
46
+ singleTemplateDetails = props.singleTemplateDetails;
46
47
  var dispatch = useAppDispatch();
47
48
  var componentDtoList = useAppSelector(selectorAllTemplateList);
48
- var filterComponentDtoList = componentDtoList.filter(function (i) {
49
+ var filterComponentDtoList = singleTemplateDetails || componentDtoList.filter(function (i) {
49
50
  return !['WORK_ORDER_ID_INPUT', // 工单ID
50
51
  'TEMPLATE_ID_INPUT', // 模板Id
51
52
  'FLOW_STATUS_SELECT', // 工单状态
@@ -33,7 +33,7 @@ import StatusSelectModal from "./components/StatusSelectModal";
33
33
  import RecordLog from "./components/RecordLog";
34
34
  import emptyImg from "../../../common/imgs/empty.png";
35
35
  import { PlatForm } from "../../types";
36
- import { queryAllWorkOrderList } from "../../../model/servers/api";
36
+ import { queryAllWorkOrderList, queryTemplateDetail } from "../../../model/servers/api";
37
37
  import FormRender from "../../../FormRender";
38
38
  import "./index.less";
39
39
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -146,6 +146,11 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
146
146
  title = _useState6[0],
147
147
  setTitle = _useState6[1];
148
148
 
149
+ var _useState7 = useState(null),
150
+ _useState8 = _slicedToArray(_useState7, 2),
151
+ searchTemplateDetails = _useState8[0],
152
+ setSearchTemplateDetails = _useState8[1];
153
+
149
154
  var groupAllList = useAppSelector(function (state) {
150
155
  return state.workOrder.groupAllList;
151
156
  });
@@ -205,6 +210,26 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
205
210
  dispatch(fetchAllComponentList);
206
211
  }, []);
207
212
 
213
+ var searchHandle = function searchHandle() {
214
+ var templateList = form.getFieldValue('templateIdList');
215
+
216
+ if (templateList && templateList.length) {
217
+ var tempId = templateList[templateList.length - 1];
218
+
219
+ if ((searchTemplateDetails === null || searchTemplateDetails === void 0 ? void 0 : searchTemplateDetails.uniqueKey) !== tempId) {
220
+ queryTemplateDetail({
221
+ uniqueKey: tempId
222
+ }).then(function (res) {
223
+ setSearchTemplateDetails(res === null || res === void 0 ? void 0 : res.data);
224
+ submit();
225
+ });
226
+ }
227
+ } else {
228
+ setSearchTemplateDetails(null);
229
+ submit();
230
+ }
231
+ };
232
+
208
233
  var searchForm = /*#__PURE__*/_jsxs("div", {
209
234
  children: [/*#__PURE__*/_jsx(Form, {
210
235
  form: form,
@@ -261,7 +286,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
261
286
  options: groupAllList,
262
287
  placeholder: "\u8BF7\u9009\u62E9\u6A21\u7248",
263
288
  showSearch: true,
264
- allowClear: false
289
+ allowClear: true
265
290
  })
266
291
  })
267
292
  }), /*#__PURE__*/_jsx(Col, {
@@ -279,7 +304,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
279
304
  children: [/*#__PURE__*/_jsxs("span", {
280
305
  children: [/*#__PURE__*/_jsx(Button, {
281
306
  type: "primary",
282
- onClick: submit,
307
+ onClick: searchHandle,
283
308
  children: "\u67E5\u8BE2"
284
309
  }), /*#__PURE__*/_jsx(Button, {
285
310
  onClick: reset,
@@ -347,7 +372,8 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
347
372
  children: dataSource.length > 0 ? dataSource.map(function (item) {
348
373
  return /*#__PURE__*/_jsx(CustomizeWorkOrderCard, {
349
374
  item: item,
350
- enabledTemplateList: enabledTemplateList
375
+ enabledTemplateList: enabledTemplateList,
376
+ singleTemplateDetails: searchTemplateDetails === null || searchTemplateDetails === void 0 ? void 0 : searchTemplateDetails.componentDtoList
351
377
  }, item.id);
352
378
  }) : /*#__PURE__*/_jsx("div", {
353
379
  className: "custom_box_main_empty",
@@ -42,7 +42,6 @@ import BasicComponent from "../../BasicComponent";
42
42
  import { ApaasCheckbox } from '@raycloud-apaas-fe-setup/apaas-react-basics-widgets';
43
43
  import { getFormItem } from "../../common/formItemWrap";
44
44
  import { jsx as _jsx } from "react/jsx-runtime";
45
- import { jsxs as _jsxs } from "react/jsx-runtime";
46
45
 
47
46
  var BasicCheckBox = /*#__PURE__*/function (_BasicComponent) {
48
47
  _inherits(BasicCheckBox, _BasicComponent);
@@ -57,19 +56,27 @@ var BasicCheckBox = /*#__PURE__*/function (_BasicComponent) {
57
56
  _this = _super.call(this, options);
58
57
 
59
58
  _defineProperty(_assertThisInitialized(_this), "render", function (value) {
60
- var _value$value;
59
+ var _value$value, _value$value2;
61
60
 
62
- return /*#__PURE__*/_jsxs("span", {
63
- children: [value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.join('/'), /*#__PURE__*/_jsx("br", {}), value === null || value === void 0 ? void 0 : value.other]
61
+ var findIndex = value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.findIndex(function (item) {
62
+ return item === '其他';
63
+ });
64
+
65
+ if (findIndex > -1 && value !== null && value !== void 0 && value.other) {
66
+ value.value[findIndex] = "\u5176\u4ED6(".concat(value === null || value === void 0 ? void 0 : value.other, ")");
67
+ }
68
+
69
+ return /*#__PURE__*/_jsx("span", {
70
+ children: value === null || value === void 0 ? void 0 : (_value$value2 = value.value) === null || _value$value2 === void 0 ? void 0 : _value$value2.join('/')
64
71
  });
65
72
  });
66
73
 
67
74
  _defineProperty(_assertThisInitialized(_this), "customRules", function () {
68
75
  return [{
69
76
  validator: function validator(_, value) {
70
- var _value$value2;
77
+ var _value$value3;
71
78
 
72
- if (!(value !== null && value !== void 0 && (_value$value2 = value.value) !== null && _value$value2 !== void 0 && _value$value2.length)) {
79
+ if (!(value !== null && value !== void 0 && (_value$value3 = value.value) !== null && _value$value3 !== void 0 && _value$value3.length)) {
73
80
  return Promise.reject(new Error('请选择'));
74
81
  }
75
82
 
@@ -92,9 +99,9 @@ var BasicCheckBox = /*#__PURE__*/function (_BasicComponent) {
92
99
  });
93
100
 
94
101
  _defineProperty(_assertThisInitialized(_this), "renderExport", function (value, record) {
95
- var _value$value3;
102
+ var _value$value4;
96
103
 
97
- return "".concat(value === null || value === void 0 ? void 0 : (_value$value3 = value.value) === null || _value$value3 === void 0 ? void 0 : _value$value3.join('/'), " ").concat((value === null || value === void 0 ? void 0 : value.other) || '');
104
+ return "".concat(value === null || value === void 0 ? void 0 : (_value$value4 = value.value) === null || _value$value4 === void 0 ? void 0 : _value$value4.join('/'), " ").concat((value === null || value === void 0 ? void 0 : value.other) || '');
98
105
  });
99
106
 
100
107
  _defineProperty(_assertThisInitialized(_this), "getColumns", function () {
@@ -69,7 +69,7 @@ var BasicRadio = /*#__PURE__*/function (_BasicComponent) {
69
69
  var _value$value;
70
70
 
71
71
  return /*#__PURE__*/_jsxs("span", {
72
- children: [value === null || value === void 0 ? void 0 : value.value, (value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.indexOf('其他')) > -1 && (value === null || value === void 0 ? void 0 : value.other)]
72
+ children: [value === null || value === void 0 ? void 0 : value.value, (value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.indexOf('其他')) > -1 && (value === null || value === void 0 ? void 0 : value.other) && "(".concat(value === null || value === void 0 ? void 0 : value.other, ")")]
73
73
  });
74
74
  });
75
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.4.0-alpha.29",
3
+ "version": "0.4.0-alpha.30",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",