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

修改字段:权重,状态

parent 060b4d61
...@@ -118,12 +118,12 @@ ...@@ -118,12 +118,12 @@
<el-link type="primary" @click="handleClick(scope.row)">{{ scope.row.applicationCount || 0 }}</el-link> <el-link type="primary" @click="handleClick(scope.row)">{{ scope.row.applicationCount || 0 }}</el-link>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
{{ scope.row.weight || '-' }} {{ scope.row.weight || '-' }}
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.flag" v-model="scope.row.flag"
...@@ -152,12 +152,12 @@ ...@@ -152,12 +152,12 @@
<span>{{ scope.row.publishDate }}</span> <span>{{ scope.row.publishDate }}</span>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span>{{ scope.row.startTime }}</span> <span>{{ scope.row.startTime }}</span>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span>{{ scope.row.endTime }}</span> <span>{{ scope.row.endTime }}</span>
</template> </template>
......
...@@ -98,10 +98,12 @@ ...@@ -98,10 +98,12 @@
<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>
</el-table-column> </el-table-column>
<el-form-item label="排序:" prop="weight"> <el-table-column label="权重" prop="weight" :show-overflow-tooltip="true" min-width="55">
<el-input-number v-model.trim="form.weight" style="width: 100%" controls-position="right" :min="0" /> <template slot-scope="scope">
</el-form-item> {{ scope.row.weight || '-' }}
<el-table-column align="left" prop="releaseStatus" label="发布状态" min-width="120" show-overflow-tooltip> </template>
</el-table-column>
<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"
......
...@@ -87,21 +87,24 @@ ...@@ -87,21 +87,24 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="公告封面:"> <el-form-item label="公告封面:" prop="pictureId">
<el-upload <el-upload
accept=".png,.jpg,.jpeg,.PNG,.JPG,.JPEG" accept=".png,.jpg,.jpeg,.PNG,.JPG,.JPEG"
:disabled="secondFromDisabled" ref="upload"
:file-list="fileList"
list-type="picture-card"
class="avatar-uploader" class="avatar-uploader"
action="#" action="#"
:http-request="handleUpload" :on-preview="handlePreview"
:show-file-list="false" :on-remove="handleUploadRemoveFake"
:on-success="handleAvatarSuccess" :on-exceed="handleUploadExceed"
:before-upload="beforeAvatarUpload" :before-upload="handleUploadBeforeFake"
:before-remove="handleFileRemoveBefore"
:auto-upload="true"
:limit="8"
> >
<img v-if="imageUrl" :src="imageUrl" style="height: 200px;width: 200px"> <i class="el-icon-plus avatar-uploader-icon"/>
<i v-else 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>
...@@ -160,6 +163,7 @@ import { ...@@ -160,6 +163,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/contentManagement/sysContest'*/ /* import { uploadPublic } from '@/api/contentManagement/sysContest'*/
export default { export default {
...@@ -210,6 +214,9 @@ export default { ...@@ -210,6 +214,9 @@ export default {
// 1:代表新增 2:代表编辑 3:代表查看 // 1:代表新增 2:代表编辑 3:代表查看
isOperation: '1' isOperation: '1'
}, },
fileList: [],
dialogImageUrl: '',
dialogVisible: false,
fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'activity', fileUpload: '/dev-api/common/fileUpload?file=' + this.file + '&temp=' + 'activity',
// 提交表单 // 提交表单
form: { form: {
...@@ -219,7 +226,7 @@ export default { ...@@ -219,7 +226,7 @@ export default {
createDate: undefined, createDate: undefined,
deptId: undefined, deptId: undefined,
deptTwoId: undefined, deptTwoId: undefined,
equipmentName: undefined, noticeName: undefined,
flag: undefined, flag: undefined,
photoossId: undefined, photoossId: undefined,
summary: undefined, summary: undefined,
...@@ -266,6 +273,51 @@ export default { ...@@ -266,6 +273,51 @@ export default {
this.setFormDefaults() this.setFormDefaults()
}, },
methods: { 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() { setFormDefaults() {
const isOperation = this.isOperation const isOperation = this.isOperation
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<el-table-column align="center" prop="weight" label="排序" min-width="200" show-overflow-tooltip /> <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="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"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.flag" v-model="scope.row.flag"
...@@ -157,12 +157,12 @@ ...@@ -157,12 +157,12 @@
<el-form-item label="话题名称:" prop="topicName"> <el-form-item label="话题名称:" prop="topicName">
<el-input v-model.trim="form.topicName" show-word-limit :maxlength="500" placeholder="请输入话题名称" /> <el-input v-model.trim="form.topicName" show-word-limit :maxlength="500" placeholder="请输入话题名称" />
</el-form-item> </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-input-number v-model.trim="form.weight" style="width: 100%" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="动态数:" prop="articleCount"> <!-- <el-form-item label="动态数:" prop="articleCount">-->
<el-input-number v-model.trim="form.articleCount" style="width: 100%" controls-position="right" :min="0" /> <!-- <el-input-number v-model.trim="form.articleCount" style="width: 100%" controls-position="right" :min="0" />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="状态:"> <el-form-item label="状态:">
<el-radio-group v-model="form.flag" style="width: 100%"> <el-radio-group v-model="form.flag" style="width: 100%">
<el-radio <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