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
9d4def11
提交
9d4def11
authored
11月 10, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改bug
上级
883d4bbb
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
61 行增加
和
42 行删除
+61
-42
.env.development
.env.development
+2
-2
.env.production
.env.production
+2
-2
richTextEditor.vue
src/components/richTextEditor.vue
+6
-1
edit.vue
src/views/commodityManage/edit.vue
+46
-33
shelves.vue
src/views/commodityManage/shelves.vue
+3
-2
vite.config.ts
vite.config.ts
+2
-2
没有找到文件。
.env.development
浏览文件 @
9d4def11
...
...
@@ -4,4 +4,4 @@ VITE_APP_PORT = 3003
# 请求接口
VITE_APP_BASE_URL = "/admin"
VITE_APP_BASE_IMG = "/wx/storage/fetch/"
\ No newline at end of file
VITE_APP_BASE_IMG = ""
\ No newline at end of file
.env.production
浏览文件 @
9d4def11
...
...
@@ -4,4 +4,4 @@ VITE_APP_PORT = 3002
# 请求接口
VITE_APP_BASE_URL = "/admin"
VITE_APP_BASE_IMG = "/wx/storage/fetch/"
\ No newline at end of file
VITE_APP_BASE_IMG = ""
\ No newline at end of file
src/components/richTextEditor.vue
浏览文件 @
9d4def11
...
...
@@ -9,7 +9,7 @@
<
script
setup
lang=
"ts"
>
import
'@wangeditor/editor/dist/css/style.css'
// 引入 css
import
{
onBeforeUnmount
,
ref
,
shallowRef
,
onMoun
ted
}
from
'vue'
import
{
onBeforeUnmount
,
ref
,
shallowRef
,
compu
ted
}
from
'vue'
import
{
Editor
,
Toolbar
}
from
'@wangeditor/editor-for-vue'
const
props
=
defineProps
({
...
...
@@ -19,6 +19,11 @@ const props = defineProps({
}
})
const
valueHtml
=
computed
({
get
:
()
=>
props
.
valueHtml
,
set
:
(
value
)
=>
emits
(
"htmlChange"
,
value
),
})
const
mode
=
ref
(
'mode'
)
const
emits
=
defineEmits
([
'htmlChange'
])
...
...
src/views/commodityManage/edit.vue
浏览文件 @
9d4def11
...
...
@@ -46,8 +46,8 @@
</el-form-item>
<el-form-item
label=
"宣传画廊"
>
<el-upload
:action=
"uploadPath"
:limit=
"5"
:headers=
"headers"
:on-exceed=
"uploadOverrun
"
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
multiple
<el-upload
v-model:file-list=
"fileList"
:action=
"uploadPath"
:limit=
"5"
:headers=
"headers
"
:on-
exceed=
"uploadOverrun"
:on-
success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
multiple
accept=
".jpg,.jpeg,.png,.gif"
list-type=
"picture-card"
>
<el-icon
class=
"avatar-uploader-icon"
>
<Plus
/>
...
...
@@ -232,6 +232,7 @@ let galleryFileList = ref([] as any);
let
categoryIds
=
ref
([]
as
any
);
let
categoryList
=
ref
([]
as
any
);
let
brandList
=
ref
([]
as
any
);
let
fileList
=
ref
([]
as
any
)
let
goods
=
ref
({
goodsSn
:
""
,
name
:
""
,
...
...
@@ -244,7 +245,7 @@ let goods = ref({
unit
:
""
,
brandId
:
""
,
brief
:
""
,
detail
:
'<p>
你好啊!!
</p>'
,
detail
:
'<p></p>'
,
categoryId
:
undefined
,
keywords
:
undefined
}
as
any
);
...
...
@@ -284,39 +285,50 @@ let initList = () => {
initList
()
let
init
=
(
id
:
number
)
=>
{
detailGoods
(
id
).
then
((
res
)
=>
{
goods
.
value
=
res
.
data
.
goods
;
for
(
let
s
in
res
.
data
.
parts
)
{
goodsParts
.
value
.
push
(
res
.
data
.
parts
[
s
].
partGoodsId
)
}
detailGoods
(
id
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
res
.
data
.
goods
.
gallery
.
map
((
item
:
any
)
=>
{
fileList
.
value
.
push
({
url
:
item
,
name
:
item
.
split
(
'/'
)[
item
.
split
(
'/'
).
length
-
1
]
})
})
goods
.
value
=
res
.
data
.
goods
;
for
(
let
s
in
res
.
data
.
parts
)
{
goodsParts
.
value
.
push
(
res
.
data
.
parts
[
s
].
partGoodsId
)
}
// 稍微调整一下前后端不一致
if
(
goods
.
value
?.
brandId
===
0
)
{
goods
.
value
!
.
brandId
=
null
;
}
if
(
goods
.
value
?.
keywords
===
""
)
{
goods
.
value
!
.
keywords
=
null
;
}
specifications
.
value
=
res
.
data
.
specifications
;
products
.
value
=
res
.
data
.
products
;
attributes
.
value
=
res
.
data
.
attributes
;
selectSpecRef
.
value
.
setAttributes
(
res
.
data
.
products
)
categoryIds
.
value
=
res
.
data
.
categoryIds
;
galleryFileList
.
value
=
[];
for
(
var
i
=
0
;
i
<
goods
.
value
?.
gallery
.
length
;
i
++
)
{
galleryFileList
.
value
.
push
({
url
:
goods
.
value
?.
gallery
[
i
],
});
}
const
keyword
:
any
=
res
.
data
.
goods
.
keywords
;
if
(
keyword
!==
null
)
{
keywords
.
value
=
keyword
.
split
(
","
);
// 稍微调整一下前后端不一致
if
(
goods
.
value
?.
brandId
===
0
)
{
goods
.
value
!
.
brandId
=
null
;
}
if
(
goods
.
value
?.
keywords
===
""
)
{
goods
.
value
!
.
keywords
=
null
;
}
specifications
.
value
=
res
.
data
.
specifications
;
products
.
value
=
res
.
data
.
products
;
attributes
.
value
=
res
.
data
.
attributes
;
selectSpecRef
.
value
.
setAttributes
(
res
.
data
.
products
)
categoryIds
.
value
=
res
.
data
.
categoryIds
;
galleryFileList
.
value
=
[];
for
(
var
i
=
0
;
i
<
goods
.
value
?.
gallery
.
length
;
i
++
)
{
galleryFileList
.
value
.
push
({
url
:
goods
.
value
?.
gallery
[
i
],
});
}
const
keyword
:
any
=
res
.
data
.
goods
.
keywords
;
if
(
keyword
!==
null
)
{
keywords
.
value
=
keyword
.
split
(
","
);
}
}
});
listCatAndBrand
().
then
((
res
:
any
)
=>
{
categoryList
.
value
=
res
.
data
.
categoryList
;
brandList
.
value
=
res
.
data
.
brandList
;
if
(
res
.
code
===
200
)
{
categoryList
.
value
=
res
.
data
.
categoryList
;
brandList
.
value
=
res
.
data
.
brandList
;
}
});
}
...
...
@@ -350,6 +362,7 @@ let handleCancel = () => {
products
.
value
=
[]
goodsParts
.
value
=
[]
attributes
.
value
=
[]
fileList
.
value
=
[]
editDrawer
.
value
=
false
}
let
handleEdit
=
()
=>
{
...
...
@@ -406,11 +419,11 @@ let uploadOverrun = () => {
});
}
let
handleGalleryUrl
=
(
res
:
any
,
file
:
any
,
fileList
:
any
)
=>
{
// if (res.errno === 0) {
goods
.
value
.
gallery
.
push
(
res
.
data
.
url
);
// }
fileList
.
value
.
push
(
fileList
)
}
let
handleRemove
=
(
file
:
any
,
fileList
:
any
)
=>
{
fileList
.
value
=
fileList
for
(
let
i
=
0
;
i
<
goods
.
value
.
gallery
.
length
;
i
++
)
{
// 这里存在两种情况
// 1. 如果所删除图片是刚刚上传的图片,那么图片地址是file.res.data.url
...
...
src/views/commodityManage/shelves.vue
浏览文件 @
9d4def11
...
...
@@ -57,8 +57,8 @@
</el-form-item>
<el-form-item
label=
"宣传画廊"
>
<el-upload
:action=
"uploadPath"
:limit=
"5"
:headers=
"headers"
:on-exceed=
"uploadOverrun
"
:on-success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
multiple
<el-upload
v-model:file-list=
"goods.gallery"
:action=
"uploadPath"
:limit=
"5"
:headers=
"headers
"
:on-
exceed=
"uploadOverrun"
:on-
success=
"handleGalleryUrl"
:on-remove=
"handleRemove"
multiple
accept=
".jpg,.jpeg,.png,.gif"
list-type=
"picture-card"
>
<el-icon
class=
"avatar-uploader-icon"
>
<Plus
/>
...
...
@@ -236,6 +236,7 @@ let newKeyword = ref("");
let
keywords
=
ref
([]
as
any
);
let
categoryList
=
ref
([]
as
any
);
let
brandList
=
ref
([]
as
any
);
let
fileList
=
ref
([])
let
goods
=
ref
({
goodsSn
:
""
,
name
:
""
,
...
...
vite.config.ts
浏览文件 @
9d4def11
...
...
@@ -89,11 +89,11 @@ export default ({ command, mode }) => {
// '/foo': '',
// 选项写法
"/admin"
:
{
target
:
"http://192.168.0.
9:8089
/"
,
target
:
"http://192.168.0.
23
/"
,
// rewrite: (path) => path.replace(/^\/api/, '')
},
"/wx"
:
{
target
:
"http://192.168.0.
9:8089
/"
,
target
:
"http://192.168.0.
23
/"
,
// rewrite: (path) => path.replace(/^\/api/, '')
},
// 正则表达式写法
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论