Commit 008a4d93 authored by 冷玲鹏's avatar 冷玲鹏

修改字段:权重,状态

parent 060b4d61
......@@ -118,12 +118,12 @@
<el-link type="primary" @click="handleClick(scope.row)">{{ scope.row.applicationCount || 0 }}</el-link>
</template>
</el-table-column>
<el-table-column label="排序" prop="weight" :show-overflow-tooltip="true" min-width="55">
<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 align="center" prop="releaseStatus" label="发布状态" min-width="80" show-overflow-tooltip>
<el-table-column align="center" prop="releaseStatus" label="状态" min-width="80" show-overflow-tooltip>
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
......@@ -152,12 +152,12 @@
<span>{{ scope.row.publishDate }}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="startTime" label="结束时间" min-width="120" show-overflow-tooltip>
<el-table-column align="center" prop="startTime" label="开始时间" min-width="180" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.startTime }}</span>
</template>
</el-table-column>
<el-table-column align="center" prop="endTime" label="发布日期" min-width="120" show-overflow-tooltip>
<el-table-column align="center" prop="endTime" label="结束时间" min-width="180" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ scope.row.endTime }}</span>
</template>
......
......@@ -98,10 +98,12 @@
<el-tag v-if="scope.row.isRecommended === 1" type="warning" size="medium ">推荐</el-tag>
</template>
</el-table-column>
<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-table-column align="left" prop="releaseStatus" label="发布状态" min-width="120" show-overflow-tooltip>
<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 align="left" prop="releaseStatus" label="状态" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
......
......@@ -87,21 +87,24 @@
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="公告封面:">
<el-form-item label="公告封面:" prop="pictureId">
<el-upload
accept=".png,.jpg,.jpeg,.PNG,.JPG,.JPEG"
:disabled="secondFromDisabled"
ref="upload"
:file-list="fileList"
list-type="picture-card"
class="avatar-uploader"
action="#"
:http-request="handleUpload"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
:on-preview="handlePreview"
:on-remove="handleUploadRemoveFake"
:on-exceed="handleUploadExceed"
:before-upload="handleUploadBeforeFake"
:before-remove="handleFileRemoveBefore"
:auto-upload="true"
:limit="8"
>
<img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px">
<i v-else class="el-icon-plus avatar-uploader-icon" />
<i class="el-icon-plus avatar-uploader-icon"/>
</el-upload>
</el-form-item>
</el-col>
</el-row>
......@@ -160,6 +163,7 @@ import {
import { updateResponseUrl } from '@/utils/updateUrl'
import { VueEditor } from 'vue2-editor'
import { yesOrNo, enableOrDisable } from '@/utils/allPageData'
import {uploadPublic} from "@/api/system/ossInfo";
/* import { uploadPublic } from '@/api/contentManagement/sysContest'*/
export default {
......@@ -210,6 +214,9 @@ export default {
// 1:代表新增 2:代表编辑 3:代表查看
isOperation: '1'
},
fileList: [],
dialogImageUrl: '',
dialogVisible: false,
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'activity',
// 提交表单
form: {
......@@ -219,7 +226,7 @@ export default {
createDate: undefined,
deptId: undefined,
deptTwoId: undefined,
equipmentName: undefined,
noticeName: undefined,
flag: undefined,
photoossId: undefined,
summary: undefined,
......@@ -266,6 +273,51 @@ export default {
this.setFormDefaults()
},
methods: {
// 上传
handlePreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
handleFileRemoveBefore(file, fileList) {
return this.$confirm(`确定移除该图片吗?`)
},
handleUploadRemoveFake(file, fileList) {
if (file.businessId) {
this.fileList = this.fileList.filter(fileItem => fileItem.businessId !== file.businessId)
} else {
this.fileList = this.fileList.filter(fileItem => fileItem.pictureId !== file.pictureId)
}
},
handleUploadExceed(files, fileList) {
this.$message.warning(`最多上传8张图片`)
},
async handleUploadBeforeFake(file) {
if (!file.type.startsWith('image/')) {
this.$message.warning('只支持上传图片')
return false
}
const formData = new FormData()
formData.append('file', file)
formData.append('temp', 'CmsNotice')
try {
// 发起上传请求
const response = await uploadPublic(formData);
// 获取返回的 businessId,并更新 form.pictureId
const businessId = response.data.businessId
this.form.pictureId = businessId
// 更新 fileList,保存文件的 URL 和其他信息
this.fileList.push({
url: response.data.url,
name: response.data.noticeName,
businessId: businessId
});
} catch (error) {
console.error('上传失败:', error);
}
},
setFormDefaults() {
const isOperation = this.isOperation
......
......@@ -75,7 +75,7 @@
<el-table-column align="center" prop="weight" label="排序" min-width="200" show-overflow-tooltip />
<el-table-column align="center" prop="articleCount" label="动态数" min-width="200" show-overflow-tooltip />
<el-table-column align="left" prop="flag" label="发布状态" min-width="120" show-overflow-tooltip>
<el-table-column align="left" prop="flag" label="状态" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
<el-switch
v-model="scope.row.flag"
......@@ -157,12 +157,12 @@
<el-form-item label="话题名称:" prop="topicName">
<el-input v-model.trim="form.topicName" show-word-limit :maxlength="500" placeholder="请输入话题名称" />
</el-form-item>
<el-form-item label="排序:" prop="weight">
<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="动态数:" prop="articleCount">
<el-input-number v-model.trim="form.articleCount" style="width: 100%" controls-position="right" :min="0" />
</el-form-item>
<!-- <el-form-item label="动态数:" prop="articleCount">-->
<!-- <el-input-number v-model.trim="form.articleCount" 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
......
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