widget.qw 1.0.21 → 1.0.24

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 (100) 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 +482 -468
  5. package/build/widget.qw.es.js +2429 -1714
  6. package/build/widget.qw.umd.js +2347 -1632
  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 +141 -141
  11. package/src/components/AuditBar.vue +340 -340
  12. package/src/components/BillCard.vue +155 -155
  13. package/src/components/CascaderPicker.vue +87 -110
  14. package/src/components/CascaderPop.vue +330 -339
  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 -128
  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/cascaderpop/index.vue +90 -90
  73. package/src/views/checkgroup/index.vue +35 -35
  74. package/src/views/dataSelector/index.vue +48 -48
  75. package/src/views/datetimepicker/index.vue +34 -34
  76. package/src/views/daydropdown/index.vue +31 -31
  77. package/src/views/filepicker/index.vue +31 -31
  78. package/src/views/imagepicker/index.vue +31 -31
  79. package/src/views/imagespicker/index.vue +31 -31
  80. package/src/views/input/index.vue +34 -34
  81. package/src/views/monthdropdown/index.vue +31 -31
  82. package/src/views/multListSelector/index.vue +61 -61
  83. package/src/views/multipicker/index.vue +36 -36
  84. package/src/views/productSelector/index.vue +35 -35
  85. package/src/views/projectdropdown/index.vue +31 -31
  86. package/src/views/projectpicker/index.vue +41 -41
  87. package/src/views/secretnotify/index.vue +27 -27
  88. package/src/views/sheet/index.vue +45 -45
  89. package/src/views/singlepicker/index.vue +35 -35
  90. package/src/views/subdepartmentSelector/index.vue +40 -40
  91. package/src/views/switch/index.vue +34 -34
  92. package/src/views/treepicker/index.vue +41 -41
  93. package/src/views/userSelector/index.vue +54 -54
  94. package/src/views/userSelectorNew/index.vue +45 -45
  95. package/src/views/userpicker/index.vue +43 -43
  96. package/src/views/userprofile/index.vue +30 -30
  97. package/src/views/userspicker/index.vue +43 -43
  98. package/src/views/yeardropdown/index.vue +32 -32
  99. package/src/vm/index.js +1 -1
  100. package/vite.config.ts +122 -122
@@ -1,128 +1,131 @@
1
- <template>
2
- <div class="widget">
3
- <van-image round width="80px" height="80px" :src="data.userInfo?.wxUser?.avatar" class="user-avatar" />
4
- <div class="user-info">
5
- <span class="user-info-item">{{ data.userInfo?.wxUser?.userid }}</span>
6
- <span class="user-info-item">{{ data.userInfo?.wxUser?.name }}</span>
7
- <span class="user-info-item">{{ data.userInfo?.wxUser?.position }}</span>
8
- <span class="user-info-item">{{ data.userInfo?.wxUser?.mobile }}</span>
9
- </div>
10
- <div class="user-jobs">
11
- <span class="job-item" v-for="(item, i) in deptPaths" :key="i">{{ item.name }}</span>
12
- </div>
13
-
14
- <van-button block class="logout-button" @click="onLogout">
15
- 注销
16
- </van-button>
17
- </div>
18
- </template>
19
-
20
- <script setup>
21
- import { reactive, onMounted, watch, defineEmits, computed } from "vue";
22
- import util from "../util"
23
-
24
- const data = reactive({
25
- userInfo: {}
26
- })
27
- const emit = defineEmits(['logout'])
28
-
29
- const deptPaths = computed(() => {
30
- //过滤掉公司
31
- if (data.userInfo && data.userInfo.departments && data.userInfo.departments.length>1)
32
- return data.userInfo.departments.filter(item => item.id != '1')
33
-
34
- // 外部访客,返回公司名
35
- if(data.userInfo && data.userInfo.wxUser)
36
- return [{name: data.userInfo.wxUser.corp}]
37
-
38
- return []
39
- })
40
-
41
- const onLogout = () => {
42
- emit('logout')
43
- }
44
-
45
- const getUserInfo = async () => {
46
- let res = await util.auth_get_user_info()
47
- data.userInfo = res.data
48
- }
49
-
50
- onMounted(() => {
51
- getUserInfo()
52
- })
53
- </script>
54
-
55
- <style scoped>
56
- .widget {
57
- position: relative;
58
- display: flex;
59
- flex-direction: column;
60
- align-items: center;
61
- justify-content: space-around;
62
- padding: 20px;
63
- background: linear-gradient(to right, #4a90e2, #87ceeb);
64
- border-radius: 10px;
65
- box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
66
-
67
- .user-avatar {
68
- margin-bottom: 15px;
69
- }
70
-
71
- .user-info {
72
- display: flex;
73
- align-items: center;
74
- justify-content: space-around;
75
- margin-bottom: 15px;
76
-
77
- .user-info-item {
78
- font-size: 16px;
79
- line-height: 22px;
80
- color: #fff;
81
- text-align: center;
82
- padding: 0 3px;
83
- }
84
- }
85
-
86
- .space {
87
- min-height: 10px;
88
- flex: 1;
89
- }
90
-
91
- /* 添加退出按钮样式 */
92
- .logout-button {
93
- width: 70px;
94
- height: 30px;
95
- position: absolute;
96
- top: 20px;
97
- right: 20px;
98
- background-color: rgba(255, 255, 255, 0.2);
99
- color: white;
100
- border: none;
101
- border-radius: 15px;
102
- padding: 5px 15px;
103
- cursor: pointer;
104
- font-size: 14px;
105
- transition: background-color 0.3s;
106
- }
107
-
108
- .logout-button:hover {
109
- background-color: rgba(255, 255, 255, 0.4);
110
- }
111
-
112
- .user-jobs {
113
- display: flex;
114
- justify-content: center;
115
- gap: 15px;
116
- width: 100%;
117
- max-width: 300px;
118
-
119
- .job-item {
120
- padding: 5px 10px;
121
- background-color: rgba(255, 255, 255, 0.2);
122
- border-radius: 20px;
123
- font-size: 12px;
124
- color: #fff;
125
- }
126
- }
127
- }
128
- </style>
1
+ <template>
2
+ <div class="widget">
3
+ <van-image round width="80px" height="80px" :src="props.avatar" class="user-avatar" />
4
+ <div class="user-info">
5
+ <span class="user-info-item">{{ props.name }}</span>
6
+ <span class="user-info-item">{{ props.position }}</span>
7
+ <span class="user-info-item">{{ props.mobile }}</span>
8
+ </div>
9
+ <div class="user-jobs">
10
+ <span class="job-item" v-for="(item, i) in departments" :key="i">{{ item }}</span>
11
+ </div>
12
+
13
+ <van-button block class="logout-button" @click="onLogout">
14
+ 注销
15
+ </van-button>
16
+ </div>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { reactive, onMounted, watch, defineEmits, computed } from "vue";
21
+ import util from "../util"
22
+ import { type } from "os";
23
+
24
+ const props = defineProps({
25
+ avatar:{
26
+ type:String,
27
+ default:''
28
+ },
29
+ name:{
30
+ type:String,
31
+ default:''
32
+ },
33
+ position:{
34
+ type:String,
35
+ default:''
36
+ },
37
+ mobile:{
38
+ type:String,
39
+ default:''
40
+ },
41
+ departments:{
42
+ type:Array,
43
+ default:[]
44
+ }
45
+ })
46
+
47
+ const emit = defineEmits(['logout'])
48
+
49
+ const onLogout = () => {
50
+ emit('logout')
51
+ }
52
+
53
+ onMounted(() => {
54
+
55
+ })
56
+ </script>
57
+
58
+ <style scoped>
59
+ .widget {
60
+ position: relative;
61
+ display: flex;
62
+ flex-direction: column;
63
+ align-items: center;
64
+ justify-content: space-around;
65
+ padding: 20px;
66
+ background: linear-gradient(to right, #4a90e2, #87ceeb);
67
+ border-radius: 10px;
68
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
69
+
70
+ .user-avatar {
71
+ margin-bottom: 15px;
72
+ }
73
+
74
+ .user-info {
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: space-around;
78
+ margin-bottom: 15px;
79
+
80
+ .user-info-item {
81
+ font-size: 16px;
82
+ line-height: 22px;
83
+ color: #fff;
84
+ text-align: center;
85
+ padding: 0 3px;
86
+ }
87
+ }
88
+
89
+ .space {
90
+ min-height: 10px;
91
+ flex: 1;
92
+ }
93
+
94
+ /* 添加退出按钮样式 */
95
+ .logout-button {
96
+ width: 70px;
97
+ height: 30px;
98
+ position: absolute;
99
+ top: 20px;
100
+ right: 20px;
101
+ background-color: rgba(255, 255, 255, 0.2);
102
+ color: white;
103
+ border: none;
104
+ border-radius: 15px;
105
+ padding: 5px 15px;
106
+ cursor: pointer;
107
+ font-size: 14px;
108
+ transition: background-color 0.3s;
109
+ }
110
+
111
+ .logout-button:hover {
112
+ background-color: rgba(255, 255, 255, 0.4);
113
+ }
114
+
115
+ .user-jobs {
116
+ display: flex;
117
+ justify-content: center;
118
+ gap: 15px;
119
+ width: 100%;
120
+ max-width: 300px;
121
+
122
+ .job-item {
123
+ padding: 5px 10px;
124
+ background-color: rgba(255, 255, 255, 0.2);
125
+ border-radius: 20px;
126
+ font-size: 12px;
127
+ color: #fff;
128
+ }
129
+ }
130
+ }
131
+ </style>
@@ -1,118 +1,118 @@
1
- <template>
2
- <van-field v-if="!isGone"
3
- :label="props.label" :required="isRequired" :rules="props.rules" :disabled="isDisabled"
4
- :placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
5
- label-class="label">
6
- <template #input>
7
- <div class="user-list">
8
- <van-tag class="user-item" :closeable="!isDisabled" type="primary" plain v-for="(item, i) in data.users"
9
- :key="item" @close.stop="onDelete(item)">
10
- {{ item.name }}
11
- </van-tag>
12
- </div>
13
- </template>
14
- </van-field>
15
-
16
- <UserPop v-model:show="data.isShowPop"
17
- :rootDeptId="props.rootDeptId"
18
- :deptRangeId="props.deptRangeId"
19
- @select="onSelectUser" />
20
-
21
- </template>
22
- <script setup>
23
- import { reactive, onMounted, watch } from "vue";
24
- import util from "../util"
25
- import { useVModel } from '@vueuse/core'
26
- import UserPop from './widget/UserPop.vue'
27
-
28
- const props = defineProps({
29
- modelValue: {
30
- type: Array,
31
- default: [],
32
- },
33
- label: {
34
- type: String,
35
- default: "选择人员",
36
- },
37
- placeholder: {
38
- type: String,
39
- default: "请选择人员",
40
- },
41
- required: {
42
- type: Boolean,
43
- default: false,
44
- },
45
- readonly: {
46
- type: Boolean,
47
- default: false,
48
- },
49
- rules: {
50
- type: Array,
51
- default: () => [],
52
- },
53
- // 默认查询所有组织机构
54
- rootDeptId: {
55
- type: String,
56
- default: "1", //组织机构id
57
- },
58
- // 二级部门取值范围字典id
59
- // 取dictionary库.dict的配置id
60
- deptRangeId: {
61
- type: String,
62
- default: ''
63
- },
64
- auth: {
65
- type: String,
66
- default: "",
67
- },
68
- });
69
-
70
- // 弹出层
71
- const data = reactive({
72
- isShowPop: false,
73
- users: []
74
- })
75
-
76
- // 定义emit
77
- const emit = defineEmits(["update:modelValue", "select"]);
78
- const modelValue = useVModel(props, 'modelValue', emit)
79
- const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
80
-
81
- //首页加载
82
- onMounted(() => {
83
- })
84
-
85
- const onSelectUser = (userId) => {
86
- let newAry = [...(modelValue.value || []), userId]
87
- modelValue.value = util.uniq(newAry)
88
- }
89
-
90
- const onDelete=(user)=>{
91
- modelValue.value = (modelValue.value || []).filter(item=>{
92
- return item != user.userid
93
- })
94
- }
95
-
96
- watch(() => modelValue.value, async(n, o) => {
97
- if(!modelValue.value || modelValue.value.length<1){
98
- data.users = []
99
- return
100
- }
101
-
102
- let ary = []
103
- for(var i=0;i<modelValue.value.length;i++){
104
- let res = await util.get_wxuser_by_id({userId:modelValue.value[i]})
105
- ary.push(res.data)
106
- }
107
- data.users = ary
108
- emit('select', data.users)
109
- }, {
110
- immediate: true
111
- })
112
- </script>
113
-
114
- <style scoped>
115
- .user-item{
116
- margin:3px;
117
- }
118
- </style>
1
+ <template>
2
+ <van-field v-if="!isGone"
3
+ :label="props.label" :required="isRequired" :rules="props.rules" :disabled="isDisabled"
4
+ :placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
5
+ label-class="label">
6
+ <template #input>
7
+ <div class="user-list">
8
+ <van-tag class="user-item" :closeable="!isDisabled" type="primary" plain v-for="(item, i) in data.users"
9
+ :key="item" @close.stop="onDelete(item)">
10
+ {{ item.name }}
11
+ </van-tag>
12
+ </div>
13
+ </template>
14
+ </van-field>
15
+
16
+ <UserPop v-model:show="data.isShowPop"
17
+ :rootDeptId="props.rootDeptId"
18
+ :deptRangeId="props.deptRangeId"
19
+ @select="onSelectUser" />
20
+
21
+ </template>
22
+ <script setup>
23
+ import { reactive, onMounted, watch } from "vue";
24
+ import util from "../util"
25
+ import { useVModel } from '@vueuse/core'
26
+ import UserPop from './widget/UserPop.vue'
27
+
28
+ const props = defineProps({
29
+ modelValue: {
30
+ type: Array,
31
+ default: [],
32
+ },
33
+ label: {
34
+ type: String,
35
+ default: "选择人员",
36
+ },
37
+ placeholder: {
38
+ type: String,
39
+ default: "请选择人员",
40
+ },
41
+ required: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ readonly: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ rules: {
50
+ type: Array,
51
+ default: () => [],
52
+ },
53
+ // 默认查询所有组织机构
54
+ rootDeptId: {
55
+ type: String,
56
+ default: "1", //组织机构id
57
+ },
58
+ // 二级部门取值范围字典id
59
+ // 取dictionary库.dict的配置id
60
+ deptRangeId: {
61
+ type: String,
62
+ default: ''
63
+ },
64
+ auth: {
65
+ type: String,
66
+ default: "",
67
+ },
68
+ });
69
+
70
+ // 弹出层
71
+ const data = reactive({
72
+ isShowPop: false,
73
+ users: []
74
+ })
75
+
76
+ // 定义emit
77
+ const emit = defineEmits(["update:modelValue", "select"]);
78
+ const modelValue = useVModel(props, 'modelValue', emit)
79
+ const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
80
+
81
+ //首页加载
82
+ onMounted(() => {
83
+ })
84
+
85
+ const onSelectUser = (userId) => {
86
+ let newAry = [...(modelValue.value || []), userId]
87
+ modelValue.value = util.uniq(newAry)
88
+ }
89
+
90
+ const onDelete=(user)=>{
91
+ modelValue.value = (modelValue.value || []).filter(item=>{
92
+ return item != user.userid
93
+ })
94
+ }
95
+
96
+ watch(() => modelValue.value, async(n, o) => {
97
+ if(!modelValue.value || modelValue.value.length<1){
98
+ data.users = []
99
+ return
100
+ }
101
+
102
+ let ary = []
103
+ for(var i=0;i<modelValue.value.length;i++){
104
+ let res = await util.get_wxuser_by_id({userId:modelValue.value[i]})
105
+ ary.push(res.data)
106
+ }
107
+ data.users = ary
108
+ emit('select', data.users)
109
+ }, {
110
+ immediate: true
111
+ })
112
+ </script>
113
+
114
+ <style scoped>
115
+ .user-item{
116
+ margin:3px;
117
+ }
118
+ </style>
@@ -1,60 +1,60 @@
1
- <template>
2
- <van-dropdown-item v-model="modelValue" :options="data.yearOptions" />
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
- startYear: {
15
- type: Number,
16
- default: 2000,
17
- },
18
- endYear: {
19
- type: Number,
20
- default: new Date().getFullYear(),
21
- },
22
- label: {
23
- type: String,
24
- default: "选择年份",
25
- },
26
- placeholder: {
27
- type: String,
28
- default: "请选择年份",
29
- },
30
- });
31
-
32
- // 弹出层
33
- const data = reactive({
34
- yearOptions: []
35
- })
36
-
37
- // 定义emit
38
- const emit = defineEmits(["update:modelValue"]);
39
- const modelValue = useVModel(props, 'modelValue', emit)
40
-
41
- const setupYearOptions = () => {
42
- data.yearOptions.push({
43
- text: '年',
44
- value: 0
45
- })
46
- for (var i = props.endYear; i >= props.startYear; i--) {
47
- data.yearOptions.push({
48
- text: i,
49
- value: i,
50
- });
51
- }
52
- };
53
-
54
- //首页加载
55
- onMounted(() => {
56
- setupYearOptions()
57
- })
58
- </script>
59
-
1
+ <template>
2
+ <van-dropdown-item v-model="modelValue" :options="data.yearOptions" />
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
+ startYear: {
15
+ type: Number,
16
+ default: 2000,
17
+ },
18
+ endYear: {
19
+ type: Number,
20
+ default: new Date().getFullYear(),
21
+ },
22
+ label: {
23
+ type: String,
24
+ default: "选择年份",
25
+ },
26
+ placeholder: {
27
+ type: String,
28
+ default: "请选择年份",
29
+ },
30
+ });
31
+
32
+ // 弹出层
33
+ const data = reactive({
34
+ yearOptions: []
35
+ })
36
+
37
+ // 定义emit
38
+ const emit = defineEmits(["update:modelValue"]);
39
+ const modelValue = useVModel(props, 'modelValue', emit)
40
+
41
+ const setupYearOptions = () => {
42
+ data.yearOptions.push({
43
+ text: '年',
44
+ value: 0
45
+ })
46
+ for (var i = props.endYear; i >= props.startYear; i--) {
47
+ data.yearOptions.push({
48
+ text: i,
49
+ value: i,
50
+ });
51
+ }
52
+ };
53
+
54
+ //首页加载
55
+ onMounted(() => {
56
+ setupYearOptions()
57
+ })
58
+ </script>
59
+
60
60
  <style scoped></style>