| | |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import userInfo from "@/stores/userInfo" |
| | | import {useI18n} from 'vue-i18n' |
| | | import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | //语言获取 |
| | | const {t} = useI18n() |
| | | const route = useRoute() |
| | | const user = userInfo() |
| | | let router = useRouter() |
| | | |
| | | onMounted(() => { |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value, gridOptions) |
| | | }) |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | |
| | | //表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {code: 'save', name: '保存', status: 'primary', icon: 'vxe-icon-save'}, |
| | | {code: 'removeRow', name: t('basicData.delete'), status: 'primary', icon: 'vxe-icon-delete'}, |
| | | {code: 'addRow', name: t('reportingWorks.increase'), status: 'primary', icon: 'vxe-icon-square-plus'}, |
| | | {code: 'save', name: '保存', status: 'primary', icon: 'vxe-icon-save'}, |
| | | ], |
| | | // import: false, |
| | | // export: true, |
| | |
| | | switch (code) { |
| | | case 'addRow': { |
| | | $grid.insertAt({}) |
| | | break |
| | | } |
| | | case 'removeRow': { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result) { |
| | | $grid.remove(result.row) |
| | | } |
| | | break |
| | | } |
| | | case 'save': { |
| | |
| | | margin: 0 auto; |
| | | height: 100%; |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | </style> |