parent
af5c28a3aa
commit
8619804a87
@ -1,13 +1,13 @@ |
||||
<template> |
||||
<el-form ref="form" :model="form" label-width="80px"> |
||||
<el-form-item label="帐号"> |
||||
<el-input v-model="form.user" placeholder="请输入帐号"></el-input> |
||||
<el-form-item :label="$t('account.form.user')"> |
||||
<el-input v-model="form.user" :placeholder="$t('account.form.input_user',{user:$t('account.form.user')})"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="密码"> |
||||
<el-input v-model="form.password" type="password" placeholder="请输入密码"></el-input> |
||||
<el-form-item :label="$t('account.form.password')"> |
||||
<el-input v-model="form.password" type="password" :placeholder="$t('account.form.input_password',{password:$t('account.form.password')})"></el-input> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="onLogin(form.user,form.password)">登录</el-button> |
||||
<el-button type="primary" @click="onLogin(form.user,form.password)">{{$t('account.login')}}</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</template> |
@ -0,0 +1,35 @@ |
||||
<template> |
||||
<el-form ref="form" :model="form" label-width="80px"> |
||||
<el-form-item :label="$t('account.form.user')"> |
||||
<el-input v-model="form.user" :placeholder="$t('account.form.input_user',{user:$t('account.form.user')})"></el-input> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('account.form.password')"> |
||||
<el-input v-model="form.password" type="password" :placeholder="$t('account.form.input_password',{password:$t('account.form.password')})"></el-input> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('account.form.confirmPwd')"> |
||||
<el-input v-model="form.confirmPwd" type="password" :placeholder="$t('account.form.input_password',{password:$t('account.form.password')})"></el-input> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="onRegister(form.user,form.password)">{{$t('account.register')}}</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</template> |
||||
|
||||
<script lang="ts"> |
||||
|
||||
export default { |
||||
name: 'register', |
||||
data(){ |
||||
return { |
||||
form:{ |
||||
user:'', |
||||
password:'', |
||||
confirmPwd:'' |
||||
} |
||||
} |
||||
}, |
||||
props:{ |
||||
onRegister:Function |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,9 @@ |
||||
<template> |
||||
<h1>我的收藏</h1> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'collect' |
||||
} |
||||
</script> |
@ -0,0 +1,9 @@ |
||||
<template> |
||||
<h1>我的上传</h1> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'myupload' |
||||
} |
||||
</script> |
@ -0,0 +1,9 @@ |
||||
<template> |
||||
<h1>帐号安全</h1> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'security' |
||||
} |
||||
</script> |
@ -0,0 +1,45 @@ |
||||
<template> |
||||
<el-row type="flex" justify="end"> |
||||
<el-col> |
||||
<span class="title">{{ $t('app_name') }}</span> |
||||
</el-col> |
||||
<el-col> |
||||
<el-dropdown class="ml4"> |
||||
<span class="el-dropdown-link"> |
||||
{{$t('choose_lang')}} |
||||
<i class="el-icon-arrow-down el-icon--right"></i> |
||||
</span> |
||||
<el-dropdown-menu slot="dropdown"> |
||||
<el-dropdown-item v-for="item in ['zhCN', 'en']" :key="item"> |
||||
<nuxt-link v-if="$i18n.locale !== item" :to="switchLocalePath(item)"> |
||||
{{$t(item)}} |
||||
</nuxt-link> |
||||
</el-dropdown-item> |
||||
</el-dropdown-menu> |
||||
</el-dropdown> |
||||
</el-col> |
||||
<el-col v-if="$cookies.isKey(GLOBAL.user_key)"> |
||||
<el-button @click="logout">{{$t('logout')}}</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
</template> |
||||
|
||||
<script lang="ts"> |
||||
import Vue from 'vue' |
||||
|
||||
export default Vue.extend({ |
||||
name: 'lang', |
||||
methods:{ |
||||
logout:function() { |
||||
this.$cookies.remove(this.GLOBAL.user_key) |
||||
this.$router.push(this.localePath('/account')) |
||||
} |
||||
} |
||||
}) |
||||
</script> |
||||
<style> |
||||
.title { |
||||
font-size: 25px; |
||||
font-weight: bold; |
||||
} |
||||
</style> |
@ -1,35 +0,0 @@ |
||||
<template> |
||||
<el-form ref="form" :model="form" label-width="80px"> |
||||
<el-form-item :label="$t('user')"> |
||||
<el-input v-model="form.user" placeholder="请输入帐号"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="密码"> |
||||
<el-input v-model="form.password" type="password" placeholder="请输入密码"></el-input> |
||||
</el-form-item> |
||||
<el-form-item label="确认密码"> |
||||
<el-input v-model="form.confirmPwd" type="password" placeholder="请确认密码"></el-input> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
<el-button type="primary" @click="onRegister(form.user,form.password)">注册</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</template> |
||||
|
||||
<script lang="ts"> |
||||
|
||||
export default { |
||||
name: 'register', |
||||
data(){ |
||||
return { |
||||
form:{ |
||||
user:'', |
||||
password:'', |
||||
confirmPwd:'' |
||||
} |
||||
} |
||||
}, |
||||
props:{ |
||||
onRegister:Function |
||||
} |
||||
} |
||||
</script> |
@ -1,10 +1,30 @@ |
||||
<template> |
||||
<h1>个人中心</h1> |
||||
<el-tabs v-model="activeName" type="card"> |
||||
<el-tab-pane :label="$t('center.security.name')" name="Security"> |
||||
<security/> |
||||
</el-tab-pane> |
||||
<el-tab-pane :label="$t('center.collect.name')" name="Collect"> |
||||
<collect/> |
||||
</el-tab-pane> |
||||
<el-tab-pane :label="$t('center.myupload.name')" name="Upload"> |
||||
<myupload/> |
||||
</el-tab-pane> |
||||
</el-tabs> |
||||
</template> |
||||
|
||||
<script lang="ts"> |
||||
import Security from '~/components/center/security.vue' |
||||
import Collect from '~/components/center/collect.vue' |
||||
import Myupload from '~/components/center/myupload.vue' |
||||
|
||||
export default { |
||||
name: 'center' |
||||
name: 'center', |
||||
components: { Myupload, Collect, Security }, |
||||
data(){ |
||||
return { |
||||
activeName:'Security' |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
|
@ -1,41 +1,148 @@ |
||||
<template> |
||||
<el-form ref="form" :model="form" label-width="80px"> |
||||
<el-form-item label="论文类型"> |
||||
<el-select v-model="form.type"> |
||||
<el-option v-for="item in options" :key="item.value" :value="item.value" placeholder="请输入论文类型">{{item.label}}</el-option> |
||||
<el-form-item :label="$t('upload.form.type')"> |
||||
<el-select v-model="form.type" :placeholder="$t('upload.form.input_type',{type:$t('upload.form.type')})"> |
||||
<el-option v-for="item in options" :key="item.value" :value="item.value">{{item.label}}</el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item label="论文作者"> |
||||
<el-form-item :label="$t('upload.form.author')"> |
||||
<el-col :span="4"> |
||||
<el-input v-model="form.author" placeholder="请输入论文作者"></el-input> |
||||
<el-input v-model="form.author" |
||||
:placeholder="$t('upload.form.input_author',{author:$t('upload.form.author')})"></el-input> |
||||
</el-col> |
||||
</el-form-item> |
||||
<el-form-item label="学科专业"> |
||||
<el-form-item :label="$t('upload.form.profession')"> |
||||
<el-col :span="4"> |
||||
<el-input v-model="form.profession" placeholder="请输入学科专业"></el-input> |
||||
<el-input v-model="form.profession" |
||||
:placeholder="$t('upload.form.input_profession',{profession:$t('upload.form.profession')})"></el-input> |
||||
</el-col> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('upload.form.school')"> |
||||
<el-col :span="4"> |
||||
<el-input v-model="form.school" |
||||
:placeholder="$t('upload.form.input_school',{school:$t('upload.form.school')})"></el-input> |
||||
</el-col> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('upload.form.year')"> |
||||
<el-select v-model="form.year" :placeholder="$t('upload.form.input_year',{year:$t('upload.form.year')})"> |
||||
<el-option v-for="n in 10" :key="n" :value="2019-n">{{2019-n}}</el-option> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('upload.form.summary')"> |
||||
<el-col :span="4"> |
||||
<el-input v-model="form.summary" type="textarea" |
||||
:placeholder="$t('upload.form.input_summary',{summary:$t('upload.form.summary')})"></el-input> |
||||
</el-col> |
||||
</el-form-item> |
||||
<el-form-item :label="$t('upload.form.tag')"> |
||||
<el-tag |
||||
:key="tag" |
||||
v-for="tag in form.tag.dynamicTags" |
||||
closable |
||||
:disable-transitions="false" |
||||
@close="handleClose(tag)"> |
||||
{{tag}} |
||||
</el-tag> |
||||
<el-col :span="4" v-if="form.tag.inputVisible"> |
||||
<el-input |
||||
class="input-new-tag" |
||||
v-model="form.tag.inputValue" |
||||
ref="saveTagInput" |
||||
size="small" |
||||
@keyup.enter.native="handleInputConfirm" |
||||
@blur="handleInputConfirm" |
||||
> |
||||
</el-input> |
||||
</el-col> |
||||
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ {{$t('upload.form.tag')}}</el-button> |
||||
|
||||
</el-form-item> |
||||
<el-form-item :label="$t('upload.form.content')"> |
||||
<el-upload |
||||
class="upload-demo" |
||||
action="https://jsonplaceholder.typicode.com/posts/" |
||||
:on-preview="handlePreview" |
||||
:on-remove="handleRemove" |
||||
:before-remove="beforeRemove" |
||||
:file-list="form.fileList" |
||||
accept=".txt"> |
||||
<el-button size="small" type="primary">{{$t('upload.form.upload')}}</el-button> |
||||
<div slot="tip" class="el-upload__tip">{{$t('upload.form.upload_tip')}}</div> |
||||
</el-upload> |
||||
</el-form-item> |
||||
|
||||
<el-form-item> |
||||
<el-button type="primary" @click="onSubmit">{{$t('submit')}}</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
</template> |
||||
|
||||
<script lang="ts"> |
||||
<script> |
||||
export default { |
||||
name: 'upload', |
||||
data(){ |
||||
data() { |
||||
return { |
||||
form:{ |
||||
type:'', |
||||
author:'', |
||||
profession:'' |
||||
form: { |
||||
type: '', |
||||
author: '', |
||||
profession: '', |
||||
school: '', |
||||
year: '', |
||||
summary: '', |
||||
tag: { |
||||
dynamicTags: [], |
||||
inputVisible: false, |
||||
inputValue: '' |
||||
}, |
||||
fileList: [] |
||||
}, |
||||
options: [{ |
||||
value: '选项1', |
||||
value: '硕士论文', |
||||
label: '硕士论文' |
||||
},{ |
||||
value: '选项2', |
||||
}, { |
||||
value: '博士论文', |
||||
label: '博士论文' |
||||
}] |
||||
} |
||||
}, |
||||
methods: { |
||||
//删除标签 |
||||
handleClose(tag) { |
||||
this.form.tag.dynamicTags.splice(this.form.tag.dynamicTags.indexOf(tag), 1) |
||||
}, |
||||
//显示添加标签输入框 |
||||
showInput() { |
||||
this.form.tag.inputVisible = true |
||||
this.$nextTick(_ => { |
||||
this.$refs.saveTagInput.$refs.input.focus() |
||||
}) |
||||
}, |
||||
//确认添加标签 |
||||
handleInputConfirm() { |
||||
let inputValue = this.form.tag.inputValue |
||||
if (inputValue) { |
||||
this.form.tag.dynamicTags.push(inputValue) |
||||
} |
||||
console.info(this.form.tag.dynamicTags) |
||||
this.form.tag.inputVisible = false |
||||
this.form.tag.inputValue = '' |
||||
}, |
||||
//删除论文 |
||||
handleRemove(file, fileList) { |
||||
console.log(file, fileList) |
||||
}, |
||||
//预览论文 |
||||
handlePreview(file) { |
||||
console.log(file) |
||||
}, |
||||
//确认移除论文 |
||||
beforeRemove(file, fileList) { |
||||
return this.$confirm($t('upload.form.remove',{file:file.name})) |
||||
}, |
||||
//提交论文 |
||||
onSubmit(){ |
||||
|
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
@ -0,0 +1,6 @@ |
||||
import Vue from 'vue' |
||||
|
||||
Vue.prototype.GLOBAL ={ |
||||
//用户cookie
|
||||
user_key:'user' |
||||
} |
@ -0,0 +1,4 @@ |
||||
import Vue from 'vue' |
||||
import VueCookie from 'vue-cookies' |
||||
|
||||
Vue.use(VueCookie) |
Loading…
Reference in new issue