Commit 9c68b51e by Mr. Lan

支持模版控制。

parent fecb3fd0
...@@ -43,6 +43,23 @@ ...@@ -43,6 +43,23 @@
:allow-half="widget.options.allowHalf" :allow-half="widget.options.allowHalf"
/> />
</template> </template>
<template v-else-if="widget.type === 'divider'">
<el-divider
:direction="widget.options.direction"
:content-position="widget.options.content_position"
>
<span
:style="{
'font-size': widget.options.font_size,
'font-family': widget.options.font_family,
'font-weight': widget.options.font_weight,
'color': widget.options.font_color
}"
>
{{ widget.options.defaultValue }}
</span>
</el-divider>
</template>
<template v-else> <template v-else>
<div> <div>
{{ dataModel }} {{ dataModel }}
......
...@@ -17,15 +17,26 @@ ...@@ -17,15 +17,26 @@
<el-option v-for="(taskValue, taskIndex) in tasks" :key="taskIndex" :label="taskValue.name" :value="taskValue.full_name" /> <el-option v-for="(taskValue, taskIndex) in tasks" :key="taskIndex" :label="taskValue.name" :value="taskValue.full_name" />
</el-select> </el-select>
</div> </div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:write-preview="false"
:readonly-preview="false"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import DefaultDetail from './DefaultDetail' import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default { export default {
inject: ['i18n'], inject: ['i18n'],
components: { components: {
DefaultDetail DefaultDetail,
NodeDetail
}, },
props: { props: {
model: { model: {
...@@ -43,6 +54,14 @@ export default { ...@@ -43,6 +54,14 @@ export default {
readOnly: { readOnly: {
type: Boolean, type: Boolean,
default: false default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
} }
} }
} }
......
...@@ -106,15 +106,25 @@ ...@@ -106,15 +106,25 @@
:disabled="readOnly" :disabled="readOnly"
:value="!!model.isTaskOrder">{{i18n['handleNode.taskOrder']}}</el-checkbox> --> :value="!!model.isTaskOrder">{{i18n['handleNode.taskOrder']}}</el-checkbox> -->
</div> </div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:readonly-preview="false"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import DefaultDetail from './DefaultDetail' import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default { export default {
inject: ['i18n'], inject: ['i18n'],
components: { components: {
DefaultDetail DefaultDetail,
NodeDetail
}, },
props: { props: {
model: { model: {
...@@ -144,6 +154,14 @@ export default { ...@@ -144,6 +154,14 @@ export default {
readOnly: { readOnly: {
type: Boolean, type: Boolean,
default: false default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
} }
}, },
data() { data() {
......
<template>
<div>
<div v-if="writePreview" class="panelRow">
<div>可写模版:</div>
<el-select
style="width:90%; font-size:12px"
placeholder="选择模版"
:disabled="readOnly"
:value="model.writeTpls"
:multiple="true"
:filterable="true"
@change="(e) => onChange('writeTpls', e)"
>
<template v-for="(templateValue, templateIndex) in templatesBase">
<el-option v-if="templates.indexOf(templateValue.id) !== -1" :key="templateIndex" :label="templateValue.name" :value="templateValue.id" />
</template>
</el-select>
</div>
<div v-if="readonlyPreview" class="panelRow">
<div>只读模版:</div>
<el-select
style="width:90%; font-size:12px"
placeholder="选择模版"
:disabled="readOnly"
:value="model.readonlyTpls"
:multiple="true"
:filterable="true"
@change="(e) => onChange('readonlyTpls', e)"
>
<template v-for="(templateValue, templateIndex) in templatesBase">
<el-option v-if="templates.indexOf(templateValue.id) !== -1" :key="templateIndex" :label="templateValue.name" :value="templateValue.id" />
</template>
</el-select>
</div>
<div class="panelRow">
<div>隐藏模版:</div>
<el-select
style="width:90%; font-size:12px"
placeholder="选择模版"
:disabled="readOnly"
:value="model.hideTpls"
:multiple="true"
:filterable="true"
@change="(e) => onChange('hideTpls', e)"
>
<template v-for="(templateValue, templateIndex) in templatesBase">
<el-option v-if="templates.indexOf(templateValue.id) !== -1" :key="templateIndex" :label="templateValue.name" :value="templateValue.id" />
</template>
</el-select>
</div>
</div>
</template>
<script>
export default {
inject: ['i18n'],
props: {
model: {
type: Object,
default: () => ({})
},
onChange: {
type: Function,
default: () => {}
},
readOnly: {
type: Boolean,
default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
},
writePreview: {
type: Boolean,
default: true
},
readonlyPreview: {
type: Boolean,
default: true
}
}
}
</script>
...@@ -17,15 +17,25 @@ ...@@ -17,15 +17,25 @@
<el-option v-for="(taskValue, taskIndex) in tasks" :key="taskIndex" :label="taskValue.name" :value="taskValue.full_name" /> <el-option v-for="(taskValue, taskIndex) in tasks" :key="taskIndex" :label="taskValue.name" :value="taskValue.full_name" />
</el-select> </el-select>
</div> </div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:write-preview="false"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import DefaultDetail from './DefaultDetail' import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default { export default {
inject: ['i18n'], inject: ['i18n'],
components: { components: {
DefaultDetail DefaultDetail,
NodeDetail
}, },
props: { props: {
model: { model: {
...@@ -43,6 +53,14 @@ export default { ...@@ -43,6 +53,14 @@ export default {
readOnly: { readOnly: {
type: Boolean, type: Boolean,
default: false default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
} }
} }
} }
......
...@@ -97,15 +97,25 @@ ...@@ -97,15 +97,25 @@
:disabled="readOnly" :disabled="readOnly"
:value="!!model.isEndorsement">{{i18n['userTask.endorsement']}}</el-checkbox> --> :value="!!model.isEndorsement">{{i18n['userTask.endorsement']}}</el-checkbox> -->
</div> </div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:readonly-preview="false"
/>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import DefaultDetail from './DefaultDetail' import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default { export default {
inject: ['i18n'], inject: ['i18n'],
components: { components: {
DefaultDetail DefaultDetail,
NodeDetail
}, },
props: { props: {
model: { model: {
...@@ -135,6 +145,14 @@ export default { ...@@ -135,6 +145,14 @@ export default {
readOnly: { readOnly: {
type: Boolean, type: Boolean,
default: false default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
} }
}, },
data() { data() {
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
:groups="groups" :groups="groups"
:departments="departments" :departments="departments"
:tasks="tasks" :tasks="tasks"
:templates="templates"
:templates-base="templatesBase"
/> />
<ScriptTaskDetail <ScriptTaskDetail
v-else-if="model.clazz === 'scriptTask'" v-else-if="model.clazz === 'scriptTask'"
...@@ -26,11 +28,42 @@ ...@@ -26,11 +28,42 @@
:groups="groups" :groups="groups"
:departments="departments" :departments="departments"
:tasks="tasks" :tasks="tasks"
:templates="templates"
:templates-base="templatesBase"
/>
<GatewayDetail
v-else-if="model.clazz === 'gateway' ||
model.clazz === 'exclusiveGateway' ||
model.clazz === 'parallelGateway' ||
model.clazz === 'inclusiveGateway'"
:model="model"
:on-change="onChange"
:read-only="readOnly"
/>
<StartEventDetail
v-else-if="model.clazz === 'start'"
:model="model"
:on-change="onChange"
:read-only="readOnly"
:tasks="tasks"
:templates="templates"
:templates-base="templatesBase"
/>
<EndEventDetail
v-else-if="model.clazz === 'end'"
:model="model"
:on-change="onChange"
:read-only="readOnly"
:tasks="tasks"
:templates="templates"
:templates-base="templatesBase"
/>
<FlowDetail
v-else-if="model.clazz === 'flow'"
:model="model"
:on-change="onChange"
:read-only="readOnly"
/> />
<GatewayDetail v-else-if="model.clazz === 'gateway' || model.clazz === 'exclusiveGateway' || model.clazz === 'parallelGateway' || model.clazz === 'inclusiveGateway'" :model="model" :on-change="onChange" :read-only="readOnly" />
<StartEventDetail v-else-if="model.clazz === 'start'" :model="model" :on-change="onChange" :read-only="readOnly" :tasks="tasks" />
<EndEventDetail v-else-if="model.clazz === 'end'" :model="model" :on-change="onChange" :read-only="readOnly" :tasks="tasks" />
<FlowDetail v-else-if="model.clazz === 'flow'" :model="model" :on-change="onChange" :read-only="readOnly" />
</div> </div>
</template> </template>
<script> <script>
...@@ -92,6 +125,14 @@ export default { ...@@ -92,6 +125,14 @@ export default {
tasks: { tasks: {
type: Array, type: Array,
default: () => ([]) default: () => ([])
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
} }
} }
} }
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
:groups="groups" :groups="groups"
:departments="departments" :departments="departments"
:tasks="tasks" :tasks="tasks"
:templates="templates"
:templates-base="templatesBase"
:signal-defs="processModel.signalDefs" :signal-defs="processModel.signalDefs"
:message-defs="processModel.messageDefs" :message-defs="processModel.messageDefs"
:on-change="(key,val)=>{onItemCfgChange(key,val)}" :on-change="(key,val)=>{onItemCfgChange(key,val)}"
...@@ -89,6 +91,14 @@ export default { ...@@ -89,6 +91,14 @@ export default {
tasks: { tasks: {
type: Array, type: Array,
default: () => ([]) default: () => ([])
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
} }
}, },
data() { data() {
......
...@@ -146,6 +146,8 @@ ...@@ -146,6 +146,8 @@
:users="users" :users="users"
:departments="departments" :departments="departments"
:tasks="taskListData" :tasks="taskListData"
:templates="ruleForm.tpls"
:templates-base="templates"
:data="ruleForm.structure" :data="ruleForm.structure"
:height="600" :height="600"
:lang="lang" :lang="lang"
......
...@@ -41,13 +41,20 @@ ...@@ -41,13 +41,20 @@
<span>表单信息</span> <span>表单信息</span>
</div> </div>
<div class="text item"> <div class="text item">
<template v-for="(tplItem, tplIndex) in processStructureValue.tpls">
<fm-generate-form <fm-generate-form
v-for="(tplItem, tplIndex) in processStructureValue.tpls" v-show="currentNode.hideTpls===undefined ||
currentNode.hideTpls===null ||
currentNode.hideTpls.indexOf(tplItem.id)===-1"
:key="tplIndex" :key="tplIndex"
:ref="'generateForm-'+tplItem.id" :ref="'generateForm-'+tplItem.id"
:remote="remoteFunc" :remote="remoteFunc"
:data="tplItem.form_structure" :data="tplItem.form_structure"
:disabled="currentNode.readonlyTpls===undefined ||
currentNode.readonlyTpls===null ||
currentNode.readonlyTpls.indexOf(tplItem.id)===-1?false:true"
/> />
</template>
</div> </div>
<hr style="background-color: #d9d9d9; border:0; height:1px;"> <hr style="background-color: #d9d9d9; border:0; height:1px;">
<div class="text item" style="text-align: center;margin-top:18px"> <div class="text item" style="text-align: center;margin-top:18px">
...@@ -132,6 +139,7 @@ export default { ...@@ -132,6 +139,7 @@ export default {
processId: this.$route.query.processId processId: this.$route.query.processId
}).then(response => { }).then(response => {
this.processStructureValue = response.data this.processStructureValue = response.data
this.currentNode = this.processStructureValue.nodes[0]
}) })
}, },
submitAction(target) { submitAction(target) {
...@@ -174,6 +182,7 @@ export default { ...@@ -174,6 +182,7 @@ export default {
var promiseList = [] var promiseList = []
for (var tpl of this.processStructureValue.tpls) { for (var tpl of this.processStructureValue.tpls) {
tpl.form_structure.id = tpl.id
this.ruleForm.tpls.form_structure.push(tpl.form_structure) this.ruleForm.tpls.form_structure.push(tpl.form_structure)
promiseList.push(this.$refs['generateForm-' + tpl.id][0].getData()) promiseList.push(this.$refs['generateForm-' + tpl.id][0].getData())
} }
......
...@@ -60,16 +60,21 @@ ...@@ -60,16 +60,21 @@
<span>表单信息</span> <span>表单信息</span>
</div> </div>
<div class="text item"> <div class="text item">
<template v-for="(tplItem, tplIndex) in processStructureValue.tpls">
<fm-generate-form <fm-generate-form
v-for="(tplItem, tplIndex) in processStructureValue.tpls" v-show="currentNode.hideTpls===undefined ||
currentNode.hideTpls===null ||
currentNode.hideTpls.indexOf(tplItem.id)===-1"
:key="tplIndex" :key="tplIndex"
:ref="'generateForm-'+tplItem.id" :ref="'generateForm-'+tplItem.id"
:preview="true" :preview="currentNode.writeTpls===undefined ||
currentNode.writeTpls===null ||
currentNode.writeTpls.indexOf(tplItem.form_structure.id)===-1?true:false"
:remote="remoteFunc" :remote="remoteFunc"
:value="tplItem.form_data" :value="tplItem.form_data"
:data="tplItem.form_structure" :data="tplItem.form_structure"
:disabled="true"
/> />
</template>
</div> </div>
<div v-if="processStructureValue.userAuthority"> <div v-if="processStructureValue.userAuthority">
<hr style="background-color: #d9d9d9; border:0; height:1px; margin-bottom: 15px"> <hr style="background-color: #d9d9d9; border:0; height:1px; margin-bottom: 15px">
...@@ -151,6 +156,7 @@ import { listUser } from '@/api/system/sysuser' ...@@ -151,6 +156,7 @@ import { listUser } from '@/api/system/sysuser'
export default { export default {
data() { data() {
return { return {
tpls: [],
remarks: '', // 备注信息 remarks: '', // 备注信息
alertMessage: '', alertMessage: '',
nodeStepList: [], nodeStepList: [],
...@@ -206,6 +212,7 @@ export default { ...@@ -206,6 +212,7 @@ export default {
if (i + 1 === this.processStructureValue.nodes.length) { if (i + 1 === this.processStructureValue.nodes.length) {
this.activeIndex = this.nodeStepList.length this.activeIndex = this.nodeStepList.length
} }
this.currentNode = this.processStructureValue.nodes[i]
} else if (!this.processStructureValue.nodes[i].isHideNode) { } else if (!this.processStructureValue.nodes[i].isHideNode) {
// 非隐藏节点 // 非隐藏节点
this.nodeStepList.push(this.processStructureValue.nodes[i]) this.nodeStepList.push(this.processStructureValue.nodes[i])
...@@ -215,6 +222,18 @@ export default { ...@@ -215,6 +222,18 @@ export default {
}) })
}, },
submitAction(item) { submitAction(item) {
var promiseList = []
for (var tpl of this.processStructureValue.tpls) {
this.tpls.push({
tplDataId: tpl.id
})
promiseList.push(this.$refs['generateForm-' + tpl.id][0].getData())
}
Promise.all(promiseList).then(values => {
for (var tplDataIndex in this.tpls) {
this.tpls[tplDataIndex].tplValue = values[tplDataIndex]
}
console.log(this.tpls)
handleWorkOrder({ handleWorkOrder({
tasks: this.processStructureValue.process.task, tasks: this.processStructureValue.process.task,
source_state: this.processStructureValue.workOrder.current_state, source_state: this.processStructureValue.workOrder.current_state,
...@@ -222,7 +241,8 @@ export default { ...@@ -222,7 +241,8 @@ export default {
circulation: item.label, circulation: item.label,
flow_properties: item.flowProperties === undefined ? 2 : parseInt(item.flowProperties), flow_properties: item.flowProperties === undefined ? 2 : parseInt(item.flowProperties),
work_order_id: parseInt(this.$route.query.workOrderId), work_order_id: parseInt(this.$route.query.workOrderId),
remarks: this.remarks remarks: this.remarks,
tpls: this.tpls
}).then(response => { }).then(response => {
if (response.code === 200) { if (response.code === 200) {
// this.$router.push({ name: 'upcoming' }) // this.$router.push({ name: 'upcoming' })
...@@ -230,6 +250,7 @@ export default { ...@@ -230,6 +250,7 @@ export default {
this.getProcessNodeList() this.getProcessNodeList()
} }
}) })
})
}, },
// 获取提示消息 // 获取提示消息
getAlertMessage() { getAlertMessage() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment