@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.
@@ -1,46 +1,46 @@
1
- <!-- 字典slot -->
2
- <template>
3
- <div>{{ dictText }}</div>
4
- </template>
5
-
6
- <script>
7
- export default {
8
- // eslint-disable-next-line vue/multi-word-component-names
9
- name: 'Dict',
10
- components: {},
11
- props: {
12
- row: {
13
- type: Object,
14
- default: () => ({})
15
- },
16
- prop: {
17
- type: String,
18
- default: ''
19
- },
20
- // 字典的code
21
- code: {
22
- type: String,
23
- default: ''
24
- }
25
- },
26
- data () {
27
- return {
28
- }
29
- },
30
- computed: {
31
- dictText () {
32
- if (Array.isArray(this.row[this.prop])) {
33
- const result = this.$DDWL.enum.getLabels(this.code, this.row[this.prop])
34
- return result?.length ? result.join(',') : ''
35
- } else {
36
- return this.$DDWL.enum.getLabel(this.code, this.row[this.prop])
37
- }
38
- }
39
- },
40
- watch: {},
41
- methods: {}
42
- }
43
- </script>
44
-
45
- <style lang='scss' scoped>
46
- </style>
1
+ <!-- 字典slot -->
2
+ <template>
3
+ <div>{{ dictText }}</div>
4
+ </template>
5
+
6
+ <script>
7
+ export default {
8
+ // eslint-disable-next-line vue/multi-word-component-names
9
+ name: 'Dict',
10
+ components: {},
11
+ props: {
12
+ row: {
13
+ type: Object,
14
+ default: () => ({})
15
+ },
16
+ prop: {
17
+ type: String,
18
+ default: ''
19
+ },
20
+ // 字典的code
21
+ code: {
22
+ type: String,
23
+ default: ''
24
+ }
25
+ },
26
+ data () {
27
+ return {
28
+ }
29
+ },
30
+ computed: {
31
+ dictText () {
32
+ if (Array.isArray(this.row[this.prop])) {
33
+ const result = this.$DDWL.enum.getLabels(this.code, this.row[this.prop])
34
+ return result?.length ? result.join(',') : ''
35
+ } else {
36
+ return this.$DDWL.enum.getLabel(this.code, this.row[this.prop])
37
+ }
38
+ }
39
+ },
40
+ watch: {},
41
+ methods: {}
42
+ }
43
+ </script>
44
+
45
+ <style lang='scss' scoped>
46
+ </style>
@@ -1,36 +1,36 @@
1
- <!-- 文件slot -->
2
- <template>
3
- <!-- eslint-disable-next-line vue/no-mutating-props -->
4
- <file-upload v-model="row[prop]" readonly />
5
- </template>
6
-
7
- <script>
8
- import FileUpload from '../../packages/upload'
9
-
10
- export default {
11
- // eslint-disable-next-line vue/multi-word-component-names
12
- name: 'File',
13
- components: { FileUpload },
14
- props: {
15
- row: {
16
- type: Object,
17
- default: () => ({})
18
- },
19
- prop: {
20
- type: String,
21
- default: ''
22
- }
23
- },
24
- data () {
25
- return {
26
- }
27
- },
28
- computed: {},
29
- watch: {},
30
- created () {},
31
- methods: {}
32
- }
33
- </script>
34
-
35
- <style lang='scss' scoped>
36
- </style>
1
+ <!-- 文件slot -->
2
+ <template>
3
+ <!-- eslint-disable-next-line vue/no-mutating-props -->
4
+ <file-upload v-model="row[prop]" readonly />
5
+ </template>
6
+
7
+ <script>
8
+ import FileUpload from '../../packages/upload'
9
+
10
+ export default {
11
+ // eslint-disable-next-line vue/multi-word-component-names
12
+ name: 'File',
13
+ components: { FileUpload },
14
+ props: {
15
+ row: {
16
+ type: Object,
17
+ default: () => ({})
18
+ },
19
+ prop: {
20
+ type: String,
21
+ default: ''
22
+ }
23
+ },
24
+ data () {
25
+ return {
26
+ }
27
+ },
28
+ computed: {},
29
+ watch: {},
30
+ created () {},
31
+ methods: {}
32
+ }
33
+ </script>
34
+
35
+ <style lang='scss' scoped>
36
+ </style>
@@ -1,74 +1,74 @@
1
- <!-- 带有icon图标的内容 -->
2
- <template>
3
- <div class="icon-slot">
4
- <div v-for="({ icon, type, color }, index) in list" :key="index">
5
- <!-- image -->
6
- <img v-if="type === 'image'" class="icon-image" :src="icon" alt="">
7
- <!-- svg -->
8
- <svg-icon v-else-if="type === 'svg'" :style="{ color }" class="icon-svg" :icon="icon" />
9
- <!-- iconfont -->
10
- <i v-else class="icon-iconfont" :style="{ color }" :class="`${icon}`"></i>
11
- </div>
12
- <span class="icon-content">{{ row[prop] }}</span>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import SvgIcon from '../../packages/svg-icon'
18
- export default {
19
- // eslint-disable-next-line vue/multi-word-component-names
20
- name: 'Icon',
21
- components: { SvgIcon },
22
- props: {
23
- row: {
24
- type: Object,
25
- default: () => ({})
26
- },
27
- prop: {
28
- type: String,
29
- default: ''
30
- },
31
- // 字典的code
32
- icons: {
33
- type: [Function, Array],
34
- default: () => []
35
- }
36
- },
37
- data () {
38
- return {}
39
- },
40
- computed: {
41
- list () {
42
- if (typeof this.icons === 'function') {
43
- return this.icons(this.row)
44
- } else {
45
- return this.icons
46
- }
47
- }
48
- },
49
- created () {},
50
- methods: {}
51
- }
52
- </script>
53
-
54
- <style lang='scss' scoped>
55
- .icon-slot {
56
- display: flex;
57
- align-items: center;
58
- .icon-image {
59
- width: 20px;
60
- height: 20px;
61
- margin-right: 4px;
62
- }
63
- .icon-svg, .icon-iconfont {
64
- font-size: 18px;
65
- margin-right: 4px;
66
- }
67
- .icon-content {
68
- flex: 1;
69
- overflow: hidden;
70
- text-overflow: ellipsis;
71
- white-space: nowrap;
72
- }
73
- }
74
- </style>
1
+ <!-- 带有icon图标的内容 -->
2
+ <template>
3
+ <div class="icon-slot">
4
+ <div v-for="({ icon, type, color }, index) in list" :key="index">
5
+ <!-- image -->
6
+ <img v-if="type === 'image'" class="icon-image" :src="icon" alt="">
7
+ <!-- svg -->
8
+ <svg-icon v-else-if="type === 'svg'" :style="{ color }" class="icon-svg" :icon="icon" />
9
+ <!-- iconfont -->
10
+ <i v-else class="icon-iconfont" :style="{ color }" :class="`${icon}`"></i>
11
+ </div>
12
+ <span class="icon-content">{{ row[prop] }}</span>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import SvgIcon from '../../packages/svg-icon'
18
+ export default {
19
+ // eslint-disable-next-line vue/multi-word-component-names
20
+ name: 'Icon',
21
+ components: { SvgIcon },
22
+ props: {
23
+ row: {
24
+ type: Object,
25
+ default: () => ({})
26
+ },
27
+ prop: {
28
+ type: String,
29
+ default: ''
30
+ },
31
+ // 字典的code
32
+ icons: {
33
+ type: [Function, Array],
34
+ default: () => []
35
+ }
36
+ },
37
+ data () {
38
+ return {}
39
+ },
40
+ computed: {
41
+ list () {
42
+ if (typeof this.icons === 'function') {
43
+ return this.icons(this.row)
44
+ } else {
45
+ return this.icons
46
+ }
47
+ }
48
+ },
49
+ created () {},
50
+ methods: {}
51
+ }
52
+ </script>
53
+
54
+ <style lang='scss' scoped>
55
+ .icon-slot {
56
+ display: flex;
57
+ align-items: center;
58
+ .icon-image {
59
+ width: 20px;
60
+ height: 20px;
61
+ margin-right: 4px;
62
+ }
63
+ .icon-svg, .icon-iconfont {
64
+ font-size: 18px;
65
+ margin-right: 4px;
66
+ }
67
+ .icon-content {
68
+ flex: 1;
69
+ overflow: hidden;
70
+ text-overflow: ellipsis;
71
+ white-space: nowrap;
72
+ }
73
+ }
74
+ </style>
@@ -1,11 +1,11 @@
1
- const modules = {}
2
- const requireComponent = require.context('../slots', true, /.vue$/)
3
-
4
- requireComponent.keys().forEach(file => {
5
- const componentConfig = requireComponent(file)
6
- const components = componentConfig.default || componentConfig
7
-
8
- modules[components.name] = components
9
- })
10
-
11
- export default modules
1
+ const modules = {}
2
+ const requireComponent = require.context('../slots', true, /.vue$/)
3
+
4
+ requireComponent.keys().forEach(file => {
5
+ const componentConfig = requireComponent(file)
6
+ const components = componentConfig.default || componentConfig
7
+
8
+ modules[components.name] = components
9
+ })
10
+
11
+ export default modules
package/src/main.js CHANGED
@@ -1,63 +1,63 @@
1
- import Button from './packages/button'
2
- import Descriptions from './packages/descriptions'
3
- import Dialog from './packages/dialog'
4
- import DialogConfirm from './packages/dialog-confirm'
5
- import Drawer from './packages/drawer'
6
- import FilterTree from './packages/filter-tree'
7
- import Form from './packages/form'
8
- import FormItem from './packages/form-item'
9
- import ImportFile from './packages/import-file'
10
- import Menu from './packages/menu'
11
- import Popconfirm from './packages/popconfirm'
12
- import Render from './packages/render'
13
- import SearchForm from './packages/search-form'
14
- import SearchInput from './packages/search-input'
15
- import SearchTable from './packages/search-table'
16
- import SvgIcon from './packages/svg-icon'
17
- import Table from './packages/table'
18
- import Upload from './packages/upload'
19
- import extendComponentInstall from './lib/install/index.js'
20
-
21
- import './lib/theme/index.css'
22
-
23
- const components = [
24
- Button,
25
- Descriptions,
26
- Dialog,
27
- DialogConfirm,
28
- Drawer,
29
- FilterTree,
30
- Form,
31
- FormItem,
32
- ImportFile,
33
- Menu,
34
- Popconfirm,
35
- Render,
36
- SearchForm,
37
- SearchInput,
38
- SearchTable,
39
- SvgIcon,
40
- Table,
41
- Upload
42
- ]
43
-
44
- const install = (Vue, opts = {}) => {
45
-
46
- Vue.prototype.$DDWL = {
47
- upload: opts.upload,
48
- enum: opts.enum
49
- }
50
-
51
- if (install.installed) return
52
- components.forEach((component) => Vue.component(component.name, component))
53
-
54
- extendComponentInstall(Vue)
55
- }
56
-
57
- if (typeof window !== 'undefined' && window.Vue) {
58
- install(window.Vue)
59
- }
60
-
61
- export default {
62
- install
1
+ import Button from './packages/button'
2
+ import Descriptions from './packages/descriptions'
3
+ import Dialog from './packages/dialog'
4
+ import DialogConfirm from './packages/dialog-confirm'
5
+ import Drawer from './packages/drawer'
6
+ import FilterTree from './packages/filter-tree'
7
+ import Form from './packages/form'
8
+ import FormItem from './packages/form-item'
9
+ import ImportFile from './packages/import-file'
10
+ import Menu from './packages/menu'
11
+ import Popconfirm from './packages/popconfirm'
12
+ import Render from './packages/render'
13
+ import SearchForm from './packages/search-form'
14
+ import SearchInput from './packages/search-input'
15
+ import SearchTable from './packages/search-table'
16
+ import SvgIcon from './packages/svg-icon'
17
+ import Table from './packages/table'
18
+ import Upload from './packages/upload'
19
+ import extendComponentInstall from './lib/install/index.js'
20
+
21
+ import './lib/theme/index.css'
22
+
23
+ const components = [
24
+ Button,
25
+ Descriptions,
26
+ Dialog,
27
+ DialogConfirm,
28
+ Drawer,
29
+ FilterTree,
30
+ Form,
31
+ FormItem,
32
+ ImportFile,
33
+ Menu,
34
+ Popconfirm,
35
+ Render,
36
+ SearchForm,
37
+ SearchInput,
38
+ SearchTable,
39
+ SvgIcon,
40
+ Table,
41
+ Upload
42
+ ]
43
+
44
+ const install = (Vue, opts = {}) => {
45
+
46
+ Vue.prototype.$DDWL = {
47
+ upload: opts.upload,
48
+ enum: opts.enum
49
+ }
50
+
51
+ if (install.installed) return
52
+ components.forEach((component) => Vue.component(component.name, component))
53
+
54
+ extendComponentInstall(Vue)
55
+ }
56
+
57
+ if (typeof window !== 'undefined' && window.Vue) {
58
+ install(window.Vue)
59
+ }
60
+
61
+ export default {
62
+ install
63
63
  }
@@ -1,36 +1,36 @@
1
- <!-- 按钮 -->
2
- <template>
3
- <el-button
4
- v-bind="$attrs"
5
- :loading="loading"
6
- @click="handleClick"
7
- >
8
- <slot />
9
- </el-button>
10
- </template>
11
-
12
- <script>
13
- export default {
14
- name: 'DButton',
15
- components: {},
16
- data () {
17
- return {
18
- loading: false
19
- }
20
- },
21
- computed: {},
22
- watch: {},
23
- created () {},
24
- methods: {
25
- handleClick () {
26
- this.loading = true
27
- this.$emit('submit', () => {
28
- this.loading = false
29
- })
30
- }
31
- }
32
- }
33
- </script>
34
-
35
- <style lang='scss' scoped>
36
- </style>
1
+ <!-- 按钮 -->
2
+ <template>
3
+ <el-button
4
+ v-bind="$attrs"
5
+ :loading="loading"
6
+ @click="handleClick"
7
+ >
8
+ <slot />
9
+ </el-button>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name: 'DButton',
15
+ components: {},
16
+ data () {
17
+ return {
18
+ loading: false
19
+ }
20
+ },
21
+ computed: {},
22
+ watch: {},
23
+ created () {},
24
+ methods: {
25
+ handleClick () {
26
+ this.loading = true
27
+ this.$emit('submit', () => {
28
+ this.loading = false
29
+ })
30
+ }
31
+ }
32
+ }
33
+ </script>
34
+
35
+ <style lang='scss' scoped>
36
+ </style>