@tongfun/tf-widget 0.1.19 → 0.1.20

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 (96) hide show
  1. package/README.md +46 -42
  2. package/lib/tf-widget.common.1.js +1 -1
  3. package/lib/tf-widget.common.js +472 -455
  4. package/lib/tf-widget.css +1 -1
  5. package/lib/tf-widget.umd.1.js +1 -1
  6. package/lib/tf-widget.umd.js +472 -455
  7. package/lib/tf-widget.umd.min.js +3 -3
  8. package/package/svg-icon/index.js +8 -8
  9. package/package/svg-icon/src/SvgIcon.vue +59 -59
  10. package/package/t-data-list/index.js +6 -6
  11. package/package/t-data-list/main.vue +193 -193
  12. package/package/t-data-list/src/condition-input/basic.vue +31 -31
  13. package/package/t-data-list/src/condition-input/date.vue +106 -106
  14. package/package/t-data-list/src/condition-input/index.vue +100 -100
  15. package/package/t-data-list/src/condition-input/input.vue +31 -31
  16. package/package/t-data-list/src/condition-input/number.vue +115 -115
  17. package/package/t-data-list/src/condition-input/select.vue +86 -86
  18. package/package/t-data-list/src/js/fieldTypeEnum.js +10 -10
  19. package/package/t-data-list/src/js/operatorEnum.js +108 -108
  20. package/package/t-data-list/src/js/qureyParamsEnum.js +4 -4
  21. package/package/t-data-list/src/js/util.js +34 -34
  22. package/package/t-data-list/src/mixins/button-controll-mixin.js +93 -93
  23. package/package/t-data-list/src/pushdown/push-down.vue +158 -158
  24. package/package/t-data-list/src/t-list-search.vue +36 -36
  25. package/package/t-data-list/src/t-plan/condition-always-item.vue +143 -143
  26. package/package/t-data-list/src/t-plan/condition-mult-item.vue +222 -222
  27. package/package/t-data-list/src/t-plan/index.vue +195 -195
  28. package/package/t-data-list/src/t-plan/plan-content.vue +389 -389
  29. package/package/t-data-list/src/t-table/index.vue +129 -129
  30. package/package/t-data-list/src/t-table/table-group-item-edit.vue +238 -238
  31. package/package/t-data-list/src/t-table/table-group-item.vue +87 -87
  32. package/package/t-data-list/src/t-table/table-group.vue +180 -180
  33. package/package/t-data-list/src/t-table/table-records-header-popover.vue +246 -246
  34. package/package/t-data-list/src/t-table/table-records-selected.vue +159 -159
  35. package/package/t-data-list/src/t-table/table-records.vue +337 -337
  36. package/package/t-input/children/address.vue +101 -101
  37. package/package/t-input/children/basic-display.vue +41 -41
  38. package/package/t-input/children/basic.vue +253 -253
  39. package/package/t-input/children/date.vue +89 -89
  40. package/package/t-input/children/group-components/group-dialog.vue +344 -344
  41. package/package/t-input/children/group.vue +126 -126
  42. package/package/t-input/children/input.vue +72 -72
  43. package/package/t-input/children/number.vue +74 -74
  44. package/package/t-input/children/select.vue +89 -89
  45. package/package/t-input/children/tfile/fiile-enclosure.vue +233 -233
  46. package/package/t-input/index.js +7 -7
  47. package/package/t-input/index.vue +337 -337
  48. package/package/t-input/tInputCache.js +24 -24
  49. package/package/tf-icon-picker/README.md +7 -7
  50. package/package/tf-icon-picker/index.js +8 -8
  51. package/package/tf-icon-picker/src/tf-icon-picker.vue +266 -266
  52. package/package/tf-layout/README.md +115 -115
  53. package/package/tf-layout/index.js +8 -8
  54. package/package/tf-layout/src/components/tf-labelbar.vue +382 -382
  55. package/package/tf-layout/src/components/tf-menu.vue +180 -180
  56. package/package/tf-layout/src/components/tf-right-menu.vue +89 -89
  57. package/package/tf-layout/src/components/tf-rotate-box.vue +50 -50
  58. package/package/tf-layout/src/tf-layout.vue +120 -120
  59. package/package/tf-widget/index.js +8 -8
  60. package/package/tf-widget/src/assets/common-input.less +10 -10
  61. package/package/tf-widget/src/children/basic-data/basic-data.vue +361 -361
  62. package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +1087 -1087
  63. package/package/tf-widget/src/children/basic-data/dependcy/common-table.vue +750 -750
  64. package/package/tf-widget/src/children/basic-data/dependcy/condition-filter.vue +519 -519
  65. package/package/tf-widget/src/children/basic-data/dependcy/pagination.vue +93 -93
  66. package/package/tf-widget/src/children/basic-data/dependcy/table-control.vue +240 -240
  67. package/package/tf-widget/src/children/basic-data/dependcy/view-picture.vue +108 -108
  68. package/package/tf-widget/src/children/date-time.vue +103 -103
  69. package/package/tf-widget/src/children/date.vue +103 -103
  70. package/package/tf-widget/src/children/decimal.vue +115 -115
  71. package/package/tf-widget/src/children/integer.vue +104 -104
  72. package/package/tf-widget/src/children/property.vue +59 -59
  73. package/package/tf-widget/src/children/single-line-text.vue +82 -82
  74. package/package/tf-widget/src/children/small-pictures.vue +223 -223
  75. package/package/tf-widget/src/children/text-area.vue +74 -74
  76. package/package/tf-widget/src/children/tf-select.vue +113 -113
  77. package/package/tf-widget/src/tf-widget.vue +175 -175
  78. package/package.json +44 -43
  79. package/src/api/edit.js +97 -97
  80. package/src/api/file-enclosure.js +26 -26
  81. package/src/api/push-down.js +19 -19
  82. package/src/api/table.js +294 -294
  83. package/src/api/tableV3.js +160 -186
  84. package/src/assets/images/icons/index.js +9 -9
  85. package/src/assets/images/icons/svg/add.svg +5 -5
  86. package/src/assets/images/icons/svg/push-down.svg +1 -1
  87. package/src/assets/images/icons/svg/remove.svg +1 -1
  88. package/src/assets/styles/common-table.less +202 -202
  89. package/src/directives/debounce.js +24 -0
  90. package/src/index.js +31 -31
  91. package/src/mixins/t-data-query-mixin.js +290 -290
  92. package/src/utils/auth.js +22 -22
  93. package/src/utils/request.js +42 -42
  94. package/src/utils/stato-anormale.js +59 -59
  95. package/src/utils/utils.js +109 -109
  96. package/src/utils/validate.js +84 -84
@@ -1,253 +1,253 @@
1
- <template>
2
- <div class="basic-input">
3
- <!-- 输入控件 -->
4
- <el-autocomplete
5
- ref="basic"
6
- v-model="displayValue"
7
- placeholder=""
8
- :fetch-suggestions="getAdvice"
9
- :disabled="disabled"
10
- popper-class="basic-suggest-poper"
11
- :trigger-on-focus="false"
12
- @select="handleSelect"
13
- @keydown.delete.native="handleDeleteKeyDown"
14
- >
15
- <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="showDialog" />
16
- <template slot-scope="{item}">
17
- <div>{{ suggestDisplay(item) }}</div>
18
- </template>
19
- </el-autocomplete>
20
-
21
- <!-- 弹窗数据选择器 -->
22
- <el-dialog
23
- :visible.sync="dialogVisible"
24
- width="80%"
25
- :append-to-body="appendToBody"
26
- :close-on-click-modal="false"
27
- :close-on-press-escape="false"
28
- :modal-append-to-body="modalAppendToBody"
29
- @open="getTableData"
30
- >
31
- <!-- {{ limitation }} -->
32
- <div class="dataDialog">
33
- <Ttable
34
- class="t-table"
35
- is-selector
36
- :layout="tableLayout"
37
- :sum="tableSum"
38
- :data="tableData"
39
- enable-group
40
- :page-size="query.pageSize"
41
- :current-page="query.pageNum"
42
- update-in-dialog
43
- @condition-change="handleHeadChange"
44
- @groupChange="handleGroupChange"
45
- @size-change="handleSizeChange"
46
- @current-change="handleCurrentChange"
47
- @fastConfirm="handleFastSelect"
48
- />
49
- </div>
50
- <template v-slot:title>
51
- <div class="common-title">
52
- <TListSearch class="common-table-buttons-search" @search="handleSuggestMultiCondition($event,true)" />
53
- </div>
54
- </template>
55
- <span slot="footer" class="dialog-footer basic-selector-footer">
56
- <el-button class="common-header-button close" size="mini" type="primary" @click="dialogVisible = false">取 消</el-button>
57
- <el-button class="common-header-button" size="mini" type="primary" @click="handleDialogConfirm">确 定</el-button>
58
- </span>
59
- </el-dialog>
60
- </div>
61
- </template>
62
- <script>
63
- import TListSearch from '../../t-data-list/src/t-list-search.vue'
64
- import Ttable from '../../t-data-list/src/t-table/index'
65
- import dataQuery from '@/mixins/t-data-query-mixin.js'
66
- export default {
67
- components: {
68
- TListSearch,
69
- Ttable
70
- },
71
- mixins: [dataQuery],
72
- props: {
73
- value: {
74
- type: Object,
75
- default: () => {
76
- return { name: '', id: null }
77
- }
78
- },
79
- limitation: {
80
- type: Object,
81
- default: () => {}
82
- },
83
- disabled: {
84
- type: Boolean,
85
- default: false
86
- },
87
- appendToBody: {
88
- type: Boolean,
89
- default: true
90
- },
91
- modalAppendToBody: {
92
- type: Boolean,
93
- default: false
94
- }
95
- },
96
- inject: ['target', 'entity'],
97
- data () {
98
- return {
99
- dialogVisible: false,
100
- // 选中一个基础资料之后,基础资料控件显示的名称
101
- displayField: null,
102
- queryType: 'SELECTOR'
103
- }
104
- },
105
- computed: {
106
- displayValue: {
107
- set (value) {
108
- if (this.value.id) {
109
- return
110
- }
111
- this.value.name = value
112
- },
113
- get () {
114
- if (!this.value) {
115
- return
116
- }
117
- return this.value.name
118
- }
119
- }
120
- },
121
- created () {
122
- if (this.entity) {
123
- this.$nextTick(() => {
124
- this.$refs.basic.focus()
125
- })
126
- }
127
- this.getTableLayout()
128
- },
129
- methods: {
130
- /**
131
- * 弹窗和数据选择
132
- */
133
- // 展开弹窗
134
- showDialog () {
135
- if (this.disabled) {
136
- return
137
- }
138
- this.dialogVisible = true
139
- },
140
- // 点击弹窗确定按钮
141
- handleDialogConfirm () {
142
- if (!this.ids.length) {
143
- this.dialogVisible = false
144
- return
145
- }
146
-
147
- if (!this.entity && this.ids.length > 1) {
148
- return this.$message.error('单据头中只能选择一条数据')
149
- }
150
-
151
- if (!this.entity) {
152
- const name = this.selectedRows[0][this.displayField]
153
- const id = this.ids[0]
154
- this.$emit('input', { name, id })
155
- this.$emit('selected', this.selectedRows)
156
- } else {
157
- this.$emit('selected', this.selectedRows)
158
- }
159
- this.dialogVisible = false
160
- },
161
- // 双击选择数据
162
- handleFastSelect (row) {
163
- this.$emit('input', { name: row[this.displayField], id: row[this.idField] })
164
- this.$emit('selected', [row])
165
- this.dialogVisible = false
166
- },
167
- /**
168
- * 输入框相关逻辑
169
- */
170
- // 删除按键处理函数
171
- handleDeleteKeyDown () {
172
- if (this.value.id) {
173
- this.$emit('input', { name: '', id: null })
174
- this.$emit('delete')
175
- }
176
- },
177
- // 获取搜索建议
178
- // 此时的搜索建议也需要对限定范围条件进行拼接
179
- async getAdvice (queryString, callback) {
180
- let record = []
181
- if (!/^\s*$/g.test(queryString)) {
182
- this.handleSuggestMultiCondition(queryString, false)
183
- record = await this.getTableData(true, false)
184
- }
185
- callback(record)
186
- },
187
- // 搜索建议的显示格式
188
- suggestDisplay (item) {
189
- const valueList = []
190
- for (const fieldObj of this.suggestFieldList) {
191
- valueList.push(item[fieldObj.field])
192
- }
193
- return valueList.join('/')
194
- },
195
- // 搜索建议被选择
196
- handleSelect (item) {
197
- const name = item[this.displayField]
198
- const id = item[this.idField]
199
- this.$emit('input', { name, id })
200
- this.$emit('selected', [item])
201
- }
202
- }
203
- }
204
- </script>
205
-
206
- <style>
207
- .basic-suggest-poper {
208
- width:unset !important;
209
- }
210
- </style>
211
- <style lang="less" scoped>
212
- .el-autocomplete {
213
- ::v-deep .el-input__suffix {
214
- display:flex;
215
- align-items:center;
216
- }
217
- }
218
-
219
- /deep/.t-table{
220
- height: 59vh;
221
- .table-records{
222
- height: 100%;
223
- position: relative;
224
- .plTableBox .elx-table--body-wrapper{
225
- height: calc(59vh - 80px);
226
- overflow-x:scroll;
227
- }
228
- .el-pagination{
229
- right: 0;
230
- }
231
- }
232
- }
233
- /deep/.el-dialog__body{
234
- padding-top: 0;
235
- }
236
-
237
- .basic-selector-footer {
238
- .el-button {
239
- background-color: #0A5194;
240
- border:none;
241
- }
242
- }
243
-
244
- .common-title{
245
- // background-color: pink;
246
- display:flex;
247
- justify-content: right;
248
- .common-table-buttons-search{
249
- margin-right:50px;
250
- }
251
- }
252
-
253
- </style>
1
+ <template>
2
+ <div class="basic-input">
3
+ <!-- 输入控件 -->
4
+ <el-autocomplete
5
+ ref="basic"
6
+ v-model="displayValue"
7
+ placeholder=""
8
+ :fetch-suggestions="getAdvice"
9
+ :disabled="disabled"
10
+ popper-class="basic-suggest-poper"
11
+ :trigger-on-focus="false"
12
+ @select="handleSelect"
13
+ @keydown.delete.native="handleDeleteKeyDown"
14
+ >
15
+ <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="showDialog" />
16
+ <template slot-scope="{item}">
17
+ <div>{{ suggestDisplay(item) }}</div>
18
+ </template>
19
+ </el-autocomplete>
20
+
21
+ <!-- 弹窗数据选择器 -->
22
+ <el-dialog
23
+ :visible.sync="dialogVisible"
24
+ width="80%"
25
+ :append-to-body="appendToBody"
26
+ :close-on-click-modal="false"
27
+ :close-on-press-escape="false"
28
+ :modal-append-to-body="modalAppendToBody"
29
+ @open="getTableData"
30
+ >
31
+ <!-- {{ limitation }} -->
32
+ <div class="dataDialog">
33
+ <Ttable
34
+ class="t-table"
35
+ is-selector
36
+ :layout="tableLayout"
37
+ :sum="tableSum"
38
+ :data="tableData"
39
+ enable-group
40
+ :page-size="query.pageSize"
41
+ :current-page="query.pageNum"
42
+ update-in-dialog
43
+ @condition-change="handleHeadChange"
44
+ @groupChange="handleGroupChange"
45
+ @size-change="handleSizeChange"
46
+ @current-change="handleCurrentChange"
47
+ @fastConfirm="handleFastSelect"
48
+ />
49
+ </div>
50
+ <template v-slot:title>
51
+ <div class="common-title">
52
+ <TListSearch class="common-table-buttons-search" @search="handleSuggestMultiCondition($event,true)" />
53
+ </div>
54
+ </template>
55
+ <span slot="footer" class="dialog-footer basic-selector-footer">
56
+ <el-button class="common-header-button close" size="mini" type="primary" @click="dialogVisible = false">取 消</el-button>
57
+ <el-button class="common-header-button" size="mini" type="primary" @click="handleDialogConfirm">确 定</el-button>
58
+ </span>
59
+ </el-dialog>
60
+ </div>
61
+ </template>
62
+ <script>
63
+ import TListSearch from '../../t-data-list/src/t-list-search.vue'
64
+ import Ttable from '../../t-data-list/src/t-table/index'
65
+ import dataQuery from '@/mixins/t-data-query-mixin.js'
66
+ export default {
67
+ components: {
68
+ TListSearch,
69
+ Ttable
70
+ },
71
+ mixins: [dataQuery],
72
+ props: {
73
+ value: {
74
+ type: Object,
75
+ default: () => {
76
+ return { name: '', id: null }
77
+ }
78
+ },
79
+ limitation: {
80
+ type: Object,
81
+ default: () => {}
82
+ },
83
+ disabled: {
84
+ type: Boolean,
85
+ default: false
86
+ },
87
+ appendToBody: {
88
+ type: Boolean,
89
+ default: true
90
+ },
91
+ modalAppendToBody: {
92
+ type: Boolean,
93
+ default: false
94
+ }
95
+ },
96
+ inject: ['target', 'entity'],
97
+ data () {
98
+ return {
99
+ dialogVisible: false,
100
+ // 选中一个基础资料之后,基础资料控件显示的名称
101
+ displayField: null,
102
+ queryType: 'SELECTOR'
103
+ }
104
+ },
105
+ computed: {
106
+ displayValue: {
107
+ set (value) {
108
+ if (this.value.id) {
109
+ return
110
+ }
111
+ this.value.name = value
112
+ },
113
+ get () {
114
+ if (!this.value) {
115
+ return
116
+ }
117
+ return this.value.name
118
+ }
119
+ }
120
+ },
121
+ created () {
122
+ if (this.entity) {
123
+ this.$nextTick(() => {
124
+ this.$refs.basic.focus()
125
+ })
126
+ }
127
+ this.getTableLayout()
128
+ },
129
+ methods: {
130
+ /**
131
+ * 弹窗和数据选择
132
+ */
133
+ // 展开弹窗
134
+ showDialog () {
135
+ if (this.disabled) {
136
+ return
137
+ }
138
+ this.dialogVisible = true
139
+ },
140
+ // 点击弹窗确定按钮
141
+ handleDialogConfirm () {
142
+ if (!this.ids.length) {
143
+ this.dialogVisible = false
144
+ return
145
+ }
146
+
147
+ if (!this.entity && this.ids.length > 1) {
148
+ return this.$message.error('单据头中只能选择一条数据')
149
+ }
150
+
151
+ if (!this.entity) {
152
+ const name = this.selectedRows[0][this.displayField]
153
+ const id = this.ids[0]
154
+ this.$emit('input', { name, id })
155
+ this.$emit('selected', this.selectedRows)
156
+ } else {
157
+ this.$emit('selected', this.selectedRows)
158
+ }
159
+ this.dialogVisible = false
160
+ },
161
+ // 双击选择数据
162
+ handleFastSelect (row) {
163
+ this.$emit('input', { name: row[this.displayField], id: row[this.idField] })
164
+ this.$emit('selected', [row])
165
+ this.dialogVisible = false
166
+ },
167
+ /**
168
+ * 输入框相关逻辑
169
+ */
170
+ // 删除按键处理函数
171
+ handleDeleteKeyDown () {
172
+ if (this.value.id) {
173
+ this.$emit('input', { name: '', id: null })
174
+ this.$emit('delete')
175
+ }
176
+ },
177
+ // 获取搜索建议
178
+ // 此时的搜索建议也需要对限定范围条件进行拼接
179
+ async getAdvice (queryString, callback) {
180
+ let record = []
181
+ if (!/^\s*$/g.test(queryString)) {
182
+ this.handleSuggestMultiCondition(queryString, false)
183
+ record = await this.getTableData(true, false)
184
+ }
185
+ callback(record)
186
+ },
187
+ // 搜索建议的显示格式
188
+ suggestDisplay (item) {
189
+ const valueList = []
190
+ for (const fieldObj of this.suggestFieldList) {
191
+ valueList.push(item[fieldObj.field])
192
+ }
193
+ return valueList.join('/')
194
+ },
195
+ // 搜索建议被选择
196
+ handleSelect (item) {
197
+ const name = item[this.displayField]
198
+ const id = item[this.idField]
199
+ this.$emit('input', { name, id })
200
+ this.$emit('selected', [item])
201
+ }
202
+ }
203
+ }
204
+ </script>
205
+
206
+ <style>
207
+ .basic-suggest-poper {
208
+ width:unset !important;
209
+ }
210
+ </style>
211
+ <style lang="less" scoped>
212
+ .el-autocomplete {
213
+ ::v-deep .el-input__suffix {
214
+ display:flex;
215
+ align-items:center;
216
+ }
217
+ }
218
+
219
+ /deep/.t-table{
220
+ height: 59vh;
221
+ .table-records{
222
+ height: 100%;
223
+ position: relative;
224
+ .plTableBox .elx-table--body-wrapper{
225
+ height: calc(59vh - 80px);
226
+ overflow-x:scroll;
227
+ }
228
+ .el-pagination{
229
+ right: 0;
230
+ }
231
+ }
232
+ }
233
+ /deep/.el-dialog__body{
234
+ padding-top: 0;
235
+ }
236
+
237
+ .basic-selector-footer {
238
+ .el-button {
239
+ background-color: #0A5194;
240
+ border:none;
241
+ }
242
+ }
243
+
244
+ .common-title{
245
+ // background-color: pink;
246
+ display:flex;
247
+ justify-content: right;
248
+ .common-table-buttons-search{
249
+ margin-right:50px;
250
+ }
251
+ }
252
+
253
+ </style>
@@ -1,89 +1,89 @@
1
- <template>
2
- <el-date-picker
3
- ref="date"
4
- class="date"
5
- :value="value"
6
- :type="type"
7
- :placeholder="placeholderComp"
8
- :disabled="disabled"
9
- :format="timeFormmat"
10
- value-format="yyyy-MM-dd HH:mm:ss"
11
- style="width:100%"
12
- @input="handleInput"
13
- />
14
- </template>
15
- <script>
16
- export default {
17
- components: {
18
-
19
- },
20
- props: {
21
- value: {
22
- type: String,
23
- default: null
24
- },
25
- disabled: {
26
- type: Boolean,
27
- default: false
28
- }
29
- },
30
- inject: ['placeholder', 'datetime', 'entity'],
31
- data () {
32
- return {
33
-
34
- }
35
- },
36
- computed: {
37
- type () {
38
- if (this.datetime) {
39
- return 'datetime'
40
- }
41
- return 'date'
42
- },
43
- timeFormmat () {
44
- if (this.datetime) {
45
- return 'yyyy-MM-dd HH:mm:ss'
46
- }
47
- return 'yyyy-MM-dd'
48
- },
49
- placeholderComp () {
50
- if (!this.placeholder) {
51
- if (this.datetime) {
52
- return '请输入日期时间'
53
- }
54
- return '请输入日期'
55
- }
56
- return this.placeholder
57
- }
58
- },
59
- mounted () {
60
- if (this.entity) {
61
- this.$refs.date.focus()
62
- }
63
- },
64
- created () {
65
- if (!this.value) {
66
- this.handleInput(null)
67
- }
68
- },
69
- methods: {
70
- handleInput (value) {
71
- this.$emit('input', value)
72
- }
73
- }
74
- }
75
- </script>
76
-
77
- <style scoped lang='less'>
78
- .date {
79
- ::v-deep .el-icon-date:before {
80
- content: "\e78e";
81
- font-size: 16px;
82
- position: absolute;
83
- right: 0% !important;
84
- }
85
- ::v-deep .el-icon-date{
86
- width: 20px;
87
- }
88
- }
89
- </style>
1
+ <template>
2
+ <el-date-picker
3
+ ref="date"
4
+ class="date"
5
+ :value="value"
6
+ :type="type"
7
+ :placeholder="placeholderComp"
8
+ :disabled="disabled"
9
+ :format="timeFormmat"
10
+ value-format="yyyy-MM-dd HH:mm:ss"
11
+ style="width:100%"
12
+ @input="handleInput"
13
+ />
14
+ </template>
15
+ <script>
16
+ export default {
17
+ components: {
18
+
19
+ },
20
+ props: {
21
+ value: {
22
+ type: String,
23
+ default: null
24
+ },
25
+ disabled: {
26
+ type: Boolean,
27
+ default: false
28
+ }
29
+ },
30
+ inject: ['placeholder', 'datetime', 'entity'],
31
+ data () {
32
+ return {
33
+
34
+ }
35
+ },
36
+ computed: {
37
+ type () {
38
+ if (this.datetime) {
39
+ return 'datetime'
40
+ }
41
+ return 'date'
42
+ },
43
+ timeFormmat () {
44
+ if (this.datetime) {
45
+ return 'yyyy-MM-dd HH:mm:ss'
46
+ }
47
+ return 'yyyy-MM-dd'
48
+ },
49
+ placeholderComp () {
50
+ if (!this.placeholder) {
51
+ if (this.datetime) {
52
+ return '请输入日期时间'
53
+ }
54
+ return '请输入日期'
55
+ }
56
+ return this.placeholder
57
+ }
58
+ },
59
+ mounted () {
60
+ if (this.entity) {
61
+ this.$refs.date.focus()
62
+ }
63
+ },
64
+ created () {
65
+ if (!this.value) {
66
+ this.handleInput(null)
67
+ }
68
+ },
69
+ methods: {
70
+ handleInput (value) {
71
+ this.$emit('input', value)
72
+ }
73
+ }
74
+ }
75
+ </script>
76
+
77
+ <style scoped lang='less'>
78
+ .date {
79
+ ::v-deep .el-icon-date:before {
80
+ content: "\e78e";
81
+ font-size: 16px;
82
+ position: absolute;
83
+ right: 0% !important;
84
+ }
85
+ ::v-deep .el-icon-date{
86
+ width: 20px;
87
+ }
88
+ }
89
+ </style>