Commit 1b70635a by ext.wangyuman1

内容中心从素材中选择重置按钮bug修复

1 parent b9229b1b
...@@ -3,7 +3,6 @@ import { getTree, getList } from '@/api/material' ...@@ -3,7 +3,6 @@ import { getTree, getList } from '@/api/material'
import 'quill/dist/quill.core.css' import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css' import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css' import 'quill/dist/quill.bubble.css'
import { getCodeCategoryList } from '@/api/drainageCode/staff' import { getCodeCategoryList } from '@/api/drainageCode/staff'
import PreviewInPhone from '@/components/ContentCenter/PreviewInPhone' import PreviewInPhone from '@/components/ContentCenter/PreviewInPhone'
export default { export default {
...@@ -62,15 +61,8 @@ export default { ...@@ -62,15 +61,8 @@ export default {
}, },
list: [], // 列表 list: [], // 列表
total: 0, // 总条数 total: 0, // 总条数
treeData: [{}], // 树
// 树props
treeProps: {
children: 'children',
label: 'name',
},
treeForm: {}, // 树表格 treeForm: {}, // 树表格
treeDialogVisible: false, // 树表格对话框显隐 treeDialogVisible: false, // 树表格对话框显隐
group: '', // 选择的分组 group: '', // 选择的分组
groupDialogVisible: false, // 移动分组对话框 groupDialogVisible: false, // 移动分组对话框
// 分组props // 分组props
...@@ -107,8 +99,7 @@ export default { ...@@ -107,8 +99,7 @@ export default {
computed: {}, computed: {},
created() { created() {
this.query.mediaType = this.type this.query.mediaType = this.type
this.getTree() // this.getTree()
// this.getList()
// 开始 // 开始
this.getCodeCategoryListFn() this.getCodeCategoryListFn()
// 结束 // 结束
...@@ -146,23 +137,6 @@ export default { ...@@ -146,23 +137,6 @@ export default {
resetQuery() { resetQuery() {
this.query.materialName = '' this.query.materialName = ''
this.search() this.search()
// this.query.categoryId = 1
},
// 结束
// 获取类目树
getTree() {
getTree(this.type).then(({ data }) => {
this.treeData = [
{
id: '',
name: '全部',
parentId: '0',
hasParent: false,
hasChildren: true,
children: data || [],
},
]
})
}, },
// 获取素材列表 // 获取素材列表
getList(page) { getList(page) {
...@@ -173,7 +147,7 @@ export default { ...@@ -173,7 +147,7 @@ export default {
this.list = rows.sort((a, b) => +new Date(b.updateTime) - +new Date(a.updateTime)) this.list = rows.sort((a, b) => +new Date(b.updateTime) - +new Date(a.updateTime))
this.total = +total this.total = +total
this.loading = false this.loading = false
this.$emit('listChange', this.list) this.$emit('listChange', this.list, this.type)
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false
...@@ -197,7 +171,8 @@ export default { ...@@ -197,7 +171,8 @@ export default {
:class="{ active: groupIndex == key }" :class="{ active: groupIndex == key }"
v-for="(group, key) in groupList" v-for="(group, key) in groupList"
:key="group.id" :key="group.id"
@click="switchGroup(key, group)"> @click="switchGroup(key, group)"
>
<div class="name">{{ group.name + ' (' + group.number + ')' }}</div> <div class="name">{{ group.name + ' (' + group.number + ')' }}</div>
</div> </div>
</div> </div>
...@@ -211,7 +186,8 @@ export default { ...@@ -211,7 +186,8 @@ export default {
clearable clearable
prefix-icon="el-icon-search" prefix-icon="el-icon-search"
style="width: 300px" style="width: 300px"
@keyup.enter.native="search()" /> @keyup.enter.native="search()"
/>
<el-button class="ml10" @click="getList(1)" type="primary">查询</el-button> <el-button class="ml10" @click="getList(1)" type="primary">查询</el-button>
<!-- v-hasPermi="['wecom:material:list']" --> <!-- v-hasPermi="['wecom:material:list']" -->
<el-button @click="resetQuery">重置</el-button> <el-button @click="resetQuery">重置</el-button>
...@@ -225,7 +201,8 @@ export default { ...@@ -225,7 +201,8 @@ export default {
:total="total" :total="total"
:page.sync="query.pageNum" :page.sync="query.pageNum"
:limit.sync="query.pageSize" :limit.sync="query.pageSize"
@pagination="getList()" /> @pagination="getList"
/>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
:label="item.label + '(' + item.list.length + ')'" :label="item.label + '(' + item.list.length + ')'"
:name="item.name" :name="item.name"
> >
<MaPage ref="page" :type="item.type" v-slot="{ list }"> <MaPage ref="page" :type="item.type" v-slot="{ list }" @listChange="listChange">
<div v-if="item.type === '0'"> <div v-if="item.type === '0'">
<div v-if="list && list.length"> <div v-if="list && list.length">
<el-checkbox-group v-model="paneList[picindex].list" class="imgStyle"> <el-checkbox-group v-model="paneList[picindex].list" class="imgStyle">
...@@ -148,6 +148,19 @@ export default { ...@@ -148,6 +148,19 @@ export default {
} }
}, },
methods: { methods: {
listChange(list, type) {
this.paneList = this.paneList.map((item) => {
if (type === item.type) {
item.list.forEach((one) => {
this.ids = this.ids.filter((two) => {
return two.id !== one.id
})
})
item.list = []
}
return item
})
},
// 超过num个。。。展示 // 超过num个。。。展示
coverContent(str, num) { coverContent(str, num) {
if (str && str.length > num) { if (str && str.length > num) {
...@@ -318,30 +331,6 @@ export default { ...@@ -318,30 +331,6 @@ export default {
} }
}) })
}, },
// 多选框选中数据
// handleSelectionChange(selection) {
// let list = JSON.parse(JSON.stringify(this.paneList[this.index].list))
// this.paneList[this.index].list = selection
// this.ids = []
// this.paneList.forEach((item) => {
// if (item.list && item.list.length) {
// item.list.forEach((item1) => {
// this.ids.push(item1)
// })
// }
// })
// if (this.ids.length + this.talkListLength > this.maxlength) {
// this.paneList[this.index].list = list
// this.ids = []
// this.paneList.forEach((item) => {
// if (item.list && item.list.length) {
// item.list.forEach((item1) => {
// this.ids.push(item1)
// })
// }
// })
// }
// },
// 处理文件类型 // 处理文件类型
filType(file) { filType(file) {
let filecontent = JSON.parse(JSON.stringify(file)) let filecontent = JSON.parse(JSON.stringify(file))
...@@ -365,13 +354,6 @@ export default { ...@@ -365,13 +354,6 @@ export default {
} else { } else {
this.inx = index this.inx = index
} }
// if (this.picindex === 0) {
// // 不包含文本
// this.inx = this.index - 1
// } else if (this.picindex === 1) {
// // 包含文本
// }
}, },
}, },
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!