<template>
	<view class="content">
	  <view v-for="(item,index) in ListData" :key="index">
		<p class="btn" @click="gotoLink(item)" v-if="item.name">{{ item.name }}</p>
	  </view>
	</view>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'

const ListData =ref([
	{
		path: '../maintenance/processOldzmd',
		name: '工艺维护',
		type:'',
	},
	{
		path:'../maintenance/m-flow',
		name:'工艺流程维护',
		type:''
	},
	{
	  path: '../maintenance/m-process',
	  name: '工序项维护',
	  type:'process',
	},
	{
	  path: '../maintenance/m-requirements',
	  name: '工艺要求维护',
	  type:'craftRequire',
	},
	{
	  path: '../maintenance/m-factory',
	  name: '工厂维护',
	   type:'factory',
	},
	{
	  path: '../maintenance/m-other',
	  name: '其他要求项维护',
	   type:'extraOption',
	},
	// {
	//   path: '../lecher/l-quality',
	//   name: '色胚质检项维护',
	// },
	// {
	//   path: '../lecher/l-flaws',
	//   name: '色胚质检瑕疵维护',
	// },
	{
	  path: '../whiteEmbryo/w-warehousing',
	  name: '白胚入库',
	  type:'rawFabric',
	},
	{
	  path: '../whiteEmbryo/w-level',
	  name: '白胚等级维护',
	  type:'rawFabricLevels',
	},
	{
	  path: '../whiteEmbryo/w-suppliers',
	  name: '供应商维护',
	  type:'suppliers',
	},
	{
	  path: '../whiteEmbryo/w-scanCode',
	  name: '扫码放货架',
	  type:'rawFabric',
	},
	{
	  path: '../whiteEmbryo/w-warehouse',
	  name: '仓库维护',
	  type:'warehouse',
	},
	{
	  path: '../whiteEmbryo/w-libraryLocation',
	  name: '库位号维护',
	  type:'shelves',
	},
	{
	  path: '../whiteEmbryo/w-list',
	  name: '白胚列表',
	  type:'rawFabric',
	},
	{
		path:'../spot/list',
		name:'需求单列表',
		type:'',
	},
	{
		path:'../customOrder/list',
		name:'定做单列表',
		type:'',
	},
	{
		path:'../distribution/distribution',
		name:'待配货列表',
		type:'',
	},
	{
		path:'../documentary/documentary',
		name:'跟单列表',
		type:'',
	}
] as any[])


onMounted(() => {
	uni.getStorage({
		key:'token',
		success: function (res) {
			if(!res.data){
				uni.reLaunch({
					url:'/pages/login/login'
				})
			}
			},
		fail:function(error){
			uni.reLaunch({
				url:'/pages/login/login'
			})
		}
	})
})

const gotoLink = (item: any) => {
  uni.navigateTo({
  	url:item.path
  })
}
</script>

<style scoped lang="scss">
.btn {
  padding: 15px 0;
  margin: 10px;
  background-color: #35a5f7;
  color: #fff;
  text-align: center;
  border-radius: 20px;
}

input[type='number'] {
  -moz-appearance: textfield;
}

  input[type=number]::-webkit-inner-spin-button,
  input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
</style>