Commit 79c7caed authored by wangwei's avatar wangwei

Merge remote-tracking branch 'origin/development' into development

parents ace92b79 5a7948bf
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=https://at.alicdn.com/t/font_746649_7dsnjecwkpg.css><title>singsing-new-admin</title><link href=/static/css/app.cb4ed962bfb554c8172f74d18c64eb5e.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.0856e2556bbad7b42ae6.js></script><script type=text/javascript src=/static/js/app.c509c1f15d89ea15e21f.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=referrer content=never><link rel=stylesheet href=https://at.alicdn.com/t/font_746649_7dsnjecwkpg.css><title>singsing-new-admin</title><link href=/static/css/app.53b0153abe0bfe1811cfe0c96b7da792.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.7b0c00ae9aa9f10c274f.js></script><script type=text/javascript src=/static/js/app.bd765625c6f1f494153f.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"version":3,"sources":["webpack:///webpack/bootstrap d04949ba744a9a2d2c48"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","config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sB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d04949ba744a9a2d2c48"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap 363de0f511c282952645"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,O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Function = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 363de0f511c282952645"],"sourceRoot":""}
\ No newline at end of file
......@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="referrer" content="never">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_746649_7dsnjecwkpg.css">
<title>singsing-new-admin</title>
</head>
......
<template>
<div class="head-index">
<img class="logo" :src="iconUrl"/>{{$store.state.userName}}
<img class="logo" :src="iconUrl" @click="toHome"/>{{$store.state.userName}}
<div class="fl-r">
<el-button round size="mini" @click="logOut">退出登录</el-button>
</div>
......@@ -33,6 +33,9 @@
}).catch(() => {
});
},
toHome(){
this.$router.push({name:'first'})
}
}
}
......
......@@ -12,7 +12,7 @@
</transition>
<div class="content">
<div class="router-block">
<tab/>
<!--<tab/>-->
<transition name="el-fade-in-linear">
<keep-alive>
<router-view class="child-view" v-loading="$store.state.mainLoad"/>
......@@ -67,7 +67,7 @@
position: relative;
.child-view{
position: absolute;
top: 42px;
top: 0;
height: auto;
left: 0;
bottom:0;
......
......@@ -6,8 +6,8 @@
:visible.sync="dialogObj.show"
width="800px">
<div v-loading="loading">
<el-form ref="form" :model="form" label-width="120px">
<el-form-item label="课程标题">
<el-form ref="form" :model="form" label-width="120px" :rules="rules">
<el-form-item label="课程标题" prop="title">
<el-input v-model="form.title"></el-input>
</el-form-item>
<el-form-item label="课程封面">
......@@ -29,46 +29,58 @@
<el-option label="日课" :value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择课程">
<el-cascader
:value="selectedLesson"
:options="showLessonList"
:show-all-levels="false"
@active-item-change="changLessonItem"
@change="selectLesson"
:props="{label: 'name',value:'id',children:'children'}"
></el-cascader>
</el-form-item>
<el-form-item label="已选课程">
<el-row>
<el-col :span="12" class="selected-block" v-for="data in selectedLessonList" :key="data.id">
<el-card shadow="always">
{{data.name}}
<el-button type="danger" icon="el-icon-close" @click="delLesson(data)" circle size="mini" style="float: right;padding: 3px"></el-button>
</el-card>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="选择盒子">
<el-cascader
:value="selectedBox"
:options="showBoxList"
:show-all-levels="false"
@change="selectBox"
expand-trigger="hover"
:props="{label: 'name',value:'id',children:'children'}"
></el-cascader>
</el-form-item>
<el-form-item label="已选盒子">
<el-row>
<el-col :span="12" class="selected-block" v-for="data in selectedBoxList" :key="data.id">
<el-card shadow="always">
{{data.name}}
<el-button type="danger" icon="el-icon-close" @click="delBox(data)" circle size="mini" style="float: right;padding: 3px"></el-button>
</el-card>
</el-col>
</el-row>
</el-form-item>
<el-row>
<el-col :span="10">
<el-form-item label="选择课程">
<el-cascader
clearable
:value="selectedLesson"
:options="showLessonList"
:show-all-levels="false"
@active-item-change="changLessonItem"
@change="selectLesson"
:props="{label: 'name',value:'id',children:'children'}"
></el-cascader>
</el-form-item>
<el-form-item label="已选课程">
<div class="selected-block" v-for="(data, index) in selectedLessonList" :key="index">
<el-card shadow="always">
{{data.name}}
<el-button type="danger" icon="el-icon-close" @click="delLesson(data)" circle size="mini" style="float: right;padding: 3px"></el-button>
<div class="move">
<el-button type="text" class="button" v-if="index !== 0" @click="moveItem(index-1,index)">上移</el-button>
<el-button type="text" class="button" v-if="index !== selectedLessonList.length - 1" @click="moveItem(index,index+1)">下移</el-button>
</div>
</el-card>
</div>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="选择盒子">
<el-cascader
clearable
:value="selectedBox"
:options="showBoxList"
:show-all-levels="false"
@change="selectBox"
expand-trigger="hover"
:props="{label: 'name',value:'id',children:'children'}"
></el-cascader>
</el-form-item>
<el-form-item label="已选盒子">
<div class="selected-block" v-for="(data,index) in selectedBoxList" :key="data.id">
<el-card shadow="always">
{{data.name}}
<el-button type="danger" icon="el-icon-close" @click="delBox(data)" circle size="mini" style="float: right;padding: 3px"></el-button>
<div class="move">
<el-button type="text" class="button" v-if="index !== 0" @click="moveBox(index-1, index)">上移</el-button>
<el-button type="text" class="button" v-if="index !== selectedBoxList.length - 1" @click="moveBox(index, index+1)">下移</el-button>
</div>
</el-card>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer" v-if="dialogObj.type !== 2">
<el-button @click="dialogObj.show = false">取 消</el-button>
......@@ -106,6 +118,11 @@
item_category_ids:[],
cover:0,
},
rules:{
title:[
{ required: true, message: '请输入课程标题', trigger: 'change' }
]
}
}
},
methods:{
......@@ -115,6 +132,7 @@
changLessonItem(){
if(this.form.type === 0){
this.showLessonList.forEach(a=>{
a.children = a.children || [];
a.children.forEach(b=>{
if(b.children){
delete b.children
......@@ -137,7 +155,11 @@
},
selectLesson(data){
let select = this.showLessonList.find(i=>{return i.id === data[0]});
select = select.children.find(i=>{return i.id === data[1]});
if (select.children) {
select = select.children.find(i=>{return i.id === data[1]});
} else {
return
}
if(data.length === 3)select = select.children.find(i=>{return i.id === data[2]});
let index = this.selectedLessonList.findIndex(val => val === select);
if (index === -1){
......@@ -163,18 +185,44 @@
},
sub(){
this.selectedBoxList.forEach(i=>{this.form.item_category_ids.push(i.id)});
this.selectedLessonList.forEach(i=>{this.form.text_category_ids.push(i.id)});
this.form.text_category_ids = this.form.text_category_ids.toString();
if(this.imageList[0]){
this.form.cover = this.imageList[0].name;
}
this.form.item_category_ids = this.form.item_category_ids.toString();
switch(this.dialogObj.type){
case 1:
// this.$refs['form'].validate((valid) => {
// if(valid){
editLessonApi(this.dialogObj.id,this.form).then(res=>{
this.$refs['form'].validate((valid) => {
let itemIds = [];
let textIds = [];
this.selectedBoxList.forEach(i=>{itemIds.push(i.id)});
this.selectedLessonList.forEach(i=>{textIds.push(i.id)});
if(this.imageList[0]){
this.form.cover = this.imageList[0].name;
}
let json = this.form;
json.item_category_ids = itemIds.toString();
json.text_category_ids = textIds.toString();
if(valid){
if (!this.form.cover) {
this.$message({
type: 'error',
message: '请上传封面!'
});
return
}
if (!json.text_category_ids) {
this.$message({
type: 'error',
message: '请选择课程!'
});
return
}
if (!json.item_category_ids) {
this.$message({
type: 'error',
message: '请选择盒子!'
});
return
}
switch(this.dialogObj.type){
case 1:
// this.$refs['form'].validate((valid) => {
// if(valid){
editLessonApi(this.dialogObj.id,json).then(res=>{
this.$message({
type: 'success',
message: '修改成功!'
......@@ -182,25 +230,27 @@
this.$emit("reflash");
this.dialogObj.show = false;
});
// }
// });
break;
case 0:
console.log(this.form);
// this.$refs['form'].validate((valid) => {
// if(valid){
addLessonApi(this.form).then(res=>{
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
})
// }
// });
break
}
// }
// });
break;
case 0:
console.log(this.form);
// this.$refs['form'].validate((valid) => {
// if(valid){
addLessonApi(json).then(res=>{
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
})
// }
// });
break
}
}
})
},
initDialog(){
getBoxTypeListApi().then(res=>{
......@@ -212,57 +262,56 @@
getCategoryApi().then(res=>{
this.lessonList = res;
this.showLessonList = JSON.parse(JSON.stringify(res))
});
switch(this.dialogObj.type){
case 0:
this.form={
title:'',
type:0,
text_category_ids:[],
item_category_ids:[],
cover:0,
};
this.uploadShow = true;
this.imageList = [];
this.selectedLessonList = [];
this.selectedBoxList = [];
break;
case 1:
getLessonDetailApi(this.dialogObj.id).then(res=>{
switch(this.dialogObj.type){
case 0:
this.form={
title:res.title,
type:res.type,
title:'',
type:0,
text_category_ids:[],
item_category_ids:[],
cover:'',
cover:0,
};
this.imageList = [{name:res.cover,url:process.env.IMAGE_URL_HEAD + res.cover}];
this.uploadShow = false;
this.uploadShow = true;
this.imageList = [];
this.selectedLessonList = [];
this.selectedBoxList = [];
if(res.type === 0){
res.detail['0'].forEach(i=>{
this.selectLesson([i.pid,i.id])
});
}else if(res.type === 1){
res.detail['1'].forEach(t=>{
let x = this.showLessonList.find(i=>{return i.children.find(j=>{return j.id === t.pid})})
this.selectLesson([x.id,t.pid,t.id])
})
}
if(res.detail['2']){
res.detail['2'].forEach(i=>{
this.selectBox([i.id])
});
}
break;
case 1:
getLessonDetailApi(this.dialogObj.id).then(resL=>{
this.form={
title:resL.title,
type:resL.type,
text_category_ids:[],
item_category_ids:[],
cover:'',
};
this.imageList = [{name:resL.cover,url: process.env.IMAGE_URL_HEAD + resL.cover}];
this.uploadShow = false;
this.selectedLessonList = [];
this.selectedBoxList = [];
if(resL.type === 0){
resL.detail['0'].forEach(i=>{
this.selectLesson([i.pid,i.id])
});
}else if(resL.type === 1){
resL.detail['1'].forEach(t=>{
let x = this.showLessonList.find(i=>{return i.children.find(j=>{return j.id === t.pid})})
this.selectLesson([x.id,t.pid,t.id])
})
}
if(resL.detail['2']){
resL.detail['2'].forEach(i=>{
this.selectBox([i.id])
});
}
});
break;
case 2:
this.title = '编辑';
this.show = this.dialogObj.show;
this.id = this.dialogObj.id;
this.type = 2;
});
break;
case 2:
this.title = '编辑';
this.show = this.dialogObj.show;
this.id = this.dialogObj.id;
this.type = 2;
// getTeacherDetailApi(this.id).then(res=>{
// this.form.name = res.name;
// this.form.alias = res.alias;
......@@ -271,8 +320,9 @@
// this.form.status = res.status;
// this.loading = false
// });
break
}
break
}
});
},
beforeAvatarUpload(){
this.uploadShow = false
......@@ -287,27 +337,40 @@
this.$store.dispatch('setProgress',{type:'new',id:a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file:a.file,type:'local'}).then(res=>{
if(this.form.goods_desc.img){
this.form.goods_desc.img[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
}else{
this.form.goods_desc.img=[];
this.form.goods_desc.img[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''}
}
this.form.cover = process.env.IMAGE_URL_HEAD + res.url;
this.imageList[0] = {name:res.url,url:process.env.IMAGE_URL_HEAD + res.url,title:'',lable:''};
})
},
moveBox(first,second){
let list = this.selectedBoxList;
let oFirst = list[first];
let oSecond = list[second];
this.selectedBoxList.splice(first,1,oSecond);
this.selectedBoxList.splice(second,1,oFirst);
},
moveItem(first,second){
console.log('moveItem', first, second);
let list = this.selectedLessonList;
let oFirst = list[first];
let oSecond = list[second];
this.selectedLessonList.splice(first,1,oSecond);
this.selectedLessonList.splice(second,1,oFirst);
}
},
watch:{
dialogObj(){
this.initDialog()
}
// dialogObj(){
// this.initDialog()
// }
},
mounted(){
this.initDialog()
}
}
</script>
<style scoped lang="less">
.el-col{
height: 50px;
/*height: 50px;*/
text-align: center;
margin-bottom: 20px;
line-height: 40px;
......@@ -332,6 +395,12 @@
margin: 0;
text-align: left;
}
.move {
display: flex;
flex-flow: row;
justify-content: flex-end;
align-items: center;
}
</style>
<style>
.disabled .el-upload--picture-card {
......
......@@ -72,7 +72,7 @@
</el-table-column>
</el-table>
<page :total="total" v-model="nowPage"/>
<dialog-com :dialogObj="dialogObj" @changeShow="changeShow" @reflash="getUser"/>
<dialog-com v-if="dialogObj.show" :dialogObj="dialogObj" @changeShow="changeShow" @reflash="getUser"/>
</div>
</template>
......@@ -151,8 +151,8 @@
type: 'success',
message: '删除成功!'
});
this.getUser()
});
this.getUser()
});
},
changeShow(data){
......
......@@ -52,7 +52,7 @@
loginApi(json).then(res=>{
this.$store.dispatch('setToken',res.token);
this.$store.dispatch('setUserName',res.user_name);
this.$router.push({name:'index'})
this.$router.push({name:'resources'})
})
}
})
......
<template>
<div class="index">
<!-- 组件有两个属性 value 传入内容双向绑定 setting传入配置信息 -->
<img :src="indexImg" class="indexImg"/>
<!--<img :src="indexImg" class="indexImg"/>-->
<div style="text-align: center;margin-top: 5%;">正在开发中...</div>
</div>
</template>
......
......@@ -183,6 +183,8 @@
onAdd(){
this.newDialog.form.id = '';
this.newDialog.start_num = '';
this.newDialog.form.goods_id = '';
this.newDialog.form.title = '';
this.newDialog.form.start_at = '';
this.newDialog.form.rest_week_day = [];
this.newDialog.form.teacher_ids = [];
......
......@@ -26,7 +26,7 @@
<el-input v-model="form.title"></el-input>
</el-form-item>
<el-form-item label="开始主题" prop="start_num">
<el-select v-model="form.start_num" placeholder="请选择">
<el-select v-model="form.start_num" clearable placeholder="请选择">
<el-option
v-for="item in itemOptions"
:key="item.id"
......@@ -215,6 +215,8 @@
})
},
getLessonDetail(id){
console.log('getLessonDetail', id);
this.form.start_num=''
getLessonDetailApi(id,{}).then((res) => {
this.itemOptions = res.detail[res.type]
})
......
......@@ -171,7 +171,8 @@
this.form = {
name:res.name,
num:res.num,
cover:res.cover
cover:res.cover,
category_name: res.category_name
};
if(this.form.cover && this.form.cover !== ''){
this.imageList = [{name:res.cover,url:process.env.IMAGE_URL_HEAD + res.cover}];
......
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