This commit is contained in:
wangchengming 2025-01-03 14:54:47 +08:00
parent 2aba33925d
commit c43ecdc66f
4 changed files with 699 additions and 604 deletions

View File

@ -15,4 +15,12 @@ export function delPartnerSupplier(id) {
url: '/official/companymessage/' + id, url: '/official/companymessage/' + id,
method: 'delete' method: 'delete'
}) })
}
export function downFile(url) {
return request({
url: '/system/oss/download?imageUrl='+ url,
method: 'get',
responseType: 'blob',
})
} }

View File

@ -3,12 +3,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="公司名称(个人)" prop="companyName"> <el-form-item label="公司名称(个人)" prop="companyName">
<el-input <el-input v-model="queryParams.companyName" placeholder="请输入公司名称(个人)" clearable @keyup.enter.native="handleQuery" />
v-model="queryParams.companyName"
placeholder="请输入公司名称(个人)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -19,22 +14,14 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['official:businessPartner:remove']">删除</el-button>
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['official:businessPartner:remove']"
>删除</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" v-if="false"/> <el-table-column label="主键id" align="center" prop="id" v-if="false" />
<el-table-column label="公司名称(个人)" width="130" align="center" prop="companyName" /> <el-table-column label="公司名称(个人)" width="130" align="center" prop="companyName" />
<el-table-column label="地址" width="230" align="center" prop="address" /> <el-table-column label="地址" width="230" align="center" prop="address" />
<el-table-column label="联系电话" width="110" align="center" prop="phoneNumber" /> <el-table-column label="联系电话" width="110" align="center" prop="phoneNumber" />
@ -50,6 +37,13 @@
<div class="multiple-line-content-show" style="cursor: pointer;" @click="dialogContent(row.cooperationIntention, '合作意向概述')" v-html="row.cooperationIntention"></div> <div class="multiple-line-content-show" style="cursor: pointer;" @click="dialogContent(row.cooperationIntention, '合作意向概述')" v-html="row.cooperationIntention"></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="附件" width="400" align="center" prop="imageurl">
<template slot-scope="{ row }" v-if="row.imageurl">
<div class="line-content-show" style="cursor: pointer;" v-for="(url, index) in row.imageurl.split(',')" :key="'file'+ index" @click="handleDownFile(url)">
{{ getFileName(url) }}
</div>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
@ -57,141 +51,159 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['official:businessPartner:remove']">删除</el-button>
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['official:businessPartner:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listPartnerSupplier, delPartnerSupplier } from "@/api/official/partnerSupplier"; import {
listPartnerSupplier,
delPartnerSupplier,
downFile
} from '@/api/official/partnerSupplier'
export default { export default {
name: "FeedBack", name: 'FeedBack',
data() { data() {
return { return {
// loading // loading
buttonLoading: false, buttonLoading: false,
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
slideshowList: [], slideshowList: [],
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
propertiesType: 1, propertiesType: 1,
companyName: undefined, companyName: undefined
}
}
},
created() {
this.getList()
},
methods: {
//
getFileName(name) {
// url
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
}, },
}; handleDownFile(url) {
}, downFile(url).then(res => {
created() { // a
this.getList(); const downLoadName = this.getFileName(url)
}, const a = document.createElement('a')
methods: { a.href = URL.createObjectURL(res)
/** // adownload
列表 */ a.setAttribute('download', downLoadName)
getList() { document.body.appendChild(a)
this.loading = true; a.click()
listPartnerSupplier(this.queryParams).then(response => { document.body.removeChild(a)
this.slideshowList = response.rows; })
this.total = response.total; },
this.loading = false; /**
}); 列表 */
}, getList() {
// this.loading = true
cancel() { listPartnerSupplier(this.queryParams).then(response => {
this.open = false; this.slideshowList = response.rows
this.reset(); this.total = response.total
}, this.loading = false
// })
reset() { },
this.form = { //
id: undefined, cancel() {
captionName: undefined, this.open = false
}; this.reset()
this.resetForm("form"); },
}, //
/** 搜索按钮操作 */ reset() {
handleQuery() { this.form = {
this.queryParams.pageNum = 1; id: undefined,
this.getList(); captionName: undefined
}, }
/** 重置按钮操作 */ this.resetForm('form')
resetQuery() { },
this.resetForm("queryForm"); /** 搜索按钮操作 */
this.handleQuery(); handleQuery() {
}, this.queryParams.pageNum = 1
// this.getList()
handleSelectionChange(selection) { },
this.ids = selection.map(item => item.id) /** 重置按钮操作 */
this.single = selection.length!==1 resetQuery() {
this.multiple = !selection.length this.resetForm('queryForm')
}, this.handleQuery()
/** 删除按钮操作 */ },
handleDelete(row) { //
const ids = row.id || this.ids; handleSelectionChange(selection) {
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => { this.ids = selection.map(item => item.id)
this.loading = true; this.single = selection.length !== 1
return delPartnerSupplier(ids); this.multiple = !selection.length
}).then(() => { },
this.loading = false; /** 删除按钮操作 */
this.getList(); handleDelete(row) {
this.$modal.msgSuccess("删除成功"); const ids = row.id || this.ids
}).catch(() => { this.$modal
}).finally(() => { .confirm('是否确认删除编号为"' + ids + '"的数据项?')
this.loading = false; .then(() => {
}); this.loading = true
}, return delPartnerSupplier(ids)
dialogContent(feedContent, title) { })
this.$alert(feedContent, title, { .then(() => {
confirmButtonText: '确定', this.loading = false
callback: action => {} this.getList()
}); this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
.finally(() => {
this.loading = false
})
},
dialogContent(feedContent, title) {
this.$alert(feedContent, title, {
confirmButtonText: '确定',
callback: action => {}
})
}
} }
} }
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .multiple-line-content-show p { ::v-deep .multiple-line-content-show p {
margin: 0; margin: 0;
} }
// //
::v-deep .el-dialog { ::v-deep .el-dialog {
height: 92%; height: 92%;
overflow: hidden; overflow: hidden;
} }
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
padding: 30px 20px 0; padding: 30px 20px 0;
height: 89%; height: 89%;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>

View File

@ -3,12 +3,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="标题名称" prop="captionName"> <el-form-item label="标题名称" prop="captionName">
<el-input <el-input v-model="queryParams.captionName" placeholder="请输入标题名称" clearable @keyup.enter.native="handleQuery" />
v-model="queryParams.captionName"
placeholder="请输入标题名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="type"> <el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" @change="handleQuery"> <el-select v-model="queryParams.type" @change="handleQuery">
@ -19,32 +14,18 @@
<el-option value="3" label="行业动态"></el-option> <el-option value="3" label="行业动态"></el-option>
<el-option value="4" label="投资者"></el-option> <el-option value="4" label="投资者"></el-option>
<el-option value="5" label="公司治理"></el-option> <el-option value="5" label="公司治理"></el-option>
<el-option value="6" label="投资者关系"></el-option> <!-- <el-option value="6" label="投资者关系"></el-option> -->
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发布时间" prop="releaseTime"> <el-form-item label="发布时间" prop="releaseTime">
<el-date-picker clearable <el-date-picker clearable v-model="queryParams.releaseTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择发布时间">
v-model="queryParams.releaseTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择发布时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="集团名称" prop="groupName"> <el-form-item label="集团名称" prop="groupName">
<el-input <el-input v-model="queryParams.groupName" placeholder="请输入集团名称" clearable @keyup.enter.native="handleQuery" />
v-model="queryParams.groupName"
placeholder="请输入集团名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item label="摘要" prop="abstracts"> <el-form-item label="摘要" prop="abstracts">
<el-input <el-input v-model="queryParams.abstracts" placeholder="请输入摘要" clearable @keyup.enter.native="handleQuery" />
v-model="queryParams.abstracts"
placeholder="请输入摘要"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -55,65 +36,30 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['official:slideshow:add']">新增</el-button>
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['official:slideshow:add']"
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['official:slideshow:edit']">修改</el-button>
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['official:slideshow:edit']"
>修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['official:slideshow:remove']">删除</el-button>
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['official:slideshow:remove']"
>删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['official:slideshow:export']">导出</el-button>
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['official:slideshow:export']"
>导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" v-if="false"/> <el-table-column label="主键id" align="center" prop="id" v-if="false" />
<el-table-column label="封面" align="center" prop="cover"> <el-table-column label="封面" align="center" prop="cover">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<img :src="row.cover" alt="" style="width:50px;height:50px;object-fit:cover;"> <img :src="row.cover" alt="" style="width:50px;height:50px;object-fit:cover;">
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标题名称" align="center" prop="captionName" /> <el-table-column label="标题名称" align="center" prop="captionName" />
<el-table-column <el-table-column label="类型" align="center" prop="type" :formatter="(row, column, cellValue, index) => ['公告通知', '公司资讯', '政策法规', '行业动态', '投资者', '公司治理'][cellValue]" />
label="类型"
align="center"
prop="type"
:formatter="(row, column, cellValue, index) => ['公告通知', '公司资讯', '政策法规', '行业动态', '投资者', '公司治理', '投资者关系'][cellValue]"
/>
<el-table-column label="发布时间" align="center" prop="releaseTime" width="180"> <el-table-column label="发布时间" align="center" prop="releaseTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d}') }}</span>
@ -126,39 +72,16 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="摘要" align="center" prop="abstracts" /> <el-table-column label="摘要" align="center" prop="abstracts" />
<el-table-column <el-table-column label="是否置顶" align="center" prop="isTop" :formatter="(row, column, cellValue, index) => ['否', '是'][cellValue || '0']" />
label="是否置顶"
align="center"
prop="isTop"
:formatter="(row, column, cellValue, index) => ['否', '是'][cellValue || '0']"
/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['official:slideshow:edit']">修改</el-button>
size="mini" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['official:slideshow:remove']">删除</el-button>
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['official:slideshow:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['official:slideshow:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改新闻信息对话框 --> <!-- 添加或修改新闻信息对话框 -->
<el-dialog :title="title" :visible.sync="open" class="showAll_dialog" width="1520px" append-to-body> <el-dialog :title="title" :visible.sync="open" class="showAll_dialog" width="1520px" append-to-body>
@ -175,38 +98,17 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="类型" prop="type">
<el-radio-group v-model="form.type">
<el-radio label="0">公告通知</el-radio>
<el-radio label="1">公司资讯</el-radio>
<el-radio label="2">政策法规</el-radio>
<el-radio label="3">行业动态</el-radio>
<el-radio label="4">投资者</el-radio>
<el-radio label="5">公司治理</el-radio>
<el-radio label="6">投资者关系</el-radio>
</el-radio-group>
</el-form-item>
<el-row> <el-row>
<el-col :span="6"> <el-col :span="18">
<el-form-item label="发布时间" prop="releaseTime"> <el-form-item label="类型" prop="type">
<el-date-picker clearable <el-radio-group v-model="form.type">
v-model="form.releaseTime" <el-radio label="0">公告通知</el-radio>
type="datetime" <el-radio label="1">公司资讯</el-radio>
value-format="yyyy-MM-dd HH:mm:ss" <el-radio label="2">政策法规</el-radio>
placeholder="请选择发布时间"> <el-radio label="3">行业动态</el-radio>
</el-date-picker> <el-radio label="4">投资者</el-radio>
</el-form-item> <el-radio label="5">公司治理</el-radio>
</el-col> <!-- <el-radio label="6">投资者关系</el-radio> -->
<el-col :span="6">
<el-form-item label="集团名称" prop="groupName">
<el-input v-model="form.groupName" placeholder="请输入集团名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否置顶" prop="isTop">
<el-radio-group v-model="form.isTop">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -216,12 +118,44 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-form-item label="封面" prop="cover"> <template v-if="form.type != '5'">
<ImageUploadLochost v-model="form.cover" :limit="1" :fileSize="10" /> <el-row>
</el-form-item> <el-col :span="6">
<el-form-item label="新闻内容" prop="newsContent"> <el-form-item label="发布时间" prop="releaseTime">
<editor v-model="form.newsContent" :min-height="388"/> <el-date-picker clearable v-model="form.releaseTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择发布时间">
</el-form-item> </el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="集团名称" prop="groupName">
<el-input v-model="form.groupName" placeholder="请输入集团名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否置顶" prop="isTop">
<el-radio-group v-model="form.isTop">
<el-radio label="0"></el-radio>
<el-radio label="1"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="封面" prop="cover">
<ImageUploadLochost v-model="form.cover" :limit="1" :fileSize="10" />
</el-form-item>
<el-form-item label="新闻内容" prop="newsContent">
<editor v-model="form.newsContent" :min-height="388" />
</el-form-item>
</template>
<template v-else>
<el-form-item label="附件">
<el-upload class="upload-demo" drag :headers="headers" :action="uploadFileUrl" :limit='limit' :before-upload="handleBeforeUpload" :file-list="fileList" :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" :on-remove="handleDeleteFile" ref="fileUpload">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</el-upload>
</el-form-item>
</template>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button> <el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
@ -232,215 +166,344 @@
</template> </template>
<script> <script>
import { listSlideshow, getSlideshow, delSlideshow, addSlideshow, updateSlideshow } from "@/api/official/slideshow"; import {
listSlideshow,
getSlideshow,
delSlideshow,
addSlideshow,
updateSlideshow
} from '@/api/official/slideshow'
import { getToken } from '@/utils/auth'
export default { export default {
name: "Slideshow", name: 'Slideshow',
data() { data() {
return { return {
// loading // (MB)
buttonLoading: false, fileSize: 10,
// // , ['png', 'jpg', 'jpeg']
loading: true, fileType: [
// 'png',
ids: [], 'jpg',
// 'doc',
single: true, 'docx',
// 'xls',
multiple: true, 'xlsx',
// 'ppt',
showSearch: true, 'txt',
// 'pdf'
total: 0,
//
slideshowList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
cover: undefined,
captionName: undefined,
releaseTime: undefined,
groupName: undefined,
newsContent: undefined,
abstracts: undefined,
isTop: undefined,
type: '',
},
//
form: {},
//
rules: {
id: [
{ required: true, message: "主键id不能为空", trigger: "blur" }
],
cover: [
{ required: true, message: "封面不能为空", trigger: "blur" }
],
captionName: [
{ required: true, message: "标题名称不能为空", trigger: "blur" }
],
releaseTime: [
{ required: true, message: "发布时间不能为空", trigger: "blur" }
],
groupName: [
{ required: true, message: "集团名称不能为空", trigger: "blur" }
],
newsContent: [
{ required: true, message: "新闻内容不能为空", trigger: "blur" }
],
abstracts: [
{ required: true, message: "摘要不能为空", trigger: "blur" }
],
isTop: [
{ required: true, message: "是否置顶不能为空", trigger: "blur" }
],
type: [
{ required: true, message: "类型不能为空", trigger: "blur" }
], ],
number: 0,
limit: 1,
uploadList: [],
//
uploadFileUrl:
process.env.VUE_APP_API_TARGET_URL + 'system/oss/addPartsUpload',
headers: { Authorization: 'Bearer ' + getToken() },
fileList: [],
loadingModal: undefined,
// loading
buttonLoading: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
slideshowList: [],
//
title: '',
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
cover: undefined,
captionName: undefined,
releaseTime: undefined,
groupName: undefined,
newsContent: undefined,
abstracts: undefined,
isTop: undefined,
type: ''
},
//
form: {},
//
rules: {
id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
cover: [{ required: true, message: '封面不能为空', trigger: 'blur' }],
captionName: [
{ required: true, message: '标题名称不能为空', trigger: 'blur' }
],
releaseTime: [
{ required: true, message: '发布时间不能为空', trigger: 'blur' }
],
groupName: [
{ required: true, message: '集团名称不能为空', trigger: 'blur' }
],
newsContent: [
{ required: true, message: '新闻内容不能为空', trigger: 'blur' }
],
abstracts: [
{ required: true, message: '摘要不能为空', trigger: 'blur' }
],
isTop: [
{ required: true, message: '是否置顶不能为空', trigger: 'blur' }
],
type: [{ required: true, message: '类型不能为空', trigger: 'blur' }]
}
} }
};
},
created() {
this.getList();
},
methods: {
/**
列表 */
getList() {
this.loading = true;
listSlideshow(this.queryParams).then(response => {
this.slideshowList = response.rows;
this.total = response.total;
this.loading = false;
});
}, },
// created() {
cancel() { this.getList()
this.open = false;
this.reset();
}, },
// methods: {
reset() { /**
this.form = { 列表 */
id: undefined, getList() {
cover: '', this.loading = true
captionName: undefined, listSlideshow(this.queryParams).then(response => {
releaseTime: undefined, this.slideshowList = response.rows
groupName: undefined, this.total = response.total
newsContent: undefined, this.loading = false
abstracts: undefined, })
isTop: '0', },
type: '1', //
createBy: undefined, cancel() {
createUserId: undefined, this.open = false
createTime: undefined, this.reset()
updateBy: undefined, },
updateUserId: undefined, //
updateTime: undefined reset() {
}; this.form = {
this.resetForm("form"); id: undefined,
}, cover: '',
/** 搜索按钮操作 */ captionName: undefined,
handleQuery() { releaseTime: undefined,
this.queryParams.pageNum = 1; groupName: undefined,
this.getList(); newsContent: undefined,
}, abstracts: undefined,
/** 重置按钮操作 */ isTop: '0',
resetQuery() { type: '1',
this.resetForm("queryForm"); createBy: undefined,
this.handleQuery(); createUserId: undefined,
}, createTime: undefined,
// updateBy: undefined,
handleSelectionChange(selection) { updateUserId: undefined,
this.ids = selection.map(item => item.id) updateTime: undefined
this.single = selection.length!==1 }
this.multiple = !selection.length this.resetForm('form')
}, },
/** 新增按钮操作 */ /** 搜索按钮操作 */
handleAdd() { handleQuery() {
this.reset(); this.queryParams.pageNum = 1
this.open = true; this.getList()
this.title = "添加新闻信息"; },
}, /** 重置按钮操作 */
/** 修改按钮操作 */ resetQuery() {
handleUpdate(row) { this.resetForm('queryForm')
this.loading = true; this.handleQuery()
this.reset(); },
const id = row.id || this.ids //
getSlideshow(id).then(response => { handleSelectionChange(selection) {
this.loading = false; this.ids = selection.map(item => item.id)
this.form = response.data; this.single = selection.length !== 1
this.open = true; this.multiple = !selection.length
this.title = "修改新闻信息"; },
}); /** 新增按钮操作 */
}, handleAdd() {
/** 提交按钮 */ this.reset()
submitForm() { this.fileList = []
this.$refs["form"].validate(valid => { this.open = true
if (valid) { this.title = '添加新闻信息'
this.buttonLoading = true; },
if (this.form.id != null) { /** 修改按钮操作 */
updateSlideshow(this.form).then(response => { handleUpdate(row) {
this.$modal.msgSuccess("修改成功"); this.loading = true
this.open = false; this.reset()
this.getList(); const id = row.id || this.ids
}).finally(() => { getSlideshow(id).then(response => {
this.buttonLoading = false; this.loading = false
}); this.form = response.data
} else { this.open = true
addSlideshow(this.form).then(response => { this.title = '修改新闻信息'
this.$modal.msgSuccess("新增成功"); if (this.form.type == '5') {
this.open = false; this.fileList = this.form.cover
this.getList(); ? [
}).finally(() => { {
this.buttonLoading = false; url: this.form.cover,
}); name: this.getFileName(this.form.cover)
}
]
: []
}
})
},
//
getFileName(name) {
// url
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
},
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.buttonLoading = true
if (this.form.id != null) {
updateSlideshow(this.form)
.then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
.finally(() => {
this.buttonLoading = false
})
} else {
addSlideshow(this.form)
.then(response => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
.finally(() => {
this.buttonLoading = false
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal
.confirm('是否确认删除新闻信息编号为"' + ids + '"的数据项?')
.then(() => {
this.loading = true
return delSlideshow(ids)
})
.then(() => {
this.loading = false
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
.finally(() => {
this.loading = false
})
},
/** 导出按钮操作 */
handleExport() {
this.download(
'official/slideshow/export',
{
...this.queryParams
},
`slideshow_${new Date().getTime()}.xlsx`
)
},
//
handleBeforeUpload(file) {
//
if (this.fileType) {
const fileName = file.name.split('.')
const fileExt = fileName[fileName.length - 1]
const isTypeOk = this.fileType.indexOf(fileExt) >= 0
if (!isTypeOk) {
this.$message.error(
`文件格式不正确, 请上传${this.fileType.join('/')}格式文件!`
)
return false
} }
} }
}); //
}, if (this.fileSize) {
/** 删除按钮操作 */ const isLt = file.size / 1024 / 1024 < this.fileSize
handleDelete(row) { if (!isLt) {
const ids = row.id || this.ids; this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`)
this.$modal.confirm('是否确认删除新闻信息编号为"' + ids + '"的数据项?').then(() => { return false
this.loading = true; }
return delSlideshow(ids); }
}).then(() => { this.loadingModal = this.$loading({
this.loading = false; lock: true,
this.getList(); text: '正在上传文件,请稍候...',
this.$modal.msgSuccess("删除成功"); spinner: 'el-icon-loading',
}).catch(() => { background: 'rgba(0, 0, 0, 0.7)'
}).finally(() => { })
this.loading = false; this.number++
}); return true
}, },
/** 导出按钮操作 */ //
handleExport() { handleExceed() {
this.download('official/slideshow/export', { this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`)
...this.queryParams },
}, `slideshow_${new Date().getTime()}.xlsx`) //
handleUploadError(err) {
this.$message.error(`上传文件失败,请重试`)
this.loadingModal.close()
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push({
name: res.data.fileName,
url: res.data.url,
ossId: res.data.ossId
})
;(this.form.cover = res.data.url), this.uploadedSuccessfully()
} else {
this.number--
this.loadingModal.close()
this.$message.error(res.msg)
this.$refs.fileUpload.handleRemove(file)
this.uploadedSuccessfully()
}
},
//
handleDeleteFile(index) {
// let ossId = this.fileList[index].ossId
// delOss(ossId)
this.fileList.splice(index, 1)
this.form.cover = null
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList)
this.uploadList = []
this.number = 0
this.loadingModal.close()
}
}
} }
} }
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .multiple-line-content-show p { ::v-deep .multiple-line-content-show p {
margin: 0; margin: 0;
} }
// //
::v-deep .el-dialog { ::v-deep .el-dialog {
height: 92%; height: 92%;
overflow: hidden; overflow: hidden;
} }
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
padding: 30px 20px 0; padding: 30px 20px 0;
height: 89%; height: 89%;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>

View File

@ -3,12 +3,7 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="公司名称" prop="companyName"> <el-form-item label="公司名称" prop="companyName">
<el-input <el-input v-model="queryParams.companyName" placeholder="请输入公司名称" clearable @keyup.enter.native="handleQuery" />
v-model="queryParams.companyName"
placeholder="请输入公司名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -19,22 +14,14 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['official:supplier:remove']">删除</el-button>
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['official:supplier:remove']"
>删除</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" v-if="false"/> <el-table-column label="主键id" align="center" prop="id" v-if="false" />
<el-table-column label="公司名称" width="130" align="center" prop="companyName" /> <el-table-column label="公司名称" width="130" align="center" prop="companyName" />
<el-table-column label="公司地址" width="230" align="center" prop="address" /> <el-table-column label="公司地址" width="230" align="center" prop="address" />
<el-table-column label="统一社会信用代码" width="230" align="center" prop="identifierCode" /> <el-table-column label="统一社会信用代码" width="230" align="center" prop="identifierCode" />
@ -60,6 +47,13 @@
<div class="multiple-line-content-show" style="cursor: pointer;" @click="dialogContent(row.cooperationIntention, '合作意向概述')" v-html="row.cooperationIntention"></div> <div class="multiple-line-content-show" style="cursor: pointer;" @click="dialogContent(row.cooperationIntention, '合作意向概述')" v-html="row.cooperationIntention"></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="附件" width="400" align="center" prop="imageurl">
<template slot-scope="{ row }" v-if="row.imageurl">
<div class="line-content-show" style="cursor: pointer;" v-for="(url, index) in row.imageurl.split(',')" :key="'file'+ index" @click="handleDownFile(url)">
{{ getFileName(url) }}
</div>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
@ -67,141 +61,159 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['official:supplier:remove']">删除</el-button>
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['official:supplier:remove']"
>删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listPartnerSupplier, delPartnerSupplier } from "@/api/official/partnerSupplier"; import {
listPartnerSupplier,
delPartnerSupplier,
downFile
} from '@/api/official/partnerSupplier'
export default { export default {
name: "FeedBack", name: 'FeedBack',
data() { data() {
return { return {
// loading // loading
buttonLoading: false, buttonLoading: false,
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// //
slideshowList: [], slideshowList: [],
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
propertiesType: 2, propertiesType: 2,
companyName: undefined, companyName: undefined
}
}
},
created() {
this.getList()
},
methods: {
//
getFileName(name) {
// url
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
}, },
}; handleDownFile(url) {
}, downFile(url).then(res => {
created() { // a
this.getList(); const downLoadName = this.getFileName(url)
}, const a = document.createElement('a')
methods: { a.href = URL.createObjectURL(res)
/** // adownload
列表 */ a.setAttribute('download', downLoadName)
getList() { document.body.appendChild(a)
this.loading = true; a.click()
listPartnerSupplier(this.queryParams).then(response => { document.body.removeChild(a)
this.slideshowList = response.rows; })
this.total = response.total; },
this.loading = false; /**
}); 列表 */
}, getList() {
// this.loading = true
cancel() { listPartnerSupplier(this.queryParams).then(response => {
this.open = false; this.slideshowList = response.rows
this.reset(); this.total = response.total
}, this.loading = false
// })
reset() { },
this.form = { //
id: undefined, cancel() {
captionName: undefined, this.open = false
}; this.reset()
this.resetForm("form"); },
}, //
/** 搜索按钮操作 */ reset() {
handleQuery() { this.form = {
this.queryParams.pageNum = 1; id: undefined,
this.getList(); captionName: undefined
}, }
/** 重置按钮操作 */ this.resetForm('form')
resetQuery() { },
this.resetForm("queryForm"); /** 搜索按钮操作 */
this.handleQuery(); handleQuery() {
}, this.queryParams.pageNum = 1
// this.getList()
handleSelectionChange(selection) { },
this.ids = selection.map(item => item.id) /** 重置按钮操作 */
this.single = selection.length!==1 resetQuery() {
this.multiple = !selection.length this.resetForm('queryForm')
}, this.handleQuery()
/** 删除按钮操作 */ },
handleDelete(row) { //
const ids = row.id || this.ids; handleSelectionChange(selection) {
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => { this.ids = selection.map(item => item.id)
this.loading = true; this.single = selection.length !== 1
return delPartnerSupplier(ids); this.multiple = !selection.length
}).then(() => { },
this.loading = false; /** 删除按钮操作 */
this.getList(); handleDelete(row) {
this.$modal.msgSuccess("删除成功"); const ids = row.id || this.ids
}).catch(() => { this.$modal
}).finally(() => { .confirm('是否确认删除编号为"' + ids + '"的数据项?')
this.loading = false; .then(() => {
}); this.loading = true
}, return delPartnerSupplier(ids)
dialogContent(feedContent, title) { })
this.$alert(feedContent, title, { .then(() => {
confirmButtonText: '确定', this.loading = false
callback: action => {} this.getList()
}); this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
.finally(() => {
this.loading = false
})
},
dialogContent(feedContent, title) {
this.$alert(feedContent, title, {
confirmButtonText: '确定',
callback: action => {}
})
}
} }
} }
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .multiple-line-content-show p { ::v-deep .multiple-line-content-show p {
margin: 0; margin: 0;
} }
// //
::v-deep .el-dialog { ::v-deep .el-dialog {
height: 92%; height: 92%;
overflow: hidden; overflow: hidden;
} }
::v-deep .el-dialog__body { ::v-deep .el-dialog__body {
padding: 30px 20px 0; padding: 30px 20px 0;
height: 89%; height: 89%;
overflow-y: auto; overflow-y: auto;
} }
</style> </style>