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,93 +1,93 @@
1
- <template>
2
- <van-field :label="props.label" v-if="!isGone" :disabled="isDisabled" :required="isRequired"
3
- :placeholder="props.placeholder">
4
-
5
- <template #input>
6
- <div class="actionbar" v-if="!isGone && !isDisabled && !isReadonly">
7
- <van-button icon="plus" type="primary" size="mini" @click="onAdd(0)" />
8
- </div>
9
- <div class="item-box" v-for="(item, i) in modelValue" :key="i">
10
- <slot name="item" :item="item" :auth="props.auth"></slot>
11
- <div class="actionbar" v-if="!isGone && !isDisabled && !isReadonly">
12
- <van-button icon="plus" type="primary" size="mini" @click="onAdd(i+1)" />
13
- <van-button icon="cross" type="primary" size="mini" @click="onDelete(i)" />
14
- </div>
15
- </div>
16
- </template>
17
-
18
- </van-field>
19
- </template>
20
-
21
- <script setup>
22
- import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
23
- import { useVModel } from '@vueuse/core'
24
- import util from '../util'
25
-
26
- const props = defineProps({
27
- modelValue: {
28
- type: Array,
29
- default: []
30
- },
31
- label: {
32
- type: String,
33
- default: ''
34
- },
35
- placeholder: {
36
- type: String,
37
- default: ''
38
- },
39
- readonly: {
40
- type: Boolean,
41
- default: true
42
- },
43
- required: {
44
- type: Boolean,
45
- default: false
46
- },
47
- auth: {
48
- type: String,
49
- default: ''
50
- }
51
- })
52
- const emit = defineEmits(['update:modelValue'])
53
- const modelValue = useVModel(props, 'modelValue', emit)
54
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
55
-
56
- onMounted(() => {
57
- })
58
-
59
- const onAdd = (idx) => {
60
- modelValue.value.splice(idx, 0, {})
61
- }
62
-
63
- const onDelete = (idx) => {
64
- modelValue.value.splice(idx, 1)
65
- }
66
-
67
- watch(() => props.modelValue, (o, n) => {
68
- if (!props.modelValue)
69
- modelValue.value = []
70
- }, { immediate: true })
71
- </script>
72
-
73
- <style lang="scss" scoped>
74
- .item-box {
75
- position: relative;
76
- padding-bottom: 5px;
77
- border-bottom: 1px solid #e1e1e1;
78
- }
79
-
80
- .actionbar {
81
- display: flex;
82
- justify-content: center;
83
- margin-top: 5px;
84
- }
85
-
86
- :deep(.label) {
87
- color: #000 !important;
88
- }
89
-
90
- :deep(.van-field__control--custom) {
91
- display: block;
92
- }
1
+ <template>
2
+ <van-field :label="props.label" v-if="!isGone" :disabled="isDisabled" :required="isRequired"
3
+ :placeholder="props.placeholder">
4
+
5
+ <template #input>
6
+ <div class="actionbar" v-if="!isGone && !isDisabled && !isReadonly">
7
+ <van-button icon="plus" type="primary" size="mini" @click="onAdd(0)" />
8
+ </div>
9
+ <div class="item-box" v-for="(item, i) in modelValue" :key="i">
10
+ <slot name="item" :item="item" :auth="props.auth"></slot>
11
+ <div class="actionbar" v-if="!isGone && !isDisabled && !isReadonly">
12
+ <van-button icon="plus" type="primary" size="mini" @click="onAdd(i+1)" />
13
+ <van-button icon="cross" type="primary" size="mini" @click="onDelete(i)" />
14
+ </div>
15
+ </div>
16
+ </template>
17
+
18
+ </van-field>
19
+ </template>
20
+
21
+ <script setup>
22
+ import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
23
+ import { useVModel } from '@vueuse/core'
24
+ import util from '../util'
25
+
26
+ const props = defineProps({
27
+ modelValue: {
28
+ type: Array,
29
+ default: []
30
+ },
31
+ label: {
32
+ type: String,
33
+ default: ''
34
+ },
35
+ placeholder: {
36
+ type: String,
37
+ default: ''
38
+ },
39
+ readonly: {
40
+ type: Boolean,
41
+ default: true
42
+ },
43
+ required: {
44
+ type: Boolean,
45
+ default: false
46
+ },
47
+ auth: {
48
+ type: String,
49
+ default: ''
50
+ }
51
+ })
52
+ const emit = defineEmits(['update:modelValue'])
53
+ const modelValue = useVModel(props, 'modelValue', emit)
54
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
55
+
56
+ onMounted(() => {
57
+ })
58
+
59
+ const onAdd = (idx) => {
60
+ modelValue.value.splice(idx, 0, {})
61
+ }
62
+
63
+ const onDelete = (idx) => {
64
+ modelValue.value.splice(idx, 1)
65
+ }
66
+
67
+ watch(() => props.modelValue, (o, n) => {
68
+ if (!props.modelValue)
69
+ modelValue.value = []
70
+ }, { immediate: true })
71
+ </script>
72
+
73
+ <style lang="scss" scoped>
74
+ .item-box {
75
+ position: relative;
76
+ padding-bottom: 5px;
77
+ border-bottom: 1px solid #e1e1e1;
78
+ }
79
+
80
+ .actionbar {
81
+ display: flex;
82
+ justify-content: center;
83
+ margin-top: 5px;
84
+ }
85
+
86
+ :deep(.label) {
87
+ color: #000 !important;
88
+ }
89
+
90
+ :deep(.van-field__control--custom) {
91
+ display: block;
92
+ }
93
93
  </style>
@@ -1,113 +1,113 @@
1
- <template>
2
- <div class="widget">
3
- <van-field v-model="formatLabel" is-link :label="props.label" :placeholder="props.placeholder" readonly
4
- :required="isRequired" :disabled="isDisabled" @click="onShow" />
5
- <van-popup v-model:show="data.isShow" destroy-on-close round position="bottom">
6
- <van-picker :columns="props.options" @cancel="onCancel" @confirm="onConfirm" />
7
- </van-popup>
8
- </div>
9
- </template>
10
-
11
- <script setup>
12
- import { ref, onMounted, watch, reactive, computed } from 'vue'
13
- import util from '../util'
14
- import { useVModel } from '@vueuse/core'
15
-
16
- const props = defineProps({
17
- modelValue: {
18
- type: String,
19
- default: null
20
- },
21
- label: {
22
- type: String,
23
- default: ''
24
- },
25
- placeholder: {
26
- type: String,
27
- default: ''
28
- },
29
- required: {
30
- type: Boolean,
31
- default: false,
32
- },
33
- readonly: {
34
- type: Boolean,
35
- default: true,
36
- },
37
- auth: {
38
- type: String,
39
- default: "",
40
- },
41
- options: {
42
- type:Array,
43
- default: []
44
- }
45
- })
46
-
47
- const emit = defineEmits(['update:modelValue', 'select'])
48
- const modelValue = useVModel(props, 'modelValue', emit)
49
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
50
- const data = reactive({
51
- isShow: false
52
- })
53
- const formatLabel = computed(() => {
54
- let one = props.options.find(item => item.value == modelValue.value)
55
- return one ? one.text : ''
56
- })
57
-
58
- onMounted(async () => {
59
- })
60
-
61
- const onShow=()=>{
62
- if(isReadonly.value || isDisabled.value || isGone.value)
63
- return
64
-
65
- data.isShow = true
66
- }
67
-
68
- const onConfirm = ({ selectedOptions }) => {
69
- console.log("selectedOptions: " + selectedOptions)
70
- let selectOption = selectedOptions[selectedOptions.length - 1]
71
- modelValue.value = selectOption.value
72
- emit('select', selectOption)
73
- data.isShow = false
74
- }
75
-
76
- const onCancel = () => {
77
- data.isShow = false
78
- }
79
-
80
- </script>
81
-
82
- <style lang="scss" scoped>
83
- .widget {
84
- :deep(.van-cell) {
85
- align-items: center;
86
- }
87
-
88
- :deep(.van-field__label) {
89
- width: 90px;
90
- flex: none;
91
- }
92
-
93
- .readonly-field {
94
- :deep(.van-field__control) {
95
- color: #323233;
96
- /* 修改文字颜色与普通字段一致 */
97
- padding-right: 16px;
98
- }
99
-
100
- /* 添加必填星号对齐 */
101
- &.van-field--required {
102
- :deep(.van-field__label::before) {
103
- margin-right: 4px;
104
- }
105
- }
106
- }
107
-
108
- /* 统一字段间距 */
109
- .readonly-field {
110
- margin: 4px 0;
111
- }
112
- }
1
+ <template>
2
+ <div class="widget">
3
+ <van-field v-model="formatLabel" is-link :label="props.label" :placeholder="props.placeholder" readonly
4
+ :required="isRequired" :disabled="isDisabled" @click="onShow" />
5
+ <van-popup v-model:show="data.isShow" destroy-on-close round position="bottom">
6
+ <van-picker :columns="props.options" @cancel="onCancel" @confirm="onConfirm" />
7
+ </van-popup>
8
+ </div>
9
+ </template>
10
+
11
+ <script setup>
12
+ import { ref, onMounted, watch, reactive, computed } from 'vue'
13
+ import util from '../util'
14
+ import { useVModel } from '@vueuse/core'
15
+
16
+ const props = defineProps({
17
+ modelValue: {
18
+ type: String,
19
+ default: null
20
+ },
21
+ label: {
22
+ type: String,
23
+ default: ''
24
+ },
25
+ placeholder: {
26
+ type: String,
27
+ default: ''
28
+ },
29
+ required: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ readonly: {
34
+ type: Boolean,
35
+ default: true,
36
+ },
37
+ auth: {
38
+ type: String,
39
+ default: "",
40
+ },
41
+ options: {
42
+ type:Array,
43
+ default: []
44
+ }
45
+ })
46
+
47
+ const emit = defineEmits(['update:modelValue', 'select'])
48
+ const modelValue = useVModel(props, 'modelValue', emit)
49
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
50
+ const data = reactive({
51
+ isShow: false
52
+ })
53
+ const formatLabel = computed(() => {
54
+ let one = props.options.find(item => item.value == modelValue.value)
55
+ return one ? one.text : ''
56
+ })
57
+
58
+ onMounted(async () => {
59
+ })
60
+
61
+ const onShow=()=>{
62
+ if(isReadonly.value || isDisabled.value || isGone.value)
63
+ return
64
+
65
+ data.isShow = true
66
+ }
67
+
68
+ const onConfirm = ({ selectedOptions }) => {
69
+ console.log("selectedOptions: " + selectedOptions)
70
+ let selectOption = selectedOptions[selectedOptions.length - 1]
71
+ modelValue.value = selectOption.value
72
+ emit('select', selectOption)
73
+ data.isShow = false
74
+ }
75
+
76
+ const onCancel = () => {
77
+ data.isShow = false
78
+ }
79
+
80
+ </script>
81
+
82
+ <style lang="scss" scoped>
83
+ .widget {
84
+ :deep(.van-cell) {
85
+ align-items: center;
86
+ }
87
+
88
+ :deep(.van-field__label) {
89
+ width: 90px;
90
+ flex: none;
91
+ }
92
+
93
+ .readonly-field {
94
+ :deep(.van-field__control) {
95
+ color: #323233;
96
+ /* 修改文字颜色与普通字段一致 */
97
+ padding-right: 16px;
98
+ }
99
+
100
+ /* 添加必填星号对齐 */
101
+ &.van-field--required {
102
+ :deep(.van-field__label::before) {
103
+ margin-right: 4px;
104
+ }
105
+ }
106
+ }
107
+
108
+ /* 统一字段间距 */
109
+ .readonly-field {
110
+ margin: 4px 0;
111
+ }
112
+ }
113
113
  </style>
@@ -1,103 +1,103 @@
1
- <template>
2
- <van-field v-if="!isGone" v-model="modelValue" :is-link="!isDisabled" :disabled="isDisabled" readonly name="picker"
3
- :label="label" label-class="label" :placeholder="props.placeholder" @click-input="onClick" :required="isRequired"
4
- :rules="props.rules" />
5
- <van-popup v-model:show="isShowPicker" position="bottom">
6
- <van-picker :columns="totalOptions" @confirm="onConfirm" @cancel="isShowPicker = false" />
7
- </van-popup>
8
- </template>
9
-
10
- <script setup>
11
- import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
12
- import util from "../util"
13
- import { useVModel } from '@vueuse/core'
14
-
15
- const props = defineProps({
16
- id: String,
17
- modelValue: String,
18
- label: String,
19
- placeholder:String,
20
- readonly: {
21
- type: Boolean,
22
- default: true
23
- },
24
- required: {
25
- type: Boolean,
26
- default: false
27
- },
28
- auth: {
29
- type: String,
30
- default: ''
31
- },
32
- rules: {
33
- type: Array,
34
- default: null
35
- }
36
- })
37
- const emit = defineEmits(['update:modelValue'])
38
- const modelValue = useVModel(props, 'modelValue', emit)
39
- const totalOptions = computed(() => {
40
- if (!modelValue.value)
41
- return columns.value
42
-
43
- let ary = columns.value.filter(item => item.value == modelValue.value)
44
- if (ary.length < 1)
45
- ary = [{ text: modelValue.value, value: modelValue.value }, ...columns.value]
46
- else
47
- ary = [...columns.value]
48
- return ary
49
- })
50
- const { isRequired, isGone, isDisabled,isReadonly } = util.props2auth(props)
51
-
52
- const isShowPicker = ref(false)
53
- const columns = ref([])
54
-
55
- onMounted(() => {
56
- query()
57
- })
58
-
59
- const query = async () => {
60
- let params = {
61
- id: props.id,
62
- }
63
- const res = await util.dictionary_dict(params)
64
- console.log(res.data)
65
- if (!res.data.parseValue) {
66
- columns.value = []
67
- return
68
- }
69
-
70
- columns.value = res.data.parseValue.map(item => {
71
- return {
72
- text: item.title,
73
- value: item.code
74
- }
75
- })
76
- }
77
-
78
- const onClick = () => {
79
- if (isDisabled.value)
80
- return
81
-
82
- isShowPicker.value = true
83
- }
84
-
85
- const onConfirm = ({ selectedOptions }) => {
86
- console.log("selectedOptions: " + selectedOptions)
87
- modelValue.value = selectedOptions[selectedOptions.length - 1].value
88
- isShowPicker.value = false
89
- }
90
- </script>
91
-
92
- <style lang="scss" scoped>
93
- :deep(.label) {
94
- color: #000 !important;
95
- }
96
-
97
- :deep(.van-field__control:disabled) {
98
- color: #000 !important;
99
- cursor: not-allowed;
100
- opacity: 1;
101
- -webkit-text-fill-color: #000;
102
- }
1
+ <template>
2
+ <van-field v-if="!isGone" v-model="modelValue" :is-link="!isDisabled" :disabled="isDisabled" readonly name="picker"
3
+ :label="label" label-class="label" :placeholder="props.placeholder" @click-input="onClick" :required="isRequired"
4
+ :rules="props.rules" />
5
+ <van-popup v-model:show="isShowPicker" position="bottom">
6
+ <van-picker :columns="totalOptions" @confirm="onConfirm" @cancel="isShowPicker = false" />
7
+ </van-popup>
8
+ </template>
9
+
10
+ <script setup>
11
+ import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
12
+ import util from "../util"
13
+ import { useVModel } from '@vueuse/core'
14
+
15
+ const props = defineProps({
16
+ id: String,
17
+ modelValue: String,
18
+ label: String,
19
+ placeholder:String,
20
+ readonly: {
21
+ type: Boolean,
22
+ default: true
23
+ },
24
+ required: {
25
+ type: Boolean,
26
+ default: false
27
+ },
28
+ auth: {
29
+ type: String,
30
+ default: ''
31
+ },
32
+ rules: {
33
+ type: Array,
34
+ default: null
35
+ }
36
+ })
37
+ const emit = defineEmits(['update:modelValue'])
38
+ const modelValue = useVModel(props, 'modelValue', emit)
39
+ const totalOptions = computed(() => {
40
+ if (!modelValue.value)
41
+ return columns.value
42
+
43
+ let ary = columns.value.filter(item => item.value == modelValue.value)
44
+ if (ary.length < 1)
45
+ ary = [{ text: modelValue.value, value: modelValue.value }, ...columns.value]
46
+ else
47
+ ary = [...columns.value]
48
+ return ary
49
+ })
50
+ const { isRequired, isGone, isDisabled,isReadonly } = util.props2auth(props)
51
+
52
+ const isShowPicker = ref(false)
53
+ const columns = ref([])
54
+
55
+ onMounted(() => {
56
+ query()
57
+ })
58
+
59
+ const query = async () => {
60
+ let params = {
61
+ id: props.id,
62
+ }
63
+ const res = await util.dictionary_dict(params)
64
+ console.log(res.data)
65
+ if (!res.data.parseValue) {
66
+ columns.value = []
67
+ return
68
+ }
69
+
70
+ columns.value = res.data.parseValue.map(item => {
71
+ return {
72
+ text: item.title,
73
+ value: item.code
74
+ }
75
+ })
76
+ }
77
+
78
+ const onClick = () => {
79
+ if (isDisabled.value)
80
+ return
81
+
82
+ isShowPicker.value = true
83
+ }
84
+
85
+ const onConfirm = ({ selectedOptions }) => {
86
+ console.log("selectedOptions: " + selectedOptions)
87
+ modelValue.value = selectedOptions[selectedOptions.length - 1].value
88
+ isShowPicker.value = false
89
+ }
90
+ </script>
91
+
92
+ <style lang="scss" scoped>
93
+ :deep(.label) {
94
+ color: #000 !important;
95
+ }
96
+
97
+ :deep(.van-field__control:disabled) {
98
+ color: #000 !important;
99
+ cursor: not-allowed;
100
+ opacity: 1;
101
+ -webkit-text-fill-color: #000;
102
+ }
103
103
  </style>