Compare commits
7 Commits
8e3d07d747
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| c31ef2f096 | |||
| 709e88bc29 | |||
|
|
908eb71b48 | ||
|
|
9492db65e9 | ||
|
|
fb74b5bb1d | ||
| 338cbe6990 | |||
|
|
2b2e320e6d |
@@ -13,7 +13,7 @@ VUE_APP_DOMAIN = uat.xingoil.com/ws
|
||||
# uat.xingoil.com/ws
|
||||
|
||||
# 开发环境,不会进行加密,会打印出数据1
|
||||
VUE_APP_ENV = 'development'
|
||||
VUE_APP_ENV = 'production'
|
||||
#production
|
||||
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
||||
@@ -12,3 +12,4 @@ VUE_APP_UPLOAD_PRIVATE_URL = '/adminapi/oil-dict/imageHandler/uploadProtectedImg
|
||||
VUE_APP_ENV = 'production'
|
||||
|
||||
VUE_APP_DOMAIN = www.xingoil.com/ws
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
"test:ci": "npm run lint && npm run test:unit",
|
||||
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
|
||||
"analyzer": "cross-env use_analyzer=true npm run dev",
|
||||
"new": "plop"
|
||||
"new": "plop",
|
||||
"dev2": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve",
|
||||
"build:prod2": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@@ -92,6 +92,13 @@ export default {
|
||||
data: time
|
||||
})
|
||||
},
|
||||
getProductOverview() {
|
||||
// 获取商品统计信息
|
||||
return request({
|
||||
url: `/${service_name}/mallProductInfo/getProductOverview`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
exportExcel(page) {
|
||||
// 导出
|
||||
return request({
|
||||
|
||||
@@ -89,12 +89,13 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
const isLt2M = file.size / 1024 < 50
|
||||
console.log(file)
|
||||
const isLt2M = file.size / 1024 > 5 * 1024
|
||||
|
||||
if (!isLt2M) {
|
||||
this.$message.error('图片大小不能超过50KB! 请重新上传!')
|
||||
if (isLt2M) {
|
||||
this.$message.error('图片大小不能超过5M! 请重新上传!')
|
||||
}
|
||||
return isLt2M
|
||||
return !isLt2M
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
20
src/main.js
20
src/main.js
@@ -1,12 +1,11 @@
|
||||
|
||||
import 'babel-polyfill'
|
||||
import 'babel-polyfill'
|
||||
import Vue from 'vue'
|
||||
import router from './router'
|
||||
import Cookies from 'js-cookie'
|
||||
import Element from 'element-ui'
|
||||
import { UTable, UTableColumn } from 'umy-ui'
|
||||
import Element from 'element-ui'
|
||||
import { UTable, UTableColumn } from 'umy-ui'
|
||||
Vue.use(UTable)
|
||||
Vue.use(UTableColumn)
|
||||
Vue.use(UTableColumn)
|
||||
import App from './App'
|
||||
import store from './store'
|
||||
import * as filters from './filters' // 全局过滤器
|
||||
@@ -24,23 +23,23 @@ import 'normalize.css/normalize.css'
|
||||
import 'vue2-animate/dist/vue2-animate.min.css'
|
||||
|
||||
import './styles/element-variables.scss'
|
||||
import 'element-ui/lib/theme-chalk/display.css'
|
||||
import 'element-ui/lib/theme-chalk/display.css'
|
||||
import 'wowjs/css/libs/animate.css'
|
||||
import '@/styles/index.scss'
|
||||
import '@/styles/index.scss'
|
||||
import './icons' // icon
|
||||
import './permission' // permission control
|
||||
import { getToken, setToken, removeToken } from '@/utils/auth.js'
|
||||
import pagesHeader from '@/components/pagesHeader';
|
||||
import pagesHeader from '@/components/pagesHeader'
|
||||
|
||||
import SlideVerify from 'vue-monoplasty-slide-verify'
|
||||
import '@/theme/index.scss';
|
||||
import '@/theme/index.scss'
|
||||
|
||||
Vue.use(SlideVerify)
|
||||
Vue.use(permission)
|
||||
Vue.use(dragDialog)
|
||||
Vue.use(dragDrawer)
|
||||
Vue.use(GlobalComponents)
|
||||
Vue.component('pagesHeader', pagesHeader);
|
||||
Vue.component('pagesHeader', pagesHeader)
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// 切换环境时执行代码
|
||||
@@ -57,6 +56,7 @@ Object.keys(filters).forEach(key => {
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$utils = utils
|
||||
Vue.prototype.$bus = new Vue()
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
||||
@@ -212,7 +212,15 @@ export function param2Obj(url) {
|
||||
if (!search) {
|
||||
return {}
|
||||
}
|
||||
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"').replace(/\+/g, ' ') + '"}')
|
||||
return JSON.parse(
|
||||
'{"' +
|
||||
decodeURIComponent(search)
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/&/g, '","')
|
||||
.replace(/=/g, '":"')
|
||||
.replace(/\+/g, ' ') +
|
||||
'"}'
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,7 +296,7 @@ export function getTime(type) {
|
||||
export function debounce(func, wait, immediate) {
|
||||
let timeout, args, context, timestamp, result
|
||||
|
||||
const later = function () {
|
||||
const later = function() {
|
||||
// 据上一次触发时间间隔
|
||||
const last = +new Date() - timestamp
|
||||
|
||||
@@ -305,7 +313,7 @@ export function debounce(func, wait, immediate) {
|
||||
}
|
||||
}
|
||||
|
||||
return function (...args) {
|
||||
return function(...args) {
|
||||
context = this
|
||||
timestamp = +new Date()
|
||||
const callNow = immediate && !timeout
|
||||
@@ -420,9 +428,9 @@ export function fileAdd(file, resolve, reject) {
|
||||
const reader = new FileReader()
|
||||
const image = new Image()
|
||||
reader.readAsDataURL(file)
|
||||
reader.onload = function () {
|
||||
reader.onload = function() {
|
||||
file.src = this.result
|
||||
image.onload = function () {
|
||||
image.onload = function() {
|
||||
const width = image.width
|
||||
const height = image.height
|
||||
file.width = width
|
||||
@@ -444,7 +452,7 @@ export function startImgCompress(path, obj, resolve, reject) {
|
||||
// path是指上传的图片,obj是压缩的品质,越低越模糊
|
||||
var img = new Image()
|
||||
img.src = path.src
|
||||
img.onload = function () {
|
||||
img.onload = function() {
|
||||
var that = this // 这里的this 是把img的对象指向改变为that
|
||||
// 默认按比例压缩
|
||||
var w = that.width
|
||||
@@ -501,7 +509,7 @@ export function formatXML(xml, tab) {
|
||||
var formatted = ''
|
||||
var indent = ''
|
||||
tab = tab || ' '
|
||||
xml.split(/>\s*</).forEach(function (node) {
|
||||
xml.split(/>\s*</).forEach(function(node) {
|
||||
if (node.match(/^\/\w/)) indent = indent.substring(tab.length)
|
||||
formatted += indent + '<' + node + '>\r\n'
|
||||
if (node.match(/^<?\w[^>]*[^\/]$/)) indent += tab
|
||||
@@ -660,7 +668,7 @@ export const exportDefault = 'export default '
|
||||
// 类型判断
|
||||
export function typeJudgment(object) {
|
||||
try {
|
||||
let res = {}.__proto__.toString.call(object);
|
||||
let res = {}.__proto__.toString.call(object)
|
||||
// let type = /(?<= ).+(?=\])/.exec(res);
|
||||
let type = res.replace(/[\[\]]/g, '').split(' ')
|
||||
return type.length ? type[1] : ''
|
||||
@@ -668,3 +676,21 @@ export function typeJudgment(object) {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
// url取参
|
||||
export function urlParamsHandle(url) {
|
||||
const search = url.split('?')[1]
|
||||
if (!search) {
|
||||
return {}
|
||||
}
|
||||
const result = {}
|
||||
const searchArr = search.split('&')
|
||||
searchArr.forEach(v => {
|
||||
const index = v.indexOf('=')
|
||||
if (index !== -1) {
|
||||
const name = v.substring(0, index)
|
||||
const val = v.substring(index + 1, v.length)
|
||||
result[name] = val
|
||||
}
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -45,23 +45,9 @@
|
||||
<span class="card-title">商品总览</span>
|
||||
</div>
|
||||
<div class="product-card flex js ac">
|
||||
<div class="product-card-item">
|
||||
<div class="number">100</div>
|
||||
<div>已下架</div>
|
||||
</div>
|
||||
<div class="product-card-item">
|
||||
<div class="number">100</div>
|
||||
<div>已下架</div>
|
||||
</div>
|
||||
|
||||
<div class="product-card-item">
|
||||
<div class="number">100</div>
|
||||
<div>已下架</div>
|
||||
</div>
|
||||
|
||||
<div class="product-card-item">
|
||||
<div class="number">100</div>
|
||||
<div>已下架</div>
|
||||
<div class="product-card-item" v-for="(item, index) in productList" :key="index">
|
||||
<div class="number">{{ item.currentNum }}</div>
|
||||
<div>{{ item.productStatus }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -230,7 +216,8 @@ export default {
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
productList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -244,6 +231,7 @@ export default {
|
||||
|
||||
this.getMainDataOne()
|
||||
this.getMainDataTwo(sevenDaysAgo, DaysAgo)
|
||||
this.getProductOverview()
|
||||
},
|
||||
methods: {
|
||||
// 表格搜索
|
||||
@@ -284,6 +272,13 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
async getProductOverview() {
|
||||
await orderInfoApi.getProductOverview().then(res => {
|
||||
if ((res.code = 20000)) {
|
||||
this.productList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
timeBefore(date) {
|
||||
if (!date) {
|
||||
date = new Date()
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<el-col>
|
||||
<el-form-item label="广告图片" prop="positionImage">
|
||||
<div class="upLoadPicBox">
|
||||
<upload :photo="advertisement.positionImage" @success="uploadSuccess" tip="只能上传jpg/png格式文件,文件不能超过50kb"></upload>
|
||||
<upload :photo="advertisement.positionImage" @success="uploadSuccess" tip="只能上传jpg/png格式文件"></upload>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
list-type="picture-card">
|
||||
<i slot="default" class="el-icon-plus"></i>
|
||||
<div slot="file" slot-scope="{file}">
|
||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
||||
<span class="el-upload-list__item-actions">
|
||||
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
||||
<i class="el-icon-zoom-in"></i>
|
||||
@@ -16,9 +16,9 @@
|
||||
<slot :file="file" name="imgButton">
|
||||
|
||||
</slot>
|
||||
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-upload>
|
||||
<!-- <div style="width: 100%;display: flex;justify-content: center;">
|
||||
<slot name="footer">
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
limit: {
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
this.fileList.push(Object.assign(file, { url }));
|
||||
},
|
||||
handleRemove(file) {
|
||||
this.fileList = this.fileList.filter(item => item.name !== file.name)
|
||||
this.fileList = this.fileList.filter(item => item !== file)
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url;
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
<style scoped lang="scss"> ::v-deep .hiedd .el-upload--picture-card {
|
||||
display: none !important;
|
||||
/* 上传按钮隐藏 */
|
||||
@@ -79,4 +79,4 @@ export default {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,9 +32,9 @@
|
||||
<el-option label="平台商品" value="1"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="油站名称:" label-for="siteName">
|
||||
<!-- <el-form-item label="油站名称:" label-for="siteName">
|
||||
<el-input clearable placeholder="请输入油站名称:" v-model="page.params.siteName" class="form_content_width" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="userSearchs">查询</el-button>
|
||||
</el-form-item>
|
||||
@@ -125,13 +125,13 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="油站" min-width="150" align="center">
|
||||
<!-- <el-table-column label="油站" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>
|
||||
{{ scope.row.siteName || '暂无' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="库存" min-width="80">
|
||||
<template slot-scope="scope">
|
||||
<!-- <span>{{ scope.row.stockList.length }}</span> <br /> -->
|
||||
@@ -459,8 +459,17 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.init()
|
||||
this.$bus.$on('productRefresh', () => {
|
||||
console.log('productRefresh')
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
activated() {
|
||||
// let { refresh } = this.$utils.urlParamsHandle(location.href)
|
||||
// if (refresh) {
|
||||
// this.init()
|
||||
// }
|
||||
},
|
||||
activated() {},
|
||||
methods: {
|
||||
auditing(row, auditStatus) {
|
||||
this.$prompt('审核', '提示', {
|
||||
@@ -711,7 +720,7 @@ export default {
|
||||
},
|
||||
// 编辑
|
||||
edit(row) {
|
||||
console.log(row)
|
||||
// console.log(row)
|
||||
this.$router.push({
|
||||
path: '/product/productAdd',
|
||||
query: {
|
||||
|
||||
@@ -25,12 +25,12 @@ module.exports = {
|
||||
proxy: {
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
// target: `cls`,
|
||||
// target: `http://192.168.0.6:38080`,
|
||||
target: `http://192.168.0.24:38080`,
|
||||
// target: `http://192.168.0.254:38080`,
|
||||
// target: `http://192.168.110.230:38080`,
|
||||
// target: `http://192.168.1.83:38080`,
|
||||
// target: 'http://222.132.26.119:8081',
|
||||
// target: `https://www.xingoil.com/adminapi`,
|
||||
// target: 'http://uat.xingoil.com/adminapi',
|
||||
target: 'http://uat.xingoil.com/adminapi',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
|
||||
Reference in New Issue
Block a user