sohelp-eleplus 1.1.22 → 1.1.25
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/components.js +1 -0
- package/http/CrudHttp.js +18 -32
- package/http/SohelpHttp.js +21 -21
- package/package.json +1 -1
- package/sohelp-dict/index.vue +79 -50
- package/sohelp-dyn-select/index.vue +2 -2
- package/sohelp-entity-form/index.vue +5 -1
- package/sohelp-grid/index.vue +216 -172
- package/sohelp-grid/js/DefaultGridOptions.js +1 -1
- package/sohelp-grid/js/DefaultProps.js +5 -1
- package/sohelp-grid/js/useSohelpGridConfig.js +7 -6
- package/sohelp-grid-view/index.vue +62 -2
- package/sohelp-image-upload/index.vue +8 -2
- package/sohelp-import/index.vue +372 -365
- package/sohelp-pro-form/components/pro-form-item.vue +7 -5
- package/sohelp-pro-form/index.vue +6 -0
- package/sohelp-rate/index.vue +12 -8
- package/sohelp-select/index.vue +18 -21
- package/sohelp-table/index.vue +113 -115
- package/sohelp-table-select/index.vue +358 -0
- package/sohelp-vform-eleplus/render.es.js +0 -1
- package/sohelp-vxe-table/index.vue +20 -32
- package/sohelp-workflow-drawer/components/form.vue +1 -1
- package/sohelp-workflow-drawer/components/table.vue +0 -1
- package/sohelp-workflow-drawer/components/timeline.vue +2 -2
- package/sohelp-workflow-drawer/components/workflow.vue +28 -0
- package/sohelp-workflow-drawer/index.vue +189 -200
|
@@ -63,9 +63,8 @@
|
|
|
63
63
|
|
|
64
64
|
<template #footer>
|
|
65
65
|
<el-button @click="userModal = false">取消</el-button>
|
|
66
|
-
<el-button type="primary" @click="saveByUser(todoType, users)" v-loading="loading" :disabled="!users.length"
|
|
67
|
-
|
|
68
|
-
}}
|
|
66
|
+
<el-button type="primary" @click="saveByUser(todoType, users)" v-loading="loading" :disabled="!users.length"
|
|
67
|
+
>{{ moreOption[todoType] }}
|
|
69
68
|
</el-button>
|
|
70
69
|
</template>
|
|
71
70
|
</ele-modal>
|
|
@@ -74,10 +73,10 @@
|
|
|
74
73
|
<el-button plain size="small" @click="updateModelValue(false)">关闭</el-button>
|
|
75
74
|
<span v-if="showOpera">
|
|
76
75
|
<el-button type="primary" size="small" @click="openModal('agree')" v-permission="'todo.wf.agree'"
|
|
77
|
-
|
|
76
|
+
>同意</el-button
|
|
78
77
|
>
|
|
79
78
|
<el-button type="danger" size="small" @click="openModal('reject')" v-permission="'todo.wf.reject'"
|
|
80
|
-
|
|
79
|
+
>拒绝</el-button
|
|
81
80
|
>
|
|
82
81
|
<ele-dropdown trigger="click" :items="getMore" @command="onOperate($event)" v-if="getMore.length > 0">
|
|
83
82
|
<el-button plain="" size="small" title="更多" :icon="MoreFilled"></el-button>
|
|
@@ -88,224 +87,214 @@
|
|
|
88
87
|
</template>
|
|
89
88
|
|
|
90
89
|
<script setup>
|
|
91
|
-
import { buttonAuth, getTodoDetail, moreOption, todoOperate } from
|
|
92
|
-
import { EleMessage } from
|
|
93
|
-
import { MoreFilled } from
|
|
94
|
-
import { ElMessageBox } from
|
|
95
|
-
import { usePermission } from
|
|
96
|
-
import { computed, reactive, ref, watch } from
|
|
97
|
-
import FormTab from
|
|
98
|
-
import TableTab from
|
|
99
|
-
import TimelineTab from
|
|
100
|
-
import WorkflowTab from
|
|
101
|
-
import ApprovalModal from
|
|
90
|
+
import { buttonAuth, getTodoDetail, moreOption, todoOperate } from '@/api/todo/index.js';
|
|
91
|
+
import { EleMessage } from '@/components/ele-admin-plus/components';
|
|
92
|
+
import { MoreFilled } from '@element-plus/icons-vue';
|
|
93
|
+
import { ElMessageBox } from 'element-plus/es';
|
|
94
|
+
import { usePermission } from '@/utils/use-permission';
|
|
95
|
+
import { computed, reactive, ref, watch } from 'vue';
|
|
96
|
+
import FormTab from './components/form.vue';
|
|
97
|
+
import TableTab from './components/table.vue';
|
|
98
|
+
import TimelineTab from './components/timeline.vue';
|
|
99
|
+
import WorkflowTab from './components/workflow.vue';
|
|
100
|
+
import ApprovalModal from './components/approval-modal.vue';
|
|
102
101
|
|
|
103
|
-
const permission = usePermission();
|
|
102
|
+
const permission = usePermission();
|
|
104
103
|
|
|
105
|
-
const props = defineProps({
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
});
|
|
104
|
+
const props = defineProps({
|
|
105
|
+
modelValue: Boolean,
|
|
106
|
+
data: Object,
|
|
107
|
+
showOpera: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: true
|
|
110
|
+
}
|
|
111
|
+
});
|
|
113
112
|
|
|
114
|
-
const emit = defineEmits([
|
|
113
|
+
const emit = defineEmits(['opera', 'update:data', 'update:showOpera', 'update:modelValue', 'reload', 'close']);
|
|
115
114
|
|
|
116
|
-
const tabs = reactive([
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
]);
|
|
122
|
-
const active = ref(
|
|
123
|
-
const detail = ref();
|
|
115
|
+
const tabs = reactive([
|
|
116
|
+
{ label: '表单', name: 'form' },
|
|
117
|
+
{ label: '流程图', name: 'workflow' },
|
|
118
|
+
{ label: '表格', name: 'table' },
|
|
119
|
+
{ label: '时间轴', name: 'timeline' }
|
|
120
|
+
]);
|
|
121
|
+
const active = ref('form');
|
|
122
|
+
const detail = ref();
|
|
124
123
|
|
|
125
|
-
const todoType = ref(null);
|
|
126
|
-
const userModal = ref(false);
|
|
127
|
-
const drawerVisible = ref(false);
|
|
128
|
-
const loading = ref(false);
|
|
129
|
-
const users = ref([]);
|
|
124
|
+
const todoType = ref(null);
|
|
125
|
+
const userModal = ref(false);
|
|
126
|
+
const drawerVisible = ref(false);
|
|
127
|
+
const loading = ref(false);
|
|
128
|
+
const users = ref([]);
|
|
130
129
|
|
|
131
|
-
const approvalModalVisible = ref(false);
|
|
132
|
-
const approvalData = reactive({
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
});
|
|
130
|
+
const approvalModalVisible = ref(false);
|
|
131
|
+
const approvalData = reactive({
|
|
132
|
+
id: '',
|
|
133
|
+
refid: ''
|
|
134
|
+
});
|
|
136
135
|
|
|
136
|
+
/**
|
|
137
|
+
* 显示详情
|
|
138
|
+
* @param params
|
|
139
|
+
*/
|
|
140
|
+
const show = (params = {}) => {
|
|
141
|
+
emit('update:data', params);
|
|
142
|
+
emit('update:modelValue', true);
|
|
143
|
+
};
|
|
137
144
|
|
|
138
|
-
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const show = (params = {}) => {
|
|
143
|
-
emit("update:data",params);
|
|
144
|
-
emit("update:modelValue", true);
|
|
145
|
-
};
|
|
145
|
+
/** 更新modelValue */
|
|
146
|
+
const updateModelValue = (value) => {
|
|
147
|
+
emit('update:modelValue', value);
|
|
148
|
+
};
|
|
146
149
|
|
|
147
|
-
/**
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
/**
|
|
151
|
+
* 打开抽屉
|
|
152
|
+
*/
|
|
153
|
+
const open = async () => {
|
|
154
|
+
emit('update:showOpera', false);
|
|
155
|
+
const { id, refid } = props.data;
|
|
156
|
+
if (id && refid) {
|
|
157
|
+
await getDetail({ refid, id });
|
|
158
|
+
// //获取可审批的任务
|
|
159
|
+
SohelpHttp.get('/engine/web/workflow/getMyTask', { refid: refid, id: id }).then((res) => {
|
|
160
|
+
if (res.meta.success) {
|
|
161
|
+
emit('update:showOpera', res.data?.id !== '');
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
151
166
|
|
|
152
|
-
/**
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
} else {
|
|
160
|
-
EleMessage.error("缺少id或refid参数");
|
|
161
|
-
}
|
|
162
|
-
};
|
|
167
|
+
/**
|
|
168
|
+
* 关闭抽屉
|
|
169
|
+
*/
|
|
170
|
+
const close = () => {
|
|
171
|
+
active.value = 'form';
|
|
172
|
+
emit('close');
|
|
173
|
+
};
|
|
163
174
|
|
|
164
|
-
/**
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
175
|
+
/**
|
|
176
|
+
* 获取详情
|
|
177
|
+
* @param params
|
|
178
|
+
*/
|
|
179
|
+
const getDetail = async (params) => {
|
|
180
|
+
loading.value = true;
|
|
181
|
+
const res = await getTodoDetail(params);
|
|
182
|
+
loading.value = false;
|
|
183
|
+
if (res) {
|
|
184
|
+
detail.value = res;
|
|
185
|
+
} else {
|
|
186
|
+
EleMessage.error('获取详情失败');
|
|
187
|
+
}
|
|
188
|
+
};
|
|
171
189
|
|
|
172
|
-
/**
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
detail.value = res;
|
|
182
|
-
} else {
|
|
183
|
-
EleMessage.error("获取详情失败");
|
|
184
|
-
}
|
|
185
|
-
};
|
|
190
|
+
/**
|
|
191
|
+
* 更多操作按钮
|
|
192
|
+
*/
|
|
193
|
+
const getMore = computed(() => {
|
|
194
|
+
const exclude = ['agree', 'reject', 'batchAgree', 'batchReject', 'submit'];
|
|
195
|
+
return Object.entries(moreOption)
|
|
196
|
+
.filter(([key]) => !exclude.includes(key) && permission.hasPermission(buttonAuth[key]))
|
|
197
|
+
?.map(([key, value]) => ({ title: value, command: key }));
|
|
198
|
+
});
|
|
186
199
|
|
|
187
|
-
/**
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
/**
|
|
201
|
+
* 同意、拒绝弹窗
|
|
202
|
+
* @param type
|
|
203
|
+
*/
|
|
204
|
+
const openModal = (type) => {
|
|
205
|
+
todoType.value = type;
|
|
206
|
+
const id = props.data.id;
|
|
207
|
+
Object.assign(approvalData, {
|
|
208
|
+
id: id,
|
|
209
|
+
refid: props.data.refid
|
|
210
|
+
});
|
|
211
|
+
approvalModalVisible.value = true;
|
|
212
|
+
};
|
|
196
213
|
|
|
197
|
-
/**
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const id = props.data.id;
|
|
204
|
-
Object.assign(approvalData, {
|
|
205
|
-
id: id,
|
|
206
|
-
refid: props.data.refid
|
|
207
|
-
});
|
|
208
|
-
approvalModalVisible.value = true;
|
|
209
|
-
};
|
|
214
|
+
/**
|
|
215
|
+
* 选择用户弹窗
|
|
216
|
+
*/
|
|
217
|
+
const openUserModal = () => {
|
|
218
|
+
users.value = todoType.value === 'delegate' ? '' : [];
|
|
219
|
+
};
|
|
210
220
|
|
|
211
|
-
/**
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
/**
|
|
222
|
+
* 更多操作
|
|
223
|
+
* @param type 类型
|
|
224
|
+
* @param row
|
|
225
|
+
*/
|
|
226
|
+
const onOperate = (type) => {
|
|
227
|
+
todoType.value = type;
|
|
217
228
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const onOperate = (type) => {
|
|
224
|
-
todoType.value = type;
|
|
229
|
+
// 委派、加签、减签
|
|
230
|
+
if (['delegate', 'addSign', 'removeSign'].includes(type)) {
|
|
231
|
+
userModal.value = true;
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
225
234
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
235
|
+
let data = {
|
|
236
|
+
taskId: props.data.taskId
|
|
237
|
+
};
|
|
238
|
+
// 跳转
|
|
239
|
+
if (type === 'jump') {
|
|
240
|
+
data.nodeKey = props.data.nodeKey;
|
|
241
|
+
}
|
|
231
242
|
|
|
232
|
-
|
|
233
|
-
|
|
243
|
+
ElMessageBox.confirm(`确定要${moreOption[type]}吗?`, '系统提示', {
|
|
244
|
+
type: 'danger',
|
|
245
|
+
draggable: false
|
|
246
|
+
})
|
|
247
|
+
.then(async () => {
|
|
248
|
+
save(type, data);
|
|
249
|
+
})
|
|
250
|
+
.catch((e) => {});
|
|
234
251
|
};
|
|
235
|
-
// 跳转
|
|
236
|
-
if (type === "jump") {
|
|
237
|
-
data.nodeKey = props.data.nodeKey;
|
|
238
|
-
}
|
|
239
252
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
253
|
+
// 更新table
|
|
254
|
+
const done = () => {
|
|
255
|
+
updateModelValue(false);
|
|
256
|
+
emit('reload');
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* 委派,加签,减签保存
|
|
261
|
+
* @param type
|
|
262
|
+
*/
|
|
263
|
+
const saveByUser = (type) => {
|
|
264
|
+
save(type, {
|
|
265
|
+
id: props.data.id,
|
|
266
|
+
[type === 'delegate' ? 'userId' : 'users']: users.value
|
|
248
267
|
});
|
|
249
|
-
};
|
|
268
|
+
};
|
|
250
269
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
270
|
+
/**
|
|
271
|
+
* 保存
|
|
272
|
+
* @param type
|
|
273
|
+
* @param data
|
|
274
|
+
*/
|
|
275
|
+
const save = (type, data) => {
|
|
276
|
+
loading.value = true;
|
|
277
|
+
todoOperate(type, data)
|
|
278
|
+
.then((msg) => {
|
|
279
|
+
loading.value = false;
|
|
280
|
+
EleMessage.success(msg);
|
|
281
|
+
done();
|
|
282
|
+
if (type == 'agree' || type == 'reject') {
|
|
283
|
+
todoDrawerRef.value?.closeModal();
|
|
284
|
+
}
|
|
285
|
+
if (['delegate', 'addSign', 'removeSign'].includes(type)) {
|
|
286
|
+
userModal.value = false;
|
|
287
|
+
}
|
|
288
|
+
})
|
|
289
|
+
.catch((e) => {
|
|
290
|
+
loading.value = false;
|
|
291
|
+
EleMessage.error(e.message);
|
|
292
|
+
});
|
|
293
|
+
};
|
|
256
294
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
*/
|
|
261
|
-
const saveByUser = (type) => {
|
|
262
|
-
save(type, {
|
|
263
|
-
id: props.data.id,
|
|
264
|
-
[type === "delegate" ? "userId" : "users"]: users.value
|
|
295
|
+
defineExpose({
|
|
296
|
+
show,
|
|
297
|
+
close
|
|
265
298
|
});
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* 保存
|
|
270
|
-
* @param type
|
|
271
|
-
* @param data
|
|
272
|
-
*/
|
|
273
|
-
const save = (type, data) => {
|
|
274
|
-
loading.value = true;
|
|
275
|
-
todoOperate(type, data)
|
|
276
|
-
.then((msg) => {
|
|
277
|
-
loading.value = false;
|
|
278
|
-
EleMessage.success(msg);
|
|
279
|
-
done();
|
|
280
|
-
if (type == "agree" || type == "reject") {
|
|
281
|
-
todoDrawerRef.value?.closeModal();
|
|
282
|
-
}
|
|
283
|
-
if (["delegate", "addSign", "removeSign"].includes(type)) {
|
|
284
|
-
userModal.value = false;
|
|
285
|
-
}
|
|
286
|
-
})
|
|
287
|
-
.catch((e) => {
|
|
288
|
-
loading.value = false;
|
|
289
|
-
EleMessage.error(e.message);
|
|
290
|
-
});
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
defineExpose({
|
|
294
|
-
show,
|
|
295
|
-
close
|
|
296
|
-
});
|
|
297
|
-
watch(
|
|
298
|
-
() => props.modelValue,
|
|
299
|
-
(val) => {
|
|
300
|
-
drawerVisible.value = val;
|
|
301
|
-
emit("update:showOpera",false);
|
|
302
|
-
//获取可审批的任务
|
|
303
|
-
SohelpHttp.get("/engine/web/workflow/getMyTasks", { refid: props.data.refid, id: props.data.id }).then(res => {
|
|
304
|
-
if (res.meta.success) {
|
|
305
|
-
// emit("update:showOpera",res.data.length > 0)
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
);
|
|
310
299
|
</script>
|
|
311
300
|
<style lang="scss" scoped></style>
|