Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
integrate-admin
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
刘旭
integrate-admin
Commits
517ad07b
提交
517ad07b
authored
12月 01, 2022
作者:
刘旭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
57765f67
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
21 行增加
和
28 行删除
+21
-28
addProduct.vue
src/views/manage/components/platformProducts/addProduct.vue
+7
-15
platformProducts.vue
src/views/manage/platformProducts.vue
+14
-13
没有找到文件。
src/views/manage/components/platformProducts/addProduct.vue
浏览文件 @
517ad07b
<
template
>
<
template
>
<el-dialog
v-model=
"showDialog"
title=
"选择产品"
width=
"30%"
:before-close=
"handleClose"
>
<el-dialog
v-model=
"showDialog"
title=
"选择产品"
width=
"30%"
:before-close=
"handleClose"
>
<div
class=
"select"
>
<div
class=
"select"
>
<el-select
v-if=
"status"
v-model=
"
productB
eforeCode"
@
change=
"beforeChange"
>
<el-select
v-if=
"status"
v-model=
"
b
eforeCode"
@
change=
"beforeChange"
>
<el-option
v-for=
"item in options"
:key=
"item.id"
:label=
"item.title"
:value=
"item.code"
/>
<el-option
v-for=
"item in options"
:key=
"item.id"
:label=
"item.title"
:value=
"item.code"
/>
</el-select>
</el-select>
<el-select
v-else
v-model=
"
productA
fterCode"
@
change=
"afterChange"
>
<el-select
v-else
v-model=
"
a
fterCode"
@
change=
"afterChange"
>
<el-option
v-for=
"item in options"
:key=
"item.id"
:label=
"item.title"
:value=
"item.code"
/>
<el-option
v-for=
"item in options"
:key=
"item.id"
:label=
"item.title"
:value=
"item.code"
/>
</el-select>
</el-select>
...
@@ -21,16 +21,6 @@ import { ref } from 'vue'
...
@@ -21,16 +21,6 @@ import { ref } from 'vue'
import
{
ElMessage
}
from
'element-plus'
import
{
ElMessage
}
from
'element-plus'
const
props
=
defineProps
({
const
props
=
defineProps
({
// 第二个选择产品
productAfterCode
:
{
type
:
String
,
default
:
''
},
// 第一个选择产品
productBeforeCode
:
{
type
:
String
,
default
:
''
},
// select 数据源
// select 数据源
options
:
{
options
:
{
type
:
Object
,
type
:
Object
,
...
@@ -40,8 +30,8 @@ const props = defineProps({
...
@@ -40,8 +30,8 @@ const props = defineProps({
const
showDialog
=
ref
(
false
)
const
showDialog
=
ref
(
false
)
const
status
=
ref
(
true
)
// 判断是哪个选择产品
const
status
=
ref
(
true
)
// 判断是哪个选择产品
const
type
=
ref
()
const
type
=
ref
()
const
beforeCode
=
ref
()
const
beforeCode
=
ref
()
// 第一个选择产品
const
afterCode
=
ref
()
const
afterCode
=
ref
()
// 第二个选择产品
const
emits
=
defineEmits
([
'codeChange'
,
'initCode'
])
const
emits
=
defineEmits
([
'codeChange'
,
'initCode'
])
...
@@ -75,7 +65,9 @@ const handleClose = () => {
...
@@ -75,7 +65,9 @@ const handleClose = () => {
defineExpose
({
defineExpose
({
showDialog
,
showDialog
,
status
,
status
,
type
type
,
afterCode
,
beforeCode
})
})
</
script
>
</
script
>
...
...
src/views/manage/platformProducts.vue
浏览文件 @
517ad07b
...
@@ -83,8 +83,7 @@
...
@@ -83,8 +83,7 @@
</el-row>
</el-row>
</el-dialog>
</el-dialog>
<add-product
ref=
"addProductRef"
:options=
"options"
:productAfterCode=
"productAfterCode"
<add-product
ref=
"addProductRef"
:options=
"options"
@
codeChange=
"codeChange"
/>
:productBeforeCode=
"productBeforeCode"
@
codeChange=
"codeChange"
/>
<enable-vue
ref=
"enableRef"
@
cornData=
"cornData"
/>
<enable-vue
ref=
"enableRef"
@
cornData=
"cornData"
/>
</template>
</template>
...
@@ -199,13 +198,6 @@ const cornData = (data: string) => {
...
@@ -199,13 +198,6 @@ const cornData = (data: string) => {
// 获取保存数据
// 获取保存数据
const
codeData
=
(
code
:
string
,
data
:
any
)
=>
{
const
codeData
=
(
code
:
string
,
data
:
any
)
=>
{
console
.
log
(
code
,
data
,
productBeforeCode
.
value
,
productAfterCode
.
value
,
'data'
)
if
(
code
===
productBeforeCode
.
value
)
productBeforeData
.
value
=
data
if
(
code
===
productBeforeCode
.
value
)
productBeforeData
.
value
=
data
else
productAfterData
.
value
=
data
else
productAfterData
.
value
=
data
}
}
...
@@ -299,6 +291,12 @@ const onConfirm = () => {
...
@@ -299,6 +291,12 @@ const onConfirm = () => {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
saveCommonParam
(
productBeforeCode
.
value
,
productBeforeData
.
value
)
saveCommonParam
(
productBeforeCode
.
value
,
productBeforeData
.
value
)
saveCommonParam
(
productAfterCode
.
value
,
productAfterData
.
value
)
saveCommonParam
(
productAfterCode
.
value
,
productAfterData
.
value
)
setTimeout
(()
=>
{
if
(
flag
&&
title
.
value
===
'编辑产品'
)
{
handleClose
()
ElMessage
({
type
:
'success'
,
message
:
'保存成功'
})
}
},
1000
);
if
(
title
.
value
===
'选择产品'
)
createPlatformProduct
(
data
).
then
((
res
:
any
)
=>
{
if
(
title
.
value
===
'选择产品'
)
createPlatformProduct
(
data
).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
)
{
if
(
res
.
code
===
200
)
{
init
()
init
()
...
@@ -309,12 +307,13 @@ const onConfirm = () => {
...
@@ -309,12 +307,13 @@ const onConfirm = () => {
},
1000
)
},
1000
)
}
}
let
flag
=
true
const
saveCommonParam
=
(
code
:
string
,
data
:
any
)
=>
{
const
saveCommonParam
=
(
code
:
string
,
data
:
any
)
=>
{
postCommonParam
({
code
,
data
}).
then
((
res
:
any
)
=>
{
postCommonParam
({
code
,
data
}).
then
((
res
:
any
)
=>
{
if
(
res
.
code
===
200
&&
code
===
productAfterCode
.
value
&&
title
.
value
===
'编辑产品'
)
{
if
(
res
.
code
===
200
&&
title
.
value
===
'编辑产品'
)
{
handleClose
()
//
handleClose()
ElMessage
({
type
:
'success'
,
message
:
'保存成功'
})
//
ElMessage({ type: 'success', message: '保存成功' })
}
}
else
flag
=
false
})
})
}
}
...
@@ -346,6 +345,8 @@ const handleClose = () => {
...
@@ -346,6 +345,8 @@ const handleClose = () => {
productAfterData
.
value
=
''
productAfterData
.
value
=
''
previewProductAfterRef
.
value
.
previewVisible
=
false
previewProductAfterRef
.
value
.
previewVisible
=
false
previewProductBeforeRef
.
value
.
previewVisible
=
false
previewProductBeforeRef
.
value
.
previewVisible
=
false
addProductRef
.
value
.
afterCode
=
''
addProductRef
.
value
.
beforeCode
=
''
showAddDialog
.
value
=
false
showAddDialog
.
value
=
false
}
}
</
script
>
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论