This commit is contained in:
libao 2024-05-11 17:55:32 +08:00
commit 8b3655c43f
12 changed files with 488 additions and 515 deletions

View File

@ -42,3 +42,26 @@ export function delAlbum(albumId) {
method: 'delete'
})
}
// 获取相册素材
export function getAlbumImgList(query) {
return request({
url: '/system/album/materialList',
method: 'get',
params: query
})
}
// 添加相册素材
export function AddAlbumImgList(data) {
return request({
url: '/system/album/saveMaterial',
method: 'post',
data: data
})
}
// 删除相册管理
export function delAlbumImgList(ids) {
return request({
url: '/system/album/deleteMaterials/' + ids,
method: 'delete'
})
}

View File

@ -13,7 +13,7 @@ import router from './router'
import directive from './directive' // directive
import plugins from './plugins' // plugins
import { download } from '@/utils/request'
import {Base64} from 'js-base64'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
@ -48,6 +48,8 @@ Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.$Base64 = Base64;
// 全局组件挂载
Vue.component('DictTag', DictTag)
Vue.component('Pagination', Pagination)

View File

@ -0,0 +1,208 @@
//
<template>
<div class="content">
<el-dialog
:title="title"
:close-on-click-modal="false"
append-to-body
width="60%"
:visible.sync="visible">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="素材名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入素材名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>添加图片</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="素材名称" align="center" prop="materialName" />
<el-table-column label="缩略图" align="center" prop="savePath">
<template slot-scope="scope">
<image-preview :src="scope.row.savePath" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="上传日期" align="center" prop="uploadTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.uploadTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<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)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</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"
/>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="submit()">确定</el-button>
</span> -->
</el-dialog>
<materialDialog ref="materialDialog" @selectData="selectData" :single="false"></materialDialog>
</div>
</template>
<script>
import {getAlbumImgList,AddAlbumImgList,delAlbumImgList} from "@/api/system/album";
import materialDialog from '@/views/system/article/materialDialog'
export default {
name: "equipment",
dicts:['tender_speciality'],
components:{
materialDialog
},
data() {
return {
loading: false,
dataList:[],
albumImgList:[],
total:0,
visible: false,
title:'相册素材',
queryParams:{
pageNum: 1,
pageSize: 10,
},
selectRow:{},
//
ids: [],
//
single: true,
//
multiple: true,
}
},
methods: {
selectData(data){
console.log(data)
console.log(typeof data)
AddAlbumImgList({albumId:this.queryParams.albumId,materialIds: data.join(',')}).then(res=>{
this.$modal.msgSuccess("添加成功");
this.getList()
})
},
getRowData(row, column, event) {
this.selectRow = row
},
init(id) {
this.visible = true
this.$set(this.queryParams,'albumId',id)
this.getList()
},
getList(){
this.loading = true
getAlbumImgList(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false
});
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
handleAdd(){
this.$refs.materialDialog.init()
},
/** 删除按钮操作 */
handleDelete(row) {
const materialId = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + materialId + '"的数据项?').then(function() {
return delAlbumImgList(materialId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
handleSearch() {
this.pageNum = 1;
this.getList();
},
handleQuery(){
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
}
this.getList();
},
pageChange(value) {
this.queryParams.pageNum = value;
this.getList();
},
pageSizeChange(value) {
this.queryParams.pageSize = value;
this.getList();
},
// handleSelectionChange(val){
// this.multipleSelection = []
// for(let i=0;i<val.length;i++){
// this.multipleSelection.push(val[i].id)
// }
// },
closeDialog() {
this.visible = false
},
}
}
</script>
<style scoped>
</style>

View File

@ -143,26 +143,20 @@
<el-table v-loading="loading" :data="albumList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="相册ID" align="center" prop="albumId" />
<el-table-column label="相册名称" align="center" prop="albumName" />
<el-table-column label="创建人ID" align="center" prop="userId" />
<el-table-column label="部门ID" align="center" prop="deptId" />
<el-table-column label="相册类型" align="center" prop="albumType" />
<el-table-column label="封面图片" align="center" prop="coverImage" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.coverImage" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="描述" align="center" prop="description" />
<el-table-column label="审核状态" align="center" prop="auditState" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="宽度" align="center" prop="width" />
<el-table-column label="高度" align="center" prop="height" />
<el-table-column label="点击数" align="center" prop="hit" />
<el-table-column label="点赞数" align="center" prop="upVote" />
<el-table-column label="是否开启评论" align="center" prop="commentFlag" />
<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-plus"
@click="handleAddAlbumImg(scope.row.albumId)"
>添加图片</el-button>
<el-button
size="mini"
type="text"
@ -188,60 +182,33 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改相册管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="相册名称" prop="albumName">
<el-input v-model="form.albumName" placeholder="请输入相册名称" />
</el-form-item>
<el-form-item label="创建人ID" prop="userId">
<el-input v-model="form.userId" placeholder="请输入创建人ID" />
</el-form-item>
<el-form-item label="部门ID" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入部门ID" />
</el-form-item>
<el-form-item label="封面图片" prop="coverImage">
<image-upload v-model="form.coverImage"/>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input v-model="form.description" placeholder="请输入描述" />
</el-form-item>
<el-form-item label="审核状态" prop="auditState">
<el-input v-model="form.auditState" placeholder="请输入审核状态" />
</el-form-item>
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="宽度" prop="width">
<el-input v-model="form.width" placeholder="请输入宽度" />
</el-form-item>
<el-form-item label="高度" prop="height">
<el-input v-model="form.height" placeholder="请输入高度" />
</el-form-item>
<el-form-item label="点击数" prop="hit">
<el-input v-model="form.hit" placeholder="请输入点击数" />
</el-form-item>
<el-form-item label="点赞数" prop="upVote">
<el-input v-model="form.upVote" placeholder="请输入点赞数" />
</el-form-item>
<el-form-item label="是否开启评论" prop="commentFlag">
<el-input v-model="form.commentFlag" placeholder="请输入是否开启评论" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<albumImg ref="albumImg"></albumImg>
</div>
</template>
<script>
import { listAlbum, getAlbum, delAlbum, addAlbum, updateAlbum } from "@/api/system/album";
import albumImg from './albumImg'
export default {
name: "Album",
components:{
albumImg
},
data() {
return {
//
@ -343,6 +310,9 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
handleAddAlbumImg(id){
this.$refs.albumImg.init(id)
},
/** 新增按钮操作 */
handleAdd() {
this.reset();

View File

@ -1,38 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!-- <el-form-item label="作者" prop="yhid">-->
<!-- <el-input-->
<!-- v-model="queryParams.yhid"-->
<!-- placeholder="请输入作者"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="推荐到哪个专区。比如:头条、精选、最新、热门、评论最多等" prop="articleRegion">-->
<!-- <el-input-->
<!-- v-model="queryParams.articleRegion"-->
<!-- placeholder="请输入推荐到哪个专区。比如:头条、精选、最新、热门、评论最多等"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原文作者" prop="author">-->
<!-- <el-input-->
<!-- v-model="queryParams.author"-->
<!-- placeholder="请输入原文作者"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="发布时间" prop="publishTime">-->
<!-- <el-input-->
<!-- v-model="queryParams.publishTime"-->
<!-- placeholder="请输入发布时间"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="文章标题" prop="title">
<el-input
v-model="queryParams.title"
@ -41,228 +9,11 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="关键词" prop="keywords">-->
<!-- <el-input-->
<!-- v-model="queryParams.keywords"-->
<!-- placeholder="请输入关键词"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="摘要" prop="description">-->
<!-- <el-input-->
<!-- v-model="queryParams.description"-->
<!-- placeholder="请输入摘要"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="文章模型" prop="articleModel">-->
<!-- <el-input-->
<!-- v-model="queryParams.articleModel"-->
<!-- placeholder="请输入文章模型"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="转载标志" prop="copyFlag">-->
<!-- <el-input-->
<!-- v-model="queryParams.copyFlag"-->
<!-- placeholder="请输入转载标志"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="频道栏目ID" prop="categoryId">-->
<!-- <el-input-->
<!-- v-model="queryParams.categoryId"-->
<!-- placeholder="请输入频道栏目ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="个人分类,多个用逗号分隔" prop="personalCategory">-->
<!-- <el-input-->
<!-- v-model="queryParams.personalCategory"-->
<!-- placeholder="请输入个人分类,多个用逗号分隔"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原始链接" prop="link">-->
<!-- <el-input-->
<!-- v-model="queryParams.link"-->
<!-- placeholder="请输入原始链接"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="静态化后url" prop="staticUrl">-->
<!-- <el-input-->
<!-- v-model="queryParams.staticUrl"-->
<!-- placeholder="请输入静态化后url"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标签" prop="tags">-->
<!-- <el-input-->
<!-- v-model="queryParams.tags"-->
<!-- placeholder="请输入标签"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="点击数" prop="hit">-->
<!-- <el-input-->
<!-- v-model="queryParams.hit"-->
<!-- placeholder="请输入点击数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="回复数" prop="replyNum">-->
<!-- <el-input-->
<!-- v-model="queryParams.replyNum"-->
<!-- placeholder="请输入回复数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="点赞数" prop="upVote">-->
<!-- <el-input-->
<!-- v-model="queryParams.upVote"-->
<!-- placeholder="请输入点赞数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="差评数" prop="downVote">-->
<!-- <el-input-->
<!-- v-model="queryParams.downVote"-->
<!-- placeholder="请输入差评数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="热点标志" prop="hotFlag">-->
<!-- <el-input-->
<!-- v-model="queryParams.hotFlag"-->
<!-- placeholder="请输入热点标志"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="新增标志" prop="newFlag">-->
<!-- <el-input-->
<!-- v-model="queryParams.newFlag"-->
<!-- placeholder="请输入新增标志"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="是否开启评论" prop="commentFlag">-->
<!-- <el-input-->
<!-- v-model="queryParams.commentFlag"-->
<!-- placeholder="请输入是否开启评论"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="置顶标志" prop="topFlag">-->
<!-- <el-input-->
<!-- v-model="queryParams.topFlag"-->
<!-- placeholder="请输入置顶标志"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="收藏数" prop="favourite">-->
<!-- <el-input-->
<!-- v-model="queryParams.favourite"-->
<!-- placeholder="请输入收藏数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="趴取任务的ID" prop="missionId">-->
<!-- <el-input-->
<!-- v-model="queryParams.missionId"-->
<!-- placeholder="请输入趴取任务的ID"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="生成静态页面的模板(cms_template表中的name)" prop="templateName">-->
<!-- <el-input-->
<!-- v-model="queryParams.templateName"-->
<!-- placeholder="请输入生成静态页面的模板(cms_template表中的name)"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="状态标志" prop="available">-->
<!-- <el-input-->
<!-- v-model="queryParams.available"-->
<!-- placeholder="请输入状态标志"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="删除标志" prop="deleted">-->
<!-- <el-input-->
<!-- v-model="queryParams.deleted"-->
<!-- placeholder="请输入删除标志"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="附加字段1" prop="extra1">-->
<!-- <el-input-->
<!-- v-model="queryParams.extra1"-->
<!-- placeholder="请输入附加字段1"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="附加字段2" prop="extra2">-->
<!-- <el-input-->
<!-- v-model="queryParams.extra2"-->
<!-- placeholder="请输入附加字段2"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="跳转链接" prop="extra3">-->
<!-- <el-input-->
<!-- v-model="queryParams.extra3"-->
<!-- placeholder="请输入跳转链接"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="${comment}" prop="sort">-->
<!-- <el-input-->
<!-- v-model="queryParams.sort"-->
<!-- placeholder="请输入${comment}"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="点击数" prop="onclick">-->
<!-- <el-input-->
<!-- v-model="queryParams.onclick"-->
<!-- placeholder="请输入点击数"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
@ -274,81 +25,14 @@
v-hasPermi="['system:article: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="['system:article: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="['system:article: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="['system:article:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="articleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="主键文章ID" align="center" prop="id" />-->
<!-- <el-table-column label="作者" align="center" prop="yhid" />-->
<!-- <el-table-column label="推荐到哪个专区。比如:头条、精选、最新、热门、评论最多等" align="center" prop="articleRegion" />-->
<!-- <el-table-column label="原文作者" align="center" prop="author" />-->
<!-- <el-table-column label="发布时间" align="center" prop="publishTime" />-->
<el-table-column label="文章标题" align="center" prop="title" />
<!-- <el-table-column label="关键词" align="center" prop="keywords" />-->
<!-- <el-table-column label="摘要" align="center" prop="description" />-->
<!-- <el-table-column label="封面图片" align="center" prop="coverImage" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <image-preview :src="scope.row.coverImage" :width="50" :height="50"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="文章模型" align="center" prop="articleModel" />-->
<!-- <el-table-column label="转载标志" align="center" prop="copyFlag" />-->
<el-table-column label="所属栏目" align="center" prop="categoryName" />
<!-- <el-table-column label="个人分类,多个用逗号分隔" align="center" prop="personalCategory" />-->
<!-- <el-table-column label="原始链接" align="center" prop="link" />-->
<!-- <el-table-column label="静态化后url" align="center" prop="staticUrl" />-->
<!-- <el-table-column label="标签" align="center" prop="tags" />-->
<!-- <el-table-column label="点击数" align="center" prop="hit" />-->
<!-- <el-table-column label="回复数" align="center" prop="replyNum" />-->
<!-- <el-table-column label="点赞数" align="center" prop="upVote" />-->
<!-- <el-table-column label="差评数" align="center" prop="downVote" />-->
<!-- <el-table-column label="热点标志" align="center" prop="hotFlag" />-->
<!-- <el-table-column label="新增标志" align="center" prop="newFlag" />-->
<!-- <el-table-column label="是否开启评论" align="center" prop="commentFlag" />-->
<!-- <el-table-column label="置顶标志" align="center" prop="topFlag" />-->
<!-- <el-table-column label="收藏数" align="center" prop="favourite" />-->
<!-- <el-table-column label="趴取任务的ID" align="center" prop="missionId" />-->
<!-- <el-table-column label="生成静态页面的模板(cms_template表中的name)" align="center" prop="templateName" />-->
<!-- <el-table-column label="状态标志" align="center" prop="available" />-->
<!-- <el-table-column label="删除标志" align="center" prop="deleted" />-->
<!-- <el-table-column label="附加字段1" align="center" prop="extra1" />-->
<!-- <el-table-column label="附加字段2" align="center" prop="extra2" />-->
<!-- <el-table-column label="跳转链接" align="center" prop="extra3" />-->
<!-- <el-table-column label="${comment}" align="center" prop="sort" />-->
<!-- <el-table-column label="点击数" align="center" prop="onclick" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -378,124 +62,51 @@
/>
<!-- 添加或修改文章管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="作者" prop="yhid">-->
<!-- <el-input v-model="form.yhid" placeholder="请输入作者" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="推荐到哪个专区。比如:头条、精选、最新、热门、评论最多等" prop="articleRegion">-->
<!-- <el-input v-model="form.articleRegion" placeholder="请输入推荐到哪个专区。比如:头条、精选、最新、热门、评论最多等" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原文作者" prop="author">-->
<!-- <el-input v-model="form.author" placeholder="请输入原文作者" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="发布时间" prop="publishTime">-->
<!-- <el-input v-model="form.publishTime" placeholder="请输入发布时间" />-->
<!-- </el-form-item>-->
<el-form-item label="文章标题" prop="title">
<el-input v-model="form.title" placeholder="请输入文章标题" />
</el-form-item>
<el-form-item label="内容">
<editor v-model="form.content" :min-height="192"/>
</el-form-item>
<!-- <el-form-item label="关键词" prop="keywords">-->
<!-- <el-input v-model="form.keywords" placeholder="请输入关键词" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="摘要" prop="description">-->
<!-- <el-input v-model="form.description" placeholder="请输入摘要" />-->
<!-- </el-form-item>-->
<el-form-item label="封面图片" prop="coverImage">
<image-upload v-model="form.coverImage"/>
<el-input disabled v-model="form.coverImage" class="input-with-select">
<el-button slot="append" @click="openDialog">选择</el-button>
</el-input>
</el-form-item>
<!-- <el-form-item label="文章模型" prop="articleModel">-->
<!-- <el-input v-model="form.articleModel" placeholder="请输入文章模型" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="转载标志" prop="copyFlag">-->
<!-- <el-input v-model="form.copyFlag" placeholder="请输入转载标志" />-->
<!-- </el-form-item>-->
<el-form-item label="所属栏目" prop="ids">
<el-input v-model="form.ids" placeholder="请输入频道栏目ID" />
<el-select v-model="form.ids" clearable>
<el-option v-for="(item, index) in columnList" :key="index"
:label="item.categoryName" :value="item.categoryId"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="个人分类,多个用逗号分隔" prop="personalCategory">-->
<!-- <el-input v-model="form.personalCategory" placeholder="请输入个人分类,多个用逗号分隔" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="原始链接" prop="link">-->
<!-- <el-input v-model="form.link" placeholder="请输入原始链接" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="静态化后url" prop="staticUrl">-->
<!-- <el-input v-model="form.staticUrl" placeholder="请输入静态化后url" />-->
<!-- </el-form-item>-->
<el-form-item label="标签" prop="tags">
<el-input v-model="form.tags" placeholder="请输入标签" />
<el-select v-model="form.tags" clearable>
<el-option v-for="(item, index) in tagList" :key="index"
:label="item.tagName" :value="item.tagId"></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="点击数" prop="hit">-->
<!-- <el-input v-model="form.hit" placeholder="请输入点击数" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="回复数" prop="replyNum">-->
<!-- <el-input v-model="form.replyNum" placeholder="请输入回复数" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="点赞数" prop="upVote">-->
<!-- <el-input v-model="form.upVote" placeholder="请输入点赞数" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="差评数" prop="downVote">-->
<!-- <el-input v-model="form.downVote" placeholder="请输入差评数" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="热点标志" prop="hotFlag">-->
<!-- <el-input v-model="form.hotFlag" placeholder="请输入热点标志" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="新增标志" prop="newFlag">-->
<!-- <el-input v-model="form.newFlag" placeholder="请输入新增标志" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="是否开启评论" prop="commentFlag">-->
<!-- <el-input v-model="form.commentFlag" placeholder="请输入是否开启评论" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="置顶标志" prop="topFlag">-->
<!-- <el-input v-model="form.topFlag" placeholder="请输入置顶标志" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="收藏数" prop="favourite">-->
<!-- <el-input v-model="form.favourite" placeholder="请输入收藏数" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="趴取任务的ID" prop="missionId">-->
<!-- <el-input v-model="form.missionId" placeholder="请输入趴取任务的ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="生成静态页面的模板(cms_template表中的name)" prop="templateName">-->
<!-- <el-input v-model="form.templateName" placeholder="请输入生成静态页面的模板(cms_template表中的name)" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="状态标志" prop="available">-->
<!-- <el-input v-model="form.available" placeholder="请输入状态标志" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="删除标志" prop="deleted">-->
<!-- <el-input v-model="form.deleted" placeholder="请输入删除标志" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="附加字段1" prop="extra1">-->
<!-- <el-input v-model="form.extra1" placeholder="请输入附加字段1" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="附加字段2" prop="extra2">-->
<!-- <el-input v-model="form.extra2" placeholder="请输入附加字段2" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="跳转链接" prop="extra3">-->
<!-- <el-input v-model="form.extra3" placeholder="请输入跳转链接" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="${comment}" prop="sort">-->
<!-- <el-input v-model="form.sort" placeholder="请输入${comment}" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="点击数" prop="onclick">-->
<!-- <el-input v-model="form.onclick" placeholder="请输入点击数" />-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<materialDialog ref="materialDialog" @selectData="selectData"></materialDialog>
</div>
</template>
<script>
import materialDialog from './materialDialog'
import { listArticle, getArticle, delArticle, addArticle, updateArticle } from "@/api/system/article";
import { listCategory } from "@/api/system/category";
import { listTags } from "@/api/system/tags";
export default {
name: "Article",
components:{
materialDialog
},
data() {
return {
//
@ -512,6 +123,8 @@ export default {
total: 0,
//
articleList: [],
columnList:[], //
tagList:[], //
//
title: "",
//
@ -563,8 +176,24 @@ export default {
},
created() {
this.getList();
//
this.getColumList()
},
methods: {
openDialog(){
this.$refs.materialDialog.init()
},
selectData(data){
this.$set(this.form,'coverImage',data.savePath)
},
getColumList(){
listCategory().then(res=>{
this.columnList = res.rows
})
listTags().then(res=>{
this.tagList = res.rows
})
},
/** 查询文章管理列表 */
getList() {
this.loading = true;
@ -649,13 +278,15 @@ export default {
const id = row.id || this.ids
getArticle(id).then(response => {
this.form = response.data;
this.form.ids = Number( this.form.categoryId)
this.form.tags = Number( this.form.tags)
this.open = true;
this.title = "修改文章管理";
});
},
/** 提交按钮 */
submitForm() {
this.form.content=Base64.encode(this.form.content)
this.form.content=this.$Base64.encode(this.form.content)
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {

View File

@ -0,0 +1,156 @@
//
<template>
<div class="content">
<el-dialog
:title="title"
:close-on-click-modal="false"
append-to-body
width="60%"
:visible.sync="visible">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="素材名称" prop="materialName">
<el-input
v-model="queryParams.materialName"
placeholder="请输入素材名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="dataList" @row-click="getRowData" @selection-change="handleSelectionChange">
<el-table-column label="选择" align="center" width="55" v-if="single">
<template slot-scope="scope" >
<el-radio class="radio" v-model="templateSelection" :label="scope.row.materialId">{{''}}</el-radio>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" v-else/>
<el-table-column label="素材名称" align="center" prop="materialName" />
<el-table-column label="缩略图" align="center" prop="savePath">
<template slot-scope="scope">
<image-preview :src="scope.row.savePath" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="上传日期" align="center" prop="uploadTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.uploadTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="submit()">确定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { listMaterial, getMaterial, delMaterial, addMaterial, updateMaterial } from "@/api/system/material";
export default {
name: "equipment",
components: {
},
props:{
single:{
type: Boolean,
default: true
}
},
data() {
return {
dataList:[],
total:0,
templateSelection:'',
visible: false,
title:'选择素材',
queryParams:{
pageNum: 1,
pageSize: 10,
},
selectRow:{},
multipleSelection:[]
}
},
methods: {
submit() {
if(this.single){
this.$emit('selectData', this.selectRow)
}else{
this.$emit('selectData', this.multipleSelection)
}
this.visible = false
},
getRowData(row, column, event) {
console.log(row)
this.selectRow = row
},
init() {
this.visible = true
this.getList()
},
getList(){
listMaterial(this.queryParams).then(response => {
this.dataList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleSearch() {
this.pageNum = 1;
this.getList();
},
handleQuery(){
this.queryParams.pageNum = 1;
this.getList();
},
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
}
this.getList();
},
pageChange(value) {
this.queryParams.pageNum = value;
this.getList();
},
pageSizeChange(value) {
this.queryParams.pageSize = value;
this.getList();
},
handleSelectionChange(val){
this.multipleSelection = []
for(let i=0;i<val.length;i++){
this.multipleSelection.push(val[i].materialId)
}
},
closeDialog() {
this.visible = false
},
}
}
</script>
<style scoped>
</style>

View File

@ -87,7 +87,7 @@
/>
<!-- 添加或修改文章内容管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="${comment}">
<editor v-model="form.content" :min-height="192"/>

View File

@ -123,7 +123,7 @@
/>
<!-- 添加或修改语音导览管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="标题" prop="title">
<el-input v-model="form.title" placeholder="请输入标题" />

View File

@ -140,7 +140,7 @@
/>
<!-- 添加或修改文章分类管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="分类名称" prop="categoryName">
<el-input v-model="form.categoryName" placeholder="请输入分类名称" />

View File

@ -151,26 +151,18 @@
<el-table v-loading="loading" :data="materialList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="素材id" align="center" prop="materialId" />-->
<!-- <el-table-column label="分组id" align="center" prop="groupId" />-->
<el-table-column label="素材名称" align="center" prop="materialName" />
<!-- <el-table-column label="素材类型 字典 1图片2视频3文本" align="center" prop="materialType" />-->
<!-- <el-table-column label="素材描述" align="center" prop="description" />-->
<!-- <el-table-column label="素材大小" align="center" prop="materialSize" />-->
<!-- <el-table-column label="保存路径" align="center" prop="savePath" />-->
<el-table-column label="缩略图" align="center" prop="thumbnail" />
<!-- <el-table-column label="审核状态 0待审批2未通过1通过" align="center" prop="auditState" />-->
<!-- <el-table-column label="审核意见" align="center" prop="auditReason" />-->
<!-- <el-table-column label="可用状态 0停用1启用" align="center" prop="useState" />-->
<!-- <el-table-column label="分辨率 宽" align="center" prop="width" />-->
<!-- <el-table-column label="分辨率 高" align="center" prop="height" />-->
<!-- <el-table-column label="上传者 id" align="center" prop="uploaderId" />-->
<el-table-column label="缩略图" align="center" prop="savePath">
<template slot-scope="scope">
<image-preview :src="scope.row.savePath" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="上传日期" align="center" prop="uploadTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.uploadTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="备注" align="center" prop="remark" />-->
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -200,52 +192,23 @@
/>
<!-- 添加或修改素材管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="分组" prop="groupId">
<el-input v-model="form.groupId" placeholder="请输入分组" />
<el-select v-model="form.groupId" clearable>
<el-option v-for="(item, index) in groupList" :key="index"
:label="item.groupName" :value="item.groupId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="素材名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入素材名称" />
<el-input v-model="form.materialName"/>
</el-form-item>
<el-form-item label="上传图片" prop="savePath">
<image-upload v-model="form.savePath" :limit="1"/>
</el-form-item>
<!-- <el-form-item label="素材描述" prop="description">-->
<!-- <el-input v-model="form.description" placeholder="请输入素材描述" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="素材大小" prop="materialSize">-->
<!-- <el-input v-model="form.materialSize" placeholder="请输入素材大小" />-->
<!-- </el-form-item>-->
<el-form-item label="保存路径" prop="savePath">
<el-input v-model="form.savePath" placeholder="请输入保存路径" />
<el-input v-model="form.savePath" disabled/>
</el-form-item>
<!-- <el-form-item label="缩略图" prop="thumbnail">-->
<!-- <el-input v-model="form.thumbnail" type="textarea" placeholder="请输入内容" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="审核状态 0待审批2未通过1通过" prop="auditState">-->
<!-- <el-input v-model="form.auditState" placeholder="请输入审核状态 0待审批2未通过1通过" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="审核意见" prop="auditReason">-->
<!-- <el-input v-model="form.auditReason" placeholder="请输入审核意见" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="可用状态 0停用1启用" prop="useState">-->
<!-- <el-input v-model="form.useState" placeholder="请输入可用状态 0停用1启用" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="分辨率 宽" prop="width">-->
<!-- <el-input v-model="form.width" placeholder="请输入分辨率 宽" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="分辨率 高" prop="height">-->
<!-- <el-input v-model="form.height" placeholder="请输入分辨率 高" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="上传者 id" prop="uploaderId">-->
<!-- <el-input v-model="form.uploaderId" placeholder="请输入上传者 id" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="上传日期" prop="uploadTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="form.uploadTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择上传日期">-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
@ -260,9 +223,13 @@
<script>
import { listMaterial, getMaterial, delMaterial, addMaterial, updateMaterial } from "@/api/system/material";
import { listMaterialGroup } from "@/api/system/materialGroup";
import imgUpload from '@/components/FileUpload/imgFileUpload'
export default {
name: "Material",
components:{
imgUpload
},
data() {
return {
//
@ -279,6 +246,7 @@ export default {
total: 0,
//
materialList: [],
groupList:[],
//
title: "",
//
@ -320,8 +288,17 @@ export default {
},
created() {
this.getList();
this.getGroupList()
},
methods: {
// input(data){
// console.log(data)
// },
openDialog(){
this.$refs.materialDialog.init()
},
/** 查询素材管理列表 */
getList() {
this.loading = true;
@ -331,6 +308,11 @@ export default {
this.loading = false;
});
},
getGroupList(){
listMaterialGroup().then(response => {
this.groupList = response.rows;
});
},
//
cancel() {
this.open = false;
@ -386,6 +368,7 @@ export default {
const materialId = row.materialId || this.ids
getMaterial(materialId).then(response => {
this.form = response.data;
this.form.groupId = Number( this.form.groupId)
this.open = true;
this.title = "修改素材管理";
});

View File

@ -139,7 +139,7 @@
/>
<!-- 添加或修改素材分组管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="父ID" prop="parentId">-->
<!-- <el-input v-model="form.parentId" placeholder="请输入父ID" />-->

View File

@ -130,7 +130,7 @@
/>
<!-- 添加或修改素材使用记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="素材ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入素材ID" />