Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mineadmin/MineAdmin-Vue
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Jul 9, 2024
2 parents c2011b6 + fa0d9ec commit 63e2e20
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/components/ma-crud/components/column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<a-table-column
:title="row.title"
:width="row.width"
:min-width="row.minWidth"
:ellipsis="row.ellipsis ?? true"
:filterable="row.filterable"
:cell-class="row.cellClass"
Expand Down Expand Up @@ -38,6 +39,7 @@
:title="row.title"
:data-index="row.dataIndex"
:width="row.width"
:min-width="row.minWidth"
:ellipsis="row.ellipsis ?? true"
:filterable="row.filterable"
:cell-class="row.cellClass"
Expand Down
10 changes: 4 additions & 6 deletions src/components/ma-crud/components/searchFormItem/form-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if ( props.component.multiple === true ) {
if (isObject(props.component.dict)) {
props.component.dict.pageOption = {
page: 1,
pageSize: props.component?.dict?.pageSize ?? 15
pageSize: props.component?.dict?.pageOption?.pageSize ?? props.component?.dict?.pageSize ?? 15
}
}

Expand Down Expand Up @@ -108,6 +108,9 @@ const handlePage = async (page) => {

watch( () => get(searchForm.value, props.component.dataIndex), vl => value.value = vl )
watch( () => value.value, v => set(searchForm.value, props.component.dataIndex, v) )
watch( () => dicts.value[dictIndex] , async v => {
dataTotal.value = v?.pageInfo?.total || 0
})

const handlerChangeeEvent = (value) => {
handlerCascader(
Expand All @@ -116,10 +119,5 @@ const handlerChangeeEvent = (value) => {
}

onMounted(() => {
setTimeout(() => {
if (isObject(dicts.value[dictIndex])) {
dataTotal.value = dicts.value[dictIndex]?.pageInfo?.total
}
}, 3000);
})
</script>
3 changes: 2 additions & 1 deletion src/components/ma-crud/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<slot name="searchAfterButtons"></slot>
</template>
</ma-search>
<div v-if="$slots.middleContent" class="mb-2"><slot name="middleContent"></slot></div>
</div>
<div class="mb-2"><slot name="middleContent"></slot></div>
<div class="_crud-content">
<div class="operation-tools lg:flex justify-between mb-3" ref="crudOperationRef">
<a-space class="lg:flex block lg:inline-block" >
Expand Down Expand Up @@ -380,6 +380,7 @@ columns.value.map((item, index) => {
item = columns.value[index]
}
!item.width && (item.width = options.value.columnWidth)
!item.minWidth && (item.minWidth = options.value.columnMinWidth)
})

provide('options', options.value)
Expand Down
3 changes: 2 additions & 1 deletion src/components/ma-crud/js/defaultOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export default {
// 页面布局方式,支持 normal(标准)和 fixed(固定)两种
pageLayout: 'normal',
// 默认统一设置列宽度
columnWidth: 100,
columnWidth: 0,// 列宽更新为最小列宽(此处设置为 0 时候,默认最小列宽生效)
columnMinWidth: 100,
// 搜索标签对齐方式
searchLabelAlign: 'right',
// 全局搜索标签宽度
Expand Down
11 changes: 4 additions & 7 deletions src/components/ma-form/formItem/form-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const props = defineProps({
if (isObject(props.component.dict)) {
props.component.dict.pageOption = {
page: 1,
pageSize: props.component?.dict?.pageSize ?? 15
pageSize: props.component?.dict?.pageOption?.pageSize ?? props.component?.dict?.pageSize ?? 15
}
}

Expand All @@ -116,6 +116,9 @@ watch( () => value.value, v => {
set(formModel.value, index, v)
index.indexOf('.') > -1 && delete formModel.value[index]
} )
watch( () => dictList.value[index] , async v => {
dataTotal.value = v?.pageInfo?.total || 0
})

if (value.value === '') {
value.value = undefined
Expand Down Expand Up @@ -170,11 +173,5 @@ const handleCascaderChangeEvent = async (value) => {

rv('onCreated')
onMounted(() => {
setTimeout(() => {
if (isObject(dictList.value[index])) {
dataTotal.value = dictList.value[index]?.pageInfo?.total
}
}, 800);
rv('onMounted')
})
</script>
2 changes: 1 addition & 1 deletion src/components/ma-resource/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a-modal v-model:visible="openNetworkModal" :ok-text="$t('sys.save')" :on-before-ok="saveNetworkImg" draggable>
<template #title>{{ $t('maResource.saveNetworkImage') }}</template>
<a-input v-model="networkImg" class="mb-3" :placeholder="$t('maResource.networkImageNotice')" allow-clear />
<a-image :src="networkImg" width="100%" style="min-height: 150px;" />
<a-image :src="networkImg ?? ''" width="100%" style="min-height: 150px;" />
</a-modal>
<div class="lg:w-1/5 w-full p-2 shadow">
<ma-tree-slider
Expand Down
1 change: 1 addition & 0 deletions src/views/setting/config/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
:title="item.name"
>
<ma-form
v-if="isCreateNode"
v-model="formArray[item.id]"
:columns="optionsArray[item.id]"
@submit="submit"
Expand Down

0 comments on commit 63e2e20

Please sign in to comment.