huangyinfeng
2024-09-09 00fe0e2047999d784d0fb353a426ffc6f35ac206
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<template>
  <a-drawer
    v-model:open="drawerOpen"
    :placement="placement"
    width="1200"
    :body-style="{ paddingBottom: '80px' }"
    :footer-style="{ textAlign: 'right' }"
    @after-open-change="afterOpenChange"
    @close="close"
  >
    <template #title>
      <pageHeadLeft :checked="true"></pageHeadLeft>
    </template>
    <template #extra>
      <div style="font-size: 16px">
        共<span class="m-1">222</span>封 <LeftOutlined style="padding: 0 20px" /><RightOutlined />
      </div>
    </template>
 
    <div class="flex-between">
        <div class="ct-left p-2" :class="isOpen ? 'isOpen' : 'onOpen'">
                    <div class="title" style="margin-bottom: 20px;">
            <div class="left">
              <span style="margin-right: 20px; font-size: 24px; font-weight: 700">标题</span>
              <span style="margin-right: 10px; font-size: 16px"><PushpinOutlined /></span>
            </div>
            <div class="right">
              <div class="tate"> 2024-06-08 15:03:09 </div>
              <div>
                <a-dropdown-button>
                  <span><LeftOutlined /></span>
                  <a-divider type="vertical" />
                  <span><DoubleLeftOutlined /></span>
                  <template #overlay>
                    <a-menu>
                      <a-menu-item key="1">
                        <UserOutlined />
                        1st menu item
                      </a-menu-item>
                      <a-menu-item key="2">
                        <UserOutlined />
                        2nd menu item
                      </a-menu-item>
                      <a-menu-item key="3">
                        <UserOutlined />
                        3rd item
                      </a-menu-item>
                    </a-menu>
                  </template>
                </a-dropdown-button>
              </div>
            </div>
          </div>
          <div class="user p-1">
            <div style="display: flex;align-items: center;">
              <a-avatar size="small" style="margin-right: 8px" src="#" /> xxx <span>{{`<dddddddddd@qq.com>`}}</span>
              <span style="margin: 0 10px;">发送</span>
              <a-popover placement="bottom">
                  <template #content>
                        <div
                          class="p-2"
                          style="
                            display: flex;
                            align-items: center;
                            border-bottom: 1px solid rgb(5 5 5 / 6%);
                          "
                        >
                          <a-avatar size="small" style="margin-right: 8px" src="#" />
                          <span style="color: #000; font-weight: 700">ssss</span>
                          <CopyOutlined />
                        </div>
                        <div class="display-flex p-2">
                          <a-button type="link" size="small">往来邮件</a-button></div
                        >
                </template>
                <a-avatar size="small" style="margin-right: 8px" src="#" /> xxx <span>{{`<dddddddddd@qq.com>`}}</span>
              </a-popover>
            </div>
            <div type="info" class="p-2"  style="margin-top: 10px;background-color: #e4f1ff;font-size: 14px;">
              <span>{{`<dddddddddd@qq.com>`}}</span><span>暂未查询到该客户的当地时间</span><span>2024-06-08 22:22</span>
              </div>
              <div class="ct">
                <Tinymce></Tinymce>
              </div>
              <a-input size="large" v-model:value="userName" placeholder="快速回复">
            <template #prefix>
              <LeftOutlined  style="color: #999;"/>
            </template>
          </a-input>
          </div>
        </div>
      <div v-show="isOpen" class="ct-right p-2">
        sssss
      </div>
    </div>
      
 
      <div @click="fuToggleContent" class="toggle-btn" :class="isOpen ? 'onIconOpen' : 'iconOpen'">
      <LeftOutlined v-if="!isOpen" />
      <RightOutlined v-else />
    </div>
  </a-drawer>
</template>
 
<script lang="ts" setup>;
  name: 'drawerDetail';
  import { ref, watch, defineProps, defineEmits, computed, reactive } from 'vue';
  import {
    LeftOutlined,
    RightOutlined,
    DoubleLeftOutlined,
  PushpinOutlined,
  CopyOutlined,
  UserOutlined
  } from '@ant-design/icons-vue';
import pageHeadLeft from '../pageHeadLeft.vue';
  import Tinymce from '@/components/Tinymce/src/index.vue';
 
  // 定义属性
  interface Props {
    modelValue: boolean;
    title?: string;
    placement?: 'left' | 'right' | 'top' | 'bottom';
    idName?: string;
    selectIds?: number[];
  }
  const props = defineProps<Props>();
 
  // 定义事件
  const emit = defineEmits(['update:modelValue', 'updateData']);
 
  // 内部状态
  const drawerOpen = ref(props.modelValue);
 
  // 监听属性变化
  watch(
    () => props.modelValue,
    (newValue) => {
      drawerOpen.value = newValue;
      if (props.selectIds && props.selectIds.length > 0) {
      } else {
      }
    },
  );
 
  // 更新外部属性
  watch(drawerOpen, (newValue) => {
    emit('update:modelValue', newValue);
  });
  import { getUserListApi } from '@/api/email/userList';
 
  // 方法
 
  import { useCollapseStore } from '@/store/modules/useCollapseStore';
  const collapseStore = useCollapseStore();
  const afterOpenChange = (bool: boolean) => {
    if (bool) {
      fnGetUserList({ page: 1, pageSize: 30 });
    }
 
      collapseStore.toggle(false);
    
 
  };
  const close = (e) => {
    drawerOpen.value = false;
  };
 const fnGetUserList = (params) => {
    //     getUserListApi(params).then((res) => {
    //   if (res && res.items && Array.isArray(res.items)) {
    //     dataSource.value = res.items;
    //     selectContactNum.value = res.total;
    //   } else {
    //     console.error('Invalid response format:', res);
    //   }
    // });
  }
  // 计算属性
  const title = computed(() => props.title || 'Basic Drawer');
  const placement = computed(() => props.placement || 'right');
  const idName = computed(() => props.idName || 'recipients');
 
  // // 显示抽屉的方法
  // const showDrawer = () => {
  //   drawerOpen.value = true;
  // };
 
  const fnSaveOpenChange = () => {
    // console.log('selectedRowKeys changed: ', state.selectedRowKeys);
    // drawerOpen.value = false;
    // emit('update:modelValue', false);
    // const data = {
    //   selectedRowKeys: state.selectedRowKeys,
    //;   idName: idName.value,
    // };
    // emit('updateData', data);
  };
 
  const userName = ref('');
  const isOpen = ref(false)
  function fuToggleContent (){
    isOpen.value = !isOpen.value
  }
</script>
 
<style scoped lang="less">
  /* 样式可以在这里定义 */
 
  .table-content {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #f0f0f0;
 
    .left {
      width: 50%;
      height: 100%;
      border-right: 1px solid #f0f0f0;
    }
 
    .right {
      width: 50%;
      height: 100%;
    }
  }
 
  ::v-deep(.ant-table) {
    min-height: 355px !important;
  }
 
  .title {
    display: flex;
    align-items: center;
    justify-content: space-between;
 
    & .left {
      display: flex;
      align-items: center;
      width: 50%;
    }
 
    & .right {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 25%;
 
      & .tate {
        color: #999;
        font-size: 14px;
      }
    }
  }
 
  .ct{
    // height: 66vh;height
    margin: 20px 0;
  }
 
  .flex-between{
    display: flex;
  }
 
.ct-left{
  padding-right: 20px;
      // border-right: 1px solid #f0f0f0;
}
 
.ct-right{
      border-left: 1px solid #f0f0f0;
 
}
 
  .toggle-btn {
    display: flex;
    position: absolute;
    z-index: 99;
    top: 50%;
    width: 20px; /* 原始宽度 */
    height: 54px;
    padding-left: 5px;
    transform: translateY(-50%);
    border: 1px solid #f0f0f0;
    border-right: none;
    border-radius:  10px 0 0 10px;
    background: #fafafa;
 
  }
 
  .onOpen {
    width: 100%;
  }
 
  .isOpen {
    width: 69%;
  }
 
  .iconOpen {
    right: 0%;
 
  }
 
  .onIconOpen {
    right: 32%;
 
  }
</style>