|
@@ -1,7 +1,7 @@
|
|
|
<script setup>
|
|
|
import spzz1 from '~/assets/spzz1.png'
|
|
|
import spzz2 from '~/assets/spzz2.png'
|
|
|
-
|
|
|
+import { downLoadFile1 } from '~/utils/download'
|
|
|
// import { szr_list } from './api'
|
|
|
|
|
|
const router = useRouter()
|
|
@@ -20,7 +20,7 @@ const statusData = ref([
|
|
|
status: '2',
|
|
|
},
|
|
|
])
|
|
|
-
|
|
|
+const spzzListRef = ref()
|
|
|
const fields = ref({
|
|
|
id: 'axm_id',
|
|
|
name: 'axm_title',
|
|
@@ -38,7 +38,7 @@ let twoData = $ref([
|
|
|
},
|
|
|
])
|
|
|
let threeData = $ref([])
|
|
|
-async function initData(num) {
|
|
|
+async function initSZRData(num) {
|
|
|
const { code, data } = await request({ url: '/aimooc/xnszr_img/index', data: { axi_type: num } })
|
|
|
if (code === '1') {
|
|
|
if (num === 1)
|
|
@@ -47,8 +47,8 @@ async function initData(num) {
|
|
|
threeData = data.page_data
|
|
|
}
|
|
|
}
|
|
|
-initData(1)
|
|
|
-initData(2)
|
|
|
+initSZRData(1)
|
|
|
+initSZRData(2)
|
|
|
|
|
|
function changeStatus(status) {
|
|
|
params.value.axm_status = status
|
|
@@ -63,13 +63,50 @@ function linkTo(type) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+let checkedData = $ref([])
|
|
|
function initCheckData(data) {
|
|
|
console.log(data, 888)
|
|
|
+ checkedData = [...data]
|
|
|
}
|
|
|
|
|
|
-function handleCreate() {
|
|
|
-
|
|
|
+async function handleCreate() {
|
|
|
+ if (checkedData.length === 0) {
|
|
|
+ ElMessage.error('请先选择数据!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const arr = checkedData.map((item) => {
|
|
|
+ return item[fields.value.id]
|
|
|
+ })
|
|
|
+ const { code } = await request({ url: `/aimooc/${catalog.value}/submit_check`, data: { axm_ids: arr.join(',') } })
|
|
|
+ if (code === '1') {
|
|
|
+ ElMessage.success('提交成功!')
|
|
|
+ checkedData = [];
|
|
|
+ spzzListRef.value.initData()
|
|
|
+ }
|
|
|
+}
|
|
|
+function handleEdit() {
|
|
|
+
|
|
|
}
|
|
|
+function handleDownload(item) {
|
|
|
+ console.log(item);
|
|
|
+ if (!item.axm_video) {
|
|
|
+ ElMessage.error('暂无资源!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const ext = item.axm_video.split('.').at(-1).split('?')[0]
|
|
|
+ console.log(ext);
|
|
|
+ downLoadFile1(item.axm_video, `${item.axm_title}.${ext}`)
|
|
|
+}
|
|
|
+function handleEnter(item) {
|
|
|
+ console.log(item.axm_id);
|
|
|
+ router.push({
|
|
|
+ path: `spzz/hjss`,
|
|
|
+ query: {
|
|
|
+ axm_id: item.axm_id
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
let activeName = $ref('1')
|
|
|
function handleMore(i) {
|
|
|
moreVisible = true
|
|
@@ -110,10 +147,10 @@ function handleChoose(i, item) {
|
|
|
</div>
|
|
|
<div
|
|
|
v-for="(item, i) in twoData" v-show="i < 4"
|
|
|
- :key="i" class="mr-20px cursor-pointer rounded-10px bg-white px-30px py-15px text-center"
|
|
|
+ :key="i" class="w-183px mr-20px cursor-pointer rounded-10px bg-white px-30px py-15px text-center"
|
|
|
>
|
|
|
- <div class="m-auto h-86px w-86px flex items-center justify-center overflow-hidden rounded-1/2 bg-hex-f9f9f9">
|
|
|
- <img :src="item.axi_img" alt="">
|
|
|
+ <div class="mx-auto h-86px w-86px flex items-center justify-center overflow-hidden rounded-1/2 bg-hex-f9f9f9 bg-cover bg-top" :style="{ backgroundImage: `url(${item.axi_img})` }">
|
|
|
+ <!-- <img :src="item.axi_img" alt=""> -->
|
|
|
</div>
|
|
|
<div class="mt-10px text-sm">
|
|
|
{{ item.axi_name }}
|
|
@@ -145,10 +182,10 @@ function handleChoose(i, item) {
|
|
|
</div>
|
|
|
<div
|
|
|
v-for="(item, i) in threeData"
|
|
|
- v-show="i < 4" :key="i" class="mr-20px cursor-pointer rounded-10px bg-white px-30px py-15px text-center"
|
|
|
+ v-show="i < 4" :key="i" class="mr-20px cursor-pointer rounded-10px bg-white px-30px py-15px text-center w-183px"
|
|
|
>
|
|
|
- <div class="m-auto h-86px w-86px flex items-center justify-center overflow-hidden rounded-50px bg-hex-f9f9f9">
|
|
|
- <img :src="item.axi_img" alt="">
|
|
|
+ <div class="m-auto h-86px w-86px flex items-center justify-center rounded-50px bg-hex-f9f9f9 bg-cover bg-top" :style="{backgroundImage: `url(${item.axi_img})`}">
|
|
|
+ <!-- <img :src="item.axi_img" alt=""> -->
|
|
|
</div>
|
|
|
<div class="mt-10px text-sm">
|
|
|
{{ item.axi_name }}
|
|
@@ -181,8 +218,8 @@ function handleChoose(i, item) {
|
|
|
</div>
|
|
|
|
|
|
<CommonList
|
|
|
- class="flex-1" :to="catalog" :d="params" :fields="fields" :show-check="true"
|
|
|
- @checkValue="initCheckData"
|
|
|
+ class="flex-1" ref="spzzListRef" :to="catalog" :d="params" :fields="fields" :show-check="true"
|
|
|
+ @checkValue="initCheckData" @edit="handleEdit" @download="handleDownload" @enter="handleEnter"
|
|
|
/>
|
|
|
<el-dialog v-model="moreVisible" title="查看更多">
|
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
@@ -191,13 +228,13 @@ function handleChoose(i, item) {
|
|
|
</el-tabs>
|
|
|
<div class="flex flex-wrap">
|
|
|
<div
|
|
|
- v-for="(item, i) in activeName === 1 ? twoData : threeData"
|
|
|
+ v-for="(item, i) in activeName === '1' ? twoData : threeData"
|
|
|
:key="i"
|
|
|
class="shadow_gray my-10px mr-20px h-154px w-183px cursor-pointer rounded-10px bg-white px-30px py-15px text-center"
|
|
|
:class="axi_id === item.axi_id ? 'shadow_green' : 'shadow_gray'" @click="handleChoose(i, item)"
|
|
|
>
|
|
|
- <div class="m-auto h-86px w-86px flex items-center justify-center overflow-hidden rounded-50px bg-hex-f9f9f9">
|
|
|
- <img :src="item.axi_img" alt="">
|
|
|
+ <div class="m-auto h-86px w-86px flex items-center justify-center overflow-hidden rounded-50px bg-hex-f9f9f9 bg-cover bg-top" :style="{ backgroundImage: `url(${item.axi_img})` }">
|
|
|
+ <!-- <img :src="item.axi_img" alt=""> -->
|
|
|
</div>
|
|
|
<div class="mt-10px text-sm">
|
|
|
{{ item.axi_name }}
|
|
@@ -247,6 +284,9 @@ function handleChoose(i, item) {
|
|
|
color: #000 !important;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
+ .common_list{
|
|
|
+ overflow: visible;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.shadow_gray {
|