|
@@ -1,45 +1,39 @@
|
|
|
<template>
|
|
|
-<div style="height:100%">
|
|
|
- <Header v-if="tool.checkAuth($route.name,'insert')">
|
|
|
- <save slot="save" type="upload_image" @btnClick="uploadClick"></save>
|
|
|
- <save slot="save" type="upload_video" @btnClick="uploadClick"></save>
|
|
|
- <save slot="save" type="upload_fwb" @btnClick="uploadClick"></save>
|
|
|
- </Header>
|
|
|
- <div class="normal-card">
|
|
|
+ <div style="height:100%">
|
|
|
+ <Header v-if="tool.checkAuth($route.name, 'insert')">
|
|
|
+ <save slot="save" type="upload_image"></save>
|
|
|
+ <save slot="save" type="upload_video"></save>
|
|
|
+ <save slot="save" type="upload_fwb"></save>
|
|
|
+ </Header>
|
|
|
+ <div class="normal-card">
|
|
|
<div class="header-panl">
|
|
|
<div class="left">
|
|
|
- <search @searchActive="searchActive" @clearData="clearData()" v-if="tool.checkAuth($route.name,'read')"></search>
|
|
|
- <category-select label="素材分类"
|
|
|
- :selectList="selectList"
|
|
|
- @changeSelect="changeSelect"
|
|
|
- @clearSelect="clearSelect()"
|
|
|
- v-if="tool.checkAuth($route.name,'read')">
|
|
|
- </category-select>
|
|
|
+ <search @searchActive="searchActive" @clearData="clearData()" v-if="tool.checkAuth($route.name, 'read')">
|
|
|
+ </search>
|
|
|
+ <category-select label="素材分类" :selectList="selectList" @changeSelect="changeSelect"
|
|
|
+ @clearSelect="clearSelect()" v-if="tool.checkAuth($route.name, 'read')">
|
|
|
+ </category-select>
|
|
|
</div>
|
|
|
<!--最新最热切换-->
|
|
|
- <hot-new-control @sortTypeChange="sortTypeChange" v-if="tool.checkAuth($route.name,'read')"></hot-new-control>
|
|
|
+ <hot-new-control @sortTypeChange="sortTypeChange" v-if="tool.checkAuth($route.name, 'read')"></hot-new-control>
|
|
|
</div>
|
|
|
<!--素材列表-->
|
|
|
- <list :fileData="fileData"
|
|
|
- @listItemClick="listItemClick"
|
|
|
- :isHandle="true"
|
|
|
- v-if="tool.checkAuth($route.name,'read')">
|
|
|
- <template v-slot:edit="scope">
|
|
|
- <Edit :fileData="scope.data" v-if="tool.checkAuth($route.name,'update')"></Edit>
|
|
|
- </template>
|
|
|
- <template v-slot:delete="scope">
|
|
|
- <Delete :data="scope.data" @removeSuccess="getFileList" v-if="tool.checkAuth($route.name,'delete')"></Delete>
|
|
|
- </template>
|
|
|
+ <list :fileData="fileData" @listItemClick="listItemClick" :isHandle="true"
|
|
|
+ v-if="tool.checkAuth($route.name, 'read')">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <Edit :fileData="scope.data" v-if="tool.checkAuth($route.name, 'update')"></Edit>
|
|
|
+ </template>
|
|
|
+ <template v-slot:delete="scope">
|
|
|
+ <Delete :data="scope.data" @removeSuccess="getFileList" v-if="tool.checkAuth($route.name, 'delete')"></Delete>
|
|
|
+ </template>
|
|
|
</list>
|
|
|
- <pagination
|
|
|
- :total="total"
|
|
|
- :pageSize="params.content.pageSize"
|
|
|
- :currentPage="params.content.pageNumber"
|
|
|
- @pageChange="pageChange">
|
|
|
+ <pagination :total="total" :pageSize="params.content.pageSize" :currentPage="params.content.pageNumber"
|
|
|
+ @pageChange="pageChange">
|
|
|
</pagination>
|
|
|
- <detail ref="detail" v-if="currentFile && tool.checkAuth($route.name,'read')" :currentSelectFile="currentFile"></detail>
|
|
|
+ <detail ref="detail" v-if="currentFile && tool.checkAuth($route.name, 'read')" :currentSelectFile="currentFile">
|
|
|
+ </detail>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -62,16 +56,16 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
params: {
|
|
|
- "classname": "saletool.sharematerial.sharematerial",
|
|
|
- "method": "selectMyList",
|
|
|
- "content": {
|
|
|
- "pageNumber": 1,
|
|
|
- "pageSize": 12,
|
|
|
- "where": {
|
|
|
- "condition": "",
|
|
|
- "sat_sharematerial_classid": null
|
|
|
- }
|
|
|
+ "classname": "saletool.sharematerial.sharematerial",
|
|
|
+ "method": "selectMyList",
|
|
|
+ "content": {
|
|
|
+ "pageNumber": 1,
|
|
|
+ "pageSize": 12,
|
|
|
+ "where": {
|
|
|
+ "condition": "",
|
|
|
+ "sat_sharematerial_classid": null
|
|
|
}
|
|
|
+ }
|
|
|
},
|
|
|
//分类配置
|
|
|
select: {
|
|
@@ -79,15 +73,15 @@ export default {
|
|
|
"classname": "saletool.sharematerial.sharematerial",
|
|
|
"method": "select",
|
|
|
"content": {
|
|
|
- "parentid": 0
|
|
|
+ "parentid": 0
|
|
|
}
|
|
|
},
|
|
|
- fileData:[],
|
|
|
+ fileData: [],
|
|
|
//列表数据
|
|
|
list: [],
|
|
|
//分类列表
|
|
|
selectList: [],
|
|
|
- total:20,
|
|
|
+ total: 20,
|
|
|
//当前查看的素材
|
|
|
currentFile: ''
|
|
|
};
|
|
@@ -104,7 +98,7 @@ export default {
|
|
|
Header,
|
|
|
save
|
|
|
},
|
|
|
- computed:{
|
|
|
+ computed: {
|
|
|
},
|
|
|
created() {
|
|
|
this.getFileList()
|
|
@@ -117,30 +111,30 @@ export default {
|
|
|
this.total = res.total
|
|
|
this.fileData = res.data
|
|
|
this.fileData.forEach((item) => {
|
|
|
- item.attinfos = matchingFileType.fileList(item.attinfos)
|
|
|
+ item.attinfos = matchingFileType.fileList(item.attinfos)
|
|
|
})
|
|
|
this.params.content.sort = res.sort
|
|
|
})
|
|
|
},
|
|
|
//获取分类列表
|
|
|
getSelectList() {
|
|
|
- this.$api.requested(this.select).then( res => {
|
|
|
+ this.$api.requested(this.select).then(res => {
|
|
|
this.selectList = res.data
|
|
|
})
|
|
|
},
|
|
|
//查询
|
|
|
searchActive(result) {
|
|
|
- if(!result) return
|
|
|
+ if (!result) return
|
|
|
this.params.content.where.condition = result
|
|
|
this.$api.requested(this.params).then(res => {
|
|
|
this.fileData = res.data
|
|
|
this.fileData.forEach((item) => {
|
|
|
- item.attinfos = matchingFileType.fileList(item.attinfos)
|
|
|
+ item.attinfos = matchingFileType.fileList(item.attinfos)
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
sortTypeChange(name) {
|
|
|
- for(let i=0;i<this.params.content.sort.length;i++) {
|
|
|
+ for (let i = 0; i < this.params.content.sort.length; i++) {
|
|
|
this.params.content.sort[i].sorted = this.params.content.sort[i].sortname == name ? 1 : 0
|
|
|
}
|
|
|
this.getFileList()
|
|
@@ -148,7 +142,7 @@ export default {
|
|
|
//赛选
|
|
|
changeSelect(id) {
|
|
|
this.params.content.where.sat_sharematerial_classid = id[id.length - 1]
|
|
|
- this.getFileList()
|
|
|
+ this.getFileList()
|
|
|
},
|
|
|
//清空赛选
|
|
|
clearSelect() {
|
|
@@ -157,13 +151,13 @@ export default {
|
|
|
//列表单击事件
|
|
|
listItemClick(data) {
|
|
|
let param = {
|
|
|
- "classname": "saletool.sharematerial.sharematerial",
|
|
|
- "method": "selectDetail",
|
|
|
- "content": {
|
|
|
- "sat_sharematerialid":data.sat_sharematerialid
|
|
|
- }
|
|
|
+ "classname": "saletool.sharematerial.sharematerial",
|
|
|
+ "method": "selectDetail",
|
|
|
+ "content": {
|
|
|
+ "sat_sharematerialid": data.sat_sharematerialid
|
|
|
+ }
|
|
|
}
|
|
|
- this.$api.requested(param).then( res => {
|
|
|
+ this.$api.requested(param).then(res => {
|
|
|
res.data.content = atob(res.data.content)
|
|
|
res.data.attinfos = this.fileType.fileList(res.data.attinfos)
|
|
|
this.currentFile = res.data
|
|
@@ -174,20 +168,14 @@ export default {
|
|
|
},
|
|
|
itemEdit(data) {
|
|
|
this.$router.push({
|
|
|
- path:'/upload_archives',
|
|
|
- params:JSON.stringify(data)
|
|
|
+ path: '/upload_archives',
|
|
|
+ params: JSON.stringify(data)
|
|
|
})
|
|
|
},
|
|
|
clearData() {
|
|
|
this.params.content.where.condition = ''
|
|
|
this.getFileList()
|
|
|
},
|
|
|
- uploadClick(type) {
|
|
|
- window.sessionStorage.setItem('uploadType',type)
|
|
|
- this.$router.push({
|
|
|
- path:'/upload_archives',
|
|
|
- })
|
|
|
- },
|
|
|
pageChange(n) {
|
|
|
this.params.content.pageNumber = n
|
|
|
this.getFileList()
|
|
@@ -197,49 +185,59 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-*{
|
|
|
+* {
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.normal-card {
|
|
|
+ min-height: 100%;
|
|
|
box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.normal-card .header-panl {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin: 20px 0 30px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.normal-card .header-panl .left {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.normal-card .header-panl .left .select {
|
|
|
+ margin-right: 16px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.normal-card .header-panl .left .select span {
|
|
|
+ margin-right: 8px;
|
|
|
+}
|
|
|
+
|
|
|
+.normal-card .header-panl .left .search {
|
|
|
+ height: 36px;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/ .input-with-select {
|
|
|
+ height: 34px;
|
|
|
+}
|
|
|
+
|
|
|
+.el-button {
|
|
|
+ width: 180px;
|
|
|
+ border-radius: 4px 4px 4px 4px;
|
|
|
+ border: 1px solid #3874F6;
|
|
|
+}
|
|
|
+
|
|
|
+/deep/.el-button span {
|
|
|
+ transform: translateX(-5px) !important;
|
|
|
+}
|
|
|
+
|
|
|
+.el-pagination {
|
|
|
+ position: absolute;
|
|
|
+ right: 16px;
|
|
|
+ bottom: 0;
|
|
|
+ margin-top: 16px;
|
|
|
}
|
|
|
- .normal-card {
|
|
|
- min-height: 100%;
|
|
|
- box-sizing: border-box;
|
|
|
- position: relative;
|
|
|
- }
|
|
|
- .normal-card .header-panl {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- margin: 20px 0 30px 0;
|
|
|
- }
|
|
|
- .normal-card .header-panl .left {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .normal-card .header-panl .left .select {
|
|
|
- margin-right: 16px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
- .normal-card .header-panl .left .select span {
|
|
|
- margin-right: 8px;
|
|
|
- }
|
|
|
- .normal-card .header-panl .left .search {
|
|
|
- height: 36px;
|
|
|
- }
|
|
|
- /deep/ .input-with-select {
|
|
|
- height: 34px;
|
|
|
- }
|
|
|
- .el-button {
|
|
|
- width: 180px;
|
|
|
- border-radius: 4px 4px 4px 4px;
|
|
|
- border: 1px solid #3874F6;
|
|
|
- }
|
|
|
- /deep/.el-button span {
|
|
|
- transform: translateX(-5px) !important;
|
|
|
- }
|
|
|
- .el-pagination {
|
|
|
- position: absolute;
|
|
|
- right: 16px;
|
|
|
- bottom: 0;
|
|
|
- margin-top: 16px;
|
|
|
- }
|
|
|
</style>
|