widget.qw 1.0.75 → 1.0.76

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 (104) hide show
  1. package/.env.development +10 -10
  2. package/.env.production +8 -8
  3. package/README.md +73 -73
  4. package/build/style.css +473 -487
  5. package/build/widget.qw.es.js +1508 -129
  6. package/build/widget.qw.umd.js +1507 -128
  7. package/index.html +17 -17
  8. package/package.json +47 -47
  9. package/src/App.vue +26 -26
  10. package/src/api/index.js +165 -165
  11. package/src/components/AuditBar.vue +396 -396
  12. package/src/components/BillCard.vue +164 -164
  13. package/src/components/CascaderPicker.vue +132 -132
  14. package/src/components/CascaderPop.vue +371 -371
  15. package/src/components/CheckGroup.vue +113 -113
  16. package/src/components/DatetimePicker/DatetimePop.vue +342 -342
  17. package/src/components/DatetimePicker/index.vue +124 -124
  18. package/src/components/DayDropdown.vue +56 -56
  19. package/src/components/FilePicker.vue +145 -145
  20. package/src/components/Input.vue +80 -80
  21. package/src/components/MonthDropdown.vue +51 -51
  22. package/src/components/MultiPicker.vue +123 -123
  23. package/src/components/ObjsEditor.vue +334 -334
  24. package/src/components/SecretNotify.js +5 -5
  25. package/src/components/Sheet.vue +92 -92
  26. package/src/components/SingleApiPicker.vue +108 -108
  27. package/src/components/SinglePicker.vue +102 -102
  28. package/src/components/SingleUserSelector.vue +425 -425
  29. package/src/components/Switch.vue +64 -64
  30. package/src/components/TreePicker.vue +113 -113
  31. package/src/components/UserPicker.vue +106 -106
  32. package/src/components/UserProfile.vue +129 -129
  33. package/src/components/UsersPicker.vue +118 -118
  34. package/src/components/YearDropdown.vue +59 -59
  35. package/src/components/data_selector.vue +303 -303
  36. package/src/components/image_picker.vue +123 -123
  37. package/src/components/images_picker.vue +159 -144
  38. package/src/components/index.js +162 -162
  39. package/src/components/mult_list_selector.vue +155 -155
  40. package/src/components/subdepartment_selector.vue +481 -481
  41. package/src/components/user_selector.vue +639 -639
  42. package/src/components/widget/DataPop.vue +95 -95
  43. package/src/components/widget/TreePop.vue +88 -88
  44. package/src/components/widget/UserPop.vue +347 -347
  45. package/src/env.d.ts +8 -8
  46. package/src/main.js +117 -117
  47. package/src/router/index.ts +173 -173
  48. package/src/util/array_util.js +32 -32
  49. package/src/util/auth_util.js +72 -72
  50. package/src/util/bool_util.js +5 -5
  51. package/src/util/bus.js +1 -1
  52. package/src/util/cache_util.js +18 -18
  53. package/src/util/errer_code.js +6 -6
  54. package/src/util/eval_util.js +19 -19
  55. package/src/util/icon_util.js +36 -36
  56. package/src/util/image_util.js +27 -27
  57. package/src/util/index.js +57 -57
  58. package/src/util/num_util.js +70 -70
  59. package/src/util/obj_util.js +28 -28
  60. package/src/util/request.js +73 -73
  61. package/src/util/request_json.js +71 -71
  62. package/src/util/request_json_mute.js +65 -65
  63. package/src/util/request_upload.js +79 -79
  64. package/src/util/route_util.js +31 -31
  65. package/src/util/str_util.js +143 -143
  66. package/src/util/time_util.js +406 -406
  67. package/src/util/toast_util.js +24 -24
  68. package/src/util/tree_util.js +153 -153
  69. package/src/util/uuid_util.js +9 -9
  70. package/src/util/validate.js +182 -182
  71. package/src/util/vue_filter.js +223 -223
  72. package/src/views/auditbar/index.vue +78 -78
  73. package/src/views/billcard/index.vue +48 -48
  74. package/src/views/cascaderpop/index.vue +90 -90
  75. package/src/views/checkgroup/index.vue +35 -35
  76. package/src/views/dataSelector/index.vue +48 -48
  77. package/src/views/datetimepicker/index.vue +34 -34
  78. package/src/views/daydropdown/index.vue +31 -31
  79. package/src/views/filepicker/index.vue +31 -31
  80. package/src/views/imagepicker/index.vue +31 -31
  81. package/src/views/imagespicker/index.vue +31 -31
  82. package/src/views/input/index.vue +35 -35
  83. package/src/views/monthdropdown/index.vue +31 -31
  84. package/src/views/multListSelector/index.vue +61 -61
  85. package/src/views/multipicker/index.vue +36 -36
  86. package/src/views/objseditor/index.vue +277 -277
  87. package/src/views/productSelector/index.vue +35 -35
  88. package/src/views/projectpicker/index.vue +41 -41
  89. package/src/views/secretnotify/index.vue +27 -27
  90. package/src/views/sheet/index.vue +45 -45
  91. package/src/views/singlepicker/index.vue +35 -35
  92. package/src/views/subdepartmentSelector/index.vue +40 -40
  93. package/src/views/switch/index.vue +34 -34
  94. package/src/views/treepicker/index.vue +41 -41
  95. package/src/views/userSelector/index.vue +54 -54
  96. package/src/views/userSelectorNew/index.vue +45 -45
  97. package/src/views/userpicker/index.vue +43 -43
  98. package/src/views/userprofile/index.vue +30 -30
  99. package/src/views/userspicker/index.vue +43 -43
  100. package/src/views/yeardropdown/index.vue +32 -32
  101. package/src/vm/index.js +1 -1
  102. package/tsconfig.json +19 -19
  103. package/tsconfig.node.json +8 -8
  104. package/vite.config.ts +122 -122
@@ -1,124 +1,124 @@
1
- <template>
2
- <van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="props.rules"
3
- label-class="label" :placeholder="props.placeholder">
4
- <template #input>
5
- <div class="image-box">
6
- <van-uploader v-if="props.capture" v-model="files" :max-count="1" :capture="props.capture"
7
- accept="image/jpeg,image/png" :afterRead="onAfterRead" :disabled="isDisabled"
8
- :deletable="!isReadonly && !isDisabled" :before-delete="onBeforeDelete" :show-upload="!isReadonly"
9
- />
10
- <van-uploader v-else v-model="files" :max-count="1" accept="image/jpeg,image/png"
11
- :afterRead="onAfterRead" :disabled="isDisabled" :deletable="!isReadonly && !isDisabled"
12
- :before-delete="onBeforeDelete" :show-upload="!isReadonly"
13
- />
14
- </div>
15
- </template>
16
- </van-field>
17
- </template>
18
-
19
- <script setup>
20
- import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
21
- import util from '../util'
22
- import { useVModel } from "@vueuse/core"
23
-
24
- const props = defineProps({
25
- modelValue: {
26
- type: String,
27
- default: ''
28
- },
29
- label: {
30
- type: String,
31
- default: ''
32
- },
33
- required: {
34
- type: Boolean,
35
- default: false
36
- },
37
- readonly: {
38
- type: Boolean,
39
- default: false
40
- },
41
- placeholder: {
42
- type: String,
43
- default: ''
44
- },
45
- capture: {
46
- type: String,
47
- default: ''
48
- },
49
- compress: {
50
- type: Boolean,
51
- default: true
52
- },
53
- rules: {
54
- type: Array,
55
- default: () => []
56
- },
57
- auth: {
58
- type: String,
59
- default: ''
60
- }
61
- })
62
-
63
- const emit = defineEmits(['update:modelValue'])
64
- const modelValue = useVModel(props, 'modelValue', emit)
65
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
66
-
67
- const files = ref([])
68
-
69
- onMounted(() => {
70
-
71
- })
72
-
73
- const onAfterRead = async (file) => {
74
- console.log(file)
75
-
76
- let compress_file = file.file
77
- if (props.compress) {
78
- compress_file = await util.compress_image(file.file)
79
- }
80
-
81
- let params = {
82
- file: compress_file
83
- }
84
-
85
- return util.file_upload(params).then(res => {
86
- modelValue.value = res.data
87
- return Promise.resolve(file)
88
- })
89
- }
90
-
91
- const onBeforeDelete = (e) => {
92
- modelValue.value = ''
93
- return Promise.resolve(e)
94
- }
95
-
96
- watch(() => props.modelValue,
97
- (newVal, oldVal) => {
98
- if (!props.modelValue) {
99
- files.value = []
100
- return
101
- }
102
-
103
- files.value = [{
104
- url: props.modelValue
105
- }]
106
- },
107
- {
108
- immediate: true
109
- }
110
- )
111
- </script>
112
-
113
- <style lang="scss" scoped>
114
- :deep(.label) {
115
- color: #000 !important;
116
- }
117
-
118
- :deep(.van-field__control:disabled) {
119
- color: #000 !important;
120
- cursor: not-allowed;
121
- opacity: 1;
122
- -webkit-text-fill-color: #000;
123
- }
1
+ <template>
2
+ <van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="props.rules"
3
+ label-class="label" :placeholder="props.placeholder">
4
+ <template #input>
5
+ <div class="image-box">
6
+ <van-uploader v-if="props.capture" v-model="files" :max-count="1" :capture="props.capture"
7
+ accept="image/jpeg,image/png" :afterRead="onAfterRead" :disabled="isDisabled"
8
+ :deletable="!isReadonly && !isDisabled" :before-delete="onBeforeDelete" :show-upload="!isReadonly"
9
+ />
10
+ <van-uploader v-else v-model="files" :max-count="1" accept="image/jpeg,image/png"
11
+ :afterRead="onAfterRead" :disabled="isDisabled" :deletable="!isReadonly && !isDisabled"
12
+ :before-delete="onBeforeDelete" :show-upload="!isReadonly"
13
+ />
14
+ </div>
15
+ </template>
16
+ </van-field>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
21
+ import util from '../util'
22
+ import { useVModel } from "@vueuse/core"
23
+
24
+ const props = defineProps({
25
+ modelValue: {
26
+ type: String,
27
+ default: ''
28
+ },
29
+ label: {
30
+ type: String,
31
+ default: ''
32
+ },
33
+ required: {
34
+ type: Boolean,
35
+ default: false
36
+ },
37
+ readonly: {
38
+ type: Boolean,
39
+ default: false
40
+ },
41
+ placeholder: {
42
+ type: String,
43
+ default: ''
44
+ },
45
+ capture: {
46
+ type: String,
47
+ default: ''
48
+ },
49
+ compress: {
50
+ type: Boolean,
51
+ default: true
52
+ },
53
+ rules: {
54
+ type: Array,
55
+ default: () => []
56
+ },
57
+ auth: {
58
+ type: String,
59
+ default: ''
60
+ }
61
+ })
62
+
63
+ const emit = defineEmits(['update:modelValue'])
64
+ const modelValue = useVModel(props, 'modelValue', emit)
65
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
66
+
67
+ const files = ref([])
68
+
69
+ onMounted(() => {
70
+
71
+ })
72
+
73
+ const onAfterRead = async (file) => {
74
+ console.log(file)
75
+
76
+ let compress_file = file.file
77
+ if (props.compress) {
78
+ compress_file = await util.compress_image(file.file)
79
+ }
80
+
81
+ let params = {
82
+ file: compress_file
83
+ }
84
+
85
+ return util.file_upload(params).then(res => {
86
+ modelValue.value = res.data
87
+ return Promise.resolve(file)
88
+ })
89
+ }
90
+
91
+ const onBeforeDelete = (e) => {
92
+ modelValue.value = ''
93
+ return Promise.resolve(e)
94
+ }
95
+
96
+ watch(() => props.modelValue,
97
+ (newVal, oldVal) => {
98
+ if (!props.modelValue) {
99
+ files.value = []
100
+ return
101
+ }
102
+
103
+ files.value = [{
104
+ url: props.modelValue
105
+ }]
106
+ },
107
+ {
108
+ immediate: true
109
+ }
110
+ )
111
+ </script>
112
+
113
+ <style lang="scss" scoped>
114
+ :deep(.label) {
115
+ color: #000 !important;
116
+ }
117
+
118
+ :deep(.van-field__control:disabled) {
119
+ color: #000 !important;
120
+ cursor: not-allowed;
121
+ opacity: 1;
122
+ -webkit-text-fill-color: #000;
123
+ }
124
124
  </style>
@@ -1,145 +1,160 @@
1
- <template>
2
- <van-field name="image" :label="props.label" :required="isRequired" :rules="props.rules" label-class="label"
3
- :placeholder="props.placeholder">
4
- <template #input>
5
- <div class="image-box">
6
- <van-uploader v-if="props.capture" v-model="files" :max-count="props.max" :capture="props.capture"
7
- accept="image/jpeg,image/png" :disabled="isDisabled" :deletable="!isRequired && !isDisabled"
8
- :afterRead="onAfterRead" :before-delete="onBeforeDelete" :show-upload="!isReadonly"/>
9
- <van-uploader v-else v-model="files" :max-count="props.max" accept="image/jpeg,image/png"
10
- :disabled="isDisabled" :deletable="!isReadonly && !isDisabled" :afterRead="onAfterRead"
11
- :before-delete="onBeforeDelete" :show-upload="!isReadonly"/>
12
- </div>
13
- </template>
14
- </van-field>
15
- </template>
16
-
17
- <script setup>
18
- import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
19
- import util from "@/util"
20
- import { useVModel } from "@vueuse/core"
21
-
22
- const props = defineProps({
23
- modelValue: {
24
- type: Array,
25
- default: []
26
- },
27
- label: {
28
- type: String,
29
- default: ''
30
- },
31
- required: {
32
- type: Boolean,
33
- default: false
34
- },
35
- readonly: {
36
- type: Boolean,
37
- default: false
38
- },
39
- placeholder: {
40
- type: String,
41
- default: undefined
42
- },
43
- capture: {
44
- type: String,
45
- default: ''
46
- },
47
- compress: {
48
- type: Boolean,
49
- default: true
50
- },
51
- max: {
52
- type: Number,
53
- default: 1000
54
- },
55
- rules: {
56
- type: Array,
57
- default: () => []
58
- },
59
- auth: {
60
- type: String,
61
- default: ''
62
- }
63
- })
64
- const emit = defineEmits(['update:modelValue'])
65
- const modelValue = useVModel(props, 'modelValue', emit)
66
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
67
- const files = ref([])
68
-
69
- onMounted(() => {
70
-
71
- })
72
-
73
- const onAfterRead = async (file) => {
74
- console.log(file)
75
-
76
- let compress_file = file.file
77
- if (props.compress) {
78
- compress_file = await util.compress_image(file.file)
79
- }
80
-
81
- let params = {
82
- file: compress_file
83
- }
84
-
85
- return util.file_upload(params).then(res => {
86
- let newUrls = []
87
- if (props.modelValue && props.modelValue.length > 0)
88
- newUrls = [...props.modelValue, res.data]
89
- else
90
- newUrls = [res.data]
91
-
92
- emit('update:modelValue', newUrls)
93
- return Promise.resolve(file)
94
- })
95
- }
96
-
97
- const onBeforeDelete = (e) => {
98
- let newUrls = props.modelValue.filter(item => {
99
- return item != e.url
100
- })
101
- emit('update:modelValue', newUrls)
102
- return Promise.resolve(e)
103
- }
104
-
105
- watch(() => props.modelValue,
106
- (newVal, oldVal) => {
107
- if (!props.modelValue || props.modelValue.length < 1) {
108
- files.value = []
109
- return
110
- }
111
-
112
- files.value = props.modelValue.map(item => {
113
- return {
114
- url: item,
115
- isImage: true
116
- }
117
- })
118
- },
119
- {
120
- immediate: true
121
- }
122
- )
123
- </script>
124
-
125
- <style lang="scss" scoped>
126
- .widget {
127
- text-align: center;
128
-
129
- .btn {
130
- position: fixed;
131
- bottom: 1rem;
132
- left: 0;
133
- right: 0;
134
- margin: auto auto;
135
- color: white;
136
- font-size: 14px;
137
- background: rgba(58, 136, 255, 1);
138
- padding: 8px 35px;
139
- width: 100px;
140
- text-align: center;
141
- display: inline-block;
142
- border-radius: 2px;
143
- }
144
- }
1
+ <template>
2
+ <van-field name="image" :label="props.label" :required="isRequired" :rules="props.rules" label-class="label"
3
+ :placeholder="props.placeholder">
4
+ <template #input>
5
+ <div class="image-box">
6
+ <van-uploader v-if="props.capture && (!isReadonly && !isDisabled)" v-model="files" :max-count="props.max"
7
+ :capture="props.capture" accept="image/jpeg,image/png" :disabled="isDisabled"
8
+ :deletable="!isRequired && !isDisabled" :afterRead="onAfterRead" :before-delete="onBeforeDelete"
9
+ :show-upload="!isReadonly" />
10
+ <van-uploader v-if="!props.capture && (!isReadonly && !isDisabled)" v-model="files" :max-count="props.max"
11
+ accept="image/jpeg,image/png" :disabled="isDisabled" :deletable="!isReadonly && !isDisabled"
12
+ :afterRead="onAfterRead" :before-delete="onBeforeDelete" :show-upload="!isReadonly" />
13
+ <img class="cover" v-if="isReadonly || isDisabled" v-for="(cover, i) in previews" :key="i" :src="cover" @click="onPreview(i)" />
14
+ <van-icon v-if="modelValue.length>props.maxPreview && (isReadonly || isDisabled)" name="ellipsis" @click="onToggleMore"/>
15
+ </div>
16
+ </template>
17
+ </van-field>
18
+ </template>
19
+
20
+ <script setup>
21
+ import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
22
+ import util from "@/util"
23
+ import { useVModel } from "@vueuse/core"
24
+ import { showImagePreview } from 'vant';
25
+
26
+ const props = defineProps({
27
+ modelValue: {
28
+ type: Array,
29
+ default: []
30
+ },
31
+ label: {
32
+ type: String,
33
+ default: ''
34
+ },
35
+ required: {
36
+ type: Boolean,
37
+ default: false
38
+ },
39
+ readonly: {
40
+ type: Boolean,
41
+ default: false
42
+ },
43
+ placeholder: {
44
+ type: String,
45
+ default: undefined
46
+ },
47
+ capture: {
48
+ type: String,
49
+ default: ''
50
+ },
51
+ compress: {
52
+ type: Boolean,
53
+ default: true
54
+ },
55
+ max: {
56
+ type: Number,
57
+ default: 10000
58
+ },
59
+ rules: {
60
+ type: Array,
61
+ default: () => []
62
+ },
63
+ auth: {
64
+ type: String,
65
+ default: ''
66
+ },
67
+ maxPreview: {
68
+ type: Number,
69
+ default: 1
70
+ }
71
+ })
72
+ const emit = defineEmits(['update:modelValue'])
73
+ const modelValue = useVModel(props, 'modelValue', emit)
74
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
75
+ const files = ref([])
76
+ const isPreviewMore=ref(false)
77
+ const previews=computed(()=>{
78
+ if(!modelValue.value || modelValue.value.length<1)
79
+ return []
80
+
81
+ if(props.maxPreview > modelValue.value.length || isPreviewMore.value)
82
+ return modelValue.value
83
+
84
+ return modelValue.value.slice(0, props.maxPreview)
85
+ })
86
+
87
+ onMounted(() => {
88
+
89
+ })
90
+
91
+ const onAfterRead = async (file) => {
92
+ console.log(file)
93
+
94
+ let compress_file = file.file
95
+ if (props.compress) {
96
+ compress_file = await util.compress_image(file.file)
97
+ }
98
+
99
+ let params = {
100
+ file: compress_file
101
+ }
102
+
103
+ return util.file_upload(params).then(res => {
104
+ let newUrls = []
105
+ if (props.modelValue && props.modelValue.length > 0)
106
+ newUrls = [...props.modelValue, res.data]
107
+ else
108
+ newUrls = [res.data]
109
+
110
+ emit('update:modelValue', newUrls)
111
+ return Promise.resolve(file)
112
+ })
113
+ }
114
+
115
+ const onBeforeDelete = (e) => {
116
+ let newUrls = props.modelValue.filter(item => {
117
+ return item != e.url
118
+ })
119
+ emit('update:modelValue', newUrls)
120
+ return Promise.resolve(e)
121
+ }
122
+
123
+ const onPreview = (i) => {
124
+ showImagePreview({images:modelValue.value, startPosition:i})
125
+ }
126
+
127
+ const onToggleMore=()=>{
128
+ isPreviewMore.value = !isPreviewMore.value
129
+ }
130
+
131
+ watch(() => props.modelValue,
132
+ (newVal, oldVal) => {
133
+ if (!props.modelValue || props.modelValue.length < 1) {
134
+ files.value = []
135
+ return
136
+ }
137
+
138
+ files.value = props.modelValue.map(item => {
139
+ return {
140
+ url: item,
141
+ isImage: true
142
+ }
143
+ })
144
+ },
145
+ {
146
+ immediate: true
147
+ }
148
+ )
149
+ </script>
150
+
151
+ <style lang="scss" scoped>
152
+
153
+ .image-box {
154
+
155
+ .cover {
156
+ width: 80px;
157
+ height: 80px;
158
+ }
159
+ }
145
160
  </style>