Commit 6b19c939 by lyl_task Committed by GitHub

Merge pull request #10 from lanyulei/dev

支持模版控制。
parents a6e2af38 9c68b51e
......@@ -43,6 +43,23 @@
:allow-half="widget.options.allowHalf"
/>
</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>
<div>
{{ dataModel }}
......
......@@ -17,15 +17,26 @@
<el-option v-for="(taskValue, taskIndex) in tasks" :key="taskIndex" :label="taskValue.name" :value="taskValue.full_name" />
</el-select>
</div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:write-preview="false"
:readonly-preview="false"
/>
</div>
</div>
</template>
<script>
import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default {
inject: ['i18n'],
components: {
DefaultDetail
DefaultDetail,
NodeDetail
},
props: {
model: {
......@@ -43,6 +54,14 @@ export default {
readOnly: {
type: Boolean,
default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
}
}
}
......
......@@ -106,15 +106,25 @@
:disabled="readOnly"
:value="!!model.isTaskOrder">{{i18n['handleNode.taskOrder']}}</el-checkbox> -->
</div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:readonly-preview="false"
/>
</div>
</div>
</template>
<script>
import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default {
inject: ['i18n'],
components: {
DefaultDetail
DefaultDetail,
NodeDetail
},
props: {
model: {
......@@ -144,6 +154,14 @@ export default {
readOnly: {
type: Boolean,
default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
}
},
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 @@
<el-option v-for="(taskValue, taskIndex) in tasks" :key="taskIndex" :label="taskValue.name" :value="taskValue.full_name" />
</el-select>
</div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:write-preview="false"
/>
</div>
</div>
</template>
<script>
import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default {
inject: ['i18n'],
components: {
DefaultDetail
DefaultDetail,
NodeDetail
},
props: {
model: {
......@@ -43,6 +53,14 @@ export default {
readOnly: {
type: Boolean,
default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
}
}
}
......
......@@ -97,15 +97,25 @@
:disabled="readOnly"
:value="!!model.isEndorsement">{{i18n['userTask.endorsement']}}</el-checkbox> -->
</div>
<NodeDetail
:model="model"
:on-change="onChange"
:read-only="readOnly"
:templates="templates"
:templates-base="templatesBase"
:readonly-preview="false"
/>
</div>
</div>
</template>
<script>
import DefaultDetail from './DefaultDetail'
import NodeDetail from './NodeDetail'
export default {
inject: ['i18n'],
components: {
DefaultDetail
DefaultDetail,
NodeDetail
},
props: {
model: {
......@@ -135,6 +145,14 @@ export default {
readOnly: {
type: Boolean,
default: false
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
}
},
data() {
......
......@@ -9,6 +9,8 @@
:groups="groups"
:departments="departments"
:tasks="tasks"
:templates="templates"
:templates-base="templatesBase"
/>
<ScriptTaskDetail
v-else-if="model.clazz === 'scriptTask'"
......@@ -26,11 +28,42 @@
:groups="groups"
:departments="departments"
: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>
</template>
<script>
......@@ -92,6 +125,14 @@ export default {
tasks: {
type: Array,
default: () => ([])
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
}
}
}
......
......@@ -14,6 +14,8 @@
:groups="groups"
:departments="departments"
:tasks="tasks"
:templates="templates"
:templates-base="templatesBase"
:signal-defs="processModel.signalDefs"
:message-defs="processModel.messageDefs"
:on-change="(key,val)=>{onItemCfgChange(key,val)}"
......@@ -89,6 +91,14 @@ export default {
tasks: {
type: Array,
default: () => ([])
},
templates: {
type: Array,
default: () => ([])
},
templatesBase: {
type: Array,
default: () => ([])
}
},
data() {
......
......@@ -146,6 +146,8 @@
:users="users"
:departments="departments"
:tasks="taskListData"
:templates="ruleForm.tpls"
:templates-base="templates"
:data="ruleForm.structure"
:height="600"
:lang="lang"
......
......@@ -41,13 +41,20 @@
<span>表单信息</span>
</div>
<div class="text item">
<fm-generate-form
v-for="(tplItem, tplIndex) in processStructureValue.tpls"
:key="tplIndex"
:ref="'generateForm-'+tplItem.id"
:remote="remoteFunc"
:data="tplItem.form_structure"
/>
<template v-for="(tplItem, tplIndex) in processStructureValue.tpls">
<fm-generate-form
v-show="currentNode.hideTpls===undefined ||
currentNode.hideTpls===null ||
currentNode.hideTpls.indexOf(tplItem.id)===-1"
:key="tplIndex"
:ref="'generateForm-'+tplItem.id"
:remote="remoteFunc"
:data="tplItem.form_structure"
:disabled="currentNode.readonlyTpls===undefined ||
currentNode.readonlyTpls===null ||
currentNode.readonlyTpls.indexOf(tplItem.id)===-1?false:true"
/>
</template>
</div>
<hr style="background-color: #d9d9d9; border:0; height:1px;">
<div class="text item" style="text-align: center;margin-top:18px">
......@@ -132,6 +139,7 @@ export default {
processId: this.$route.query.processId
}).then(response => {
this.processStructureValue = response.data
this.currentNode = this.processStructureValue.nodes[0]
})
},
submitAction(target) {
......@@ -174,6 +182,7 @@ export default {
var promiseList = []
for (var tpl of this.processStructureValue.tpls) {
tpl.form_structure.id = tpl.id
this.ruleForm.tpls.form_structure.push(tpl.form_structure)
promiseList.push(this.$refs['generateForm-' + tpl.id][0].getData())
}
......
......@@ -60,16 +60,21 @@
<span>表单信息</span>
</div>
<div class="text item">
<fm-generate-form
v-for="(tplItem, tplIndex) in processStructureValue.tpls"
:key="tplIndex"
:ref="'generateForm-'+tplItem.id"
:preview="true"
:remote="remoteFunc"
:value="tplItem.form_data"
:data="tplItem.form_structure"
:disabled="true"
/>
<template v-for="(tplItem, tplIndex) in processStructureValue.tpls">
<fm-generate-form
v-show="currentNode.hideTpls===undefined ||
currentNode.hideTpls===null ||
currentNode.hideTpls.indexOf(tplItem.id)===-1"
:key="tplIndex"
:ref="'generateForm-'+tplItem.id"
:preview="currentNode.writeTpls===undefined ||
currentNode.writeTpls===null ||
currentNode.writeTpls.indexOf(tplItem.form_structure.id)===-1?true:false"
:remote="remoteFunc"
:value="tplItem.form_data"
:data="tplItem.form_structure"
/>
</template>
</div>
<div v-if="processStructureValue.userAuthority">
<hr style="background-color: #d9d9d9; border:0; height:1px; margin-bottom: 15px">
......@@ -151,6 +156,7 @@ import { listUser } from '@/api/system/sysuser'
export default {
data() {
return {
tpls: [],
remarks: '', // 备注信息
alertMessage: '',
nodeStepList: [],
......@@ -206,6 +212,7 @@ export default {
if (i + 1 === this.processStructureValue.nodes.length) {
this.activeIndex = this.nodeStepList.length
}
this.currentNode = this.processStructureValue.nodes[i]
} else if (!this.processStructureValue.nodes[i].isHideNode) {
// 非隐藏节点
this.nodeStepList.push(this.processStructureValue.nodes[i])
......@@ -215,20 +222,34 @@ export default {
})
},
submitAction(item) {
handleWorkOrder({
tasks: this.processStructureValue.process.task,
source_state: this.processStructureValue.workOrder.current_state,
target_state: item.target,
circulation: item.label,
flow_properties: item.flowProperties === undefined ? 2 : parseInt(item.flowProperties),
work_order_id: parseInt(this.$route.query.workOrderId),
remarks: this.remarks
}).then(response => {
if (response.code === 200) {
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({
tasks: this.processStructureValue.process.task,
source_state: this.processStructureValue.workOrder.current_state,
target_state: item.target,
circulation: item.label,
flow_properties: item.flowProperties === undefined ? 2 : parseInt(item.flowProperties),
work_order_id: parseInt(this.$route.query.workOrderId),
remarks: this.remarks,
tpls: this.tpls
}).then(response => {
if (response.code === 200) {
// this.$router.push({ name: 'upcoming' })
// window.location.reload()
this.getProcessNodeList()
}
this.getProcessNodeList()
}
})
})
},
// 获取提示消息
......
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