Commit b0888fee authored by 冷玲鹏's avatar 冷玲鹏

修改页面bug:数据回显

parent 63531717
import request from '@/utils/request' import request from '@/utils/request'
import Qs from 'qs' import Qs from 'qs'
import {parseTime} from '@/utils/common';
/** /**
* 1. 列表查询 * 1. 列表查询
...@@ -11,7 +12,7 @@ import Qs from 'qs' ...@@ -11,7 +12,7 @@ import Qs from 'qs'
* *
*/ */
// 1. 查询新闻资讯列表 // 1. 查询活动列表
export function listCmsActivity(query) { export function listCmsActivity(query) {
return request({ return request({
url: '/cmsActivity/queryCmsActivityByPagination', url: '/cmsActivity/queryCmsActivityByPagination',
...@@ -20,7 +21,7 @@ export function listCmsActivity(query) { ...@@ -20,7 +21,7 @@ export function listCmsActivity(query) {
}) })
} }
// 2. 查询新闻资讯详细信息 // 2. 查询活动详细信息
export function getCmsActivity(businessId) { export function getCmsActivity(businessId) {
return request({ return request({
url: '/cmsActivity/detail/' + businessId, url: '/cmsActivity/detail/' + businessId,
...@@ -28,7 +29,7 @@ export function getCmsActivity(businessId) { ...@@ -28,7 +29,7 @@ export function getCmsActivity(businessId) {
}) })
} }
// 3. 新增新闻资讯 // 3. 新增活动
export function addCmsActivity(data) { export function addCmsActivity(data) {
data = Qs.stringify(data) data = Qs.stringify(data)
return request({ return request({
...@@ -38,7 +39,7 @@ export function addCmsActivity(data) { ...@@ -38,7 +39,7 @@ export function addCmsActivity(data) {
}) })
} }
// 4. 修改新闻资讯 // 4. 修改活动
export function updateCmsActivity(data) { export function updateCmsActivity(data) {
const businessId = data.businessId const businessId = data.businessId
data = Qs.stringify(data) data = Qs.stringify(data)
...@@ -49,7 +50,7 @@ export function updateCmsActivity(data) { ...@@ -49,7 +50,7 @@ export function updateCmsActivity(data) {
}) })
} }
// 5. 逻辑删除新闻资讯 // 5. 逻辑删除活动
export function delCmsActivity(businessId) { export function delCmsActivity(businessId) {
return request({ return request({
url: '/cmsActivity/delete/' + businessId, url: '/cmsActivity/delete/' + businessId,
...@@ -57,7 +58,7 @@ export function delCmsActivity(businessId) { ...@@ -57,7 +58,7 @@ export function delCmsActivity(businessId) {
}) })
} }
// 6. 导出新闻资讯 // 6. 导出活动
export function exportCmsActivity(query) { export function exportCmsActivity(query) {
return request({ return request({
url: '/cmsActivity/export', url: '/cmsActivity/export',
...@@ -66,7 +67,7 @@ export function exportCmsActivity(query) { ...@@ -66,7 +67,7 @@ export function exportCmsActivity(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 7. 修改新闻资讯状态 // 7. 修改活动状态
export function updateStatus(data) { export function updateStatus(data) {
const businessId = data.businessId const businessId = data.businessId
data = Qs.stringify(data) data = Qs.stringify(data)
......
...@@ -11,7 +11,7 @@ import Qs from 'qs' ...@@ -11,7 +11,7 @@ import Qs from 'qs'
* *
*/ */
// 1. 查询新闻资讯列表 // 1. 查询公告列表
export function listCmsNotice(query) { export function listCmsNotice(query) {
return request({ return request({
url: '/cmsNotice/queryCmsNoticeByPagination', url: '/cmsNotice/queryCmsNoticeByPagination',
...@@ -20,7 +20,7 @@ export function listCmsNotice(query) { ...@@ -20,7 +20,7 @@ export function listCmsNotice(query) {
}) })
} }
// 2. 查询新闻资讯详细信息 // 2. 查询公告详细信息
export function getCmsNotice(businessId) { export function getCmsNotice(businessId) {
return request({ return request({
url: '/cmsNotice/detail/' + businessId, url: '/cmsNotice/detail/' + businessId,
...@@ -28,7 +28,7 @@ export function getCmsNotice(businessId) { ...@@ -28,7 +28,7 @@ export function getCmsNotice(businessId) {
}) })
} }
// 3. 新增新闻资讯 // 3. 新增公告
export function addCmsNotice(data) { export function addCmsNotice(data) {
data = Qs.stringify(data) data = Qs.stringify(data)
return request({ return request({
...@@ -38,7 +38,7 @@ export function addCmsNotice(data) { ...@@ -38,7 +38,7 @@ export function addCmsNotice(data) {
}) })
} }
// 4. 修改新闻资讯 // 4. 修改公告
export function updateCmsNotice(data) { export function updateCmsNotice(data) {
const businessId = data.businessId const businessId = data.businessId
data = Qs.stringify(data) data = Qs.stringify(data)
...@@ -49,7 +49,7 @@ export function updateCmsNotice(data) { ...@@ -49,7 +49,7 @@ export function updateCmsNotice(data) {
}) })
} }
// 5. 逻辑删除新闻资讯 // 5. 逻辑删除公告
export function delCmsNotice(businessId) { export function delCmsNotice(businessId) {
return request({ return request({
url: '/cmsNotice/delete/' + businessId, url: '/cmsNotice/delete/' + businessId,
...@@ -57,7 +57,7 @@ export function delCmsNotice(businessId) { ...@@ -57,7 +57,7 @@ export function delCmsNotice(businessId) {
}) })
} }
// 6. 导出新闻资讯 // 6. 导出公告
export function exportCmsNotice(query) { export function exportCmsNotice(query) {
return request({ return request({
url: '/cmsNotice/export', url: '/cmsNotice/export',
...@@ -66,7 +66,7 @@ export function exportCmsNotice(query) { ...@@ -66,7 +66,7 @@ export function exportCmsNotice(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
// 7. 修改新闻资讯状态 // 7. 修改公告状态
export function updateStatus(data) { export function updateStatus(data) {
const businessId = data.businessId const businessId = data.businessId
data = Qs.stringify(data) data = Qs.stringify(data)
......
...@@ -3,8 +3,8 @@ export { typeField, enableOrDisable, yesOrNo, isExam } ...@@ -3,8 +3,8 @@ export { typeField, enableOrDisable, yesOrNo, isExam }
/** banner管理*/ /** banner管理*/
/** 分类*/ /** 分类*/
const typeField = [ const typeField = [
{ value: '0', label: '首页' }, { value: '1', label: '首页' },
{ value: '1', label: '活动' } { value: '0', label: '活动' }
] ]
/** 启用、停用*/ /** 启用、停用*/
const enableOrDisable = [ const enableOrDisable = [
...@@ -14,8 +14,8 @@ const enableOrDisable = [ ...@@ -14,8 +14,8 @@ const enableOrDisable = [
/** 是、否*/ /** 是、否*/
const yesOrNo = [ const yesOrNo = [
{ value: 0, label: '是' }, { value: 1, label: '是' },
{ value: 1, label: '否' } { value: 0, label: '否' }
] ]
const isExam = [ const isExam = [
......
...@@ -53,14 +53,6 @@ ...@@ -53,14 +53,6 @@
:size="commonField.smallSize" :size="commonField.smallSize"
@click="handleAdd" @click="handleAdd"
>{{ commonField.addName }}</el-button> >{{ commonField.addName }}</el-button>
<!-- //新增按钮-->
<!-- <el-button-->
<!-- :class="commonField.addClass"-->
<!-- :type="commonField.typePrimary"-->
<!-- :icon="commonField.addIcon"-->
<!-- :size="commonField.smallSize"-->
<!-- @click="handleExamination"-->
<!-- >{{ "跳转考核临时" }}</el-button>-->
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -76,14 +68,8 @@ ...@@ -76,14 +68,8 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="title" label="活动标题" min-width="230" show-overflow-tooltip /> <el-table-column align="center" prop="title" label="活动标题" min-width="230" show-overflow-tooltip />
<el-table-column align="center" label="封面" min-width="120" prop="pictureId"> <el-table-column align="center" label="封面" min-width="120" prop="pictureId">
<!-- <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>
</template>-->
<template slot-scope="scope"> <template slot-scope="scope">
<div :id="step(scope.$index)"> <div :id="step(scope.$index)">
<!-- 修改 src 路径 -->
<el-image <el-image
:src="getImagePath(scope.row.path)" :src="getImagePath(scope.row.path)"
:preview-src-list="[getImagePath(scope.row.path)]" :preview-src-list="[getImagePath(scope.row.path)]"
...@@ -94,14 +80,8 @@ ...@@ -94,14 +80,8 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="left" prop="isForntPage" label="是否为头条活动" show-overflow-tooltip>-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ scope.row.isForntPage === 1 ? '是' : '否' }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" prop="isTop" min-width="80" label="置顶" show-overflow-tooltip> <el-table-column align="center" prop="isTop" min-width="80" label="置顶" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 只显示 isTop === 1 时,显示标签 -->
<el-tag v-if="scope.row.isTop === 1" type="success" size="medium ">置顶</el-tag> <el-tag v-if="scope.row.isTop === 1" type="success" size="medium ">置顶</el-tag>
</template> </template>
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
...@@ -138,15 +118,7 @@ ...@@ -138,15 +118,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ numberFormatter(scope.row.applicationFee, 2) || '-' }} {{ numberFormatter(scope.row.applicationFee, 2) || '-' }}
</template> </template>
<!-- <template slot-scope="scope">
<span>{{ scope.row.applicationFee }}</span>
</template>-->
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" prop="createUser" label="提交人" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.nickName }}</span>
</template>
</el-table-column>-->
<el-table-column align="center" prop="publishDate" label="发布日期" min-width="120" show-overflow-tooltip> <el-table-column align="center" prop="publishDate" label="发布日期" min-width="120" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.publishDate }}</span> <span>{{ scope.row.publishDate }}</span>
...@@ -154,20 +126,14 @@ ...@@ -154,20 +126,14 @@
</el-table-column> </el-table-column>
<el-table-column align="center" prop="startTime" label="开始时间" min-width="180" show-overflow-tooltip> <el-table-column align="center" prop="startTime" label="开始时间" min-width="180" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.startTime }}</span> <span>{{ scope.row.startTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="endTime" label="结束时间" min-width="180" show-overflow-tooltip> <el-table-column align="center" prop="endTime" label="结束时间" min-width="180" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.endTime }}</span> <span>{{ scope.row.endTime | transformDateByFormat('YYYY-MM-DD HH:mm') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="left" prop="createDate" label="提交时间" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.createDate }}</span>
</template>
</el-table-column>-->
<el-table-column align="center" label="操作" min-width="150"> <el-table-column align="center" label="操作" min-width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -190,7 +156,6 @@ ...@@ -190,7 +156,6 @@
:size="commonField.size" :size="commonField.size"
@click="removeCourse(scope.row)" @click="removeCourse(scope.row)"
>删除</el-button> >删除</el-button>
<!-- <el-button type="text" @click="handleView(scope.row)">查看</el-button>-->
</template> </template>
</el-table-column> </el-table-column>
...@@ -328,12 +293,9 @@ import { ...@@ -328,12 +293,9 @@ import {
delCmsActivity, delCmsActivity,
listCmsActivity, updateStatus listCmsActivity, updateStatus
} from '@/api/contentManagement/activity' } from '@/api/contentManagement/activity'
import { updateResponseUrl } from '@/utils/updateUrl'
import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData' import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { listCmsApplication } from '@/api/contentManagement/application' import { listCmsApplication } from '@/api/contentManagement/application'
import { listCmsBanner } from '@/api/contentManagement/banner'
export default { export default {
name: 'Index', name: 'Index',
// components: { // components: {
...@@ -345,8 +307,6 @@ export default { ...@@ -345,8 +307,6 @@ export default {
hasAddPerm: ['sys:activity:add'], hasAddPerm: ['sys:activity:add'],
hasUpdatePerm: ['sys:activity:update'], hasUpdatePerm: ['sys:activity:update'],
hasDetailPerm: ['sys:activity:query'], hasDetailPerm: ['sys:activity:query'],
/* imageSrc: require('@/assets/image/test.png'),*/
// 显示开关 // 显示开关
showSwitch: { showSwitch: {
courseContent: true, courseContent: true,
...@@ -500,17 +460,6 @@ export default { ...@@ -500,17 +460,6 @@ export default {
step(index) { step(index) {
return 'step' + index return 'step' + index
}, },
changPlate(data) {
if (data === '1') {
return '板块一'
}
if (data === '2') {
return '板块二'
}
if (data === '3') {
return '板块三'
}
},
/** /**
* @description: 点击蒙版关闭预览图片 * @description: 点击蒙版关闭预览图片
* @author: gaoyu * @author: gaoyu
...@@ -703,7 +652,6 @@ export default { ...@@ -703,7 +652,6 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
console.log('我是修改')
this.$router.push({ this.$router.push({
path: '/contentManagement/activity/info', path: '/contentManagement/activity/info',
query: { query: {
...@@ -747,8 +695,12 @@ export default { ...@@ -747,8 +695,12 @@ export default {
}) })
}, },
// 获取图片的正确路径 // 获取图片的正确路径
getImagePath() { getImagePath(path) {
return require(`@/assets/image/testImage/test.png`) // 返回图片路径
if (path) {
return path
}
return ''
}, },
// 封面图片预览 // 封面图片预览
justEnter(event) { justEnter(event) {
...@@ -770,13 +722,6 @@ export default { ...@@ -770,13 +722,6 @@ export default {
margin: 10px; margin: 10px;
height: 45px; height: 45px;
} }
/* ::v-deep .el-table .cell {
text-align: center !important;
}
::v-deep .el-table th .cell{
justify-content: center;
text-align: center !important;
}*/
} }
app-container1{ app-container1{
font-size: 18px; font-size: 18px;
...@@ -787,41 +732,5 @@ app-container1{ ...@@ -787,41 +732,5 @@ app-container1{
height: 25px; height: 25px;
} }
} }
/*.courseContent{
!*padding-left: 15px;*!
width:100%;
height:100%;
::v-deep .el-table th .cell{
justify-content: left!important;
}
::v-deep .el-table td .cell{
margin: 10px 0 10px 0;
text-align: left!important;
}
}
#courseManage .table_box{
margin:0;
height:calc(100% - 175px);
}
#courseManage .el-table{height:100%;}
#courseManage .el-table__body-wrapper{
height:calc(100% - 40px);
overflow-x:hidden;
overflow-y:auto;
}
#courseManage .pages{margin-top:15px;}
#courseManage .breadNav{margin-left:0;}
#courseManage .search_area{margin:1em 0;}
#courseManage .info_change{margin-left:0;}
#courseManage .search_area div{width:190px;}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {-webkit-appearance: none;}
input[type="number"]{-moz-appearance: textfield;}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
margin: 0;
}*/
</style> </style>
...@@ -67,33 +67,28 @@ ...@@ -67,33 +67,28 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="title" label="公告标题" min-width="200" show-overflow-tooltip /> <el-table-column align="center" prop="title" label="公告标题" min-width="200" show-overflow-tooltip />
<el-table-column align="center" label="封面" min-width="120" prop="pictureId"> <el-table-column align="center" label="图片" prop="pictureId" min-width="120">
<!-- <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>
</template>-->
<template slot-scope="scope"> <template slot-scope="scope">
<div :id="step(scope.$index)"> <div :id="step(scope.$index)">
<!-- 修改 src 路径 -->
<el-image <el-image
:src="getImagePath(scope.row.path)" :src="getImagePath(scope.row.path)"
:preview-src-list="[getImagePath(scope.row.path)]" :preview-src-list="[getImagePath(scope.row.path)]"
style="width:100%;height:100%;" style="width:100%;height:100%;"
@mouseover="justEnter($event)" @mouseover="justEnter($event)"
@mouseout="justOut($event)" /> @mouseout="justOut($event)"
/>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="left" prop="isTop" min-width="80" label="置顶" show-overflow-tooltip> <el-table-column align="left" prop="isTop" min-width="80" label="置顶" show-overflow-tooltip>
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<span>{{ scope.row.isTop === 1 ? '是' : '否' }}</span> <span>{{ scope.row.isTop === 1 ? '是' : '否' }}</span>
</template>--> </template>-->
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.isTop === 1" type="success" size="medium ">置顶</el-tag> <el-tag v-if="scope.row.isTop === 1" type="success" size="medium ">置顶</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="left" prop="isRecommended" min-width="80" label="推荐" show-overflow-tooltip> <el-table-column align="left" prop="isRecommended" min-width="80" label="推荐" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.isRecommended === 1" type="warning" size="medium ">推荐</el-tag> <el-tag v-if="scope.row.isRecommended === 1" type="warning" size="medium ">推荐</el-tag>
</template> </template>
...@@ -103,7 +98,7 @@ ...@@ -103,7 +98,7 @@
{{ scope.row.weight || '-' }} {{ scope.row.weight || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="left" prop="releaseStatus" label="状态" min-width="120" show-overflow-tooltip> <el-table-column align="left" prop="releaseStatus" label="状态" min-width="120" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.flag" v-model="scope.row.flag"
...@@ -114,7 +109,7 @@ ...@@ -114,7 +109,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="left" prop="createUser" label="提交人" show-overflow-tooltip> <!-- <el-table-column align="left" prop="createUser" label="提交人" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.nickName }}</span> <span>{{ scope.row.nickName }}</span>
</template> </template>
...@@ -124,13 +119,13 @@ ...@@ -124,13 +119,13 @@
<span>{{ scope.row.publishDate }}</span> <span>{{ scope.row.publishDate }}</span>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span>{{ scope.row.createDate }}</span> <span>{{ scope.row.createDate }}</span>
</template> </template>
</el-table-column>--> </el-table-column>-->
<el-table-column align="center" label="操作" min-width="160"> <el-table-column align="center" label="操作" min-width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-has-permi="hasDetailPerm" v-has-permi="hasDetailPerm"
...@@ -159,8 +154,8 @@ ...@@ -159,8 +154,8 @@
</el-table> </el-table>
</div> </div>
<pagination <pagination
:key="pageKey"
v-show="total>0" v-show="total>0"
:key="pageKey"
:total="total" :total="total"
:page.sync="queryParams.page" :page.sync="queryParams.page"
:limit.sync="queryParams.rows" :limit.sync="queryParams.rows"
...@@ -177,11 +172,8 @@ import { ...@@ -177,11 +172,8 @@ import {
delCmsNotice, delCmsNotice,
listCmsNotice, updateStatus listCmsNotice, updateStatus
} from '@/api/contentManagement/notice' } from '@/api/contentManagement/notice'
import { updateResponseUrl } from '@/utils/updateUrl'
import { error } from 'autoprefixer/lib/utils'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getDataCache, setDataCache } from '@/assets/js/filterData' import { getDataCache, setDataCache } from '@/assets/js/filterData'
import { listCmsActivity } from '@/api/contentManagement/activity'
export default { export default {
name: 'Index', name: 'Index',
// components: { // components: {
...@@ -193,8 +185,6 @@ export default { ...@@ -193,8 +185,6 @@ export default {
hasAddPerm: ['sys:notice:add'], hasAddPerm: ['sys:notice:add'],
hasUpdatePerm: ['sys:notice:update'], hasUpdatePerm: ['sys:notice:update'],
hasDetailPerm: ['sys:notice:query'], hasDetailPerm: ['sys:notice:query'],
/* imageSrc: require('@/assets/image/test.png'),*/
// 显示开关 // 显示开关
showSwitch: { showSwitch: {
courseContent: true, courseContent: true,
...@@ -216,10 +206,8 @@ export default { ...@@ -216,10 +206,8 @@ export default {
formLabelWidth: '90px', formLabelWidth: '90px',
// 表格 // 表格
tableData: [], tableData: [],
lineindex: 0, lineindex: 0,
teacode: '', teacode: '',
// edit form // edit form
labelPosition: 'right', labelPosition: 'right',
formLabelAlign: { formLabelAlign: {
...@@ -231,21 +219,6 @@ export default { ...@@ -231,21 +219,6 @@ export default {
}, },
// 日期范围 // 日期范围
dateRange: [], dateRange: [],
// 板块选择框
plateOptions: [
{
label: '板块一',
value: '1'
},
{
label: '板块二',
value: '2'
},
{
label: '板块三',
value: '3'
}
],
// 发布状态 // 发布状态
releaseStatusOptions: [ releaseStatusOptions: [
{ {
...@@ -257,30 +230,18 @@ export default { ...@@ -257,30 +230,18 @@ export default {
value: '0' value: '0'
} }
], ],
// 上传提交 // 上传提交
uploadList: { uploadList: {
fm: '' fm: ''
}, },
// search area
courseid: '',
coursename: '',
queryParams: { queryParams: {
page: 1, page: 1,
rows: 10, rows: 10,
flag: '' flag: ''
}, },
// pagination
total: 0, total: 0,
actionUrl: '',
filelist: [], filelist: [],
bussid: [],
fullscreenLoading: false, fullscreenLoading: false,
curCatForm: {
},
tableDataTips: '加载中' tableDataTips: '加载中'
} }
}, },
...@@ -302,7 +263,7 @@ export default { ...@@ -302,7 +263,7 @@ export default {
vm.queryParams.page = JSON.parse(getDataCache(vm.$route.path)).page vm.queryParams.page = JSON.parse(getDataCache(vm.$route.path)).page
setTimeout(() => { setTimeout(() => {
vm.loadData() vm.loadData()
},500) }, 500)
} }
}) })
}, },
...@@ -316,17 +277,6 @@ export default { ...@@ -316,17 +277,6 @@ export default {
step(index) { step(index) {
return 'step' + index return 'step' + index
}, },
changPlate(data) {
if (data === '1') {
return '板块一'
}
if (data === '2') {
return '板块二'
}
if (data === '3') {
return '板块三'
}
},
/** /**
* @description: 点击蒙版关闭预览图片 * @description: 点击蒙版关闭预览图片
* @author: gaoyu * @author: gaoyu
...@@ -470,8 +420,12 @@ export default { ...@@ -470,8 +420,12 @@ export default {
}, },
// 获取图片的正确路径 // 获取图片的正确路径
getImagePath() { getImagePath(path) {
return require(`@/assets/image/testImage/test.png`) // 返回图片路径
if (path) {
return path
}
return ''
}, },
// 封面图片预览 // 封面图片预览
justEnter(event) { justEnter(event) {
......
...@@ -28,20 +28,7 @@ ...@@ -28,20 +28,7 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <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 yesOrNo" :key="item.value" :label="item.label" :value="item.value" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12"> <el-col :span="12">
<!-- 是否推荐-->
<el-form-item <el-form-item
label="是否推荐:" label="是否推荐:"
prop="isRecommended" prop="isRecommended"
...@@ -70,11 +57,11 @@ ...@@ -70,11 +57,11 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="发布日期:" label="发布日期:"
prop="releaseDate" prop="publishDate"
:rules="{ required: !(controls.isOperation === '3'), message: '请选择发布日期', trigger: 'blur' }" :rules="{ required: !(controls.isOperation === '3'), message: '请选择发布日期', trigger: 'blur' }"
> >
<el-date-picker <el-date-picker
v-model="form.releaseDate" v-model="form.publishDate"
type="date" type="date"
placeholder="选择发布日期" placeholder="选择发布日期"
:disabled="secondFromDisabled" :disabled="secondFromDisabled"
...@@ -84,13 +71,22 @@ ...@@ -84,13 +71,22 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item
label="权重:"
prop="weight"
:rules="{ required: !(controls.isOperation === '3'), message: '请选择权重', trigger: 'change' }"
>
<el-input-number v-model.trim="form.weight" style="width: 100%" controls-position="right" :min="0" />
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="公告封面:" prop="pictureId"> <el-form-item label="公告封面:" prop="pictureId">
<el-upload <el-upload
accept=".png,.jpg,.jpeg,.PNG,.JPG,.JPEG"
ref="upload" ref="upload"
accept=".png,.jpg,.jpeg,.PNG,.JPG,.JPEG"
:file-list="fileList" :file-list="fileList"
list-type="picture-card" list-type="picture-card"
class="avatar-uploader" class="avatar-uploader"
...@@ -103,31 +99,11 @@ ...@@ -103,31 +99,11 @@
:auto-upload="true" :auto-upload="true"
:limit="8" :limit="8"
> >
<i class="el-icon-plus avatar-uploader-icon"/> <i class="el-icon-plus avatar-uploader-icon" />
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="24">
<el-form-item
label="公告摘要:"
prop="summary"
:rules="{ required: !(controls.isOperation === '3'), message: '请输入公告简介', trigger: 'blur' }"
>
<el-input
v-model.trim="form.summary"
type="textarea"
:disabled="secondFromDisabled"
placeholder="请输入公告摘要"
size="small"
rows="3"
class="normalInput"
:maxlength="300"
/>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item <el-form-item
...@@ -163,8 +139,7 @@ import { ...@@ -163,8 +139,7 @@ import {
import { updateResponseUrl } from '@/utils/updateUrl' import { updateResponseUrl } from '@/utils/updateUrl'
import { VueEditor } from 'vue2-editor' import { VueEditor } from 'vue2-editor'
import { yesOrNo, enableOrDisable } from '@/utils/allPageData' import { yesOrNo, enableOrDisable } from '@/utils/allPageData'
import {uploadPublic} from "@/api/system/ossInfo"; import { uploadPublic } from '@/api/system/ossInfo'
/* import { uploadPublic } from '@/api/contentManagement/sysContest'*/
export default { export default {
components: { components: {
...@@ -221,33 +196,21 @@ export default { ...@@ -221,33 +196,21 @@ export default {
// 提交表单 // 提交表单
form: { form: {
// 主表id // 主表id
businessId: undefined, businessId: null,
createBy: undefined, createBy: null,
createDate: undefined, createDate: null,
deptId: undefined, deptId: null,
deptTwoId: undefined, deptTwoId: null,
noticeName: undefined, noticeName: null,
flag: undefined, flag: null,
photoossId: undefined, photoossId: null,
summary: undefined, summary: null,
weight: undefined, weight: null,
// isForntPage: undefined, isRecommended: null,
isRecommended: undefined, isTop: null
isTop: undefined
}, },
yesOrNo, yesOrNo,
enableOrDisable, enableOrDisable,
// 状态
statusOptions: [
{
label: '启用',
value: '1'
},
{
label: '停用',
value: '0'
}
],
// 校验规则 // 校验规则
rules: { rules: {
startDateS: [], startDateS: [],
...@@ -301,7 +264,7 @@ export default { ...@@ -301,7 +264,7 @@ export default {
formData.append('temp', 'CmsNotice') formData.append('temp', 'CmsNotice')
try { try {
// 发起上传请求 // 发起上传请求
const response = await uploadPublic(formData); const response = await uploadPublic(formData)
// 获取返回的 businessId,并更新 form.pictureId // 获取返回的 businessId,并更新 form.pictureId
const businessId = response.data.businessId const businessId = response.data.businessId
...@@ -312,10 +275,9 @@ export default { ...@@ -312,10 +275,9 @@ export default {
url: response.data.url, url: response.data.url,
name: response.data.noticeName, name: response.data.noticeName,
businessId: businessId businessId: businessId
}); })
} catch (error) { } catch (error) {
console.error('上传失败:', error); console.error('上传失败:', error)
} }
}, },
setFormDefaults() { setFormDefaults() {
...@@ -375,7 +337,10 @@ export default { ...@@ -375,7 +337,10 @@ export default {
getCmsNotice(this.$route.query.bussinessId).then(response => { getCmsNotice(this.$route.query.bussinessId).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.form = response.data this.form = response.data
this.imageUrl = response.data.path const param = {
url: response.data.path
}
this.fileList.push(param)
} }
}) })
} }
...@@ -418,7 +383,7 @@ export default { ...@@ -418,7 +383,7 @@ export default {
this.$refs.deviceFormRef.validate(valid => { this.$refs.deviceFormRef.validate(valid => {
if (valid) { if (valid) {
if (this.form.businessId !== undefined) { if (this.form.businessId !== null) {
// 编辑 // 编辑
updateCmsNotice(form).then(res => { updateCmsNotice(form).then(res => {
if (res.code === 200) { if (res.code === 200) {
...@@ -427,7 +392,7 @@ export default { ...@@ -427,7 +392,7 @@ export default {
type: 'success' type: 'success'
}) })
this.$router.push({ this.$router.push({
path: '/contentManagement/activity/index' path: '/contentManagement/notice'
}) })
} }
}) })
...@@ -439,7 +404,7 @@ export default { ...@@ -439,7 +404,7 @@ export default {
type: 'success' type: 'success'
}) })
this.$router.push({ this.$router.push({
path: '/contentManagement/activity/index' path: 'contentManagement/notice'
}) })
} }
}) })
...@@ -455,8 +420,9 @@ export default { ...@@ -455,8 +420,9 @@ export default {
this.pubLoading = true this.pubLoading = true
this.$refs.deviceFormRef.validate(valid => { this.$refs.deviceFormRef.validate(valid => {
if (valid) { if (valid) {
if (this.form.businessId !== undefined) { if (this.form.businessId !== null) {
// 编辑 // 编辑
console.log('编辑打印',form)
form.flag = '1' form.flag = '1'
updateCmsNotice(form).then(res => { updateCmsNotice(form).then(res => {
if (res.code === 200) { if (res.code === 200) {
...@@ -466,7 +432,7 @@ export default { ...@@ -466,7 +432,7 @@ export default {
}) })
this.pubLoading = false this.pubLoading = false
this.$router.push({ this.$router.push({
path: '/contentManagement/activity/index' path: '/contentManagement/notice'
}) })
} }
}).catch(() => { }).catch(() => {
...@@ -482,7 +448,7 @@ export default { ...@@ -482,7 +448,7 @@ export default {
}) })
this.pubLoading = false this.pubLoading = false
this.$router.push({ this.$router.push({
path: '/contentManagement/activity/index' path: '/contentManagement/notice'
}) })
} }
}).catch(() => { }).catch(() => {
...@@ -505,17 +471,17 @@ export default { ...@@ -505,17 +471,17 @@ export default {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
::v-deep.avatar-uploader .el-upload:hover { .avatar-uploader .el-upload:hover {
border-color: #409EFF; border-color: #409EFF;
} }
::v-deep.avatar-uploader-icon { /*::v-deep.avatar-uploader-icon {
font-size: 28px; font-size: 28px;
color: #8c939d; color: #8c939d;
width: 178px; width: 178px;
height: 178px; height: 178px;
line-height: 178px; line-height: 178px;
text-align: center; text-align: center;
} }*/
::v-deep.avatar { ::v-deep.avatar {
width: 178px; width: 178px;
height: 178px; height: 178px;
......
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