Files
workflow/app/view/component/workflowBasicInfo.html
T
2024-05-14 16:43:27 +08:00

250 lines
10 KiB
HTML

<template id="workflow-basic-info">
<div class="workflow-basic-info-container">
<v-form ref="basicInfoForm" lazy-validation>
<v-row>
<v-col cols="12" sm="12" md="12" xl="12" class="pb-0">
<span class="jh-input-label title-label">流程名<span class="red--text text--accent-2 ml-1 require-label">*必填</span></span>
<v-text-field
class="jh-v-input" dense filled single-line color="success"
v-model="workflowInfo['workflowName']" :rules="validationRules.requireRules">
</v-text-field>
</v-col>
<v-col cols="12" sm="12" md="12" xl="12" class="pb-0">
<span class="title-label jh-input-label">模板图标</span>
<v-menu
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="auto"
max-width="75%"
max-height="60%"
class="block"
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
class="jh-v-input"
dense
single-line
filled
v-model="workflowInfo['taskTemplateIcon']"
v-bind="attrs"
v-on="on"
>
<template #prepend-inner>
<template v-if="workflowInfo.taskTemplateIcon">
<v-img
max-height="30"
max-width="30"
:src="`/<$ ctx.app.config.appId $>/public${workflowInfo.taskTemplateIcon}`"
></v-img>
</template>
</template>
</v-text-field>
</template>
<v-card>
<div class="d-flex flex-wrap">
<div
v-for="icon in constantObj.materialDesignIcons"
:class="`item-icon pa-1 ${workflowInfo.taskTemplateIcon == icon && 'grey lighten-2'}`"
@click="workflowInfo.taskTemplateIcon = icon"
>
<v-img
max-height="30"
max-width="30"
:src="`/<$ ctx.app.config.appId $>/public${icon}`"
></v-img>
</div>
</div>
</v-card>
</v-menu>
</v-col>
<v-col cols="12" sm="12" md="12" xl="12" class="pb-0">
<span class="jh-input-label title-label">模板分组(支持输入自定义分组)</span>
<v-combobox v-model="workflowInfo['taskTemplateGroup']" :items="constantObj.taskTemplateGroup" class="jh-v-input" dense
filled small hide-actions hide-controls hide-details>
</v-combobox>
</v-col>
<v-col cols="12" sm="12" md="12" xl="12" class="pb-0">
<span class="jh-input-label title-label">申请时,设置审批人/抄送人权限</span>
<v-checkbox
v-model="workflowInfo['modifyAuthority']"
label="申请人不可修改预设审批/抄送人"
hide-details
dense
></v-checkbox>
</v-col>
<v-col cols="12" sm="12" md="12" xl="12" class="pb-0">
<span class="jh-input-label title-label">审批过程时,当审批人账号被禁用</span>
<!-- 自动同意、自动交接给指定人员 -->
<v-radio-group v-model="workflowInfo['abnormalType']" dense>
<v-radio
label="自动同意"
value="-1"
dense
></v-radio>
<v-radio
label="自动交接给指定人员"
value="1"
dense
>
<template v-slot:label>
<div class="d-flex align-center" style="width: 450px;">
<span>自动交接给指定人员</span>
<div v-if="workflowInfo['abnormalType'] == 1" style="width: 45%;" class="d-flex align-center ml-2" >
<v-autocomplete
class="jh-v-input mr-2"
dense filled single-line clearable
:items="user"
item-text="username"
item-value="userId"
v-model="workflowInfo['abnormalUser']">
</v-autocomplete>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon
color="grey"
dark
v-bind="attrs"
v-on="on"
small
>
mdi-alert-circle-outline
</v-icon>
</template>
<span>若指定成员也异常,将自动通过</span>
</v-tooltip>
</div>
</div>
</template>
</v-radio>
</v-radio-group>
</v-col>
<v-col cols="12" sm="12" md="12" xl="12" class="pb-0">
<span class="jh-input-label title-label">审批过程时,一人多节点自动审批配置</span>
<!-- 仅首个节点需要审批,其余自动同意 -->
<!-- 仅连续审批时自动同意 -->
<!-- 每个节点都需要审批 -->
<v-radio-group v-model="workflowInfo['autoApprovel']" dense>
<v-radio
label="仅首个节点需要审批,其余自动同意"
value="1"
dense
></v-radio>
<!-- <v-radio
label="仅连续审批时自动同意"
value="2"
dense
></v-radio> -->
<v-radio
label="每个节点都需要审批"
value="2"
dense
></v-radio>
</v-radio>
</v-col>
<!-- <v-col cols="12" sm="12" md="12" xl="12">
<span class="jh-input-label">备注</span>
<v-text-field
class="jh-v-input mr-2" dense filled single-line color="success"
v-model="workflowInfo['workflowRemark']">
</v-text-field>
</v-col> -->
</v-row>
</v-form>
</div>
</template>
<script src="/<$ ctx.app.config.appId $>/public/task-template-icons.js"></script>
<script type="module">
Vue.component("workflow-basic-info", {
template: '#workflow-basic-info',
// vuetify: new Vuetify(),
props: {
workflowInfo: {
type: Object,
default: () => {
return {
taskTemplateIcon: '/images/task-template-icon/10001.png',
addAuthority: false,
modifyAuthority: false,
abnormalType: '-1',
autoApprovel: '1',
}
}
},
user: {
type: Array,
default: () => {
return []
}
},
},
data() {
return {
validationRules: {
requireRules: [
v => !!v || '必填',
],
},
constantObj: {
taskTemplateGroup: window.constantObj.taskTemplateGroup,
materialDesignIcons: window.constantObj.materialDesignIcons,
},
}
},
watch: {
},
created() {},
methods: {
async doUiAction(uiActionId, uiActionData) {
switch (uiActionId) {
case 'dataValidate':
await this.dataValidate();
break;
default:
console.error("[doUiAction] uiActionId not find", {uiActionId});
break;
}
},
async dataValidate(){
if (await this.$refs.basicInfoForm.validate()) {
return true;
}
await window.vtoast.fail("基础信息:请完善基础信息!");
throw new Error("基础信息:请完善基础信息!")
}
}
})
</script>
<style scoped>
.workflow-basic-info-container {
height: 650px;
max-height: 850px;
overflow-y: auto;
overflow-x: hidden;
}
.theme--light.v-messages{
display: none;
}
.v-input--selection-controls{
margin-top: 0px;
padding-top: 0px;
}
.title-label{
/* font-weight: 600 !important; */
font-size: 14px;
}
.title-label .require-label{
font-weight: 500;
font-size: 12px;
}
</style>