work-flow-master 1.0.0 → 1.0.2
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/lib/App.css +92 -0
- package/lib/App.js +19 -0
- package/lib/api/index.js +83 -0
- package/lib/assets/images/add-close.png +0 -0
- package/lib/assets/images/add-close1.png +0 -0
- package/lib/assets/images/cancel.png +0 -0
- package/lib/assets/images/check_box.png +0 -0
- package/lib/assets/images/icon_file.png +0 -0
- package/lib/assets/images/icon_people.png +0 -0
- package/lib/assets/images/icon_role.png +0 -0
- package/lib/assets/images/jiaojiao.png +0 -0
- package/lib/assets/images/list_search.png +0 -0
- package/lib/assets/images/loading.gif +0 -0
- package/lib/assets/images/next_level.png +0 -0
- package/lib/assets/images/next_level_active.png +0 -0
- package/lib/assets/logo.svg +1 -0
- package/lib/components/AddNode/index.js +120 -0
- package/lib/components/AddNode/index.scss +120 -0
- package/lib/components/Dialog/ErrorDialog/index.js +61 -0
- package/lib/components/Dialog/ErrorDialog/index.scss +60 -0
- package/lib/components/Dialog/SelectDialog/index.js +336 -0
- package/lib/components/Dialog/SelectDialog/index.scss +34 -0
- package/lib/components/Drawer/ApproverDrawer/index.js +260 -0
- package/lib/components/Drawer/ApproverDrawer/index.scss +62 -0
- package/lib/components/Drawer/ConditionDrawer/index.js +431 -0
- package/lib/components/Drawer/ConditionDrawer/index.scss +113 -0
- package/lib/components/Drawer/CopyerDrawer/index.js +111 -0
- package/lib/components/Drawer/CopyerDrawer/index.scss +12 -0
- package/lib/components/Drawer/PromoterDrawer/index.js +82 -0
- package/lib/components/Drawer/PromoterDrawer/index.scss +16 -0
- package/lib/components/NodeWrap/index.js +383 -0
- package/lib/components/NodeWrap/index.scss +32 -0
- package/lib/components/SelectBox/index.js +72 -0
- package/lib/components/SelectBox/index.scss +27 -0
- package/lib/components/SelectResult/index.js +67 -0
- package/lib/components/SelectResult/index.scss +37 -0
- package/lib/components/setting/index.css +4 -0
- package/lib/components/setting/index.js +342 -0
- package/lib/css/override-element-ui.scss +119 -0
- package/lib/css/workflow.css +952 -0
- package/lib/index.js +0 -0
- package/lib/store/index.js +21 -0
- package/lib/store/models.js +91 -0
- package/lib/utils/axios.js +43 -0
- package/lib/utils/const.js +74 -0
- package/lib/utils/index.js +158 -0
- package/package.json +7 -5
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = ConditionDrawer;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _SelectDialog = _interopRequireDefault(require("../../../components/Dialog/SelectDialog"));
|
|
11
|
+
var _index = require("../../../utils/index");
|
|
12
|
+
var _const = require("../../../utils/const");
|
|
13
|
+
var _addClose = _interopRequireDefault(require("../../../assets/images/add-close1.png"));
|
|
14
|
+
require("./index.scss");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
// import { getConditions } from '@/api/index'
|
|
17
|
+
|
|
18
|
+
function ConditionDrawer(props) {
|
|
19
|
+
let {
|
|
20
|
+
tableId,
|
|
21
|
+
conditionsConfig1,
|
|
22
|
+
conditionDrawer,
|
|
23
|
+
setCondition,
|
|
24
|
+
setConditionsConfig
|
|
25
|
+
} = props.store;
|
|
26
|
+
let [conditionVisible, setConditionVisible] = (0, _react.useState)(false);
|
|
27
|
+
let [configs, setConfigs] = (0, _react.useState)({
|
|
28
|
+
conditionNodes: []
|
|
29
|
+
});
|
|
30
|
+
let [config, setConfig] = (0, _react.useState)({
|
|
31
|
+
conditionList: []
|
|
32
|
+
});
|
|
33
|
+
let [conditions, setConditions] = (0, _react.useState)([]);
|
|
34
|
+
let [conditionList, setConditionList] = (0, _react.useState)([]);
|
|
35
|
+
let [checkedList, setCheckedList] = (0, _react.useState)([]);
|
|
36
|
+
let [priorityLevel, setPriorityLevel] = (0, _react.useState)('');
|
|
37
|
+
let [conditionRoleVisible, setConditionRoleVisible] = (0, _react.useState)(false);
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
39
|
+
if (!conditionsConfig1.value) return;
|
|
40
|
+
let {
|
|
41
|
+
value,
|
|
42
|
+
priorityLevel
|
|
43
|
+
} = conditionsConfig1;
|
|
44
|
+
let {
|
|
45
|
+
conditionNodes
|
|
46
|
+
} = value;
|
|
47
|
+
setConfigs(value);
|
|
48
|
+
setPriorityLevel(priorityLevel);
|
|
49
|
+
setConfig(priorityLevel ? conditionNodes[priorityLevel - 1] : {
|
|
50
|
+
nodeUserList: [],
|
|
51
|
+
conditionList: []
|
|
52
|
+
});
|
|
53
|
+
}, [conditionsConfig1]);
|
|
54
|
+
const changeOptType = (e, item, i, key) => {
|
|
55
|
+
item[key] = typeof e === 'object' ? e.target.value : e;
|
|
56
|
+
if (key === 'optType') {
|
|
57
|
+
if (item.optType == 1) {
|
|
58
|
+
item.zdy1 = 2;
|
|
59
|
+
} else {
|
|
60
|
+
item.zdy1 = 1;
|
|
61
|
+
item.zdy2 = 2;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
config.conditionList.splice(i, 1, item);
|
|
65
|
+
setConfig({
|
|
66
|
+
...config,
|
|
67
|
+
conditionList: config.conditionList
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const toStrChecked = (item, key) => {
|
|
71
|
+
let a = item.zdy1 ? item.zdy1.split(",") : [];
|
|
72
|
+
var isIncludes = (0, _index.toggleStrClass)(item, key);
|
|
73
|
+
if (!isIncludes) {
|
|
74
|
+
a.push(key);
|
|
75
|
+
item.zdy1 = a.toString();
|
|
76
|
+
return item;
|
|
77
|
+
} else {
|
|
78
|
+
return removeStrEle(item, key);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const removeStrEle = (item, key) => {
|
|
82
|
+
let a = item.zdy1 ? item.zdy1.split(",") : [];
|
|
83
|
+
var includesIndex;
|
|
84
|
+
a.map((item, index) => {
|
|
85
|
+
if (item == key) {
|
|
86
|
+
includesIndex = index;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
a.splice(includesIndex, 1);
|
|
90
|
+
item.zdy1 = a.toString();
|
|
91
|
+
return item;
|
|
92
|
+
};
|
|
93
|
+
const checkEvent = (item, key, i) => {
|
|
94
|
+
let data = toStrChecked(item, key);
|
|
95
|
+
config.conditionList.splice(i, 1, data);
|
|
96
|
+
setConfig({
|
|
97
|
+
...config,
|
|
98
|
+
conditionList: config.conditionList
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const addCondition = async () => {
|
|
102
|
+
let res = [];
|
|
103
|
+
setConditionVisible(true);
|
|
104
|
+
// let { data } = await getConditions({ tableId })
|
|
105
|
+
let data = {};
|
|
106
|
+
setConditions(data);
|
|
107
|
+
let {
|
|
108
|
+
conditionList
|
|
109
|
+
} = config;
|
|
110
|
+
if (conditionList) {
|
|
111
|
+
for (var i = 0; i < conditionList.length; i++) {
|
|
112
|
+
var {
|
|
113
|
+
columnId
|
|
114
|
+
} = conditionList[i];
|
|
115
|
+
if (columnId == 0) {
|
|
116
|
+
res.push({
|
|
117
|
+
columnId: 0
|
|
118
|
+
});
|
|
119
|
+
} else {
|
|
120
|
+
res.push(conditions.filter(item => item.columnId == columnId)[0]);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
setConditionList(res);
|
|
125
|
+
};
|
|
126
|
+
const sureCondition = () => {
|
|
127
|
+
let data = {
|
|
128
|
+
...config
|
|
129
|
+
};
|
|
130
|
+
//1.弹窗有,外面无+
|
|
131
|
+
//2.弹窗有,外面有不变
|
|
132
|
+
for (var i = 0; i < conditionList.length; i++) {
|
|
133
|
+
var {
|
|
134
|
+
columnId,
|
|
135
|
+
showName,
|
|
136
|
+
columnName,
|
|
137
|
+
showType,
|
|
138
|
+
columnType,
|
|
139
|
+
fixedDownBoxValue
|
|
140
|
+
} = conditionList[i];
|
|
141
|
+
if ((0, _index.toggleClass)(data.conditionList, conditionList[i], "columnId")) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
if (columnId == 0) {
|
|
145
|
+
data.nodeUserList = [];
|
|
146
|
+
data.conditionList.push({
|
|
147
|
+
type: 1,
|
|
148
|
+
columnId,
|
|
149
|
+
showName: '发起人'
|
|
150
|
+
});
|
|
151
|
+
} else {
|
|
152
|
+
if (columnType == "Double") {
|
|
153
|
+
data.conditionList.push({
|
|
154
|
+
showType,
|
|
155
|
+
columnId,
|
|
156
|
+
type: 2,
|
|
157
|
+
showName,
|
|
158
|
+
optType: "1",
|
|
159
|
+
zdy1: "2",
|
|
160
|
+
opt1: "<",
|
|
161
|
+
zdy2: "",
|
|
162
|
+
opt2: "<",
|
|
163
|
+
columnDbname: columnName,
|
|
164
|
+
columnType
|
|
165
|
+
});
|
|
166
|
+
} else if (columnType == "String" && showType == "3") {
|
|
167
|
+
data.conditionList.push({
|
|
168
|
+
showType,
|
|
169
|
+
columnId,
|
|
170
|
+
type: 2,
|
|
171
|
+
showName,
|
|
172
|
+
zdy1: "",
|
|
173
|
+
columnDbname: columnName,
|
|
174
|
+
columnType,
|
|
175
|
+
fixedDownBoxValue
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//3.弹窗无,外面有-
|
|
181
|
+
for (let i = data.conditionList.length - 1; i >= 0; i--) {
|
|
182
|
+
if (!(0, _index.toggleClass)(conditionList, data.conditionList[i], "columnId")) {
|
|
183
|
+
data.conditionList.splice(i, 1);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
data.conditionList.sort(function (a, b) {
|
|
187
|
+
return a.columnId - b.columnId;
|
|
188
|
+
});
|
|
189
|
+
setConfig(data);
|
|
190
|
+
setConditionVisible(false);
|
|
191
|
+
};
|
|
192
|
+
const changePriortyLevel = priorityLevel => {
|
|
193
|
+
setConfig({
|
|
194
|
+
...config,
|
|
195
|
+
priorityLevel
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const saveCondition = () => {
|
|
199
|
+
closeDrawer();
|
|
200
|
+
let {
|
|
201
|
+
conditionNodes
|
|
202
|
+
} = configs;
|
|
203
|
+
var a = conditionNodes.splice(config.priorityLevel - 1, 1); //截取旧下标
|
|
204
|
+
conditionNodes.splice(priorityLevel - 1, 0, a[0]); //填充新下标
|
|
205
|
+
conditionNodes.map((item, index) => {
|
|
206
|
+
item.priorityLevel = index + 1;
|
|
207
|
+
});
|
|
208
|
+
for (var i = 0; i < conditionNodes.length; i++) {
|
|
209
|
+
conditionNodes[i].error = (0, _index.conditionStr)({
|
|
210
|
+
conditionNodes
|
|
211
|
+
}, i) == "请设置条件" && i != conditionNodes.length - 1;
|
|
212
|
+
}
|
|
213
|
+
setConditionsConfig({
|
|
214
|
+
value: {
|
|
215
|
+
...configs,
|
|
216
|
+
conditionNodes
|
|
217
|
+
},
|
|
218
|
+
flag: true,
|
|
219
|
+
id: conditionsConfig1.id
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
const addConditionRole = e => {
|
|
223
|
+
if (e.target.nodeName === "DIV" || e.target.nodeName === "P") {
|
|
224
|
+
setConditionRoleVisible(true);
|
|
225
|
+
setCheckedList(config.nodeUserList);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const sureConditionRole = nodeUserList => {
|
|
229
|
+
setConditionRoleVisible(false);
|
|
230
|
+
setConfig({
|
|
231
|
+
...config,
|
|
232
|
+
nodeUserList
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
const closeDrawer = () => {
|
|
236
|
+
setCondition(false);
|
|
237
|
+
};
|
|
238
|
+
const checkedHandle = function () {
|
|
239
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
240
|
+
columnId: 0
|
|
241
|
+
};
|
|
242
|
+
setConditionList((0, _index.toChecked)(conditionList, data, 'columnId'));
|
|
243
|
+
};
|
|
244
|
+
const delItem = item => {
|
|
245
|
+
let data = {
|
|
246
|
+
...config
|
|
247
|
+
};
|
|
248
|
+
if (item.type === 1) {
|
|
249
|
+
data.nodeUserList = [];
|
|
250
|
+
}
|
|
251
|
+
data.conditionList = (0, _index.removeEle)(data.conditionList, item, 'columnId');
|
|
252
|
+
setConfig(data);
|
|
253
|
+
};
|
|
254
|
+
const delUser = item => {
|
|
255
|
+
setConfig({
|
|
256
|
+
...config,
|
|
257
|
+
nodeUserList: (0, _index.removeEle)(config.nodeUserList, item, 'targetId')
|
|
258
|
+
});
|
|
259
|
+
};
|
|
260
|
+
function getColumn(item, i) {
|
|
261
|
+
let {
|
|
262
|
+
nodeUserList
|
|
263
|
+
} = config;
|
|
264
|
+
let {
|
|
265
|
+
type,
|
|
266
|
+
showType,
|
|
267
|
+
showName,
|
|
268
|
+
columnType,
|
|
269
|
+
fixedDownBoxValue,
|
|
270
|
+
optType,
|
|
271
|
+
zdy1,
|
|
272
|
+
zdy2,
|
|
273
|
+
opt1,
|
|
274
|
+
opt2
|
|
275
|
+
} = item;
|
|
276
|
+
if (type === 1) {
|
|
277
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
278
|
+
className: nodeUserList.length > 0 ? 'selected_list line' : 'line',
|
|
279
|
+
onClick: addConditionRole,
|
|
280
|
+
style: {
|
|
281
|
+
cursor: 'text'
|
|
282
|
+
}
|
|
283
|
+
}, nodeUserList.length == 0 ? /*#__PURE__*/_react.default.createElement("p", {
|
|
284
|
+
class: "like_input",
|
|
285
|
+
onClick: addConditionRole
|
|
286
|
+
}, nodeUserList.length === 0 ? '请选择具体人员/角色/部门' : '') : nodeUserList.map((item1, index1) => /*#__PURE__*/_react.default.createElement("span", {
|
|
287
|
+
key: index1
|
|
288
|
+
}, item1.name, /*#__PURE__*/_react.default.createElement("img", {
|
|
289
|
+
src: _addClose.default,
|
|
290
|
+
onClick: () => delUser(item1),
|
|
291
|
+
alt: ""
|
|
292
|
+
})))));
|
|
293
|
+
} else if (columnType == 'String' && showType == 3) {
|
|
294
|
+
let list = Object.values(JSON.parse(fixedDownBoxValue));
|
|
295
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
296
|
+
className: "check_box line"
|
|
297
|
+
}, list.map(_ref => {
|
|
298
|
+
let {
|
|
299
|
+
key,
|
|
300
|
+
value
|
|
301
|
+
} = _ref;
|
|
302
|
+
return /*#__PURE__*/_react.default.createElement("a", {
|
|
303
|
+
className: (0, _index.toggleStrClass)(item, key) ? 'active' : '',
|
|
304
|
+
key: key,
|
|
305
|
+
onClick: () => checkEvent(item, key, i)
|
|
306
|
+
}, value);
|
|
307
|
+
})));
|
|
308
|
+
} else {
|
|
309
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
310
|
+
className: "line"
|
|
311
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Select, {
|
|
312
|
+
className: "select",
|
|
313
|
+
value: optType,
|
|
314
|
+
options: _const.optTypes,
|
|
315
|
+
style: {
|
|
316
|
+
width: optType == 6 ? 370 : 100
|
|
317
|
+
},
|
|
318
|
+
onChange: e => changeOptType(e, item, i, "optType")
|
|
319
|
+
}), optType != 6 ? /*#__PURE__*/_react.default.createElement(_antd.InputNumber, {
|
|
320
|
+
placeholder: `请输入${showName}`,
|
|
321
|
+
value: zdy1,
|
|
322
|
+
controls: false,
|
|
323
|
+
bordered: false,
|
|
324
|
+
onChange: e => changeOptType(e, item, i, "zdy1")
|
|
325
|
+
}) : ''), optType == 6 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
326
|
+
className: "line between"
|
|
327
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.InputNumber, {
|
|
328
|
+
className: "mr_10",
|
|
329
|
+
value: zdy1,
|
|
330
|
+
controls: false,
|
|
331
|
+
bordered: false,
|
|
332
|
+
onChange: e => changeOptType(e, item, i, "zdy1")
|
|
333
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.Select, {
|
|
334
|
+
className: "select",
|
|
335
|
+
value: opt1,
|
|
336
|
+
options: _const.opt1s,
|
|
337
|
+
onChange: e => changeOptType(e, item, i, "opt1")
|
|
338
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
339
|
+
className: "ellipsis"
|
|
340
|
+
}, showName), /*#__PURE__*/_react.default.createElement(_antd.Select, {
|
|
341
|
+
className: "select ml_10",
|
|
342
|
+
value: opt2,
|
|
343
|
+
options: _const.opt1s,
|
|
344
|
+
onChange: e => changeOptType(e, item, i, "opt2")
|
|
345
|
+
}), /*#__PURE__*/_react.default.createElement(_antd.InputNumber, {
|
|
346
|
+
value: zdy2,
|
|
347
|
+
controls: false,
|
|
348
|
+
bordered: false,
|
|
349
|
+
onChange: e => changeOptType(e, item, i, "zdy2")
|
|
350
|
+
})) : '');
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
let icon = /*#__PURE__*/_react.default.createElement("span", {
|
|
354
|
+
className: "ant-icon-close"
|
|
355
|
+
});
|
|
356
|
+
let extra = () => {
|
|
357
|
+
let list = Array.from({
|
|
358
|
+
length: configs.conditionNodes.length
|
|
359
|
+
}, (_, i) => ({
|
|
360
|
+
value: i + 1,
|
|
361
|
+
label: `优先级${i + 1}`
|
|
362
|
+
}));
|
|
363
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Select, {
|
|
364
|
+
style: {
|
|
365
|
+
marginRight: 20
|
|
366
|
+
},
|
|
367
|
+
value: config.priorityLevel,
|
|
368
|
+
options: list,
|
|
369
|
+
onChange: e => changePriortyLevel(e)
|
|
370
|
+
});
|
|
371
|
+
};
|
|
372
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Drawer, {
|
|
373
|
+
title: "\u6761\u4EF6\u8BBE\u7F6E",
|
|
374
|
+
extra: extra(),
|
|
375
|
+
open: conditionDrawer,
|
|
376
|
+
className: "condition_copyer",
|
|
377
|
+
closable: false,
|
|
378
|
+
width: 550,
|
|
379
|
+
onClose: saveCondition
|
|
380
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
381
|
+
className: "demo-drawer-content"
|
|
382
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
383
|
+
className: "condition_content drawer_content"
|
|
384
|
+
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
385
|
+
className: "tip"
|
|
386
|
+
}, "\u5F53\u5BA1\u6279\u5355\u540C\u65F6\u6EE1\u8DB3\u4EE5\u4E0B\u6761\u4EF6\u65F6\u8FDB\u5165\u6B64\u6D41\u7A0B"), /*#__PURE__*/_react.default.createElement("ul", null, config.conditionList.map((item, index) => /*#__PURE__*/_react.default.createElement("li", {
|
|
387
|
+
key: index
|
|
388
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
389
|
+
className: "ellipsis"
|
|
390
|
+
}, item.type == 1 ? '发起人' : item.showName, "\uFF1A"), getColumn(item, index), /*#__PURE__*/_react.default.createElement("a", {
|
|
391
|
+
onClick: () => delItem(item)
|
|
392
|
+
}, "\u5220\u9664")))), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
393
|
+
type: "primary",
|
|
394
|
+
onClick: addCondition
|
|
395
|
+
}, "\u6DFB\u52A0\u6761\u4EF6"), /*#__PURE__*/_react.default.createElement(_antd.Modal, {
|
|
396
|
+
title: "\u9009\u62E9\u6761\u4EF6",
|
|
397
|
+
open: conditionVisible,
|
|
398
|
+
width: 480,
|
|
399
|
+
okText: "\u786E \u5B9A",
|
|
400
|
+
closeIcon: icon,
|
|
401
|
+
onOk: sureCondition,
|
|
402
|
+
cancelText: "\u53D6 \u6D88",
|
|
403
|
+
onCancel: () => setConditionVisible(false),
|
|
404
|
+
className: "condition_list"
|
|
405
|
+
}, /*#__PURE__*/_react.default.createElement("p", null, "\u8BF7\u9009\u62E9\u7528\u6765\u533A\u5206\u5BA1\u6279\u6D41\u7A0B\u7684\u6761\u4EF6\u5B57\u6BB5"), /*#__PURE__*/_react.default.createElement("p", {
|
|
406
|
+
className: "check_box"
|
|
407
|
+
}, /*#__PURE__*/_react.default.createElement("a", {
|
|
408
|
+
className: (0, _index.toggleClass)(conditionList, {
|
|
409
|
+
columnId: 0
|
|
410
|
+
}, 'columnId') ? 'active' : '',
|
|
411
|
+
onClick: () => checkedHandle()
|
|
412
|
+
}, "\u53D1\u8D77\u4EBA"), conditions.map((item, index) => /*#__PURE__*/_react.default.createElement("a", {
|
|
413
|
+
key: index,
|
|
414
|
+
className: (0, _index.toggleClass)(conditionList, item, 'columnId') ? 'active' : '',
|
|
415
|
+
onClick: () => checkedHandle(item)
|
|
416
|
+
}, item.showName))))), /*#__PURE__*/_react.default.createElement(_SelectDialog.default, {
|
|
417
|
+
type: "employeesRole",
|
|
418
|
+
visible: conditionRoleVisible,
|
|
419
|
+
setVisible: setConditionRoleVisible,
|
|
420
|
+
data: checkedList,
|
|
421
|
+
changeEvent: sureConditionRole,
|
|
422
|
+
isDepartment: true
|
|
423
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
424
|
+
className: "demo-drawer-footer clear"
|
|
425
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
426
|
+
type: "primary",
|
|
427
|
+
onClick: saveCondition
|
|
428
|
+
}, "\u786E \u5B9A"), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
429
|
+
onClick: closeDrawer
|
|
430
|
+
}, "\u53D6 \u6D88"))));
|
|
431
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
|
|
2
|
+
.condition_copyer {
|
|
3
|
+
.condition_content {
|
|
4
|
+
padding: 20px 20px 0;
|
|
5
|
+
p.tip {
|
|
6
|
+
margin: 20px 0;
|
|
7
|
+
width: 510px;
|
|
8
|
+
text-indent: 17px;
|
|
9
|
+
line-height: 45px;
|
|
10
|
+
background: rgba(241, 249, 255, 1);
|
|
11
|
+
border: 1px solid rgba(64, 163, 247, 1);
|
|
12
|
+
color: #46a6fe;
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
}
|
|
15
|
+
ul {
|
|
16
|
+
max-height: 500px;
|
|
17
|
+
overflow-y: scroll;
|
|
18
|
+
margin-bottom: 20px;
|
|
19
|
+
li {
|
|
20
|
+
&>span {
|
|
21
|
+
float: left;
|
|
22
|
+
margin-right: 8px;
|
|
23
|
+
width: 70px;
|
|
24
|
+
line-height: 32px;
|
|
25
|
+
text-align: right;
|
|
26
|
+
}
|
|
27
|
+
&>div {
|
|
28
|
+
display: inline-block;
|
|
29
|
+
width: 370px;
|
|
30
|
+
|
|
31
|
+
&>.line:not(:last-child) {
|
|
32
|
+
margin-bottom: 10px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
&:not(:last-child)>div>.line {
|
|
36
|
+
margin-bottom: 20px;
|
|
37
|
+
}
|
|
38
|
+
&>a {
|
|
39
|
+
float: right;
|
|
40
|
+
margin-right: 10px;
|
|
41
|
+
margin-top: 7px;
|
|
42
|
+
}
|
|
43
|
+
.like_input,
|
|
44
|
+
.select,
|
|
45
|
+
input {
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 32px;
|
|
48
|
+
background: rgba(255, 255, 255, 1);
|
|
49
|
+
border-radius: 4px;
|
|
50
|
+
vertical-align: middle;
|
|
51
|
+
}
|
|
52
|
+
.like_input,
|
|
53
|
+
input{
|
|
54
|
+
border: 1px solid rgba(217, 217, 217, 1);
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
.like_input{
|
|
58
|
+
line-height: 30px;
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
text-indent: 10px;
|
|
61
|
+
color: #757575;
|
|
62
|
+
}
|
|
63
|
+
.select+.ant-input-number {
|
|
64
|
+
width: 260px;
|
|
65
|
+
}
|
|
66
|
+
.select {
|
|
67
|
+
margin-right: 10px;
|
|
68
|
+
width: 100px;
|
|
69
|
+
}
|
|
70
|
+
.between{
|
|
71
|
+
&>span{
|
|
72
|
+
display: inline-block;
|
|
73
|
+
width: 60px;
|
|
74
|
+
vertical-align: middle;
|
|
75
|
+
}
|
|
76
|
+
.ant-select{
|
|
77
|
+
width: 60px;
|
|
78
|
+
}
|
|
79
|
+
.ant-input-number{
|
|
80
|
+
width: 75px;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
.line.selected_list {
|
|
84
|
+
padding-left: 10px;
|
|
85
|
+
border-radius: 4px;
|
|
86
|
+
min-height: 32px;
|
|
87
|
+
border: 1px solid rgba(217, 217, 217, 1);
|
|
88
|
+
word-break: break-word;
|
|
89
|
+
}
|
|
90
|
+
.line.check_box {
|
|
91
|
+
line-height: 32px;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
.ant-btn {
|
|
96
|
+
margin-bottom: 20px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.condition_list {
|
|
101
|
+
.ant-modal-body {
|
|
102
|
+
padding: 16px 26px;
|
|
103
|
+
}
|
|
104
|
+
p {
|
|
105
|
+
color: #666666;
|
|
106
|
+
margin-bottom: 10px;
|
|
107
|
+
|
|
108
|
+
&>.check_box {
|
|
109
|
+
margin-bottom: 0;
|
|
110
|
+
line-height: 36px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = CopyerDrawer;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _index = require("../../../utils/index");
|
|
11
|
+
var _SelectDialog = _interopRequireDefault(require("../../../components/Dialog/SelectDialog"));
|
|
12
|
+
var _addClose = _interopRequireDefault(require("../../../assets/images/add-close1.png"));
|
|
13
|
+
require("./index.scss");
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
/*
|
|
16
|
+
* @Date: 2023-03-15 17:56:12
|
|
17
|
+
* @LastEditors: StavinLi 495727881@qq.com
|
|
18
|
+
* @LastEditTime: 2023-03-23 17:57:29
|
|
19
|
+
* @FilePath: /workflow-react/src/components/Drawer/CopyerDrawer/index.js
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
function CopyerDrawer(props) {
|
|
23
|
+
let {
|
|
24
|
+
copyerDrawer,
|
|
25
|
+
copyerConfig1,
|
|
26
|
+
setCopyerConfig,
|
|
27
|
+
setCopyer
|
|
28
|
+
} = props.store;
|
|
29
|
+
let [copyerVisible, setCopyerVisible] = (0, _react.useState)(false);
|
|
30
|
+
let [config, setConfig] = (0, _react.useState)({
|
|
31
|
+
nodeUserList: []
|
|
32
|
+
});
|
|
33
|
+
let [ccSelfSelectFlag, setCcSelfSelectFlag] = (0, _react.useState)([]);
|
|
34
|
+
let [checkedList, setCheckedList] = (0, _react.useState)([]);
|
|
35
|
+
(0, _react.useEffect)(() => {
|
|
36
|
+
if (!copyerConfig1.value) return;
|
|
37
|
+
setConfig(copyerConfig1.value);
|
|
38
|
+
setCcSelfSelectFlag(copyerConfig1.value.ccSelfSelectFlag == 0 ? [] : [copyerConfig1.value.ccSelfSelectFlag]);
|
|
39
|
+
}, [copyerConfig1]);
|
|
40
|
+
const addCopyer = () => {
|
|
41
|
+
setCopyerVisible(true);
|
|
42
|
+
setCheckedList(config.nodeUserList);
|
|
43
|
+
};
|
|
44
|
+
const sureCopyer = data => {
|
|
45
|
+
setCopyerVisible(false);
|
|
46
|
+
setConfig({
|
|
47
|
+
...config,
|
|
48
|
+
nodeUserList: data
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const saveCopyer = () => {
|
|
52
|
+
let data = {
|
|
53
|
+
...config,
|
|
54
|
+
ccSelfSelectFlag: ccSelfSelectFlag.length == 0 ? 0 : 1,
|
|
55
|
+
error: (0, _index.copyerStr)(config)
|
|
56
|
+
};
|
|
57
|
+
setCopyerConfig({
|
|
58
|
+
value: data,
|
|
59
|
+
flag: true,
|
|
60
|
+
id: copyerConfig1.id
|
|
61
|
+
});
|
|
62
|
+
closeDrawer();
|
|
63
|
+
};
|
|
64
|
+
const closeDrawer = () => {
|
|
65
|
+
setCopyer(false);
|
|
66
|
+
};
|
|
67
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Drawer, {
|
|
68
|
+
title: "\u6284\u9001\u4EBA\u8BBE\u7F6E",
|
|
69
|
+
open: copyerDrawer,
|
|
70
|
+
className: "set_copyer",
|
|
71
|
+
closable: false,
|
|
72
|
+
width: 550,
|
|
73
|
+
onClose: saveCopyer
|
|
74
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
75
|
+
className: "demo-drawer-content"
|
|
76
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: "copyer_content drawer_content"
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
79
|
+
type: "primary",
|
|
80
|
+
onClick: addCopyer
|
|
81
|
+
}, "\u6DFB\u52A0\u6210\u5458"), /*#__PURE__*/_react.default.createElement("p", {
|
|
82
|
+
className: "selected_list"
|
|
83
|
+
}, config.nodeUserList.map((item, index) => /*#__PURE__*/_react.default.createElement("span", {
|
|
84
|
+
key: index
|
|
85
|
+
}, item.name, /*#__PURE__*/_react.default.createElement("img", {
|
|
86
|
+
src: _addClose.default,
|
|
87
|
+
onClick: () => (0, _index.removeEle)(config.nodeUserList, item, 'targetId'),
|
|
88
|
+
alt: ""
|
|
89
|
+
}))), config.nodeUserList.length != 0 ? /*#__PURE__*/_react.default.createElement("a", {
|
|
90
|
+
onClick: () => config.nodeUserList = []
|
|
91
|
+
}, "\u6E05\u9664") : ''), /*#__PURE__*/_react.default.createElement(_antd.Checkbox.Group, {
|
|
92
|
+
value: ccSelfSelectFlag,
|
|
93
|
+
onChange: setCcSelfSelectFlag,
|
|
94
|
+
className: "clear"
|
|
95
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Checkbox, {
|
|
96
|
+
value: 1
|
|
97
|
+
}, "\u5141\u8BB8\u53D1\u8D77\u4EBA\u81EA\u9009\u6284\u9001\u4EBA"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
98
|
+
className: "demo-drawer-footer clear"
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
100
|
+
type: "primary",
|
|
101
|
+
onClick: saveCopyer
|
|
102
|
+
}, "\u786E \u5B9A"), /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
103
|
+
onClick: closeDrawer
|
|
104
|
+
}, "\u53D6 \u6D88")), /*#__PURE__*/_react.default.createElement(_SelectDialog.default, {
|
|
105
|
+
type: "employeesRole",
|
|
106
|
+
visible: copyerVisible,
|
|
107
|
+
setVisible: setCopyerVisible,
|
|
108
|
+
data: checkedList,
|
|
109
|
+
changeEvent: sureCopyer
|
|
110
|
+
})));
|
|
111
|
+
}
|