实训案例管理 后台列表

zqqdev
CherrysChang 5 years ago
parent 894aec50b1
commit 54a165e4ce
  1. 1
      src/api/app.js
  2. 38
      src/api/server.js
  3. 3
      src/views/TrainHome.vue
  4. 50
      src/views/train/case-list.vue

@ -1,5 +1,6 @@
//开发环境 //开发环境
export const app = { export const app = {
trainUrl: "http://127.0.0.1:9141",
sysconfUrl: "http://127.0.0.1:9131", sysconfUrl: "http://127.0.0.1:9131",
loginUrl: "http://127.0.0.1:9121", loginUrl: "http://127.0.0.1:9121",
userUrl: "http://127.0.0.1:9101", userUrl: "http://127.0.0.1:9101",

@ -13,6 +13,7 @@ import {app} from "./app";
// const sysconfApi = "http://127.0.0.1:9131"; // const sysconfApi = "http://127.0.0.1:9131";
// const loginApi = "http://127.0.0.1:9121"; // const loginApi = "http://127.0.0.1:9121";
// const userApi = "http://127.0.0.1:9101"; // const userApi = "http://127.0.0.1:9101";
const trainApi = app.trainUrl;
const sysconfApi = app.sysconfUrl; const sysconfApi = app.sysconfUrl;
const loginApi = app.loginUrl; const loginApi = app.loginUrl;
const userApi = app.userUrl; const userApi = app.userUrl;
@ -28,6 +29,43 @@ const botApi = app.botUrl;
export const FILE_URL = app.FILE_URL_APP; export const FILE_URL = app.FILE_URL_APP;
// export const FILE_URL = "http://127.0.0.1:8088/"; // export const FILE_URL = "http://127.0.0.1:8088/";
/**
* 实训管理模块 Train
*/
export const Train = new (class {
constructor() {
this.getTrainListApi = trainApi + "/trainManage/list"; //实训管理列表
this.insertTrainApi = trainApi + "/trainManage/add";//添加
this.updTrainApi = trainApi + "/trainManage/edit";//修改
this.delTrainApi = trainApi + "/trainManage/remove";//删除
}
//实训管理列表
getTrainList(params) {
return axios
.post(this.getTrainListApi, qs.stringify(params))
.then(res => res.data);
}
//添加
insertTrain(params) {
return axios
.post(this.insertTrainApi, qs.stringify(params))
.then(res => res.data);
}
//修改
updTrain(params) {
return axios
.post(this.updTrainApi, qs.stringify(params))
.then(res => res.data);
}
//删除
delTrain(params) {
return axios
.post(this.delTrainApi, qs.stringify(params))
.then(res => res.data);
}
})();
/** /**
* 用户管理api模块 * 用户管理api模块
*/ */

@ -32,9 +32,6 @@
}, },
mounted() { mounted() {
this.$router.push({name: 'CaseList'}) this.$router.push({name: 'CaseList'})
},
methods: {
} }
} }
</script> </script>

@ -81,6 +81,7 @@
</template> </template>
<script> <script>
import {Train} from '@/api/server.js';
export default { export default {
name: 'case-list', name: 'case-list',
data() { data() {
@ -104,55 +105,6 @@
this.initList(); this.initList();
}, },
methods: { methods: {
setDefaultUserName(loginId) {
this.$util.setCookie('userLoginId', loginId);
},
gotoDb: function (row) {
let self = this;
let userType = this.$store.state.app.user.userType;
let customerManager = JSON.parse(self.$util.getCookie("customerManager"));
self.$store.commit('startLoading');
self.$http.post('/pmtapi/base_Account/login', {
username: customerManager.userName,
password: customerManager.password,
caseId: row.id,
captchaCode: "yyyf",
}).then(function (response) {
self.$store.commit('loginIn', {
appKey: response.appKey,
userId: response.userId,
userLoginId: response.userLoginId,
userDisplayName: response.userDisplayName,
userMobile: response.userMobile,
userType: userType,
showSearchDiv: 0,
currentRole:0
});
self.$store.commit('endLoading');
self.setDefaultUserName(customerManager.userName);
let toPath = null;
if (!toPath || self.$router.currentRoute.name == 'login' || self.$router.currentRoute.name == '404') {
toPath = "/";
}
self.$router.push({
path: toPath
});
self.$message({
message: '成功进入',
type: 'success',
onClose: function () {
$("body").removeClass("el-loading-parent--hidden").removeClass("el-loading-parent--relative");
}
});
}).catch(function (error) {
self.$store.commit('endLoading');
self.$message.error(error);
});
},
initList(searchObj) { initList(searchObj) {
this.searchObj.selfIsAdmin = this.$store.state.app.user.userType == 1 ? 0 : 1; this.searchObj.selfIsAdmin = this.$store.state.app.user.userType == 1 ? 0 : 1;
this.$http.post('/authapi/bs_projectManage/getProjectPagedList', { this.$http.post('/authapi/bs_projectManage/getProjectPagedList', {

Loading…
Cancel
Save