2022-8-5 广告

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

@ -1,7 +1,7 @@
<!--新增门店--> <!--新增门店-->
<template> <template>
<div> <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> <template v-slot:belongsMerchant>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label"> <div class="xy-table-item-label">
@ -248,16 +248,7 @@ export default {
this.form.lng = res.longitude this.form.lng = res.longitude
} }
}else{ }else{
this.form = { this.$refs['dialog'].reset()
belongsMerchant:'',
name:'',
password:'',
contact:'',
contactNumber:'',
address:'',
lng:'',//
lat:'',//
}
} }
} }
}, },

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

@ -23,8 +23,10 @@
</div> </div>
<div class="selects-item"> <div class="selects-item">
<div class="selects-item-label">有效时间</div> <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> <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>
<div class="selects-item"> <div class="selects-item">
@ -80,7 +82,7 @@ export default {
name:'', name:'',
system:'', system:'',
createDate:[], createDate:[],
effectiveDate:[] isEffect:''
}, },
total:0, total:0,
@ -109,7 +111,7 @@ export default {
{ {
label:'发布系统', label:'发布系统',
width: 180, width: 180,
prop:'origin_system' prop:'origin_system_detail.value'
}, },
{ {
label:'活动跳转', label:'活动跳转',
@ -124,9 +126,12 @@ export default {
prop:'type', prop:'type',
formatter:(cell,data,value)=>{ formatter:(cell,data,value)=>{
switch (value){ switch (value){
case 1: case 0:
return '首页轮播图' return '首页轮播图'
break; break;
case 1:
return '商品轮播图'
break;
default: default:
return '未知' return '未知'
} }
@ -152,15 +157,14 @@ export default {
label:'有效期', label:'有效期',
width: 220, width: 220,
customFn:(row)=>{ 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:'创建人/创建时间', label:'创建人/创建时间',
width: 220, width: 220,
prop:'created_at', customFn:(row)=>{
formatter:(cell, data, value) => { return (<div>{row.admin.name} / {parseTime(new Date(row.created_at),'{y}-{m}-{d}')}</div>)
return parseTime(new Date(value),'{y}-{m}-{d}') || ''
} }
} }
], ],
@ -184,7 +188,8 @@ export default {
page_size:this.select.pageSize, page_size:this.select.pageSize,
create_begin:this.select.createDate[0], create_begin:this.select.createDate[0],
create_over:this.select.createDate[1], create_over:this.select.createDate[1],
page:this.select.pageIndex page:this.select.pageIndex,
valid_time:this.select.isEffect,
}) })
this.list = res.data this.list = res.data
}, },

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

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

Loading…
Cancel
Save