增加商品词条模块
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'bxg/api/yxStoreEntry',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'bxg/api/yxStoreEntry/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'bxg/api/yxStoreEntry',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del }
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="商品详情:">
|
<el-form-item label="商品详情:">
|
||||||
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
|
<vue-ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></vue-ueditor-wrap>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -356,7 +356,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getCates } from '@/api/bxg/yxStoreCategory'
|
|
||||||
import { initData} from '@/api/bxg/data'
|
import { initData} from '@/api/bxg/data'
|
||||||
import { add, edit, getInfo, isFormatAttr } from '@/api/bxg/yxStoreProduct'
|
import { add, edit, getInfo, isFormatAttr } from '@/api/bxg/yxStoreProduct'
|
||||||
import editor from '../../components/Editor'
|
import editor from '../../components/Editor'
|
||||||
@@ -366,9 +365,9 @@ import Treeselect from '@riophae/vue-treeselect'
|
|||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
import MaterialList from '@/components/material'
|
import MaterialList from '@/components/material'
|
||||||
import singlePic from '@/components/singlematerial'
|
import singlePic from '@/components/singlematerial'
|
||||||
import UeditorWrap from 'vue-ueditor-wrap';
|
import VueUeditorWrap from 'vue-ueditor-wrap';
|
||||||
export default {
|
export default {
|
||||||
components: { editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic },
|
components: { editor, picUpload, mulpicUpload, Treeselect, MaterialList, VueUeditorWrap, singlePic },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//品牌列表
|
//品牌列表
|
||||||
@@ -692,9 +691,11 @@ export default {
|
|||||||
console.log('data:'+data,res)
|
console.log('data:'+data,res)
|
||||||
if(data){
|
if(data){
|
||||||
let cate_id = parseInt(data.cate_id) || 0;
|
let cate_id = parseInt(data.cate_id) || 0;
|
||||||
|
let brand_id = parseInt(data.brand_id) || 0;
|
||||||
this.attrs = data.items || [];
|
this.attrs = data.items || [];
|
||||||
that.formValidate = data;
|
that.formValidate = data;
|
||||||
that.formValidate.cate_id = cate_id;
|
that.formValidate.cate_id = cate_id;
|
||||||
|
that.formValidate.brand_id = brand_id;
|
||||||
that.oneFormValidate = [data.attr];
|
that.oneFormValidate = [data.attr];
|
||||||
that.formValidate.header = [];
|
that.formValidate.header = [];
|
||||||
that.generate();
|
that.generate();
|
||||||
|
|||||||
@@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||||
|
<!-- <el-form-item label="词条id">-->
|
||||||
|
<!-- <el-input v-model="form.id" style="width: 370px;" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="租户id" prop="tenantId">-->
|
||||||
|
<!-- <el-input v-model="form.tenantId" style="width: 370px;" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="词条名称" prop="entryName">
|
||||||
|
<el-input v-model="form.entryName" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="词条讲解" prop="entryInfo">
|
||||||
|
<el-input type="textarea" v-model="form.entryInfo" style="width: 370px;min-height:100px" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="添加时间">-->
|
||||||
|
<!-- <el-input v-model="form.createTime" style="width: 370px;" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="更新时间">-->
|
||||||
|
<!-- <el-input v-model="form.updateTime" style="width: 370px;" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="是否删除">-->
|
||||||
|
<!-- <el-input v-model="form.isDel" style="width: 370px;" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column v-if="columns.visible('id')" prop="id" label="词条id" />
|
||||||
|
<!-- <el-table-column v-if="columns.visible('tenantId')" prop="tenantId" label="租户id" />-->
|
||||||
|
<el-table-column v-if="columns.visible('entryName')" prop="entryName" label="词条名称" />
|
||||||
|
<el-table-column v-if="columns.visible('entryInfo')" prop="entryInfo" label="词条讲解" width="500"/>
|
||||||
|
<el-table-column v-if="columns.visible('createTime')" prop="createTime" label="添加时间">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="columns.visible('updateTime')" prop="updateTime" label="更新时间">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updateTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column v-if="columns.visible('isDel')" prop="isDel" label="是否删除" />-->
|
||||||
|
<el-table-column v-permission="['admin','yxStoreEntry:edit','yxStoreEntry:del']" label="操作" width="150px" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudYxStoreEntry from '@/api/bxg/yxStoreEntry'
|
||||||
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import MaterialList from "@/components/material";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
|
|
||||||
|
// crud交由presenter持有
|
||||||
|
const defaultCrud = CRUD({ title: '词条', url: '/bxg/api/yxStoreEntry', sort: 'id,desc', crudMethod: { ...crudYxStoreEntry }})
|
||||||
|
const defaultForm = { id: null, entryName: null, entryInfo: null,
|
||||||
|
createTime: null, updateTime: null, isDel: null, tenantId: Cookies.get('tenantId') }
|
||||||
|
export default {
|
||||||
|
name: 'yxStoreEntry',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList},
|
||||||
|
mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
picArr: [],
|
||||||
|
permission: {
|
||||||
|
add: ['admin', 'YxStoreEntry:add'],
|
||||||
|
edit: ['admin', 'YxStoreEntry:edit'],
|
||||||
|
del: ['admin', 'YxStoreEntry:del']
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
entryName: [
|
||||||
|
{ required: true, message: '词条名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
entryInfo: [
|
||||||
|
{ required: true, message: '词条讲解不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
} }
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
picArr: function(val) {
|
||||||
|
this.form.pic = val.join(',')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取数据前设置好接口地址
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
}, // 新增与编辑前做的操作
|
||||||
|
[CRUD.HOOK.afterToCU](crud, form) {
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.table-img {
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
background: #ccc;
|
||||||
|
color: #fff;
|
||||||
|
white-space: nowrap;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<!-- <el-table-column v-if="columns.visible('goodsId')" prop="goodsId" label="关联商品" />-->
|
<!-- <el-table-column v-if="columns.visible('goodsId')" prop="goodsId" label="关联商品" />-->
|
||||||
<el-table-column v-if="columns.visible('product')" prop="product" label="关联商品" >
|
<el-table-column v-if="columns.visible('product')" prop="product" label="关联商品" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ JSON.parse(scope.row.product).store_name}}</span>
|
<span>{{ JSON.parse(scope.row.product).storeName}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column v-if="columns.visible('homeImage')" prop="homeImage" label="首页图" />-->
|
<!-- <el-table-column v-if="columns.visible('homeImage')" prop="homeImage" label="首页图" />-->
|
||||||
@@ -133,6 +133,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Cookies from "js-cookie";
|
||||||
import crudYxEvaluation from '@/api/yxEvaluation'
|
import crudYxEvaluation from '@/api/yxEvaluation'
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
@@ -149,7 +150,7 @@ const defaultCrud = CRUD({ title: '评测', url: 'bxg/api/yxEvaluation', sort: '
|
|||||||
const defaultForm = { id: null, homeImage: null, synopsis: null,videoInput:null,
|
const defaultForm = { id: null, homeImage: null, synopsis: null,videoInput:null,
|
||||||
product: null, summary: null, displayImage: null,displaySynopsis:null,feelImage: null,
|
product: null, summary: null, displayImage: null,displaySynopsis:null,feelImage: null,
|
||||||
feelSynopsis: null, accessibilityImage: null, accessibilitySynopsis: null,createTime:null,
|
feelSynopsis: null, accessibilityImage: null, accessibilitySynopsis: null,createTime:null,
|
||||||
updateTime:null,isDel:null,isShow:1,sort:null,tenantId:null,
|
updateTime:null,isDel:null,isShow:1,sort:null,tenantId:Cookies.get('tenantId'),
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'YxEvaluation',
|
name: 'YxEvaluation',
|
||||||
@@ -277,10 +278,10 @@ export default {
|
|||||||
},
|
},
|
||||||
change(val){
|
change(val){
|
||||||
// this.form.product=JSON.stringify(val)
|
// this.form.product=JSON.stringify(val)
|
||||||
initData('/bxg/api/yxStoreProduct/info/'+val[1]).then((data)=>{
|
// initData('/bxg/api/yxStoreProduct/info/'+val[1]).then((data)=>{
|
||||||
this.form.product=JSON.stringify(data.productInfo)
|
this.form.product=val[1]
|
||||||
console.log('选的子级',this.form.product)
|
console.log('选的子级',this.form.product)
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
async getInfo(){
|
async getInfo(){
|
||||||
//查询商品分类
|
//查询商品分类
|
||||||
@@ -332,7 +333,8 @@ export default {
|
|||||||
}
|
}
|
||||||
if (form.product && form.id) {
|
if (form.product && form.id) {
|
||||||
let data=JSON.parse(this.form.product)
|
let data=JSON.parse(this.form.product)
|
||||||
this.product=[Number(data.cate_id),Number(data.id)]
|
// console.log('data',data)
|
||||||
|
this.product=[Number(data.cateId),Number(data.id)]
|
||||||
// this.product=[50,105]
|
// this.product=[50,105]
|
||||||
// this.product=data
|
// this.product=data
|
||||||
console.log( '111',this.product,typeof(this.product));
|
console.log( '111',this.product,typeof(this.product));
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ import MaterialList from "@/components/material";
|
|||||||
|
|
||||||
// crud交由presenter持有
|
// crud交由presenter持有
|
||||||
const defaultCrud = CRUD({ title: '专家', url: 'bxg/api/yxStoreExpert', sort: 'id,desc', crudMethod: { ...crudYxStoreExpert }})
|
const defaultCrud = CRUD({ title: '专家', url: 'bxg/api/yxStoreExpert', sort: 'id,desc', crudMethod: { ...crudYxStoreExpert }})
|
||||||
const defaultForm = { id: null, merId: 0, image: null, expertName: null, expertInfo: null, expertStatus: null, expertUnit: null, createTime: null, updateTime: null, isDel: null }
|
const defaultForm = { id: null, merId: 0, image: null, expertName: null, expertInfo: null,
|
||||||
|
expertStatus: null, expertUnit: null, createTime: null, updateTime: null, isDel: null }
|
||||||
export default {
|
export default {
|
||||||
name: 'YxStoreExpert',
|
name: 'YxStoreExpert',
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList},
|
components: { pagination, crudOperation, rrOperation, udOperation ,MaterialList},
|
||||||
|
|||||||
Reference in New Issue
Block a user