diff options
| author | unknown <[email protected]> | 2023-06-05 20:04:56 +0800 |
|---|---|---|
| committer | unknown <[email protected]> | 2023-06-05 20:04:56 +0800 |
| commit | 6766bd7c6f5d59dc5a8024c192f7a511653feca3 (patch) | |
| tree | 4f95df1832f326980370cacc80ef33d184bf4ede /frontend/src/components/Settings.vue | |
Diffstat (limited to 'frontend/src/components/Settings.vue')
| -rw-r--r-- | frontend/src/components/Settings.vue | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/frontend/src/components/Settings.vue b/frontend/src/components/Settings.vue new file mode 100644 index 0000000..2848d62 --- /dev/null +++ b/frontend/src/components/Settings.vue @@ -0,0 +1,142 @@ +<template> + <div> + <el-card class="box-card"> + <div slot="header" class="clearfix"> + <span>敏感词</span> + </div> + <el-tag + :key="word" + v-for="word in sensitiveWords" + type="danger" + closable + :disable-transitions="false" + @close="handleClose(word)"> + {{word}} +</el-tag> +<el-input + class="input-new-tag" + v-if="inputVisible" + v-model="inputValue" + ref="saveTagInput" + size="small" + @keyup.enter.native="handleInputConfirm" + @blur="handleInputConfirm" +> +</el-input> +<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 新增</el-button> +</el-card> +<el-card class="box-card"> + <div slot="header" class="clearfix"> + <span>重点域名列表</span> + </div> + <el-tag + :key="tag" + v-for="tag in keyService" + type="danger" + closable + :disable-transitions="false" + @close="handleClose(tag)"> + {{tag}} +</el-tag> +<el-input + class="input-new-tag" + v-if="inputVisible" + v-model="inputValue" + ref="saveTagInput" + size="small" + @keyup.enter.native="handleInputConfirm" + @blur="handleInputConfirm" +> +</el-input> +<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 新增</el-button> +</el-card> +<el-card class="box-card"> + <div slot="header" class="clearfix"> + <span>重点账号列表</span> + </div> + <el-tag + :key="tag" + v-for="tag in keyAccounts" + type="danger" + closable + :disable-transitions="false" + @close="handleClose(tag)"> + {{tag}} +</el-tag> +<el-input + class="input-new-tag" + v-if="inputVisible" + v-model="inputValue" + ref="saveTagInput" + size="small" + @keyup.enter.native="handleInputConfirm" + @blur="handleInputConfirm" +> +</el-input> +<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 新增</el-button> +</el-card> + </div> +</template> +<script> +export default { + data(){ + return { + sensitiveWords: ['机密', '涉密'], + keyService:['iie.ac.cn','mails.ucas.ac.cn','digitalgd.com.cn'], + inputVisible: false, + inputValue: '' + } + }, + methods:{ + handleClose(tag) { + this.sensitiveWords.splice(this.sensitiveWords.indexOf(tag), 1); + }, + + showInput() { + this.inputVisible = true; + this.$nextTick(_ => { + this.$refs.saveTagInput.$refs.input.focus(); + }); + }, + + handleInputConfirm() { + let inputValue = this.inputValue; + if (inputValue) { + this.sensitiveWords.push(inputValue); + } + this.inputVisible = false; + this.inputValue = ''; + } + }, + mounted(){ + this.getLog() + this.getRatio() + } +} +</script> +<style scoped> + .clearfix:before, + .clearfix:after { + display: table; + content: ""; + } + .clearfix:after { + clear: both + } + .el-tag + .el-tag { + margin-left: 10px; + } + .button-new-tag { + margin-left: 10px; + height: 32px; + line-height: 30px; + padding-top: 0; + padding-bottom: 0; + } + .input-new-tag { + width: 90px; + margin-left: 10px; + vertical-align: bottom; + } +</style> |
