| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- <template>
- <!-- 头部 -->
- <nav-bar height="120" backPath="workspace" title="教师专业发展" :showHeaderborder="true" :showFilterPicker="false" :showTabs="false" :onlyTitle="false" rightWidth="0rpx" @CommonFilterData="CommonFilterData"></nav-bar>
- <view class="page_content">
- <view class="count_list">
- <view class="count_item">
- <text class="title">全部荣誉</text>
- <text class="count">{{state.countList.honorCount}}</text>
- </view>
- <view class="count_item">
- <text class="title">待审核</text>
- <text class="count">{{state.countList.reViewCount}}</text>
- </view>
- <view class="count_item">
- <text class="title">已完成</text>
- <text class="count">{{state.countList.overCount}}</text>
- </view>
- <view class="count_item">
- <text class="title">已驳回</text>
- <text class="count">{{state.countList.overruleCount}}</text>
- </view>
- </view>
- <view class="list_title">
- <view class="title">荣誉类型</view>
- <view class="add_btn" @click="AddEditHonorType('add')">
- <uni-icons class="btn_icon" type="plusempty"></uni-icons>
- <text class="btn_text">新建类型</text>
- </view>
- </view>
- <view class="honor_list">
- <template v-if="state.tableData.length > 0">
- <view class="list_item" v-for="item in state.tableData" :key="item.honorTypeId" @click="HonorTypeAuditDetail(item.honorTypeId,item.reviewStatus,item.honorTypeName)">
- <view class="item_name">
- <text class="name">{{item.honorTypeName}}</text>
- <view class="more_icon" @click.stop="ShowMorePopupDialog(item.honorTypeName,item.honorTypeId,item.deleteStatus)">
- <uni-icons type="more-filled" style="color: #999999;font-size: 32rpx;"></uni-icons>
- </view>
- </view>
- <view class="item_sum">
- <image class="cup" src="@/static/image/icon/honor_cup.png"></image>
- <view class="sum">共{{item.number}}项</view>
- <template v-if="Number(item.reviewStatus) === 0">
- <image class="seal" src="@/static/image/icon/honor_seal.png"></image>
- <view class="audit">需审核</view>
- </template>
- </view>
- </view>
- </template>
- <noData v-if="!state.isLoading && state.tableData.length == 0" />
- </view>
- </view>
- <customPopupDialog 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">
- <image class="img" src="@/static/image/icon/edit.png"></image>
- <text class="text">编辑</text>
- </view>
- <uni-icons class="content_item_right" type="right" style="color: #333333;font-size: 36rpx;"></uni-icons>
- </view>
- <view class="content_item" v-if="state.popupDelDialog.deleteStatus!=1" @click="DeleteHonorTypeItem">
- <view class="content_item_left">
- <image class="img" src="@/static/image/icon/delete.png"></image>
- <text :class="['text',{'red':state.popupDelDialog.deleteStatus!=1,'disabled':state.popupDelDialog.deleteStatus==1}]">删除</text>
- </view>
- </view>
- </view>
- </customPopupDialog>
- <!-- 删除确认框 -->
- <popupDialog ref="popupDelDialogRef" :showFootBorder="true" :content="state.popupDelDialog.content" @DialogConfirm="DialogDelConfirm" />
- </template>
- <script setup>
- import navBar from '@/components/navBar.vue';
- import noData from '@/components/noData.vue';
- import customPopupDialog from '@/components/customPopupDialog.vue';
- import popupDialog from '@/components/popupDialog.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({
- queryStr: '',
- countList:{
- honorCount:'',//全部荣誉
- reViewCount:'',//待审核
- overCount:'',//已完成
- overruleCount:''//已驳回
- },
- isLoading:true,//加载中
- tableData:[],
- popupDialog:{
- title:'',
- id:'',//荣誉id
- deleteStatus:0//0 可删 1 不可删
- },
- popupDelDialog:{
- content:''
- }
- })
- //提示框
- 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({
- queryStr:state.queryStr
- }).then(res=>{
- if(res.code == 200 && res.data){
- const { honorCount, reViewCount, overCount, overruleCount,tableData } = res.data;
- state.countList.honorCount = honorCount || 0;
- state.countList.reViewCount = reViewCount || 0;
- state.countList.overCount = overCount || 0;
- state.countList.overruleCount = overruleCount || 0;
- state.tableData = tableData || [];
- }else{
- state.countList.honorCount = '';
- state.countList.reViewCount = '';
- state.countList.overCount = '';
- state.countList.overruleCount = '';
- state.tableData = [];
- }
- }).finally(()=>{
- state.isLoading = false;
- })
- }
- //搜索
- const CommonFilterData = (filterOptions,type) => {
- if(type=='search'){
- state.queryStr = filterOptions.searchWord;
- OnLoadData();
- }
- }
- //编辑 删除
- const ShowMorePopupDialog = (title,id,deleteStatus) => {
- state.popupDialog.title = title;
- state.popupDialog.id = id;
- state.popupDelDialog.deleteStatus = deleteStatus;
- popupDialogRef.value.OpenDialog('bottom');
- }
- //删除弹框
- const DeleteHonorTypeItem = () => {
- if(state.popupDelDialog.deleteStatus == 1) return false
- state.popupDelDialog.content = `确定要删除【${state.popupDialog.title}】吗?`;
- popupDelDialogRef.value.OpenDialog();
- }
- //确定删除
- const DialogDelConfirm = () => {
- deleteHonorType(state.popupDialog.id).then(res=>{
- if(res.code == 200){
- uni.showToast({
- title: '删除成功!',
- icon: 'none'
- });
- OnLoadData();
- }else{
- uni.showToast({
- title: res.msg,
- icon: 'none'
- });
- }
- })
- }
- //新建或编辑荣誉类型
- 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}`
- });
- }
- //查看荣誉详情
- const HonorTypeAuditDetail = (honorTypeId,reviewStatus,honorTypeName) => {
- uni.navigateTo({
- url: `/pages/teacherHonor/honorOverview/honorTypeAuditDetail?honorTypeId=${honorTypeId}&reviewStatus=${reviewStatus}&honorTypeName=${encodeURIComponent(honorTypeName)}`
- });
- }
-
- </script>
- <style lang="scss" scoped>
- .count_list{
- width: 100%;
- display: flex;
- margin-top: 32rpx;
- gap: 20rpx;
- .count_item{
- display: flex;
- align-items: center;
- flex-direction: column;
- width: calc((100% - 60rpx) / 4);
- background-color: #F7FAFF;
- border-radius: 20rpx;
- border: 2rpx solid #E4E7ED;
- padding: 18rpx 16rpx 16rpx;
- height: 136rpx;
- box-sizing: border-box;
- .title{
- font-weight: 400;
- font-size: 28rpx;
- color: #666666;
- text-align: center;
- }
- .count{
- margin-top: 6rpx;
- font-weight: 600;
- font-size: 48rpx;
- color: #333333;
- }
- }
- }
- .list_title{
- width: 100%;
- display: flex;
- margin-top: 40rpx;
- justify-content: space-between;
- align-items: center;
- .title{
- font-weight: 500;
- font-size: 32rpx;
- color: #333333;
- }
- .add_btn{
- width: 204rpx;
- height: 72rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background-color: #2E64FA;
- border-radius: 8rpx;
- border: 2rpx solid #2E64FA;
- color: #FFFFFF;
- .btn_icon{
- color: #FFFFFF !important;
- font-size: 28rpx !important;
- margin-right: 8rpx;
- }
- .btn_text{
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 44rpx;
- }
- }
- }
- .honor_list{
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- gap: 22rpx;
- padding: 22rpx 0;
- .list_item{
- display: flex;
- flex-direction: column;
- width: calc((100% - 22rpx) / 2);
- background: linear-gradient( 180deg, #EDF4FF 0%, #FFFFFF 100%);
- border-radius: 20rpx;
- border: 2rpx solid #E4E7ED;
- margin-top: 10rpx;
- padding: 24rpx;
- box-sizing: border-box;
- .item_name{
- display: flex;
- align-items: center;
- width: 100%;
- .name{
- font-weight: 500;
- font-size: 36rpx;
- color: #333333;
- margin-right: 8rpx;
- flex:1;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .more_icon{
- display: inline-flex;
- align-items: center;
- justify-content: center;
- width: 32rpx;
- height: 32rpx;
- }
- }
- .item_sum{
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- width: 100%;
- margin-top: 38rpx;
- .cup,.seal{
- width: 32rpx;
- height: 32rpx;
- margin-right: 8rpx;
- }
- .sum,.audit{
- font-weight: 400;
- font-size: 28rpx;
- }
- .sum{
- color: #2E64FA;
- margin-right: 24rpx;
- }
- .audit{
- color: #F56C6C;
- }
- }
- }
- }
- .popup_content{
- display: flex;
- width: 100%;
- height: 360rpx;
- flex-direction: column;
- margin-top: 8rpx;
- .content_item{
- display: flex;
- width: 100%;
- height: 88rpx;
- padding: 0 48rpx;
- box-sizing: border-box;
- margin-top: 16rpx;
- align-items: center;
- justify-content: space-between;
- .content_item_left{
- display: flex;
- height:100%;
- align-items: center;
- .img{
- width: 32rpx;
- height: 32rpx;
- margin-right: 16rpx;
- }
- .text{
- font-weight: 400;
- font-size: 32rpx;
- color: #333333;
- &.red{
- color: #F56C6C;
- }
- &.disabled{
- color: #bbb;
- }
- }
- }
- }
- }
- </style>
|