Jelajahi Sumber

新建编辑荣誉类型、荣誉教师列表接口对接

liurongli 2 minggu lalu
induk
melakukan
6d922d5f4e

+ 5 - 5
common/request.js

@@ -82,16 +82,16 @@ const responseInterceptor = (response) => {
         url: '/pages/login/index'
       });
     }
-    throw new Error(response.data.message || '未授权,请重新登录');
+    throw new Error(response.data.message || response.data.msg || '未授权,请重新登录');
   }
 
   if (response.data.code === 500 || response.data.code === 503) {
     uni.showToast({
-      title: response.data.message || '服务器繁忙,请稍后重试',
+      title: response.data.message || response.data.msg || '服务器繁忙,请稍后重试',
       icon: 'none',
       duration: 3000
     });
-    throw new Error(response.data.message || '服务器内部错误');
+    throw new Error(response.data.message || response.data.msg || '服务器内部错误');
   }
 
   if (response.data.code === 200 || response.data.code === 400 || response.data.code === 601 || response.data.code === 602) {
@@ -99,11 +99,11 @@ const responseInterceptor = (response) => {
   }
 
   if (response.data.code === 403) {
-    throw new Error(response.data.message || '禁止访问');
+    throw new Error(response.data.message || response.data.msg || '禁止访问');
   }
 
   if (response.data.code === 404) {
-    throw new Error(response.data.message || '资源未找到');
+    throw new Error(response.data.message || response.data.msg || '资源未找到');
   }
 
   throw new Error(`未知错误,状态码: ${response.statusCode}`);

+ 314 - 54
pages/teacherHonor/honorOverview/honorTypeDetail.vue

@@ -1,27 +1,41 @@
 <template>
-	<!-- 头部 -->
-	<nav-bar height="96" :title="state.title" :onlyTitle="true" :showHeaderborder="true" @GoBack="GoBack"></nav-bar>
-	<view class="page_content">
-		<uni-forms ref="valiForm" class="forms_style" :model="state.formData" :rules="rules" labelWidth="150rpx">
-			<uni-forms-item label="类型名称:">
-				<uni-easyinput v-model="state.formData.honorTypeName" :maxlength="30" placeholder="请输入类型名称" />
-			</uni-forms-item>
-			<uni-forms-item label="审核机制:">
-				<radio-group @change="radioChange">
-					<label class="uni-list-cell uni-list-cell-pd" v-for="item in state.radioList" :key="item.value">
-						<view>
-							<radio :value="item.value" :checked="index === current" />
-						</view>
-						<view>{{item.name}}</view>
-					</label>
-				</radio-group>
-			</uni-forms-item>
-			<uni-forms-item label="审核人:">
-				<zxz-uni-data-select class="" v-model="state.formData.auditPeople" collapse-tags :collapse-tags-num="1" filterable multiple dataKey="teacherName" dataValue="teacherId" :clear="false" :localdata="state.teacherData"></zxz-uni-data-select>
-			</uni-forms-item>
-		</uni-forms>
+	<view class="page_body">
+		<!-- 头部 -->
+		<nav-bar height="96" :title="state.title" :onlyTitle="true" :showHeaderborder="true" @GoBack="GoBack"></nav-bar>
+		<view class="page_content">
+			<uni-forms ref="valiForm" class="forms_style" :model="state.formData" :rules="rules" border labelWidth="140rpx" label-align="right">
+				<uni-forms-item label="类型名称:">
+					<uni-easyinput v-model="state.formData.honorTypeName" :maxlength="30" placeholder="请输入类型名称" />
+				</uni-forms-item>
+				<uni-forms-item label="审核机制:">
+					<uni-data-checkbox v-model="state.formData.reviewStatus" selectedColor="#2E64FA" selectedTextColor="#333333" :localdata="state.radioList"></uni-data-checkbox>
+				</uni-forms-item>
+				<uni-forms-item label="审核人:">
+					<zxz-uni-data-select v-model="state.formData.auditPeople" collapse-tags :collapse-tags-num="1" filterable multiple dataKey="dataKey" dataValue="dataValue" :clear="false" :localdata="state.teacherData"></zxz-uni-data-select>
+				</uni-forms-item>
+				<uni-forms-item label-width="0px">
+					<view class="forms_item_title">选择提交信息:</view>
+					<view class="checkbox_list_scroll">
+						<scroll-view scroll-y="true" scroll-top="0" :show-scrollbar="false" style="height: 100%;">
+							<view class="checkbox_list_item" v-for="item in state.dictionaryData" :key="item.id">
+								<view :class="['checkbx', {'is_checked':item.isChecked,'disabled':item.disabled}]" @click="checkedDictionary(item,item.isChecked,item.disabled)">
+									<uni-icons v-if="item.isChecked" class="checkbx_icon" type="checkmarkempty"></uni-icons>
+								</view>
+								<view class="checkbx_content">
+									<view class="label_type">
+										<view class="checkbx_label">{{item.dictName}}</view>
+										<view class="checkbx_type">{{DictTypeNumToName(item.dictType)}}</view>
+									</view>
+									<view class="checkbx_desc">{{item.dictContent}}</view>
+								</view>
+							</view>
+						</scroll-view>
+					</view>
+				</uni-forms-item>
+			</uni-forms>
+		</view>
+		<view class="page_foot"><button class="btn_submit" type="primary" :loading="state.loading" @click="honorTypeConfirm">确认</button></view>
 	</view>
-	<view class="page_foot"><button class="btn_submit" type="primary" :loading="state.loading" @click="HandleUpdateExamCourse">确认</button></view>
 </template>
 
 <script setup>
@@ -29,10 +43,9 @@
 	import uniForms from '@/uni_modules/uni-forms/components/uni-forms/uni-forms.vue';
 	import uniFormsItem from '@/uni_modules/uni-forms/components/uni-forms-item/uni-forms-item.vue';
 	import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue';
-	import uniDataSelect from '@/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue';
-	import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue';
+	import uniDataCheckbox from '@/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue';
 	import zxzUniDataSelect from '@/uni_modules/zxz-uni-data-select/components/zxz-uni-data-select/zxz-uni-data-select.vue';
-	import {queryHonorTypeOverView,deleteHonorType} from '@/reqApi/teacherHonor.js';
+	import {querySchoolAllTeacherData,baseDictLibListData,queryHonorDetailData,addHonorData,updateHonorData} from '@/reqApi/teacherHonor.js';
 	import {
 		reactive,
 		ref,
@@ -44,18 +57,20 @@
 		id:'',//荣誉类型id
 		title:'',
 		formData: {
-			id:'',//修改传参
 			honorTypeName: '',//荣誉类型
-			reviewStatus: '',//审核机制
-			auditPeople:'',
+			reviewStatus: 0,//审核机制
+			auditPeople:[],//审核人
 		},
-		radioList:[{
-			label:'需审核',
+		radioList:[{//审核机制
+			text:'需审核',
 			value:0
 		},{
-			label:'无审核',
+			text:'无审核',
 			value:1
-		}]
+		}],
+		teacherData:[],//审核人
+		dictionaryData:[],//字典库
+		loading:false
 	})
 	const rules = ref({
 		honorTypeName: { rules: [{ required: true, errorMessage: '请输入类型名称' }] },
@@ -64,7 +79,164 @@
 	onLoad((option) => {
 		state.id = option.id;
 		state.title = state.id?'修改荣誉类型':'新建荣誉类型';
+		uni.setStorageSync('isLoadHonorOverview', false);//返回列表页是否重新加载荣誉类型列表
+		getSchoolAllTeacherData();//查询审核教师接口
+		if(state.id){
+			state.radioList = [{//审核机制
+				text:'需审核',
+				value:0,
+				disable:true
+			},{
+				text:'无审核',
+				value:1,
+				disable:true
+			}]
+			getHonorDetailData()
+		}else{
+			state.radioList = [{//审核机制
+				text:'需审核',
+				value:0,
+				disable:false
+			},{
+				text:'无审核',
+				value:1,
+				disable:false
+			}]
+			getBaseDictLibListData();//字典库
+		}
 	})
+	//查询审核教师接口
+	const getSchoolAllTeacherData = () => {
+		querySchoolAllTeacherData({
+			teacherName:''
+		}).then(res=>{
+			if(res.code == 200){
+				const dataList = res?.data || [];
+				state.teacherData = dataList.map(item=>({
+					...item,
+					dataKey:`${item.teacherName}(${item.userAccount})`,
+					dataValue:`${item.teacherId}——${item.teacherName}`
+				}))
+			}else{
+				state.teacherData = [];
+			}
+		})
+	}
+	//字典库
+	const getBaseDictLibListData = () => {
+		baseDictLibListData().then(res=>{
+			if(res.code == 200){
+				const dataList = res?.data || [];
+				state.dictionaryData = dataList.map(item=>({
+					...item,
+					isChecked:item.defaultStatus===0 && item.dictType!=2,//默认选中
+					disabled:item.defaultStatus===0 && item.dictType!=2//默认不可取消勾选
+				}))
+			}else{
+				state.dictionaryData = [];
+			}
+		})
+	}
+	//查询当前荣誉详情
+	const getHonorDetailData = () => {
+		queryHonorDetailData(state.id).then(res=>{
+			if(res.code == 200){
+				state.formData.honorTypeName = res?.data?.honorTypeName || '';
+				const reviewStatusList = res?.data?.reviewStatus || 0;
+				const auditPeopleList = res?.data?.reviewTeacherData || [];
+				state.formData.auditPeople = auditPeopleList.map(item=>`${item.reviewTeacherId}——${item.reviewTeacherName}`);//审核人
+				//提交信息
+				const selectDictData = res?.data?.selectDictData || [];//勾选的字典库
+				state.dictionaryData = selectDictData.map(item=>{
+					return {
+						...item,
+						isChecked:true,//默认选中
+						disabled:true
+					}
+				})
+			}
+		})
+	}
+	// 类型切换
+	const DictTypeNumToName = (num) => {
+	    switch(Number(num)){
+	        case 0:
+	            return '日期'
+	        case 1:
+	            return '输入框'
+	        case 2:
+	            return '单选'
+			default:
+			    return ''	
+	    }
+	}
+	//勾选提交信息
+	const checkedDictionary = (item,isChecked,disabled) => {
+		if(disabled) return false;
+		item.isChecked = !isChecked;//选中状态
+	}
+	//提交
+	const honorTypeConfirm = () => {
+		for (const key in rules.value) {
+			if (state.formData?.[key] === "" || state.formData?.[key] === null || state.formData?.[key]&&state.formData?.[key]?.length === 0) {
+				const errorMessage = rules.value[key].rules[0].errorMessage;
+				uni.showToast({
+					title: errorMessage,
+					icon: 'none'
+				})
+				return false
+			}
+		}
+		state.loading = true;
+		const selectData = state.dictionaryData.filter(item=>item.isChecked).map((items,index)=>({
+			dictId: items.id,
+			sortCode: index + 1
+		}))
+		const auditPeopleData = state.formData.auditPeople.map(item=>{
+			const teacherData = item?.split('——') || [];
+			return {
+				reviewTeacherId: teacherData?.[0] || '',
+				reviewTeacherName: teacherData?.[1] || ''
+			}
+		})
+		let params =  {
+			selectData: selectData,
+			honorTypeName: state.formData.honorTypeName,
+			reviewStatus:state.formData.reviewStatus,//审核机制
+			reviewTeacherData: auditPeopleData
+		}
+		console.log(params,2323)
+		if(state.id){
+			params.id = state.id;
+			updateHonorData(params).then(res=>{
+				if(res.code == 200){
+					uni.showToast({
+						title: '修改成功!',
+						icon: 'none'
+					})
+					uni.setStorageSync('isLoadHonorOverview', true);//刷新荣誉列表
+					GoBack();
+				}
+			}).finally(()=>{
+				state.loading = false;
+			})
+		}else{//新建
+			addHonorData(params).then(res=>{
+				if(res.code == 200){
+					uni.showToast({
+						title: '新建成功!',
+						icon: 'none'
+					})
+					uni.setStorageSync('isLoadHonorOverview', true);//刷新荣誉列表
+					GoBack();
+				}else{
+					
+				}
+			}).finally(()=>{
+				state.loading = false;
+			})
+		}
+	}
 	const GoBack = () => {
 		uni.navigateBack({
 			delta: 1
@@ -73,32 +245,120 @@
 </script>
 
 <style lang="scss" scoped>
+	.page_body{
+		height: 100%;
+		min-height: auto;
+	}
+	.page_content{
+		height: calc(100% - 230rpx);
+		overflow: hidden;
+	}
 	.forms_style{
-		padding: 20rpx;
-		background-color: #fff;
-		border-radius: 20rpx;
-		.row_line{
-			width: 100%;
-			display: flex;
-			gap: 20rpx;
-			:deep(.uni-forms-item){
-				width: 50%;
+		height: 100%;
+		:deep(uni-form){
+			height: 100%;
+			overflow: hidden;
+			> span{
+				height: 100%;
+				display: flex;
+				width: 100%;
+				flex-direction: column;
+				overflow: hidden;
 			}
-			&.switch{
-				:deep(.isStudentRanking){
-					width: 60%;
-					.uni-forms-item__label{
-						width: 238rpx !important;
-					}
+		}
+		:deep(.uni-forms-item){
+			&:nth-child(2){
+				.uni-forms-item__label{
+					height: 56rpx;
 				}
-				:deep(.isAnalysisOpen){
-					width: 40%;
+			}
+				
+			&:nth-child(4){
+				flex:1;
+				overflow: hidden;
+				padding: 24rpx 0 0;
+				.uni-forms-item__content{
+					display: flex;
+					overflow: hidden;
 				}
 			}
-		}
-		.isOpenWeChart{
-			:deep(.uni-forms-item__label){
-				width: 176rpx !important;
+			.forms_item_title{
+				width: 100%;
+				display: flex;
+				font-weight: 400;
+				font-size: 28rpx;
+				color: #666666;
+			}
+			.checkbox_list_scroll{
+				flex: 1;
+				height: calc(100% - 30rpx);;
+			}
+			.checkbox_list_item{
+				display: flex;
+				width: 100%;
+				padding: 24rpx 0;
+				border-bottom: 2rpx solid #F3F3F3;
+				.checkbx{
+					width: 32rpx;
+					height: 32rpx;
+					margin-top: 4rpx;
+					background-color: #FFFFFF;
+					border-radius: 4rpx;
+					border: 2rpx solid #DCDFE6;
+					margin-right: 16rpx;
+					flex-shrink: 0;
+					display: inline-flex;
+					justify-content: center;
+					align-items: center;
+					&.is_checked{
+						background-color: #2E64FA;
+						.checkbx_icon{
+							color: #FFFFFF !important;
+							font-size: 28rpx !important;
+						}
+					}
+					&.disabled{//必选不可取消
+						background-color: #F2F6FC;
+						.checkbx_icon{
+							color: #C0C4CC !important;
+						}
+					}
+				}
+				.checkbx_content{
+					flex:1;
+					display: flex;
+					flex-direction: column;
+					overflow: hidden;
+					.label_type{
+						display: flex;
+						justify-content: space-between;
+						align-items: center;
+						height: 40rpx;
+						width: 100%;
+						.checkbx_label{
+							flex: 1;
+							font-weight: 500;
+							font-size: 28rpx;
+							color: #333333;
+							white-space: nowrap;
+							overflow: hidden;
+							text-overflow: ellipsis;
+						}
+						.checkbx_type{
+							font-weight: 400;
+							font-size: 24rpx;
+							color: #999999;
+						}
+					}
+					.checkbx_desc{
+						display: flex;
+						width: 100%;
+						margin-top: 8rpx;
+						font-weight: 400;
+						font-size: 24rpx;
+						color: #999999;
+					}
+				}
 			}
 		}
 	}
@@ -108,7 +368,7 @@
 		right: 0;
 		bottom: 0;
 		padding: 20rpx 24rpx;
-		background-color:#F8F9FD;
+		background-color:#FFFFFF;
 		.btn_submit{
 			width: 100%;
 			height: 88rpx;

+ 15 - 1
pages/teacherHonor/honorOverview/index.vue

@@ -49,7 +49,7 @@
 			<no-data v-if="!state.isLoading && state.tableData.length == 0" />
 		</view>
 	</view>
-	<custom-popup-dialog ref="popupDialogRef" :title="state.popupDialog.title" :isMaskClick="true" :showDialogClose="false" :showDialogFooter="false" @DialogConfirm="DialogConfirm">
+	<custom-popup-dialog ref="popupDialogRef" :title="state.popupDialog.title" :isMaskClick="true" :showDialogClose="false" :showDialogFooter="false">
 		<view class="popup_content">
 			<view class="content_item" @click="AddEditHonorType('edit')">
 				<view class="content_item_left">
@@ -77,10 +77,12 @@
 	import popupDialog from '@/components/popup-dialog.vue';
 	import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue';
 	import {queryHonorTypeOverView,deleteHonorType} from '@/reqApi/teacherHonor.js';
+	import { onShow } from '@dcloudio/uni-app';
 	import {
 		reactive,
 		ref,
 		onMounted,
+		onUnmounted,
 		nextTick
 	} from 'vue';
 	const state = reactive({
@@ -105,9 +107,18 @@
 	//提示框
 	const popupDialogRef = ref(null);
 	const popupDelDialogRef = ref(null);
+	onShow(()=>{
+		const isLoadHonorOverview = uni.getStorageSync('isLoadHonorOverview');
+		if(isLoadHonorOverview){
+			OnLoadData();
+		}
+	})
 	onMounted(() => {
 		OnLoadData();
 	});
+	onUnmounted(()=>{
+		uni.setStorageSync('isLoadHonorOverview', false);
+	})
 	const OnLoadData = () => {
 		state.isLoading = true;
 		queryHonorTypeOverView({
@@ -171,6 +182,9 @@
 	//新建或编辑荣誉类型
 	const AddEditHonorType = (type) => {
 		const id = type=='add'?'':state.popupDialog.id;
+		if(type=='edit'){
+			popupDialogRef.value.CloseDialog();
+		}
 		uni.navigateTo({
 			url: `/pages/teacherHonor/honorOverview/honorTypeDetail?id=${id}`
 		});

+ 236 - 2
pages/teacherHonor/honorTeacher/index.vue

@@ -1,8 +1,242 @@
 <template>
+	<!-- 头部 -->
+	<nav-bar height="224" backPath="workspace" title="教师专业发展" :tabList="state.tabList" :onlyTitle="false" :showFilterPicker="false" :showTabs="true" rightWidth="0rpx" @CommonFilterData="CommonFilterData"></nav-bar>
+	<view class="page_content">
+		<scroll-view
+		    class="scroll_view_y"
+			:scroll-top="state.scrollTop"
+			scroll-y="true"
+			:refresher-enabled="false" 
+			:enable-back-to-top="true"
+			:show-scrollbar="false" 
+			:scroll-with-animation="true" 
+			refresher-default-style="none"
+			refresher-background="#F8F9FD" 
+			:refresher-triggered="state.isRefreshing" 
+			@scrolltolower="OnLoadMore"
+			@refresherrefresh="OnRefresh"
+			@scroll="OnScroll">
+			<view class="refresh_loading" v-if="state.isRefreshing"><uni-load-more status="loading" /></view>
+			<view class="page_list">
+				<view class="list_item" v-for="item in state.pageList" :key="item.id" @click="GoVideoDetails(item.id)">
+					<view class="teacher_name">
+						<image class="icon" src="@/static/image/icon/person.png"></image>
+						<text class="name">{{item.teacherName}}</text>
+					</view>
+					<view class="honor_count">共<text class="count">{{item.honorCount}}</text>个奖项</view>
+					<view class="honor_desc">{{item.honorName}}</view>
+					<view class="honor_date">更新时间:{{item?.createdAt?.slice(0, 10)}}</view>
+				</view>
+			</view>
+			<view class="no_data" v-if="!state.isLoading && state.pageList.length == 0">
+				<image class="no_data_img" src="@/static/image/bg/no_data.png"></image>
+				<text class="no_data_text">暂无数据</text>
+			</view>
+			<uni-load-more v-if="state.pageList.length > 0" :status="state.loadStatus" />
+		</scroll-view>
+	</view>
 </template>
 
-<script>
+<script setup>
+	import navBar from '@/components/nav-bar.vue';
+	import {queryHonorTeacherListData} from '@/reqApi/teacherHonor.js';
+	import {
+		reactive,
+		ref,
+		onMounted,
+		nextTick
+	} from 'vue';
+	const state = reactive({
+		tabList:[ {
+			label:'更新时间',
+			value:'0',
+		},{
+			label:'获奖数量',
+			value:'1',
+		},{
+			label:'姓名',
+			value:'2',
+		}],
+		pageList:[],//列表数据
+		sortType:'0',
+		queryStr: '',
+		pageSize: 30,
+		pageNum: 1,
+		scrollTop:0,
+		oldScrollTop:0,
+		isRefreshing:false,//设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
+		isLoading:true,//加载中
+		noMoreData:false,//没有更多数据了
+		loadStatus:'more',//loading状态
+	})
+	onMounted(() => {
+		OnLoadData(true);
+	});
+	//切换条件选择器
+	const CommonFilterData = (searchWord,filterPicker,tabsSelected,type) => {
+		state.queryStr = searchWord;
+		state.sortType = tabsSelected;
+		OnLoadData(true)
+	}
+	/*
+	*获取数据
+	* initPage:初始分页 从第一开始
+	*/
+	const OnLoadData = (initPage) => {
+		// uni.showLoading({
+		// 	title: '加载中'
+		// });
+		state.isLoading = true;
+		state.loadStatus = 'loading';
+		if (initPage) {
+			state.pageNum = 1;//如果是下拉刷新、重新查询 默认加载第一页
+		}
+		queryHonorTeacherListData({
+			queryStr:state.queryStr,
+			sortType:state.sortType
+		}).then(res=>{
+			if(res.code == 200){
+				const recordsData = res?.data || [];
+				const total = recordsData.length;//总数
+				const pages = Math.ceil(total / state.pageSize);//总页数
+				state.pageList = initPage ? recordsData : [...state.pageList,...recordsData];
+				state.noMoreData = state.pageNum == pages;
+				state.pageNum++;
+			}
+		}).finally(()=>{
+			// uni.hideLoading();
+			state.isLoading = false;
+			state.isRefreshing = false;//下拉刷新未被触发
+			if(state.noMoreData){
+				state.loadStatus = 'no-more';
+			}else{
+				state.loadStatus = 'more';
+			}
+			//返回到页面顶部
+			if(initPage){
+				GoTop();
+			}
+		})
+	}
+	// 自定义下拉刷新被触发	 下拉刷新
+	const OnRefresh = () =>{
+		state.isRefreshing = true;//下拉刷新已经被触发
+		OnLoadData(true);
+	}
+	//滚动到底部/右边 触发上拉刷新
+	const OnLoadMore = () => {
+		if (state.isLoading || state.noMoreData) return;
+		OnLoadData(false);
+	}
+	//	滚动时触发
+	const OnScroll = (e) => {
+		state.oldScrollTop = e.detail.scrollTop;
+	}
+	//返回到顶部
+	const GoTop = () => {
+		// 解决view层不同步的问题
+		state.scrollTop = state.oldScrollTop;
+		nextTick(() => {
+			state.scrollTop = 0
+		});
+	}
+	//视频详情
+	const GoVideoDetails = (id) => {
+		// uni.navigateTo({
+		// 	url: `/pages/studentStudy/videoDetails?id=${id}`
+		// });
+	}
 </script>
 
-<style>
+<style lang="scss" scoped>
+	.page_content{
+		height: calc(100% - 448rpx);
+		.scroll_view_y{
+			height: 100%;
+			.refresh_loading{
+				padding: 10rpx 0;
+			}
+		}
+		.page_list{
+			display: flex;
+			width: 100%;
+			flex-wrap: wrap;
+			gap:22rpx;
+			.list_item{
+				&:nth-child(1){
+					margin-top: 0rpx;
+				}
+				&:nth-child(2){
+					margin-top: 0rpx;
+				}
+				width: calc((100% - 22rpx) / 2);
+				// min-height: 280rpx;
+				padding: 16rpx 12rpx 18rpx 16rpx;
+				background-color: #F8FAFE;
+				border-radius: 16rpx;
+				border: 2rpx solid #EBEEF5;
+				box-sizing: border-box;
+				margin-top: 24rpx;
+				overflow: hidden;
+				display: flex;
+				flex-direction: column;
+				.teacher_name{
+					display: flex;
+					width: 100%;
+					align-items: center;
+					.icon{
+						width: 40rpx;
+						height: 40rpx;
+						margin-right: 16rpx;
+						flex-shrink: 0;
+					}
+					.name{
+						font-weight: 500;
+						font-size: 36rpx;
+						color: #333333;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+					}
+				}
+				.honor_count{
+					display: flex;
+					flex-wrap: wrap;
+					align-items: center;
+					width: 100%;
+					margin-top: 8rpx;
+					font-weight: 500;
+					font-size: 28rpx;
+					color: #666666;
+					.count{
+						color: #2E64FA;
+						margin:0 8rpx;
+					}
+				}
+				.honor_desc{
+					display: -webkit-box;
+					-webkit-line-clamp: 2;
+					-webkit-box-orient: vertical;
+					overflow: hidden;
+					text-overflow: ellipsis;
+					flex-wrap: wrap;
+					word-break: break-all;
+					width: 100%;
+					margin-top: 16rpx;
+					font-weight: 400;
+					font-size: 28rpx;
+					color: #999999;
+				}
+				.honor_date{
+					width: 100%;
+					display: flex;
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #999999;
+					margin-top: 18rpx;
+				}
+			}
+		}
+		
+	}
 </style>

+ 18 - 0
reqApi/teacherHonor.js

@@ -6,4 +6,22 @@ export function queryHonorTypeOverView(data) {//查询荣誉总览列表数据
 }
 export function deleteHonorType(id) {//删除荣誉类型接口
 	return request.get(`/api/v1/deleteHonorType/${id}`)
+}
+export function querySchoolAllTeacherData(data) {//查询审核教师接口
+	return request.get('/api/v1/querySchoolAllTeacherData',data)
+}
+export function baseDictLibListData(data) {//查询字典接口
+	return request.get('/api/v1/baseDictLibListData',data)
+}
+export function queryHonorDetailData(honorTypeId) {//获取荣誉类型 修改的 详细数据接口
+	return request.get(`/api/v1/queryHonorDetailData/${honorTypeId}`)
+}
+export function addHonorData(data) {//新增荣誉类型
+	return request.post('/api/v1/addHonorData',data)
+}
+export function updateHonorData(data) {//修改荣誉类型接口
+	return request.post('/api/v1/updateHonorData',data)
+}
+export function queryHonorTeacherListData(data) {//查询荣誉教师列表接口
+	return request.get('/api/v1/queryHonorTeacherListData',data)
 }

TEMPAT SAMPAH
static/image/icon/person.png


+ 49 - 11
style/common.scss

@@ -434,7 +434,7 @@ uni-page-body {
 		display: flex;
 		width: 100%;
 		gap: 32rpx;
-		padding:24rpx;
+		padding:24rpx 24rpx 0;
 		box-sizing: border-box;
 		background-color: #FFFFFF;
 	
@@ -463,7 +463,7 @@ uni-page-body {
 .scroll_tabs {
 	display: flex;
 	height: 56rpx;
-	padding: 0 24rpx;
+	padding: 24rpx 24rpx 0;
 	.tab_item {
 		display: inline-flex;
 		font-weight: 400;
@@ -511,24 +511,30 @@ uni-page-body {
 }
 //表单样式
 .forms_style {
+	width: 100%;
+	display: flex;
+	flex-direction: column;
 	.uni-forms-item {
-		margin-bottom: 30rpx !important;
-		&:last-child {
-			margin-bottom: 0 !important;
+		&.uni-forms-item--border{
+			padding: 24rpx 0;
+			border-top: 2rpx solid #F3F3F3;
 		}
 		.uni-forms-item__label {
-			color: #333333;
+			font-weight: 400;
 			font-size: 28rpx;
+			color: #666666;
 			height: 72rpx;
-			padding: 0 8rpx 0 0;
+			padding: 0;
 		}
 		.uni-forms-item__content {
+			font-weight: 400;
 			font-size: 28rpx;
 			color: #333333;
 			//输入框
 			.uni-easyinput {
+				font-size: 28rpx;
 				.is-input-border {
-					border: 1px solid #ebeef5;
+					border: 2rpx solid #E9E9E9 !important;
 					border-radius: 8rpx;
 				}
 				.is-disabled {
@@ -537,9 +543,12 @@ uni-page-body {
 				}
 				.uni-easyinput__content-input {
 					height: 72rpx;
+					min-height:72rpx;
 					font-size: 28rpx;
+					padding-left:24rpx !important;
 					.uni-easyinput__placeholder-class {
 						font-size: 28rpx;
+						color: #909399 ;
 					}
 				}
 				.content-clear-icon {
@@ -547,16 +556,45 @@ uni-page-body {
 					padding: 0 10rpx;
 				}
 			}
+			//checkbox  单选 多选
+			.uni-data-checklist {
+				.checklist-group {
+					.checklist-box{
+						margin: 12rpx 0;
+						margin-right: 24rpx;
+						.radio__inner{
+							width: 32rpx;
+							height: 32rpx;
+							border: 2rpx solid rgba(0,0,0,0.2);
+							border-radius: 32rpx;
+							.radio__inner-icon{
+								width: 20rpx;
+								height: 20rpx;
+								border-radius: 20rpx;
+							}
+						}
+						.checklist-content {
+							.checklist-text{
+								font-weight: 400;
+								font-size: 28rpx;
+								color: #333333;
+								margin-left: 8rpx;
+								line-height: 28rpx;
+							}
+						}
+					}
+				}
+			}
 			//单选框
 			.uni-stat__select {
 				.uni-select {
 					font-size: 28rpx;
-					border: 1px solid #ebeef5;
+					border: 2rpx solid #DCDFE6;
 					border-radius: 8rpx;
 					height: 72rpx;
 					min-height: 72rpx;
 					box-sizing: border-box;
-					padding: 0 10rpx;
+					padding: 0 16rpx 0 24rpx;
 					.uni-select__input-box {
 						height: 72rpx;
 						.uni-select__input-text {
@@ -564,7 +602,7 @@ uni-page-body {
 							color: #333333;
 							&.uni-select__input-placeholder {
 								font-size: 28rpx;
-								color: #999999;
+								color: #909399;
 							}
 						}
 						.tag-calss {

+ 51 - 0
uni_modules/uni-data-checkbox/changelog.md

@@ -0,0 +1,51 @@
+## 1.0.6(2024-10-22)
+- 新增 当 multiple 为 false 且传递的 value 为 数组时,使用数组第一项用作反显
+## 1.0.5(2024-03-20)
+- 修复 单选模式下选中样式不生效的bug
+## 1.0.4(2024-01-27)
+- 修复 修复错别字chagne为change
+## 1.0.3(2022-09-16)
+- 可以使用 uni-scss 控制主题色
+## 1.0.2(2022-06-30)
+- 优化 在 uni-forms 中的依赖注入方式
+## 1.0.1(2022-02-07)
+- 修复 multiple 为 true 时,v-model 的值为 null 报错的 bug
+## 1.0.0(2021-11-19)
+- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
+- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-data-checkbox](https://uniapp.dcloud.io/component/uniui/uni-data-checkbox)
+## 0.2.5(2021-08-23)
+- 修复 在uni-forms中 modelValue 中不存在当前字段,当前字段必填写也不参与校验的问题
+## 0.2.4(2021-08-17)
+- 修复 单选 list 模式下 ,icon 为 left 时,选中图标不显示的问题
+## 0.2.3(2021-08-11)
+- 修复 在 uni-forms 中重置表单,错误信息无法清除的问题
+## 0.2.2(2021-07-30)
+- 优化 在uni-forms组件,与label不对齐的问题
+## 0.2.1(2021-07-27)
+- 修复 单选默认值为0不能选中的Bug
+## 0.2.0(2021-07-13)
+- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
+## 0.1.11(2021-07-06)
+- 优化 删除无用日志
+## 0.1.10(2021-07-05)
+- 修复 由 0.1.9 引起的非 nvue 端图标不显示的问题
+## 0.1.9(2021-07-05)
+- 修复 nvue 黑框样式问题
+## 0.1.8(2021-06-28)
+- 修复 selectedTextColor 属性不生效的Bug
+## 0.1.7(2021-06-02)
+- 新增 map 属性,可以方便映射text/value属性
+## 0.1.6(2021-05-26)
+- 修复 不关联服务空间的情况下组件报错的Bug
+## 0.1.5(2021-05-12)
+- 新增 组件示例地址
+## 0.1.4(2021-04-09)
+- 修复 nvue 下无法选中的问题
+## 0.1.3(2021-03-22)
+- 新增 disabled属性
+## 0.1.2(2021-02-24)
+- 优化 默认颜色显示
+## 0.1.1(2021-02-24)
+- 新增 支持nvue
+## 0.1.0(2021-02-18)
+- “暂无数据”显示居中

+ 316 - 0
uni_modules/uni-data-checkbox/components/uni-data-checkbox/clientdb.js

@@ -0,0 +1,316 @@
+
+const events = {
+	load: 'load',
+	error: 'error'
+}
+const pageMode = {
+	add: 'add',
+	replace: 'replace'
+}
+
+const attrs = [
+	'pageCurrent',
+	'pageSize',
+	'collection',
+	'action',
+	'field',
+	'getcount',
+	'orderby',
+	'where'
+]
+
+export default {
+	data() {
+		return {
+			loading: false,
+			listData: this.getone ? {} : [],
+			paginationInternal: {
+				current: this.pageCurrent,
+				size: this.pageSize,
+				count: 0
+			},
+			errorMessage: ''
+		}
+	},
+	created() {
+		let db = null;
+		let dbCmd = null;
+
+		if(this.collection){
+			this.db = uniCloud.database();
+			this.dbCmd = this.db.command;
+		}
+
+		this._isEnded = false
+
+		this.$watch(() => {
+			let al = []
+			attrs.forEach(key => {
+				al.push(this[key])
+			})
+			return al
+		}, (newValue, oldValue) => {
+			this.paginationInternal.pageSize = this.pageSize
+
+			let needReset = false
+			for (let i = 2; i < newValue.length; i++) {
+				if (newValue[i] != oldValue[i]) {
+					needReset = true
+					break
+				}
+			}
+			if (needReset) {
+				this.clear()
+				this.reset()
+			}
+			if (newValue[0] != oldValue[0]) {
+				this.paginationInternal.current = this.pageCurrent
+			}
+
+			this._execLoadData()
+		})
+
+		// #ifdef H5
+		if (process.env.NODE_ENV === 'development') {
+			this._debugDataList = []
+			if (!window.unidev) {
+				window.unidev = {
+					clientDB: {
+						data: []
+					}
+				}
+			}
+			unidev.clientDB.data.push(this._debugDataList)
+		}
+		// #endif
+
+		// #ifdef MP-TOUTIAO
+		let changeName
+		let events = this.$scope.dataset.eventOpts
+		for (let i = 0; i < events.length; i++) {
+			let event = events[i]
+			if (event[0].includes('^load')) {
+				changeName = event[1][0][0]
+			}
+		}
+		if (changeName) {
+			let parent = this.$parent
+			let maxDepth = 16
+			this._changeDataFunction = null
+			while (parent && maxDepth > 0) {
+				let fun = parent[changeName]
+				if (fun && typeof fun === 'function') {
+					this._changeDataFunction = fun
+					maxDepth = 0
+					break
+				}
+				parent = parent.$parent
+				maxDepth--;
+			}
+		}
+		// #endif
+
+		// if (!this.manual) {
+		// 	this.loadData()
+		// }
+	},
+	// #ifdef H5
+	beforeDestroy() {
+		if (process.env.NODE_ENV === 'development' && window.unidev) {
+			let cd = this._debugDataList
+			let dl = unidev.clientDB.data
+			for (let i = dl.length - 1; i >= 0; i--) {
+				if (dl[i] === cd) {
+					dl.splice(i, 1)
+					break
+				}
+			}
+		}
+	},
+	// #endif
+	methods: {
+		loadData(args1, args2) {
+			let callback = null
+			if (typeof args1 === 'object') {
+				if (args1.clear) {
+					this.clear()
+					this.reset()
+				}
+				if (args1.current !== undefined) {
+					this.paginationInternal.current = args1.current
+				}
+				if (typeof args2 === 'function') {
+					callback = args2
+				}
+			} else if (typeof args1 === 'function') {
+				callback = args1
+			}
+
+			this._execLoadData(callback)
+		},
+		loadMore() {
+			if (this._isEnded) {
+				return
+			}
+			this._execLoadData()
+		},
+		refresh() {
+			this.clear()
+			this._execLoadData()
+		},
+		clear() {
+			this._isEnded = false
+			this.listData = []
+		},
+		reset() {
+			this.paginationInternal.current = 1
+		},
+		remove(id, {
+			action,
+			callback,
+			confirmTitle,
+			confirmContent
+		} = {}) {
+			if (!id || !id.length) {
+				return
+			}
+			uni.showModal({
+				title: confirmTitle || '提示',
+				content: confirmContent || '是否删除该数据',
+				showCancel: true,
+				success: (res) => {
+					if (!res.confirm) {
+						return
+					}
+					this._execRemove(id, action, callback)
+				}
+			})
+		},
+		_execLoadData(callback) {
+			if (this.loading) {
+				return
+			}
+			this.loading = true
+			this.errorMessage = ''
+
+			this._getExec().then((res) => {
+				this.loading = false
+				const {
+					data,
+					count
+				} = res.result
+				this._isEnded = data.length < this.pageSize
+
+				callback && callback(data, this._isEnded)
+				this._dispatchEvent(events.load, data)
+
+				if (this.getone) {
+					this.listData = data.length ? data[0] : undefined
+				} else if (this.pageData === pageMode.add) {
+					this.listData.push(...data)
+					if (this.listData.length) {
+						this.paginationInternal.current++
+					}
+				} else if (this.pageData === pageMode.replace) {
+					this.listData = data
+					this.paginationInternal.count = count
+				}
+
+				// #ifdef H5
+				if (process.env.NODE_ENV === 'development') {
+					this._debugDataList.length = 0
+					this._debugDataList.push(...JSON.parse(JSON.stringify(this.listData)))
+				}
+				// #endif
+			}).catch((err) => {
+				this.loading = false
+				this.errorMessage = err
+				callback && callback()
+				this.$emit(events.error, err)
+			})
+		},
+		_getExec() {
+			let exec = this.db
+			if (this.action) {
+				exec = exec.action(this.action)
+			}
+
+			exec = exec.collection(this.collection)
+
+			if (!(!this.where || !Object.keys(this.where).length)) {
+				exec = exec.where(this.where)
+			}
+			if (this.field) {
+				exec = exec.field(this.field)
+			}
+			if (this.orderby) {
+				exec = exec.orderBy(this.orderby)
+			}
+
+			const {
+				current,
+				size
+			} = this.paginationInternal
+			exec = exec.skip(size * (current - 1)).limit(size).get({
+				getCount: this.getcount
+			})
+
+			return exec
+		},
+		_execRemove(id, action, callback) {
+			if (!this.collection || !id) {
+				return
+			}
+
+			const ids = Array.isArray(id) ? id : [id]
+			if (!ids.length) {
+				return
+			}
+
+			uni.showLoading({
+				mask: true
+			})
+
+			let exec = this.db
+			if (action) {
+				exec = exec.action(action)
+			}
+
+			exec.collection(this.collection).where({
+				_id: dbCmd.in(ids)
+			}).remove().then((res) => {
+				callback && callback(res.result)
+				if (this.pageData === pageMode.replace) {
+					this.refresh()
+				} else {
+					this.removeData(ids)
+				}
+			}).catch((err) => {
+				uni.showModal({
+					content: err.message,
+					showCancel: false
+				})
+			}).finally(() => {
+				uni.hideLoading()
+			})
+		},
+		removeData(ids) {
+			let il = ids.slice(0)
+			let dl = this.listData
+			for (let i = dl.length - 1; i >= 0; i--) {
+				let index = il.indexOf(dl[i]._id)
+				if (index >= 0) {
+					dl.splice(i, 1)
+					il.splice(index, 1)
+				}
+			}
+		},
+		_dispatchEvent(type, data) {
+			if (this._changeDataFunction) {
+				this._changeDataFunction(data, this._isEnded)
+			} else {
+				this.$emit(type, data, this._isEnded)
+			}
+		}
+	}
+}

+ 853 - 0
uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue

@@ -0,0 +1,853 @@
+<template>
+	<view class="uni-data-checklist" :style="{'margin-top':isTop+'px'}">
+		<template v-if="!isLocal">
+			<view class="uni-data-loading">
+				<uni-load-more v-if="!mixinDatacomErrorMessage" status="loading" iconType="snow" :iconSize="18"
+					:content-text="contentText"></uni-load-more>
+				<text v-else>{{mixinDatacomErrorMessage}}</text>
+			</view>
+		</template>
+		<template v-else>
+			<checkbox-group v-if="multiple" class="checklist-group" :class="{'is-list':mode==='list' || wrap}"
+				@change="change">
+				<label class="checklist-box"
+					:class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
+					:style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
+					<checkbox class="hidden" hidden :disabled="disabled || !!item.disabled" :value="item[map.value]+''"
+						:checked="item.selected" />
+					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')"
+						class="checkbox__inner" :style="item.styleIcon">
+						<view class="checkbox__inner-icon"></view>
+					</view>
+					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
+						<text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text>
+						<view v-if="mode === 'list' && icon === 'right'" class="checkobx__list" :style="item.styleBackgroud"></view>
+					</view>
+				</label>
+			</checkbox-group>
+			<radio-group v-else class="checklist-group" :class="{'is-list':mode==='list','is-wrap':wrap}" @change="change">
+				<label class="checklist-box"
+					:class="['is--'+mode,item.selected?'is-checked':'',(disabled || !!item.disabled)?'is-disable':'',index!==0&&mode==='list'?'is-list-border':'']"
+					:style="item.styleBackgroud" v-for="(item,index) in dataList" :key="index">
+					<radio class="hidden" hidden :disabled="disabled || item.disabled" :value="item[map.value]+''"
+						:checked="item.selected" />
+					<view v-if="(mode !=='tag' && mode !== 'list') || ( mode === 'list' && icon === 'left')" class="radio__inner"
+						:style="item.styleBackgroud">
+						<view class="radio__inner-icon" :style="item.styleIcon"></view>
+					</view>
+					<view class="checklist-content" :class="{'list-content':mode === 'list' && icon ==='left'}">
+						<text class="checklist-text" :style="item.styleIconText">{{item[map.text]}}</text>
+						<view v-if="mode === 'list' && icon === 'right'" :style="item.styleRightIcon" class="checkobx__list"></view>
+					</view>
+				</label>
+			</radio-group>
+		</template>
+	</view>
+</template>
+
+<script>
+	/**
+	 * DataChecklist 数据选择器
+	 * @description 通过数据渲染 checkbox 和 radio
+	 * @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
+	 * @property {String} mode = [default| list | button | tag] 显示模式
+	 * @value default  	默认横排模式
+	 * @value list		列表模式
+	 * @value button	按钮模式
+	 * @value tag 		标签模式
+	 * @property {Boolean} multiple = [true|false] 是否多选
+	 * @property {Array|String|Number} value 默认值
+	 * @property {Array} localdata 本地数据 ,格式 [{text:'',value:''}]
+	 * @property {Number|String} min 最小选择个数 ,multiple为true时生效
+	 * @property {Number|String} max 最大选择个数 ,multiple为true时生效
+	 * @property {Boolean} wrap 是否换行显示
+	 * @property {String} icon = [left|right]  list 列表模式下icon显示位置
+	 * @property {Boolean} selectedColor 选中颜色
+	 * @property {Boolean} emptyText 没有数据时显示的文字 ,本地数据无效
+	 * @property {Boolean} selectedTextColor 选中文本颜色,如不填写则自动显示
+	 * @property {Object} map 字段映射, 默认 map={text:'text',value:'value'}
+	 * @value left 左侧显示
+	 * @value right 右侧显示
+	 * @event {Function} change  选中发生变化触发
+	 */
+
+	export default {
+		name: 'uniDataChecklist',
+		mixins: [uniCloud.mixinDatacom || {}],
+		emits: ['input', 'update:modelValue', 'change'],
+		props: {
+			mode: {
+				type: String,
+				default: 'default'
+			},
+
+			multiple: {
+				type: Boolean,
+				default: false
+			},
+			value: {
+				type: [Array, String, Number],
+				default () {
+					return ''
+				}
+			},
+			// TODO vue3
+			modelValue: {
+				type: [Array, String, Number],
+				default () {
+					return '';
+				}
+			},
+			localdata: {
+				type: Array,
+				default () {
+					return []
+				}
+			},
+			min: {
+				type: [Number, String],
+				default: ''
+			},
+			max: {
+				type: [Number, String],
+				default: ''
+			},
+			wrap: {
+				type: Boolean,
+				default: false
+			},
+			icon: {
+				type: String,
+				default: 'left'
+			},
+			selectedColor: {
+				type: String,
+				default: ''
+			},
+			selectedTextColor: {
+				type: String,
+				default: ''
+			},
+			emptyText: {
+				type: String,
+				default: '暂无数据'
+			},
+			disabled: {
+				type: Boolean,
+				default: false
+			},
+			map: {
+				type: Object,
+				default () {
+					return {
+						text: 'text',
+						value: 'value'
+					}
+				}
+			}
+		},
+		watch: {
+			localdata: {
+				handler(newVal) {
+					this.range = newVal
+					this.dataList = this.getDataList(this.getSelectedValue(newVal))
+				},
+				deep: true
+			},
+			mixinDatacomResData(newVal) {
+				this.range = newVal
+				this.dataList = this.getDataList(this.getSelectedValue(newVal))
+			},
+			value(newVal) {
+				this.dataList = this.getDataList(newVal)
+				// fix by mehaotian is_reset 在 uni-forms 中定义
+				// if(!this.is_reset){
+				// 	this.is_reset = false
+				// 	this.formItem && this.formItem.setValue(newVal)
+				// }
+			},
+			modelValue(newVal) {
+				this.dataList = this.getDataList(newVal);
+				// if(!this.is_reset){
+				// 	this.is_reset = false
+				// 	this.formItem && this.formItem.setValue(newVal)
+				// }
+			}
+		},
+		data() {
+			return {
+				dataList: [],
+				range: [],
+				contentText: {
+					contentdown: '查看更多',
+					contentrefresh: '加载中',
+					contentnomore: '没有更多'
+				},
+				isLocal: true,
+				styles: {
+					selectedColor: '#2979ff',
+					selectedTextColor: '#666',
+				},
+				isTop: 0
+			};
+		},
+		computed: {
+			dataValue() {
+				if (this.value === '') return this.modelValue
+				if (this.modelValue === '') return this.value
+				return this.value
+			}
+		},
+		created() {
+			// this.form = this.getForm('uniForms')
+			// this.formItem = this.getForm('uniFormsItem')
+			// this.formItem && this.formItem.setValue(this.value)
+
+			// if (this.formItem) {
+			// 	this.isTop = 6
+			// 	if (this.formItem.name) {
+			// 		// 如果存在name添加默认值,否则formData 中不存在这个字段不校验
+			// 		if(!this.is_reset){
+			// 			this.is_reset = false
+			// 			this.formItem.setValue(this.dataValue)
+			// 		}
+			// 		this.rename = this.formItem.name
+			// 		this.form.inputChildrens.push(this)
+			// 	}
+			// }
+
+			if (this.localdata && this.localdata.length !== 0) {
+				this.isLocal = true
+				this.range = this.localdata
+				this.dataList = this.getDataList(this.getSelectedValue(this.range))
+			} else {
+				if (this.collection) {
+					this.isLocal = false
+					this.loadData()
+				}
+			}
+		},
+		methods: {
+			loadData() {
+				this.mixinDatacomGet().then(res => {
+					this.mixinDatacomResData = res.result.data
+					if (this.mixinDatacomResData.length === 0) {
+						this.isLocal = false
+						this.mixinDatacomErrorMessage = this.emptyText
+					} else {
+						this.isLocal = true
+					}
+				}).catch(err => {
+					this.mixinDatacomErrorMessage = err.message
+				})
+			},
+			/**
+			 * 获取父元素实例
+			 */
+			getForm(name = 'uniForms') {
+				let parent = this.$parent;
+				let parentName = parent.$options.name;
+				while (parentName !== name) {
+					parent = parent.$parent;
+					if (!parent) return false
+					parentName = parent.$options.name;
+				}
+				return parent;
+			},
+			change(e) {
+				const values = e.detail.value
+
+				let detail = {
+					value: [],
+					data: []
+				}
+
+				if (this.multiple) {
+					this.range.forEach(item => {
+
+						if (values.includes(item[this.map.value] + '')) {
+							detail.value.push(item[this.map.value])
+							detail.data.push(item)
+						}
+					})
+				} else {
+					const range = this.range.find(item => (item[this.map.value] + '') === values)
+					if (range) {
+						detail = {
+							value: range[this.map.value],
+							data: range
+						}
+					}
+				}
+				// this.formItem && this.formItem.setValue(detail.value)
+				// TODO 兼容 vue2
+				this.$emit('input', detail.value);
+				// // TOTO 兼容 vue3
+				this.$emit('update:modelValue', detail.value);
+				this.$emit('change', {
+					detail
+				})
+				if (this.multiple) {
+					// 如果 v-model 没有绑定 ,则走内部逻辑
+					// if (this.value.length === 0) {
+					this.dataList = this.getDataList(detail.value, true)
+					// }
+				} else {
+					this.dataList = this.getDataList(detail.value)
+				}
+			},
+
+			/**
+			 * 获取渲染的新数组
+			 * @param {Object} value 选中内容
+			 */
+			getDataList(value) {
+				// 解除引用关系,破坏原引用关系,避免污染源数据
+				let dataList = JSON.parse(JSON.stringify(this.range))
+				let list = []
+				if (this.multiple) {
+					if (!Array.isArray(value)) {
+						value = []
+					}
+				} else {
+					if (Array.isArray(value) && value.length) {
+						value = value[0]
+					}
+				}
+				dataList.forEach((item, index) => {
+					item.disabled = item.disable || item.disabled || false
+					if (this.multiple) {
+						if (value.length > 0) {
+							let have = value.find(val => val === item[this.map.value])
+							item.selected = have !== undefined
+						} else {
+							item.selected = false
+						}
+					} else {
+						item.selected = value === item[this.map.value]
+					}
+
+					list.push(item)
+				})
+				return this.setRange(list)
+			},
+			/**
+			 * 处理最大最小值
+			 * @param {Object} list
+			 */
+			setRange(list) {
+				let selectList = list.filter(item => item.selected)
+				let min = Number(this.min) || 0
+				let max = Number(this.max) || ''
+				list.forEach((item, index) => {
+					if (this.multiple) {
+						if (selectList.length <= min) {
+							let have = selectList.find(val => val[this.map.value] === item[this.map.value])
+							if (have !== undefined) {
+								item.disabled = true
+							}
+						}
+
+						if (selectList.length >= max && max !== '') {
+							let have = selectList.find(val => val[this.map.value] === item[this.map.value])
+							if (have === undefined) {
+								item.disabled = true
+							}
+						}
+					}
+					this.setStyles(item, index)
+					list[index] = item
+				})
+				return list
+			},
+			/**
+			 * 设置 class
+			 * @param {Object} item
+			 * @param {Object} index
+			 */
+			setStyles(item, index) {
+				//  设置自定义样式
+				item.styleBackgroud = this.setStyleBackgroud(item)
+				item.styleIcon = this.setStyleIcon(item)
+				item.styleIconText = this.setStyleIconText(item)
+				item.styleRightIcon = this.setStyleRightIcon(item)
+			},
+
+			/**
+			 * 获取选中值
+			 * @param {Object} range
+			 */
+			getSelectedValue(range) {
+				if (!this.multiple) return this.dataValue
+				let selectedArr = []
+				range.forEach((item) => {
+					if (item.selected) {
+						selectedArr.push(item[this.map.value])
+					}
+				})
+				return this.dataValue.length > 0 ? this.dataValue : selectedArr
+			},
+
+			/**
+			 * 设置背景样式
+			 */
+			setStyleBackgroud(item) {
+				let styles = {}
+				let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
+				if (this.selectedColor) {
+					if (this.mode !== 'list') {
+						styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
+					}
+					if (this.mode === 'tag') {
+						styles['background-color'] = item.selected ? selectedColor : '#f5f5f5'
+					}
+				}
+				let classles = ''
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+				return classles
+			},
+			setStyleIcon(item) {
+				let styles = {}
+				let classles = ''
+				if (this.selectedColor) {
+					let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
+					styles['background-color'] = item.selected ? selectedColor : '#fff'
+					styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
+
+					if (!item.selected && item.disabled) {
+						styles['background-color'] = '#F2F6FC'
+						styles['border-color'] = item.selected ? selectedColor : '#DCDFE6'
+					}
+				}
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+				return classles
+			},
+			setStyleIconText(item) {
+				let styles = {}
+				let classles = ''
+				if (this.selectedColor) {
+					let selectedColor = this.selectedColor ? this.selectedColor : '#2979ff'
+					if (this.mode === 'tag') {
+						styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : '#fff') : '#666'
+					} else {
+						styles.color = item.selected ? (this.selectedTextColor ? this.selectedTextColor : selectedColor) : '#666'
+					}
+					if (!item.selected && item.disabled) {
+						styles.color = '#999'
+					}
+				}
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+				return classles
+			},
+			setStyleRightIcon(item) {
+				let styles = {}
+				let classles = ''
+				if (this.mode === 'list') {
+					styles['border-color'] = item.selected ? this.styles.selectedColor : '#DCDFE6'
+				}
+				for (let i in styles) {
+					classles += `${i}:${styles[i]};`
+				}
+
+				return classles
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	$uni-primary: #2979ff !default;
+	$border-color: #DCDFE6;
+	$disable: 0.4;
+
+	@mixin flex {
+		/* #ifndef APP-NVUE */
+		display: flex;
+		/* #endif */
+	}
+
+	.uni-data-loading {
+		@include flex;
+		flex-direction: row;
+		justify-content: center;
+		align-items: center;
+		height: 36px;
+		padding-left: 10px;
+		color: #999;
+	}
+
+	.uni-data-checklist {
+		position: relative;
+		z-index: 0;
+		flex: 1;
+
+		// 多选样式
+		.checklist-group {
+			@include flex;
+			flex-direction: row;
+			flex-wrap: wrap;
+
+			&.is-list {
+				flex-direction: column;
+			}
+
+			.checklist-box {
+				@include flex;
+				flex-direction: row;
+				align-items: center;
+				position: relative;
+				margin: 5px 0;
+				margin-right: 25px;
+
+				.hidden {
+					position: absolute;
+					opacity: 0;
+				}
+
+				// 文字样式
+				.checklist-content {
+					@include flex;
+					flex: 1;
+					flex-direction: row;
+					align-items: center;
+					justify-content: space-between;
+
+					.checklist-text {
+						font-size: 14px;
+						color: #666;
+						margin-left: 5px;
+						line-height: 14px;
+					}
+
+					.checkobx__list {
+						border-right-width: 1px;
+						border-right-color: #007aff;
+						border-right-style: solid;
+						border-bottom-width: 1px;
+						border-bottom-color: #007aff;
+						border-bottom-style: solid;
+						height: 12px;
+						width: 6px;
+						left: -5px;
+						transform-origin: center;
+						transform: rotate(45deg);
+						opacity: 0;
+					}
+				}
+
+				// 多选样式
+				.checkbox__inner {
+					/* #ifndef APP-NVUE */
+					flex-shrink: 0;
+					box-sizing: border-box;
+					/* #endif */
+					position: relative;
+					width: 16px;
+					height: 16px;
+					border: 1px solid $border-color;
+					border-radius: 4px;
+					background-color: #fff;
+					z-index: 1;
+
+					.checkbox__inner-icon {
+						position: absolute;
+						/* #ifdef APP-NVUE */
+						top: 2px;
+						/* #endif */
+						/* #ifndef APP-NVUE */
+						top: 1px;
+						/* #endif */
+						left: 5px;
+						height: 8px;
+						width: 4px;
+						border-right-width: 1px;
+						border-right-color: #fff;
+						border-right-style: solid;
+						border-bottom-width: 1px;
+						border-bottom-color: #fff;
+						border-bottom-style: solid;
+						opacity: 0;
+						transform-origin: center;
+						transform: rotate(40deg);
+					}
+				}
+
+				// 单选样式
+				.radio__inner {
+					@include flex;
+					/* #ifndef APP-NVUE */
+					flex-shrink: 0;
+					box-sizing: border-box;
+					/* #endif */
+					justify-content: center;
+					align-items: center;
+					position: relative;
+					width: 16px;
+					height: 16px;
+					border: 1px solid $border-color;
+					border-radius: 16px;
+					background-color: #fff;
+					z-index: 1;
+
+					.radio__inner-icon {
+						width: 8px;
+						height: 8px;
+						border-radius: 10px;
+						opacity: 0;
+					}
+				}
+
+				// 默认样式
+				&.is--default {
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+
+						/* #endif */
+						.checkbox__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+
+						.radio__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+						}
+
+						.checklist-text {
+							color: #999;
+						}
+					}
+
+					// 选中
+					&.is-checked {
+						.checkbox__inner {
+							border-color: $uni-primary;
+							background-color: $uni-primary;
+
+							.checkbox__inner-icon {
+								opacity: 1;
+								transform: rotate(45deg);
+							}
+						}
+
+						.radio__inner {
+							border-color: $uni-primary;
+
+							.radio__inner-icon {
+								opacity: 1;
+								background-color: $uni-primary;
+							}
+						}
+
+						.checklist-text {
+							color: $uni-primary;
+						}
+
+						// 选中禁用
+						&.is-disable {
+							.checkbox__inner {
+								opacity: $disable;
+							}
+
+							.checklist-text {
+								opacity: $disable;
+							}
+
+							.radio__inner {
+								opacity: $disable;
+							}
+						}
+					}
+				}
+
+				// 按钮样式
+				&.is--button {
+					margin-right: 10px;
+					padding: 5px 10px;
+					border: 1px $border-color solid;
+					border-radius: 3px;
+					transition: border-color 0.2s;
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+						/* #endif */
+						border: 1px #eee solid;
+						opacity: $disable;
+
+						.checkbox__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+
+						.radio__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+
+						.checklist-text {
+							color: #999;
+						}
+					}
+
+					&.is-checked {
+						border-color: $uni-primary;
+
+						.checkbox__inner {
+							border-color: $uni-primary;
+							background-color: $uni-primary;
+
+							.checkbox__inner-icon {
+								opacity: 1;
+								transform: rotate(45deg);
+							}
+						}
+
+						.radio__inner {
+							border-color: $uni-primary;
+
+							.radio__inner-icon {
+								opacity: 1;
+								background-color: $uni-primary;
+							}
+						}
+
+						.checklist-text {
+							color: $uni-primary;
+						}
+
+						// 选中禁用
+						&.is-disable {
+							opacity: $disable;
+						}
+					}
+				}
+
+				// 标签样式
+				&.is--tag {
+					margin-right: 10px;
+					padding: 5px 10px;
+					border: 1px $border-color solid;
+					border-radius: 3px;
+					background-color: #f5f5f5;
+
+					.checklist-text {
+						margin: 0;
+						color: #666;
+					}
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+						/* #endif */
+						opacity: $disable;
+					}
+
+					&.is-checked {
+						background-color: $uni-primary;
+						border-color: $uni-primary;
+
+						.checklist-text {
+							color: #fff;
+						}
+					}
+				}
+
+				// 列表样式
+				&.is--list {
+					/* #ifndef APP-NVUE */
+					display: flex;
+					/* #endif */
+					padding: 10px 15px;
+					padding-left: 0;
+					margin: 0;
+
+					&.is-list-border {
+						border-top: 1px #eee solid;
+					}
+
+					// 禁用
+					&.is-disable {
+						/* #ifdef H5 */
+						cursor: not-allowed;
+
+						/* #endif */
+						.checkbox__inner {
+							background-color: #F2F6FC;
+							border-color: $border-color;
+							/* #ifdef H5 */
+							cursor: not-allowed;
+							/* #endif */
+						}
+
+						.checklist-text {
+							color: #999;
+						}
+					}
+
+					&.is-checked {
+						.checkbox__inner {
+							border-color: $uni-primary;
+							background-color: $uni-primary;
+
+							.checkbox__inner-icon {
+								opacity: 1;
+								transform: rotate(45deg);
+							}
+						}
+
+						.radio__inner {
+							border-color: $uni-primary;
+							.radio__inner-icon {
+								opacity: 1;
+								background-color: $uni-primary;
+							}
+						}
+
+						.checklist-text {
+							color: $uni-primary;
+						}
+
+						.checklist-content {
+							.checkobx__list {
+								opacity: 1;
+								border-color: $uni-primary;
+							}
+						}
+
+						// 选中禁用
+						&.is-disable {
+							.checkbox__inner {
+								opacity: $disable;
+							}
+
+							.checklist-text {
+								opacity: $disable;
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 87 - 0
uni_modules/uni-data-checkbox/package.json

@@ -0,0 +1,87 @@
+{
+  "id": "uni-data-checkbox",
+  "displayName": "uni-data-checkbox 数据选择器",
+  "version": "1.0.6",
+  "description": "通过数据驱动的单选框和复选框",
+  "keywords": [
+    "uni-ui",
+    "checkbox",
+    "单选",
+    "多选",
+    "单选多选"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": "^3.1.1"
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": ["uni-load-more","uni-scss"],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y",
+        "alipay": "n"
+      },
+      "client": {
+        "App": {
+            "app-vue": "y",
+            "app-nvue": "y",
+            "app-harmony": "u",
+            "app-uvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "y",
+          "百度": "y",
+          "字节跳动": "y",
+          "QQ": "y"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        },
+        "Vue": {
+            "vue2": "y",
+            "vue3": "y"
+        }
+      }
+    }
+  }
+}

+ 18 - 0
uni_modules/uni-data-checkbox/readme.md

@@ -0,0 +1,18 @@
+
+
+## DataCheckbox 数据驱动的单选复选框
+> **组件名:uni-data-checkbox**
+> 代码块: `uDataCheckbox`
+
+
+本组件是基于uni-app基础组件checkbox的封装。本组件要解决问题包括:
+
+1. 数据绑定型组件:给本组件绑定一个data,会自动渲染一组候选内容。再以往,开发者需要编写不少代码实现类似功能
+2. 自动的表单校验:组件绑定了data,且符合[uni-forms](https://ext.dcloud.net.cn/plugin?id=2773)组件的表单校验规范,搭配使用会自动实现表单校验
+3. 本组件合并了单选多选
+4. 本组件有若干风格选择,如普通的单选多选框、并列button风格、tag风格。开发者可以快速选择需要的风格。但作为一个封装组件,样式代码虽然不用自己写了,却会牺牲一定的样式自定义性
+
+在uniCloud开发中,`DB Schema`中配置了enum枚举等类型后,在web控制台的[自动生成表单](https://uniapp.dcloud.io/uniCloud/schema?id=autocode)功能中,会自动生成``uni-data-checkbox``组件并绑定好data
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-data-checkbox)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839 

+ 2 - 4
uni_modules/uni-load-more/changelog.md

@@ -1,9 +1,7 @@
+## 1.3.7(2025-08-20)
+- 修复 微信小程序css警告问题
 ## 1.3.6(2024-10-15)
 - 修复 微信小程序中的getSystemInfo警告
-## 1.3.5(2024-10-12)
-- 修复 微信小程序中的getSystemInfo警告
-## 1.3.4(2024-10-12)
-- 修复 微信小程序中的getSystemInfo警告
 ## 1.3.3(2022-01-20)
 - 新增 showText属性 ,是否显示文本
 ## 1.3.2(2022-01-19)

+ 2 - 3
uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue

@@ -26,7 +26,7 @@
 		<!-- #ifndef APP-NVUE -->
 		<view v-else-if="!webviewHide && status === 'loading' && showIcon"
 			:style="{width:iconSize+'px',height:iconSize+'px'}" class="uni-load-more__img uni-load-more__img--ios-H5">
-			<image :src="imgBase64" mode="widthFix"></image>
+			<image class="image" :src="imgBase64" mode="widthFix"></image>
 		</view>
 		<!-- #endif -->
 		<text v-if="showText" class="uni-load-more__text"
@@ -166,7 +166,6 @@
 		height: 40px;
 		align-items: center;
 		justify-content: center;
-		// background-color: #F8F9FD;
 	}
 
 	.uni-load-more__text {
@@ -211,7 +210,7 @@
 		animation: loading-ios-H5 1s 0s step-end infinite;
 	}
 
-	.uni-load-more__img--ios-H5 image {
+	.uni-load-more__img--ios-H5 .image {
 		position: absolute;
 		width: 100%;
 		height: 100%;

+ 60 - 39
uni_modules/uni-load-more/package.json

@@ -1,7 +1,7 @@
 {
   "id": "uni-load-more",
   "displayName": "uni-load-more 加载更多",
-  "version": "1.3.6",
+  "version": "1.3.7",
   "description": "LoadMore 组件,常用在列表里面,做滚动加载使用。",
   "keywords": [
     "uni-ui",
@@ -11,12 +11,14 @@
 ],
   "repository": "https://github.com/dcloudio/uni-ui",
   "engines": {
-    "HBuilderX": ""
+    "HBuilderX": "",
+    "uni-app": "^4.07",
+    "uni-app-x": ""
   },
   "directories": {
     "example": "../../temps/example_temps"
   },
-"dcloudext": {
+  "dcloudext": {
     "sale": {
       "regular": {
         "price": "0.00"
@@ -34,51 +36,70 @@
       "permissions": "无"
     },
     "npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
-    "type": "component-vue"
+    "type": "component-vue",
+    "darkmode": "x",
+    "i18n": "x",
+    "widescreen": "x"
   },
   "uni_modules": {
-    "dependencies": ["uni-scss"],
+    "dependencies": [
+      "uni-scss"
+    ],
     "encrypt": [],
     "platforms": {
       "cloud": {
-        "tcb": "y",
-        "aliyun": "y",
-        "alipay": "n"
+        "tcb": "x",
+        "aliyun": "x",
+        "alipay": "x"
       },
       "client": {
-        "App": {
-          "app-vue": "y",
-          "app-nvue": "y"
+        "uni-app": {
+          "vue": {
+            "vue2": "√",
+            "vue3": "√"
+          },
+          "web": {
+            "safari": "√",
+            "chrome": "√"
+          },
+          "app": {
+            "vue": "√",
+            "nvue": "-",
+            "android": "√",
+            "ios": "√",
+            "harmony": "√"
+          },
+          "mp": {
+            "weixin": "√",
+            "alipay": "√",
+            "toutiao": "√",
+            "baidu": "√",
+            "kuaishou": "-",
+            "jd": "-",
+            "harmony": "-",
+            "qq": "√",
+            "lark": "-"
+          },
+          "quickapp": {
+            "huawei": "√",
+            "union": "√"
+          }
         },
-        "H5-mobile": {
-          "Safari": "y",
-          "Android Browser": "y",
-          "微信浏览器(Android)": "y",
-          "QQ浏览器(Android)": "y"
-        },
-        "H5-pc": {
-          "Chrome": "y",
-          "IE": "y",
-          "Edge": "y",
-          "Firefox": "y",
-          "Safari": "y"
-        },
-        "小程序": {
-          "微信": "y",
-          "阿里": "y",
-          "百度": "y",
-          "字节跳动": "y",
-          "QQ": "y"
-        },
-        "快应用": {
-          "华为": "u",
-          "联盟": "u"
-        },
-        "Vue": {
-            "vue2": "y",
-            "vue3": "y"
+        "uni-app-x": {
+          "web": {
+            "safari": "-",
+            "chrome": "-"
+          },
+          "app": {
+            "android": "-",
+            "ios": "-",
+            "harmony": "-"
+          },
+          "mp": {
+            "weixin": "-"
+          }
         }
       }
     }
   }
-}
+}