lijingjia 2 weeks ago
parent bb74dda076
commit 646e44ebc4

@ -107,7 +107,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam } from './types/table' import type { BasicTableProps, TableActionType, SizeType, ColumnChangeParam } from './types/table'
import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, onMounted, watch } from 'vue' import { defineComponent, ref, computed, unref, toRaw, inject, watchEffect, watch } from 'vue'
import { Table, Pagination } from 'ant-design-vue' import { Table, Pagination } from 'ant-design-vue'
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { PageWrapperFixedHeightKey } from '/@/components/Page' import { PageWrapperFixedHeightKey } from '/@/components/Page'
@ -180,7 +180,6 @@ export default defineComponent({
const [registerForm, formActions] = useForm() const [registerForm, formActions] = useForm()
const getProps = computed(() => { const getProps = computed(() => {
console.log(props.tableComponent)
return { ...props, ...unref(innerPropsRef) } as BasicTableProps return { ...props, ...unref(innerPropsRef) } as BasicTableProps
}) })
@ -192,6 +191,15 @@ export default defineComponent({
"'canResize' of BasicTable may not work in PageWrapper with 'fixedHeight' (especially in hot updates)", "'canResize' of BasicTable may not work in PageWrapper with 'fixedHeight' (especially in hot updates)",
) )
}) })
watch(
() => getProps,
(v) => {
if (unref(v).tableComponent == 'vxe') {
getVxeColSetData()
}
},
{ deep: true }
)
const { getLoading, setLoading } = useLoading(getProps) const { getLoading, setLoading } = useLoading(getProps)
const { const {
getPaginationInfo, getPaginationInfo,
@ -362,10 +370,10 @@ export default defineComponent({
const vxeSetId = ref('0') const vxeSetId = ref('0')
// vxe // vxe
const getVxeColSetData = () => { const getVxeColSetData = () => {
console.log(props)
if (props.id) { if (props.id) {
getColumnSetInfoByModule({ permissionId: permissionsInfo().permissionId, columnNo: props.id }).then(res => { getColumnSetInfoByModule({ permissionId: permissionsInfo().permissionId, columnNo: props.id }).then(res => {
const { data } = res const { data } = res
if (!data) return
const columns = JSON.parse(data.content).columns const columns = JSON.parse(data.content).columns
columns.forEach(item => { columns.forEach(item => {
item['title'] = item.customTitle item['title'] = item.customTitle
@ -451,9 +459,6 @@ export default defineComponent({
}) })
setColumns(data) setColumns(data)
} }
// onMounted(() => {
// getVxeColSetData()
// })
// //
const initColSet = () => { const initColSet = () => {

@ -68,7 +68,7 @@
.ButtonBox { .ButtonBox {
width: 70%; width: 70%;
display: flex; display: flex;
justify-content: end; justify-content: flex-end;
.CheckButton { .CheckButton {
width: 150px; width: 150px;
margin: 16px 0 16px 16px; margin: 16px 0 16px 16px;

@ -314,7 +314,7 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="订单管理"> <script lang="ts" setup name="订单管理">
import { onMounted, ref, defineAsyncComponent, onActivated } from 'vue' import { ref, defineAsyncComponent, onActivated } from 'vue'
const TableActionBar = defineAsyncComponent(() => import("./components/tableActionBar.vue")) const TableActionBar = defineAsyncComponent(() => import("./components/tableActionBar.vue"))
import { CheckCircleFilled, CloseCircleFilled, RedoOutlined } from '@ant-design/icons-vue' import { CheckCircleFilled, CloseCircleFilled, RedoOutlined } from '@ant-design/icons-vue'
const tableActionBarRight = defineAsyncComponent(() => import("./components/tableActionBarRight.vue")) const tableActionBarRight = defineAsyncComponent(() => import("./components/tableActionBarRight.vue"))
@ -517,7 +517,7 @@ const [registerTable, { reload, getVxeSelectRows, setLoading }] = useTable({
immediate: false, immediate: false,
tableComponent: 'vxe', tableComponent: 'vxe',
autoHeight: tbHeight, autoHeight: tbHeight,
id: '011', id: '0',
actionColumn: { actionColumn: {
width: 60, width: 60,
title: '操作', title: '操作',
@ -654,7 +654,7 @@ function compareSuccess() {
setLoading(false); setLoading(false);
reload() reload()
} }
onMounted(() => { onActivated(() => {
// //
reload() reload()
}) })

@ -264,7 +264,7 @@
.bottom { .bottom {
padding: 10px 60px; padding: 10px 60px;
display: flex; display: flex;
justify-content: end; justify-content: flex-end;
box-shadow: 0px -3px 6px rgba(214, 214, 214, 1); box-shadow: 0px -3px 6px rgba(214, 214, 214, 1);
.steps { .steps {
width: 800px; width: 800px;

Loading…
Cancel
Save