Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yongxinda-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
yongxinda-admin
Commits
ca537cc2
提交
ca537cc2
authored
10月 24, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
9d3f1cb6
全部展开
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
37 行增加
和
78 行删除
+37
-78
edit.vue
src/views/commodityManage/edit.vue
+25
-73
list.vue
src/views/commodityManage/list.vue
+11
-4
shelves.vue
src/views/commodityManage/shelves.vue
+0
-0
vite.config.ts
vite.config.ts
+1
-1
没有找到文件。
src/views/commodityManage/edit.vue
浏览文件 @
ca537cc2
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-drawer
v-model=
"editDrawer"
size=
"100%"
@
before-close=
"handleCancel"
>
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<h3>
商品介绍
</h3>
<h3>
商品介绍
</h3>
<el-form
ref=
"goodsRef"
:rules=
"rules"
:model=
"goods"
label-width=
"150px"
>
<el-form
ref=
"goodsRef"
:rules=
"rules"
:model=
"goods"
label-width=
"150px"
>
...
@@ -46,8 +47,8 @@
...
@@ -46,8 +47,8 @@
<el-form-item
label=
"宣传画廊"
>
<el-form-item
label=
"宣传画廊"
>
<el-upload
:action=
"uploadPath"
:limit=
"5"
:headers=
"headers"
:on-exceed=
"uploadOverrun"
<el-upload
:action=
"uploadPath"
:limit=
"5"
:headers=
"headers"
:on-exceed=
"uploadOverrun"
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
multiple
accept=
".jpg,.jpeg,.png,.gif"
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
multiple
list-type=
"picture-card"
>
accept=
".jpg,.jpeg,.png,.gif"
list-type=
"picture-card"
>
<el-icon
class=
"avatar-uploader-icon"
>
<el-icon
class=
"avatar-uploader-icon"
>
<Plus
/>
<Plus
/>
</el-icon>
</el-icon>
...
@@ -63,12 +64,14 @@
...
@@ -63,12 +64,14 @@
{{ tag }}
{{ tag }}
</el-tag>
</el-tag>
<el-input
v-if=
"newKeywordVisible"
ref=
"newKeywordInput"
v-model=
"newKeyword"
<el-input
v-if=
"newKeywordVisible"
ref=
"newKeywordInput"
v-model=
"newKeyword"
class=
"input-new-keyword"
@
keyup
.
enter
.
native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
/>
class=
"input-new-keyword"
@
keyup
.
enter
.
native=
"handleInputConfirm"
@
blur=
"handleInputConfirm"
/>
<el-button
v-else
class=
"button-new-keyword"
type=
"primary"
@
click=
"showInput"
>
+ 增加
</el-button>
<el-button
v-else
class=
"button-new-keyword"
type=
"primary"
@
click=
"showInput"
>
+ 增加
</el-button>
</el-form-item>
</el-form-item>
<el-form-item
label=
"商品配件"
>
<el-form-item
label=
"商品配件"
>
<el-select
v-model=
"goods.parts"
multiple
collapse-tags
collapse-tags-tooltip
style=
"width: 240px"
>
<el-select
v-model=
"goodsParts"
multiple
collapse-tags
collapse-tags-tooltip
style=
"width: 240px"
>
<el-option
v-for=
"item in partsList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
<el-option
v-for=
"item in partsList"
:key=
"item.id"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
...
@@ -166,59 +169,6 @@
...
@@ -166,59 +169,6 @@
</el-dialog>
</el-dialog>
</el-card>
</el-card>
<!-- <el-card class="box-card">
<h3>商品库存</h3>
<el-table :data="products">
<el-table-column property="value" label="货品规格">
<template #default="scope">
<el-tag v-for="tag in scope.row.specifications" :key="tag">
{{ tag }}
</el-tag>
</template>
</el-table-column>
<el-table-column property="price" width="100" label="货品售价" />
<el-table-column property="number" width="100" label="货品数量" />
<el-table-column property="url" width="100" label="货品图片">
<template #default="scope">
<img v-if="scope.row.url" :src="scope.row.url" width="40" />
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="100" class-name="small-padding fixed-width">
<template #default="scope">
<el-button type="primary" size="small" @click="handleProductShow(scope.row)">设置</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog v-model="productVisiable" title="添加货品">
<el-form ref="productRef" :model="productForm" status-icon label-position="left" label-width="100px"
style="width: 400px; margin-left: 50px">
<el-form-item label="货品规格列" prop="specifications">
<el-tag v-for="tag in productForm.specifications" :key="tag">
{{ tag }}
</el-tag>
</el-form-item>
<el-form-item label="货品售价" prop="price">
<el-input v-model="productForm.price" />
</el-form-item>
<el-form-item label="货品数量" prop="number">
<el-input v-model="productForm.number" />
</el-form-item>
<el-form-item label="货品图片" prop="url">
<el-upload :action="uploadPath" :show-file-list="false" :headers="headers"
:on-success="uploadProductUrl" class="avatar-uploader" accept=".jpg,.jpeg,.png,.gif">
<img v-if="productForm.url" :src="productForm.url" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon" />
</el-upload>
</el-form-item>
</el-form>
<template #footer class="dialog-footer">
<el-button @click="productVisiable = false">取消</el-button>
<el-button type="primary" @click="handleProductEdit">确定</el-button>
</template>
</el-dialog>
</el-card> -->
<el-card
class=
"box-card"
>
<el-card
class=
"box-card"
>
<h3>
商品参数
</h3>
<h3>
商品参数
</h3>
<el-button
type=
"primary"
@
click=
"handleAttributeShow"
>
添加
</el-button>
<el-button
type=
"primary"
@
click=
"handleAttributeShow"
>
添加
</el-button>
...
@@ -227,14 +177,15 @@
...
@@ -227,14 +177,15 @@
<el-table-column
property=
"value"
label=
"商品参数值"
/>
<el-table-column
property=
"value"
label=
"商品参数值"
/>
<el-table-column
align=
"center"
label=
"操作"
width=
"100"
class-name=
"small-padding fixed-width"
>
<el-table-column
align=
"center"
label=
"操作"
width=
"100"
class-name=
"small-padding fixed-width"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-button
type=
"danger"
size=
"small"
@
click=
"handleAttributeDelete(scope.row)"
>
删除
</el-button>
<el-button
type=
"danger"
size=
"small"
@
click=
"handleAttributeDelete(scope.row)"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
<el-dialog
v-model=
"attributeVisiable"
title=
"添加商品参数"
>
<el-dialog
v-model=
"attributeVisiable"
title=
"添加商品参数"
>
<el-form
ref=
"attributeRef"
:model=
"attributeForm"
status-icon
label-position=
"left"
label-width=
"100px
"
<el-form
ref=
"attributeRef"
:model=
"attributeForm"
status-icon
label-position=
"left
"
style=
"width: 400px; margin-left: 50px"
>
label-width=
"100px"
style=
"width: 400px; margin-left: 50px"
>
<el-form-item
label=
"商品参数名称"
prop=
"attribute"
>
<el-form-item
label=
"商品参数名称"
prop=
"attribute"
>
<el-input
v-model=
"attributeForm.attribute"
/>
<el-input
v-model=
"attributeForm.attribute"
/>
</el-form-item>
</el-form-item>
...
@@ -249,15 +200,16 @@
...
@@ -249,15 +200,16 @@
</el-dialog>
</el-dialog>
</el-card>
</el-card>
<div
class=
"op-container"
>
<
template
#
footer
>
<el-button
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
@
click=
"handleCancel"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"handleEdit"
>
更新商品
</el-button>
<el-button
type=
"primary"
@
click=
"handleEdit"
>
更新商品
</el-button>
</div>
</
template
>
</el-drawer>
</div>
</div>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
computed
,
nextTick
}
from
"vue"
;
import
{
ref
,
computed
}
from
"vue"
;
import
{
detailGoods
,
editGoods
,
listCatAndBrand
}
from
"@/services/api/commodityManage/list"
;
import
{
detailGoods
,
editGoods
,
listCatAndBrand
}
from
"@/services/api/commodityManage/list"
;
import
{
uploadPath
}
from
"@/services/api/storage"
;
import
{
uploadPath
}
from
"@/services/api/storage"
;
import
{
ElMessageBox
,
ElMessage
,
ElNotification
}
from
"element-plus"
;
import
{
ElMessageBox
,
ElMessage
,
ElNotification
}
from
"element-plus"
;
...
@@ -266,6 +218,7 @@ import router from '@/router'
...
@@ -266,6 +218,7 @@ import router from '@/router'
import
{
listGoods
}
from
"@/services/api/commodityManage/list"
;
import
{
listGoods
}
from
"@/services/api/commodityManage/list"
;
let
route
:
any
=
router
let
route
:
any
=
router
let
editDrawer
=
ref
(
false
)
let
newKeywordVisible
=
ref
(
false
);
let
newKeywordVisible
=
ref
(
false
);
let
newPartsVisible
=
ref
(
false
);
let
newPartsVisible
=
ref
(
false
);
let
newKeyword
=
ref
(
""
);
let
newKeyword
=
ref
(
""
);
...
@@ -290,9 +243,9 @@ let goods = ref({
...
@@ -290,9 +243,9 @@ let goods = ref({
brief
:
""
,
brief
:
""
,
detail
:
'<p>你好啊!!</p>'
,
detail
:
'<p>你好啊!!</p>'
,
categoryId
:
undefined
,
categoryId
:
undefined
,
keywords
:
undefined
,
keywords
:
undefined
parts
:
undefined
}
as
any
);
}
as
any
);
let
goodsParts
=
ref
()
let
specVisiable
=
ref
(
false
);
let
specVisiable
=
ref
(
false
);
let
specForm
=
ref
({
specification
:
""
,
value
:
""
,
picUrl
:
""
}
as
any
);
let
specForm
=
ref
({
specification
:
""
,
value
:
""
,
picUrl
:
""
}
as
any
);
let
multipleSpec
=
ref
(
false
);
let
multipleSpec
=
ref
(
false
);
...
@@ -305,7 +258,6 @@ let productForm = ref({
...
@@ -305,7 +258,6 @@ let productForm = ref({
number
:
0
,
number
:
0
,
url
:
""
,
url
:
""
,
});
});
let
goodsId
=
ref
(
route
.
options
.
history
.
location
.
split
(
'='
)[
1
])
let
products
=
ref
([
let
products
=
ref
([
{
id
:
0
,
specifications
:
[
"标准"
],
price
:
0.0
,
number
:
0
,
url
:
""
},
{
id
:
0
,
specifications
:
[
"标准"
],
price
:
0.0
,
number
:
0
,
url
:
""
},
]);
]);
...
@@ -335,13 +287,9 @@ let initList = () => {
...
@@ -335,13 +287,9 @@ let initList = () => {
})
})
}
}
initList
()
initList
()
let
init
=
()
=>
{
// if (route.options.history.location.split('=').length > 1) {
// var goodsId = route.options.history.location.split('=')[1]
// }
// else return
detailGoods
(
goodsId
.
value
).
then
((
res
)
=>
{
let
init
=
(
id
:
number
)
=>
{
detailGoods
(
id
).
then
((
res
)
=>
{
goods
.
value
=
res
.
data
.
goods
;
goods
.
value
=
res
.
data
.
goods
;
console
.
log
(
goods
.
value
);
console
.
log
(
goods
.
value
);
...
@@ -374,7 +322,6 @@ let init = () => {
...
@@ -374,7 +322,6 @@ let init = () => {
brandList
.
value
=
res
.
data
.
brandList
;
brandList
.
value
=
res
.
data
.
brandList
;
});
});
}
}
init
()
let
htmlChange
=
(
value
:
any
)
=>
goods
.
value
.
detail
=
value
let
htmlChange
=
(
value
:
any
)
=>
goods
.
value
.
detail
=
value
...
@@ -622,6 +569,11 @@ let handleAttributeDelete = (row: any) => {
...
@@ -622,6 +569,11 @@ let handleAttributeDelete = (row: any) => {
const
index
=
attributes
.
value
.
indexOf
(
row
);
const
index
=
attributes
.
value
.
indexOf
(
row
);
attributes
.
value
.
splice
(
index
,
1
);
attributes
.
value
.
splice
(
index
,
1
);
}
}
defineExpose
({
editDrawer
,
init
})
</
script
>
</
script
>
<
style
>
<
style
>
...
...
src/views/commodityManage/list.vue
浏览文件 @
ca537cc2
...
@@ -114,6 +114,8 @@
...
@@ -114,6 +114,8 @@
<litemall-page
:page-data=
"listQuery"
:total=
"total"
@
size-change=
"sizeChange"
<litemall-page
:page-data=
"listQuery"
:total=
"total"
@
size-change=
"sizeChange"
@
current-change=
"currentChange"
/>
@
current-change=
"currentChange"
/>
</div>
</div>
<shelves
ref=
"shelvesRef"
@
initShelves=
"getList"
/>
<edit
ref=
"editRef"
:editId=
"editId"
@
initShelves=
"getList"
/>
</template>
</template>
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
...
@@ -123,10 +125,15 @@ import { listGoods, deleteGoods } from "@/services/api/commodityManage/list";
...
@@ -123,10 +125,15 @@ import { listGoods, deleteGoods } from "@/services/api/commodityManage/list";
// import { thumbnail, toPreview } from "@/utils/index";
// import { thumbnail, toPreview } from "@/utils/index";
import
router
from
'@/router'
;
import
router
from
'@/router'
;
import
LitemallPage
from
"@/components/pagination/litemallPage.vue"
;
import
LitemallPage
from
"@/components/pagination/litemallPage.vue"
;
import
shelves
from
'./shelves.vue'
import
edit
from
'./edit.vue'
let
list
=
ref
([]);
let
list
=
ref
([]);
let
total
=
ref
(
0
);
let
total
=
ref
(
0
);
let
listLoading
=
ref
(
true
);
let
listLoading
=
ref
(
true
);
let
shelvesRef
=
ref
();
let
editRef
=
ref
();
let
editId
=
ref
();
let
listQuery
=
ref
({
let
listQuery
=
ref
({
page
:
1
,
page
:
1
,
limit
:
10
,
limit
:
10
,
...
@@ -170,12 +177,12 @@ let handleFilter = () => {
...
@@ -170,12 +177,12 @@ let handleFilter = () => {
getList
();
getList
();
};
};
let
handleCreate
=
()
=>
{
let
handleCreate
=
()
=>
{
console
.
log
(
'跳转'
);
shelvesRef
.
value
.
shelvesDrawer
=
true
// router.push({ path: "/commodity/shelves" });
router
.
push
({
path
:
"/commodity/shelves"
});
};
};
let
handleUpdate
=
(
row
:
any
)
=>
{
let
handleUpdate
=
(
row
:
any
)
=>
{
router
.
push
({
path
:
"/commodity/edit"
,
query
:
{
id
:
row
.
id
}
});
editRef
.
value
.
init
(
row
.
id
)
editRef
.
value
.
editDrawer
=
true
};
};
let
showDetail
=
(
detail
:
any
)
=>
{
let
showDetail
=
(
detail
:
any
)
=>
{
goodsDetail
=
detail
;
goodsDetail
=
detail
;
...
...
src/views/commodityManage/shelves.vue
浏览文件 @
ca537cc2
差异被折叠。
点击展开。
vite.config.ts
浏览文件 @
ca537cc2
...
@@ -89,7 +89,7 @@ export default ({ command, mode }) => {
...
@@ -89,7 +89,7 @@ export default ({ command, mode }) => {
// '/foo': '',
// '/foo': '',
// 选项写法
// 选项写法
"/admin"
:
{
"/admin"
:
{
target
:
"http://192.168.0.
23
/"
,
target
:
"http://192.168.0.
9:8089
/"
,
// rewrite: (path) => path.replace(/^\/api/, '')
// rewrite: (path) => path.replace(/^\/api/, '')
},
},
// 正则表达式写法
// 正则表达式写法
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论