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

@ -16,3 +16,11 @@ export function delPartnerSupplier(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,32 +51,24 @@
</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
@ -108,90 +94,116 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
propertiesType: 1, propertiesType: 1,
companyName: undefined, companyName: undefined
}, }
}; }
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
//
getFileName(name) {
// url
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
},
handleDownFile(url) {
downFile(url).then(res => {
// a
const downLoadName = this.getFileName(url)
const a = document.createElement('a')
a.href = URL.createObjectURL(res)
// adownload
a.setAttribute('download', downLoadName)
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
})
},
/** /**
列表 */ 列表 */
getList() { getList() {
this.loading = true; this.loading = true
listPartnerSupplier(this.queryParams).then(response => { listPartnerSupplier(this.queryParams).then(response => {
this.slideshowList = response.rows; this.slideshowList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
this.form = { this.form = {
id: undefined, id: undefined,
captionName: undefined, captionName: undefined
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => { this.$modal
this.loading = true; .confirm('是否确认删除编号为"' + ids + '"的数据项?')
return delPartnerSupplier(ids); .then(() => {
}).then(() => { this.loading = true
this.loading = false; return delPartnerSupplier(ids)
this.getList(); })
this.$modal.msgSuccess("删除成功"); .then(() => {
}).catch(() => { this.loading = false
}).finally(() => { this.getList()
this.loading = false; this.$modal.msgSuccess('删除成功')
}); })
.catch(() => {})
.finally(() => {
this.loading = false
})
}, },
dialogContent(feedContent, title) { dialogContent(feedContent, title) {
this.$alert(feedContent, title, { this.$alert(feedContent, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => {} 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,6 +98,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :span="18">
<el-form-item label="类型" prop="type"> <el-form-item label="类型" prop="type">
<el-radio-group v-model="form.type"> <el-radio-group v-model="form.type">
<el-radio label="0">公告通知</el-radio> <el-radio label="0">公告通知</el-radio>
@ -183,17 +108,21 @@
<el-radio label="3">行业动态</el-radio> <el-radio label="3">行业动态</el-radio>
<el-radio label="4">投资者</el-radio> <el-radio label="4">投资者</el-radio>
<el-radio label="5">公司治理</el-radio> <el-radio label="5">公司治理</el-radio>
<el-radio label="6">投资者关系</el-radio> <!-- <el-radio label="6">投资者关系</el-radio> -->
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="排序" prop="orderBy">
<el-input-number v-model="form.orderBy" placeholder="请输入排序"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<template v-if="form.type != '5'">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="发布时间" prop="releaseTime"> <el-form-item label="发布时间" prop="releaseTime">
<el-date-picker clearable <el-date-picker clearable v-model="form.releaseTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择发布时间">
v-model="form.releaseTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择发布时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -210,18 +139,23 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6">
<el-form-item label="排序" prop="orderBy">
<el-input-number v-model="form.orderBy" placeholder="请输入排序"></el-input-number>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-form-item label="封面" prop="cover"> <el-form-item label="封面" prop="cover">
<ImageUploadLochost v-model="form.cover" :limit="1" :fileSize="10" /> <ImageUploadLochost v-model="form.cover" :limit="1" :fileSize="10" />
</el-form-item> </el-form-item>
<el-form-item label="新闻内容" prop="newsContent"> <el-form-item label="新闻内容" prop="newsContent">
<editor v-model="form.newsContent" :min-height="388"/> <editor v-model="form.newsContent" :min-height="388" />
</el-form-item> </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,12 +166,42 @@
</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 {
// (MB)
fileSize: 10,
// , ['png', 'jpg', 'jpeg']
fileType: [
'png',
'jpg',
'doc',
'docx',
'xls',
'xlsx',
'ppt',
'txt',
'pdf'
],
number: 0,
limit: 1,
uploadList: [],
//
uploadFileUrl:
process.env.VUE_APP_API_TARGET_URL + 'system/oss/addPartsUpload',
headers: { Authorization: 'Bearer ' + getToken() },
fileList: [],
loadingModal: undefined,
// loading // loading
buttonLoading: false, buttonLoading: false,
// //
@ -255,7 +219,7 @@ export default {
// //
slideshowList: [], slideshowList: [],
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -269,60 +233,54 @@ export default {
newsContent: undefined, newsContent: undefined,
abstracts: undefined, abstracts: undefined,
isTop: undefined, isTop: undefined,
type: '', type: ''
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
id: [ id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }],
{ required: true, message: "主键id不能为空", trigger: "blur" } cover: [{ required: true, message: '封面不能为空', trigger: 'blur' }],
],
cover: [
{ required: true, message: "封面不能为空", trigger: "blur" }
],
captionName: [ captionName: [
{ required: true, message: "标题名称不能为空", trigger: "blur" } { required: true, message: '标题名称不能为空', trigger: 'blur' }
], ],
releaseTime: [ releaseTime: [
{ required: true, message: "发布时间不能为空", trigger: "blur" } { required: true, message: '发布时间不能为空', trigger: 'blur' }
], ],
groupName: [ groupName: [
{ required: true, message: "集团名称不能为空", trigger: "blur" } { required: true, message: '集团名称不能为空', trigger: 'blur' }
], ],
newsContent: [ newsContent: [
{ required: true, message: "新闻内容不能为空", trigger: "blur" } { required: true, message: '新闻内容不能为空', trigger: 'blur' }
], ],
abstracts: [ abstracts: [
{ required: true, message: "摘要不能为空", trigger: "blur" } { required: true, message: '摘要不能为空', trigger: 'blur' }
], ],
isTop: [ isTop: [
{ required: true, message: "是否置顶不能为空", trigger: "blur" } { required: true, message: '是否置顶不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: "类型不能为空", trigger: "blur" }
], ],
type: [{ required: true, message: '类型不能为空', trigger: 'blur' }]
}
} }
};
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
/** /**
列表 */ 列表 */
getList() { getList() {
this.loading = true; this.loading = true
listSlideshow(this.queryParams).then(response => { listSlideshow(this.queryParams).then(response => {
this.slideshowList = response.rows; this.slideshowList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
@ -342,105 +300,210 @@ export default {
updateBy: undefined, updateBy: undefined,
updateUserId: undefined, updateUserId: undefined,
updateTime: undefined updateTime: undefined
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset()
this.open = true; this.fileList = []
this.title = "添加新闻信息"; this.open = true
this.title = '添加新闻信息'
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.loading = true; this.loading = true
this.reset(); this.reset()
const id = row.id || this.ids const id = row.id || this.ids
getSlideshow(id).then(response => { getSlideshow(id).then(response => {
this.loading = false; this.loading = false
this.form = response.data; this.form = response.data
this.open = true; this.open = true
this.title = "修改新闻信息"; this.title = '修改新闻信息'
}); if (this.form.type == '5') {
this.fileList = this.form.cover
? [
{
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() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.buttonLoading = true; this.buttonLoading = true
if (this.form.id != null) { if (this.form.id != null) {
updateSlideshow(this.form).then(response => { updateSlideshow(this.form)
this.$modal.msgSuccess("修改成功"); .then(response => {
this.open = false; this.$modal.msgSuccess('修改成功')
this.getList(); this.open = false
}).finally(() => { this.getList()
this.buttonLoading = false; })
}); .finally(() => {
this.buttonLoading = false
})
} else { } else {
addSlideshow(this.form).then(response => { addSlideshow(this.form)
this.$modal.msgSuccess("新增成功"); .then(response => {
this.open = false; this.$modal.msgSuccess('新增成功')
this.getList(); this.open = false
}).finally(() => { this.getList()
this.buttonLoading = false; })
}); .finally(() => {
this.buttonLoading = false
})
} }
} }
}); })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids
this.$modal.confirm('是否确认删除新闻信息编号为"' + ids + '"的数据项?').then(() => { this.$modal
this.loading = true; .confirm('是否确认删除新闻信息编号为"' + ids + '"的数据项?')
return delSlideshow(ids); .then(() => {
}).then(() => { this.loading = true
this.loading = false; return delSlideshow(ids)
this.getList(); })
this.$modal.msgSuccess("删除成功"); .then(() => {
}).catch(() => { this.loading = false
}).finally(() => { this.getList()
this.loading = false; this.$modal.msgSuccess('删除成功')
}); })
.catch(() => {})
.finally(() => {
this.loading = false
})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('official/slideshow/export', { this.download(
'official/slideshow/export',
{
...this.queryParams ...this.queryParams
}, `slideshow_${new Date().getTime()}.xlsx`) },
`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
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`)
return false
}
}
this.loadingModal = this.$loading({
lock: true,
text: '正在上传文件,请稍候...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
this.number++
return true
},
//
handleExceed() {
this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`)
},
//
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,32 +61,24 @@
</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
@ -118,90 +104,116 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
propertiesType: 2, propertiesType: 2,
companyName: undefined, companyName: undefined
}, }
}; }
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
//
getFileName(name) {
// url
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
},
handleDownFile(url) {
downFile(url).then(res => {
// a
const downLoadName = this.getFileName(url)
const a = document.createElement('a')
a.href = URL.createObjectURL(res)
// adownload
a.setAttribute('download', downLoadName)
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
})
},
/** /**
列表 */ 列表 */
getList() { getList() {
this.loading = true; this.loading = true
listPartnerSupplier(this.queryParams).then(response => { listPartnerSupplier(this.queryParams).then(response => {
this.slideshowList = response.rows; this.slideshowList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
this.form = { this.form = {
id: undefined, id: undefined,
captionName: undefined, captionName: undefined
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map(item => item.id)
this.single = selection.length!==1 this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => { this.$modal
this.loading = true; .confirm('是否确认删除编号为"' + ids + '"的数据项?')
return delPartnerSupplier(ids); .then(() => {
}).then(() => { this.loading = true
this.loading = false; return delPartnerSupplier(ids)
this.getList(); })
this.$modal.msgSuccess("删除成功"); .then(() => {
}).catch(() => { this.loading = false
}).finally(() => { this.getList()
this.loading = false; this.$modal.msgSuccess('删除成功')
}); })
.catch(() => {})
.finally(() => {
this.loading = false
})
}, },
dialogContent(feedContent, title) { dialogContent(feedContent, title) {
this.$alert(feedContent, title, { this.$alert(feedContent, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
callback: action => {} 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>