feature:支持繁体匹配,新增消息中心展示自动刮削不匹配的数据,

This commit is contained in:
charlesxie
2023-08-30 15:56:48 +08:00
parent 0f9c843db6
commit c947118e96
18 changed files with 27032 additions and 27 deletions

View File

@@ -36,5 +36,8 @@ export default {
},
translationLyc: function(params) {
return POST(reUrl + '/api/translation_lyc/', params)
},
getRecord: function(params) {
return GET(reUrl + '/api/record/', params)
}
}

View File

@@ -13,6 +13,7 @@
<bk-popover theme="light navigation-message" :arrow="false" offset="-150, 5" trigger="mouseenter"
:tippy-options="{ 'hideOnClick': false }">
<div class="header-mind">
<bk-badge class="" :theme="'danger'" :max="99" :val="msgList.length" :visible="msgList.length > 0">
<svg style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path
@@ -20,15 +21,16 @@
<path
d="M53.8,49.1L50,41.5V28c0-8.4-5.8-15.7-14-17.6V8c0-2.2-1.8-4-4-4s-4,1.8-4,4v2.4c-8.2,1.9-14,9.2-14,17.6v13.5l-3.8,7.6c-0.3,0.6-0.3,1.3,0.1,1.9c0.4,0.6,1,1,1.7,1h40c0.7,0,1.3-0.4,1.7-1C54,50.4,54.1,49.7,53.8,49.1z"></path>
</svg>
<span class="header-mind-mark"></span>
</bk-badge>
</div>
<template slot="content">
<div class="monitor-navigation-message">
<h5 class="message-title">消息中心</h5>
<ul class="message-list">
<li class="message-list-item" v-for="(item,index) in msgList" :key="index">
<li class="message-list-item" v-for="(item,index) in msgList" :key="index"
@click="handleRedirect(item)">
<span class="item-message">{{ item.message }}</span>
<span class="item-date">{{ item.date }}</span>
<span class="item-date">{{ item.created_at }}</span>
</li>
</ul>
</div>
@@ -43,7 +45,7 @@
<template slot="content">
<ul class="monitor-navigation-admin">
<li class="nav-item" @click="handleUserListClic2k">
后台管理
后台管理{{refresh}}
</li>
<li class="nav-item" @click="handleUserListClic3k">
使用手册
@@ -61,6 +63,7 @@
<script>
import {clearStore} from '../../../common/store.js'
import {mapGetters} from 'vuex'
export default {
data() {
@@ -68,8 +71,7 @@
logout_url: 'https://github.com/xhongc/music-tag-web',
pageTitle: '测试',
userData: {},
msgList: [
],
msgList: [],
user: {
list: [
'关于作者'
@@ -78,16 +80,28 @@
}
},
computed: {
...mapGetters(['getHasMsg']),
refresh() {
if (this.getHasMsg) {
this.$store.commit('setHasMsg', false)
this.fetchRecord()
}
},
headerTitle() {
return this.$route.meta.title
}
},
created() {
this.loginUser()
this.fetchRecord()
},
methods: {
changeTitle() {
},
handleRedirect(item) {
console.log(item.parent_path)
this.$store.commit('setFullPath', item.parent_path)
},
handleUserListClick(e) {
const btn = document.createElement('a')
btn.setAttribute('href', this.logout_url)
@@ -121,7 +135,14 @@
},
handleBack() {
this.$router.go(-1)
}
},
fetchRecord() {
this.$api.Task.getRecord({'state': 'failed', 'page_size': 20}).then((res) => {
if (res.result) {
this.msgList = res.data.items
}
})
},
}
}
</script>

View File

@@ -75,7 +75,9 @@
</div>
<div v-for="(item, index) in showFields" :key="'l1' + index">
<div class="edit-item" v-if="item === 'filename'">
<div class="label1 can-copy" v-bk-tooltips="'变量名:${filename}'" v-bk-copy="'${filename}'">文件名</div>
<div class="label1 can-copy" v-bk-tooltips="'变量名:${filename}'" v-bk-copy="'${filename}'">
文件名
</div>
<div style="width: 70%;">
<bk-input :clearable="true" v-model="musicInfo.filename"></bk-input>
</div>
@@ -93,7 +95,9 @@
</div>
</div>
<div class="edit-item can-copy" v-else-if="item === 'albumartist'">
<div class="label1" v-bk-tooltips="'变量名:${albumartist}'" v-bk-copy="'${albumartist}'">专辑艺术家</div>
<div class="label1" v-bk-tooltips="'变量名:${albumartist}'" v-bk-copy="'${albumartist}'">
专辑艺术家
</div>
<div style="width: 70%;">
<bk-input :clearable="true" v-model="musicInfo.albumartist"></bk-input>
</div>
@@ -263,14 +267,17 @@
</div>
<div v-for="(item, index) in showFields" :key="'l2' + index">
<div class="edit-item" v-if="item === 'filename'">
<div class="label1 can-copy" v-bk-tooltips="'变量名:${filename}'" v-bk-copy="'${filename}'">文件名</div>
<div class="label1 can-copy" v-bk-tooltips="'变量名:${filename}'" v-bk-copy="'${filename}'">
文件名
</div>
<div style="width: 70%;">
<bk-input :clearable="true" v-model="musicInfoManual.filename"
:placeholder="'例如:${title}-${album}'"></bk-input>
</div>
</div>
<div class="edit-item" v-else-if="item === 'artist'">
<div class="label1 can-copy" v-bk-tooltips="'变量名:${artist}'" v-bk-copy="'${artist}'">艺术家</div>
<div class="label1 can-copy" v-bk-tooltips="'变量名:${artist}'" v-bk-copy="'${artist}'">艺术家
</div>
<div style="width: 70%;">
<bk-input :clearable="true" v-model="musicInfoManual.artist"
:placeholder="'具体哪些变量,鼠标悬浮在标题上查看'"></bk-input>
@@ -283,7 +290,9 @@
</div>
</div>
<div class="edit-item" v-else-if="item === 'albumartist'">
<div class="label1 can-copy" v-bk-tooltips="'变量名:${albumartist}'" v-bk-copy="'${albumartist}'">专辑艺术家</div>
<div class="label1 can-copy" v-bk-tooltips="'变量名:${albumartist}'"
v-bk-copy="'${albumartist}'">专辑艺术家
</div>
<div style="width: 70%;">
<bk-input :clearable="true" v-model="musicInfoManual.albumartist"></bk-input>
</div>
@@ -566,6 +575,8 @@
</div>
</template>
<script>
import {mapGetters} from 'vuex'
export default {
data() {
return {
@@ -600,7 +611,6 @@
],
searchWord: '',
treeListOne: [],
filePath: '/app/media/',
fullPath: '',
fileName: '',
resource: localStorage.getItem('resource') ? localStorage.getItem('resource') : 'netease',
@@ -700,6 +710,27 @@
sortedField: localStorage.getItem('sortedField') ? JSON.parse(localStorage.getItem('sortedField')) : []
}
},
computed: {
...mapGetters(['geFullPath']),
filePath: {
get() {
if (this.geFullPath) {
console.log(this.geFullPath)
const fullPath = this.geFullPath
this.$store.commit('setFullPath', '')
this.$nextTick(() => {
this.handleSearchFile()
})
return fullPath
} else {
return '/app/media/'
}
},
set(value) {
this.$store.commit('setFullPath', value)
}
}
},
created() {
this.handleSearchFile()
},
@@ -729,7 +760,7 @@
},
backDir() {
this.filePath = this.backPath(this.filePath)
this.handleSearchFile()
// this.handleSearchFile()
},
backPath(path) {
// 使用正则表达式匹配最后一个斜杠及其后面的内容
@@ -751,7 +782,7 @@
nodeClickOne(node) {
if (node.icon === 'icon-folder') {
this.filePath = this.filePath + '/' + node.name
this.handleSearchFile()
// this.handleSearchFile()
} else {
if (node.children && node.children.length > 0) {
return
@@ -907,6 +938,7 @@
this.isLoading = false
if (res.result) {
this.$cwMessage('修改成功', 'success')
this.$store.commit('setHasMsg', true)
} else {
this.$cwMessage('修改失败', 'error')
}
@@ -957,6 +989,7 @@
console.log(res)
if (res.result) {
this.$cwMessage('创建成功', 'success')
this.$store.commit('setHasMsg', true)
}
})
return true
@@ -1219,6 +1252,7 @@ button.bk-button-text {
margin-bottom: 10px;
align-items: center;
}
.can-copy {
cursor: pointer;
}

View File

@@ -1,4 +1,6 @@
const getters = {
getUserRole: state => state.common.userRole // 权限
getUserRole: state => state.common.userRole,
geFullPath: state => state.common.fullPath,
getHasMsg: state => state.common.hasMsg
}
export default getters

View File

@@ -1,7 +1,9 @@
const common = {
state: {
defaultTableHeight: 800,
userRole: ''
userRole: '',
fullPath: '',
hasMsg: false
},
mutations: {
setDefaultTableHeight: (state, val) => {
@@ -9,6 +11,12 @@ const common = {
},
setUserRole: (state, val) => {
state.userRole = val
},
setFullPath: (state, val) => {
state.fullPath = val
},
setHasMsg: (state, val) => {
state.hasMsg = val
}
}
}