influencer-requests.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121
  1. <template>
  2. <div>
  3. <div class="inner--headers">
  4. <h2>{{ pageId }}</h2>
  5. <div class="bread--crumbs--wrap">
  6. <span>홈</span>
  7. <span>벤더 대시보드</span>
  8. <span>{{ pageId }}</span>
  9. </div>
  10. </div>
  11. <!-- 통계 카드 -->
  12. <div class="stats--cards--wrap">
  13. <div class="stats--card">
  14. <div class="stats--icon pending">
  15. <v-icon>mdi-clock-outline</v-icon>
  16. </div>
  17. <div class="stats--content">
  18. <h3>{{ stats.pending || 0 }}</h3>
  19. <p>대기 중인 승인요청</p>
  20. </div>
  21. </div>
  22. <div class="stats--card">
  23. <div class="stats--icon approved">
  24. <v-icon>mdi-check-circle</v-icon>
  25. </div>
  26. <div class="stats--content">
  27. <h3>{{ stats.approved || 0 }}</h3>
  28. <p>승인 완료</p>
  29. </div>
  30. </div>
  31. <div class="stats--card">
  32. <div class="stats--icon rejected">
  33. <v-icon>mdi-close-circle</v-icon>
  34. </div>
  35. <div class="stats--content">
  36. <h3>{{ stats.rejected || 0 }}</h3>
  37. <p>거부</p>
  38. </div>
  39. </div>
  40. <div class="stats--card">
  41. <div class="stats--icon total">
  42. <v-icon>mdi-account-group</v-icon>
  43. </div>
  44. <div class="stats--content">
  45. <h3>{{ stats.total || 0 }}</h3>
  46. <p>총 요청 수</p>
  47. </div>
  48. </div>
  49. </div>
  50. <!-- 필터 및 검색 -->
  51. <div class="search--modules type2">
  52. <div class="search--inner">
  53. <div class="form--cont--filter">
  54. <v-select
  55. v-model="searchFilter.status"
  56. :items="statusOptions"
  57. variant="outlined"
  58. class="custom-select"
  59. label="상태"
  60. clearable
  61. >
  62. </v-select>
  63. </div>
  64. <div class="form--cont--filter">
  65. <v-select
  66. v-model="searchFilter.category"
  67. :items="categoryOptions"
  68. variant="outlined"
  69. class="custom-select"
  70. label="인플루언서 카테고리"
  71. clearable
  72. >
  73. </v-select>
  74. </div>
  75. <div class="form--cont--text">
  76. <v-text-field
  77. v-model="searchFilter.keyword"
  78. class="custom-input mini"
  79. style="width: 100%"
  80. placeholder="인플루언서명을 입력하세요"
  81. @keyup.enter="handleSearch"
  82. ></v-text-field>
  83. </div>
  84. </div>
  85. <v-btn
  86. class="custom-btn btn-blue mini sch--btn"
  87. @click="handleSearch"
  88. :loading="loading"
  89. >
  90. 검색
  91. </v-btn>
  92. </div>
  93. <!-- 인플루언서 승인 요청 목록 -->
  94. <div class="data--list--wrap">
  95. <div class="btn--actions--wrap">
  96. <div class="left--sections">
  97. <span class="result-count">
  98. 총 {{ pagination.totalCount || 0 }}개의 승인요청
  99. </span>
  100. </div>
  101. <div class="right--sections">
  102. <v-select
  103. v-model="sortOption"
  104. :items="sortOptions"
  105. variant="outlined"
  106. class="custom-select mini"
  107. @update:model-value="handleSort"
  108. >
  109. </v-select>
  110. </div>
  111. </div>
  112. <!-- 로딩 상태 -->
  113. <div v-if="loading" class="loading-wrap">
  114. <v-progress-circular indeterminate color="primary"></v-progress-circular>
  115. <p>승인요청을 불러오고 있습니다...</p>
  116. </div>
  117. <!-- 에러 상태 -->
  118. <div v-else-if="error" class="error-wrap">
  119. <v-alert type="error" dismissible @click:close="error = null">
  120. {{ error }}
  121. </v-alert>
  122. </div>
  123. <!-- 승인요청 리스트 -->
  124. <div v-else-if="requests.length > 0" class="requests--list--wrap">
  125. <div class="requests--grid">
  126. <div
  127. v-for="request in requests"
  128. :key="request.SEQ"
  129. class="request--card"
  130. :class="getRequestStatusClass(request.STATUS)"
  131. >
  132. <!-- 카드 헤더 -->
  133. <div class="request--card--header">
  134. <div class="influencer--info">
  135. <div class="influencer--avatar">
  136. <v-img
  137. v-if="request.influencerAvatar"
  138. :src="request.influencerAvatar"
  139. :alt="request.influencerNickname + ' 프로필'"
  140. width="50"
  141. height="50"
  142. ></v-img>
  143. <div v-else class="no-avatar">
  144. {{ request.influencerNickname?.charAt(0) || "U" }}
  145. </div>
  146. </div>
  147. <div class="influencer--details">
  148. <div class="influencer--header">
  149. <h4>{{ request.influencerNickname || request.influencerName }}</h4>
  150. <p class="influencer--category">
  151. {{ getCategoryText(request.influencerCategory) }}
  152. </p>
  153. </div>
  154. <div class="influencer--contact">
  155. <p v-if="request.influencerEmail" class="contact--item">
  156. <v-icon size="small">mdi-email</v-icon>
  157. {{ request.influencerEmail }}
  158. </p>
  159. <p v-if="request.influencerPhone" class="contact--item">
  160. <v-icon size="small">mdi-phone</v-icon>
  161. {{ request.influencerPhone }}
  162. </p>
  163. <p v-if="request.influencerRegion" class="contact--item">
  164. <v-icon size="small">mdi-map-marker</v-icon>
  165. {{ request.influencerRegion }}
  166. </p>
  167. </div>
  168. <div class="influencer--meta">
  169. <span v-if="request.followerCount" class="meta--item">
  170. <v-icon size="small">mdi-account-group</v-icon>
  171. {{ formatNumber(request.followerCount) }} 팔로워
  172. </span>
  173. <span v-if="request.avgViews" class="meta--item">
  174. <v-icon size="small">mdi-eye</v-icon>
  175. 평균 {{ formatNumber(request.avgViews) }} 조회
  176. </span>
  177. <span v-if="request.engagementRate" class="meta--item">
  178. <v-icon size="small">mdi-chart-line</v-icon>
  179. 참여율 {{ request.engagementRate }}%
  180. </span>
  181. </div>
  182. <div v-if="request.influencerDescription" class="influencer--description">
  183. <p>{{ request.influencerDescription }}</p>
  184. </div>
  185. <div v-if="request.influencerSnsChannels" class="influencer--sns">
  186. <div v-for="(channel, index) in parseSnsChannels(request.influencerSnsChannels)"
  187. :key="index"
  188. class="sns--item">
  189. <v-icon size="small">{{ getSnsIcon(channel.platform) }}</v-icon>
  190. {{ channel.handle }}
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. <div class="request--status">
  196. <v-chip :color="getStatusColor(request.STATUS)" size="small">
  197. {{ getStatusText(request.STATUS) }}
  198. </v-chip>
  199. <p class="request--date">{{ formatDate(request.REQUEST_DATE) }}</p>
  200. </div>
  201. </div>
  202. <!-- 카드 바디 -->
  203. <div class="request--card--body">
  204. <div v-if="request.REQUEST_MESSAGE" class="request--message">
  205. <h5>요청 메시지</h5>
  206. <p>"{{ request.REQUEST_MESSAGE }}"</p>
  207. </div>
  208. <div
  209. v-if="request.COMMISSION_RATE || request.SPECIAL_CONDITIONS"
  210. class="request--conditions"
  211. >
  212. <h5>희망 조건</h5>
  213. <div v-if="request.COMMISSION_RATE" class="condition--item">
  214. <span class="condition--label">희망 수수료율:</span>
  215. <span class="condition--value">{{ request.COMMISSION_RATE }}%</span>
  216. </div>
  217. <div v-if="request.SPECIAL_CONDITIONS" class="condition--item">
  218. <span class="condition--label">특별 조건:</span>
  219. <span class="condition--value">{{ request.SPECIAL_CONDITIONS }}</span>
  220. </div>
  221. </div>
  222. <div v-if="request.STATUS === 'PENDING'" class="expire--info">
  223. <v-icon size="16" color="warning">mdi-clock-alert</v-icon>
  224. <span>만료일: {{ formatDate(request.EXPIRED_DATE) }}</span>
  225. </div>
  226. </div>
  227. <!-- 카드 푸터 (액션 버튼) -->
  228. <div class="request--card--footer">
  229. <div class="card--actions">
  230. <v-btn
  231. class="custom-btn mini btn-outline"
  232. @click="viewInfluencerDetail(request.INFLUENCER_SEQ)"
  233. >
  234. 프로필 보기
  235. </v-btn>
  236. <div v-if="request.STATUS === 'PENDING'" class="approval--actions">
  237. <v-btn
  238. class="custom-btn mini btn-red"
  239. @click="handleReject(request)"
  240. :loading="processing"
  241. >
  242. 거부
  243. </v-btn>
  244. <v-btn
  245. class="custom-btn mini btn-blue"
  246. @click="handleApprove(request)"
  247. :loading="processing"
  248. >
  249. 승인
  250. </v-btn>
  251. </div>
  252. <v-btn
  253. v-else
  254. class="custom-btn mini btn-outline"
  255. @click="viewRequestHistory(request.SEQ)"
  256. >
  257. 이력보기
  258. </v-btn>
  259. </div>
  260. </div>
  261. </div>
  262. </div>
  263. <!-- 페이지네이션 -->
  264. <div class="pagination-wrap" v-if="pagination.totalPages > 1">
  265. <v-pagination
  266. v-model="currentPage"
  267. :length="pagination.totalPages"
  268. :total-visible="7"
  269. @update:model-value="handlePageChange"
  270. ></v-pagination>
  271. </div>
  272. </div>
  273. <!-- 검색 결과 없음 -->
  274. <div v-else class="no-data-wrap">
  275. <div class="no-data">
  276. <v-icon size="64" color="grey-lighten-1">mdi-account-search</v-icon>
  277. <h3>승인요청이 없습니다</h3>
  278. <p>아직 인플루언서로부터 승인요청이 없습니다</p>
  279. </div>
  280. </div>
  281. </div>
  282. <!-- 승인 확인 모달 -->
  283. <v-dialog v-model="approveModal.show" max-width="500px">
  284. <v-card>
  285. <v-card-title class="text-h5 text-success">
  286. <v-icon left>mdi-check-circle</v-icon>
  287. 승인 확인
  288. </v-card-title>
  289. <v-card-text>
  290. <div class="approve--content">
  291. <div class="influencer--summary">
  292. <div class="influencer--avatar--small">
  293. <v-img
  294. v-if="approveModal.request?.influencerAvatar"
  295. :src="approveModal.request.influencerAvatar"
  296. width="40"
  297. height="40"
  298. ></v-img>
  299. <div v-else class="no-avatar--small">
  300. {{ approveModal.request?.influencerNickname?.charAt(0) || "U" }}
  301. </div>
  302. </div>
  303. <div>
  304. <h4>{{ approveModal.request?.influencerNickname }}</h4>
  305. <p>{{ getCategoryText(approveModal.request?.influencerCategory) }}</p>
  306. </div>
  307. </div>
  308. <p>이 인플루언서의 승인요청을 승인하시겠습니까?</p>
  309. <v-textarea
  310. v-model="approveModal.approveMessage"
  311. label="승인 메시지 (선택사항)"
  312. placeholder="인플루언서에게 전달할 메시지를 입력해주세요..."
  313. rows="3"
  314. counter="300"
  315. maxlength="300"
  316. class="mt-4"
  317. ></v-textarea>
  318. </div>
  319. </v-card-text>
  320. <v-card-actions>
  321. <v-spacer></v-spacer>
  322. <v-btn color="grey" variant="text" @click="closeApproveModal">취소</v-btn>
  323. <v-btn color="success" @click="confirmApprove" :loading="processing">
  324. 승인하기
  325. </v-btn>
  326. </v-card-actions>
  327. </v-card>
  328. </v-dialog>
  329. <!-- 거부 확인 모달 -->
  330. <v-dialog v-model="rejectModal.show" max-width="500px">
  331. <v-card>
  332. <v-card-title class="text-h5 text-error">
  333. <v-icon left>mdi-close-circle</v-icon>
  334. 거부 확인
  335. </v-card-title>
  336. <v-card-text>
  337. <div class="reject--content">
  338. <div class="influencer--summary">
  339. <div class="influencer--avatar--small">
  340. <v-img
  341. v-if="rejectModal.request?.influencerAvatar"
  342. :src="rejectModal.request.influencerAvatar"
  343. width="40"
  344. height="40"
  345. ></v-img>
  346. <div v-else class="no-avatar--small">
  347. {{ rejectModal.request?.influencerNickname?.charAt(0) || "U" }}
  348. </div>
  349. </div>
  350. <div>
  351. <h4>{{ rejectModal.request?.influencerNickname }}</h4>
  352. <p>{{ getCategoryText(rejectModal.request?.influencerCategory) }}</p>
  353. </div>
  354. </div>
  355. <p>이 인플루언서의 승인요청을 거부하시겠습니까?</p>
  356. <v-textarea
  357. v-model="rejectModal.rejectReason"
  358. label="거부 사유"
  359. placeholder="거부 사유를 입력해주세요..."
  360. rows="4"
  361. counter="500"
  362. maxlength="500"
  363. class="mt-4"
  364. required
  365. ></v-textarea>
  366. </div>
  367. </v-card-text>
  368. <v-card-actions>
  369. <v-spacer></v-spacer>
  370. <v-btn color="grey" variant="text" @click="closeRejectModal">취소</v-btn>
  371. <v-btn color="error" @click="confirmReject" :loading="processing">
  372. 거부하기
  373. </v-btn>
  374. </v-card-actions>
  375. </v-card>
  376. </v-dialog>
  377. </div>
  378. </template>
  379. <script setup>
  380. import { ref, onMounted, computed } from "vue";
  381. import { useRouter } from "vue-router";
  382. /************************************************************************
  383. | 레이아웃
  384. ************************************************************************/
  385. definePageMeta({
  386. layout: "default",
  387. });
  388. /************************************************************************
  389. | 스토어 & 라우터
  390. ************************************************************************/
  391. const router = useRouter();
  392. const { $toast } = useNuxtApp();
  393. /************************************************************************
  394. | 반응형 데이터
  395. ************************************************************************/
  396. const pageId = ref("인플루언서 승인요청 관리");
  397. const loading = ref(false);
  398. const processing = ref(false);
  399. const error = ref(null);
  400. const currentPage = ref(1);
  401. // 검색 필터
  402. const searchFilter = ref({
  403. keyword: "",
  404. status: "",
  405. category: "",
  406. });
  407. // 정렬 옵션
  408. const sortOption = ref("latest");
  409. const sortOptions = ref([
  410. { title: "최신순", value: "latest" },
  411. { title: "오래된순", value: "oldest" },
  412. { title: "마감임박순", value: "expiring" },
  413. ]);
  414. // 상태 옵션
  415. const statusOptions = ref([
  416. { title: "전체", value: "" },
  417. { title: "대기중", value: "PENDING" },
  418. { title: "승인완료", value: "APPROVED" },
  419. { title: "거부됨", value: "REJECTED" },
  420. ]);
  421. // 카테고리 옵션
  422. const categoryOptions = ref([
  423. { title: "전체", value: "" },
  424. { title: "패션·뷰티", value: "FASHION_BEAUTY" },
  425. { title: "식품·건강", value: "FOOD_HEALTH" },
  426. { title: "라이프스타일", value: "LIFESTYLE" },
  427. { title: "테크·가전", value: "TECH_ELECTRONICS" },
  428. { title: "스포츠·레저", value: "SPORTS_LEISURE" },
  429. { title: "문화·엔터테인먼트", value: "CULTURE_ENTERTAINMENT" },
  430. ]);
  431. // 데이터
  432. const requests = ref([]);
  433. const stats = ref({
  434. pending: 0,
  435. approved: 0,
  436. rejected: 0,
  437. total: 0,
  438. });
  439. const pagination = ref({
  440. currentPage: 1,
  441. totalPages: 1,
  442. totalCount: 0,
  443. pageSize: 12,
  444. });
  445. // 승인 모달
  446. const approveModal = ref({
  447. show: false,
  448. request: null,
  449. approveMessage: "",
  450. });
  451. // 거부 모달
  452. const rejectModal = ref({
  453. show: false,
  454. request: null,
  455. rejectReason: "",
  456. });
  457. /************************************************************************
  458. | computed
  459. ************************************************************************/
  460. const currentUser = computed(() => {
  461. return JSON.parse(localStorage.getItem("authStore"))?.auth || {};
  462. });
  463. /************************************************************************
  464. | 메서드
  465. ************************************************************************/
  466. const handleSearch = async () => {
  467. currentPage.value = 1;
  468. await loadRequests();
  469. };
  470. const handlePageChange = async (page) => {
  471. currentPage.value = page;
  472. await loadRequests();
  473. };
  474. const handleSort = async () => {
  475. currentPage.value = 1;
  476. await loadRequests();
  477. };
  478. const loadRequests = async () => {
  479. try {
  480. loading.value = true;
  481. error.value = null;
  482. const params = {
  483. vendorSeq: currentUser.value.seq,
  484. keyword: searchFilter.value.keyword,
  485. status: searchFilter.value.status,
  486. category: searchFilter.value.category,
  487. sortBy: sortOption.value,
  488. page: currentPage.value,
  489. size: pagination.value.pageSize,
  490. };
  491. useAxios()
  492. .post("/api/vendor-influencer/requests", params)
  493. .then((res) => {
  494. if (res.data.success) {
  495. requests.value = res.data.data.items;
  496. pagination.value = res.data.data.pagination;
  497. stats.value = res.data.data.stats || stats.value;
  498. } else {
  499. error.value =
  500. res.data.message || "승인요청 목록을 불러오는 중 오류가 발생했습니다.";
  501. }
  502. })
  503. .catch((err) => {
  504. error.value = err.message || "승인요청 목록을 불러오는 중 오류가 발생했습니다.";
  505. })
  506. .finally(() => {
  507. loading.value = false;
  508. });
  509. } catch (err) {
  510. error.value = err.message || "승인요청 목록을 불러오는 중 오류가 발생했습니다.";
  511. loading.value = false;
  512. }
  513. };
  514. const handleApprove = (request) => {
  515. approveModal.value = {
  516. show: true,
  517. request: request,
  518. approveMessage: "",
  519. };
  520. };
  521. const closeApproveModal = () => {
  522. approveModal.value = {
  523. show: false,
  524. request: null,
  525. approveMessage: "",
  526. };
  527. };
  528. const confirmApprove = async () => {
  529. try {
  530. processing.value = true;
  531. const params = {
  532. mappingSeq: approveModal.value.request.SEQ,
  533. action: "APPROVE",
  534. processedBy: currentUser.value.seq,
  535. responseMessage: approveModal.value.approveMessage,
  536. };
  537. useAxios()
  538. .post("/api/vendor-influencer/process", params)
  539. .then((res) => {
  540. if (res.data.success) {
  541. $toast.success("승인요청이 승인되었습니다.");
  542. closeApproveModal();
  543. loadRequests();
  544. } else {
  545. $toast.error(res.data.message || "승인 처리 중 오류가 발생했습니다.");
  546. }
  547. })
  548. .catch((err) => {
  549. $toast.error(err.message || "승인 처리 중 오류가 발생했습니다.");
  550. })
  551. .finally(() => {
  552. processing.value = false;
  553. });
  554. } catch (err) {
  555. $toast.error(err.message || "승인 처리 중 오류가 발생했습니다.");
  556. processing.value = false;
  557. }
  558. };
  559. const handleReject = (request) => {
  560. rejectModal.value = {
  561. show: true,
  562. request: request,
  563. rejectReason: "",
  564. };
  565. };
  566. const closeRejectModal = () => {
  567. rejectModal.value = {
  568. show: false,
  569. request: null,
  570. rejectReason: "",
  571. };
  572. };
  573. const confirmReject = async () => {
  574. if (!rejectModal.value.rejectReason.trim()) {
  575. $toast.error("거부 사유를 입력해주세요.");
  576. return;
  577. }
  578. try {
  579. processing.value = true;
  580. const params = {
  581. mappingSeq: rejectModal.value.request.SEQ,
  582. action: "REJECT",
  583. processedBy: currentUser.value.seq,
  584. responseMessage: rejectModal.value.rejectReason,
  585. };
  586. useAxios()
  587. .post("/api/vendor-influencer/process", params)
  588. .then((res) => {
  589. if (res.data.success) {
  590. $toast.success("승인요청이 거부되었습니다.");
  591. closeRejectModal();
  592. loadRequests();
  593. } else {
  594. $toast.error(res.data.message || "거부 처리 중 오류가 발생했습니다.");
  595. }
  596. })
  597. .catch((err) => {
  598. $toast.error(err.message || "거부 처리 중 오류가 발생했습니다.");
  599. })
  600. .finally(() => {
  601. processing.value = false;
  602. });
  603. } catch (err) {
  604. $toast.error(err.message || "거부 처리 중 오류가 발생했습니다.");
  605. processing.value = false;
  606. }
  607. };
  608. const viewInfluencerDetail = (influencerSeq) => {
  609. router.push(`/view/influencer/${influencerSeq}`);
  610. };
  611. const viewRequestHistory = (requestSeq) => {
  612. router.push(`/view/vendor/request-history/${requestSeq}`);
  613. };
  614. // 유틸리티 함수들
  615. const getCategoryText = (category) => {
  616. const categoryMap = {
  617. FASHION_BEAUTY: "패션·뷰티",
  618. FOOD_HEALTH: "식품·건강",
  619. LIFESTYLE: "라이프스타일",
  620. TECH_ELECTRONICS: "테크·가전",
  621. SPORTS_LEISURE: "스포츠·레저",
  622. CULTURE_ENTERTAINMENT: "문화·엔터테인먼트",
  623. };
  624. return categoryMap[category] || category || "기타";
  625. };
  626. const getStatusText = (status) => {
  627. const statusMap = {
  628. PENDING: "대기중",
  629. APPROVED: "승인완료",
  630. REJECTED: "거절됨",
  631. EXPIRED: "만료됨",
  632. };
  633. return statusMap[status] || status || "알 수 없음";
  634. };
  635. const getStatusColor = (status) => {
  636. const colorMap = {
  637. PENDING: "orange",
  638. APPROVED: "success",
  639. REJECTED: "error",
  640. EXPIRED: "grey",
  641. };
  642. return colorMap[status] || "grey";
  643. };
  644. const getRequestStatusClass = (status) => {
  645. return `request-status-${status?.toLowerCase() || "unknown"}`;
  646. };
  647. const formatDate = (dateString) => {
  648. return new Date(dateString).toLocaleDateString("ko-KR");
  649. };
  650. const formatNumber = (num) => {
  651. if (!num) return "0";
  652. if (num >= 1000000) return (num / 1000000).toFixed(1) + "M";
  653. if (num >= 1000) return (num / 1000).toFixed(1) + "K";
  654. return num.toString();
  655. };
  656. const parseSnsChannels = (snsChannels) => {
  657. try {
  658. return JSON.parse(snsChannels);
  659. } catch (e) {
  660. return [];
  661. }
  662. };
  663. const getSnsIcon = (platform) => {
  664. const iconMap = {
  665. instagram: 'mdi-instagram',
  666. youtube: 'mdi-youtube',
  667. tiktok: 'mdi-music-note',
  668. blog: 'mdi-post',
  669. facebook: 'mdi-facebook',
  670. twitter: 'mdi-twitter'
  671. };
  672. return iconMap[platform.toLowerCase()] || 'mdi-link';
  673. };
  674. /************************************************************************
  675. | 라이프사이클
  676. ************************************************************************/
  677. onMounted(async () => {
  678. await loadRequests();
  679. });
  680. </script>
  681. <style scoped>
  682. .stats--cards--wrap {
  683. display: grid;
  684. grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  685. gap: 20px;
  686. margin-bottom: 30px;
  687. }
  688. .stats--card {
  689. background: white;
  690. border-radius: 12px;
  691. padding: 20px;
  692. display: flex;
  693. align-items: center;
  694. gap: 16px;
  695. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  696. }
  697. .stats--icon {
  698. width: 50px;
  699. height: 50px;
  700. border-radius: 10px;
  701. display: flex;
  702. align-items: center;
  703. justify-content: center;
  704. color: white;
  705. }
  706. .stats--icon.pending {
  707. background: #ff9800;
  708. }
  709. .stats--icon.approved {
  710. background: #4caf50;
  711. }
  712. .stats--icon.rejected {
  713. background: #f44336;
  714. }
  715. .stats--icon.total {
  716. background: #2196f3;
  717. }
  718. .stats--content h3 {
  719. margin: 0;
  720. font-size: 24px;
  721. font-weight: 700;
  722. color: #333;
  723. }
  724. .stats--content p {
  725. margin: 0;
  726. font-size: 14px;
  727. color: #666;
  728. }
  729. .requests--list--wrap {
  730. margin-top: 20px;
  731. }
  732. .requests--grid {
  733. display: grid;
  734. grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  735. gap: 20px;
  736. margin-bottom: 20px;
  737. }
  738. .request--card {
  739. background: white;
  740. border-radius: 12px;
  741. padding: 20px;
  742. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  743. transition: transform 0.2s, box-shadow 0.2s;
  744. border-left: 4px solid #e0e0e0;
  745. }
  746. .request--card:hover {
  747. transform: translateY(-2px);
  748. box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  749. }
  750. .request--card.request-status-pending {
  751. border-left-color: #ff9800;
  752. }
  753. .request--card.request-status-approved {
  754. border-left-color: #4caf50;
  755. }
  756. .request--card.request-status-rejected {
  757. border-left-color: #f44336;
  758. }
  759. .request--card--header {
  760. display: flex;
  761. justify-content: space-between;
  762. align-items: flex-start;
  763. margin-bottom: 16px;
  764. }
  765. .influencer--info {
  766. display: flex;
  767. gap: 12px;
  768. flex: 1;
  769. }
  770. .influencer--avatar {
  771. width: 50px;
  772. height: 50px;
  773. border-radius: 50%;
  774. overflow: hidden;
  775. flex-shrink: 0;
  776. display: flex;
  777. align-items: center;
  778. justify-content: center;
  779. background: #f5f5f5;
  780. }
  781. .no-avatar {
  782. font-size: 20px;
  783. font-weight: bold;
  784. color: #666;
  785. }
  786. .influencer--details h4 {
  787. margin: 0 0 4px 0;
  788. font-size: 16px;
  789. font-weight: 600;
  790. }
  791. .influencer--category {
  792. color: #666;
  793. font-size: 14px;
  794. margin: 0 0 8px 0;
  795. }
  796. .influencer--meta {
  797. display: flex;
  798. flex-direction: column;
  799. gap: 2px;
  800. }
  801. .influencer--meta span {
  802. font-size: 12px;
  803. color: #888;
  804. }
  805. .request--status {
  806. text-align: right;
  807. flex-shrink: 0;
  808. }
  809. .request--date {
  810. margin: 8px 0 0;
  811. font-size: 12px;
  812. color: #999;
  813. }
  814. .request--card--body {
  815. margin-bottom: 16px;
  816. }
  817. .request--message,
  818. .request--conditions {
  819. margin-bottom: 12px;
  820. }
  821. .request--message h5,
  822. .request--conditions h5 {
  823. margin: 0 0 8px 0;
  824. font-size: 14px;
  825. font-weight: 600;
  826. color: #333;
  827. }
  828. .request--message p {
  829. margin: 0;
  830. font-size: 14px;
  831. color: #666;
  832. font-style: italic;
  833. }
  834. .condition--item {
  835. display: flex;
  836. gap: 8px;
  837. margin-bottom: 4px;
  838. }
  839. .condition--label {
  840. font-size: 13px;
  841. color: #666;
  842. min-width: 80px;
  843. }
  844. .condition--value {
  845. font-size: 13px;
  846. color: #333;
  847. font-weight: 500;
  848. }
  849. .expire--info {
  850. display: flex;
  851. align-items: center;
  852. gap: 6px;
  853. font-size: 12px;
  854. color: #ff9800;
  855. background: #fff8e1;
  856. padding: 6px 10px;
  857. border-radius: 6px;
  858. }
  859. .request--card--footer {
  860. border-top: 1px solid #f0f0f0;
  861. padding-top: 16px;
  862. }
  863. .card--actions {
  864. display: flex;
  865. justify-content: space-between;
  866. align-items: center;
  867. }
  868. .approval--actions {
  869. display: flex;
  870. gap: 8px;
  871. }
  872. .loading-wrap,
  873. .error-wrap,
  874. .no-data-wrap {
  875. display: flex;
  876. flex-direction: column;
  877. align-items: center;
  878. justify-content: center;
  879. padding: 60px 20px;
  880. }
  881. .no-data {
  882. text-align: center;
  883. }
  884. .no-data h3 {
  885. margin: 16px 0 8px;
  886. color: #666;
  887. }
  888. .no-data p {
  889. color: #999;
  890. }
  891. .pagination-wrap {
  892. display: flex;
  893. justify-content: center;
  894. margin-top: 20px;
  895. }
  896. .approve--content,
  897. .reject--content {
  898. padding: 8px 0;
  899. }
  900. .influencer--summary {
  901. display: flex;
  902. align-items: center;
  903. gap: 12px;
  904. padding: 12px;
  905. background: #f8f9fa;
  906. border-radius: 8px;
  907. margin-bottom: 16px;
  908. }
  909. .influencer--avatar--small {
  910. width: 40px;
  911. height: 40px;
  912. border-radius: 50%;
  913. overflow: hidden;
  914. flex-shrink: 0;
  915. display: flex;
  916. align-items: center;
  917. justify-content: center;
  918. background: #f5f5f5;
  919. }
  920. .no-avatar--small {
  921. font-size: 16px;
  922. font-weight: bold;
  923. color: #666;
  924. }
  925. .result-count {
  926. font-size: 14px;
  927. color: #666;
  928. font-weight: 500;
  929. }
  930. .influencer--contact {
  931. margin: 4px 0;
  932. }
  933. .contact--item {
  934. display: flex;
  935. align-items: center;
  936. gap: 6px;
  937. font-size: 13px;
  938. color: #666;
  939. margin: 2px 0;
  940. }
  941. .contact--item .v-icon {
  942. color: #999;
  943. }
  944. .influencer--header {
  945. margin-bottom: 8px;
  946. }
  947. .influencer--contact {
  948. margin: 8px 0;
  949. padding: 8px;
  950. background: #f8f9fa;
  951. border-radius: 6px;
  952. }
  953. .contact--item {
  954. display: flex;
  955. align-items: center;
  956. gap: 6px;
  957. font-size: 13px;
  958. color: #666;
  959. margin: 4px 0;
  960. }
  961. .influencer--meta {
  962. display: flex;
  963. flex-wrap: wrap;
  964. gap: 12px;
  965. margin: 8px 0;
  966. }
  967. .meta--item {
  968. display: flex;
  969. align-items: center;
  970. gap: 4px;
  971. font-size: 13px;
  972. color: #555;
  973. background: #f0f0f0;
  974. padding: 4px 8px;
  975. border-radius: 4px;
  976. }
  977. .influencer--description {
  978. margin: 8px 0;
  979. font-size: 13px;
  980. color: #666;
  981. line-height: 1.4;
  982. }
  983. .influencer--sns {
  984. display: flex;
  985. flex-wrap: wrap;
  986. gap: 8px;
  987. margin-top: 8px;
  988. }
  989. .sns--item {
  990. display: flex;
  991. align-items: center;
  992. gap: 4px;
  993. font-size: 12px;
  994. color: #555;
  995. background: #eef2ff;
  996. padding: 4px 8px;
  997. border-radius: 4px;
  998. }
  999. </style>