chore:细节问题调整

This commit is contained in:
CN32479-詹红柱 2022-03-14 17:30:56 +08:00
parent c85d39467f
commit 3b0021a275
4 changed files with 33 additions and 29 deletions

View File

@ -14,9 +14,8 @@
<img src="./assets/svg/add.svg" class="tool-icon" @click="add({},'add')" /> <img src="./assets/svg/add.svg" class="tool-icon" @click="add({},'add')" />
<a title="我的博客" href="https://zhanhongzhu.top" target="_blank"><img src="./assets/svg/blog.svg" class="tool-icon" /></a> <a title="我的博客" href="https://zhanhongzhu.top" target="_blank"><img src="./assets/svg/blog.svg" class="tool-icon" /></a>
<a title="在线翻译" href="https://translate.google.cn" target="_blank"><img src="./assets/svg/translate.svg" class="tool-icon" /></a> <a title="在线翻译" href="https://translate.google.cn" target="_blank"><img src="./assets/svg/translate.svg" class="tool-icon" /></a>
<span class="login-s" @click="loginClick"><img src="./assets/svg/user.svg" class="tool-icon" title="已登录"/><span class="login-status" :title="userInfo.username">{{userInfo.username.slice(0, 5)}}</span></span> <span class="login-s" @click="loginClick"><img src="./assets/svg/user.svg" class="tool-icon" title="已登录" /><span class="login-status" :title="userInfo.username">{{userInfo.username.slice(0, 5)}}</span></span>
</div> </div>
<!-- userInfo.objectId?LoginOut:handleUserLogin --> <!-- userInfo.objectId?LoginOut:handleUserLogin -->
</div> </div>
<!-- 侧边导航栏 --> <!-- 侧边导航栏 -->
@ -138,22 +137,25 @@ export default {
fn() fn()
} else { } else {
// //
getObject('BOOKMARK').then((res) => { getObject('BOOKMARK')
if (res.length > 0) { .then((res) => {
rowData = JSON.parse(res[0].attributes.formDatas) if (res.length > 0) {
} else { rowData = JSON.parse(res[0].attributes.formDatas)
} else {
localStorage.setItem('BOOKMARK', JSON.stringify(myData))
rowData = JSON.parse(JSON.stringify(myData))
}
})
.catch(() => {
localStorage.setItem('BOOKMARK', JSON.stringify(myData)) localStorage.setItem('BOOKMARK', JSON.stringify(myData))
rowData = JSON.parse(JSON.stringify(myData)) rowData = JSON.parse(JSON.stringify(myData))
} })
}).catch(() => { .finally(() => {
localStorage.setItem('BOOKMARK', JSON.stringify(myData)) fn()
rowData = JSON.parse(JSON.stringify(myData)) data.data = rowData
}).finally(() => { data.bookMark = rowData[0].children
fn() data.allData = flatten(rowData)
data.data = rowData })
data.bookMark = rowData[0].children
data.allData = flatten(rowData)
})
} }
} }

View File

@ -46,21 +46,21 @@ import { ElMessage } from 'element-plus'
export default { export default {
model: { model: {
value: 'isDetailVisible', value: 'isDetailVisible',
events: 'closeViews' events: 'closeViews',
}, },
props: { props: {
isDetailVisible: { isDetailVisible: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
selectType: { selectType: {
type: Number, type: Number,
default: 0 default: 0,
}, },
detail: { detail: {
type: Object, type: Object,
default: () => {} default: () => {},
} },
}, },
setup(props, context) { setup(props, context) {
const isBOOKMARK = JSON.parse(localStorage.getItem('BOOKMARK')) const isBOOKMARK = JSON.parse(localStorage.getItem('BOOKMARK'))
@ -71,13 +71,13 @@ export default {
type: '', type: '',
desc: '', desc: '',
url: '', url: '',
logo: '' logo: '',
} },
}) })
// :rules // :rules
const rules = { const rules = {
title: [{ required: true, message: '请输入书签名称', trigger: 'blur' }], title: [{ required: true, message: '请输入书签名称', trigger: 'blur' }],
type: [{ required: true, message: '请选择书签类别', trigger: 'change' }] type: [{ required: true, message: '请选择书签类别', trigger: 'change' }],
} }
const refruleForm = ref(null) const refruleForm = ref(null)
// //
@ -101,7 +101,9 @@ export default {
// //
// //
if (myDetail.type === v.type) { if (myDetail.type === v.type) {
const pindex = v.children.findIndex(p => p.title === myDetail.title) const pindex = v.children.findIndex(
(p) => p.title === myDetail.title
)
v.children.splice(pindex, 1) v.children.splice(pindex, 1)
} }
// //
@ -148,11 +150,10 @@ export default {
submitForm, submitForm,
refruleForm, refruleForm,
rules, rules,
BOOKMARK BOOKMARK,
} }
}, },
methods: { methods: {},
}
} }
</script> </script>

View File

@ -12,7 +12,6 @@
<el-input v-model="ruleForm.password" show-password placeholder="请输入密码"></el-input> <el-input v-model="ruleForm.password" show-password placeholder="请输入密码"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>

View File

@ -6,7 +6,9 @@ import 'element-plus/lib/theme-chalk/index.css'
// 接入了Leancloud // 接入了Leancloud
import AV from 'leancloud-storage' import AV from 'leancloud-storage'
// 请注册leancloud,新建应用,然后替换这个
AV.init({ appId: '\x42\x77\x4c\x72\x43\x67\x64\x56\x79\x4c\x73\x35\x32\x6d\x4a\x4f\x31\x48\x63\x72\x58\x61\x6b\x49\x2d\x67\x7a\x47\x7a\x6f\x48\x73\x7a', appKey: '\x32\x35\x67\x4e\x77\x7a\x77\x34\x64\x56\x37\x49\x41\x68\x37\x69\x30\x49\x7a\x44\x6e\x59\x76\x56', serverURL: '\x68\x74\x74\x70\x73\x3a\x2f\x2f\x62\x77\x6c\x72\x63\x67\x64\x76\x2e\x6c\x63\x2d\x63\x6e\x2d\x6e\x31\x2d\x73\x68\x61\x72\x65\x64\x2e\x63\x6f\x6d' }) AV.init({ appId: '\x42\x77\x4c\x72\x43\x67\x64\x56\x79\x4c\x73\x35\x32\x6d\x4a\x4f\x31\x48\x63\x72\x58\x61\x6b\x49\x2d\x67\x7a\x47\x7a\x6f\x48\x73\x7a', appKey: '\x32\x35\x67\x4e\x77\x7a\x77\x34\x64\x56\x37\x49\x41\x68\x37\x69\x30\x49\x7a\x44\x6e\x59\x76\x56', serverURL: '\x68\x74\x74\x70\x73\x3a\x2f\x2f\x62\x77\x6c\x72\x63\x67\x64\x76\x2e\x6c\x63\x2d\x63\x6e\x2d\x6e\x31\x2d\x73\x68\x61\x72\x65\x64\x2e\x63\x6f\x6d' })
const app = createApp(App) const app = createApp(App)
app.use(ElementPlus) app.use(ElementPlus)
app.mount('#app') app.mount('#app')