Sanakey
3 天以前 b5c1614fe473330ceca8b7cff0f1802e19bd5039
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<template>
  <BasicDrawer
    class="clues-detail-drawer"
    v-bind="$attrs"
    title="线索详情"
    @register="registerDrawer"
    :maskClosable="false"
    :keyboard="false"
    width="550px"
  >
    <template #title>
      <div class="text-right">
        <span>
          <Tooltip v-if="isFollow" title="已关注">
            <Icon
              icon="mingcute:heart-fill"
              class="mr-15px cursor-pointer c-red-5"
              @click="handleCancelFollow"
              :size="20"
            />
          </Tooltip>
          <Tooltip v-else title="未关注">
            <Icon
              icon="mingcute:heart-line"
              class="mr-15px cursor-pointer"
              @click="handleFollow"
              :size="20"
            />
          </Tooltip>
        </span>
        <Icon
          icon="ri:edit-line"
          class="mr-15px cursor-pointer"
          @click="handleEditCluesForm"
          :size="20"
        />
        <Icon
          icon="mdi:email-outline"
          class="mr-15px cursor-pointer"
          @click=""
          :size="20"
        />
        <a-dropdown :trigger="['click']">
          <Icon
            icon="gg:add-r"
            class="mr-15px cursor-pointer"
            @click=""
            :size="20"
          />
          <template #overlay>
            <a-menu>
              <a-menu-item key="0" @click="handleNewSchedule">
                <span >新建日程</span>
              </a-menu-item>
              <a-menu-item key="1" >
                <span>转化为客户</span>
              </a-menu-item>
              <!--              <a-menu-divider />-->
              <a-menu-item key="2">转化为已有客户</a-menu-item>
            </a-menu>
          </template>
        </a-dropdown>
        <a-dropdown :trigger="['click']">
          <Icon
            icon="ri:more-2-fill"
            class="cursor-pointer"
            @click=""
            :size="20"
          />
          <template #overlay>
            <a-menu>
              <a-menu-item key="0">
                <span >转移</span>
              </a-menu-item>
              <a-menu-item key="1" @click="handleReallocate">
                <span>重新分配</span>
              </a-menu-item>
<!--              <a-menu-divider />-->
              <a-menu-item key="2">合并线索</a-menu-item>
              <a-menu-item key="3">无效</a-menu-item>
              <a-popconfirm title="确定删除当前线索吗?" placement="top" @confirm="handleDeleteClues" ok-text="确定" cancel-text="取消">
                <a-menu-item key="4">删除</a-menu-item>
              </a-popconfirm>
 
            </a-menu>
          </template>
        </a-dropdown>
      </div>
 
    </template>
    <Content></Content>
<!--    <BasicForm @register="registerForm"></BasicForm>-->
  </BasicDrawer>
</template>
<script lang="ts" setup>
  // import {  useForm } from '@/components/Form';
  // import { formSchema } from './drawerData';
  import {BasicDrawer, useDrawerInner} from '@/components/Drawer';
  import Icon from "@/components/Icon/Icon.vue";
  import {Tooltip} from "ant-design-vue";
  import Content from "./drawer/index.vue";
  import EventBus from "@/utils/eventBus";
  import {reactive, defineEmits, ref} from 'vue';
 
  const emit = defineEmits(['success', 'register']);
 
  // const [registerForm, { setFieldsValue, }] = useForm({
  //   labelWidth: 90,
  //   baseColProps: { span: 24 },
  //   schemas: formSchema,
  //   showActionButtonGroup: false,
  // });
 
  // const [registerDrawer] = useDrawer();
  let currentClues = reactive({});
  const [registerDrawer] = useDrawerInner((data) => {
    Logger.log('Drawer 注册回调', data);
    currentClues = data.clue;
    // // 方式1
    // setFieldsValue({
    //   field2: data.data,
    //   field1: data.info,
    // });
  });
 
  function handleEditCluesForm() {
    Logger.log('点击了编辑表单', currentClues);
    EventBus.emit('openCluesFormDrawer', currentClues);
  }
  function handleReallocate() {
    Logger.log('点击了重新分配', currentClues);
    EventBus.emit('openReallocateModal', currentClues);
  }
  function handleDeleteClues() {
    Logger.log('点击了删除线索', currentClues);
  }
 
  function handleNewSchedule() {
    Logger.log('点击了新建日程', currentClues);
    EventBus.emit('openScheduleModal',{
      title:'新建日程12',
    });
  }
 
  const isFollow = ref(false);
  function handleFollow() {
    Logger.log('关注');
    isFollow.value = true;
  }
  function handleCancelFollow() {
    Logger.log('取消关注');
    isFollow.value = false;
  }
 
</script>