驾校关联
This commit is contained in:
@@ -1,7 +1,102 @@
|
||||
<template>
|
||||
<div> 关键话术 </div>
|
||||
<div>
|
||||
<el-form :model="searchForm" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.question"
|
||||
placeholder="请输入问题"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" plain @click="handleAdd">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="tableList">
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="问题" align="center" prop="question" />
|
||||
<el-table-column label="答案" align="center" prop="content">
|
||||
<template #default="scope">
|
||||
<p v-dompurify-html="scope.row.content"></p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关键词" align="center" prop="skillKey" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" text @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button type="primary" text @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNum"
|
||||
:total="total"
|
||||
@pagination="handleQuery"
|
||||
/>
|
||||
<DialogSkill ref="skillDialog" @success="handleQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
<script setup name="ClueSkill">
|
||||
import DialogSkill from './Comp/DialogSkill.vue'
|
||||
|
||||
const skillDialog = ref()
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
question: '',
|
||||
pageSize: 20,
|
||||
pageNum: 1
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
|
||||
const tableList = ref([])
|
||||
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
question: '',
|
||||
pageSize: 20,
|
||||
pageNum: 1
|
||||
}
|
||||
getList()
|
||||
}
|
||||
|
||||
function handleQuery() {
|
||||
searchForm.value.pageNum = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
function getList() {
|
||||
tableList.value = [{ question: '测试' }]
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
skillDialog.value.open('create', null)
|
||||
}
|
||||
|
||||
function handleUpdate(row) {
|
||||
skillDialog.value.open('update', row)
|
||||
}
|
||||
|
||||
async function handleDelete(row) {
|
||||
try {
|
||||
console.log(row)
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
// await UserApi.deleteUser(row.id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user