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
5534f372
提交
5534f372
authored
10月 20, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
商品管理
上级
90015874
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
47 行增加
和
55 行删除
+47
-55
richTextEditor.vue
src/components/richTextEditor.vue
+40
-49
list.vue
src/views/commodityManage/list.vue
+7
-6
shelves.vue
src/views/commodityManage/shelves.vue
+0
-0
没有找到文件。
src/components/richTextEditor.vue
浏览文件 @
5534f372
<
template
>
<
template
>
<div
style=
"border: 1px solid #ccc"
>
<div
style=
"border: 1px solid #ccc"
>
<Toolbar
<Toolbar
style=
"border-bottom: 1px solid #ccc"
:editor=
"editorRef"
:defaultConfig=
"toolbarConfig"
:mode=
"mode"
/>
style=
"border-bottom: 1px solid #ccc"
<Editor
style=
"height: 400px; overflow-y: hidden;"
v-model=
"valueHtml"
:defaultConfig=
"editorConfig"
:mode=
"mode"
:editor=
"editorRef"
@
onCreated=
"handleCreated"
@
onChange=
"handleChange"
/>
:defaultConfig=
"toolbarConfig"
</div>
:mode=
"mode"
/>
<Editor
style=
"height: 500px; overflow-y: hidden;"
v-model=
"valueHtml"
:defaultConfig=
"editorConfig"
:mode=
"mode"
@
onCreated=
"handleCreated"
/>
</div>
</
template
>
</
template
>
<
script
>
<
script
setup
lang=
"ts"
>
import
'@wangeditor/editor/dist/css/style.css'
// 引入 css
import
'@wangeditor/editor/dist/css/style.css'
// 引入 css
import
{
onBeforeUnmount
,
ref
,
shallowRef
,
onMounted
}
from
'vue'
import
{
onBeforeUnmount
,
ref
,
shallowRef
,
onMounted
}
from
'vue'
import
{
Editor
,
Toolbar
}
from
'@wangeditor/editor-for-vue'
import
{
Editor
,
Toolbar
}
from
'@wangeditor/editor-for-vue'
export
default
{
const
props
=
defineProps
({
components
:
{
Editor
,
Toolbar
},
valueHtml
:
{
setup
()
{
type
:
String
,
// 编辑器实例,必须用 shallowRef
default
:
'<p></p>'
const
editorRef
=
shallowRef
()
}
})
// 内容 HTML
const
emits
=
defineEmits
([
'htmlChange'
])
const
valueHtml
=
ref
(
'<p>hello</p>'
)
// 模拟 ajax 异步获取内容
// 编辑器实例,必须用 shallowRef
onMounted
(()
=>
{
const
editorRef
=
shallowRef
()
setTimeout
(()
=>
{
valueHtml
.
value
=
'<p>模拟 Ajax 异步设置内容</p>'
},
1500
)
})
const
toolbarConfig
=
{}
// 内容 HTML
const
editorConfig
=
{
placeholder
:
'请输入内容...'
}
// const valueHtml = ref('
<
p
><
/p>'
)
// 组件销毁时,也及时销毁编辑器
// 模拟 ajax 异步获取内容
onBeforeUnmount
(()
=>
{
// onMounted
(() => {
const
editor
=
editorRef
.
value
// setTimeout(() => {
if
(
editor
==
null
)
return
// valueHtml.value = '
<
p
><
/p>
'
editor
.
destroy
(
)
// }, 1500
)
})
//
})
const
handleCreated
=
(
editor
)
=>
{
const
toolbarConfig
=
{}
editorRef
.
value
=
editor
// 记录 editor 实例,重要!
const
editorConfig
=
{
placeholder
:
'请输入内容...'
}
}
return
{
// 组件销毁时,也及时销毁编辑器
editorRef
,
onBeforeUnmount
(()
=>
{
valueHtml
,
const
editor
=
editorRef
.
value
mode
:
'default'
,
// 或 'simple'
if
(
editor
==
null
)
return
toolbarConfig
,
editor
.
destroy
()
editorConfig
,
})
handleCreated
};
const
handleCreated
=
(
editor
:
any
)
=>
{
}
editorRef
.
value
=
editor
// 记录 editor 实例,重要!
}
}
const
handleChange
=
(
editor
:
any
)
=>
{
emits
(
'htmlChange'
,
editor
.
children
)
}
</
script
>
</
script
>
\ No newline at end of file
src/views/commodityManage/list.vue
浏览文件 @
5534f372
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<el-table
v-loading=
"listLoading"
:data=
"list"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table
v-loading=
"listLoading"
:data=
"list"
element-loading-text=
"正在查询中。。。"
border
fit
highlight-current-row
>
<el-table-column
type=
"expand"
>
<el-table-column
type=
"expand"
>
<template
#
default=
"props"
>
<template
#
default=
"props"
>
<el-form
label-position=
"left"
class=
"table-expand"
>
<el-form
label-position=
"left"
>
<el-form-item
label=
"商品编号"
>
<el-form-item
label=
"商品编号"
>
<span>
{{
props
.
row
.
goodsSn
}}
</span>
<span>
{{
props
.
row
.
goodsSn
}}
</span>
</el-form-item>
</el-form-item>
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
<el-table-column
align=
"center"
label=
"详情"
prop=
"detail"
>
<el-table-column
align=
"center"
label=
"详情"
prop=
"detail"
>
<
template
#
default=
"scope"
>
<
template
#
default=
"scope"
>
<el-dialog
:visible
.
sync
=
"detailDialogVisible"
title=
"商品详情"
>
<el-dialog
v-model
=
"detailDialogVisible"
title=
"商品详情"
>
<div
class=
"goods-detail-box"
v-html=
"goodsDetail"
/>
<div
class=
"goods-detail-box"
v-html=
"goodsDetail"
/>
</el-dialog>
</el-dialog>
<el-button
type=
"primary"
size=
"small"
@
click=
"showDetail(scope.row.detail)"
>
查看
</el-button>
<el-button
type=
"primary"
size=
"small"
@
click=
"showDetail(scope.row.detail)"
>
查看
</el-button>
...
@@ -118,15 +118,14 @@ import { ref } from "vue";
...
@@ -118,15 +118,14 @@ import { ref } from "vue";
import
{
ElMessageBox
,
ElNotification
}
from
"element-plus"
;
import
{
ElMessageBox
,
ElNotification
}
from
"element-plus"
;
import
{
listGoods
,
deleteGoods
}
from
"@/services/api/commodityManage/list"
;
import
{
listGoods
,
deleteGoods
}
from
"@/services/api/commodityManage/list"
;
import
{
thumbnail
,
toPreview
}
from
"@/utils/index"
;
import
{
thumbnail
,
toPreview
}
from
"@/utils/index"
;
import
{
useRouter
}
from
"vue-router"
;
import
router
from
'@/router'
;
let
router
=
useRouter
();
let
list
=
ref
([]);
let
list
=
ref
([]);
let
total
=
ref
(
0
);
let
total
=
ref
(
0
);
let
listLoading
=
ref
(
true
);
let
listLoading
=
ref
(
true
);
let
listQuery
=
ref
({
let
listQuery
=
ref
({
page
:
1
,
page
:
1
,
limit
:
2
0
,
limit
:
1
0
,
goodsSn
:
undefined
,
goodsSn
:
undefined
,
name
:
undefined
,
name
:
undefined
,
sort
:
"add_time"
,
sort
:
"add_time"
,
...
@@ -157,7 +156,9 @@ let handleFilter = () => {
...
@@ -157,7 +156,9 @@ let handleFilter = () => {
getList
();
getList
();
};
};
let
handleCreate
=
()
=>
{
let
handleCreate
=
()
=>
{
// router.push({ path: "/goods/create" });
console
.
log
(
'跳转'
);
router
.
push
({
path
:
"/commodity/shelves"
});
};
};
let
handleUpdate
=
(
row
:
any
)
=>
{
let
handleUpdate
=
(
row
:
any
)
=>
{
// router.push({ path: "/goods/edit", query: { id: row.id } });
// router.push({ path: "/goods/edit", query: { id: row.id } });
...
...
src/views/commodityManage/shelves.vue
浏览文件 @
5534f372
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论