Commit 97acd9d1 by Lyan

首页轮播增加修改大小轮播等级

parent e41eeacc
......@@ -16,7 +16,7 @@
v-for="item in colorBackgroundList"
:key="item.label"
:label="item.label"
:value="item.label">
:value="item.value">
</el-option>
</el-select>
</el-col>
......@@ -38,7 +38,7 @@
v-for="item in colorMoreList"
:key="item.label"
:label="item.label"
:value="item.label">
:value="item.value">
</el-option>
</el-select>
</el-col>
......@@ -176,18 +176,35 @@
levelList: [1, 2, 3, 4, 5, 6, 7, 8, 9],
colorBackgroundList: [
{
label: '蓝色'
label: '桔色',
value: '#f26334'
},
{
label: '黄色',
value: '#fbb033'
},
{
label: '粉色',
value: '#f05587'
},
{
label: '紫色',
value: '#BF83B9'
},
{
label: '红色'
label: '蓝色',
value: '#002c6c!important'
}
],
colorMoreList: [
{
label: '蓝色'
label: '蓝色',
value: 'blue'
},
{
label: '红色'
label: '红色',
value: 'orange'
}
],
classnumList: [
......@@ -284,7 +301,7 @@
}
})
} else {
this.$message.error(data.msg)
this.$message.error('网络错误,请重试!')
}
})
}
......@@ -298,10 +315,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
......@@ -50,7 +50,9 @@
</el-form>
<div class="add-btn">
<el-button v-if="isAuth('manage:indexcarouselmanage:save')" type="primary" @click="addOrUpdateHandle()"> + 添加</el-button>
<!-- <el-button v-if="isAuth('manage:indexcarouselmanage:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> -->
<el-button v-if="isAuth('manage:indexcarouselmanage:update')" type="success" @click="getLevelBig('大轮播')" >修改大轮播顺序</el-button>
<el-button v-if="isAuth('manage:indexcarouselmanage:update')" type="success" @click="getLevelBig('小轮播')" >修改小轮播顺序</el-button>
</div>
<div class="table-list">
<el-table
......@@ -154,6 +156,40 @@
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<!-- 弹窗 -->
<el-dialog :title="listTitle" :visible.sync="dialogTableVisible">
<el-table border :data="lunboList">
<el-table-column align="center" property="levels" label="等级"></el-table-column>
<el-table-column align="center" property="title" label="标题" ></el-table-column>
<el-table-column align="center" property="classnum" label="类别"></el-table-column>
<el-table-column align="center" property="levels" label="调整等级" >
<template slot-scope="scope">
<div>
<el-input v-model='scope.row.levels' @change='getTypeNum(scope.row)' style="width:70px;text-align:center"></el-input>
</div>
</template>
</el-table-column>
<el-table-column
prop="checkIndexAuthor"
header-align="center"
align="center"
label="审核人">
</el-table-column>
<el-table-column
prop="checkflagIndex"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope">
<div>
<span v-if="scope.row.checkflagIndex === 0">待审核</span>
<span v-if="scope.row.checkflagIndex === -1">失败</span>
<span v-if="scope.row.checkflagIndex === 1">成功</span>
</div>
</template>
</el-table-column>
</el-table>
</el-dialog>
</div>
</div>
</template>
......@@ -205,7 +241,11 @@ export default {
}
],
releaseDate: [],
urls: this.$store.state.config.urls
urls: this.$store.state.config.urls,
listTitle: '',
dialogTableVisible: false,
lunboList: [],
typeLevel: ''
}
},
activated () {
......@@ -269,7 +309,7 @@ export default {
})
},
showMsg (data) {
console.log(data, 'datadatadata');
console.log(data, 'datadatadata')
window.open(`${this.$store.state.config.urls}/home?indexCarouselManageId=${data.id}`, '_blank')
},
// 删除
......@@ -337,6 +377,70 @@ export default {
}
})
}).catch(() => {})
},
getLevelBig (type) {
this.dialogTableVisible = true
this.getLunboList(type)
if (type === '大轮播') {
this.listTitle = '大轮播列表'
} else if (type === '小轮播') {
this.listTitle = '小轮播列表'
}
},
getLunboList (type) {
this.$http({
url: this.$http.adornUrl('/office/indexCarouselManage/indexCarouselManageList'),
method: 'post',
data: this.$http.adornParams({
'page': 1,
'limit': 100,
'type': type
})
}).then(({data}) => {
if (data && data.code === 0) {
this.lunboList = data.page.list
} else {
this.$message.error(data.msg)
this.lunboList = []
}
this.dataListLoading = false
})
},
getTypeNum (data) {
this.typeLevel = data.levels
this.saveLevel(data)
},
saveLevel (data) {
this.$http({
url: this.$http.adornUrl(`/office/indexCarouselManage/update`),
method: 'post',
data: this.$http.adornData({
'id': data.id,
'classnum': data.classnum,
'title': data.title,
'levels': data.levels,
'directpath': data.directpath,
'colorBackground': data.colorBackground,
'colorMore': data.colorMore,
'brief': data.brief,
'picIndexPath': data.picIndexPath
})
}).then(({data}) => {
this.loading = false
if (data && data.code === 0) {
this.$message({
message: '等级修改成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
}
}
......
......@@ -411,10 +411,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
......@@ -277,10 +277,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
......@@ -304,10 +304,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
......@@ -246,10 +246,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
......@@ -243,10 +243,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
......@@ -246,10 +246,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
......@@ -246,10 +246,12 @@
if (!isJPG) {
if (!isPNG) {
this.$message.error('上传图片只能是 JPG, PNG 格式!')
return
}
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
return
}
if (file) {
var windowURL = window.URL || window.webkitURL
......
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