更新数据
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div class="titleBox">
|
||||
<PageTitle title="保安题库">
|
||||
<el-button type="primary" @click="addEdit('add', '')">
|
||||
<el-button type="primary" @click="addEdit('add', null)">
|
||||
<el-icon style="vertical-align: middle">
|
||||
<CirclePlus />
|
||||
</el-icon>
|
||||
@ -22,11 +22,19 @@
|
||||
<template #type="{ row }">
|
||||
<DictTag :value="row.type" :tag="false" :options="D_BAXX_KTLX" />
|
||||
</template>
|
||||
<template #answer="{ row }">
|
||||
<span v-if="row.type == '01' || row.type == '02'">
|
||||
<span v-for="val in row.correctAnswer" class="flex items-center just-center">
|
||||
<DictTag :value="val" :tag="false" :options="D_BA_TKDA" />、
|
||||
</span>
|
||||
</span>
|
||||
<span v-else>{{ row.isTrue }}</span>
|
||||
</template>
|
||||
<!-- 操作 -->
|
||||
<template #controls="{ row }">
|
||||
<el-link type="primary" link @click="addEdit('edit', row)">编辑</el-link>
|
||||
<el-link type="primary" link @click="addEdit('detail', row)">详情</el-link>
|
||||
<el-link type="danger" link @click="handleDelete(row.id)">删除</el-link>
|
||||
<el-link type="danger" link @click="handleDelete([row.id])">删除</el-link>
|
||||
</template>
|
||||
</MyTable>
|
||||
<Pages @changeNo="changeNo" @changeSize="changeSize" :tableHeight="pageData.tableHeight" :pageConfiger="{
|
||||
@ -35,7 +43,7 @@
|
||||
}"></Pages>
|
||||
</div>
|
||||
<!-- 详情 -->
|
||||
<DetailForm ref="detailDiloag" @refresh="getList" />
|
||||
<DetailForm ref="detailDiloag" :dic="{D_BAXX_KTLX,D_BA_TKDA,D_BA_TKDA_PDT}" @refresh="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -45,13 +53,13 @@ import MyTable from "@/components/aboutTable/MyTable.vue";
|
||||
import Pages from "@/components/aboutTable/Pages.vue";
|
||||
import Search from "@/components/aboutTable/Search.vue";
|
||||
import DetailForm from "./components/detailForm.vue";
|
||||
import { qcckGet, qcckPost, qcckDelete } from "@/api/qcckApi.js";
|
||||
import { qcckPost } from "@/api/qcckApi.js";
|
||||
import { reactive, ref, onMounted, getCurrentInstance, nextTick } from "vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { D_BAXX_KTLX,D_BA_TKDA,D_BA_TKDA_PDT } = proxy.$dict("D_BAXX_KTLX",'D_BA_TKDA','D_BA_TKDA_PDT');
|
||||
|
||||
const detailDiloag = ref();
|
||||
const searchBox = ref(); //搜索框
|
||||
const baseUrl = 'data:image/jpeg;base64,'
|
||||
const searchConfiger = ref([
|
||||
{
|
||||
label: "题目",
|
||||
@ -84,7 +92,7 @@ const pageData = reactive({
|
||||
{ label: "选项C", prop: "optionC" },
|
||||
{ label: "选项D", prop: "optionD" },
|
||||
{ label: "选项E", prop: "optionE" },
|
||||
{ label: "答案", prop: "answer"}
|
||||
{ label: "答案", prop: "answer", showSolt: true}
|
||||
]
|
||||
});
|
||||
|
||||
@ -114,7 +122,13 @@ const getList = () => {
|
||||
pageData.tableConfiger.loading = true;
|
||||
let data = { ...pageData.pageConfiger, ...queryFrom.value };
|
||||
qcckPost(data, "/mosty-base/baxx/tkgl/page").then((res) => {
|
||||
pageData.tableData = res.records || [];
|
||||
let arr = res.records || []
|
||||
arr.forEach(item => {
|
||||
item.correctAnswer = item.correctAnswer.split(',')
|
||||
console.log(item.correctAnswer);
|
||||
|
||||
});
|
||||
pageData.tableData = arr;
|
||||
pageData.total = res.total;
|
||||
pageData.tableConfiger.loading = false;
|
||||
}).catch(() => {
|
||||
@ -126,7 +140,7 @@ const getList = () => {
|
||||
// 删除
|
||||
const handleDelete = (ids) => {
|
||||
proxy.$modal.confirm("是否确认删除该题目?").then(() => {
|
||||
qcckPost({ ids }, "/mosty-base/baxx/tkgl/remove").then(() => {
|
||||
qcckPost(ids, "/mosty-base/baxx/tkgl/remove").then(() => {
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
getList();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user