@jx3box/jx3box-common-ui 6.9.5 → 6.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-common-ui",
3
- "version": "6.9.5",
3
+ "version": "6.9.6",
4
4
  "description": "JX3BOX UI",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,18 +10,29 @@
10
10
  <slot></slot>
11
11
  </div>
12
12
  <div class="u-input">
13
- <el-input v-model.trim.lazy="search" placeholder="请输入用户 UID 或者昵称进行搜索" @keydown.enter.native="onSearch">
13
+ <el-input
14
+ v-model.trim.lazy="search"
15
+ placeholder="请输入用户 UID 或者昵称进行搜索"
16
+ @keydown.enter.native="onSearch"
17
+ >
14
18
  <i slot="prepend" class="el-icon-search"></i>
15
19
  </el-input>
16
- <el-button class="u-search-btn" type="primary" @click="onSearch">搜索</el-button>
20
+ <el-button class="u-search-btn" type="primary" @click="onSearch" :disabled="!search">搜索</el-button>
17
21
  </div>
18
22
  <div class="u-preview" v-loading="loading">
19
- <img class="u-avatar" :src="showAvatar(userdata.user_avatar)" />
20
- <span class="u-name">{{ userdata.display_name || "-" }}</span>
21
-
22
- <div class="u-empty" v-if="!status">
23
- <i class="el-icon-warning-outline"></i>未找到匹配项
24
- </div>
23
+ <template v-if="searched && status">
24
+ <a class="u-author" :href="'/author/' + userdata.ID" target="_blank">
25
+ <img class="u-avatar" :src="showAvatar(userdata.user_avatar)" />
26
+ <span class="u-name">{{ userdata.display_name || "-" }}</span>
27
+ </a>
28
+ </template>
29
+ <template v-else>
30
+ <img class="u-avatar" :src="showAvatar('')" />
31
+ <span class="u-name">-</span>
32
+ <div class="u-empty">
33
+ <i class="el-icon-warning-outline"></i>{{ searched ? "未找到匹配项" : "请输入搜索条件" }}
34
+ </div>
35
+ </template>
25
36
  </div>
26
37
  <div slot="footer" class="dialog-footer">
27
38
  <el-button @click="cancel">取 消</el-button>
@@ -40,7 +51,9 @@ export default {
40
51
  return {
41
52
  visible: false,
42
53
  search: "",
54
+ searched: false,
43
55
  userdata: {
56
+ ID: "",
44
57
  name: "",
45
58
  avatar: "",
46
59
  },
@@ -79,25 +92,29 @@ export default {
79
92
  this.userdata = {
80
93
  name: "",
81
94
  avatar: "",
82
- }
95
+ };
83
96
  this.status = true;
84
- return
97
+ return;
85
98
  }
86
99
  this.loading = true;
87
- getUserInfoByUidOrName({ search: this.search }).then((data) => {
88
- if (data) {
89
- this.status = true;
90
- this.userdata = data;
91
- } else {
92
- this.status = false;
93
- this.userdata = {
94
- name: "",
95
- avatar: "",
96
- };
97
- }
98
- }).finally(() => {
99
- this.loading = false;
100
- });
100
+ this.searched = false;
101
+ getUserInfoByUidOrName({ search: this.search })
102
+ .then((data) => {
103
+ if (data) {
104
+ this.status = true;
105
+ this.userdata = data;
106
+ } else {
107
+ this.status = false;
108
+ this.userdata = {
109
+ name: "",
110
+ avatar: "",
111
+ };
112
+ }
113
+ })
114
+ .finally(() => {
115
+ this.loading = false;
116
+ this.searched = true;
117
+ });
101
118
  },
102
119
  cancel() {
103
120
  this.visible = false;
@@ -107,7 +124,7 @@ export default {
107
124
  avatar: "",
108
125
  };
109
126
  this.status = true;
110
- }
127
+ },
111
128
  },
112
129
  mounted: function () {},
113
130
  components: {},
@@ -136,6 +153,19 @@ export default {
136
153
  .x;
137
154
  .db;
138
155
  }
156
+ .u-author {
157
+ .db;
158
+ max-width: 280px;
159
+ .auto(x);
160
+ &:hover {
161
+ .u-avatar {
162
+ border-color: #ff71b8;
163
+ }
164
+ .u-name {
165
+ color: #ff71b8;
166
+ }
167
+ }
168
+ }
139
169
  .u-tip {
140
170
  .fz(13px);
141
171
  }