实现缓存策略部分管理功能

This commit is contained in:
刘祥超
2020-10-02 17:22:24 +08:00
parent 0febe3e5bd
commit bd51284504
53 changed files with 1163 additions and 211 deletions

View File

@@ -0,0 +1,47 @@
Vue.component("time-duration-box", {
props: ["v-name", "v-value", "v-count", "v-unit"],
data: function () {
let v = this.vValue
if (v == null) {
v = {
count: this.vCount,
unit: this.vUnit
}
}
if (typeof (v["count"]) != "number") {
v["count"] = -1
}
return {
"size": v,
countString: (v.count >= 0) ? v.count.toString() : ""
}
},
watch: {
"countString": function (newValue) {
let value = newValue.trim()
if (value.length == 0) {
this.size.count = -1
return
}
let count = parseInt(value)
if (!isNaN(count)) {
this.size.count = count
}
}
},
template: `<div class="ui fields inline">
<input type="hidden" :name="vName" :value="JSON.stringify(size)"/>
<div class="ui field">
<input type="text" v-model="countString" maxlength="11" size="11"/>
</div>
<div class="ui field">
<select class="ui dropdown" v-model="size.unit">
<option value="ms">毫秒</option>
<option value="second">秒</option>
<option value="minute">分钟</option>
<option value="hour">小时</option>
<option value="day">天</option>
</select>
</div>
</div>`
})