Commit 8cb1bc92 by xinla Committed by Gitee

!15 海报分支合并前端分支

Merge pull request !15 from xinla/dev_poster
2 parents ff11825e 20393cdc
tag-version-prefix=""
registry=https://registry.npm.taobao.org
\ No newline at end of file \ No newline at end of file
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
"core-js": "3.6.5", "core-js": "3.6.5",
"echarts": "4.2.1", "echarts": "4.2.1",
"element-ui": "2.13.2", "element-ui": "2.13.2",
"fabric": "^3.5.1",
"file-saver": "2.0.1", "file-saver": "2.0.1",
"fuse.js": "3.4.4", "fuse.js": "3.4.4",
"js-beautify": "1.10.2", "js-beautify": "1.10.2",
...@@ -56,6 +57,8 @@ ...@@ -56,6 +57,8 @@
"promise.prototype.finally": "^3.1.2", "promise.prototype.finally": "^3.1.2",
"screenfull": "4.2.0", "screenfull": "4.2.0",
"sortablejs": "1.8.4", "sortablejs": "1.8.4",
"tui-color-picker": "^2.2.6",
"tui-image-editor": "^3.11.0",
"video.js": "^7.10.2", "video.js": "^7.10.2",
"vue": "2.6.10", "vue": "2.6.10",
"vue-count-to": "1.0.13", "vue-count-to": "1.0.13",
......
...@@ -11,6 +11,14 @@ export function getList(params) { ...@@ -11,6 +11,14 @@ export function getList(params) {
} }
/** /**
* 更新海报
* @param {*} params
*/
export function updatePoster(data) {
return request({ url: serviceCategory + '/update', method: 'put', data })
}
/**
* 添加海报 * 添加海报
* @param {*} data * @param {*} data
*/ */
...@@ -22,8 +30,8 @@ export function addPoster(data) { ...@@ -22,8 +30,8 @@ export function addPoster(data) {
* 查询海报详情 * 查询海报详情
* @param {*} data * @param {*} data
*/ */
export function getPosterInfo(data) { export function getPosterInfo(id) {
return request({ url: serviceCategory + '/entity', method: 'get', data }) return request({ url: serviceCategory + '/entity/' + id })
} }
/** /**
......
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
</script> </script>
<template> <template>
<el-dialog title="选择素材" :visible.sync="Pvisible" width="650px"> <el-dialog title="选择素材" :visible.sync="Pvisible" width="650px" append-to-body>
<div> <div>
<el-tabs v-model="Ptype"> <el-tabs v-model="Ptype">
<el-tab-pane name="0" v-if="showArr.includes(0)"> <el-tab-pane name="0" v-if="showArr.includes(0)">
......
...@@ -98,11 +98,19 @@ export default { ...@@ -98,11 +98,19 @@ export default {
// 获取类目树 // 获取类目树
getTree() { getTree() {
getTree(this.type).then(({ data }) => { getTree(this.type).then(({ data }) => {
this.treeData = data this.treeData = [{
id: "",
name: "全部",
parentId: "0",
hasParent: false,
hasChildren: true,
children: data || []
}]
}) })
}, },
// 获取素材列表 // 获取素材列表
getList(page) { getList(page) {
console.log('getList', page, JSON.stringify(this.query))
page && (this.query.pageNum = page) page && (this.query.pageNum = page)
this.loading = true this.loading = true
getList(this.query) getList(this.query)
...@@ -161,14 +169,22 @@ export default { ...@@ -161,14 +169,22 @@ export default {
}, },
// 素材添加/编辑 // 素材添加/编辑
edit(data, type) { edit(data, type) {
this.form = Object.assign( switch (type) {
{}, case 5:
data || { categoryId: this.query.categoryId } this.$parent.posterEdit.step = 0
) this.$parent.dialog.edit = true
this.dialogVisible = true break
this.$nextTick(() => { default:
this.$refs['form'].clearValidate() this.form = Object.assign(
}) {},
data || { categoryId: this.query.categoryId }
)
this.dialogVisible = true
this.$nextTick(() => {
this.$refs['form'].clearValidate()
})
break;
}
// type || !data ? (this.disabled = false) : (this.disabled = true) // type || !data ? (this.disabled = false) : (this.disabled = true)
}, },
// 素材提交 // 素材提交
...@@ -246,7 +262,7 @@ export default { ...@@ -246,7 +262,7 @@ export default {
> >
<div class="custom-tree-node" slot-scope="{ node, data }"> <div class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span> <span>{{ node.label }}</span>
<span class="fr"> <span class="fr" v-if="data.id">
<i <i
v-hasPermi="['material:editType']" v-hasPermi="['material:editType']"
class="el-icon-edit" class="el-icon-edit"
...@@ -298,7 +314,7 @@ export default { ...@@ -298,7 +314,7 @@ export default {
<div style="position: relative; margin: 10px 0;"> <div style="position: relative; margin: 10px 0;">
<el-cascader <el-cascader
v-model="group" v-model="group"
:options="treeData" :options="treeData[0].children"
:props="groupProps" :props="groupProps"
></el-cascader> ></el-cascader>
</div> </div>
...@@ -323,7 +339,7 @@ export default { ...@@ -323,7 +339,7 @@ export default {
<el-button <el-button
v-hasPermi="['material:add']" v-hasPermi="['material:add']"
type="primary" type="primary"
@click="edit(1)" @click="edit(1, ~~type)"
>添加{{ typeTitle[type] }}</el-button >添加{{ typeTitle[type] }}</el-button
> >
</div> </div>
...@@ -380,7 +396,7 @@ export default { ...@@ -380,7 +396,7 @@ export default {
<el-form-item label="分类" prop="categoryId"> <el-form-item label="分类" prop="categoryId">
<el-cascader <el-cascader
v-model="form.categoryId" v-model="form.categoryId"
:options="treeData" :options="treeData[0].children"
:props="groupProps" :props="groupProps"
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!