modified ProjectApply table and design the textShow component

jzq 2024-07-03 18:45:48 +08:00
parent 2accfe287a
commit 4df5885701
7 changed files with 3140 additions and 12 deletions

View File

@ -12,6 +12,42 @@ export const formConf = {
formBtns: true formBtns: true
} }
export const textComponents = [
{
// 组件的自定义配置
__config__: {
label: '文本显示',
labelWidth: null,
showLabel: false,
changeTag: true,
tag: 'el-input',
tagIcon: 'text',
defaultValue: undefined,
required: false,
layout: 'colFormItem',
span: 24,
document: 'https://element.eleme.cn/#/zh-CN/component/el-input',
// 正则校验规则
regList: [],
},
// 组件的插槽属性
__slot__: {
prepend: '',
append: ''
},
// 其余的为可直接写在组件标签上的属性
style: {width: '100%'},
placeholder: '请输入要显示的字符然后打开只读属性',
clearable: false,
'prefix-icon': '',
'suffix-icon': '',
maxlength: null,
'show-word-limit': false,
readonly: false,
disabled: false
}
]
// 输入型组件 【左面板】 // 输入型组件 【左面板】
export const inputComponents = [ export const inputComponents = [
{ {

View File

@ -26,6 +26,17 @@ const layouts = {
let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null let labelWidth = config.labelWidth ? `${config.labelWidth}px` : null
if (config.showLabel === false) labelWidth = '0' if (config.showLabel === false) labelWidth = '0'
if(config.tagIcon === 'text') {
return (
<el-col span={config.span}>
<el-form-item class="text" label-width={labelWidth} prop={scheme.__vModel__}
label={config.showLabel ? config.label : ''}>
<render conf={scheme} on={listeners} />
</el-form-item>
</el-col>
)
}
else {
return ( return (
<el-col span={config.span}> <el-col span={config.span}>
<el-form-item label-width={labelWidth} prop={scheme.__vModel__} <el-form-item label-width={labelWidth} prop={scheme.__vModel__}
@ -34,6 +45,7 @@ const layouts = {
</el-form-item> </el-form-item>
</el-col> </el-col>
) )
}
}, },
rowFormItem(h, scheme) { rowFormItem(h, scheme) {
let child = renderChildren.apply(this, arguments) let child = renderChildren.apply(this, arguments)
@ -87,7 +99,7 @@ function renderFormItem(h, elementList) {
return elementList.map(scheme => { return elementList.map(scheme => {
const config = scheme.__config__ const config = scheme.__config__
const layout = layouts[config.layout] const layout = layouts[config.layout]
console.log(layout)
if (layout) { if (layout) {
return layout.call(this, h, scheme) return layout.call(this, h, scheme)
} }

View File

@ -645,7 +645,7 @@ import TreeNodeDialog from './TreeNodeDialog'
import { isNumberStr } from '@/utils/index' import { isNumberStr } from '@/utils/index'
import IconsDialog from './IconsDialog' import IconsDialog from './IconsDialog'
import { import {
inputComponents, selectComponents, layoutComponents inputComponents, selectComponents, layoutComponents, textComponents
} from '@/utils/generator/config' } from '@/utils/generator/config'
import { saveFormConf } from '@/utils/db' import { saveFormConf } from '@/utils/db'
@ -785,6 +785,10 @@ export default {
}, },
tagList() { tagList() {
return [ return [
{
label: '显示型组件',
options: textComponents
},
{ {
label: '输入型组件', label: '输入型组件',
options: inputComponents options: inputComponents

View File

@ -71,6 +71,7 @@
<draggable class="drawing-board" :list="drawingList" :animation="340" group="componentsGroup"> <draggable class="drawing-board" :list="drawingList" :animation="340" group="componentsGroup">
<draggable-item <draggable-item
v-for="(item, index) in drawingList" v-for="(item, index) in drawingList"
:class="item.__config__.tagIcon"
:key="item.renderKey" :key="item.renderKey"
:drawing-list="drawingList" :drawing-list="drawingList"
:current-item="item" :current-item="item"
@ -143,7 +144,13 @@ import render from '@/utils/generator/render'
import FormDrawer from './FormDrawer' import FormDrawer from './FormDrawer'
import JsonDrawer from './JsonDrawer' import JsonDrawer from './JsonDrawer'
import RightPanel from './RightPanel' import RightPanel from './RightPanel'
import { inputComponents, selectComponents, layoutComponents, formConf } from '@/utils/generator/config' import {
inputComponents,
selectComponents,
layoutComponents,
formConf,
textComponents
} from '@/utils/generator/config'
import { beautifierConf, titleCase, deepClone } from '@/utils/index' import { beautifierConf, titleCase, deepClone } from '@/utils/index'
import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html' import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html'
import { makeUpJs } from '@/utils/generator/js' import { makeUpJs } from '@/utils/generator/js'
@ -184,6 +191,7 @@ export default {
logo, logo,
idGlobal, idGlobal,
formConf, formConf,
textComponents,
inputComponents, inputComponents,
selectComponents, selectComponents,
layoutComponents, layoutComponents,
@ -201,6 +209,10 @@ export default {
saveDrawingListDebounce: debounce(340, saveDrawingList), saveDrawingListDebounce: debounce(340, saveDrawingList),
saveIdGlobalDebounce: debounce(340, saveIdGlobal), saveIdGlobalDebounce: debounce(340, saveIdGlobal),
leftComponents: [ leftComponents: [
{
title: '显示型组件',
list: textComponents
},
{ {
title: '输入型组件', title: '输入型组件',
list: inputComponents list: inputComponents
@ -563,6 +575,42 @@ export default {
<style lang='scss'> <style lang='scss'>
// zqjia: set the style for el-input__inner in textShow component
// for textShow component with width 22
.el-col {
.text {
.el-input__inner, .el-input {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 14px;
color: #606266;
border: 0 !important;
box-shadow: none !important;
background-color: transparent !important;
text-align: center;
}
}
}
// for multi textShow component in a line with width 24
.el-col-24 {
.text {
.el-input__inner, .el-input {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: bold;
font-size: 14px;
color: #606266;
border: 0 !important;
box-shadow: none !important;
background-color: transparent !important;
text-align: left;
}
}
}
.editor-tabs{ .editor-tabs{
background: #121315; background: #121315;
.el-tabs__header{ .el-tabs__header{

View File

@ -183,6 +183,7 @@ export default {
path: '/workflow/process/start/' + row.deploymentId, path: '/workflow/process/start/' + row.deploymentId,
query: { query: {
definitionId: row.definitionId, definitionId: row.definitionId,
processName: row.processName,
} }
}) })
}, },

View File

@ -2,8 +2,9 @@
<div class="app-container"> <div class="app-container">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>发起流程</span> <span>{{ processName }}</span>
</div> </div>
<el-col :span="18" :offset="3"> <el-col :span="18" :offset="3">
<div class="form-conf" v-if="formOpen"> <div class="form-conf" v-if="formOpen">
<parser :key="new Date().getTime()" :form-conf="formData" @submit="submit" ref="parser" @getData="getData"/> <parser :key="new Date().getTime()" :form-conf="formData" @submit="submit" ref="parser" @getData="getData"/>
@ -29,6 +30,8 @@ export default {
procInsId: null, procInsId: null,
formOpen: false, formOpen: false,
formData: {}, formData: {},
processName: null,
} }
}, },
created() { created() {
@ -39,6 +42,8 @@ export default {
this.deployId = this.$route.params && this.$route.params.deployId; this.deployId = this.$route.params && this.$route.params.deployId;
this.definitionId = this.$route.query && this.$route.query.definitionId; this.definitionId = this.$route.query && this.$route.query.definitionId;
this.procInsId = this.$route.query && this.$route.query.procInsId; this.procInsId = this.$route.query && this.$route.query.procInsId;
this.processName = this.$route.query && this.$route.query.processName;
getProcessForm({ getProcessForm({
definitionId: this.definitionId, definitionId: this.definitionId,
deployId: this.deployId, deployId: this.deployId,

File diff suppressed because one or more lines are too long