haiwei-ui 1.0.3 → 1.0.5
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 +10 -0
- package/package.json +1 -1
- package/packages/components/box/index.vue +116 -125
- package/packages/components/box-col/index.vue +30 -33
- package/packages/components/box-row/index.vue +17 -17
- package/packages/components/box-small/index.vue +38 -38
- package/packages/components/button/index.vue +29 -42
- package/packages/components/button-copy/index.vue +46 -62
- package/packages/components/button-delete/index.vue +64 -77
- package/packages/components/button-delete-batch/index.vue +82 -95
- package/packages/components/button-has/index.vue +29 -42
- package/packages/components/checkbox-group/index.vue +85 -85
- package/packages/components/color-picker/index.vue +41 -50
- package/packages/components/container/index.vue +8 -8
- package/packages/components/date-range-picker/index.vue +92 -103
- package/packages/components/details/index.vue +72 -79
- package/packages/components/dialog/index.vue +281 -294
- package/packages/components/drag-sort/index.vue +36 -36
- package/packages/components/drag-sort-dialog/index.vue +58 -58
- package/packages/components/drawer/index.vue +157 -166
- package/packages/components/enums/sex/index.vue +1 -1
- package/packages/components/flex/index.vue +33 -33
- package/packages/components/form/index.vue +123 -138
- package/packages/components/form-dialog/index.vue +184 -217
- package/packages/components/form-page/index.vue +134 -151
- package/packages/components/icon/index.vue +6 -6
- package/packages/components/icon-picker/index.vue +30 -30
- package/packages/components/icon-picker/panel.vue +58 -58
- package/packages/components/label/index.vue +22 -30
- package/packages/components/list/components/export/index.vue +101 -99
- package/packages/components/list/components/footer/index.vue +42 -51
- package/packages/components/list/components/header/index.vue +34 -34
- package/packages/components/list/components/querybar/index.vue +143 -143
- package/packages/components/list/components/select-column/index.vue +30 -30
- package/packages/components/list/components/table/index.vue +169 -188
- package/packages/components/list/index.vue +337 -391
- package/packages/components/list-agile/index.vue +145 -145
- package/packages/components/list-dialog/index.vue +70 -84
- package/packages/components/listbox/index.vue +48 -48
- package/packages/components/login-default/index.vue +107 -107
- package/packages/components/login-neon/index.vue +104 -104
- package/packages/components/map/index.vue +229 -229
- package/packages/components/map-coord-picking/index.vue +220 -219
- package/packages/components/map-search/index.vue +75 -72
- package/packages/components/scrollbar/index.vue +11 -11
- package/packages/components/select-whether/index.vue +30 -30
- package/packages/components/split/index.vue +141 -141
- package/packages/components/split/trigger.vue +15 -15
- package/packages/components/tabnav/index.vue +125 -89
- package/packages/components/tabs/index.vue +31 -31
- package/packages/components/toolbar/components/fullscreen/index.vue +10 -10
- package/packages/components/toolbar/components/logout/index.vue +13 -13
- package/packages/components/toolbar/components/skin-toggle/form.vue +59 -59
- package/packages/components/toolbar/components/skin-toggle/index.vue +12 -12
- package/packages/components/toolbar/components/userInfo/index.vue +18 -18
- package/packages/components/toolbar/index.vue +12 -12
- package/packages/components/tree-select/mixins.vue +261 -270
- package/packages/components/txt/index.vue +17 -17
- package/packages/components/update-password/index.vue +45 -57
- package/packages/layout.vue +18 -18
- package/packages/mixins/components/checkbox.vue +71 -82
- package/packages/mixins/components/radio.vue +69 -69
- package/packages/page/403/index.vue +32 -28
- package/packages/page/404/index.vue +32 -28
- package/packages/page/default/index.vue +17 -13
- package/packages/page/iframe/index.vue +6 -6
- package/packages/page/login/index.vue +9 -9
- package/packages/page/userInfo/index.vue +5 -5
- package/packages/router/index.js +1 -9
- package/packages/skins/pretty/components/header/components/breadcrumb/index.vue +29 -29
- package/packages/skins/pretty/components/header/components/theme/index.vue +22 -21
- package/packages/skins/pretty/components/header/index.vue +12 -12
- package/packages/skins/pretty/components/main/index.vue +27 -27
- package/packages/skins/pretty/components/menus/index.vue +28 -28
- package/packages/skins/pretty/components/menus/item.vue +23 -23
- package/packages/skins/pretty/components/sidebar/index.vue +7 -7
- package/packages/skins/pretty/index.vue +6 -6
- package/packages/skins/pretty/styles/themes/blue-light/_index.scss +2 -2
- package/packages/skins/pretty/styles/themes/default/_index.scss +1 -1
- package/packages/skins/pretty/styles/themes/green/_index.scss +2 -2
- package/packages/skins/pretty/styles/themes/green-light/_index.scss +2 -2
- package/packages/styles/_mixins.scss +24 -25
- package/packages/styles/animation/_index.scss +22 -23
- package/packages/styles/animation/breadcrumb.scss +6 -6
- package/packages/styles/animation/fade.scss +11 -11
- package/packages/styles/animation/move.scss +98 -98
- package/packages/styles/components/box-small/_index.scss +58 -58
- package/packages/styles/components/button/_index.scss +7 -7
- package/packages/styles/components/container/_index.scss +26 -26
- package/packages/styles/components/date-range-picker/_index.scss +4 -4
- package/packages/styles/components/details/_index.scss +66 -67
- package/packages/styles/components/details-dialog/_index.scss +13 -13
- package/packages/styles/components/drag-sort/_index.scss +20 -20
- package/packages/styles/components/drag-sort-dialog/_index.scss +7 -7
- package/packages/styles/components/flex/_index.scss +56 -56
- package/packages/styles/components/form-dialog/_index.scss +11 -11
- package/packages/styles/components/icon/_index.scss +6 -6
- package/packages/styles/components/label/_index.scss +245 -245
- package/packages/styles/components/listbox/_index.scss +47 -47
- package/packages/styles/components/split/_index.scss +102 -102
- package/packages/styles/components/toolbar/_index.scss +98 -98
- package/packages/styles/components/txt/_index.scss +13 -13
- package/packages/styles/components/upload-dialog/_index.scss +44 -44
- package/packages/styles/components/upload-multiple/_index.scss +19 -19
- package/packages/styles/components/upload-single/_index.scss +16 -16
- package/packages/utils/resize-event.js +3 -3
- package/packages/vuter/attributes.json +30 -40
- package/packages/vuter/tags.json +11 -27
- package/public/lib/font/iconfont.js +47 -1
|
@@ -62,162 +62,162 @@
|
|
|
62
62
|
</section>
|
|
63
63
|
</template>
|
|
64
64
|
<script>
|
|
65
|
-
import { mapState } from 'vuex'
|
|
66
|
-
import QueryHeader from '../list/components/header'
|
|
67
|
-
import Querybar from '../list/components/querybar'
|
|
68
|
-
import QueryTable from '../list/components/table'
|
|
69
|
-
import QueryFooter from '../list/components/footer'
|
|
65
|
+
import { mapState } from 'vuex'
|
|
66
|
+
import QueryHeader from '../list/components/header'
|
|
67
|
+
import Querybar from '../list/components/querybar'
|
|
68
|
+
import QueryTable from '../list/components/table'
|
|
69
|
+
import QueryFooter from '../list/components/footer'
|
|
70
70
|
|
|
71
|
-
export default {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
loading_: false,
|
|
77
|
-
fullscreen: false,
|
|
78
|
-
// 分页数据
|
|
79
|
-
page: {
|
|
80
|
-
index: 1,
|
|
81
|
-
size: 15,
|
|
82
|
-
sort: []
|
|
83
|
-
},
|
|
84
|
-
// 数据列表
|
|
85
|
-
rows: [],
|
|
86
|
-
// 总数量
|
|
87
|
-
total: 0,
|
|
88
|
-
selection: []
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
props: {
|
|
92
|
-
/** 标题 */
|
|
93
|
-
title: String,
|
|
94
|
-
/** 图标 */
|
|
95
|
-
icon: String,
|
|
96
|
-
// 查询方法
|
|
97
|
-
action: {
|
|
98
|
-
type: Function,
|
|
99
|
-
required: true
|
|
100
|
-
},
|
|
101
|
-
/** 查询表单输入框宽度 */
|
|
102
|
-
inputWidth: String,
|
|
103
|
-
// 模型
|
|
104
|
-
model: Object,
|
|
105
|
-
/** 模型验证规则 */
|
|
106
|
-
rules: Object,
|
|
107
|
-
/** 高级查询 */
|
|
108
|
-
advanced: Object,
|
|
109
|
-
/** 多选 */
|
|
110
|
-
multiple: Boolean,
|
|
111
|
-
/** 显示序号 */
|
|
112
|
-
showNo: {
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: true
|
|
115
|
-
},
|
|
116
|
-
/** 不显示操作列 */
|
|
117
|
-
noOperation: Boolean,
|
|
118
|
-
/** 操作列宽度 */
|
|
119
|
-
operationWidth: [String, Number],
|
|
120
|
-
/** 不显示查询栏 */
|
|
121
|
-
noQuerybar: Boolean,
|
|
122
|
-
/** 不显示全屏按钮 */
|
|
123
|
-
noFullscreen: Boolean,
|
|
124
|
-
/** 不显示刷新按钮 */
|
|
125
|
-
noRefresh: Boolean,
|
|
126
|
-
/** 不显示头部 */
|
|
127
|
-
noHeader: Boolean,
|
|
128
|
-
/** 不显示底部 */
|
|
129
|
-
noFooter: Boolean,
|
|
130
|
-
/** 不包含搜索功能 */
|
|
131
|
-
noSearch: Boolean,
|
|
132
|
-
/** 不显示查询按钮图标 */
|
|
133
|
-
noSearchButtonIcon: Boolean,
|
|
134
|
-
/** 底部反转 */
|
|
135
|
-
footerReverse: Boolean,
|
|
136
|
-
/** 合并行列的方法 */
|
|
137
|
-
spanMethod: Function,
|
|
138
|
-
/** 加载中动画 */
|
|
139
|
-
loading: Boolean,
|
|
140
|
-
/** 加载中文本 */
|
|
141
|
-
loadingText: String,
|
|
142
|
-
/** 创建后执行一次查询 */
|
|
143
|
-
queryOnCreated: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: true
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
computed: {
|
|
149
|
-
...mapState('app/loading', { loadingText_: 'text', loadingBackground: 'background', loadingSpinner: 'spinner' }),
|
|
150
|
-
class_() {
|
|
151
|
-
return ['nm-list', this.fontSize ? `nm-list-${this.fontSize}` : '', this.fullscreen ? 'fullscreen' : '']
|
|
152
|
-
},
|
|
153
|
-
querybar() {
|
|
71
|
+
export default {
|
|
72
|
+
name: 'ListAgile',
|
|
73
|
+
components: { QueryHeader, Querybar, QueryTable, QueryFooter },
|
|
74
|
+
data() {
|
|
154
75
|
return {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
76
|
+
loading_: false,
|
|
77
|
+
fullscreen: false,
|
|
78
|
+
// 分页数据
|
|
79
|
+
page: {
|
|
80
|
+
index: 1,
|
|
81
|
+
size: 15,
|
|
82
|
+
sort: []
|
|
83
|
+
},
|
|
84
|
+
// 数据列表
|
|
85
|
+
rows: [],
|
|
86
|
+
// 总数量
|
|
87
|
+
total: 0,
|
|
88
|
+
selection: []
|
|
161
89
|
}
|
|
162
90
|
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
91
|
+
props: {
|
|
92
|
+
/** 标题 */
|
|
93
|
+
title: String,
|
|
94
|
+
/** 图标 */
|
|
95
|
+
icon: String,
|
|
96
|
+
// 查询方法
|
|
97
|
+
action: {
|
|
98
|
+
type: Function,
|
|
99
|
+
required: true
|
|
100
|
+
},
|
|
101
|
+
/** 查询表单输入框宽度 */
|
|
102
|
+
inputWidth: String,
|
|
103
|
+
// 模型
|
|
104
|
+
model: Object,
|
|
105
|
+
/** 模型验证规则 */
|
|
106
|
+
rules: Object,
|
|
107
|
+
/** 高级查询 */
|
|
108
|
+
advanced: Object,
|
|
109
|
+
/** 多选 */
|
|
110
|
+
multiple: Boolean,
|
|
111
|
+
/** 显示序号 */
|
|
112
|
+
showNo: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: true
|
|
115
|
+
},
|
|
116
|
+
/** 不显示操作列 */
|
|
117
|
+
noOperation: Boolean,
|
|
118
|
+
/** 操作列宽度 */
|
|
119
|
+
operationWidth: [String, Number],
|
|
120
|
+
/** 不显示查询栏 */
|
|
121
|
+
noQuerybar: Boolean,
|
|
122
|
+
/** 不显示全屏按钮 */
|
|
123
|
+
noFullscreen: Boolean,
|
|
124
|
+
/** 不显示刷新按钮 */
|
|
125
|
+
noRefresh: Boolean,
|
|
126
|
+
/** 不显示头部 */
|
|
127
|
+
noHeader: Boolean,
|
|
128
|
+
/** 不显示底部 */
|
|
129
|
+
noFooter: Boolean,
|
|
130
|
+
/** 不包含搜索功能 */
|
|
131
|
+
noSearch: Boolean,
|
|
132
|
+
/** 不显示查询按钮图标 */
|
|
133
|
+
noSearchButtonIcon: Boolean,
|
|
134
|
+
/** 底部反转 */
|
|
135
|
+
footerReverse: Boolean,
|
|
136
|
+
/** 合并行列的方法 */
|
|
137
|
+
spanMethod: Function,
|
|
138
|
+
/** 加载中动画 */
|
|
139
|
+
loading: Boolean,
|
|
140
|
+
/** 加载中文本 */
|
|
141
|
+
loadingText: String,
|
|
142
|
+
/** 创建后执行一次查询 */
|
|
143
|
+
queryOnCreated: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
default: true
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
computed: {
|
|
149
|
+
...mapState('app/loading', { loadingText_: 'text', loadingBackground: 'background', loadingSpinner: 'spinner' }),
|
|
150
|
+
class_() {
|
|
151
|
+
return ['nm-list', this.fontSize ? `nm-list-${this.fontSize}` : '', this.fullscreen ? 'fullscreen' : '']
|
|
152
|
+
},
|
|
153
|
+
querybar() {
|
|
154
|
+
return {
|
|
155
|
+
model: this.model,
|
|
156
|
+
rules: this.rules,
|
|
157
|
+
inputWidth: this.inputWidth,
|
|
158
|
+
advanced: this.advanced,
|
|
159
|
+
noSearch: this.noSearch,
|
|
160
|
+
noSearchButtonIcon: this.noSearchButtonIcon
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
showLoading() {
|
|
164
|
+
return this.loading || this.loading_
|
|
172
165
|
}
|
|
166
|
+
},
|
|
167
|
+
methods: {
|
|
168
|
+
/** 查询方法 */
|
|
169
|
+
query() {
|
|
170
|
+
if (this.loading_) {
|
|
171
|
+
return
|
|
172
|
+
}
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
this.loading_ = true
|
|
175
|
+
let fullModel = Object.assign({}, this.model)
|
|
176
176
|
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
// 设置分页
|
|
178
|
+
fullModel.page = this.page
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
this.page.index = 1
|
|
197
|
-
this.query()
|
|
198
|
-
},
|
|
199
|
-
/** 查询表单重置 */
|
|
200
|
-
reset(from) {
|
|
201
|
-
if (!from) {
|
|
202
|
-
this.$refs.querybar.reset()
|
|
203
|
-
} else {
|
|
204
|
-
this.$refs.table.clearSort()
|
|
180
|
+
this.action(fullModel)
|
|
181
|
+
.then(data => {
|
|
182
|
+
this.rows = data.rows
|
|
183
|
+
this.total = data.total
|
|
184
|
+
// 回到顶部
|
|
185
|
+
this.$refs.table.scrollTop()
|
|
186
|
+
// 重新绘制布局
|
|
187
|
+
this.$refs.table.doLayout()
|
|
188
|
+
this.loading_ = false
|
|
189
|
+
})
|
|
190
|
+
.catch(() => {
|
|
191
|
+
this.loading_ = false
|
|
192
|
+
})
|
|
193
|
+
},
|
|
194
|
+
/** 刷新 */
|
|
195
|
+
refresh() {
|
|
205
196
|
this.page.index = 1
|
|
197
|
+
this.query()
|
|
198
|
+
},
|
|
199
|
+
/** 查询表单重置 */
|
|
200
|
+
reset(from) {
|
|
201
|
+
if (!from) {
|
|
202
|
+
this.$refs.querybar.reset()
|
|
203
|
+
} else {
|
|
204
|
+
this.$refs.table.clearSort()
|
|
205
|
+
this.page.index = 1
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
/** 获取序号 */
|
|
209
|
+
getNo(index) {
|
|
210
|
+
return (this.page.index - 1) * this.page.size + index + 1
|
|
206
211
|
}
|
|
207
212
|
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
this.
|
|
213
|
+
created() {
|
|
214
|
+
if (this.queryOnCreated) {
|
|
215
|
+
this.query()
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
activated() {
|
|
219
|
+
// 重新绘制布局
|
|
220
|
+
this.$refs.table.doLayout()
|
|
216
221
|
}
|
|
217
|
-
},
|
|
218
|
-
activated() {
|
|
219
|
-
// 重新绘制布局
|
|
220
|
-
this.$refs.table.doLayout()
|
|
221
222
|
}
|
|
222
|
-
}
|
|
223
223
|
</script>
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<nm-dialog
|
|
3
|
-
class="nm-list-dialog"
|
|
4
|
-
no-scrollbar
|
|
5
|
-
:title="title"
|
|
6
|
-
:icon="icon"
|
|
7
|
-
:width="width"
|
|
8
|
-
:height="height"
|
|
9
|
-
:fullscreen="fullscreen"
|
|
10
|
-
:close-on-click-modal="closeOnClickModal"
|
|
11
|
-
:draggable="draggable"
|
|
12
|
-
:drag-out-page="dragOutPage"
|
|
13
|
-
:drag-min-width="dragMinWidth"
|
|
14
|
-
:visible.sync="visible_"
|
|
15
|
-
v-on="on"
|
|
16
|
-
>
|
|
2
|
+
<nm-dialog class="nm-list-dialog" no-scrollbar :title="title" :icon="icon" :width="width" :height="height" :fullscreen="fullscreen" :close-on-click-modal="closeOnClickModal" :draggable="draggable" :drag-out-page="dragOutPage" :drag-min-width="dragMinWidth" :visible.sync="visible_" v-on="on">
|
|
17
3
|
<template v-slot:title>
|
|
18
4
|
<slot name="title" />
|
|
19
5
|
</template>
|
|
@@ -25,78 +11,78 @@
|
|
|
25
11
|
</nm-dialog>
|
|
26
12
|
</template>
|
|
27
13
|
<script>
|
|
28
|
-
import visible from '../../mixins/components/visible.js'
|
|
29
|
-
export default {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
props: {
|
|
43
|
-
/** 标题 */
|
|
44
|
-
title: String,
|
|
45
|
-
/** 图标 */
|
|
46
|
-
icon: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: 'list'
|
|
49
|
-
},
|
|
50
|
-
/** Dialog 的宽度 */
|
|
51
|
-
width: {
|
|
52
|
-
type: String,
|
|
53
|
-
default: '60%'
|
|
54
|
-
},
|
|
55
|
-
/** Dialog 的高度 */
|
|
56
|
-
height: {
|
|
57
|
-
type: [Number, String],
|
|
58
|
-
default: '80%'
|
|
59
|
-
},
|
|
60
|
-
/** 是否显示全屏按钮 */
|
|
61
|
-
fullscreen: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: true
|
|
64
|
-
},
|
|
65
|
-
/** 是否可以通过点击 modal 关闭 Dialog */
|
|
66
|
-
closeOnClickModal: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: null
|
|
69
|
-
},
|
|
70
|
-
/** 是否可拖拽 */
|
|
71
|
-
draggable: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: null
|
|
74
|
-
},
|
|
75
|
-
/** 是否可拖出页面 */
|
|
76
|
-
dragOutPage: Boolean,
|
|
77
|
-
/** 拖拽出页面后保留的最小宽度 */
|
|
78
|
-
dragMinWidth: Number
|
|
79
|
-
},
|
|
80
|
-
methods: {
|
|
81
|
-
refresh() {
|
|
82
|
-
this.$slots.default.map(slot => {
|
|
83
|
-
if (slot.componentOptions.tag === 'nm-list') {
|
|
84
|
-
slot.componentInstance.refresh()
|
|
14
|
+
import visible from '../../mixins/components/visible.js'
|
|
15
|
+
export default {
|
|
16
|
+
name: 'ListDialog',
|
|
17
|
+
mixins: [visible],
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
on: {
|
|
21
|
+
open: this.onOpen,
|
|
22
|
+
opened: this.onOpened,
|
|
23
|
+
close: this.onClose,
|
|
24
|
+
closed: this.onClosed
|
|
85
25
|
}
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
onOpen() {
|
|
89
|
-
this.$emit('open')
|
|
90
|
-
},
|
|
91
|
-
onOpened() {
|
|
92
|
-
this.$emit('opened')
|
|
26
|
+
}
|
|
93
27
|
},
|
|
94
|
-
|
|
95
|
-
|
|
28
|
+
props: {
|
|
29
|
+
/** 标题 */
|
|
30
|
+
title: String,
|
|
31
|
+
/** 图标 */
|
|
32
|
+
icon: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: 'list'
|
|
35
|
+
},
|
|
36
|
+
/** Dialog 的宽度 */
|
|
37
|
+
width: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: '60%'
|
|
40
|
+
},
|
|
41
|
+
/** Dialog 的高度 */
|
|
42
|
+
height: {
|
|
43
|
+
type: [Number, String],
|
|
44
|
+
default: '80%'
|
|
45
|
+
},
|
|
46
|
+
/** 是否显示全屏按钮 */
|
|
47
|
+
fullscreen: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
},
|
|
51
|
+
/** 是否可以通过点击 modal 关闭 Dialog */
|
|
52
|
+
closeOnClickModal: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: null
|
|
55
|
+
},
|
|
56
|
+
/** 是否可拖拽 */
|
|
57
|
+
draggable: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: null
|
|
60
|
+
},
|
|
61
|
+
/** 是否可拖出页面 */
|
|
62
|
+
dragOutPage: Boolean,
|
|
63
|
+
/** 拖拽出页面后保留的最小宽度 */
|
|
64
|
+
dragMinWidth: Number
|
|
96
65
|
},
|
|
97
|
-
|
|
98
|
-
|
|
66
|
+
methods: {
|
|
67
|
+
refresh() {
|
|
68
|
+
this.$slots.default.map(slot => {
|
|
69
|
+
if (slot.componentOptions.tag === 'nm-list') {
|
|
70
|
+
slot.componentInstance.refresh()
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
},
|
|
74
|
+
onOpen() {
|
|
75
|
+
this.$emit('open')
|
|
76
|
+
},
|
|
77
|
+
onOpened() {
|
|
78
|
+
this.$emit('opened')
|
|
79
|
+
},
|
|
80
|
+
onClose() {
|
|
81
|
+
this.$emit('close')
|
|
82
|
+
},
|
|
83
|
+
onClosed() {
|
|
84
|
+
this.$emit('closed')
|
|
85
|
+
}
|
|
99
86
|
}
|
|
100
87
|
}
|
|
101
|
-
}
|
|
102
88
|
</script>
|
|
@@ -20,58 +20,58 @@
|
|
|
20
20
|
</nm-box>
|
|
21
21
|
</template>
|
|
22
22
|
<script>
|
|
23
|
-
export default {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
props: {
|
|
32
|
-
value: {
|
|
33
|
-
type: Array,
|
|
34
|
-
required: true
|
|
35
|
-
},
|
|
36
|
-
// 标题
|
|
37
|
-
title: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: '列表'
|
|
23
|
+
export default {
|
|
24
|
+
name: 'Listbox',
|
|
25
|
+
data() {
|
|
26
|
+
return {
|
|
27
|
+
value_: this.value,
|
|
28
|
+
resizeing: false
|
|
29
|
+
}
|
|
40
30
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
props: {
|
|
32
|
+
value: {
|
|
33
|
+
type: Array,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
// 标题
|
|
37
|
+
title: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: '列表'
|
|
40
|
+
},
|
|
41
|
+
// 左侧图标
|
|
42
|
+
icon: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'select'
|
|
45
|
+
},
|
|
46
|
+
/** 不显示数量 */
|
|
47
|
+
noCount: Boolean
|
|
45
48
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
methods: {
|
|
50
|
+
remove(v) {
|
|
51
|
+
this.value_.splice(
|
|
52
|
+
this.value_.findIndex(item => item.value === v),
|
|
53
|
+
1
|
|
54
|
+
)
|
|
55
|
+
this.$emit('input', this.value_)
|
|
56
|
+
this.$emit('remove', v, this.value_)
|
|
57
|
+
},
|
|
58
|
+
scrollbarResize() {
|
|
59
|
+
if (!this.resizeing) {
|
|
60
|
+
this.resizeing = true
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
this.$nextTick(() => {
|
|
63
|
+
this.$refs.page.scrollbarResize()
|
|
64
|
+
this.resizeing = false
|
|
65
|
+
})
|
|
66
|
+
}, 300)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
57
69
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
this.
|
|
61
|
-
|
|
62
|
-
this.$nextTick(() => {
|
|
63
|
-
this.$refs.page.scrollbarResize()
|
|
64
|
-
this.resizeing = false
|
|
65
|
-
})
|
|
66
|
-
}, 300)
|
|
70
|
+
watch: {
|
|
71
|
+
value(val) {
|
|
72
|
+
this.value_ = val
|
|
73
|
+
this.scrollbarResize()
|
|
67
74
|
}
|
|
68
75
|
}
|
|
69
|
-
},
|
|
70
|
-
watch: {
|
|
71
|
-
value(val) {
|
|
72
|
-
this.value_ = val
|
|
73
|
-
this.scrollbarResize()
|
|
74
|
-
}
|
|
75
76
|
}
|
|
76
|
-
}
|
|
77
77
|
</script>
|