@tongfun/tf-widget 0.1.29 → 0.1.30

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 (81) hide show
  1. package/README.md +4 -0
  2. package/lib/tf-widget.common.js +264 -226
  3. package/lib/tf-widget.css +1 -1
  4. package/lib/tf-widget.umd.js +264 -226
  5. package/lib/tf-widget.umd.min.js +4 -4
  6. package/package.json +1 -1
  7. package/package/svg-icon/index.js +0 -8
  8. package/package/svg-icon/src/SvgIcon.vue +0 -59
  9. package/package/t-data-list/index.js +0 -6
  10. package/package/t-data-list/main.vue +0 -193
  11. package/package/t-data-list/src/condition-input/basic.vue +0 -31
  12. package/package/t-data-list/src/condition-input/date.vue +0 -106
  13. package/package/t-data-list/src/condition-input/index.vue +0 -100
  14. package/package/t-data-list/src/condition-input/input.vue +0 -31
  15. package/package/t-data-list/src/condition-input/number.vue +0 -115
  16. package/package/t-data-list/src/condition-input/select.vue +0 -86
  17. package/package/t-data-list/src/js/fieldTypeEnum.js +0 -10
  18. package/package/t-data-list/src/js/operatorEnum.js +0 -108
  19. package/package/t-data-list/src/js/qureyParamsEnum.js +0 -4
  20. package/package/t-data-list/src/js/util.js +0 -34
  21. package/package/t-data-list/src/mixins/button-controll-mixin.js +0 -93
  22. package/package/t-data-list/src/pushdown/push-down.vue +0 -158
  23. package/package/t-data-list/src/t-list-search.vue +0 -36
  24. package/package/t-data-list/src/t-plan/condition-always-item.vue +0 -143
  25. package/package/t-data-list/src/t-plan/condition-mult-item.vue +0 -222
  26. package/package/t-data-list/src/t-plan/index.vue +0 -195
  27. package/package/t-data-list/src/t-plan/plan-content.vue +0 -389
  28. package/package/t-data-list/src/t-table/index.vue +0 -129
  29. package/package/t-data-list/src/t-table/table-group-item-edit.vue +0 -238
  30. package/package/t-data-list/src/t-table/table-group-item.vue +0 -87
  31. package/package/t-data-list/src/t-table/table-group.vue +0 -180
  32. package/package/t-data-list/src/t-table/table-records-header-popover.vue +0 -246
  33. package/package/t-data-list/src/t-table/table-records-selected.vue +0 -159
  34. package/package/t-data-list/src/t-table/table-records.vue +0 -336
  35. package/package/t-input/children/address.vue +0 -101
  36. package/package/t-input/children/basic-display.vue +0 -41
  37. package/package/t-input/children/basic.vue +0 -261
  38. package/package/t-input/children/date.vue +0 -84
  39. package/package/t-input/children/group-components/group-dialog.vue +0 -344
  40. package/package/t-input/children/group.vue +0 -126
  41. package/package/t-input/children/input.vue +0 -67
  42. package/package/t-input/children/number.vue +0 -71
  43. package/package/t-input/children/select.vue +0 -86
  44. package/package/t-input/children/tfile/fiile-enclosure.vue +0 -233
  45. package/package/t-input/children/tfile/file-img/comp.png +0 -0
  46. package/package/t-input/children/tfile/file-img/excel.png +0 -0
  47. package/package/t-input/children/tfile/file-img/img.png +0 -0
  48. package/package/t-input/children/tfile/file-img/pdf.png +0 -0
  49. package/package/t-input/children/tfile/file-img/word.png +0 -0
  50. package/package/t-input/index.js +0 -7
  51. package/package/t-input/index.vue +0 -337
  52. package/package/t-input/tInputCache.js +0 -24
  53. package/package/tf-icon-picker/README.md +0 -8
  54. package/package/tf-icon-picker/index.js +0 -8
  55. package/package/tf-icon-picker/src/tf-icon-picker.vue +0 -266
  56. package/package/tf-layout/README.md +0 -115
  57. package/package/tf-layout/index.js +0 -8
  58. package/package/tf-layout/src/components/tf-labelbar.vue +0 -394
  59. package/package/tf-layout/src/components/tf-menu.vue +0 -180
  60. package/package/tf-layout/src/components/tf-right-menu.vue +0 -89
  61. package/package/tf-layout/src/components/tf-rotate-box.vue +0 -50
  62. package/package/tf-layout/src/tf-layout.vue +0 -140
  63. package/package/tf-widget/index.js +0 -8
  64. package/package/tf-widget/src/assets/common-input.less +0 -11
  65. package/package/tf-widget/src/children/basic-data/basic-data.vue +0 -366
  66. package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +0 -1087
  67. package/package/tf-widget/src/children/basic-data/dependcy/common-table.vue +0 -750
  68. package/package/tf-widget/src/children/basic-data/dependcy/condition-filter.vue +0 -519
  69. package/package/tf-widget/src/children/basic-data/dependcy/pagination.vue +0 -93
  70. package/package/tf-widget/src/children/basic-data/dependcy/table-control.vue +0 -240
  71. package/package/tf-widget/src/children/basic-data/dependcy/view-picture.vue +0 -108
  72. package/package/tf-widget/src/children/date-time.vue +0 -103
  73. package/package/tf-widget/src/children/date.vue +0 -103
  74. package/package/tf-widget/src/children/decimal.vue +0 -115
  75. package/package/tf-widget/src/children/integer.vue +0 -104
  76. package/package/tf-widget/src/children/property.vue +0 -59
  77. package/package/tf-widget/src/children/single-line-text.vue +0 -82
  78. package/package/tf-widget/src/children/small-pictures.vue +0 -223
  79. package/package/tf-widget/src/children/text-area.vue +0 -74
  80. package/package/tf-widget/src/children/tf-select.vue +0 -113
  81. package/package/tf-widget/src/tf-widget.vue +0 -175
@@ -1,104 +0,0 @@
1
- <template>
2
- <div class="integer">
3
- <el-input-number
4
- :disabled="JSON.parse(disabled)"
5
- :controls="false"
6
- :placeholder="placeholder"
7
- :step="1"
8
- step-strictly
9
- :min="0"
10
- :value="value"
11
- @change="handleInput"
12
- v-on="$listeners"
13
- />
14
- <!-- <i v-if="disabled" class="el-icon-lock" /> -->
15
- </div>
16
- </template>
17
- <script>
18
- export default {
19
- components: {
20
-
21
- },
22
- props: {
23
- value: {
24
- type: [Object, Number, String],
25
- default: undefined
26
- },
27
- placeholder: {
28
- type: String,
29
- default: ''
30
- },
31
- disabled: {
32
- type: [Boolean, Object, String],
33
- default: null
34
- },
35
- defaultValue: {
36
- type: [String, Object],
37
- default: null
38
- }
39
- },
40
- data () {
41
- return {
42
- // refName: Math.random().toString().slice(3, 9),
43
- // inputWidth: '0'
44
- }
45
- },
46
- watch: {
47
- value: {
48
- handler (newVal) {
49
- if (newVal === '') {
50
- this.handleInput(undefined)
51
- }
52
- }
53
- }
54
- },
55
- created () {
56
- if (this.defaultValue) {
57
- return this.$emit('input', this.defaultValue)
58
- }
59
- if (this.value) {
60
- return this.$emit('input', this.value)
61
- }
62
- this.$emit('input', undefined)
63
- },
64
-
65
- // mounted () {
66
- // this.inputWidth = this.$refs[this.refName].$children[0].$el.clientWidth + 'px'
67
- // },
68
-
69
- methods: {
70
- handleInput (value) {
71
- this.$emit('input', value)
72
- }
73
-
74
- }
75
- }
76
- </script>
77
-
78
- <style lang="less" scoped>
79
- @import '../assets/common-input.less';
80
- .integer{
81
- width: 100%;
82
- display: flex;
83
- align-items: center;
84
- position: relative;
85
- ::v-deep .el-input-number{
86
- width: 100%;
87
- }
88
- ::v-deep .el-input__inner{
89
- width: 100%;
90
- border: none;
91
- border-bottom: 1px solid #DCDCDC;
92
- border-radius: 0;
93
- text-align: left;
94
- }
95
- // .el-icon-lock{
96
- // position: absolute;
97
- // left: calc(var(--inputWidth) - 25px);
98
- // }
99
- // .el-icon-lock::before{
100
- // color: #C0C4CC;
101
- // font-size: 14px;
102
- // }
103
- }
104
- </style>
@@ -1,59 +0,0 @@
1
- <template>
2
- <div>
3
- <el-input
4
- :value="value"
5
- :placeholder="placeholder"
6
- disabled
7
- @input="handleInput"
8
- v-on="$listeners"
9
- />
10
- </div>
11
- </template>
12
- <script>
13
- export default {
14
- components: {
15
-
16
- },
17
- props: {
18
- value: {
19
- type: [String, Object],
20
- default: ''
21
- },
22
- placeholder: {
23
- type: String,
24
- default: ''
25
- },
26
- defaultValue: {
27
- type: String,
28
- default: ''
29
- }
30
- },
31
- data () {
32
- return {
33
-
34
- }
35
- },
36
- created () {
37
- if (this.value) {
38
- return
39
- }
40
- if (this.defaultValue && !this.value) {
41
- return this.handleInput(this.defaultValue)
42
- }
43
- },
44
- methods: {
45
- handleInput (newValue) {
46
- this.$emit('input', newValue)
47
- }
48
- }
49
- }
50
- </script>
51
-
52
- <style lang="less" scoped>
53
- ::v-deep .el-input__inner{
54
- width: 100%;
55
- border: none;
56
- border-bottom: 1px solid #DCDCDC;
57
- border-radius: 0;
58
- }
59
- </style>
@@ -1,82 +0,0 @@
1
- <template>
2
- <el-input
3
- :value="value"
4
- :disabled="JSON.parse(disabled) "
5
- :placeholder="placeholder"
6
- :clearable="clearable"
7
- @input="handleInput"
8
- v-on="$listeners"
9
- >
10
- <i v-if="disabled" class="el-icon-lock el-input__icon" slot="suffix" />
11
- </el-input>
12
- </template>
13
- <script>
14
- export default {
15
- components: {
16
-
17
- },
18
- props: {
19
- value: {
20
- type: String,
21
- default: ''
22
- },
23
- placeholder: {
24
- type: String,
25
- default: ''
26
- },
27
- disabled: {
28
- type: [Boolean, String],
29
- default: false
30
- },
31
- defaultValue: {
32
- type: String,
33
- default: ''
34
- },
35
- clearable: {
36
- type: Boolean,
37
- default: true
38
- }
39
- },
40
- data () {
41
- return {
42
- }
43
- },
44
- computed: {
45
- debug () {
46
- return typeof this.value
47
- }
48
- },
49
- watch: {
50
- value () {
51
- if (!this.value) {
52
- this.handleInput(null)
53
- }
54
- }
55
- },
56
- created () {
57
- // 默认值
58
- if (this.defaultValue && !this.value) {
59
- return this.handleInput(this.defaultValue)
60
- }
61
- // 有值的情况下不进行初始化
62
- if (!this.value) {
63
- return this.handleInput(null)
64
- }
65
- },
66
- methods: {
67
- handleInput (newValue) {
68
- this.$emit('input', newValue)
69
- }
70
- }
71
- }
72
- </script>
73
-
74
- <style lang="less" scoped>
75
- @import '../assets/common-input.less';
76
- ::v-deep .el-input__inner{
77
- width: 100%;
78
- border: none;
79
- border-bottom: 1px solid #DCDCDC;
80
- border-radius: 0;
81
- }
82
- </style>
@@ -1,223 +0,0 @@
1
- <template>
2
- <div class="small-picture">
3
- <el-button size="mini" @click="handleClickUploadPicture" :disabled="disabled">点击上传图片</el-button>
4
- <el-dialog
5
- title="图片上传"
6
- :visible.sync="dialogVisible"
7
- width="30%"
8
- >
9
- <div>
10
- <el-upload
11
- class="upload-demo"
12
- action="qqq"
13
- :on-preview="handlePreview"
14
- :on-remove="handleRemove"
15
- :on-change="handleChange"
16
- :before-upload="beforeAvatarUpload"
17
- accept="image/jpg,image/jpeg,image/png"
18
- :auto-upload="false"
19
- multiple
20
- :limit="5"
21
- :on-exceed="handleExceed"
22
- :file-list="fileList"
23
- list-type="picture"
24
- >
25
- <el-button size="mini" type="primary">选择图片</el-button>
26
- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过2M</div>
27
- </el-upload>
28
- </div>
29
- <span slot="footer" class="dialog-footer">
30
- <el-button size="mini" class="close" @click="handleClickClose">取 消</el-button>
31
- <el-button size="mini" @click="handleClickSure">确 定</el-button>
32
- </span>
33
- </el-dialog>
34
- </div>
35
- </template>
36
-
37
- <script>
38
- export default {
39
- props: {
40
- value: {
41
- type: String,
42
- default: null
43
- },
44
- disabled: {
45
- type: [Boolean, Object, String],
46
- default: null
47
- }
48
- },
49
- data () {
50
- return {
51
- dialogVisible: false,
52
- fileList: [],
53
- count: null,
54
- // 上传图片的参数
55
- fileListParam: []
56
- }
57
- },
58
- created () {
59
- if (!this.$route.query.receiptId) {
60
- // eslint-disable-next-line no-return-assign
61
- return this.count = null
62
- }
63
- this.count = 0
64
- },
65
- methods: {
66
-
67
- // 打开上传图片模态框
68
- handleClickUploadPicture () {
69
- this.dialogVisible = true
70
- if (!this.$route.query.receiptId) {
71
- return
72
- }
73
- if (!this.value) {
74
- this.fileListParam = []
75
- this.fileList = []
76
- return
77
- }
78
- this.fileListParam = []
79
- this.fileList = []
80
- this.value.split(',').forEach((v, i) => {
81
- this.fileListParam.push(v)
82
- this.fileList.push({
83
- name: v.split('/')[v.split('/').length - 1],
84
- url: v
85
- })
86
- })
87
- },
88
-
89
- // 上传图片之前
90
- beforeAvatarUpload (file) {
91
- const isJPG = file.type === 'image/jpeg'
92
- const isPng = file.type === 'image/png'
93
- const isLt2M = file.size / 1024 / 1024 < 2
94
- if (!isJPG && !isPng) {
95
- this.$message.error('上传头像图片只能是 JPG 或者 PNG 格式!')
96
- }
97
- if (!isLt2M) {
98
- this.$message.error('上传头像图片大小不能超过 2MB!')
99
- }
100
- return isJPG && isLt2M
101
- },
102
-
103
- // 点击删除上传图片列表
104
- handleRemove (file, fileList) {
105
- // eslint-disable-next-line eqeqeq
106
- const index = this.fileList.findIndex((ele) => { return ele.url == file.url })
107
- this.fileList.splice(index, 1)
108
- this.fileListParam.splice(index, 1)
109
- },
110
-
111
- // 点击已经上传的图片列表
112
- handlePreview (file) {
113
-
114
- },
115
-
116
- // 文件超出个数限制时触发
117
- handleExceed (files, fileList) {
118
- this.$message.warning(`当前限制选择 5 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
119
- },
120
-
121
- // 上传成功或者删除图片变化就会触发
122
- handleChange (file, fileList) {
123
- this.fileList = fileList
124
- this.getBase64(file.raw).then((res) => {
125
- const str = `${res.name}%${res.url}`
126
- this.fileListParam.push(str)
127
- })
128
- },
129
-
130
- // base64转码
131
- getBase64 (file) {
132
- return new Promise(function (resolve, reject) {
133
- const reader = new FileReader()
134
- const Result = {}
135
- reader.readAsDataURL(file)
136
- reader.onload = function () {
137
- Result.name = file.name
138
- Result.url = reader.result
139
- }
140
- reader.onerror = function (error) {
141
- reject(error)
142
- }
143
- reader.onloadend = function () {
144
- resolve(Result)
145
- }
146
- })
147
- },
148
-
149
- handleClickClose () {
150
- this.dialogVisible = false
151
- },
152
-
153
- handleClickSure () {
154
- this.$emit('input', this.fileListParam.join('@'))
155
- this.dialogVisible = false
156
- }
157
-
158
- }
159
- }
160
-
161
- </script>
162
- <style lang='less' scoped>
163
- .small-picture{
164
- ::v-deep .el-button--mini{
165
- background-color: #0C4C8E;
166
- border-color: #0C4C8E;
167
- color: #FFFFFF;
168
- margin-right: 2px;
169
- }
170
- .close{
171
- background: #e5e5e5;
172
- color: #666;
173
- margin-right: 1.95vw;
174
- }
175
- ::v-deep .el-dialog__body{
176
- padding-top: 0;
177
- }
178
- .dialog-footer{
179
- display: flex;
180
- justify-content: center;
181
- }
182
- /*去除upload组件过渡效果*/
183
- ::v-deep.el-upload-list__item {
184
- transition: none !important;
185
- }
186
- ::v-deep .el-upload-list--picture{
187
- max-height: 30vh;
188
- overflow: auto;
189
- padding: 0 1vw;
190
- box-sizing: border-box;
191
- }
192
- ::v-deep.el-upload-list__item-name{
193
- cursor: pointer;
194
- }
195
- ::v-deep .el-upload-list--picture::-webkit-scrollbar{
196
- width:10px;
197
- height:10px;
198
- }
199
- /*正常情况下滑块的样式*/
200
- ::v-deep .el-upload-list--picture::-webkit-scrollbar-thumb{
201
- background-color:rgba(0,0,0,.05);
202
- border-radius:10px;
203
- }
204
- /*鼠标悬浮在该类指向的控件上时滑块的样式*/
205
- ::v-deep .el-upload-list--picture:hover::-webkit-scrollbar-thumb{
206
- background-color:rgba(0,0,0,.2);
207
- border-radius:10px;
208
- }
209
- /*鼠标悬浮在滑块上时滑块的样式*/
210
- ::v-deep .el-upload-list--picture::-webkit-scrollbar-thumb:hover{
211
- background-color:rgba(0,0,0,.4);
212
- }
213
- /*正常时候的主干部分*/
214
- ::v-deep .el-upload-list--picture::-webkit-scrollbar-track{
215
- border-radius:10px;
216
- background-color:white;
217
- }
218
- /*鼠标悬浮在滚动条上的主干部分*/
219
- ::v-deep .el-upload-list--picture::-webkit-scrollbar-track:hover{
220
- background-color:rgba(0,0,0,.01);
221
- }
222
- }
223
- </style>
@@ -1,74 +0,0 @@
1
- <template>
2
- <el-input
3
- type="textarea"
4
- :value="value"
5
- :disabled="JSON.parse(disabled) "
6
- :placeholder="placeholder"
7
- @input="handleInput"
8
- v-on="$listeners"
9
- />
10
- </template>
11
- <script>
12
- export default {
13
- components: {
14
-
15
- },
16
- props: {
17
- value: {
18
- type: String,
19
- default: ''
20
- },
21
- placeholder: {
22
- type: String,
23
- default: ''
24
- },
25
- disabled: {
26
- type: [Boolean, String],
27
- default: false
28
- },
29
- defaultValue: {
30
- type: String,
31
- default: ''
32
- }
33
- },
34
- data () {
35
- return {
36
- }
37
- },
38
- computed: {
39
- debug () {
40
- return typeof this.value
41
- }
42
- },
43
- watch: {
44
- value () {
45
- if (!this.value) {
46
- this.handleInput(null)
47
- }
48
- }
49
- },
50
- created () {
51
- // 默认值
52
- if (this.defaultValue && !this.value) {
53
- return this.handleInput(this.defaultValue)
54
- }
55
- // 有值的情况下不进行初始化
56
- if (!this.value) {
57
- return this.handleInput(null)
58
- }
59
- },
60
- methods: {
61
- handleInput (newValue) {
62
- this.$emit('input', newValue)
63
- }
64
- }
65
- }
66
- </script>
67
-
68
- <style lang="less" scoped>
69
- @import '../assets/common-input.less';
70
- ::v-deep .el-textarea__inner{
71
- width: 100%;
72
- height: 100%;
73
- }
74
- </style>
@@ -1,113 +0,0 @@
1
- <template>
2
- <div class="tf-select">
3
- <el-select v-if="!disabled" :value="selectId" filterable clearable :placeholder="placeholder" :disabled="JSON.parse(disabled)" style="display:block" @input="change" @change="$emit('change', $event)">
4
- <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
5
- </el-select>
6
- <el-input
7
- v-else
8
- :value="value ? value.name : ''"
9
- :disabled="true"
10
- :placeholder="placeholder"
11
- >
12
- <i class="el-icon-lock el-input__icon" slot="suffix" />
13
- </el-input>
14
- </div>
15
- </template>
16
- <script>
17
- import { getEnumOptions } from '@/api/edit.js'
18
- export default {
19
- components: {
20
-
21
- },
22
- props: {
23
- value: {
24
- type: [String, Object],
25
- default: ''
26
- },
27
- enumtype: {
28
- type: String,
29
- default: ''
30
- },
31
- placeholder: {
32
- type: String,
33
- default: ''
34
- },
35
- disabled: {
36
- type: [Boolean, Object, String],
37
- default: null
38
- },
39
- defaultValue: {
40
- type: [String, Object],
41
- default: null
42
- },
43
- inEntity: {
44
- type: Boolean,
45
- default: false
46
- },
47
- field: {
48
- type: String,
49
- default: ''
50
- }
51
- },
52
- data () {
53
- return {
54
- options: []
55
- }
56
- },
57
- computed: {
58
- selectId () {
59
- if (this.value) {
60
- return this.value.id
61
- }
62
- return ''
63
- }
64
- },
65
- async created () {
66
- const res = await getEnumOptions(this.enumtype)
67
- this.options = res.data
68
- // 有默认值渲染默认值
69
- if (this.defaultValue && !this.value) {
70
- return this.change(this.defaultValue)
71
- }
72
- // 没有值的情况下初始化为null
73
- if (!this.value) {
74
- this.change(null)
75
- } else {
76
- this.change(this.selectId)
77
- }
78
- },
79
- methods: {
80
- change (newValue) {
81
- const name = this.getLabelByValue(newValue)
82
- let id = newValue
83
- if (!name) {
84
- id = null
85
- }
86
- this.$emit('input', { name, id })
87
- if (this.field === 'is_closed') {
88
- this.$emit('receiptClose', newValue)
89
- }
90
- if (this.field === 'line_closed') {
91
- this.$emit('rowClose', newValue)
92
- }
93
- },
94
- getLabelByValue (newValue) {
95
- const option = this.options.find(item => item.id === newValue)
96
- if (option) {
97
- return option.name
98
- }
99
- return ''
100
- }
101
- }
102
- }
103
- </script>
104
-
105
- <style lang="less" scoped>
106
- @import '../assets/common-input.less';
107
- ::v-deep .el-input__inner{
108
- width: 100%;
109
- border: none;
110
- border-bottom: 1px solid #DCDCDC;
111
- border-radius: 0;
112
- }
113
- </style>