widget.qw 1.0.89 → 1.0.91
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/build/style.css +93 -93
- package/build/widget.qw.es.js +105 -79
- package/build/widget.qw.umd.js +105 -79
- package/package.json +1 -1
- package/src/components/CascaderPicker.vue +2 -2
- package/src/components/CheckGroup.vue +2 -2
- package/src/components/DatetimePicker.vue +2 -2
- package/src/components/FilePicker.vue +2 -2
- package/src/components/Input.vue +7 -4
- package/src/components/MultiPicker.vue +2 -2
- package/src/components/ObjsEditor.vue +2 -2
- package/src/components/Sheet.vue +2 -2
- package/src/components/SingleApiPicker.vue +7 -2
- package/src/components/SinglePicker.vue +1 -1
- package/src/components/SingleUserSelector.vue +2 -2
- package/src/components/Switch.vue +1 -1
- package/src/components/TreePicker.vue +2 -2
- package/src/components/UserPicker.vue +2 -2
- package/src/components/UsersPicker.vue +2 -2
- package/src/components/data_selector.vue +2 -2
- package/src/components/image_picker.vue +2 -2
- package/src/components/images_picker.vue +6 -2
- package/src/components/subdepartment_selector.vue +1 -1
- package/src/components/user_selector.vue +2 -2
- package/src/components/widget/UserPop.vue +1 -1
- package/src/util/auth_util.js +23 -15
- package/src/views/dataSelector/index.vue +17 -5
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field v-if="!isGone" :label="props.label" readonly :required="isRequired" :rules="
|
|
2
|
+
<van-field v-if="!isGone" :label="props.label" readonly :required="isRequired" :rules="rules"
|
|
3
3
|
:disabled="isDisabled" :placeholder="props.placeholder" :is-link="isReadonly ? false : true"
|
|
4
4
|
@click="data.isShowPop = !isReadonly" label-class="label">
|
|
5
5
|
<template #input v-if="modelValue">
|
|
@@ -79,7 +79,7 @@ const data = reactive({
|
|
|
79
79
|
// 定义emit
|
|
80
80
|
const emit = defineEmits(["update:modelValue", "select"]);
|
|
81
81
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
82
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
|
|
82
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props);
|
|
83
83
|
|
|
84
84
|
//首页加载
|
|
85
85
|
onMounted(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="
|
|
2
|
+
<van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="rules">
|
|
3
3
|
<template #input>
|
|
4
4
|
<van-checkbox-group v-model="modelValue" direction="vertical" :disabled="isDisabled">
|
|
5
5
|
<van-checkbox style="padding:5px 0;" v-for="(option, i) in totalOptions" :key="i" :name="option.code"
|
|
@@ -46,7 +46,7 @@ const props = defineProps({
|
|
|
46
46
|
})
|
|
47
47
|
const emit = defineEmits(['update:modelValue'])
|
|
48
48
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
49
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
49
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
50
50
|
const options = ref([])
|
|
51
51
|
// 将初始化数据与配置项合并
|
|
52
52
|
const totalOptions = computed(() => {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
:readonly="isReadonly"
|
|
5
5
|
readonly
|
|
6
6
|
clearable
|
|
7
|
-
:placeholder="props.placeholder" :required="isRequired" :rules="
|
|
7
|
+
:placeholder="props.placeholder" :required="isRequired" :rules="rules"
|
|
8
8
|
:right-icon="rightIcon"
|
|
9
9
|
@click-right-icon="onToggleShow">
|
|
10
10
|
</van-field>
|
|
@@ -69,7 +69,7 @@ const props = defineProps({
|
|
|
69
69
|
const data = reactive({
|
|
70
70
|
isShow: false, //是否显示弹出层
|
|
71
71
|
})
|
|
72
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
72
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
73
73
|
//定义要向父组件传递的事件
|
|
74
74
|
const emit = defineEmits(["update:modelValue"])
|
|
75
75
|
const modelValue = useVModel(props, "modelValue", emit)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="
|
|
2
|
+
<van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="rules"
|
|
3
3
|
label-class="label" :placeholder="props.placeholder">
|
|
4
4
|
<template #input>
|
|
5
5
|
<div class="file-box">
|
|
@@ -61,7 +61,7 @@ const props = defineProps({
|
|
|
61
61
|
|
|
62
62
|
const emit = defineEmits(['update:modelValue'])
|
|
63
63
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
64
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
64
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
65
65
|
|
|
66
66
|
const files = ref([])
|
|
67
67
|
const maxCount = computed(() => {
|
package/src/components/Input.vue
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field
|
|
2
|
+
<van-field
|
|
3
|
+
:label="props.label"
|
|
4
|
+
v-model.number="modelValue"
|
|
5
|
+
v-if="!isGone && props.type === 'number'"
|
|
3
6
|
:disabled="isDisabled" :required="isRequired" :placeholder="props.placeholder" :type="props.type"
|
|
4
|
-
:rows="props.rows" :autosize="props.autosize" :rules="
|
|
7
|
+
:rows="props.rows" :autosize="props.autosize" :rules="rules" />
|
|
5
8
|
<van-field :label="props.label" v-model="modelValue" v-if="!isGone && props.type != 'number'" :disabled="isDisabled"
|
|
6
9
|
:required="isRequired" :placeholder="props.placeholder" :type="props.type" :rows="props.rows"
|
|
7
|
-
:autosize="props.autosize" :rules="
|
|
10
|
+
:autosize="props.autosize" :rules="rules" />
|
|
8
11
|
</template>
|
|
9
12
|
|
|
10
13
|
<script setup>
|
|
@@ -61,7 +64,7 @@ const props = defineProps({
|
|
|
61
64
|
})
|
|
62
65
|
const emit = defineEmits(['update:modelValue'])
|
|
63
66
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
64
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
67
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
65
68
|
|
|
66
69
|
onMounted(() => {
|
|
67
70
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="
|
|
2
|
+
<van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="rules" :disabled="isDisabled"
|
|
3
3
|
:placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
|
|
4
4
|
label-class="label">
|
|
5
5
|
<template #input v-if="selectOptions.length>0">
|
|
@@ -50,7 +50,7 @@ const props = defineProps({
|
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
53
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
54
54
|
const emit = defineEmits(["update:modelValue"]);
|
|
55
55
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
56
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<van-field :label="props.label" v-if="!isGone" :disabled="isDisabled" :required="isRequired"
|
|
3
|
-
:placeholder="props.placeholder">
|
|
3
|
+
:placeholder="props.placeholder" :rules="rules">
|
|
4
4
|
<template #input>
|
|
5
5
|
<div class="widget-box">
|
|
6
6
|
<div class="option" v-for="(item, index) in modelValue" :key="index">
|
|
@@ -130,7 +130,7 @@ const props = defineProps({
|
|
|
130
130
|
|
|
131
131
|
const emit = defineEmits(['update:modelValue'])
|
|
132
132
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
133
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
133
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
134
134
|
|
|
135
135
|
const data = reactive({
|
|
136
136
|
inputValue: {},
|
package/src/components/Sheet.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field :label="props.label" v-if="!isGone" :disabled="isDisabled" :required="isRequired"
|
|
2
|
+
<van-field :label="props.label" v-if="!isGone" :disabled="isDisabled" :required="isRequired" :rules="rules"
|
|
3
3
|
:placeholder="props.placeholder">
|
|
4
4
|
|
|
5
5
|
<template #input>
|
|
@@ -51,7 +51,7 @@ const props = defineProps({
|
|
|
51
51
|
})
|
|
52
52
|
const emit = defineEmits(['update:modelValue'])
|
|
53
53
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
54
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
54
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
55
55
|
|
|
56
56
|
onMounted(() => {
|
|
57
57
|
})
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="widget">
|
|
3
|
-
<van-field v-if="!isGone" v-model="formatLabel"
|
|
3
|
+
<van-field v-if="!isGone" v-model="formatLabel"
|
|
4
|
+
:is-link="!isReadonly && !isDisabled"
|
|
5
|
+
:label="props.label"
|
|
6
|
+
:placeholder="props.placeholder"
|
|
7
|
+
:rules="rules"
|
|
8
|
+
readonly
|
|
4
9
|
:required="isRequired" :disabled="isDisabled" @click="onShow" />
|
|
5
10
|
<van-popup v-model:show="data.isShow" destroy-on-close round position="bottom">
|
|
6
11
|
<van-picker :columns="props.options" @cancel="onCancel" @confirm="onConfirm" />
|
|
@@ -42,7 +47,7 @@ const props = defineProps({
|
|
|
42
47
|
|
|
43
48
|
const emit = defineEmits(['update:modelValue', 'select'])
|
|
44
49
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
45
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
|
|
50
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props);
|
|
46
51
|
const data = reactive({
|
|
47
52
|
isShow: false
|
|
48
53
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<van-field v-if="!isGone" v-model="modelValue" :is-link="!isDisabled" :disabled="isDisabled" readonly name="picker"
|
|
3
3
|
:label="label" label-class="label" :placeholder="props.placeholder" @click-input="onClick" :required="isRequired"
|
|
4
|
-
:rules="
|
|
4
|
+
:rules="rules" />
|
|
5
5
|
<van-popup v-model:show="isShowPicker" position="bottom">
|
|
6
6
|
<van-picker :columns="totalOptions" @confirm="onConfirm" @cancel="isShowPicker = false" />
|
|
7
7
|
</van-popup>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<van-field v-if="!isGone" :is-link="isReadonly ? false : true" readonly :label="props.label"
|
|
3
3
|
:placeholder="props.placeholder" @click="show = !isReadonly" :model-value="selectedUserInfo" :required="isRequired"
|
|
4
|
-
:rules="
|
|
4
|
+
:rules="rules" input-align="center" />
|
|
5
5
|
<van-popup v-model:show="show" round position="bottom" class="user-popup">
|
|
6
6
|
<div class="department-selector">
|
|
7
7
|
<div class="picker-header">
|
|
@@ -100,7 +100,7 @@ const props = defineProps({
|
|
|
100
100
|
// 定义emit
|
|
101
101
|
const emit = defineEmits(["update:modelValue", "select"]);
|
|
102
102
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
103
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
|
|
103
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props);
|
|
104
104
|
|
|
105
105
|
// 部门列表
|
|
106
106
|
let departments = ref([]);
|
|
@@ -40,7 +40,7 @@ const props = defineProps({
|
|
|
40
40
|
})
|
|
41
41
|
const emit = defineEmits(['update:modelValue'])
|
|
42
42
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
43
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
43
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
44
44
|
|
|
45
45
|
onMounted(() => {
|
|
46
46
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<van-field v-if="!isGone"
|
|
3
|
-
:label="props.label" :required="isRequired" :rules="
|
|
3
|
+
:label="props.label" :required="isRequired" :rules="rules" :disabled="isDisabled"
|
|
4
4
|
:placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
|
|
5
5
|
label-class="label">
|
|
6
6
|
<template #input>
|
|
@@ -72,7 +72,7 @@ const selectOptions = computed(()=>{
|
|
|
72
72
|
// 定义emit
|
|
73
73
|
const emit = defineEmits(["update:modelValue","select"]);
|
|
74
74
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
75
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
|
|
75
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props);
|
|
76
76
|
|
|
77
77
|
onMounted(async () => {
|
|
78
78
|
await query()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="
|
|
2
|
+
<van-field v-if="!isGone" :label="props.label" :required="isRequired" :rules="rules" :disabled="isDisabled"
|
|
3
3
|
:placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
|
|
4
4
|
label-class="label">
|
|
5
5
|
<template #input>
|
|
@@ -71,7 +71,7 @@ const data = reactive({
|
|
|
71
71
|
// 定义emit
|
|
72
72
|
const emit = defineEmits(["update:modelValue", "select"]);
|
|
73
73
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
74
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
|
|
74
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props);
|
|
75
75
|
|
|
76
76
|
//首页加载
|
|
77
77
|
onMounted(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<van-field v-if="!isGone"
|
|
3
|
-
:label="props.label" :required="isRequired" :rules="
|
|
3
|
+
:label="props.label" :required="isRequired" :rules="rules" :disabled="isDisabled"
|
|
4
4
|
:placeholder="props.placeholder" :is-link="isReadonly ? false : true" @click="data.isShowPop = !isReadonly"
|
|
5
5
|
label-class="label">
|
|
6
6
|
<template #input>
|
|
@@ -76,7 +76,7 @@ const data = reactive({
|
|
|
76
76
|
// 定义emit
|
|
77
77
|
const emit = defineEmits(["update:modelValue", "select"]);
|
|
78
78
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
79
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
|
|
79
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props);
|
|
80
80
|
|
|
81
81
|
//首页加载
|
|
82
82
|
onMounted(() => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!-- 显示已选数据 -->
|
|
4
4
|
<van-field v-if="!isGone" type="textarea" rows="1" autosize :modelValue="selectdItemsLabel" clearable
|
|
5
5
|
:required="isRequired" :label="label" :name="name" v-bind="$attrs" @click-right-icon="showPopup" @clear="onClear"
|
|
6
|
-
:right-icon="rightIcon" :rules="
|
|
6
|
+
:right-icon="rightIcon" :rules="rules" :class="{ 'disabled-field': isReadonly }" />
|
|
7
7
|
<!-- 数据选择弹出层 -->
|
|
8
8
|
<van-popup v-model:show="popupVisible" position="bottom" class="popup-style">
|
|
9
9
|
<div>
|
|
@@ -93,7 +93,7 @@ const props = defineProps({
|
|
|
93
93
|
name: String,
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
96
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
97
97
|
const emit = defineEmits(["update:modelValue", "select"]);
|
|
98
98
|
|
|
99
99
|
const rightIcon = computed(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="
|
|
2
|
+
<van-field v-if="!isGone" name="image" :label="props.label" :required="isRequired" :rules="rules"
|
|
3
3
|
label-class="label" :placeholder="props.placeholder">
|
|
4
4
|
<template #input>
|
|
5
5
|
<div class="image-box">
|
|
@@ -62,7 +62,7 @@ const props = defineProps({
|
|
|
62
62
|
|
|
63
63
|
const emit = defineEmits(['update:modelValue'])
|
|
64
64
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
65
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
65
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
66
66
|
|
|
67
67
|
const files = ref([])
|
|
68
68
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<van-field name="image"
|
|
2
|
+
<van-field name="image"
|
|
3
|
+
:label="props.label"
|
|
4
|
+
:required="isRequired"
|
|
5
|
+
:rules="rules"
|
|
6
|
+
label-class="label"
|
|
3
7
|
:placeholder="props.placeholder">
|
|
4
8
|
<template #input>
|
|
5
9
|
<div class="image-box">
|
|
@@ -74,7 +78,7 @@ const props = defineProps({
|
|
|
74
78
|
})
|
|
75
79
|
const emit = defineEmits(['update:modelValue'])
|
|
76
80
|
const modelValue = useVModel(props, 'modelValue', emit)
|
|
77
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props)
|
|
81
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props)
|
|
78
82
|
const files = ref([])
|
|
79
83
|
const isPreviewMore = ref(false)
|
|
80
84
|
const previews = computed(() => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="department-selector">
|
|
3
3
|
<van-field v-if="!isGone" :model-value="selectedDepartmentPath" readonly clickable :label="props.label"
|
|
4
4
|
:placeholder="props.placeholder" @click="onShow" :right-icon="isReadonly ? '' : 'arrow'"
|
|
5
|
-
:required="isRequired" :rules="
|
|
5
|
+
:required="isRequired" :rules="rules" type="textarea" autosize="true" rows="1"/>
|
|
6
6
|
|
|
7
7
|
<van-popup v-model:show="showPicker" position="bottom" class="department-popup">
|
|
8
8
|
<div class="popup-container">
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
@click="showPicker = !props.readonly"
|
|
11
11
|
:right-icon="props.readonly ? '' : 'arrow'"
|
|
12
12
|
:required="props.required"
|
|
13
|
-
:rules="
|
|
13
|
+
:rules="rules"
|
|
14
14
|
/>
|
|
15
15
|
|
|
16
16
|
<van-popup v-model:show="showPicker" position="bottom" class="user-popup">
|
|
@@ -167,7 +167,7 @@ const props = defineProps({
|
|
|
167
167
|
},
|
|
168
168
|
});
|
|
169
169
|
|
|
170
|
-
const { isRequired, isReadonly, isGone, isDisabled } = util.props2auth(props);
|
|
170
|
+
const { isRequired, isReadonly, isGone, isDisabled, rules } = util.props2auth(props);
|
|
171
171
|
|
|
172
172
|
// 用户加载逻辑
|
|
173
173
|
const userData = ref({
|
|
@@ -210,7 +210,7 @@ const onSearch = async () => {
|
|
|
210
210
|
return
|
|
211
211
|
|
|
212
212
|
// 搜索用户
|
|
213
|
-
const res = await util.wx_user_list({ keyword: data.keyword, page: 1, limit:
|
|
213
|
+
const res = await util.wx_user_list({ keyword: data.keyword, page: 1, limit: 10 })
|
|
214
214
|
data.searchUsers = res.data.list
|
|
215
215
|
}
|
|
216
216
|
|
package/src/util/auth_util.js
CHANGED
|
@@ -9,7 +9,7 @@ export const TOKEN_PREFIX = import.meta.env.VITE_TOKEN_PREFIX;
|
|
|
9
9
|
export function getToken() {
|
|
10
10
|
if (import.meta.env.VITE_IS_DEBUG === 'true')
|
|
11
11
|
return TOKEN_PREFIX + import.meta.env.VITE_DEBUG_TOKEN
|
|
12
|
-
else if(vm.tokenCallback)
|
|
12
|
+
else if (vm.tokenCallback)
|
|
13
13
|
return vm.tokenCallback()
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -33,41 +33,49 @@ export const props2auth = (props) => {
|
|
|
33
33
|
isGone: computed(() => {
|
|
34
34
|
if (props.auth)
|
|
35
35
|
return props.auth == 'gone'
|
|
36
|
-
|
|
36
|
+
|
|
37
37
|
return false
|
|
38
38
|
}),
|
|
39
|
-
isDisabled: computed(()=>{
|
|
39
|
+
isDisabled: computed(() => {
|
|
40
40
|
if (props.auth)
|
|
41
41
|
return props.auth == 'readonly'
|
|
42
|
-
|
|
43
|
-
if(props.required)
|
|
42
|
+
|
|
43
|
+
if (props.required)
|
|
44
44
|
return false
|
|
45
45
|
|
|
46
|
-
if(props.disabled)
|
|
46
|
+
if (props.disabled)
|
|
47
47
|
return true
|
|
48
48
|
|
|
49
|
-
if(props.readonly)
|
|
49
|
+
if (props.readonly)
|
|
50
50
|
return true
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
return false
|
|
53
53
|
}),
|
|
54
|
-
isReadonly: computed(()=>{
|
|
54
|
+
isReadonly: computed(() => {
|
|
55
55
|
if (props.auth)
|
|
56
56
|
return props.auth == 'readonly'
|
|
57
57
|
|
|
58
|
-
if(props.readonly)
|
|
58
|
+
if (props.readonly)
|
|
59
59
|
return true
|
|
60
60
|
|
|
61
|
-
if(props.required)
|
|
61
|
+
if (props.required)
|
|
62
62
|
return false
|
|
63
63
|
|
|
64
|
-
if(props.disabled)
|
|
64
|
+
if (props.disabled)
|
|
65
65
|
return true
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
return false
|
|
68
68
|
}),
|
|
69
|
-
rules: computed(()=>{
|
|
70
|
-
|
|
69
|
+
rules: computed(() => {
|
|
70
|
+
if ((props.rules || []).length > 0)
|
|
71
|
+
return []
|
|
72
|
+
|
|
73
|
+
if(!props.label)
|
|
74
|
+
return []
|
|
75
|
+
|
|
76
|
+
//默认必填校验提示文案
|
|
77
|
+
if (props.auth == 'require' || props.required)
|
|
78
|
+
return [{ required: true, message: `${props.label}为空` }]
|
|
71
79
|
})
|
|
72
80
|
}
|
|
73
81
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="page">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
<van-form @submit="onSubmit">
|
|
4
|
+
<widget-qw-data-selector :options="options" v-model="formData.singleSelect" label="单选数据" placeholder="单选数据"
|
|
5
|
+
:auth="formData.auth" />
|
|
6
|
+
<widget-qw-data-selector :options="options" v-model="formData.multSelect" multiple label="多选数据"
|
|
7
|
+
placeholder="多选数据" :required="true" :readonly="false" />
|
|
8
|
+
|
|
9
|
+
<div style="margin: 16px;">
|
|
10
|
+
<van-button round block type="primary" native-type="submit">
|
|
11
|
+
提交
|
|
12
|
+
</van-button>
|
|
13
|
+
</div>
|
|
14
|
+
</van-form>
|
|
7
15
|
</div>
|
|
8
16
|
</template>
|
|
9
17
|
|
|
@@ -15,7 +23,7 @@ const formData = ref({
|
|
|
15
23
|
singleSelect: '',
|
|
16
24
|
multSelect: [],
|
|
17
25
|
apiSelect: '',
|
|
18
|
-
auth: '
|
|
26
|
+
auth: 'require'
|
|
19
27
|
})
|
|
20
28
|
|
|
21
29
|
// 数据选项
|
|
@@ -30,6 +38,10 @@ const options = ref([
|
|
|
30
38
|
{ text: '一号门与二号门之间前花园', value: '一号门与二号门之间前花园' }
|
|
31
39
|
])
|
|
32
40
|
|
|
41
|
+
const onSubmit=()=>{
|
|
42
|
+
console.log('onSubmit')
|
|
43
|
+
}
|
|
44
|
+
|
|
33
45
|
onMounted(() => {
|
|
34
46
|
})
|
|
35
47
|
</script>
|