@v2coding/ui 0.1.7 → 0.1.11

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 (48) hide show
  1. package/dist/v2coding-ui.esm.js +67 -25
  2. package/dist/v2coding-ui.min.js +1 -1
  3. package/dist/v2coding-ui.ssr.js +78 -36
  4. package/package.json +2 -3
  5. package/src/components/dialog/dialog.vue +0 -179
  6. package/src/components/drawer/drawer.vue +0 -523
  7. package/src/components/exports/index.vue +0 -53
  8. package/src/components/exports/remote-exports-dialog.vue +0 -202
  9. package/src/components/field/field.autocomplete.vue +0 -21
  10. package/src/components/field/field.calendar.vue +0 -117
  11. package/src/components/field/field.cascade.vue +0 -233
  12. package/src/components/field/field.checkbox.vue +0 -134
  13. package/src/components/field/field.color.vue +0 -24
  14. package/src/components/field/field.date.vue +0 -145
  15. package/src/components/field/field.fence.vue +0 -856
  16. package/src/components/field/field.icons.vue +0 -123
  17. package/src/components/field/field.lnglat.vue +0 -236
  18. package/src/components/field/field.number.vue +0 -43
  19. package/src/components/field/field.radio.vue +0 -100
  20. package/src/components/field/field.rate.vue +0 -37
  21. package/src/components/field/field.rich.vue +0 -155
  22. package/src/components/field/field.select.vue +0 -210
  23. package/src/components/field/field.slider.vue +0 -66
  24. package/src/components/field/field.switch.vue +0 -14
  25. package/src/components/field/field.text.vue +0 -66
  26. package/src/components/field/field.timepicker.vue +0 -70
  27. package/src/components/field/field.timeselect.vue +0 -24
  28. package/src/components/field/field.trigger.dialog.vue +0 -50
  29. package/src/components/field/field.trigger.popover.vue +0 -63
  30. package/src/components/field/field.upload.file.vue +0 -241
  31. package/src/components/field/field.upload.image.vue +0 -125
  32. package/src/components/fill-view/fill-view.vue +0 -43
  33. package/src/components/form/form.dialog.vue +0 -174
  34. package/src/components/form/form.drawer.vue +0 -246
  35. package/src/components/form/form.fieldset.vue +0 -110
  36. package/src/components/form/form.item.vue +0 -210
  37. package/src/components/form/form.vue +0 -302
  38. package/src/components/history/history.vue +0 -361
  39. package/src/components/icon/icon.vue +0 -63
  40. package/src/components/minimize/minimize.vue +0 -342
  41. package/src/components/page/page.vue +0 -43
  42. package/src/components/page/search-page.vue +0 -202
  43. package/src/components/provider/provider.vue +0 -15
  44. package/src/components/scroll-view/scroll-view.vue +0 -384
  45. package/src/components/table/column.vue +0 -262
  46. package/src/components/table/table.pagination.vue +0 -71
  47. package/src/components/table/table.select.vue +0 -165
  48. package/src/components/table/table.vue +0 -807
@@ -1,123 +0,0 @@
1
- <template>
2
- <trigger-field popover v-bind="$attrs" :value="value" :visible.sync="visible" :prefix-icon="value" @hide="onHide">
3
- <div class="ui-field-icons">
4
- <el-input class="filter" v-model="filter" placeholder="输入名称快速查找" clearable/>
5
- <div class="scroll">
6
- <div class="icons" v-loading="iconsLoading">
7
- <div v-for="icon in filteredIcons" :key="icon" class="icon" :class="{active: value === icon}" :title="icon" @click="sel(icon)">
8
- <icon :name="icon"/>
9
- <span class="ellipsis">{{ icon }}</span>
10
- </div>
11
- </div>
12
- </div>
13
- </div>
14
- </trigger-field>
15
- </template>
16
-
17
- <script>
18
- import Icon from '../icon/icon';
19
- import FieldMixin from './field.mixin';
20
- import TriggerField from './field.trigger';
21
- import Iconfont from '../../config/config.iconfont';
22
-
23
- export default {
24
- name: 'ui-field-icons',
25
- mixins: [FieldMixin],
26
- components: {Icon, TriggerField},
27
- data() {
28
- return {
29
- filter: '',
30
- icons: [],
31
- iconsLoading: false,
32
- visible: false,
33
- };
34
- },
35
- computed: {
36
- filteredIcons() {
37
- return this.icons.filter((icon) => icon.toLowerCase().indexOf(String(this.filter).toLowerCase()) !== -1);
38
- },
39
- },
40
- mounted() {
41
- this.initIcons();
42
- },
43
- methods: {
44
- async initIcons() {
45
- this.iconsLoading = true;
46
- const icons = await Iconfont.getIcons();
47
- this.iconsLoading = false;
48
- this.icons = icons;
49
- },
50
- onChange(val) {
51
- this.$emit('input', val);
52
- this.$emit('change', val);
53
- },
54
- sel(icon) {
55
- this.onChange(icon);
56
- this.visible = false;
57
- },
58
- onHide() {
59
- this.filter = '';
60
- },
61
- focus() {
62
- this.visible = true;
63
- },
64
- },
65
- };
66
- </script>
67
-
68
- <style lang="less" scoped>
69
- .ui-field-icons {
70
- .filter {
71
- margin-bottom: 10px;
72
-
73
- ::v-deep .el-input__validateIcon {
74
- display: none;
75
- }
76
- }
77
-
78
- .scroll {
79
- height: 200px;
80
- overflow: auto;
81
- }
82
-
83
- .icons {
84
- display: flex;
85
- flex-wrap: wrap;
86
-
87
- .icon {
88
- flex: none;
89
- width: 150px;
90
- height: 28px;
91
- margin: 2px;
92
- padding: 4px;
93
- border-radius: 2px;
94
- cursor: pointer;
95
- transition: all 0.3s;
96
- overflow: hidden;
97
- text-overflow: ellipsis;
98
- white-space: nowrap;
99
- display: flex;
100
- flex-direction: row;
101
- align-items: center;
102
-
103
- &:hover {
104
- background: #eaeaea;
105
- }
106
-
107
- &.active {
108
- color: #409eff;
109
- box-shadow: inset 0 0 3px #666;
110
- }
111
-
112
- .ui-icon {
113
- margin-right: 4px;
114
- }
115
-
116
- span {
117
- flex: 1;
118
-
119
- }
120
- }
121
- }
122
- }
123
- </style>
@@ -1,236 +0,0 @@
1
- <template>
2
- <div class="ui-field-latlng" v-loading="loading">
3
- <div class="map"></div>
4
- <div class="info" v-show="!loading">
5
- <div class="input-item searchbox">
6
- <div class="input-item-prepend">
7
- <span class="input-item-text">搜索关键字</span>
8
- </div>
9
- <!-- form="__ignore__" 避免 enter提交表单 -->
10
- <input ref="input" type="text" form="__ignore__" placeholder="请输入...">
11
- <div ref="output" class="search-result"></div>
12
- </div>
13
- </div>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- import gcoord from 'gcoord';
19
- import {getAMap} from '../../config/config.amap';
20
- import FieldMixin from './field.mixin';
21
-
22
- const CoordTypes = {
23
- bd09: gcoord.BD09,
24
- gcj02: gcoord.GCJ02,
25
- wgs84: gcoord.WGS84,
26
- };
27
-
28
- export default {
29
- name: 'ui-field-latlng',
30
- mixins: [FieldMixin],
31
- props: {
32
- coordType: {
33
- type: String,
34
- default: 'wgs84',
35
- validator: (val) => Object.keys(CoordTypes).includes(val),
36
- },
37
- },
38
- data() {
39
- return {
40
- loading: true,
41
- keyword: '',
42
- };
43
- },
44
- computed: {
45
- point() {
46
- if (!this.value) {
47
- return null;
48
- }
49
- if (!this.isValidPoint(this.value)) {
50
- return null;
51
- }
52
- const [lat, lng] = this.value.split(',');
53
- return {lat: +lat, lng: +lng};
54
- },
55
- },
56
- watch: {
57
- point(p) {
58
- this.onPointChange(p);
59
- },
60
- },
61
- methods: {
62
- init() {
63
- getAMap(['AMap.ToolBar', 'AMap.Geolocation', 'AMap.AutoComplete']).then((AMap) => {
64
- this.initMap(AMap);
65
- this.loading = false;
66
- this.done();
67
- });
68
- },
69
- initMap(AMap) {
70
- const map = new AMap.Map(this.$el.querySelector('.map'), {
71
- zoom: 11,
72
- });
73
-
74
- map.addControl(new AMap.ToolBar({position: 'RT'}));
75
- map.addControl(new AMap.Geolocation({position: 'RB'}));
76
- const auto = new AMap.AutoComplete({
77
- input: this.$refs.input,
78
- output: this.$refs.output,
79
- });
80
-
81
- map.on('click', this.onMapClick);
82
- auto.on('select', (event) => {
83
- if (!event.poi || !event.poi.location) {
84
- return;
85
- }
86
- map.setZoomAndCenter(16, event.poi.location);
87
- });
88
-
89
- this.map = map;
90
-
91
- this.onPointChange(this.point);
92
- },
93
- isValidPoint(val) {
94
- const [lat, lng] = val.split(',');
95
- return !(isNaN(+lat) || isNaN(+lng));
96
- },
97
- onMapClick({lnglat}) {
98
- let {lat, lng} = lnglat;
99
- // 当前地图是 GCJ02 坐标系
100
- if (this.coordType !== 'gcj02') {
101
- [lng, lat] = gcoord.transform([lng, lat], gcoord.GCJ02, CoordTypes[this.coordType]);
102
- lng = lng.toFixed(7) / 1;
103
- lat = lat.toFixed(7) / 1;
104
- }
105
- this.onChange([lat, lng].join(','));
106
- },
107
- onPointChange(point) {
108
- if (!this.map) {
109
- return;
110
- }
111
- this.map.clearMap();
112
- if (!point) {
113
- return;
114
- }
115
- let {lng, lat} = point;
116
- // 当前地图是 GCJ02 坐标系
117
- if (this.coordType !== 'gcj02') {
118
- [lng, lat] = gcoord.transform([lng, lat], CoordTypes[this.coordType], gcoord.GCJ02);
119
- }
120
- // eslint-disable-next-line no-undef
121
- const marker = new AMap.Marker({position: new AMap.LngLat(lng, lat)});
122
- this.map.add(marker);
123
- this.map.setCenter([lng, lat]);
124
- },
125
- },
126
- };
127
- </script>
128
-
129
- <style lang="less">
130
- .ui-field-latlng {
131
- width: 100%;
132
- height: 280px;
133
- position: relative;
134
-
135
- .map {
136
- width: 100%;
137
- height: 100%;
138
- }
139
-
140
- .info {
141
- position: absolute;
142
- top: 0;
143
- left: 0;
144
- right: 0;
145
- bottom: 0;
146
- pointer-events: none;
147
-
148
- .searchbox {
149
- left: 12px;
150
- top: 12px;
151
- background-color: #fff;
152
- box-shadow: 0 0 3px rgba(0, 0, 0, .5);
153
- pointer-events: initial;
154
- border-radius: 3px;
155
- padding: 3px;
156
-
157
- .search-result {
158
- position: absolute;
159
- top: calc(100% - 2px);
160
- left: 0;
161
- right: 0;
162
- background-color: #fefefe;
163
- box-shadow: 0 1px 3px #999 ;
164
- visibility: hidden;
165
- border-radius: 0 0 3px 3px;
166
-
167
- .auto-item {
168
- white-space: nowrap;
169
- font-size: 12px;
170
- cursor: pointer;
171
- padding: 4px;
172
- line-height: 14px;
173
- }
174
- }
175
- }
176
- }
177
-
178
- .input-item {
179
- position: relative;
180
- display: inline-flex;
181
- align-items: center;
182
- width: 220px;
183
- font-size: 12px;
184
-
185
- .input-item-prepend {
186
- margin-right: -1px;
187
-
188
- .input-item-text {
189
- padding: 0.25em 0.5em;
190
- display: block;
191
- text-justify: distribute-all-lines;
192
- text-align-last: justify;
193
- align-items: center;
194
- margin-bottom: 0;
195
- font-weight: 400;
196
- line-height: 1.5;
197
- color: #495057;
198
- text-align: center;
199
- white-space: nowrap;
200
- background-color: #e9ecef;
201
- border: 1px solid #ced4da;
202
- border-radius: .25rem 0 0 .25rem;
203
- box-sizing: border-box;
204
- }
205
- }
206
-
207
- input {
208
- position: relative;
209
- flex: 1 1 auto;
210
- width: 1%;
211
- margin: 0;
212
- background: #fff;
213
- padding: 0.25em 0.5em;
214
- display: inline-block;
215
- line-height: 1.5;
216
- color: #495057;
217
- vertical-align: middle;
218
- border: 1px solid #ced4da;
219
- border-radius: 0 .25rem .25rem 0;
220
- appearance: none;
221
- box-sizing: border-box;
222
-
223
- &:focus {
224
- border-color: #80bdff;
225
- outline: 0;
226
- box-shadow: 0 0 0 0.1rem rgba(128, 189, 255, .1);
227
- }
228
- }
229
- }
230
-
231
- .amap-logo,
232
- .amap-copyright {
233
- display: none !important;
234
- }
235
- }
236
- </style>
@@ -1,43 +0,0 @@
1
- <template>
2
- <el-input-number v-bind="$attrs" v-on="$listeners" :value="pickerValue" class="ui-number-field" :controls-position="controlsPosition" />
3
- </template>
4
-
5
- <script>
6
- import FieldMixin from './field.mixin';
7
-
8
- export default {
9
- name: 'ui-field-number',
10
- mixins: [FieldMixin],
11
- props: {
12
- controlsPosition: {
13
- type: String,
14
- default: 'right',
15
- },
16
- },
17
- computed: {
18
- pickerValue() {
19
- const v = [null, undefined, ''].includes(this.value) ? undefined : +this.value;
20
- if (isNaN(v)) {
21
- return undefined;
22
- }
23
- return v;
24
- },
25
- },
26
- methods: {
27
- focus() {
28
- const numberInput = this.$children[0];
29
- numberInput && numberInput.focus();
30
- },
31
- }
32
- };
33
- </script>
34
-
35
- <style lang="less" scoped>
36
- .ui-number-field {
37
- width: 100%;
38
-
39
- ::v-deep input {
40
- text-align: initial;
41
- }
42
- }
43
- </style>
@@ -1,100 +0,0 @@
1
- <template>
2
- <div class="ui-field-radio" v-loading="realLoading" element-loading-spinner="el-icon-loading">
3
- <el-radio-group v-bind="$attrs" v-on="$listeners" :value="value">
4
- <component v-bind:is="optionComponent" v-bind="item" v-for="item in realData" :key="item.value" :label="item.value" :border="ui === 'border'" :title="item.label">
5
- {{ item.label }}
6
- </component>
7
- </el-radio-group>
8
- <div v-if="isEmpty" class="empty">暂无数据!&emsp;<el-button v-show="realError" type="text" @click="init">重新加载</el-button>
9
- </div>
10
- </div>
11
- </template>
12
-
13
- <script>
14
- import FieldMixin from './field.mixin';
15
- import DataMixin from './field.data.mixin';
16
- import Objects from '../../util/objects';
17
-
18
- export default {
19
- name: 'ui-field-radio',
20
- mixins: [FieldMixin, DataMixin],
21
- props: {
22
- ui: {
23
- type: String,
24
- validator: (val) => ['default', 'border', 'button'].includes(val),
25
- },
26
- initDefault: {
27
- type: Boolean,
28
- default: true,
29
- },
30
- },
31
- computed: {
32
- optionComponent() {
33
- if (this.ui === 'button') {
34
- return 'el-radio-button';
35
- }
36
- return 'el-radio';
37
- },
38
- isEmpty() {
39
- return !this.realData.length;
40
- },
41
- },
42
- watch: {
43
- realData(data, o) {
44
- if (!Objects.isEquals(data, o)) {
45
- this.initDefaultValue();
46
- }
47
- },
48
- },
49
- methods: {
50
- init() {
51
- this.getData().then(() => {
52
- this.done();
53
- this.initDefaultValue();
54
- });
55
- },
56
- initDefaultValue() {
57
- if (!this.initDefault) {
58
- return;
59
- }
60
- if (this.hasMatched()) {
61
- return;
62
- }
63
- const first = this.realData.find(Boolean);
64
- first && this.onChange(first.value);
65
- },
66
- hasMatched() {
67
- return this.realData.some((item) => Object.is(item.value, this.value));
68
- },
69
- resetValue() {
70
- this.onChange('');
71
- },
72
- },
73
- };
74
- </script>
75
-
76
- <style lang="less" scoped>
77
- .ui-field-radio {
78
- .empty {
79
- display: inline-flex;
80
- align-items: center;
81
- font-size: 12px;
82
- color: #909399;
83
- }
84
-
85
- > .el-radio-group {
86
- display: inline-flex;
87
- flex-direction: row;
88
- flex-wrap: wrap;
89
- align-items: center;
90
-
91
- .el-radio {
92
- line-height: 36px;
93
- }
94
- }
95
- }
96
-
97
- ::v-deep .el-loading-mask .el-loading-spinner {
98
- margin-top: -14px;
99
- }
100
- </style>
@@ -1,37 +0,0 @@
1
- <template>
2
- <el-rate v-bind="$attrs" v-on="_listeners" v-model="score" :max="max"></el-rate>
3
- </template>
4
-
5
- <script>
6
- import FieldMixin from './field.mixin';
7
-
8
- export default {
9
- name: 'ui-field-rate',
10
- mixins: [FieldMixin],
11
- props: {
12
- max: {
13
- type: Number,
14
- default: 5,
15
- },
16
- },
17
- computed: {
18
- score: {
19
- get() {
20
- if (!this.value) {
21
- return 0;
22
- }
23
- const num = Number(this.value);
24
- if (isNaN(num)) {
25
- return 0;
26
- }
27
- return Math.min(num, this.max);
28
- },
29
- set(v) {
30
- this.onChange(v);
31
- }
32
- },
33
- },
34
- };
35
- </script>
36
-
37
- <style scoped></style>
@@ -1,155 +0,0 @@
1
- <template>
2
- <quill-editor :content="value" :options="realOptions" @change="onChange"></quill-editor>
3
- </template>
4
-
5
- <script>
6
- import {Message} from 'element-ui';
7
- import {Quill, quillEditor} from 'vue-quill-editor';
8
- import FieldMixin from './field.mixin';
9
- import {quillRedefine} from './field.rich.upload';
10
- import 'quill/dist/quill.core.css';
11
- import 'quill/dist/quill.snow.css';
12
- import 'quill/dist/quill.bubble.css';
13
- import Objects from '../../util/objects';
14
-
15
- const Font = Quill.import('formats/font');
16
-
17
- Font.whitelist = ['Arial', 'FangSong', 'HeiTi', 'Microsoft'];
18
-
19
- Quill.register(Font, true);
20
-
21
- const defaultConfig = {
22
- upload: {
23
- url: ({type}) => (type === 'oss' ? '/aliyun/oss' : '/api/oss/upload'), // 必填参数 图片上传地址
24
- accept: 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon', // 可选 可上传的图片格式
25
- filename: 'file', // 必填参数 文件的参数名
26
- type: 'oss', // default:上传至服务器; oss:上传至oss
27
- afterUpload(result) {
28
- if (!result.success) {
29
- Message.error(result.message || '上传错误');
30
- return;
31
- }
32
- return result.content.url;
33
- },
34
- beforeUpload: () => void 0,
35
- },
36
- placeholder: '请输入...',
37
- theme: 'snow', // 主题
38
- modules: {
39
- toolbar: {
40
- // 工具栏选项
41
- container: [
42
- ['bold', 'italic', 'underline', 'strike'],
43
- ['blockquote', 'code-block'],
44
- [{header: 1}, {header: 2}],
45
- [{list: 'ordered'}, {list: 'bullet'}],
46
- [{script: 'sub'}, {script: 'super'}],
47
- [{indent: '-1'}, {indent: '+1'}],
48
- [{direction: 'rtl'}],
49
- [{size: ['small', false, 'large', 'huge']}],
50
- [{header: [1, 2, 3, 4, 5, 6, false]}],
51
- [{color: []}, {background: []}],
52
- [{font: ['Arial', 'FangSong', 'HeiTi', 'Microsoft']}],
53
- [{align: []}],
54
- ['clean'],
55
- ['link', 'image', 'video'],
56
- ],
57
- },
58
- },
59
- };
60
-
61
- const RichField = {
62
- name: 'ui-field-rich',
63
- mixins: [FieldMixin],
64
- components: {
65
- quillEditor,
66
- },
67
- computed: {
68
- realOptions() {
69
- return quillRedefine(Objects.merge({}, defaultConfig, this.$attrs));
70
- },
71
- },
72
- methods: {
73
- onChange({html}) {
74
- this.emitChange(html);
75
- },
76
- },
77
- };
78
-
79
- export default RichField;
80
- </script>
81
-
82
- <style lang="less">
83
- .quill-editor {
84
- /*工具栏内用*/
85
-
86
- .ql-font {
87
- span[data-value="Arial"]::before {
88
- content: "Arial" !important;
89
- font-family: "Arial",serif;
90
- }
91
-
92
- span[data-value="FangSong"]::before {
93
- content: "仿宋" !important;
94
- font-family: "仿宋_GB2312", "FangSong_GB2312", "宋体", "SimSun", "STFangsong","STSong", serif;
95
- }
96
-
97
- span[data-value="HeiTi"]::before {
98
- content: "黑体" !important;
99
- font-family: "黑体", "SimHei", "微软正黑体", "Microsoft JhengHei", "STHeiti",serif;
100
- }
101
-
102
- span[data-value="Microsoft"]::before {
103
- content: "微软雅黑" !important;
104
- font-family: "微软雅黑", "Microsoft YaHei",serif;
105
- }
106
- }
107
-
108
- /*编辑器内容用*/
109
-
110
- .ql-font-Arial {
111
- font-family: "Arial",serif;
112
- }
113
-
114
- .ql-font-FangSong {
115
- font-family: "仿宋_GB2312", "FangSong_GB2312", "宋体", "SimSun", "STFangsong","STSong", serif;
116
- }
117
-
118
- .ql-font-HeiTi {
119
- font-family: "黑体", "SimHei", "微软正黑体", "Microsoft JhengHei", "STHeiti",serif;
120
- }
121
-
122
- .ql-font-Microsoft {
123
- font-family: "微软雅黑", "Microsoft YaHei",serif;
124
- }
125
- }
126
- </style>
127
-
128
- <style lang="less" scoped>
129
- .quill-editor {
130
- width: 100%;
131
-
132
- display: flex;
133
- align-items: initial !important;
134
- flex-direction: column;
135
-
136
- .ql-toolbar {
137
- flex: none;
138
- }
139
-
140
- .ql-container {
141
- flex: auto;
142
- height: initial;
143
- display: flex;
144
- flex-direction: column;
145
-
146
- .ql-editor {
147
- flex: auto;
148
- }
149
- }
150
- }
151
-
152
- .quill-editor ::v-deep .ql-editor {
153
- min-height: 200px;
154
- }
155
- </style>