widget.qw 1.0.82 → 1.0.84
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.
- package/.env.development +10 -10
- package/.env.production +8 -8
- package/README.md +75 -75
- package/build/style.css +471 -471
- package/build/widget.qw.es.js +132 -65
- package/build/widget.qw.umd.js +132 -65
- package/index.html +17 -17
- package/package.json +47 -47
- package/src/App.vue +26 -26
- package/src/api/index.js +165 -165
- package/src/components/AuditBar.vue +396 -396
- package/src/components/BillCard.vue +164 -164
- package/src/components/CascaderPicker.vue +132 -132
- package/src/components/CascaderPop.vue +373 -371
- package/src/components/CheckGroup.vue +113 -113
- package/src/components/DatetimeDropdown.vue +62 -0
- package/src/components/{DatetimePicker/index.vue → DatetimePicker.vue} +124 -124
- package/src/components/DayDropdown.vue +56 -56
- package/src/components/FilePicker.vue +169 -169
- package/src/components/Input.vue +80 -80
- package/src/components/MonthDropdown.vue +51 -51
- package/src/components/MultiPicker.vue +123 -123
- package/src/components/ObjsEditor.vue +334 -334
- package/src/components/SecretNotify.js +5 -5
- package/src/components/Sheet.vue +92 -92
- package/src/components/SingleApiPicker.vue +108 -108
- package/src/components/SinglePicker.vue +102 -102
- package/src/components/SingleUserSelector.vue +425 -425
- package/src/components/Switch.vue +64 -64
- package/src/components/TreePicker.vue +113 -113
- package/src/components/UserPicker.vue +106 -106
- package/src/components/UserProfile.vue +129 -129
- package/src/components/UsersPicker.vue +118 -118
- package/src/components/YearDropdown.vue +59 -59
- package/src/components/data_selector.vue +303 -303
- package/src/components/image_picker.vue +123 -123
- package/src/components/images_picker.vue +195 -195
- package/src/components/index.js +167 -162
- package/src/components/mult_list_selector.vue +155 -155
- package/src/components/subdepartment_selector.vue +481 -481
- package/src/components/user_selector.vue +639 -639
- package/src/components/widget/DataPop.vue +95 -95
- package/src/components/{DatetimePicker → widget}/DatetimePop.vue +342 -342
- package/src/components/widget/TreePop.vue +88 -88
- package/src/components/widget/UserPop.vue +347 -347
- package/src/main.js +117 -117
- package/src/router/index.ts +178 -173
- package/src/util/array_util.js +32 -32
- package/src/util/auth_util.js +72 -72
- package/src/util/bool_util.js +5 -5
- package/src/util/bus.js +1 -1
- package/src/util/cache_util.js +18 -18
- package/src/util/errer_code.js +6 -6
- package/src/util/eval_util.js +19 -19
- package/src/util/icon_util.js +36 -36
- package/src/util/image_util.js +27 -27
- package/src/util/index.js +57 -57
- package/src/util/num_util.js +70 -70
- package/src/util/obj_util.js +28 -28
- package/src/util/request.js +73 -73
- package/src/util/request_json.js +71 -71
- package/src/util/request_json_mute.js +65 -65
- package/src/util/request_upload.js +79 -79
- package/src/util/route_util.js +31 -31
- package/src/util/str_util.js +143 -143
- package/src/util/time_util.js +406 -406
- package/src/util/toast_util.js +24 -24
- package/src/util/tree_util.js +153 -153
- package/src/util/uuid_util.js +9 -9
- package/src/util/validate.js +182 -182
- package/src/util/vue_filter.js +223 -223
- package/src/views/auditbar/index.vue +78 -78
- package/src/views/billcard/index.vue +48 -48
- package/src/views/cascaderpicker/index.vue +0 -0
- package/src/views/cascaderpop/index.vue +90 -90
- package/src/views/checkgroup/index.vue +35 -35
- package/src/views/dataSelector/index.vue +48 -48
- package/src/views/datetimedropdown/index.vue +34 -0
- package/src/views/datetimepicker/index.vue +34 -34
- package/src/views/daydropdown/index.vue +31 -31
- package/src/views/filepicker/index.vue +32 -32
- package/src/views/home/index.vue +0 -0
- package/src/views/imagepicker/index.vue +31 -31
- package/src/views/imagespicker/index.vue +37 -37
- package/src/views/input/index.vue +35 -35
- package/src/views/monthdropdown/index.vue +31 -31
- package/src/views/multListSelector/index.vue +61 -61
- package/src/views/multipicker/index.vue +36 -36
- package/src/views/objseditor/index.vue +277 -277
- package/src/views/productSelector/index.vue +35 -35
- package/src/views/projectpicker/index.vue +41 -41
- package/src/views/secretnotify/index.vue +27 -27
- package/src/views/sheet/index.vue +45 -45
- package/src/views/singlepicker/index.vue +35 -35
- package/src/views/subdepartmentSelector/index.vue +40 -40
- package/src/views/switch/index.vue +34 -34
- package/src/views/treepicker/index.vue +41 -41
- package/src/views/userSelector/index.vue +54 -54
- package/src/views/userSelectorNew/index.vue +45 -45
- package/src/views/userpicker/index.vue +43 -43
- package/src/views/userprofile/index.vue +30 -30
- package/src/views/userspicker/index.vue +43 -43
- package/src/views/yeardropdown/index.vue +32 -32
- package/src/vm/index.js +1 -1
- package/vite.config.ts +122 -122
|
@@ -1,129 +1,129 @@
|
|
|
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
|
-
|
|
22
|
-
const props = defineProps({
|
|
23
|
-
avatar:{
|
|
24
|
-
type:String,
|
|
25
|
-
default:''
|
|
26
|
-
},
|
|
27
|
-
name:{
|
|
28
|
-
type:String,
|
|
29
|
-
default:''
|
|
30
|
-
},
|
|
31
|
-
position:{
|
|
32
|
-
type:String,
|
|
33
|
-
default:''
|
|
34
|
-
},
|
|
35
|
-
mobile:{
|
|
36
|
-
type:String,
|
|
37
|
-
default:''
|
|
38
|
-
},
|
|
39
|
-
departments:{
|
|
40
|
-
type:Array,
|
|
41
|
-
default:[]
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const emit = defineEmits(['logout'])
|
|
46
|
-
|
|
47
|
-
const onLogout = () => {
|
|
48
|
-
emit('logout')
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
onMounted(() => {
|
|
52
|
-
|
|
53
|
-
})
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<style scoped>
|
|
57
|
-
.widget {
|
|
58
|
-
position: relative;
|
|
59
|
-
display: flex;
|
|
60
|
-
flex-direction: column;
|
|
61
|
-
align-items: center;
|
|
62
|
-
justify-content: space-around;
|
|
63
|
-
padding: 20px;
|
|
64
|
-
background: linear-gradient(to right, #4a90e2, #87ceeb);
|
|
65
|
-
border-radius: 10px;
|
|
66
|
-
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
|
67
|
-
|
|
68
|
-
.user-avatar {
|
|
69
|
-
margin-bottom: 15px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.user-info {
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: space-around;
|
|
76
|
-
margin-bottom: 15px;
|
|
77
|
-
|
|
78
|
-
.user-info-item {
|
|
79
|
-
font-size: 16px;
|
|
80
|
-
line-height: 22px;
|
|
81
|
-
color: #fff;
|
|
82
|
-
text-align: center;
|
|
83
|
-
padding: 0 3px;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.space {
|
|
88
|
-
min-height: 10px;
|
|
89
|
-
flex: 1;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* 添加退出按钮样式 */
|
|
93
|
-
.logout-button {
|
|
94
|
-
width: 70px;
|
|
95
|
-
height: 30px;
|
|
96
|
-
position: absolute;
|
|
97
|
-
top: 20px;
|
|
98
|
-
right: 20px;
|
|
99
|
-
background-color: rgba(255, 255, 255, 0.2);
|
|
100
|
-
color: white;
|
|
101
|
-
border: none;
|
|
102
|
-
border-radius: 15px;
|
|
103
|
-
padding: 5px 15px;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
font-size: 14px;
|
|
106
|
-
transition: background-color 0.3s;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.logout-button:hover {
|
|
110
|
-
background-color: rgba(255, 255, 255, 0.4);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.user-jobs {
|
|
114
|
-
display: flex;
|
|
115
|
-
justify-content: center;
|
|
116
|
-
gap: 15px;
|
|
117
|
-
width: 100%;
|
|
118
|
-
max-width: 300px;
|
|
119
|
-
|
|
120
|
-
.job-item {
|
|
121
|
-
padding: 5px 10px;
|
|
122
|
-
background-color: rgba(255, 255, 255, 0.2);
|
|
123
|
-
border-radius: 20px;
|
|
124
|
-
font-size: 12px;
|
|
125
|
-
color: #fff;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
</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
|
+
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
avatar:{
|
|
24
|
+
type:String,
|
|
25
|
+
default:''
|
|
26
|
+
},
|
|
27
|
+
name:{
|
|
28
|
+
type:String,
|
|
29
|
+
default:''
|
|
30
|
+
},
|
|
31
|
+
position:{
|
|
32
|
+
type:String,
|
|
33
|
+
default:''
|
|
34
|
+
},
|
|
35
|
+
mobile:{
|
|
36
|
+
type:String,
|
|
37
|
+
default:''
|
|
38
|
+
},
|
|
39
|
+
departments:{
|
|
40
|
+
type:Array,
|
|
41
|
+
default:[]
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
const emit = defineEmits(['logout'])
|
|
46
|
+
|
|
47
|
+
const onLogout = () => {
|
|
48
|
+
emit('logout')
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onMounted(() => {
|
|
52
|
+
|
|
53
|
+
})
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
.widget {
|
|
58
|
+
position: relative;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: space-around;
|
|
63
|
+
padding: 20px;
|
|
64
|
+
background: linear-gradient(to right, #4a90e2, #87ceeb);
|
|
65
|
+
border-radius: 10px;
|
|
66
|
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
|
67
|
+
|
|
68
|
+
.user-avatar {
|
|
69
|
+
margin-bottom: 15px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.user-info {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: space-around;
|
|
76
|
+
margin-bottom: 15px;
|
|
77
|
+
|
|
78
|
+
.user-info-item {
|
|
79
|
+
font-size: 16px;
|
|
80
|
+
line-height: 22px;
|
|
81
|
+
color: #fff;
|
|
82
|
+
text-align: center;
|
|
83
|
+
padding: 0 3px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.space {
|
|
88
|
+
min-height: 10px;
|
|
89
|
+
flex: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* 添加退出按钮样式 */
|
|
93
|
+
.logout-button {
|
|
94
|
+
width: 70px;
|
|
95
|
+
height: 30px;
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 20px;
|
|
98
|
+
right: 20px;
|
|
99
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
100
|
+
color: white;
|
|
101
|
+
border: none;
|
|
102
|
+
border-radius: 15px;
|
|
103
|
+
padding: 5px 15px;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
font-size: 14px;
|
|
106
|
+
transition: background-color 0.3s;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.logout-button:hover {
|
|
110
|
+
background-color: rgba(255, 255, 255, 0.4);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.user-jobs {
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
gap: 15px;
|
|
117
|
+
width: 100%;
|
|
118
|
+
max-width: 300px;
|
|
119
|
+
|
|
120
|
+
.job-item {
|
|
121
|
+
padding: 5px 10px;
|
|
122
|
+
background-color: rgba(255, 255, 255, 0.2);
|
|
123
|
+
border-radius: 20px;
|
|
124
|
+
font-size: 12px;
|
|
125
|
+
color: #fff;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
</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>
|