diff --git a/.env.development b/.env.development index d9a2132..ef711df 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ ENV = 'development' # 接口地址 -VUE_APP_BASE_API = 'http://localhost:8000' -VUE_APP_WS_API = 'ws://localhost:8000' +VUE_APP_BASE_API = 'http://192.168.2.128:8000' +VUE_APP_WS_API = 'ws://192.168.2.128:8000' # 是否启用 babel-plugin-dynamic-import-node插件 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/package.json b/package.json index 21e3b87..96d5e4f 100644 --- a/package.json +++ b/package.json @@ -16,17 +16,6 @@ "dev_t": "set NODE_OPTIONS=\"--openssl-legacy-provider\" & npm run dev\n" }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, - "lint-staged": { - "src/**/*.{js,vue}": [ - "eslint --fix", - "git add" - ] - }, "repository": { "type": "git", "url": "https://github.com/elunez/eladmin-web.git" diff --git a/src/api/shop.js b/src/api/shop.js new file mode 100644 index 0000000..c6be2c5 --- /dev/null +++ b/src/api/shop.js @@ -0,0 +1,13 @@ +import request from '@/utils/request' + +/** + * 商品列表 + * @returns + */ +export function tbProduct(params) { + return request({ + url: '/api/tbProduct', + method: 'get', + params + }) +} diff --git a/src/api/tbProductGroup.js b/src/api/tbProductGroup.js index 91ba5c4..f78b3cb 100644 --- a/src/api/tbProductGroup.js +++ b/src/api/tbProductGroup.js @@ -24,15 +24,10 @@ export function edit(data) { }) } -export function addProduct(page,size){ +export function addProduct(data) { return request({ url: '/api/tbProductGroup/addProduct', - menthod:'post', - data: { - page, - size - } + menthod: 'post', + data }) } - -export default { add, edit, del ,addProduct} diff --git a/src/views/product/group/index.vue b/src/views/product/group/index.vue index 36284de..407af61 100644 --- a/src/views/product/group/index.vue +++ b/src/views/product/group/index.vue @@ -23,20 +23,20 @@ - +添加商品 + +添加商品 - - - - + + + + 取 消 确 定 - + @@ -79,7 +79,7 @@ import rrOperation from '@crud/RR.operation' import crudOperation from '@crud/CRUD.operation' import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' -import {addProduct} from '@/api/tbProductGroup' +import { addProduct } from '@/api/tbProductGroup' const defaultForm = { id: null, name: null, merchantId: null, shopId: null, pic: null, isShow: null, detail: null, style: null, sort: null, productIds: null, createdAt: null, updatedAt: null } export default { @@ -103,9 +103,9 @@ export default { isShow: [ { required: true, message: '是否显示:1显示 0不显示不能为空', trigger: 'blur' } ] - }, - productList:[], - productClick:false + }, + productList: [], + productClick: false } }, methods: { @@ -113,10 +113,10 @@ export default { [CRUD.HOOK.beforeRefresh]() { return true }, - addProductClick(data){ - this.productClick = true; - addProduct(data).then(res=>{ - this.productList=res; + addProduct(data) { + this.productClick = true + addProduct(data).then(res => { + this.productList = res }) } } diff --git a/src/views/product/index.vue b/src/views/product/index.vue index 764b91b..9a49f9c 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -1,267 +1,147 @@