Compare commits

..

No commits in common. "2d9003bca3648fb4f461759c5b2e9aa446160c5c" and "7b7fb5f67ad0a049c15aad0197f6e2aa1b965d37" have entirely different histories.

3 changed files with 14 additions and 93 deletions

View File

@ -4,7 +4,7 @@ export const columns = [
{
type: 'selection',
width: 50,
fixed: 'left',
fixed:"left"
},
{
title: 'ID',
@ -15,24 +15,20 @@ export const columns = [
{
title: '消息标题',
key: 'title',
width: 250,
},
{
title: '消息状态',
key: 'status',
width: 100,
customRender({ record }) {
return h('span', record.status === 1 ? '已读' : '未读');
return h('span', record.status === 1 ? '已读' : '未读')
},
},
{
title: '创建人',
key: 'createUser',
width: 100,
},
{
title: '创建时间',
key: 'createTime',
width: 180,
},
];

View File

@ -28,10 +28,6 @@
import { onMounted, reactive } from 'vue';
const emit = defineEmits(['success', 'update:visible']);
/**
* 定义表单参数
*/
const formData = reactive({
id: '',
title: '',
@ -41,9 +37,6 @@
content: '',
});
/**
* 定义接收的参数
*/
const props = defineProps({
visible: {
type: Boolean,
@ -56,26 +49,16 @@
default: 0,
},
});
/**
* 定义模态
*/
const [modalRegister, { openModal }] = useModal({
title: '日志详情',
subBtuText: '确定',
width: 600,
});
/**
* 关闭弹窗
*/
const dialogClose = () => {
emit('update:visible', false);
};
/**
* 设置表单参数
*/
const setFormData = async () => {
const data = await getMessageDetail(props.messageId);
for (const key in formData) {
@ -85,11 +68,6 @@
}
}
};
/**
* 获取类型文本描述
* @param type 类型
*/
const getTyepText = (type) => {
let typeText = '';
switch (type) {
@ -108,18 +86,12 @@
return typeText;
};
/**
* 钩子函数
*/
onMounted(() => {
if (props.messageId) {
setFormData();
}
});
/**
* 定义函数
*/
//
defineExpose({
openModal,
});

View File

@ -43,7 +43,8 @@
v-model:visible="editVisible"
ref="createModalRef"
@success="reloadTable('noRefresh')"
/>
>
</editDialog>
</PageWrapper>
</template>
@ -61,29 +62,10 @@
import editDialog from './edit.vue';
import { useMessage, useDialog } from 'naive-ui';
import { renderIcon } from '@/utils';
/**
* 定义参数
*/
const messageId = ref(0);
const message = useMessage();
const dialog = useDialog();
const activeName = ref(1);
const editVisible = ref(false);
const createModalRef = ref();
const selectionData = ref([]);
const tableRef = ref();
/**
* 定义查询参数
*/
const formParams = reactive({
type: 1,
});
/**
* 定义数据源
*/
const messageTypeList = ref([
{
name: '系统通知',
@ -98,11 +80,14 @@
value: 3,
},
]);
const editVisible = ref(false);
const createModalRef = ref();
const selectionData = ref([]);
const tableRef = ref();
const formParams = reactive({
type: 1,
});
/**
* 加载数据列表
* @param res 参数
*/
const loadDataTable = async (res: any) => {
selectionData.value = [];
const result = await getMessageProfile({ ...formParams, ...res });
@ -110,10 +95,6 @@
item.number = result.number;
return result;
};
/**
* 定义操作栏
*/
const actionColumn = reactive({
width: 300,
title: '操作',
@ -134,7 +115,7 @@
label: '详情',
icon: renderIcon(EyeOutlined),
type: 'info',
onClick: handleDetail.bind(null, record),
onClick: handleInfo.bind(null, record),
},
{
label: '删除',
@ -146,40 +127,22 @@
});
},
});
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') {
tableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
}
/**
* 执行点击事件
* @param e 参数
*/
const handleClick = (e) => {
activeName.value = e;
formParams.type = e;
reloadTable();
};
/**
* 执行查看详情
* @param record 参数
*/
const handleDetail = async (record) => {
const handleInfo = async (record) => {
messageId.value = record.id;
editVisible.value = true;
await nextTick();
createModalRef.value.openModal();
};
/**
* 执行删除
* @param record 参数
*/
async function handleDelete(record) {
dialog.warning({
title: '提示',
@ -193,11 +156,6 @@
},
});
}
/**
* 执行设置已读
* @param id 参数
*/
async function handleSetRead(id) {
dialog.warning({
title: '提示',
@ -211,11 +169,6 @@
},
});
}
/**
* 数据行选中事件
* @param value 参数
*/
function onSelectionChange(value) {
selectionData.value = value;
}