Commit 0be0d418 by 杨北旺

新建v2.8.0改UI规范

1 parent e0284cc7
This diff could not be displayed because it is too large.
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"el-tree-transfer": "^2.4.7", "el-tree-transfer": "^2.4.7",
"element-ui": "^2.15.6", "element-ui": "^2.15.6",
"glsx-common": "^1.4.9", "glsx-common": "^1.4.9",
"glsx-components": "^1.3.7", "glsx-components": "^1.4.7",
"glsx-vue-components": "^1.0.15", "glsx-vue-components": "^1.0.15",
"jquery": "^3.6.0", "jquery": "^3.6.0",
"vue": "^2.6.14", "vue": "^2.6.14",
......
.equity-wrap .contain { .equity-wrap .contain {
background: #FFFFFF; background: #FFFFFF;
margin: 0 0 20px 0; // margin: 0 0 20px 0;
padding: 20px; padding: 20px;
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10); // box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
} }
.equity-wrap .contain .el-table__empty-text{ .equity-wrap .contain .el-table__empty-text{
display: inline-block; display: inline-block;
...@@ -128,6 +128,25 @@ ...@@ -128,6 +128,25 @@
margin: 0 0 30px 0; margin: 0 0 30px 0;
padding-left: 8px; padding-left: 8px;
} }
.find_wrap{
background: #ffffff;
padding: 20px 15px;
// padding: 20px 20px 0px 20px;
}
.tableTopButton {
display: flex;
align-items: center;
justify-content: flex-end;
margin-bottom: 10px;
margin-right: 2px;
}
.pannel{
padding: 0 15px;
}
.table_wrap {
padding: 0 15px;
padding-bottom: 10px;
}
// .equity-wrap table { // .equity-wrap table {
// width: 98%; // width: 98%;
......
import VueQuillEditor from 'vue-quill-editor'
import '@/components'
import VueBus from 'vue-bus'
import Vue from 'vue' import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Dialog, Tabs, TabPane, Table, TableColumn, Pagination, RadioButton, Upload, Image, Loading, InputNumber } from 'element-ui' import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container, Progress, Timeline, TimelineItem, Dropdown, DropdownMenu, Rate, Image, Drawer, Popover, Row } from 'element-ui'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建) Vue.use(Button)
// Vue.use(Button) Vue.use(ButtonGroup)
// Vue.use(ButtonGroup) Vue.use(Form)
// Vue.use(Form) Vue.use(FormItem)
// Vue.use(FormItem) Vue.use(Input)
// Vue.use(Input) Vue.use(Radio)
// Vue.use(Radio) Vue.use(RadioGroup)
// Vue.use(RadioGroup) Vue.use(Checkbox)
// Vue.use(Checkbox) Vue.use(CheckboxGroup)
// Vue.use(CheckboxGroup) Vue.use(Switch)
// Vue.use(Switch) Vue.use(Select)
// Vue.use(Select) Vue.use(Option)
// Vue.use(Option) Vue.use(TimePicker)
// Vue.use(TimePicker) Vue.use(Col)
// Vue.use(Col) Vue.use(DatePicker)
// Vue.use(DatePicker) Vue.use(Tree)
// Vue.use(Dialog) Vue.use(Card)
// Vue.use(Tabs) Vue.use(Table)
// Vue.use(TabPane) Vue.use(TableColumn)
// Vue.use(Table) Vue.use(Pagination)
// Vue.use(TableColumn) Vue.use(Loading)
// Vue.use(Pagination) Vue.use(Dialog)
// Vue.use(RadioButton) Vue.use(Upload)
// Vue.use(Upload) Vue.use(Tooltip)
Vue.use(GLTable) Vue.use(Tabs)
Vue.use(VueQuillEditor) Vue.use(TabPane)
Vue.use(VueBus) Vue.use(Progress)
// Vue.use(Image) Vue.use(Timeline)
// Vue.use(Loading) Vue.use(TimelineItem)
// Vue.use(InputNumber) Vue.use(Dropdown)
import ElementUI from 'element-ui' Vue.use(DropdownMenu)
Vue.use(ElementUI) Vue.use(Rate)
Vue.use(Image)
Vue.use(Drawer)
Vue.use(Popover)
Vue.use(Row)
export const message = Message export const message = Message
export const messageBox = MessageBox
\ No newline at end of file \ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import { message } from '@/plugins/element.js' import ElementUI from 'element-ui'
import { message,messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton,GLTable, GLCombiForm, GLTableButton,GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
let routes = [] let routes = []
let router = null let router = null
let instance = null let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState,routerBase }) {
Vue.use(GLTable)
Vue.use(ElementUI)
Vue.use(GLCombiForm)
Vue.use(GLTableButton)
Vue.use(GLDialog)
export async function bootstrap({history, common, messenger, globalState,routerBase }) {
const { response, request, sign, secret } = await fetchConfig(globalState.configSwitch) const { response, request, sign, secret } = await fetchConfig(globalState.configSwitch)
let newrequest = Object.assign({},request) let newrequest = Object.assign({},request)
newrequest.baseURL = juedeDomain(request.baseURL) newrequest.baseURL = juedeDomain(request.baseURL)
...@@ -16,6 +24,8 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt ...@@ -16,6 +24,8 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
Vue.prototype.$common = common Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$new_http = new common.Http({ response, request:newrequest, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$new_http = new common.Http({ response, request:newrequest, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
......
<template> <template>
<div class="equity-wrap"> <div class="equity-wrap">
<GLButton fn="新增商品" class="addGood" type="primary" icon="el-icon-plus" @click="jump">新增商品</GLButton> <GLButton fn="新增商品" size="small" class="addGood" type="primary" icon="el-icon-plus" @click="jump">新增商品</GLButton>
<div class="equity-wrap contain"> <div class="find_wrap">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="85px" label-position="right"> <GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- <el-form :inline="true" style="width: 100%" :model="searchForm" label-width="85px" label-position="right">
<el-row style="display: flex; align-items: center; margin-bottom: 2px"> <el-row style="display: flex; align-items: center; margin-bottom: 2px">
<el-form-item size="small" label="品牌名称"> <el-form-item size="small" label="品牌名称">
<el-select clearable size="small" v-model="searchForm.brandName" filterable placeholder="请选择"> <el-select clearable size="small" v-model="searchForm.brandName" filterable placeholder="请选择">
...@@ -12,9 +13,6 @@ ...@@ -12,9 +13,6 @@
<el-form-item size="small" label="商品名称"> <el-form-item size="small" label="商品名称">
<el-input v-model="searchForm.productName" placeholder="请输入" size="small" clearable></el-input> <el-input v-model="searchForm.productName" placeholder="请输入" size="small" clearable></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="门店名称">
<el-input v-model="searchForm.productName" placeholder="请输入" size="small" clearable></el-input>
</el-form-item> -->
<el-form-item size="small" label="提供方" style="margin-left: -10px"> <el-form-item size="small" label="提供方" style="margin-left: -10px">
<el-select clearable size="small" v-model="searchForm.supplier"> <el-select clearable size="small" v-model="searchForm.supplier">
<el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value"></el-option>
...@@ -38,20 +36,29 @@ ...@@ -38,20 +36,29 @@
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form> -->
<div class="row-btns"> <div class="pannel tableTopButton">
<el-button size="small" @click="toggleAll">全选</el-button> <el-button size="small" @click="toggleAll">全选</el-button>
<GLButton fn="上架商品" size="small" type="primary" @click="batchOperation(1)">上架</GLButton> <GLButton fn="上架商品" size="small" type="primary" @click="batchOperation(1)">上架</GLButton>
<GLButton fn="下架商品" size="small" type="primary" @click="batchOperation(2)">下架</GLButton> <GLButton fn="下架商品" size="small" type="primary" @click="batchOperation(2)">下架</GLButton>
<GLButton fn="删除商品" size="small" type="primary" @click="batchOperation(-1)">删除</GLButton> <GLButton fn="删除商品" size="small" type="primary" @click="batchOperation(-1)">删除</GLButton>
</div> </div>
<GLTable v-if="flag" ref="table" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="tableParams.getListApi" :pageConf="pageConf"> <div class="table_wrap">
<GLTable ref="table" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi">
<div slot="table-btns" slot-scope="scope">
<GLButton fn="编辑商品" type="text" @click="jump(scope.scope)">编辑</GLButton>
<GLButton fn="复制商品" type="text" @click="copy(scope.scope)">复制</GLButton>
<el-button type="text" :disabled="!scope.scope.groupStatus || scope.scope.status != 1" @click="toCreateLine(scope.scope)">生成商品短链</el-button>
</div>
</GLTable>
</div>
<!-- <GLTable v-if="flag" ref="table" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="tableParams.getListApi" :pageConf="pageConf">
<span slot="auth-button" slot-scope="scope" :data="scope.scope"> <span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLButton fn="编辑商品" type="text" @click="jump(scope.scope)">编辑</GLButton> <GLButton fn="编辑商品" type="text" @click="jump(scope.scope)">编辑</GLButton>
<GLButton fn="复制商品" type="text" @click="copy(scope.scope)">复制</GLButton> <GLButton fn="复制商品" type="text" @click="copy(scope.scope)">复制</GLButton>
<el-button type="text" :disabled="!scope.scope.groupStatus||scope.scope.status!=1" @click="toCreateLine(scope.scope)">生成商品短链</el-button> <el-button type="text" :disabled="!scope.scope.groupStatus || scope.scope.status != 1" @click="toCreateLine(scope.scope)">生成商品短链</el-button>
</span> </span>
</GLTable> </GLTable> -->
</div> </div>
<!-- 推广弹窗 --> <!-- 推广弹窗 -->
<el-dialog title="商品短链" :visible.sync="isVisible" :before-close="handleClose" :close-on-click-modal="false" width="576px" class="addCardsDialog"> <el-dialog title="商品短链" :visible.sync="isVisible" :before-close="handleClose" :close-on-click-modal="false" width="576px" class="addCardsDialog">
...@@ -66,7 +73,7 @@ ...@@ -66,7 +73,7 @@
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script>
const cloneText = message => { const cloneText = message => {
let input = document.createElement('input') let input = document.createElement('input')
input.value = message input.value = message
...@@ -85,9 +92,81 @@ export default { ...@@ -85,9 +92,81 @@ export default {
url: url, url: url,
size: 'small', size: 'small',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
flag: true, flag: false,
searchForm: {}, searchForm: {
brandName: '',
productName: '',
supplier: '',
productId: '',
status: '',
id: ''
},
searchFormData: [
{
label: '品牌名称',
name: 'brandName',
type: 'select',
optionList: [],
optionId: 'brandName',
optionLabel: 'brandName',
isClear: true
},
{
label: '商品名称',
name: 'productName',
type: 'input',
isClear: true
},
{
label: '提供方',
name: 'supplier',
type: 'select',
optionList: [
{
label: '海威',
value: 'HW'
}
],
optionId: 'value',
optionLabel: 'label',
isClear: true
},
{
label: '商品编码',
name: 'productId',
type: 'input',
isClear: true
},
{
label: '商品状态',
name: 'status',
type: 'select',
optionList: [
{
label: '上架',
value: '1'
},
{
label: '下架',
value: '2'
},
{
label: '待上架',
value: '0'
}
],
optionId: 'value',
optionLabel: 'label',
isClear: true
},
{
label: '商品ID',
name: 'id',
type: 'input',
isClear: true
}
],
buttonList: [],
supplierList: [ supplierList: [
{ {
label: '海威', label: '海威',
...@@ -108,30 +187,30 @@ export default { ...@@ -108,30 +187,30 @@ export default {
value: '0' value: '0'
} }
], ],
getListApi: this.$apis.orderApi.getGoodsList,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
mutiSelectName: 'goodsIndex', // mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id', // mutiSelectUniqueKey: 'id',
tableOption: true, tableOption: false,
getListApi: this.$apis.orderApi.getGoodsList,
tableColumns: [ tableColumns: [
{ {
label: '提供方', label: '提供方',
width:150,
formatter: cell => { formatter: cell => {
return '海威' return '海威'
} }
}, },
{ {
label: '商品SKU', label: '商品SKU',
formatter: cell => { formatter: cell => {
return cell.appearance == 1 ? `${cell.brandName || ''}${cell.productName || ''}` : `${cell.brandName || ''}${cell.productName || ''}${cell.denomination || ''}` return cell.appearance == 1 ? `${cell.brandName || ''}${cell.productName || ''}` : `${cell.brandName || ''}${cell.productName || ''}${cell.denomination || ''}`
} }
}, },
{ {
label: '会员价(元)', label: '会员价(元)',
width:150, width: 150,
align:'right',
prop: 'salesPrice' prop: 'salesPrice'
}, },
{ {
...@@ -139,7 +218,7 @@ export default { ...@@ -139,7 +218,7 @@ export default {
sortable: true, sortable: true,
label: '销量', label: '销量',
width:110, width: 150
// renderHeader: h => { // renderHeader: h => {
// return h('div', { class: 'table-header' }, [ // return h('div', { class: 'table-header' }, [
// h('span', '销量'), // h('span', '销量'),
...@@ -151,7 +230,7 @@ export default { ...@@ -151,7 +230,7 @@ export default {
}, },
{ {
label: '库存', label: '库存',
width:150, width: 200,
sortable: true, sortable: true,
formatter: cell => { formatter: cell => {
return cell.stock == -1 ? '无限制' : cell.stock return cell.stock == -1 ? '无限制' : cell.stock
...@@ -159,10 +238,17 @@ export default { ...@@ -159,10 +238,17 @@ export default {
}, },
{ {
label: '商品状态', label: '商品状态',
width:110, width: 110,
formatter: cell => { formatter: cell => {
return ['待上架', '上架', '下架'][cell.status] return ['待上架', '上架', '下架'][cell.status]
} }
},
{
label: '操作',
prop: '',
width: '200px',
fixed: 'right',
addHtml: 'table-btns'
} }
] ]
}, },
...@@ -176,11 +262,12 @@ export default { ...@@ -176,11 +262,12 @@ export default {
this.getAllBrandList() this.getAllBrandList()
}, },
methods: { methods: {
getGoodsListData() {},
handleClose() { handleClose() {
this.isVisible = !this.isVisible this.isVisible = !this.isVisible
}, },
copyLink(){ copyLink() {
if(!this.shortLink)return if (!this.shortLink) return
cloneText(this.shortLink) cloneText(this.shortLink)
this.$message.success('复制成功') this.$message.success('复制成功')
this.handleClose() this.handleClose()
...@@ -192,16 +279,22 @@ export default { ...@@ -192,16 +279,22 @@ export default {
if (sapCode) { if (sapCode) {
base_info = `${base_info}&storeCode=${sapCode}` base_info = `${base_info}&storeCode=${sapCode}`
} }
const CHARGE_PATH = 'packageEquity/pages/commodity/chargeDetail/chargeDetail'
const MINI_PATH = 'packageEquity/pages/commodity/detail/detail' const MINI_PATH = 'packageEquity/pages/commodity/detail/detail'
const MINI_OPTIONS = { const MINI_OPTIONS = {
supplier: row.supplier, supplier: row.supplier,
brandName: row.brandName, brandName: row.brandName
id: row.id }
if (row.appearance == 2) {
MINI_OPTIONS.icon = row.icon
}
if (row.appearance == 1) {
MINI_OPTIONS.id = row.id
} }
const ENV = this.$custom_env const ENV = this.$custom_env
let query = `param=${encodeURIComponent(JSON.stringify(MINI_OPTIONS))}&${base_info}` let query = `param=${encodeURIComponent(JSON.stringify(MINI_OPTIONS))}&${base_info}`
let para = { let para = {
path: MINI_PATH, path: row.appearance == 2 ? CHARGE_PATH : MINI_PATH,
query, query,
appId: ENV.channel == 2 ? 'wxfe82b8d65d07808f' : 'wxe10067a63c1856ac', appId: ENV.channel == 2 ? 'wxfe82b8d65d07808f' : 'wxe10067a63c1856ac',
envVersion: ENV.envVersion envVersion: ENV.envVersion
...@@ -213,7 +306,9 @@ export default { ...@@ -213,7 +306,9 @@ export default {
}, },
getAllBrandList() { getAllBrandList() {
this.$apis.orderApi.getAllBrandList().then(res => { this.$apis.orderApi.getAllBrandList().then(res => {
this.goodsBrandList = res.data || [] // this.goodsBrandList = res.data || []
const item = this.searchFormData.find(item => item.name === 'brandName')
item.optionList = res.data
}) })
}, },
jump({ id, status }, copy) { jump({ id, status }, copy) {
...@@ -277,11 +372,10 @@ export default { ...@@ -277,11 +372,10 @@ export default {
handleReset() { handleReset() {
this.flag = false this.flag = false
this.searchForm = {} this.searchForm = {}
this.$nextTick(() => { this.handleSearch()
this.flag = true
})
}, },
handleSearch() { handleSearch() {
this.flag = false
this.$refs.table.refreshTable() this.$refs.table.refreshTable()
}, },
// ['待上架', '上架', '下架'] // // ['待上架', '上架', '下架'] //
...@@ -314,7 +408,6 @@ export default { ...@@ -314,7 +408,6 @@ export default {
confirmButtonText: '是', confirmButtonText: '是',
cancelButtonText: '否', cancelButtonText: '否',
type: 'warning', type: 'warning',
center: true
}) })
.then(() => { .then(() => {
let target = 'deleteGoods' let target = 'deleteGoods'
...@@ -343,23 +436,20 @@ export default { ...@@ -343,23 +436,20 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.addGood { .addGood {
margin-bottom: 20px; margin-bottom: 16px;
// margin-left: 40px;
padding: 8px 16px;
// margin-bottom: 20px;
} }
.con-wrap{ .con-wrap {
height: 191px; height: 191px;
.link{ .link {
width: 536px; width: 536px;
height: 62px; height: 62px;
background: #F9F9F9; background: #f9f9f9;
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
} }
} }
.flex_cc{ .flex_cc {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
......
...@@ -4,6 +4,12 @@ const node_env = process.env.NODE_ENV === 'production' ...@@ -4,6 +4,12 @@ const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/' const publicPath = node_env ? `/child/${packageName}/` : '/'
// const baseUrl = process.env.VUE_APP_BASE_URL; // const baseUrl = process.env.VUE_APP_BASE_URL;
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
// css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.13.0/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
}
module.exports = { module.exports = {
outputDir: `dist`, outputDir: `dist`,
publicPath, publicPath,
...@@ -34,6 +40,11 @@ module.exports = { ...@@ -34,6 +40,11 @@ module.exports = {
} }
}, },
chainWebpack: config => { chainWebpack: config => {
config.plugin('html').tap(args => {
// args[0].minify.removeComments = false;
args[0].cdn = cdn
return args
})
config.plugins.delete('preload') // TODO: need test config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test config.plugins.delete('prefetch') // TODO: need test
config.resolve.alias config.resolve.alias
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!