Commit 997da0cd authored by zhanglw's avatar zhanglw

广告、公告管理

parent f90ac9c6
......@@ -20,7 +20,7 @@ export const HttpReq = {
method: 'get'
})
},
updateIfUp: function(data) {
updateIfUpApp: function(data) {
return request({
url: 'apps/updateIfUp',
method: 'post',
......@@ -29,6 +29,31 @@ export const HttpReq = {
return res
})
},
getAdvertList: function(params) {
return request({
url: 'word/getAll?' + qs.stringify(params, { indices: false }),
method: 'get'
})
},
updateIfUpAdvert: function(data) {
return request({
url: 'word/updateIfUp',
method: 'post',
data: data
}).then((res) => {
return res
})
},
// 获取所有软件工具
addAdvert: function(data) {
return request({
url: 'word/add',
method: 'post',
data: data
}).then((res) => {
return res
})
},
api: null
},
// web端接口列表
......
......@@ -118,7 +118,7 @@ export default {
type: 'info'
})
}
HttpReq.backstageApi.updateIfUp({
HttpReq.backstageApi.updateIfUpApp({
ids: row ? [row.id] : this.multipleSelection.map(item => { return item.id }),
ifUp: type
}).then((res) => {
......
<template>
<!-- 表单渲染 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelView" :visible="visible" :title="title" width="900px">
<el-form ref="formViewRef" :model="formData" :rules="rules" :status-icon="true" label-width="140px">
<el-form-item label="选择分类:" class="form-cell" style="margin: 0">
<div class="cell-box" style="display: flex">
<el-form-item prop="type">
<el-select v-model="formData.type" placeholder="请选择">
<el-option v-for="item in dict.advert_type" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</div>
</el-form-item>
<el-form-item label="标题:" class="form-cell" prop="title">
<div class="cell-box">
<el-input v-model="formData.title" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item v-show="formData.type>0" label="正文:" class="form-cell" prop="content">
<div class="cell-box">
<div ref="editor" class="editor" />
</div>
</el-form-item>
<el-form-item v-show="formData.type<=0" label="链接:" class="form-cell" prop="title">
<div class="cell-box">
<el-input v-model="formData.url" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item v-show="formData.type<=0" label="上传图片:" class="form-cell">
<div class="cell-box">
<el-upload
ref="uploadLogo"
:before-upload="beforeUpload"
:headers="uploadHeaders"
:on-success="handleSuccessLOGO"
:on-error="handleError"
:limit="1"
action="/api/localStorage/pictures"
>
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加.gif/jpg/jpeg文件 </div>
<div slot="tip" class="el-upload__tip">请上传文件,且不超过20M</div>
</el-upload>
<span v-show="formData.imagelink">存放位置:..{{ formData.imagelink }}</span>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button @click="cancelView">关闭</el-button>
<el-button type="primary" @click="submitForm(true)">提交</el-button>
</div>
</el-dialog>
</template>
<script>
import { getToken } from '@/utils/auth'
import { HttpReq } from '@/api/common'
import { mapGetters } from 'vuex'
import { upload } from '@/utils/upload'
import E from 'wangeditor'
export default {
dicts: ['advert_type'],
data() {
return {
uploadHeaders: { 'Authorization': getToken() },
editor: false, // 富文本对象
visible: false,
title: '上传小工具',
feature: [],
inputVisible: false,
inputValue: '',
formData: {
id: null,
title: '', // 标题
type: '0', // 类型
imagelink: '', // 图片链接
content: '', // 摘要
url: '' // 链接
},
rules: {}
}
},
computed: {
...mapGetters([
'imagesUploadApi',
'baseApi'
])
},
mounted() {
},
methods: {
// 上传
beforeUpload(file) {
let isLt2M = true
isLt2M = file.size / 1024 / 1024 < 20
if (!isLt2M) {
this.$message.error('上传文件大小不能超过 100MB!')
}
return isLt2M
},
handleSuccessLOGO(res, file, fileList) {
this.$nextTick(() => {
this.formData.imagelink = '/file/' + res.type + '/' + res.realName
this.$notify({
title: '上传成功!',
type: 'success',
duration: 2500
})
})
},
handleError(e, file, fileList) {
const msg = JSON.parse(e.message)
this.$notify({
title: msg.message,
type: 'error',
duration: 2500
})
},
showView() {
this.visible = true
},
hideView() {
if (this.editor) {
this.editor.txt.clear()
}
if (this.$refs.uploadLogo) {
this.$refs.uploadLogo.clearFiles()
}
this.$refs.formViewRef.resetFields()
this.visible = false
},
cancelView() {
this.hideView()
this.formData = {
id: null,
title: '', // 标题
type: '0', // 类型
imagelink: '', // 图片链接
content: '', // 摘要
url: '' // 链接
}
},
submitForm() {
this.$refs.formViewRef.validate((valid, obj) => {
if (valid) {
HttpReq.backstageApi.addAdvert(this.formData).then((res) => {
this.$notify({
title: res.message,
type: res.code === 200 ? 'success' : 'error'
})
if (res.code === 200) {
this.cancelView()
this.$parent.loadData()
}
})
} else {
this.$message({
message: '表单信息有误,请核对无误后提交!',
type: 'error'
})
}
})
},
loadData(item) {
this.showView()
this.$nextTick(() => {
if (!this.editor) {
const _this = this
const editor = new E(this.$refs.editor)
editor.config.zIndex = 5
editor.config.customUploadImg = function(files, insert) {
files.forEach(image => {
upload(_this.imagesUploadApi, image).then(res => {
const data = res.data
const url = _this.baseApi + '/file/' + data.type + '/' + data.realName
insert(url)
})
})
}
editor.config.onchange = (html) => {
this.formData.content = html
}
editor.create()
this.editor = editor
}
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.grid-content {
border: 1px solid rgba(100, 100, 100, 0.3);
padding: 0;
}
.grid-label {
background: #dedede;
padding: 0 10px;
}
.editor{
text-align:left;
width: 680px;
}
::v-deep .w-e-text-container {
height: 560px !important;
}
.cell-box {
min-width: 120px;
.cell-input {
width: 420px;
}
.cell-select {
width: 220px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
height: 28px;
line-height: 24px;
padding: 0 8px;
}
.input-new-tag {
width: 140px;
height: 28px;
margin-left: 10px;
vertical-align: bottom;
}
>>>.el-input__inner {
border: 1px solid rgba(100, 100, 100, 0.1);
border-bottom: 1px solid rgba(100, 100, 100, 0.2);
border-radius: 5px;
}
>>>.el-input.is-disabled .el-input__inner {
border-radius: 0;
border: 0;
border-bottom: 1px solid rgba(100, 100, 100, 0.4);
background: white;
cursor: text;
}
>>>.el-input.is-disabled .el-input__icon {
cursor: text;
}
>>>.el-icon-circle-check {
color: #13ce66;
}
//>>>.el-icon-arrow-up:before {
// content: '';
//}
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<el-input v-model="query.title" clearable placeholder="请输入标题" style="width:280px;" />
<el-select v-model="query.type" clearable placeholder="请选择类型" style="width: 150px">
<el-option v-for="item in dict.advert_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="query.ifUp" clearable placeholder="请选择状态" style="width: 150px">
<el-option v-for="item in dict.norm_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker
v-model="query.start"
type="date"
placeholder="选择开始日期"
/>
<el-date-picker
v-model="query.end"
type="date"
placeholder="选择结束日期"
/>
<el-button type="success" icon="el-icon-search" @click="toSearch">搜索</el-button>
<el-button type="warning" icon="el-icon-refresh" @click="clearLimit">重置</el-button>
</div>
<div class="toolbar">
<div>
<el-button type="danger" icon="el-icon-download" :disabled="!multipleSelection.length" @click="batchOperate(1, null)">下架</el-button>
<el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(0, null)">上架</el-button>
</div>
<div style="text-align: right">
<el-button type="primary" icon="el-icon-upload2" @click="toAdd">新增</el-button>
</div>
</div>
<!-- 表格 -->
<div class="content">
<el-table id="dataTable" ref="dataTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width:auto;min-height: 70vh" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column type="index" width="55" label="序号" :index="indexMethod" />
<el-table-column prop="title" label="标题" />
<el-table-column prop="type" label="类型" :formatter="(row, col, val)=>{return dict.label.advert_type[val]}" />
<el-table-column prop="ower" label="操作人" />
<el-table-column prop="uploadtime" label="维护日期" align="center" width="180" />
<el-table-column prop="ifUp" label="状态" width="100" />
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-tooltip content="下架"><el-button round plain type="danger" icon="el-icon-download" @click="batchOperate(1, scope.row)" /></el-tooltip>
<el-tooltip content="上架"><el-button round plain type="success" icon="el-icon-finished" @click="batchOperate(0, scope.row)" /></el-tooltip>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination :total="total" :current-page="page" :page-size="pageSize" style="margin-top: 8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" />
</div>
<add-page ref="addPage" />
</div>
</template>
<script>
import { HttpReq } from '@/api/common'
import addPage from './add'
export default {
components: { addPage },
dicts: ['norm_status', 'advert_type'],
data() {
return {
textColors: ['#ccc', '#000', '#f00', '#000',
'#000', '#32cd32', '#bba'],
loading: false,
page: 1,
pageSize: 10,
total: 0,
query: {},
tableData: [],
currentTime: '',
multipleSelection: []
}
},
mounted() {
this.currentTimeFn()
this.$nextTick(() => {
this.loadData()
})
},
methods: {
indexMethod(index) {
return 1 + index + this.page * this.pageSize - this.pageSize
},
handleSelectionChange(val) {
this.multipleSelection = val
},
loadData() {
// 清除参数无值的情况
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined
})
HttpReq.backstageApi.getAdvertList({
pageNum: this.page,
pageSize: this.pageSize,
...this.query
}).then((res) => {
this.tableData = res.list
this.total = res.totalCount
})
},
batchOperate(type, row) {
if (!row && !this.multipleSelection.length) {
return this.$message({
message: '未选取数据',
type: 'info'
})
}
HttpReq.backstageApi.updateIfUpAdvert({
ids: row ? [row.id] : this.multipleSelection.map(item => { return item.id }),
ifUp: type
}).then((res) => {
this.$notify({
title: res.message,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
this.loadData()
})
},
toAdd() {
this.$refs.addPage.loadData()
},
toEdit(item) {
this.$refs.addPage.loadData(item)
},
toSearch() {
this.page = 1
this.loadData()
},
clearLimit() {
this.query = {}
this.currentTimeFn()
this.loadData()
},
pageChange(e) {
this.page = e
this.loadData()
},
sizeChange(e) {
this.page = 1
this.pageSize = e
this.loadData()
},
currentTimeFn() {
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (day >= 0 && day <= 9) {
day = '0' + day
}
this.currentTime = year + '-' + month + '-' + day
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.toolbar {
display: flex;
justify-content: space-between;
}
.content {
margin-top: 15px;
overflow: auto;
}
</style>
<template>
<!-- 表单渲染 -->
<el-dialog append-to-body :close-on-click-modal="false" :before-close="cancelView" :visible="visible" :title="title" width="900px">
<el-form ref="formViewRef" :model="formData" :rules="rules" :status-icon="true" label-width="240px">
<el-form-item label="选择分类:" class="form-cell" style="margin: 0">
<div class="cell-box" style="display: flex">
<el-form-item prop="type">
<el-select v-model="formData.type" placeholder="请选择">
<el-option v-for="item in dict.tools_class" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</div>
</el-form-item>
<el-form-item label="软件工具名称:" class="form-cell" prop="title">
<div class="cell-box">
<el-input v-model="formData.name" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="标签:" class="form-cell" prop="tag">
<div class="cell-box">
<el-tag
v-for="tag in feature"
:key="tag"
closable
size="small"
:disable-transitions="false"
@close="handleClose(tag)"
>
{{ tag }}
</el-tag>
<el-input
v-show="inputVisible"
ref="saveTagInput"
v-model="inputValue"
class="input-new-tag"
placeholder="请输入特点标签文本"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
/>
<el-button v-show="!inputVisible && feature.length < 3" plain round class="button-new-tag" icon="el-icon-price-tag" @click="showInput">添加</el-button>
</div>
</el-form-item>
<el-form-item label="介绍说明:" class="form-cell" prop="notes">
<div class="cell-box">
<el-input v-model="formData.remark" type="textarea" placeholder="请输入文本" maxlength="300" :autosize="{ minRows: 4, maxRows: 4}" show-word-limit resize="none" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="web页面地址:" class="form-cell" prop="title">
<div class="cell-box">
<el-input v-model="formData.url" placeholder="单行输入" class="cell-input" />
</div>
</el-form-item>
<el-form-item label="上传软件工具:" class="form-cell">
<div class="cell-box">
<el-upload
ref="uploadApp"
:before-upload="beforeUpload"
:headers="uploadHeaders"
:on-success="handleSuccessEXE"
:on-error="handleError"
:limit="1"
action="/api/localStorage"
>
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加.exe文件 </div>
<div slot="tip" class="el-upload__tip">请上传文件,且不超过20M</div>
</el-upload>
<span v-show="formData.link">存放位置:..{{ formData.link }}</span>
</div>
</el-form-item>
<el-form-item label="上传LOGO:" class="form-cell">
<div class="cell-box">
<el-upload
ref="uploadLogo"
:before-upload="beforeUpload"
:headers="uploadHeaders"
:on-success="handleSuccessLOGO"
:on-error="handleError"
:limit="1"
action="/api/localStorage/pictures"
>
<div class="eladmin-upload"><i class="el-icon-upload" /> 添加.gif/jpg/jpeg文件 </div>
<div slot="tip" class="el-upload__tip">请上传文件,且不超过20M</div>
</el-upload>
<span v-show="formData.imagelink">存放位置:..{{ formData.imagelink }}</span>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button @click="cancelView">关闭</el-button>
<el-button type="primary" @click="submitForm(true)">提交</el-button>
</div>
</el-dialog>
</template>
<script>
import { getToken } from '@/utils/auth'
import { HttpReq } from '@/api/common'
export default {
dicts: ['tools_class'],
data() {
return {
uploadHeaders: { 'Authorization': getToken() },
dialogImgUrl: '',
dialogImgVisible: false,
visible: false,
title: '上传小工具',
feature: [],
inputVisible: false,
inputValue: '',
formData: {
id: null,
name: '', // 标题
type: '1', // 类型
tag: '',
link: '', // 下载链接
imagelink: '', // 图片链接
remark: '', // 摘要
url: '' // 链接
},
rules: {}
}
},
mounted() {
},
methods: {
// 上传
beforeUpload(file) {
let isLt2M = true
isLt2M = file.size / 1024 / 1024 < 20
if (!isLt2M) {
this.$message.error('上传文件大小不能超过 100MB!')
}
return isLt2M
},
handleSuccessEXE(res, file, fileList) {
this.$nextTick(() => {
this.formData.link = '/file/' + res.type + '/' + res.realName
this.$notify({
title: '上传成功!',
type: 'success',
duration: 2500
})
})
},
handleSuccessLOGO(res, file, fileList) {
this.$nextTick(() => {
this.formData.imagelink = '/file/' + res.type + '/' + res.realName
this.$notify({
title: '上传成功!',
type: 'success',
duration: 2500
})
})
},
handleError(e, file, fileList) {
const msg = JSON.parse(e.message)
this.$notify({
title: msg.message,
type: 'error',
duration: 2500
})
},
// 标签
handleClose(tag) {
this.feature.splice(this.feature.indexOf(tag), 1)
this.formData.tag = this.feature.join(';')
},
showInput() {
this.inputVisible = true
this.$nextTick(_ => {
this.$refs.saveTagInput.$refs.input.focus()
})
},
handleInputConfirm() {
const inputValue = this.inputValue
if (inputValue && !this.feature.filter(item => { return item === inputValue }).length) {
this.feature.push(inputValue)
this.formData.tag = this.feature.join(';')
}
this.inputValue = ''
this.inputVisible = false
},
showView() {
this.visible = true
},
hideView() {
if (this.$refs.uploadApp) {
this.$refs.uploadApp.clearFiles()
}
if (this.$refs.uploadLogo) {
this.$refs.uploadLogo.clearFiles()
}
this.$refs.formViewRef.resetFields()
this.visible = false
},
cancelView() {
this.hideView()
this.formData = {
id: null,
name: '', // 标题
type: '1', // 类型
tag: '',
link: '', // 下载链接
imagelink: '', // 图片链接
remark: '', // 摘要
url: '' // 链接
}
},
submitForm() {
this.$refs.formViewRef.validate((valid, obj) => {
if (valid) {
HttpReq.backstageApi.addApp(this.formData).then((res) => {
this.$notify({
title: res.message,
type: res.code === 200 ? 'success' : 'error'
})
if (res.code === 200) {
this.cancelView()
this.$parent.loadData()
}
})
} else {
this.$message({
message: '表单信息有误,请核对无误后提交!',
type: 'error'
})
}
})
},
loadData(item) {
this.showView()
this.$nextTick(() => {
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.grid-content {
border: 1px solid rgba(100, 100, 100, 0.3);
padding: 0;
}
.grid-label {
background: #dedede;
padding: 0 10px;
}
.editor{
text-align:left;
width: 680px;
}
::v-deep .w-e-text-container {
height: 560px !important;
}
.cell-box {
min-width: 120px;
.cell-input {
width: 420px;
}
.cell-select {
width: 220px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
height: 28px;
line-height: 24px;
padding: 0 8px;
}
.input-new-tag {
width: 140px;
height: 28px;
margin-left: 10px;
vertical-align: bottom;
}
>>>.el-input__inner {
border: 1px solid rgba(100, 100, 100, 0.1);
border-bottom: 1px solid rgba(100, 100, 100, 0.2);
border-radius: 5px;
}
>>>.el-input.is-disabled .el-input__inner {
border-radius: 0;
border: 0;
border-bottom: 1px solid rgba(100, 100, 100, 0.4);
background: white;
cursor: text;
}
>>>.el-input.is-disabled .el-input__icon {
cursor: text;
}
>>>.el-icon-circle-check {
color: #13ce66;
}
//>>>.el-icon-arrow-up:before {
// content: '';
//}
}
</style>
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<el-input v-model="query.name" clearable placeholder="请输入工具名称" style="width:280px;" />
<el-select v-model="query.type" clearable placeholder="请选择分类" style="width: 150px">
<el-option v-for="item in dict.tools_class" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-input v-model="query.tag" clearable placeholder="请输入标签名称" style="width:280px;" />
<el-select v-model="query.ifUp" clearable placeholder="请选择状态" style="width: 150px">
<el-option v-for="item in dict.norm_status" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker
v-model="query.start"
type="date"
placeholder="选择开始日期"
/>
<el-date-picker
v-model="query.end"
type="date"
placeholder="选择结束日期"
/>
<el-button type="success" icon="el-icon-search" @click="toSearch">搜索</el-button>
<el-button type="warning" icon="el-icon-refresh" @click="clearLimit">重置</el-button>
</div>
<div class="toolbar">
<div>
<el-button type="danger" icon="el-icon-download" :disabled="!multipleSelection.length" @click="batchOperate(1, null)">下架</el-button>
<el-button type="success" icon="el-icon-finished" :disabled="!multipleSelection.length" @click="batchOperate(0, null)">上架</el-button>
</div>
<div style="text-align: right">
<el-button type="primary" icon="el-icon-upload2" @click="toAdd">上传app</el-button>
</div>
</div>
<!-- 表格 -->
<div class="content">
<el-table id="dataTable" ref="dataTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width:auto;min-height: 70vh" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column type="index" width="55" label="序号" :index="indexMethod" />
<!-- <el-table-column prop="id" label="ID" width="100" />-->
<el-table-column prop="name" label="小工具名称" width="500" />
<el-table-column prop="type" label="分类" width="140" :formatter="(row, col, val)=>{return dict.label.tools_class[val]}" />
<el-table-column prop="tag" label="标签" />
<el-table-column prop="score" label="下载分数" />
<el-table-column prop="tcount" label="点击数" />
<el-table-column label="是否可下载">
<template slot-scope="scope">
{{ scope.row.download==='0'?'':'' }}
</template>
</el-table-column>
<el-table-column prop="ifUp" label="状态" width="100" />
<el-table-column prop="uploadtime" label="最后维护日期" align="center" width="180" />
<el-table-column label="操作" align="center" width="200">
<template slot-scope="scope">
<el-tooltip content="下架"><el-button round plain type="danger" icon="el-icon-download" @click="batchOperate(1, scope.row)" /></el-tooltip>
<el-tooltip content="上架"><el-button round plain type="success" icon="el-icon-finished" @click="batchOperate(0, scope.row)" /></el-tooltip>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination :total="total" :current-page="page" :page-size="pageSize" style="margin-top: 8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" />
</div>
<add-page ref="addPage" />
</div>
</template>
<script>
import { HttpReq } from '@/api/common'
import addPage from './add'
export default {
components: { addPage },
dicts: ['norm_status', 'tools_class'],
data() {
return {
textColors: ['#ccc', '#000', '#f00', '#000',
'#000', '#32cd32', '#bba'],
loading: false,
page: 1,
pageSize: 10,
total: 0,
query: {},
tableData: [],
currentTime: '',
multipleSelection: []
}
},
mounted() {
this.currentTimeFn()
this.$nextTick(() => {
this.loadData()
})
},
methods: {
indexMethod(index) {
return 1 + index + this.page * this.pageSize - this.pageSize
},
handleSelectionChange(val) {
this.multipleSelection = val
},
loadData() {
// 清除参数无值的情况
Object.keys(this.query).length !== 0 && Object.keys(this.query).forEach(item => {
if (this.query[item] === null || this.query[item] === '') this.query[item] = undefined
})
HttpReq.backstageApi.getAppAll({
pageNum: this.page,
pageSize: this.pageSize,
...this.query
}).then((res) => {
this.tableData = res.list
this.total = res.totalCount
})
},
batchOperate(type, row) {
if (!row && !this.multipleSelection.length) {
return this.$message({
message: '未选取数据',
type: 'info'
})
}
HttpReq.backstageApi.updateIfUp({
ids: row ? [row.id] : this.multipleSelection.map(item => { return item.id }),
ifUp: type
}).then((res) => {
this.$notify({
title: res.message,
type: res.code === 200 ? 'success' : 'error',
duration: 2500
})
this.loadData()
})
},
toAdd() {
this.$refs.addPage.loadData()
},
toEdit(item) {
this.$refs.addPage.loadData(item)
},
toSearch() {
this.page = 1
this.loadData()
},
clearLimit() {
this.query = {}
this.currentTimeFn()
this.loadData()
},
pageChange(e) {
this.page = e
this.loadData()
},
sizeChange(e) {
this.page = 1
this.pageSize = e
this.loadData()
},
currentTimeFn() {
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth() + 1
var day = date.getDate()
if (month >= 1 && month <= 9) {
month = '0' + month
}
if (day >= 0 && day <= 9) {
day = '0' + day
}
this.currentTime = year + '-' + month + '-' + day
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.toolbar {
display: flex;
justify-content: space-between;
}
.content {
margin-top: 15px;
overflow: auto;
}
</style>
......@@ -34,6 +34,13 @@ module.exports = {
'^/apps': 'apps'
}
},
'/word': {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true,
pathRewrite: {
'^/word': 'word'
}
},
'/api': {
target: process.env.VUE_APP_BASE_API,
changeOrigin: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment