|
@@ -6,9 +6,12 @@
|
|
<!-- 页面搜索 -->
|
|
<!-- 页面搜索 -->
|
|
<div>
|
|
<div>
|
|
<a-form :model="searchData" layout="inline" >
|
|
<a-form :model="searchData" layout="inline" >
|
|
- <a-form-item>
|
|
|
|
- <a-button type="primary" @click="add">新视频</a-button>
|
|
|
|
- </a-form-item>
|
|
|
|
|
|
+ <a-form-item>
|
|
|
|
+ <a-button class="reset" @click="back()">返回</a-button>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item>
|
|
|
|
+ <a-button type="primary" @click="add">新视频</a-button>
|
|
|
|
+ </a-form-item>
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -26,11 +29,11 @@
|
|
>
|
|
>
|
|
<template #bodyCell="{ column, record }">
|
|
<template #bodyCell="{ column, record }">
|
|
<!-- 图片样式 -->
|
|
<!-- 图片样式 -->
|
|
- <template v-if="column.key === 'img'">
|
|
|
|
|
|
+ <template v-if="column.key === 'coverimg'">
|
|
<a-image
|
|
<a-image
|
|
:width="40"
|
|
:width="40"
|
|
:height="40"
|
|
:height="40"
|
|
- :src="record.img"
|
|
|
|
|
|
+ :src="record.coverimg"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
<!-- 任务状态 -->
|
|
<!-- 任务状态 -->
|
|
@@ -94,6 +97,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
+ import { useRoute, useRouter } from 'vue-router'
|
|
import { defineComponent,onMounted,ref } from 'vue'
|
|
import { defineComponent,onMounted,ref } from 'vue'
|
|
|
|
|
|
import uploadImg from "../../components/upload-img.vue";
|
|
import uploadImg from "../../components/upload-img.vue";
|
|
@@ -111,6 +115,11 @@
|
|
CloseCircleTwoTone
|
|
CloseCircleTwoTone
|
|
},
|
|
},
|
|
setup() {
|
|
setup() {
|
|
|
|
+ const router = useRouter()
|
|
|
|
+ const route = useRoute();
|
|
|
|
+ const back = () => {
|
|
|
|
+ router.back();
|
|
|
|
+ };
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
// 搜索数据
|
|
// 搜索数据
|
|
const searchData = ref({
|
|
const searchData = ref({
|
|
@@ -134,9 +143,9 @@
|
|
//获取请求列表
|
|
//获取请求列表
|
|
const getData = async(e) =>{
|
|
const getData = async(e) =>{
|
|
const { code, data ,count} = await curriculAJAXREQUEST({
|
|
const { code, data ,count} = await curriculAJAXREQUEST({
|
|
- path: AJAXPATH.bannerList.path,
|
|
|
|
- method: AJAXPATH.bannerList.method,
|
|
|
|
- data: {},
|
|
|
|
|
|
+ path: AJAXPATH.chapterList.path,
|
|
|
|
+ method: "get",
|
|
|
|
+ data: {id:projectId.value},
|
|
});
|
|
});
|
|
if(code == 0){
|
|
if(code == 0){
|
|
dataList.value = data
|
|
dataList.value = data
|
|
@@ -168,7 +177,7 @@
|
|
const delSubmit = async(id) =>{
|
|
const delSubmit = async(id) =>{
|
|
// delempower(id)
|
|
// delempower(id)
|
|
const { code} = await curriculAJAXREQUEST({
|
|
const { code} = await curriculAJAXREQUEST({
|
|
- path: AJAXPATH.bannerList.path +"/"+ id,
|
|
|
|
|
|
+ path: AJAXPATH.chapterList.path +"/"+ id,
|
|
method: 'DELETE',
|
|
method: 'DELETE',
|
|
});
|
|
});
|
|
if(code == 0){
|
|
if(code == 0){
|
|
@@ -216,7 +225,7 @@
|
|
// )
|
|
// )
|
|
// if(!status){
|
|
// if(!status){
|
|
const { code} = await curriculAJAXREQUEST({
|
|
const { code} = await curriculAJAXREQUEST({
|
|
- path: AJAXPATH.bannerList.path +"/"+ addData.value.id,
|
|
|
|
|
|
+ path: AJAXPATH.chapterList.path +"/"+ addData.value.id,
|
|
method: 'put',
|
|
method: 'put',
|
|
data: addData.value,
|
|
data: addData.value,
|
|
});
|
|
});
|
|
@@ -230,7 +239,7 @@
|
|
// addData.value
|
|
// addData.value
|
|
// )
|
|
// )
|
|
const { code} = await curriculAJAXREQUEST({
|
|
const { code} = await curriculAJAXREQUEST({
|
|
- path: AJAXPATH.bannerList.path,
|
|
|
|
|
|
+ path: AJAXPATH.chapterList.path,
|
|
method: 'POST',
|
|
method: 'POST',
|
|
data: addData.value,
|
|
data: addData.value,
|
|
});
|
|
});
|
|
@@ -254,7 +263,7 @@
|
|
//
|
|
//
|
|
console.log(record.id,record.status);
|
|
console.log(record.id,record.status);
|
|
const { code} = await curriculAJAXREQUEST({
|
|
const { code} = await curriculAJAXREQUEST({
|
|
- path: AJAXPATH.bannerList.path +"/"+ record.id,
|
|
|
|
|
|
+ path: AJAXPATH.chapterList.path +"/"+ record.id,
|
|
method: 'put',
|
|
method: 'put',
|
|
data: record,
|
|
data: record,
|
|
});
|
|
});
|
|
@@ -317,15 +326,24 @@
|
|
}
|
|
}
|
|
};
|
|
};
|
|
//页面加载
|
|
//页面加载
|
|
|
|
+ const projectId = ref(null);
|
|
onMounted(() =>{
|
|
onMounted(() =>{
|
|
- getData()
|
|
|
|
- rowDrop()
|
|
|
|
|
|
+ if (route.query.id) {
|
|
|
|
+ projectId.value = route.query.id;
|
|
|
|
+ getData();
|
|
|
|
+ rowDrop()
|
|
|
|
+ }
|
|
|
|
+ // getData()
|
|
})
|
|
})
|
|
|
|
|
|
return{
|
|
return{
|
|
|
|
+ route,
|
|
|
|
+ router,
|
|
|
|
+ back,
|
|
shopTable,
|
|
shopTable,
|
|
formRef,
|
|
formRef,
|
|
rules,
|
|
rules,
|
|
|
|
+ projectId,
|
|
columns:[
|
|
columns:[
|
|
{
|
|
{
|
|
title: "序号",
|
|
title: "序号",
|
|
@@ -337,23 +355,14 @@
|
|
rowDrag: true,
|
|
rowDrag: true,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "首页头图名称",
|
|
|
|
|
|
+ title: "名称",
|
|
key: "name",
|
|
key: "name",
|
|
- dataIndex: "name",
|
|
|
|
|
|
+ dataIndex: "title",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: "图片地址",
|
|
|
|
- key: "img",
|
|
|
|
- dataIndex: "img",
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: "链接地址",
|
|
|
|
- key: "href",
|
|
|
|
- dataIndex: "href",
|
|
|
|
- },
|
|
|
|
- { title: "状态",
|
|
|
|
- key: "switch",
|
|
|
|
- dataIndex: "status",
|
|
|
|
|
|
+ title: "视频封面",
|
|
|
|
+ key: "coverimg",
|
|
|
|
+ dataIndex: "coverimg",
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: "创建时间",
|
|
title: "创建时间",
|