@tongfun/tf-widget 0.1.6 → 0.1.10

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 (80) hide show
  1. package/.browserslistrc +3 -3
  2. package/.editorconfig +5 -5
  3. package/.eslintrc.js +17 -17
  4. package/README.md +39 -8
  5. package/dist/css/chunk-9c7a8e06.920744ef.css +1 -0
  6. package/dist/css/chunk-vendors.de967301.css +1 -0
  7. package/dist/css/index.153bd82e.css +1 -0
  8. package/dist/fonts/element-icons.535877f5.woff +0 -0
  9. package/dist/fonts/element-icons.732389de.ttf +0 -0
  10. package/dist/js/chunk-9c7a8e06.ffff58b5.js +1 -0
  11. package/dist/js/chunk-vendors.45086d09.js +39 -0
  12. package/dist/js/index.52bcef0d.js +1 -0
  13. package/lib/css/1.920744ef.css +1 -0
  14. package/lib/tf-widget.common.1.js +387 -0
  15. package/lib/tf-widget.common.js +85007 -63712
  16. package/lib/tf-widget.css +1 -1
  17. package/lib/tf-widget.umd.1.js +387 -0
  18. package/lib/tf-widget.umd.js +85007 -63712
  19. package/lib/tf-widget.umd.min.1.js +1 -0
  20. package/lib/tf-widget.umd.min.js +10 -3
  21. package/package/t-data-list/index.js +6 -0
  22. package/package/t-data-list/main.vue +192 -0
  23. package/package/t-data-list/src/condition-input/basic.vue +31 -0
  24. package/package/t-data-list/src/condition-input/date.vue +106 -0
  25. package/package/t-data-list/src/condition-input/index.vue +100 -0
  26. package/package/t-data-list/src/condition-input/input.vue +31 -0
  27. package/package/t-data-list/src/condition-input/number.vue +115 -0
  28. package/package/t-data-list/src/condition-input/select.vue +86 -0
  29. package/package/t-data-list/src/js/fieldTypeEnum.js +10 -0
  30. package/package/t-data-list/src/js/operatorEnum.js +109 -0
  31. package/package/t-data-list/src/js/qureyParamsEnum.js +4 -0
  32. package/package/t-data-list/src/js/util.js +34 -0
  33. package/package/t-data-list/src/mixins/button-controll-mixin.js +77 -0
  34. package/package/t-data-list/src/pushdown/push-down.vue +158 -0
  35. package/package/t-data-list/src/t-list-search.vue +32 -0
  36. package/package/t-data-list/src/t-plan/condition-always-item.vue +143 -0
  37. package/package/t-data-list/src/t-plan/condition-mult-item.vue +222 -0
  38. package/package/t-data-list/src/t-plan/index.vue +190 -0
  39. package/package/t-data-list/src/t-plan/plan-content.vue +396 -0
  40. package/package/t-data-list/src/t-table/index.vue +120 -0
  41. package/package/t-data-list/src/t-table/table-group-item-edit.vue +238 -0
  42. package/package/t-data-list/src/t-table/table-group-item.vue +87 -0
  43. package/package/t-data-list/src/t-table/table-group.vue +179 -0
  44. package/package/t-data-list/src/t-table/table-records-header-popover.vue +250 -0
  45. package/package/t-data-list/src/t-table/table-records-selected.vue +159 -0
  46. package/package/t-data-list/src/t-table/table-records.vue +324 -0
  47. package/package/t-input/children/address.vue +101 -0
  48. package/package/t-input/children/basic-display.vue +41 -0
  49. package/package/t-input/children/basic.vue +251 -0
  50. package/package/t-input/children/date.vue +89 -0
  51. package/package/t-input/children/group-components/group-dialog.vue +350 -0
  52. package/package/t-input/children/group.vue +126 -0
  53. package/package/t-input/children/input.vue +72 -0
  54. package/package/t-input/children/number.vue +74 -0
  55. package/package/t-input/children/select.vue +89 -0
  56. package/package/t-input/children/tfile/fiile-enclosure.vue +233 -0
  57. package/package/t-input/children/tfile/file-img/comp.png +0 -0
  58. package/package/t-input/children/tfile/file-img/excel.png +0 -0
  59. package/package/t-input/children/tfile/file-img/img.png +0 -0
  60. package/package/t-input/children/tfile/file-img/pdf.png +0 -0
  61. package/package/t-input/children/tfile/file-img/word.png +0 -0
  62. package/package/t-input/index.js +7 -0
  63. package/package/t-input/index.vue +337 -0
  64. package/package/t-input/tInputCache.js +24 -0
  65. package/package/tf-layout/README.md +69 -0
  66. package/package/tf-layout/index.js +8 -0
  67. package/package/tf-layout/src/components/tf-labelbar.vue +376 -0
  68. package/package/tf-layout/src/components/tf-menu.vue +180 -0
  69. package/package/tf-layout/src/components/tf-right-menu.vue +89 -0
  70. package/package/tf-layout/src/components/tf-rotate-box.vue +50 -0
  71. package/package/tf-layout/src/tf-layout.vue +115 -0
  72. package/package/tf-widget/src/children/decimal.vue +15 -16
  73. package/package/tf-widget/src/children/integer.vue +15 -16
  74. package/package.json +4 -2
  75. package/postinstall.js +10 -10
  76. package/src/api/file-enclosure.js +26 -0
  77. package/src/api/push-down.js +19 -0
  78. package/src/api/tableV3.js +186 -0
  79. package/src/index.js +11 -3
  80. package/src/mixins/t-data-query-mixin.js +289 -0
@@ -0,0 +1,89 @@
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
+ components: {
19
+
20
+ },
21
+ props: {
22
+ value: {
23
+ type: Object,
24
+ default: null
25
+ },
26
+ disabled: {
27
+ type: Boolean,
28
+ default: false
29
+ }
30
+ },
31
+ inject: ['enumType', 'placeholder', 'defaultValue'],
32
+ data () {
33
+ return {
34
+ options: []
35
+ }
36
+ },
37
+ computed: {
38
+ selectId () {
39
+ if (this.value) {
40
+ return this.value.id
41
+ }
42
+ return ''
43
+ }
44
+ },
45
+ async created () {
46
+ const res = await getEnumOptions(this.enumType)
47
+ this.options = res.data
48
+ if (res.code !== 0) {
49
+ return this.$message.error(res.msg)
50
+ }
51
+ if (!this.value) {
52
+ const initValue = this.defaultValue || null
53
+ this.handleInput(initValue)
54
+ }
55
+ },
56
+ methods: {
57
+ handleInput (value) {
58
+ const name = this.getLabelByValue(value)
59
+ const id = value
60
+ this.$emit('input', { name, id })
61
+ // 下面是将来处理行关闭和整单关闭的预留
62
+ // if (this.field === 'is_closed') {
63
+ // this.$emit('receiptClose', value)
64
+ // }
65
+ // if (this.field === 'line_closed') {
66
+ // this.$emit('rowClose', value)
67
+ // }
68
+ },
69
+ // 选中的值发生了变化
70
+ handleSelectChange (newValue) {
71
+ this.$emit('change', newValue)
72
+ },
73
+ getLabelByValue (newValue) {
74
+ const option = this.options.find(item => item.id === newValue)
75
+ return option ? option.name : null
76
+ }
77
+ }
78
+ }
79
+ </script>
80
+
81
+ <style lang="less" scoped>
82
+ .el-select{
83
+ ::v-deep .el-input__inner{
84
+ border: 0;
85
+ border-bottom: 1px solid #dcdcdc;
86
+ border-radius: 0;
87
+ }
88
+ }
89
+ </style>
@@ -0,0 +1,233 @@
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>
@@ -0,0 +1,7 @@
1
+ import Tinput from './index.vue'
2
+
3
+ Tinput.install = function (Vue) {
4
+ Vue.component(Tinput.name, Tinput)
5
+ }
6
+
7
+ export default Tinput
@@ -0,0 +1,337 @@
1
+ <template>
2
+ <div>
3
+ <component
4
+ :is="typeRelations[type]"
5
+ v-if="entity || notForm"
6
+ class="common-input"
7
+ :value="value"
8
+ :target="target"
9
+ :show-field="showField"
10
+ v-bind="property"
11
+ :common-flag="commonFlag"
12
+ :append-to-body="false"
13
+ :modal-append-to-body="true"
14
+ @selected="handleSelected"
15
+ @handleSelected="handleSelected"
16
+ @input="handleInput"
17
+ @isDel="handleDel"
18
+ @change="handleChange"
19
+ @delete="$emit('delete')"
20
+ @suggestSelected="$emit('suggestSelected',$event)"
21
+ />
22
+
23
+ <el-form-item v-else :label-width="labelWidth" :prop="prop">
24
+ <template v-slot:label>
25
+ <el-tooltip effect="dark" :content="title" placement="top">
26
+ <span>{{ title }}</span>
27
+ </el-tooltip>
28
+ </template>
29
+ <component
30
+ :is="typeRelations[type]"
31
+ v-if="type !== 'basicCus'"
32
+ class="common-input"
33
+ :value="value"
34
+ :target="target"
35
+ :show-field="showField"
36
+ :common-flag="commonFlag"
37
+ :append-to-body="true"
38
+ :modal-append-to-body="false"
39
+ v-bind="property"
40
+ @isDel="handleDel"
41
+ @selected="handleSelected"
42
+ @handleSelected="handleSelected"
43
+ @input="handleInput"
44
+ @change="handleChange"
45
+ @delete="$emit('delete')"
46
+ @suggestSelected="$emit('suggestSelected',$event)"
47
+ />
48
+
49
+ <slot />
50
+ </el-form-item>
51
+ </div>
52
+ </template>
53
+ <script>
54
+ import tinput from './children/input.vue'
55
+ import tselect from './children/select.vue'
56
+ import tdate from './children/date.vue'
57
+ import tnumber from './children/number.vue'
58
+ import tbasicDisplay from './children/basic-display'
59
+ import tfile from './children/tfile/fiile-enclosure.vue'
60
+ import tbasic from './children/basic.vue'
61
+ import tGroup from './children/group.vue'
62
+ import tAddress from './children/address.vue'
63
+ import basicData from '../tf-widget/src/children/basic-data/basic-data.vue'
64
+ import { getTableIdByTableName } from '@/api/edit.js'
65
+ export default {
66
+ name: 'Tinput',
67
+ components: {
68
+ tinput, tnumber, tselect, tdate, tfile, tbasic, tbasicDisplay, basicData, tGroup, tAddress
69
+ },
70
+ props: {
71
+ // 双向绑定
72
+ value: {
73
+ type: [String, Number, Object, Array],
74
+ default: undefined
75
+ },
76
+ /**
77
+ * 控件类型
78
+ * input : 文本输入
79
+ * select: 下拉选择
80
+ * date 日期
81
+ * datetime 日期时间
82
+ * integer 整数
83
+ * decimal 小数
84
+ * text 文本域
85
+ * basicDisplay 基础资料展示字段,用于创建人等永远不能被填写的字段
86
+ * basicData 通用的基础资料
87
+ * basicCus 非通用的基础资料,
88
+ */
89
+ type: {
90
+ type: String,
91
+ default: 'input'
92
+ },
93
+ /**
94
+ * 控件属性
95
+ */
96
+ // el-form-item 属性
97
+ labelWidth: {
98
+ type: String,
99
+ default: '150px'
100
+ },
101
+ // el-form-item属性
102
+ title: {
103
+ type: String,
104
+ default: ''
105
+ },
106
+ // el form item属性,用来指定校验的属性的规则
107
+ prop: {
108
+ type: String,
109
+ default: ''
110
+ },
111
+ // 不在表单中使用这个控件,默认在表单中
112
+ notForm: {
113
+ type: Boolean,
114
+ default: false
115
+ },
116
+ // 在单据体中显示,当使用这个属性,默认开启not form
117
+ entity: {
118
+ type: Boolean,
119
+ default: false
120
+ },
121
+ /**
122
+ * 子组件的通用属性
123
+ */
124
+ // 默认值
125
+ defaultValue: {
126
+ type: String,
127
+ default: ''
128
+ },
129
+ // 关闭
130
+ disabled: {
131
+ type: Boolean,
132
+ default: false
133
+ },
134
+ // 提示
135
+ placeholder: {
136
+ type: String,
137
+ default: ''
138
+ },
139
+ /**
140
+ * select枚举类型属性
141
+ */
142
+ // 下拉框属性,获取下拉的选项的参数
143
+ enumType: {
144
+ type: String,
145
+ default: ''
146
+ },
147
+
148
+ /**
149
+ * 数值类型属性
150
+ */
151
+ // 小数属性,保留的小数个数
152
+ percision: {
153
+ type: Number,
154
+ default: 2
155
+ },
156
+
157
+ /**
158
+ * 多行文本文本类型
159
+ */
160
+ // 文本域的行数
161
+ rows: {
162
+ type: Number,
163
+ default: 3
164
+ },
165
+
166
+ /**
167
+ * 基础资料类型属性
168
+ */
169
+ // 基础资料相关信息的网络请求地址,和基础资料相关的一个请求参数
170
+ target: {
171
+ type: String,
172
+ default: ''
173
+ },
174
+ // 基础资料的搜索限制条件,将会被解析成多个高级过滤条件,拼接到查询条件里面
175
+ // 格式如下:{a:{name:'xx',id:'xx'}
176
+ limitation: {
177
+ type: Object,
178
+ default: () => {}
179
+ },
180
+ // 指定基础资料显示哪个属性作为展示的字段
181
+ // 没有值使用后端提供的配置,有值则覆盖后端的配置
182
+ displayField: {
183
+ type: String,
184
+ default: null
185
+ },
186
+ // todo:这两个属性功能已经重复,需要对接 // 基础资料需要展示的数据
187
+ showField: {
188
+ type: String,
189
+ default: ''
190
+ },
191
+ // 通用基础资料的表名
192
+ tableConfig: {
193
+ type: Object,
194
+ default: function () {
195
+ return {
196
+ enum: {},
197
+ name: ''
198
+ }
199
+ }
200
+ },
201
+ // 此标识用于写死的组件,将事件发射出去自己处理 ???????????
202
+ commonFlag: {
203
+ type: Boolean,
204
+ default: false
205
+ },
206
+ // 附件上传的文件列表
207
+ fileList: {
208
+ type: Array,
209
+ default: () => []
210
+ }
211
+
212
+ },
213
+ provide () {
214
+ return {
215
+ entity: this.entity,
216
+ target: this.target,
217
+ enumType: this.enumType,
218
+ placeholder: this.placeholder,
219
+ // 是否是日期时间控件
220
+ datetime: this.type === 'datetime',
221
+ // 小数的情况下,指定小数的精度
222
+ percision: this.type === 'decimal' ? this.percision : null,
223
+ // 是否是文本域控件
224
+ text: this.type === 'text',
225
+ // 文本域的行数
226
+ rows: this.type === 'text' ? this.rows : null,
227
+ defaultValue: this.defaultValue
228
+ }
229
+ },
230
+ data () {
231
+ return {
232
+ typeRelations: {
233
+ input: 'tinput',
234
+ text: 'tinput',
235
+ date: 'tdate',
236
+ datetime: 'tdate',
237
+ integer: 'tnumber',
238
+ decimal: 'tnumber',
239
+ select: 'tselect',
240
+ basicDisplay: 'tbasicDisplay',
241
+ basicData: 'basicData',
242
+ basic: 'tbasic',
243
+ file: 'tfile',
244
+ group: 'tGroup',
245
+ address: 'tAddress'
246
+ }
247
+ }
248
+ },
249
+ computed: {
250
+ // 部分属性加入到计算属性传递下去,不使用provide的属性是为了获取响应式支持
251
+ property () {
252
+ return {
253
+ disabled: this.disabled,
254
+ tableId: this.tableConfig.enum[this.tableConfig.name] || null,
255
+ fileList: this.fileList,
256
+ displayField: this.displayField,
257
+ limitation: this.limitation
258
+ }
259
+ }
260
+ },
261
+ created () {
262
+ if (this.type === 'basicData') {
263
+ this.getTableId()
264
+ }
265
+ },
266
+ methods: {
267
+ // 通知触发了删除事件
268
+ handleDel () {
269
+ this.$emit('isDel')
270
+ },
271
+ // 基础资料的方法
272
+ handleSelected (rows) {
273
+ this.$emit('selected', rows)
274
+ },
275
+ // 选中的值发生了变化,目前仅仅是为了 枚举/下拉类型使用
276
+ handleChange (newValue) {
277
+ this.$emit('change', newValue)
278
+ },
279
+ handleInput (value) {
280
+ this.$emit('input', value)
281
+ },
282
+ async getTableId () {
283
+ const conf = this.tableConfig
284
+ // 如果已经存在了tableId,则不进行获取
285
+ if (conf.enum[conf.name]) {
286
+ return
287
+ }
288
+ const res = await getTableIdByTableName(conf.name)
289
+ if (res.code !== 0) {
290
+ return this.$message.error(res.msg)
291
+ }
292
+ conf.enum[conf.name] = res.data
293
+ }
294
+ }
295
+ }
296
+ </script>
297
+
298
+ <style scoped lang='less'>
299
+ .common-input {
300
+ // 即便是disable,也不改变背景色
301
+ // 采用直接子元素的方式避免影响到分页的样式
302
+ ::v-deep >.el-input__inner {
303
+ background: #fff !important;
304
+ border:none;
305
+ border-bottom:1px solid #DCDCDC;
306
+ border-radius: 0;
307
+ }
308
+ ::v-deep>div{
309
+ >div{
310
+ >.el-input__inner{
311
+ background: #fff !important;
312
+ border:none;
313
+ border-bottom:1px solid #DCDCDC;
314
+ border-radius: 0;
315
+
316
+ }
317
+ >div{
318
+ >.el-input__inner{
319
+ background: #fff !important;
320
+ border:none;
321
+ border-bottom:1px solid #DCDCDC;
322
+ border-radius: 0;
323
+ }
324
+ }
325
+ }
326
+ }
327
+
328
+ }
329
+ .el-form-item{
330
+ ::v-deep .el-form-item__label{
331
+ overflow: hidden;
332
+ white-space: nowrap;
333
+ text-overflow: ellipsis;
334
+ }
335
+ }
336
+
337
+ </style>
@@ -0,0 +1,24 @@
1
+ const ProxyCreateSingleton = (function () {
2
+ let instance = null
3
+ return function () {
4
+ if (instance) {
5
+ return instance
6
+ }
7
+ instance = new InputData()
8
+ return instance
9
+ }
10
+ })()
11
+ class InputData {
12
+ #cacheData = new Map()
13
+ getCacheData (key) {
14
+ if (key) {
15
+ return this.#cacheData.get(key)
16
+ }
17
+ return this.#cacheData
18
+ }
19
+
20
+ setCacheData (key, value) {
21
+ this.#cacheData.set(key, value)
22
+ }
23
+ }
24
+ export default ProxyCreateSingleton