2022-8-5 广告

master
271556543@qq.com 4 years ago
parent 98f36794d4
commit d5bd9931c6

@ -1,7 +1,7 @@
<!--新增门店-->
<template>
<div>
<xy-dialog :is-show.sync="isShow" :title="type === 'add' ? '新增门店' : '编辑门店'" type="form" :form="form" :rules="rules" @submit="submit">
<xy-dialog ref="dialog" :is-show.sync="isShow" :title="type === 'add' ? '新增门店' : '编辑门店'" type="form" :form="form" :rules="rules" @submit="submit">
<template v-slot:belongsMerchant>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -248,16 +248,7 @@ export default {
this.form.lng = res.longitude
}
}else{
this.form = {
belongsMerchant:'',
name:'',
password:'',
contact:'',
contactNumber:'',
address:'',
lng:'',//
lat:'',//
}
this.$refs['dialog'].reset()
}
}
},

@ -64,7 +64,7 @@
return {
loginForm: {
username: 'admin',
password: 'Yunyubang2021@'
password: ''
},
loginRules: {
username: [{

@ -23,8 +23,10 @@
</div>
<div class="selects-item">
<div class="selects-item-label">有效时间</div>
<DatePicker :value="select.effectiveDate" style="width: 200px;" transfer placeholder="选择有效时间" type="daterange" placement="bottom" @on-change="(e)=>select.effectiveDate = e"></DatePicker>
<div class="selects-item-label">是否在有效期</div>
<Select v-model="select.isEffect" placeholder="是否有效" style="width: 100px;" clearable>
<Option v-for="item in [{value:0,label:'有效'},{value:1,label:'无效'},{value:'',label:'全部'}]" :value="item.value">{{ item.label }}</Option>
</Select>
</div>
<div class="selects-item">
@ -80,7 +82,7 @@ export default {
name:'',
system:'',
createDate:[],
effectiveDate:[]
isEffect:''
},
total:0,
@ -109,7 +111,7 @@ export default {
{
label:'发布系统',
width: 180,
prop:'origin_system'
prop:'origin_system_detail.value'
},
{
label:'活动跳转',
@ -124,9 +126,12 @@ export default {
prop:'type',
formatter:(cell,data,value)=>{
switch (value){
case 1:
case 0:
return '首页轮播图'
break;
case 1:
return '商品轮播图'
break;
default:
return '未知'
}
@ -152,15 +157,14 @@ export default {
label:'有效期',
width: 220,
customFn:(row)=>{
return (<div>{parseTime(new Date(row.valid_time_begin),'{y}-{m}-{d}')} - {parseTime(new Date(row.valid_time_over),'{y}-{m}-{d}')}</div>)
return (<div>{parseTime(new Date(row.valid_time_begin),'{y}-{m}-{d}')} ~ {parseTime(new Date(row.valid_time_over),'{y}-{m}-{d}')}</div>)
}
},
{
label:'创建人/创建时间',
width: 220,
prop:'created_at',
formatter:(cell, data, value) => {
return parseTime(new Date(value),'{y}-{m}-{d}') || ''
customFn:(row)=>{
return (<div>{row.admin.name} / {parseTime(new Date(row.created_at),'{y}-{m}-{d}')}</div>)
}
}
],
@ -184,7 +188,8 @@ export default {
page_size:this.select.pageSize,
create_begin:this.select.createDate[0],
create_over:this.select.createDate[1],
page:this.select.pageIndex
page:this.select.pageIndex,
valid_time:this.select.isEffect,
})
this.list = res.data
},

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增广告' : '编辑广告'" :form="form" :rules="rules" @submit="submit">
<xy-dialog :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增广告' : '编辑广告'" :form="form" :rules="rules" ref="dialog" @submit="submit">
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -133,7 +133,7 @@ export default {
type:'add',
isShow:false,
types:[{label:'首页轮播图',value:1}],
types:[{label:'首页轮播图',value:0},{label:'商品轮播图',value:1}],
states:[
{
label:'禁用',
@ -290,7 +290,7 @@ export default {
this.form.name = res?.name
this.form.state = res?.state
this.form.system = res?.origin_system
this.form.to = Number(res?.action)
this.form.to = res?.action
this.form.sort = res?.sort
this.form.type = res?.type
this.form.img = res?.pic
@ -304,6 +304,8 @@ export default {
if(this.type === 'editor'){
this.getDetailAd()
}
}else{
this.$refs['dialog'].reset()
}
}
}

@ -1,148 +1,148 @@
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = defaultSettings.title || '孕育邦' // page title
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
// You can change the port by the following methods:
// port = 9528 npm run dev OR npm run dev --port = 9528
const port = process.env.port || process.env.npm_config_port || 8012 // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
* You will need to set publicPath if you plan to deploy your site under a sub path,
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then publicPath should be set to "/bar/".
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/yunyubang/yunyubang-service/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项
less: {
javascriptEnabled: true
}
}
},
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: port,
open: true,
overlay: {
warnings: false,
errors: true
},
//before: require('./mock/mock-server.js'),
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: 'http://yunyubang.ali251.langye.net/',
changeOrigin: true, //配置跨域
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
}
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: name,
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [{
rel: 'preload',
// to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}])
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
// set preserveWhitespace
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.end()
config
.when(process.env.NODE_ENV !== 'development',
config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
config
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk('single')
}
)
}
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
function resolve(dir) {
return path.join(__dirname, dir)
}
const name = defaultSettings.title || '孕育邦' // page title
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
// You can change the port by the following methods:
// port = 9528 npm run dev OR npm run dev --port = 9528
const port = process.env.port || process.env.npm_config_port || 8012 // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
/**
* You will need to set publicPath if you plan to deploy your site under a sub path,
* for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/,
* then publicPath should be set to "/bar/".
* In most cases please use '/' !!!
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/liuxiangyu/Work/yunyubang/yunyubang-service/public/admin',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项
less: {
javascriptEnabled: true
}
}
},
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
devServer: {
port: port,
open: true,
overlay: {
warnings: false,
errors: true
},
//before: require('./mock/mock-server.js'),
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: 'https://yunyubang.ali251.langye.net/',
changeOrigin: true, //配置跨域
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
}
}
},
configureWebpack: {
// provide the app's title in webpack's name field, so that
// it can be accessed in index.html to inject the correct title.
name: name,
resolve: {
alias: {
'@': resolve('src')
}
}
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
config.plugin('preload').tap(() => [{
rel: 'preload',
// to ignore runtime.js
// https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171
fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/],
include: 'initial'
}])
// when there are many pages, it will cause too many meaningless requests
config.plugins.delete('prefetch')
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
config.module
.rule('icons')
.test(/\.svg$/)
.include.add(resolve('src/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({
symbolId: 'icon-[name]'
})
.end()
// set preserveWhitespace
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.end()
config
.when(process.env.NODE_ENV !== 'development',
config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
config
.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
libs: {
name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/,
priority: 10,
chunks: 'initial' // only package third parties that are initially dependent
},
elementUI: {
name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
},
commons: {
name: 'chunk-commons',
test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number
priority: 5,
reuseExistingChunk: true
}
}
})
// https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk
config.optimization.runtimeChunk('single')
}
)
}
}

Loading…
Cancel
Save