装起全部商城菜单
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<div class="dashboard-container">
|
||||
<div class="dashboard-editor-container">
|
||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||
<heat-map />
|
||||
</el-row>
|
||||
<el-row :gutter="32">
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<radar-chart />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<sunburst />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<gauge />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<div class="chart-wrapper">
|
||||
<rich />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="chart-wrapper">
|
||||
<theme-river />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="32">
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<graph />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<sankey />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :lg="8">
|
||||
<div class="chart-wrapper">
|
||||
<line3-d />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<div class="chart-wrapper">
|
||||
<scatter />
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="chart-wrapper">
|
||||
<point />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||
<div class="chart-wrapper">
|
||||
<word-cloud />
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||
<div class="chart-wrapper">
|
||||
<category />
|
||||
</div>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import RadarChart from '@/components/Echarts/RadarChart'
|
||||
import HeatMap from '@/components/Echarts/HeatMap'
|
||||
import Gauge from '@/components/Echarts/Gauge'
|
||||
import Rich from '@/components/Echarts/Rich'
|
||||
import ThemeRiver from '@/components/Echarts/ThemeRiver'
|
||||
import Sunburst from '@/components/Echarts/Sunburst'
|
||||
import Graph from '@/components/Echarts/Graph'
|
||||
import Sankey from '@/components/Echarts/Sankey'
|
||||
import Scatter from '@/components/Echarts/Scatter'
|
||||
import Line3D from '@/components/Echarts/Line3D'
|
||||
import Category from '@/components/Echarts/Category'
|
||||
import Point from '@/components/Echarts/Point'
|
||||
import WordCloud from '@/components/Echarts/WordCloud'
|
||||
|
||||
export default {
|
||||
name: 'Echarts',
|
||||
components: {
|
||||
Point,
|
||||
Category,
|
||||
Graph,
|
||||
HeatMap,
|
||||
RadarChart,
|
||||
Sunburst,
|
||||
Gauge,
|
||||
Rich,
|
||||
ThemeRiver,
|
||||
Sankey,
|
||||
Line3D,
|
||||
Scatter,
|
||||
WordCloud
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.dashboard-editor-container {
|
||||
padding: 18px 22px 22px 22px;
|
||||
background-color: rgb(240, 242, 245);
|
||||
.chart-wrapper {
|
||||
background: #fff;
|
||||
padding: 16px 16px 0;
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,73 @@
|
||||
<template>
|
||||
<div>
|
||||
<div ref="editor" style="text-align:left;margin: 5px;width: 700px" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import E from 'wangeditor'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
name: 'Editor',
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: {
|
||||
'Authorization': getToken()
|
||||
},
|
||||
info: null,
|
||||
editor: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'uploadApi'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
value: function(val) {
|
||||
this.editor.txt.html(val)
|
||||
// this.editor.txt.html(val)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.editor = new E(this.$refs.editor)
|
||||
this.editor.customConfig = this.editor.customConfig ? this.editor.customConfig : this.editor.config
|
||||
this.editor.customConfig.uploadImgShowBase64 = true // 使用 base64 保存图片
|
||||
// 不可修改
|
||||
this.editor.customConfig.uploadImgHeaders = this.headers
|
||||
// 自定义文件名,不可修改,修改后会上传失败
|
||||
this.editor.customConfig.uploadFileName = 'file'
|
||||
this.editor.customConfig.uploadImgServer = this.uploadApi // 上传图片到服务器
|
||||
this.editor.customConfig.uploadImgHooks = {
|
||||
customInsert: function(insertImg, result, editor) {
|
||||
var url = result.link
|
||||
insertImg(url)
|
||||
}
|
||||
}
|
||||
this.editor.customConfig.onchange = (html) => {
|
||||
this.info = html
|
||||
this.$emit('change', this.info)
|
||||
this.$emit('input', this.info)
|
||||
}
|
||||
this.editor.create()
|
||||
this.editor.txt.html(this.value)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editor-content{
|
||||
padding-left: 5px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<p class="warn-content">
|
||||
Markdown 基于
|
||||
<el-link type="primary" href="https://github.com/hinesboy/mavonEditor" target="_blank">MavonEditor</el-link>
|
||||
,图片上传使用 <el-link type="primary" href="https://sm.ms/" target="_blank">SM.MS</el-link>
|
||||
</p>
|
||||
<mavon-editor ref="md" :style="'height:' + height" @imgAdd="imgAdd" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { upload } from '@/utils/upload'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
name: 'Markdown',
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 200 + 'px'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'imagesUploadApi'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 200 + 'px'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
imgAdd(pos, $file) {
|
||||
upload(this.imagesUploadApi, $file).then(data => {
|
||||
this.$refs.md.$img2Url(pos, data.data.url)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
@@ -0,0 +1,207 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<p class="warn-content">
|
||||
Yaml编辑器 基于
|
||||
<a href="https://github.com/codemirror/CodeMirror" target="_blank">CodeMirror</a>,
|
||||
主题预览地址 <a href="https://codemirror.net/demo/theme.html#idea" target="_blank">Theme</a>
|
||||
</p>
|
||||
<Yaml :value="value" :height="height" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Yaml from '@/components/YamlEdit/index'
|
||||
export default {
|
||||
name: 'YamlEdit',
|
||||
components: { Yaml },
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 210 + 'px',
|
||||
value: '# 展示数据,如需更换主题,请在src/components/YamlEdit 目录中搜索原主题名称进行替换\n' +
|
||||
'\n' +
|
||||
'# ===================================================================\n' +
|
||||
'# Spring Boot configuration.\n' +
|
||||
'#\n' +
|
||||
'# This configuration will be overridden by the Spring profile you use,\n' +
|
||||
'# for example application-dev.yml if you use the "dev" profile.\n' +
|
||||
'#\n' +
|
||||
'# More information on profiles: https://www.jhipster.tech/profiles/\n' +
|
||||
'# More information on configuration properties: https://www.jhipster.tech/common-application-properties/\n' +
|
||||
'# ===================================================================\n' +
|
||||
'\n' +
|
||||
'# ===================================================================\n' +
|
||||
'# Standard Spring Boot properties.\n' +
|
||||
'# Full reference is available at:\n' +
|
||||
'# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html\n' +
|
||||
'# ===================================================================\n' +
|
||||
'\n' +
|
||||
'eureka:\n' +
|
||||
' client:\n' +
|
||||
' enabled: true\n' +
|
||||
' healthcheck:\n' +
|
||||
' enabled: true\n' +
|
||||
' fetch-registry: true\n' +
|
||||
' register-with-eureka: true\n' +
|
||||
' instance-info-replication-interval-seconds: 10\n' +
|
||||
' registry-fetch-interval-seconds: 10\n' +
|
||||
' instance:\n' +
|
||||
' appname: product\n' +
|
||||
' instanceId: product:${spring.application.instance-id:${random.value}}\n' +
|
||||
' #instanceId: 127.0.0.1:9080\n' +
|
||||
' lease-renewal-interval-in-seconds: 5\n' +
|
||||
' lease-expiration-duration-in-seconds: 10\n' +
|
||||
' status-page-url-path: ${management.endpoints.web.base-path}/info\n' +
|
||||
' health-check-url-path: ${management.endpoints.web.base-path}/health\n' +
|
||||
' metadata-map:\n' +
|
||||
' zone: primary # This is needed for the load balancer\n' +
|
||||
' profile: ${spring.profiles.active}\n' +
|
||||
' version: ${info.project.version:}\n' +
|
||||
' git-version: ${git.commit.id.describe:}\n' +
|
||||
' git-commit: ${git.commit.id.abbrev:}\n' +
|
||||
' git-branch: ${git.branch:}\n' +
|
||||
'ribbon:\n' +
|
||||
' ReadTimeout: 120000\n' +
|
||||
' ConnectTimeout: 300000\n' +
|
||||
' eureka:\n' +
|
||||
' enabled: true\n' +
|
||||
'zuul:\n' +
|
||||
' host:\n' +
|
||||
' connect-timeout-millis: 5000\n' +
|
||||
' max-per-route-connections: 10000\n' +
|
||||
' max-total-connections: 5000\n' +
|
||||
' socket-timeout-millis: 60000\n' +
|
||||
' semaphore:\n' +
|
||||
' max-semaphores: 500\n' +
|
||||
'\n' +
|
||||
'feign:\n' +
|
||||
' hystrix:\n' +
|
||||
' enabled: true\n' +
|
||||
' client:\n' +
|
||||
' config:\n' +
|
||||
' default:\n' +
|
||||
' connectTimeout: 500000\n' +
|
||||
' readTimeout: 500000\n' +
|
||||
'\n' +
|
||||
'# See https://github.com/Netflix/Hystrix/wiki/Configuration\n' +
|
||||
'hystrix:\n' +
|
||||
' command:\n' +
|
||||
' default:\n' +
|
||||
' circuitBreaker:\n' +
|
||||
' sleepWindowInMilliseconds: 100000\n' +
|
||||
' forceClosed: true\n' +
|
||||
' execution:\n' +
|
||||
' isolation:\n' +
|
||||
'# strategy: SEMAPHORE\n' +
|
||||
'# See https://github.com/spring-cloud/spring-cloud-netflix/issues/1330\n' +
|
||||
' thread:\n' +
|
||||
' timeoutInMilliseconds: 60000\n' +
|
||||
' shareSecurityContext: true\n' +
|
||||
'\n' +
|
||||
'management:\n' +
|
||||
' endpoints:\n' +
|
||||
' web:\n' +
|
||||
' base-path: /management\n' +
|
||||
' exposure:\n' +
|
||||
' include: ["configprops", "env", "health", "info", "threaddump"]\n' +
|
||||
' endpoint:\n' +
|
||||
' health:\n' +
|
||||
' show-details: when_authorized\n' +
|
||||
' info:\n' +
|
||||
' git:\n' +
|
||||
' mode: full\n' +
|
||||
' health:\n' +
|
||||
' mail:\n' +
|
||||
' enabled: false # When using the MailService, configure an SMTP server and set this to true\n' +
|
||||
' metrics:\n' +
|
||||
' enabled: false # http://micrometer.io/ is disabled by default, as we use http://metrics.dropwizard.io/ instead\n' +
|
||||
'\n' +
|
||||
'spring:\n' +
|
||||
' application:\n' +
|
||||
' name: product\n' +
|
||||
' jpa:\n' +
|
||||
' open-in-view: false\n' +
|
||||
' hibernate:\n' +
|
||||
' ddl-auto: update\n' +
|
||||
' naming:\n' +
|
||||
' physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy\n' +
|
||||
' implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy\n' +
|
||||
' messages:\n' +
|
||||
' basename: i18n/messages\n' +
|
||||
' mvc:\n' +
|
||||
' favicon:\n' +
|
||||
' enabled: false\n' +
|
||||
' thymeleaf:\n' +
|
||||
' mode: HTML\n' +
|
||||
'security:\n' +
|
||||
' oauth2:\n' +
|
||||
' resource:\n' +
|
||||
' filter-order: 3\n' +
|
||||
'\n' +
|
||||
'server:\n' +
|
||||
' servlet:\n' +
|
||||
' session:\n' +
|
||||
' cookie:\n' +
|
||||
' http-only: true\n' +
|
||||
'\n' +
|
||||
'# Properties to be exposed on the /info management endpoint\n' +
|
||||
'info:\n' +
|
||||
' # Comma separated list of profiles that will trigger the ribbon to show\n' +
|
||||
' display-ribbon-on-profiles: "dev"\n' +
|
||||
'\n' +
|
||||
'# ===================================================================\n' +
|
||||
'# JHipster specific properties\n' +
|
||||
'#\n' +
|
||||
'# Full reference is available at: https://www.jhipster.tech/common-application-properties/\n' +
|
||||
'# ===================================================================\n' +
|
||||
'\n' +
|
||||
'jhipster:\n' +
|
||||
' async:\n' +
|
||||
' core-pool-size: 2\n' +
|
||||
' max-pool-size: 50\n' +
|
||||
' queue-capacity: 10000\n' +
|
||||
' # By default CORS is disabled. Uncomment to enable.\n' +
|
||||
' #cors:\n' +
|
||||
' #allowed-origins: "*"\n' +
|
||||
' #allowed-methods: "*"\n' +
|
||||
' #allowed-headers: "*"\n' +
|
||||
' #exposed-headers: "Authorization,Link,X-Total-Count"\n' +
|
||||
' #allow-credentials: true\n' +
|
||||
' #max-age: 1800\n' +
|
||||
' mail:\n' +
|
||||
' from: product@localhost\n' +
|
||||
' swagger:\n' +
|
||||
' default-include-pattern: /api/.*\n' +
|
||||
' title: product API\n' +
|
||||
' description: product API documentation\n' +
|
||||
' version: 0.0.1\n' +
|
||||
' terms-of-service-url:\n' +
|
||||
' contact-name:\n' +
|
||||
' contact-url:\n' +
|
||||
' contact-email:\n' +
|
||||
' license:\n' +
|
||||
' license-url:\n' +
|
||||
'\n' +
|
||||
'# ===================================================================\n' +
|
||||
'# Application specific properties\n' +
|
||||
'# Add your own application properties here, see the ApplicationProperties class\n' +
|
||||
'# to have type-safe configuration, like in the JHipsterProperties above\n' +
|
||||
'#\n' +
|
||||
'# More documentation is available at:\n' +
|
||||
'# https://www.jhipster.tech/common-application-properties/\n' +
|
||||
'# ===================================================================\n' +
|
||||
'\n' +
|
||||
'# application:\n'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 210 + 'px'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="value.productId">
|
||||
<ul class="el-upload-list el-upload-list--picture-card">
|
||||
<li tabindex="0" class="el-upload-list__item is-ready">
|
||||
<div>
|
||||
<img :src="value.image" alt="" class="el-upload-list__item-thumbnail">
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-delete" @click="deleteGood">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-else tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
|
||||
<i class="el-icon-plus" />
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商品列表">
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
</el-select>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;" >
|
||||
<el-table-column prop="id" label="商品id" />
|
||||
<el-table-column ref="table" prop="image" label="商品图片">
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="storeName" label="商品名称" />
|
||||
<el-table-column prop="storeCategory.cateName" label="分类名称" />
|
||||
<el-table-column prop="price" label="商品价格" />
|
||||
<el-table-column label="操作" width="185" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="doSelect(scope.row)"
|
||||
>选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
export default {
|
||||
components: { },
|
||||
mixins: [initData],
|
||||
props: {
|
||||
value: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
dialog: false,
|
||||
queryTypeOptions: [
|
||||
{ key: 'storeName', display_name: '商品名称' }
|
||||
],
|
||||
isAttr: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'api/yxStoreProduct'
|
||||
const sort = 'id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort, isShow: 1, isDel: 0 ,isIntegral:0}
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
if (type && value) { this.params[type] = value }
|
||||
return true
|
||||
},
|
||||
deleteGood() {
|
||||
const that = this
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
that.$set(that.value,"productId", null)
|
||||
that.$set(that.value,"storeName", null)
|
||||
that.$set(that.value,"image", null)
|
||||
that.$set(that.value,"otPrice", null)
|
||||
that.$set(that.value,"price", null)
|
||||
that.$set(that.value,"cform",null)
|
||||
})
|
||||
},
|
||||
doSelect(data) {
|
||||
this.$set(this.value,"productId", data.id)
|
||||
this.$set(this.value,"storeName", data.storeName)
|
||||
this.$set(this.value,"image", data.image)
|
||||
this.$set(this.value,"otPrice", data.otPrice)
|
||||
this.$set(this.value,"price", data.price)
|
||||
this.$set(this.value,"cform",data)
|
||||
this.dialog = false
|
||||
},
|
||||
toSelete() {
|
||||
this.dialog = true
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<ul v-for="(item,index) in newValue" :key="index" class="el-upload-list el-upload-list--picture-card">
|
||||
<li tabindex="0" class="el-upload-list__item is-ready" :style="'width: '+width+'px;height: '+height+'px'">
|
||||
<div>
|
||||
<img :src="item.image" alt="" class="el-upload-list__item-thumbnail">
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-delete" @click="deleteGood(index)">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
|
||||
<i class="el-icon-plus" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商品列表">
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
</el-select>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange" ref="multipleTable">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" label="商品id" />
|
||||
<el-table-column ref="table" prop="image" label="商品图片">
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.image" style="color: #42b983" target="_blank"><img :src="scope.row.image" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="storeName" label="商品名称" />
|
||||
<el-table-column prop="storeCategory.cateName" label="分类名称" />
|
||||
<el-table-column prop="price" label="商品价格" />
|
||||
</el-table>
|
||||
|
||||
<div style="margin-top: 20px">
|
||||
<el-button type="primary" @click="doSelect()">确定选择</el-button>
|
||||
</div>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
import { del, onsale } from '@/api/bxg/yxStoreProduct'
|
||||
export default {
|
||||
components: { },
|
||||
mixins: [initData],
|
||||
props: {
|
||||
value: {
|
||||
type: Array,
|
||||
default() {
|
||||
return []
|
||||
}
|
||||
},
|
||||
// 宽度
|
||||
width: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 150
|
||||
}
|
||||
},
|
||||
// 宽度
|
||||
height: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 150
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
page: function (val) {
|
||||
var map = this.selectGoods;
|
||||
map.set(this.lastPage, this.multipleSelection);
|
||||
this.selectGoods = map;
|
||||
|
||||
if (map.get(val)) {
|
||||
this.multipleSelection = map.get(val);
|
||||
}
|
||||
this.lastPage = val;
|
||||
},
|
||||
data: function (val) {
|
||||
const _this=this;
|
||||
_this.$nextTick(()=> {
|
||||
//获取map
|
||||
var map = this.selectGoods;
|
||||
//判断当前页是否有数据
|
||||
var thePageData = map.get(this.page);
|
||||
if (thePageData) {
|
||||
thePageData.forEach(thePageData=>{
|
||||
val.forEach(tableData=>{
|
||||
if(tableData.id==thePageData.id){
|
||||
this.$refs.multipleTable.toggleRowSelection(tableData,true);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
lastPage: 0,
|
||||
selectGoods: new Map(),
|
||||
newValue: this.value,
|
||||
delLoading: false,
|
||||
visible: false,
|
||||
queryTypeOptions: [
|
||||
{ key: 'storeName', display_name: '商品名称' }
|
||||
],
|
||||
isAttr: false,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
deleteGood(index) {
|
||||
const that = this
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
that.newValue.splice(index, 1)
|
||||
that.url = []
|
||||
})
|
||||
},
|
||||
doSelect() {
|
||||
this.newValue =[];
|
||||
var dataList=this.selectGoods;
|
||||
dataList.forEach(i=>{
|
||||
i.forEach(j=>{
|
||||
this.newValue.push(j)
|
||||
})
|
||||
})
|
||||
this.$emit("selectGoods", this.newValue)
|
||||
this.dialog = false
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
var map = this.selectGoods;
|
||||
map.set(this.lastPage, val);
|
||||
this.selectGoods = map;
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
toSelete() {
|
||||
this.dialog = true
|
||||
},
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'api/yxStoreProduct'
|
||||
const sort = 'id,desc'
|
||||
this.params = {page: this.page, size: this.size, sort: sort, isShow: 1, isDel: 0,isIntegral:0}
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
if (type && value) {
|
||||
this.params[type] = value
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,4 +1,4 @@
|
||||
const req = require.context('../../../assets/icons/svg', false, /\.svg$/)
|
||||
const req = require.context('@/assets/icons/svg', false, /\.svg$/)
|
||||
const requireAll = requireContext => requireContext.keys()
|
||||
|
||||
const re = /\.\/(.*)\.svg/
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<ul v-for="(item,index) in product" :key="index" class="el-upload-list el-upload-list--picture-card">
|
||||
<li tabindex="0" class="el-upload-list__item is-ready" :style="'width: '+width+'px;height: '+height+'px'">
|
||||
<div>
|
||||
<img :src="item.coverImgeUrl" alt="" class="el-upload-list__item-thumbnail">
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-delete" @click="deleteGood(index)">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
|
||||
<i class="el-icon-plus" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商品列表">
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
</el-select>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;" @selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column prop="goodsId" label="直播商品id" />
|
||||
<el-table-column prop="name" label="商品名称" />
|
||||
<el-table-column prop="productId" label="关联商品id" />
|
||||
<el-table-column prop="coverImgUrl" label="商品图片" >
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.coverImgeUrl" style="color: #42b983" target="_blank"><img :src="scope.row.coverImgeUrl" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="url" label="商品小程序路径" />
|
||||
<el-table-column prop="priceType" label="价格类型" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.priceType == 1" :type="''">一口价</el-tag>
|
||||
<el-tag v-else-if="scope.row.priceType == 2" :type="''">价格区间</el-tag>
|
||||
<el-tag v-else-if="scope.row.priceType == 3" :type="''">显示折扣价</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-if="columns.visible('price')" prop="price" label="price" />-->
|
||||
<!-- <el-table-column v-if="columns.visible('price2')" prop="price2" label="price2" />-->
|
||||
<el-table-column prop="auditStatus" label="审核状态" >
|
||||
<!-- //0:未审核,1:审核中,2:审核通过,3审核失败-->
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.auditStatus === 0" :type="''">未审核</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 1" :type="''">审核中</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 2" :type="''">审核通过</el-tag>
|
||||
<el-tag v-else-if="scope.row.auditStatus === 3" :type="''">审核失败</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 1, 2:表示是为api添加商品,否则是直播控制台添加的商品-->
|
||||
<el-table-colum prop="thirdPartyTag" label="添加途径" >
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.thirdPartyTag == 0" :type="''">api添加</el-tag>
|
||||
<el-tag v-else-if="scope.row.thirdPartyTag == 2" :type="''">控制台</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-colum>
|
||||
</el-table>
|
||||
|
||||
<div style="margin-top: 20px">
|
||||
<el-button type="primary" @click="doSelect()">确定选择</el-button>
|
||||
</div>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
export default {
|
||||
components: { },
|
||||
mixins: [initData],
|
||||
props: {
|
||||
product : Array,
|
||||
// 宽度
|
||||
width: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 150
|
||||
}
|
||||
},
|
||||
// 宽度
|
||||
height: {
|
||||
type: Number,
|
||||
default() {
|
||||
return 150
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
product:this.product,
|
||||
delLoading: false,
|
||||
visible: false,
|
||||
queryTypeOptions: [
|
||||
{ key: 'storeName', display_name: '商品名称' }
|
||||
],
|
||||
isAttr: false,
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
deleteGood(index) {
|
||||
const that = this
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
that.product.splice(index, 1)
|
||||
that.url = []
|
||||
})
|
||||
},
|
||||
doSelect() {
|
||||
this.product = this.multipleSelection
|
||||
this.$emit("selectGoods", this.product)
|
||||
this.dialog = false
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
toSelete() {
|
||||
this.dialog = true
|
||||
},
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'api/yxWechatLiveGoods'
|
||||
const sort = 'goods_id,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort, auditStatus: "2" }
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
if (type && value) { this.params[type] = value }
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,161 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="value.uid">
|
||||
<ul class="el-upload-list el-upload-list--picture-card">
|
||||
<li tabindex="0" class="el-upload-list__item is-ready">
|
||||
<div>
|
||||
<img :src="value.avatar" alt="" class="el-upload-list__item-thumbnail">
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-delete" @click="deleteUser">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-else tabindex="0" class="el-upload el-upload--picture-card" @click="toSelete">
|
||||
<i class="el-icon-plus" />
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialog" append-to-body width="60%" title="商城会员">
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
</el-select>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<el-button
|
||||
type="danger"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
icon="el-icon-refresh"
|
||||
@click="toQuery"
|
||||
>刷新</el-button>
|
||||
</div>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="uid" label="用户id" />
|
||||
<el-table-column prop="nickname" label="用户昵称" />
|
||||
<el-table-column ref="table" prop="avatar" label="用户头像">
|
||||
<template slot-scope="scope">
|
||||
<a :href="scope.row.avatar" style="color: #42b983" target="_blank"><img :src="scope.row.avatar" alt="点击打开" class="el-avatar"></a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="phone" label="手机号码" />
|
||||
<el-table-column label="用户来源" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.userType == 'wechat'">公众号</el-tag>
|
||||
<el-tag v-else-if="scope.row.userType == 'routine'">小程序</el-tag>
|
||||
<el-tag v-else>H5</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin','YXUSER_ALL','YXUSER_EDIT','YXUSER_DELETE'])" label="操作" width="185" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-permission="['admin','YXUSER_ALL','YXUSER_EDIT']"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="doSelect(scope.row)"
|
||||
>选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/crud'
|
||||
export default {
|
||||
components: {},
|
||||
mixins: [initData],
|
||||
props: {
|
||||
value: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
myValue: this.value,
|
||||
delLoading: false, dialog: false,
|
||||
userType: '',
|
||||
queryTypeOptions: [
|
||||
{ key: 'nickname', display_name: '用户昵称' },
|
||||
{ key: 'phone', display_name: '手机号码' }
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
beforeInit() {
|
||||
this.url = 'api/yxUser'
|
||||
const sort = 'uid,desc'
|
||||
this.params = { page: this.page, size: this.size, sort: sort }
|
||||
const query = this.query
|
||||
const type = query.type
|
||||
const value = query.value
|
||||
if (type && value) { this.params[type] = value }
|
||||
return true
|
||||
},
|
||||
deleteUser() {
|
||||
const that = this
|
||||
this.$confirm('是否确认删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
//that.myValue = {uid: null,nickname: null,avatar: null}
|
||||
that.$set(that.value,"uid", null)
|
||||
that.$set(that.value,"nickname", null)
|
||||
that.$set(that.value,"avatar", null)
|
||||
})
|
||||
},
|
||||
toSelete() {
|
||||
this.dialog = true
|
||||
},
|
||||
doSelect(data) {
|
||||
this.$set(this.value,"uid", data.uid)
|
||||
this.$set(this.value,"nickname", data.nickname)
|
||||
this.$set(this.value,"avatar", data.avatar)
|
||||
|
||||
this.dialog = false
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.avatar-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
width: 178px;
|
||||
height: 178px;
|
||||
line-height: 178px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user