cloud-web-corejs 1.0.54-dev.335 → 1.0.54-dev.337

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.
Files changed (20) hide show
  1. package/package.json +1 -1
  2. package/src/components/xform/form-designer/form-widget/dialog/importDialogMixin.js +15 -2
  3. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +27 -5
  4. package/src/components/xform/form-designer/form-widget/field-widget/import-button-widget.vue +2 -0
  5. package/src/components/xform/form-designer/form-widget/field-widget/oplog-widget.vue +171 -0
  6. package/src/components/xform/form-designer/form-widget/field-widget/status-widget.vue +13 -4
  7. package/src/components/xform/form-designer/setting-panel/option-items-setting.vue +376 -366
  8. package/src/components/xform/form-designer/setting-panel/property-editor/field-import-button/import-button-editor.vue +3 -0
  9. package/src/components/xform/form-designer/setting-panel/property-editor/field-status/field-status-editor.vue +37 -30
  10. package/src/components/xform/form-designer/setting-panel/property-editor/formScriptEnabled-editor.vue +15 -10
  11. package/src/components/xform/form-designer/setting-panel/property-editor/oplog-editor.vue +31 -0
  12. package/src/components/xform/form-designer/setting-panel/propertyRegister.js +2 -0
  13. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +29 -0
  14. package/src/components/xform/form-render/container-item/data-table-item.vue +10 -7
  15. package/src/components/xform/form-render/container-item/data-table-mixin.js +112 -4
  16. package/src/components/xform/lang/zh-CN.js +1 -0
  17. package/src/components/xform/mixins/scriptHttp.js +62 -61
  18. package/src/utils/request.js +43 -8
  19. package/src/utils/vab.js +1095 -1
  20. package/src/views/bd/setting/menu_kind/mixins/authDialog.js +295 -2
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.335",
4
+ "version": "1.0.54-dev.337",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -774,10 +774,23 @@ tmixins = {
774
774
  } else {
775
775
  // error_win(resultMsg);
776
776
  // layer.close(opts.dialogObjIndex);
777
- that.$errorMsg(resultMsg);
777
+
778
+ let items = param.map(item=>{
779
+ return {
780
+ ...item,
781
+ _resultType: "error",
782
+ _resultContent: resultMsg.content,
783
+ }
784
+ })
785
+ failNum = failNum + items.length;
786
+ that.failRows.push(...items);
787
+
788
+ that.failRows = that.failRows.sort(compareV('impSeq'));
789
+
790
+ /* that.$errorMsg(resultMsg);
778
791
  that.showContent = false;
779
792
  that.clearImportTimer();
780
- return;
793
+ return; */
781
794
  }
782
795
  } else {
783
796
  var data = that.resultData.data[index];
@@ -548,6 +548,14 @@ modules = {
548
548
  }
549
549
  },
550
550
  initOptionItemsHandle() {
551
+ if(this.tableParam){
552
+ if(this.field._syncInited){
553
+ this.handleCustomEvent(
554
+ this.field.options.formScriptSuccess
555
+ );
556
+ }
557
+ return
558
+ }
551
559
  this.initGloatOptionItems(true);
552
560
  },
553
561
  initGloatOptionItems(initFlag) {
@@ -560,7 +568,8 @@ modules = {
560
568
  this.field.type === "radio" ||
561
569
  this.field.type === "checkbox" ||
562
570
  this.field.type === "select" ||
563
- this.field.type === "cascader"
571
+ this.field.type === "cascader" ||
572
+ this.field.type === "status"
564
573
  ) {
565
574
  /* this.field.options.optionItems.forEach(item=>{
566
575
  if (!item.hasOwnProperty('disabled')) {
@@ -643,7 +652,8 @@ modules = {
643
652
  this.getOptionItemLabelKey(),
644
653
  this.getOptionItemValueKey()
645
654
  );
646
- this.field.options.optionItems = optionItems
655
+ // this.field.options.optionItems = optionItems
656
+ this.setOptionItems(optionItems)
647
657
  let tableParam = this.tableParam;
648
658
  if (tableParam) {
649
659
  if (initFlag) {
@@ -652,6 +662,15 @@ modules = {
652
662
  this.loadTableOtions(optionItems)
653
663
  }
654
664
  },
665
+ setOptionItems(rows){
666
+ let formScriptEnabledTypes = ['select', 'checkbox', 'radio',"cascader"]
667
+ let widgetType = this.field.type;
668
+ if(formScriptEnabledTypes.includes(widgetType)){
669
+ this.field.options.optionItems = rows || [];
670
+ }else if(widgetType=="status"){
671
+ widget.options.statusParam = rows || [];
672
+ }
673
+ },
655
674
  loadTableOtions(e) {
656
675
  let tableParam = this.tableParam;
657
676
  if (tableParam) {
@@ -1400,7 +1419,8 @@ modules = {
1400
1419
  this.getOptionItemLabelKey(),
1401
1420
  this.getOptionItemValueKey()()
1402
1421
  );
1403
- this.field.options.optionItems = optionItems
1422
+ // this.field.options.optionItems = optionItems
1423
+ this.setOptionItems(optionItems)
1404
1424
  },
1405
1425
  loadOptions: function (e, rowOptionFlag) {
1406
1426
  let optionItems = baseRefUtil.translateOptionItems(
@@ -1409,7 +1429,8 @@ modules = {
1409
1429
  this.getOptionItemLabelKey(),
1410
1430
  this.getOptionItemValueKey()
1411
1431
  );
1412
- this.field.options.optionItems = optionItems
1432
+ // this.field.options.optionItems = optionItems
1433
+ this.setOptionItems(optionItems)
1413
1434
  },
1414
1435
  getOptionKey() {
1415
1436
  let key = "optionItems-" + this.field.options.name
@@ -1430,7 +1451,8 @@ modules = {
1430
1451
  this.getOptionItemLabelKey(),
1431
1452
  this.getOptionItemValueKey()
1432
1453
  );
1433
- this.field.options.optionItems = optionItems;
1454
+ // this.field.options.optionItems = optionItems;
1455
+ this.setOptionItems(optionItems)
1434
1456
  },
1435
1457
  getOptions: function () {
1436
1458
  return this.getOptionItems();
@@ -62,11 +62,13 @@ export default {
62
62
  methods: {
63
63
  importHandle() {
64
64
  let multi = this.field.options.importMultiple || false;
65
+ let multiSize = this.field.options.importMultiSize || 1;
65
66
  this.getFormRef().openImportDialog({
66
67
  target: this,
67
68
  importOption: this.field.options,
68
69
  importFrontOnly: false,
69
70
  multi,
71
+ multiSize,
70
72
  callback: (resultData, file, done) => {
71
73
 
72
74
  }
@@ -0,0 +1,171 @@
1
+ <template>
2
+ <static-content-wrapper :designer="designer" :field="field" :design-state="designState"
3
+ :display-style="field.options.displayStyle"
4
+ :parent-widget="parentWidget" :parent-list="parentList"
5
+ :index-of-parent-list="indexOfParentList"
6
+ :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
7
+ :sub-form-row-id="subFormRowId">
8
+ <vxe-grid ref="table-m1" :data="oplogDTOs" v-bind="m1Option" @resizable-change="$vxeTableUtil.onColumnWitchChange" @custom="$vxeTableUtil.customHandle"></vxe-grid>
9
+ </static-content-wrapper>
10
+ </template>
11
+
12
+ <script>
13
+ import StaticContentWrapper from './static-content-wrapper'
14
+ import emitter from '../../../utils/emitter'
15
+ import i18n from "../../../utils/i18n";
16
+ import fieldMixin from "./fieldMixin";
17
+
18
+ export default {
19
+ name: "oplog-widget",
20
+ componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
21
+ mixins: [emitter, fieldMixin, i18n],
22
+ props: {
23
+ field: Object,
24
+ parentWidget: Object,
25
+ parentList: Array,
26
+ indexOfParentList: Number,
27
+ designer: Object,
28
+
29
+ designState: {
30
+ type: Boolean,
31
+ default: false
32
+ },
33
+
34
+ subFormRowIndex: { /* 子表单组件行索引,从0开始计数 */
35
+ type: Number,
36
+ default: -1
37
+ },
38
+ subFormColIndex: { /* 子表单组件列索引,从0开始计数 */
39
+ type: Number,
40
+ default: -1
41
+ },
42
+ subFormRowId: { /* 子表单组件行Id,唯一id且不可变 */
43
+ type: String,
44
+ default: ''
45
+ },
46
+
47
+ },
48
+ components: {
49
+ StaticContentWrapper,
50
+ },
51
+ computed: {
52
+ showLabel(){
53
+ return this.field.options.labelHidden? null: this.label;
54
+ },
55
+ label() {
56
+ return this.field.options.isFormLabel ? this.currentValue : this.getI18nLabel(this.field.options.label);
57
+ },
58
+ widgetClass() {
59
+ let list = [];
60
+ let optionModel = this.field.options
61
+ if (optionModel.colorClass) list.push(optionModel.colorClass);
62
+ if (optionModel.underline) list.push('underLine');
63
+ if (optionModel.disabled) list.push('is-disabled');
64
+ return list
65
+ }
66
+ },
67
+ beforeCreate() {
68
+ /* 这里不能访问方法和属性!! */
69
+ },
70
+ data(){
71
+ return {
72
+ m1Option:{},
73
+ oplogDTOs:[]
74
+ }
75
+ },
76
+
77
+ created() {
78
+ /* 注意:子组件mounted在父组件created之后、父组件mounted之前触发,故子组件mounted需要用到的prop
79
+ 需要在父组件created中初始化!! */
80
+ this.registerToRefList()
81
+ this.initEventHandler()
82
+
83
+ this.handleOnCreated()
84
+ },
85
+
86
+ mounted() {
87
+ this.handleOnMounted()
88
+ this.initOplogDTOs();
89
+ },
90
+
91
+ beforeDestroy() {
92
+ this.unregisterFromRefList()
93
+ },
94
+
95
+ methods: {
96
+ initOplogDTOs() {
97
+ const tableOption = {
98
+ vue: this,
99
+ tableRef: 'table-m1',
100
+ tableName: 'xform-oplog-oplogList-m1Grid',
101
+ columns: [{
102
+ type: 'checkbox',
103
+ fixed: 'left',
104
+ width: 48,
105
+ resizable: false
106
+ },
107
+ {
108
+ title: this.$t2('操作时间', 'components.oplogTable.createDate'),
109
+ field: 'createDate',
110
+ width: 150
111
+ },
112
+ {
113
+ title: this.$t2('操作人员', 'components.oplogTable.createBy'),
114
+ field: '_createBy',
115
+ width: 150
116
+ },
117
+ {
118
+ title: this.$t2('操作日志', 'components.oplogTable.content'),
119
+ field: 'content',
120
+ width: 150
121
+ },
122
+ {
123
+ width: 47,
124
+ fixed: 'right',
125
+ title: '',
126
+ sortable: false
127
+ }
128
+ ]
129
+ };
130
+ this.$vxeTableUtil.initVxeTable(tableOption).then(opts => {
131
+ this.m1Option = opts;
132
+ });
133
+ this.initData();
134
+ },
135
+ initData(option) {
136
+ let reportTemplate = this.getFormRef().reportTemplate;
137
+ let formCode = reportTemplate.formCode;
138
+ let scriptCode = this.field.options.formScriptCode;
139
+ let oplogTypeCode = this.field.options.oplogTypeCode || formCode;
140
+ let oplogBusinessKey = this.field.options.oplogBusinessKey || "id";
141
+ if (!scriptCode) return;
142
+ let business_code = this.formModel[oplogBusinessKey];
143
+ if(!business_code) return;
144
+ this.formHttp({
145
+ scriptCode: scriptCode,
146
+ data: {
147
+ formCode: formCode,
148
+ formVersion: reportTemplate.formVersion,
149
+ data: {
150
+ log_type: oplogTypeCode,
151
+ business_code: business_code
152
+ }
153
+ },
154
+ callback: res => {
155
+ let rows = res.objx || [];
156
+ this.oplogDTOs = rows;
157
+ }
158
+ });
159
+ },
160
+ }
161
+
162
+ }
163
+ </script>
164
+
165
+ <style lang="scss" scoped>
166
+ @import "~@/styles/global.scss"; //* static-content-wrapper已引入,还需要重复引入吗? *//
167
+ a.is-disabled {
168
+ cursor: not-allowed;
169
+ }
170
+
171
+ </style>
@@ -4,10 +4,10 @@
4
4
  :sub-form-row-index="subFormRowIndex" :sub-form-col-index="subFormColIndex"
5
5
  :sub-form-row-id="subFormRowId">
6
6
  <template v-for="(item,index) in field.options.statusParam">
7
- <span
8
- v-if="fieldModel===item.value"
9
- :key="index" class="list-tag"
10
- :class="item.type">{{ getI18nLabel(item.label) }}</span>
7
+ <template v-if="fieldModel===item[valueField]">
8
+ <span v-if="field.options.formScriptEnabled || field.options.commonAttributeEnabled" :key="index" >{{ getI18nLabel(item[labelField]) }}</span>
9
+ <span v-else :key="index" class="list-tag" :class="item.type">{{ getI18nLabel(item[labelField]) }}</span>
10
+ </template>
11
11
  </template>
12
12
  </form-item-wrapper>
13
13
  </template>
@@ -64,6 +64,14 @@ export default {
64
64
  statusParam: [],
65
65
  }
66
66
  },
67
+ computed: {
68
+ labelField(){
69
+ return this.getOptionItemLabelKey();
70
+ },
71
+ valueField(){
72
+ return this.getOptionItemValueKey();
73
+ }
74
+ },
67
75
  watch: {
68
76
  fieldModel(val) {
69
77
  this.handleChangeEvent(val);
@@ -85,6 +93,7 @@ export default {
85
93
  this.buildFieldRules()
86
94
 
87
95
  this.handleOnCreated()
96
+ this.initOptionItemsHandle()
88
97
  // this.initStatusParam();
89
98
  },
90
99