fast-crud-ui3 1.5.16-tsc-beta → 1.5.16

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 (168) hide show
  1. package/lib/fast-crud-ui3.cjs.js +7 -7
  2. package/lib/fast-crud-ui3.es.js +1960 -2003
  3. package/lib/fast-crud-ui3.umd.js +7 -7
  4. package/lib/style.css +1 -1
  5. package/package.json +5 -18
  6. package/lib/assets/fonts/iconfont.d.ts +0 -0
  7. package/lib/components/checkbox-group/index.d.ts +0 -2
  8. package/lib/components/checkbox-group/src/fast-checkbox-group.d.ts +0 -72
  9. package/lib/components/content-dialog/index.d.ts +0 -2
  10. package/lib/components/content-dialog/src/fast-cell-content.d.ts +0 -83
  11. package/lib/components/json-viewer/index.d.ts +0 -2
  12. package/lib/components/json-viewer/src/fast-json-viewer.d.ts +0 -48
  13. package/lib/components/mapping.d.ts +0 -5
  14. package/lib/components/object-picker/index.d.ts +0 -2
  15. package/lib/components/object-picker/src/fast-object-picker.d.ts +0 -132
  16. package/lib/components/select/index.d.ts +0 -2
  17. package/lib/components/select/src/fast-select.d.ts +0 -83
  18. package/lib/components/table/index.d.ts +0 -2
  19. package/lib/components/table/src/RowConfirm.d.ts +0 -39
  20. package/lib/components/table/src/dynamic-filter-form.d.ts +0 -118
  21. package/lib/components/table/src/dynamic-filter-list.d.ts +0 -57
  22. package/lib/components/table/src/easy-filter.d.ts +0 -118
  23. package/lib/components/table/src/export-confirm.d.ts +0 -12
  24. package/lib/components/table/src/quick-filter-form.d.ts +0 -42
  25. package/lib/components/table/src/row-form.d.ts +0 -33
  26. package/lib/components/table/src/stored-filter-manager.d.ts +0 -55
  27. package/lib/components/table/src/stored-filter.d.ts +0 -37
  28. package/lib/components/table/src/table-head-cell.d.ts +0 -9
  29. package/lib/components/table/src/table.d.ts +0 -497
  30. package/lib/components/table/src/util.d.ts +0 -77
  31. package/lib/components/table-column/config.d.ts +0 -5
  32. package/lib/components/table-column/index.d.ts +0 -2
  33. package/lib/components/table-column/src/table-column.d.ts +0 -256
  34. package/lib/components/table-column-date-picker/config.d.ts +0 -5
  35. package/lib/components/table-column-date-picker/index.d.ts +0 -2
  36. package/lib/components/table-column-date-picker/src/table-column-date-picker.d.ts +0 -173
  37. package/lib/components/table-column-file/config.d.ts +0 -5
  38. package/lib/components/table-column-file/index.d.ts +0 -2
  39. package/lib/components/table-column-file/src/table-column-file.d.ts +0 -285
  40. package/lib/components/table-column-img/config.d.ts +0 -5
  41. package/lib/components/table-column-img/index.d.ts +0 -2
  42. package/lib/components/table-column-img/src/table-column-img.d.ts +0 -285
  43. package/lib/components/table-column-input/config.d.ts +0 -5
  44. package/lib/components/table-column-input/index.d.ts +0 -2
  45. package/lib/components/table-column-input/src/table-column-input.d.ts +0 -173
  46. package/lib/components/table-column-number/config.d.ts +0 -5
  47. package/lib/components/table-column-number/index.d.ts +0 -2
  48. package/lib/components/table-column-number/src/table-column-number.d.ts +0 -173
  49. package/lib/components/table-column-object/config.d.ts +0 -5
  50. package/lib/components/table-column-object/index.d.ts +0 -2
  51. package/lib/components/table-column-object/src/table-column-object.d.ts +0 -315
  52. package/lib/components/table-column-select/config.d.ts +0 -5
  53. package/lib/components/table-column-select/index.d.ts +0 -2
  54. package/lib/components/table-column-select/src/table-column-select.d.ts +0 -276
  55. package/lib/components/table-column-switch/config.d.ts +0 -5
  56. package/lib/components/table-column-switch/index.d.ts +0 -2
  57. package/lib/components/table-column-switch/src/table-column-switch.d.ts +0 -175
  58. package/lib/components/table-column-textarea/config.d.ts +0 -5
  59. package/lib/components/table-column-textarea/index.d.ts +0 -2
  60. package/lib/components/table-column-textarea/src/table-column-textarea.d.ts +0 -173
  61. package/lib/components/table-column-time-picker/config.d.ts +0 -5
  62. package/lib/components/table-column-time-picker/index.d.ts +0 -2
  63. package/lib/components/table-column-time-picker/src/table-column-time-picker.d.ts +0 -173
  64. package/lib/components/upload/index.d.ts +0 -2
  65. package/lib/components/upload/src/fast-upload.d.ts +0 -120
  66. package/lib/global.d.ts +0 -42
  67. package/lib/index.d.ts +0 -56
  68. package/lib/mixins/table-column.d.ts +0 -104
  69. package/lib/mixins/upload.d.ts +0 -15
  70. package/lib/model/cond.d.ts +0 -25
  71. package/lib/model/editComponentConfig.d.ts +0 -25
  72. package/lib/model/fastTableOption.d.ts +0 -355
  73. package/lib/model/filterComponentConfig.d.ts +0 -57
  74. package/lib/model/opt.d.ts +0 -20
  75. package/lib/model/order.d.ts +0 -7
  76. package/lib/model/pageQuery.d.ts +0 -23
  77. package/lib/model/query.d.ts +0 -33
  78. package/lib/model/rel.d.ts +0 -5
  79. package/lib/util/cache.d.ts +0 -17
  80. package/lib/util/dialog.d.ts +0 -49
  81. package/lib/util/escape.d.ts +0 -7
  82. package/lib/util/http.d.ts +0 -8
  83. package/lib/util/pick.d.ts +0 -14
  84. package/lib/util/util.d.ts +0 -252
  85. package/packages/assets/fonts/iconfont.css +0 -163
  86. package/packages/assets/fonts/iconfont.js +0 -1
  87. package/packages/assets/fonts/iconfont.ttf +0 -0
  88. package/packages/assets/fonts/iconfont.woff +0 -0
  89. package/packages/assets/fonts/iconfont.woff2 +0 -0
  90. package/packages/components/checkbox-group/index.js +0 -7
  91. package/packages/components/checkbox-group/src/fast-checkbox-group.vue +0 -83
  92. package/packages/components/content-dialog/index.js +0 -7
  93. package/packages/components/content-dialog/src/fast-cell-content.vue +0 -115
  94. package/packages/components/json-viewer/index.js +0 -7
  95. package/packages/components/json-viewer/src/fast-json-viewer.vue +0 -54
  96. package/packages/components/mapping.js +0 -95
  97. package/packages/components/object-picker/index.js +0 -7
  98. package/packages/components/object-picker/src/fast-object-picker.vue +0 -170
  99. package/packages/components/select/index.js +0 -7
  100. package/packages/components/select/src/fast-select.vue +0 -89
  101. package/packages/components/table/index.js +0 -7
  102. package/packages/components/table/src/RowConfirm.vue +0 -87
  103. package/packages/components/table/src/dynamic-filter-form.vue +0 -253
  104. package/packages/components/table/src/dynamic-filter-list.vue +0 -172
  105. package/packages/components/table/src/easy-filter.vue +0 -129
  106. package/packages/components/table/src/export-confirm.vue +0 -55
  107. package/packages/components/table/src/quick-filter-form.vue +0 -140
  108. package/packages/components/table/src/row-form.vue +0 -137
  109. package/packages/components/table/src/stored-filter-manager.vue +0 -240
  110. package/packages/components/table/src/stored-filter.vue +0 -180
  111. package/packages/components/table/src/table-head-cell.vue +0 -41
  112. package/packages/components/table/src/table.vue +0 -1309
  113. package/packages/components/table/src/util.js +0 -496
  114. package/packages/components/table-column/config.js +0 -64
  115. package/packages/components/table-column/index.js +0 -7
  116. package/packages/components/table-column/src/table-column.vue +0 -44
  117. package/packages/components/table-column-date-picker/config.js +0 -139
  118. package/packages/components/table-column-date-picker/index.js +0 -7
  119. package/packages/components/table-column-date-picker/src/table-column-date-picker.vue +0 -54
  120. package/packages/components/table-column-file/config.js +0 -83
  121. package/packages/components/table-column-file/index.js +0 -7
  122. package/packages/components/table-column-file/src/table-column-file.vue +0 -79
  123. package/packages/components/table-column-img/config.js +0 -83
  124. package/packages/components/table-column-img/index.js +0 -7
  125. package/packages/components/table-column-img/src/table-column-img.vue +0 -82
  126. package/packages/components/table-column-input/config.js +0 -77
  127. package/packages/components/table-column-input/index.js +0 -7
  128. package/packages/components/table-column-input/src/table-column-input.vue +0 -60
  129. package/packages/components/table-column-number/config.js +0 -89
  130. package/packages/components/table-column-number/index.js +0 -7
  131. package/packages/components/table-column-number/src/table-column-number.vue +0 -54
  132. package/packages/components/table-column-object/config.js +0 -66
  133. package/packages/components/table-column-object/index.js +0 -7
  134. package/packages/components/table-column-object/src/table-column-object.vue +0 -75
  135. package/packages/components/table-column-select/config.js +0 -66
  136. package/packages/components/table-column-select/index.js +0 -7
  137. package/packages/components/table-column-select/src/table-column-select.vue +0 -101
  138. package/packages/components/table-column-switch/config.js +0 -55
  139. package/packages/components/table-column-switch/index.js +0 -7
  140. package/packages/components/table-column-switch/src/table-column-switch.vue +0 -82
  141. package/packages/components/table-column-textarea/config.js +0 -77
  142. package/packages/components/table-column-textarea/index.js +0 -7
  143. package/packages/components/table-column-textarea/src/table-column-textarea.vue +0 -56
  144. package/packages/components/table-column-time-picker/config.js +0 -62
  145. package/packages/components/table-column-time-picker/index.js +0 -7
  146. package/packages/components/table-column-time-picker/src/table-column-time-picker.vue +0 -53
  147. package/packages/components/upload/index.js +0 -7
  148. package/packages/components/upload/src/fast-upload.vue +0 -272
  149. package/packages/global.d.ts +0 -42
  150. package/packages/index.js +0 -145
  151. package/packages/mixins/table-column.js +0 -133
  152. package/packages/mixins/upload.js +0 -14
  153. package/packages/model/cond.js +0 -65
  154. package/packages/model/editComponentConfig.js +0 -72
  155. package/packages/model/fastTableOption.js +0 -538
  156. package/packages/model/filterComponentConfig.js +0 -185
  157. package/packages/model/opt.js +0 -21
  158. package/packages/model/order.js +0 -16
  159. package/packages/model/pageQuery.js +0 -31
  160. package/packages/model/query.js +0 -93
  161. package/packages/model/rel.js +0 -5
  162. package/packages/style.scss +0 -5
  163. package/packages/util/cache.js +0 -92
  164. package/packages/util/dialog.js +0 -133
  165. package/packages/util/escape.js +0 -34
  166. package/packages/util/http.js +0 -18
  167. package/packages/util/pick.js +0 -92
  168. package/packages/util/util.js +0 -833
@@ -1,139 +0,0 @@
1
- import {isUndefined, merge, ternary} from "../../util/util";
2
- import Cond from '../../model/cond.js'
3
- import Opt from '../../model/opt.js'
4
-
5
- const DEFAULT_DATE_FORMAT = 'YYYY-MM-DD'
6
- const DEFAULT_DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
7
- const defaultQueryConfig = {
8
- component: 'el-date-picker',
9
- opt: Opt.BTW,
10
- val: [], // 默认值
11
- props: {
12
- type: `daterange`,
13
- clearable: true,
14
- valueFormat: DEFAULT_DATE_FORMAT,
15
- // (易用性提升)
16
- shortcuts: [{
17
- text: '最近1h',
18
- value: () => {
19
- const end = new Date()
20
- const start = new Date(end)
21
- start.setTime(start.getTime() - 3600 * 1000)
22
- return [start, end]
23
- }
24
- }, {
25
- text: '最近1天',
26
- value: () => {
27
- const end = new Date()
28
- const start = new Date(end)
29
- start.setTime(start.getTime() - 3600 * 1000 * 24)
30
- return [start, end]
31
- }
32
- }, {
33
- text: '最近1周',
34
- value: () => {
35
- const end = new Date()
36
- const start = new Date()
37
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
38
- return [start, end]
39
- }
40
- }, {
41
- text: '最近1月',
42
- value: () => {
43
- const end = new Date()
44
- const start = new Date()
45
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
46
- return [start, end]
47
- }
48
- }, {
49
- text: '最近3月',
50
- value: () => {
51
- const end = new Date()
52
- const start = new Date()
53
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
54
- return [start, end]
55
- }
56
- }, {
57
- text: '最近1年',
58
- value: () => {
59
- const end = new Date()
60
- const start = new Date(end)
61
- start.setFullYear(end.getFullYear() - 1)
62
- return [start, end]
63
- }
64
- }]
65
- },
66
- condMapFn: (cond) => {
67
- const conds = []
68
- const [start, end] = cond.val
69
- if (start) {
70
- conds.push(new Cond(cond.col, Opt.GE, start))
71
- }
72
- if (end) {
73
- conds.push(new Cond(cond.col, Opt.LE, end))
74
- }
75
- return conds
76
- }
77
-
78
- }
79
- const defaultEditConfig = {
80
- component: 'el-date-picker',
81
- opt: Opt.BTW,
82
- val: null, // 默认值
83
- props: {
84
- type: "date",
85
- clearable: true,
86
- valueFormat: DEFAULT_DATE_FORMAT,
87
- class: 'fc-table-inline-edit-component',
88
- editable: true,
89
- rules: []
90
- }
91
- }
92
-
93
- export default {
94
- query: (config, type) => {
95
- let val = defaultQueryConfig.val;
96
- const {props: {defaultVal, ...validProps} = {}} = config
97
- const {type: dateType = 'date'} = validProps;
98
- if (type === 'quick') {
99
- val = ternary(isUndefined(defaultVal), val, defaultVal);
100
- }
101
- if (type === 'dynamic' || type === 'stored') {
102
- validProps.teleported = false // 防止动筛二选时popover关闭
103
- }
104
- const {valueFormat} = validProps;
105
- if (config.props.type === 'datetime') {
106
- if (isUndefined(valueFormat)) {
107
- validProps.valueFormat = DEFAULT_DATETIME_FORMAT;
108
- }
109
- // 限定时分秒的默认区间值(易用性提升)
110
- validProps.defaultTime = [
111
- new Date(0, 0, 0, 0, 0 ,0, 0),
112
- new Date(0, 0, 0, 23, 59, 59, 999)]
113
- }
114
- config.val = val;
115
- config.props = {
116
- ...validProps,
117
- type: `${dateType}range`
118
- }
119
- return merge(config, defaultQueryConfig, true, false)
120
- },
121
- edit: (config, type) => {
122
- const {label, props: {defaultVal, ...validProps} = {}} = config;
123
- const {rules = []} = validProps;
124
- // 如果含有值不为false的required属性, 则将其转换为rules规则添加到props中
125
- if (validProps.hasOwnProperty('required') && validProps.required !== false) {
126
- rules.push({required: true, message: `${label}不能为空`})
127
- }
128
- config.val = ternary(isUndefined(defaultVal), defaultEditConfig.val, defaultVal);
129
- const {valueFormat} = validProps;
130
- if (config.props.type === 'datetime' && isUndefined(valueFormat)) {
131
- validProps.valueFormat = DEFAULT_DATETIME_FORMAT;
132
- }
133
- config.props = {
134
- ...validProps,
135
- rules: rules
136
- }
137
- return merge(config, defaultEditConfig, true, false)
138
- }
139
- }
@@ -1,7 +0,0 @@
1
- import FastTableColumnDatePicker from './src/table-column-date-picker.vue'
2
-
3
- FastTableColumnDatePicker.install = (app) => {
4
- app.component(FastTableColumnDatePicker.name, FastTableColumnDatePicker)
5
- }
6
-
7
- export default FastTableColumnDatePicker
@@ -1,54 +0,0 @@
1
- <template>
2
- <el-table-column class-name="fc-table-column"
3
- :prop="prop"
4
- :label="label"
5
- :min-width="minWidth"
6
- :show-overflow-tooltip="showOverflowTooltip"
7
- v-bind="$attrs"
8
- v-if="!hidden">
9
- <template #header="{column, $index}">
10
- <fast-table-head-cell :column="columnProp" @click="headCellClick(column)">
11
- <slot name="header" v-bind:column="column" v-bind:$index="$index">
12
- <span>{{ label }}</span>
13
- </slot>
14
- </fast-table-head-cell>
15
- </template>
16
-
17
- <template #default="{row, column, $index}">
18
- <slot v-bind:row="row" v-bind:column="column" v-bind:$index="$index">
19
- <div v-if="!canEdit(row, column, $index)">
20
- <slot name="normal" v-bind:row="row" v-bind:column="column" v-bind:$index="$index">
21
- <fast-cell-content :value="showLabel(row)" :fat-row="row" :show-length="showLength" :linkTo="link"/>
22
- </slot>
23
- </div>
24
- <slot name="edit" v-bind:row="row" v-bind:column="column" v-bind:$index="$index" v-else>
25
- <el-date-picker v-model="row['editRow'][prop]"
26
- v-bind="row['config'][prop]['props']"
27
- :ref="prop + $index"
28
- @change="(val) => handleChange(val, {row, column, $index})"
29
- @blur="(event) => handleBlur(event, {row, column, $index})"
30
- @focus="(event) => handleFocus(event, {row, column, $index})"/>
31
- </slot>
32
- </slot>
33
- </template>
34
- </el-table-column>
35
- </template>
36
-
37
- <script>
38
- import tableColumn from "../../../mixins/table-column"
39
-
40
- export default {
41
- name: "FastTableColumnDatePicker",
42
- mixins: [tableColumn],
43
- props: {
44
- minWidth: {
45
- type: String,
46
- default: () => '150px'
47
- }
48
- }
49
- }
50
- </script>
51
-
52
- <style scoped>
53
-
54
- </style>
@@ -1,83 +0,0 @@
1
- import {
2
- addStartWith,
3
- easyOptParse,
4
- isUndefined,
5
- merge,
6
- ternary
7
- } from "../../util/util";
8
- import Opt from "../../model/opt.js"
9
-
10
- const defaultQueryConfig = {
11
- component: 'el-input',
12
- opt: Opt.LIKE,
13
- val: null, // 默认值
14
- props: {
15
- clearable: true,
16
- placeholder: '请输入文件名...'
17
- },
18
- condMapFn: (cond) => {
19
- const operators = {
20
- '^!=': {
21
- opt: Opt.NE,
22
- valExtract: (cond) => cond.val.substring(2)
23
- },
24
- '^=': {
25
- opt: Opt.EQ,
26
- valExtract: (cond) => cond.val.substring(1)
27
- },
28
- '^~': {
29
- opt: Opt.NLIKE,
30
- valExtract: (cond) => cond.val.substring(1)
31
- },
32
- '^\\*': {
33
- opt: Opt.LLIKE,
34
- valExtract: (cond) => cond.val.substring(1)
35
- },
36
- '\\*$': {
37
- opt: Opt.RLIKE,
38
- valExtract: (cond) => cond.val.substring(0, cond.val.length - 1)
39
- }
40
- }
41
- easyOptParse(cond, operators)
42
- return [cond]
43
- }
44
- }
45
- const defaultEditConfig = {
46
- component: 'fast-upload',
47
- val: null,
48
- props: {
49
- action: '/',
50
- 'list-type': 'text',
51
- class: 'fc-table-inline-edit-component',
52
- multiple: false, // 默认单选文件
53
- editable: true
54
- }
55
- }
56
- export default {
57
- query: (config, type) => {
58
- let val = defaultQueryConfig.val;
59
- const {props: {defaultVal, ...validProps} = {}} = config
60
- if (type === 'quick') {
61
- val = ternary(isUndefined(defaultVal), val, defaultVal);
62
- }
63
- config.val = val;
64
- config.props = validProps;
65
- return merge(config, defaultQueryConfig, true, false)
66
- },
67
- edit: (config, type, tableOption) => {
68
- const {label, props = {}} = config;
69
- const {defaultVal, rules = [], ...validProps} = props;
70
- if (validProps.hasOwnProperty('required') && validProps.required !== false) {
71
- rules.push({required: true, message: `${label}不能为空`})
72
- }
73
- config.val = ternary(isUndefined(defaultVal), defaultEditConfig.val, defaultVal)
74
- config.props = {
75
- ...validProps,
76
- rules: rules
77
- }
78
- const finalConfig = merge(config, defaultEditConfig, true, false);
79
- finalConfig.props.action = addStartWith(tableOption.uploadUrl, '/');
80
- finalConfig.props.listType = 'text'; // 固定避免被自定义覆盖
81
- return finalConfig;
82
- }
83
- }
@@ -1,7 +0,0 @@
1
- import FastTableColumnFile from './src/table-column-file.vue'
2
-
3
- FastTableColumnFile.install = (app) => {
4
- app.component(FastTableColumnFile.name, FastTableColumnFile)
5
- }
6
-
7
- export default FastTableColumnFile
@@ -1,79 +0,0 @@
1
- <template>
2
- <el-table-column class-name="fc-table-column"
3
- :prop="prop"
4
- :label="label"
5
- :min-width="minWidth"
6
- :show-overflow-tooltip="showOverflowTooltip"
7
- v-bind="$attrs"
8
- v-if="!hidden">
9
- <template #header="{column, $index}">
10
- <fast-table-head-cell :column="columnProp" @click="headCellClick(column)">
11
- <slot name="header" v-bind:column="column" v-bind:$index="$index">
12
- <span>{{ label }}</span>
13
- </slot>
14
- </fast-table-head-cell>
15
- </template>
16
-
17
- <template #default="{row, column, $index}">
18
- <slot v-bind:row="row" v-bind:column="column" v-bind:$index="$index">
19
- <template v-if="!canEdit(row, column, $index)">
20
- <slot name="normal" v-bind:row="row" v-bind:column="column" v-bind:$index="$index">
21
- <fast-upload v-model="row[row.status === 'normal' ? 'row' : 'editRow'][prop]"
22
- v-bind="row['config'][prop]['props']"
23
- list-type="text"
24
- :disabled="true"
25
- class="fc-fast-upload-file"></fast-upload>
26
- </slot>
27
- </template>
28
- <slot name="edit" v-bind:row="row" v-bind:column="column" v-bind:$index="$index" v-else>
29
- <fast-upload v-model="row['editRow'][prop]"
30
- :data="{row: JSON.stringify(row['editRow']), col: prop}"
31
- v-bind="row['config'][prop]['props']"
32
- :ref="prop + $index"
33
- :on-preview="(file) => onPreview(file, {row, column, $index})"
34
- :before-remove="(file, files) => handleBeforeRemove(file, files, {row, column, $index})"
35
- :on-remove="(file, files) => isFunction(onRemove) ? onRemove(file, files, {row, column, $index}) : null"
36
- :response-handler="(response, file, files) => isFunction(responseHandler) ? responseHandler(response, file, files, {row, column, $index}) : response"
37
- :on-success="(response, file, files) => isFunction(onSuccess) ? onSuccess(response, file, files, {row, column, $index}) : null"
38
- :on-progress="(event ,file, files) => isFunction(onProgress) ? onProgress(event, file, files, {row, column, $index}) : null"
39
- :on-change="(file, files) => isFunction(onChange) ? onChange(file, files, {row, column, $index}) : null"
40
- :on-exceed="(file, files) => isFunction(onExceed) ? onExceed(file, files, {row, column, $index}) : null"
41
- class="fc-fast-upload-file"/>
42
- </slot>
43
- </slot>
44
- </template>
45
- </el-table-column>
46
- </template>
47
-
48
- <script>
49
- import FastUpload from "../../upload/src/fast-upload.vue"
50
- import tableColumn from "../../../mixins/table-column"
51
- import UploadMixin from "../../../mixins/upload.js"
52
- import {isFunction} from "../../../util/util.js"
53
-
54
- export default {
55
- name: "FastTableColumnFile",
56
- components: {FastUpload},
57
- mixins: [tableColumn, UploadMixin],
58
- props: {
59
- minWidth: {
60
- type: String,
61
- default: () => '300px'
62
- },
63
- },
64
- methods: {
65
- isFunction,
66
- handleBeforeRemove(file, files, scope) {
67
- return isFunction(this.beforeRemove) ? this.beforeRemove(file, files, scope) : Promise.resolve(true) // Promise在模版中不识别?
68
- }
69
- }
70
- }
71
- </script>
72
-
73
- <style scoped lang="scss">
74
- .fc-fast-upload-file {
75
- display: flex;
76
- flex-direction: column;
77
- justify-content: center;
78
- }
79
- </style>
@@ -1,83 +0,0 @@
1
- import {
2
- addStartWith,
3
- easyOptParse,
4
- isUndefined,
5
- merge,
6
- ternary
7
- } from "../../util/util";
8
- import Opt from "../../model/opt.js"
9
-
10
- const defaultQueryConfig = {
11
- component: 'el-input',
12
- opt: Opt.LIKE,
13
- val: null, // 默认值
14
- props: {
15
- clearable: true
16
- },
17
- condMapFn: (cond) => {
18
- const operators = {
19
- '^!=': {
20
- opt: Opt.NE,
21
- valExtract: (cond) => cond.val.substring(2)
22
- },
23
- '^=': {
24
- opt: Opt.EQ,
25
- valExtract: (cond) => cond.val.substring(1)
26
- },
27
- '^~': {
28
- opt: Opt.NLIKE,
29
- valExtract: (cond) => cond.val.substring(1)
30
- },
31
- '^\\*': {
32
- opt: Opt.LLIKE,
33
- valExtract: (cond) => cond.val.substring(1)
34
- },
35
- '\\*$': {
36
- opt: Opt.RLIKE,
37
- valExtract: (cond) => cond.val.substring(0, cond.val.length - 1)
38
- }
39
- }
40
- easyOptParse(cond, operators)
41
- return [cond]
42
- }
43
- }
44
- const defaultEditConfig = {
45
- component: 'fast-upload',
46
- val: null,
47
- props: {
48
- action: '/',
49
- listType: 'picture-card',
50
- accept: 'image/*',
51
- class: 'fc-table-inline-edit-component',
52
- multiple: false, // 默认单选文件
53
- editable: true
54
- }
55
- }
56
- export default {
57
- query: (config, type) => {
58
- let val = defaultQueryConfig.val;
59
- const {props: {defaultVal, ...validProps} = {}} = config
60
- if (type === 'quick') {
61
- val = ternary(isUndefined(defaultVal), val, defaultVal);
62
- }
63
- config.val = val;
64
- config.props = validProps;
65
- return merge(config, defaultQueryConfig, true, false)
66
- },
67
- edit: (config, type, tableOption) => {
68
- const {label, props = {}} = config;
69
- const {defaultVal, rules = [], ...validProps} = props;
70
- if (validProps.hasOwnProperty('required') && validProps.required !== false) {
71
- rules.push({required: true, message: `${label}不能为空`})
72
- }
73
- config.val = ternary(isUndefined(defaultVal), defaultEditConfig.val, defaultVal)
74
- config.props = {
75
- ...validProps,
76
- rules: rules
77
- }
78
- const finalConfig = merge(config, defaultEditConfig, true, false);
79
- finalConfig.props.action = addStartWith(tableOption.uploadUrl, '/');
80
- finalConfig.props.listType = 'picture-card'; // 固定避免被自定义覆盖
81
- return finalConfig;
82
- }
83
- }
@@ -1,7 +0,0 @@
1
- import FastTableColumnImg from './src/table-column-img.vue'
2
-
3
- FastTableColumnImg.install = (app) => {
4
- app.component(FastTableColumnImg.name, FastTableColumnImg)
5
- }
6
-
7
- export default FastTableColumnImg
@@ -1,82 +0,0 @@
1
- <template>
2
- <el-table-column class-name="fc-table-column"
3
- :prop="prop"
4
- :label="label"
5
- :min-width="minWidth"
6
- :show-overflow-tooltip="showOverflowTooltip"
7
- v-bind="$attrs"
8
- v-if="!hidden">
9
- <template #header="{column, $index}">
10
- <fast-table-head-cell :column="columnProp" @click="headCellClick(column)">
11
- <slot name="header" v-bind:column="column" v-bind:$index="$index">
12
- <span>{{ label }}</span>
13
- </slot>
14
- </fast-table-head-cell>
15
- </template>
16
-
17
- <template #default="{row, column, $index}">
18
- <slot v-bind:row="row" v-bind:column="column" v-bind:$index="$index">
19
- <template v-if="!canEdit(row, column, $index)">
20
- <slot name="normal" v-bind:row="row" v-bind:column="column" v-bind:$index="$index">
21
- <fast-upload v-model="row[row.status === 'normal' ? 'row' : 'editRow'][prop]"
22
- v-bind="row['config'][prop]['props']"
23
- list-type="picture-card"
24
- :disabled="true"></fast-upload>
25
- </slot>
26
- </template>
27
- <slot name="edit" v-bind:row="row" v-bind:column="column" v-bind:$index="$index" v-else>
28
- <fast-upload v-model="row['editRow'][prop]"
29
- v-bind="row['config'][prop]['props']"
30
- :data="{row: JSON.stringify(row['editRow']), col: prop}"
31
- :ref="prop + $index"
32
- :on-preview="(file) => onPreview(file, {row, column, $index})"
33
- :before-remove="(file, files) => handleBeforeRemove(file, files, {row, column, $index})"
34
- :on-remove="(file, files) => isFunction(onRemove) ? onRemove(file, files, {row, column, $index}) : null"
35
- :response-handler="(response, file, files) => isFunction(responseHandler) ? responseHandler(response, file, files, {row, column, $index}) : response"
36
- :on-success="(response, file, files) => isFunction(onSuccess) ? onSuccess(response, file, files, {row, column, $index}) : null"
37
- :on-progress="(event ,file, files) => isFunction(onProgress) ? onProgress(event, file, files, {row, column, $index}) : null"
38
- :on-change="(file, files) => isFunction(onChange) ? onChange(file, files, {row, column, $index}) : null"
39
- :on-exceed="(file, files) => isFunction(onExceed) ? onExceed(file, files, {row, column, $index}) : null"
40
- />
41
- </slot>
42
- </slot>
43
- </template>
44
- </el-table-column>
45
- </template>
46
-
47
- <script>
48
- import FastUpload from "../../upload/src/fast-upload.vue";
49
- import tableColumn from "../../../mixins/table-column";
50
- import UploadMixin from "../../../mixins/upload.js";
51
- import {isFunction} from "../../../util/util.js";
52
-
53
- export default {
54
- name: "FastTableColumnImg",
55
- components: {FastUpload},
56
- mixins: [tableColumn, UploadMixin],
57
- props: {
58
- minWidth: {
59
- type: String,
60
- default: () => '100px'
61
- },
62
- },
63
- methods: {
64
- isFunction,
65
- handleBeforeRemove(file, files, scope) {
66
- return isFunction(this.beforeRemove) ? this.beforeRemove(file, files, scope) : Promise.resolve(true) // Promise在模版中不识别?
67
- }
68
- }
69
- }
70
- </script>
71
-
72
- <style scoped lang="scss">
73
- .img-list {
74
- display: flex;
75
- flex-wrap: wrap;
76
- padding: 3px 0;
77
- }
78
-
79
- img {
80
- object-fit: cover;
81
- }
82
- </style>
@@ -1,77 +0,0 @@
1
- import {easyOptParse, isUndefined, merge, ternary} from "../../util/util";
2
- import Opt from "../../model/opt.js";
3
-
4
- const defaultQueryConfig = {
5
- component: 'el-input',
6
- opt: Opt.LIKE,
7
- val: null, // 默认值
8
- props: {
9
- clearable: true,
10
- placeholder: '请输入..'
11
- },
12
- condMapFn: (cond) => {
13
- const operators = {
14
- '^!=': {
15
- opt: Opt.NE,
16
- valExtract: (cond) => cond.val.substring(2)
17
- },
18
- '^=': {
19
- opt: Opt.EQ,
20
- valExtract: (cond) => cond.val.substring(1)
21
- },
22
- '^~': {
23
- opt: Opt.NLIKE,
24
- valExtract: (cond) => cond.val.substring(1)
25
- },
26
- '^\\*': {
27
- opt: Opt.LLIKE,
28
- valExtract: (cond) => cond.val.substring(1)
29
- },
30
- '\\*$': {
31
- opt: Opt.RLIKE,
32
- valExtract: (cond) => cond.val.substring(0, cond.val.length - 1)
33
- }
34
- }
35
- easyOptParse(cond, operators)
36
- return [cond]
37
- }
38
- }
39
-
40
- const defaultEditConfig = {
41
- component: 'el-input',
42
- val: null,
43
- props: {
44
- clearable: true,
45
- class: 'fc-table-inline-edit-component',
46
- editable: true,
47
- rules: []
48
- }
49
- }
50
-
51
- export default {
52
- query: (config, type) => {
53
- let val = defaultQueryConfig.val;
54
- const {props: {defaultVal, ...validProps} = {}} = config
55
- if (type === 'quick') {
56
- val = ternary(isUndefined(defaultVal), val, defaultVal);
57
- }
58
- config.val = val;
59
- config.props = validProps;
60
- return merge(config, defaultQueryConfig, true, false)
61
- },
62
- edit: (config, type) => {
63
- const {label, props = {}} = config;
64
- const {defaultVal, rules = [], ...validProps} = props;
65
- // 如果含有值不为false的required属性, 则将其转换为rules规则添加到props中
66
- if (validProps.hasOwnProperty('required') && validProps.required !== false) {
67
- rules.push({required: true, message: `${label}不能为空`})
68
- }
69
- config.val = ternary(isUndefined(defaultVal), defaultEditConfig.val, defaultVal);
70
- config.props = {
71
- ...validProps,
72
- rules: rules
73
- }
74
- return merge(config, defaultEditConfig, true, false)
75
- }
76
-
77
- }
@@ -1,7 +0,0 @@
1
- import FastTableColumnInput from './src/table-column-input.vue'
2
-
3
- FastTableColumnInput.install = (app) => {
4
- app.component(FastTableColumnInput.name, FastTableColumnInput)
5
- }
6
-
7
- export default FastTableColumnInput