计算审批流

This commit is contained in:
ChenXinXin committed 2024-04-24 11:46:38 +08:00
1 parent f6460544f1
commit d418e9b853
6 files changed
+458 -109

No files matched your search

@@ -0,0 +1,119 @@
<template id="form-component-list">
<v-list-item>
<!-- 单选 -->
<v-list-item-content v-if="formItem.type === 'single'">
<template v-if="formItem.optionList.length > 0">
<v-radio-group :disabled='disabled' v-model="formItem.answer" @change="calcWorkflow">
<v-radio hide-details v-for="(option, optionIndex) in formItem.optionList"
:key="optionIndex" :label="option" :value="option"></v-radio>
</v-radio-group>
</template>
<div v-else class="text-caption">请添加选项~</div>
</v-list-item-content>
<!-- 多选 -->
<v-list-item-content v-if="formItem.type === 'multiple'">
<template v-if="formItem.optionList.length > 0">
<div v-for="(option, optionIndex) in formItem.optionList" :key="optionIndex">
<v-checkbox class="mt-0" :disabled='disabled' :label="option" :value="option" hide-details v-model="formItem.answer" @click="calcWorkflow"></v-checkbox>
</div>
</template>
<div v-else class="text-caption">请添加选项~</div>
</v-list-item-content>
<!-- 多行文本 -->
<v-list-item-content v-if="formItem.type === 'textarea'">
<v-textarea class="jh-v-input" dense outlined hide-details :disabled='disabled' :rows="4" placeholder='请输入' v-model="formItem.answer" />
</v-list-item-content>
<!-- 单行文本 -->
<v-list-item-content v-if="formItem.type === 'input'">
<v-text-field class="jh-v-input" dense outlined :disabled='disabled' placeholder='请输入' v-model="formItem.answer"></v-text-field>
</v-list-item-content>
<!-- 文件 -->
<v-list-item-content v-if="formItem.type === 'file'">
<v-file-input chips multiple :disabled='disabled' ></v-file-input>
</v-list-item-content>
<!-- 数字 -->
<v-list-item-content v-if="formItem.type === 'number'">
<v-text-field class="jh-v-input" type="number" dense outlined :disabled='disabled' placeholder='请输入' v-model="formItem.answer" @input="calcWorkflow"></v-text-field>
</v-list-item-content>
<!-- 日期选择器 -->
<v-list-item-content v-if="formItem.type === 'date'">
<v-menu
:close-on-content-click="false"
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="auto"
:disabled='disabled'
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
class="jh-v-input"
dense
single-line
filled
v-bind="attrs"
v-on="on"
placeholder='请选择'
v-model="formItem.answer"
></v-text-field>
</template>
<v-date-picker no-title scrollable></v-date-picker>
</v-menu>
</v-list-item-content>
<!-- 日期时间选择器 -->
<v-list-item-content v-if="formItem.type === 'time'">
<date-time-picker :disabled='disabled' @save-date-time="setDateTime" v-model="formItem.answer"></date-time-picker>
</v-list-item-content>
</v-list-item>
</template>
{% include 'component/common/dateTimePicker.html' %}
<script type="module">
Vue.component("form-component-list", {
template: '#form-component-list',
vuetify: new Vuetify(),
props: {
formItem: {
type: Object,
default: () => {
return {};
},
},
disabled: {
type: Boolean,
default: true,
},
},
data() {
return {
datetime:"2023-12-24 22:23",
}
},
computed: {
},
async created() {
},
methods: {
setDateTime(data){
this.datetime = data
},
async calcWorkflow(){
await this.$emit('calc-workflow')
}
}
})
</script>
<style scoped>
</style>
@@ -69,79 +69,7 @@
</span>
</template>
</div>
<v-list-item>
<!-- 单选 -->
<v-list-item-content v-if="formItem.type === 'single'">
<template v-if="formItem.optionList.length > 0">
<v-radio-group disabled>
<v-radio hide-details v-for="(option, optionIndex) in formItem.optionList"
:key="optionIndex" :label="option" :value="option"></v-radio>
</v-radio-group>
</template>
<div v-else class="text-caption">请添加选项~</div>
</v-list-item-content>
<!-- 多选 -->
<v-list-item-content v-if="formItem.type === 'multiple'">
<template v-if="formItem.optionList.length > 0">
<div v-for="(option, optionIndex) in formItem.optionList" :key="optionIndex">
<v-checkbox hide-details class="mt-0" disabled :label="option" hide-details ></v-checkbox>
</div>
</template>
<div v-else class="text-caption">请添加选项~</div>
</v-list-item-content>
<!-- 多行文本 -->
<v-list-item-content v-if="formItem.type === 'textarea'">
<v-textarea class="jh-v-input" dense outlined hide-details disabled :rows="4" placeholder='请输入' />
</v-list-item-content>
<!-- 单行文本 -->
<v-list-item-content v-if="formItem.type === 'input'">
<v-text-field class="jh-v-input" dense outlined disabled placeholder='请输入'></v-text-field>
</v-list-item-content>
<!-- 文件 -->
<v-list-item-content v-if="formItem.type === 'file'">
<v-file-input chips multiple disabled></v-file-input>
</v-list-item-content>
<!-- 数字 -->
<v-list-item-content v-if="formItem.type === 'number'">
<v-text-field class="jh-v-input" type="number" dense outlined disabled placeholder='请输入'></v-text-field>
</v-list-item-content>
<!-- 日期选择器 -->
<v-list-item-content v-if="formItem.type === 'date'">
<v-menu
:close-on-content-click="false"
:nudge-right="40"
transition="scale-transition"
offset-y
min-width="auto"
disabled
>
<template v-slot:activator="{ on, attrs }">
<v-text-field
class="jh-v-input"
dense
single-line
filled
v-bind="attrs"
v-on="on"
placeholder='请选择'
></v-text-field>
</template>
<v-date-picker no-title scrollable></v-date-picker>
</v-menu>
</v-list-item-content>
<!-- 日期时间选择器 -->
<v-list-item-content v-if="formItem.type === 'time'">
<date-time-picker :disabled='true' @save-date-time="setDateTime"></date-time-picker>
</v-list-item-content>
</v-list-item>
<form-component-list :form-item="formItem" disabled="true"></form-component-list>
</v-card>
</v-hover>
</draggable>
@@ -223,6 +151,8 @@
<script src="//cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/Vue.Draggable/2.20.0/vuedraggable.umd.min.js"></script>
{% include 'component/tpl/formComponentList.html' %}
<script>
// 1. v-main 滚动条
// 2. v-navigation-drawer 小屏幕 不要关闭
@@ -250,7 +180,7 @@ Vue.component("form-item-list-generator", {
],
tempComponent: null,
selectedFormItemId: null,
datetime:"2023-12-24 22:23"
}),
computed: {
selectCanvaIndex() {
@@ -329,9 +259,7 @@ Vue.component("form-item-list-generator", {
getFormItemList() {
return this.formItemList;
},
setDateTime(data){
this.datetime = data
}
},
})
</script>