sks-plugin-el-erp 1.0.4 → 1.0.5

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 (37) hide show
  1. package/README.md +13 -1
  2. package/babel.config.js +13 -0
  3. package/index.js +42 -3
  4. package/lib/core.js +34 -346
  5. package/lib/sks-app-utils.js +341 -1
  6. package/lib/sks-mock-utils.js +82 -0
  7. package/lib/sks-mock.js +3 -2
  8. package/lib/sks-model-utils.js +5 -3
  9. package/lib/sksConfig.js +6 -0
  10. package/lib/style/element-ui.css +23 -0
  11. package/lib/style/element-ui.css.map +1 -1
  12. package/lib/style-sass/element-ui.scss +23 -0
  13. package/lib/ui/filter-param/sks-filter-param-date-range/index.js +8 -0
  14. package/lib/ui/filter-param/sks-filter-param-date-range/src/main.vue +169 -0
  15. package/lib/ui/filter-param/sks-filter-param-dict-select/index.js +8 -0
  16. package/lib/ui/filter-param/sks-filter-param-dict-select/src/main.vue +95 -0
  17. package/lib/ui/filter-param/sks-filter-param-input/index.js +8 -0
  18. package/lib/ui/filter-param/sks-filter-param-input/src/main.vue +83 -0
  19. package/lib/ui/sks-checkbox/index.js +8 -0
  20. package/lib/ui/sks-checkbox/src/main.vue +96 -0
  21. package/lib/ui/sks-date/index.js +8 -0
  22. package/lib/ui/sks-date/src/main.vue +127 -0
  23. package/lib/ui/sks-image-use-img-url/src/index.vue +1 -1
  24. package/lib/ui/sks-pagination/src/main.vue +1 -1
  25. package/lib/ui/sks-right-toolbar/src/index.vue +7 -7
  26. package/lib/ui/sks-select-multiple-by-lookup-controller/index.js +8 -0
  27. package/lib/ui/sks-select-multiple-by-lookup-controller/src/main.vue +440 -0
  28. package/lib/ui/sks-select-single-by-lookup-controller/index.js +8 -0
  29. package/lib/ui/sks-select-single-by-lookup-controller/src/main.vue +463 -0
  30. package/lib/ui/sks-status-select/index.js +8 -0
  31. package/lib/ui/sks-status-select/src/main.vue +202 -0
  32. package/lib/ui/sks-table/src/SksTable.vue +3 -2
  33. package/lib/ui/sks-table-query-form-el/index.js +8 -0
  34. package/lib/ui/sks-table-query-form-el/src/main.vue +396 -0
  35. package/package-lock.bak.json +2016 -236
  36. package/package.json +7 -6
  37. package/vue.config.js +31 -25
package/README.md CHANGED
@@ -7,8 +7,20 @@ npm publish
7
7
  ```
8
8
 
9
9
  ## 测试版
10
+
11
+ ```json
12
+ {
13
+ "version": "1.0.4-beta.2",
14
+ "package.json": "发布时文件中的版本号,下个测试版最后面的版本号+1,例如 1.0.4-beta.3"
15
+ }
16
+ ```
17
+ ### 发布测试版
18
+ ```shell
19
+ npm publish --tag beta1
20
+ ```
21
+ ### 按照测试版
10
22
  ```shell
11
- npm publish --tag beta
23
+ npm install sks-plugin-el-erp@beta1
12
24
  ```
13
25
 
14
26
  ## 撤销发布包
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ presets: [
3
+ // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
4
+ '@vue/cli-plugin-babel/preset'
5
+ ],
6
+ 'env': {
7
+ 'development': {
8
+ // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
9
+ // This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
10
+ 'plugins': ['dynamic-import-node']
11
+ }
12
+ }
13
+ }
package/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  DICT_DATA_CSS_CLASS,
6
6
  CHANGE_BIT_FLAG,
7
7
  clearFormValidate,
8
- dictValueTypeToInteger, equalsObj,
8
+ equalsObj,
9
9
  findRowIndexInListFromAttrName,
10
10
  formatOssUrl, ifNull,
11
11
  isInArray,
@@ -19,7 +19,7 @@ import {
19
19
  setSksTableDataByPage,
20
20
  strIfEmpty,
21
21
  strIsEmpty,
22
- strLength
22
+ strLength, generateUUID, initListVueVirtualUUID, genRowVueVirtualUUID, deepCopy, dictValueTypeToInteger
23
23
  } from "./lib/core";
24
24
  import {newTableColumnList} from "./lib/sks-model-utils";
25
25
  import './lib/style/sks-main.css'
@@ -28,8 +28,9 @@ import {isExternal} from "./lib/validate";
28
28
  import {msgError, msgInfo, msgLoading, msgSuccess} from "./lib/modal";
29
29
  import {resetForm} from "./lib/ref";
30
30
  import {absNumber, negateNumber} from "./lib/sks-number-utils";
31
- import {sksConfig} from "./lib/sksConfig";
31
+ import {request, sksConfig} from "./lib/sksConfig";
32
32
  import {rowStyleElTable} from "./lib/sks-app-utils";
33
+ import {simulateFilterByQueryParams} from "./lib/sks-mock-utils";
33
34
 
34
35
 
35
36
  const sksUtils={
@@ -48,6 +49,7 @@ const sksUtils={
48
49
  safeGetNullEmpty,
49
50
  formatOssUrl,
50
51
  mergeFromObject,
52
+ deepCopy,
51
53
  isInArray,
52
54
  findRowIndexInListFromAttrName,
53
55
  isInvalid,
@@ -65,6 +67,10 @@ const sksUtils={
65
67
  resetSksTableBefore,
66
68
  setSksTableDataByPage,
67
69
  rowStyleElTable,
70
+ generateUUID,
71
+ initListVueVirtualUUID,
72
+ genRowVueVirtualUUID,
73
+ simulateFilterByQueryParams,
68
74
 
69
75
  //modal
70
76
  msgError,
@@ -97,6 +103,18 @@ import SksDictLabelTag from './lib/ui/sks-dict-label-tag/index.js'
97
103
  import SksRightToolbar from './lib/ui/sks-right-toolbar/index.js'
98
104
  import SksTable from './lib/ui/sks-table/index.js'
99
105
  import SksPagination from './lib/ui/sks-pagination/index.js'
106
+ import SksSelectSingleByLookupController from './lib/ui/sks-select-single-by-lookup-controller/index.js'
107
+ import SksSelectMultipleByLookupService from "./lib/ui/sks-select-multiple-by-lookup-controller/index.js";
108
+ import SksFilterParamDateRange from "./lib/ui/filter-param/sks-filter-param-date-range/index.js";
109
+ import SksFilterParamInput from "./lib/ui/filter-param/sks-filter-param-input/index.js";
110
+ import SksFilterParamDictSelect from "./lib/ui/filter-param/sks-filter-param-dict-select/index.js";
111
+ import SksCheckbox from './lib/ui/sks-checkbox/index.js'
112
+ import SksDate from './lib/ui/sks-date/index.js'
113
+ import SksStatusSelect from './lib/ui/sks-status-select/index.js'
114
+ import SksTableQueryFormEl from './lib/ui/sks-table-query-form-el/index.js'
115
+
116
+
117
+
100
118
 
101
119
  const components = [
102
120
  SksButton,
@@ -107,6 +125,15 @@ const components = [
107
125
  SksRightToolbar,
108
126
  SksTable,
109
127
  SksPagination,
128
+ SksSelectSingleByLookupController,
129
+ SksSelectMultipleByLookupService,
130
+ SksFilterParamDateRange,
131
+ SksFilterParamInput,
132
+ SksFilterParamDictSelect,
133
+ SksCheckbox,
134
+ SksDate,
135
+ SksStatusSelect,
136
+ SksTableQueryFormEl,
110
137
  ]
111
138
 
112
139
 
@@ -114,6 +141,9 @@ const install = function(Vue, opts = {}) {
114
141
  components.forEach(component => {
115
142
  Vue.component(component.name, component);
116
143
  });
144
+ Vue.prototype.$SKS_PLUGIN_EL_ERP = {
145
+ request: opts.request||request
146
+ };
117
147
  }
118
148
 
119
149
  /* istanbul ignore if */
@@ -132,4 +162,13 @@ export default {
132
162
  SksRightToolbar,
133
163
  SksTable,
134
164
  SksPagination,
165
+ SksSelectSingleByLookupController,
166
+ SksSelectMultipleByLookupService,
167
+ SksFilterParamDateRange,
168
+ SksFilterParamInput,
169
+ SksFilterParamDictSelect,
170
+ SksCheckbox,
171
+ SksDate,
172
+ SksStatusSelect,
173
+ SksTableQueryFormEl,
135
174
  }
package/lib/core.js CHANGED
@@ -1,8 +1,8 @@
1
-
2
1
  /**
3
2
  * 变更标志
4
3
  * @type {{toBeDelete: 1, toBeAdd: 2, toBeModify: 3}}
5
4
  */
5
+
6
6
  export const CHANGE_BIT_FLAG={
7
7
  //无变更,只做查看
8
8
  none: 0,
@@ -536,7 +536,7 @@ export const defaultSksParamColumnData={
536
536
  prop: undefined,
537
537
  label: undefined,
538
538
  labelWidth: undefined,
539
- clearable: false,
539
+ clearable: true,
540
540
  visible: true,
541
541
  itemStyle: undefined,
542
542
 
@@ -567,46 +567,6 @@ export const defaultSksParamColumnData={
567
567
  }
568
568
 
569
569
 
570
- /**
571
- *
572
- * @param data
573
- * //时间范围查询
574
- * htmlType: `sksFilterParamDateRange`
575
- useTimeBetween: sksParamColumn({
576
- htmlType: `sksFilterParamDateRange`,
577
- //根据map中的key为基准
578
- // prop: `nameLike`,
579
- label: '用餐时间',
580
- }),
581
- * @return {{}}
582
- */
583
- export function sksParamColumn(data){
584
- return mergeFromObject({},defaultSksParamColumnData,data
585
- )
586
- }
587
-
588
- export const defaultSksTableColumnData={
589
- //自定义插槽
590
- slot: undefined,
591
- //属性名
592
- prop: undefined,
593
- label: undefined,
594
- clearable: false,
595
- visible: true,
596
- minWidth: undefined,
597
- align: 'center',
598
- showOverflowTooltip: true,
599
- className: undefined,
600
- //不推荐使用
601
- filters: undefined,
602
-
603
- //页面类型
604
- //none: 自定义
605
- htmlType: '',
606
- //字体颜色
607
- textColor: 'none',
608
- }
609
-
610
570
 
611
571
 
612
572
  export const sksParamsPropConfigAvailableValueTypeOptions= {
@@ -800,301 +760,6 @@ export const availableSksWebDialogPropConfig={
800
760
  },
801
761
  }
802
762
 
803
- //列表可用配置项
804
- export const availableSksWebListPropPropConfig={
805
- slot:{
806
- value: undefined,
807
- name: 'slot',
808
- description: '自定义渲染',
809
- },
810
- align:{
811
- value: 'center',
812
- name: 'align',
813
- description: '对齐方式',
814
- htmlType: 'select',
815
- htmlTypeOptions:[
816
- {
817
- dictValue: 'center',
818
- dictLabel: '居中'
819
- },
820
- {
821
- dictValue: 'left',
822
- dictLabel: '左对齐'
823
- },
824
- {
825
- dictValue: 'right',
826
- dictLabel: '右对齐'
827
- },
828
-
829
- ]
830
- },
831
- width:{
832
- value: undefined,
833
- name: 'width',
834
- description: '固定列宽',
835
- },
836
- minWidth:{
837
- value: undefined,
838
- name: 'minWidth',
839
- description: '最小列宽',
840
- },
841
- htmlType: {
842
- value: '',
843
- name: 'htmlType',
844
- description: '控件类型',
845
- htmlType: 'select',
846
- htmlTypeOptions:[
847
- {
848
- dictValue: '',
849
- dictLabel: '默认(字符)'
850
- },
851
- {
852
- dictValue: 'none',
853
- dictLabel: '自定义'
854
- },
855
- {
856
- dictValue: 'parseTimeYmd',
857
- dictLabel: '只显示年月日'
858
- },
859
- {
860
- dictValue: 'parseTimeMdHm',
861
- dictLabel: '只显示月日时分'
862
- },
863
- {
864
- dictValue: 'parseTimeYmdHm',
865
- dictLabel: '只显示年月日时分'
866
- },
867
- {
868
- dictValue: 'negateNumber',
869
- dictLabel: '数字取反'
870
- },
871
- {
872
- dictValue: 'absNumber',
873
- dictLabel: '数字绝对值'
874
- },
875
- {
876
- dictValue: 'dictFormat',
877
- dictLabel: '显示字典对应的值'
878
- },
879
- {
880
- dictValue: 'dictFormatObject',
881
- dictLabel: '根据字典对象显示带颜色的字典标签(数据处理需要返回字典对象)'
882
- },
883
- {
884
- dictValue: 'textSysUserId',
885
- dictLabel: '显示用户ID对应的姓名'
886
- },
887
- {
888
- dictValue: 'no0InfoYes1Danger',
889
- dictLabel: '加急[0否(灰色)1是(红色)]'
890
- },
891
- {
892
- dictValue: 'unFinish0WarningFinish1Success',
893
- dictLabel: '0未完结,1完结'
894
- },
895
- {
896
- dictValue: 'formatItemFeature',
897
- dictLabel: '物资属性'
898
- },
899
- {
900
- dictValue: 'elImageByImgUrl',
901
- dictLabel: '图片(单字段)'
902
- },
903
-
904
-
905
- ]
906
- },
907
- showOverflowTooltip:{
908
- value: defaultSksTableColumnData.showOverflowTooltip,
909
- name: 'showOverflowTooltip',
910
- description: '当内容过长被隐藏时显示 tooltip',
911
- htmlType: 'select',
912
- valueType: sksParamsPropConfigAvailableValueTypeOptions.boolean.dictValue,
913
- htmlTypeOptions:[
914
- {
915
- dictValue: true,
916
- dictLabel: '是'
917
- },
918
- {
919
- dictValue: false,
920
- dictLabel: '否'
921
- },
922
- ]
923
- },
924
- //字体颜色
925
- textColor:{
926
- value: defaultSksTableColumnData.textColor,
927
- name: 'textColor',
928
- description: '字体颜色',
929
- htmlType: 'select',
930
- valueType: sksParamsPropConfigAvailableValueTypeOptions.string.dictValue,
931
- htmlTypeOptions:[
932
- {
933
- dictValue: 'none',
934
- dictLabel: '默认颜色'
935
- },
936
- {
937
- dictValue: 'red',
938
- dictLabel: '红色'
939
- },
940
- ]
941
- },
942
- }
943
-
944
-
945
- //查询可用配置项
946
- export const availableSksParamsPropConfig={
947
- slot:{
948
- value: undefined,
949
- name: 'slot',
950
- description: '自定义渲染',
951
- },
952
- labelWidth:{
953
- value: undefined,
954
- name: 'labelWidth',
955
- description: '标签宽度',
956
- },
957
- htmlType: {
958
- value: '',
959
- name: 'htmlType',
960
- description: '控件类型',
961
- htmlType: 'select',
962
- htmlTypeOptions:[
963
- {
964
- dictValue: '',
965
- dictLabel: '默认输入框'
966
- },
967
- {
968
- dictValue: 'none',
969
- dictLabel: '自定义'
970
- },
971
- {
972
- dictValue: 'input',
973
- dictLabel: '文本框'
974
- },
975
- // {
976
- // dictValue: 'checkboxGroup',
977
- // dictLabel: '多选框'
978
- // },
979
- {
980
- dictValue: 'checkbox',
981
- dictLabel: '勾选框'
982
- },
983
- {
984
- dictValue: 'sksFilterParamStrRangeYm',
985
- dictLabel: '日期范围(年月-字符串范围搜索)'
986
- },
987
- {
988
- dictValue: 'sksFilterParamDateRange',
989
- dictLabel: '时间范围(年月日)'
990
- },
991
- {
992
- dictValue: 'sksFilterParamDateRangeYmdhms',
993
- dictLabel: '时间范围(年月日时分秒)'
994
- },
995
- {
996
- dictValue: 'shopCategoryEquals',
997
- dictLabel: '商户分类下拉'
998
- },
999
- {
1000
- dictValue: 'companySupperEquals',
1001
- dictLabel: '供应商选择下拉'
1002
- },
1003
- {
1004
- dictValue: 'sysUserIdEquals',
1005
- dictLabel: '人员选择下拉'
1006
- },
1007
- {
1008
- dictValue: 'sysUserIdEqualsZeroIsWaitAssign',
1009
- dictLabel: '人员选择下拉(增加为0时待指派选项)'
1010
- },
1011
- {
1012
- dictValue: 'itemEquals',
1013
- dictLabel: '产品/原材料下拉'
1014
- },
1015
- {
1016
- dictValue: 'unFinish0Finish1',
1017
- dictLabel: '0未完结,1完结'
1018
- },
1019
- {
1020
- dictValue: 'dictFormat',
1021
- dictLabel: '显示字典对应的值'
1022
- },
1023
- {
1024
- dictValue: 'dateFormatYmd',
1025
- dictLabel: '日期格式化'
1026
- },
1027
- ],
1028
- },
1029
- min:{
1030
- value: undefined,
1031
- name: 'min',
1032
- description: '最小值, htmlType=数字形式时有效',
1033
- //如果为空则默认String
1034
- valueType: sksParamsPropConfigAvailableValueTypeOptions.number.dictValue,
1035
- valueTypeOptions:[sksParamsPropConfigAvailableValueTypeOptions.number],
1036
- },
1037
- defaultValue: {
1038
- value: 'undefined',
1039
- name: 'htmlType',
1040
- description: '控件类型',
1041
- htmlType: 'select',
1042
- htmlTypeOptions:[
1043
- {
1044
- dictValue: 'undefined',
1045
- dictLabel: 'undefined'
1046
- },
1047
- {
1048
- dictValue: '',
1049
- dictLabel: '空字符'
1050
- },
1051
- {
1052
- dictValue: '0',
1053
- dictLabel: '数字0'
1054
- },
1055
- ]
1056
- },
1057
- // dictName:{
1058
- // value: '',
1059
- // name: 'dictName',
1060
- // description: '字典名称(控件类型为显示字典值时有效)',
1061
- // hide:()=>{
1062
- // },
1063
- // },
1064
- }
1065
-
1066
- export function sksTableColumn(data){
1067
- return mergeFromObject({},defaultSksTableColumnData,data)
1068
- }
1069
-
1070
- //显示列表属性名称
1071
- export function formatWebListPropConfigDescription(name){
1072
- let tmp=''
1073
- switch (name){
1074
- case 'visible':
1075
- return '是否显示'
1076
- case 'handleDictType':
1077
- return '处理字典类型'
1078
- case 'prop':
1079
- return '属性名'
1080
- case 'label':
1081
- return '标题'
1082
- case 'sksAppId':
1083
- return '配置主键'
1084
- case 'handleValProp':
1085
- return '处理的原属性(为空则使用 prop)'
1086
- case 'handleValType':
1087
- return '数据处理类型'
1088
- default:
1089
- break
1090
- }
1091
- for (let key of Object.keys(availableSksWebListPropPropConfig)) {
1092
- if (name == key) {
1093
- return availableSksWebListPropPropConfig[key].description
1094
- }
1095
- }
1096
- return tmp;
1097
- }
1098
763
 
1099
764
 
1100
765
  export function getSelectTitleByColumnConfig(columnConf) {
@@ -1107,10 +772,14 @@ function columnConfigToSelectTitle(columnConf={}){
1107
772
  const data={}
1108
773
  for (let key of Object.keys(columnConf)) {
1109
774
  let value=columnConf[key]
1110
- if(value.label?.constructor === String){
1111
- data[key]=value.label
1112
- }else{
775
+ if(isNullOrUndefined(value.label)){
1113
776
  data[key]=columnConfigToSelectTitle(value)
777
+ }else{
778
+ if(value.label.constructor === String){
779
+ data[key]=value.label
780
+ }else{
781
+ data[key]=columnConfigToSelectTitle(value)
782
+ }
1114
783
  }
1115
784
  }
1116
785
  return data
@@ -1301,12 +970,12 @@ export function notEmptyAppend(val,prefix,suffix){
1301
970
  return tmp;
1302
971
  }
1303
972
 
1304
- export function initListVueVirtualUUID(list){
973
+ export function initListVueVirtualUUID(list,hasVirtualChangeBitFlag=true,hasIsSet=true){
1305
974
  if(list == undefined){
1306
975
  return [];
1307
976
  }
1308
977
  list.forEach((item,i)=>{
1309
- initRowVueVirtualUUID(item)
978
+ initRowVueVirtualUUID(item,hasVirtualChangeBitFlag,hasIsSet)
1310
979
  })
1311
980
  return list;
1312
981
  }
@@ -1316,18 +985,37 @@ export function initListVueVirtualUUID(list){
1316
985
  * @param item
1317
986
  * @return {*}
1318
987
  */
1319
- export function initRowVueVirtualUUID(item){
1320
- if(isNullOrUndefined(item.virtualChangeBitFlag)){
1321
- item.virtualChangeBitFlag=0
988
+ export function initRowVueVirtualUUID(item,hasVirtualChangeBitFlag=true,hasIsSet=true){
989
+ if(hasVirtualChangeBitFlag){
990
+ if(isNullOrUndefined(item.virtualChangeBitFlag)){
991
+ item.virtualChangeBitFlag=0
992
+ }
1322
993
  }
1323
994
  if(isNullOrUndefined(item.vueVirtualUUID)){
1324
995
  item.vueVirtualUUID=generateUUID();
1325
- item.isSet=false;
996
+ if(hasIsSet){
997
+ item.isSet=false;
998
+ }
1326
999
  }
1327
1000
  return item;
1328
1001
  }
1329
1002
 
1330
1003
 
1004
+ /**
1005
+ * 如果 vueVirtualUUID 不存在则生成
1006
+ * 主要用于组件中 for循环需要一个key
1007
+ * @param item
1008
+ * @return {string} vueVirtualUUID 的值
1009
+ */
1010
+ export function genRowVueVirtualUUID(item){
1011
+ let vueVirtualUUID=item.vueVirtualUUID
1012
+ if(isNullOrUndefined(vueVirtualUUID)){
1013
+ vueVirtualUUID=generateUUID();
1014
+ item.vueVirtualUUID=vueVirtualUUID
1015
+ }
1016
+ return vueVirtualUUID;
1017
+ }
1018
+
1331
1019
  /**
1332
1020
  * 清除属性校验错误信息
1333
1021
  * @param propName