[网站域名]在列表中可以查看网站域名列表,并可以筛选

This commit is contained in:
GoEdgeLab
2020-12-07 12:11:48 +08:00
parent 8f1e5e4fc0
commit 56bafbce2b
6 changed files with 85 additions and 1 deletions

View File

@@ -40,6 +40,18 @@ Vue.component("link-popup", {
template: `<a href="" :title="title" @click.prevent="clickPrevent"><slot></slot></a>`
})
Vue.component("popup-icon", {
props: ["title", "href", "height"],
methods: {
clickPrevent: function () {
teaweb.popup(this.href, {
height: this.height
})
}
},
template: `<span><slot></slot>&nbsp;<a href="" :title="title" @click.prevent="clickPrevent"><i class="icon clone outline small"></i></a></span>`
})
// 小提示
Vue.component("tip-icon", {
props: ["content"],

View File

@@ -51,7 +51,7 @@
<span v-if="server.serverNames.length > 0">
<span v-if="server.serverNames[0].subNames == null || server.serverNames[0].subNames.length == 0">{{server.serverNames[0].name}}</span>
<span v-else>{{server.serverNames[0].subNames[0]}}</span>
<span v-if="server.countServerNames > 1">等{{server.countServerNames}}个域名</span>
<span v-if="server.countServerNames > 1">等{{server.countServerNames}}个域名 <popup-icon :href="'/servers/serverNamesPopup?serverId=' + server.id" height="20em"></popup-icon></span>
</span>
<span v-else class="disabled">-</span>
</td>

View File

@@ -0,0 +1,11 @@
{$layout "layout_popup"}
<h3>查看域名</h3>
<form class="ui form">
<input type="text" name="keyword" v-model="keyword" placeholder="输入关键词搜索" ref="focus" autocomplete="off"/>
</form>
<div style="margin-top: 1em">
<span v-for="serverName in serverNames" class="ui label basic" style="margin-bottom: 0.5em">{{serverName}}</span>
</div>

View File

@@ -0,0 +1,14 @@
Tea.context(function () {
let allServerNames = this.serverNames.$copy();
this.keyword = ""
this.$delay(function () {
let that = this
this.$watch("keyword", function (keyword) {
that.serverNames = allServerNames.$findAll(function (k, serverName) {
return teaweb.match(serverName, keyword)
})
})
})
})