@lx-frontend/wrap-element-ui 0.4.2-beta.1 → 0.4.3-beta.1
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/.tool-versions +1 -0
- package/README.md +54 -54
- package/babel.config.js +5 -5
- package/global.d.ts +23 -23
- package/package.json +48 -48
- package/packages/AddMembers/index.js +11 -11
- package/packages/AddMembers/src/AddMembers.vue +127 -127
- package/packages/AuditSteps/index.js +7 -7
- package/packages/AuditSteps/src/AuditSteps.vue +85 -85
- package/packages/DemoComponent/index.js +7 -7
- package/packages/DemoComponent/src/DemoComponent.vue +10 -10
- package/packages/Ellipsis/index.js +7 -7
- package/packages/Ellipsis/src/Ellipsis.vue +119 -119
- package/packages/Ellipsis/src/MultilineEllipsis.vue +141 -141
- package/packages/LxTable/index.js +11 -11
- package/packages/LxTable/src/LxTable.vue +281 -281
- package/packages/PopoverForm/index.js +7 -7
- package/packages/PopoverForm/src/PopoverForm.vue +66 -66
- package/packages/SearchForm/index.js +7 -7
- package/packages/SearchForm/src/SearchForm.vue +217 -224
- package/packages/SearchSelect/index.js +7 -7
- package/packages/SearchSelect/src/SearchSelect.vue +150 -150
- package/packages/index.js +59 -59
- package/packages/lib/AddMembers.js +1 -0
- package/packages/lib/AuditSteps.js +1 -0
- package/packages/lib/DemoComponent.js +1 -0
- package/packages/lib/Ellipsis.js +1 -0
- package/packages/lib/LxTable.js +21 -0
- package/packages/lib/PopoverForm.js +1 -0
- package/packages/lib/SearchForm.js +1 -0
- package/packages/lib/SearchSelect.js +1 -0
- package/packages/lib/index.js +21 -0
- package/packages/singleMessage/index.ts +44 -44
- package/packages/theme-default/gulpfile.js +25 -25
- package/packages/theme-default/package.json +23 -23
- package/packages/theme-default/src/AuditSteps.scss +52 -52
- package/packages/theme-default/src/DemoComponent.scss +9 -9
- package/packages/theme-default/src/index.css +11 -11
- package/packages/theme-default/src/index.scss +2 -2
- package/plugins/wrap.js +22 -22
- package/postcss.config.js +5 -5
- package/tsconfig.json +41 -41
- package/yarn.lock +0 -12226
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="audit-steps">
|
|
3
|
-
<ElSteps direction="vertical">
|
|
4
|
-
<ElStep class="audit-steps__step-item" v-for="(item, index) in value" :key="index">
|
|
5
|
-
<div slot="icon">{{index + 1}}</div>
|
|
6
|
-
<div :class="{'el-name-box': item.id}" slot="description">
|
|
7
|
-
<span :class="[ 'audit-steps__step-order', {first: index===0} ]">{{index + 1}}</span>
|
|
8
|
-
<ElSelect
|
|
9
|
-
:value="item.employees"
|
|
10
|
-
@input="val => handleEditCandidate(val, index)"
|
|
11
|
-
multiple
|
|
12
|
-
:multiple-limit="maxSelect"
|
|
13
|
-
placeholder="请选择">
|
|
14
|
-
<ElOption
|
|
15
|
-
v-for="v in candidates"
|
|
16
|
-
:key="v.id"
|
|
17
|
-
:label="v.name"
|
|
18
|
-
:value="v.id" />
|
|
19
|
-
</ElSelect>
|
|
20
|
-
<i class="el-name" v-if="item.id">{{item.miniName}}</i>
|
|
21
|
-
<i class="el-icon-delete" v-if="index" @click="handleDeleteStep(index)" ></i>
|
|
22
|
-
</div>
|
|
23
|
-
</ElStep>
|
|
24
|
-
</ElSteps>
|
|
25
|
-
<ElButton v-if="isAdd" type="text" class="audit-steps__add" icon="circle-plus" @click="handleAddStep">添加审核环节</ElButton>
|
|
26
|
-
</div>
|
|
27
|
-
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
export default {
|
|
31
|
-
name: 'AuditSteps',
|
|
32
|
-
props: {
|
|
33
|
-
candidates: {
|
|
34
|
-
type: Array
|
|
35
|
-
},
|
|
36
|
-
value: {
|
|
37
|
-
type: Array,
|
|
38
|
-
default () {
|
|
39
|
-
return []
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
maxSelect: {
|
|
43
|
-
type: Number,
|
|
44
|
-
default: 3
|
|
45
|
-
},
|
|
46
|
-
stepNum: {
|
|
47
|
-
type: Number,
|
|
48
|
-
default: 2
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
computed: {
|
|
52
|
-
isAdd () {
|
|
53
|
-
return this.value.length < this.stepNum
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
methods: {
|
|
57
|
-
syncSteps (modification) {
|
|
58
|
-
const _steps = [ ...this.value ]
|
|
59
|
-
this.$emit('input', modification(_steps))
|
|
60
|
-
},
|
|
61
|
-
handleEditCandidate (val, index) {
|
|
62
|
-
this.syncSteps(_steps => {
|
|
63
|
-
_steps[index].employees = val
|
|
64
|
-
return _steps
|
|
65
|
-
})
|
|
66
|
-
},
|
|
67
|
-
handleDeleteStep (i) {
|
|
68
|
-
this.syncSteps(_steps => {
|
|
69
|
-
_steps.splice(i, 1)
|
|
70
|
-
return _steps
|
|
71
|
-
})
|
|
72
|
-
},
|
|
73
|
-
handleAddStep () {
|
|
74
|
-
this.syncSteps(_steps => {
|
|
75
|
-
return _steps.concat([{ employees: [] }])
|
|
76
|
-
})
|
|
77
|
-
},
|
|
78
|
-
// 判断是不是每一个步骤都选有审核人
|
|
79
|
-
isValidateSteps () {
|
|
80
|
-
return !this.value.some(_steps => _steps.employees.length <= 0)
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
</script>
|
|
85
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="audit-steps">
|
|
3
|
+
<ElSteps direction="vertical">
|
|
4
|
+
<ElStep class="audit-steps__step-item" v-for="(item, index) in value" :key="index">
|
|
5
|
+
<div slot="icon">{{index + 1}}</div>
|
|
6
|
+
<div :class="{'el-name-box': item.id}" slot="description">
|
|
7
|
+
<span :class="[ 'audit-steps__step-order', {first: index===0} ]">{{index + 1}}</span>
|
|
8
|
+
<ElSelect
|
|
9
|
+
:value="item.employees"
|
|
10
|
+
@input="val => handleEditCandidate(val, index)"
|
|
11
|
+
multiple
|
|
12
|
+
:multiple-limit="maxSelect"
|
|
13
|
+
placeholder="请选择">
|
|
14
|
+
<ElOption
|
|
15
|
+
v-for="v in candidates"
|
|
16
|
+
:key="v.id"
|
|
17
|
+
:label="v.name"
|
|
18
|
+
:value="v.id" />
|
|
19
|
+
</ElSelect>
|
|
20
|
+
<i class="el-name" v-if="item.id">{{item.miniName}}</i>
|
|
21
|
+
<i class="el-icon-delete" v-if="index" @click="handleDeleteStep(index)" ></i>
|
|
22
|
+
</div>
|
|
23
|
+
</ElStep>
|
|
24
|
+
</ElSteps>
|
|
25
|
+
<ElButton v-if="isAdd" type="text" class="audit-steps__add" icon="circle-plus" @click="handleAddStep">添加审核环节</ElButton>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
export default {
|
|
31
|
+
name: 'AuditSteps',
|
|
32
|
+
props: {
|
|
33
|
+
candidates: {
|
|
34
|
+
type: Array
|
|
35
|
+
},
|
|
36
|
+
value: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default () {
|
|
39
|
+
return []
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
maxSelect: {
|
|
43
|
+
type: Number,
|
|
44
|
+
default: 3
|
|
45
|
+
},
|
|
46
|
+
stepNum: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 2
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
computed: {
|
|
52
|
+
isAdd () {
|
|
53
|
+
return this.value.length < this.stepNum
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
syncSteps (modification) {
|
|
58
|
+
const _steps = [ ...this.value ]
|
|
59
|
+
this.$emit('input', modification(_steps))
|
|
60
|
+
},
|
|
61
|
+
handleEditCandidate (val, index) {
|
|
62
|
+
this.syncSteps(_steps => {
|
|
63
|
+
_steps[index].employees = val
|
|
64
|
+
return _steps
|
|
65
|
+
})
|
|
66
|
+
},
|
|
67
|
+
handleDeleteStep (i) {
|
|
68
|
+
this.syncSteps(_steps => {
|
|
69
|
+
_steps.splice(i, 1)
|
|
70
|
+
return _steps
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
handleAddStep () {
|
|
74
|
+
this.syncSteps(_steps => {
|
|
75
|
+
return _steps.concat([{ employees: [] }])
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
// 判断是不是每一个步骤都选有审核人
|
|
79
|
+
isValidateSteps () {
|
|
80
|
+
return !this.value.some(_steps => _steps.employees.length <= 0)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
85
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import DemoComponent from './src/DemoComponent.vue';
|
|
2
|
-
|
|
3
|
-
DemoComponent.install = function (Vue) {
|
|
4
|
-
Vue.component(DemoComponent.name, DemoComponent)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default DemoComponent
|
|
1
|
+
import DemoComponent from './src/DemoComponent.vue';
|
|
2
|
+
|
|
3
|
+
DemoComponent.install = function (Vue) {
|
|
4
|
+
Vue.component(DemoComponent.name, DemoComponent)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default DemoComponent
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="demo-component__input">
|
|
3
|
-
<ElInput title="DemoComponent" lable="DemoComponent" />
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
<script>
|
|
7
|
-
export default{
|
|
8
|
-
name: 'DemoComponent'
|
|
9
|
-
}
|
|
10
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="demo-component__input">
|
|
3
|
+
<ElInput title="DemoComponent" lable="DemoComponent" />
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
export default{
|
|
8
|
+
name: 'DemoComponent'
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Ellipsis from './src/Ellipsis.vue'
|
|
2
|
-
|
|
3
|
-
Ellipsis.install = function (Vue) {
|
|
4
|
-
Vue.component(Ellipsis.name, Ellipsis)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export default Ellipsis
|
|
1
|
+
import Ellipsis from './src/Ellipsis.vue'
|
|
2
|
+
|
|
3
|
+
Ellipsis.install = function (Vue) {
|
|
4
|
+
Vue.component(Ellipsis.name, Ellipsis)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export default Ellipsis
|
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ellipsis-popover">
|
|
3
|
-
<ElPopover
|
|
4
|
-
:disabled="showPopover === 'off' || (showPopover !== 'always' && !isOverflow)"
|
|
5
|
-
:popper-class="popoverName"
|
|
6
|
-
placement="top-start"
|
|
7
|
-
trigger="hover">
|
|
8
|
-
<div class="popover-content">
|
|
9
|
-
<slot name="popover">
|
|
10
|
-
<div v-for="(item, index) in contentArr" :key="getKey(item, index)">{{ item }}</div>
|
|
11
|
-
</slot>
|
|
12
|
-
</div>
|
|
13
|
-
<div slot="reference">
|
|
14
|
-
<template v-for="(item, index) in contentArr">
|
|
15
|
-
<MultilineEllipsis
|
|
16
|
-
:key="getKey(item, index)"
|
|
17
|
-
:content="item"
|
|
18
|
-
:fontSize="fontSize"
|
|
19
|
-
:color="color"
|
|
20
|
-
:lineCount="lineCount"
|
|
21
|
-
:iconName="iconName"
|
|
22
|
-
:showIconObj="{
|
|
23
|
-
isShowIcon: showIconObj.isShowIcon,
|
|
24
|
-
length: showIconObj.length,
|
|
25
|
-
}"
|
|
26
|
-
:overCountTip="{
|
|
27
|
-
index: index + 1,
|
|
28
|
-
length: contentArr.length,
|
|
29
|
-
}"
|
|
30
|
-
:isOverflow.sync="overflowArr[index]">
|
|
31
|
-
</MultilineEllipsis>
|
|
32
|
-
</template>
|
|
33
|
-
</div>
|
|
34
|
-
</ElPopover>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script>
|
|
39
|
-
import MultilineEllipsis from './MultilineEllipsis.vue'
|
|
40
|
-
|
|
41
|
-
export default {
|
|
42
|
-
name: 'Ellipsis',
|
|
43
|
-
components: {
|
|
44
|
-
MultilineEllipsis
|
|
45
|
-
},
|
|
46
|
-
props: {
|
|
47
|
-
fontSize: {
|
|
48
|
-
type: Number,
|
|
49
|
-
default: 12
|
|
50
|
-
},
|
|
51
|
-
color: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: '#000000'
|
|
54
|
-
},
|
|
55
|
-
lineCount: {
|
|
56
|
-
type: Number,
|
|
57
|
-
default: 1
|
|
58
|
-
},
|
|
59
|
-
iconName: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: 'el-icon-arrow-down'
|
|
62
|
-
},
|
|
63
|
-
overCountTip: {
|
|
64
|
-
type: Object
|
|
65
|
-
},
|
|
66
|
-
showIconObj: {
|
|
67
|
-
type: Object,
|
|
68
|
-
default: () => {
|
|
69
|
-
return {
|
|
70
|
-
isShowIcon: false,
|
|
71
|
-
length: 0
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
content: {
|
|
76
|
-
type: [String, Array],
|
|
77
|
-
default: ''
|
|
78
|
-
},
|
|
79
|
-
popoverName: String,
|
|
80
|
-
showPopover: {
|
|
81
|
-
type: String,
|
|
82
|
-
default: 'auto' // 可选值 auto, always, off
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
data () {
|
|
86
|
-
return {
|
|
87
|
-
overflowArr: []
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
computed: {
|
|
91
|
-
contentArr () {
|
|
92
|
-
return typeof (this.content) === 'string' ? [this.content] : [...this.content]
|
|
93
|
-
},
|
|
94
|
-
isOverflow () {
|
|
95
|
-
return this.overflowArr.includes(true)
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
watch: {
|
|
99
|
-
contentArr (val) {
|
|
100
|
-
this.overflowArr.length = val.length
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
methods: {
|
|
104
|
-
getKey (item, index) {
|
|
105
|
-
return btoa(escape(`${item}_${index}`))
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
</script>
|
|
110
|
-
|
|
111
|
-
<style lang="scss">
|
|
112
|
-
.ellipsis-popover {
|
|
113
|
-
width: 100%;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.popover-content {
|
|
117
|
-
padding: 18px 20px;
|
|
118
|
-
}
|
|
119
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ellipsis-popover">
|
|
3
|
+
<ElPopover
|
|
4
|
+
:disabled="showPopover === 'off' || (showPopover !== 'always' && !isOverflow)"
|
|
5
|
+
:popper-class="popoverName"
|
|
6
|
+
placement="top-start"
|
|
7
|
+
trigger="hover">
|
|
8
|
+
<div class="popover-content">
|
|
9
|
+
<slot name="popover">
|
|
10
|
+
<div v-for="(item, index) in contentArr" :key="getKey(item, index)">{{ item }}</div>
|
|
11
|
+
</slot>
|
|
12
|
+
</div>
|
|
13
|
+
<div slot="reference">
|
|
14
|
+
<template v-for="(item, index) in contentArr">
|
|
15
|
+
<MultilineEllipsis
|
|
16
|
+
:key="getKey(item, index)"
|
|
17
|
+
:content="item"
|
|
18
|
+
:fontSize="fontSize"
|
|
19
|
+
:color="color"
|
|
20
|
+
:lineCount="lineCount"
|
|
21
|
+
:iconName="iconName"
|
|
22
|
+
:showIconObj="{
|
|
23
|
+
isShowIcon: showIconObj.isShowIcon,
|
|
24
|
+
length: showIconObj.length,
|
|
25
|
+
}"
|
|
26
|
+
:overCountTip="{
|
|
27
|
+
index: index + 1,
|
|
28
|
+
length: contentArr.length,
|
|
29
|
+
}"
|
|
30
|
+
:isOverflow.sync="overflowArr[index]">
|
|
31
|
+
</MultilineEllipsis>
|
|
32
|
+
</template>
|
|
33
|
+
</div>
|
|
34
|
+
</ElPopover>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
import MultilineEllipsis from './MultilineEllipsis.vue'
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
name: 'Ellipsis',
|
|
43
|
+
components: {
|
|
44
|
+
MultilineEllipsis
|
|
45
|
+
},
|
|
46
|
+
props: {
|
|
47
|
+
fontSize: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 12
|
|
50
|
+
},
|
|
51
|
+
color: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: '#000000'
|
|
54
|
+
},
|
|
55
|
+
lineCount: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: 1
|
|
58
|
+
},
|
|
59
|
+
iconName: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'el-icon-arrow-down'
|
|
62
|
+
},
|
|
63
|
+
overCountTip: {
|
|
64
|
+
type: Object
|
|
65
|
+
},
|
|
66
|
+
showIconObj: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => {
|
|
69
|
+
return {
|
|
70
|
+
isShowIcon: false,
|
|
71
|
+
length: 0
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
content: {
|
|
76
|
+
type: [String, Array],
|
|
77
|
+
default: ''
|
|
78
|
+
},
|
|
79
|
+
popoverName: String,
|
|
80
|
+
showPopover: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: 'auto' // 可选值 auto, always, off
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
data () {
|
|
86
|
+
return {
|
|
87
|
+
overflowArr: []
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
computed: {
|
|
91
|
+
contentArr () {
|
|
92
|
+
return typeof (this.content) === 'string' ? [this.content] : [...this.content]
|
|
93
|
+
},
|
|
94
|
+
isOverflow () {
|
|
95
|
+
return this.overflowArr.includes(true)
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
watch: {
|
|
99
|
+
contentArr (val) {
|
|
100
|
+
this.overflowArr.length = val.length
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
methods: {
|
|
104
|
+
getKey (item, index) {
|
|
105
|
+
return btoa(escape(`${item}_${index}`))
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style lang="scss">
|
|
112
|
+
.ellipsis-popover {
|
|
113
|
+
width: 100%;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.popover-content {
|
|
117
|
+
padding: 18px 20px;
|
|
118
|
+
}
|
|
119
|
+
</style>
|