import {
	createRouter,
	createWebHashHistory
} from 'vue-router'
import login from '../views/login.vue'
import main from '../views/main.vue'
const routes = [{
		path: '/',
		name: 'login',
		component: login
	},
	{
		path: '/about',
		name: 'about',
		component: () => import('../views/AboutView.vue')
	},
	{
		path: '/main',
		name: 'main',
		component: main,
		redirect: '/main/equipment',
		children: [
			{
				path: 'equipment',
				name: '设备列表',
				component: () => import('../views/equipment/index.vue')
			},
			{
				path: 'working',
				name: '工作台',
				component: () => import('../views/working/index.vue')
			},
			{
				path: 'warpKnitting/:id',
				name: '经编机',
				component: () => import('../views/equipment/warpKnitting.vue')
			},

		]
	},
	{
		path: '/purchase-sales',
		name: 'purchase-sales',
		// component: main,
		// redirect: '/purchase-sales/equipment',
		children: [{
				path: 'manualOutbound',
				name: '手动出库',
				component: () => import('../views/purchase-sales/inbound-outbound/manualOutbound/index.vue')
			},
			{
				path: 'manualInbound',
				name: '手动入库',
				component: () => import('../views/purchase-sales/inbound-outbound/manualInbound/index.vue')
			},
			{
				path: 'addDetails',
				name: '手动入库',
				component: () => import('../views/purchase-sales/inbound-outbound/addDetails.vue')
			},

		]
	},
]

const router = createRouter({
	history: createWebHashHistory(),
	routes
})

export default router