feat
This commit is contained in:
parent
8412ba4bf8
commit
2740fb22b5
@ -14,21 +14,11 @@
|
|||||||
@row-save="handleSave"
|
@row-save="handleSave"
|
||||||
@row-update="handleUpdate"
|
@row-update="handleUpdate"
|
||||||
>
|
>
|
||||||
<template #menu="{ index, row }">
|
<template #menu-left>
|
||||||
<el-dropdown>
|
<el-button type="primary" @click="handleDownSoilType">导出</el-button>
|
||||||
<el-icon style="padding: 14px 0"><More /></el-icon>
|
</template>
|
||||||
<template #dropdown>
|
<template #menu="scope">
|
||||||
<el-dropdown-menu>
|
<custom-table-operate :actions="actions" :data="scope" />
|
||||||
<template v-for="item in actions" :key="item.name">
|
|
||||||
<el-dropdown-item @click="item.event(row, index)">
|
|
||||||
<el-button :type="item.type ?? 'primary'" :icon="item.icon" :size="item.size" :disabled="item.disabled" text>
|
|
||||||
{{ item.name == '查看' ? (row.status == '1' ? '禁用' : '启用') : item.name }}
|
|
||||||
</el-button>
|
|
||||||
</el-dropdown-item>
|
|
||||||
</template>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</template>
|
|
||||||
</el-dropdown>
|
|
||||||
</template>
|
</template>
|
||||||
</avue-crud>
|
</avue-crud>
|
||||||
</CustomCard>
|
</CustomCard>
|
||||||
@ -46,6 +36,7 @@ const {
|
|||||||
pageData,
|
pageData,
|
||||||
option,
|
option,
|
||||||
actions,
|
actions,
|
||||||
|
handleDownSoilType,
|
||||||
handleSizeChange,
|
handleSizeChange,
|
||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
handleSearch,
|
handleSearch,
|
||||||
|
@ -62,8 +62,8 @@ export default function useSoilTypeHook() {
|
|||||||
});
|
});
|
||||||
const actions = ref([
|
const actions = ref([
|
||||||
{
|
{
|
||||||
name: '查看',
|
name: ({ row }) => (row.status == '0' ? '启用' : '禁用'),
|
||||||
icon: 'view',
|
icon: 'TurnOff',
|
||||||
event: handleStatusChange,
|
event: handleStatusChange,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ export default function useSoilTypeHook() {
|
|||||||
pageData.value.total = res.data.total;
|
pageData.value.total = res.data.total;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function handleStatusChange(row, index) {
|
async function handleStatusChange({ row, index }) {
|
||||||
await editSoilType(row, index);
|
await editSoilType(row, index);
|
||||||
}
|
}
|
||||||
function handleCurrentChange(val) {
|
function handleCurrentChange(val) {
|
||||||
@ -153,6 +153,9 @@ export default function useSoilTypeHook() {
|
|||||||
pageData.value.pageSize = 10;
|
pageData.value.pageSize = 10;
|
||||||
getList();
|
getList();
|
||||||
}
|
}
|
||||||
|
function handleDownSoilType() {
|
||||||
|
console.log('handleDownSoilType');
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
crudRef,
|
crudRef,
|
||||||
condition,
|
condition,
|
||||||
@ -167,5 +170,6 @@ export default function useSoilTypeHook() {
|
|||||||
handleSizeChange,
|
handleSizeChange,
|
||||||
handleSave,
|
handleSave,
|
||||||
handleUpdate,
|
handleUpdate,
|
||||||
|
handleDownSoilType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user