Compare commits

...

2 Commits

@ -10,9 +10,9 @@
>
<Row v-bind="getRow" :gutter="15" style="position: relative;">
<slot name="formHeader"></slot>
<template v-for="schema in getSchema" :key="schema.field">
<template v-for="(schema, index) in getSchema" :key="schema.field">
<FormItem
v-if="getFormItemVisible(schema)"
v-if="getFormItemVisible(schema, index)"
:is-advanced="fieldsIsAdvancedMap[schema.field]"
:table-action="tableAction"
:form-action-type="formActionType"
@ -136,11 +136,17 @@
() => ({ ...attrs, ...props, ...unref(getProps) } as Recordable),
)
const getFormItemVisible = (schema: FormSchema) => {
const getFormItemVisible = (schema: FormSchema, index) => {
// item
if (index < 6 && !advanceState.isAdvanced && unref(getBindValue).autoSubmitOnEnter) {
return true
} else {
if (!advanceState.isAdvanced && unref(getBindValue).autoSubmitOnEnter) return false
const visibleFlag = schema.isEdit != 1 || schema.component == 'Divider'
if (unref(getBindValue).textAreaReadOnly) return visibleFlag
return visibleFlag || schema.component == 'InputTextArea'
}
}
const getReadonlyColItemVisible = (schema: FormSchema) => {
const visibleFlag =
schema.show !== false && schema.isEdit == 1 && schema.component != 'Divider'

@ -33,10 +33,11 @@
show-overflow
show-header-overflow
show-footer-overflow
:min-height="tableHeightRef + 35"
:height="tableHeightRef + 35"
:row-config="{ isCurrent: true, isHover: true }"
:column-config="{ resizable: true }"
:scroll-y="{ enabled: true, gt: 15 }"
:scroll-y="{ enabled: true, gt: 0 }"
:scroll-x="{ enabled: true, gt: 0 }"
:sort-config="{ trigger: 'cell', remote: true }"
rowSelection
@ -45,15 +46,14 @@
@cell-dblclick="dbclickVxeRow"
@sort-change="sortChangeEvent"
@resizable-change="resizableChangeEvent"
>
<template #empty>
<div>
<img style="width: 100px;" src="../../../assets/images/nodata.png" />
<img src="../../../assets/images/nodata.png" />
</div>
</template>
<vxe-column type="checkbox" width="40"></vxe-column>
<!-- <vxe-column type="seq" width="40"></vxe-column> -->
<vxe-column type="checkbox" fixed="left" width="40"></vxe-column>
<!-- <vxe-column type="seq" title="序号" width="45"></vxe-column> -->
<template
v-for="(item, index) in getBindValues.columns"
>
@ -102,12 +102,12 @@
</Table>
<slot name="right" class="right" ></slot>
</div>
<Pagination v-if="getBindValues.tableComponent === 'vxe'" v-bind="getBindValues.pagination" @change="pageChange" />
<Pagination v-if="getBindValues.tableComponent === 'vxe'" v-bind="getBindValues.pagination" @change="pageChange" @showSizeChange="onShowSizeChange" />
</div>
</template>
<script lang="ts">
import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam } from './types/table'
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch, onUnmounted } from 'vue'
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch, onUpdated, onActivated, onDeactivated, nextTick } from 'vue'
import { Table, Pagination } from 'ant-design-vue'
import { BasicForm, useForm } from '/@/components/Form/index'
import { PageWrapperFixedHeightKey } from '/@/components/Page'
@ -367,6 +367,13 @@ export default defineComponent({
setPagination(pageConfig)
reload()
}
const onShowSizeChange = (current, pageSize) => {
const pageConfig = toRaw(unref(getPaginationInfo))
pageConfig.current = current
pageConfig.pageSize = pageSize
setPagination(pageConfig)
reload()
}
const vxeSetId = ref('0')
// vxe
const getVxeColSetData = () => {
@ -383,6 +390,27 @@ export default defineComponent({
})
}
}
// let vxeTableScrollTop = null
// onActivated(() => {
// console.log(vxeTableScrollTop)
// if (vxeTableScrollTop && tableElRef.value?.scrollTo) {
// tableElRef.value.scrollTo(null, vxeTableScrollTop)
// }
// })
// onUpdated(() => {
// setTimeout(() => {
// if (vxeTableScrollTop && tableElRef.value?.scrollTo) {
// tableElRef.value.scrollTo(null, vxeTableScrollTop)
// }
// }, 10)
// })
// onDeactivated(() => {
// if (tableElRef.value?.getScroll) {
// const scrollData = tableElRef.value.getScroll()
// vxeTableScrollTop = scrollData.scrollTop
// console.log(vxeTableScrollTop)
// }
// })
const tableAction: TableActionType = {
reload,
getSelectRows,
@ -443,6 +471,7 @@ export default defineComponent({
}
// vxe
const resizableChangeEvent = (item) => {
if (item?.columm?.type === 'seq' || item?.columm?.type === 'checkbox') return
if (vxeSetId.value == '0') return
const postData = {
permissionId: permissionsInfo().permissionId,
@ -459,9 +488,6 @@ export default defineComponent({
})
setColumns(data)
}
onUnmounted(() => {
console.log(111111111111111)
})
// vxe
// const filterChangeEvent = ({ filterList }) => {
// console.log(filterList)
@ -478,6 +504,7 @@ export default defineComponent({
getBindValues,
getLoading,
registerForm,
onShowSizeChange,
handleSearchInfoChange,
getEmptyDataIsShowTable,
sortChangeEvent,

@ -222,7 +222,7 @@
...item,
})
})
console.log(ret)
return ret
}

@ -109,14 +109,15 @@ export function useColumns(
const getColumnsRef = computed(() => {
const columns = cloneDeep(unref(columnsRef))
// 原表格设置操作列到和序号columns vxetable跳过这部分逻辑
if (unref(propsRef).tableComponent !== 'vxe') {
handleIndexColumn(propsRef, getPaginationRef, columns)
handleActionColumn(propsRef, columns)
}
if (!columns) {
return []
}
const { ellipsis } = unref(propsRef)
columns.forEach((item) => {
const { customRender, slots } = item
item['resizable'] = true
@ -145,7 +146,6 @@ export function useColumns(
const getViewColumns = computed(() => {
const viewColumns = sortFixedColumn(unref(getColumnsRef))
console.log(getColumnsRef)
const mapFn = (column) => {
const { slots, customRender, format, edit, editRow, flag } = column

@ -266,7 +266,6 @@ export function formatParams(params = {}, searchForm: any = [], otherQuery: any
}
postData.queryCondition = JSON.stringify(conditions)
console.log(postData)
return postData
}
// 获取列表设置详情接口

@ -1,5 +1,5 @@
<!--
* @Description:
* @Description: 配置缓存标签页面入口
* @Author: lijj
* @Date: 2024-04-15 17:08:08
-->
@ -48,8 +48,6 @@
const tabStore = useMultipleTabStore()
const { getOpenKeepAlive } = useRootSetting()
console.log(getOpenKeepAlive.value)
console.log(getShowMultipleTab.value)
const { getBasicTransition, getEnableTransition } = useTransitionSetting()

@ -23,7 +23,7 @@ export default {
totalField: 'total',
},
// Number of pages that can be selected
pageSizeOptions: ['20', '50', '80', '100', '500'],
pageSizeOptions: ['10', '20', '50', '80', '100'],
// Default display quantity on one page
defaultPageSize: 100,
// Default Size

@ -232,7 +232,7 @@
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
showIndexColumn: false,
indexColumnProps: {
width: 60,
},

@ -488,7 +488,7 @@ export const formSchema: FormSchema[] = [
componentProps: ({ formModel }) => {
return {
api: GetSupplierListByCode,
params: { code: 'yard' },
params: { code: 'isYard' },
labelField: 'pinYinCode',
showName: 'description',
valueField: 'shortName',
@ -703,7 +703,7 @@ export const formSchema: FormSchema[] = [
componentProps: ({ formModel }) => {
return {
api: GetSupplierListByCode,
params: { code: 'yard' },
params: { code: 'isYard' },
labelField: 'pinYinCode',
showName: 'description',
valueField: 'shortName',

@ -437,7 +437,7 @@ export const formSchema: FormSchema[] = [
componentProps: ({ formModel }) => {
return {
api: GetSupplierListByCode,
params: { code: 'yard' },
params: { code: 'isYard' },
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'shortName',

@ -614,7 +614,7 @@ export const yardSchema: FormSchema[] = [
componentProps: ({ formModel }) => {
return {
api: GetSupplierListByCode,
params: { code: 'yard' },
params: { code: 'isYard' },
labelField: 'pinYinCode',
placeholder: '场站',
showName: 'shortName',

@ -314,7 +314,7 @@
</div>
</template>
<script lang="ts" setup name="订单管理">
import { ref, defineAsyncComponent, onActivated, onMounted } from 'vue'
import { ref, defineAsyncComponent, onActivated } from 'vue'
const TableActionBar = defineAsyncComponent(() => import("./components/tableActionBar.vue"))
import { CheckCircleFilled, CloseCircleFilled, RedoOutlined } from '@ant-design/icons-vue'
const tableActionBarRight = defineAsyncComponent(() => import("./components/tableActionBarRight.vue"))
@ -425,7 +425,6 @@ const calcColumns = [
width: 120,
}
]
console.log(columns)
//
const fieldFlag = ref(true)
//
@ -480,7 +479,6 @@ const [registerTable, { reload, getVxeSelectRows, setLoading }] = useTable({
appStore.setIds(ids, 'hyck')
}
resolve({ data: [...res.data.list], total: res.data.totalCount })
console.log(getVxeSelectRows)
})
},
//
@ -652,7 +650,7 @@ function compareSuccess() {
setLoading(false);
reload()
}
onMounted(() => {
onActivated(() => {
//
reload()
})

@ -374,7 +374,7 @@ export const formSchema1: FormSchema[] = [
componentProps: ({ formModel }) => {
return {
api: GetSupplierListByCode,
params: { code: 'agent' },
params: { code: 'isAgent' },
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'shortName',

Loading…
Cancel
Save