cloud-web-corejs 1.0.54-dev.205 → 1.0.54-dev.207

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.54-dev.205",
4
+ "version": "1.0.54-dev.207",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -93,7 +93,8 @@ modules = {
93
93
  formTemplates: {type: Array, default: null},
94
94
  testOptionData: {type: Object, default: null},
95
95
  readonly: Boolean,
96
- columnFlag: Boolean
96
+ columnFlag: Boolean,
97
+ sourceData:Object
97
98
  },
98
99
  data() {
99
100
  return {
@@ -158,7 +159,8 @@ modules = {
158
159
  getHasWf: () => false,
159
160
  readonly:this.readonly,
160
161
  columnFlag:this.columnFlag,
161
- widgetKeyNameMap:{}
162
+ widgetKeyNameMap:{},
163
+ sourceData:this.sourceData
162
164
  };
163
165
  },
164
166
  created() {
@@ -17,6 +17,9 @@
17
17
  <el-form-item :label="i18nt('流程启动时自动保存表单数据')">
18
18
  <el-switch v-model="formConfig.wfStartBindSave"></el-switch>
19
19
  </el-form-item>
20
+ <el-form-item :label="i18nt('流程第一步可编辑')">
21
+ <el-switch v-model="formConfig.wfFirstNodeEdit"></el-switch>
22
+ </el-form-item>
20
23
  <el-form-item :label="i18nt('默认流程单据类型名称')">
21
24
  <el-input type="text" v-model="designer.vueInstance.reportTemplate.objTypeName"></el-input>
22
25
  </el-form-item>
@@ -6,7 +6,7 @@
6
6
  <el-tabs v-model="formDesTabs" type="card" class="tab-boxOnly" :stretch="true">
7
7
  <el-tab-pane :label="$t1('设计器')" name="first">
8
8
  <designer ref="designer" :formTemplate="formTemplate" @customConfirm="customConfirm" :columnFlag="true"
9
- :widgetList="widgetList"></designer>
9
+ :widgetList="widgetList" :sourceData="sourceData"></designer>
10
10
  </el-tab-pane>
11
11
  </el-tabs>
12
12
  <el-button class="isFullIcon" v-if="!isFullscreen" @click="handleFullscreen">
@@ -27,7 +27,8 @@
27
27
  import PopupManager from 'element-ui/src/utils/popup/popup-manager.js'
28
28
  export default {
29
29
  props: {
30
- column: Object
30
+ column: Object,
31
+ sourceData:Object
31
32
  },
32
33
  components: {
33
34
  designer: () => import("@base/views/user/form/vform/designer.vue"),
@@ -341,7 +341,7 @@
341
341
  </template>
342
342
  </el-table-column>
343
343
  </el-table>
344
- <columnRenderDialog :column="currentTableColumn" v-if="showColumnRenderDialog"
344
+ <columnRenderDialog :column="currentTableColumn" :sourceData="sourceData" v-if="showColumnRenderDialog"
345
345
  :visiable.sync="showColumnRenderDialog"
346
346
  @confirm="confirmWidgetRenderDialog"></columnRenderDialog>
347
347
  </div>
@@ -499,7 +499,7 @@
499
499
  <script>
500
500
  import i18n from "../../../../../../components/xform/utils/i18n";
501
501
  import Sortable from "sortablejs";
502
- import {generateId} from "../../../../../../components/xform/utils/util";
502
+ import {generateId, loopHandleWidget,deepClone} from "../../../../../../components/xform/utils/util";
503
503
  import columnRenderDialog from "./columnRenderDialog.vue"
504
504
  import {businessFields} from "@base/components/xform/form-designer/widget-panel/widgetsConfig";
505
505
 
@@ -750,6 +750,7 @@ export default {
750
750
  showRenderDialogFlag: !1,
751
751
  renderJson: "",
752
752
  currentTableColumn: null,
753
+ sourceData: null,
753
754
 
754
755
  hideAfter: 1500,
755
756
  openDelay: 500,
@@ -850,8 +851,9 @@ export default {
850
851
  this.optionModel.tableColumns = this.tableData;
851
852
  this.closeHandle();
852
853
  },
853
- openWidgetRenderDialog(row) {
854
+ openWidgetRenderDialog(row, sourceData) {
854
855
  this.currentTableColumn = row;
856
+ this.sourceData = sourceData;
855
857
 
856
858
  // this.widgetList =
857
859
 
@@ -1314,9 +1316,57 @@ export default {
1314
1316
  }
1315
1317
  return {columnSelectedWidget, columnEditFields};
1316
1318
  },
1319
+ findColumnByColumnId(columnList, columnId) {
1320
+ let result = null
1321
+ if (columnList) {
1322
+ let column = columnList.find(item => item.columnId == columnId);
1323
+ if (!column) {
1324
+
1325
+ }
1326
+ for (let column of columnList) {
1327
+ if (column.columnId == columnId) {
1328
+ result = column;
1329
+ break
1330
+ } else if (column.children && column.children.length) {
1331
+ let subColumn = this.findColumnByColumnId(column.children, children)
1332
+ if (subColumn) {
1333
+ result = subColumn;
1334
+ break
1335
+ }
1336
+ }
1337
+
1338
+ }
1339
+ }
1340
+ return result;
1341
+ },
1317
1342
  openFormatConfigDialog(row, index) {
1318
1343
  if (row.formatS == 'widgetRender') {
1319
- this.openWidgetRenderDialog(row);
1344
+ let formWidgetList = deepClone(this.designer.widgetList);
1345
+ let tableData = deepClone(this.tableData);
1346
+ let columnId = row.columnId;
1347
+
1348
+ let dataTableName = this.optionModel.name;
1349
+
1350
+
1351
+ let targetColumn = null;
1352
+ loopHandleWidget(formWidgetList, (item) => {
1353
+ if (item.options.name == dataTableName) {
1354
+ item.options.tableColumns = tableData;
1355
+ targetColumn = this.findColumnByColumnId(item.options.tableColumns, columnId)
1356
+ }
1357
+ });
1358
+ let getWidgetList = (subWidgetList = []) =>{
1359
+ targetColumn.widgetList = this.$baseLodash.cloneDeep(subWidgetList);
1360
+ return formWidgetList;
1361
+ }
1362
+ let sourceData = {
1363
+ formWidgetList,
1364
+ dataTableName,
1365
+ columnId,
1366
+ getWidgetList
1367
+ }
1368
+
1369
+ this.openWidgetRenderDialog(row, sourceData);
1320
1370
  return
1321
1371
  }
1322
1372
 
@@ -215,6 +215,7 @@ export default {
215
215
  optionModel: Object,
216
216
  tableColumns: Array
217
217
  },
218
+ inject:["columnFlag","sourceData"],
218
219
  computed: {
219
220
  formulaForView() {
220
221
  const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP);
@@ -327,7 +328,6 @@ export default {
327
328
 
328
329
  traverseFieldWidgetsOfTableDataWidget(widget, callback) {
329
330
  if (widget.type == "data-table") {
330
- debugger
331
331
  let loopDo = (t) => {
332
332
  if (t.children && t.children.length) {
333
333
  t.children.forEach((item) => {
@@ -358,11 +358,22 @@ export default {
358
358
  handleTableConfigData(widget, callback) {
359
359
  callback(widget);
360
360
  },
361
+ getTargetWidgetList(){
362
+ let widgetList = this.designer.widgetList;
363
+ if(this.columnFlag){
364
+ let sourceData = this.sourceData;
365
+ let formWidgetList = sourceData.getWidgetList(widgetList)
366
+ widgetList = formWidgetList;
367
+ }
368
+ return widgetList;
369
+ },
361
370
  loadFieldListToTree() {
362
371
  this.fieldTreeData.length = 0; //先清空
363
372
 
364
- const allFields = getAllFieldWidgets(this.designer.widgetList);
365
- const allContainers = getAllContainerWidgets(this.designer.widgetList);
373
+ let widgetList = this.getTargetWidgetList();
374
+
375
+ const allFields = getAllFieldWidgets(widgetList);
376
+ const allContainers = getAllContainerWidgets(widgetList);
366
377
 
367
378
  const subFormArray = [];
368
379
  let sfFieldArray = [];
@@ -391,7 +402,9 @@ export default {
391
402
  tmpFieldArray.push(fw);
392
403
  }
393
404
  };
394
- this.traverseFieldWidgetsOfTableDataWidget(con.container, fwHandler);
405
+
406
+ // this.traverseFieldWidgetsOfTableDataWidget(con.container, fwHandler);
407
+ traverseFieldWidgetsOfContainer(con.container, fwHandler);
395
408
  subFormFieldMap[con.container.options.name] = tmpFieldArray;
396
409
  sfFieldArray = sfFieldArray.concat(tmpFieldArray);
397
410
  }
@@ -546,7 +559,8 @@ export default {
546
559
 
547
560
  const fieldId = firstPart.substring(2, firstPart.length);
548
561
  const fieldSchema = getFieldWidgetById(
549
- this.designer.widgetList,
562
+ // this.designer.widgetList,
563
+ this.getTargetWidgetList(),
550
564
  fieldId,
551
565
  false
552
566
  );
@@ -569,12 +583,16 @@ export default {
569
583
  editFormula() {
570
584
  this.fieldTreeData.length = 0;
571
585
  // 初始化字段树
572
- this.designer.widgetList.forEach((wItem) => {
573
- if (this.optionModel.name !== wItem.id) {
574
- //this.buildTreeNodeOfWidget(wItem, this.fieldTreeData);
575
- this.loadFieldListToTree();
576
- }
577
- });
586
+ if(this.columnFlag){
587
+ this.loadFieldListToTree();
588
+ }else{
589
+ this.designer.widgetList.forEach((wItem) => {
590
+ if (this.optionModel.name !== wItem.id) {
591
+ //this.buildTreeNodeOfWidget(wItem, this.fieldTreeData);
592
+ this.loadFieldListToTree();
593
+ }
594
+ });
595
+ }
578
596
 
579
597
  console.log("设计器字段===>", this.fieldTreeData);
580
598
 
@@ -3317,7 +3317,7 @@ export const businessFields = [
3317
3317
  }
3318
3318
  },
3319
3319
  {
3320
- type: "modfiy_date-text",
3320
+ type: "modify_date-text",
3321
3321
  targetType: "text",
3322
3322
  icon: "text",
3323
3323
  commonFlag: !0,
@@ -218,7 +218,6 @@ export function replaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef) {
218
218
  console.error('Invalid formula!')
219
219
  }
220
220
  } else {
221
- debugger
222
221
  /* 在主表单字段的计算公式中使用子表单字段,应将子表单所有记录同字段的值代入!! */
223
222
  const subFormValue = VFR.formDataModel[subFormNameOfField]
224
223
  let allSubFieldValues = ''
@@ -392,9 +392,12 @@ export function traverseFieldWidgetsOfContainer(
392
392
  handleWidgetForTraverse(column.widget, handler, staticWidgetsIncluded);
393
393
  }
394
394
  if (column.widgetList) {
395
- loopHandleWidget(column.widgetList, (cw) => {
395
+ column.widgetList.forEach((cw) => {
396
396
  handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
397
397
  });
398
+ /*loopHandleWidget(column.widgetList, (cw) => {
399
+ handleWidgetForTraverse(cw, handler, staticWidgetsIncluded);
400
+ });*/
398
401
  }
399
402
  }
400
403
  } else if (con.category === "container") {
@@ -14,6 +14,8 @@
14
14
  v-if="showDesinger"
15
15
  :readonly="readonly"
16
16
  :columnFlag="columnFlag"
17
+ :sourceData="sourceData"
18
+ sourceData:="sourceData"
17
19
  @customConfirm="customConfirm"
18
20
  />
19
21
  </div><!--
@@ -41,6 +43,7 @@ export default {
41
43
  formTemplate: Object,
42
44
  widgetList: Array,
43
45
  columnFlag: Boolean,
46
+ sourceData:Object
44
47
  },
45
48
  components: {
46
49
  VFormDesigner