Commit 5cdca287 authored by 冷玲鹏's avatar 冷玲鹏

修改:banner管理、活动管理、公告管理

parent d5154675
<template>
<!-- 活动(原新闻)资讯管理 -->
<!-- 活动管理 -->
<div class="app-container">
<div v-show="showSwitch.courseContent" class="courseContent">
<div class="search">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="发布状态:" prop="flag">
<!-- 发布状态下拉框-->
<el-select v-model="queryParams.flag" placeholder="请选择发布状态">
<el-option
v-for="item in releaseStatusOptions"
......@@ -78,7 +77,7 @@
<el-table-column align="center" prop="title" label="活动标题" min-width="230" show-overflow-tooltip />
<el-table-column align="center" prop="summary" label="活动摘要" min-width="230" show-overflow-tooltip />
<el-table-column align="center" label="封面" min-width="120" prop="pictureId">
<!-- <template slot-scope="scope">
<!-- <template slot-scope="scope">
<div :id="step(scope.$index)">
<el-image :src="scope.row.path" :preview-src-list="[scope.row.path]" style="width:100%;height:100%;" @mouseover="justEnter($event)" @mouseout="justOut($event)" />
</div>
......@@ -91,7 +90,8 @@
:preview-src-list="[getImagePath(scope.row.path)]"
style="width:100%;height:100%;"
@mouseover="justEnter($event)"
@mouseout="justOut($event)" />
@mouseout="justOut($event)"
/>
</div>
</template>
</el-table-column>
......@@ -105,7 +105,7 @@
<!-- 只显示 isTop === 1 时,显示标签 -->
<el-tag v-if="scope.row.isTop === 1" type="success" size="medium ">置顶</el-tag>
</template>
<!-- <template slot-scope="scope">
<!-- <template slot-scope="scope">
<span>{{ scope.row.isTop === 1 ? '是' : '否' }}</span>
</template>-->
</el-table-column>
......@@ -139,11 +139,11 @@
<template slot-scope="scope">
{{ numberFormatter(scope.row.registrationFee, 2) || '-' }}
</template>
<!-- <template slot-scope="scope">
<!-- <template slot-scope="scope">
<span>{{ scope.row.registrationFee }}</span>
</template>-->
</el-table-column>
<!-- <el-table-column align="center" prop="createUser" label="提交人" show-overflow-tooltip>
<!-- <el-table-column align="center" prop="createUser" label="提交人" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.nickName }}</span>
</template>
......@@ -153,7 +153,7 @@
<span>{{ scope.row.releaseDate }}</span>
</template>
</el-table-column>
<!-- <el-table-column align="left" prop="createDate" label="提交时间" show-overflow-tooltip>
<!-- <el-table-column align="left" prop="createDate" label="提交时间" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.createDate }}</span>
</template>
......@@ -188,8 +188,8 @@
</el-table>
</div>
<pagination
:key="pageKey"
v-show="total>0"
:key="pageKey"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
......@@ -200,7 +200,6 @@
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="queryForm" style="margin: 0 0 0 -15px" :model="queryParams1" :inline="true">
<el-form-item>
<!-- 发布状态下拉框-->
<el-select v-model="queryParams1.registration">
<el-option
v-for="item in registrationOptions"
......@@ -245,9 +244,9 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column property="name" label="姓名" min-width="120" :header-cell-style="{ display: 'none' }"/>
<el-table-column property="createDate" label="报名日期" min-width="150"></el-table-column>
<el-table-column property="phone" label="联系方式" min-width="220"></el-table-column>
<el-table-column property="name" label="姓名" min-width="120" :header-cell-style="{ display: 'none' }" />
<el-table-column property="createDate" label="报名日期" min-width="150" />
<el-table-column property="phone" label="联系方式" min-width="220" />
<el-table-column property="applicationFee" label="缴费" min-width="120">
<template slot-scope="scope">
{{ numberFormatter(scope.row.payment, 2) || '-' }}
......@@ -266,8 +265,8 @@
</el-table-column>
</el-table>
<pagination
:key="pageKey"
v-show="total1>0"
:key="pageKey"
:total="total1"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.rows"
......@@ -281,9 +280,9 @@
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column property="name" label="姓名" min-width="120"></el-table-column>
<el-table-column property="createDate" label="报名日期" min-width="150"></el-table-column>
<el-table-column property="phone" label="联系方式" min-width="220"></el-table-column>
<el-table-column property="name" label="姓名" min-width="120" />
<el-table-column property="createDate" label="报名日期" min-width="150" />
<el-table-column property="phone" label="联系方式" min-width="220" />
<el-table-column property="applicationFee" label="缴费" min-width="120">
<template slot-scope="scope">
{{ numberFormatter(scope.row.payment, 2) || '-' }}
......@@ -302,8 +301,8 @@
</el-table-column>
</el-table>
<pagination
:key="pageKey"
v-show="total2>0"
:key="pageKey"
:total="total2"
:page.sync="queryParams1.page"
:limit.sync="queryParams1.rows"
......@@ -324,7 +323,7 @@ import { updateResponseUrl } from '@/utils/updateUrl'
import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import {getCmsApplication, listCmsApplication} from "@/api/contentManagement/application";
import { listCmsApplication } from '@/api/contentManagement/application'
export default {
name: 'Index',
// components: {
......@@ -336,7 +335,7 @@ export default {
hasAddPerm: ['sys:activity:add'],
hasUpdatePerm: ['sys:activity:update'],
hasDetailPerm: ['sys:activity:query'],
/* imageSrc: require('@/assets/image/test.png'),*/
/* imageSrc: require('@/assets/image/test.png'),*/
// 显示开关
showSwitch: {
......@@ -438,8 +437,8 @@ export default {
},
// pagination
total: 0,
total1:0,
total2:0,
total1: 0,
total2: 0,
actionUrl: '',
filelist: [],
bussid: [],
......@@ -468,7 +467,7 @@ export default {
vm.queryParams.page = JSON.parse(getDataCache(vm.$route.path)).page
setTimeout(() => {
vm.loadData()
},500)
}, 500)
}
})
},
......@@ -547,13 +546,32 @@ export default {
}
},
loadData1() {
// 列表渲染数据
var data = []
const _this = this
this.gridData = []
_this.fullscreenLoading = true
_this.fullscreenLoading = false
// 过滤 gridData
const filteredGridData = this.gridData.filter(item => {
return (
(!this.queryParams1.registration || item.registration === this.queryParams1.registration) &&
(!this.queryParams1.name || item.name.includes(this.queryParams1.name))
)
})
// 过滤 gridData1
const filteredGridData1 = this.gridData1.filter(item => {
return (
(!this.queryParams1.registration || item.registration === this.queryParams1.registration) &&
(!this.queryParams1.name || item.name.includes(this.queryParams1.name))
)
})
// 更新过滤后的数据
this.gridData = filteredGridData
this.gridData1 = filteredGridData1
// 更新分页总数
this.total1 = this.gridData.length
this.total2 = this.gridData1.length
_this.fullscreenLoading = false
},
resetQuery1() {
this.queryParams1 = {
......@@ -561,7 +579,16 @@ export default {
rows: 10,
registration: '已报名'
}
this.dateRange = []
// 重置表单
this.$refs.queryForm.resetFields()
// 恢复原始数据
this.gridData = [...this.originalGridData] // 记得在加载数据时保存原始数据
this.gridData1 = [...this.originalGridData1] // 记得在加载数据时保存原始数据
// 更新分页总数
this.total1 = this.gridData.length
this.total2 = this.gridData1.length
this.loadData1()
},
loadData() {
......@@ -617,50 +644,50 @@ export default {
_this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport'
},
/** 查看报名人数 */
// 查看报名人数并查询子表数据
handleClick(row) {
this.open = true;
this.open = true
this.queryParams1 = {
page: 1,
rows: 10,
registration: '已报名'
}
this.title = '报名人数';
this.title = '报名人数'
const activityId = row.businessId
const participantCount = row.participantCount || 0
console.log('打印打印', activityId)
// 调用后端接口查询与该活动对应的子表数据
this.fetchSubTableData(activityId)
// 显示报名人数
this.participantCount = participantCount
},
// 查询子表数据
/** 查询子表数据 */
fetchSubTableData(activityId) {
// 将 activityId 传递给后端,查询子表数据
listCmsApplication({ activityId: activityId })
.then(response => {
// 假设返回的数据是一个数组
const data = response.rows || [];
const data = response.rows || []
console.log('data', data)
// 清空原始数据(如果有需要的话)
this.gridData = [];
this.gridData1 = [];
this.gridData = []
this.gridData1 = []
// 保存原始数据
this.originalGridData = []
this.originalGridData1 = []
// 根据 status 将数据分类
data.forEach(item => {
if (item.status === '1' && item.activityId === activityId) {
this.gridData.push(item);
this.total1 = this.gridData.length; // 假设你需要显示 gridData 的分页
this.gridData.push(item)
this.originalGridData.push(item) // 保存原始数据
this.total1 = this.gridData.length
} else if (item.status === '2' && item.activityId === activityId) {
this.gridData1.push(item); // 将 status = 2 的数据添加到 gridData1
this.total2 = this.gridData1.length; // 假设你需要显示 gridData 的分页
this.gridData1.push(item)
this.originalGridData1.push(item) // 保存原始数据
this.total2 = this.gridData1.length
}
});
})
})
.catch(error => {
console.error('获取子表数据失败:', error);
});
console.error('获取子表数据失败:', error)
})
},
handleViewGridData() {
......@@ -703,7 +730,7 @@ export default {
path: '/contentManagement/activity/info',
query: {
isOperation: '1',
title: '新增活动',
title: '新增活动'
}
})
},
......@@ -715,7 +742,7 @@ export default {
query: {
isOperation: '2',
bussinessId: row.businessId,
title: ' 编辑活动 ',
title: ' 编辑活动 '
}
})
},
......
......@@ -28,20 +28,7 @@
</el-col>
</el-row>
<el-row :gutter="20">
<!-- <el-col :span="12">-->
<!-- &lt;!&ndash; 是否为头条新闻&ndash;&gt;-->
<!-- <el-form-item-->
<!-- label="是否为头条新闻:"-->
<!-- prop="isForntPage"-->
<!-- :rules="{ required: !(controls.isOperation === '3'), message: '请选择是否为头条新闻', trigger: 'blur' }"-->
<!-- >-->
<!-- <el-select v-model="form.isForntPage" placeholder="请选择是否为头条新闻" size="small" class="normalInput" :disabled="secondFromDisabled">-->
<!-- <el-option v-for="item in isList" :key="item.value" :label="item.label" :value="item.value" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<!-- 是否推荐-->
<el-form-item
label="是否推荐:"
prop="isRecommended"
......@@ -60,7 +47,6 @@
</el-form-item>
</el-col>
<el-col :span="12">
<!-- 是否置顶-->
<el-form-item
label="是否置顶:"
prop="isTop"
......@@ -175,7 +161,6 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<!-- 是否推荐-->
<el-form-item
label="开放报名:"
prop="isRegistration"
......@@ -194,7 +179,6 @@
</el-form-item>
</el-col>
<el-col :span="12">
<!-- 是否置顶-->
<el-form-item
label="是否实名:"
prop="isRealNameAuthentication"
......@@ -251,9 +235,9 @@ import {
addCmsActivity,
getCmsActivity, updateCmsActivity
} from '@/api/contentManagement/activity'
import { updatePagesRes, updateRes, updateResonseUrl, updateResponseUrl } from '@/utils/updateUrl'
import { updateResponseUrl } from '@/utils/updateUrl'
import { VueEditor } from 'vue2-editor'
import { yesOrNo, enableOrDisable} from "@/utils/allPageData";
import { yesOrNo, enableOrDisable } from '@/utils/allPageData'
/* import { uploadPublic } from '@/api/contentManagement/sysContest'*/
export default {
......@@ -305,7 +289,7 @@ export default {
isOperation: '1'
},
// 是否List
/* isList: [
/* isList: [
{
label: '是',
value: 1
......@@ -371,7 +355,7 @@ export default {
},
created() {
this.isOperation = this.$route.query.isOperation
// 页面加载时根据 isOperation 设置表单的默认值
// 页面加载时根据 isOperation 设置表单的默认值
this.setFormDefaults()
},
methods: {
......
......@@ -2,79 +2,69 @@
<div class="app-container">
<div v-show="showSwitch.courseContent" class="courseContent">
<div class="search">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="名称:" prop="bannerName">
<el-input
v-model.trim="queryParams.bannerName"
placeholder="请输入名称"
clearable
:maxlength="500"
size="small"
style="width: 150px"
/>
</el-form-item>
<!-- <el-form-item label="链接地址:" prop="linkUrl">
<el-input
v-model.trim="queryParams.linkUrl"
placeholder="请输入链接地址"
clearable
:maxlength="255"
size="small"
style="width: 150px"
/>
</el-form-item>-->
<el-form-item>
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="handleQuery"
>查询</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>重置</el-button>
</el-form-item>
<div style="float: right">
<el-form-item>
<el-button
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd"
>新增</el-button>
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="名称:" prop="bannerName">
<el-input
v-model.trim="queryParams.bannerName"
placeholder="请输入名称"
clearable
:maxlength="500"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item>
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="handleQuery"
>查询</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>重置</el-button>
</el-form-item>
<div style="float: right">
<el-form-item>
<el-button
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd"
>新增</el-button>
</el-form-item>
</div>
</el-form>
</el-form-item>
</div>
</el-form>
</div>
<div style="padding:5px 10px">
<div class="tableTitle">banner管理</div>
<el-table v-loading="loading" border :data="cmsBannerList" :row-style="{'textAlign': 'center'}">
<el-table-column prop="id" label="序号" min-width="55px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<div style="padding:5px 10px">
<div class="tableTitle">banner管理</div>
<el-table v-loading="loading" border :data="cmsBannerList" :row-style="{'textAlign': 'center'}">
<el-table-column prop="id" label="序号" min-width="55px">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="图片" prop="bannerPicture" min-width="120">
<template slot-scope="scope">
<div :id="step(scope.$index)">
<!-- 修改 src 路径 -->
<el-image
:src="getImagePath(scope.row.path)"
:preview-src-list="[getImagePath(scope.row.path)]"
style="width:100%;height:100%;"
@mouseover="justEnter($event)"
@mouseout="justOut($event)" />
</div>
</template>
</el-table-column>
<!-- <template slot-scope="scope">
<el-table-column align="center" label="图片" prop="bannerPicture" min-width="120">
<template slot-scope="scope">
<div :id="step(scope.$index)">
<el-image
:src="getImagePath(scope.row.path)"
:preview-src-list="[getImagePath(scope.row.path)]"
style="width:100%;height:100%;"
@mouseover="justEnter($event)"
@mouseout="justOut($event)"
/>
</div>
</template>
</el-table-column>
<!-- <template slot-scope="scope">
<div :id="step(scope.$index)">
<el-image
style="width:100%;height:100%;"
......@@ -90,108 +80,75 @@
</el-image>
</div>
</template>-->
<el-table-column align="center" label="分类" prop="type" :show-overflow-tooltip="true" min-width="80">
<!-- <template slot-scope="scope">
<el-table-column align="center" label="分类" prop="type" :show-overflow-tooltip="true" min-width="80">
<!-- <template slot-scope="scope">
<span>
{{ getTypeValue(scope.row.type) || '-' }}
</span>
</template>-->
<template slot-scope="scope">
<span v-if="scope.row.type=='0'">首页</span>
<span v-else-if="scope.row.type=='1'">活动</span>
<span v-else>-</span>
</template>
</el-table-column>
<!-- <template slot-scope="scope">
<span v-if="scope.row.type=='0'">首页</span>
<span v-else-if="scope.row.type=='1'">活动</span>
<span v-else>-</span>
</template>-->
<el-table-column label="名称" prop="bannerName" :show-overflow-tooltip="true" min-width="120px">
<template slot-scope="scope">
{{ scope.row.bannerName || '-' }}
</template>
</el-table-column>
<!-- <el-table-column label="图片" prop="bannerPicture" :show-overflow-tooltip="true">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.bannerPicture || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="链接地址" prop="linkUrl" min-width="250" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.linkUrl || '-' }}
</template>
</el-table-column>-->
<el-table-column label="排序" prop="weight" :show-overflow-tooltip="true" min-width="55">
<template slot-scope="scope">
{{ scope.row.weight || '-' }}
</template>
</el-table-column>
<el-table-column min-width="100" label="状态" prop="flag">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<!-- <el-table-column label="备注" prop="remarks" :show-overflow-tooltip="true">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.remarks || '-' }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="创建时间" prop="createDate" :show-overflow-tooltip="true">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="操作" class-name="small-padding fixed-width" min-width="120">
<template slot-scope="scope">
<el-button
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
<template slot-scope="scope">
<span v-if="scope.row.type=='0'">首页</span>
<span v-else-if="scope.row.type=='1'">活动</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="名称" prop="bannerName" :show-overflow-tooltip="true" min-width="120px">
<template slot-scope="scope">
{{ scope.row.bannerName || '-' }}
</template>
</el-table-column>
<el-table-column label="排序" prop="weight" :show-overflow-tooltip="true" min-width="55">
<template slot-scope="scope">
{{ scope.row.weight || '-' }}
</template>
</el-table-column>
<el-table-column min-width="100" label="状态" prop="flag">
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
class="switchDisabledStyle"
inactive-value="0"
active-value="1"
@click.native="handleStatusChange(scope.row)"
/>
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width" min-width="120">
<template slot-scope="scope">
<el-button
:class="commonField.updateClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
:class="commonField.delClass"
:type="commonField.typeParent"
:size="commonField.size"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
</div>
<!-- 添加或修改banner管理配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="分类:" prop="type">
<!-- <el-input v-model.trim="form.type" show-word-limit :maxlength="32" placeholder="请输入类型" />-->
<!-- <el-select v-model.trim="form.type" show-word-limit placeholder="请输入类型" style="width: 100%">
<el-option label="课程资源" value="0" />
<el-option label="其他资源" value="1" />
</el-select>-->
<!-- 使用 v-for 动态生成 el-option -->
<el-select v-model.trim="form.type" show-word-limit placeholder="请输入类型" style="width: 100%">
<el-option
v-for="item in typeField"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-option
v-for="item in typeField"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="名称:" prop="bannerName">
......@@ -208,19 +165,14 @@
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<!-- <img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px">-->
<img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px">
<i v-else class="el-icon-plus avatar-uploader-icon" />
</el-upload>
</el-form-item>
<!-- <el-form-item label="链接地址:" prop="linkUrl">
<el-input v-model.trim="form.linkUrl" show-word-limit :maxlength="255" placeholder="请输入链接地址" />
</el-form-item>-->
<el-form-item label="排序:" prop="weight">
<el-input-number v-model.trim="form.weight" style="width: 100%" controls-position="right" :min="0" />
</el-form-item>
<!-- 状态选择: 启用、停用 -->
<el-form-item label="状态:">
<el-radio-group v-model="form.flag" style="width: 100%">
<el-radio
......@@ -232,9 +184,6 @@
</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="备注" prop="remarks">-->
<!-- <el-input v-model.trim="form.remarks" maxlength="200" show-word-limit type="textarea" placeholder="请输入内容" />-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="cancelBtn" @click="cancel">取 消</el-button>
......@@ -252,13 +201,8 @@ import {
listCmsBanner,
updateCmsBanner
} from '@/api/contentManagement/banner'
import { typeField, enableOrDisable} from "@/utils/allPageData";
import commonField from "@/utils/commonField";
/*import { updateResponseUrl } from '@/utils/updateUrl'
import { uploadPublic } from '@/api/contentManagement/sysContest'
import user from "@/store/modules/user";
import store from "@/store";*/
import { typeField, enableOrDisable } from '@/utils/allPageData'
import commonField from '@/utils/commonField'
export default {
name: 'CmsBanner',
data() {
......@@ -270,7 +214,7 @@ export default {
},
imageUrl: '',
/*fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'development',*/
/* fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'development',*/
// 遮罩层
loading: true,
// 总条数
......@@ -342,8 +286,8 @@ export default {
// 获取对应的分类名称
getTypeValue(type) {
// 查找 type 对应的 value
const found = typeField.find(item => item.label === type);
return found ? found.value : null; // 如果没有找到对应的分类,返回 null
const found = typeField.find(item => item.label === type)
return found ? found.value : null // 如果没有找到对应的分类,返回 null
},
// 获取图片的正确路径
getImagePath() {
......@@ -382,17 +326,17 @@ export default {
**/
handleUpload(file) {
// 获取上传的文件
const formData = new FormData();
formData.append('file', file.file);
const formData = new FormData()
formData.append('file', file.file)
// 模拟本地上传,将图片保存到本地某个目录(如:assets/images)
const localPath = this.getImagePath(file.file); // 获取本地存储的路径
const localPath = this.getImagePath(file.file) // 获取本地存储的路径
// 假设你将本地路径保存到 form.bannerPicture 中
this.imageUrl = localPath; // 显示图片路径
this.form.bannerPicture = localPath; // 保存到表单字段中
this.imageUrl = localPath // 显示图片路径
this.form.bannerPicture = localPath // 保存到表单字段中
},
/* handleUpload(file) {
/* handleUpload(file) {
const formData = new FormData()
formData.append('file', file.file)
formData.append('temp', 'CmsBanner')
......
......@@ -418,7 +418,7 @@ export default {
_this.fullscreenLoading = false
console.log(error)
})
_this.dataIsReady = true
_this.dataIseady = true
_this.uploadList.fm = this.interfaceUrl + 'BLesson/picImport'
},
// 修改状态
......
......@@ -132,7 +132,7 @@
prop="details"
:rules="{ required: !(controls.isOperation === '3'), message: '请输入公告内容', trigger: 'blur' }"
>
<vue-editor id="editorsay" v-model="form.details" :useCustomImageHandler="true" :editor-toolbar="customToolbar" :disabled="secondFromDisabled" @blur="queryRules" @image-added="handleImageAdded" />
<vue-editor id="editorsay" v-model="form.details" :use-custom-image-handler="true" :editor-toolbar="customToolbar" :disabled="secondFromDisabled" @blur="queryRules" @image-added="handleImageAdded" />
</el-form-item>
</el-col>
......@@ -157,10 +157,10 @@ import {
addCmsNotice,
getCmsNotice, updateCmsNotice
} from '@/api/contentManagement/notice'
import {updatePagesRes, updateRes, updateResonseUrl, updateResponseUrl} from '@/utils/updateUrl'
import { updateResponseUrl } from '@/utils/updateUrl'
import { VueEditor } from 'vue2-editor'
import { yesOrNo, enableOrDisable} from "@/utils/allPageData";
/*import { uploadPublic } from '@/api/contentManagement/sysContest'*/
import { yesOrNo, enableOrDisable } from '@/utils/allPageData'
/* import { uploadPublic } from '@/api/contentManagement/sysContest'*/
export default {
components: {
......@@ -262,12 +262,12 @@ export default {
},
created() {
this.isOperation = this.$route.query.isOperation
// 页面加载时根据 isOperation 设置表单的默认值
// 页面加载时根据 isOperation 设置表单的默认值
this.setFormDefaults()
},
methods: {
setFormDefaults() {
const isOperation = this.isOperation;
const isOperation = this.isOperation
// 判断是新增、编辑还是查看
if (isOperation === '1') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment