|
|
@ -1,29 +1,24 @@ |
|
|
|
<template> |
|
|
|
<div class="project-form" |
|
|
|
:style="{backgroundColor:projectTheme.backgroundColor, |
|
|
|
background:projectTheme.backgroundImg?'url('+projectTheme.backgroundImg+') no-repeat center':''}" |
|
|
|
> |
|
|
|
background:projectTheme.backgroundImg?'url('+projectTheme.backgroundImg+') no-repeat center':''}"> |
|
|
|
<div class=""> |
|
|
|
<div :style="{textAlign:projectTheme.logoPosition}"> |
|
|
|
<img :src="projectTheme.logoImg" |
|
|
|
class="logo-img" |
|
|
|
> |
|
|
|
class="logo-img"> |
|
|
|
</div> |
|
|
|
<el-image v-if="projectTheme.headImgUrl" |
|
|
|
:src="projectTheme.headImgUrl" |
|
|
|
style="width: 100%;" |
|
|
|
fit="scale-down" |
|
|
|
/> |
|
|
|
fit="scale-down" /> |
|
|
|
<h4 v-if="projectTheme.showTitle" |
|
|
|
class="form-name-text" |
|
|
|
style="text-align: center;" |
|
|
|
> |
|
|
|
style="text-align: center;"> |
|
|
|
{{ formConf.title }} |
|
|
|
</h4> |
|
|
|
<div v-show="projectTheme.showDescribe" |
|
|
|
class="form-name-text describe-html" |
|
|
|
v-html="formConf.description" |
|
|
|
/> |
|
|
|
v-html="formConf.description" /> |
|
|
|
<el-divider /> |
|
|
|
<parser v-if="startParser" |
|
|
|
:key="parserKey" |
|
|
@ -32,8 +27,7 @@ |
|
|
|
:form-conf="formConf" |
|
|
|
@next="nextPage" |
|
|
|
@prev="prevPage" |
|
|
|
@submit="submitForm" |
|
|
|
/> |
|
|
|
@submit="submitForm" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
@ -44,13 +38,13 @@ import { dbDataConvertForItemJson } from '@/utils/convert' |
|
|
|
import { getExpression } from '@/utils/expression' |
|
|
|
import _ from 'lodash' |
|
|
|
|
|
|
|
window.onload = function() { |
|
|
|
document.addEventListener('touchstart', function(event) { |
|
|
|
window.onload = function () { |
|
|
|
document.addEventListener('touchstart', function (event) { |
|
|
|
if (event.touches.length > 1) { |
|
|
|
event.preventDefault() |
|
|
|
} |
|
|
|
}) |
|
|
|
document.addEventListener('gesturestart', function(event) { |
|
|
|
document.addEventListener('gesturestart', function (event) { |
|
|
|
event.preventDefault() |
|
|
|
}) |
|
|
|
} |
|
|
@ -78,7 +72,7 @@ export default { |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
logicShowTriggerRule: {}, |
|
|
|
startParser: false, |
|
|
@ -120,10 +114,10 @@ export default { |
|
|
|
}, |
|
|
|
computed: {}, |
|
|
|
watch: {}, |
|
|
|
beforeCreate() { |
|
|
|
beforeCreate () { |
|
|
|
document.querySelector('body').className = 'project-body' |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created () { |
|
|
|
if (this.projectConfig && this.projectConfig.projectKey) { |
|
|
|
this.formConf.projectKey = this.projectConfig.projectKey |
|
|
|
if (this.projectConfig.projectKind) { |
|
|
@ -139,8 +133,8 @@ export default { |
|
|
|
} |
|
|
|
this.formConf.size = window.innerWidth < 480 ? 'medium' : 'small' |
|
|
|
}, |
|
|
|
async mounted() { |
|
|
|
let url = `${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/details/${this.formConf.projectKey}` |
|
|
|
async mounted () { |
|
|
|
let url = `${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/details/${this.formConf.projectKey}?access_key=${this.accessKey}` |
|
|
|
if (this.formConf.projectKind == 2) { |
|
|
|
url = `${process.env.VUE_APP_API_ROOT_TDUCK}/project/template/details/${this.formConf.projectKey}` |
|
|
|
} |
|
|
@ -193,7 +187,7 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 分页显示数据处理 |
|
|
|
pageShowHandle(allFields) { |
|
|
|
pageShowHandle (allFields) { |
|
|
|
// 判断是否存在分页 |
|
|
|
let index = allFields.findIndex(item => { |
|
|
|
return item.typeId === 'PAGINATION' |
|
|
@ -236,9 +230,9 @@ export default { |
|
|
|
this.perPageFields = perPageFields |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 处理逻辑显示数据 |
|
|
|
*/ |
|
|
|
logicShowTriggerHandle(logicItem) { |
|
|
|
* 处理逻辑显示数据 |
|
|
|
*/ |
|
|
|
logicShowTriggerHandle (logicItem) { |
|
|
|
if (!logicItem) { |
|
|
|
return |
|
|
|
} |
|
|
@ -260,7 +254,7 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 统一处理axios请求 |
|
|
|
queryLogicItemList() { |
|
|
|
queryLogicItemList () { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
this.$api.get(`${process.env.VUE_APP_API_ROOT_TDUCK}/user/project/logic/list`, { params: { projectKey: this.formConf.projectKey } }) |
|
|
|
.then(res => { |
|
|
@ -270,13 +264,13 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
prevPage(params) { |
|
|
|
prevPage (params) { |
|
|
|
this.switchPage(params.page - 1, params) |
|
|
|
}, |
|
|
|
nextPage(params) { |
|
|
|
nextPage (params) { |
|
|
|
this.switchPage(params.page + 1, params) |
|
|
|
}, |
|
|
|
switchPage(page, params) { |
|
|
|
switchPage (page, params) { |
|
|
|
let { labelFormModel, formModel } = params |
|
|
|
this.formModel = formModel |
|
|
|
this.labelFormModel = labelFormModel |
|
|
@ -284,7 +278,7 @@ export default { |
|
|
|
this.formConf.fields = _.get(this.perPageFields, page) |
|
|
|
this.parserKey = +new Date() |
|
|
|
}, |
|
|
|
submitForm(data) { |
|
|
|
submitForm (data) { |
|
|
|
this.$emit('submit', data) |
|
|
|
} |
|
|
|
} |
|
|
|