widget.qw 1.0.24 → 1.0.26

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 (102) 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 +1637 -2379
  6. package/build/widget.qw.umd.js +1550 -2292
  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 +324 -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 +129 -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.vue +0 -0
  72. package/src/views/cascaderpicker/index_user.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/singleapipicker/index.vue +0 -0
  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/vite.config.ts +122 -122
@@ -1,72 +1,72 @@
1
- <template>
2
- <van-field :label="props.label" v-model="modelValue" v-if="!isGone" :disabled="isDisabled" :required="isRequired"
3
- :placeholder="props.placeholder" :type="props.type" :rows="props.rows" :autosize="props.autosize" :rules="props.rules"/>
4
- </template>
5
-
6
- <script setup>
7
- import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
8
- import { useVModel } from '@vueuse/core'
9
- import util from '../util'
10
-
11
- const props = defineProps({
12
- modelValue: {
13
- type:String,
14
- default:null
15
- },
16
- label: {
17
- type:String,
18
- default: ''
19
- },
20
- type: {
21
- type: String,
22
- default: 'text'
23
- },
24
- rows:{
25
- type:Number,
26
- default:1
27
- },
28
- autosize:{
29
- type:Boolean,
30
- default:false
31
- },
32
- placeholder: {
33
- type: String,
34
- default: ''
35
- },
36
- readonly: {
37
- type: Boolean,
38
- default: true
39
- },
40
- required: {
41
- type: Boolean,
42
- default: false
43
- },
44
- auth: {
45
- type: String,
46
- default: ''
47
- },
48
- rules:{
49
- type: Array,
50
- default:null
51
- }
52
- })
53
- const emit = defineEmits(['update:modelValue'])
54
- const modelValue = useVModel(props, 'modelValue', emit)
55
- const {isRequired, isReadonly, isGone, isDisabled} = util.props2auth(props)
56
-
57
- onMounted(() => {
58
- })
59
- </script>
60
-
61
- <style lang="scss" scoped>
62
- :deep(.label) {
63
- color: #000 !important;
64
- }
65
-
66
- :deep(.van-field__control:disabled) {
67
- color: #000 !important;
68
- cursor: not-allowed;
69
- opacity: 1;
70
- -webkit-text-fill-color: #000;
71
- }
1
+ <template>
2
+ <van-field :label="props.label" v-model="modelValue" v-if="!isGone" :disabled="isDisabled" :required="isRequired"
3
+ :placeholder="props.placeholder" :type="props.type" :rows="props.rows" :autosize="props.autosize" :rules="props.rules"/>
4
+ </template>
5
+
6
+ <script setup>
7
+ import { ref, computed, onMounted, defineProps, defineEmits, watch } from "vue"
8
+ import { useVModel } from '@vueuse/core'
9
+ import util from '../util'
10
+
11
+ const props = defineProps({
12
+ modelValue: {
13
+ type:String,
14
+ default:null
15
+ },
16
+ label: {
17
+ type:String,
18
+ default: ''
19
+ },
20
+ type: {
21
+ type: String,
22
+ default: 'text'
23
+ },
24
+ rows:{
25
+ type:Number,
26
+ default:1
27
+ },
28
+ autosize:{
29
+ type:Boolean,
30
+ default:false
31
+ },
32
+ placeholder: {
33
+ type: String,
34
+ default: ''
35
+ },
36
+ readonly: {
37
+ type: Boolean,
38
+ default: true
39
+ },
40
+ required: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ auth: {
45
+ type: String,
46
+ default: ''
47
+ },
48
+ rules:{
49
+ type: Array,
50
+ default:null
51
+ }
52
+ })
53
+ const emit = defineEmits(['update:modelValue'])
54
+ const modelValue = useVModel(props, 'modelValue', emit)
55
+ const {isRequired, isReadonly, isGone, isDisabled} = util.props2auth(props)
56
+
57
+ onMounted(() => {
58
+ })
59
+ </script>
60
+
61
+ <style lang="scss" scoped>
62
+ :deep(.label) {
63
+ color: #000 !important;
64
+ }
65
+
66
+ :deep(.van-field__control:disabled) {
67
+ color: #000 !important;
68
+ cursor: not-allowed;
69
+ opacity: 1;
70
+ -webkit-text-fill-color: #000;
71
+ }
72
72
  </style>
@@ -1,52 +1,52 @@
1
- <template>
2
- <van-dropdown-item v-model="modelValue" :options="data.monthOptions" />
3
- </template>
4
- <script setup>
5
- import { reactive, onMounted, watch } from "vue";
6
- import util from "../util"
7
- import { useVModel } from '@vueuse/core'
8
-
9
- const props = defineProps({
10
- modelValue: {
11
- type: Number,
12
- default: 0,
13
- },
14
- label: {
15
- type: String,
16
- default: "选择月份",
17
- },
18
- placeholder: {
19
- type: String,
20
- default: "请选择月份",
21
- },
22
- });
23
-
24
- // 弹出层
25
- const data = reactive({
26
- monthOptions: []
27
- })
28
-
29
- // 定义emit
30
- const emit = defineEmits(["update:modelValue"]);
31
- const modelValue = useVModel(props, 'modelValue', emit)
32
-
33
- const setupOptions = () => {
34
- data.monthOptions.push({
35
- text: '月',
36
- value: 0
37
- })
38
- for (var i = 1; i <= 12; i++) {
39
- data.monthOptions.push({
40
- text: i+'月',
41
- value: i,
42
- });
43
- }
44
- };
45
-
46
- //首页加载
47
- onMounted(() => {
48
- setupOptions()
49
- })
50
- </script>
51
-
1
+ <template>
2
+ <van-dropdown-item v-model="modelValue" :options="data.monthOptions" />
3
+ </template>
4
+ <script setup>
5
+ import { reactive, onMounted, watch } from "vue";
6
+ import util from "../util"
7
+ import { useVModel } from '@vueuse/core'
8
+
9
+ const props = defineProps({
10
+ modelValue: {
11
+ type: Number,
12
+ default: 0,
13
+ },
14
+ label: {
15
+ type: String,
16
+ default: "选择月份",
17
+ },
18
+ placeholder: {
19
+ type: String,
20
+ default: "请选择月份",
21
+ },
22
+ });
23
+
24
+ // 弹出层
25
+ const data = reactive({
26
+ monthOptions: []
27
+ })
28
+
29
+ // 定义emit
30
+ const emit = defineEmits(["update:modelValue"]);
31
+ const modelValue = useVModel(props, 'modelValue', emit)
32
+
33
+ const setupOptions = () => {
34
+ data.monthOptions.push({
35
+ text: '月',
36
+ value: 0
37
+ })
38
+ for (var i = 1; i <= 12; i++) {
39
+ data.monthOptions.push({
40
+ text: i+'月',
41
+ value: i,
42
+ });
43
+ }
44
+ };
45
+
46
+ //首页加载
47
+ onMounted(() => {
48
+ setupOptions()
49
+ })
50
+ </script>
51
+
52
52
  <style scoped></style>
@@ -1,124 +1,124 @@
1
- <template>
2
- <van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="props.rules" :disabled="isDisabled"
3
- :placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
4
- label-class="label">
5
- <template #input v-if="selectOptions.length>0">
6
- <div class="data-list">
7
- <van-tag class="data-item" :closeable="!isDisabled" type="primary" plain v-for="(item, i) in selectOptions"
8
- :key="item" @close.stop="onDelete(i)">
9
- {{ item.title }}
10
- </van-tag>
11
- </div>
12
- </template>
13
- </van-field>
14
- <data-pop v-model="modelValue" :options="totalOptions" v-model:show="data.isShowPop" />
15
- </template>
16
-
17
- <script setup>
18
- import { onMounted, ref, onBeforeUpdate, computed, nextTick, watch, reactive } from "vue"
19
- import util from '../util'
20
- import DataPop from "./widget/DataPop.vue";
21
- import { useVModel } from "@vueuse/core";
22
-
23
- const props = defineProps({
24
- id: String,
25
- label: String,
26
- placeholder: String,
27
- options: {
28
- type: Array,
29
- default: [],
30
- },
31
- modelValue: {
32
- type: Array,
33
- default: () => [],
34
- },
35
- rules: {
36
- type: Array,
37
- default: () => []
38
- },
39
- required: {
40
- type: Boolean,
41
- default: false,
42
- },
43
- readonly: {
44
- type: Boolean,
45
- default: false,
46
- },
47
- auth: {
48
- type: String,
49
- default: ''
50
- },
51
- });
52
-
53
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
54
- const emit = defineEmits(["update:modelValue"]);
55
- const modelValue = useVModel(props, 'modelValue', emit)
56
-
57
- const data = reactive({
58
- isShowPop: false,
59
- options: []
60
- })
61
-
62
- // 将modelValue与选项列表合并
63
- const totalOptions = computed(() => {
64
- if (!modelValue.value || modelValue.value.length < 1)
65
- return data.options
66
-
67
- let res = [...data.options]
68
-
69
- for (var i = 0; i < modelValue.value.length; i++) {
70
- let ary = data.options.filter(item => item.code == modelValue.value[i])
71
- if (ary.length < 1)
72
- res = [{ code: modelValue.value[i], title: modelValue.value[i] }, ...res]
73
- }
74
- return res
75
- })
76
-
77
- const selectOptions = computed(() => {
78
- if (!modelValue.value || modelValue.value.length < 1)
79
- return []
80
-
81
- let res = totalOptions.value.filter(item => {
82
- return modelValue.value.includes(item.code)
83
- })
84
- return res
85
- })
86
-
87
- onMounted(() => {
88
- query()
89
- })
90
-
91
- const query = async () => {
92
- if(!props.id){
93
- data.options = props.options
94
- return
95
- }
96
-
97
- let params = {
98
- id: props.id,
99
- }
100
- const res = await util.dictionary_dict(params)
101
- if (!res.data.parseValue) {
102
- data.options = []
103
- return
104
- }
105
-
106
- data.options = res.data.parseValue
107
- }
108
-
109
- const onDelete = (idx) => {
110
- modelValue.value.splice(idx, 1)
111
- }
112
-
113
- watch(()=>props.modelValue,(o,n)=>{
114
- if(!props.modelValue)
115
- modelValue.value = []
116
- },{immediate:true})
117
- </script>
118
-
119
- <style scoped>
120
- .data-item{
121
- margin: 0 8px 8px 0;
122
- padding: 2px 5px;
123
- }
1
+ <template>
2
+ <van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="props.rules" :disabled="isDisabled"
3
+ :placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
4
+ label-class="label">
5
+ <template #input v-if="selectOptions.length>0">
6
+ <div class="data-list">
7
+ <van-tag class="data-item" :closeable="!isDisabled" type="primary" plain v-for="(item, i) in selectOptions"
8
+ :key="item" @close.stop="onDelete(i)">
9
+ {{ item.title }}
10
+ </van-tag>
11
+ </div>
12
+ </template>
13
+ </van-field>
14
+ <data-pop v-model="modelValue" :options="totalOptions" v-model:show="data.isShowPop" />
15
+ </template>
16
+
17
+ <script setup>
18
+ import { onMounted, ref, onBeforeUpdate, computed, nextTick, watch, reactive } from "vue"
19
+ import util from '../util'
20
+ import DataPop from "./widget/DataPop.vue";
21
+ import { useVModel } from "@vueuse/core";
22
+
23
+ const props = defineProps({
24
+ id: String,
25
+ label: String,
26
+ placeholder: String,
27
+ options: {
28
+ type: Array,
29
+ default: [],
30
+ },
31
+ modelValue: {
32
+ type: Array,
33
+ default: () => [],
34
+ },
35
+ rules: {
36
+ type: Array,
37
+ default: () => []
38
+ },
39
+ required: {
40
+ type: Boolean,
41
+ default: false,
42
+ },
43
+ readonly: {
44
+ type: Boolean,
45
+ default: false,
46
+ },
47
+ auth: {
48
+ type: String,
49
+ default: ''
50
+ },
51
+ });
52
+
53
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
54
+ const emit = defineEmits(["update:modelValue"]);
55
+ const modelValue = useVModel(props, 'modelValue', emit)
56
+
57
+ const data = reactive({
58
+ isShowPop: false,
59
+ options: []
60
+ })
61
+
62
+ // 将modelValue与选项列表合并
63
+ const totalOptions = computed(() => {
64
+ if (!modelValue.value || modelValue.value.length < 1)
65
+ return data.options
66
+
67
+ let res = [...data.options]
68
+
69
+ for (var i = 0; i < modelValue.value.length; i++) {
70
+ let ary = data.options.filter(item => item.code == modelValue.value[i])
71
+ if (ary.length < 1)
72
+ res = [{ code: modelValue.value[i], title: modelValue.value[i] }, ...res]
73
+ }
74
+ return res
75
+ })
76
+
77
+ const selectOptions = computed(() => {
78
+ if (!modelValue.value || modelValue.value.length < 1)
79
+ return []
80
+
81
+ let res = totalOptions.value.filter(item => {
82
+ return modelValue.value.includes(item.code)
83
+ })
84
+ return res
85
+ })
86
+
87
+ onMounted(() => {
88
+ query()
89
+ })
90
+
91
+ const query = async () => {
92
+ if(!props.id){
93
+ data.options = props.options
94
+ return
95
+ }
96
+
97
+ let params = {
98
+ id: props.id,
99
+ }
100
+ const res = await util.dictionary_dict(params)
101
+ if (!res.data.parseValue) {
102
+ data.options = []
103
+ return
104
+ }
105
+
106
+ data.options = res.data.parseValue
107
+ }
108
+
109
+ const onDelete = (idx) => {
110
+ modelValue.value.splice(idx, 1)
111
+ }
112
+
113
+ watch(()=>props.modelValue,(o,n)=>{
114
+ if(!props.modelValue)
115
+ modelValue.value = []
116
+ },{immediate:true})
117
+ </script>
118
+
119
+ <style scoped>
120
+ .data-item{
121
+ margin: 0 8px 8px 0;
122
+ padding: 2px 5px;
123
+ }
124
124
  </style>
@@ -1,6 +1,6 @@
1
- import { showNotify } from 'vant'
2
-
3
- //保密提醒
4
- export const secret_notify=()=>{
5
- showNotify({ type: 'danger', message: '严格执行信息保密要求,切实防范企业泄密风险',duration: 3000, })
1
+ import { showNotify } from 'vant'
2
+
3
+ //保密提醒
4
+ export const secret_notify=()=>{
5
+ showNotify({ type: 'danger', message: '严格执行信息保密要求,切实防范企业泄密风险',duration: 3000, })
6
6
  }