|
@@ -1,29 +1,43 @@
|
|
<template>
|
|
<template>
|
|
- <div class="flow-create-wrap">
|
|
|
|
- <div class="el-tabs__item submit-tab is-top">
|
|
|
|
- <el-button type="primary" @click="submitHandler">发布</el-button>
|
|
|
|
|
|
+ <div class="create-approval">
|
|
|
|
+ <div class="create-approval-header flex flex_align-center">
|
|
|
|
+ <div class="create-approval-header-back">
|
|
|
|
+ <el-icon :size="18"><ArrowLeft /></el-icon>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="create-approval-header-left-zh">
|
|
|
|
+ <div class="create-approval-header-name">请假</div>
|
|
|
|
+ <div class="create-approval-header-time">最近保存:6 分钟前</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="create-approval-header-tab-list">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(item, idx) in componentsArr"
|
|
|
|
+ :key="idx"
|
|
|
|
+ class="create-approval-header-tab-item"
|
|
|
|
+ :class="[item.label === activeName ? 'active' : '']"
|
|
|
|
+ @click="activeComponent(item)"
|
|
|
|
+ >
|
|
|
|
+ <span class="create-approval-header-tab-counter">{{ idx + 1 }}</span>
|
|
|
|
+ <span>{{ item.label }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="create-approval-header-right">
|
|
|
|
+ <el-button type="primary" @click="submitHandler">发布</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="create-approval-main">
|
|
|
|
+ <component :is="currentComponent" />
|
|
</div>
|
|
</div>
|
|
- <el-tabs v-model="activeName">
|
|
|
|
- <template v-for="v of components" :key="v.name">
|
|
|
|
- <component :is="v.component" ref="tabRefs" v-bind="v" />
|
|
|
|
- </template>
|
|
|
|
- </el-tabs>
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup name="flow_create">
|
|
<script setup name="flow_create">
|
|
-import { ref } from 'vue'
|
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
|
|
|
+import { computed, ref } from 'vue'
|
|
import BasicInfoTab from './components/BasicInfo.vue'
|
|
import BasicInfoTab from './components/BasicInfo.vue'
|
|
import ExtendSetTab from './components/ExtendSet.vue'
|
|
import ExtendSetTab from './components/ExtendSet.vue'
|
|
import FlowDesignTab from './components/FlowDesign.vue'
|
|
import FlowDesignTab from './components/FlowDesign.vue'
|
|
import FormDesignTab from './components/FormDesign.vue'
|
|
import FormDesignTab from './components/FormDesign.vue'
|
|
-const tabRefs = ref()
|
|
|
|
-// const basicInfoRef = ref()
|
|
|
|
-// const formDesignRef = ref()
|
|
|
|
-// const flowDesignRef = ref()
|
|
|
|
-// const extendSetRef = ref()
|
|
|
|
-const components = [
|
|
|
|
|
|
+
|
|
|
|
+const componentsArr = [
|
|
{
|
|
{
|
|
component: BasicInfoTab,
|
|
component: BasicInfoTab,
|
|
label: '基础信息',
|
|
label: '基础信息',
|
|
@@ -49,60 +63,132 @@ const components = [
|
|
// ref: 'extendSetRef'
|
|
// ref: 'extendSetRef'
|
|
}
|
|
}
|
|
]
|
|
]
|
|
-
|
|
|
|
const activeName = ref('基础信息')
|
|
const activeName = ref('基础信息')
|
|
|
|
|
|
-window.tabRefs = tabRefs
|
|
|
|
-const submitHandler = () => {
|
|
|
|
- Promise.all(
|
|
|
|
- tabRefs.value.map(tabPane => {
|
|
|
|
- if (tabPane.validate) {
|
|
|
|
- return tabPane.validate()
|
|
|
|
- }
|
|
|
|
- return {}
|
|
|
|
- })
|
|
|
|
- )
|
|
|
|
- .then(res => {
|
|
|
|
- console.warn(res, 'res.......')
|
|
|
|
- })
|
|
|
|
- .catch(([name, errObj]) => {
|
|
|
|
- console.warn(name, ')错误来源(', errObj)
|
|
|
|
- ElMessage.warning(`${name} 校验失败, 请重试~`)
|
|
|
|
- // 跳转到错误tab
|
|
|
|
- activeName.value = name
|
|
|
|
- })
|
|
|
|
- // console.log(basicInfoRef.value)
|
|
|
|
- // console.log(formDesignRef.value)
|
|
|
|
- // console.log(flowDesignRef.value)
|
|
|
|
- // console.log(extendSetRef.value)
|
|
|
|
|
|
+const submitHandler = () => {}
|
|
|
|
+
|
|
|
|
+const activeComponent = (item) => {
|
|
|
|
+ activeName.value = item.label
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+const currentComponent = computed(() => {
|
|
|
|
+ return componentsArr.find(item => item.label === activeName.value)?.component
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
-.flow-create-wrap {
|
|
|
|
- padding: 0 10px;
|
|
|
|
- background: #fff;
|
|
|
|
- position: relative;
|
|
|
|
|
|
+.create-approval {
|
|
height: 100%;
|
|
height: 100%;
|
|
- .submit-tab {
|
|
|
|
- position: absolute;
|
|
|
|
- right: 0;
|
|
|
|
- top: 0;
|
|
|
|
- z-index: 1;
|
|
|
|
- height: 40px;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-:deep(.el-tabs) {
|
|
|
|
- height: 100%;
|
|
|
|
- .el-tabs__header {
|
|
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
+ min-width: 1200px;
|
|
|
|
+ min-height: 600px;
|
|
|
|
+ overflow: auto;
|
|
|
|
+
|
|
|
|
+ &-header {
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ height: 64px;
|
|
|
|
+ z-index: 12;
|
|
|
|
+ position: relative;
|
|
|
|
+ box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.06);
|
|
|
|
+ padding-left: 16px;
|
|
|
|
+ padding-right: 20px;
|
|
|
|
+
|
|
|
|
+ &-back {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
+ align-items: center;
|
|
|
|
+ height: 100%;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-left-zh {
|
|
|
|
+ width: calc(50% - 316.5px);
|
|
|
|
+ min-width: 248px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-name {
|
|
|
|
+ font-weight: 500;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ width: -webkit-fit-content;
|
|
|
|
+ width: -moz-fit-content;
|
|
|
|
+ width: fit-content;
|
|
|
|
+ max-width: 100%;
|
|
|
|
+ height: 24px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-time {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 20px;
|
|
|
|
+ line-height: 20px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #8f959e;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-tab-list {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-tab-item {
|
|
|
|
+ font-family: PingFang SC, Microsoft YaHei;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ line-height: 28px;
|
|
|
|
+ color: #646a73;
|
|
|
|
+ margin-right: 42px;
|
|
|
|
+ padding: 18px 0;
|
|
|
|
+ border-bottom: 2px solid transparent;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+
|
|
|
|
+ &.active {
|
|
|
|
+ border-bottom-color: #3370ff;
|
|
|
|
+ color: #3370ff;
|
|
|
|
+ font-weight: 500;
|
|
|
|
+
|
|
|
|
+ .create-approval-header-tab-counter {
|
|
|
|
+ border-color: #3370ff;
|
|
|
|
+ background-color: #3370ff;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-tab-counter {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ margin-right: 6px;
|
|
|
|
+ width: 24px;
|
|
|
|
+ height: 24px;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ border: 1px solid #646a73;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ line-height: 22px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &-right {
|
|
|
|
+ flex: 1 1;
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: flex-end;
|
|
|
|
+ align-items: center;
|
|
|
|
+ position: relative;
|
|
|
|
+ height: 100%;
|
|
|
|
+ width: -webkit-fit-content;
|
|
|
|
+ width: -moz-fit-content;
|
|
|
|
+ width: fit-content;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- .el-tabs__content {
|
|
|
|
- // 40 + 10
|
|
|
|
- height: calc(100% - 50px);
|
|
|
|
- overflow: auto;
|
|
|
|
|
|
+
|
|
|
|
+ &-main {
|
|
|
|
+ height: calc(100% - 64px);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|