今日不良

81 阅读1分钟

某一天你在本地仓库进行了相关修改然后上传到远程仓库中,这时本地仓库和远程仓库都是同步的,不会出现这种错误。过了几天你突然在github看到了一个错误需要修改,但你并没有通过本地仓库进行修改而是直接在github上进行修改,然后保存修改。这里就要注意一个问题,之前你通过本地仓库进行修改文章最后都会上传到远程仓库(也就是github中),这就保证了远程仓库和本地仓库是同步的,但是如果你直接在远程仓库(github)中进行修改,默认是不会上传到本地的,这就导致了一个问题,本地仓库中的相关内容没有被修改,而远程仓库中的相关内容被修改,这里可以理解为远程仓库更新了而本地仓库没有更新,这就导致了本地仓库的版本落后于远程仓库,也就是本地仓库和远程仓库版本不一致。而你现在直接在本地仓库这个落后的仓库中修改相关文件然后上传到远程仓库中就会出现错误,本地的修改是基于之前

<!-- 今日不良 -->
<template>
	<view>
		<swo-title-bar title="今日不良" :isBack="true"></swo-title-bar>
		<view>
			<!--搜索条-->
			<search-bar class="fixed" :style="{top: CustomBar + 'px'}" placeholder="搜索不良品名称/工序名称"
				@confirm="search" @clear="search">
			</search-bar>
			<!--不良列表-->
			<view style="padding-top: 100rpx;">
				<today-bad-item v-for="(item,i) in shownDatas" :item="item" :key="`item-${i}`"></today-bad-item>
	
			</view>

			<!--空列表占位符-->
			<u-empty v-if="!isLoading && shownDatas.length == 0" mode="list" text="暂无数据"
				icon="http://cdn.uviewui.com/uview/empty/list.png">
			</u-empty>
			
			<!-- 拉到底部没有更多数据了 -->
			<uni-load-more v-else :status="loadMoreStatus"></uni-load-more>
		</view>
	</view>
</template>

<script>
	import getTime from '@/common/util/timeFilter.js'
	export default {
		data() {
			return {
				shownDatas: [], // 接口返回数据
				isLoading:true,//是否正在加载中
				searchValue: '', // 搜索框文本
			
				startTime:"",
				endTime:"",
				form: {
					startTime: getTime('今天').startTime,
					endTime: getTime('今天').endTime,
					searchValue: '',
				},
				
				queryData: {
					timeLabel: '',
					pageLabel: '',
				}
			};
		},
		watch: {
			queryData: {
				immediate: true,
				handler(queryData){
					
					let timeObj = {};
					switch(queryData.timeLabel){
						case '昨天': timeObj = getTime(queryData.timeLabel); break;
						case '今天': timeObj = getTime(queryData.timeLabel); break;
						case '前7天': 
							timeObj.startTime = getTime(-8).startTime;
							timeObj.endTime = getTime(-1).endTime;
						; break;
						default: timeObj = getTime('今天'); break;
					}
					
					this.form.startTime = timeObj.startTime
					this.form.endTime = timeObj.endTime
				}
			}
		},
		computed: {
					loadMoreStatus() {
						if (this.isLoading) return 'loading'
						if (!this.isLoading ) return 'no-more'
						return 'more'
					}
				},
		created() {
			
			let queryData = this.$Route.query;
			debugger
			if(queryData.pageLabel){
				this.queryData = queryData;
			}
			this.getDatas()
			
		},
		
		methods: {
			//搜索
			search(val) {
				this.form.searchValue = val
				this.getDatas()
			},
			getDatas() {
				this.isLoading = true	
				// uni.$api.productionDefectitemTodayDefectitem({
					 uni.$api.productionDefectitemTodayDefectitem(this.form).then(res => {
						this.isLoading = false
							this.shownDatas = res.rows
					}).catch(() => {
						this.isLoading = false
					})
			},
			
		}
                ```
	}
</script>

<style lang="scss">

</style>