Skip to content

Commit

Permalink
结构调整
Browse files Browse the repository at this point in the history
  • Loading branch information
zhh committed May 16, 2018
1 parent 5f6f46c commit d444433
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 273 deletions.
9 changes: 0 additions & 9 deletions src/api/table.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/components/Breadcrumb/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default {
getBreadcrumb() {
let matched = this.$route.matched.filter(item => item.name)
const first = matched[0]
if (first && first.name !== 'dashboard') {
matched = [{ path: '/dashboard', meta: { title: '首页' }}].concat(matched)
if (first && first.name !== 'home') {
matched = [{ path: '/home', meta: { title: '首页' }}].concat(matched)
}
this.levelList = matched
}
Expand Down
8 changes: 4 additions & 4 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export const constantRouterMap = [
{
path: '',
component: Layout,
redirect: '/dashboard',
redirect: '/home',
children: [{
path: 'dashboard',
name: 'dashboard',
component: () => import('@/views/dashboard/index'),
path: 'home',
name: 'home',
component: () => import('@/views/home/index'),
meta: {title: '首页', icon: 'home'}
}]
},
Expand Down
2 changes: 1 addition & 1 deletion src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ a:hover {

/*外框样式*/
.container-frame{
padding: 8px;
padding: 10px;
border: 1px solid rgb(235, 235, 235);
border-image: initial;
border-radius: 3px;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ service.interceptors.response.use(
Message({
message: res.message,
type: 'error',
duration: 5 * 1000
duration: 3 * 1000
})

// 401:未登录;
Expand All @@ -57,7 +57,7 @@ service.interceptors.response.use(
Message({
message: error.message,
type: 'error',
duration: 5 * 1000
duration: 3 * 1000
})
return Promise.reject(error)
}
Expand Down
85 changes: 0 additions & 85 deletions src/views/form/index.vue

This file was deleted.

2 changes: 1 addition & 1 deletion src/views/dashboard/index.vue → src/views/home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { mapGetters } from 'vuex'
export default {
name: 'dashboard',
name: 'home',
computed: {
...mapGetters([
'name',
Expand Down
4 changes: 2 additions & 2 deletions src/views/layout/components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<el-dropdown-menu class="user-dropdown" slot="dropdown">
<router-link class="inlineBlock" to="/">
<el-dropdown-item>
Home
首页
</el-dropdown-item>
</router-link>
<el-dropdown-item divided>
<span @click="logout" style="display:block;">LogOut</span>
<span @click="logout" style="display:block;">退出</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
Expand Down
4 changes: 2 additions & 2 deletions src/views/pms/brand/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<brand-detail :is-edit='false'></brand-detail>
</template>
<script>
import brandDetail from './components/brandDetail'
import BrandDetail from './components/BrandDetail'
export default {
name: 'addBrand',
components: { brandDetail }
components: { BrandDetail }
}
</script>
<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import {createBrand, getBrand, updateBrand} from '@/api/brand'
export default {
name: 'brandDetail',
name: 'BrandDetail',
props: {
isEdit: {
type: Boolean,
Expand Down Expand Up @@ -100,15 +100,17 @@
this.$refs[formName].resetFields();
this.$message({
message: '修改成功',
type: 'success'
type: 'success',
duration:1000
});
});
} else {
createBrand(this.brand).then(response => {
this.$refs[formName].resetFields();
this.$message({
message: '提交成功',
type: 'success'
type: 'success',
duration:1000
});
});
}
Expand All @@ -117,7 +119,8 @@
} else {
this.$message({
message: '验证失败',
type: 'error'
type: 'error',
duration:1000
});
return false;
}
Expand Down
38 changes: 22 additions & 16 deletions src/views/pms/brand/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div class="app-container">
<div class="filter-container container-frame">
<div>
<i class="el-icon-search"></i>
筛选搜索
<i class="el-icon-search" style="margin-top: 10px"></i>
<span style="margin-top: 10px">筛选搜索</span>
<el-button
style="float: right"
@click="searchBrandList()"
Expand All @@ -23,8 +23,9 @@
</div>
</div>
<div class="operate-container container-frame">
<i class="el-icon-tickets"></i>
操作栏

<i class="el-icon-tickets" style="margin-top: 5px"></i>
<span style="margin-top: 5px">数据列表</span>
<el-button
@click="addBrand()"
size="mini">
Expand Down Expand Up @@ -77,21 +78,21 @@
<el-button
size="mini"
type="text"
@click="handleProductList(scope.$index, scope.row)">100
@click="getProductList(scope.$index, scope.row)">100
</el-button>
<span>评价:</span>
<el-button
size="mini"
type="text"
@click="handleProductCommentList(scope.$index, scope.row)">1000
@click="getProductCommentList(scope.$index, scope.row)">1000
</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="220" align="center">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleEdit(scope.$index, scope.row)">编辑
@click="handleUpdate(scope.$index, scope.row)">编辑
</el-button>
<el-button
size="mini"
Expand Down Expand Up @@ -181,7 +182,7 @@
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleEdit(index, row) {
handleUpdate(index, row) {
this.$router.push({path: '/pms/updateBrand',query:{id:row.id}})
},
handleDelete(index, row) {
Expand All @@ -193,26 +194,28 @@
deleteBrand(row.id).then(response=>{
this.$message({
message: '删除成功',
type: 'success'
type: 'success',
duration:1000
});
this.getList();
});
});
},
handleProductList(index, row) {
getProductList(index, row) {
console.log(index, row);
},
handleProductCommentList(index, row) {
getProductCommentList(index, row) {
console.log(index, row);
},
handleFactoryStatusChange(index, row) {
var data = new FormData();
var data = new URLSearchParams();
data.append("ids",row.id);
data.append("factoryStatus",row.factoryStatus);
updateFactoryStatus(data).then(response => {
this.$message({
message: '修改成功',
type: 'success'
type: 'success',
duration:1000
});
}).catch(error => {
if (row.factoryStatus === 0) {
Expand All @@ -229,7 +232,8 @@
updateShowStatus(data).then(response => {
this.$message({
message: '修改成功',
type: 'success'
type: 'success',
duration:1000
});
}).catch(error => {
if (row.showStatus === 0) {
Expand Down Expand Up @@ -267,7 +271,8 @@
}else{
this.$message({
message: '请选择批量操作类型',
type: 'warning'
type: 'warning',
duration:1000
});
return;
}
Expand All @@ -282,7 +287,8 @@
this.getList();
this.$message({
message: '修改成功',
type: 'success'
type: 'success',
duration:1000
});
});
},
Expand Down
4 changes: 2 additions & 2 deletions src/views/pms/brand/update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<brand-detail :is-edit='true'></brand-detail>
</template>
<script>
import brandDetail from './components/brandDetail'
import BrandDetail from './components/BrandDetail'
export default {
name: 'updateBrand',
components: { brandDetail }
components: { BrandDetail }
}
</script>
<style>
Expand Down
Loading

0 comments on commit d444433

Please sign in to comment.