@hzab/list-render 1.10.0-beta6 → 1.10.0-beta7
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.
- package/CHANGELOG.md +1 -2
- package/README.md +53 -54
- package/package.json +1 -1
- package/src/components/Formily/FormilyEditTable.tsx +57 -34
- package/src/list-render.jsx +5 -2
- package/src/table-render/index.jsx +7 -3
- package/src/table-render/index.less +30 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -49,60 +49,59 @@ const listDM = useMemo(
|
|
|
49
49
|
|
|
50
50
|
### InfoPanel Attributes
|
|
51
51
|
|
|
52
|
-
| 属性名称 | 属性类型
|
|
53
|
-
| --------------------------- |
|
|
54
|
-
| layout | string
|
|
55
|
-
| className | string
|
|
56
|
-
| idKey | string
|
|
57
|
-
| schema | Object
|
|
58
|
-
| model | Object
|
|
59
|
-
| isPatchUpdate | boolean
|
|
60
|
-
| list | Array
|
|
61
|
-
| closeAutoRequest | Boolean
|
|
62
|
-
| hasQuery | Boolean
|
|
63
|
-
| verticalHeader | Boolean
|
|
64
|
-
| search | String
|
|
65
|
-
| filters | Array
|
|
66
|
-
| queryConf | Object
|
|
67
|
-
| createText | String/ReactNote
|
|
68
|
-
| hasCreate | Boolean
|
|
69
|
-
| hasAction | Boolean
|
|
70
|
-
| hasEdit | Boolean/Function
|
|
71
|
-
| hasDel | Boolean/Function
|
|
72
|
-
| hasDetail | Boolean/Function
|
|
73
|
-
| hasDelTips | String/Function
|
|
74
|
-
| tableConf | Object
|
|
75
|
-
| tableProps | Object
|
|
76
|
-
| cardConf | Object
|
|
77
|
-
| cardProps | Object
|
|
78
|
-
| fetchOnEdit | Boolean
|
|
79
|
-
| fetchById | Boolean
|
|
80
|
-
| modalMode | string
|
|
81
|
-
| modalConf | Object
|
|
82
|
-
| modalDetailProps | Object
|
|
83
|
-
| modalFormProps | Object
|
|
84
|
-
| modalProps | Object
|
|
85
|
-
| schemaScope | Object
|
|
86
|
-
| components | Object
|
|
87
|
-
| detailComponents | Object
|
|
88
|
-
| hasPagination | Boolean
|
|
89
|
-
| paginationConf | Object
|
|
90
|
-
| formInitialValues | Object
|
|
91
|
-
| Slots | Object
|
|
92
|
-
| getFieldListOpt | Object
|
|
93
|
-
| onGetListEnd | Function
|
|
94
|
-
| onCreateSuc | Function
|
|
95
|
-
| onEditSuc | Function
|
|
96
|
-
| onDelSuc | Function
|
|
97
|
-
| onFormModalClose | Function
|
|
98
|
-
| modalFormMount | Function
|
|
99
|
-
| msgConf | Object
|
|
100
|
-
| i18n | Object
|
|
101
|
-
| queryFormInitialValues | Object
|
|
102
|
-
| queryFormIsExtendModelQuery | Boolean
|
|
103
|
-
| useFormData | boolean
|
|
104
|
-
|
|
|
105
|
-
| editBtnType | cell/action | 否 | action | 编辑按钮位置 cell 各单元格内 action 操作列中 |
|
|
52
|
+
| 属性名称 | 属性类型 | 必须 | 默认值 | 描述 |
|
|
53
|
+
| --------------------------- | ------------------------- | ---- | --------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| layout | string | 否 | default | 列表渲染类型格式 |
|
|
55
|
+
| className | string | 否 | - | 外层 div className |
|
|
56
|
+
| idKey | string | 否 | id | 唯一值字段的 key |
|
|
57
|
+
| schema | Object | 是 | - | 字段描述文件,包含各个字段的信息 |
|
|
58
|
+
| model | Object | 是 | - | 数据模型,包含 CURD 接口信息,传入 DataModel 的实例 |
|
|
59
|
+
| isPatchUpdate | boolean | 否 | false | 编辑提交接口是否使用 patch 发起请求 |
|
|
60
|
+
| list | Array | | - | 本地数据源 |
|
|
61
|
+
| closeAutoRequest | Boolean | | false | 是否关闭加载完毕后自动发起请求。true 时组件 didMount 不自动发起请求 |
|
|
62
|
+
| hasQuery | Boolean | | true | 是否包含搜索、筛选框、搜索按钮等 |
|
|
63
|
+
| verticalHeader | Boolean | | false | 搜索项和新增按钮是否处于不同的行等 |
|
|
64
|
+
| search | String | | - | 传入空字符串时,不包含搜索框;传入非空字符串时,显示搜索框,同时传入的字符串作为搜索框的占位符 |
|
|
65
|
+
| filters | Array | | [] | 字符串数组,可以包含要筛选的字段 key 值(schema 中的 name),或者字符串 '$timerange'(时间范围筛选专用) |
|
|
66
|
+
| queryConf | Object | | {} | 设置 query 参数的 key |
|
|
67
|
+
| createText | String/ReactNote | | 新增 | 新增按钮文案 |
|
|
68
|
+
| hasCreate | Boolean | | true | 是否显示新增按钮 |
|
|
69
|
+
| hasAction | Boolean | | true | 是否在表格的最右增加一个“操作”列;hasAction 为 true 时,下面的 hasEdit/hasDel 才会生效 |
|
|
70
|
+
| hasEdit | Boolean/Function | | true | 是否显示编辑按钮,可传入回调控制当前行是否显示 |
|
|
71
|
+
| hasDel | Boolean/Function | | true | 是否显示删除按钮,可传入回调控制当前行是否显示 |
|
|
72
|
+
| hasDetail | Boolean/Function | | true | 是否显示详情按钮,可传入回调控制当前行是否显示 |
|
|
73
|
+
| hasDelTips | String/Function | | "确认删除该项?" | 删除按钮自定义提示,可传入回调根据当前行数据显示对应提示 |
|
|
74
|
+
| tableConf | Object | | {} | Table 相关配置 |
|
|
75
|
+
| tableProps | Object | | {} | 直接传给 Table 的 props,相关 API 可直接参考 antd table 组件 |
|
|
76
|
+
| cardConf | Object | | {} | Card 相关配置 |
|
|
77
|
+
| cardProps | Object | | {} | 直接传给 cardRender 的 props,因内部渲染使用的的是详情组件,相关 API 可直接参考 @hzab/schema-descriptions 组件 |
|
|
78
|
+
| fetchOnEdit | Boolean | | true | 展示编辑弹框时,是否会调用一次详情接口进行回填;若为 false,则会使用表格列表接口返回的 row 数据进行回填 |
|
|
79
|
+
| fetchById | Boolean | | true | 编辑中的详情请求,是否使用 id 作为入参的 key |
|
|
80
|
+
| modalMode | string | | dialog | 新增/编辑表单、详情 展示模式: dialog drawer |
|
|
81
|
+
| modalConf | Object | | {} | modal/Drawer 配置对象 |
|
|
82
|
+
| modalDetailProps | Object | | {} | modal descriptions 配置对象 |
|
|
83
|
+
| modalFormProps | Object | | {} | modal/drawer fromRender 配置对象 |
|
|
84
|
+
| modalProps | Object | | {} | modal/drawer 配置对象 |
|
|
85
|
+
| schemaScope | Object | | {} | formRender schemaScope props |
|
|
86
|
+
| components | Object | | {} | formRender components props 自定义组件 |
|
|
87
|
+
| detailComponents | Object | | {} | descriptions components props 自定义组件 |
|
|
88
|
+
| hasPagination | Boolean | | true | 是否显示分页 |
|
|
89
|
+
| paginationConf | Object | | {} | 可自定义 Pagination props,进行 pagination 相关设置 |
|
|
90
|
+
| formInitialValues | Object | | {} | 给新增、编辑对话框中的表单增加默认值 |
|
|
91
|
+
| Slots | Object | | {} | 组件插槽 |
|
|
92
|
+
| getFieldListOpt | Object | | {} | getFieldList opt 参数 |
|
|
93
|
+
| onGetListEnd | Function | | - | 请求列表成功返回的回调 |
|
|
94
|
+
| onCreateSuc | Function | | - | 新增成功返回的回调 |
|
|
95
|
+
| onEditSuc | Function | | - | 编辑成功返回的回调 |
|
|
96
|
+
| onDelSuc | Function | | - | 删除成功返回的回调 |
|
|
97
|
+
| onFormModalClose | Function | | - | 表单弹窗关闭回调 |
|
|
98
|
+
| modalFormMount | Function | | - | 新增、编辑弹窗 Form 渲染完成回调 |
|
|
99
|
+
| msgConf | Object | | {} | 新增、编辑、删除、列表查询,详情查询的报错 msg 提示设置 |
|
|
100
|
+
| i18n | Object | | {} | 文案配置 |
|
|
101
|
+
| queryFormInitialValues | Object | | {} | 列表上方查询 Form 默认值 |
|
|
102
|
+
| queryFormIsExtendModelQuery | Boolean | | false | 列表上方查询 Form 默认值是否继承 data-model.query 置 |
|
|
103
|
+
| useFormData | boolean | 否 | | 是否使用 form data 提交数据 |
|
|
104
|
+
| editMode | modal/line/line-cell/cell | 否 | modal | 编辑模式: modal 弹窗/抽屉编辑; line 编辑整行,编辑按钮在操作列; line-cell 编辑整行,操作按钮在单元格; cell 编辑指定单元格 |
|
|
106
105
|
|
|
107
106
|
- fetchOnEdit 展示编辑弹框时,是否会调用一次详情接口进行回填(某些场景下,列表接口只返回部分部分字段,只有详情接口会返回全部字段);若为 false,则会使用表格列表接口返回的 row 数据进行回填
|
|
108
107
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useCallback, useRef } from "react";
|
|
2
2
|
import { Card, Slider, Rate, Form, Button } from "antd";
|
|
3
|
-
import { EditOutlined } from "@ant-design/icons";
|
|
3
|
+
import { EditOutlined, CheckOutlined, CloseOutlined } from "@ant-design/icons";
|
|
4
4
|
import { createSchemaField, FormProvider, FormConsumer } from "@formily/react";
|
|
5
5
|
import { cloneDeep } from "lodash";
|
|
6
6
|
|
|
@@ -26,10 +26,12 @@ export interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
26
26
|
record: Item;
|
|
27
27
|
index: number;
|
|
28
28
|
editable: boolean;
|
|
29
|
-
onEdit: (record: Partial<Item> & { key: React.Key }) => void;
|
|
29
|
+
onEdit: (record: Partial<Item> & { key: React.Key }, dataIndex: string) => void;
|
|
30
|
+
onSave: () => void;
|
|
31
|
+
onCancel: () => void;
|
|
30
32
|
topProps: {
|
|
31
33
|
config: { hasEdit: boolean | Function };
|
|
32
|
-
|
|
34
|
+
editMode: "modal" | "line" | "line-cell" | "cell";
|
|
33
35
|
};
|
|
34
36
|
children: React.ReactNode;
|
|
35
37
|
}
|
|
@@ -44,6 +46,8 @@ export const EditableCell: React.FC<EditableCellProps> = ({
|
|
|
44
46
|
record,
|
|
45
47
|
index,
|
|
46
48
|
onEdit,
|
|
49
|
+
onSave,
|
|
50
|
+
onCancel,
|
|
47
51
|
editable,
|
|
48
52
|
topProps,
|
|
49
53
|
children,
|
|
@@ -51,40 +55,56 @@ export const EditableCell: React.FC<EditableCellProps> = ({
|
|
|
51
55
|
}) => {
|
|
52
56
|
const fPattern = field?.["x-pattern"];
|
|
53
57
|
const fDisplay = field?.["x-display"];
|
|
58
|
+
const { editMode = "modal" } = topProps || {};
|
|
54
59
|
const { hasEdit } = topProps?.config || {};
|
|
55
|
-
|
|
60
|
+
|
|
61
|
+
// 弹窗编辑模式
|
|
62
|
+
if (editMode === "modal") {
|
|
63
|
+
return <td {...restProps}>{children}</td>;
|
|
64
|
+
}
|
|
65
|
+
// 无编辑权限或禁止编辑
|
|
56
66
|
const _hasEdit = hasEdit && typeof hasEdit === "function" ? hasEdit(record, index) : hasEdit !== false;
|
|
57
67
|
let _editable = _hasEdit && editable && !(fPattern === "disabled" || fPattern === "readOnly" || fDisplay === "none");
|
|
58
68
|
if (!_editable) {
|
|
59
69
|
return <td {...restProps}>{children}</td>;
|
|
60
70
|
}
|
|
71
|
+
|
|
61
72
|
// 编辑中状态
|
|
62
73
|
if (editing) {
|
|
63
74
|
// 使用 Schema 渲染模式
|
|
64
75
|
return (
|
|
65
76
|
<td {...restProps}>
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
<div className="editable-table-cell table-cell-editing">
|
|
78
|
+
<SchemaField
|
|
79
|
+
schema={{
|
|
80
|
+
type: "object",
|
|
81
|
+
properties: {
|
|
82
|
+
[field.name]: { ...field, title: "" },
|
|
83
|
+
},
|
|
84
|
+
}}
|
|
85
|
+
/>
|
|
86
|
+
{editMode !== "line" ? (
|
|
87
|
+
<div className="cell-editing-actions">
|
|
88
|
+
<CheckOutlined className="table-cell-confirm-icon" onClick={onSave} />
|
|
89
|
+
<CloseOutlined className="table-cell-cancel-icon" onClick={onCancel} />
|
|
90
|
+
</div>
|
|
91
|
+
) : null}
|
|
92
|
+
</div>
|
|
74
93
|
</td>
|
|
75
94
|
);
|
|
76
95
|
}
|
|
96
|
+
|
|
77
97
|
// 行内单元格编辑按钮
|
|
78
|
-
const showEditIcon =
|
|
98
|
+
const showEditIcon = editMode === "line-cell" || editMode === "cell";
|
|
79
99
|
if (showEditIcon) {
|
|
80
100
|
return (
|
|
81
101
|
<td {...restProps}>
|
|
82
102
|
<div
|
|
83
|
-
className="table-cell"
|
|
103
|
+
className="editable-table-cell"
|
|
84
104
|
onDoubleClick={(e) => {
|
|
85
105
|
e?.preventDefault();
|
|
86
106
|
e?.stopPropagation();
|
|
87
|
-
onEdit(record);
|
|
107
|
+
onEdit(record, dataIndex);
|
|
88
108
|
}}
|
|
89
109
|
>
|
|
90
110
|
{children}
|
|
@@ -93,7 +113,7 @@ export const EditableCell: React.FC<EditableCellProps> = ({
|
|
|
93
113
|
onClick={(e) => {
|
|
94
114
|
e?.preventDefault();
|
|
95
115
|
e?.stopPropagation();
|
|
96
|
-
onEdit(record);
|
|
116
|
+
onEdit(record, dataIndex);
|
|
97
117
|
}}
|
|
98
118
|
/>
|
|
99
119
|
</div>
|
|
@@ -104,9 +124,9 @@ export const EditableCell: React.FC<EditableCellProps> = ({
|
|
|
104
124
|
};
|
|
105
125
|
|
|
106
126
|
export const useEditTable = (props) => {
|
|
107
|
-
const {
|
|
127
|
+
const { topProps, idKey, columns, onEditSubmit, formRender } = props;
|
|
128
|
+
const { editMode = "modal" } = topProps || {};
|
|
108
129
|
|
|
109
|
-
const schema = _schema?.schema || _schema || {};
|
|
110
130
|
// 创建 formily 表单相关参数
|
|
111
131
|
/** schema scope 解决父级无 schema Scope 导致 scope 对象刷新的问题 */
|
|
112
132
|
const schemaScopeRef = useRef<{ _$tempData: Object }>();
|
|
@@ -135,21 +155,27 @@ export const useEditTable = (props) => {
|
|
|
135
155
|
);
|
|
136
156
|
|
|
137
157
|
// 是否可编辑状态逻辑处理
|
|
158
|
+
const [editingId, setEditingId] = useState("");
|
|
159
|
+
// 当前编辑的字段
|
|
138
160
|
const [editingKey, setEditingKey] = useState("");
|
|
139
|
-
/**
|
|
140
|
-
const isEditing = (record: Item) => record[idKey] ===
|
|
161
|
+
/** 判断当前 行 是否处于编辑状态 */
|
|
162
|
+
const isEditing = (record: Item) => record[idKey] === editingId;
|
|
163
|
+
/** 判断当前 单元格 是否处于编辑状态 */
|
|
164
|
+
const isEditingCell = (key) => key === editingKey;
|
|
141
165
|
|
|
142
166
|
/**
|
|
143
167
|
* 点击编辑按钮
|
|
144
168
|
* @param record
|
|
145
169
|
*/
|
|
146
|
-
const onEdit = async (record: Partial<Item> & { key: React.Key }) => {
|
|
170
|
+
const onEdit = async (record: Partial<Item> & { key: React.Key }, key) => {
|
|
147
171
|
const value = await (props.onEdit && props.onEdit(record));
|
|
148
172
|
formRender?.setValues(value);
|
|
149
|
-
|
|
173
|
+
setEditingId(record[idKey]);
|
|
174
|
+
editMode === "cell" && setEditingKey(key);
|
|
150
175
|
};
|
|
151
176
|
|
|
152
177
|
const onCancel = () => {
|
|
178
|
+
setEditingId("");
|
|
153
179
|
setEditingKey("");
|
|
154
180
|
};
|
|
155
181
|
|
|
@@ -162,6 +188,7 @@ export const useEditTable = (props) => {
|
|
|
162
188
|
(await formRender?.validate()) as Item;
|
|
163
189
|
onEditSubmit && onEditSubmit(formRender.values);
|
|
164
190
|
// 清除编辑目标
|
|
191
|
+
setEditingId("");
|
|
165
192
|
setEditingKey("");
|
|
166
193
|
} catch (errInfo) {
|
|
167
194
|
console.error("Validate Failed:", errInfo);
|
|
@@ -184,16 +211,22 @@ export const useEditTable = (props) => {
|
|
|
184
211
|
dataIndex: col.dataIndex,
|
|
185
212
|
title: col.title,
|
|
186
213
|
editable: col.editable,
|
|
187
|
-
editing: isActions
|
|
214
|
+
editing: isActions
|
|
215
|
+
? false
|
|
216
|
+
: editMode === "cell"
|
|
217
|
+
? isEditing(record) && isEditingCell(col.dataIndex)
|
|
218
|
+
: isEditing(record),
|
|
188
219
|
topProps: props.topProps,
|
|
189
220
|
onEdit,
|
|
221
|
+
onSave,
|
|
222
|
+
onCancel,
|
|
190
223
|
}),
|
|
191
224
|
};
|
|
192
225
|
// 操作列编辑态改成保存、取消按钮
|
|
193
226
|
if (isActions) {
|
|
194
227
|
resCol.render = (record, index) => {
|
|
195
228
|
// 编辑态操作栏变成保存和取消按钮
|
|
196
|
-
if (record[idKey] ===
|
|
229
|
+
if (editMode === "line" && record[idKey] === editingId) {
|
|
197
230
|
return (
|
|
198
231
|
<div className="edit-table-actions">
|
|
199
232
|
<Button type="link" onClick={onSave}>
|
|
@@ -214,16 +247,6 @@ export const useEditTable = (props) => {
|
|
|
214
247
|
return {
|
|
215
248
|
onEdit,
|
|
216
249
|
SchemaField,
|
|
217
|
-
formRender,
|
|
218
250
|
mergedColumns,
|
|
219
|
-
Form: (props) => {
|
|
220
|
-
return (
|
|
221
|
-
<FormProvider form={formRender}>
|
|
222
|
-
<Form layout={schema?.form?.layout}>
|
|
223
|
-
<FormConsumer>{() => props.children}</FormConsumer>
|
|
224
|
-
</Form>
|
|
225
|
-
</FormProvider>
|
|
226
|
-
);
|
|
227
|
-
},
|
|
228
251
|
};
|
|
229
252
|
};
|
package/src/list-render.jsx
CHANGED
|
@@ -274,7 +274,8 @@ const ListRender = forwardRef(function (props, parentRef) {
|
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
function onEdit(row, idx) {
|
|
277
|
-
const {
|
|
277
|
+
const { editMode = "modal" } = props;
|
|
278
|
+
const isEditTable = editMode !== "modal";
|
|
278
279
|
if (props.fetchOnEdit !== false) {
|
|
279
280
|
const getQuery = {};
|
|
280
281
|
if (props.fetchById !== false) {
|
|
@@ -285,7 +286,9 @@ const ListRender = forwardRef(function (props, parentRef) {
|
|
|
285
286
|
return model
|
|
286
287
|
.get(getQuery)
|
|
287
288
|
.then((res) => {
|
|
289
|
+
// 解决非弹窗编辑模式触发弹窗问题
|
|
288
290
|
!isEditTable && handleEdit(res, row[idKey]);
|
|
291
|
+
return res;
|
|
289
292
|
})
|
|
290
293
|
.catch((err) => {
|
|
291
294
|
console.error("err", err);
|
|
@@ -293,6 +296,7 @@ const ListRender = forwardRef(function (props, parentRef) {
|
|
|
293
296
|
return Promise.reject(err);
|
|
294
297
|
});
|
|
295
298
|
} else {
|
|
299
|
+
// 解决非弹窗编辑模式触发弹窗问题
|
|
296
300
|
!isEditTable && handleEdit(row, row[idKey]);
|
|
297
301
|
return Promise.resolve(row);
|
|
298
302
|
}
|
|
@@ -445,7 +449,6 @@ const ListRender = forwardRef(function (props, parentRef) {
|
|
|
445
449
|
schemaScope={props.schemaScope}
|
|
446
450
|
i18n={i18n}
|
|
447
451
|
onEditSubmit={onEditSubmit}
|
|
448
|
-
isEditTable={props.isEditTable}
|
|
449
452
|
topProps={props}
|
|
450
453
|
/>
|
|
451
454
|
) : null}
|
|
@@ -23,7 +23,7 @@ import "./index.less";
|
|
|
23
23
|
const scenario = "table-render";
|
|
24
24
|
|
|
25
25
|
function TableRender(props) {
|
|
26
|
-
const {
|
|
26
|
+
const { topProps, config = {}, query = {}, i18n, setList } = props;
|
|
27
27
|
const { tableDel = "删除", tableEdit = "编辑", tableDelTip = "确认删除该项?", tableDetail = "详情" } = i18n || {};
|
|
28
28
|
const {
|
|
29
29
|
dragColConf = {},
|
|
@@ -35,6 +35,8 @@ function TableRender(props) {
|
|
|
35
35
|
isShowTableFilter = false,
|
|
36
36
|
isTableSortXIdex = false,
|
|
37
37
|
} = config || {};
|
|
38
|
+
const { editMode = "modal" } = topProps || {};
|
|
39
|
+
const isEditTable = editMode !== "modal";
|
|
38
40
|
|
|
39
41
|
const [columns, setColumns] = useState([]);
|
|
40
42
|
const [columnList, setColumnList] = useState([]);
|
|
@@ -243,9 +245,11 @@ function TableRender(props) {
|
|
|
243
245
|
return <Slots.tableActionsSlot {...slotProps} />;
|
|
244
246
|
}
|
|
245
247
|
|
|
246
|
-
|
|
248
|
+
const { editMode = "modal" } = props.topProps || {};
|
|
249
|
+
// 编辑按钮权限
|
|
247
250
|
const _hasEdit =
|
|
248
|
-
|
|
251
|
+
editMode !== "cell" &&
|
|
252
|
+
editMode !== "line-cell" &&
|
|
249
253
|
(hasEdit && typeof hasEdit === "function" ? hasEdit(record, index) : hasEdit !== false);
|
|
250
254
|
|
|
251
255
|
//详情按钮权限
|
|
@@ -36,10 +36,36 @@
|
|
|
36
36
|
text-overflow: ellipsis;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.table-cell
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
.editable-table-cell {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
.ant-formily-item {
|
|
43
|
+
margin-bottom: 0;
|
|
44
|
+
}
|
|
45
|
+
.table-cell-edit-icon {
|
|
46
|
+
margin-left: 8px;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
color: var(--ant-primary-color, #1890ff);
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
.cell-editing-actions {
|
|
52
|
+
display: inline-block;
|
|
53
|
+
.table-cell-confirm-icon,
|
|
54
|
+
.table-cell-cancel-icon {
|
|
55
|
+
margin-left: 12px;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
}
|
|
58
|
+
.table-cell-confirm-icon {
|
|
59
|
+
color: var(--ant-primary-color, #1890ff);
|
|
60
|
+
}
|
|
61
|
+
.table-cell-cancel-icon {
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
&:hover {
|
|
65
|
+
.table-cell-edit-icon {
|
|
66
|
+
opacity: 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
43
69
|
}
|
|
44
70
|
}
|
|
45
71
|
|