Browse Source

所有接口及功能完成,已优化,测试

master
wen 2 years ago
parent
commit
877d4107bf
  1. 2
      public/index.html
  2. 1
      public/loadhead.css
  3. 121
      src/components/Breadcrumb/index.vue
  4. 43
      src/layout/components/Sidebar/index.vue
  5. 9
      src/layout/components/Sidebar/leftMenusData.js
  6. 4
      src/store/modules/user.js
  7. 425
      src/views/filemange/index.vue
  8. 20
      src/views/homepage/index.vue
  9. 51
      src/views/login/index.vue
  10. 0
      src/views/subfile/index.js
  11. 59
      src/views/subfile/index.vue
  12. 149
      src/views/systme/changepass.vue
  13. 43
      src/views/systme/switchtheme.vue
  14. 5
      src/views/systme/userrelated.vue
  15. 53
      src/views/usermanage/index.vue

2
public/index.html

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>jialuoma2.ico">
<!-- <title><%= webpackConfig.name %></title> -->
<title>嘉洛马</title>
<title>嘉洛马 — 文件后台管理系统</title>
<link rel="stylesheet" type="text/css" href="loadhead.css">
</head>
<body>

1
public/loadhead.css

@ -12,6 +12,7 @@ a{color:#464c5c;text-decoration:none;} @@ -12,6 +12,7 @@ a{color:#464c5c;text-decoration:none;}
.elementhidden{visibility:hidden !important;}
.verMiddle{vertical-align:middle !important;}
.vercenter{text-align:center !important;}
.verleft{text-align:left !important;}
.textright{text-align:right !important;}
.verbold{font-weight:bold !important;}
.qcmargin{margin:0 !important;}

121
src/components/Breadcrumb/index.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<el-breadcrumb class="app-breadcrumb" separator-class="el-icon-arrow-right">
<el-breadcrumb v-if="breadcrumbq" class="app-breadcrumb" separator-class="el-icon-arrow-right">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
@ -7,27 +7,139 @@ @@ -7,27 +7,139 @@
</el-breadcrumb-item>
</transition-group>
</el-breadcrumb>
<el-breadcrumb v-else class="app-breadcrumb" separator-class="el-icon-arrow-right">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item) in levelList2" :key="item.path">
<!-- <span v-if="" class="no-redirect">{{ item.meta.title }}</span> -->
<a :href="'/#'+item.path">{{ item.meta.title }}</a>
</el-breadcrumb-item>
</transition-group>
<!-- <el-breadcrumb-item :to="{ path: '/filemange/index' }">首页</el-breadcrumb-item>
<el-breadcrumb-item><a href="/">活动管理</a></el-breadcrumb-item> -->
</el-breadcrumb>
</template>
<script>
import pathToRegexp from 'path-to-regexp'
import menusdata from '@/layout/components/Sidebar/leftMenusData.js'
export default {
data() {
return {
levelList: null
levelList: null,
breadcrumbq:true,
getcrumbsData: menusdata,
levelList2: []
}
},
watch: {
$route() {
this.getBreadcrumb()
this.ifbreadshow();
},
// getcrumbsData
getcrumbsData: {
handler: function(newV, oldv) {
this.extractChild = this.arrToobj(newV);
this.ifbreadshow();
//console.log(extractChild);
},
deep: true
//immediate:true
}
},
created() {
this.getBreadcrumb()
//this.ifbreadshow();
//
this.extractChild = null;
//this.getBread(extractChild);
},
computed: {
},
methods: {
ifbreadshow() {
//console.log(menusdata[1]);
let thisURl = window.location.href;
let currentid =null;
let ancestorsDir = null;
if (thisURl.indexOf('filemange') != -1) {
for (let key in this.extractChild) {
if (this.extractChild[key].id == 1) {
ancestorsDir = this.extractChild[key];
break;
}
}
if (thisURl.indexOf('?id') != -1) {
currentid = thisURl.split('?id=')[1]
this.levelList2 = this.getBread(currentid, this.extractChild);
this.levelList2.reverse(); //
//levelList2.
} else {
this.levelList2 = [];
}
this.levelList2.unshift(ancestorsDir)
console.log(this.levelList2);
this.breadcrumbq = false;
// console.log(currentid);
// console.log(this.extractChild);
//console.log(this.levelList2);
} else {
this.breadcrumbq = true;
this.getBreadcrumb()
}
},
arrToobj (arr) {
//console.log(arr);
var obj = {};
var tmp;
for (var i in arr) {
if (typeof(arr[i]['children']) != 'undefined') {
tmp = this.arrToobj(arr[i]['children']);
obj[arr[i].id] = arr[i];
for (var j in tmp) {
obj[tmp[j].id] = tmp[j];
}
}else {
obj[arr[i].id] = arr[i];
}
}
return obj;
},
getBread (id, obj) {
if (typeof(obj[id]) == 'undefined') {return false;}
var arr = [];
arr[arr.length] = obj[id];
//arr[arr.length].unshift(obj[id])
var pid = typeof (obj[id]['pid']) != 'undefined' ? obj[id]['pid'] : 0;
while (pid) {
arr[arr.length] = obj[pid];
pid = typeof (obj[pid]['pid']) != 'undefined' ? obj[pid]['pid'] : 0;
}
//console.log(1111);
return arr;
},
getBreadcrumb() {
// only show routes with meta.title
@ -41,6 +153,7 @@ export default { @@ -41,6 +153,7 @@ export default {
}
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
//console.log(this.levelList);
},
isDashboard(route) {
const name = route && route.name

43
src/layout/components/Sidebar/index.vue

@ -11,6 +11,8 @@ @@ -11,6 +11,8 @@
:active-text-color="variables.menuActiveText"
:collapse-transition="false"
mode="vertical"
@open="handleOpen"
:default-openeds="openedsindex"
>
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
</el-menu>
@ -39,13 +41,21 @@ export default { @@ -39,13 +41,21 @@ export default {
},
mounted() {
EventBus.$on('mkdirSuccess', this.getmunusdata)
EventBus.$on('mkdirSuccess', this.getmunusdata); //
//EventBus.$on('menuopemdsc', this.menuopeneds); //
let winpach = window.location.href;
if (winpach.indexOf('filemange/index') != -1) {
this.menuopeneds();
}
//console.log(this.$root);
},
data() {
return {
routes:menusdata
routes:menusdata,
// index submenindex
openedsindex:[]
}
},
computed: {
@ -61,7 +71,7 @@ export default { @@ -61,7 +71,7 @@ export default {
const route = this.$route
const { meta, path } = route
const menusindex = window.location.href
//console.log(1);
// path
if (menusindex.indexOf('?id') != -1) {
return menusindex.split('/#')[1]
@ -85,8 +95,16 @@ export default { @@ -85,8 +95,16 @@ export default {
},
methods: {
menuopeneds() {
window.setTimeout(() => {
this.openedsindex = ['/filemange/index'];
}, 400);
},
SplicingMenuTree(menus) {
let newMenu = null, arrMenus = [];
let nuni = 2;
menus.forEach(item => {
//console.log(menusdata[0]);
// if (!this.menusdata.children) {
@ -97,6 +115,8 @@ export default { @@ -97,6 +115,8 @@ export default {
path: '/filemange/subfile?id='+item.id,
meta: { title: item.directory },
class: 'file',
id: item.id,
pid: item.pid,
children:[]
}
if (item.directories && item.directories.length > 0) {
@ -104,6 +124,7 @@ export default { @@ -104,6 +124,7 @@ export default {
}
arrMenus.push(newMenu);
//nuni++;
});
return arrMenus;
},
@ -114,13 +135,17 @@ export default { @@ -114,13 +135,17 @@ export default {
// console.log(this.$store);
mirlist().then(response => {
let datamain = response.data;
this.routes[1].children = [];
if (datamain.code == 1) {
this.routes[1].children = this.SplicingMenuTree(datamain.data.menus);
//console.log();
let dirTree = datamain.data.dirTree;
if (dirTree.id) {
//this.$router.push({path: '/filemange/subfile?id='+dirTree.id});
// let dirTree = datamain.data.dirTree;
// if (dirTree.id) {
// //this.$router.push({path: '/filemange/subfile?id='+dirTree.id});
// }
}
}).catch(function (error) {
if (error.response) {
if (error.response.status == 401) {
@ -135,7 +160,11 @@ export default { @@ -135,7 +160,11 @@ export default {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
}
});
}
},
handleOpen(key, keyPath) {
//console.log(key, keyPath);
},
}
}
</script>

9
src/layout/components/Sidebar/leftMenusData.js

@ -30,8 +30,7 @@ var menusdata = [ @@ -30,8 +30,7 @@ var menusdata = [
{
id: '0',
path: '/homepage',
meta: { title: '首页', icon: 'dashboard' },
children:[]
meta: { title: '首页', icon: 'dashboard' }
},
{
@ -42,29 +41,35 @@ var menusdata = [ @@ -42,29 +41,35 @@ var menusdata = [
children:[]
},
{
id: '2',
path: '/usermange/index',
meta: { title: '用户管理', icon: 'form' }
},
{
id: '3',
path: '/systme',
meta: { title: '系统管理', icon: 'dashboard' },
children: [
{
id:'3-1',
path: 'changepass',
meta: { title: '修改密码', icon: 'table' }
},
{
id: '3-2',
path: 'userrelated',
meta: { title: '用户相关', icon: 'tree' }
},
{
id: '3-3',
path: 'switchtheme',
meta: { title: '皮肤更换', icon: 'tree' }
}
]
},
{
id: '4',
path: 'https://dev.filesite.io',
meta: { title: '前端展示页面', icon: 'link' }

4
src/store/modules/user.js

@ -30,9 +30,9 @@ const mutations = { @@ -30,9 +30,9 @@ const mutations = {
const actions = {
// user login
login({ commit }, userInfo) {
const { username, password } = userInfo
const { username, password, captcha} = userInfo
return new Promise((resolve, reject) => {
login({ username: username.trim(), password: password }).then(response => {
login({ username: username.trim(), password: password, captcha: captcha}).then(response => {
const { data } = response
commit('SET_TOKEN', data.token)
setToken(data.token)

425
src/views/filemange/index.vue

@ -1,23 +1,107 @@ @@ -1,23 +1,107 @@
<template>
<div class="filemange_container">
<div class="mkdirm">
<el-button type="primary" @click="dirbox = true">创建目录</el-button>
<div class="filemange_container" v-loading="subloading" element-loading-text="数据加载中...">
<div class="use_button">
<el-button type="primary" icon="el-icon-edit" @click="dirbox = true">创建目录</el-button>
<!-- <el-button type="primary" icon="el-icon-edit" @click="rmdirm">删除目录</el-button>
<el-button type="primary" icon="el-icon-edit">重命名</el-button> -->
</div>
<div v-on:click="fileTableMClick">
<!-- 子目录数据列表 如果不需要显示空数据提示可以用css隐藏-->
<el-table
:data="dirdata"
empty-text="暂无子目录数据"
border
style="width: 100%" class="filesmd verleft">
<!-- <el-table-column
align="center"
prop="date"
label="时间"
width="auto">
</el-table-column> -->
<el-table-column
align="left"
prop="name"
label="名称">
</el-table-column>
<el-table-column
align="left"
label="类型"
width="auto">
<template slot-scope="scope">
<div class="type_file_click">
<el-tooltip content="进入子目录" placement="bottom-start" effect="light">
<a :href="'#/filemange/subfile?id='+scope.row.id">
<!-- <el-button type="warning" icon="el-icon-notebook-1">{{scope.row.name}}</el-button> -->
<img src="../../common/img/file.png" alt="图片"/>
</a>
</el-tooltip>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="auto">
<template slot-scope="scope">
<div class="file_caozuo">
<el-button size="mini" :filenames="scope.row.name" mark="rename">重命名</el-button>
<!-- <el-button size="mini">下载</el-button> -->
</div>
<div class="file_caozuo2">
<el-button size="mini" :realpath="scope.row.frealpath" mark="movefiledir">移动</el-button>
<el-button size="mini" mark="dirdelete" :filenames="scope.row.name" type="danger">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
<!-- 创建目录弹框 -->
<el-dialog title="创建目录" :visible.sync="dirbox">
<el-form :model="form">
<el-form :model="dirform">
<el-form-item label="目录名称" :label-width="formLabelWidth">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
<el-form-item label="父级目录" :label-width="formLabelWidth">
<el-select v-model="form.region" placeholder="请选择父级目录">
<el-option label="区域一" value="shanghai"></el-option>
<el-option label="区域二" value="beijing"></el-option>
</el-select>
<el-input v-model="dirform.dir" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dirbox = false"> </el-button>
<el-button type="primary" @click="dirbox = false"> </el-button>
<el-button type="primary" @click="mkdirs" :loading="mkdirloadings"> </el-button>
</div>
</el-dialog>
<!-- 重新命名弹框 -->
<el-dialog title="重命名" :visible.sync="renamebox">
<el-form :model="renamefileform">
<el-form-item label="新名称" :label-width="formLabelWidth">
<el-input v-model="renamefileform.to" autocomplete="off">
<template v-if="filesuffix" slot="append">{{filesuffix}}</template>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="renamebox = false"> </el-button>
<el-button type="primary" @click="renameFileDir" :loading="mkdirloadings"> </el-button>
</div>
</el-dialog>
<!-- 移动目录弹框 -->
<el-dialog title="目录移动弹出框" :visible.sync="movebox">
<el-form :model="movefileform">
<el-form-item label="当前位置" :label-width="formLabelWidth">
<el-input v-model="movefileform.from" autocomplete="off">
</el-input>
</el-form-item>
<el-form-item label="目标位置(请参考当前位置的格式填写目标位置,需要带上当前的文件名称)" :label-width="formLabelWidth">
<el-input v-model="movefileform.to" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="movebox = false"> </el-button>
<el-button type="primary" @click="moveFileDir" :loading="mkdirloadings"> </el-button>
</div>
</el-dialog>
</div>
@ -26,32 +110,323 @@ @@ -26,32 +110,323 @@
<script>
//import { mapGetters } from 'vuex'
import { mirlist, mkdir, rmdirs, deletefile, renamefile, movefiledir} from '@/api/user'
import EventBus from '@/utils/EventBus.js'
export default {
//
created() {
this.getFileData();
//console.log(this.imgurl);
},
data() {
return {
//
dirdata: [],
subloading: false, //loading
mkdirloadings: false, //loading
//
dirbox: false,
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
formLabelWidth: '120px'
dirform: {
dir: '',
parent: ''
},
formLabelWidth: '',
//
rmdirform: {
dir: '',
parent: ''
},
//
renamebox: false,
filesuffix:false,
renamefileform: {
from: '',
to: '',
parent: ''
},
//
movebox: false,
movefileform: {
from: '',
to: ''
},
}
},
methods: {
getFileData() {
let thiss = this;
this.subloading = true;
mirlist().then(response => {
let datamain = response.data;
//console.log(maindata);
this.dirdata = []
if (datamain.code == 1) {
let maindata = datamain.data.menus;
//console.log(maindata.directories.length);
if (maindata) {
this.dirdata = this.forObjectData(maindata);
}
// this.dirform.parent = maindata.realpath; //
// this.rmdirform.parent = maindata.realpath; //
// this.renamefileform.parent = maindata.realpath; //
// this.movefileform.from = maindata.realpath; //
//console.log(this.movefileform.from);
}
this.subloading = false;
}).catch(error => {
if (error.response) {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else if (error.request) {
thiss.$message({showClose: true,message: error,type: 'error'});
} else {
thiss.$message({showClose: true,message: error.message, type: 'error'});
}
this.subloading = false;
});
},
forObjectData(objectd) {
let newObject = null, arrObjs = [];
Object.keys(objectd).forEach(item => {
let names = null;
if (objectd[item].filename) {
names = objectd[item].filename+'.'+objectd[item].extension;
}
newObject = {
suffix:objectd[item].extension || '',
image: objectd[item].path,
name: names || objectd[item].directory,
id: objectd[item].id,
frealpath: objectd[item].realpath || objectd[item].directory
}
arrObjs.push(newObject);
});
return arrObjs;
console.log(arrObjs);
},
//
mkdirs() {
let thiss = this;
if (!this.dirform.dir) {
thiss.$message({showClose: true,message: '目录名不能为空',type: 'error'});
return;
}
//console.log(this.dirform);
this.mkdirloadings = true;
mkdir(this.dirform).then(response => {
let datamain = response.data;
if (datamain.code == 1) {
EventBus.$emit('mkdirSuccess'); //
//EventBus.$emit('menuopemdsc'); //
this.getFileData();
this.dirform.dir = '';
thiss.$message({showClose: true,message: datamain.msg, type: 'success'});
//this.subloading = false;
} else {
thiss.$message({showClose: true,message: datamain.err, type: 'error'});
}
this.mkdirloadings = false;
this.dirbox = false;
}).catch(error => {
//console.log(0);
if (error.response) {
thiss.mkdirloadings = false;
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else if (error.request) {
thiss.$message({showClose: true,message: error,type: 'error'});
} else {
thiss.$message({showClose: true,message: error.message, type: 'error'});
}
});
},
//
rmdirm() {
let thiss = this;
this.subloading = true;
//console.log(this.rmdirform);
rmdirs(this.rmdirform).then(response => {
let datamain = response.data;
let maindata = datamain.data.dirTree;
if (datamain.code == 1) {
EventBus.$emit('mkdirSuccess'); //
this.getFileData();
thiss.$message({showClose: true,message: datamain.msg,type: 'success'});
//this.subloading = false;
} else {
thiss.$message({showClose: true,message: datamain.err,type: 'error'});
}
this.subloading = false;
//this.dirbox = false;
}).catch(error => {
if (error.response) {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else if (error.request) {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
}
this.subloading = false;
});
},
//
moveFileDir() {
if (!this.movefileform.to || !this.movefileform.from) {
this.$message({showClose: true,message: '不能为空',type: 'error'});
return;
}
let thiss = this;
this.subloading = true;
//console.log(this.rmfileform);
movefiledir(this.movefileform).then(response => {
let datamain = response.data;
if (datamain.code == 1) {
console.log(66666);
EventBus.$emit('mkdirSuccess'); //
this.getFileData();
thiss.$message({showClose: true,message: datamain.msg,type: 'success'});
//this.subloading = false;
} else {
thiss.$message({showClose: true,message: datamain.err,type: 'error'});
}
this.subloading = false;
this.movebox = false;
}).catch(error => {
this.subloading = false;
if (error.response) {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else if (error.request) {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
}
});
},
//
renameFileDir() {
if (!this.renamefileform.to) {
this.$message({showClose: true,message: '新名称不能为空',type: 'error'});
return;
}
if (this.filesuffix) {
this.renamefileform.to += this.filesuffix;
}
let thiss = this;
this.subloading = true;
//console.log(this.rmfileform);
renamefile(this.renamefileform).then(response => {
let datamain = response.data;
if (datamain.code == 1) {
EventBus.$emit('mkdirSuccess'); //
this.getFileData();
thiss.$message({showClose: true,message: datamain.msg,type: 'success'});
//this.subloading = false;
} else {
thiss.$message({showClose: true,message: datamain.err,type: 'error'});
}
this.subloading = false;
this.renamebox = false;
}).catch(error => {
this.subloading = false;
if (error.response) {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else if (error.request) {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
} else {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
}
});
},
// table
fileTableMClick(e) {
let dangQian = e.target, labelname = dangQian.tagName.toLowerCase(), chufazhe = e.currentTarget; //currentTarget
let getbutton = dangQian, objmark = null;
if (labelname == 'span') {
//console.log(dangQian.parentNode);
getbutton = dangQian.parentNode;
}
objmark = getbutton.getAttribute('mark');
//
if (objmark == 'dirdelete') {
this.rmdirform.dir = getbutton.getAttribute('filenames');
this.rmdirm();
return;
}
//
if (objmark == 'rename') {
this.renamefileform.from = getbutton.getAttribute('filenames');
this.filesuffix = getbutton.getAttribute('suffixs');
this.renamefileform.to = '';
this.renamebox = true;
//this.renameFileDir();
return;
}
//
if (objmark == 'movefiledir') {
//this.movefileform.from = getbutton.getAttribute('filenames');
this.movefileform.from = getbutton.getAttribute('realpath');
this.movefileform.to = '';
this.movebox = true;
//this.renameFileDir();
return;
}
//console.log(dangQian);
}
}
}
</script>
<style lang="scss" scoped>
.mkdirm{text-align:center;margin:20% 0 0 0;}
<style lang="scss">
.filemange_container{
padding:26px 5% 47px 5%;
.block{margin:0 0 28px 0;}
.sou_bottom{margin-left:10px;}
.use_button{margin:15px 0 16px 0;}
// .use_button>button{margin:0 10px 10px 0;}
.file_caozuo2>button{margin-top:6px;}
.el-table td{padding:9px 0}
.folder_bottom a{margin:0 6px;}
.el-table__body-wrapper img{width:100px;height:71px;}
.el-drawer__body{text-align:center;padding:0 10% 20px 10%;}
.request_main{text-align:center;margin:12px 0;}
.addimgtext{line-height:25px;display:inline-block;color:#8c939d;vertical-align: middle;}
.el-upload--picture-card i{vertical-align:middle;}
.type_file_click img{width:64px;height:48px;}
.type_file_click a{display:block;}
// .el-table .is-center{text-align:left;}
}
</style>

20
src/views/homepage/index.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<div class="filemange_container">
<!-- <div class="filemange_container">
<div class="mkdirm">
<el-button type="primary" @click="dirbox = true">创建目录</el-button>
</div>
@ -20,6 +20,9 @@ @@ -20,6 +20,9 @@
<el-button type="primary" @click="dirbox = false"> </el-button>
</div>
</el-dialog>
</div> -->
<div class="app-container Clew">
<h2>欢迎</h2>
</div>
</template>
@ -30,18 +33,7 @@ @@ -30,18 +33,7 @@
export default {
data() {
return {
dirbox: false,
form: {
name: '',
region: '',
date1: '',
date2: '',
delivery: false,
type: [],
resource: '',
desc: ''
},
formLabelWidth: '120px'
}
},
@ -52,5 +44,5 @@ methods: { @@ -52,5 +44,5 @@ methods: {
</script>
<style lang="scss" scoped>
.mkdirm{text-align:center;margin:20% 0 0 0;}
// .Clew{font-size:}
</style>

51
src/views/login/index.vue

@ -170,30 +170,37 @@ export default { @@ -170,30 +170,37 @@ export default {
if (valid) {
this.loading = true
let thiss = this;
login(this.loginForm).then(response => {
let datamain = response.data;
console.log(1111);
if (datamain.code == 0) {
this.loading = false;
this.$message({
showClose: true,
message: datamain.err,
type: 'error'
});
return false;
}
//console.log(response)
this.$store.dispatch('user/login', this.loginForm).then(() => {
//this.$router.push({ path: this.redirect || '/' })
this.$router.push({path: '/filemange/index'})
//console.log('6666');
}).catch(function (error) {
thiss.$message({
showClose: true,
message: error,
type: 'error'
});
this.loading = false
});
}).catch(() => {
this.loading = false
})
// login(this.loginForm).then(response => {
// let datamain = response.data;
// console.log(1111);
// if (datamain.code == 0) {
// this.loading = false;
// this.$message({
// showClose: true,
// message: datamain.err,
// type: 'error'
// });
// return false;
// }
// //console.log(response)
// this.$router.push({path: '/filemange/index'})
// //console.log('6666');
// }).catch(function (error) {
// thiss.$message({
// showClose: true,
// message: error,
// type: 'error'
// });
// this.loading = false
// });
} else {
console.log('error submit!!')
return false

0
src/views/subfile/indexs.js → src/views/subfile/index.js

59
src/views/subfile/index.vue

@ -41,17 +41,17 @@ @@ -41,17 +41,17 @@
width="auto">
</el-table-column> -->
<el-table-column
align="center"
align="left"
prop="name"
label="名称">
</el-table-column>
<el-table-column
align="center"
align="left"
label="类型"
width="auto">
<template slot-scope="scope">
<div class="type_file_click">
<a :href="'#/filemange/subfile?id='+scope.row.id">
<a title="点击进入子目录" :href="'#/filemange/subfile?id='+scope.row.id">
<!-- <el-button type="warning" icon="el-icon-notebook-1">{{scope.row.name}}</el-button> -->
<img src="../../common/img/file.png" alt="图片"/>
</a>
@ -92,12 +92,12 @@ @@ -92,12 +92,12 @@
width="auto">
</el-table-column> -->
<el-table-column
align="center"
align="left"
prop="name"
label="名称">
</el-table-column>
<el-table-column
align="center"
align="left"
label="图片"
width="auto">
<template slot-scope="scope">
@ -112,7 +112,7 @@ @@ -112,7 +112,7 @@
label="操作">
<template slot-scope="scope">
<div class="file_caozuo">
<el-button size="mini" :filenames="scope.row.name" mark="rename">重命名</el-button>
<el-button size="mini" :filenames="scope.row.name" :suffixs="'.'+scope.row.suffix" mark="rename">重命名</el-button>
<!-- <el-button size="mini">下载</el-button> -->
</div>
<div class="file_caozuo2">
@ -143,7 +143,9 @@ @@ -143,7 +143,9 @@
<el-dialog title="重命名" :visible.sync="renamebox">
<el-form :model="renamefileform">
<el-form-item label="新名称" :label-width="formLabelWidth">
<el-input v-model="renamefileform.to" autocomplete="off"></el-input>
<el-input v-model="renamefileform.to" autocomplete="off">
<template v-if="filesuffix" slot="append">{{filesuffix}}</template>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -156,9 +158,11 @@ @@ -156,9 +158,11 @@
<el-dialog title="目录移动弹出框" :visible.sync="movebox">
<el-form :model="movefileform">
<el-form-item label="当前位置" :label-width="formLabelWidth">
<el-input v-model="movefileform.from" autocomplete="off"></el-input>
<el-input v-model="movefileform.from" autocomplete="off">
</el-input>
</el-form-item>
<el-form-item label="目标位置" :label-width="formLabelWidth">
<el-form-item label="目标位置(请参考当前位置的格式填写目标位置,需要带上当前的文件名称)" :label-width="formLabelWidth">
<el-input v-model="movefileform.to" autocomplete="off"></el-input>
</el-form-item>
</el-form>
@ -184,6 +188,7 @@ @@ -184,6 +188,7 @@
:on-change="filechange"
:on-preview="handlePictureCardPreview"
:disabled="false"
:file-list="uploadFilelist"
accept=".jpg, .jpeg, .png, .gif"
:auto-upload="false">
<i slot="default" class="el-icon-plus"></i>
@ -223,7 +228,7 @@ export default { @@ -223,7 +228,7 @@ export default {
//
created() {
this.getFileData();
console.log(this.imgurl);
//console.log(this.imgurl);
},
//
@ -231,9 +236,9 @@ export default { @@ -231,9 +236,9 @@ export default {
// console.log(this.imgurl);
// },
filters: {
// filters: {
},
// },
data() {
return {
//
@ -296,6 +301,7 @@ export default { @@ -296,6 +301,7 @@ export default {
//
renamebox: false,
filesuffix:false,
renamefileform: {
from: '',
to: '',
@ -315,6 +321,7 @@ export default { @@ -315,6 +321,7 @@ export default {
//
uploadDrawer: false,
direction: 'ttb',
uploadFilelist: [],
//
dialogImageUrl: '',
@ -364,6 +371,7 @@ export default { @@ -364,6 +371,7 @@ export default {
return;
}
this.uploadFilelist = fileList;
//
this.imgUploadData.name = files.name;
this.getBase64(files.raw).then(res => {
@ -417,9 +425,10 @@ export default { @@ -417,9 +425,10 @@ export default {
uploadrequest(this.imgUploadData).then(response => {
let datamain = response.data;
if (datamain.code == 1) {
console.log(datamain);
//console.log(datamain);
this.$message({showClose: true,message: datamain.msg, type:'success'});
this.uploadDrawer = false;
this.uploadFilelist = [];
this.getFileData();
}
this.uploadLoad = false;
@ -434,6 +443,12 @@ export default { @@ -434,6 +443,12 @@ export default {
}
});
},
//
// uploadDrawerClose(done) {
// this.uploadDrawer = false;
// this.uploadFilelist = [];
// },
getFileData() {
let can = {};
const menusindex = window.location.href
@ -469,12 +484,7 @@ export default { @@ -469,12 +484,7 @@ export default {
this.imgUploadData.parent = maindata.realpath; //
this.movefileform.from = maindata.realpath; //
//console.log(this.movefileform.from);
this.subloading = false;
}
}).catch(error => {
if (error.response) {
@ -498,7 +508,7 @@ export default { @@ -498,7 +508,7 @@ export default {
names = objectd[item].filename+'.'+objectd[item].extension;
}
newObject = {
date: '2016-05-03',
suffix:objectd[item].extension || '',
image: objectd[item].path,
name: names || objectd[item].directory,
id: objectd[item].id,
@ -531,6 +541,8 @@ export default { @@ -531,6 +541,8 @@ export default {
this.dirform.dir = '';
thiss.$message({showClose: true,message: datamain.msg,type: 'success'});
//this.subloading = false;
} else {
thiss.$message({showClose: true,message: datamain.err, type: 'error'});
}
this.mkdirloadings = false;
@ -615,6 +627,10 @@ export default { @@ -615,6 +627,10 @@ export default {
this.$message({showClose: true,message: '新名称不能为空',type: 'error'});
return;
}
if (this.filesuffix) {
this.renamefileform.to += this.filesuffix;
}
let thiss = this;
this.subloading = true;
//console.log(this.rmfileform);
@ -657,7 +673,7 @@ export default { @@ -657,7 +673,7 @@ export default {
movefiledir(this.movefileform).then(response => {
let datamain = response.data;
if (datamain.code == 1) {
EventBus.$emit('mkdirSuccess'); //
this.getFileData();
thiss.$message({showClose: true,message: datamain.msg,type: 'success'});
//this.subloading = false;
@ -708,6 +724,7 @@ export default { @@ -708,6 +724,7 @@ export default {
//
if (objmark == 'rename') {
this.renamefileform.from = getbutton.getAttribute('filenames');
this.filesuffix = getbutton.getAttribute('suffixs');
this.renamefileform.to = '';
this.renamebox = true;
//this.renameFileDir();
@ -746,5 +763,7 @@ export default { @@ -746,5 +763,7 @@ export default {
.addimgtext{line-height:25px;display:inline-block;color:#8c939d;vertical-align: middle;}
.el-upload--picture-card i{vertical-align:middle;}
.type_file_click img{width:64px;height:48px;}
.type_file_click a{display:block;}
// .el-table .is-center{text-align:left;}
}
</style>

149
src/views/systme/changepass.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<div class="change_pass">
<!-- <div class="change_pass">
<el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm pass_form">
<el-form-item label="当前密码" prop="pass">
<el-input type="password" v-model="ruleForm.pass" autocomplete="off"></el-input>
@ -15,6 +15,9 @@ @@ -15,6 +15,9 @@
<el-button @click="resetForm('ruleForm')">重置</el-button>
</el-form-item>
</el-form>
</div> -->
<div class="app-container">
暂未开放
</div>
</template>
@ -26,76 +29,76 @@ @@ -26,76 +29,76 @@
<script>
export default {
data() {
var checkAge = (rule, value, callback) => {
if (!value) {
return callback(new Error('年龄不能为空'));
}
setTimeout(() => {
if (!Number.isInteger(value)) {
callback(new Error('请输入数字值'));
} else {
if (value < 18) {
callback(new Error('必须年满18岁'));
} else {
callback();
}
}
}, 1000);
};
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'));
} else {
if (this.ruleForm.checkPass !== '') {
this.$refs.ruleForm.validateField('checkPass');
}
callback();
}
};
var validatePass2 = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.ruleForm.pass) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
};
return {
ruleForm: {
pass: '',
checkPass: '',
age: ''
},
rules: {
pass: [
{ validator: validatePass, trigger: 'blur' }
],
checkPass: [
{ validator: validatePass2, trigger: 'blur' }
],
age: [
{ validator: checkAge, trigger: 'blur' }
]
}
};
},
methods: {
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
alert('submit!');
} else {
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
}
}
// export default {
// data() {
// var checkAge = (rule, value, callback) => {
// if (!value) {
// return callback(new Error(''));
// }
// setTimeout(() => {
// if (!Number.isInteger(value)) {
// callback(new Error(''));
// } else {
// if (value < 18) {
// callback(new Error('18'));
// } else {
// callback();
// }
// }
// }, 1000);
// };
// var validatePass = (rule, value, callback) => {
// if (value === '') {
// callback(new Error(''));
// } else {
// if (this.ruleForm.checkPass !== '') {
// this.$refs.ruleForm.validateField('checkPass');
// }
// callback();
// }
// };
// var validatePass2 = (rule, value, callback) => {
// if (value === '') {
// callback(new Error(''));
// } else if (value !== this.ruleForm.pass) {
// callback(new Error('!'));
// } else {
// callback();
// }
// };
// return {
// ruleForm: {
// pass: '',
// checkPass: '',
// age: ''
// },
// rules: {
// pass: [
// { validator: validatePass, trigger: 'blur' }
// ],
// checkPass: [
// { validator: validatePass2, trigger: 'blur' }
// ],
// age: [
// { validator: checkAge, trigger: 'blur' }
// ]
// }
// };
// },
// methods: {
// submitForm(formName) {
// this.$refs[formName].validate((valid) => {
// if (valid) {
// alert('submit!');
// } else {
// console.log('error submit!!');
// return false;
// }
// });
// },
// resetForm(formName) {
// this.$refs[formName].resetFields();
// }
// }
// }
</script>

43
src/views/systme/switchtheme.vue

@ -1,8 +1,9 @@ @@ -1,8 +1,9 @@
<template>
<div class="seitchtheme_m">
<h5>更换皮肤以查看不同皮肤的前端网站</h5>
<div>
<span>更换皮肤</span>
<el-select v-model="skinvalue" placeholder="请选择皮肤">
<el-select v-model="skinvalue" @change="selectbian" placeholder="请选择皮肤">
<el-option
v-for="item in options"
:key="item.value"
@ -11,7 +12,9 @@ @@ -11,7 +12,9 @@
</el-option>
</el-select>
<div class="Submit1">
<el-button @click="skinSubmit" :loading="skinloading" type="primary">提交</el-button>
<!-- <el-button @click="skinSubmit" :loading="skinloading" type="primary">提交</el-button> -->
<a v-if="skinvalue" class="to_front_web" target="_blank" :href="skinLink"><el-button type="success" round>查看{{skinlabel}}站点</el-button></a>
</div>
</div>
@ -29,21 +32,27 @@ export default { @@ -29,21 +32,27 @@ export default {
return {
options: [{
value: 'manual',
label: 'manual'
label: '文档站',
link:'https://Filesite.io'
}, {
value: 'webdirectory',
label: 'webdirectory'
label: '导航站',
link:'https://WebDirectory.filesite.io'
}, {
value: 'googleimage',
label: 'googleimage'
label: '图片站',
link:'https://googleimage.filesite.io/'
}, {
value: 'videoblog',
label: 'videoblog'
label: '视频站',
link:'https://Duan.Filesite.io'
}],
skinvalue: '',
skinlabel:'',
skinLink: '',
skinloading:false,
themes:{
skinForm:{
theme:''
}
}
@ -52,12 +61,12 @@ export default { @@ -52,12 +61,12 @@ export default {
skinSubmit() {
let thiss = this;
this.skinloading = true;
this.themes.theme = this.skinvalue;
switchthemeApi(this.themes).then(response => {
this.skinForm.theme = this.skinvalue;
switchthemeApi(this.skinForm).then(response => {
let datamain = response.data;
if (datamain.code == 1) {
this.getFileData();
thiss.$message({showClose: true,message: datamain.msg,type: 'success'});
//this.subloading = false;
} else {
@ -76,6 +85,16 @@ export default { @@ -76,6 +85,16 @@ export default {
thiss.$message({showClose: true,message: error.response.data.err,type: 'error'});
}
});
},
selectbian(thisop) {
//console.log(thisop);
this.options.forEach(element => {
if (element.value == thisop) {
this.skinlabel = element.label;
this.skinLink = element.link;
}
});
}
}
}
@ -84,8 +103,10 @@ export default { @@ -84,8 +103,10 @@ export default {
<style lang="scss">
.seitchtheme_m{
padding:26px 5% 47px 5%;
.el-select{width:88%}
.el-select{width:88%;margin:25px 0;}
.Submit1{margin:20px 0;text-align:center;}
h5{font-size:18px;font-weight:bold;}
.to_front_web{display:block;margin:16px 0;}
}
</style>

5
src/views/systme/userrelated.vue

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
<template>
<div class="change_pass">
<!-- <div class="change_pass">
<el-form :label-position="labelPosition" label-width="80px" :model="formLabelAlign">
<el-form-item label="">
<el-checkbox v-model="checked">是否需要用户登入才能访问</el-checkbox>
@ -8,6 +8,9 @@ @@ -8,6 +8,9 @@
<el-input v-model="input" placeholder="授权登入密码设置"></el-input>
</el-form-item>
</el-form>
</div> -->
<div class="app-container">
暂未开放
</div>
</template>

53
src/views/usermanage/index.vue

@ -1,45 +1,6 @@ @@ -1,45 +1,6 @@
<template>
<div class="app-container">
<el-table
v-loading="listLoading"
:data="list"
element-loading-text="Loading"
border
fit
highlight-current-row
>
<el-table-column align="center" label="ID" width="95">
<template slot-scope="scope">
{{ scope.$index }}
</template>
</el-table-column>
<el-table-column label="标题">
<template slot-scope="scope">
{{ scope.row.title }}
</template>
</el-table-column>
<el-table-column label="昵称" width="110" align="center">
<template slot-scope="scope">
<span>{{ scope.row.author }}</span>
</template>
</el-table-column>
<el-table-column label="时间" width="110" align="center">
<template slot-scope="scope">
{{ scope.row.pageviews }}
</template>
</el-table-column>
<el-table-column class-name="status-col" label="状态" width="110" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status | statusFilter">{{ scope.row.status }}</el-tag>
</template>
</el-table-column>
<el-table-column align="center" prop="created_at" label="操作" width="200">
<template slot-scope="scope">
<i class="el-icon-time" />
<span>{{ scope.row.display_time }}</span>
</template>
</el-table-column>
</el-table>
暂未开放
</div>
</template>
@ -50,19 +11,11 @@ import { getList } from '@/api/table' @@ -50,19 +11,11 @@ import { getList } from '@/api/table'
export default {
filters: {
statusFilter(status) {
const statusMap = {
published: 'success',
draft: 'gray',
deleted: 'danger'
}
return statusMap[status]
}
},
data() {
return {
list: null,
listLoading: true
}
},
created() {

Loading…
Cancel
Save