Browse Source

ESlint语法

local_v3_liwenxuan
liwenxuan 2 years ago
parent
commit
f9a4199409
  1. 10
      src/views/knowledge/knowledge/components/KnowledgeContent.vue
  2. 5
      src/views/knowledge/knowledge/components/Navili.vue
  3. 15
      src/views/knowledge/knowledge/components/archivestype.vue
  4. 21
      src/views/knowledge/knowledge/index.vue
  5. 22
      src/views/knowledge/news/index.vue

10
src/views/knowledge/knowledge/components/KnowledgeContent.vue

@ -9,6 +9,7 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false default: false
}, },
// eslint-disable-next-line vue/require-default-prop
contentSource: { contentSource: {
type: Object type: Object
}, },
@ -54,17 +55,16 @@ watch(() => props.isShow, () => {
<template> <template>
<el-dialog v-model="boxShow" class="dialogStyle" :show-close="true"> <el-dialog v-model="boxShow" class="dialogStyle" :show-close="true">
<template #header="{ close, titleId, titleClass }"> <template #header="{ close, titleId, titleClass }">
<div class="my-header"> <div class="my-header" @dblclick="close">
<h4 :id="titleId" :class="titleClass" style="margin-top: 5px;">{{ props.contentSource?.gTitle }}</h4> <h4 :id="titleId" :class="titleClass" style="margin-top: 5px;">{{ props.contentSource?.gTitle }}</h4>
<!-- <h4 :id="titleId" :class="titleClass" style="margin-top: 5px;">{{ props.contentSource?.gContent }}</h4> --> <!-- <h4 :id="titleId" :class="titleClass" style="margin-top: 5px;">{{ props.contentSource?.gContent }}</h4> -->
</div> </div>
</template> </template>
<div style="padding-bottom: 20px;"><span>{{ formatDate(props.contentSource?.gAddTime) }}</span></div> <div style="padding-bottom: 20px;"><span>{{ formatDate(props.contentSource?.gAddTime) }}</span></div>
<iframe v-if="pdfIframeShow" :src="props.contentSource?.gTestUrl" frameborder="0" <iframe v-if="pdfIframeShow" :src="props.contentSource?.gTestUrl" frameborder="0" style=" z-index: 1000;height: 680px;width: 850px"></iframe>
style=" z-index: 1000;height: 680px;width: 850px"></iframe> <div style="height: auto;width: auto;" v-html="props.contentSource?.gContent"></div>
<div v-html="props.contentSource?.gContent" style="height: auto;width: auto;"></div>
<h5>评论区</h5> <h5 >评论区</h5>
</el-dialog> </el-dialog>
</template> </template>

5
src/views/knowledge/knowledge/components/Navili.vue

@ -2,6 +2,7 @@
const showli = ref(true); const showli = ref(true);
const props = defineProps({ const props = defineProps({
// eslint-disable-next-line vue/require-default-prop
oneli: { oneli: {
type: Object, type: Object,
@ -15,9 +16,11 @@ const props = defineProps({
type: Number, type: Number,
default: 0 default: 0
}, },
// eslint-disable-next-line vue/require-default-prop
knowledgeStore: { knowledgeStore: {
type: Object, type: Object,
}, },
// eslint-disable-next-line vue/require-default-prop
fatherisReady1: { fatherisReady1: {
type: Number, type: Number,
} }
@ -25,7 +28,7 @@ const props = defineProps({
</script> </script>
<template> <template>
<li :class="{ active: active === index }" v-if="showli"> <li v-if="showli" :class="{ active: active === index }">
{{ oneli?.atTitle }} {{ oneli?.atTitle }}
</li> </li>
</template> </template>

15
src/views/knowledge/knowledge/components/archivestype.vue

@ -11,10 +11,12 @@ import { useKnowledgeStore } from "@/store/modules/knowledge"
const showArea = ref(true); const showArea = ref(true);
const props = defineProps({ const props = defineProps({
// eslint-disable-next-line vue/require-default-prop
liContent: { liContent: {
type: Object, type: Object,
}, },
// eslint-disable-next-line vue/require-default-prop
routerUrl: { routerUrl: {
type: String, type: String,
}, },
@ -158,18 +160,17 @@ function showContentDialog(item: any) {
</script> </script>
<template> <template>
<div class="models "> <div class="models ">
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> <KnowledgeContent v-model:isShow="showContentBox" :content-source="cardContentSource"></KnowledgeContent>
<div class="model-title"> <div class="model-title">
<h3>{{ props.liContent?.atTitle }}</h3> <h3>{{ props.liContent?.atTitle }}</h3>
</div> </div>
<div v-show="!showCards" style="text-align: center;padding-top: 5%;">暂无数据</div> <div v-show="!showCards" style="text-align: center;padding-top: 5%;">暂无数据</div>
<div class="grid-tuijian" v-show="showCards"> <div v-show="showCards" class="grid-tuijian">
<div v-for="(item, index) in tuijianPage" :key="index" class="tuijian-card" @click="showContentDialog(item)"> <div v-for="(item, index1) in tuijianPage" :key="index1" class="tuijian-card" @click="showContentDialog(item)">
<img style="width: 170px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" <img style="width: 170px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
<div class="card-right"> <div class="card-right">
<span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span> <span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span>
@ -187,9 +188,7 @@ function showContentDialog(item: any) {
</div> </div>
</div> </div>
<el-pagination class="pagi" v-model:current-page="pageParamTuijian.page" v-if="pageParamTuijian.total > 0" <el-pagination v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" v-model:page-size="pageParamTuijian.pagesize" class="pagi" layout="prev, pager, next, jumper" :total="pageParamTuijian.total" @current-change="handleCurrentChange" />
v-model:page-size="pageParamTuijian.pagesize" layout="prev, pager, next, jumper" :total="pageParamTuijian.total"
@current-change="handleCurrentChange" />
</div> </div>
</template> </template>
<style> <style>

21
src/views/knowledge/knowledge/index.vue

@ -184,9 +184,8 @@ function scrollTo(index: any) {
推荐 推荐
</li> </li>
<template v-for="(item, index) in naviList"> <template v-for="(item, index) in naviList" :key="index">
<Navili :class="{ active: active === index+1 }" :oneli=item :index=(index+1) v-if="item.hasCard" :active=active <Navili v-if="item.hasCard" :class="{ active: active === index+1 }" :oneli=item :index=(index+1) :active=active @click="scrollTo(index + 1)"></Navili>
@click="scrollTo(index + 1)"></Navili>
</template> </template>
</ul> </ul>
@ -206,14 +205,12 @@ function scrollTo(index: any) {
<el-carousel indicator-position="outside" class="mycarousel" arrow="always"> <el-carousel indicator-position="outside" class="mycarousel" arrow="always">
<el-carousel-item v-for="(item, index) in carousel" :key="index" @click="showContentDialog(item)"> <el-carousel-item v-for="(item, index) in carousel" :key="index" @click="showContentDialog(item)">
<img style="width: 495px; height: 300px;border-radius:16px;margin-top: 4px; margin-left: 4px;" <img style="width: 495px; height: 300px;border-radius:16px;margin-top: 4px; margin-left: 4px;" referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<div v-for="(item, index) in tuijianPage" :key="index" class="tuijian-card" @click="showContentDialog(item)"> <div v-for="(item, index) in tuijianPage" :key="index" class="tuijian-card" @click="showContentDialog(item)">
<img style="width: 170px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" <img style="width: 170px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
<div class="card-right"> <div class="card-right">
<span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span> <span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span>
@ -231,20 +228,18 @@ function scrollTo(index: any) {
</div> </div>
</div> </div>
<el-pagination class="pagi" v-model:current-page="pageParamTuijian.page" v-if="pageParamTuijian.total > 0" <el-pagination v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" v-model:page-size="pageParamTuijian.pagesize" class="pagi" layout="prev, pager, next, jumper" :total="pageParamTuijian.total" @current-change="handleCurrentChange" />
v-model:page-size="pageParamTuijian.pagesize" layout="prev, pager, next, jumper" :total="pageParamTuijian.total"
@current-change="handleCurrentChange" />
</div> </div>
<!-- 各知识/新闻分区 --> <!-- 各知识/新闻分区 -->
<template v-for="(item, index) in naviList"> <template v-for="(item, index) in naviList" :key="index">
<Archivestype :liContent=item :index=(index) :fatherisReady="fatherisReady" :routerUrl="routerUrl"></Archivestype> <Archivestype :li-content=item :index=(index) :fatheris-ready="fatherisReady" :router-url="routerUrl"></Archivestype>
</template> </template>
</div> </div>
<!-- 内容详情组件 --> <!-- 内容详情组件 -->
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> <KnowledgeContent v-model:isShow="showContentBox" :content-source="cardContentSource"></KnowledgeContent>
</div> </div>

22
src/views/knowledge/news/index.vue

@ -171,7 +171,6 @@ function scrollTo(index: any) {
} }
// end // end
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
@ -184,9 +183,8 @@ function scrollTo(index: any) {
推荐 推荐
</li> </li>
<template v-for="(item, index) in naviList"> <template v-for="(item, index) in naviList" :key="index">
<Navili :class="{ active: active === index+1 }" :oneli=item :index=(index+1) v-if="item.hasCard" :active=active <Navili v-if="item.hasCard" :class="{ active: active === index+1 }" :oneli=item :index=(index+1) :active=active @click="scrollTo(index + 1)"></Navili>
@click="scrollTo(index + 1)"></Navili>
</template> </template>
</ul> </ul>
@ -206,14 +204,12 @@ function scrollTo(index: any) {
<el-carousel indicator-position="outside" class="mycarousel" arrow="always"> <el-carousel indicator-position="outside" class="mycarousel" arrow="always">
<el-carousel-item v-for="(item, index) in carousel" :key="index" @click="showContentDialog(item)"> <el-carousel-item v-for="(item, index) in carousel" :key="index" @click="showContentDialog(item)">
<img style="width: 495px; height: 300px;border-radius:16px;margin-top: 4px; margin-left: 4px;" <img style="width: 495px; height: 300px;border-radius:16px;margin-top: 4px; margin-left: 4px;" referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<div v-for="(item, index) in tuijianPage" :key="index" class="tuijian-card" @click="showContentDialog(item)"> <div v-for="(item, index) in tuijianPage" :key="index" class="tuijian-card" @click="showContentDialog(item)">
<img style="width: 170px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" <img style="width: 170px; height: 126px;border-radius:8px;margin-top: 4px; margin-left: 4px;" referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
referrerpolicy="no-referrer" :src="item.gThumbnail" fit="fill" loading="lazy" @error="errorImg($event)" />
<div class="card-right"> <div class="card-right">
<span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span> <span class="card-title" :title=item.gTitle>{{ item.gTitle }}</span>
@ -231,20 +227,18 @@ function scrollTo(index: any) {
</div> </div>
</div> </div>
<el-pagination class="pagi" v-model:current-page="pageParamTuijian.page" v-if="pageParamTuijian.total > 0" <el-pagination v-if="pageParamTuijian.total > 0" v-model:current-page="pageParamTuijian.page" v-model:page-size="pageParamTuijian.pagesize" class="pagi" layout="prev, pager, next, jumper" :total="pageParamTuijian.total" @current-change="handleCurrentChange" />
v-model:page-size="pageParamTuijian.pagesize" layout="prev, pager, next, jumper" :total="pageParamTuijian.total"
@current-change="handleCurrentChange" />
</div> </div>
<!-- 各知识/新闻分区 --> <!-- 各知识/新闻分区 -->
<template v-for="(item, index) in naviList"> <template v-for="(item, index) in naviList" :key="index">
<Archivestype :liContent=item :index=(index) :fatherisReady="fatherisReady" :routerUrl="routerUrl"></Archivestype> <Archivestype :li-content=item :index=(index) :fatheris-ready="fatherisReady" :router-url="routerUrl"></Archivestype>
</template> </template>
</div> </div>
<!-- 内容详情组件 --> <!-- 内容详情组件 -->
<KnowledgeContent v-model:isShow="showContentBox" :contentSource="cardContentSource"></KnowledgeContent> <KnowledgeContent v-model:isShow="showContentBox" :content-source="cardContentSource"></KnowledgeContent>
</div> </div>

Loading…
Cancel
Save