cloud-web-corejs 1.0.255 → 1.0.257

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.255",
4
+ "version": "1.0.257",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -1746,13 +1746,31 @@ wfStartMixin = {
1746
1746
  if (settingConfig.withoutConfrimByOneWf === true) {
1747
1747
  this.startSubmit();
1748
1748
  } else {
1749
+ let customStartTip = this.option && this.option.startConfirmText;
1750
+ if (typeof customStartTip === "function") {
1751
+ customStartTip = await customStartTip.call(
1752
+ this.parentVue || this,
1753
+ {
1754
+ objId: this.dataId,
1755
+ wfCode: this.code,
1756
+ formCode: this.formCode,
1757
+ startParam: this.startParam,
1758
+ }
1759
+ );
1760
+ }
1749
1761
  let wfStartOperateName =
1750
1762
  settingConfig.wfStartOperateName ||
1751
1763
  settingConfig.wfStartButtonName ||
1752
1764
  "启动流程";
1753
- let startTip = "您确定要" + wfStartOperateName + "吗?";
1765
+ let defaultStartTip = "您确定要" + wfStartOperateName + "吗?";
1766
+ let startTip;
1767
+ if (typeof customStartTip === "string" && customStartTip.trim()) {
1768
+ startTip = customStartTip;
1769
+ } else {
1770
+ startTip = this.$t2(defaultStartTip, 'components.wf.startTip');
1771
+ }
1754
1772
  that
1755
- .$baseConfirm(this.$t2(startTip, 'components.wf.startTip'))
1773
+ .$baseConfirm(startTip)
1756
1774
  .then(() => {
1757
1775
  this.startSubmit();
1758
1776
  });
@@ -85,6 +85,7 @@ let chartContainers = [],
85
85
  saveScriptCode: "saveUpdate",
86
86
  wfConfig: null,
87
87
  wfStartBindSave: false,
88
+ wfStartConfirmText: null,
88
89
  wfAgreenBindSave: false,
89
90
  wfAgreeConfigData: [],
90
91
  wfConfigDataEnabled: false,
@@ -158,6 +158,16 @@
158
158
  <el-form-item :label="i18nt('流程启动时自动保存表单数据')">
159
159
  <el-switch v-model="formConfig.wfStartBindSave"></el-switch>
160
160
  </el-form-item>
161
+ <el-form-item :label="i18nt('流程启动确认提示脚本')">
162
+ <a
163
+ href="javascript:void(0);"
164
+ class="a-link link-oneLind"
165
+ @click="editFormEventHandler('wfStartConfirmText')"
166
+ >
167
+ <span>{{ formConfig.wfStartConfirmText }}</span>
168
+ <i class="el-icon-edit"></i>
169
+ </a>
170
+ </el-form-item>
161
171
 
162
172
  <el-form-item :label="i18nt('流程通过时自动保存表单数据')">
163
173
  <el-switch v-model="formConfig.wfAgreenBindSave"></el-switch>
@@ -360,7 +370,7 @@
360
370
  </el-form>
361
371
 
362
372
  <el-dialog
363
- :title="i18nt('designer.setting.editFormEventHandler')"
373
+ :title="formEventDialogTitle"
364
374
  :visible.sync="showFormEventDialogFlag"
365
375
  v-if="showFormEventDialogFlag"
366
376
  :show-close="true"
@@ -927,6 +937,18 @@ export default {
927
937
  showFormEventDialogFlag: false,
928
938
  formEventHandlerCode: "",
929
939
  curEventName: "",
940
+ formEventDialogTitle: "",
941
+ eventDialogTitleMap: {
942
+ globalConfig: "全局参数配置",
943
+ wfStartConfirmText: "流程启动确认提示语配置",
944
+ wfConfig: "流程自定义配置",
945
+ onBeforeCreated: "表单创建前事件配置",
946
+ onFormCreated: "表单创建事件配置",
947
+ onFormBeforeMounted: "表单挂载前事件配置",
948
+ onFormMounted: "表单挂载事件配置",
949
+ onFormDataChange: "表单数据变更事件配置",
950
+ onFormValidate: "表单校验事件配置",
951
+ },
930
952
 
931
953
  eventParamsMap: {
932
954
  onBeforeCreated: "onBeforeCreated(dataId,formCode,done) {",
@@ -935,6 +957,8 @@ export default {
935
957
  onFormMounted: "onFormMounted(dataId,formCode) {",
936
958
  onFormDataChange:
937
959
  "onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex) {",
960
+ wfStartConfirmText:
961
+ "wfStartConfirmText(dataId, formCode, formData) {",
938
962
  wfConfig: "wfConfig(dataId, formCode, formData) {",
939
963
  globalConfig: "globalConfig(dataId, formCode) {",
940
964
  //'onFormValidate': 'onFormValidate() {',
@@ -1123,9 +1147,16 @@ $\{wf.starterName\}提交的$\{pm_product_project.product_code\}$\{pm_product_pr
1123
1147
  this.showEditFunctionsDialogFlag = false;
1124
1148
  },
1125
1149
 
1126
- editFormEventHandler(eventName) {
1150
+ editFormEventHandler(eventName, dialogTitle) {
1127
1151
  this.curEventName = eventName;
1128
1152
  this.formEventHandlerCode = this.formConfig[eventName];
1153
+ let customTitle =
1154
+ typeof dialogTitle === "string" && dialogTitle ? dialogTitle : null;
1155
+ let eventTitle =
1156
+ customTitle ||
1157
+ this.eventDialogTitleMap[eventName] ||
1158
+ (eventName ? eventName + " 配置" : "配置");
1159
+ this.formEventDialogTitle = this.i18nt(eventTitle);
1129
1160
  this.showFormEventDialogFlag = true;
1130
1161
  },
1131
1162
 
@@ -135,6 +135,7 @@ export default {
135
135
  wfCode: formCode, //流程编码
136
136
  showStartBtn: true, //是否放出启动按钮,流程已启动时此参数失效
137
137
  serviceId: 'user',
138
+ startConfirmText: () => formTarget.getWfStartConfirmText(),
138
139
  callback: ({wfInfo}) => {
139
140
  this.wfInfo = wfInfo;
140
141
  }
@@ -147,6 +147,7 @@ export default {
147
147
  wfCode: formCode, //流程编码
148
148
  showStartBtn: true, //是否放出启动按钮,流程已启动时此参数失效
149
149
  serviceId: "user",
150
+ startConfirmText: () => formTarget.getWfStartConfirmText(),
150
151
  callback: ({ wfInfo }) => {
151
152
  this.wfInfo = wfInfo;
152
153
  },
@@ -14,8 +14,8 @@
14
14
  }"
15
15
  >
16
16
  <el-tab-pane
17
- v-for="(tab, index) in visibleTabs"
18
- :key="index"
17
+ v-for="tab in visibleTabs"
18
+ :key="tab.options.name"
19
19
  :label="getI18nLabel(tab.options.label)"
20
20
  :disabled="tab.options.disabled"
21
21
  :name="tab.options.name"
@@ -25,7 +25,7 @@
25
25
  <component
26
26
  :is="subWidget.type + '-item'"
27
27
  :widget="subWidget"
28
- :key="swIdx"
28
+ :key="subWidget.id || swIdx"
29
29
  :parent-list="tab.widgetList"
30
30
  :index-of-parent-list="swIdx"
31
31
  :parent-widget="widget"
@@ -42,7 +42,7 @@
42
42
  <component
43
43
  :is="subWidget.type + '-widget'"
44
44
  :field="subWidget"
45
- :key="swIdx"
45
+ :key="subWidget.id || swIdx"
46
46
  :parent-list="tab.widgetList"
47
47
  :index-of-parent-list="swIdx"
48
48
  :parent-widget="widget"
@@ -1243,6 +1243,7 @@ modules = {
1243
1243
  showStartBtn: true, //是否放出启动按钮,流程已启动时此参数失效
1244
1244
  showWfFold: true,
1245
1245
  formCode: formCode,
1246
+ startConfirmText: () => this.getWfStartConfirmText(),
1246
1247
  callback: (wfParam) => {
1247
1248
  this.setFormData(formData);
1248
1249
 
@@ -1651,6 +1652,14 @@ modules = {
1651
1652
  );
1652
1653
  }
1653
1654
  },
1655
+ getWfStartConfirmText() {
1656
+ let currentFormData = this.getSysFormData(this.getRealFormData());
1657
+ return this.handleCustomEvent(
1658
+ this.formConfig?.wfStartConfirmText,
1659
+ ["formData"],
1660
+ [currentFormData]
1661
+ );
1662
+ },
1654
1663
 
1655
1664
  handleOnCreated: function () {
1656
1665
  this.handleCustomEvent(this.formConfig?.onFormCreated);
@@ -993,6 +993,7 @@ export function getDefaultFormConfig() {
993
993
  saveScriptCode: "saveUpdate",
994
994
  wfConfig: null,
995
995
  wfStartBindSave: false,
996
+ wfStartConfirmText: null,
996
997
  wfAgreenBindSave: false,
997
998
  wfAgreeConfigData: [],
998
999
  wfConfigDataEnabled: false,
@@ -172,6 +172,12 @@
172
172
  :option="{ title: $t1('流程待办导出'), targetRef: 'table-m2' }"
173
173
  :parent-target="_self"
174
174
  />
175
+ <el-button
176
+ type="primary"
177
+ class="button-sty"
178
+ @click="openCurrentTaskUserDialog"
179
+ >{{ $t1("处理当前任务用户") }}
180
+ </el-button>
175
181
  </div>
176
182
  <div class="fr">
177
183
  <vxe-button
@@ -242,6 +248,14 @@
242
248
  <el-input v-model="formData2.candidateNames" size="small" clearable />
243
249
  </template>
244
250
  </vxe-form-item>
251
+ <vxe-form-item :title="$t1('禁用用户流程') + ':'">
252
+ <template v-slot>
253
+ <el-select v-model="formData2.filterDisabledUser" clearable>
254
+ <el-option :value="1" :label="$t1('是')"></el-option>
255
+ <el-option :value="0" :label="$t1('否')"></el-option>
256
+ </el-select>
257
+ </template>
258
+ </vxe-form-item>
245
259
  </vxe-form>
246
260
  </template>
247
261
  </vxe-grid>
@@ -262,15 +276,102 @@
262
276
  @confirm="confirmInsertWfObjConfig2"
263
277
  :multi="false"
264
278
  ></wfObjConfigDialog>
279
+ <el-dialog
280
+ :title="$t1('处理当前任务用户')"
281
+ :append-to-body="true"
282
+ :modal-append-to-body="true"
283
+ :close-on-click-modal="false"
284
+ :visible.sync="showCurrentTaskUserDialog"
285
+ :modal="false"
286
+ custom-class="dialog-style list-dialog pd_0"
287
+ width="300px"
288
+ @close="closeCurrentTaskUserDialog"
289
+ v-el-drag-dialog
290
+ v-el-dialog-center
291
+ >
292
+ <div class="cont" style="padding: 16px 20px">
293
+ <el-form
294
+ ref="currentTaskUserForm"
295
+ :model="currentTaskUserForm"
296
+ label-width="100px"
297
+ >
298
+ <el-form-item :label="$t1('删除用户')">
299
+ <el-input
300
+ class="search-input"
301
+ v-model="currentTaskUserForm.delUserNames"
302
+ clearable
303
+ @clear="clearDelUsers"
304
+ v-el-readonly
305
+ >
306
+ <i
307
+ slot="suffix"
308
+ class="el-input__icon el-icon-search"
309
+ @click="openDelUserDialog"
310
+ ></i>
311
+ </el-input>
312
+ </el-form-item>
313
+ <el-form-item :label="$t1('新增用户')">
314
+ <el-input
315
+ class="search-input"
316
+ v-model="currentTaskUserForm.addUserNames"
317
+ clearable
318
+ @clear="clearAddUsers"
319
+ v-el-readonly
320
+ >
321
+ <i
322
+ slot="suffix"
323
+ class="el-input__icon el-icon-search"
324
+ @click="openAddUserDialog"
325
+ ></i>
326
+ </el-input>
327
+ </el-form-item>
328
+ </el-form>
329
+ </div>
330
+ <span slot="footer" class="dialog-footer">
331
+ <el-button
332
+ type="primary"
333
+ plain
334
+ class="button-sty"
335
+ @click="closeCurrentTaskUserDialog"
336
+ >
337
+ <i class="el-icon-close el-icon"></i>
338
+ {{ $t1("取 消") }}
339
+ </el-button>
340
+ <el-button
341
+ type="primary"
342
+ class="button-sty"
343
+ @click="confirmCurrentTaskUser"
344
+ >
345
+ <i class="el-icon-check el-icon"></i>
346
+ {{ $t1("确 定") }}
347
+ </el-button>
348
+ </span>
349
+ </el-dialog>
350
+ <userDialog
351
+ v-if="showDelUserDialog"
352
+ :visiable.sync="showDelUserDialog"
353
+ @confirm="confirmDelUsers"
354
+ :multi="true"
355
+ :param="{ enabled: null }"
356
+ :rows="currentTaskUserForm.delUserRows"
357
+ />
358
+ <userDialog
359
+ v-if="showAddUserDialog"
360
+ :visiable.sync="showAddUserDialog"
361
+ @confirm="confirmAddUsers"
362
+ :multi="true"
363
+ :rows="currentTaskUserForm.addUserRows"
364
+ />
265
365
  </div>
266
366
  </template>
267
367
  <script>
268
368
  import { treeScollx } from "@base/utils/global.js";
269
369
  import wfObjConfigDialog from "../../../../views/user/wf/wf_obj_config/dialog.vue";
370
+ import userDialog from "@base/views/user/user/dialog";
270
371
 
271
372
  export default {
272
373
  name: "wf_manage:list",
273
- components: { wfObjConfigDialog },
374
+ components: { wfObjConfigDialog, userDialog },
274
375
  created() {},
275
376
  async mounted() {
276
377
  treeScollx({ target: this, type: "default" });
@@ -301,6 +402,19 @@ export default {
301
402
  param: {},
302
403
  wfContent: null,
303
404
  showWfContent: false,
405
+
406
+ showCurrentTaskUserDialog: false,
407
+ showDelUserDialog: false,
408
+ showAddUserDialog: false,
409
+ currentTaskUserUuids: [],
410
+ currentTaskUserForm: {
411
+ delUserIds: [],
412
+ delUserNames: "",
413
+ delUserRows: [],
414
+ addUserIds: [],
415
+ addUserNames: "",
416
+ addUserRows: [],
417
+ },
304
418
  };
305
419
  },
306
420
  computed: {
@@ -797,6 +911,112 @@ export default {
797
911
  this.$set(this.formData2, "objTypeCode", row.objTypeCode);
798
912
  }
799
913
  },
914
+ openCurrentTaskUserDialog() {
915
+ let checkRows = this.$refs["table-m2"].getCheckboxRecords(true) || [];
916
+ if (!checkRows.length) {
917
+ this.$baseAlert(this.$t1("请勾选需要处理的数据"));
918
+ return;
919
+ }
920
+ this.currentTaskUserUuids = checkRows.map((row) => row.uuid);
921
+ this.currentTaskUserForm = {
922
+ delUserIds: [],
923
+ delUserNames: "",
924
+ delUserRows: [],
925
+ addUserIds: [],
926
+ addUserNames: "",
927
+ addUserRows: [],
928
+ };
929
+ this.showCurrentTaskUserDialog = true;
930
+ this.initDelUsers();
931
+ },
932
+ initDelUsers() {
933
+ this.$http({
934
+ url: USER_PREFIX + "/wf_info/getDelUsers",
935
+ method: "post",
936
+ data: {
937
+ uuid: this.currentTaskUserUuids,
938
+ flag: 1,
939
+ },
940
+ success: (res) => {
941
+ let rows = (res.objx || []).map((row) => {
942
+ return { ...row, nickName: row.nickName || row.nick_name };
943
+ });
944
+ this.confirmDelUsers(rows);
945
+ },
946
+ });
947
+ },
948
+ closeCurrentTaskUserDialog() {
949
+ this.showCurrentTaskUserDialog = false;
950
+ },
951
+ openDelUserDialog() {
952
+ this.showDelUserDialog = true;
953
+ },
954
+ openAddUserDialog() {
955
+ this.showAddUserDialog = true;
956
+ },
957
+ clearDelUsers() {
958
+ this.currentTaskUserForm.delUserIds = [];
959
+ this.currentTaskUserForm.delUserNames = "";
960
+ this.currentTaskUserForm.delUserRows = [];
961
+ },
962
+ clearAddUsers() {
963
+ this.currentTaskUserForm.addUserIds = [];
964
+ this.currentTaskUserForm.addUserNames = "";
965
+ this.currentTaskUserForm.addUserRows = [];
966
+ },
967
+ confirmDelUsers(rows) {
968
+ if (!rows || !rows.length) {
969
+ this.clearDelUsers();
970
+ return;
971
+ }
972
+ this.currentTaskUserForm.delUserIds = rows.map((row) => row.id);
973
+ this.currentTaskUserForm.delUserRows = rows;
974
+ this.currentTaskUserForm.delUserNames = rows
975
+ .map((row) => row.nickName)
976
+ .join(",");
977
+ },
978
+ confirmAddUsers(rows) {
979
+ if (!rows || !rows.length) {
980
+ this.clearAddUsers();
981
+ return;
982
+ }
983
+ this.currentTaskUserForm.addUserIds = rows.map((row) => row.id);
984
+ this.currentTaskUserForm.addUserRows = rows;
985
+ this.currentTaskUserForm.addUserNames = rows
986
+ .map((row) => row.nickName)
987
+ .join(",");
988
+ },
989
+ confirmCurrentTaskUser() {
990
+ let delUserIds = this.currentTaskUserForm.delUserIds || [];
991
+ let addUserIds = this.currentTaskUserForm.addUserIds || [];
992
+ if (!delUserIds.length) {
993
+ this.$message.error(this.$t1("请选择删除用户"));
994
+ return;
995
+ }
996
+ this.$baseConfirm(this.$t1("您确定要处理当前任务用户吗?")).then(() => {
997
+ this.$http({
998
+ url: USER_PREFIX + "/wf_info/updateCurrentTaskUsers",
999
+ method: "post",
1000
+ data: {
1001
+ uuid: this.currentTaskUserUuids,
1002
+ delUserIds: delUserIds,
1003
+ addUserIds: addUserIds,
1004
+ },
1005
+ isLoading: true,
1006
+ success: (res) => {
1007
+ this.$message({
1008
+ message: res.content || this.$t1("操作成功"),
1009
+ type: "success",
1010
+ duration: 500,
1011
+ onClose: () => {
1012
+ this.closeCurrentTaskUserDialog();
1013
+ this.searchEvent2();
1014
+ },
1015
+ });
1016
+ },
1017
+ });
1018
+ });
1019
+ },
800
1020
  },
801
1021
  };
802
1022
  </script>