修改多条添加逻辑
This commit is contained in:
parent
8ec4b585b6
commit
7bcb6b2062
|
@ -2,7 +2,7 @@
|
|||
* @Author: hisense.liangjunhua
|
||||
* @Date: 2022-06-13 10:22:27
|
||||
* @LastEditors: hisense.liangjunhua
|
||||
* @LastEditTime: 2022-07-16 14:27:31
|
||||
* @LastEditTime: 2022-07-19 18:34:53
|
||||
* @Description: 算法上架
|
||||
-->
|
||||
<template>
|
||||
|
@ -24,6 +24,7 @@
|
|||
<div class="vue-box">
|
||||
<put-on-the-shelf
|
||||
v-if="showView === '基本信息' && refData.name"
|
||||
ref="refPutOnTheShelf"
|
||||
:refData="refData"
|
||||
:dataFrom="dataFrom"
|
||||
:videoList="videoList"
|
||||
|
@ -31,18 +32,25 @@
|
|||
></put-on-the-shelf>
|
||||
<put-on-the-shelf
|
||||
v-else-if="showView === '算法优势'"
|
||||
ref="refPutOnTheShelf"
|
||||
:refData="refData"
|
||||
:dataFrom="dataFrom"
|
||||
:configure="sfys"
|
||||
@next="next()"
|
||||
@back="back()"
|
||||
></put-on-the-shelf>
|
||||
<put-on-the-shelf
|
||||
v-else-if="showView === '应用场景'"
|
||||
ref="refPutOnTheShelf"
|
||||
:refData="refData"
|
||||
:dataFrom="dataFrom"
|
||||
:configure="yycj"
|
||||
@next="next()"
|
||||
@back="back()"
|
||||
></put-on-the-shelf>
|
||||
<put-on-the-shelf
|
||||
v-else-if="showView === '部署与使用'"
|
||||
ref="refPutOnTheShelf"
|
||||
:refData="refData"
|
||||
:dataFrom="dataFrom"
|
||||
:fileList="fileList"
|
||||
|
@ -50,6 +58,8 @@
|
|||
:imgList="imgList"
|
||||
:externalField="['接口服务', '接口请求方式']"
|
||||
:configure="bs"
|
||||
@submit="submit()"
|
||||
@back="back()"
|
||||
></put-on-the-shelf>
|
||||
<!-- <algorithm-essential-information
|
||||
v-if="showView === '基本信息' && refData.name"
|
||||
|
@ -82,12 +92,58 @@
|
|||
</div>
|
||||
<div class="btn" :class="showView === '基本信息' ? 'first' : ''">
|
||||
<button @click="close()">取消</button>
|
||||
<button v-show="showView !== '基本信息'" @click="back()">上一步</button>
|
||||
<a-popconfirm
|
||||
v-if="showView == '算法优势'"
|
||||
title="如果信息未填写完整将会被丢弃,是否返回上一步?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="changeSfys('上一步')"
|
||||
@cancel="cancel"
|
||||
>
|
||||
<button>上一步</button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm
|
||||
v-else-if="showView == '应用场景'"
|
||||
title="如果信息未填写完整将会被丢弃,是否返回上一步?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="changeYycj('上一步')"
|
||||
@cancel="cancel"
|
||||
>
|
||||
<button>上一步</button>
|
||||
</a-popconfirm>
|
||||
<button v-else-if="showView !== '基本信息'" @click="back()">
|
||||
上一步
|
||||
</button>
|
||||
<button v-show="showView === '部署与使用'" @click="preview()">
|
||||
预览
|
||||
</button>
|
||||
<button v-show="showView !== '部署与使用'" @click="next()">下一步</button>
|
||||
<button v-show="showView === '部署与使用'" @click="submit()">提交</button>
|
||||
<a-popconfirm
|
||||
v-if="showView == '算法优势'"
|
||||
title="如果信息未填写完整将会被丢弃,是否进行下一步?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="changeSfys('下一步')"
|
||||
@cancel="cancel"
|
||||
>
|
||||
<button>下一步</button>
|
||||
</a-popconfirm>
|
||||
<a-popconfirm
|
||||
v-else-if="showView == '应用场景'"
|
||||
title="如果信息未填写完整将会被丢弃,是否进行下一步?"
|
||||
ok-text="是"
|
||||
cancel-text="否"
|
||||
@confirm="changeYycj('下一步')"
|
||||
@cancel="cancel"
|
||||
>
|
||||
<button>下一步</button>
|
||||
</a-popconfirm>
|
||||
<button v-else-if="showView !== '部署与使用'" @click="next()">
|
||||
下一步
|
||||
</button>
|
||||
<button v-show="showView === '部署与使用'" @click="changeBs()">
|
||||
提交
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -332,6 +388,21 @@
|
|||
console.log('所有编目结构==============>', res.data.data)
|
||||
})
|
||||
}
|
||||
// 特殊字段处理
|
||||
const refPutOnTheShelf = ref(null)
|
||||
const changeSfys = (type) => {
|
||||
console.log(refPutOnTheShelf)
|
||||
refPutOnTheShelf.value.add('算法优势', true, type)
|
||||
}
|
||||
const changeYycj = (type) => {
|
||||
console.log(refPutOnTheShelf)
|
||||
refPutOnTheShelf.value.add('应用场景', true, type)
|
||||
}
|
||||
const changeBs = (type) => {
|
||||
console.log(refPutOnTheShelf)
|
||||
refPutOnTheShelf.value.add('计费标准信息', true)
|
||||
refPutOnTheShelf.value.add('常见问题', true, type)
|
||||
}
|
||||
init()
|
||||
mybus.on('chageDataFrom', (obj) => {
|
||||
if (obj.attrType == '技术文档' && obj.attrValue != null) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @Author: hisense.liangjunhua
|
||||
* @Date: 2022-06-17 14:11:08
|
||||
* @LastEditors: hisense.liangjunhua
|
||||
* @LastEditTime: 2022-07-19 14:50:30
|
||||
* @LastEditTime: 2022-07-19 18:49:40
|
||||
* @Description: 上架
|
||||
-->
|
||||
<template>
|
||||
|
@ -442,7 +442,14 @@
|
|||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, defineProps, watch, onMounted } from 'vue'
|
||||
import {
|
||||
ref,
|
||||
defineProps,
|
||||
watch,
|
||||
onMounted,
|
||||
defineExpose,
|
||||
defineEmits,
|
||||
} from 'vue'
|
||||
import mybus from '@/myplugins/mybus'
|
||||
import upload from '@/views/components/upload'
|
||||
import { message } from 'ant-design-vue'
|
||||
|
@ -518,6 +525,7 @@
|
|||
// ]
|
||||
// }]
|
||||
})
|
||||
const emit = defineEmits(['next', 'back', 'submit'])
|
||||
// console.log('props==========>', props)
|
||||
const changeAdd = () => {
|
||||
console.log('子组件方法触发~')
|
||||
|
@ -655,7 +663,7 @@
|
|||
showText.value = show
|
||||
})
|
||||
mybus.off('func')
|
||||
const add = (title) => {
|
||||
const add = (title, addFlag, type) => {
|
||||
console.log(title, 'title')
|
||||
let list = props.configure.filter((item) => item.name === title)[0].list
|
||||
let flag = true
|
||||
|
@ -707,8 +715,31 @@
|
|||
item.note1 = ''
|
||||
showKey.value++
|
||||
})
|
||||
if (addFlag) {
|
||||
if (type == '上一步') {
|
||||
emit('back')
|
||||
} else if (type == '下一步') {
|
||||
emit('next')
|
||||
} else if (type == '提交') {
|
||||
emit('submit')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!addFlag) {
|
||||
message.warning('请填写完整')
|
||||
} else {
|
||||
list.forEach((item) => {
|
||||
item.note1 = ''
|
||||
showKey.value++
|
||||
})
|
||||
if (type == '上一步') {
|
||||
emit('back')
|
||||
} else if (type == '下一步') {
|
||||
emit('next')
|
||||
} else if (type == '提交') {
|
||||
emit('submit')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const del = (title, index) => {
|
||||
|
@ -927,6 +958,9 @@
|
|||
const filterOption = (input, option) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}
|
||||
defineExpose({
|
||||
add,
|
||||
})
|
||||
</script>
|
||||
<style></style>
|
||||
<style lang="less" scoped>
|
||||
|
|
Loading…
Reference in New Issue