mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-13 12:43:45 +08:00
发布v2.15.1版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -5,12 +5,12 @@ export const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
key: 'id',
|
||||
width: 80,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '岗位',
|
||||
key: 'name',
|
||||
width: 100,
|
||||
width: 200,
|
||||
render(row) {
|
||||
return h(
|
||||
NTag,
|
||||
@@ -48,17 +48,14 @@ export const columns = [
|
||||
);
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '排序',
|
||||
// key: 'sort',
|
||||
// width: 100,
|
||||
// },
|
||||
{
|
||||
title: '备注',
|
||||
key: 'sort',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'createdAt',
|
||||
width: 150,
|
||||
render: (rows, _) => {
|
||||
return rows.createdAt;
|
||||
},
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
ref="actionRef"
|
||||
:actionColumn="actionColumn"
|
||||
@update:checked-row-keys="onCheckedRow"
|
||||
:resizeHeightOffset="-10000"
|
||||
:scroll-x="1090"
|
||||
>
|
||||
<template #tableTitle>
|
||||
@@ -96,16 +97,17 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="org_post">
|
||||
<script lang="ts" setup>
|
||||
import { h, reactive, ref } from 'vue';
|
||||
import { useDialog, useMessage } from 'naive-ui';
|
||||
import { BasicTable, TableAction } from '@/components/Table';
|
||||
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
||||
import { Delete, Edit, getPostList, Status } from '@/api/org/post';
|
||||
import { Delete, Edit, getPostList } from '@/api/org/post';
|
||||
import { columns } from './columns';
|
||||
import { DeleteOutlined, PlusOutlined } from '@vicons/antd';
|
||||
import { statusActions, statusOptions } from '@/enums/optionsiEnum';
|
||||
import { defRangeShortcuts } from "@/utils/dateUtil";
|
||||
import { statusOptions } from '@/enums/optionsiEnum';
|
||||
import { defRangeShortcuts } from '@/utils/dateUtil';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
const params = ref<any>({
|
||||
pageSize: 10,
|
||||
@@ -179,25 +181,18 @@
|
||||
|
||||
const resetFormParams = {
|
||||
id: 0,
|
||||
pid: 0,
|
||||
name: '',
|
||||
code: '',
|
||||
type: '',
|
||||
leader: '',
|
||||
phone: '',
|
||||
email: '',
|
||||
sort: 0,
|
||||
name: '',
|
||||
remark: '',
|
||||
sort: null,
|
||||
status: 1,
|
||||
created_at: '',
|
||||
updated_at: '',
|
||||
};
|
||||
let formParams = ref<any>(resetFormParams);
|
||||
|
||||
const formParams = ref<any>(resetFormParams);
|
||||
const actionColumn = reactive({
|
||||
width: 220,
|
||||
width: 150,
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
// fixed: 'right',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
style: 'button',
|
||||
@@ -211,10 +206,6 @@
|
||||
onClick: handleDelete.bind(null, record),
|
||||
},
|
||||
],
|
||||
dropDownActions: statusActions,
|
||||
select: (key) => {
|
||||
updateStatus(record.id, key);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -227,7 +218,7 @@
|
||||
|
||||
function addTable() {
|
||||
showModal.value = true;
|
||||
formParams.value = resetFormParams;
|
||||
formParams.value = cloneDeep(resetFormParams);
|
||||
}
|
||||
|
||||
const loadDataTable = async (res) => {
|
||||
@@ -237,7 +228,6 @@
|
||||
function onCheckedRow(rowKeys) {
|
||||
console.log(rowKeys);
|
||||
batchDeleteDisabled.value = rowKeys.length <= 0;
|
||||
|
||||
checkedIds.value = rowKeys;
|
||||
}
|
||||
|
||||
@@ -282,9 +272,6 @@
|
||||
reloadTable();
|
||||
});
|
||||
},
|
||||
onNegativeClick: () => {
|
||||
// message.error('取消');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -300,9 +287,6 @@
|
||||
reloadTable();
|
||||
});
|
||||
},
|
||||
onNegativeClick: () => {
|
||||
// message.error('取消');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -316,15 +300,6 @@
|
||||
params.value = values;
|
||||
reloadTable();
|
||||
}
|
||||
|
||||
function updateStatus(id, status) {
|
||||
Status({ id: id, status: status }).then((_res) => {
|
||||
message.success('操作成功');
|
||||
setTimeout(() => {
|
||||
reloadTable();
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user