|
@@ -1,145 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="browse-container">
|
|
|
- <div class="title-group" v-show="getList.length">
|
|
|
- <slot name="header-title">
|
|
|
- <span class="title">{{ title }}</span>
|
|
|
- </slot>
|
|
|
- <slot name="header-right">
|
|
|
- <div class="delete-icon" @click="$emit('delete')">
|
|
|
- <AppIcon name="dataDelete" />
|
|
|
- </div>
|
|
|
- </slot>
|
|
|
- </div>
|
|
|
- <ul class="browse-list">
|
|
|
- <li
|
|
|
- class="hover-css--slide jy-hairline--bottom"
|
|
|
- v-for="(item, index) in getList"
|
|
|
- :key="index"
|
|
|
- v-html="item.html"
|
|
|
- @click="$emit('click', item)"
|
|
|
- ></li>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import { AppIcon } from '@/ui'
|
|
|
-export default {
|
|
|
- name: 'history-browse-list',
|
|
|
- components: {
|
|
|
- [AppIcon.name]: AppIcon
|
|
|
- },
|
|
|
- /**
|
|
|
- * keys 需替换的关键词或关键词组
|
|
|
- * list 数据集合
|
|
|
- * item.html 替换后的字符
|
|
|
- * item.label 替换前字符
|
|
|
- */
|
|
|
- props: {
|
|
|
- keys: {
|
|
|
- required: true,
|
|
|
- type: [String, Array],
|
|
|
- default() {
|
|
|
- return ''
|
|
|
- }
|
|
|
- },
|
|
|
- searchType: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
- },
|
|
|
- list: {
|
|
|
- type: Array,
|
|
|
- default() {
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- title: {
|
|
|
- type: String,
|
|
|
- default: '历史浏览'
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- getList() {
|
|
|
- return this.list.map((v) => {
|
|
|
- console.log(v, 'v')
|
|
|
- if (this.searchType === 'company') {
|
|
|
- const stringItemTransform =
|
|
|
- typeof v === 'string' ? { html: v.split('_')[0] } : v
|
|
|
- return Object.assign(
|
|
|
- {
|
|
|
- html: v.label,
|
|
|
- eId: v.split('_')[1]
|
|
|
- },
|
|
|
- stringItemTransform
|
|
|
- )
|
|
|
- } else {
|
|
|
- const stringItemTransform = typeof v.name === 'string' ? { html: v.name } : v
|
|
|
- return Object.assign(
|
|
|
- {
|
|
|
- html: v.label
|
|
|
- },
|
|
|
- stringItemTransform
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-$association-list-color: #171826;
|
|
|
-
|
|
|
-$association-list-padding: 14px;
|
|
|
-$association-list-size: 14px;
|
|
|
-$association-list-line-height: 48px;
|
|
|
-
|
|
|
-.browse-container {
|
|
|
- .title-group {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- justify-content: space-between;
|
|
|
- font-weight: 400;
|
|
|
- font-size: 16px;
|
|
|
- padding: 16px;
|
|
|
- line-height: 24px;
|
|
|
- color: #171826;
|
|
|
- box-sizing: border-box;
|
|
|
- .delete-icon {
|
|
|
- .iconfont {
|
|
|
- font-size: 20px;
|
|
|
- color: #9b9ca3;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .browse-list {
|
|
|
- margin: 0;
|
|
|
- padding: 0;
|
|
|
- list-style: none;
|
|
|
- font-weight: 500;
|
|
|
- font-size: $association-list-size;
|
|
|
- line-height: $association-list-line-height;
|
|
|
- color: $association-list-color;
|
|
|
- li {
|
|
|
- position: relative;
|
|
|
- outline: none;
|
|
|
- border: none;
|
|
|
- z-index: 1;
|
|
|
- font-size: inherit;
|
|
|
- font-family: inherit;
|
|
|
- color: inherit;
|
|
|
- background: inherit;
|
|
|
- padding: 0 $association-list-padding;
|
|
|
- box-sizing: border-box;
|
|
|
- overflow: hidden;
|
|
|
- white-space: nowrap;
|
|
|
- text-overflow: ellipsis;
|
|
|
- float: unset;
|
|
|
- &::after {
|
|
|
- margin-left: $association-list-padding;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|