Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
ee16508b02
@ -1,9 +0,0 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 获取实操列表(题库)*/
|
||||
export function getPracticeList() {
|
||||
return request({
|
||||
url: `/api/v1/competitionPractical/competition`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
@ -24,3 +24,20 @@ export function updateRace(id, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取实操列表(题库)*/
|
||||
export function getPracticeList() {
|
||||
return request({
|
||||
url: `/api/v1/competitionPractical/competition`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取单个实操详情(题库)*/
|
||||
export function getPracticeByIdBasic() {
|
||||
return request({
|
||||
url: `/api/v1/competitionPractical/competition`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getScriptByIdBasic} from '@/api/script';
|
||||
import { getPracticeByIdBasic} from '@/api/race';
|
||||
|
||||
export default {
|
||||
name: 'ScriptDraft',
|
||||
@ -36,7 +36,7 @@ export default {
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '150px',
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'name', label: '实操名称', type: 'text' },
|
||||
{ prop: 'description', label: '实操描述', type: 'textarea' }
|
||||
@ -77,7 +77,7 @@ export default {
|
||||
},
|
||||
doShow(questid) {
|
||||
if (questid) {
|
||||
getScriptByIdBasic(questid).then(resp=>{
|
||||
getPracticeByIdBasic(questid).then(resp=>{
|
||||
const data = {'name':resp.data.name, 'description':resp.data.description, 'mapId':resp.data.mapId};
|
||||
this.formModel = data;
|
||||
this.formModel.id = questid;
|
||||
|
@ -6,7 +6,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getPracticeList } from '@/api/competitionManage';
|
||||
import { getPracticeList, getRaceList } from '@/api/race';
|
||||
import CreatePractice from './create';
|
||||
export default {
|
||||
name:'PracticeManage',
|
||||
@ -15,6 +15,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
raceList:[],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -38,7 +39,11 @@ export default {
|
||||
},
|
||||
queryList: {
|
||||
// query: getPracticeList,
|
||||
data:[],
|
||||
data:[
|
||||
{id:1, raceId:2, name:'行调进行扣车操作', creatorName:'水墨'},
|
||||
{id:2, raceId:4, name:'行调进行扣车操作', creatorName:'zyy'},
|
||||
{id:3, raceId:3, name:'行调进行扣车操作', creatorName:'水墨'}
|
||||
],
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
@ -47,18 +52,18 @@ export default {
|
||||
prop: 'raceId',
|
||||
type: 'tag',
|
||||
width: '320',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.type, 'QuestionTypeList'); },
|
||||
columnValue: (row) => { return this.getRaceName(row.raceId); },
|
||||
tagType: (row) => {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '实操名称',
|
||||
prop: 'topic'
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
prop: 'createUserName',
|
||||
prop: 'creatorName',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
@ -94,6 +99,15 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
getRaceList({pageSize:999, pageNum:1}).then(res=>{
|
||||
this.raceList = res.data.list;
|
||||
this.queryForm.queryObject.raceId.config.data = [];
|
||||
this.raceList.forEach(each=>{
|
||||
this.queryForm.queryObject.raceId.config.data.push({label:each.name, value:each.id});
|
||||
});
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
doCreate() {
|
||||
this.$refs.createPractice.doShow(null);
|
||||
@ -107,8 +121,18 @@ export default {
|
||||
doRecord() {
|
||||
|
||||
},
|
||||
doUpdate() {
|
||||
|
||||
// 修改
|
||||
doUpdate(index, row) {
|
||||
this.$refs.modifyPractice.doShow(row.id);
|
||||
},
|
||||
getRaceName(raceId) {
|
||||
let raceName = '';
|
||||
this.raceList.forEach(each=>{
|
||||
if (each.id == raceId) {
|
||||
raceName = each.name;
|
||||
}
|
||||
});
|
||||
return raceName;
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
|
Loading…
Reference in New Issue
Block a user