@nokecy/qc-ui 1.1.53 → 1.1.54

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.
@@ -128,15 +128,26 @@ ArrayBase.Remove = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
128
128
  ,
129
129
  ref: ref,
130
130
  onClick: function onClick(e) {
131
- var _array$field5, _array$field5$remove, _array$props3, _array$props3$onRemov;
132
131
  if (self !== null && self !== void 0 && self.disabled) return;
133
132
  e.stopPropagation();
134
- (_array$field5 = array.field) === null || _array$field5 === void 0 || (_array$field5$remove = _array$field5.remove) === null || _array$field5$remove === void 0 || _array$field5$remove.call(_array$field5, index);
135
- (_array$props3 = array.props) === null || _array$props3 === void 0 || (_array$props3$onRemov = _array$props3.onRemove) === null || _array$props3$onRemov === void 0 || _array$props3$onRemov.call(_array$props3, index);
136
- if (props.onClick) {
137
- //@ts-ignore
138
- props.onClick(e);
139
- }
133
+ // 明细删除会直接改变表单值,必须在共享组件源头统一确认,避免业务页面漏包确认。@author nokecy
134
+ _antd.Modal.confirm({
135
+ title: '确认删除明细',
136
+ content: '删除当前明细行后将从当前表单中移除,保存后不可恢复。',
137
+ okText: '删除',
138
+ okButtonProps: {
139
+ danger: true
140
+ },
141
+ onOk: function onOk() {
142
+ var _array$field5, _array$field5$remove, _array$props3, _array$props3$onRemov;
143
+ (_array$field5 = array.field) === null || _array$field5 === void 0 || (_array$field5$remove = _array$field5.remove) === null || _array$field5$remove === void 0 || _array$field5$remove.call(_array$field5, index);
144
+ (_array$props3 = array.props) === null || _array$props3 === void 0 || (_array$props3$onRemov = _array$props3.onRemove) === null || _array$props3$onRemov === void 0 || _array$props3$onRemov.call(_array$props3, index);
145
+ if (props.onClick) {
146
+ //@ts-ignore
147
+ props.onClick(e);
148
+ }
149
+ }
150
+ });
140
151
  },
141
152
  icon: (0, _shared.isUndef)(props.icon) ? /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null) : props.icon
142
153
  }), props.title || self.title);
@@ -9,7 +9,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
9
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
11
  import React, { createContext, useContext } from 'react';
12
- import { Button } from 'antd';
12
+ import { Button, Modal } from 'antd';
13
13
  import { DeleteOutlined, DownOutlined, UpOutlined, CopyOutlined } from '@ant-design/icons';
14
14
  import { useField, useFieldSchema } from '@formily/react';
15
15
  import { clone, isUndef } from '@formily/shared';
@@ -119,15 +119,26 @@ ArrayBase.Remove = /*#__PURE__*/React.forwardRef(function (props, ref) {
119
119
  ,
120
120
  ref: ref,
121
121
  onClick: function onClick(e) {
122
- var _array$field5, _array$field5$remove, _array$props3, _array$props3$onRemov;
123
122
  if (self !== null && self !== void 0 && self.disabled) return;
124
123
  e.stopPropagation();
125
- (_array$field5 = array.field) === null || _array$field5 === void 0 || (_array$field5$remove = _array$field5.remove) === null || _array$field5$remove === void 0 || _array$field5$remove.call(_array$field5, index);
126
- (_array$props3 = array.props) === null || _array$props3 === void 0 || (_array$props3$onRemov = _array$props3.onRemove) === null || _array$props3$onRemov === void 0 || _array$props3$onRemov.call(_array$props3, index);
127
- if (props.onClick) {
128
- //@ts-ignore
129
- props.onClick(e);
130
- }
124
+ // 明细删除会直接改变表单值,必须在共享组件源头统一确认,避免业务页面漏包确认。@author nokecy
125
+ Modal.confirm({
126
+ title: '确认删除明细',
127
+ content: '删除当前明细行后将从当前表单中移除,保存后不可恢复。',
128
+ okText: '删除',
129
+ okButtonProps: {
130
+ danger: true
131
+ },
132
+ onOk: function onOk() {
133
+ var _array$field5, _array$field5$remove, _array$props3, _array$props3$onRemov;
134
+ (_array$field5 = array.field) === null || _array$field5 === void 0 || (_array$field5$remove = _array$field5.remove) === null || _array$field5$remove === void 0 || _array$field5$remove.call(_array$field5, index);
135
+ (_array$props3 = array.props) === null || _array$props3 === void 0 || (_array$props3$onRemov = _array$props3.onRemove) === null || _array$props3$onRemov === void 0 || _array$props3$onRemov.call(_array$props3, index);
136
+ if (props.onClick) {
137
+ //@ts-ignore
138
+ props.onClick(e);
139
+ }
140
+ }
141
+ });
131
142
  },
132
143
  icon: isUndef(props.icon) ? /*#__PURE__*/React.createElement(DeleteOutlined, null) : props.icon
133
144
  }), props.title || self.title);