@tongfun/tf-widget 0.1.27 → 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 (100) hide show
  1. package/README.md +12 -0
  2. package/lib/tf-widget.common.js +341 -281
  3. package/lib/tf-widget.css +1 -1
  4. package/lib/tf-widget.umd.js +341 -281
  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 -361
  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
  82. package/src/api/edit.js +0 -97
  83. package/src/api/file-enclosure.js +0 -26
  84. package/src/api/push-down.js +0 -19
  85. package/src/api/table.js +0 -294
  86. package/src/api/tableV3.js +0 -166
  87. package/src/assets/images/icons/index.js +0 -9
  88. package/src/assets/images/icons/svg/add.svg +0 -5
  89. package/src/assets/images/icons/svg/push-down.svg +0 -2
  90. package/src/assets/images/icons/svg/remove.svg +0 -1
  91. package/src/assets/images/icons/svg/table-empty.svg +0 -1
  92. package/src/assets/styles/common-table.less +0 -202
  93. package/src/directives/debounce.js +0 -24
  94. package/src/index.js +0 -31
  95. package/src/mixins/t-data-query-mixin.js +0 -293
  96. package/src/utils/auth.js +0 -22
  97. package/src/utils/request.js +0 -42
  98. package/src/utils/stato-anormale.js +0 -59
  99. package/src/utils/utils.js +0 -109
  100. package/src/utils/validate.js +0 -84
@@ -1,126 +0,0 @@
1
- <template>
2
- <div>
3
- <!-- 输入控件 -->
4
- <el-autocomplete
5
- ref="group"
6
- v-model="showValue"
7
- placeholder=""
8
- :fetch-suggestions="getAdvice"
9
- :disabled="disabled"
10
- :trigger-on-focus="false"
11
- @select="handleSelect"
12
- @blur="handleBlur"
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>{{ item.name }}</div>
18
- </template>
19
- </el-autocomplete>
20
-
21
- <!-- 弹窗数据选择器 -->
22
- <GroupDialog
23
- ref="groupDialog"
24
- :value="value"
25
- :data="options"
26
- :visible.sync="dialogVisible"
27
- @confirm="handleConfig"
28
- @success="handleSuccess"
29
- />
30
- </div>
31
- </template>
32
-
33
- <script>
34
- import { getGroupTree } from '@/api/tableV3.js'
35
- import GroupDialog from './group-components/group-dialog'
36
- // 使用该组件必穿一个target
37
-
38
- export default {
39
- name: 'Group',
40
- components: {
41
- GroupDialog
42
- },
43
- props: {
44
- value: {
45
- type: Object,
46
- default: null
47
- },
48
- disabled: {
49
- type: Boolean,
50
- default: false
51
- }
52
- },
53
- inject: ['target'],
54
- data () {
55
- return {
56
- options: [],
57
- dialogVisible: false,
58
- groupList: []
59
- }
60
- },
61
- computed: {
62
- showValue: {
63
- get: function () {
64
- return this.value ? this.value.name : ''
65
- },
66
- set: function (newVal) {
67
- this.$emit('input', { id: '', name: newVal })
68
- }
69
- }
70
- },
71
- mounted () {
72
- this.getGroupTree()
73
- },
74
- methods: {
75
- // 获取分组数据
76
- async getGroupTree () {
77
- const res = await getGroupTree(this.target)
78
- if (res.code !== 0) {
79
- return this.$message.error(res.msg)
80
- }
81
- this.groupList = []
82
- this.options = [res.data]
83
- this.groupList = Object.values(this.$refs.groupDialog.createSelectMap(this.options))
84
- if (this.dialogVisible) {
85
- this.$refs.groupDialog.updateGroupStatus()
86
- }
87
- },
88
- handleSelect (val) {
89
- this.$emit('input', { id: val.id, name: val.name })
90
- // this.$emit('input', val[val.length - 1])
91
- },
92
- // 点击删除时进行的操作
93
- handleDeleteKeyDown () {
94
- this.$emit('input', { id: '', name: '' })
95
- },
96
- // 获取搜索建议
97
- getAdvice (str, cb) {
98
- if (str) {
99
- cb(this.groupList.filter(e => e.name.includes(str)))
100
- }
101
- },
102
- // 展示dialog
103
- showDialog () {
104
- this.dialogVisible = true
105
- },
106
- handleBlur () {
107
- if (!this.value.id) {
108
- this.$emit('input', { id: '', name: '' })
109
- }
110
- },
111
- handleConfig (val) {
112
- this.$emit('input', val)
113
- },
114
- handleSuccess () {
115
- this.getGroupTree()
116
- }
117
-
118
- }
119
- }
120
- </script>
121
- <style lang="less" scoped>
122
- /deep/.el-scrollbar__wrap{
123
- overflow-x: hidden!important;
124
- }
125
-
126
- </style>
@@ -1,67 +0,0 @@
1
- <template>
2
- <el-input
3
- ref="input"
4
- :value="value"
5
- :type="inputType"
6
- :disabled="disabled"
7
- :rows="rows"
8
- :placeholder="placeholder"
9
- @input="handleInput"
10
- />
11
- </template>
12
- <script>
13
- export default {
14
- components: {
15
-
16
- },
17
- props: {
18
- value: {
19
- type: String,
20
- default: ''
21
- },
22
- disabled: {
23
- type: Boolean,
24
- default: false
25
- },
26
- defaultValue: {
27
- type: String,
28
- default: ''
29
- }
30
- },
31
- inject: ['rows', 'placeholder', 'text', 'entity'],
32
- data () {
33
- return {
34
-
35
- }
36
- },
37
- computed: {
38
- inputType () {
39
- if (this.text) {
40
- return 'textarea'
41
- }
42
- return 'text'
43
- }
44
- },
45
- created () {
46
- // 对象还不存在这个属性,创建属性,如果有属性,但是值是null不进行任何操作
47
- if (!this.value) {
48
- this.handleInput(null)
49
- }
50
- },
51
- methods: {
52
- handleInput (value) {
53
- this.$emit('input', value)
54
- }
55
- }
56
- }
57
- </script>
58
-
59
- <style lang="less" scoped>
60
- .el-textarea{
61
- ::v-deep .el-textarea__inner{
62
- border:0;
63
- border-bottom: 1px solid #dcdcdc;
64
- border-radius: 0;
65
- }
66
- }
67
- </style>
@@ -1,71 +0,0 @@
1
- <template>
2
- <el-input-number
3
- ref="number"
4
- :disabled="disabled"
5
- :controls="false"
6
- :placeholder="placeholder"
7
- :precision="percision"
8
- :min="0"
9
- :value="value"
10
- @input="handleInput"
11
- />
12
- </template>
13
- <script>
14
- export default {
15
- components: {
16
-
17
- },
18
- props: {
19
- value: {
20
- type: Number,
21
- default: undefined
22
- },
23
- disabled: {
24
- type: Boolean,
25
- default: false
26
- },
27
- defaultValue: {
28
- type: Number,
29
- default: null
30
- }
31
- },
32
- inject: ['percision', 'placeholder', 'entity'],
33
- data () {
34
- return {
35
-
36
- }
37
- },
38
- created () {
39
- if (!this.value) {
40
- const initValue = this.defaultValue || null
41
- this.handleInput(initValue)
42
- }
43
- },
44
- methods: {
45
- handleInput (value) {
46
- this.$emit('input', value)
47
- }
48
- }
49
- }
50
- </script>
51
-
52
- <style scoped lang='less'>
53
- .el-input-number {
54
- width:100%;
55
-
56
- ::v-deep .el-input{
57
- height: 100%;
58
- //margin-top: -0.55vh;
59
- }
60
- ::v-deep .el-input-number{
61
- width: 100%;
62
- }
63
- ::v-deep .el-input__inner{
64
- width: 100%;
65
- border: none;
66
- border-bottom: 1px solid #DCDCDC;
67
- border-radius: 0;
68
- text-align: left;
69
- }
70
- }
71
- </style>
@@ -1,86 +0,0 @@
1
- <template>
2
- <el-select
3
- :value="selectId"
4
- filterable
5
- clearable
6
- :placeholder="placeholder"
7
- :disabled="JSON.parse(disabled)"
8
- style="display:block"
9
- @input="handleInput"
10
- @change="handleSelectChange"
11
- >
12
- <el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id" />
13
- </el-select>
14
- </template>
15
- <script>
16
- import { getEnumOptions } from '@/api/edit.js'
17
- export default {
18
- props: {
19
- value: {
20
- type: Object,
21
- default: null
22
- },
23
- disabled: {
24
- type: Boolean,
25
- default: false
26
- }
27
- },
28
- inject: ['enumType', 'placeholder', 'defaultValue'],
29
- data () {
30
- return {
31
- options: []
32
- }
33
- },
34
- computed: {
35
- selectId () {
36
- if (this.value) {
37
- return this.value.id
38
- }
39
- return ''
40
- }
41
- },
42
- async created () {
43
- const res = await getEnumOptions(this.enumType)
44
- this.options = res.data
45
- if (res.code !== 0) {
46
- return this.$message.error(res.msg)
47
- }
48
- if (!this.value) {
49
- const initValue = this.defaultValue || null
50
- this.handleInput(initValue)
51
- }
52
- },
53
- methods: {
54
- handleInput (value) {
55
- const name = this.getLabelByValue(value)
56
- const id = value
57
- this.$emit('input', { name, id })
58
- // 下面是将来处理行关闭和整单关闭的预留
59
- // if (this.field === 'is_closed') {
60
- // this.$emit('receiptClose', value)
61
- // }
62
- // if (this.field === 'line_closed') {
63
- // this.$emit('rowClose', value)
64
- // }
65
- },
66
- // 选中的值发生了变化
67
- handleSelectChange (newValue) {
68
- this.$emit('change', newValue)
69
- },
70
- getLabelByValue (newValue) {
71
- const option = this.options.find(item => item.id === newValue)
72
- return option ? option.name : null
73
- }
74
- }
75
- }
76
- </script>
77
-
78
- <style lang="less" scoped>
79
- .el-select{
80
- ::v-deep .el-input__inner{
81
- border: 0;
82
- border-bottom: 1px solid #dcdcdc;
83
- border-radius: 0;
84
- }
85
- }
86
- </style>
@@ -1,233 +0,0 @@
1
- <template>
2
- <div class="enclosure">
3
- <div class="enclosure-box">
4
- <dl v-for="(item,index) in fileList" :key="index" class="enclosure-item">
5
- <dt>
6
- <div v-if="item.suffix === 'png' || item.suffix === 'jpg' || item.suffix === 'jpeg'">
7
- <img src="./file-img/img.png">
8
- </div>
9
- <div v-else-if="item.suffix === 'pdf' ">
10
- <img src="./file-img/pdf.png">
11
- </div>
12
- <div v-else-if="item.suffix === 'xlx' || item.suffix === 'xlsx'">
13
- <img src="./file-img/excel.png">
14
- </div>
15
- <div v-else-if="item.suffix === 'doc' || item.suffix === 'docx'">
16
- <img src="./file-img/word.png">
17
- </div>
18
- <div v-else-if="item.suffix === 'zip' || item.suffix === 'rar'">
19
- <img src="./file-img/comp.png">
20
- </div>
21
- <p>{{ item.size }}Mb</p>
22
- </dt>
23
- <dd>
24
- <el-tooltip :content="item.title" placement="top">
25
- <p class="dd-title">{{ item.title }}</p>
26
- </el-tooltip>
27
- <div class="item-dd">
28
- <p @click="downloadList(item)">下载</p>
29
- <span>|</span>
30
- <p @click="delEnclosureList(item)">删除</p>
31
- </div>
32
- </dd>
33
- </dl>
34
- </div>
35
- <div class="enclosure-fot">
36
- <el-upload
37
- class="upload-demo"
38
- action=""
39
- :show-file-list="false"
40
- multiple
41
- :auto-upload="false"
42
- :file-list="fileList"
43
- :on-change="onChange"
44
- >
45
- <el-button size="mini" type="primary">选择文件</el-button>
46
- <p class="fot-text">文件可上传<span>附件</span>,<span>照片</span>和<span>PDF</span>形式</p>
47
- </el-upload>
48
- </div>
49
- </div>
50
- </template>
51
-
52
- <script>
53
- import { delAttachment, download } from '@/api/file-enclosure'
54
- export default {
55
- props: {
56
- value: { // 给后端的参数
57
- type: Array,
58
- default: () => []
59
- },
60
- fileList: { // 前端的附件列表
61
- type: Array,
62
- default: () => []
63
- },
64
- disabled: {
65
- type: Boolean,
66
- default: false
67
- }
68
- },
69
- mounted () {},
70
- methods: {
71
- onChange (file, fileList) {
72
- file.suffix = file.name.split('.')[1]
73
- file.title = file.name.split('.')[0]
74
- file.size = (file.size / 1024 / 1024).toFixed(2)
75
- this.fileList.push(file)
76
- },
77
- /**
78
- * 删除附件
79
- */
80
- delEnclosureList (item) {
81
- if (this.value.length > 0) {
82
- this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
83
- confirmButtonText: '确定',
84
- cancelButtonText: '取消',
85
- type: 'warning'
86
- }).then(() => {
87
- const index = this.fileList.findIndex(ele => { return ele === item })
88
- this.fileList.splice(index, 1)
89
-
90
- if (this.value.length > 0) {
91
- delAttachment(item.id).then((res) => {
92
- if (res.code === 0) {
93
- this.value.splice(index, 1)
94
- this.$emit('input', this.value)
95
- }
96
- })
97
- }
98
- }).catch(() => {
99
- this.$message({
100
- type: 'info',
101
- message: '已取消删除'
102
- })
103
- })
104
- return
105
- }
106
- const index = this.fileList.findIndex(ele => { return ele === item })
107
- this.fileList.splice(index, 1)
108
- },
109
- /**
110
- * 下载附件
111
- */
112
- async downloadList (item) {
113
- const findItem = this.value.find(ele => ele.id === item.id)
114
- // const a = document.createElement('a')
115
- // a.download = findItem.submittedFileName
116
- // a.href = findItem.url
117
- // a.click()
118
- const res = await download(item.id)
119
- const blob = new Blob([res])
120
- if ('download' in document.createElement('a')) {
121
- const link = document.createElement('a') // 创建a标签
122
- link.download = findItem.submittedFileName // a标签添加属性
123
- link.style.display = 'none'
124
- link.href = URL.createObjectURL(blob)
125
- document.body.appendChild(link)
126
- link.click() // 执行下载
127
- URL.revokeObjectURL(link.href) // 释放url
128
- document.body.removeChild(link) // 释放标签
129
- } else {
130
- // IE10+下载
131
- navigator.msSaveBlob(blob)
132
- }
133
- }
134
- }
135
- }
136
-
137
- </script>
138
- <style lang='less' scoped>
139
- p{
140
- margin: 0;
141
- padding: 0;
142
- height: 2vh;
143
- }
144
- .enclosure{
145
- width: 30vw;
146
- height: 28vh;
147
- background: #ffffff;
148
- border: 1px dashed #dcdcdc;
149
- padding: 0vh 2vw 0.5vh;
150
- box-sizing: border-box;
151
- display: flex;
152
- flex-direction: column;
153
- .enclosure-box{
154
- flex: 1;
155
- // margin-bottom: 0.5vh;
156
- display: flex;
157
- overflow-x: auto;
158
- .enclosure-item{
159
- display: flex;
160
- flex-direction: column;
161
- justify-content: center;
162
- align-items: center;
163
- margin-left: 5vw;
164
- >dt{
165
- >div{
166
- width: 3vw;
167
- height: 7vh;
168
- >img{
169
- width: 100%;
170
- height: 100%;
171
- display: block;
172
- }
173
- }
174
- >p{
175
- width: 100%;
176
- text-align: center;
177
- color: #9CA2A7;
178
- }
179
- }
180
- >dd{
181
- width: 4vw;
182
- margin: 0;
183
- .item-dd{
184
- width: 100%;
185
- height: 3vh;
186
- display: flex;
187
- color: #0C4C8E;
188
- cursor: pointer;
189
- justify-content: space-around;
190
- font-family: Source Han Sans SC, Source Han Sans SC-Regular;
191
- }
192
- .dd-title{
193
- height: 3vh;
194
- display: -webkit-box;
195
- -webkit-box-orient: vertical;
196
- -webkit-line-clamp: 2;
197
- overflow: hidden;
198
- cursor: default;
199
- }
200
- }
201
- p{
202
- text-align: center;
203
- margin: 0;
204
- }
205
- }:nth-child(1) {
206
- margin: 0;
207
- }
208
- }
209
- .enclosure-box::-webkit-scrollbar {
210
- width: 5px;
211
- height: 5px;
212
- }
213
- .enclosure-box::-webkit-scrollbar-thumb {
214
- background-color: #eee;
215
- -webkit-border-radius: 2em;
216
- -moz-border-radius: 2em;
217
- border-radius: 2em;
218
- }
219
- .enclosure-fot{
220
- width: 100%;
221
- display: flex;
222
- justify-content: center;
223
- .fot-text{
224
- width: 100%;
225
- font-size: 1.4vh;
226
- color: #666666;
227
- >span{
228
- color: #0C4C8E;
229
- }
230
- }
231
- }
232
- }
233
- </style>
@@ -1,7 +0,0 @@
1
- import Tinput from './index.vue'
2
-
3
- Tinput.install = function (Vue) {
4
- Vue.component(Tinput.name, Tinput)
5
- }
6
-
7
- export default Tinput