eoss 0.1.0-alpha.45 → 0.1.0-alpha.46
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/data-table.js +60 -23
- package/lib/eoss.common.js +251 -163
- package/lib/flow.js +7 -9
- package/lib/form-editor.js +2 -3
- package/lib/index.js +1 -1
- package/lib/select.js +37 -16
- package/lib/selector.js +16 -4
- package/lib/table-column.js +40 -68
- package/lib/table.js +48 -69
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/table.css +1 -1
- package/lib/tree.js +17 -7
- package/lib/upload.js +85 -8
- package/package.json +1 -1
- package/packages/data-table/src/data-table.vue +32 -7
- package/packages/flow/src/selectUser.vue +12 -18
- package/packages/form-editor/src/form-editor.vue +0 -1
- package/packages/select/src/select.vue +37 -12
- package/packages/selector/src/selector.vue +10 -1
- package/packages/table/src/store/index.js +10 -1
- package/packages/table/src/util.js +33 -61
- package/packages/theme-chalk/src/table.scss +6 -0
- package/packages/tree/src/tree.vue +13 -3
- package/packages/upload/src/index.vue +43 -8
- package/src/index.js +1 -1
- package/packages/flowOld/index.js +0 -7
- package/packages/flowOld/src/component/Circulate.vue +0 -464
- package/packages/flowOld/src/component/CustomPreset.vue +0 -343
- package/packages/flowOld/src/component/FileList.vue +0 -117
- package/packages/flowOld/src/component/FreeCirculation.vue +0 -278
- package/packages/flowOld/src/component/Preset.vue +0 -283
- package/packages/flowOld/src/component/SendMsg.vue +0 -309
- package/packages/flowOld/src/component/TimeLimit.vue +0 -223
- package/packages/flowOld/src/component/opinions-file.vue +0 -126
- package/packages/flowOld/src/component/opinions.vue +0 -429
- package/packages/flowOld/src/component/taskUnionExamine.vue +0 -832
- package/packages/flowOld/src/form.vue +0 -134
- package/packages/flowOld/src/freeStartFlow.vue +0 -2945
- package/packages/flowOld/src/main.vue +0 -4141
- package/packages/flowOld/src/processForm.vue +0 -1431
- package/packages/flowOld/src/processReject.vue +0 -338
- package/packages/flowOld/src/reset.vue +0 -964
- package/packages/flowOld/src/selectUser.vue +0 -520
- package/packages/flowOld/src/startTaskRead.vue +0 -737
- package/packages/flowOld/src/supervise.vue +0 -197
- package/packages/flowOld/src/table.vue +0 -71
|
@@ -87,6 +87,14 @@ Watcher.prototype.mutations = {
|
|
|
87
87
|
const _label = label || title;
|
|
88
88
|
const _labelKey = labelKey || (sysCode ? 'shortName' : 'name');
|
|
89
89
|
const _valueKey = valueKey || (sysCode ? 'cciValue' : 'value');
|
|
90
|
+
// 必填列:显式 required 配置或 rules 含 required 规则(与 es-form-item isRequired 判定一致),
|
|
91
|
+
// 用于表头渲染红色星号
|
|
92
|
+
const _required =
|
|
93
|
+
configs.required === true ||
|
|
94
|
+
(!!rules &&
|
|
95
|
+
(Array.isArray(rules) ? rules : [rules]).some(
|
|
96
|
+
(rule) => !!rule && rule.required === true
|
|
97
|
+
));
|
|
90
98
|
// 归一化列配置:兼容文档中的 kebab-case 写法(如 min-width / show-overflow-tooltip)
|
|
91
99
|
const normalized = {};
|
|
92
100
|
Object.keys(configs).forEach((key) => {
|
|
@@ -136,7 +144,8 @@ Watcher.prototype.mutations = {
|
|
|
136
144
|
prop: _field,
|
|
137
145
|
property: _field,
|
|
138
146
|
formatter,
|
|
139
|
-
...normalized
|
|
147
|
+
...normalized,
|
|
148
|
+
required: _required
|
|
140
149
|
};
|
|
141
150
|
}
|
|
142
151
|
let childrens = null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
1
2
|
import { getValueByPath, getPropByPath } from 'eoss/src/utils/util';
|
|
2
3
|
import { cellForced } from './config';
|
|
3
4
|
export const getCell = function(event) {
|
|
@@ -653,6 +654,13 @@ export function setColumnRenders(column) {
|
|
|
653
654
|
// 对于普通列,设置默认渲染函数
|
|
654
655
|
if (!column.renderHeader) {
|
|
655
656
|
column.renderHeader = (h, { column }) => {
|
|
657
|
+
// 必填列:标题前渲染红色星号,与 es-form-item 必填星号样式一致
|
|
658
|
+
if (column.required) {
|
|
659
|
+
return h('span', [
|
|
660
|
+
h('span', { class: 'es-table__required-star' }, '*'),
|
|
661
|
+
column.label
|
|
662
|
+
]);
|
|
663
|
+
}
|
|
656
664
|
return h('span', column.label);
|
|
657
665
|
};
|
|
658
666
|
}
|
|
@@ -695,6 +703,11 @@ export function setColumnRenders(column) {
|
|
|
695
703
|
|
|
696
704
|
export function renderDom(h, { type, data, optionData, config = {}, events = {} }) {
|
|
697
705
|
const { className, ...configs } = config;
|
|
706
|
+
// 回写统一入口:行对象可能初始不含该列键(如新增空行),直接赋值会新增非响应式键,
|
|
707
|
+
// 控件 value 与外部数据都感知不到回写,需用 Vue.set 补键
|
|
708
|
+
const setValue = (val) => {
|
|
709
|
+
Vue.set(data.row, data.column.prop, val);
|
|
710
|
+
};
|
|
698
711
|
switch (type) {
|
|
699
712
|
case 'input':
|
|
700
713
|
return h('es-input', {
|
|
@@ -706,9 +719,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
706
719
|
},
|
|
707
720
|
on: {
|
|
708
721
|
...events,
|
|
709
|
-
input:
|
|
710
|
-
data.row[data.column.prop] = val;
|
|
711
|
-
}
|
|
722
|
+
input: setValue
|
|
712
723
|
}
|
|
713
724
|
});
|
|
714
725
|
case 'textarea':
|
|
@@ -722,9 +733,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
722
733
|
},
|
|
723
734
|
on: {
|
|
724
735
|
...events,
|
|
725
|
-
input:
|
|
726
|
-
data.row[data.column.prop] = val;
|
|
727
|
-
}
|
|
736
|
+
input: setValue
|
|
728
737
|
}
|
|
729
738
|
});
|
|
730
739
|
case 'radio':
|
|
@@ -738,9 +747,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
738
747
|
},
|
|
739
748
|
on: {
|
|
740
749
|
...events,
|
|
741
|
-
input:
|
|
742
|
-
data.row[data.column.prop] = val;
|
|
743
|
-
}
|
|
750
|
+
input: setValue
|
|
744
751
|
}
|
|
745
752
|
});
|
|
746
753
|
case 'checkbox':
|
|
@@ -754,9 +761,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
754
761
|
},
|
|
755
762
|
on: {
|
|
756
763
|
...events,
|
|
757
|
-
input:
|
|
758
|
-
data.row[data.column.prop] = val;
|
|
759
|
-
}
|
|
764
|
+
input: setValue
|
|
760
765
|
}
|
|
761
766
|
});
|
|
762
767
|
case 'inputNumber':
|
|
@@ -769,9 +774,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
769
774
|
},
|
|
770
775
|
on: {
|
|
771
776
|
...events,
|
|
772
|
-
input:
|
|
773
|
-
data.row[data.column.prop] = val;
|
|
774
|
-
}
|
|
777
|
+
input: setValue
|
|
775
778
|
}
|
|
776
779
|
});
|
|
777
780
|
case 'select':
|
|
@@ -785,9 +788,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
785
788
|
},
|
|
786
789
|
on: {
|
|
787
790
|
...events,
|
|
788
|
-
input:
|
|
789
|
-
data.row[data.column.prop] = val;
|
|
790
|
-
}
|
|
791
|
+
input: setValue
|
|
791
792
|
}
|
|
792
793
|
});
|
|
793
794
|
case 'cascader':
|
|
@@ -801,9 +802,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
801
802
|
},
|
|
802
803
|
on: {
|
|
803
804
|
...events,
|
|
804
|
-
input:
|
|
805
|
-
data.row[data.column.prop] = val;
|
|
806
|
-
}
|
|
805
|
+
input: setValue
|
|
807
806
|
}
|
|
808
807
|
});
|
|
809
808
|
case 'switch':
|
|
@@ -817,9 +816,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
817
816
|
},
|
|
818
817
|
on: {
|
|
819
818
|
...events,
|
|
820
|
-
input:
|
|
821
|
-
data.row[data.column.prop] = val;
|
|
822
|
-
}
|
|
819
|
+
input: setValue
|
|
823
820
|
}
|
|
824
821
|
});
|
|
825
822
|
case 'slider':
|
|
@@ -832,9 +829,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
832
829
|
},
|
|
833
830
|
on: {
|
|
834
831
|
...events,
|
|
835
|
-
input:
|
|
836
|
-
data.row[data.column.prop] = val;
|
|
837
|
-
}
|
|
832
|
+
input: setValue
|
|
838
833
|
}
|
|
839
834
|
});
|
|
840
835
|
case 'year':
|
|
@@ -848,9 +843,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
848
843
|
},
|
|
849
844
|
on: {
|
|
850
845
|
...events,
|
|
851
|
-
input:
|
|
852
|
-
data.row[data.column.prop] = val;
|
|
853
|
-
}
|
|
846
|
+
input: setValue
|
|
854
847
|
}
|
|
855
848
|
});
|
|
856
849
|
case 'month':
|
|
@@ -864,9 +857,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
864
857
|
},
|
|
865
858
|
on: {
|
|
866
859
|
...events,
|
|
867
|
-
input:
|
|
868
|
-
data.row[data.column.prop] = val;
|
|
869
|
-
}
|
|
860
|
+
input: setValue
|
|
870
861
|
}
|
|
871
862
|
});
|
|
872
863
|
case 'date':
|
|
@@ -880,9 +871,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
880
871
|
},
|
|
881
872
|
on: {
|
|
882
873
|
...events,
|
|
883
|
-
input:
|
|
884
|
-
data.row[data.column.prop] = val;
|
|
885
|
-
}
|
|
874
|
+
input: setValue
|
|
886
875
|
}
|
|
887
876
|
});
|
|
888
877
|
case 'week':
|
|
@@ -896,9 +885,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
896
885
|
},
|
|
897
886
|
on: {
|
|
898
887
|
...events,
|
|
899
|
-
input:
|
|
900
|
-
data.row[data.column.prop] = val;
|
|
901
|
-
}
|
|
888
|
+
input: setValue
|
|
902
889
|
}
|
|
903
890
|
});
|
|
904
891
|
case 'datetime':
|
|
@@ -912,9 +899,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
912
899
|
},
|
|
913
900
|
on: {
|
|
914
901
|
...events,
|
|
915
|
-
input:
|
|
916
|
-
data.row[data.column.prop] = val;
|
|
917
|
-
}
|
|
902
|
+
input: setValue
|
|
918
903
|
}
|
|
919
904
|
});
|
|
920
905
|
case 'datetimerange':
|
|
@@ -928,9 +913,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
928
913
|
},
|
|
929
914
|
on: {
|
|
930
915
|
...events,
|
|
931
|
-
input:
|
|
932
|
-
data.row[data.column.prop] = val;
|
|
933
|
-
}
|
|
916
|
+
input: setValue
|
|
934
917
|
}
|
|
935
918
|
});
|
|
936
919
|
case 'daterange':
|
|
@@ -944,9 +927,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
944
927
|
},
|
|
945
928
|
on: {
|
|
946
929
|
...events,
|
|
947
|
-
input:
|
|
948
|
-
data.row[data.column.prop] = val;
|
|
949
|
-
}
|
|
930
|
+
input: setValue
|
|
950
931
|
}
|
|
951
932
|
});
|
|
952
933
|
case 'quarter':
|
|
@@ -960,9 +941,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
960
941
|
},
|
|
961
942
|
on: {
|
|
962
943
|
...events,
|
|
963
|
-
input:
|
|
964
|
-
data.row[data.column.prop] = val;
|
|
965
|
-
}
|
|
944
|
+
input: setValue
|
|
966
945
|
}
|
|
967
946
|
});
|
|
968
947
|
case 'halfyear':
|
|
@@ -976,9 +955,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
976
955
|
},
|
|
977
956
|
on: {
|
|
978
957
|
...events,
|
|
979
|
-
input:
|
|
980
|
-
data.row[data.column.prop] = val;
|
|
981
|
-
}
|
|
958
|
+
input: setValue
|
|
982
959
|
}
|
|
983
960
|
});
|
|
984
961
|
case 'time':
|
|
@@ -992,9 +969,7 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
992
969
|
},
|
|
993
970
|
on: {
|
|
994
971
|
...events,
|
|
995
|
-
input:
|
|
996
|
-
data.row[data.column.prop] = val;
|
|
997
|
-
}
|
|
972
|
+
input: setValue
|
|
998
973
|
}
|
|
999
974
|
});
|
|
1000
975
|
case 'selector':
|
|
@@ -1007,13 +982,10 @@ export function renderDom(h, { type, data, optionData, config = {}, events = {}
|
|
|
1007
982
|
},
|
|
1008
983
|
on: {
|
|
1009
984
|
...events,
|
|
1010
|
-
input:
|
|
1011
|
-
data.row[data.column.prop] = val;
|
|
1012
|
-
}
|
|
985
|
+
input: setValue
|
|
1013
986
|
}
|
|
1014
987
|
});
|
|
1015
988
|
case 'handle':
|
|
1016
|
-
console.log('handle', data);
|
|
1017
989
|
// const contents = events.filter((item) => item.rules && typeof item.rules === 'function' ? item.rules(data.row) : true);
|
|
1018
990
|
return h('es-button-group', {
|
|
1019
991
|
class: className,
|
|
@@ -246,6 +246,12 @@
|
|
|
246
246
|
margin-bottom: 0;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
// 表头必填列红色星号(颜色/间距与 es-form-item 必填星号一致)
|
|
250
|
+
.es-table__required-star {
|
|
251
|
+
color: $--color-danger;
|
|
252
|
+
margin-right: 4px;
|
|
253
|
+
}
|
|
254
|
+
|
|
249
255
|
// 拥有多级表头
|
|
250
256
|
@include m((group, border)) {
|
|
251
257
|
border: $--table-border;
|
|
@@ -357,7 +357,15 @@ export default {
|
|
|
357
357
|
/**
|
|
358
358
|
* 配置操作按钮,格式为 { icon: 'es-icon-circle-jia', event: (data, node) => { console.log(data, node); } }
|
|
359
359
|
*/
|
|
360
|
-
handles: Array
|
|
360
|
+
handles: Array,
|
|
361
|
+
/**
|
|
362
|
+
* ajax 配置
|
|
363
|
+
* @type {Object}
|
|
364
|
+
*/
|
|
365
|
+
ajaxConfig: {
|
|
366
|
+
type: Object,
|
|
367
|
+
default: () => ({})
|
|
368
|
+
}
|
|
361
369
|
},
|
|
362
370
|
|
|
363
371
|
computed: {
|
|
@@ -889,7 +897,8 @@ export default {
|
|
|
889
897
|
url: this.url,
|
|
890
898
|
method: this.method,
|
|
891
899
|
data: params,
|
|
892
|
-
params: params
|
|
900
|
+
params: params,
|
|
901
|
+
...this.ajaxConfig
|
|
893
902
|
})
|
|
894
903
|
.then((res) => {
|
|
895
904
|
this.loading = false;
|
|
@@ -945,7 +954,8 @@ export default {
|
|
|
945
954
|
url: this.url,
|
|
946
955
|
method: this.method,
|
|
947
956
|
data: params,
|
|
948
|
-
params: params
|
|
957
|
+
params: params,
|
|
958
|
+
...this.ajaxConfig
|
|
949
959
|
})
|
|
950
960
|
.then((res) => {
|
|
951
961
|
this.loading = false;
|
|
@@ -201,6 +201,7 @@ import MessageBox from 'eoss/packages/message-box';
|
|
|
201
201
|
import ImageViewer from 'eoss/packages/image-viewer';
|
|
202
202
|
import { ajax, deleteFile } from 'eoss/src/utils/ajax';
|
|
203
203
|
import { getWinTop } from 'eoss/src/utils/util';
|
|
204
|
+
import Emitter from 'eoss/src/mixins/emitter';
|
|
204
205
|
import EsButton from 'eoss/packages/button';
|
|
205
206
|
import {
|
|
206
207
|
getAdjunctProperties,
|
|
@@ -221,7 +222,7 @@ function noop() {}
|
|
|
221
222
|
export default {
|
|
222
223
|
name: 'EsUpload',
|
|
223
224
|
|
|
224
|
-
mixins: [Migrating],
|
|
225
|
+
mixins: [Migrating, Emitter],
|
|
225
226
|
|
|
226
227
|
components: {
|
|
227
228
|
EsProgress,
|
|
@@ -732,6 +733,14 @@ export default {
|
|
|
732
733
|
zIndex: {
|
|
733
734
|
type: Number,
|
|
734
735
|
default: 2000
|
|
736
|
+
},
|
|
737
|
+
/**
|
|
738
|
+
* ajax 配置
|
|
739
|
+
* @type {Object}
|
|
740
|
+
*/
|
|
741
|
+
ajaxConfig: {
|
|
742
|
+
type: Object,
|
|
743
|
+
default: () => ({})
|
|
735
744
|
}
|
|
736
745
|
},
|
|
737
746
|
|
|
@@ -876,11 +885,17 @@ export default {
|
|
|
876
885
|
fileLists: {
|
|
877
886
|
immediate: true,
|
|
878
887
|
handler(res) {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
item
|
|
882
|
-
|
|
883
|
-
|
|
888
|
+
// 保留进行中(未成功)条目,避免 value 回写时丢失并发上传项
|
|
889
|
+
const pending = this.uploadFiles.filter(
|
|
890
|
+
(item) => item.status !== 'success' && res.indexOf(item) === -1
|
|
891
|
+
);
|
|
892
|
+
this.uploadFiles = res
|
|
893
|
+
.map((item) => {
|
|
894
|
+
item.uid = item.uid || Date.now() + this.tempIndex++;
|
|
895
|
+
item.status = item.status || 'success';
|
|
896
|
+
return item;
|
|
897
|
+
})
|
|
898
|
+
.concat(pending);
|
|
884
899
|
}
|
|
885
900
|
}
|
|
886
901
|
},
|
|
@@ -1014,7 +1029,8 @@ export default {
|
|
|
1014
1029
|
ajax({
|
|
1015
1030
|
method: 'post',
|
|
1016
1031
|
url: getAdjunctProperties,
|
|
1017
|
-
data: { code: this.code }
|
|
1032
|
+
data: { code: this.code },
|
|
1033
|
+
...this.ajaxConfig
|
|
1018
1034
|
})
|
|
1019
1035
|
.then((res) => {
|
|
1020
1036
|
if (res.rCode === 0) {
|
|
@@ -1065,7 +1081,8 @@ export default {
|
|
|
1065
1081
|
ajax({
|
|
1066
1082
|
method: 'post',
|
|
1067
1083
|
url: this.dochubConfig.getDocumentList || getAdjunctFileInfos,
|
|
1068
|
-
data: params
|
|
1084
|
+
data: params,
|
|
1085
|
+
...this.ajaxConfig
|
|
1069
1086
|
})
|
|
1070
1087
|
.then((res) => {
|
|
1071
1088
|
if (res.rCode === 0) {
|
|
@@ -1198,6 +1215,7 @@ export default {
|
|
|
1198
1215
|
}
|
|
1199
1216
|
this.onSuccess(res, file, this.uploadFiles);
|
|
1200
1217
|
this.onChange(file, this.uploadFiles);
|
|
1218
|
+
this.emitFileChange();
|
|
1201
1219
|
}
|
|
1202
1220
|
} else {
|
|
1203
1221
|
file.status = 'fail';
|
|
@@ -1214,6 +1232,7 @@ export default {
|
|
|
1214
1232
|
}
|
|
1215
1233
|
this.onSuccess(res, file, this.uploadFiles);
|
|
1216
1234
|
this.onChange(file, this.uploadFiles);
|
|
1235
|
+
this.emitFileChange();
|
|
1217
1236
|
}
|
|
1218
1237
|
}
|
|
1219
1238
|
}
|
|
@@ -1259,6 +1278,21 @@ export default {
|
|
|
1259
1278
|
*/
|
|
1260
1279
|
clearFiles() {
|
|
1261
1280
|
this.uploadFiles = [];
|
|
1281
|
+
this.emitFileChange();
|
|
1282
|
+
},
|
|
1283
|
+
/**
|
|
1284
|
+
* 回写当前文件列表:筛选上传成功的写入 fileLists(筛选收敛在此),
|
|
1285
|
+
* fileLists.length > 0(表示上传有数据)时才作为值回写供 required 校验;
|
|
1286
|
+
* 无数据时回写 undefined,保证 required 能判空
|
|
1287
|
+
*/
|
|
1288
|
+
emitFileChange() {
|
|
1289
|
+
this.fileLists = this.uploadFiles.filter(
|
|
1290
|
+
(item) => item.status === 'success'
|
|
1291
|
+
);
|
|
1292
|
+
const value = this.fileLists.length ? this.fileLists : undefined;
|
|
1293
|
+
this.$emit('update:fileList', value);
|
|
1294
|
+
this.$emit('input', value);
|
|
1295
|
+
this.dispatch('EsFormItem', 'es.form.change', value);
|
|
1262
1296
|
},
|
|
1263
1297
|
/**
|
|
1264
1298
|
* 提交上传
|
|
@@ -1404,6 +1438,7 @@ export default {
|
|
|
1404
1438
|
this.uploadFiles.splice(this.uploadFiles.indexOf(file), 1);
|
|
1405
1439
|
this.onRemove && this.onRemove(file, this.uploadFiles);
|
|
1406
1440
|
this.onChange(file, this.uploadFiles);
|
|
1441
|
+
this.emitFileChange();
|
|
1407
1442
|
};
|
|
1408
1443
|
|
|
1409
1444
|
// 弹出确认对话框
|
package/src/index.js
CHANGED