|
@@ -22,16 +22,18 @@
|
|
|
<div
|
|
|
class="flex items-center text-base"
|
|
|
:class="`${
|
|
|
- state.step.index >= index
|
|
|
- ? 'font-bold text-[#2E3238]'
|
|
|
- : 'text-[#A7ADB9]'
|
|
|
- } ${item.finish ? '__hover' : 'cursor-no-drop'}`"
|
|
|
- @click="item.finish ? (state.step.index = index) : undefined"
|
|
|
+ item.finish ? 'font-bold text-[#2E3238]' : 'text-[#A7ADB9]'
|
|
|
+ } ${item.finish || state.step.index <= index ? '__hover' : 'cursor-no-drop'}`"
|
|
|
+ @click="
|
|
|
+ item.finish || state.step.index <= index
|
|
|
+ ? (state.step.index = index)
|
|
|
+ : undefined
|
|
|
+ "
|
|
|
>
|
|
|
<div
|
|
|
class="mr-2.5 flex size-8 items-center justify-center rounded-full border-1 border-[#A7ADB9]"
|
|
|
:class="
|
|
|
- state.step.index >= index
|
|
|
+ item.finish
|
|
|
? 'border-[var(--czr-main-color)] bg-[var(--czr-main-color)] text-[#ffffff]'
|
|
|
: 'border-[#A7ADB9]'
|
|
|
"
|
|
@@ -105,19 +107,23 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- <div class="flex size-full flex-col">-->
|
|
|
- <!-- <div>-->
|
|
|
- <!-- <el-button @click="getAnswer">获取答案</el-button>-->
|
|
|
- <!-- <template v-for="item in state.answers">-->
|
|
|
- <!-- <div>{{ item }}</div>-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div class="flex-1 overflow-y-auto">-->
|
|
|
- <!-- </div>-->
|
|
|
+ <!-- <template v-for="item in state.components">-->
|
|
|
+ <!-- <teleport :to="'#' + item.id">-->
|
|
|
+ <!-- <component :is="item.is" v-bind="item.props" />-->
|
|
|
+ <!-- </teleport>-->
|
|
|
+ <!-- </template>-->
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { nextTick, onMounted, provide, reactive, ref } from 'vue'
|
|
|
+import {
|
|
|
+ defineAsyncComponent,
|
|
|
+ markRaw,
|
|
|
+ nextTick,
|
|
|
+ onMounted,
|
|
|
+ provide,
|
|
|
+ reactive,
|
|
|
+ ref,
|
|
|
+} from 'vue'
|
|
|
import { mockQuestion, sxOnethingInfo } from './mock'
|
|
|
import treeNode from './tree-node.vue'
|
|
|
import toBackCom from '@/views/manage/components/to-back.vue'
|
|
@@ -125,6 +131,7 @@ import { useRoute, useRouter } from 'vue-router'
|
|
|
import { appDetail } from '@/api/modules/app'
|
|
|
import chat from '@/views/chat/index.vue'
|
|
|
import { isValue } from '@/utils/czr-util'
|
|
|
+import { v4 } from 'uuid'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
@@ -134,7 +141,7 @@ const state: any = reactive({
|
|
|
answers: [],
|
|
|
step: {
|
|
|
options: [
|
|
|
- { label: '用户须知', finish: false, time: 3 },
|
|
|
+ { label: '用户须知', finish: false, time: 0 },
|
|
|
{
|
|
|
label: '情形选择',
|
|
|
finish: false,
|
|
@@ -146,8 +153,9 @@ const state: any = reactive({
|
|
|
{ label: '材料上传', finish: false },
|
|
|
{ label: '结果领取', finish: false },
|
|
|
],
|
|
|
- index: 1,
|
|
|
+ index: 0,
|
|
|
},
|
|
|
+ // components: [],
|
|
|
})
|
|
|
const ref_chat = ref()
|
|
|
const ref_treeNode = ref()
|
|
@@ -156,7 +164,6 @@ const getAnswer = () => {
|
|
|
state.step.options[state.step.index].complete = state.step.options[
|
|
|
state.step.index
|
|
|
].answers.every((a) => a.every((b) => isValue(b)))
|
|
|
- console.log(state.step.options[state.step.index].answers)
|
|
|
}
|
|
|
const onStep = (index) => {
|
|
|
const current = state.step.options[index - 1]
|
|
@@ -167,12 +174,53 @@ const onStep = (index) => {
|
|
|
current.finish = true
|
|
|
ref_chat.value.mockAnswer({
|
|
|
text: '欢迎进入事项网办阶段!请选择情形',
|
|
|
- com: true,
|
|
|
})
|
|
|
}
|
|
|
state.step.index = index
|
|
|
}
|
|
|
break
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (current.complete) {
|
|
|
+ if (!current.finish) {
|
|
|
+ current.finish = true
|
|
|
+ const id = v4()
|
|
|
+ const ddd = () => {
|
|
|
+ console.log(123123)
|
|
|
+ }
|
|
|
+ ref_chat.value.mockAnswer({
|
|
|
+ text: '欢迎进入表单填写阶段!为了让您的体验更加顺畅,我已经贴心地为您预先填写了部分内容。接下来,请在左侧补充剩余的信息,感谢您的配合!',
|
|
|
+ teleport: id,
|
|
|
+ com: {
|
|
|
+ is: defineAsyncComponent(
|
|
|
+ () =>
|
|
|
+ import(
|
|
|
+ '@/views/business/doing-with-chat/chat/form-list.vue'
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ binds: {
|
|
|
+ data: ['asdasd', 'zxvzxvzxv'],
|
|
|
+ ddd,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ })
|
|
|
+ // state.components.push({
|
|
|
+ // id,
|
|
|
+ // is: defineAsyncComponent(
|
|
|
+ // () =>
|
|
|
+ // import(
|
|
|
+ // '@/views/business/doing-with-chat/chat/form-list.vue'
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // props: {
|
|
|
+ // data: ['asdasda', 'faszxcszczxc'],
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ state.step.index = index
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
}
|
|
|
}
|
|
|
onMounted(() => {
|