widget.qw 1.0.24 → 1.0.25

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 (101) hide show
  1. package/.env.development +9 -9
  2. package/.env.production +8 -8
  3. package/README.md +73 -73
  4. package/build/style.css +468 -482
  5. package/build/widget.qw.es.js +1628 -2374
  6. package/build/widget.qw.umd.js +1540 -2286
  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 +149 -141
  11. package/src/components/AuditBar.vue +340 -340
  12. package/src/components/BillCard.vue +155 -155
  13. package/src/components/CascaderPicker.vue +87 -87
  14. package/src/components/CascaderPop.vue +319 -330
  15. package/src/components/CheckGroup.vue +113 -113
  16. package/src/components/DatetimePicker/DatetimePop.vue +342 -342
  17. package/src/components/DatetimePicker/index.vue +112 -112
  18. package/src/components/DayDropdown.vue +56 -56
  19. package/src/components/FilePicker.vue +113 -113
  20. package/src/components/Input.vue +71 -71
  21. package/src/components/MonthDropdown.vue +51 -51
  22. package/src/components/MultiPicker.vue +123 -123
  23. package/src/components/SecretNotify.js +5 -5
  24. package/src/components/Sheet.vue +92 -92
  25. package/src/components/SingleApiPicker.vue +112 -112
  26. package/src/components/SinglePicker.vue +102 -102
  27. package/src/components/SingleUserSelector.vue +425 -425
  28. package/src/components/Switch.vue +64 -64
  29. package/src/components/TreePicker.vue +113 -113
  30. package/src/components/UserPicker.vue +106 -106
  31. package/src/components/UserProfile.vue +131 -131
  32. package/src/components/UsersPicker.vue +118 -118
  33. package/src/components/YearDropdown.vue +59 -59
  34. package/src/components/data_selector.vue +280 -280
  35. package/src/components/image_picker.vue +114 -114
  36. package/src/components/images_picker.vue +139 -139
  37. package/src/components/index.js +157 -157
  38. package/src/components/mult_list_selector.vue +155 -155
  39. package/src/components/subdepartment_selector.vue +481 -481
  40. package/src/components/user_selector.vue +639 -639
  41. package/src/components/widget/DataPop.vue +95 -95
  42. package/src/components/widget/TreePop.vue +88 -88
  43. package/src/components/widget/UserPop.vue +347 -347
  44. package/src/main.js +117 -117
  45. package/src/router/index.ts +168 -168
  46. package/src/util/array_util.js +32 -32
  47. package/src/util/auth_util.js +72 -72
  48. package/src/util/bool_util.js +5 -5
  49. package/src/util/bus.js +1 -1
  50. package/src/util/cache_util.js +18 -18
  51. package/src/util/errer_code.js +6 -6
  52. package/src/util/eval_util.js +19 -19
  53. package/src/util/icon_util.js +36 -36
  54. package/src/util/image_util.js +27 -27
  55. package/src/util/index.js +55 -55
  56. package/src/util/num_util.js +70 -70
  57. package/src/util/obj_util.js +28 -28
  58. package/src/util/request.js +73 -73
  59. package/src/util/request_json.js +71 -71
  60. package/src/util/request_json_mute.js +65 -65
  61. package/src/util/request_upload.js +79 -79
  62. package/src/util/route_util.js +31 -31
  63. package/src/util/str_util.js +143 -143
  64. package/src/util/time_util.js +406 -406
  65. package/src/util/toast_util.js +24 -24
  66. package/src/util/tree_util.js +153 -153
  67. package/src/util/validate.js +182 -182
  68. package/src/util/vue_filter.js +223 -223
  69. package/src/views/auditbar/index.vue +65 -65
  70. package/src/views/billcard/index.vue +45 -45
  71. package/src/views/cascaderpicker/index copy.vue +0 -0
  72. package/src/views/cascaderpicker/index.vue +0 -0
  73. package/src/views/cascaderpop/index.vue +90 -90
  74. package/src/views/checkgroup/index.vue +35 -35
  75. package/src/views/dataSelector/index.vue +48 -48
  76. package/src/views/datetimepicker/index.vue +34 -34
  77. package/src/views/daydropdown/index.vue +31 -31
  78. package/src/views/filepicker/index.vue +31 -31
  79. package/src/views/imagepicker/index.vue +31 -31
  80. package/src/views/imagespicker/index.vue +31 -31
  81. package/src/views/input/index.vue +34 -34
  82. package/src/views/monthdropdown/index.vue +31 -31
  83. package/src/views/multListSelector/index.vue +61 -61
  84. package/src/views/multipicker/index.vue +36 -36
  85. package/src/views/productSelector/index.vue +35 -35
  86. package/src/views/projectdropdown/index.vue +31 -31
  87. package/src/views/projectpicker/index.vue +41 -41
  88. package/src/views/secretnotify/index.vue +27 -27
  89. package/src/views/sheet/index.vue +45 -45
  90. package/src/views/singlepicker/index.vue +35 -35
  91. package/src/views/subdepartmentSelector/index.vue +40 -40
  92. package/src/views/switch/index.vue +34 -34
  93. package/src/views/treepicker/index.vue +41 -41
  94. package/src/views/userSelector/index.vue +54 -54
  95. package/src/views/userSelectorNew/index.vue +45 -45
  96. package/src/views/userpicker/index.vue +43 -43
  97. package/src/views/userprofile/index.vue +30 -30
  98. package/src/views/userspicker/index.vue +43 -43
  99. package/src/views/yeardropdown/index.vue +32 -32
  100. package/src/vm/index.js +1 -1
  101. package/vite.config.ts +122 -122
@@ -1,113 +1,113 @@
1
- <template>
2
- <van-field v-if="!isGone"
3
- v-model="props.modelValue" name="datetimePicker" :label="props.label"
4
- :placeholder="props.placeholder" readonly :required="isRequired" :rules="props.rules"
5
- :is-link="isReadonly ? false : true"
6
- @click="onToggleShow">
7
- <template #input>
8
- {{ formatTime(props.modelValue) }}
9
- </template>
10
- </van-field>
11
-
12
- <!-- 弹出层 -->
13
- <DatetimePop v-model:isShow="data.isShow"
14
- v-model="modelValue"
15
- :before="props.before"
16
- :defaultnow="props.defaultnow"
17
- :columnsType="props.columnsType" />
18
- </template>
19
-
20
-
21
- <script setup>
22
- import { ref,reactive, watch, getCurrentInstance, computed } from "vue"
23
- import DatetimePop from './DatetimePop.vue'
24
- import util from '../../util'
25
- import { useVModel } from "@vueuse/core"
26
-
27
- const props = defineProps({
28
- modelValue:{
29
- type: String,
30
- default: ''
31
- },
32
- label: {
33
- type:String,
34
- default: ''
35
- },
36
- readonly: {
37
- type: Boolean,
38
- default: false
39
- },
40
- defaultnow: {
41
- type: Boolean,
42
- default: false
43
- },
44
- before:{
45
- type: Boolean,
46
- default: false
47
- },
48
- required: {
49
- type: Boolean,
50
- default: false
51
- },
52
- columnsType: {
53
- type: Array,
54
- default: ['year', 'month', 'day', 'hour', 'minute', 'second']
55
- },
56
- placeholder:{
57
- type:String,
58
- default:''
59
- },
60
- auth:{
61
- type:String,
62
- default:''
63
- },
64
- rules:{
65
- type: Array,
66
- default:null
67
- }
68
- })
69
- const data = reactive({
70
- isShow: false, //是否显示弹出层
71
- })
72
- const {isRequired, isReadonly, isGone,isDisabled} = util.props2auth(props)
73
- //定义要向父组件传递的事件
74
- const emit = defineEmits(["update:modelValue"])
75
- const modelValue = useVModel(props, "modelValue", emit)
76
-
77
- const formatTime=(time)=>{
78
- let res = time
79
-
80
- // let week_day = util.date2week_day(time)
81
- // res = time+'/'+week_day
82
-
83
- return res
84
- }
85
-
86
- // 默认当前时间
87
- watch(
88
- () => props.modelValue,
89
- (n, o) => {
90
- //不需要默认时间时,直接返回
91
- if (!props.defaultnow)
92
- return
93
-
94
- //有值是,直接返回
95
- if (n) {
96
- return
97
- }
98
-
99
- // 没有值时,默认设置为当前时间
100
- modelValue.value = util.date2yyyyMMddhhmmss(new Date())
101
- },
102
- {
103
- immediate: true//立即监听--进入就会执行一次 监听显影状态
104
- }
105
- )
106
-
107
- function onToggleShow() {
108
- if (isReadonly.value)
109
- return
110
-
111
- data.isShow = true
112
- }
1
+ <template>
2
+ <van-field v-if="!isGone"
3
+ v-model="props.modelValue" name="datetimePicker" :label="props.label"
4
+ :placeholder="props.placeholder" readonly :required="isRequired" :rules="props.rules"
5
+ :is-link="isReadonly ? false : true"
6
+ @click="onToggleShow">
7
+ <template #input>
8
+ {{ formatTime(props.modelValue) }}
9
+ </template>
10
+ </van-field>
11
+
12
+ <!-- 弹出层 -->
13
+ <DatetimePop v-model:isShow="data.isShow"
14
+ v-model="modelValue"
15
+ :before="props.before"
16
+ :defaultnow="props.defaultnow"
17
+ :columnsType="props.columnsType" />
18
+ </template>
19
+
20
+
21
+ <script setup>
22
+ import { ref,reactive, watch, getCurrentInstance, computed } from "vue"
23
+ import DatetimePop from './DatetimePop.vue'
24
+ import util from '../../util'
25
+ import { useVModel } from "@vueuse/core"
26
+
27
+ const props = defineProps({
28
+ modelValue:{
29
+ type: String,
30
+ default: ''
31
+ },
32
+ label: {
33
+ type:String,
34
+ default: ''
35
+ },
36
+ readonly: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ defaultnow: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ before:{
45
+ type: Boolean,
46
+ default: false
47
+ },
48
+ required: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ columnsType: {
53
+ type: Array,
54
+ default: ['year', 'month', 'day', 'hour', 'minute', 'second']
55
+ },
56
+ placeholder:{
57
+ type:String,
58
+ default:''
59
+ },
60
+ auth:{
61
+ type:String,
62
+ default:''
63
+ },
64
+ rules:{
65
+ type: Array,
66
+ default:null
67
+ }
68
+ })
69
+ const data = reactive({
70
+ isShow: false, //是否显示弹出层
71
+ })
72
+ const {isRequired, isReadonly, isGone,isDisabled} = util.props2auth(props)
73
+ //定义要向父组件传递的事件
74
+ const emit = defineEmits(["update:modelValue"])
75
+ const modelValue = useVModel(props, "modelValue", emit)
76
+
77
+ const formatTime=(time)=>{
78
+ let res = time
79
+
80
+ // let week_day = util.date2week_day(time)
81
+ // res = time+'/'+week_day
82
+
83
+ return res
84
+ }
85
+
86
+ // 默认当前时间
87
+ watch(
88
+ () => props.modelValue,
89
+ (n, o) => {
90
+ //不需要默认时间时,直接返回
91
+ if (!props.defaultnow)
92
+ return
93
+
94
+ //有值是,直接返回
95
+ if (n) {
96
+ return
97
+ }
98
+
99
+ // 没有值时,默认设置为当前时间
100
+ modelValue.value = util.date2yyyyMMddhhmmss(new Date())
101
+ },
102
+ {
103
+ immediate: true//立即监听--进入就会执行一次 监听显影状态
104
+ }
105
+ )
106
+
107
+ function onToggleShow() {
108
+ if (isReadonly.value)
109
+ return
110
+
111
+ data.isShow = true
112
+ }
113
113
  </script>
@@ -1,57 +1,57 @@
1
- <template>
2
- <van-dropdown-item v-model="modelValue" :options="totalOptions" />
3
- </template>
4
- <script setup>
5
- import { reactive, onMounted, computed } from "vue";
6
- import util from "../util"
7
- import { useVModel } from '@vueuse/core'
8
-
9
- const props = defineProps({
10
- year:{
11
- type:Number,
12
- default: 0
13
- },
14
- month:{
15
- type:Number,
16
- default: 0
17
- },
18
- modelValue: {
19
- type: Number,
20
- default: 0,
21
- },
22
- label: {
23
- type: String,
24
- default: "选择日",
25
- },
26
- placeholder: {
27
- type: String,
28
- default: "请选择日",
29
- },
30
- });
31
-
32
- const totalOptions = computed(() => {
33
- if (!props.year) return [];
34
-
35
- const year = props.year
36
- const month = props.month
37
- const days = new Date(year, month, 0).getDate(); // 获取当月实际天数
38
-
39
- let res = Array.from({length: days}, (_, i) => ({
40
- text: `${i+1}日`,
41
- value: i+1
42
- }));
43
- return [{
44
- text: '日',
45
- value: 0
46
- }, ...res]
47
- });
48
-
49
- // 定义emit
50
- const emit = defineEmits(["update:modelValue"]);
51
- const modelValue = useVModel(props, 'modelValue', emit)
52
- //首页加载
53
- onMounted(() => {
54
- })
55
- </script>
56
-
1
+ <template>
2
+ <van-dropdown-item v-model="modelValue" :options="totalOptions" />
3
+ </template>
4
+ <script setup>
5
+ import { reactive, onMounted, computed } from "vue";
6
+ import util from "../util"
7
+ import { useVModel } from '@vueuse/core'
8
+
9
+ const props = defineProps({
10
+ year:{
11
+ type:Number,
12
+ default: 0
13
+ },
14
+ month:{
15
+ type:Number,
16
+ default: 0
17
+ },
18
+ modelValue: {
19
+ type: Number,
20
+ default: 0,
21
+ },
22
+ label: {
23
+ type: String,
24
+ default: "选择日",
25
+ },
26
+ placeholder: {
27
+ type: String,
28
+ default: "请选择日",
29
+ },
30
+ });
31
+
32
+ const totalOptions = computed(() => {
33
+ if (!props.year) return [];
34
+
35
+ const year = props.year
36
+ const month = props.month
37
+ const days = new Date(year, month, 0).getDate(); // 获取当月实际天数
38
+
39
+ let res = Array.from({length: days}, (_, i) => ({
40
+ text: `${i+1}日`,
41
+ value: i+1
42
+ }));
43
+ return [{
44
+ text: '日',
45
+ value: 0
46
+ }, ...res]
47
+ });
48
+
49
+ // 定义emit
50
+ const emit = defineEmits(["update:modelValue"]);
51
+ const modelValue = useVModel(props, 'modelValue', emit)
52
+ //首页加载
53
+ onMounted(() => {
54
+ })
55
+ </script>
56
+
57
57
  <style scoped></style>
@@ -1,114 +1,114 @@
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-model="files" :max-count="1" :afterRead="onAfterRead" :disabled="isDisabled"
7
- :accept="props.accept" upload-icon="plus" :deletable="!isDisabled" :before-delete="onBeforeDelete"
8
- @click-preview="onPreview" />
9
- </div>
10
- </template>
11
- </van-field>
12
- </template>
13
-
14
- <script setup>
15
- import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
16
- import util from '../util'
17
- import { useVModel } from "@vueuse/core"
18
-
19
- const props = defineProps({
20
- modelValue: {
21
- type: String,
22
- default: ''
23
- },
24
- label: {
25
- type: String,
26
- default: ''
27
- },
28
- required: {
29
- type: Boolean,
30
- default: false
31
- },
32
- readonly: {
33
- type: Boolean,
34
- default: false
35
- },
36
- placeholder: {
37
- type: String,
38
- default: ''
39
- },
40
- rules: {
41
- type: Array,
42
- default: () => []
43
- },
44
- accept: {
45
- type: String,
46
- default: ""
47
- },
48
- auth: {
49
- type: String,
50
- default: ''
51
- }
52
- })
53
-
54
- const emit = defineEmits(['update:modelValue'])
55
- const modelValue = useVModel(props, 'modelValue', emit)
56
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
57
-
58
- const files = ref([])
59
-
60
- onMounted(() => {
61
-
62
- })
63
-
64
- const onAfterRead = async (file) => {
65
- console.log(file)
66
- let params = {
67
- file: file.file
68
- }
69
-
70
- return util.file_upload(params).then(res => {
71
- modelValue.value = res.data
72
- return Promise.resolve(file)
73
- })
74
- }
75
-
76
- const onBeforeDelete = (e) => {
77
- modelValue.value = ''
78
- return Promise.resolve(e)
79
- }
80
-
81
- const onPreview = (e) => {
82
- console.log('onPreview', e)
83
- window.open(e.url, "_blank");
84
- }
85
-
86
- watch(() => props.modelValue,
87
- (newVal, oldVal) => {
88
- if (!props.modelValue) {
89
- files.value = []
90
- return
91
- }
92
-
93
- files.value = [{
94
- url: props.modelValue
95
- }]
96
- },
97
- {
98
- immediate: true
99
- }
100
- )
101
- </script>
102
-
103
- <style lang="scss" scoped>
104
- :deep(.label) {
105
- color: #000 !important;
106
- }
107
-
108
- :deep(.van-field__control:disabled) {
109
- color: #000 !important;
110
- cursor: not-allowed;
111
- opacity: 1;
112
- -webkit-text-fill-color: #000;
113
- }
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-model="files" :max-count="1" :afterRead="onAfterRead" :disabled="isDisabled"
7
+ :accept="props.accept" upload-icon="plus" :deletable="!isDisabled" :before-delete="onBeforeDelete"
8
+ @click-preview="onPreview" />
9
+ </div>
10
+ </template>
11
+ </van-field>
12
+ </template>
13
+
14
+ <script setup>
15
+ import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
16
+ import util from '../util'
17
+ import { useVModel } from "@vueuse/core"
18
+
19
+ const props = defineProps({
20
+ modelValue: {
21
+ type: String,
22
+ default: ''
23
+ },
24
+ label: {
25
+ type: String,
26
+ default: ''
27
+ },
28
+ required: {
29
+ type: Boolean,
30
+ default: false
31
+ },
32
+ readonly: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ placeholder: {
37
+ type: String,
38
+ default: ''
39
+ },
40
+ rules: {
41
+ type: Array,
42
+ default: () => []
43
+ },
44
+ accept: {
45
+ type: String,
46
+ default: ""
47
+ },
48
+ auth: {
49
+ type: String,
50
+ default: ''
51
+ }
52
+ })
53
+
54
+ const emit = defineEmits(['update:modelValue'])
55
+ const modelValue = useVModel(props, 'modelValue', emit)
56
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
57
+
58
+ const files = ref([])
59
+
60
+ onMounted(() => {
61
+
62
+ })
63
+
64
+ const onAfterRead = async (file) => {
65
+ console.log(file)
66
+ let params = {
67
+ file: file.file
68
+ }
69
+
70
+ return util.file_upload(params).then(res => {
71
+ modelValue.value = res.data
72
+ return Promise.resolve(file)
73
+ })
74
+ }
75
+
76
+ const onBeforeDelete = (e) => {
77
+ modelValue.value = ''
78
+ return Promise.resolve(e)
79
+ }
80
+
81
+ const onPreview = (e) => {
82
+ console.log('onPreview', e)
83
+ window.open(e.url, "_blank");
84
+ }
85
+
86
+ watch(() => props.modelValue,
87
+ (newVal, oldVal) => {
88
+ if (!props.modelValue) {
89
+ files.value = []
90
+ return
91
+ }
92
+
93
+ files.value = [{
94
+ url: props.modelValue
95
+ }]
96
+ },
97
+ {
98
+ immediate: true
99
+ }
100
+ )
101
+ </script>
102
+
103
+ <style lang="scss" scoped>
104
+ :deep(.label) {
105
+ color: #000 !important;
106
+ }
107
+
108
+ :deep(.van-field__control:disabled) {
109
+ color: #000 !important;
110
+ cursor: not-allowed;
111
+ opacity: 1;
112
+ -webkit-text-fill-color: #000;
113
+ }
114
114
  </style>