| | |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import {useI18n} from "vue-i18n" |
| | | import request from "@/utils/request" |
| | | import {copyTableCellValue} from "@/hook/copyTableCellValue"; |
| | | const { t } = useI18n() |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | |
| | | //scrollX:{ enabled: true,gt:15 },//开启虚拟滚动 |
| | | mouseConfig:{selected: true},//鼠标选中 |
| | | keyboardConfig:{ |
| | | isArrow: true, |
| | | isDel: true, |
| | | isEnter: true, |
| | | isTab: true, |
| | | isEdit: true, |
| | | isChecked: true |
| | | isArrow: true |
| | | }, |
| | | columnConfig: { |
| | | resizable: true, |
| | |
| | | {field: 'orderDetail.edgingType',width:120, title: t('order.edgingType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged} |
| | | ], |
| | | toolbarConfig: { |
| | | slots:{ |
| | | buttons: "title" |
| | | }, |
| | | zoom: true, |
| | | custom: true |
| | | } |
| | |
| | | }) |
| | | |
| | | let props = defineProps({ |
| | | orderId:null |
| | | orderId:null, |
| | | row: {} |
| | | }) |
| | | onMounted(()=>{ |
| | | request.post(`/order/getOrderCraftDetailById/${props.orderId}`).then(res=>{ |
| | |
| | | }) |
| | | |
| | | const handleKeyDown = (evnt) =>{ |
| | | |
| | | if(evnt.$event.keyCode === 38 ){ |
| | | let nextRowIndex = xGrid.value.getRowIndex(xGrid.value.getCurrentRecord()) - 1; |
| | | if (nextRowIndex < xGrid.value.getTableData().fullData.length && nextRowIndex>=0) { |
| | |
| | | |
| | | } |
| | | } |
| | | const gridEvents = { |
| | | cellDblclick ({row,column}) { |
| | | copyTableCellValue(row,column) |
| | | } |
| | | } |
| | | |
| | | let showTitle = ref(false) |
| | | const changeZoom = ()=> { |
| | | showTitle.value = !showTitle.value |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | size="mini" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | @zoom="changeZoom" |
| | | v-bind="gridOptions" |
| | | @keydown="handleKeyDown" |
| | | v-on="gridEvents" |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | <span>{{ row.shape==='1'?$t('order.universalShape'):row.shape==='2'?$t('order.alien'):null }}</span> |
| | | </template> |
| | | |
| | | <template #title> |
| | | <span style="font-weight: bold" v-show="showTitle"> |
| | | {{ row.orderId }} |
| | | {{ row.project?'--':'' }} |
| | | {{row.project}} |
| | | {{ row.batch?'--':'' }} |
| | | {{row.batch}} |
| | | </span> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | transform: translateZ(0); |
| | | } |
| | | </style> |