Skip to content

Commit

Permalink
fix: 增加扩展列
Browse files Browse the repository at this point in the history
  • Loading branch information
DokiDoki1103 committed Oct 26, 2024
1 parent 1097ce2 commit 468785a
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions web/src/pages/TikuComponent/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</a-button>
</template>
<a-table :columns="columns" :data-source="data" :pagination="false" :row-key="record => record.id"
:loading="tabLoading">
:loading="tabLoading" :scroll="{ x: '2000px' }">
<template #type="{ record }">
<a-tag :color="record.type === 0 ? 'green' : record.type === 1 ? 'cyan' : 'orange'">
{{ quesType[record.type] }}
Expand All @@ -77,6 +77,14 @@
</a-tag>
</div>
</template>

<template #plat="{ record }">
<span>
{{getPlatStr(record.plat)}}
</span>
</template>


<template #action="{ record }">
<div style="display:flex;justify-content: space-between">
<a-button type="primary" ghost @click="showModal(record, 1)">编辑</a-button>
Expand Down Expand Up @@ -172,7 +180,7 @@ const columns = [
title: 'ID',
dataIndex: 'id',
key: 'id',
width: 80
width: 90
},
{
title: '类型',
Expand Down Expand Up @@ -203,6 +211,21 @@ const columns = [
customRender: 'answer',
},
},
{
title: '平台',
dataIndex: 'plat',
key: 'plat',
width: 100,
slots: {
customRender: 'plat',
},
},
{
title: '拓展参数',
dataIndex: 'extra',
key: 'extra',
width: 300,
},
{
title: '操作',
fixed: 'right',
Expand Down Expand Up @@ -326,7 +349,14 @@ export default defineComponent({
})
}
}
},
getPlatStr(plat){
for (let valueElement of platType.value) {
if (plat === valueElement.value){
return valueElement.label
}
}
},
async getPlat() {
const list = await getPlat()
Expand All @@ -338,7 +368,6 @@ export default defineComponent({
}
})
}
console.log('platType===>', platType.value)
},
async fetchData() {
fileList.value = []
Expand Down

0 comments on commit 468785a

Please sign in to comment.