新增评分组件

master
于肖磊 2025-07-02 10:26:06 +08:00
parent 3366383488
commit 006c28475f
11 changed files with 31 additions and 37 deletions

View File

@ -77,8 +77,8 @@
this.setData({
com_data: com_data,
address_type: com_data.address_type || 'noDetailed',
placeholder: com_data?.placeholder || '请选择内容...',
form_value: com_data?.form_value || '',
placeholder: com_data.placeholder,
form_value: com_data.form_value ,
detailed_value: com_data?.detailed_value || '',
province_id: com_data?.form_value[0] || '',
city_id: com_data?.form_value[1] || '',

View File

@ -86,7 +86,7 @@
this.$nextTick(() => {
this.setData({
com_data: com_data,
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data?.placeholder,
form_value: date_list,
date_style: com_data.date_style,
date_type: com_data.date_type,

View File

@ -77,7 +77,7 @@
this.$nextTick(() => {
this.setData({
com_data: com_data,
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data.placeholder,
form_value: date,
date_style: com_data.date_style,
date_type: com_data.date_type,

View File

@ -55,6 +55,9 @@
<view v-else-if="item.key == 'pwd'" :style="item.com_data.common_style">
<componentPwd :propValue="item.com_data" :propKey="propKey" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataCheck="data_check" @dataChange="data_change"></componentPwd>
</view>
<view v-else-if="item.key == 'score'">
<componentScore :propValue="item.com_data" :propKey="propKey" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction" @dataCheck="data_check" @dataChange="data_change"></componentScore>
</view>
<view v-if="!isEmpty(item.com_data.common_config.error_text)" class="field-invalid-info">{{ item.com_data.common_config.error_text }}</view>
</view>
</view>
@ -96,6 +99,7 @@ import componentAddress from '@/pages/form-input/components/form-input/address.v
import componentSelectMulti from '@/pages/form-input/components/form-input/select-multi.vue';
import componentPhone from '@/pages/form-input/components/form-input/phone.vue';
import componentPwd from '@/pages/form-input/components/form-input/pwd.vue';
import componentScore from '@/pages/form-input/components/form-input/score.vue';
import componentRegionPicker from '@/pages/common/components/region-picker/region-picker';
export default {
name: 'formInput',
@ -113,6 +117,8 @@ export default {
componentRegionPicker,
componentPhone,
componentPwd,
componentScore,
},
props: {
propValue: {

View File

@ -50,7 +50,7 @@
this.setData({
com_data: com_data,
max_length: com_data.is_limit_num == '1' && !isEmpty(com_data.max_num) ? com_data.max_num : '-1',
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data.placeholder,
form_value: com_data?.form_value || '',
});
},

View File

@ -59,7 +59,7 @@
this.setData({
com_data: com_data,
max_length: com_data.is_limit_num == '1' && !isEmpty(com_data.max_num) ? com_data.max_num : '-1',
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data.placeholder,
form_value: com_data?.form_value || '',
decimal_num: com_data.is_decimal == '1' ? com_data.decimal_num : 0,
is_thousandths_symbol: com_data.is_thousandths_symbol,

View File

@ -93,7 +93,7 @@
}
this.setData({
com_data: com_data,
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data.placeholder,
form_value: com_data?.form_value || '',
form_value_code: com_data?.form_value_code || '',
format: com_data.format,

View File

@ -53,7 +53,7 @@
const com_data = this.propValue;
this.setData({
com_data: com_data,
placeholder: com_data?.placeholder || '请输入密码...',
placeholder: com_data.placeholder,
form_value: com_data?.form_value || '',
is_show: true,
});

View File

@ -17,7 +17,7 @@
</template>
</view>
<!-- 弹窗 -->
<component-popup :propShow="popup_status" propPosition="bottom" @onclose="quick_close_event">
<uni-popup ref="selectPopup" type="bottom" @onclose="quick_close_event">
<view class="padding-horizontal-main padding-top-main bg-white popup-content flex-col">
<!-- 头部的样式 -->
<view class="flex-row jc-sb margin-bottom">
@ -59,7 +59,7 @@
<view class="size-14 cr-blue">添加选项</view>
</view>
</view>
</component-popup>
</uni-popup>
<!-- 选项弹出框 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="输入内容" :value="dialog_value" before-close placeholder="请输入内容" @close="dialog_input_close" @confirm="dialog_input_confirm"></uni-popup-dialog>
@ -73,11 +73,7 @@
<script>
import { get_format_checks, isEmpty, get_color_style, color_change } from '@/common/js/common/common.js';
import componentPopup from '@/components/popup/popup';
export default {
components: {
componentPopup,
},
props: {
propValue: {
type: Object,
@ -156,7 +152,7 @@
this.setData({
com_data: com_data,
is_multicolour: com_data.is_multicolour,
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data?.placeholder,
option_list: com_data?.option_list.concat(com_data?.custom_option_list || []) || [],
custom_option_list: com_data?.custom_option_list || [],
color_style: get_color_style(this.propMobile),
@ -173,8 +169,8 @@
this.setData({
select_value: count == this.new_option_list.length ? 'all' : '',
popup_list: this.form_value,
popup_status: true,
});
this.$refs.selectPopup.open();
},
add_option() {
this.setData({
@ -209,9 +205,7 @@
* 快速关闭事件
*/
quick_close_event() {
this.setData({
popup_status: false,
});
this.$refs.selectPopup.close();
},
/**
* 搜索事件
@ -269,9 +263,9 @@
//
this.setData({
form_value: this.popup_list,
popup_status: false,
form_value_data: form_value_data,
});
this.$refs.selectPopup.close();
const { is_error = '0', error_text = '' } = get_format_checks(this.com_data, this.popup_list, true, 'checkbox');
//
this.$emit('dataCheck', { is_error, error_text, value: this.popup_list, index: this.propDataIndex });

View File

@ -17,7 +17,7 @@
</template>
</view>
<!-- 弹窗 -->
<component-popup :propShow="popup_status" propPosition="bottom" @onclose="quick_close_event">
<uni-popup ref="selectPopup" type="bottom" @onclose="quick_close_event">
<view class="padding-horizontal-main padding-top-main bg-white popup-content flex-col gap-10">
<!-- 头部的样式 -->
<view class="flex-row jc-sb">
@ -47,17 +47,13 @@
</template>
</view>
</view>
</component-popup>
</uni-popup>
</view>
</template>
<script>
import { get_format_checks, isEmpty, get_color_style } from '@/common/js/common/common.js';
import componentPopup from '@/components/popup/popup';
import { isEmpty, get_color_style } from '@/common/js/common/common.js';
export default {
components: {
componentPopup,
},
props: {
propValue: {
type: Object,
@ -133,7 +129,7 @@
this.setData({
com_data: com_data,
is_multicolour: com_data.is_multicolour,
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data.placeholder,
option_list: com_data?.option_list || [],
color_style: get_color_style(this.propMobile),
form_value: com_data?.form_value || '',
@ -144,17 +140,13 @@
* 下拉框选择事件
*/
data_value_event() {
this.setData({
popup_status: true,
});
this.$refs.selectPopup.open();
},
/**
* 快速关闭事件
*/
quick_close_event() {
this.setData({
popup_status: false,
});
this.$refs.selectPopup.close();
},
/**
* 搜索事件
@ -180,9 +172,11 @@
//
this.setData({
form_value: e.detail.value,
popup_status: false,
form_value_data: form_value_data,
});
//
this.$refs.selectPopup.close();
this.$emit('dataChange', { value: e.detail.value, index: this.propDataIndex });
}
}

View File

@ -51,7 +51,7 @@
this.setData({
com_data: com_data,
max_length: com_data.is_limit_num == '1' && !isEmpty(com_data.max_num) ? com_data.max_num : '-1',
placeholder: com_data?.placeholder || '请输入内容...',
placeholder: com_data?.placeholder,
form_value: com_data?.form_value || '',
});
},