| | |
| | | import {useRouter} from 'vue-router' |
| | | import {columnDrop2,sortable2} from "@/hook/columnMove" |
| | | import useUserInfo from "@/stores/userInfo" |
| | | import Sortable from 'sortablejs' |
| | | import BasicTable from '@/components/sd/product/BasicTable.vue' |
| | | import {VXETable} from "vxe-table"; |
| | | import {useI18n} from "vue-i18n"; |
| | |
| | | rowIndex:{} |
| | | }) |
| | | |
| | | let sortData = ref({ |
| | | field:'id', |
| | | order:null |
| | | }) |
| | | |
| | | let glassType = ref([]) |
| | | |
| | | const getProduct = () => { |
| | | request.post(`/product/1/100/${productGlassTypeStore.GlassType}`,filterData.value).then((res) => { |
| | | const config = { |
| | | filter: filterData.value, |
| | | sort: sortData.value |
| | | } |
| | | request.post(`/product/1/100/${productGlassTypeStore.GlassType}`,config).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | xGrid.value.loadData(res.data.data) |
| | |
| | | } |
| | | if(pageState!==null){ |
| | | gridOptions.loading=true |
| | | request.post(`/product/${pageNum}/100/${productGlassTypeStore.GlassType}`,filterData.value).then((res) => { |
| | | const config = { |
| | | filter: filterData.value, |
| | | sort: sortData.value |
| | | } |
| | | request.post(`/product/${pageNum}/100/${productGlassTypeStore.GlassType}`,config).then((res) => { |
| | | try{ |
| | | if(res.code==200){ |
| | | if(pageState){ |
| | |
| | | }) |
| | | |
| | | |
| | | const config = { |
| | | filter: filterData.value, |
| | | sort: sortData.value |
| | | } |
| | | //第一次加载数据 |
| | | request.post(`/product/1/100/${productGlassTypeStore.GlassType}`,filterData.value).then((res) => { |
| | | request.post(`/product/1/100/${productGlassTypeStore.GlassType}`,config).then((res) => { |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | }, |
| | | sortConfig: { //排序配置项 |
| | | remote: true//是否服务端排序 |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | |
| | | {field: 'productName', title: t('product.productName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: false}, |
| | | {field: 'productAbbreviation', title:t('product.msg.productAbbreviation'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: false}, |
| | | {field: 'basicGlassType.typeName', title: t('product.typeName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: false}, |
| | | {field: 'query', title: t('product.query'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: false}, |
| | | {field: 'query', title: t('product.query'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'remarks', title: t('basicData.remarks'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: false}, |
| | | {field: 'creator', title: t('product.creator'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: false}, |
| | | {field: 'createTime', title: t('basicData.creationTime'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: false} |
| | |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | |
| | | const gridEvents = { |
| | | sortChange ({ field, order }) { |
| | | sortData.value = {field,order} |
| | | getProduct() |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @scroll ="scrollEvnt" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |