@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.
- package/README.md +4 -0
- package/lib/tf-widget.common.js +264 -226
- package/lib/tf-widget.css +1 -1
- package/lib/tf-widget.umd.js +264 -226
- package/lib/tf-widget.umd.min.js +4 -4
- package/package.json +1 -1
- package/package/svg-icon/index.js +0 -8
- package/package/svg-icon/src/SvgIcon.vue +0 -59
- package/package/t-data-list/index.js +0 -6
- package/package/t-data-list/main.vue +0 -193
- package/package/t-data-list/src/condition-input/basic.vue +0 -31
- package/package/t-data-list/src/condition-input/date.vue +0 -106
- package/package/t-data-list/src/condition-input/index.vue +0 -100
- package/package/t-data-list/src/condition-input/input.vue +0 -31
- package/package/t-data-list/src/condition-input/number.vue +0 -115
- package/package/t-data-list/src/condition-input/select.vue +0 -86
- package/package/t-data-list/src/js/fieldTypeEnum.js +0 -10
- package/package/t-data-list/src/js/operatorEnum.js +0 -108
- package/package/t-data-list/src/js/qureyParamsEnum.js +0 -4
- package/package/t-data-list/src/js/util.js +0 -34
- package/package/t-data-list/src/mixins/button-controll-mixin.js +0 -93
- package/package/t-data-list/src/pushdown/push-down.vue +0 -158
- package/package/t-data-list/src/t-list-search.vue +0 -36
- package/package/t-data-list/src/t-plan/condition-always-item.vue +0 -143
- package/package/t-data-list/src/t-plan/condition-mult-item.vue +0 -222
- package/package/t-data-list/src/t-plan/index.vue +0 -195
- package/package/t-data-list/src/t-plan/plan-content.vue +0 -389
- package/package/t-data-list/src/t-table/index.vue +0 -129
- package/package/t-data-list/src/t-table/table-group-item-edit.vue +0 -238
- package/package/t-data-list/src/t-table/table-group-item.vue +0 -87
- package/package/t-data-list/src/t-table/table-group.vue +0 -180
- package/package/t-data-list/src/t-table/table-records-header-popover.vue +0 -246
- package/package/t-data-list/src/t-table/table-records-selected.vue +0 -159
- package/package/t-data-list/src/t-table/table-records.vue +0 -336
- package/package/t-input/children/address.vue +0 -101
- package/package/t-input/children/basic-display.vue +0 -41
- package/package/t-input/children/basic.vue +0 -261
- package/package/t-input/children/date.vue +0 -84
- package/package/t-input/children/group-components/group-dialog.vue +0 -344
- package/package/t-input/children/group.vue +0 -126
- package/package/t-input/children/input.vue +0 -67
- package/package/t-input/children/number.vue +0 -71
- package/package/t-input/children/select.vue +0 -86
- package/package/t-input/children/tfile/fiile-enclosure.vue +0 -233
- package/package/t-input/children/tfile/file-img/comp.png +0 -0
- package/package/t-input/children/tfile/file-img/excel.png +0 -0
- package/package/t-input/children/tfile/file-img/img.png +0 -0
- package/package/t-input/children/tfile/file-img/pdf.png +0 -0
- package/package/t-input/children/tfile/file-img/word.png +0 -0
- package/package/t-input/index.js +0 -7
- package/package/t-input/index.vue +0 -337
- package/package/t-input/tInputCache.js +0 -24
- package/package/tf-icon-picker/README.md +0 -8
- package/package/tf-icon-picker/index.js +0 -8
- package/package/tf-icon-picker/src/tf-icon-picker.vue +0 -266
- package/package/tf-layout/README.md +0 -115
- package/package/tf-layout/index.js +0 -8
- package/package/tf-layout/src/components/tf-labelbar.vue +0 -394
- package/package/tf-layout/src/components/tf-menu.vue +0 -180
- package/package/tf-layout/src/components/tf-right-menu.vue +0 -89
- package/package/tf-layout/src/components/tf-rotate-box.vue +0 -50
- package/package/tf-layout/src/tf-layout.vue +0 -140
- package/package/tf-widget/index.js +0 -8
- package/package/tf-widget/src/assets/common-input.less +0 -11
- package/package/tf-widget/src/children/basic-data/basic-data.vue +0 -366
- package/package/tf-widget/src/children/basic-data/dependcy/basic-data-selector.vue +0 -1087
- package/package/tf-widget/src/children/basic-data/dependcy/common-table.vue +0 -750
- package/package/tf-widget/src/children/basic-data/dependcy/condition-filter.vue +0 -519
- package/package/tf-widget/src/children/basic-data/dependcy/pagination.vue +0 -93
- package/package/tf-widget/src/children/basic-data/dependcy/table-control.vue +0 -240
- package/package/tf-widget/src/children/basic-data/dependcy/view-picture.vue +0 -108
- package/package/tf-widget/src/children/date-time.vue +0 -103
- package/package/tf-widget/src/children/date.vue +0 -103
- package/package/tf-widget/src/children/decimal.vue +0 -115
- package/package/tf-widget/src/children/integer.vue +0 -104
- package/package/tf-widget/src/children/property.vue +0 -59
- package/package/tf-widget/src/children/single-line-text.vue +0 -82
- package/package/tf-widget/src/children/small-pictures.vue +0 -223
- package/package/tf-widget/src/children/text-area.vue +0 -74
- package/package/tf-widget/src/children/tf-select.vue +0 -113
- package/package/tf-widget/src/tf-widget.vue +0 -175
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-show="showMenu"
|
|
4
|
-
class="tf-right-menu"
|
|
5
|
-
:style="{ top: top + 'px', left: left + 'px' }"
|
|
6
|
-
>
|
|
7
|
-
<p @click="rightMenuClick('closeLeft')">
|
|
8
|
-
<i class="el-icon-back" /> 关闭左侧
|
|
9
|
-
</p>
|
|
10
|
-
<p @click="rightMenuClick('closeRight')">
|
|
11
|
-
<i class="el-icon-right" /> 关闭右侧
|
|
12
|
-
</p>
|
|
13
|
-
<p @click="rightMenuClick('closeOther')">
|
|
14
|
-
<i class="el-icon-circle-close" /> 关闭其他
|
|
15
|
-
</p>
|
|
16
|
-
<p @click="rightMenuClick('closeAll')">
|
|
17
|
-
<i class="el-icon-circle-close" /> 全部关闭
|
|
18
|
-
</p>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script>
|
|
23
|
-
export default {
|
|
24
|
-
props: {
|
|
25
|
-
top: {
|
|
26
|
-
default: 0,
|
|
27
|
-
type: Number
|
|
28
|
-
},
|
|
29
|
-
left: {
|
|
30
|
-
default: 0,
|
|
31
|
-
type: Number
|
|
32
|
-
},
|
|
33
|
-
showMenu: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: false
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
/**
|
|
40
|
-
* @description 右键点击事件
|
|
41
|
-
*/
|
|
42
|
-
rightMenuClick (params) {
|
|
43
|
-
this.$emit('rightMenuClick', params)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<style lang="less" scoped>
|
|
50
|
-
.tf-right-menu {
|
|
51
|
-
position: fixed;
|
|
52
|
-
z-index: 9999;
|
|
53
|
-
width: 120px;
|
|
54
|
-
height: 166px;
|
|
55
|
-
background: white;
|
|
56
|
-
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
|
|
57
|
-
border-radius: 4px;
|
|
58
|
-
box-sizing: border-box;
|
|
59
|
-
padding: 10px 0;
|
|
60
|
-
p {
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
height: 36px;
|
|
63
|
-
margin: 0;
|
|
64
|
-
font-size: 14px;
|
|
65
|
-
display: flex;
|
|
66
|
-
align-items: center;
|
|
67
|
-
justify-content: space-between;
|
|
68
|
-
box-sizing: border-box;
|
|
69
|
-
padding: 0 20px;
|
|
70
|
-
color: #606266;
|
|
71
|
-
&:hover {
|
|
72
|
-
background: #ecf5ff;
|
|
73
|
-
color: #46a6ff;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
&::before {
|
|
77
|
-
content: "";
|
|
78
|
-
position: absolute;
|
|
79
|
-
width: 12px;
|
|
80
|
-
height: 6px;
|
|
81
|
-
top: -6px;
|
|
82
|
-
right: 10px;
|
|
83
|
-
background: white;
|
|
84
|
-
clip-path: polygon(50% 0px, 100% 100%, 0px 100%);
|
|
85
|
-
box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
|
|
86
|
-
border-radius: 1px;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
</style>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="tf-rotate-box">
|
|
3
|
-
<span class="close">
|
|
4
|
-
<i />
|
|
5
|
-
<i />
|
|
6
|
-
<i />
|
|
7
|
-
<i />
|
|
8
|
-
</span>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
export default {}
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<style lang="less" scoped>
|
|
17
|
-
.tf-rotate-box {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
.close {
|
|
22
|
-
width: 14px;
|
|
23
|
-
height: 14px;
|
|
24
|
-
display: flex;
|
|
25
|
-
flex-wrap: wrap;
|
|
26
|
-
align-items: center;
|
|
27
|
-
justify-content: center;
|
|
28
|
-
gap: 2px 2px;
|
|
29
|
-
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1), border 0s,
|
|
30
|
-
color 0.1s, font-size 0s;
|
|
31
|
-
&:hover {
|
|
32
|
-
transform: rotate(90deg);
|
|
33
|
-
transform-origin: 50% 50%;
|
|
34
|
-
i {
|
|
35
|
-
background: #07579a;
|
|
36
|
-
&:nth-child(1) {
|
|
37
|
-
transform: rotate(45deg);
|
|
38
|
-
transform-origin: 50% 50%;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
i {
|
|
43
|
-
margin: 0;
|
|
44
|
-
height: 6px;
|
|
45
|
-
width: 6px;
|
|
46
|
-
background: #9a9a9a;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
</style>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="tf-layout">
|
|
3
|
-
<TfMenu
|
|
4
|
-
:menus-info="menusInfo"
|
|
5
|
-
:menu-state="menuState"
|
|
6
|
-
/>
|
|
7
|
-
<div class="tf-layout-subject">
|
|
8
|
-
<TfLaberBar
|
|
9
|
-
ref="TfLaberBar"
|
|
10
|
-
:route-base="routeBase"
|
|
11
|
-
@setCache="setCache"
|
|
12
|
-
@changeMenuState="changeMenuState"
|
|
13
|
-
@deleteCache="deleteCache"
|
|
14
|
-
/>
|
|
15
|
-
<div class="tf-layout-subject-content">
|
|
16
|
-
<keep-alive :include="secondCacheArray">
|
|
17
|
-
<router-view />
|
|
18
|
-
</keep-alive>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
import TfMenu from './components/tf-menu'
|
|
26
|
-
import TfLaberBar from './components/tf-labelbar'
|
|
27
|
-
export default {
|
|
28
|
-
name: 'TfLayout',
|
|
29
|
-
components: {
|
|
30
|
-
TfMenu,
|
|
31
|
-
TfLaberBar
|
|
32
|
-
},
|
|
33
|
-
props: {
|
|
34
|
-
menusInfo: {
|
|
35
|
-
type: Array,
|
|
36
|
-
default: function () {
|
|
37
|
-
return []
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
routeBase: {
|
|
41
|
-
default: null,
|
|
42
|
-
type: String
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
data () {
|
|
46
|
-
return {
|
|
47
|
-
currencyCache: {},
|
|
48
|
-
menuState: false,
|
|
49
|
-
cacheMap: new Map(),
|
|
50
|
-
secondCacheArray: [],
|
|
51
|
-
thirdCacheArr: []
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
methods: {
|
|
55
|
-
changeMenuState (state) {
|
|
56
|
-
this.menuState = state
|
|
57
|
-
},
|
|
58
|
-
setCache (value) {
|
|
59
|
-
const key = value[2] || value[1]
|
|
60
|
-
if (this.cacheMap.get(key)) {
|
|
61
|
-
if (!this.currencyCache[key] || this.currencyCache[key] < 0) this.$set(this.currencyCache, key, 0)
|
|
62
|
-
this.currencyCache[key] += 1
|
|
63
|
-
} else {
|
|
64
|
-
this.cacheMap.set(key, value[1])
|
|
65
|
-
this.initCacheArr()
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
initCacheArr () {
|
|
69
|
-
this.secondCacheArray.push(
|
|
70
|
-
...this.arrayDiff([...this.cacheMap.values()], this.secondCacheArray)
|
|
71
|
-
)
|
|
72
|
-
this.thirdCacheArr.push(
|
|
73
|
-
...this.arrayDiff([...this.cacheMap.keys()], this.thirdCacheArr)
|
|
74
|
-
)
|
|
75
|
-
this.$emit('setSecondCache', this.secondCacheArray)
|
|
76
|
-
this.$emit('setThirdCache', this.thirdCacheArr)
|
|
77
|
-
},
|
|
78
|
-
arrayDiff (arr, arrRaw) {
|
|
79
|
-
if (Array.isArray(arr)) {
|
|
80
|
-
return arr.filter((i) => {
|
|
81
|
-
return arrRaw.indexOf(i) < 0
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
return []
|
|
85
|
-
},
|
|
86
|
-
deleteCache (value) {
|
|
87
|
-
if (Array.isArray(value)) {
|
|
88
|
-
value.forEach((item) => {
|
|
89
|
-
const key = item[2] || item[1]
|
|
90
|
-
if (`${this.currencyCache[key]}` && this.currencyCache[key] >= 0) {
|
|
91
|
-
this.currencyCache[key] -= 1
|
|
92
|
-
if (this.currencyCache[key] < 0) {
|
|
93
|
-
this.cacheMap.delete(key)
|
|
94
|
-
this.thirdCacheArr.splice(
|
|
95
|
-
this.thirdCacheArr.indexOf(key),
|
|
96
|
-
1
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
} else {
|
|
100
|
-
this.cacheMap.delete(key)
|
|
101
|
-
this.thirdCacheArr.splice(
|
|
102
|
-
this.thirdCacheArr.indexOf(key),
|
|
103
|
-
1
|
|
104
|
-
)
|
|
105
|
-
}
|
|
106
|
-
if ([...this.cacheMap.values()].indexOf(item[1]) === -1) {
|
|
107
|
-
this.secondCacheArray.splice(
|
|
108
|
-
this.secondCacheArray.indexOf(item[2]),
|
|
109
|
-
1
|
|
110
|
-
)
|
|
111
|
-
}
|
|
112
|
-
})
|
|
113
|
-
this.$emit('setSecondCache', this.secondCacheArray)
|
|
114
|
-
this.$emit('setThirdCache', this.thirdCacheArr)
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
</script>
|
|
120
|
-
|
|
121
|
-
<style lang="less" scoped>
|
|
122
|
-
.tf-layout {
|
|
123
|
-
height: 100vh;
|
|
124
|
-
width: 100vw;
|
|
125
|
-
display: flex;
|
|
126
|
-
.tf-layout-subject {
|
|
127
|
-
flex: 1;
|
|
128
|
-
height: 94.82vh;
|
|
129
|
-
width: 100%;
|
|
130
|
-
overflow: hidden;
|
|
131
|
-
.tf-layout-subject-content {
|
|
132
|
-
width: 100%;
|
|
133
|
-
height: calc(100% - 35px);
|
|
134
|
-
background: rgb(241, 241, 241);
|
|
135
|
-
box-sizing: border-box;
|
|
136
|
-
padding: 5px 0 0 0;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
</style>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// 颜色定义
|
|
2
|
-
@disabledBgColor: #f0f0f5;
|
|
3
|
-
|
|
4
|
-
::v-deep .el-input__inner[disabled = 'disabled']{
|
|
5
|
-
background: @disabledBgColor;
|
|
6
|
-
border-color: @disabledBgColor;
|
|
7
|
-
}
|
|
8
|
-
::v-deep .el-textarea__inner[disabled = 'disabled']{
|
|
9
|
-
background: @disabledBgColor;
|
|
10
|
-
border-color: @disabledBgColor;
|
|
11
|
-
}
|
|
@@ -1,366 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-autocomplete
|
|
4
|
-
v-model="displayName"
|
|
5
|
-
popper-class="advice-poper"
|
|
6
|
-
:class="basicDataStyle"
|
|
7
|
-
:fetch-suggestions="getAdvice"
|
|
8
|
-
:value-key="displayField"
|
|
9
|
-
:trigger-on-focus="false"
|
|
10
|
-
:placeholder="placeholder"
|
|
11
|
-
:disabled="JSON.parse(disabled)"
|
|
12
|
-
@select="handleSelect"
|
|
13
|
-
@keydown.delete.native="handleDeleteKeyDown"
|
|
14
|
-
>
|
|
15
|
-
<i slot="suffix" :class=" disabled ? 'el-icon-lock' : 'el-icon-search' " style="cursor: pointer" @click="showDialog" />
|
|
16
|
-
<template slot-scope="{item}">
|
|
17
|
-
<div>{{ item[displayField] + ' ' + '[' + item.head__code + ']' }}</div>
|
|
18
|
-
</template>
|
|
19
|
-
</el-autocomplete>
|
|
20
|
-
|
|
21
|
-
<el-dialog
|
|
22
|
-
:visible.sync="dialogVisible"
|
|
23
|
-
width="80%"
|
|
24
|
-
append-to-body
|
|
25
|
-
:modal-append-to-body="false"
|
|
26
|
-
>
|
|
27
|
-
<div class="dataDialog">
|
|
28
|
-
<BasicDataSelector :table-id="tableId" :limit-show="limitShow" :dialog-visible="dialogVisible" :much-select="muchSelect" @rowSelect="handleRowSelect" />
|
|
29
|
-
</div>
|
|
30
|
-
<span slot="footer" class="dialog-footer">
|
|
31
|
-
<el-button class="common-header-button close" type="primary" @click="close">取 消</el-button>
|
|
32
|
-
<el-button class="common-header-button" type="primary" @click="handleDialogConfirm">确 定</el-button>
|
|
33
|
-
</span>
|
|
34
|
-
</el-dialog>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
<script>
|
|
38
|
-
import { getBasicDataSearchAdvice, getFormData } from '@/api/edit.js'
|
|
39
|
-
import BasicDataSelector from './dependcy/basic-data-selector.vue'
|
|
40
|
-
export default {
|
|
41
|
-
components: {
|
|
42
|
-
BasicDataSelector
|
|
43
|
-
// DataSelectorDialog
|
|
44
|
-
},
|
|
45
|
-
props: {
|
|
46
|
-
value: { // 双向绑定
|
|
47
|
-
type: [String, Object],
|
|
48
|
-
default: () => {
|
|
49
|
-
return { name: '', id: '' }
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
// 当选中一条基础资料的时候,默认选择基础资料的head__name属性
|
|
53
|
-
displayField: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: 'head__name'
|
|
56
|
-
},
|
|
57
|
-
basicDataStyle: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: 'default'
|
|
60
|
-
},
|
|
61
|
-
tableId: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: ''
|
|
64
|
-
},
|
|
65
|
-
disabled: {
|
|
66
|
-
type: [Boolean, String],
|
|
67
|
-
default: false
|
|
68
|
-
},
|
|
69
|
-
placeholder: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: ''
|
|
72
|
-
},
|
|
73
|
-
// 当前控件操作的属性所在的数据对象(单据体中体现为一行数据
|
|
74
|
-
scopeData: {
|
|
75
|
-
type: Object,
|
|
76
|
-
default: null
|
|
77
|
-
},
|
|
78
|
-
relationFields: {
|
|
79
|
-
type: [Object, Array],
|
|
80
|
-
default: null
|
|
81
|
-
},
|
|
82
|
-
defaultValue: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: ''
|
|
85
|
-
},
|
|
86
|
-
field: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: ''
|
|
89
|
-
},
|
|
90
|
-
widgets: {
|
|
91
|
-
type: Array,
|
|
92
|
-
default: () => []
|
|
93
|
-
},
|
|
94
|
-
muchSelect: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false
|
|
97
|
-
},
|
|
98
|
-
inputMoreSelect: { // 开启input内的多选
|
|
99
|
-
type: Boolean,
|
|
100
|
-
default: false
|
|
101
|
-
},
|
|
102
|
-
forDeadComponentFlag: { // 此标识用于写死的组件,将事件发射出去自己处理
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: false
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
data () {
|
|
109
|
-
return {
|
|
110
|
-
limitShow: 0, // 限制基础资料显示某个属性,1:审核状态状态,
|
|
111
|
-
dialogVisible: false,
|
|
112
|
-
currentSelectRow: {},
|
|
113
|
-
showName: '',
|
|
114
|
-
currentSelectMap: new Map(),
|
|
115
|
-
inputKey: ''
|
|
116
|
-
// relationFields:[{}]
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
computed: {
|
|
120
|
-
displayName: {
|
|
121
|
-
set (value) {
|
|
122
|
-
// 已经选中了一个值忽略再次输入
|
|
123
|
-
if (this.value.id) {
|
|
124
|
-
return
|
|
125
|
-
}
|
|
126
|
-
this.value.name = value
|
|
127
|
-
},
|
|
128
|
-
get () {
|
|
129
|
-
if (!this.value) {
|
|
130
|
-
return
|
|
131
|
-
}
|
|
132
|
-
return this.value.name
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
watch: {
|
|
137
|
-
value (newValue) {
|
|
138
|
-
if (!this.value) {
|
|
139
|
-
this.$emit('input', { name: '', id: null })
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
created () {
|
|
144
|
-
if (this.defaultValue && (!this.value || this.value.id === '')) {
|
|
145
|
-
return this.handleDefaultValue()
|
|
146
|
-
}
|
|
147
|
-
if (!this.value) {
|
|
148
|
-
this.$emit('input', { name: '', id: null })
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
methods: {
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* 根据默认值id获取数据
|
|
155
|
-
*/
|
|
156
|
-
handleDefaultValue () {
|
|
157
|
-
const interval = setInterval(async () => {
|
|
158
|
-
if (this.tableId) {
|
|
159
|
-
clearInterval(interval)
|
|
160
|
-
const data = {
|
|
161
|
-
entityMark: '',
|
|
162
|
-
id: this.defaultValue,
|
|
163
|
-
pageNum: 1,
|
|
164
|
-
pageSize: 1,
|
|
165
|
-
tableId: this.tableId
|
|
166
|
-
}
|
|
167
|
-
const res = await getFormData(data)
|
|
168
|
-
if (res.code === 0) {
|
|
169
|
-
const data = {
|
|
170
|
-
id: this.defaultValue,
|
|
171
|
-
name: res.data[res.data.headIdentification].name
|
|
172
|
-
}
|
|
173
|
-
this.$emit('input', data)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}, 50)
|
|
177
|
-
},
|
|
178
|
-
/**
|
|
179
|
-
* dialog关闭和确定处理函数
|
|
180
|
-
*/
|
|
181
|
-
handleClose () {
|
|
182
|
-
this.dialogVisible = false
|
|
183
|
-
},
|
|
184
|
-
close () {
|
|
185
|
-
this.dialogVisible = false
|
|
186
|
-
},
|
|
187
|
-
handleDialogConfirm () {
|
|
188
|
-
this.$emit('handleSelected', this.currentSelectRow)
|
|
189
|
-
if (this.forDeadComponentFlag) {
|
|
190
|
-
this.close()
|
|
191
|
-
return
|
|
192
|
-
}
|
|
193
|
-
if (this.currentSelectRow.length === 1 || (!this.muchSelect && !this.inputMoreSelect)) {
|
|
194
|
-
this.$emit('input', { id: this.currentSelectRow[0].head__id, name: this.currentSelectRow[0][this.displayField] })
|
|
195
|
-
if (this.relationFields) {
|
|
196
|
-
for (const key in this.relationFields) {
|
|
197
|
-
this.scopeData[this.relationFields[key]] = this.currentSelectRow[0][key]
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
this.close()
|
|
201
|
-
} else if (this.currentSelectRow.length > 1) {
|
|
202
|
-
if (this.inputMoreSelect) {
|
|
203
|
-
const idArr = []
|
|
204
|
-
const nameArr = []
|
|
205
|
-
this.currentSelectRow.forEach(e => {
|
|
206
|
-
idArr.push(e.head__id)
|
|
207
|
-
nameArr.push(e[this.displayField])
|
|
208
|
-
})
|
|
209
|
-
const data = {
|
|
210
|
-
id: idArr.toString(),
|
|
211
|
-
name: nameArr.toString()
|
|
212
|
-
}
|
|
213
|
-
this.$emit('input', data)
|
|
214
|
-
this.close()
|
|
215
|
-
}
|
|
216
|
-
if (this.muchSelect) {
|
|
217
|
-
const insertData = []
|
|
218
|
-
this.currentSelectRow.forEach((item, index) => {
|
|
219
|
-
const obj = {}
|
|
220
|
-
this.widgets.forEach((item2, index2) => {
|
|
221
|
-
if (item2.field === this.field) {
|
|
222
|
-
obj[item2.field] = { id: this.currentSelectRow[index].head__id, name: this.currentSelectRow[index][this.displayField] }
|
|
223
|
-
} else if (item2.type === 'basic_data') {
|
|
224
|
-
obj[item2.field] = { id: undefined, name: undefined }
|
|
225
|
-
} else {
|
|
226
|
-
obj[item2.field] = undefined
|
|
227
|
-
}
|
|
228
|
-
})
|
|
229
|
-
// 添加关联关系
|
|
230
|
-
const relationFieldsIndex = this.widgets.findIndex(d => d.field === this.field)
|
|
231
|
-
if (relationFieldsIndex !== -1) {
|
|
232
|
-
const relationFields = this.widgets[relationFieldsIndex].relationFields
|
|
233
|
-
for (const key in relationFields) {
|
|
234
|
-
obj[relationFields[key]] = this.currentSelectRow[index][key]
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
insertData.push(obj)
|
|
238
|
-
})
|
|
239
|
-
this.$emit('addMuchData', insertData)
|
|
240
|
-
this.close()
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
// this.$emit('input', { id: this.currentSelectRow.head__id, name: this.currentSelectRow.head__name })
|
|
244
|
-
// if (this.relationFields) {
|
|
245
|
-
// for (const key in this.relationFields) {
|
|
246
|
-
// this.scopeData[this.relationFields[key]] = this.currentSelectRow[key]
|
|
247
|
-
// }
|
|
248
|
-
// }
|
|
249
|
-
// this.close()
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* 在弹窗中选择基础资料
|
|
254
|
-
*/
|
|
255
|
-
handleRowSelect (row) {
|
|
256
|
-
this.currentSelectRow = row
|
|
257
|
-
},
|
|
258
|
-
showDialog () {
|
|
259
|
-
// 后端这里的数据可能是字符串也可能是boolean类型
|
|
260
|
-
const disabled = typeof this.disabled === 'string'
|
|
261
|
-
? Boolean(this.disabled)
|
|
262
|
-
: this.disabled
|
|
263
|
-
|
|
264
|
-
if (!disabled) {
|
|
265
|
-
this.dialogVisible = true
|
|
266
|
-
}
|
|
267
|
-
this.limitShow = 1
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* 清空选择
|
|
272
|
-
*/
|
|
273
|
-
// delete按键处理
|
|
274
|
-
handleDeleteKeyDown () {
|
|
275
|
-
if (this.value.id) {
|
|
276
|
-
this.$emit('input', { name: '', id: null })
|
|
277
|
-
}
|
|
278
|
-
},
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* 基础资料搜索建议
|
|
282
|
-
*/
|
|
283
|
-
// 获取建议结果
|
|
284
|
-
async getAdvice (queryString, callback) {
|
|
285
|
-
// 如果输入空字符串,不调用接口
|
|
286
|
-
const reg = /^\s*$/g
|
|
287
|
-
/* eslint-disable */
|
|
288
|
-
if (reg.test(this.displayName)) {
|
|
289
|
-
return callback([])
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
try {
|
|
293
|
-
const res = await getBasicDataSearchAdvice(this.tableId, this.displayName)
|
|
294
|
-
if (res.code !== 0) {
|
|
295
|
-
return
|
|
296
|
-
}
|
|
297
|
-
callback(res.data.records)
|
|
298
|
-
} catch (err) {
|
|
299
|
-
console.log(err)
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
// 选择一条建议
|
|
303
|
-
handleSelect (item) {
|
|
304
|
-
this.$emit('input', { name: item[this.displayField], id: item.head__id })
|
|
305
|
-
if (this.relationFields) {
|
|
306
|
-
for (const key in this.relationFields) {
|
|
307
|
-
this.scopeData[this.relationFields[key]] = item[key]
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
// 将处理携带属性
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
</script>
|
|
316
|
-
|
|
317
|
-
<style lang='less' scoped>
|
|
318
|
-
@import "@/assets/styles/common-table.less";
|
|
319
|
-
@import '../../assets/common-input.less';
|
|
320
|
-
.el-autocomplete{
|
|
321
|
-
display:block;
|
|
322
|
-
::v-deep .el-input__inner{
|
|
323
|
-
// height: 3vh;
|
|
324
|
-
width: 100%;
|
|
325
|
-
border: none;
|
|
326
|
-
border-bottom: 1px solid #DCDCDC;
|
|
327
|
-
border-radius: 0;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
::v-deep .el-input__suffix {
|
|
331
|
-
display: flex;
|
|
332
|
-
align-items: center;
|
|
333
|
-
}
|
|
334
|
-
::v-deep .el-dialog__body{
|
|
335
|
-
padding: 0 10px;
|
|
336
|
-
}
|
|
337
|
-
// 弹框样式修改
|
|
338
|
-
::v-deep .el-dialog__wrapper{
|
|
339
|
-
overflow: hidden;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
::v-deep .el-dialog__footer{
|
|
343
|
-
padding-bottom: 5px;
|
|
344
|
-
.el-button{
|
|
345
|
-
width: 2.5vw;
|
|
346
|
-
height: 2.222vh;
|
|
347
|
-
border-radius: 2px;
|
|
348
|
-
padding: 0;
|
|
349
|
-
margin-left: 0;
|
|
350
|
-
margin-right: 0.4166vw;
|
|
351
|
-
::v-deep span{
|
|
352
|
-
opacity: 1;
|
|
353
|
-
font-size: 0.625vw;
|
|
354
|
-
font-family: Source Han Sans SC, Source Han Sans SC-Regular;
|
|
355
|
-
font-weight: 400;
|
|
356
|
-
color: #ffffff;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
</style>
|
|
362
|
-
<style>
|
|
363
|
-
.advice-poper{
|
|
364
|
-
width: unset !important;
|
|
365
|
-
}
|
|
366
|
-
</style>
|