赋能场景按钮顺序

This commit is contained in:
a0049873 2023-01-06 16:40:16 +08:00
parent 508669b7c5
commit 88d84bbcb5
3 changed files with 96 additions and 139 deletions

View File

@ -88,9 +88,8 @@
</el-form>
</div>
<template slot="footer">
<el-button type="primary" @click="dataFormSubmitHandle()">提交</el-button>
<el-button @click="closeModal">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">提交</el-button>
</template>
</el-dialog>
</div>

View File

@ -3,7 +3,6 @@
<el-dialog custom-class="customClass" :visible.sync="areaVisibleCopy" :title="modalTypeText[modalType]"
@close="closeModal" :close-on-click-modal="false" :close-on-press-escape="false">
<!-- 挂载和修改 -->
<div class="right">
<el-form :model="dataForm" :rules="rules" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()"
@ -52,12 +51,11 @@
</div>
</div>
</el-form>
</div>
<template slot="footer">
<el-button type="primary" @click="dataFormSubmitHandle()">提交</el-button>
<el-button @click="closeModal">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">提交</el-button>
</template>
</el-dialog>
@ -130,7 +128,7 @@ export default {
fuseAttrList: [
{
attrType: '构建步骤',
attrValue: [{ question: '', answer: [{ 'answer': '' }, { 'answer': '' }] }]
attrValue: [{ question: '', answer: [{ answer: '' }, { answer: '' }] }]
},
{
attrType: '基础设施',
@ -156,7 +154,7 @@ export default {
attrType: '服务图片',
attrValue: ''
}
],
]
},
rules: {
@ -228,11 +226,9 @@ export default {
this.$emit('closeModal')
},
//
dataFormSubmitHandle: debounce(
function () {
this.$refs.dataForm.validate((valid) => {
if (!valid) {
this.$message.error('请检查表单是否填写完整')
@ -254,9 +250,8 @@ export default {
this.dataForm.fuseAttrList.forEach(item => {
if (item.attrType !== '服务图片') {
item.attrValue = JSON.stringify(item.attrValue);
item.attrValue = JSON.stringify(item.attrValue)
}
})
this.$http
[methodsObj[this.modalType]]('/fuse', _obj)
@ -333,7 +328,6 @@ export default {
},
beforeDestroy () {
this.clearForm()
}
}
</script>
@ -368,14 +362,11 @@ export default {
background-position-y: 22px;
}
.right {
width: 770px;
margin-left: 100px;
margin-top: 24px;
.info-inner {
margin-left: 10px;
@ -392,7 +383,6 @@ export default {
border-radius: 2px;
}
.baseTitle {
@ -404,7 +394,6 @@ export default {
background: url("~@/assets/img/biaoti.png") no-repeat;
background-position-y: 2px;
}
.baseInner {
@ -438,7 +427,6 @@ export default {
height: 580px;
overflow: auto;
}
.icon-input ::v-deep .el-input__inner {
@ -558,4 +546,3 @@ export default {
display: block;
}
</style>

View File

@ -22,7 +22,6 @@
</div>
</div>
<!-- 挂载和修改 -->
<div class="right">
<el-form :model="dataForm" :rules="rules" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()"
@ -140,8 +139,8 @@
</el-form>
</div>
<template slot="footer">
<el-button type="primary" @click="dataFormSubmitHandle()">提交</el-button>
<el-button @click="closeModal">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">提交</el-button>
</template>
</el-dialog>
@ -160,7 +159,6 @@ import InfrastructureModal from './components/infrastructure-modal.vue'
import Cookies from 'js-cookie'
import upload from '@/views/modules/components/upload'
export const getDescJson = (text) => {
return {
descObj: {
@ -231,11 +229,11 @@ export default {
dataTypeList: [{ value: '数据', label: '数据' }],
sceneAreas: [], //
steps: [{ 'name': '基本信息', 'id': "anchor1" },
{ 'name': '场景痛点', 'id': "anchor2" },
{ 'name': '解决方案', 'id': "anchor3" },
{ 'name': '使用能力', 'id': "anchor4" },
{ 'name': '构建步骤', 'id': "anchor5" }],
steps: [{ name: '基本信息', id: 'anchor1' },
{ name: '场景痛点', id: 'anchor2' },
{ name: '解决方案', id: 'anchor3' },
{ name: '使用能力', id: 'anchor4' },
{ name: '构建步骤', id: 'anchor5' }],
fileUploadUrl: window.SITE_CONFIG.apiURL + '/upload',
painKeyTextObj: getDescJson('痛点'),
@ -253,7 +251,7 @@ export default {
fuseAttrList: [
{
attrType: '构建步骤',
attrValue: [{ question: '', answer: [{ 'answer': '' }, { 'answer': '' }] }]
attrValue: [{ question: '', answer: [{ answer: '' }, { answer: '' }] }]
},
{
attrType: '基础设施',
@ -279,7 +277,7 @@ export default {
attrType: '服务图片',
attrValue: ''
}
],
]
},
rules: {
@ -327,13 +325,11 @@ export default {
methods: {
handleStep (item, index) {
this.activeStepIndex = index
this.selectNow = item.id //
let top = document.querySelector('#' + item.id).offsetTop - 100
document.querySelectorAll(".customClass .el-dialog__body")[0].scrollTop = top
const top = document.querySelector('#' + item.id).offsetTop - 100
document.querySelectorAll('.customClass .el-dialog__body')[0].scrollTop = top
},
//
getSceneArea () {
@ -362,7 +358,6 @@ export default {
v.attrValue = data.list
}
})
},
//
updateCount (data) {
@ -375,13 +370,11 @@ export default {
if (data.title === '数据资源') {
this.dataForm.dataSourceCount = data.count
}
},
//
dataFormSubmitHandle: debounce(
function () {
this.$refs.dataForm.validate((valid) => {
if (!valid) {
this.$message.error('请检查表单是否填写完整')
@ -402,9 +395,8 @@ export default {
})
this.dataForm.fuseAttrList.forEach(item => {
if (item.attrType !== '服务图片') {
item.attrValue = JSON.stringify(item.attrValue);
item.attrValue = JSON.stringify(item.attrValue)
}
})
this.$http
[methodsObj[this.modalType]]('/fuse', _obj)
@ -440,11 +432,7 @@ export default {
}
const _imgObj = data.fuseAttrList.find(v => v.attrType == '服务图片') || {}
this.imageUrl = _imgObj.attrValue
})
},
handleAvatarSuccess (res, file) {
if (res.code !== 0) {
@ -489,42 +477,33 @@ export default {
}
},
mounted () {
const that = this;
const that = this
this.$nextTick(() => {
document.querySelector(".el-dialog__body").onscroll = function () {
let top = document.querySelectorAll(".customClass .el-dialog__body")[0].scrollTop - 100
document.querySelector('.el-dialog__body').onscroll = function () {
const top = document.querySelectorAll('.customClass .el-dialog__body')[0].scrollTop - 100
if (top < document.querySelector('#anchor1').offsetTop - 100) {
that.activeStepIndexs = 0
}
else if (top < document.querySelector('#anchor2').offsetTop - 100) {
} else if (top < document.querySelector('#anchor2').offsetTop - 100) {
that.activeStepIndexs = 1
}
else if (top < document.querySelector('#anchor3').offsetTop - 100) {
} else if (top < document.querySelector('#anchor3').offsetTop - 100) {
that.activeStepIndexs = 2
}
else if (top < document.querySelector('#anchor4').offsetTop - 100) {
} else if (top < document.querySelector('#anchor4').offsetTop - 100) {
that.activeStepIndexs = 3
}
else if (top < document.querySelector('#anchor5').offsetTop - 100) {
} else if (top < document.querySelector('#anchor5').offsetTop - 100) {
that.activeStepIndexs = 4
} else {
that.activeStepIndexs = 0
}
if (that.activeStepIndex !== that.activeStepIndexs) {
that.activeStepIndex = that.activeStepIndexs;
that.$forceUpdate();
that.activeStepIndex = that.activeStepIndexs
that.$forceUpdate()
}
}
})
},
beforeDestroy () {
this.clearForm()
}
}
</script>
@ -632,9 +611,6 @@ export default {
border: 4px solid #1160e2;
}
.advice {
font-size: 10px;
color: #1160e2;
@ -653,7 +629,6 @@ export default {
margin-left: 157px;
margin-top: -5px;
.info-inner {
margin-left: 10px;
@ -670,7 +645,6 @@ export default {
border-radius: 2px;
}
.baseTitle {
@ -682,7 +656,6 @@ export default {
background: url("~@/assets/img/biaoti.png") no-repeat;
background-position-y: 2px;
}
.baseInner {
@ -716,7 +689,6 @@ export default {
height: 580px;
overflow: auto;
}
.icon-input ::v-deep .el-input__inner {
@ -836,4 +808,3 @@ export default {
display: block;
}
</style>