功能点完善
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ ENV = 'development'
|
|||||||
VUE_APP_PROJECT_NAME = 'cereshop-admin-web'
|
VUE_APP_PROJECT_NAME = 'cereshop-admin-web'
|
||||||
|
|
||||||
# 请求服务配置
|
# 请求服务配置
|
||||||
VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.236:8764'
|
VUE_APP_DEV_REQUEST_DOMAIN_PREFIX = 'http://192.168.10.130:8764'
|
||||||
|
|
||||||
# 是否启用验证码
|
# 是否启用验证码
|
||||||
VUE_APP_IS_CAPTCHA = true
|
VUE_APP_IS_CAPTCHA = true
|
||||||
|
|||||||
Generated
+4
-4
@@ -3820,9 +3820,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vue-loader-v16": {
|
"vue-loader-v16": {
|
||||||
"version": "npm:vue-loader@16.2.0",
|
"version": "npm:vue-loader@16.3.0",
|
||||||
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.2.0.tgz",
|
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.3.0.tgz?cache=0&sync_timestamp=1624996813170&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-loader%2Fdownload%2Fvue-loader-16.3.0.tgz",
|
||||||
"integrity": "sha1-BGpTMI3Ufljv4g3ewe3sAnzjtG4=",
|
"integrity": "sha1-LxleS6D7DiY1ltaDDfF9Gjbok2w=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@@ -3833,7 +3833,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"json5": {
|
"json5": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npm.taobao.org/json5/download/json5-2.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-2.2.0.tgz",
|
"resolved": "https://registry.npm.taobao.org/json5/download/json5-2.2.0.tgz",
|
||||||
"integrity": "sha1-Lf7+cgxrpSXZ69kJlQ8FFTFsiaM=",
|
"integrity": "sha1-Lf7+cgxrpSXZ69kJlQ8FFTFsiaM=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
import axiosApi from './AxiosApi.js'
|
||||||
|
|
||||||
|
const apiList = {
|
||||||
|
page: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/information/list`,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
method: 'PUT',
|
||||||
|
url: `/information`
|
||||||
|
},
|
||||||
|
save: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/information`
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: `/information`
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
page (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.page,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// query (data, custom = {}) {
|
||||||
|
// return axiosApi({
|
||||||
|
// ...apiList.query,
|
||||||
|
// data,
|
||||||
|
// custom
|
||||||
|
// })
|
||||||
|
// },
|
||||||
|
save (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.save,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
update (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.update,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
delete (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.delete,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
+1
-1
@@ -81,6 +81,7 @@ function handleSuccess(res, resolve) {
|
|||||||
|
|
||||||
// http请求
|
// http请求
|
||||||
const httpServer = opts => {
|
const httpServer = opts => {
|
||||||
|
console.log(opts,"opts")
|
||||||
// 公共参数
|
// 公共参数
|
||||||
const publicParams = {
|
const publicParams = {
|
||||||
ts: Date.now()
|
ts: Date.now()
|
||||||
@@ -133,5 +134,4 @@ const httpServer = opts => {
|
|||||||
})
|
})
|
||||||
return promise
|
return promise
|
||||||
}
|
}
|
||||||
|
|
||||||
export default httpServer
|
export default httpServer
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
import axiosApi from './AxiosApi.js'
|
||||||
|
|
||||||
|
const apiList = {
|
||||||
|
page: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/brand/page`,
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/brand/query`,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
method: 'PUT',
|
||||||
|
url: `/brand`
|
||||||
|
},
|
||||||
|
save: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/brand`
|
||||||
|
},
|
||||||
|
delete: {
|
||||||
|
method: 'DELETE',
|
||||||
|
url: `/brand`
|
||||||
|
},
|
||||||
|
export: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/brand/export`
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/brand/preview`
|
||||||
|
},
|
||||||
|
import: {
|
||||||
|
method: 'POST',
|
||||||
|
url: `/brand/import`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
page (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.page,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
query (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.query,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
save (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.save,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
update (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.update,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
delete (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.delete,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
export (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.export,
|
||||||
|
responseType: "blob",
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
preview (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.preview,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
},
|
||||||
|
import (data, custom = {}) {
|
||||||
|
return axiosApi({
|
||||||
|
...apiList.import,
|
||||||
|
data,
|
||||||
|
custom
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,35 +3,35 @@ import axiosApi from '../AxiosApi.js'
|
|||||||
const apiList = {
|
const apiList = {
|
||||||
page: {
|
page: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `/store/creditGoodsImg/page`,
|
url: `/creditGoodsImg/page`,
|
||||||
},
|
},
|
||||||
query: {
|
query: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `/store/creditGoodsImg/query`,
|
url: `/creditGoodsImg/query`,
|
||||||
},
|
},
|
||||||
update: {
|
update: {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
url: `/store/creditGoodsImg`
|
url: `/creditGoodsImg`
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `/store/creditGoodsImg`
|
url: `/creditGoodsImg`
|
||||||
},
|
},
|
||||||
delete: {
|
delete: {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: `/store/creditGoodsImg`
|
url: `/creditGoodsImg`
|
||||||
},
|
},
|
||||||
export: {
|
export: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `/store/creditGoodsImg/export`
|
url: `/creditGoodsImg/export`
|
||||||
},
|
},
|
||||||
preview: {
|
preview: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `/store/creditGoodsImg/preview`
|
url: `/creditGoodsImg/preview`
|
||||||
},
|
},
|
||||||
import: {
|
import: {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `/store/creditGoodsImg/import`
|
url: `/creditGoodsImg/import`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<Table :data="dataList.records" style="width: 100%" border>
|
<Table :data="dataList.records" style="width: 100%" border>
|
||||||
<table-column prop="name" label="店铺名称" />
|
<table-column prop="name" label="店铺名称" />
|
||||||
<table-column prop="code" label="店铺编码" />
|
<table-column prop="code" label="店铺编码" />
|
||||||
<table-column prop="posType.desc" label="店铺类型" width="180" />
|
<!-- <table-column prop="posType.desc" label="店铺类型" width="180" /> -->
|
||||||
<table-column prop="duty" label="负责人" width="180" />
|
<table-column prop="duty" label="负责人" width="180" />
|
||||||
<table-column prop="contactTel" label="联系电话" width="180" />
|
<table-column prop="contactTel" label="联系电话" width="180" />
|
||||||
<table-column label="合同状态" width="180">
|
<table-column label="合同状态" width="180">
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
class="check-dialog"
|
class="check-dialog"
|
||||||
width="55%"
|
width="55%"
|
||||||
>
|
>
|
||||||
<checkDialog v-if="checkVisible" :data-map="checkData" @close="closeCheckDialog" />
|
<checkDialog ref="checkDialog" v-if="checkVisible" :dataMap="list" @close="closeCheckDialog" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -100,12 +100,14 @@ export default {
|
|||||||
return {
|
return {
|
||||||
checkVisible: false,
|
checkVisible: false,
|
||||||
checkData: {
|
checkData: {
|
||||||
status: {}
|
status: {},
|
||||||
|
defaultPay: false
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10
|
size: 10
|
||||||
}
|
},
|
||||||
|
list: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -116,11 +118,13 @@ export default {
|
|||||||
item.check = v
|
item.check = v
|
||||||
this.checkVisible = true
|
this.checkVisible = true
|
||||||
this.checkData = item
|
this.checkData = item
|
||||||
|
this.list = item
|
||||||
console.log(this.checkData, 11)
|
console.log(this.checkData, 11)
|
||||||
},
|
},
|
||||||
closeCheckDialog() {
|
closeCheckDialog() {
|
||||||
this.checkVisible = false
|
this.checkVisible = false
|
||||||
this.checkData = {}
|
this.checkData = {}
|
||||||
|
console.log(this.$refs.checkDialog.dataMap,"dataMap")
|
||||||
},
|
},
|
||||||
prohibit(item) {
|
prohibit(item) {
|
||||||
const code = item.status.code
|
const code = item.status.code
|
||||||
|
|||||||
@@ -62,11 +62,17 @@
|
|||||||
clearable
|
clearable
|
||||||
/>
|
/>
|
||||||
</form-item>
|
</form-item>
|
||||||
<form-item label="合同状态">
|
<!-- <form-item label="合同状态">
|
||||||
<Select v-model="dataMap.status.code" disabled size="mini">
|
<Select v-model="dataMap.status.code" disabled size="mini">
|
||||||
<Option label="有效" value="NORMAL" />
|
<Option label="有效" value="NORMAL" />
|
||||||
<Option label="无效" value="FORBIDDEN" />
|
<Option label="无效" value="FORBIDDEN" />
|
||||||
</Select>
|
</Select>
|
||||||
|
</form-item> -->
|
||||||
|
<form-item label="是否使用平台收款" prop="mobile">
|
||||||
|
<el-radio-group size="small" v-model="dataMap.defaultPay">
|
||||||
|
<el-radio-button :label="true">{{ $t('common.yes') }}</el-radio-button>
|
||||||
|
<el-radio-button :label="false">{{ $t('common.no') }}</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
</form-item>
|
</form-item>
|
||||||
<form-item label="账号" prop="mobile">
|
<form-item label="账号" prop="mobile">
|
||||||
<Input
|
<Input
|
||||||
@@ -79,13 +85,13 @@
|
|||||||
/>
|
/>
|
||||||
</form-item>
|
</form-item>
|
||||||
|
|
||||||
<form-item label="收单类型">
|
<!-- <form-item label="收单类型">
|
||||||
<Select v-model="dataMap.posType.code" size="mini">
|
<Select v-model="dataMap.posType.code" size="mini">
|
||||||
<Option label="普通餐饮" value="NORMALSTORE" />
|
<Option label="普通餐饮" value="NORMALSTORE" />
|
||||||
<Option label="快消餐饮" value="FASTSTORE" />
|
<Option label="快消餐饮" value="FASTSTORE" />
|
||||||
<Option label="零售店" value="RETAILSTORE" />
|
<Option label="零售店" value="RETAILSTORE" />
|
||||||
</Select>
|
</Select>
|
||||||
</form-item>
|
</form-item> -->
|
||||||
|
|
||||||
<form-item size="large">
|
<form-item size="large">
|
||||||
<Button v-if="!dataMap.check" type="primary" @click="sumbit">确定</Button>
|
<Button v-if="!dataMap.check" type="primary" @click="sumbit">确定</Button>
|
||||||
@@ -106,8 +112,8 @@ export default {
|
|||||||
FormItem,
|
FormItem,
|
||||||
Input,
|
Input,
|
||||||
Button,
|
Button,
|
||||||
Select,
|
// Select,
|
||||||
Option,
|
// Option,
|
||||||
DatePicker
|
DatePicker
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|||||||
@@ -8,16 +8,17 @@
|
|||||||
<!-- upload -->
|
<!-- upload -->
|
||||||
上传
|
上传
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dialog :visible.sync="dialogVisible">
|
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||||
<el-upload
|
<el-upload
|
||||||
:multiple="true"
|
:multiple="true"
|
||||||
|
:headers="headers"
|
||||||
:file-list="fileList"
|
:file-list="fileList"
|
||||||
:show-file-list="true"
|
:show-file-list="true"
|
||||||
:on-remove="handleRemove"
|
:on-remove="handleRemove"
|
||||||
:on-success="handleSuccess"
|
:on-success="handleSuccess"
|
||||||
:before-upload="beforeUpload"
|
:data="dataObj"
|
||||||
class="editor-slide-upload"
|
class="editor-slide-upload"
|
||||||
action="https://httpbin.org/post"
|
:action="action"
|
||||||
list-type="picture-card"
|
list-type="picture-card"
|
||||||
>
|
>
|
||||||
<el-button size="small" type="primary">
|
<el-button size="small" type="primary">
|
||||||
@@ -39,7 +40,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { getToken } from 'api/qiniu'
|
// import { getToken } from 'api/qiniu'
|
||||||
|
import db from '@/utils/localstorage'
|
||||||
export default {
|
export default {
|
||||||
name: 'EditorSlideUpload',
|
name: 'EditorSlideUpload',
|
||||||
props: {
|
props: {
|
||||||
@@ -52,25 +53,44 @@ export default {
|
|||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
listObj: {},
|
listObj: {},
|
||||||
fileList: []
|
fileList: [],
|
||||||
|
action: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}/file/upload`,
|
||||||
|
list: [],
|
||||||
|
headers: {
|
||||||
|
Authorization: '',
|
||||||
|
},
|
||||||
|
dataObj: {
|
||||||
|
folderId: 1
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.headers.token = 'Bearer ' + db.get('TOKEN', '')
|
||||||
|
this.headers.tenant = 'MDAwMA=='
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkAllSuccess() {
|
checkAllSuccess() {
|
||||||
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
|
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess)
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
const arr = Object.keys(this.listObj).map(v => this.listObj[v])
|
// const arr = Object.keys(this.listObj).map(v => this.listObj[v])
|
||||||
if (!this.checkAllSuccess()) {
|
// if (!this.checkAllSuccess()) {
|
||||||
this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')
|
// this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
if(!this.list.length) {
|
||||||
|
this.$message('请上传图片')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let arr = this.list
|
||||||
this.$emit('successCBK', arr)
|
this.$emit('successCBK', arr)
|
||||||
this.listObj = {}
|
this.listObj = {}
|
||||||
this.fileList = []
|
this.fileList = []
|
||||||
|
this.list = []
|
||||||
this.dialogVisible = false
|
this.dialogVisible = false
|
||||||
},
|
},
|
||||||
handleSuccess(response, file) {
|
handleSuccess(response, file) {
|
||||||
|
this.list.push(response.data.url)
|
||||||
const uid = file.uid
|
const uid = file.uid
|
||||||
const objKeyArr = Object.keys(this.listObj)
|
const objKeyArr = Object.keys(this.listObj)
|
||||||
for (let i = 0, len = objKeyArr.length; i < len; i++) {
|
for (let i = 0, len = objKeyArr.length; i < len; i++) {
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ export default {
|
|||||||
imageSuccessCBK(arr) {
|
imageSuccessCBK(arr) {
|
||||||
const _this = this
|
const _this = this
|
||||||
arr.forEach(v => {
|
arr.forEach(v => {
|
||||||
window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`)
|
window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v}" >`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,15 @@ export default {
|
|||||||
github: 'Github Repository'
|
github: 'Github Repository'
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
|
brand: {
|
||||||
|
id: 'ID',
|
||||||
|
name: 'name',
|
||||||
|
image: 'image',
|
||||||
|
video: 'video',
|
||||||
|
desc: 'desc',
|
||||||
|
content: 'content',
|
||||||
|
sort: 'sort',
|
||||||
|
},
|
||||||
banner: {
|
banner: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
imgUrl: 'imgUrl',
|
imgUrl: 'imgUrl',
|
||||||
|
|||||||
+16
-7
@@ -32,6 +32,15 @@ export default {
|
|||||||
github: '项目地址'
|
github: '项目地址'
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
|
brand: {
|
||||||
|
id: 'ID',
|
||||||
|
name: '名称',
|
||||||
|
image: '图片',
|
||||||
|
video: '视频',
|
||||||
|
desc: '描述',
|
||||||
|
content: '富文本',
|
||||||
|
sort: 'sort',
|
||||||
|
},
|
||||||
banner: {
|
banner: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
imgUrl: '图片',
|
imgUrl: '图片',
|
||||||
@@ -49,7 +58,7 @@ export default {
|
|||||||
startTime: '开始时间',
|
startTime: '开始时间',
|
||||||
endTime: '结束时间',
|
endTime: '结束时间',
|
||||||
state: '状态:1-上架,0-下架',
|
state: '状态:1-上架,0-下架',
|
||||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
isDelete: '逻辑删除:',
|
||||||
},
|
},
|
||||||
creditOrder: {
|
creditOrder: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
@@ -58,7 +67,7 @@ export default {
|
|||||||
amount: '金额',
|
amount: '金额',
|
||||||
state: '状态:1-未完成,2-已完成,9-已取消',
|
state: '状态:1-未完成,2-已完成,9-已取消',
|
||||||
useTyped: '使用类型:1-配送,2-自提,3-虚拟',
|
useTyped: '使用类型:1-配送,2-自提,3-虚拟',
|
||||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
isDelete: '逻辑删除:',
|
||||||
},
|
},
|
||||||
creditOrderDetail: {
|
creditOrderDetail: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
@@ -75,7 +84,7 @@ export default {
|
|||||||
goodsMainImg: '商品主图路径',
|
goodsMainImg: '商品主图路径',
|
||||||
goodsViceImg: '商品副图的路径集合',
|
goodsViceImg: '商品副图的路径集合',
|
||||||
goodsNumber: '商品数量',
|
goodsNumber: '商品数量',
|
||||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
isDelete: '逻辑删除:',
|
||||||
},
|
},
|
||||||
creditOrderDelivery: {
|
creditOrderDelivery: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
@@ -90,7 +99,7 @@ export default {
|
|||||||
address: '收货详细地址',
|
address: '收货详细地址',
|
||||||
longitude: '经度',
|
longitude: '经度',
|
||||||
latitude: '纬度',
|
latitude: '纬度',
|
||||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
isDelete: '逻辑删除:',
|
||||||
},
|
},
|
||||||
creditGoods: {
|
creditGoods: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
@@ -118,7 +127,7 @@ export default {
|
|||||||
sortOrder: '显示顺序',
|
sortOrder: '显示顺序',
|
||||||
typed: '类型:1-主图,2-副图',
|
typed: '类型:1-主图,2-副图',
|
||||||
enabled: '是否启用:1-已启用,0-未启用',
|
enabled: '是否启用:1-已启用,0-未启用',
|
||||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
isDelete: '逻辑删除:',
|
||||||
},
|
},
|
||||||
creditGoodsCategory: {
|
creditGoodsCategory: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
@@ -127,7 +136,7 @@ export default {
|
|||||||
miniShow: '小程序是否显示',
|
miniShow: '小程序是否显示',
|
||||||
// miniShow: '小程序是否显示:1-显示,0-不显示',
|
// miniShow: '小程序是否显示:1-显示,0-不显示',
|
||||||
sortOrder: '显示顺序',
|
sortOrder: '显示顺序',
|
||||||
isDelete: '逻辑删除:1-删除 0-未删除',
|
isDelete: '逻辑删除:',
|
||||||
},
|
},
|
||||||
memberRank: {
|
memberRank: {
|
||||||
id: 'ID',
|
id: 'ID',
|
||||||
@@ -353,7 +362,7 @@ export default {
|
|||||||
},
|
},
|
||||||
dictionary: {
|
dictionary: {
|
||||||
type: "类型",
|
type: "类型",
|
||||||
name: "名称",
|
name: "编码",
|
||||||
describe: "描述",
|
describe: "描述",
|
||||||
status: "状态"
|
status: "状态"
|
||||||
},
|
},
|
||||||
|
|||||||
+23
-9
@@ -256,14 +256,14 @@ const constRouter = [{
|
|||||||
affix: true
|
affix: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: '/creditGoods/goodsImg',
|
// path: '/creditGoods/goodsImg',
|
||||||
component: () => import('@/views/creditGoods/goodsImg/index'),
|
// component: () => import('@/views/creditGoods/goodsImg/index'),
|
||||||
meta: {
|
// meta: {
|
||||||
title: '商品图片',
|
// title: '商品图片',
|
||||||
affix: true
|
// affix: true
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: '/creditGoods/goodsCategory',
|
path: '/creditGoods/goodsCategory',
|
||||||
component: () => import('@/views/creditGoods/goodsCategory/index'),
|
component: () => import('@/views/creditGoods/goodsCategory/index'),
|
||||||
@@ -801,7 +801,21 @@ const constRouter = [{
|
|||||||
},
|
},
|
||||||
"hidden": false,
|
"hidden": false,
|
||||||
"alwaysShow": false
|
"alwaysShow": false
|
||||||
}],
|
},
|
||||||
|
{
|
||||||
|
"sortValue": 2,
|
||||||
|
path: "/brand",
|
||||||
|
name: "品牌设置",
|
||||||
|
component: resolve => require(['@/views/brand/Index'], resolve),
|
||||||
|
meta: {
|
||||||
|
"title": "品牌设置",
|
||||||
|
"icon": "",
|
||||||
|
"breadcrumb": true
|
||||||
|
},
|
||||||
|
"hidden": false,
|
||||||
|
"alwaysShow": false
|
||||||
|
},
|
||||||
|
],
|
||||||
path: "/system",
|
path: "/system",
|
||||||
name: "设置",
|
name: "设置",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
|||||||
@@ -201,14 +201,14 @@ export default {
|
|||||||
icon: ''
|
icon: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: '/creditGoods/goodsImg',
|
// path: '/creditGoods/goodsImg',
|
||||||
name: '商品图片',
|
// name: '商品图片',
|
||||||
meta: {
|
// meta: {
|
||||||
title: '商品图片',
|
// title: '商品图片',
|
||||||
icon: ''
|
// icon: ''
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
path: '/creditGoods/goodsCategory',
|
path: '/creditGoods/goodsCategory',
|
||||||
name: '商品分类',
|
name: '商品分类',
|
||||||
@@ -217,30 +217,30 @@ export default {
|
|||||||
icon: ''
|
icon: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
path: '/creditGoods/order',
|
// path: '/creditGoods/order',
|
||||||
name: '订单管理',
|
// name: '订单管理',
|
||||||
meta: {
|
// meta: {
|
||||||
title: '订单管理',
|
// title: '订单管理',
|
||||||
icon: ''
|
// icon: ''
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: '/creditGoods/orderDetail',
|
// path: '/creditGoods/orderDetail',
|
||||||
name: '订单详情',
|
// name: '订单详情',
|
||||||
meta: {
|
// meta: {
|
||||||
title: '订单详情',
|
// title: '订单详情',
|
||||||
icon: ''
|
// icon: ''
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
path: '/creditGoods/orderDelivery',
|
// path: '/creditGoods/orderDelivery',
|
||||||
name: '订单物流',
|
// name: '订单物流',
|
||||||
meta: {
|
// meta: {
|
||||||
title: '订单物流',
|
// title: '订单物流',
|
||||||
icon: ''
|
// icon: ''
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -657,7 +657,19 @@ export default {
|
|||||||
},
|
},
|
||||||
"hidden": false,
|
"hidden": false,
|
||||||
"alwaysShow": false
|
"alwaysShow": false
|
||||||
}],
|
},{
|
||||||
|
"sortValue": 2,
|
||||||
|
"path": "/brand",
|
||||||
|
"name": "品牌介绍",
|
||||||
|
"component": "brand/Index",
|
||||||
|
"meta": {
|
||||||
|
"title": "品牌介绍",
|
||||||
|
"icon": "",
|
||||||
|
"breadcrumb": true
|
||||||
|
},
|
||||||
|
"hidden": false,
|
||||||
|
"alwaysShow": false
|
||||||
|
},],
|
||||||
"path": "/system",
|
"path": "/system",
|
||||||
"name": "设置",
|
"name": "设置",
|
||||||
"component": "Layout",
|
"component": "Layout",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<el-form
|
<el-form
|
||||||
label-position="right"
|
label-position="right"
|
||||||
@@ -20,20 +21,294 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<h4 style="font-size: 18px; margin-left: 150px; color: red">
|
<h4 style="font-size: 18px; margin-left: 150px; color: red">
|
||||||
移动端设置
|
移动端设置(百年川椒)
|
||||||
</h4>
|
</h4>
|
||||||
<h5 style="font-size: 18px; margin-left: 150px;">
|
<!-- <h5 style="font-size: 18px; margin-left: 150px;">
|
||||||
安卓版本设置
|
安卓版本设置
|
||||||
</h5>
|
</h5> -->
|
||||||
<el-form-item label="版本号android_version:">
|
<el-form-item label="版本号:">
|
||||||
<el-input v-model="formLabelAlign.android_version"></el-input>
|
<el-input v-model="formLabelAlign.android_version"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="下载地址android_apk_url:">
|
<el-form-item label="下载地址:">
|
||||||
<el-input v-model="formLabelAlign.android_apk_url"></el-input>
|
<el-input v-model="formLabelAlign.android_apk_url"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="积分规则Integral_rules:">
|
<el-form-item label="积分规则:">
|
||||||
<Tinymce ref="content" v-model="formLabelAlign.Integral_rules" :height="300" />
|
<Tinymce
|
||||||
|
ref="content"
|
||||||
|
v-model="formLabelAlign.Integral_rules"
|
||||||
|
:height="300"
|
||||||
|
/>
|
||||||
<!-- <el-input v-model="formLabelAlign.Integral_rules"></el-input> -->
|
<!-- <el-input v-model="formLabelAlign.Integral_rules"></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="百年川椒品牌介绍:">
|
||||||
|
<Tinymce
|
||||||
|
ref="content"
|
||||||
|
v-model="formLabelAlign.bncj"
|
||||||
|
:height="300"
|
||||||
|
/>
|
||||||
|
<!-- <el-input v-model="formLabelAlign.Integral_rules"></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="前进麦味品牌介绍:">
|
||||||
|
<Tinymce
|
||||||
|
ref="content"
|
||||||
|
v-model="formLabelAlign.qjmw"
|
||||||
|
:height="300"
|
||||||
|
/>
|
||||||
|
<!-- <el-input v-model="formLabelAlign.Integral_rules"></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="海峡姐妹品牌介绍:">
|
||||||
|
<Tinymce
|
||||||
|
ref="content"
|
||||||
|
v-model="formLabelAlign.hxjm"
|
||||||
|
:height="300"
|
||||||
|
/>
|
||||||
|
<!-- <el-input v-model="formLabelAlign.Integral_rules"></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创始人设置:">
|
||||||
|
<Tinymce
|
||||||
|
ref="content"
|
||||||
|
v-model="formLabelAlign.founder"
|
||||||
|
:height="300"
|
||||||
|
/>
|
||||||
|
<!-- <el-input v-model="formLabelAlign.Integral_rules"></el-input> -->
|
||||||
|
</el-form-item>
|
||||||
|
<h5 style="font-size: 18px; margin-left: 150px; color: red">
|
||||||
|
支付宝设置
|
||||||
|
</h5>
|
||||||
|
<el-form-item label="支付宝应用ID:">
|
||||||
|
<el-input v-model="formLabelAlign.alipay_app_id"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="应用公钥证书:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePreviewg"
|
||||||
|
:on-remove="handleRemoveg"
|
||||||
|
:before-remove="beforeRemoveg"
|
||||||
|
:on-success="handleImageSuccessg"
|
||||||
|
:on-change="handleChangeg"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListg"
|
||||||
|
style="width: 130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-upload">点击上传</el-button>
|
||||||
|
<span style="color:red">支付宝下载的应用公钥证书,如:appCertPublicKey.crt</span>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="支付宝公钥证书:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePreview"
|
||||||
|
:on-remove="handleRemove"
|
||||||
|
:before-remove="beforeRemove"
|
||||||
|
:on-success="handleImageSuccess"
|
||||||
|
:on-change="handleChangeSuccess"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileList"
|
||||||
|
style="width: 130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-upload"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
<span style="font-size: 12px; color: red "
|
||||||
|
>支付宝下载的公钥证书,如:alipayCertPublicKey_RSA2.crt</span
|
||||||
|
>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="私钥:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePreviewm"
|
||||||
|
:on-remove="handleRemovem"
|
||||||
|
:before-remove="beforeRemovem"
|
||||||
|
:on-success="handleImageSuccessm"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListm"
|
||||||
|
style="width:130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary">点击上传</el-button>
|
||||||
|
<span style="font-size:12px; color:" >请上传CSR的私钥</span>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<el-form-item label="支付宝根证书:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePreviewz"
|
||||||
|
:on-remove="handleRemovez"
|
||||||
|
:before-remove="beforeRemovez"
|
||||||
|
:on-success="handleImageSuccessz"
|
||||||
|
:on-change="handleChangez"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListz"
|
||||||
|
style="width: 130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-upload"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
<span style="color:red">支付宝下载的根证书,如:alipayRootCert.crt</span>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="应用私钥证书:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePreviewm"
|
||||||
|
:on-remove="handleRemovem"
|
||||||
|
:before-remove="beforeRemovem"
|
||||||
|
:on-success="handleImageSuccessm"
|
||||||
|
:on-change="handleChangem"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListm"
|
||||||
|
style="width: 130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-upload"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
<span style="font-size: 12px; color: red ">用户生成的csr私钥,如:csr/私钥.txt </span>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="阿里支付网关:">
|
||||||
|
<el-input v-model="formLabelAlign.alipay_gateway"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<h5 style="font-size: 18px; margin-left: 150px; color: red">微信设置</h5>
|
||||||
|
<el-form-item label="微信商户v3接口的密钥:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_v3_mch_key"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="微信商户v3接口开关:">
|
||||||
|
<el-switch v-model="value2"> </el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<h5 style="font-size: 18px; margin-left: 150px; color: red">
|
||||||
|
小程序设置
|
||||||
|
</h5>
|
||||||
|
<el-form-item label="小程序appid:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_program_appId"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="小程序secret:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_program_secret"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商户id:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_mch_id"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商户密钥:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_mch_key"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item label="通知地址:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_notify_url"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="退款通知地址:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_refund_notify_url"></el-input>
|
||||||
|
</el-form-item> -->
|
||||||
|
<!-- <el-form-item label="证书地址:">
|
||||||
|
<el-input v-model="formLabelAlign.mini_key_path"></el-input>
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePreviewsh"
|
||||||
|
:on-remove="handleRemovesh"
|
||||||
|
:before-remove="beforeRemovesh"
|
||||||
|
:on-success="handleImageSuccesssh"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListsh"
|
||||||
|
style="width:130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary">点击上传</el-button>
|
||||||
|
<span>请上传正确的证书</span>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<el-form-item label="p12证书文件:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePreviewzs"
|
||||||
|
:on-remove="handleRemovezs"
|
||||||
|
:before-remove="beforeRemovezs"
|
||||||
|
:on-success="handleImageSuccesszs"
|
||||||
|
:on-change="handleChangezs"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListzs"
|
||||||
|
style="width: 130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-upload"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
<span>请上传正确的p12证书文件</span>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="p12文件编码:">
|
||||||
|
<el-input
|
||||||
|
type="password"
|
||||||
|
v-model="formLabelAlign.mini_key_sn_no"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="cert证书文件:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePCertificate"
|
||||||
|
:on-remove="handleRCertificate"
|
||||||
|
:before-remove="beforeCertificate"
|
||||||
|
:on-success="handleImageCertificate"
|
||||||
|
:on-change="handleChangeCertificate"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListdz"
|
||||||
|
style="width: 130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-upload"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
<span style="font-size: 12px; color: "
|
||||||
|
>请上传cert证书文件地址(p12导出,v3接口使用)</span
|
||||||
|
>
|
||||||
|
</el-upload>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="key文件:">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
:action="actions"
|
||||||
|
:on-preview="handlePSecretkey"
|
||||||
|
:on-remove="handleRSecretkey"
|
||||||
|
:before-remove="beforeCerSecretkey"
|
||||||
|
:on-success="handleImageSecretkey"
|
||||||
|
:on-change="handleChangeSecretkey"
|
||||||
|
multiple
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:file-list="fileListmy"
|
||||||
|
style="width: 130%"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary" icon="el-icon-upload"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
<span style="font-size: 12px; color: "
|
||||||
|
>请上传key文件(p12导出,v3接口使用)</span
|
||||||
|
>
|
||||||
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <h5 style="font-size: 18px; margin-left: 150px; color: red">
|
<!-- <h5 style="font-size: 18px; margin-left: 150px; color: red">
|
||||||
支付方式设置
|
支付方式设置
|
||||||
@@ -445,8 +720,6 @@
|
|||||||
<el-input v-model="formLabelAlign.alipay_gateway"></el-input>
|
<el-input v-model="formLabelAlign.alipay_gateway"></el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <el-form-item label="厨房打印机:">
|
<!-- <el-form-item label="厨房打印机:">
|
||||||
<el-input v-model="formLabelAlign.printerSN"></el-input>
|
<el-input v-model="formLabelAlign.printerSN"></el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
@@ -490,19 +763,18 @@
|
|||||||
<el-input v-model="formLabelAlign.AutomaticSN"></el-input>
|
<el-input v-model="formLabelAlign.AutomaticSN"></el-input>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<!-- <el-button size="small" type="primary" @click="newlyAdded" style="float:right">新增</el-button> -->
|
<!-- <el-button size="small" type="primary" @click="newlyAdded" style="float:right">新增</el-button> -->
|
||||||
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div style="margin-top: 100px; margin-left: 10.5%; margin-bottom: 30px">
|
<div style="margin-top: 100px; margin-left: 10.5%; margin-bottom: 30px">
|
||||||
<el-button size="small" type="primary" @click="Submits">提交</el-button>
|
<el-button size="small" type="primary" @click="Submits">提交</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Tables from '@/api/ceresConfig.js'
|
import Tables from '@/api/ceresConfig.js'
|
||||||
import db from '@/utils/localstorage'
|
import db from '@/utils/localstorage'
|
||||||
// import Setting from '@/api/Setting'
|
import Setting from '@/api/Setting'
|
||||||
import Tinymce from '@/components/Tinymce'
|
import Tinymce from '@/components/Tinymce'
|
||||||
export default {
|
export default {
|
||||||
inject: ['reload'],
|
inject: ['reload'],
|
||||||
@@ -535,6 +807,31 @@ export default {
|
|||||||
{ name: 'android_version', value: '', id: '' },
|
{ name: 'android_version', value: '', id: '' },
|
||||||
{ name: 'android_apk_url', value: '', id: '' },
|
{ name: 'android_apk_url', value: '', id: '' },
|
||||||
{ name: 'Integral_rules', value: '', id: '' },
|
{ name: 'Integral_rules', value: '', id: '' },
|
||||||
|
{ name: 'bncj', value: '', id: '' },
|
||||||
|
{ name: 'qjmw', value: '', id: '' },
|
||||||
|
{ name: 'hxjm', value: '', id: '' },
|
||||||
|
{ name: 'founder', value: '', id: '' },
|
||||||
|
//支付宝设置
|
||||||
|
{ name: 'alipay_app_id', value: '', id: '' },
|
||||||
|
{ name: 'alipay_app_public_key', value: '', id: '' },
|
||||||
|
{ name: 'alipay_public_key', value: '', id: '' },
|
||||||
|
{ name: 'alipay_root_key', value: '', id: '' },
|
||||||
|
{ name: 'alipay_private_key', value: '', id: '' },
|
||||||
|
{ name: 'alipay_gateway', value: '', id: '' },
|
||||||
|
//微信设置
|
||||||
|
{ name: 'mini_v3_mch_key', value: '', id: '' },
|
||||||
|
{ name: 'switch', value: '', id: '' },
|
||||||
|
//小程序设置
|
||||||
|
{ name: 'mini_program_appId', value: '', id: '' },
|
||||||
|
{ name: 'mini_program_secret', value: '', id: '' },
|
||||||
|
{ name: 'mini_mch_id', value: '', id: '' },
|
||||||
|
{ name: 'mini_mch_key', value: '', id: '' },
|
||||||
|
{ name: 'mini_key_path', value: '', id: '' },
|
||||||
|
{ name: 'mini_key_sn_no', value: '', id: '' },
|
||||||
|
{ name: 'mini_key_cert_path', value: '', id: '' },
|
||||||
|
{ name: 'mini_key_key_path', value: '', id: '' },
|
||||||
|
{ name: 'mini_version', value: '', id: '' },
|
||||||
|
{ name: 'mini_download_url', value: '', id: '' }
|
||||||
/* { name: 'mini_program_appId', value: '', id: '' },
|
/* { name: 'mini_program_appId', value: '', id: '' },
|
||||||
{ name: 'mini_program_secret', value: '', id: '' },
|
{ name: 'mini_program_secret', value: '', id: '' },
|
||||||
{ name: 'receipt_top', value: '', id: '' },
|
{ name: 'receipt_top', value: '', id: '' },
|
||||||
@@ -572,13 +869,35 @@ export default {
|
|||||||
android_version: '',
|
android_version: '',
|
||||||
android_apk_url: '',
|
android_apk_url: '',
|
||||||
Integral_rules: '',
|
Integral_rules: '',
|
||||||
|
bncj: '',
|
||||||
|
qjmw: '',
|
||||||
|
hxjm: '',
|
||||||
|
founder: '',
|
||||||
|
alipay_app_id: '',
|
||||||
|
alipay_app_public_key: '',
|
||||||
|
alipay_public_key: '',
|
||||||
|
alipay_root_key: '',
|
||||||
|
alipay_private_key: '',
|
||||||
|
alipay_gateway: '',
|
||||||
|
mini_v3_mch_key: '',
|
||||||
|
switch: '',
|
||||||
|
mini_program_appId: '',
|
||||||
|
mini_program_secret: '',
|
||||||
|
mini_mch_id: '',
|
||||||
|
mini_mch_key: '',
|
||||||
|
mini_key_path: '',
|
||||||
|
mini_key_sn_no: '',
|
||||||
|
mini_key_cert_path: '',
|
||||||
|
mini_key_key_path: '',
|
||||||
|
mini_version: '',
|
||||||
|
mini_download_url: ''
|
||||||
/* // printer_sn: 30,
|
/* // printer_sn: 30,
|
||||||
mini_program_appId: '',
|
mini_program_appId: '',
|
||||||
mini_program_secret: '',
|
mini_program_secret: '',
|
||||||
receipt_top: '',
|
receipt_top: '',
|
||||||
receipt_bottom: '',
|
receipt_bottom: '',
|
||||||
printer_order_sn: '',
|
printer_order_sn: '',
|
||||||
printer_pay_sn: '',
|
printer_pay_sn: '',alipay_app_id
|
||||||
mini_mch_id: '',
|
mini_mch_id: '',
|
||||||
mini_mch_key: '',
|
mini_mch_key: '',
|
||||||
mini_notify_url: '',
|
mini_notify_url: '',
|
||||||
@@ -614,6 +933,28 @@ export default {
|
|||||||
android_version: '',
|
android_version: '',
|
||||||
android_apk_url: '',
|
android_apk_url: '',
|
||||||
Integral_rules: '',
|
Integral_rules: '',
|
||||||
|
bncj: '',
|
||||||
|
qjmw: '',
|
||||||
|
hxjm: '',
|
||||||
|
founder: '',
|
||||||
|
alipay_app_id: '',
|
||||||
|
alipay_app_public_key: '',
|
||||||
|
alipay_public_key: '',
|
||||||
|
alipay_root_key: '',
|
||||||
|
alipay_private_key: '',
|
||||||
|
alipay_gateway: '',
|
||||||
|
mini_v3_mch_key: '',
|
||||||
|
switch: '',
|
||||||
|
mini_program_appId: '',
|
||||||
|
mini_program_secret: '',
|
||||||
|
mini_mch_id: '',
|
||||||
|
mini_mch_key: '',
|
||||||
|
mini_key_path: '',
|
||||||
|
mini_key_sn_no: '',
|
||||||
|
mini_key_cert_path: '',
|
||||||
|
mini_key_key_path: '',
|
||||||
|
mini_version: '',
|
||||||
|
mini_download_url: ''
|
||||||
/* // printer_sn: 30,
|
/* // printer_sn: 30,
|
||||||
mini_program_appId: '',
|
mini_program_appId: '',
|
||||||
mini_program_secret: '',
|
mini_program_secret: '',
|
||||||
@@ -654,10 +995,10 @@ export default {
|
|||||||
},
|
},
|
||||||
payMents: [
|
payMents: [
|
||||||
{ label: '现金支付', value: '0' },
|
{ label: '现金支付', value: '0' },
|
||||||
{label:'微信支付 ',value:"1"},
|
{ label: '微信支付 ', value: '1' },
|
||||||
{label:'支付宝支付',value:"2"},
|
{ label: '支付宝支付', value: '2' },
|
||||||
{label:'商户会员余额支付',value:"3"},
|
{ label: '商户会员余额支付', value: '3' },
|
||||||
{label:'平台会员余额支付',value:"4"},
|
{ label: '平台会员余额支付', value: '4' },
|
||||||
],
|
],
|
||||||
payChannelChooses: [],
|
payChannelChooses: [],
|
||||||
// logistics:[]
|
// logistics:[]
|
||||||
@@ -665,11 +1006,11 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// console.log('ddd')
|
// console.log('ddd')
|
||||||
// this.kiu()
|
this.kiu()
|
||||||
console.log(db.get("TENANT"))
|
console.log(db.get('TENANT'))
|
||||||
// this.formLabelAlign.storeId = sessionStorage.getItem('UserID')
|
// this.formLabelAlign.storeId = sessionStorage.getItem('UserID')
|
||||||
this.headers.token = 'Bearer ' + db.get('TOKEN', '')
|
this.headers.token = 'Bearer ' + db.get('TOKEN', '')
|
||||||
this.headers.tenant = db.get("TENANT")
|
this.headers.tenant = db.get('TENANT')
|
||||||
// this.queryse()
|
// this.queryse()
|
||||||
// this.getLogistics()
|
// this.getLogistics()
|
||||||
},
|
},
|
||||||
@@ -734,7 +1075,6 @@ export default {
|
|||||||
handleImageSuccessg(file) {
|
handleImageSuccessg(file) {
|
||||||
// console.log(file, '就是这个')
|
// console.log(file, '就是这个')
|
||||||
this.formLabelAlign.alipay_app_public_key = file.data.url
|
this.formLabelAlign.alipay_app_public_key = file.data.url
|
||||||
|
|
||||||
},
|
},
|
||||||
handleChangeg(file, fileList) {
|
handleChangeg(file, fileList) {
|
||||||
if (fileList.length > 0) {
|
if (fileList.length > 0) {
|
||||||
@@ -1029,11 +1369,62 @@ export default {
|
|||||||
payChannel.value = payChannelChooses;
|
payChannel.value = payChannelChooses;
|
||||||
this.formLabelAlignss.push(payChannel) */
|
this.formLabelAlignss.push(payChannel) */
|
||||||
// console.log(this.payChannelChooses)
|
// console.log(this.payChannelChooses)
|
||||||
|
if (this.value2 == true) {
|
||||||
|
this.formLabelAlign.switch = 'true'
|
||||||
|
} else if (this.value2 == false) {
|
||||||
|
this.formLabelAlign.switch = 'false'
|
||||||
|
}
|
||||||
this.formLabelAlignss.forEach((item, index) => {
|
this.formLabelAlignss.forEach((item, index) => {
|
||||||
if (item.name == 'android_version') {
|
if (item.name == 'android_version') {
|
||||||
item.value = this.formLabelAlign.android_version
|
item.value = this.formLabelAlign.android_version
|
||||||
} else if (item.name == 'android_apk_url') {
|
} else if (item.name == 'android_apk_url') {
|
||||||
item.value = this.formLabelAlign.android_apk_url
|
item.value = this.formLabelAlign.android_apk_url
|
||||||
|
}else if (item.name == 'Integral_rules') {
|
||||||
|
item.value = this.formLabelAlign.Integral_rules
|
||||||
|
}else if (item.name == 'bncj') {
|
||||||
|
item.value = this.formLabelAlign.bncj
|
||||||
|
}else if (item.name == 'qjmw') {
|
||||||
|
item.value = this.formLabelAlign.qjmw
|
||||||
|
}else if (item.name == 'hxjm') {
|
||||||
|
item.value = this.formLabelAlign.hxjm
|
||||||
|
}else if (item.name == 'founder') {
|
||||||
|
item.value = this.formLabelAlign.founder
|
||||||
|
}else if (item.name == 'alipay_app_id') {
|
||||||
|
item.value = this.formLabelAlign.alipay_app_id
|
||||||
|
}else if (item.name == 'alipay_app_public_key') {
|
||||||
|
item.value = this.formLabelAlign.alipay_app_public_key
|
||||||
|
}else if (item.name == 'alipay_public_key') {
|
||||||
|
item.value = this.formLabelAlign.alipay_public_key
|
||||||
|
}else if (item.name == 'alipay_root_key') {
|
||||||
|
item.value = this.formLabelAlign.alipay_root_key
|
||||||
|
}else if (item.name == 'alipay_private_key') {
|
||||||
|
item.value = this.formLabelAlign.alipay_private_key
|
||||||
|
}else if (item.name == 'alipay_gateway') {
|
||||||
|
item.value = this.formLabelAlign.alipay_gateway
|
||||||
|
}else if (item.name == 'mini_v3_mch_key') {
|
||||||
|
item.value = this.formLabelAlign.mini_v3_mch_key
|
||||||
|
}else if (item.name == 'switch') {
|
||||||
|
item.value = this.formLabelAlign.switch
|
||||||
|
}else if (item.name == 'mini_program_appId') {
|
||||||
|
item.value = this.formLabelAlign.mini_program_appId
|
||||||
|
}else if (item.name == 'mini_program_secret') {
|
||||||
|
item.value = this.formLabelAlign.mini_program_secret
|
||||||
|
}else if (item.name == 'mini_mch_id') {
|
||||||
|
item.value = this.formLabelAlign.mini_mch_id
|
||||||
|
}else if (item.name == 'mini_mch_key') {
|
||||||
|
item.value = this.formLabelAlign.mini_mch_key
|
||||||
|
}else if (item.name == 'mini_key_path') {
|
||||||
|
item.value = this.formLabelAlign.mini_key_path
|
||||||
|
}else if (item.name == 'mini_key_sn_no') {
|
||||||
|
item.value = this.formLabelAlign.mini_key_sn_no
|
||||||
|
}else if (item.name == 'mini_key_cert_path') {
|
||||||
|
item.value = this.formLabelAlign.mini_key_cert_path
|
||||||
|
}else if (item.name == 'mini_key_key_path') {
|
||||||
|
item.value = this.formLabelAlign.mini_key_key_path
|
||||||
|
}else if (item.name == 'mini_version') {
|
||||||
|
item.value = this.formLabelAlign.mini_version
|
||||||
|
}else if (item.name == 'mini_download_url') {
|
||||||
|
item.value = this.formLabelAlign.mini_download_url
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(this.formLabelAlignss)
|
console.log(this.formLabelAlignss)
|
||||||
@@ -1041,7 +1432,11 @@ export default {
|
|||||||
Tables.setdata(this.formLabelAlignss).then((res) => {
|
Tables.setdata(this.formLabelAlignss).then((res) => {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
if (res.data.msg == 'ok') {
|
if (res.data.msg == 'ok') {
|
||||||
this.reload()
|
this.$message({
|
||||||
|
message: '修改成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
this.kiu()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// }
|
// }
|
||||||
@@ -1055,80 +1450,56 @@ export default {
|
|||||||
|
|
||||||
red.data.data.forEach((item, index) => {
|
red.data.data.forEach((item, index) => {
|
||||||
// console.log(item)
|
// console.log(item)
|
||||||
if (item.name == 'mini_program_appId') {
|
if (item.name == 'android_version') {
|
||||||
this.formLabelAlignss[0].id = item.id
|
this.formLabelAlignss[0].id = item.id
|
||||||
} else if (item.name == 'mini_program_secret') {
|
} else if (item.name == 'android_apk_url') {
|
||||||
this.formLabelAlignss[1].id = item.id
|
this.formLabelAlignss[1].id = item.id
|
||||||
} else if (item.name == 'receipt_top') {
|
} else if (item.name == 'Integral_rules') {
|
||||||
this.formLabelAlignss[2].id = item.id
|
this.formLabelAlignss[2].id = item.id
|
||||||
} else if (item.name == 'receipt_bottom') {
|
} else if (item.name == 'bncj') {
|
||||||
this.formLabelAlignss[3].id = item.id
|
this.formLabelAlignss[3].id = item.id
|
||||||
} else if (item.name == 'printer_order_sn') {
|
} else if (item.name == 'qjmw') {
|
||||||
this.formLabelAlignss[4].id = item.id
|
this.formLabelAlignss[4].id = item.id
|
||||||
} else if (item.name == 'printer_pay_sn') {
|
} else if (item.name == 'hxjm') {
|
||||||
this.formLabelAlignss[5].id = item.id
|
this.formLabelAlignss[5].id = item.id
|
||||||
} else if (item.name == 'mini_mch_id') {
|
} else if (item.name == 'founder') {
|
||||||
this.formLabelAlignss[6].id = item.id
|
this.formLabelAlignss[6].id = item.id
|
||||||
} else if (item.name == 'mini_mch_key') {
|
|
||||||
this.formLabelAlignss[7].id = item.id
|
|
||||||
} else if (item.name == 'mini_notify_url') {
|
|
||||||
this.formLabelAlignss[8].id = item.id
|
|
||||||
} else if (item.name == 'mini_refund_notify_url') {
|
|
||||||
this.formLabelAlignss[9].id = item.id
|
|
||||||
} else if (item.name == 'mini_key_path') {
|
|
||||||
this.formLabelAlignss[10].id = item.id
|
|
||||||
this.fileListzs[0].name = item.value
|
|
||||||
} else if (item.name == 'merchant_table_price') {
|
|
||||||
this.formLabelAlignss[11].id = item.id
|
|
||||||
} else if (item.name == 'merchant_table_price_switch') {
|
|
||||||
this.formLabelAlignss[12].id = item.id
|
|
||||||
} else if (item.name == 'alipay_app_id') {
|
} else if (item.name == 'alipay_app_id') {
|
||||||
this.formLabelAlignss[13].id = item.id
|
this.formLabelAlignss[7].id = item.id
|
||||||
} else if (item.name == 'alipay_public_key') {
|
|
||||||
this.formLabelAlignss[14].id = item.id
|
|
||||||
this.fileList[0].name = item.value
|
|
||||||
} else if (item.name == 'alipay_private_key') {
|
|
||||||
this.formLabelAlignss[15].id = item.id
|
|
||||||
this.fileListm[0].name = item.value
|
|
||||||
} else if (item.name == 'alipay_gateway') {
|
|
||||||
this.formLabelAlignss[16].id = item.id
|
|
||||||
}else if (item.name == 'alipay_app_public_key') {
|
}else if (item.name == 'alipay_app_public_key') {
|
||||||
this.formLabelAlignss[17].id = item.id
|
this.formLabelAlignss[8].id = item.id
|
||||||
this.fileListg[0].name = item.value
|
}else if (item.name == 'alipay_public_key') {
|
||||||
|
this.formLabelAlignss[9].id = item.id
|
||||||
}else if (item.name == 'alipay_root_key') {
|
}else if (item.name == 'alipay_root_key') {
|
||||||
this.formLabelAlignss[18].id = item.id
|
this.formLabelAlignss[10].id = item.id
|
||||||
this.fileListz[0].name = item.value
|
}else if (item.name == 'alipay_private_key') {
|
||||||
} else if (item.name == 'printer_bar_code') {
|
this.formLabelAlignss[11].id = item.id
|
||||||
this.formLabelAlignss[19].id = item.id
|
}else if (item.name == 'alipay_gateway') {
|
||||||
} else if (item.name == 'mini_key_cert_path') {
|
this.formLabelAlignss[12].id = item.id
|
||||||
this.formLabelAlignss[20].id = item.id
|
|
||||||
this.fileListdz[0].name = item.value
|
|
||||||
} else if (item.name == 'mini_key_key_path') {
|
|
||||||
this.formLabelAlignss[21].id = item.id
|
|
||||||
this.fileListmy[0].name = item.value
|
|
||||||
} else if (item.name == 'mini_key_sn_no') {
|
|
||||||
this.formLabelAlignss[22].id = item.id
|
|
||||||
} else if (item.name == 'printer_logo') {
|
|
||||||
this.formLabelAlignss[23].id = item.id
|
|
||||||
this.fileLogo[0].name = item.value
|
|
||||||
}else if (item.name == 'mini_v3_mch_key') {
|
}else if (item.name == 'mini_v3_mch_key') {
|
||||||
this.formLabelAlignss[24].id = item.id
|
this.formLabelAlignss[13].id = item.id
|
||||||
}else if (item.name == 'switch') {
|
}else if (item.name == 'switch') {
|
||||||
this.formLabelAlignss[25].id = item.id
|
this.formLabelAlignss[14].id = item.id
|
||||||
} else if (item.name == 'printer_kitchen_total') { //总厨打印机
|
}else if (item.name == 'mini_program_appId') {
|
||||||
this.formLabelAlignss[26].id = item.id
|
this.formLabelAlignss[15].id = item.id
|
||||||
} else if (item.name == 'printer_bar_code_width') { //总厨打印机
|
}else if (item.name == 'mini_program_secret') {
|
||||||
this.formLabelAlignss[27].id = item.id
|
this.formLabelAlignss[16].id = item.id
|
||||||
} else if(item.name == 'pay_channel_chooses'){
|
}else if (item.name == 'mini_mch_id') {
|
||||||
this.payChannelChooses = item.value.split(',')
|
this.formLabelAlignss[17].id = item.id
|
||||||
} else if(item.name == 'sending_threshold'){
|
}else if (item.name == 'mini_mch_key') {
|
||||||
this.formLabelAlignss[28].id = item.value
|
this.formLabelAlignss[18].id = item.id
|
||||||
}else if(item.name == 'sending_price'){
|
}else if (item.name == 'mini_key_path') {
|
||||||
this.formLabelAlignss[29].id = item.value
|
this.formLabelAlignss[19].id = item.id
|
||||||
}else if(item.name == 'free_package_price'){
|
}else if (item.name == 'mini_key_sn_no') {
|
||||||
this.formLabelAlignss[30].id = item.value
|
this.formLabelAlignss[20].id = item.id
|
||||||
} else if(item.name == 'default_logistics'){
|
}else if (item.name == 'mini_key_cert_path') {
|
||||||
this.formLabelAlignss[31].id = item.value
|
this.formLabelAlignss[21].id = item.id
|
||||||
|
}else if (item.name == 'mini_key_key_path') {
|
||||||
|
this.formLabelAlignss[22].id = item.id
|
||||||
|
}else if (item.name == 'mini_version') {
|
||||||
|
this.formLabelAlignss[23].id = item.id
|
||||||
|
}else if (item.name == 'mini_download_url') {
|
||||||
|
this.formLabelAlignss[24].id = item.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// console.log(this.payChannelChooses)
|
// console.log(this.payChannelChooses)
|
||||||
|
|||||||
+17
-13
@@ -105,6 +105,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'add',
|
default: 'add',
|
||||||
},
|
},
|
||||||
|
enums: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -115,7 +119,7 @@ export default {
|
|||||||
width: this.initWidth(),
|
width: this.initWidth(),
|
||||||
rules: {},
|
rules: {},
|
||||||
// 枚举
|
// 枚举
|
||||||
enums: {},
|
// enums: {},
|
||||||
// 字典
|
// 字典
|
||||||
dicts: {},
|
dicts: {},
|
||||||
headers: {
|
headers: {
|
||||||
@@ -154,18 +158,6 @@ export default {
|
|||||||
this.width = this.initWidth()
|
this.width = this.initWidth()
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
initMsgsEnums(['banner_type'], this.enums)
|
|
||||||
setTimeout(() => {
|
|
||||||
let obj = this.enums.banner_type
|
|
||||||
for (let key in obj) {
|
|
||||||
let val = {
|
|
||||||
value: key,
|
|
||||||
label: obj[key],
|
|
||||||
}
|
|
||||||
this.typeOptions.push(val)
|
|
||||||
}
|
|
||||||
console.log(this.typeOptions, 'this.typeOptions')
|
|
||||||
}, 100)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAvatarSuccess (response) {
|
handleAvatarSuccess (response) {
|
||||||
@@ -199,6 +191,18 @@ export default {
|
|||||||
if (val['row']) {
|
if (val['row']) {
|
||||||
vm.banner = { ...val['row'] }
|
vm.banner = { ...val['row'] }
|
||||||
}
|
}
|
||||||
|
this.typeOptions = []
|
||||||
|
let obj = this.enums.banner_type
|
||||||
|
for (let key in obj) {
|
||||||
|
let val = {
|
||||||
|
value: key,
|
||||||
|
label: obj[key],
|
||||||
|
}
|
||||||
|
if(this.banner.type == obj[key]) {
|
||||||
|
this.banner.type = key
|
||||||
|
}
|
||||||
|
this.typeOptions.push(val)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||||
<banner-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
<banner-edit :dialog-visible="dialog.isVisible" :type="dialog.type" :enums="enums"
|
||||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||||
<banner-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
<banner-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||||
|
|||||||
@@ -0,0 +1,225 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||||
|
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||||
|
<el-form :model="brand" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||||
|
<el-form-item :label="$t('table.brand.name')" prop="name">
|
||||||
|
<el-input type="" v-model="brand.name" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.image')" prop="image">
|
||||||
|
<!-- <el-input type="" v-model="brand.image" placeholder=""/> -->
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:action="action"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-success="handleAvatarSuccess"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
</el-upload>
|
||||||
|
<img
|
||||||
|
style="margin-top:5px"
|
||||||
|
v-if="brand.image"
|
||||||
|
:src="brand.image"
|
||||||
|
class="avatar"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.video')" prop="video">
|
||||||
|
<el-input type="" v-model="brand.video" placeholder=""/>
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.desc')" prop="desc">
|
||||||
|
<el-input type="" v-model="brand.desc" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.content')" prop="content">
|
||||||
|
<!-- <el-input type="" v-model="brand.content" placeholder=""/> -->
|
||||||
|
<Tinymce ref="content" v-if="isVisible" v-model="brand.content" :height="200" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item :label="$t('table.brand.sort')" prop="sort">
|
||||||
|
<el-input type="" v-model="brand.sort" placeholder=""/>
|
||||||
|
</el-form-item> -->
|
||||||
|
</el-form>
|
||||||
|
<div class="dialog-footer" slot="footer">
|
||||||
|
<el-button @click="isVisible = false" plain type="warning">
|
||||||
|
{{ $t("common.cancel") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||||
|
{{ $t("common.confirm") }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import elDragDialog from '@/directive/el-drag-dialog'
|
||||||
|
import brandApi from "@/api/Brand.js";
|
||||||
|
import db from '@/utils/localstorage'
|
||||||
|
import Tinymce from '@/components/Tinymce'
|
||||||
|
export default {
|
||||||
|
name: "BrandEdit",
|
||||||
|
directives: { elDragDialog },
|
||||||
|
components: {Tinymce },
|
||||||
|
props: {
|
||||||
|
dialogVisible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: "add"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
confirmDisabled: false,
|
||||||
|
brand: this.initBrand(),
|
||||||
|
screenWidth: 0,
|
||||||
|
width: this.initWidth(),
|
||||||
|
rules: {
|
||||||
|
|
||||||
|
},
|
||||||
|
// 枚举
|
||||||
|
enums: {
|
||||||
|
},
|
||||||
|
// 字典
|
||||||
|
dicts: {
|
||||||
|
},
|
||||||
|
//图片上传
|
||||||
|
headers: {
|
||||||
|
Authorization: '',
|
||||||
|
},
|
||||||
|
action: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}/file/upload`,
|
||||||
|
dataObj: {
|
||||||
|
folderId: 1
|
||||||
|
},
|
||||||
|
fileList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isVisible: {
|
||||||
|
get() {
|
||||||
|
return this.dialogVisible;
|
||||||
|
},
|
||||||
|
set() {
|
||||||
|
this.close();
|
||||||
|
this.reset();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title() {
|
||||||
|
return this.$t("common." + this.type);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.headers.token = 'Bearer ' + db.get('TOKEN', '')
|
||||||
|
this.headers.tenant = 'MDAwMA=='
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
window.onresize = () => {
|
||||||
|
return (() => {
|
||||||
|
this.width = this.initWidth();
|
||||||
|
})();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleAvatarSuccess (response) {
|
||||||
|
const { url } = response.data
|
||||||
|
this.brand.image = url
|
||||||
|
console.log(response,"response")
|
||||||
|
},
|
||||||
|
initBrand() {
|
||||||
|
return {
|
||||||
|
id: "",
|
||||||
|
name: '',
|
||||||
|
image: '',
|
||||||
|
video: '',
|
||||||
|
desc: '',
|
||||||
|
content: '',
|
||||||
|
sort: 50,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
initWidth() {
|
||||||
|
this.screenWidth = document.body.clientWidth;
|
||||||
|
if (this.screenWidth < 991) {
|
||||||
|
return "90%";
|
||||||
|
} else if (this.screenWidth < 1400) {
|
||||||
|
return "45%";
|
||||||
|
} else {
|
||||||
|
return "800px";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setBrand(val = {}) {
|
||||||
|
const vm = this;
|
||||||
|
|
||||||
|
vm.dicts = val['dicts'];
|
||||||
|
vm.enums = val['enums'];
|
||||||
|
if (val['row']) {
|
||||||
|
vm.brand = { ...val['row'] };
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit("close");
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||||
|
this.$refs.form.clearValidate();
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
this.confirmDisabled = false;
|
||||||
|
this.brand = this.initBrand();
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
const vm = this;
|
||||||
|
this.$refs.form.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
vm.editSubmit();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
editSubmit() {
|
||||||
|
const vm = this;
|
||||||
|
if (vm.type === "edit") {
|
||||||
|
vm.update();
|
||||||
|
} else {
|
||||||
|
vm.save();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
const vm = this;
|
||||||
|
vm.confirmDisabled = true;
|
||||||
|
brandApi.save(this.brand).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
vm.isVisible = false;
|
||||||
|
vm.$message({
|
||||||
|
message: vm.$t("tips.createSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
vm.$emit("success");
|
||||||
|
}
|
||||||
|
}).finally(()=> vm.confirmDisabled = false);
|
||||||
|
},
|
||||||
|
update() {
|
||||||
|
const vm = this;
|
||||||
|
vm.confirmDisabled = true;
|
||||||
|
brandApi.update(this.brand).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
vm.isVisible = false;
|
||||||
|
vm.$message({
|
||||||
|
message: this.$t("tips.updateSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
vm.$emit("success");
|
||||||
|
}
|
||||||
|
}).finally(()=> vm.confirmDisabled = false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -0,0 +1,352 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="filter-container">
|
||||||
|
|
||||||
|
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||||
|
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||||
|
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
/>
|
||||||
|
<el-button @click="search" class="filter-item" plain type="primary">
|
||||||
|
{{ $t("table.search") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||||
|
{{ $t("table.reset") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['brand:add']">
|
||||||
|
{{ $t("table.add") }}
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['brand:delete', 'brand:export',
|
||||||
|
'brand:import']">
|
||||||
|
<el-button>
|
||||||
|
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item @click.native="batchDelete" v-has-permission="['brand:delete']">
|
||||||
|
{{ $t("table.delete") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="exportExcel" v-has-permission="['brand:export']">
|
||||||
|
{{ $t("table.export") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['brand:export']">
|
||||||
|
{{ $t("table.exportPreview") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="importExcel" v-has-permission="['brand:import']">
|
||||||
|
{{ $t("table.import") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||||
|
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||||
|
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||||
|
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||||
|
<el-table-column :label="$t('table.brand.name')" :show-overflow-tooltip="true" align="center" prop="name"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.image')" :show-overflow-tooltip="true" align="center" prop="image"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<!-- <span>{{ scope.row.image }}</span> -->
|
||||||
|
<img
|
||||||
|
v-if="scope.row.image"
|
||||||
|
:src="scope.row.image"
|
||||||
|
class="avatar"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.video')" :show-overflow-tooltip="true" align="center" prop="video"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.video }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.desc')" :show-overflow-tooltip="true" align="center" prop="desc"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.desc }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.content')" :show-overflow-tooltip="true" align="center" prop="content"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.content }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.sort')" :show-overflow-tooltip="true" align="center" prop="sort"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.sort }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('table.createTime')"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
sortable="custom"
|
||||||
|
width="170px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||||
|
style="color: #2db7f5;" v-hasPermission="['brand:add']"/>
|
||||||
|
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||||
|
style="color: #2db7f5;" v-hasPermission="['brand:update']"/>
|
||||||
|
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||||
|
style="color: #f50;" v-hasPermission="['brand:delete']"/>
|
||||||
|
<el-link class="no-perm" v-has-no-permission="['brand:update', 'brand:copy', 'brand:delete']">
|
||||||
|
{{ $t("tips.noPermission") }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||||
|
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||||
|
<brand-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||||
|
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||||
|
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||||
|
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||||
|
<el-scrollbar>
|
||||||
|
<div v-html="preview.context"></div>
|
||||||
|
</el-scrollbar>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Pagination from "@/components/Pagination";
|
||||||
|
import elDragDialog from '@/directive/el-drag-dialog'
|
||||||
|
import BrandEdit from "./Edit";
|
||||||
|
import brandApi from "@/api/Brand.js";
|
||||||
|
import {convertEnum} from '@/utils/utils'
|
||||||
|
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BrandManage",
|
||||||
|
directives: { elDragDialog },
|
||||||
|
components: { Pagination, BrandEdit},
|
||||||
|
filters: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 编辑
|
||||||
|
dialog: {
|
||||||
|
isVisible: false,
|
||||||
|
type: "add"
|
||||||
|
},
|
||||||
|
// 预览
|
||||||
|
preview: {
|
||||||
|
isVisible: false,
|
||||||
|
context: ''
|
||||||
|
},
|
||||||
|
// 导入
|
||||||
|
fileImport: {
|
||||||
|
isVisible: false,
|
||||||
|
type: "import",
|
||||||
|
action: `${process.env.VUE_APP_BASE_API}/brand/brand/import`
|
||||||
|
},
|
||||||
|
tableKey: 0,
|
||||||
|
queryParams: initQueryParams(),
|
||||||
|
selection: [],
|
||||||
|
loading: false,
|
||||||
|
tableData: {
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
|
// 枚举
|
||||||
|
enums: {
|
||||||
|
},
|
||||||
|
// 字典
|
||||||
|
dicts: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetch();
|
||||||
|
|
||||||
|
// 初始化字典和枚举
|
||||||
|
const enumList = [];
|
||||||
|
const dictList = [];
|
||||||
|
loadEnums(enumList, this.enums, 'brand');
|
||||||
|
initDicts(dictList, this.dicts);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
editClose() {
|
||||||
|
this.dialog.isVisible = false;
|
||||||
|
},
|
||||||
|
editSuccess() {
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
onSelectChange(selection) {
|
||||||
|
this.selection = selection;
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.fetch({
|
||||||
|
...this.queryParams
|
||||||
|
});
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.queryParams = initQueryParams();
|
||||||
|
this.$refs.table.clearSort();
|
||||||
|
this.$refs.table.clearFilter();
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
exportExcelPreview() {
|
||||||
|
if (this.queryParams.timeRange) {
|
||||||
|
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||||
|
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||||
|
}
|
||||||
|
this.queryParams.map.fileName = '导出数据';
|
||||||
|
brandApi.preview(this.queryParams).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
this.preview.isVisible = true;
|
||||||
|
this.preview.context = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
if (this.queryParams.timeRange) {
|
||||||
|
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||||
|
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||||
|
}
|
||||||
|
this.queryParams.map.fileName = '导出数据';
|
||||||
|
brandApi.export(this.queryParams).then(response => {
|
||||||
|
downloadFile(response);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
importExcel() {
|
||||||
|
this.fileImport.type = "upload";
|
||||||
|
this.fileImport.isVisible = true;
|
||||||
|
this.$refs.import.setModel(false);
|
||||||
|
},
|
||||||
|
importSuccess() {
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
importClose() {
|
||||||
|
this.fileImport.isVisible = false;
|
||||||
|
},
|
||||||
|
singleDelete(row) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$refs.table.toggleRowSelection(row, true);
|
||||||
|
this.batchDelete();
|
||||||
|
},
|
||||||
|
batchDelete() {
|
||||||
|
if (!this.selection.length) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.noDataSelected"),
|
||||||
|
type: "warning"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||||
|
confirmButtonText: this.$t("common.confirm"),
|
||||||
|
cancelButtonText: this.$t("common.cancel"),
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
const ids = this.selection.map(u => u.id);
|
||||||
|
this.delete(ids);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.clearSelections();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clearSelections() {
|
||||||
|
this.$refs.table.clearSelection();
|
||||||
|
},
|
||||||
|
delete(ids) {
|
||||||
|
brandApi.delete({ ids: ids }).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.deleteSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.dialog.type = "add";
|
||||||
|
this.dialog.isVisible = true;
|
||||||
|
this.$refs.edit.setBrand({ enums: this.enums, dicts: this.dicts});
|
||||||
|
},
|
||||||
|
copy(row) {
|
||||||
|
this.$refs.edit.setBrand({row, enums: this.enums, dicts: this.dicts});
|
||||||
|
this.dialog.type = "copy";
|
||||||
|
this.dialog.isVisible = true;
|
||||||
|
},
|
||||||
|
edit(row) {
|
||||||
|
this.$refs.edit.setBrand({row, enums: this.enums, dicts: this.dicts});
|
||||||
|
this.dialog.type = "edit";
|
||||||
|
this.dialog.isVisible = true;
|
||||||
|
},
|
||||||
|
fetch(params = {}) {
|
||||||
|
this.loading = true;
|
||||||
|
if (this.queryParams.timeRange) {
|
||||||
|
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||||
|
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||||
|
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||||
|
|
||||||
|
brandApi.page(this.queryParams).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.tableData = res.data;
|
||||||
|
}
|
||||||
|
}).finally(() => this.loading = false);
|
||||||
|
},
|
||||||
|
sortChange(val) {
|
||||||
|
this.queryParams.sort = val.prop;
|
||||||
|
this.queryParams.order = val.order;
|
||||||
|
if (this.queryParams.sort) {
|
||||||
|
this.search();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filterChange (filters) {
|
||||||
|
for (const key in filters) {
|
||||||
|
if(key.includes('.')) {
|
||||||
|
const val = { };
|
||||||
|
val[key.split('.')[1]] = filters[key][0];
|
||||||
|
this.queryParams.model[key.split('.')[0]] = val;
|
||||||
|
} else {
|
||||||
|
this.queryParams.model[key] = filters[key][0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
cellClick (row, column) {
|
||||||
|
if (column['columnKey'] === "operation") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let flag = false;
|
||||||
|
this.selection.forEach((item)=>{
|
||||||
|
if(item.id === row.id) {
|
||||||
|
flag = true;
|
||||||
|
this.$refs.table.toggleRowSelection(row);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if(!flag){
|
||||||
|
this.$refs.table.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
||||||
|
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
||||||
|
<el-form :model="brand" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||||
|
<el-form-item :label="$t('table.brand.name')" prop="name">
|
||||||
|
<el-input type="" v-model="brand.name" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.image')" prop="image">
|
||||||
|
<el-input type="" v-model="brand.image" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.video')" prop="video">
|
||||||
|
<el-input type="" v-model="brand.video" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.desc')" prop="desc">
|
||||||
|
<el-input type="" v-model="brand.desc" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.content')" prop="content">
|
||||||
|
<el-input type="" v-model="brand.content" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.sort')" prop="sort">
|
||||||
|
<el-input type="" v-model="brand.sort" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div class="dialog-footer" slot="footer">
|
||||||
|
<el-button @click="isVisible = false" plain type="warning">
|
||||||
|
{{ $t("common.cancel") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
||||||
|
{{ $t("common.confirm") }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import elDragDialog from '@/directive/el-drag-dialog'
|
||||||
|
import brandApi from "@/api/Brand.js";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BrandEdit",
|
||||||
|
directives: { elDragDialog },
|
||||||
|
components: { },
|
||||||
|
props: {
|
||||||
|
dialogVisible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: "add"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
confirmDisabled: false,
|
||||||
|
brand: this.initBrand(),
|
||||||
|
screenWidth: 0,
|
||||||
|
width: this.initWidth(),
|
||||||
|
rules: {
|
||||||
|
|
||||||
|
},
|
||||||
|
// 枚举
|
||||||
|
enums: {
|
||||||
|
},
|
||||||
|
// 字典
|
||||||
|
dicts: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
isVisible: {
|
||||||
|
get() {
|
||||||
|
return this.dialogVisible;
|
||||||
|
},
|
||||||
|
set() {
|
||||||
|
this.close();
|
||||||
|
this.reset();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title() {
|
||||||
|
return this.$t("common." + this.type);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
mounted() {
|
||||||
|
window.onresize = () => {
|
||||||
|
return (() => {
|
||||||
|
this.width = this.initWidth();
|
||||||
|
})();
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initBrand() {
|
||||||
|
return {
|
||||||
|
id: "",
|
||||||
|
name: '',
|
||||||
|
image: '',
|
||||||
|
video: '',
|
||||||
|
desc: '',
|
||||||
|
content: '',
|
||||||
|
sort: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
initWidth() {
|
||||||
|
this.screenWidth = document.body.clientWidth;
|
||||||
|
if (this.screenWidth < 991) {
|
||||||
|
return "90%";
|
||||||
|
} else if (this.screenWidth < 1400) {
|
||||||
|
return "45%";
|
||||||
|
} else {
|
||||||
|
return "800px";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setBrand(val = {}) {
|
||||||
|
const vm = this;
|
||||||
|
|
||||||
|
vm.dicts = val['dicts'];
|
||||||
|
vm.enums = val['enums'];
|
||||||
|
if (val['row']) {
|
||||||
|
vm.brand = { ...val['row'] };
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit("close");
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
// 先清除校验,再清除表单,不然有奇怪的bug
|
||||||
|
this.$refs.form.clearValidate();
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
this.confirmDisabled = false;
|
||||||
|
this.brand = this.initBrand();
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
const vm = this;
|
||||||
|
this.$refs.form.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
vm.editSubmit();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
editSubmit() {
|
||||||
|
const vm = this;
|
||||||
|
if (vm.type === "edit") {
|
||||||
|
vm.update();
|
||||||
|
} else {
|
||||||
|
vm.save();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
const vm = this;
|
||||||
|
vm.confirmDisabled = true;
|
||||||
|
brandApi.save(this.brand).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
vm.isVisible = false;
|
||||||
|
vm.$message({
|
||||||
|
message: vm.$t("tips.createSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
vm.$emit("success");
|
||||||
|
}
|
||||||
|
}).finally(()=> vm.confirmDisabled = false);
|
||||||
|
},
|
||||||
|
update() {
|
||||||
|
const vm = this;
|
||||||
|
vm.confirmDisabled = true;
|
||||||
|
brandApi.update(this.brand).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
vm.isVisible = false;
|
||||||
|
vm.$message({
|
||||||
|
message: this.$t("tips.updateSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
vm.$emit("success");
|
||||||
|
}
|
||||||
|
}).finally(()=> vm.confirmDisabled = false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
export default {
|
||||||
|
table: {
|
||||||
|
// 以下复制到en.js
|
||||||
|
brand: {
|
||||||
|
id: 'ID',
|
||||||
|
name: 'name',
|
||||||
|
image: 'image',
|
||||||
|
video: 'video',
|
||||||
|
desc: 'desc',
|
||||||
|
content: 'content',
|
||||||
|
sort: 'sort',
|
||||||
|
},
|
||||||
|
// 以下复制到zh.js
|
||||||
|
brand: {
|
||||||
|
id: 'ID',
|
||||||
|
name: 'name',
|
||||||
|
image: 'image',
|
||||||
|
video: 'video',
|
||||||
|
desc: 'desc',
|
||||||
|
content: 'content',
|
||||||
|
sort: 'sort',
|
||||||
|
},
|
||||||
|
// 复制之后,删除 lang.js
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,347 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="filter-container">
|
||||||
|
|
||||||
|
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
||||||
|
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
||||||
|
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
/>
|
||||||
|
<el-button @click="search" class="filter-item" plain type="primary">
|
||||||
|
{{ $t("table.search") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||||
|
{{ $t("table.reset") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['brand:add']">
|
||||||
|
{{ $t("table.add") }}
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['brand:delete', 'brand:export',
|
||||||
|
'brand:import']">
|
||||||
|
<el-button>
|
||||||
|
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item @click.native="batchDelete" v-has-permission="['brand:delete']">
|
||||||
|
{{ $t("table.delete") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="exportExcel" v-has-permission="['brand:export']">
|
||||||
|
{{ $t("table.export") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['brand:export']">
|
||||||
|
{{ $t("table.exportPreview") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="importExcel" v-has-permission="['brand:import']">
|
||||||
|
{{ $t("table.import") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
||||||
|
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
||||||
|
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
||||||
|
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
||||||
|
<el-table-column :label="$t('table.brand.name')" :show-overflow-tooltip="true" align="center" prop="name"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.image')" :show-overflow-tooltip="true" align="center" prop="image"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.image }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.video')" :show-overflow-tooltip="true" align="center" prop="video"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.video }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.desc')" :show-overflow-tooltip="true" align="center" prop="desc"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.desc }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.content')" :show-overflow-tooltip="true" align="center" prop="content"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.content }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('table.brand.sort')" :show-overflow-tooltip="true" align="center" prop="sort"
|
||||||
|
width="">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.sort }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('table.createTime')"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
sortable="custom"
|
||||||
|
width="170px">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.createTime }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
||||||
|
style="color: #2db7f5;" v-hasPermission="['brand:add']"/>
|
||||||
|
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
||||||
|
style="color: #2db7f5;" v-hasPermission="['brand:update']"/>
|
||||||
|
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
||||||
|
style="color: #f50;" v-hasPermission="['brand:delete']"/>
|
||||||
|
<el-link class="no-perm" v-has-no-permission="['brand:update', 'brand:copy', 'brand:delete']">
|
||||||
|
{{ $t("tips.noPermission") }}
|
||||||
|
</el-link>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||||
|
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||||
|
<brand-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
||||||
|
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||||
|
<brand-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||||
|
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||||
|
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||||
|
<el-scrollbar>
|
||||||
|
<div v-html="preview.context"></div>
|
||||||
|
</el-scrollbar>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Pagination from "@/components/Pagination";
|
||||||
|
import elDragDialog from '@/directive/el-drag-dialog'
|
||||||
|
import BrandEdit from "./Edit";
|
||||||
|
import brandApi from "@/api/Brand.js";
|
||||||
|
import BrandImport from "@/components/zsw/Import"
|
||||||
|
import {convertEnum} from '@/utils/utils'
|
||||||
|
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BrandManage",
|
||||||
|
directives: { elDragDialog },
|
||||||
|
components: { Pagination, BrandEdit, BrandImport},
|
||||||
|
filters: {
|
||||||
|
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 编辑
|
||||||
|
dialog: {
|
||||||
|
isVisible: false,
|
||||||
|
type: "add"
|
||||||
|
},
|
||||||
|
// 预览
|
||||||
|
preview: {
|
||||||
|
isVisible: false,
|
||||||
|
context: ''
|
||||||
|
},
|
||||||
|
// 导入
|
||||||
|
fileImport: {
|
||||||
|
isVisible: false,
|
||||||
|
type: "import",
|
||||||
|
action: `${process.env.VUE_APP_BASE_API}/brand/brand/import`
|
||||||
|
},
|
||||||
|
tableKey: 0,
|
||||||
|
queryParams: initQueryParams(),
|
||||||
|
selection: [],
|
||||||
|
loading: false,
|
||||||
|
tableData: {
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
|
// 枚举
|
||||||
|
enums: {
|
||||||
|
},
|
||||||
|
// 字典
|
||||||
|
dicts: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetch();
|
||||||
|
|
||||||
|
// 初始化字典和枚举
|
||||||
|
const enumList = [];
|
||||||
|
const dictList = [];
|
||||||
|
loadEnums(enumList, this.enums, 'brand');
|
||||||
|
initDicts(dictList, this.dicts);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
editClose() {
|
||||||
|
this.dialog.isVisible = false;
|
||||||
|
},
|
||||||
|
editSuccess() {
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
onSelectChange(selection) {
|
||||||
|
this.selection = selection;
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.fetch({
|
||||||
|
...this.queryParams
|
||||||
|
});
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.queryParams = initQueryParams();
|
||||||
|
this.$refs.table.clearSort();
|
||||||
|
this.$refs.table.clearFilter();
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
exportExcelPreview() {
|
||||||
|
if (this.queryParams.timeRange) {
|
||||||
|
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||||
|
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||||
|
}
|
||||||
|
this.queryParams.map.fileName = '导出数据';
|
||||||
|
brandApi.preview(this.queryParams).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
this.preview.isVisible = true;
|
||||||
|
this.preview.context = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
if (this.queryParams.timeRange) {
|
||||||
|
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||||
|
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||||
|
}
|
||||||
|
this.queryParams.map.fileName = '导出数据';
|
||||||
|
brandApi.export(this.queryParams).then(response => {
|
||||||
|
downloadFile(response);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
importExcel() {
|
||||||
|
this.fileImport.type = "upload";
|
||||||
|
this.fileImport.isVisible = true;
|
||||||
|
this.$refs.import.setModel(false);
|
||||||
|
},
|
||||||
|
importSuccess() {
|
||||||
|
this.search();
|
||||||
|
},
|
||||||
|
importClose() {
|
||||||
|
this.fileImport.isVisible = false;
|
||||||
|
},
|
||||||
|
singleDelete(row) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$refs.table.toggleRowSelection(row, true);
|
||||||
|
this.batchDelete();
|
||||||
|
},
|
||||||
|
batchDelete() {
|
||||||
|
if (!this.selection.length) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.noDataSelected"),
|
||||||
|
type: "warning"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
||||||
|
confirmButtonText: this.$t("common.confirm"),
|
||||||
|
cancelButtonText: this.$t("common.cancel"),
|
||||||
|
type: "warning"
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
const ids = this.selection.map(u => u.id);
|
||||||
|
this.delete(ids);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.clearSelections();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
clearSelections() {
|
||||||
|
this.$refs.table.clearSelection();
|
||||||
|
},
|
||||||
|
delete(ids) {
|
||||||
|
brandApi.delete({ ids: ids }).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.deleteSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
this.search();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.dialog.type = "add";
|
||||||
|
this.dialog.isVisible = true;
|
||||||
|
this.$refs.edit.setBrand({ enums: this.enums, dicts: this.dicts});
|
||||||
|
},
|
||||||
|
copy(row) {
|
||||||
|
this.$refs.edit.setBrand({row, enums: this.enums, dicts: this.dicts});
|
||||||
|
this.dialog.type = "copy";
|
||||||
|
this.dialog.isVisible = true;
|
||||||
|
},
|
||||||
|
edit(row) {
|
||||||
|
this.$refs.edit.setBrand({row, enums: this.enums, dicts: this.dicts});
|
||||||
|
this.dialog.type = "edit";
|
||||||
|
this.dialog.isVisible = true;
|
||||||
|
},
|
||||||
|
fetch(params = {}) {
|
||||||
|
this.loading = true;
|
||||||
|
if (this.queryParams.timeRange) {
|
||||||
|
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
||||||
|
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
||||||
|
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
||||||
|
|
||||||
|
brandApi.page(this.queryParams).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.tableData = res.data;
|
||||||
|
}
|
||||||
|
}).finally(() => this.loading = false);
|
||||||
|
},
|
||||||
|
sortChange(val) {
|
||||||
|
this.queryParams.sort = val.prop;
|
||||||
|
this.queryParams.order = val.order;
|
||||||
|
if (this.queryParams.sort) {
|
||||||
|
this.search();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
filterChange (filters) {
|
||||||
|
for (const key in filters) {
|
||||||
|
if(key.includes('.')) {
|
||||||
|
const val = { };
|
||||||
|
val[key.split('.')[1]] = filters[key][0];
|
||||||
|
this.queryParams.model[key.split('.')[0]] = val;
|
||||||
|
} else {
|
||||||
|
this.queryParams.model[key] = filters[key][0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.search()
|
||||||
|
},
|
||||||
|
cellClick (row, column) {
|
||||||
|
if (column['columnKey'] === "operation") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let flag = false;
|
||||||
|
this.selection.forEach((item)=>{
|
||||||
|
if(item.id === row.id) {
|
||||||
|
flag = true;
|
||||||
|
this.$refs.table.toggleRowSelection(row);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if(!flag){
|
||||||
|
this.$refs.table.toggleRowSelection(row, true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -0,0 +1,356 @@
|
|||||||
|
<template>
|
||||||
|
<div class="brand">
|
||||||
|
<el-row :gutter="10">
|
||||||
|
<el-col :sm="12" :xs="24">
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="filter-container">
|
||||||
|
<el-input :placeholder="$t('table.brand.label')" class="filter-item search-item" v-model="label"/>
|
||||||
|
<el-button @click="search" class="filter-item" plain type="primary">
|
||||||
|
{{ $t("table.search") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="reset" class="filter-item" plain type="warning">
|
||||||
|
{{ $t("table.reset") }}
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['brand:add']">
|
||||||
|
{{ $t("table.add") }}
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['brand:import', 'brand:delete', 'brand:export']">
|
||||||
|
<el-button>
|
||||||
|
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right"/>
|
||||||
|
</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item @click.native="batchDelete" v-has-permission="['brand:delete']">
|
||||||
|
{{ $t("table.delete") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="exportExcel" v-has-permission="['brand:export']">
|
||||||
|
{{ $t("table.export") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['brand:export']">
|
||||||
|
{{ $t("table.exportPreview") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click.native="importExcel" v-has-permission="['brand:import']">
|
||||||
|
{{ $t("table.import") }}
|
||||||
|
</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</div>
|
||||||
|
<el-tree
|
||||||
|
:check-strictly="true"
|
||||||
|
:data="brandTree"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
@node-click="nodeClick"
|
||||||
|
:load="loadTree"
|
||||||
|
highlight-current
|
||||||
|
node-key="id"
|
||||||
|
ref="brandTree"
|
||||||
|
:lazy="true"
|
||||||
|
show-checkbox/>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :sm="12" :xs="24">
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div class="clearfix" slot="header">
|
||||||
|
<span>
|
||||||
|
{{brand.id === "" ? this.$t("common.add") : this.$t("common.edit")}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-form :model="brand" :rules="rules" label-position="right" label-width="100px" ref="form">
|
||||||
|
<el-form-item :hidden="true" :label="$t('table.brand.parentId')" prop="parentId">
|
||||||
|
<el-tooltip :content="$t('tips.topId')" class="item" effect="dark" placement="top-start">
|
||||||
|
<el-input readonly v-model="brand.parentId"/>
|
||||||
|
</el-tooltip>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.parentId')" prop="parentLabel">
|
||||||
|
<el-input readonly disabled="disabled" v-model="brand.parentLabel"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.label')" prop="label">
|
||||||
|
<el-input v-model="brand.label"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.name')" prop="name">
|
||||||
|
<el-input type="" v-model="brand.name" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.image')" prop="image">
|
||||||
|
<el-input type="" v-model="brand.image" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.video')" prop="video">
|
||||||
|
<el-input type="" v-model="brand.video" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.desc')" prop="desc">
|
||||||
|
<el-input type="" v-model="brand.desc" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.content')" prop="content">
|
||||||
|
<el-input type="" v-model="brand.content" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.sort')" prop="sort">
|
||||||
|
<el-input type="" v-model="brand.sort" placeholder=""/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('table.brand.sortValue')" prop="sortValue">
|
||||||
|
<el-input-number :max="100" :min="0" @change="handleNumChange" v-model="brand.sortValue"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="box-card" style="margin-top: -2rem;">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24" style="text-align: right">
|
||||||
|
<el-button @click="submit" plain type="primary">
|
||||||
|
{{brand.id === "" ? this.$t("common.add") : this.$t("common.edit") }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<brand-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||||
|
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||||
|
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
||||||
|
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
||||||
|
<el-scrollbar>
|
||||||
|
<div v-html="preview.context"></div>
|
||||||
|
</el-scrollbar>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import brandApi from "@/api/Brand.js";
|
||||||
|
import elDragDialog from '@/directive/el-drag-dialog'
|
||||||
|
import BrandImport from "@/components/zsw/Import"
|
||||||
|
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BrandManager",
|
||||||
|
directives: { elDragDialog },
|
||||||
|
components: { BrandImport },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
label: "",
|
||||||
|
brandTree: [],
|
||||||
|
brand: this.initBrand(),
|
||||||
|
rules: {
|
||||||
|
|
||||||
|
},
|
||||||
|
// 预览
|
||||||
|
preview: {
|
||||||
|
isVisible: false,
|
||||||
|
context: ''
|
||||||
|
},
|
||||||
|
// 导入
|
||||||
|
fileImport: {
|
||||||
|
isVisible: false,
|
||||||
|
type: "import",
|
||||||
|
action: `${process.env.VUE_APP_BASE_API}/brand/brand/import`
|
||||||
|
},
|
||||||
|
// 枚举
|
||||||
|
enums: {
|
||||||
|
},
|
||||||
|
// 字典
|
||||||
|
dicts: {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 初始化字典和枚举
|
||||||
|
const enumList = [];
|
||||||
|
const dictList = [];
|
||||||
|
loadEnums(enumList, this.enums, 'brand');
|
||||||
|
initDicts(dictList, this.dicts);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initBrand() {
|
||||||
|
return {
|
||||||
|
id: "",
|
||||||
|
label: "",
|
||||||
|
sortValue: 0,
|
||||||
|
parentId: 0,
|
||||||
|
parentLabel: "",
|
||||||
|
name: '',
|
||||||
|
image: '',
|
||||||
|
video: '',
|
||||||
|
desc: '',
|
||||||
|
content: '',
|
||||||
|
sort: null,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
initBrandTree(parentId = 0) {
|
||||||
|
brandApi.query({parentId: parentId}).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
this.brandTree = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadTree(node, resolve) {
|
||||||
|
brandApi.query({parentId: node.data.id ? node.data.id : 0}).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
resolve(res.data);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
exportExcelPreview() {
|
||||||
|
const queryParams = initQueryParams();
|
||||||
|
queryParams.map.fileName = '导出数据';
|
||||||
|
brandApi.preview(queryParams).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
this.preview.isVisible = true;
|
||||||
|
this.preview.context = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
exportExcel() {
|
||||||
|
const queryParams = initQueryParams();
|
||||||
|
queryParams.map.fileName = '导出数据';
|
||||||
|
brandApi.export(queryParams).then(response => {
|
||||||
|
downloadFile(response);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
importExcel() {
|
||||||
|
this.fileImport.type = "upload";
|
||||||
|
this.fileImport.isVisible = true;
|
||||||
|
this.$refs.import.setModel(false);
|
||||||
|
},
|
||||||
|
importSuccess() {
|
||||||
|
this.initBrandTree(0);
|
||||||
|
},
|
||||||
|
importClose() {
|
||||||
|
this.fileImport.isVisible = false;
|
||||||
|
},
|
||||||
|
handleNumChange(val) {
|
||||||
|
this.brand.sortValue = val;
|
||||||
|
},
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.label.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
nodeClick(val) {
|
||||||
|
const vm = this;
|
||||||
|
if(val){
|
||||||
|
this.brand = {...val};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const parent = this.$refs.brandTree.getNode(val.parentId);
|
||||||
|
if (parent) {
|
||||||
|
this.brand.parentLabel = parent.label;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$refs.form.clearValidate();
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.resetForm();
|
||||||
|
const checked = this.$refs.brandTree.getCheckedNodes();
|
||||||
|
if (checked.length > 1) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.onlyChooseOne"),
|
||||||
|
type: "warning"
|
||||||
|
});
|
||||||
|
} else if (checked.length > 0) {
|
||||||
|
this.brand.parentId = checked[0].id;
|
||||||
|
this.brand.parentLabel = checked[0].label;
|
||||||
|
} else {
|
||||||
|
this.brand.parentId = 0;
|
||||||
|
this.brand.parentLabel = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
batchDelete() {
|
||||||
|
const checked = this.$refs.brandTree.getCheckedKeys();
|
||||||
|
if (checked.length === 0) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.noNodeSelected"),
|
||||||
|
type: "warning"
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$confirm(this.$t("tips.confirmDeleteNode"), this.$t("common.tips"), {
|
||||||
|
confirmButtonText: this.$t("common.confirm"),
|
||||||
|
cancelButtonText: this.$t("common.cancel"),
|
||||||
|
type: "warning"
|
||||||
|
}).then(() => {
|
||||||
|
brandApi.delete({ids: checked}).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.deleteSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.reset();
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
this.$refs.brandTree.setCheckedKeys([]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.$refs.brandTree.filter(this.label);
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.initBrandTree();
|
||||||
|
this.label = "";
|
||||||
|
this.resetForm();
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs.form.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.brand.id) {
|
||||||
|
this.update();
|
||||||
|
} else {
|
||||||
|
this.save();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
brandApi.save({...this.brand}).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.createSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
this.reset();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
update() {
|
||||||
|
brandApi.update({...this.brand}).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.$message({
|
||||||
|
message: this.$t("tips.updateSuccess"),
|
||||||
|
type: "success"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.reset();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
resetForm() {
|
||||||
|
this.$refs.form.clearValidate();
|
||||||
|
this.$refs.form.resetFields();
|
||||||
|
this.brand = this.initBrand();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.brand {
|
||||||
|
margin: 10px;
|
||||||
|
|
||||||
|
.app-container {
|
||||||
|
margin: 0 0 10px 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-card.is-always-shadow {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-card {
|
||||||
|
border-radius: 0;
|
||||||
|
border: none;
|
||||||
|
|
||||||
|
.el-card__header {
|
||||||
|
padding: 10px 20px !important;
|
||||||
|
border-bottom: 1px solid #f1f1f1 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -20,11 +20,19 @@
|
|||||||
:label="$t('table.creditGoods.categoryId')"
|
:label="$t('table.creditGoods.categoryId')"
|
||||||
prop="categoryId"
|
prop="categoryId"
|
||||||
>
|
>
|
||||||
<el-input
|
<!-- <el-input
|
||||||
type=""
|
type=""
|
||||||
v-model="creditGoods.categoryId"
|
v-model="creditGoods.categoryId"
|
||||||
placeholder="分类ID"
|
placeholder="分类ID"
|
||||||
/>
|
/> -->
|
||||||
|
<el-select v-model="creditGoods.categoryId" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in classification.records"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.creditGoods.name')" prop="name">
|
<el-form-item :label="$t('table.creditGoods.name')" prop="name">
|
||||||
<el-input type="" v-model="creditGoods.name" placeholder="商品名" />
|
<el-input type="" v-model="creditGoods.name" placeholder="商品名" />
|
||||||
@@ -209,6 +217,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'add',
|
default: 'add',
|
||||||
},
|
},
|
||||||
|
classification:{
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -174,7 +174,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
||||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
||||||
<creditGoods-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
<creditGoods-edit :dialog-visible="dialog.isVisible" :type="dialog.type" :classification="classification"
|
||||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
@close="editClose" @success="editSuccess" ref="edit"/>
|
||||||
<creditGoods-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
<creditGoods-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
||||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
||||||
@@ -195,7 +195,7 @@ import creditGoodsApi from "@/api/creditGoods/CreditGoods.js";
|
|||||||
import CreditGoodsImport from "@/components/ceres/Import"
|
import CreditGoodsImport from "@/components/ceres/Import"
|
||||||
import {convertEnum} from '@/utils/utils'
|
import {convertEnum} from '@/utils/utils'
|
||||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
||||||
|
import creditGoodsCategoryApi from "@/api/creditGoods/CreditGoodsCategory.js";
|
||||||
export default {
|
export default {
|
||||||
name: "CreditGoodsManage",
|
name: "CreditGoodsManage",
|
||||||
directives: { elDragDialog },
|
directives: { elDragDialog },
|
||||||
@@ -234,7 +234,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 字典
|
// 字典
|
||||||
dicts: {
|
dicts: {
|
||||||
}
|
},
|
||||||
|
classification:{}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -243,7 +244,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetch();
|
this.fetch();
|
||||||
|
this.getclassification()
|
||||||
// 初始化字典和枚举
|
// 初始化字典和枚举
|
||||||
const enumList = [];
|
const enumList = [];
|
||||||
const dictList = [];
|
const dictList = [];
|
||||||
@@ -251,6 +252,22 @@ export default {
|
|||||||
initDicts(dictList, this.dicts);
|
initDicts(dictList, this.dicts);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//商品分类
|
||||||
|
getclassification() {
|
||||||
|
this.loading = true;
|
||||||
|
let queryParams = {
|
||||||
|
current: 1,
|
||||||
|
size: 999,
|
||||||
|
model: {}
|
||||||
|
}
|
||||||
|
creditGoodsCategoryApi.page(queryParams).then(response => {
|
||||||
|
const res = response.data;
|
||||||
|
if (res.isSuccess) {
|
||||||
|
this.classification = res.data;
|
||||||
|
console.log(this.classification,"this.classification")
|
||||||
|
}
|
||||||
|
}).finally(() => this.loading = false);
|
||||||
|
},
|
||||||
editClose() {
|
editClose() {
|
||||||
this.dialog.isVisible = false;
|
this.dialog.isVisible = false;
|
||||||
},
|
},
|
||||||
|
|||||||
+236
-149
@@ -1,210 +1,297 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true" :title="title" :type="type"
|
<el-dialog
|
||||||
:visible.sync="isVisible" :width="width" top="50px" v-el-drag-dialog>
|
:close-on-click-modal="false"
|
||||||
<el-form :model="information" :rules="rules" label-position="right" label-width="100px" ref="form">
|
:title="title"
|
||||||
<el-form-item :label="$t('table.information.storeId')" prop="storeId">
|
:type="type"
|
||||||
<el-input type="" v-model="information.storeId" placeholder="店铺ID"/>
|
:visible.sync="isVisible"
|
||||||
|
width="800px"
|
||||||
|
top="50px"
|
||||||
|
class="group-dialog"
|
||||||
|
>
|
||||||
|
<el-form :model="params" label-width="100px" :rules="rules" ref="params">
|
||||||
|
<el-form-item label="活动标题" prop="mainTitle">
|
||||||
|
<el-input v-model="params.mainTitle" style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.information.mainTitle')" prop="mainTitle">
|
<el-form-item label="活动简介" prop="viceTitle">
|
||||||
<el-input type="" v-model="information.mainTitle" placeholder="主标题"/>
|
<el-input v-model="params.viceTitle" style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.information.viceTitle')" prop="viceTitle">
|
<el-form-item label="作者" prop="name">
|
||||||
<el-input type="" v-model="information.viceTitle" placeholder="副标题"/>
|
<el-input v-model="params.name" style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.information.content')" prop="content">
|
<el-form-item label="作者头像" prop="avatar">
|
||||||
<el-input type="" v-model="information.content" placeholder="内容"/>
|
<!-- <el-input v-model="params.author.avatar" style="width: 200px" /> -->
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:action="action"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-success="handleAvatarSuccessAvatar"
|
||||||
|
>
|
||||||
|
<!-- <img
|
||||||
|
v-if="params.avatar"
|
||||||
|
:src="params.avatar"
|
||||||
|
class="avatar"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
/> -->
|
||||||
|
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
||||||
|
<el-button size="small" type="primary"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
</el-upload>
|
||||||
|
<img
|
||||||
|
style="margin-top:5px"
|
||||||
|
v-if="params.avatar"
|
||||||
|
:src="params.avatar"
|
||||||
|
class="avatar"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.information.coverImg')" prop="coverImg">
|
<el-form-item label="活动封面图" prop="coverImg">
|
||||||
<el-input type="" v-model="information.coverImg" placeholder="封面图"/>
|
<!-- <el-input v-model="params.coverImg" style="width: 200px" /> -->
|
||||||
|
<el-upload
|
||||||
|
class="avatar-uploader"
|
||||||
|
:headers="headers"
|
||||||
|
:data="dataObj"
|
||||||
|
:action="action"
|
||||||
|
:show-file-list="false"
|
||||||
|
:on-success="handleAvatarSuccess"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
|
||||||
|
<el-button size="small" type="primary"
|
||||||
|
>点击上传</el-button
|
||||||
|
>
|
||||||
|
</el-upload>
|
||||||
|
<img
|
||||||
|
style="margin-top:5px"
|
||||||
|
v-if="params.coverImg"
|
||||||
|
:src="params.coverImg"
|
||||||
|
class="avatar"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.information.startTime')" prop="startTime">
|
<el-form-item label="开始时间" prop="startTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="information.startTime"
|
v-model="params.startTime"
|
||||||
placeholder="开始时间"
|
type="datetime"
|
||||||
:start-placeholder="$t('table.information.startTime')"
|
placeholder="选择日期时间"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
>
|
||||||
class="filter-item date-range-item"
|
</el-date-picker>
|
||||||
type="datetime"/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.information.endTime')" prop="endTime">
|
<el-form-item label="结束时间" prop="endTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="information.endTime"
|
v-model="params.endTime"
|
||||||
placeholder="结束时间"
|
type="datetime"
|
||||||
:start-placeholder="$t('table.information.endTime')"
|
placeholder="选择日期时间"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
>
|
||||||
class="filter-item date-range-item"
|
</el-date-picker>
|
||||||
type="datetime"/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('table.information.state')" prop="state">
|
<el-form-item label="富文本" prop="content">
|
||||||
<el-input type="" v-model="information.state" placeholder="状态:1-上架,0-下架"/>
|
<Tinymce ref="content" v-if="isVisible" v-model="params.content" :height="200" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :label="$t('table.information.isDelete')" prop="isDelete">
|
|
||||||
<el-input type="" v-model="information.isDelete" placeholder="逻辑删除:1-删除 0-未删除"/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="是否上架" prop="state">
|
||||||
|
<el-radio-group v-model="params.state" size="medium">
|
||||||
|
<el-radio-button :label="0">{{
|
||||||
|
$t('common.yes')
|
||||||
|
}}</el-radio-button>
|
||||||
|
<el-radio-button :label="1">{{
|
||||||
|
$t('common.no')
|
||||||
|
}}</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item> -->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="dialog-footer" slot="footer">
|
<div class="dialog-footer" slot="footer">
|
||||||
<el-button @click="isVisible = false" plain type="warning">
|
<el-button @click="isVisible = false" plain type="warning">
|
||||||
{{ $t("common.cancel") }}
|
{{ $t('common.cancel') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="submitForm" :disabled="confirmDisabled" plain type="primary">
|
<el-button
|
||||||
{{ $t("common.confirm") }}
|
@click="submitForm('params')"
|
||||||
|
plain
|
||||||
|
type="primary"
|
||||||
|
>
|
||||||
|
{{ $t('common.confirm') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import elDragDialog from '@/directive/el-drag-dialog'
|
import db from '@/utils/localstorage'
|
||||||
import informationApi from "@/api/InformationApi.js";
|
import ActivityTweets from '@/api/ActivityTweets'
|
||||||
|
import Tinymce from '@/components/Tinymce'
|
||||||
|
// import moment from 'moment'
|
||||||
export default {
|
export default {
|
||||||
name: "InformationEdit",
|
components:{
|
||||||
directives: { elDragDialog },
|
Tinymce
|
||||||
components: { },
|
},
|
||||||
props: {
|
props: {
|
||||||
dialogVisible: {
|
dialogVisible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false,
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "add"
|
default: 'add',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
confirmDisabled: false,
|
options: [],
|
||||||
information: this.initInformation(),
|
sizeForm: {},
|
||||||
screenWidth: 0,
|
headers: {
|
||||||
width: this.initWidth(),
|
Authorization: '',
|
||||||
|
},
|
||||||
|
action: `${process.env.VUE_APP_DEV_REQUEST_DOMAIN_PREFIX}/file/upload`,
|
||||||
|
dataObj: {
|
||||||
|
folderId: 1,
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
id: '',
|
||||||
|
mainTitle: '',
|
||||||
|
viceTitle: 1,
|
||||||
|
coverImg: '',
|
||||||
|
startTime: '',
|
||||||
|
endTime: '',
|
||||||
|
content: '',
|
||||||
|
name: '',
|
||||||
|
avatar: ''
|
||||||
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
groupName: [{ required: true, message: '不可为空', trigger: 'blur' }],
|
||||||
},
|
},
|
||||||
// 枚举
|
|
||||||
enums: {
|
|
||||||
},
|
|
||||||
// 字典
|
|
||||||
dicts: {
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isVisible: {
|
isVisible: {
|
||||||
get() {
|
get() {
|
||||||
return this.dialogVisible;
|
return this.dialogVisible
|
||||||
},
|
},
|
||||||
set() {
|
set() {
|
||||||
this.close();
|
this.close()
|
||||||
this.reset();
|
this.reset()
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
title() {
|
title() {
|
||||||
return this.$t("common." + this.type);
|
return this.type === 'add' ? '新建活动' : '查看活动'
|
||||||
}
|
|
||||||
},
|
},
|
||||||
watch: {},
|
},
|
||||||
mounted() {
|
created() {
|
||||||
window.onresize = () => {
|
this.headers.token = 'Bearer ' + db.get('TOKEN', '')
|
||||||
return (() => {
|
this.headers.tenant = db.get('TENANT')
|
||||||
this.width = this.initWidth();
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initInformation() {
|
|
||||||
return {
|
|
||||||
id: "",
|
|
||||||
storeId: null,
|
|
||||||
mainTitle: '',
|
|
||||||
viceTitle: '',
|
|
||||||
content: '',
|
|
||||||
coverImg: '',
|
|
||||||
startTime: null,
|
|
||||||
endTime: null,
|
|
||||||
state: null,
|
|
||||||
isDelete: null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
initWidth() {
|
|
||||||
this.screenWidth = document.body.clientWidth;
|
|
||||||
if (this.screenWidth < 991) {
|
|
||||||
return "90%";
|
|
||||||
} else if (this.screenWidth < 1400) {
|
|
||||||
return "45%";
|
|
||||||
} else {
|
|
||||||
return "800px";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setInformation(val = {}) {
|
|
||||||
const vm = this;
|
|
||||||
|
|
||||||
vm.dicts = val['dicts'];
|
|
||||||
vm.enums = val['enums'];
|
|
||||||
if (val['row']) {
|
|
||||||
vm.information = { ...val['row'] };
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
close() {
|
close() {
|
||||||
this.$emit("close");
|
this.$emit('close')
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
// 先清除校验,再清除表单,不然有奇怪的bug
|
this.params = {}
|
||||||
this.$refs.form.clearValidate();
|
|
||||||
this.$refs.form.resetFields();
|
|
||||||
this.confirmDisabled = false;
|
|
||||||
this.information = this.initInformation();
|
|
||||||
},
|
},
|
||||||
submitForm() {
|
async submitForm(params) {
|
||||||
const vm = this;
|
this.$refs[params].validate((valid) => {
|
||||||
this.$refs.form.validate(valid => {
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
vm.editSubmit();
|
if (this.type === 'add') {
|
||||||
|
this.addGroup()
|
||||||
|
} else if (this.type === 'edit') {
|
||||||
|
this.updateGroup()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return false;
|
// console.log(false+'123')
|
||||||
|
// if(
|
||||||
|
// !this.params.groupName ||
|
||||||
|
// !this.params.printerId ){
|
||||||
|
// this.$message.warning("请填写完整商品信息!");
|
||||||
|
// }else{
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
editSubmit() {
|
async addGroup() {
|
||||||
const vm = this;
|
// this.params.startTime = moment(this.params.startTime).format('YYYY-MM-DD HH:mm:ss')
|
||||||
if (vm.type === "edit") {
|
// this.params.endTime = moment(this.params.endTime).format('YYYY-MM-DD HH:mm:ss')
|
||||||
vm.update();
|
this.params.type = 2
|
||||||
} else {
|
let data = {
|
||||||
vm.save();
|
name: this.params.name,
|
||||||
|
avatar: this.params.avatar
|
||||||
|
}
|
||||||
|
this.params.author = JSON.stringify(data)
|
||||||
|
// console.log(this.params, '商品')
|
||||||
|
const res = await ActivityTweets.save(this.params)
|
||||||
|
// console.log(res, 'resxinz')
|
||||||
|
const resData = res.data
|
||||||
|
const { code } = resData
|
||||||
|
if (code === 0) {
|
||||||
|
this.isVisible = false
|
||||||
|
this.$message({
|
||||||
|
message: this.$t('tips.createSuccess'),
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.$emit('success')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
save() {
|
async updateGroup() {
|
||||||
const vm = this;
|
let data = {
|
||||||
vm.confirmDisabled = true;
|
name: this.params.name,
|
||||||
informationApi.save(this.information).then(response => {
|
avatar: this.params.avatar
|
||||||
const res = response.data;
|
}
|
||||||
if (res.isSuccess) {
|
this.params.author = JSON.stringify(data)
|
||||||
vm.isVisible = false;
|
// this.params.startTime = moment(this.params.startTime).format('YYYY-MM-DD HH:mm:ss')
|
||||||
vm.$message({
|
// this.params.endTime = moment(this.params.endTime).format('YYYY-MM-DD HH:mm:ss')
|
||||||
message: vm.$t("tips.createSuccess"),
|
this.params.type = 2
|
||||||
type: "success"
|
const res = await ActivityTweets.update(this.params)
|
||||||
});
|
const resData = res.data
|
||||||
vm.$emit("success");
|
const { code } = resData
|
||||||
|
if (code === 0) {
|
||||||
|
this.isVisible = false
|
||||||
|
this.$message({
|
||||||
|
message: this.$t('tips.updateSuccess'),
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
this.$emit('success')
|
||||||
}
|
}
|
||||||
}).finally(()=> vm.confirmDisabled = false);
|
|
||||||
},
|
},
|
||||||
update() {
|
handleAvatarSuccess(response) {
|
||||||
const vm = this;
|
const { url } = response.data
|
||||||
vm.confirmDisabled = true;
|
this.params.coverImg = url
|
||||||
informationApi.update(this.information).then(response => {
|
},
|
||||||
const res = response.data;
|
handleAvatarSuccessAvatar(response) {
|
||||||
if (res.isSuccess) {
|
const { url } = response.data
|
||||||
vm.isVisible = false;
|
this.params.avatar = url
|
||||||
vm.$message({
|
},
|
||||||
message: this.$t("tips.updateSuccess"),
|
setParams(val = {}) {
|
||||||
type: "success"
|
this.params = {}
|
||||||
});
|
if(val) {
|
||||||
vm.$emit("success");
|
this.params = JSON.parse(JSON.stringify(val))
|
||||||
|
this.params.name = JSON.parse(this.params.author).name
|
||||||
|
this.params.avatar = JSON.parse(this.params.author).avatar
|
||||||
}
|
}
|
||||||
}).finally(()=> vm.confirmDisabled = false);
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="less" scoped>
|
||||||
|
.group-dialog {
|
||||||
|
.upload-wrap {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
.image-wrap {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
line-height: 120px;
|
||||||
|
margin-right: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px dashed #d9d9d9;
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
+182
-325
@@ -1,370 +1,227 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="group-page">
|
||||||
<div class="filter-container">
|
<div class="toolbar">
|
||||||
<el-input
|
<el-button
|
||||||
:placeholder="$t('table.information.mainTitle')"
|
type="primary"
|
||||||
class="filter-item search-item"
|
size="mini"
|
||||||
v-model="queryParams.model.mainTitle"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<el-date-picker :range-separator="null" class="filter-item search-item date-range-item"
|
@click="getActivityTweetsList"
|
||||||
end-placeholder="结束日期" format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
|
icon="el-icon-zoom-in"
|
||||||
type="daterange" v-model="queryParams.timeRange" value-format="yyyy-MM-dd HH:mm:ss"
|
>
|
||||||
/>
|
查询
|
||||||
<el-button @click="search" class="filter-item" plain type="primary">
|
|
||||||
{{ $t("table.search") }}
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="reset" class="filter-item" plain type="warning">
|
<el-button type="warning" size="mini" @click="reset" icon="el-icon-refresh-right">
|
||||||
{{ $t("table.reset") }}
|
重置
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button @click="add" class="filter-item" plain type="danger" v-has-permission="['information:add']">
|
<el-button
|
||||||
{{ $t("table.add") }}
|
type="goon"
|
||||||
|
size="mini"
|
||||||
|
@click="addGroup"
|
||||||
|
icon="el-icon-circle-plus-outline"
|
||||||
|
>
|
||||||
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dropdown class="filter-item" trigger="click" v-has-any-permission="['information:delete', 'information:export',
|
|
||||||
'information:import']">
|
|
||||||
<el-button>
|
|
||||||
{{ $t("table.more") }}<i class="el-icon-arrow-down el-icon--right" />
|
|
||||||
</el-button>
|
|
||||||
<el-dropdown-menu slot="dropdown">
|
|
||||||
<el-dropdown-item @click.native="batchDelete" v-has-permission="['information:delete']">
|
|
||||||
{{ $t("table.delete") }}
|
|
||||||
</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click.native="exportExcel" v-has-permission="['information:export']">
|
|
||||||
{{ $t("table.export") }}
|
|
||||||
</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click.native="exportExcelPreview" v-has-permission="['information:export']">
|
|
||||||
{{ $t("table.exportPreview") }}
|
|
||||||
</el-dropdown-item>
|
|
||||||
<el-dropdown-item @click.native="importExcel" v-has-permission="['information:import']">
|
|
||||||
{{ $t("table.import") }}
|
|
||||||
</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="group-content">
|
||||||
<el-table :data="tableData.records" :key="tableKey" @cell-click="cellClick"
|
<el-table
|
||||||
@filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
|
id="tables"
|
||||||
border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading">
|
:data="tableData.list"
|
||||||
<el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
|
style="width: 100%"
|
||||||
<el-table-column :label="$t('table.information.storeId')" :show-overflow-tooltip="true" align="center" prop="storeId"
|
v-loading="loading"
|
||||||
width="">
|
row-key="id"
|
||||||
<template slot-scope="scope">
|
>
|
||||||
<span>{{ scope.row.storeId }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.mainTitle')" :show-overflow-tooltip="true" align="center" prop="mainTitle"
|
|
||||||
width="">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.mainTitle }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.viceTitle')" :show-overflow-tooltip="true" align="center" prop="viceTitle"
|
|
||||||
width="">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.viceTitle }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.content')" :show-overflow-tooltip="true" align="center" prop="content"
|
|
||||||
width="">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.content }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.coverImg')" :show-overflow-tooltip="true" align="center" prop="coverImg"
|
|
||||||
width="">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.coverImg }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.startTime')" :show-overflow-tooltip="true" align="center" prop="startTime"
|
|
||||||
width="170">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.startTime }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.endTime')" :show-overflow-tooltip="true" align="center" prop="endTime"
|
|
||||||
width="170">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.endTime }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.state')" :show-overflow-tooltip="true" align="center" prop="state"
|
|
||||||
width="">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.state }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column :label="$t('table.information.isDelete')" :show-overflow-tooltip="true" align="center" prop="isDelete"
|
|
||||||
width="">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.isDelete }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('table.createTime')"
|
prop="mainTitle"
|
||||||
|
label="活动标题"
|
||||||
align="center"
|
align="center"
|
||||||
prop="createTime"
|
width="200"
|
||||||
sortable="custom"
|
></el-table-column>
|
||||||
width="170px">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.createTime }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
:label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width" width="100px">
|
prop="viceTitle"
|
||||||
<template slot-scope="{ row }">
|
label="活动简介"
|
||||||
<i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
|
align="center"
|
||||||
style="color: #2db7f5;" v-hasPermission="['information:add']"/>
|
width="200"
|
||||||
<i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
|
></el-table-column>
|
||||||
style="color: #2db7f5;" v-hasPermission="['information:update']"/>
|
<!-- <el-table-column
|
||||||
<i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
|
prop="coverImg"
|
||||||
style="color: #f50;" v-hasPermission="['information:delete']"/>
|
label="活动封面图"
|
||||||
<el-link class="no-perm" v-has-no-permission="['information:update', 'information:copy', 'information:delete']">
|
align="center"
|
||||||
{{ $t("tips.noPermission") }}
|
width="200"
|
||||||
</el-link>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img
|
||||||
|
v-if="scope.row.coverImg"
|
||||||
|
:src="scope.row.coverImg"
|
||||||
|
class="avatar"
|
||||||
|
width="80"
|
||||||
|
height="80"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column
|
||||||
|
prop="createTime"
|
||||||
|
label="发布时间"
|
||||||
|
align="center"
|
||||||
|
width="200"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="storeName"
|
||||||
|
label="发布人(平台)"
|
||||||
|
align="center"
|
||||||
|
width="200"
|
||||||
|
></el-table-column>
|
||||||
|
<!-- <el-table-column
|
||||||
|
prop="updateTime"
|
||||||
|
label="最后修改时间"
|
||||||
|
align="center"
|
||||||
|
width="200"
|
||||||
|
></el-table-column> -->
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.prevent="editGroup(scope.row)"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click.native.prevent="deleteGroup(scope.row)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
|
</div>
|
||||||
:total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
|
<pagination
|
||||||
<information-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
|
v-show="tableData.total > 0"
|
||||||
@close="editClose" @success="editSuccess" ref="edit"/>
|
:limit.sync="formParams.pageSize"
|
||||||
<information-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
|
:page.sync="formParams.pageNum"
|
||||||
:action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess" />
|
:total="Number(tableData.total)"
|
||||||
<el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
|
@pagination="fetch"
|
||||||
title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
|
/>
|
||||||
<el-scrollbar>
|
<grope-edit
|
||||||
<div v-html="preview.context"></div>
|
ref="edit"
|
||||||
</el-scrollbar>
|
:dialog-visible="dialog.isVisible"
|
||||||
</el-dialog>
|
:type="dialog.type"
|
||||||
|
@close="editClose"
|
||||||
|
@success="getActivityTweetsList"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Pagination from "@/components/Pagination";
|
import ActivityTweets from '@/api/ActivityTweets'
|
||||||
import elDragDialog from '@/directive/el-drag-dialog'
|
import GropeEdit from './Edit'
|
||||||
import InformationEdit from "./Edit";
|
import Pagination from '@/components/Pagination'
|
||||||
import informationApi from "@/api/InformationApi.js";
|
import db from '@/utils/localstorage'
|
||||||
import InformationImport from "@/components/ceres/Import"
|
|
||||||
import {convertEnum} from '@/utils/utils'
|
|
||||||
import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "InformationManage",
|
name: 'ActivityTweets',
|
||||||
directives: { elDragDialog },
|
components: {
|
||||||
components: { Pagination, InformationEdit, InformationImport},
|
GropeEdit,
|
||||||
filters: {
|
Pagination,
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 编辑
|
loading: true,
|
||||||
|
formParams: {
|
||||||
|
"pageNum": 1,
|
||||||
|
"pageSize": 10,
|
||||||
|
"searchKey": "",
|
||||||
|
"type": 2,
|
||||||
|
state: 1
|
||||||
|
},
|
||||||
dialog: {
|
dialog: {
|
||||||
|
type: 'add',
|
||||||
isVisible: false,
|
isVisible: false,
|
||||||
type: "add"
|
|
||||||
},
|
},
|
||||||
// 预览
|
tableData: [],
|
||||||
preview: {
|
|
||||||
isVisible: false,
|
|
||||||
context: ''
|
|
||||||
},
|
|
||||||
// 导入
|
|
||||||
fileImport: {
|
|
||||||
isVisible: false,
|
|
||||||
type: "import",
|
|
||||||
action: `${process.env.VUE_APP_BASE_API}/store/information/import`
|
|
||||||
},
|
|
||||||
tableKey: 0,
|
|
||||||
queryParams: initQueryParams(),
|
|
||||||
selection: [],
|
|
||||||
loading: false,
|
|
||||||
tableData: {
|
|
||||||
total: 0
|
|
||||||
},
|
|
||||||
// 枚举
|
|
||||||
enums: {
|
|
||||||
},
|
|
||||||
// 字典
|
|
||||||
dicts: {
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
},
|
},
|
||||||
computed: {
|
created() {
|
||||||
},
|
this.getActivityTweetsList()
|
||||||
watch: {
|
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
this.fetch();
|
|
||||||
|
|
||||||
// 初始化字典和枚举
|
|
||||||
const enumList = [];
|
|
||||||
const dictList = [];
|
|
||||||
loadEnums(enumList, this.enums, 'store');
|
|
||||||
initDicts(dictList, this.dicts);
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
editClose() {
|
async getActivityTweetsList() {
|
||||||
this.dialog.isVisible = false;
|
this.loading = true
|
||||||
|
const res = await ActivityTweets.page(this.formParams)
|
||||||
|
const resData = res.data
|
||||||
|
const { code } = resData
|
||||||
|
if (code === 0) {
|
||||||
|
this.tableData = resData.data
|
||||||
|
this.loading = false
|
||||||
|
console.log(this.tableData,'this.tableData')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
editSuccess() {
|
fetch() {
|
||||||
this.search();
|
this.getActivityTweetsList()
|
||||||
},
|
|
||||||
onSelectChange(selection) {
|
|
||||||
this.selection = selection;
|
|
||||||
},
|
|
||||||
search() {
|
|
||||||
this.fetch({
|
|
||||||
...this.queryParams
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
reset() {
|
reset() {
|
||||||
this.queryParams = initQueryParams();
|
this.getActivityTweetsList()
|
||||||
this.$refs.table.clearSort();
|
|
||||||
this.$refs.table.clearFilter();
|
|
||||||
this.search();
|
|
||||||
},
|
},
|
||||||
exportExcelPreview() {
|
addGroup() {
|
||||||
if (this.queryParams.timeRange) {
|
this.dialog = {
|
||||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
type: 'add',
|
||||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
isVisible: true,
|
||||||
}
|
}
|
||||||
this.queryParams.map.fileName = '导出数据';
|
this.$refs.edit.setParams(null)
|
||||||
informationApi.preview(this.queryParams).then(response => {
|
|
||||||
const res = response.data;
|
|
||||||
this.preview.isVisible = true;
|
|
||||||
this.preview.context = res.data;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
exportExcel() {
|
editClose() {
|
||||||
if (this.queryParams.timeRange) {
|
this.dialog.isVisible = false
|
||||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
},
|
||||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
editGroup(row) {
|
||||||
|
const {id, mainTitle, viceTitle, coverImg, startTime, endTime, content, state} = row
|
||||||
|
this.dialog = {
|
||||||
|
type: 'edit',
|
||||||
|
isVisible: true,
|
||||||
}
|
}
|
||||||
this.queryParams.map.fileName = '导出数据';
|
this.$refs.edit.setParams(row)
|
||||||
informationApi.export(this.queryParams).then(response => {
|
|
||||||
downloadFile(response);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
importExcel() {
|
async delete(params) {
|
||||||
this.fileImport.type = "upload";
|
const res = await ActivityTweets.delete(params)
|
||||||
this.fileImport.isVisible = true;
|
const resData = res.data
|
||||||
this.$refs.import.setModel(false);
|
const { code } = resData
|
||||||
},
|
if (code === 0) {
|
||||||
importSuccess() {
|
|
||||||
this.search();
|
|
||||||
},
|
|
||||||
importClose() {
|
|
||||||
this.fileImport.isVisible = false;
|
|
||||||
},
|
|
||||||
singleDelete(row) {
|
|
||||||
this.$refs.table.clearSelection()
|
|
||||||
this.$refs.table.toggleRowSelection(row, true);
|
|
||||||
this.batchDelete();
|
|
||||||
},
|
|
||||||
batchDelete() {
|
|
||||||
if (!this.selection.length) {
|
|
||||||
this.$message({
|
this.$message({
|
||||||
message: this.$t("tips.noDataSelected"),
|
message: this.$t('tips.deleteSuccess'),
|
||||||
type: "warning"
|
type: 'success',
|
||||||
});
|
})
|
||||||
return;
|
this.getActivityTweetsList()
|
||||||
}
|
}
|
||||||
this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
|
},
|
||||||
confirmButtonText: this.$t("common.confirm"),
|
deleteGroup(row) {
|
||||||
cancelButtonText: this.$t("common.cancel"),
|
const { id } = row
|
||||||
type: "warning"
|
this.$confirm(this.$t('tips.confirmDelete'), this.$t('common.tips'), {
|
||||||
|
confirmButtonText: this.$t('common.confirm'),
|
||||||
|
cancelButtonText: this.$t('common.cancel'),
|
||||||
|
type: 'warning',
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const ids = this.selection.map(u => u.id);
|
this.delete({
|
||||||
this.delete(ids);
|
id,
|
||||||
})
|
})
|
||||||
.catch(() => {
|
|
||||||
this.clearSelections();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
clearSelections() {
|
|
||||||
this.$refs.table.clearSelection();
|
|
||||||
},
|
|
||||||
delete(ids) {
|
|
||||||
informationApi.delete({ ids: ids }).then(response => {
|
|
||||||
const res = response.data;
|
|
||||||
if (res.isSuccess) {
|
|
||||||
this.$message({
|
|
||||||
message: this.$t("tips.deleteSuccess"),
|
|
||||||
type: "success"
|
|
||||||
});
|
|
||||||
this.search();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
add() {
|
|
||||||
this.dialog.type = "add";
|
|
||||||
this.dialog.isVisible = true;
|
|
||||||
this.$refs.edit.setInformation({ enums: this.enums, dicts: this.dicts});
|
|
||||||
},
|
|
||||||
copy(row) {
|
|
||||||
this.$refs.edit.setInformation({row, enums: this.enums, dicts: this.dicts});
|
|
||||||
this.dialog.type = "copy";
|
|
||||||
this.dialog.isVisible = true;
|
|
||||||
},
|
|
||||||
edit(row) {
|
|
||||||
this.$refs.edit.setInformation({row, enums: this.enums, dicts: this.dicts});
|
|
||||||
this.dialog.type = "edit";
|
|
||||||
this.dialog.isVisible = true;
|
|
||||||
},
|
|
||||||
fetch(params = {}) {
|
|
||||||
this.loading = true;
|
|
||||||
if (this.queryParams.timeRange) {
|
|
||||||
this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
|
|
||||||
this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
this.queryParams.current = params.current ? params.current : this.queryParams.current;
|
|
||||||
this.queryParams.size = params.size ? params.size : this.queryParams.size;
|
|
||||||
|
|
||||||
informationApi.page(this.queryParams).then(response => {
|
|
||||||
const res = response.data;
|
|
||||||
if (res.isSuccess) {
|
|
||||||
this.tableData = res.data;
|
|
||||||
}
|
|
||||||
}).finally(() => this.loading = false);
|
|
||||||
},
|
|
||||||
sortChange(val) {
|
|
||||||
this.queryParams.sort = val.prop;
|
|
||||||
this.queryParams.order = val.order;
|
|
||||||
if (this.queryParams.sort) {
|
|
||||||
this.search();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
filterChange (filters) {
|
|
||||||
for (const key in filters) {
|
|
||||||
if(key.includes('.')) {
|
|
||||||
const val = { };
|
|
||||||
val[key.split('.')[1]] = filters[key][0];
|
|
||||||
this.queryParams.model[key.split('.')[0]] = val;
|
|
||||||
} else {
|
|
||||||
this.queryParams.model[key] = filters[key][0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.search()
|
|
||||||
},
|
|
||||||
cellClick (row, column) {
|
|
||||||
if (column['columnKey'] === "operation") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let flag = false;
|
|
||||||
this.selection.forEach((item)=>{
|
|
||||||
if(item.id === row.id) {
|
|
||||||
flag = true;
|
|
||||||
this.$refs.table.toggleRowSelection(row);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
.catch(() => {})
|
||||||
if(!flag){
|
},
|
||||||
this.$refs.table.toggleRowSelection(row, true);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped></style>
|
<style lang="less" scoped>
|
||||||
|
.group-page {
|
||||||
|
padding: 15px 20px;
|
||||||
|
.toolbar {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-align: left;
|
||||||
|
.el-input{
|
||||||
|
margin-right: 10px !important;
|
||||||
|
}
|
||||||
|
.group-name {
|
||||||
|
width: 180px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ module.exports = {
|
|||||||
lintOnSave: process.env.NODE_ENV === 'development',
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
devServer: {
|
devServer: {
|
||||||
// port: 145,
|
port: 8082,
|
||||||
open: true,
|
open: true,
|
||||||
overlay: {
|
overlay: {
|
||||||
warnings: false,
|
warnings: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user