chroe: adjust ins page

This commit is contained in:
engigu
2024-01-20 13:57:57 +08:00
parent 1e0e745fea
commit 877f9d4211
4 changed files with 29 additions and 18 deletions
+6
View File
@@ -1,5 +1,7 @@
import { CONSTANT } from '@/constant'
class CommonUtils { class CommonUtils {
static formatInsConfigDisplay = (scope) => { static formatInsConfigDisplay = (scope) => {
@@ -15,6 +17,10 @@ class CommonUtils {
} }
} }
static formatWayName = (type) => {
return CONSTANT.WAYS_DATA_MAP[type].label;
}
} }
export { CommonUtils }; export { CommonUtils };
@@ -59,14 +59,14 @@
<el-table :data="insTableData" empty-text="发信实例为空" style="width: 100%" max-height="300" <el-table :data="insTableData" empty-text="发信实例为空" style="width: 100%" max-height="300"
:row-style="insRowStyle()"> :row-style="insRowStyle()">
<el-table-column prop="way_name" label="渠道名" /> <el-table-column prop="way_name" label="渠道名" />
<el-table-column prop="way_type" label="渠道+内容类型"> <el-table-column prop="way_type" label="渠道+内容类型" width="140px">
<template #default="scope"> <template #default="scope">
{{ scope.row.way_type }}+{{ scope.row.content_type }} {{ CommonUtils.formatWayName(scope.row.way_type) }}+{{ scope.row.content_type }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="way_type" label="额外信息"> <el-table-column prop="way_type" label="额外信息">
<template #default="scope"> <template #default="scope">
{{ formatExtraInfo(scope) }} {{ CommonUtils.formatInsConfigDisplay(scope) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="60px"> <el-table-column fixed="right" label="操作" width="60px">
@@ -201,13 +201,13 @@ export default defineComponent({
} }
} }
const formatExtraInfo = (scope) => { // const formatExtraInfo = (scope) => {
return CommonUtils.formatInsConfigDisplay(scope); // return CommonUtils.formatInsConfigDisplay(scope);
} // }
return { return {
...toRefs(state), handleCancer, handleSubmit, ...toRefs(state), handleCancer, handleSubmit,
searchID, formatExtraInfo, CONSTANT, searchID, CONSTANT, CommonUtils,
clickStore, insRowStyle clickStore, insRowStyle
}; };
}, },
@@ -61,14 +61,14 @@
<el-table :data="insTableData" empty-text="发信实例为空" style="width: 100%" max-height="300" <el-table :data="insTableData" empty-text="发信实例为空" style="width: 100%" max-height="300"
:row-style="insRowStyle()"> :row-style="insRowStyle()">
<el-table-column prop="way_name" label="渠道名" /> <el-table-column prop="way_name" label="渠道名" />
<el-table-column prop="way_type" label="渠道+内容类型" width="120px"> <el-table-column prop="way_type" label="渠道+内容类型" width="140px">
<template #default="scope"> <template #default="scope">
{{ scope.row.way_type }}+{{ scope.row.content_type }} {{ CommonUtils.formatWayName(scope.row.way_type) }}+{{ scope.row.content_type }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="way_type" label="额外信息"> <el-table-column prop="way_type" label="额外信息">
<template #default="scope"> <template #default="scope">
{{ formatExtraInfo(scope) }} {{ CommonUtils.formatInsConfigDisplay(scope) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" prop="status" width="60px"> <el-table-column label="状态" prop="status" width="60px">
@@ -188,9 +188,9 @@ export default defineComponent({
} }
} }
const formatExtraInfo = (scope) => { // const formatExtraInfo = (scope) => {
return CommonUtils.formatInsConfigDisplay(scope); // return CommonUtils.formatInsConfigDisplay(scope);
} // }
const searchID = async () => { const searchID = async () => {
const rsp = await request.get('/sendways/get', { params: { id: state.searchWayID } }); const rsp = await request.get('/sendways/get', { params: { id: state.searchWayID } });
@@ -242,8 +242,8 @@ export default defineComponent({
} }
return { return {
...toRefs(state), handleCancer, handleAddSubmit, handleEditTask, CONSTANT, ...toRefs(state), handleCancer, handleAddSubmit, handleEditTask, CONSTANT, CommonUtils,
searchID, handleDelete, insRowStyle, formatExtraInfo, updateInsEnableStatus searchID, handleDelete, insRowStyle, updateInsEnableStatus
}; };
}, },
}); });
@@ -19,7 +19,7 @@
<hr /> <hr />
<div ref="refContainer"> <div ref="refContainer">
<el-table :data="tableData" stripe empty-text="发信渠道为空" :row-style="rowStyle()"> <el-table :data="tableData" stripe empty-text="发信渠道为空" :row-style="rowStyle()">
<el-table-column label="ID" > <el-table-column label="ID">
<template #default="scope"> <template #default="scope">
{{ scope.row.id }} {{ scope.row.id }}
<el-icon> <el-icon>
@@ -28,7 +28,11 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="渠道名" prop="name" /> <el-table-column label="渠道名" prop="name" />
<el-table-column label="发信渠道" prop="type" /> <el-table-column label="发信渠道" prop="type">
<template #default="scope">
{{ CommonUtils.formatWayName(scope.row.type) }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="created_on" /> <el-table-column label="创建时间" prop="created_on" />
<el-table-column fixed="right" label="操作" width="100px"> <el-table-column fixed="right" label="操作" width="100px">
<template #default="scope"> <template #default="scope">
@@ -63,6 +67,7 @@ import { CopyDocument } from '@element-plus/icons-vue'
import { copyToClipboard } from '@/util/clipboard.js'; import { copyToClipboard } from '@/util/clipboard.js';
import tableDeleteButton from '@/views/common/tableDeleteButton.vue' import tableDeleteButton from '@/views/common/tableDeleteButton.vue'
import { CONSTANT } from '@/constant' import { CONSTANT } from '@/constant'
import { CommonUtils } from "@/util/commonUtils.js";
export default { export default {
components: { components: {
@@ -145,7 +150,7 @@ export default {
return { return {
...toRefs(state), handleEdit, handleDelete, ...toRefs(state), handleEdit, handleDelete,
clickAdd, rowStyle, handPageChange, filterFunc, copyToClipboard clickAdd, rowStyle, handPageChange, filterFunc, copyToClipboard, CommonUtils
}; };
} }
} }