fix:增加课程审核时间字段,类型搜索问题修复

This commit is contained in:
wuyx
2022-11-30 15:41:00 +08:00
parent a2e699571c
commit 29ba6dd15d
2 changed files with 104 additions and 142 deletions

View File

@@ -14,35 +14,24 @@
<div class="tmplh_inp">
<div class="inpbox">
<div class="inpbox1">
<a-select
v-model:value="valueproj"
value-key="value"
:options="[{label:'请选择内容分类',value:''},...calssifyList]"
/>
<a-select v-model:value="valueproj" value-key="value"
:options="[{ label: '请选择内容分类', value: '' }, ...calssifyList]" />
</div>
<div class="inpbox1">
<a-input
v-model:value="valuecreater"
style="
<a-input v-model:value="valuecreater" style="
width: 270px;
height: 40px;
border-radius: 8px;
margin-right: 14px;
"
placeholder="请输入创建人"
/>
" placeholder="请输入创建人" />
</div>
<div class="inpbox1">
<a-input
v-model:value="valuename"
style="
<a-input v-model:value="valuename" style="
width: 270px;
height: 40px;
border-radius: 8px;
margin-right: 14px;
"
placeholder="请输入名称"
/>
" placeholder="请输入名称" />
</div>
</div>
</div>
@@ -59,28 +48,13 @@
</div>
<div class="tmpl_body">
<div class="tmpl_tabbox">
<a-table
:columns="columns1"
:data-source="tableData1"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
@expand="expandTable"
:scroll="{ x: 1300 }"
:pagination="false"
/>
<a-table :columns="columns1" :data-source="tableData1" :loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true" @expand="expandTable" :scroll="{ x: 1300 }" :pagination="false" />
</div>
<div class="tableBox">
<div class="pa">
<a-pagination
v-if="total > 10"
showSizeChanger="true"
show-quick-jumper
:pageSize="pageSize"
v-model:current="currentPage"
:total="total"
class="pagination"
@change="changePagination"
/>
<a-pagination v-if="total > 10" showSizeChanger="true" show-quick-jumper :pageSize="pageSize"
v-model:current="currentPage" :total="total" class="pagination" @change="changePagination" />
</div>
</div>
</div>
@@ -88,9 +62,10 @@
</div>
</template>
<script>
import {reactive, toRefs, onMounted} from "vue";
import {courseListView} from "../../api/indexAudit";
import { reactive, toRefs, onMounted } from "vue";
import { courseListView } from "../../api/indexAudit";
import * as api1 from "@/api/index1";
import { toDate } from "../../api/method";
export default {
name: "CoursereViewed",
@@ -128,7 +103,7 @@ export default {
dataIndex: "content",
key: "content",
align: "center",
customRender: ({text}) => state.calssifyList.find(e => e.value == text)?.label,
customRender: ({ text }) => state.calssifyList.find(e => e.value == text)?.label,
},
{
title: "审核状态",
@@ -147,6 +122,11 @@ export default {
dataIndex: "time",
key: "time",
align: "center",
customRender: (time) => {
console.log(time)
return <div style="color:#387DF7">{toDate(time, "Y-M-D h:m")}</div>;
},
},
{
title: "审核说明",
@@ -154,15 +134,15 @@ export default {
key: "msg",
align: "center",
},
{
title: "操作",
dataIndex: "opt",
key: "opt",
align: "center",
customRender: () => {
return <div style="color:#387DF7">审核日志</div>;
},
},
// {
// title: "操作",
// dataIndex: "opt",
// key: "opt",
// align: "center",
// customRender: () => {
// return <div style="color:#387DF7">审核日志</div>;
// },
// },
],
tableData1: [
// {
@@ -180,24 +160,25 @@ export default {
const getList = () => {
let objn = {
auditStatus: 0,
categoryId: state.valueproj,
categoryId: Number(state.valueproj),
createName: state.valuecreater,
name: state.valuename,
pageNo: state.currentPage,
pageSize: 10,
};
console.log(objn)
courseListView(objn)
.then((res) => {
console.log("获取已审核课程成功", res.data.data);
state.total = res.data.data.total;
setTableData(res.data.data.rows);
})
.catch((err) => {
console.log("获取已审核课程失败", err);
});
.then((res) => {
console.log("获取已审核课程成功", res.data.data);
state.total = res.data.data.total;
setTableData(res.data.data.rows);
})
.catch((err) => {
console.log("获取已审核课程失败", err);
});
};
const setTableData = (table) => {
if(!table || !table.length){
if (!table || !table.length) {
state.tableData1 = []
return
}
@@ -210,17 +191,17 @@ export default {
type: item.type == 1 ? "线上" : "线下",
content: item.categoryId,
status:
item.auditStatus == 0
? "未提交"
: item.auditStatus == 1
? "提交待审核"
: item.auditStatus == 2
? "通过"
: item.auditStatus == -1
? "拒绝"
: "-",
item.auditStatus == 0
? "未提交"
: item.auditStatus == 1
? "提交待审核"
: item.auditStatus == 2
? "通过"
: item.auditStatus == -1
? "拒绝"
: "-",
creater: item.createName,
time: "-",
time: item.createTime,
msg: item.description || "-",
};
array.push(obj);
@@ -229,9 +210,9 @@ export default {
};
const reset = () => {
(state.valueproj = ''),
(state.valuecreater = null),
(state.valuename = null),
getList();
(state.valuecreater = null),
(state.valuename = null),
getList();
};
const changePagination = (pagina) => {
state.currentPage = pagina;
@@ -246,7 +227,7 @@ export default {
onMounted(async () => {
getList();
//获取分类列表
state.calssifyList = (await getDictList("faceclassClass")).map(e => ({label: e.dictName, value: e.dictCode}))
state.calssifyList = (await getDictList("faceclassClass")).map(e => ({ label: e.dictName, value: e.dictCode }))
});
return {
...toRefs(state),