基础资料,表格刷新问题

main
GaoF 2024-08-02 09:25:37 +08:00
parent 8eff8f1952
commit 6e55926994
8 changed files with 40 additions and 18 deletions

View File

@ -25,7 +25,7 @@
class="s-tool-item"
v-if="item.name === 'refresh' && props.toolConfig.refresh"
>
<component class="icons" :is="item.icon" @click="loadTreeData()"></component>
<component class="icons" :is="item.icon" @click="handleRefresh"></component>
</a-tooltip>
</span>
</div>
@ -91,7 +91,7 @@
}
})
const emit = defineEmits(['selectTree', 'delTree'])
const emit = defineEmits(['selectTree', 'delTree', 'treeRefresh'])
const tool = [
{
@ -154,11 +154,15 @@
})
}
const handleRefresh = () => {
loadTreeData()
emit('treeRefresh')
}
const loadTreeData = async () => {
try {
localLoading.value = true
const treeRes = await props.apiModel.getTree()
console.log(treeRes, 'treeRes')
if (Array.isArray(treeRes)) {
treeData.value[0].children = treeRes
} else {
@ -168,7 +172,7 @@
if (selectedKeys.value.length > 0) {
selectedKeys.value = []
props.tableRef.refresh()
// props.tableRef.refresh()
}
if (treeRow.id) {

View File

@ -42,7 +42,7 @@
</a-menu>
</template>
</a-dropdown>
<div v-if="setDrawer === 'true'" class="setting panel-item" @click="openSetting">
<div class="setting panel-item" @click="openSetting">
<layout-outlined />
</div>
</div>

View File

@ -43,6 +43,7 @@
}"
@selectTree="selectTree"
@delTree="delTree"
@treeRefresh="treeRefresh"
></dynamic-tree>
</a-col>
<a-col :span="18">
@ -228,6 +229,11 @@
tableRef.value.refresh()
}
const treeRefresh = () => {
searchFormState.value.categoryId = null
tableRef.value.refresh()
}
const successful = () => {
searchFormState.value.categoryId = null
tableRef.value.refresh()

View File

@ -43,6 +43,7 @@
}"
@selectTree="selectTree"
@delTree="delTree"
@treeRefresh="treeRefresh"
></dynamic-tree>
</a-col>
<a-col :span="18">
@ -178,6 +179,11 @@
tableRef.value.refresh()
}
const treeRefresh = () => {
searchFormState.value.categoryId = null
tableRef.value.refresh()
}
const delTree = () => {
searchFormState.value.categoryId = null
tableRef.value.refresh()

View File

@ -41,6 +41,7 @@
delTree: sysStoreApi.productionOrganizationDelete
}"
@selectTree="onSelectTree"
@treeRefresh="treeRefresh"
:toolConfig="{
plus: false,
edit: false,
@ -222,6 +223,11 @@
tableRef.value.refresh()
}
const treeRefresh = () => {
searchFormState.value.parentId = null
tableRef.value.refresh()
}
onMounted(() => {
dynamicTreeRef.value.loadTreeData()
})

View File

@ -56,6 +56,7 @@
}"
@selectTree="onSelectTree"
@delTree="delTree"
@treeRefresh="treeRefresh"
:toolConfig="{
plus: false,
edit: false,
@ -222,6 +223,11 @@
tableRef.value.refresh()
}
const treeRefresh = () => {
searchFormState.value.parentId = null
tableRef.value.refresh()
}
const successful = () => {
searchFormState.value.parentId = null
tableRef.value.refresh()

View File

@ -23,11 +23,6 @@
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="字段类型:" name="fieldType">
<a-input v-model:value="formData.fieldType" placeholder="请输入字段名" allow-clear />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="展示形式:" name="showType">
<a-select
@ -54,7 +49,7 @@
<a-col
:span="24"
v-if="formData.showType && formData.showType !== 'input' && formData.showType !== 'inputNumber'"
v-if="formData.showType && formData.showType !== 'a-input' && formData.showType !== 'a-input-number'"
>
<h3>扩展数据</h3>
<div v-for="(item, index) in selectableData" :key="index" class="mb-2">
@ -139,15 +134,14 @@
//
const formRules = {
name: [required('请输入名称')],
fieldType: [required('请输入类型')],
model: [required('请输入模块')]
}
//
const onSubmit = () => {
if (
formData.value.showType === 'select' &&
formData.value.showType === 'radio' &&
formData.value.showType === 'checkbox' &&
formData.value.showType === 'a-select' &&
formData.value.showType === 'a-radio-group' &&
formData.value.showType === 'a-checkbox-group' &&
selectableData.value.length === 0
) {
return message.error('请添加选项要展示的数据')
@ -156,7 +150,7 @@
formRef.value.validate().then(() => {
submitLoading.value = true
const formDataParam = cloneDeep(formData.value)
if (formDataParam.showType === 'input' || formDataParam.showType === 'inputNumber') {
if (formDataParam.showType === 'a-input' || formDataParam.showType === 'a-input-number') {
formDataParam.showValues = ''
} else {
formDataParam.showValues = JSON.stringify(selectableData.value)

View File

@ -62,10 +62,10 @@
<template v-if="column.dataIndex === 'action'">
<a-space>
<a @click="formRef.onOpen(record)" v-if="hasPerm('extendFieldEdit')"></a>
<a-divider type="vertical" v-if="hasPerm(['extendFieldEdit', 'extendFieldDelete'], 'and')" />
<!-- <a-divider type="vertical" v-if="hasPerm(['extendFieldEdit', 'extendFieldDelete'], 'and')" />
<a-popconfirm title="确定要删除吗?" @confirm="deleteExtendField(record)">
<a-button type="link" danger size="small" v-if="hasPerm('extendFieldDelete')"></a-button>
</a-popconfirm>
</a-popconfirm>-->
</a-space>
</template>
</template>