@ddwl/ddwl-ui 1.1.5 → 1.1.7
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 +92 -92
- package/package.json +68 -68
- package/src/lib/install/index.js +13 -13
- package/src/lib/slots/buttonGroup.vue +113 -113
- package/src/lib/slots/dict.vue +46 -46
- package/src/lib/slots/file.vue +36 -36
- package/src/lib/slots/icon.vue +74 -74
- package/src/lib/slots/index.js +11 -11
- package/src/main.js +62 -62
- package/src/packages/button/index.vue +36 -36
- package/src/packages/descriptions/index.vue +124 -124
- package/src/packages/dialog/index.vue +172 -172
- package/src/packages/dialog-confirm/index.vue +99 -99
- package/src/packages/drawer/index.vue +136 -136
- package/src/packages/file-preview/index.vue +275 -275
- package/src/packages/filter-tree/index.vue +292 -295
- package/src/packages/form/index.vue +149 -149
- package/src/packages/form-item/index.vue +199 -199
- package/src/packages/import-file/index.vue +173 -173
- package/src/packages/menu/index.vue +66 -66
- package/src/packages/menu/menuItem.vue +90 -90
- package/src/packages/popconfirm/index.vue +39 -39
- package/src/packages/render/index.vue +14 -14
- package/src/packages/search-form/index.vue +257 -257
- package/src/packages/search-input/index.vue +68 -68
- package/src/packages/search-table/index.vue +93 -93
- package/src/packages/svg-icon/index.vue +43 -43
- package/src/packages/table/index.vue +451 -458
- package/src/packages/upload/index.vue +352 -352
- package/src/utils/constant.js +3 -3
- package/src/utils/index.js +77 -77
- package/src/utils/treeLib.js +190 -190
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
<!-- 查询输入框组件 -->
|
|
2
|
-
<template>
|
|
3
|
-
<div class="d-search-input">
|
|
4
|
-
<slot><div /></slot>
|
|
5
|
-
<div>
|
|
6
|
-
<el-input
|
|
7
|
-
v-model="value"
|
|
8
|
-
class="search-input-container"
|
|
9
|
-
:placeholder="placeholder"
|
|
10
|
-
:clearable="clearable"
|
|
11
|
-
@keyup.enter.native="$emit('search', value)"
|
|
12
|
-
>
|
|
13
|
-
<i slot="suffix" class="el-input__icon el-icon-search pointer" @click="$emit('search', value)" />
|
|
14
|
-
</el-input>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
export default {
|
|
21
|
-
name: 'DSearchInput',
|
|
22
|
-
components: {},
|
|
23
|
-
model: {
|
|
24
|
-
prop: 'modelValue',
|
|
25
|
-
event: 'change'
|
|
26
|
-
},
|
|
27
|
-
props: {
|
|
28
|
-
modelValue: {
|
|
29
|
-
type: String,
|
|
30
|
-
default: ''
|
|
31
|
-
},
|
|
32
|
-
placeholder: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: '请输入查询内容'
|
|
35
|
-
},
|
|
36
|
-
clearable: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: true
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
data () {
|
|
42
|
-
return {}
|
|
43
|
-
},
|
|
44
|
-
computed: {
|
|
45
|
-
value: {
|
|
46
|
-
get () {
|
|
47
|
-
return this.modelValue
|
|
48
|
-
},
|
|
49
|
-
set (value) {
|
|
50
|
-
this.$emit('change', value)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
watch: {},
|
|
55
|
-
created () {},
|
|
56
|
-
methods: {}
|
|
57
|
-
}
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<style lang='scss' scoped>
|
|
61
|
-
.d-search-input {
|
|
62
|
-
display: flex;
|
|
63
|
-
justify-content: space-between;
|
|
64
|
-
.search-input-container {
|
|
65
|
-
width: 320px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
</style>
|
|
1
|
+
<!-- 查询输入框组件 -->
|
|
2
|
+
<template>
|
|
3
|
+
<div class="d-search-input">
|
|
4
|
+
<slot><div /></slot>
|
|
5
|
+
<div>
|
|
6
|
+
<el-input
|
|
7
|
+
v-model="value"
|
|
8
|
+
class="search-input-container"
|
|
9
|
+
:placeholder="placeholder"
|
|
10
|
+
:clearable="clearable"
|
|
11
|
+
@keyup.enter.native="$emit('search', value)"
|
|
12
|
+
>
|
|
13
|
+
<i slot="suffix" class="el-input__icon el-icon-search pointer" @click="$emit('search', value)" />
|
|
14
|
+
</el-input>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'DSearchInput',
|
|
22
|
+
components: {},
|
|
23
|
+
model: {
|
|
24
|
+
prop: 'modelValue',
|
|
25
|
+
event: 'change'
|
|
26
|
+
},
|
|
27
|
+
props: {
|
|
28
|
+
modelValue: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
placeholder: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: '请输入查询内容'
|
|
35
|
+
},
|
|
36
|
+
clearable: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
data () {
|
|
42
|
+
return {}
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
value: {
|
|
46
|
+
get () {
|
|
47
|
+
return this.modelValue
|
|
48
|
+
},
|
|
49
|
+
set (value) {
|
|
50
|
+
this.$emit('change', value)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
watch: {},
|
|
55
|
+
created () {},
|
|
56
|
+
methods: {}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style lang='scss' scoped>
|
|
61
|
+
.d-search-input {
|
|
62
|
+
display: flex;
|
|
63
|
+
justify-content: space-between;
|
|
64
|
+
.search-input-container {
|
|
65
|
+
width: 320px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
<!-- 查询表格 -->
|
|
2
|
-
<template>
|
|
3
|
-
<div class="table-search-wrap">
|
|
4
|
-
<search-form v-model="form" :config="config.searchConfig" :search-data="searchData" v-bind="$attrs"
|
|
5
|
-
v-on="$listeners">
|
|
6
|
-
<slot />
|
|
7
|
-
</search-form>
|
|
8
|
-
<d-table ref="dTable" :request-config="requestConfig" :columns="config.columns" :data="data" v-bind="$attrs"
|
|
9
|
-
class="table-wrap" v-on="$listeners" />
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
import { cloneDeep } from 'lodash'
|
|
15
|
-
import SearchForm from '../search-form/index.vue'
|
|
16
|
-
import DTable from '../table/index.vue'
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
name: 'DSearchTable',
|
|
20
|
-
components: { SearchForm, DTable },
|
|
21
|
-
props: {
|
|
22
|
-
config: {
|
|
23
|
-
type: Object,
|
|
24
|
-
default: () => ({
|
|
25
|
-
searchConfig: [],
|
|
26
|
-
requestConfig: {},
|
|
27
|
-
columns: []
|
|
28
|
-
})
|
|
29
|
-
},
|
|
30
|
-
data: {
|
|
31
|
-
type: Array,
|
|
32
|
-
default: () => []
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
data() {
|
|
36
|
-
return {
|
|
37
|
-
form: {}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
computed: {
|
|
41
|
-
requestConfig() {
|
|
42
|
-
const requestConfig = this.config.requestConfig
|
|
43
|
-
return {
|
|
44
|
-
...requestConfig,
|
|
45
|
-
params: typeof requestConfig.params === 'function'
|
|
46
|
-
? requestConfig.params(cloneDeep(this.form)) // 处理自定义参数
|
|
47
|
-
: {
|
|
48
|
-
...this.form,
|
|
49
|
-
...requestConfig.params
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
created() {
|
|
55
|
-
this.createFormBind()
|
|
56
|
-
},
|
|
57
|
-
methods: {
|
|
58
|
-
createFormBind() {
|
|
59
|
-
const _form = {};
|
|
60
|
-
(this.config.searchConfig || []).forEach(c => {
|
|
61
|
-
_form[c.prop] = c.defaultValue || ''
|
|
62
|
-
})
|
|
63
|
-
this.form = _form
|
|
64
|
-
},
|
|
65
|
-
search(params) {
|
|
66
|
-
this.$refs.dTable.search(params)
|
|
67
|
-
},
|
|
68
|
-
searchData(params = { pageNum: 1 }) {
|
|
69
|
-
this.$nextTick(() => {
|
|
70
|
-
this.search(params)
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
</script>
|
|
76
|
-
<style lang="scss" scoped>
|
|
77
|
-
.table-search-wrap {
|
|
78
|
-
height: 100%;
|
|
79
|
-
width: 100%;
|
|
80
|
-
overflow: hidden;
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
|
|
84
|
-
.table-wrap {
|
|
85
|
-
flex: 1;
|
|
86
|
-
overflow: hidden;
|
|
87
|
-
|
|
88
|
-
:deep(.el-table) {
|
|
89
|
-
max-height: calc(100% - 52px) !important;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
</style>
|
|
1
|
+
<!-- 查询表格 -->
|
|
2
|
+
<template>
|
|
3
|
+
<div class="table-search-wrap">
|
|
4
|
+
<search-form v-model="form" :config="config.searchConfig" :search-data="searchData" v-bind="$attrs"
|
|
5
|
+
v-on="$listeners">
|
|
6
|
+
<slot />
|
|
7
|
+
</search-form>
|
|
8
|
+
<d-table ref="dTable" :request-config="requestConfig" :columns="config.columns" :data="data" v-bind="$attrs"
|
|
9
|
+
class="table-wrap" v-on="$listeners" />
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { cloneDeep } from 'lodash'
|
|
15
|
+
import SearchForm from '../search-form/index.vue'
|
|
16
|
+
import DTable from '../table/index.vue'
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'DSearchTable',
|
|
20
|
+
components: { SearchForm, DTable },
|
|
21
|
+
props: {
|
|
22
|
+
config: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => ({
|
|
25
|
+
searchConfig: [],
|
|
26
|
+
requestConfig: {},
|
|
27
|
+
columns: []
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
data: {
|
|
31
|
+
type: Array,
|
|
32
|
+
default: () => []
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
form: {}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
computed: {
|
|
41
|
+
requestConfig() {
|
|
42
|
+
const requestConfig = this.config.requestConfig
|
|
43
|
+
return {
|
|
44
|
+
...requestConfig,
|
|
45
|
+
params: typeof requestConfig.params === 'function'
|
|
46
|
+
? requestConfig.params(cloneDeep(this.form)) // 处理自定义参数
|
|
47
|
+
: {
|
|
48
|
+
...this.form,
|
|
49
|
+
...requestConfig.params
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
created() {
|
|
55
|
+
this.createFormBind()
|
|
56
|
+
},
|
|
57
|
+
methods: {
|
|
58
|
+
createFormBind() {
|
|
59
|
+
const _form = {};
|
|
60
|
+
(this.config.searchConfig || []).forEach(c => {
|
|
61
|
+
_form[c.prop] = c.defaultValue || ''
|
|
62
|
+
})
|
|
63
|
+
this.form = _form
|
|
64
|
+
},
|
|
65
|
+
search(params) {
|
|
66
|
+
this.$refs.dTable.search(params)
|
|
67
|
+
},
|
|
68
|
+
searchData(params = { pageNum: 1 }) {
|
|
69
|
+
this.$nextTick(() => {
|
|
70
|
+
this.search(params)
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
<style lang="scss" scoped>
|
|
77
|
+
.table-search-wrap {
|
|
78
|
+
height: 100%;
|
|
79
|
+
width: 100%;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
|
|
84
|
+
.table-wrap {
|
|
85
|
+
flex: 1;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
|
|
88
|
+
:deep(.el-table) {
|
|
89
|
+
max-height: calc(100% - 52px) !important;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</style>
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg :class="svgClass" aria-hidden="true" v-on="$listeners">
|
|
3
|
-
<use :xlink:href="iconName" />
|
|
4
|
-
</svg>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
export default {
|
|
9
|
-
name: 'DSvgIcon',
|
|
10
|
-
props: {
|
|
11
|
-
icon: {
|
|
12
|
-
type: String,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
className: {
|
|
16
|
-
type: String,
|
|
17
|
-
default: ''
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
computed: {
|
|
21
|
-
iconName () {
|
|
22
|
-
return `#icon-${this.icon}`
|
|
23
|
-
},
|
|
24
|
-
svgClass () {
|
|
25
|
-
if (this.className) {
|
|
26
|
-
return 'svg-icon ' + this.className
|
|
27
|
-
} else {
|
|
28
|
-
return 'svg-icon'
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
</script>
|
|
34
|
-
|
|
35
|
-
<style lang="scss" scoped>
|
|
36
|
-
.svg-icon {
|
|
37
|
-
width: 14px;
|
|
38
|
-
height: 14px;
|
|
39
|
-
vertical-align: -0.15em;
|
|
40
|
-
fill: currentColor;
|
|
41
|
-
overflow: hidden;
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<svg :class="svgClass" aria-hidden="true" v-on="$listeners">
|
|
3
|
+
<use :xlink:href="iconName" />
|
|
4
|
+
</svg>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'DSvgIcon',
|
|
10
|
+
props: {
|
|
11
|
+
icon: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
className: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ''
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
computed: {
|
|
21
|
+
iconName () {
|
|
22
|
+
return `#icon-${this.icon}`
|
|
23
|
+
},
|
|
24
|
+
svgClass () {
|
|
25
|
+
if (this.className) {
|
|
26
|
+
return 'svg-icon ' + this.className
|
|
27
|
+
} else {
|
|
28
|
+
return 'svg-icon'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style lang="scss" scoped>
|
|
36
|
+
.svg-icon {
|
|
37
|
+
width: 14px;
|
|
38
|
+
height: 14px;
|
|
39
|
+
vertical-align: -0.15em;
|
|
40
|
+
fill: currentColor;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
</style>
|