Initial commit (code only without large binaries)
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
{$layout}
|
||||
{$template "../menu"}
|
||||
|
||||
<div class="margin"></div>
|
||||
|
||||
<form class="ui form" method="get" action="/settings/ip-library/towns">
|
||||
<div class="ui fields inline">
|
||||
<div class="ui field">
|
||||
<combo-box name="countryId" :v-items="countries" :v-value="countryId" @change="changeCountry" placeholder="国家/地区"></combo-box>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<combo-box name="provinceId" :data-url="'/settings/ip-library/towns/provinceOptions?countryId=' + countryId" data-key="provinces" :v-value="provinceId" ref="provinceOptionsRef" @change="changeProvince" placeholder="省份/州"></combo-box>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<combo-box name="cityId" :data-url="'/settings/ip-library/towns/cityOptions?provinceId=' + provinceId" data-key="cities" :v-value="cityId" ref="cityOptionsRef" placeholder="城市/市"></combo-box>
|
||||
</div>
|
||||
<div class="ui field">
|
||||
<button class="ui button" type="submit">搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<not-found-box v-if="towns.length == 0">暂时还没有区/县。</not-found-box>
|
||||
|
||||
<p class="ui basic message" v-if="towns.length > 0">共 {{towns.length}} 个区/县。</p>
|
||||
|
||||
<table class="ui table selectable celled" v-if="towns.length > 0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 3em">ID</th>
|
||||
<th style="width: 12em">区/县名称</th>
|
||||
<th style="width: 12em">内置别名</th>
|
||||
<th style="width: 12em">自定义名称 <tip-icon content="修改在界面上显示的区/县名称"></tip-icon></th>
|
||||
<th style="width: 12em">自定义别名 <tip-icon content="可以在IP库中通过别名找到当前区/县,比如通过”朝阳区“、”朝阳“都能找到朝阳区"></tip-icon></th>
|
||||
<th class="one op">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr v-for="town in towns">
|
||||
<td>{{town.id}}</td>
|
||||
<td>{{town.name}}</td>
|
||||
<td>
|
||||
<div v-if="town.codes.length > 0">
|
||||
<span v-for="code in town.codes" class="ui label basic">{{code}}</span>
|
||||
</div>
|
||||
<span v-else class="disabled">无</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="town.customName.length > 0">{{town.customName}}</span>
|
||||
<span v-else class="disabled">暂无</span>
|
||||
</td>
|
||||
<td>
|
||||
<div v-if="town.customCodes.length > 0">
|
||||
<span v-for="code in town.customCodes" class="ui label basic">{{code}}</span>
|
||||
</div>
|
||||
<span v-else class="disabled">暂无</span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="" @click.prevent="updateTown(town.id)">修改</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -0,0 +1,33 @@
|
||||
Tea.context(function () {
|
||||
this.changeCountry = function (item) {
|
||||
let provinceOptionsBox = this.$refs.provinceOptionsRef
|
||||
|
||||
if (item != null) {
|
||||
provinceOptionsBox.setDataURL("/settings/ip-library/towns/provinceOptions?countryId=" + item.value)
|
||||
provinceOptionsBox.reloadData()
|
||||
}
|
||||
|
||||
provinceOptionsBox.clear()
|
||||
|
||||
this.changeProvince(null)
|
||||
}
|
||||
|
||||
this.changeProvince = function (item) {
|
||||
let cityOptionsBox = this.$refs.cityOptionsRef
|
||||
|
||||
if (item != null) {
|
||||
cityOptionsBox.setDataURL("/settings/ip-library/towns/cityOptions?provinceId=" + item.value)
|
||||
cityOptionsBox.reloadData()
|
||||
}
|
||||
|
||||
cityOptionsBox.clear()
|
||||
}
|
||||
|
||||
this.updateTown = function (townId) {
|
||||
teaweb.popup("/settings/ip-library/towns/updatePopup?townId=" + townId, {
|
||||
callback: function () {
|
||||
teaweb.successRefresh("保存成功")
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,35 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>定制区/县信息</h3>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<csrf-token></csrf-token>
|
||||
<input type="hidden" name="townId" :value="town.id"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">省份/州名称</td>
|
||||
<td>{{town.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>内置别名</td>
|
||||
<td>
|
||||
<div v-if="town.codes.length > 0">
|
||||
<span v-for="code in town.codes" class="ui label basic">{{code}}</span>
|
||||
</div>
|
||||
<span v-else class="disabled">无</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>自定义名称</td>
|
||||
<td>
|
||||
<input type="text" name="customName" maxlength="100" v-model="town.customName"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>自定义别名</td>
|
||||
<td>
|
||||
<values-box name="customCodes" :v-values="town.customCodes"></values-box>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
Reference in New Issue
Block a user