Compare commits
9 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
cae4cf2ee6 | 1 year ago |
|
|
964ab4417b | 1 year ago |
|
|
398257cae7 | 1 year ago |
|
|
2a61431756 | 1 year ago |
|
|
a435750b36 | 1 year ago |
|
|
f479ef0c9a | 1 year ago |
|
|
12f2e1d3ce | 1 year ago |
|
|
e7f0724ed1 | 1 year ago |
|
|
dd35c6fa7b | 1 year ago |
@ -0,0 +1,12 @@
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}],
|
||||
"stage-2"
|
||||
],
|
||||
"plugins": ["transform-vue-jsx", "transform-runtime"]
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
@ -0,0 +1,14 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
@ -0,0 +1,10 @@
|
||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = {
|
||||
"plugins": {
|
||||
"postcss-import": {},
|
||||
"postcss-url": {},
|
||||
// to edit target browsers: use "browserslist" field in package.json
|
||||
"autoprefixer": {}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [2018-2024] [macrozheng]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,54 @@
|
||||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
console.log('')
|
||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||
console.log()
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
console.log(' ' + warning)
|
||||
}
|
||||
|
||||
console.log()
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,101 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const packageConfig = require('../package.json')
|
||||
|
||||
exports.assetsPath = function (_path) {
|
||||
const assetsSubDirectory = process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsSubDirectory
|
||||
: config.dev.assetsSubDirectory
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
exports.cssLoaders = function (options) {
|
||||
options = options || {}
|
||||
|
||||
const cssLoader = {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
const postcssLoader = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders (loader, loaderOptions) {
|
||||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
options: Object.assign({}, loaderOptions, {
|
||||
sourceMap: options.sourceMap
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Extract CSS when that option is specified
|
||||
// (which is the case during production build)
|
||||
if (options.extract) {
|
||||
return ExtractTextPlugin.extract({
|
||||
use: loaders,
|
||||
fallback: 'vue-style-loader'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function (options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction
|
||||
? config.build.productionSourceMap
|
||||
: config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './src/main.js'
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsPublicPath
|
||||
: config.dev.assetsPublicPath
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js',
|
||||
'@': resolve('src'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
loader: 'svg-sprite-loader',
|
||||
include: [resolve('src/icons')],
|
||||
options: {
|
||||
symbolId: 'icon-[name]'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
exclude: resolve('src/icons'),
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// source contains it (although only uses it if it's native).
|
||||
setImmediate: false,
|
||||
// prevent webpack from injecting mocks to Node native modules
|
||||
// that does not make sense for the client
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||
],
|
||||
},
|
||||
hot: true,
|
||||
contentBase: false, // since we use CopyWebpackPlugin.
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay
|
||||
? { warnings: false, errors: true }
|
||||
: false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors
|
||||
? utils.createNotifierCallback()
|
||||
: undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,145 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const env = require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
||||
@ -0,0 +1,8 @@
|
||||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"',
|
||||
BASE_API: '"http://localhost:8080"'
|
||||
})
|
||||
@ -0,0 +1,69 @@
|
||||
'use strict'
|
||||
// Template version: 1.3.1
|
||||
// see http://vuejs-templates.github.io/webpack for documentation.
|
||||
|
||||
const path = require('path')
|
||||
|
||||
module.exports = {
|
||||
dev: {
|
||||
|
||||
// Paths
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: '/',
|
||||
proxyTable: {},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
port: 8090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: false,
|
||||
errorOverlay: true,
|
||||
notifyOnErrors: true,
|
||||
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
|
||||
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
// https://webpack.js.org/configuration/devtool/#development
|
||||
devtool: 'cheap-module-eval-source-map',
|
||||
|
||||
// If you have problems debugging vue-files in devtools,
|
||||
// set this to false - it *may* help
|
||||
// https://vue-loader.vuejs.org/en/options.html#cachebusting
|
||||
cacheBusting: true,
|
||||
|
||||
cssSourceMap: true
|
||||
},
|
||||
|
||||
build: {
|
||||
// Template for index.html
|
||||
index: path.resolve(__dirname, '../dist/index.html'),
|
||||
|
||||
// Paths
|
||||
assetsRoot: path.resolve(__dirname, '../dist'),
|
||||
assetsSubDirectory: 'static',
|
||||
assetsPublicPath: './',
|
||||
|
||||
/**
|
||||
* Source Maps
|
||||
*/
|
||||
|
||||
productionSourceMap: true,
|
||||
// https://webpack.js.org/configuration/devtool/#production
|
||||
devtool: '#source-map',
|
||||
|
||||
// Gzip off by default as many popular static hosts such as
|
||||
// Surge or Netlify already gzip all static assets for you.
|
||||
// Before setting to `true`, make sure to:
|
||||
// npm install --save-dev compression-webpack-plugin
|
||||
productionGzip: false,
|
||||
productionGzipExtensions: ['js', 'css'],
|
||||
|
||||
// Run the build command with an extra argument to
|
||||
// View the bundle analyzer report after build finishes:
|
||||
// `npm run build --report`
|
||||
// Set to `true` or `false` to always turn it on or off
|
||||
bundleAnalyzerReport: process.env.npm_config_report
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"',
|
||||
BASE_API: '"https://admin-api.macrozheng.com"'
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title>mall-admin-web</title>
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-73YJPXJTLX"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'G-73YJPXJTLX');
|
||||
</script>
|
||||
<!--Baidu Analytics-->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?8b02a318fde5831da10426656a43d03c";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script src="./static/tinymce4.7.5/tinymce.min.js"></script>
|
||||
<!--<script src="https://unpkg.com/tinymce@4.7.5/tinymce.min.js"></script>-->
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,3 @@
|
||||
export { default as Navbar } from './Navbar'
|
||||
export { default as Sidebar } from './Sidebar'
|
||||
export { default as AppMain } from './AppMain'
|
||||
@ -0,0 +1,41 @@
|
||||
import store from '@/store'
|
||||
|
||||
const { body } = document
|
||||
const WIDTH = 1024
|
||||
const RATIO = 3
|
||||
|
||||
export default {
|
||||
watch: {
|
||||
$route(route) {
|
||||
if (this.device === 'mobile' && this.sidebar.opened) {
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: false })
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
window.addEventListener('resize', this.resizeHandler)
|
||||
},
|
||||
mounted() {
|
||||
const isMobile = this.isMobile()
|
||||
if (isMobile) {
|
||||
store.dispatch('ToggleDevice', 'mobile')
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: true })
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isMobile() {
|
||||
const rect = body.getBoundingClientRect()
|
||||
return rect.width - RATIO < WIDTH
|
||||
},
|
||||
resizeHandler() {
|
||||
if (!document.hidden) {
|
||||
const isMobile = this.isMobile()
|
||||
store.dispatch('ToggleDevice', isMobile ? 'mobile' : 'desktop')
|
||||
|
||||
if (isMobile) {
|
||||
store.dispatch('CloseSideBar', { withoutAnimation: true })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,74 @@
|
||||
{
|
||||
"name": "mall-admin-web",
|
||||
"version": "1.0.0",
|
||||
"description": "mall后台管理前端",
|
||||
"author": "macro",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"build": "node build/build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.0",
|
||||
"echarts": "^4.2.0-rc.2",
|
||||
"element-ui": "^2.3.7",
|
||||
"js-cookie": "^2.2.0",
|
||||
"normalize.css": "^8.0.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"sass": "^1.32.8",
|
||||
"v-charts": "^1.19.0",
|
||||
"v-distpicker": "^1.0.20",
|
||||
"vue": "^2.7.2",
|
||||
"vue-router": "^3.0.1",
|
||||
"vuex": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^7.1.2",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-runtime": "^6.22.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.28.0",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.4",
|
||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"node-notifier": "^5.1.2",
|
||||
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-loader": "^2.0.8",
|
||||
"postcss-url": "^7.2.1",
|
||||
"rimraf": "^2.6.0",
|
||||
"sass-loader": "^7.0.1",
|
||||
"semver": "^5.3.0",
|
||||
"shelljs": "^0.7.6",
|
||||
"svg-sprite-loader": "^3.7.3",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-style-loader": "^3.0.1",
|
||||
"vue-template-compiler": "^2.5.2",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-bundle-analyzer": "^2.9.0",
|
||||
"webpack-dev-server": "^2.9.1",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="productAttr" :rules="rules" ref="productAttrFrom" label-width="150px">
|
||||
<el-form-item label="属性名称:" prop="name">
|
||||
<el-input v-model="productAttr.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品类型:">
|
||||
<el-select v-model="productAttr.productAttributeCategoryId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in productAttrCateList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类筛选样式:">
|
||||
<el-radio-group v-model="productAttr.filterType">
|
||||
<el-radio :label="0">普通</el-radio>
|
||||
<el-radio :label="1">颜色</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="能否进行检索:">
|
||||
<el-radio-group v-model="productAttr.searchType">
|
||||
<el-radio :label="0">不需要检索</el-radio>
|
||||
<el-radio :label="1">关键字检索</el-radio>
|
||||
<el-radio :label="2">范围检索</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品属性关联:">
|
||||
<el-radio-group v-model="productAttr.relatedStatus">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性是否可选:">
|
||||
<el-radio-group v-model="productAttr.selectType">
|
||||
<el-radio :label="0">唯一</el-radio>
|
||||
<el-radio :label="1">单选</el-radio>
|
||||
<el-radio :label="2">复选</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性值的录入方式:">
|
||||
<el-radio-group v-model="productAttr.inputType">
|
||||
<el-radio :label="0">手工录入</el-radio>
|
||||
<el-radio :label="1">从下面列表中选择</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="属性值可选值列表:">
|
||||
<el-input :autosize="true" type="textarea" v-model="inputListFormat"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否支持手动新增:">
|
||||
<el-radio-group v-model="productAttr.handAddStatus">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序属性:">
|
||||
<el-input v-model="productAttr.sort"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('productAttrFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('productAttrFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {fetchList} from '@/api/productAttrCate'
|
||||
import {createProductAttr,getProductAttr,updateProductAttr} from '@/api/productAttr'
|
||||
|
||||
const defaultProductAttr = {
|
||||
filterType: 0,
|
||||
handAddStatus: 0,
|
||||
inputList: '',
|
||||
inputType: 0,
|
||||
name: '',
|
||||
productAttributeCategoryId: 0,
|
||||
relatedStatus: 0,
|
||||
searchType: 0,
|
||||
selectType: 0,
|
||||
sort: 0,
|
||||
type: 0
|
||||
};
|
||||
export default {
|
||||
name: "ProductAttrDetail",
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
productAttr: Object.assign({}, defaultProductAttr),
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入属性名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
productAttrCateList: null,
|
||||
inputListFormat:null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if(this.isEdit){
|
||||
getProductAttr(this.$route.query.id).then(response => {
|
||||
this.productAttr = response.data;
|
||||
this.inputListFormat = this.productAttr.inputList.replace(/,/g,'\n');
|
||||
});
|
||||
}else{
|
||||
this.resetProductAttr();
|
||||
}
|
||||
this.getCateList();
|
||||
},
|
||||
watch:{
|
||||
inputListFormat: function (newValue, oldValue) {
|
||||
newValue = newValue.replace(/\n/g,',');
|
||||
this.productAttr.inputList = newValue;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCateList() {
|
||||
let listQuery = {pageNum: 1, pageSize: 100};
|
||||
fetchList(listQuery).then(response => {
|
||||
this.productAttrCateList = response.data.list;
|
||||
});
|
||||
},
|
||||
resetProductAttr() {
|
||||
this.productAttr = Object.assign({}, defaultProductAttr);
|
||||
this.productAttr.productAttributeCategoryId = Number(this.$route.query.cid);
|
||||
this.productAttr.type = Number(this.$route.query.type);
|
||||
},
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if(this.isEdit){
|
||||
updateProductAttr(this.$route.query.id,this.productAttr).then(response=>{
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
}else{
|
||||
createProductAttr(this.productAttr).then(response=>{
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.resetForm('productAttrFrom');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.resetProductAttr();
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="productCate"
|
||||
:rules="rules"
|
||||
ref="productCateFrom"
|
||||
label-width="150px">
|
||||
<el-form-item label="分类名称:" prop="name">
|
||||
<el-input v-model="productCate.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上级分类:">
|
||||
<el-select v-model="productCate.parentId"
|
||||
placeholder="请选择分类">
|
||||
<el-option
|
||||
v-for="item in selectProductCateList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量单位:">
|
||||
<el-input v-model="productCate.productUnit"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序:">
|
||||
<el-input v-model="productCate.sort"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否显示:">
|
||||
<el-radio-group v-model="productCate.showStatus">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否显示在导航栏:">
|
||||
<el-radio-group v-model="productCate.navStatus">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类图标:">
|
||||
<single-upload v-model="productCate.icon"></single-upload>
|
||||
</el-form-item>
|
||||
<el-form-item v-for="(filterProductAttr, index) in filterProductAttrList"
|
||||
:label="index | filterLabelFilter"
|
||||
:key="filterProductAttr.key"
|
||||
>
|
||||
<el-cascader
|
||||
clearable
|
||||
v-model="filterProductAttr.value"
|
||||
:options="filterAttrs">
|
||||
</el-cascader>
|
||||
<el-button style="margin-left: 20px" @click.prevent="removeFilterAttr(filterProductAttr)">删除</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="small" type="primary" @click="handleAddFilterAttr()">新增</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键词:">
|
||||
<el-input v-model="productCate.keywords"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类描述:">
|
||||
<el-input type="textarea" :autosize="true" v-model="productCate.description"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit('productCateFrom')">提交</el-button>
|
||||
<el-button v-if="!isEdit" @click="resetForm('productCateFrom')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {fetchList, createProductCate, updateProductCate, getProductCate} from '@/api/productCate';
|
||||
import {fetchListWithAttr} from '@/api/productAttrCate';
|
||||
import {getProductAttrInfo} from '@/api/productAttr';
|
||||
import SingleUpload from '@/components/Upload/singleUpload';
|
||||
|
||||
const defaultProductCate = {
|
||||
description: '',
|
||||
icon: '',
|
||||
keywords: '',
|
||||
name: '',
|
||||
navStatus: 0,
|
||||
parentId: 0,
|
||||
productUnit: '',
|
||||
showStatus: 0,
|
||||
sort: 0,
|
||||
productAttributeIdList: []
|
||||
};
|
||||
export default {
|
||||
name: "ProductCateDetail",
|
||||
components: {SingleUpload},
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
productCate: Object.assign({}, defaultProductCate),
|
||||
selectProductCateList: [],
|
||||
rules: {
|
||||
name: [
|
||||
{required: true, message: '请输入品牌名称', trigger: 'blur'},
|
||||
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
|
||||
]
|
||||
},
|
||||
filterAttrs: [],
|
||||
filterProductAttrList: [{
|
||||
value: []
|
||||
}]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.isEdit) {
|
||||
getProductCate(this.$route.query.id).then(response => {
|
||||
this.productCate = response.data;
|
||||
});
|
||||
getProductAttrInfo(this.$route.query.id).then(response => {
|
||||
if (response.data != null && response.data.length > 0) {
|
||||
this.filterProductAttrList = [];
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.filterProductAttrList.push({
|
||||
key: Date.now() + i,
|
||||
value: [response.data[i].attributeCategoryId, response.data[i].attributeId]
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.productCate = Object.assign({}, defaultProductCate);
|
||||
}
|
||||
this.getSelectProductCateList();
|
||||
this.getProductAttrCateList();
|
||||
},
|
||||
methods: {
|
||||
getSelectProductCateList() {
|
||||
fetchList(0, {pageSize: 100, pageNum: 1}).then(response => {
|
||||
this.selectProductCateList = response.data.list;
|
||||
this.selectProductCateList.unshift({id: 0, name: '无上级分类'});
|
||||
});
|
||||
},
|
||||
getProductAttrCateList() {
|
||||
fetchListWithAttr().then(response => {
|
||||
let list = response.data;
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
let productAttrCate = list[i];
|
||||
let children = [];
|
||||
if (productAttrCate.productAttributeList != null && productAttrCate.productAttributeList.length > 0) {
|
||||
for (let j = 0; j < productAttrCate.productAttributeList.length; j++) {
|
||||
children.push({
|
||||
label: productAttrCate.productAttributeList[j].name,
|
||||
value: productAttrCate.productAttributeList[j].id
|
||||
})
|
||||
}
|
||||
}
|
||||
this.filterAttrs.push({label: productAttrCate.name, value: productAttrCate.id, children: children});
|
||||
}
|
||||
});
|
||||
},
|
||||
getProductAttributeIdList() {
|
||||
//获取选中的筛选商品属性
|
||||
let productAttributeIdList = [];
|
||||
for (let i = 0; i < this.filterProductAttrList.length; i++) {
|
||||
let item = this.filterProductAttrList[i];
|
||||
if (item.value !== null && item.value.length === 2) {
|
||||
productAttributeIdList.push(item.value[1]);
|
||||
}
|
||||
}
|
||||
return productAttributeIdList;
|
||||
},
|
||||
onSubmit(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('是否提交数据', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.isEdit) {
|
||||
this.productCate.productAttributeIdList = this.getProductAttributeIdList();
|
||||
updateProductCate(this.$route.query.id, this.productCate).then(response => {
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.$router.back();
|
||||
});
|
||||
} else {
|
||||
this.productCate.productAttributeIdList = this.getProductAttributeIdList();
|
||||
createProductCate(this.productCate).then(response => {
|
||||
this.$refs[formName].resetFields();
|
||||
this.resetForm(formName);
|
||||
this.$message({
|
||||
message: '提交成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: '验证失败',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
this.productCate = Object.assign({}, defaultProductCate);
|
||||
this.getSelectProductCateList();
|
||||
this.filterProductAttrList = [{
|
||||
value: []
|
||||
}];
|
||||
},
|
||||
removeFilterAttr(productAttributeId) {
|
||||
if (this.filterProductAttrList.length === 1) {
|
||||
this.$message({
|
||||
message: '至少要留一个',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
var index = this.filterProductAttrList.indexOf(productAttributeId);
|
||||
if (index !== -1) {
|
||||
this.filterProductAttrList.splice(index, 1)
|
||||
}
|
||||
},
|
||||
handleAddFilterAttr() {
|
||||
if (this.filterProductAttrList.length === 3) {
|
||||
this.$message({
|
||||
message: '最多添加三个',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.filterProductAttrList.push({
|
||||
value: null,
|
||||
key: Date.now()
|
||||
});
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
filterLabelFilter(index) {
|
||||
if (index === 0) {
|
||||
return '筛选属性:';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/brand/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function createBrand(data) {
|
||||
return request({
|
||||
url:'/brand/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function updateShowStatus(data) {
|
||||
return request({
|
||||
url:'/brand/update/showStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateFactoryStatus(data) {
|
||||
return request({
|
||||
url:'/brand/update/factoryStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteBrand(id) {
|
||||
return request({
|
||||
url:'/brand/delete/'+id,
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function getBrand(id) {
|
||||
return request({
|
||||
url:'/brand/'+id,
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateBrand(id,data) {
|
||||
return request({
|
||||
url:'/brand/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList() {
|
||||
return request({
|
||||
url:'/companyAddress/list',
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/coupon/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function createCoupon(data) {
|
||||
return request({
|
||||
url:'/coupon/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function getCoupon(id) {
|
||||
return request({
|
||||
url:'/coupon/'+id,
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateCoupon(id,data) {
|
||||
return request({
|
||||
url:'/coupon/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteCoupon(id) {
|
||||
return request({
|
||||
url:'/coupon/delete/'+id,
|
||||
method:'post',
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/couponHistory/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/flash/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function updateStatus(id,params) {
|
||||
return request({
|
||||
url:'/flash/update/status/'+id,
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function deleteFlash(id) {
|
||||
return request({
|
||||
url:'/flash/delete/'+id,
|
||||
method:'post'
|
||||
})
|
||||
}
|
||||
export function createFlash(data) {
|
||||
return request({
|
||||
url:'/flash/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function updateFlash(id,data) {
|
||||
return request({
|
||||
url:'/flash/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/flashProductRelation/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function createFlashProductRelation(data) {
|
||||
return request({
|
||||
url:'/flashProductRelation/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function deleteFlashProductRelation(id) {
|
||||
return request({
|
||||
url:'/flashProductRelation/delete/'+id,
|
||||
method:'post'
|
||||
})
|
||||
}
|
||||
export function updateFlashProductRelation(id,data) {
|
||||
return request({
|
||||
url:'/flashProductRelation/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url: '/flashSession/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchSelectList(params) {
|
||||
return request({
|
||||
url: '/flashSession/selectList',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateStatus(id, params) {
|
||||
return request({
|
||||
url: '/flashSession/update/status/' + id,
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteSession(id) {
|
||||
return request({
|
||||
url: '/flashSession/delete/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function createSession(data) {
|
||||
return request({
|
||||
url: '/flashSession/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateSession(id, data) {
|
||||
return request({
|
||||
url: '/flashSession/update/' + id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/home/advertise/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function updateStatus(id,params) {
|
||||
return request({
|
||||
url:'/home/advertise/update/status/'+id,
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function deleteHomeAdvertise(data) {
|
||||
return request({
|
||||
url:'/home/advertise/delete',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function createHomeAdvertise(data) {
|
||||
return request({
|
||||
url:'/home/advertise/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function getHomeAdvertise(id) {
|
||||
return request({
|
||||
url:'/home/advertise/'+id,
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateHomeAdvertise(id,data) {
|
||||
return request({
|
||||
url:'/home/advertise/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/home/brand/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRecommendStatus(data) {
|
||||
return request({
|
||||
url:'/home/brand/update/recommendStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteHomeBrand(data) {
|
||||
return request({
|
||||
url:'/home/brand/delete',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function createHomeBrand(data) {
|
||||
return request({
|
||||
url:'/home/brand/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateHomeBrandSort(params) {
|
||||
return request({
|
||||
url:'/home/brand/update/sort/'+params.id,
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/home/recommendSubject/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRecommendStatus(data) {
|
||||
return request({
|
||||
url:'/home/recommendSubject/update/recommendStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteHomeSubject(data) {
|
||||
return request({
|
||||
url:'/home/recommendSubject/delete',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function createHomeSubject(data) {
|
||||
return request({
|
||||
url:'/home/recommendSubject/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateHomeSubjectSort(params) {
|
||||
return request({
|
||||
url:'/home/recommendSubject/update/sort/'+params.id,
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/home/recommendProduct/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRecommendStatus(data) {
|
||||
return request({
|
||||
url:'/home/recommendProduct/update/recommendStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteHotProduct(data) {
|
||||
return request({
|
||||
url:'/home/recommendProduct/delete',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function createHotProduct(data) {
|
||||
return request({
|
||||
url:'/home/recommendProduct/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateHotProductSort(params) {
|
||||
return request({
|
||||
url:'/home/recommendProduct/update/sort/'+params.id,
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function login(username, password) {
|
||||
return request({
|
||||
url: '/admin/login',
|
||||
method: 'post',
|
||||
data: {
|
||||
username,
|
||||
password
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: '/admin/info',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function logout() {
|
||||
return request({
|
||||
url: '/admin/logout',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url: '/admin/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function createAdmin(data) {
|
||||
return request({
|
||||
url: '/admin/register',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateAdmin(id, data) {
|
||||
return request({
|
||||
url: '/admin/update/' + id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateStatus(id, params) {
|
||||
return request({
|
||||
url: '/admin/updateStatus/' + id,
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteAdmin(id) {
|
||||
return request({
|
||||
url: '/admin/delete/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function getRoleByAdmin(id) {
|
||||
return request({
|
||||
url: '/admin/role/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function allocRole(data) {
|
||||
return request({
|
||||
url: '/admin/role/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/memberLevel/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function fetchList(parentId, params) {
|
||||
return request({
|
||||
url: '/menu/list/' + parentId,
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteMenu(id) {
|
||||
return request({
|
||||
url: '/menu/delete/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function createMenu(data) {
|
||||
return request({
|
||||
url: '/menu/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMenu(id, data) {
|
||||
return request({
|
||||
url: '/menu/update/' + id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function getMenu(id) {
|
||||
return request({
|
||||
url: '/menu/' + id,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateHidden(id, params) {
|
||||
return request({
|
||||
url: '/menu/updateHidden/' + id,
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchTreeList() {
|
||||
return request({
|
||||
url: '/menu/treeList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/home/newProduct/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRecommendStatus(data) {
|
||||
return request({
|
||||
url:'/home/newProduct/update/recommendStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteNewProduct(data) {
|
||||
return request({
|
||||
url:'/home/newProduct/delete',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function createNewProduct(data) {
|
||||
return request({
|
||||
url:'/home/newProduct/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateNewProductSort(params) {
|
||||
return request({
|
||||
url:'/home/newProduct/update/sort/'+params.id,
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/order/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function closeOrder(params) {
|
||||
return request({
|
||||
url:'/order/update/close',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteOrder(params) {
|
||||
return request({
|
||||
url:'/order/delete',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function deliveryOrder(data) {
|
||||
return request({
|
||||
url:'/order/update/delivery',
|
||||
method:'post',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
|
||||
export function getOrderDetail(id) {
|
||||
return request({
|
||||
url:'/order/'+id,
|
||||
method:'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function updateReceiverInfo(data) {
|
||||
return request({
|
||||
url:'/order/update/receiverInfo',
|
||||
method:'post',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
|
||||
export function updateMoneyInfo(data) {
|
||||
return request({
|
||||
url:'/order/update/moneyInfo',
|
||||
method:'post',
|
||||
data:data
|
||||
});
|
||||
}
|
||||
|
||||
export function updateOrderNote(params) {
|
||||
return request({
|
||||
url:'/order/update/note',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
import request from '@/utils/request'
|
||||
export function getOrderSetting(id) {
|
||||
return request({
|
||||
url:'/orderSetting/'+id,
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateOrderSetting(id,data) {
|
||||
return request({
|
||||
url:'/orderSetting/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
export function policy() {
|
||||
return request({
|
||||
url:'/aliyun/oss/policy',
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList() {
|
||||
return request({
|
||||
url:'/prefrenceArea/listAll',
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/product/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchSimpleList(params) {
|
||||
return request({
|
||||
url:'/product/simpleList',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateDeleteStatus(params) {
|
||||
return request({
|
||||
url:'/product/update/deleteStatus',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateNewStatus(params) {
|
||||
return request({
|
||||
url:'/product/update/newStatus',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRecommendStatus(params) {
|
||||
return request({
|
||||
url:'/product/update/recommendStatus',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePublishStatus(params) {
|
||||
return request({
|
||||
url:'/product/update/publishStatus',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function createProduct(data) {
|
||||
return request({
|
||||
url:'/product/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateProduct(id,data) {
|
||||
return request({
|
||||
url:'/product/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function getProduct(id) {
|
||||
return request({
|
||||
url:'/product/updateInfo/'+id,
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(cid,params) {
|
||||
return request({
|
||||
url:'/productAttribute/list/'+cid,
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteProductAttr(data) {
|
||||
return request({
|
||||
url:'/productAttribute/delete',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function createProductAttr(data) {
|
||||
return request({
|
||||
url:'/productAttribute/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateProductAttr(id,data) {
|
||||
return request({
|
||||
url:'/productAttribute/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function getProductAttr(id) {
|
||||
return request({
|
||||
url:'/productAttribute/'+id,
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getProductAttrInfo(productCategoryId) {
|
||||
return request({
|
||||
url:'/productAttribute/attrInfo/'+productCategoryId,
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/productAttribute/category/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function createProductAttrCate(data) {
|
||||
return request({
|
||||
url:'/productAttribute/category/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteProductAttrCate(id) {
|
||||
return request({
|
||||
url:'/productAttribute/category/delete/'+id,
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function updateProductAttrCate(id,data) {
|
||||
return request({
|
||||
url:'/productAttribute/category/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
export function fetchListWithAttr() {
|
||||
return request({
|
||||
url:'/productAttribute/category/list/withAttr',
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(parentId,params) {
|
||||
return request({
|
||||
url:'/productCategory/list/'+parentId,
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function deleteProductCate(id) {
|
||||
return request({
|
||||
url:'/productCategory/delete/'+id,
|
||||
method:'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function createProductCate(data) {
|
||||
return request({
|
||||
url:'/productCategory/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateProductCate(id,data) {
|
||||
return request({
|
||||
url:'/productCategory/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function getProductCate(id) {
|
||||
return request({
|
||||
url:'/productCategory/'+id,
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function updateShowStatus(data) {
|
||||
return request({
|
||||
url:'/productCategory/update/showStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateNavStatus(data) {
|
||||
return request({
|
||||
url:'/productCategory/update/navStatus',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchListWithChildren() {
|
||||
return request({
|
||||
url:'/productCategory/list/withChildren',
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url: '/resource/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function createResource(data) {
|
||||
return request({
|
||||
url: '/resource/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateResource(id, data) {
|
||||
return request({
|
||||
url: '/resource/update/' + id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteResource(id) {
|
||||
return request({
|
||||
url: '/resource/delete/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchAllResourceList() {
|
||||
return request({
|
||||
url: '/resource/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listAllCate() {
|
||||
return request({
|
||||
url: '/resourceCategory/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function createResourceCategory(data) {
|
||||
return request({
|
||||
url: '/resourceCategory/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateResourceCategory(id, data) {
|
||||
return request({
|
||||
url: '/resourceCategory/update/' + id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteResourceCategory(id) {
|
||||
return request({
|
||||
url: '/resourceCategory/delete/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/returnApply/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteApply(params) {
|
||||
return request({
|
||||
url:'/returnApply/delete',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
export function updateApplyStatus(id,data) {
|
||||
return request({
|
||||
url:'/returnApply/update/status/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function getApplyDetail(id) {
|
||||
return request({
|
||||
url:'/returnApply/'+id,
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/returnReason/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteReason(params) {
|
||||
return request({
|
||||
url:'/returnReason/delete',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function updateStatus(params) {
|
||||
return request({
|
||||
url:'/returnReason/update/status',
|
||||
method:'post',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function addReason(data) {
|
||||
return request({
|
||||
url:'/returnReason/create',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function getReasonDetail(id) {
|
||||
return request({
|
||||
url:'/returnReason/'+id,
|
||||
method:'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function updateReason(id,data) {
|
||||
return request({
|
||||
url:'/returnReason/update/'+id,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url: '/role/list',
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function createRole(data) {
|
||||
return request({
|
||||
url: '/role/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateRole(id, data) {
|
||||
return request({
|
||||
url: '/role/update/' + id,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateStatus(id, params) {
|
||||
return request({
|
||||
url: '/role/updateStatus/' + id,
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteRole(data) {
|
||||
return request({
|
||||
url:'/role/delete',
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchAllRoleList() {
|
||||
return request({
|
||||
url: '/role/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function listMenuByRole(roleId) {
|
||||
return request({
|
||||
url: '/role/listMenu/'+roleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function listResourceByRole(roleId) {
|
||||
return request({
|
||||
url: '/role/listResource/'+roleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function allocMenu(data) {
|
||||
return request({
|
||||
url: '/role/allocMenu',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
|
||||
export function allocResource(data) {
|
||||
return request({
|
||||
url: '/role/allocResource',
|
||||
method: 'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchList(pid,params) {
|
||||
return request({
|
||||
url:'/sku/'+pid,
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
||||
export function update(pid,data) {
|
||||
return request({
|
||||
url:'/sku/update/'+pid,
|
||||
method:'post',
|
||||
data:data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
import request from '@/utils/request'
|
||||
export function fetchListAll() {
|
||||
return request({
|
||||
url:'/subject/listAll',
|
||||
method:'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(params) {
|
||||
return request({
|
||||
url:'/subject/list',
|
||||
method:'get',
|
||||
params:params
|
||||
})
|
||||
}
|
||||
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 1.0 MiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue