Commit 26748a6d by zhaoyifan

Initial commit

parents
> 1%
last 2 versions
not dead
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# yunteng-2
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "yunteng-2",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"core-js": "^3.6.5",
"element-ui": "^2.4.5",
"less-loader": "^10.0.1",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"wangeditor": "^4.7.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"axios": "^0.18.0",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.2",
"vue-cli-plugin-axios": "0.0.4",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.11"
}
}
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<style>
html,body{
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'app',
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
height: 100%;
}
</style>
import _axios from "@/plugins/axios";
export const loginPost = (data) => {
return _axios({
url:'/user/login',
method:'post',
data
})
}
export const homePicGet = (params) => {
return _axios({
url:'/home-picture/showHomePicture',
method:'get',
params
})
}
export const chipClassGet = (params) =>{
return _axios({
url:'/chip-classify/showClassify',
method:'get',
params
})
}
export const chipPost = (data) =>{
return _axios({
url:'/chip/showChipList',
method:'post',
data
})
}
export const moduleGet = (params) =>{
return _axios({
url:'/module/showModuleAll',
method:'get',
params
})
}
export const modulePicGet = (data) =>{
return _axios({
url:'/module-picture/showModulePicture',
method:'post',
data
})
}
export const moduleIntroGet =(params) =>{
return _axios({
url:'/module-statement/showStatementAll',
method:'get',
params
})
}
export const uploadHomePic =(formData) =>{
return _axios({
url:'/home-picture/addHomePicture',
method: "post",
data: formData,
})
}
export const uploadChipPic =(formData) =>{
return _axios({
url:'/chip/addChipPicture',
method: "post",
data: formData,
})
}
export const uploadModulePic =(formData) =>{
return _axios({
url:'/module/addModulePicture',
method: "post",
data: formData,
})
}
export const delHomePic =(params) =>{
// console.log(data);
return _axios({
url:'/home-picture/deleteHomePicture',
method:'post',
params
})
}
export const addChip =(data) =>{
return _axios({
url:'/chip/addChip',
method:'post',
data
})
}
export const delChip =(params) =>{
// console.log(data);
return _axios({
url:'/chip//deletedChip',
method:'delete',
params
})
}
export const addModule =(data) =>{
return _axios({
url:'/module/addModule',
method:'post',
data
})
}
export const delModule =(params) =>{
return _axios({
url:'/module/deleteModule',
method:'delete',
params
})
}
export const addModulePic =(data) =>{
return _axios({
url:'/module-picture/addModulePictureContent',
method:'post',
data
})
}
export const deletedModulePicture =(params) =>{
return _axios({
url:'/module-picture/deletedModulePicture',
method:'delete',
params
})
}
export const addModuleIntro =(data) =>{
return _axios({
url:'/module-statement/addStatement',
method:'post',
data
})
}
export const editModuleIntro =(data) =>{
return _axios({
url:'/module-statement/updateStatement',
method:'post',
data
})
}
\ No newline at end of file
/* 全局样式表 */
html, body, #app{
height: 100%;
margin: 0;
padding: 0;
min-width: 1366px;
font-size: 16px;
}
.el-breadcrumb{
margin-bottom: 15px;
font-size: 16px;
}
.el-card{
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) !important;
}
.el-table{
margin-top: 15px;
font-size: 16px;
}
.el-pagination{
margin-top: 15px;
}
.el-cascader-panel{
height: 300px;
}
\ No newline at end of file
<template>
<div>
<!-- 面包屑导航区 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item >首页</el-breadcrumb-item>
<el-breadcrumb-item>芯片管理</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="box-card">
<el-row>
<el-col>
<el-button type="primary" @click="addDialogVisible = true">添加芯片</el-button>
</el-col>
</el-row>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="chipclass in chipclassList" :key="chipclass.index"
:label="chipclass.classifyName" :name="chipclass.classifyId" >
<el-table :data="chiplist" border stripe>
<el-table-column label="#" type="index"></el-table-column>
<el-table-column label="芯片名称" prop="chipName" width="130px" align="center"></el-table-column>
<el-table-column label="芯片图片" align="center" width="130px">
<template slot-scope="scope">
<el-image style="width: 30px; height: 30px" :src="scope.row.chipPictureUrl" :preview-src-list="[scope.row.chipPictureUrl]">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="芯片介绍" prop="chipIntroduce"></el-table-column>
<el-table-column label="官网介绍" width="130px" align="center">
<template slot-scope="scope">
<el-link :href="scope.row.chipIntroduceUrl" type="primary" target="_blank">{{scope.row.chipName}}</el-link>
</template>
</el-table-column>
<el-table-column label="操作" width="230px" align="center">
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" @click="removeChipById(scope.row.chipId)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-dialog title="添加用户" :visible.sync="addDialogVisible" width="50%" @close="addDialogClosed">
<!-- 添加用户表单 -->
<el-form :model="addForm" :rules="addFormRules"
ref="addFormRef" label-width="70px">
<el-form-item label="芯片名称" prop="chipName">
<el-input v-model="addForm.chipName"></el-input>
</el-form-item>
<el-form-item label="芯片图片" prop="chipPicture">
<el-upload
class="upload-demo"
action
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-change="handleChange"
:on-success="getPicUrl"
:http-request="getPicUrl"
:limit="1"
:file-list="fileList"
list-type="picture">
<el-button type="primary">点我上传</el-button>
</el-upload>
</el-form-item>
<el-form-item label="芯片介绍" prop="chipIntroduce">
<el-input v-model="addForm.chipIntroduce"></el-input>
</el-form-item>
<el-form-item label="介绍链接" prop="getChipIntroduceUrl">
<el-input v-model="addForm.getChipIntroduceUrl"></el-input>
</el-form-item>
</el-form>
<!-- 对话框底部按钮 -->
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addUser">确 定</el-button>
</span>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {chipClassGet, chipPost, uploadChipPic,addChip,delChip} from '@/api/api.js'
export default {
data() {
return {
activeName:'1',
chipclassList:[],
classfyId:'1',
chiplist:[],
fileList:[],
formPicUrl:'',
addDialogVisible: false,
addForm: {
classifyId:'',
chipName:'',
chipPictureUrl: '',
chipIntroduce: '',
getChipIntroduceUrl: '',
},
};
},
created() {
this.getChipList()
},
methods: {
getChipList() {
chipClassGet().then(res =>{
const resData = res.data
if(resData.code !== 200) return this.$message.error('获取分类列表失败!')
this.chipclassList = resData.data
this.handleClick()
})
},
handleClick(){
chipPost({classifyId:this.activeName}).then( res =>{
const resData = res.data
if(resData.code !== 200) return this.$message.error('获取芯片列表失败!')
this.chiplist = resData.data
})
this.addForm.classifyId = this.activeName
},
getPicUrl(){
console.log(this.fileList[0])
let data = this.fileList[0].raw;
let formData = new FormData();
formData.append('multipartFile',data);
uploadChipPic(formData).then(res=>{
console.log(res);
const resData = res.data
if(resData.code !== 200) return this.$message.error('图片上传失败!')
this.addForm.chipPictureUrl = resData.data
// console.log(this.addForm.chipPictureUrl)
})
},
handleChange(file,fileList){
this.fileList = fileList;
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
addDialogClosed(){
this.$refs.addFormRef.resetFields();
},
addUser(){
// console.log(this.addForm);
addChip(this.addForm).then(res=>{
const resData = res.data
// console.log(resData);
if(resData.code !== 200) return this.$message.error('添加失败!')
this.$message.success('添加成功!')
this.addDialogVisible = false
this.getChipList()
})
},
async removeChipById(id){
// console.log(id);
const confirmResult = await this.$confirm('此操作将永久删除该芯片, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(err => err)
if(confirmResult !== 'confirm') return this.$message.info('已取消删除操作')
//确定删除发起请求
delChip({chipId:id}).then(res=>{
// console.log(id);
// console.log(res);
if(res.data.code !== 200) return this.$message.error('删除失败!')
this.$message.success('删除成功!')
this.getChipList()
})
}
},
};
</script>
<style scoped>
.el-tabs{
margin-top: 20px;
}
.uploadInput{
border-radius: none;
border: none;
}
</style>
\ No newline at end of file
<template>
<el-container class="home-container">
<!-- 头部区域 -->
<el-header>
<div>
<span>龙芯展厅后台管理系统</span>
</div>
<el-button type="info" @click="loginout">退出</el-button></el-header
>
<!-- 页面主体区域 -->
<el-container>
<!-- 侧边栏 -->
<el-aside width="200px">
<el-menu background-color="#333744" text-color="#fff"
active-text-color="#409eff" unique-opened router :default-active="activePath">
<!-- 一级菜单 -->
<el-menu-item :index="'/' + item.path" v-for="item in menulist"
:key="item.id" @click="saveNavState('/' + item.path)">
<!-- 一级菜单的模板区域 -->
<template slot="title">
<span class="asideText">{{item.authName}}</span>
</template>
</el-menu-item>
</el-menu>
</el-aside>
<!-- 右侧内容主体 -->
<el-main>
<!-- 路由占位符 -->
<router-view>
</router-view>
</el-main>
</el-container>
</el-container>
</template>
<script>
export default {
data(){
return{
//左侧菜单
menulist:[
{
authName:'首页轮播图管理',
path:'homepic'
},
{
authName:'芯片管理',
path:'chip'
},
{
authName:'展区分类管理',
path:'showclass'
},
{
authName:'展品管理',
path:'showpic'
},
{
authName:'展区一角',
path:'showcorner'
},
{
authName:'展区详情页管理',
path:'showhtml'
}
],
activePath:''
}
},
mounted(){
this.activePath = window.sessionStorage.getItem('activePath')
},
methods:{
loginout(){
window.sessionStorage.clear();
this.$router.push("/login");
},
saveNavState(activePath){
this.activePath = activePath;
window.sessionStorage.setItem('activePath',activePath);
},
}
}
</script>
<style scoped>
.home-container {
height: 100%;
}
.el-header {
background-color: #373d41;
display: flex;
justify-content: space-between;
padding-left: 0;
align-items: center;
color: #fff;
font-size: 20px;
}
.el-header> div {
display: flex;
align-items: center;
}
.el-header> div span {
margin-left: 15px;
}
.el-aside {
background-color: #333744;
}
.el-aside .el-menu{
border-right-width: 0px;
text-align: center;
}
.asideText{
font-size: 16px;
color: #fff;
}
.el-main {
background-color: #eaedf1;
}
.toggle-button{
background-color: #4a5064;
color: #fff;
font-size: 10px;
line-height: 24px;
text-align: center;
letter-spacing: 0.2em;
cursor: pointer;
}
</style>
\ No newline at end of file
<template>
<div>
<!-- 面包屑导航区 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item >首页</el-breadcrumb-item>
<el-breadcrumb-item>轮播图管理</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="box-card">
<el-row>
<el-col>
<el-button type="primary" @click="addDialogVisible = true">添加图片</el-button>
</el-col>
</el-row>
<!-- 表格区域 -->
<el-table :data="piclist" border stripe >
<el-table-column label="#" type="index"></el-table-column>
<el-table-column label="首页轮播图" align="center">
<template slot-scope="scope">
<el-image style="width: 220px; height: 130px" :src="scope.row.homePictureUrl" :preview-src-list="[scope.row.homePictureUrl]">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="操作" width="200px" align="center">
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" @click="removePicById(scope.row.homePictureId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="添加图片" :visible.sync="addDialogVisible" width="50%" @close="addDialogClosed">
<el-upload
class="upload-demo"
action
ref="upload"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-success="uploadSuccess"
:on-change="handleChange"
:file-list="fileList"
:auto-upload="false"
:before-remove="beforeRemove"
:limit="1"
list-type="picture"
>
<el-button slot="trigger" type="primary">选取文件</el-button>
<el-button style="margin-left: 20px" type="success" @click="submitUpload">确定上传</el-button>
</el-upload>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {homePicGet,uploadHomePic,delHomePic} from '@/api/api.js'
export default {
data() {
return {
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
piclist: [],
fileList:[],
doUpload:'#',
addDialogVisible: false,
};
},
created() {
this.getPic()
},
methods: {
getPic(){
homePicGet().then(res=>{
const resData = res.data
if(resData.code !== 200) return this.$message.error('图片列表获取失败')
this.piclist = resData.data
})
},
beforeUpload(){
return false
},
addDialogClosed(){
this.$refs.upload.abort();
this.$refs.upload.clearFiles();
},
handleChange(file,fileList){
this.fileList = fileList;
console.log(fileList);
console.log(this.fileList)
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
},
submitUpload(){
console.log(this.fileList[0])
let data = this.fileList[0].raw;
let formData = new FormData();
formData.append('multipartFile',data);
uploadHomePic(formData).then(res=>{
console.log(res);
const resData = res.data
if(resData.code !== 200) return this.$message.error('添加失败!')
this.$message.success('添加成功')
this.addDialogVisible = false
this.getPic()
})
},
uploadSuccess(res){
this.addDialogVisible = false
console.log(res);
},
uploadError(){
this.$message.error('上传失败!')
},
async removePicById(id){
console.log(id);
const confirmResult = await this.$confirm('此操作将永久删除该图片, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(err => err)
if(confirmResult !== 'confirm') return this.$message.info('已取消删除操作')
//确定删除发起请求
delHomePic({homePictureId:id}).then(res=>{
// console.log(id);
// console.log(res);
if(res.data.code !== 200) return this.$message.error('删除失败!')
this.$message.success('删除成功!')
this.getPic()
})
}
},
};
</script>
<template>
<div>
<!-- 面包屑导航区 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item >首页</el-breadcrumb-item>
<el-breadcrumb-item>展区分类管理</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="box-card">
<el-row>
<el-col>
<el-button type="primary" @click="addDialogVisible = true">添加展区</el-button>
</el-col>
</el-row>
<el-table :data="modulelist" border stripe>
<el-table-column label="#" type="index"></el-table-column>
<el-table-column label="展区名称" prop="moduleName" width="230px" align="center"></el-table-column>
<el-table-column label="展区图片" align="center" >
<template slot-scope="scope">
<el-image style="width: 480px; height: 100px" :src="scope.row.modulePictureUrl" :preview-src-list="[scope.row.modulePictureUrl]">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="操作" width="230px" align="center">
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" @click="removeClassById(scope.row.moduleId)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="添加展区" :visible.sync="addDialogVisible" width="50%" @close="addDialogClosed">
<!-- 添加用户表单 -->
<el-form :model="addForm"
ref="addFormRef" label-width="70px">
<el-form-item label="展区名称" prop="moduleName">
<el-input v-model="addForm.moduleName"></el-input>
</el-form-item>
<el-form-item label="展区图片" prop="modulePictureUrl">
<el-upload
class="upload-demo"
action
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-change="handleChange"
:http-request="getPicUrl"
:limit="1"
:file-list="fileList"
list-type="picture">
<el-button type="primary">点我上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<!-- 对话框底部按钮 -->
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addClass">确 定</el-button>
</span>
</el-dialog>
</el-card>
</div>
</template>
<script>
import { moduleGet,uploadModulePic,addModule,delModule } from '@/api/api.js'
export default {
data() {
return {
activeName:'1',
modulelist:[],
fileList:[],
//控制添加用户对话框的显示与隐藏(默认隐藏)
addDialogVisible: false,
//添加用户表单的数据对象
addForm: {
moduleName: '',
modulePictureUrl: ''
},
};
},
created() {
this.getModulelist();
},
methods: {
getModulelist() {
moduleGet().then(res => {
const resData = res.data
if (resData.code !== 200)
return this.$message.error("获取分类列表失败!");
this.modulelist = resData.data
console.log(this.modulelist);
})
},
handleChange(file,fileList){
this.fileList = fileList;
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
addDialogClosed(){
this.$refs.addFormRef.resetFields();
},
getPicUrl(){
console.log(this.fileList[0])
let data = this.fileList[0].raw;
let formData = new FormData();
formData.append('multipartFile',data);
uploadModulePic(formData).then(res=>{
console.log(res);
const resData = res.data
if(resData.code !== 200) return this.$message.error('图片上传失败!')
this.addForm.modulePictureUrl = resData.data
// console.log(this.addForm.chipPictureUrl)
})
},
addClass(){
console.log(this.fileList[0])
let data = this.fileList[0].raw;
let formData = new FormData();
formData.append('multipartFile',data);
uploadModulePic(formData).then(res=>{
console.log(res);
const resData = res.data
if(resData.code !== 200) return this.$message.error('图片上传失败!')
this.addForm.modulePictureUrl = resData.data
addModule(this.addForm).then(res=>{
const resData = res.data
console.log(resData);
if(resData.code !== 200) return this.$message.error('添加失败!')
this.$message.success('添加成功!')
this.addDialogVisible = false
this.getModulelist()
})
})
},
async removeClassById(id){
// console.log(id);
const confirmResult = await this.$confirm('此操作将永久删除该芯片, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(err => err)
if(confirmResult !== 'confirm') return this.$message.info('已取消删除操作')
//确定删除发起请求
delModule({moduleId:id}).then(res=>{
if(res.data.code !== 200) return this.$message.error('删除失败!')
this.$message.success('删除成功!')
this.getModulelist()
})
}
},
};
</script>
<style scoped>
.el-tabs{
margin-top: 20px;
}
</style>
\ No newline at end of file
<template>
<div>
<!-- 面包屑导航区 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item >首页</el-breadcrumb-item>
<el-breadcrumb-item>展区一角</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="box-card">
<el-row>
<el-col>
<el-button type="primary" @click="addDialogVisible = true">添加图片</el-button>
</el-col>
</el-row>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="moduleitem in modulelist" :key="moduleitem.index"
:label="moduleitem.moduleName" :name="moduleitem.moduleId">
<el-table :data="modulePicList" border stripe>
<el-table-column label="#" type="index"></el-table-column>
<el-table-column label="展区一角" align="center">
<template slot-scope="scope">
<el-image style="width: 220px; height: 130px" :src="scope.row.modulePictureUrl" :preview-src-list="[scope.row.modulePictureUrl]">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="操作" width="230px" align="center">
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" @click="removeCornorById(scope.row.modulePictureId)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-dialog title="添加图片" :visible.sync="addDialogVisible" width="50%" @close="addDialogClosed">
<!-- 添加用户表单 -->
<el-form :model="addForm"
ref="addFormRef" label-width="70px">
<el-form-item label="展区图片" prop="modulePictureUrl">
<el-upload
class="upload-demo"
action
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-change="handleChange"
:auto-upload="false"
:limit="1"
:file-list="fileList"
list-type="picture">
<el-button type="primary">点我上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addPic">确 定</el-button>
</span>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {modulePicGet,uploadModulePic, moduleGet,addModulePic,deletedModulePicture} from '@/api/api.js'
export default {
data() {
return {
modulelist:[],
activeName:'1',
fileList:[],
modulePicList:[],
addDialogVisible: false,
addForm: {
moduleId: '',
modulePictureUrl: '',
judgeExhibits: 1,
},
};
},
created() {
this.getModulelist();
},
methods: {
getModulelist(){
moduleGet().then(res => {
const resData = res.data
if (resData.code !== 200)
return this.$message.error("获取分类列表失败!");
this.modulelist = resData.data
// console.log(this.modulelist);
})
this.handleClick()
},
handleClick(){
this.addForm.moduleId = this.activeName
modulePicGet({moduleId:this.activeName,judgeExhibits:1}).then(res => {
const resData = res.data
if(resData.code !== 200) return this.$message.error('获取图片列表失败!')
this.modulePicList = resData.data
// console.log(this.modulePicList);
})
},
handleChange(file,fileList){
this.fileList = fileList;
// console.log(this.fileList);
},
beforeUpload(){
return false
},
addDialogClosed(){
this.$refs.addFormRef.resetFields();
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
},
addPic(){
console.log(this.fileList[0])
let data = this.fileList[0].raw;
let formData = new FormData();
formData.append('multipartFile',data);
uploadModulePic(formData).then(res=>{
console.log(res);
const resData = res.data
if(resData.code !== 200) return this.$message.error('图片上传失败!')
this.addForm.modulePictureUrl = resData.data
addModulePic(this.addForm).then(res=>{
const resData = res.data
console.log(resData);
if(resData.code !== 200) return this.$message.error('添加失败!')
this.$message.success('添加成功!')
this.addDialogVisible = false
this.getModulelist()
})
})
},
async removeCornorById(id){
// console.log(id);
const confirmResult = await this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(err => err)
if(confirmResult !== 'confirm') return this.$message.info('已取消删除操作')
deletedModulePicture({modulePictureId:id}).then(res=>{
if(res.data.code !== 200) return this.$message.error('删除失败!')
this.$message.success('删除成功!')
this.getModulelist()
})
},
},
};
</script>
<style scoped>
.el-tabs{
margin-top: 20px;
}
</style>
\ No newline at end of file
<template>
<div>
<!-- 面包屑导航区 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item >首页</el-breadcrumb-item>
<el-breadcrumb-item>展区详情页管理</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="box-card">
<el-row>
<el-col>
<el-button type="primary" @click="addDialogVisible = true">添加介绍</el-button>
</el-col>
</el-row>
<el-table :data="moduleClasslist" border stripe>
<el-table-column label="#" type="index"></el-table-column>
<el-table-column label="展区名称" prop="moduleName" width="230px" align="center">
</el-table-column>
<el-table-column label="展区介绍" prop="moduleId" :formatter="formatname"></el-table-column>
<el-table-column label="操作" width="230px" align="center">
<template slot-scope="scope">
<el-button type="primary" icon="el-icon-edit" @click="showEditDialog(scope.row.moduleId)">编辑</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog title="添加展区" :visible.sync="addDialogVisible" width="50%" @close="addDialogClosed">
<!-- 添加用户表单 -->
<el-form :model="addForm"
ref="addFormRef" label-width="70px">
<el-form-item label="展区名称" prop="moduleName">
<el-input v-model="addForm.moduleName"></el-input>
</el-form-item>
<el-form-item label="展区介绍" prop="moduleIntroduce">
<el-input v-model="addForm.moduleIntroduce"></el-input>
</el-form-item>
</el-form>
<!-- 对话框底部按钮 -->
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addHtml">确 定</el-button>
</span>
</el-dialog>
<!-- 修改对话框 -->
<el-dialog title="修改用户" :visible.sync="editDialogVisible" width="50%" @close="editDialogClosed">
<!-- 修改用户表单 -->
<el-form :model="editForm"
ref="editFormRef" label-width="70px">
<el-form-item label="展区名称">
<el-input v-model="editForm.moduleName" disabled></el-input>
</el-form-item>
<el-form-item label="展区介绍" prop="email">
<el-input v-model="editForm.moduleIntroduce" type="textarea"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="editIntro">确 定</el-button>
</span>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {moduleIntroGet,moduleGet,addModuleIntro,editModuleIntro} from '@/api/api.js'
export default {
data() {
return {
activeName:'1',
modulelist:[],
moduleClasslist:[],
addDialogVisible: false,
editDialogVisible:false,
haveIntro:false,
addForm: {
moduleId: '',
moduleName:'',
moduleIntroduce: '',
},
editForm: {
moduleId:'',
moduleName:'',
moduleIntroduce:''
},
};
},
created() {
this.getModuleIntro();
this.getModulelist();
},
methods: {
getModulelist() {
moduleGet().then(res => {
const resData = res.data
if (resData.code !== 200)
return this.$message.error("获取分类列表失败!");
this.moduleClasslist = resData.data
// console.log(this.moduleClasslist);
})
},
getModuleIntro(){
moduleIntroGet().then(res =>{
const resData = res.data
if(resData.code !== 200) return this.$message.error('获取展区介绍失败!')
this.modulelist = resData.data
// console.log(this.modulelist);
})
},
formatname(row, column){
const id = row[column.property]
for (let i = 0; i < this.modulelist.length; i++) {
if( id === this.modulelist[i].moduleId){
// console.log('id相等'+id);
return this.modulelist[i].statementIntroduce
}
}
},
addDialogClosed(){
this.$refs.addFormRef.resetFields();
},
addHtml(){
for (let i = 0; i < this.moduleClasslist.length; i++) {
// const element = moduleClasslist[i];
if(this.addForm.moduleName === this.moduleClasslist[i].moduleName){
this.addForm.moduleId = this.moduleClasslist[i].moduleId
}
}
// moduleId:this.addForm.moduleId,moduleIntroduce:this.addForm.moduleIntroduce
addModuleIntro(this.addForm).then(res =>{
const resData = res.data
console.log(resData);
if(resData.code == 0) return this.$message.error('添加失败,该展区介绍已存在!')
else if(resData.code == 2000) return this.$message.error('添加失败,展区名称或图片不能为空!')
else if(resData.code == 200) {
this.addDialogVisible = false
this.getModulelist()
this.getModuleIntro()
return this.$message.success('添加成功!')
}
else return this.$message.error('添加失败!')
})
},
async showEditDialog(id){
this.haveIntro = false
for (let i = 0; i < this.moduleClasslist.length; i++) {
// const element = moduleClasslist[i];
if(id === this.moduleClasslist[i].moduleId){
this.editForm.moduleId = this.moduleClasslist[i].moduleId
this.editForm.moduleName = this.moduleClasslist[i].moduleName
}
}
for (let i = 0; i < this.modulelist.length; i++) {
// const element = moduleClasslist[i];
if(id === this.modulelist[i].moduleId){
this.editForm.moduleIntroduce = this.modulelist[i].statementIntroduce
this.haveIntro = true
}
}
if(!this.haveIntro){
this.editForm.moduleIntroduce = ''
}
// console.log(this.editForm);
this.editDialogVisible = true
},
editDialogClosed(){
this.$refs.editFormRef.resetFields()
},
editIntro(){
editModuleIntro(this.editForm).then(res =>{
const resData = res.data
console.log(resData);
if(resData.code !== 200) return this.$message.error('更新失败')
this.editDialogVisible = false
this.$message.success('更新成功!')
this.getModulelist()
this.getModuleIntro()
})
},
},
};
</script>
<style scoped>
.el-tabs{
margin-top: 20px;
}
</style>
\ No newline at end of file
<template>
<div>
<!-- 面包屑导航区 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item >首页</el-breadcrumb-item>
<el-breadcrumb-item>展品管理</el-breadcrumb-item>
</el-breadcrumb>
<el-card class="box-card">
<el-row>
<el-col>
<el-button type="primary" @click="addDialogVisible = true">添加展品图片</el-button>
</el-col>
</el-row>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="moduleitem in modulelist" :key="moduleitem.index"
:label="moduleitem.moduleName" :name="moduleitem.moduleId">
<el-table :data="modulePicList" border stripe>
<el-table-column label="#" type="index"></el-table-column>
<el-table-column label="展品图片" align="center">
<template slot-scope="scope">
<el-image style="width: 220px; height: 130px" :src="scope.row.modulePictureUrl" :preview-src-list="[scope.row.modulePictureUrl]">
<div slot="error" class="image-slot">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</template>
</el-table-column>
<el-table-column label="操作" width="230px" align="center">
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" @click="removePicById(scope.row.modulePictureId)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<el-dialog title="添加图片" :visible.sync="addDialogVisible" width="50%" @close="addDialogClosed">
<el-form :model="addForm"
ref="addFormRef" label-width="70px">
<el-form-item label="展品图片" prop="modulePictureUrl">
<el-upload
class="upload-demo"
action
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-change="handleChange"
:auto-upload="false"
:limit="1"
:file-list="fileList"
ref="uploadPic"
list-type="picture">
<el-button type="primary">点我上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addPic">确 定</el-button>
</span>
</el-dialog>
</el-card>
</div>
</template>
<script>
import {modulePicGet,uploadModulePic, moduleGet,addModulePic,deletedModulePicture} from '@/api/api.js'
export default {
data() {
return {
modulelist:[],
activeName:'1',
fileList:[],
modulePicList:[],
addDialogVisible: false,
addForm: {
moduleId: '',
modulePictureUrl: '',
judgeExhibits: 0,
},
};
},
created() {
this.getModulelist();
},
methods: {
getModulelist(){
moduleGet().then(res => {
const resData = res.data
if (resData.code !== 200)
return this.$message.error("获取分类列表失败!");
this.modulelist = resData.data
// console.log(this.modulelist);
})
this.handleClick()
},
handleClick(){
this.addForm.moduleId = this.activeName
modulePicGet({moduleId:this.activeName,judgeExhibits:0}).then(res => {
const resData = res.data
if(resData.code !== 200) return this.$message.error('获取图片列表失败!')
this.modulePicList = resData.data
// console.log(this.modulePicList);
})
},
handleChange(file,fileList){
this.fileList = fileList;
// console.log(this.fileList);
},
beforeUpload(){
return false
},
addDialogClosed(){
this.$refs.uploadPic.clearFiles();
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
},
//对添加用户表单进行预校验
addPic(){
console.log(this.fileList[0])
let data = this.fileList[0].raw;
let formData = new FormData();
formData.append('multipartFile',data);
uploadModulePic(formData).then(res=>{
console.log(res);
const resData = res.data
if(resData.code !== 200) return this.$message.error('图片上传失败!')
this.addForm.modulePictureUrl = resData.data
addModulePic(this.addForm).then(res=>{
const resData = res.data
console.log(resData);
if(resData.code !== 200) return this.$message.error('添加失败!')
this.$message.success('添加成功!')
this.addDialogVisible = false
this.getModulelist()
})
})
},
async removePicById(id){
// console.log(id);
const confirmResult = await this.$confirm('此操作将永久删除该用户, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(err => err)
if(confirmResult !== 'confirm') return this.$message.info('已取消删除操作')
deletedModulePicture({modulePictureId:id}).then(res=>{
if(res.data.code !== 200) return this.$message.error('删除失败!')
this.$message.success('删除成功!')
this.getModulelist()
})
},
},
};
</script>
<style scoped>
.el-tabs{
margin-top: 20px;
}
</style>
\ No newline at end of file
// 占位文件
\ No newline at end of file
<template>
<div class="login-container">
<div class="login-box">
<div class="loginTitle">
<h1>龙芯展厅后台管理系统</h1>
</div>
<el-form :model="loginForm" ref="loginFormRef">
<el-form-item prop="password">
<el-input v-model="loginForm.password" prefix-icon="el-icon-lock" type="password" placeholder="请输入口令"
@keyup.enter.native="login"></el-input>
</el-form-item>
<!-- 按钮区域 -->
<el-form-item class="btns">
<!-- 重要按钮 -->
<el-button type="primary" @click="login">登录</el-button>
<!-- 信息按钮 -->
<el-button type="info" @click="resetLoginForm">重置</el-button>
</el-form-item>
</el-form>
</div>
</div>
</template>
<script>
import {
loginPost,
} from '@/api/api.js'
import axios from 'axios'
export default {
data() {
return {
loginForm: {
password: ''
},
}
},
methods: {
resetLoginForm() {
// console.log(this);
this.$refs.loginFormRef.resetFields();
},
login() {
console.log(this.loginForm.password);
if (!this.loginForm.password) {
this.$message.error('请输入口令')
return
}
let password = this.loginForm.password
console.log(password);
loginPost({
password: this.loginForm.password
}).then(res => {
const resData = res.data
console.log(resData);
if (resData.code !== 200) return this.$message.error('登录失败!')
this.$message.success('登录成功!')
localStorage.setItem('token', resData.data.token)
console.log(resData.data.token);
this.$router.push('/home')
})
}
}
}
</script>
<style scoped>
.login-container {
background-color: #2b4b6b;
height: 100%;
}
.login-box {
text-align: center;
width: 450px;
height: 200px;
background-color: #fff;
border-radius: 3px;
padding: 10px 20px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.login-form {
position: absolute;
width: 100%;
bottom: 0;
padding: 0 20px;
box-sizing: border-box;
}
</style>
\ No newline at end of file
/*
Write your variables here. All available variables can be
found in element-ui/packages/theme-chalk/src/common/var.scss.
For example, to overwrite the theme color:
*/
$--color-primary: #409eff;
/* icon font path, required */
$--font-path: '~element-ui/lib/theme-chalk/fonts';
@import "~element-ui/packages/theme-chalk/src/index";
import Vue from 'vue'
import './plugins/axios'
import App from './App.vue'
import router from './router'
import store from './store'
import './api/api.js'
import './plugins/element.js'
// import './assets/fonts/iconfont.css'
import './assets/css/global.css'
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
// 占位文件
\ No newline at end of file
"use strict";
import Vue from 'vue';
import axios from "axios";
// Full config: https://github.com/axios/axios#request-config
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
let config = {
//baseURL: process.env.baseURL || process.env.apiUrl || "",
baseURL:'http://songsir.natapp1.cc',
timeout: 60 * 1000, // Timeout
//withCredentials: true, // Check cross-site Access-Control
};
const _axios = axios.create(config);
_axios.interceptors.request.use(
function(config) {
const token = localStorage.getItem("token");
if (token) {
// 判断是否存在token,如果存在的话,则每个http header都加上token
config.headers['token'] = token;
config.headers['content-type'] = 'application/json;charset=UTF-8';
}
return config;
},
async function doRequest(error) {
const data = await store.dispatch('refreshToken')
let { token_type: tokenType, access_token: accessToken } = data
let token = tokenType + accessToken
let config = error.response.config
config.headers.Authorization = token
const res = await axios.request(config)
return res
// Do something with request error
// return Promise.reject(error);
}
);
// Add a response interceptor
_axios.interceptors.response.use(
function(response) {
// Do something with response data
return response;
},
function(error) {
// Do something with response error
return Promise.reject(error);
}
);
Plugin.install = function(Vue, options) {
Vue.axios = _axios;
window.axios = _axios;
Object.defineProperties(Vue.prototype, {
axios: {
get() {
return _axios;
}
},
$axios: {
get() {
return _axios;
}
},
});
};
Vue.prototype.$axios = _axios
Vue.use(Plugin)
export default _axios;
import Vue from 'vue'
import Element from 'element-ui'
import '../element-variables.scss'
Vue.use(Element)
import Vue from 'vue'
import Login from '../components/login.vue'
import Home from '../components/Home.vue'
import HomePic from '../components/HomePic.vue'
import Chip from '../components/Chip.vue'
import ShowPic from '../components/ShowPic.vue'
import ShowClass from '../components/ShowClass.vue'
import ShowHtml from '../components/ShowHtml.vue'
import ShowCornor from '../components/ShowCornor.vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{
path: '/',
redirect: '/login'
},
{ path: '/login', component : Login },
{
path: '/home',
component : Home,
redirect:'/homepic',
children:[
{ path:'/homepic',component:HomePic },
{ path:'/chip',component:Chip },
{ path:'/showpic',component:ShowPic },
{ path:'/showcorner',component:ShowCornor},
{ path:'/showclass',component:ShowClass},
{ path:'/showhtml',component:ShowHtml}
]
},
// {
// path: '/about',
// name: 'About',
// // route level code-splitting
// // this generates a separate chunk (about.[hash].js) for this route
// // which is lazy-loaded when the route is visited.
// component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
// }
]
const router = new VueRouter({
routes
})
export default router
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
},
mutations: {
},
actions: {
},
modules: {
}
})
随时删除
随时删除
\ No newline at end of file
> 1%
last 2 versions
not dead
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# yunteng-2
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "yunteng-2",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"core-js": "^3.6.5",
"element-ui": "^2.4.5",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"axios": "^0.18.0",
"node-sass": "^4.12.0",
"sass-loader": "^8.0.2",
"vue-cli-plugin-axios": "0.0.4",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.11"
}
}
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<router-view></router-view>
</div>
</template>
<script>
export default {
name: 'app',
}
</script>
<style>
#app {
background-color: #F5F6F8;
}
</style>
// 占位文件
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment