This commit is contained in:
zjl 2025-04-10 16:38:29 +08:00
parent 9ca68e5a8d
commit c9d9c78028
5 changed files with 36 additions and 20 deletions

View File

@ -14,12 +14,12 @@ export const columns = [
{ {
label: '消息标题', label: '消息标题',
prop: 'title', prop: 'title',
width: 250, minWidth: 250,
}, },
{ {
label: '消息状态', label: '消息状态',
prop: 'status', prop: 'status',
width: 100, minWidth: 100,
render(record) { render(record) {
return h('span', record.row.status === 1 ? '已读' : '未读'); return h('span', record.row.status === 1 ? '已读' : '未读');
}, },
@ -27,7 +27,7 @@ export const columns = [
{ {
label: '创建人', label: '创建人',
prop: 'createUser', prop: 'createUser',
width: 100, minWidth: 100,
}, },
{ {
label: '创建时间', label: '创建时间',

View File

@ -6,10 +6,12 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="dialogClose" :before-close="dialogClose"
> >
<el-descriptions column="2"> <el-descriptions column="2" border>
<el-descriptions-item label="消息标题:">{{ formData.title }}</el-descriptions-item> <el-descriptions-item label="消息标题:" label-class-name="des-width">{{
<el-descriptions-item label="消息类型:">{{ formData.title
getTyepText(formData.type) }}</el-descriptions-item>
<el-descriptions-item label="消息类型:" label-class-name="des-width">{{
getTypeText(formData.type)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="业务类型:">{{ <el-descriptions-item label="业务类型:">{{
formData.bizType == 1 ? '订单' : '其他' formData.bizType == 1 ? '订单' : '其他'
@ -17,7 +19,11 @@
<el-descriptions-item label="消息状态:">{{ <el-descriptions-item label="消息状态:">{{
formData.status == 1 ? '已读' : '未读' formData.status == 1 ? '已读' : '未读'
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="消息内容:">{{ formData.content }}</el-descriptions-item> </el-descriptions>
<el-descriptions class="margin-top" :column="1" border>
<el-descriptions-item label="消息内容" label-class-name="des-width">
{{ formData.content }}
</el-descriptions-item>
</el-descriptions> </el-descriptions>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
@ -84,7 +90,7 @@
* 获取类型文本描述 * 获取类型文本描述
* @param type 类型 * @param type 类型
*/ */
const getTyepText = (type) => { const getTypeText = (type) => {
let typeText = ''; let typeText = '';
switch (type) { switch (type) {
case 1: case 1:
@ -111,3 +117,11 @@
} }
}); });
</script> </script>
<style lang="scss" scoped>
:deep(.des-width) {
width: 120px;
}
:deep(.el-descriptions__body .el-descriptions__table .el-descriptions__cell) {
word-break: break-all;
}
</style>

View File

@ -105,7 +105,7 @@
{ {
label: '确认', label: '确认',
icon: 'Check', icon: 'Check',
type: 'warning', type: 'primary',
onClick: handleSetRead.bind(null, record), onClick: handleSetRead.bind(null, record),
}, },
{ {

View File

@ -8,37 +8,37 @@ export const columns = [
{ {
label: '数据表名称', label: '数据表名称',
prop: 'tableName', prop: 'tableName',
width: 150, minWidth: 150,
}, },
{ {
label: '数据表描述', label: '数据表描述',
prop: 'tableComment', prop: 'tableComment',
width: 150, minWidth: 150,
}, },
{ {
label: '数据表引擎', label: '数据表引擎',
prop: 'engine', prop: 'engine',
width: 100, minWidth: 100,
}, },
{ {
label: '数据表行数', label: '数据表行数',
prop: 'tableRows', prop: 'tableRows',
width: 100, minWidth: 100,
}, },
{ {
label: '数据表长度', label: '数据表长度',
prop: 'dataLength', prop: 'dataLength',
width: 100, minWidth: 100,
}, },
{ {
label: '数据表自增索引', label: '数据表自增索引',
prop: 'autoIncrement', prop: 'autoIncrement',
width: 150, minWidth: 150,
}, },
{ {
label: '数据表编码', label: '数据表编码',
prop: 'tableCollation', prop: 'tableCollation',
width: 150, minWidth: 150,
}, },
{ {
label: '创建时间', label: '创建时间',

View File

@ -151,11 +151,13 @@
async function handleBatchGenerator(record: Recordable) { async function handleBatchGenerator(record: Recordable) {
let names = []; let names = [];
if (!record) { if (!record) {
names = selectionData.value.map(({ tableName }) => tableName); names = selectionData.value.map(
({ tableName, tableComment }) => tableName + '|' + tableComment,
);
} }
await confirm('确定要批量一键生成吗?'); await confirm('确定要批量一键生成吗?');
record record
? await batchGenerator({ tableNames: record.row.tableName }) ? await batchGenerator({ tableNames: [record.row.tableName + '|' + record.row.tableComment] })
: await batchGenerator({ tableNames: names }); : await batchGenerator({ tableNames: names });
message('批量生成成功'); message('批量生成成功');
reloadTable(); reloadTable();
@ -166,7 +168,7 @@
* @param recored 数据记录 * @param recored 数据记录
*/ */
const handleGenerator = async (record: Recordable) => { const handleGenerator = async (record: Recordable) => {
await generator({ tableNames: [record.row.tableName] }); await generator({ tableNames: [record.row.tableName + '|' + record.row.tableComment] });
message('一键生成成功'); message('一键生成成功');
}; };