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
ruoyi-ui/src
api/official
views/official
businessPartner
slideshow
supplier

View File

@ -15,4 +15,12 @@ export function delPartnerSupplier(id) {
url: '/official/companymessage/' + id,
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-item label="公司名称(个人)" prop="companyName">
<el-input
v-model="queryParams.companyName"
placeholder="请输入公司名称(个人)"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.companyName" placeholder="请输入公司名称(个人)" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
@ -19,22 +14,14 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['official:businessPartner:remove']"
>删除</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['official:businessPartner:remove']">删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange">
<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="230" align="center" prop="address" />
<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>
</template>
</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">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
@ -57,141 +51,159 @@
</el-table-column>
<el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['official:businessPartner:remove']"
>删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['official:businessPartner:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
import { listPartnerSupplier, delPartnerSupplier } from "@/api/official/partnerSupplier";
import {
listPartnerSupplier,
delPartnerSupplier,
downFile
} from '@/api/official/partnerSupplier'
export default {
name: "FeedBack",
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
slideshowList: [],
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
propertiesType: 1,
companyName: undefined,
export default {
name: 'FeedBack',
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
slideshowList: [],
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
propertiesType: 1,
companyName: undefined
}
}
},
created() {
this.getList()
},
methods: {
//
getFileName(name) {
// url
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
},
};
},
created() {
this.getList();
},
methods: {
/**
列表 */
getList() {
this.loading = true;
listPartnerSupplier(this.queryParams).then(response => {
this.slideshowList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
captionName: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => {
this.loading = true;
return delPartnerSupplier(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
dialogContent(feedContent, title) {
this.$alert(feedContent, title, {
confirmButtonText: '确定',
callback: action => {}
});
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() {
this.loading = true
listPartnerSupplier(this.queryParams).then(response => {
this.slideshowList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: undefined,
captionName: undefined
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal
.confirm('是否确认删除编号为"' + ids + '"的数据项?')
.then(() => {
this.loading = true
return delPartnerSupplier(ids)
})
.then(() => {
this.loading = false
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
.finally(() => {
this.loading = false
})
},
dialogContent(feedContent, title) {
this.$alert(feedContent, title, {
confirmButtonText: '确定',
callback: action => {}
})
}
}
}
};
</script>
<style scoped lang="scss">
::v-deep .multiple-line-content-show p {
margin: 0;
}
//
::v-deep .el-dialog {
height: 92%;
overflow: hidden;
}
::v-deep .el-dialog__body {
padding: 30px 20px 0;
height: 89%;
overflow-y: auto;
}
::v-deep .multiple-line-content-show p {
margin: 0;
}
//
::v-deep .el-dialog {
height: 92%;
overflow: hidden;
}
::v-deep .el-dialog__body {
padding: 30px 20px 0;
height: 89%;
overflow-y: auto;
}
</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-item label="标题名称" prop="captionName">
<el-input
v-model="queryParams.captionName"
placeholder="请输入标题名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.captionName" placeholder="请输入标题名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" @change="handleQuery">
@ -19,32 +14,18 @@
<el-option value="3" label="行业动态"></el-option>
<el-option value="4" 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-form-item>
<el-form-item label="发布时间" prop="releaseTime">
<el-date-picker clearable
v-model="queryParams.releaseTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择发布时间">
<el-date-picker clearable v-model="queryParams.releaseTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择发布时间">
</el-date-picker>
</el-form-item>
<el-form-item label="集团名称" prop="groupName">
<el-input
v-model="queryParams.groupName"
placeholder="请输入集团名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.groupName" placeholder="请输入集团名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="摘要" prop="abstracts">
<el-input
v-model="queryParams.abstracts"
placeholder="请输入摘要"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.abstracts" placeholder="请输入摘要" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
@ -55,65 +36,30 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['official:slideshow:add']"
>新增</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['official:slideshow:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['official:slideshow:edit']"
>修改</el-button>
<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 :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['official:slideshow:remove']"
>删除</el-button>
<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 :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['official:slideshow:export']"
>导出</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['official:slideshow:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange">
<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">
<template slot-scope="{ row }">
<img :src="row.cover" alt="" style="width:50px;height:50px;object-fit:cover;">
</template>
</el-table-column>
<el-table-column label="标题名称" align="center" prop="captionName" />
<el-table-column
label="类型"
align="center"
prop="type"
:formatter="(row, column, cellValue, index) => ['公告通知', '公司资讯', '政策法规', '行业动态', '投资者', '公司治理', '投资者关系'][cellValue]"
/>
<el-table-column label="类型" align="center" prop="type" :formatter="(row, column, cellValue, index) => ['公告通知', '公司资讯', '政策法规', '行业动态', '投资者', '公司治理'][cellValue]" />
<el-table-column label="发布时间" align="center" prop="releaseTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d}') }}</span>
@ -126,39 +72,16 @@
</template>
</el-table-column>
<el-table-column label="摘要" align="center" prop="abstracts" />
<el-table-column
label="是否置顶"
align="center"
prop="isTop"
:formatter="(row, column, cellValue, index) => ['否', '是'][cellValue || '0']"
/>
<el-table-column label="是否置顶" align="center" prop="isTop" :formatter="(row, column, cellValue, index) => ['否', '是'][cellValue || '0']" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
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>
<el-button size="mini" 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>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination 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>
@ -175,38 +98,17 @@
</el-form-item>
</el-col>
</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-col :span="6">
<el-form-item label="发布时间" prop="releaseTime">
<el-date-picker clearable
v-model="form.releaseTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择发布时间">
</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-col :span="18">
<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-col>
@ -216,12 +118,44 @@
</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 v-if="form.type != '5'">
<el-row>
<el-col :span="6">
<el-form-item label="发布时间" prop="releaseTime">
<el-date-picker clearable v-model="form.releaseTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择发布时间">
</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>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
@ -232,215 +166,344 @@
</template>
<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 {
name: "Slideshow",
data() {
return {
// 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" }
export default {
name: 'Slideshow',
data() {
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
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;
});
},
//
cancel() {
this.open = false;
this.reset();
created() {
this.getList()
},
//
reset() {
this.form = {
id: undefined,
cover: '',
captionName: undefined,
releaseTime: undefined,
groupName: undefined,
newsContent: undefined,
abstracts: undefined,
isTop: '0',
type: '1',
createBy: undefined,
createUserId: undefined,
createTime: undefined,
updateBy: undefined,
updateUserId: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加新闻信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const id = row.id || this.ids
getSlideshow(id).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改新闻信息";
});
},
/** 提交按钮 */
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;
});
methods: {
/**
列表 */
getList() {
this.loading = true
listSlideshow(this.queryParams).then(response => {
this.slideshowList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: undefined,
cover: '',
captionName: undefined,
releaseTime: undefined,
groupName: undefined,
newsContent: undefined,
abstracts: undefined,
isTop: '0',
type: '1',
createBy: undefined,
createUserId: undefined,
createTime: undefined,
updateBy: undefined,
updateUserId: undefined,
updateTime: undefined
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.fileList = []
this.open = true
this.title = '添加新闻信息'
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true
this.reset()
const id = row.id || this.ids
getSlideshow(id).then(response => {
this.loading = false
this.form = response.data
this.open = true
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() {
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
}
}
});
},
/** 删除按钮操作 */
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`)
//
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>
<style scoped lang="scss">
::v-deep .multiple-line-content-show p {
margin: 0;
}
//
::v-deep .el-dialog {
height: 92%;
overflow: hidden;
}
::v-deep .el-dialog__body {
padding: 30px 20px 0;
height: 89%;
overflow-y: auto;
}
::v-deep .multiple-line-content-show p {
margin: 0;
}
//
::v-deep .el-dialog {
height: 92%;
overflow: hidden;
}
::v-deep .el-dialog__body {
padding: 30px 20px 0;
height: 89%;
overflow-y: auto;
}
</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-item label="公司名称" prop="companyName">
<el-input
v-model="queryParams.companyName"
placeholder="请输入公司名称"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.companyName" placeholder="请输入公司名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
@ -19,22 +14,14 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['official:supplier:remove']"
>删除</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['official:supplier:remove']">删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="slideshowList" @selection-change="handleSelectionChange">
<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="230" align="center" prop="address" />
<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>
</template>
</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">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
@ -67,141 +61,159 @@
</el-table-column>
<el-table-column label="操作" width="100" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['official:supplier:remove']"
>删除</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['official:supplier:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
import { listPartnerSupplier, delPartnerSupplier } from "@/api/official/partnerSupplier";
import {
listPartnerSupplier,
delPartnerSupplier,
downFile
} from '@/api/official/partnerSupplier'
export default {
name: "FeedBack",
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
slideshowList: [],
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
propertiesType: 2,
companyName: undefined,
export default {
name: 'FeedBack',
data() {
return {
// loading
buttonLoading: false,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
slideshowList: [],
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
propertiesType: 2,
companyName: undefined
}
}
},
created() {
this.getList()
},
methods: {
//
getFileName(name) {
// url
if (name.lastIndexOf('/') > -1) {
return name.slice(name.lastIndexOf('/') + 1)
} else {
return name
}
},
};
},
created() {
this.getList();
},
methods: {
/**
列表 */
getList() {
this.loading = true;
listPartnerSupplier(this.queryParams).then(response => {
this.slideshowList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
captionName: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(() => {
this.loading = true;
return delPartnerSupplier(ids);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
dialogContent(feedContent, title) {
this.$alert(feedContent, title, {
confirmButtonText: '确定',
callback: action => {}
});
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() {
this.loading = true
listPartnerSupplier(this.queryParams).then(response => {
this.slideshowList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: undefined,
captionName: undefined
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal
.confirm('是否确认删除编号为"' + ids + '"的数据项?')
.then(() => {
this.loading = true
return delPartnerSupplier(ids)
})
.then(() => {
this.loading = false
this.getList()
this.$modal.msgSuccess('删除成功')
})
.catch(() => {})
.finally(() => {
this.loading = false
})
},
dialogContent(feedContent, title) {
this.$alert(feedContent, title, {
confirmButtonText: '确定',
callback: action => {}
})
}
}
}
};
</script>
<style scoped lang="scss">
::v-deep .multiple-line-content-show p {
margin: 0;
}
//
::v-deep .el-dialog {
height: 92%;
overflow: hidden;
}
::v-deep .el-dialog__body {
padding: 30px 20px 0;
height: 89%;
overflow-y: auto;
}
::v-deep .multiple-line-content-show p {
margin: 0;
}
//
::v-deep .el-dialog {
height: 92%;
overflow: hidden;
}
::v-deep .el-dialog__body {
padding: 30px 20px 0;
height: 89%;
overflow-y: auto;
}
</style>