desc: 调整剧本加载,删除城市注释

This commit is contained in:
zyy 2019-08-01 15:19:24 +08:00
parent 4be4c87327
commit ff9e69585d
9 changed files with 965 additions and 869 deletions

View File

@ -27,7 +27,14 @@ export function deleteQuest(id) {
export function getQuestById(id) {
return request({
url: `/api/quest/${id}`,
method: 'get',
method: 'get'
});
}
/** 根据id查询任务基础信息 */
export function getQuestByIdList(id) {
return request({
url: `/api/quest/${id}/detail`,
method: 'get'
});
}
/** 更新任务基本信息 */

View File

@ -1,8 +1,9 @@
const mapDeviceStyle = {
// '01': 'chengdu_04',
'02': 'fuzhou_01',
'03': 'bejing_01',
'04': 'chengdu_03',
'05': 'batong_01'
'05': 'batong_01' // 暂时没有画北京八通线
};
export function selectSkinStyle(code) {

View File

@ -1,14 +1,14 @@
export function getBaseUrl() {
let BASE_API
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud'
BASE_API = 'https://test.joylink.club/jlcloud'
// BASE_API = 'http://192.168.3.5:9010' // 袁琪
// BASE_API = 'http://192.168.3.6:9010' // 旭强
// BASE_API = 'http://192.168.3.6:9010'; // 旭强
// BASE_API = 'http://192.168.3.4:9010' // 琰培
} else {
BASE_API = process.env.VUE_APP_BASE_API
BASE_API = process.env.VUE_APP_BASE_API;
}
return BASE_API
return BASE_API;
}

View File

@ -1,33 +1,88 @@
<template>
<el-dialog title="任务列表" :visible.sync="show" top="50px" width="70%" :before-doClose="doClose"
:close-on-click-modal="false">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
<div>
<el-dialog
title="任务列表"
:visible.sync="show"
top="50px"
width="70%"
:before-do-close="doClose"
:close-on-click-modal="false"
:z-index="2000"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
<el-dialog
title="角色选择"
:visible.sync="roleShow"
top="50px"
width="350px"
:before-do-close="roleDoClose"
:close-on-click-modal="false"
:z-index="5000"
>
<div>
<el-form ref="ruleForm" :model="form" :rules="rules" label-width="50px">
<el-form-item label="角色" prop="role">
<el-select v-model="form.role" placeholder="请选择">
<el-option
v-for="item in memberList"
:key="item.id"
:label="item.name"
:value="item.id"
:disabled="item.role != 'Dispatcher'"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="roleDoClose"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getQuestPageList } from '@/api/quest';
import { getSkinStyleList } from '@/api/management/mapskin'
import { getQuestPageList, getQuestByIdList } from '@/api/quest';
import { getSkinStyleList } from '@/api/management/mapskin';
export default {
name: 'addQuest',
export default {
name: 'AddQuest',
props: {
trainings: {
type: Array,
default: () => {
return [];
}
},
detail: {
type: Object,
default: () => {
return {};
}
}
},
data() {
return {
show: false,
roleShow: false,
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
row: {},
memberList: [],
form: {
role: ''
},
rules: {
role: [
{ required: true, message: '请选择', trigger: 'change' }
]
},
queryForm: {
labelWidth: '80px',
reset: false,
@ -49,12 +104,12 @@
title: '皮肤类型',
prop: 'skinCode',
type: 'tag',
columnValue: (row) => { return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']) },
tagType: (row) => { return 'success' }
columnValue: (row) => { return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
tagType: (row) => { return 'success'; }
},
{
title: '创建时间',
prop: 'createTime',
prop: 'createTime'
},
{
type: 'button',
@ -62,10 +117,10 @@
width: '250',
buttons: [
{
name: '加载任务',
name: '加载剧本',
type: 'primary',
handleClick: this.handleLoad
},
}
]
}
],
@ -74,7 +129,7 @@
},
currentModel: {}
}
};
},
created() {
this.loadInitData();
@ -106,14 +161,14 @@
this.skinCodeList = [];
getSkinStyleList().then(response => {
this.skinCodeList = response.data;
})
});
},
convertField(fieldValue, enumList, converFormat) {
if (converFormat && converFormat.length >= 2) {
let value = converFormat[0];
let label = converFormat[1];
for (let i = 0; enumList && i < enumList.length; i++) {
const value = converFormat[0];
const label = converFormat[1];
for (let i = 0; i < enumList.length; i++) {
if ('' + fieldValue === '' + enumList[i][value]) {
return enumList[i][label];
}
@ -121,10 +176,14 @@
}
},
handleLoad(index, row) {
this.$emit('selectQuest', row);
this.doClose();
async handleLoad(index, row) {
this.row = row;
const res = await getQuestByIdList(row.id);
if (res.code == 200) {
this.memberList = res.data.memberVOList;
this.memberList.unshift({id: '', name: '观众', role: 'Dispatcher'});
}
this.roleShow = true;
},
reloadTable() {
@ -132,6 +191,21 @@
this.queryList.reload();
}
},
confirm() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.$emit('selectQuest', this.row, this.form.role);
this.doClose();
this.roleDoClose();
}
});
},
roleDoClose() {
this.$refs['ruleForm'].resetFields();
this.roleShow = false;
}
}
};
</script>

View File

@ -2,34 +2,45 @@
<div class="main" :style="{width: canvasWidth+'px'}" @mousemove="mousemove">
<div v-show="panelShow" :panelShow="panelShow">
<transition name="el-zoom-in-bottom">
<map-system-draft ref="mapCanvas" @back="back"></map-system-draft>
<map-system-draft ref="mapCanvas" @back="back" />
</transition>
<menu-exam ref="menuExam" v-if="isExam" :offset="offset" :group="group"></menu-exam>
<menu-exam v-if="isExam" ref="menuExam" :offset="offset" :group="group" />
<menu-lesson ref="lessonMenu" v-if="isLesson" :offset="offset" :group="group" :trainingObj="trainingObj">
</menu-lesson>
<menu-lesson v-if="isLesson" ref="lessonMenu" :offset="offset" :group="group" :training-obj="trainingObj" />
<menu-demon ref="menuDemon" v-if="isDemon" :offset="offset" :group="group" :questId="questId"
@tryTime='tryTime' @hidepanel="hidepanel" @quitQuest="quitQuest">
<menu-demon
v-if="isDemon"
ref="menuDemon"
:offset="offset"
:group="group"
:quest-id="questId"
@tryTime="tryTime"
@hidepanel="hidepanel"
@quitQuest="quitQuest"
/>
</menu-demon>
<menu-screen v-if="isScreen" ref="menuScreen" :offset="offset" :group="group" @tryTime="tryTime" />
<menu-screen ref="menuScreen" v-if="isScreen" :offset="offset" :group="group" @tryTime='tryTime'>
</menu-screen>
<menu-plan v-if="isPlan" ref="menuPlan" :offset="offset" :group="group" />
<menu-plan ref="menuPlan" v-if="isPlan" :offset="offset" :group="group"></menu-plan>
<menu-replay v-if="isReplay" ref="menuReplay" :offset="offset" :group="group" />
<menu-replay ref="menuReplay" v-if="isReplay" :offset="offset" :group="group"></menu-replay>
<menu-script v-if="isTask" ref="menuScript" :offset="offset" :group="group" />
<menu-script ref="menuScript" v-if="isTask" :offset="offset" :group="group"></menu-script>
<menu-schema
v-if="isDemon || isPlan || isTask "
ref="menuSchema"
:offset="offset"
:group="group"
@runPlanLoadShow="runPlanLoadShow"
@runPlanViewShow="runPlanViewShow"
@faultChooseShow="faultChooseShow"
@runQuestLoadShow="runQuestLoadShow"
@switchMode="switchMode"
/>
<menu-schema ref="menuSchema" v-if="isDemon || isPlan || isTask " :offset="offset" :group="group"
@runPlanLoadShow="runPlanLoadShow" @runPlanViewShow="runPlanViewShow" @faultChooseShow="faultChooseShow"
@runQuestLoadShow="runQuestLoadShow" @switchMode="switchMode">
</menu-schema>
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group"></menu-system-time>
<menu-system-time ref="menuSystemTime" :offset="offset" :group="group" />
</div>
<!-- <Three-Test v-show="simulationShow" :panelShow="simulationShow" ref="ThreeTest" @showpanel="showpanel">
@ -37,45 +48,45 @@
<Jl3d-Simulation v-show="drivingShow" :panelShow="drivingShow" ref="Jl3dSimulation" @showdriving="showdriving">
</Jl3d-Simulation> -->
<fault-choose ref="faultChoose" :group="group"></fault-choose>
<run-plan-Load ref="runPlanLoad" :group="group"></run-plan-Load>
<run-plan-view ref="runPlanView" :group="group"></run-plan-view>
<add-quest ref="addQuest" @selectQuest="selectQuest"></add-quest>
<fault-choose ref="faultChoose" :group="group" />
<run-plan-Load ref="runPlanLoad" :group="group" />
<run-plan-view ref="runPlanView" :group="group" />
<add-quest ref="addQuest" @selectQuest="selectQuest" />
</div>
</template>
<script>
import RunPlanLoad from './demon/runPlanLoad';
import RunPlanView from './demon/runPlanView';
import FaultChoose from './demon/faultChoose';
import MapSystemDraft from '@/views/mapsystem/index';
import MenuExam from '@/views/display/menuExam';
import MenuLesson from '@/views/display/menuLesson';
import MenuReplay from '@/views/display/menuReplay';
import MenuDemon from '@/views/display/menuDemon';
import MenuScreen from '@/views/display/menuScreen';
import MenuSchema from '@/views/display/menuSchema';
import MenuSystemTime from '@/views/display/menuSystemTime';
import MenuPlan from '@/views/display/menuPlan';
import MenuScript from '@/views/display/menuScript';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import AddQuest from './demon/addQuest';
import { mapGetters } from 'vuex';
import { getTrainingStepsDetail } from '@/api/jmap/training';
import { setGoodsTryUse } from '@/api/management/goods';
import { getProductDetail } from '@/api/management/mapprd';
import { simulationNotify, bitScreenNotify, runDiagramQuit, loadQuest, getSimulationInfo } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { isFullscreen } from '@/utils/screen';
import { loadMapData } from '@/utils/loaddata';
import { handleToken } from '@/utils/auth';
import RunPlanLoad from './demon/runPlanLoad';
import RunPlanView from './demon/runPlanView';
import FaultChoose from './demon/faultChoose';
import MapSystemDraft from '@/views/mapsystem/index';
import MenuExam from '@/views/display/menuExam';
import MenuLesson from '@/views/display/menuLesson';
import MenuReplay from '@/views/display/menuReplay';
import MenuDemon from '@/views/display/menuDemon';
import MenuScreen from '@/views/display/menuScreen';
import MenuSchema from '@/views/display/menuSchema';
import MenuSystemTime from '@/views/display/menuSystemTime';
import MenuPlan from '@/views/display/menuPlan';
import MenuScript from '@/views/display/menuScript';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import AddQuest from './demon/addQuest';
import { mapGetters } from 'vuex';
import { getTrainingStepsDetail } from '@/api/jmap/training';
import { setGoodsTryUse } from '@/api/management/goods';
import { getProductDetail } from '@/api/management/mapprd';
import { simulationNotify, bitScreenNotify, runDiagramQuit, loadQuest, getSimulationInfo } from '@/api/simulation';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';
import { isFullscreen } from '@/utils/screen';
import { loadMapData } from '@/utils/loaddata';
import { handleToken } from '@/utils/auth';
//
// import ThreeTest from '@/views/jlmap3d/index';
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
//
// import ThreeTest from '@/views/jlmap3d/index';
// import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation';
export default {
export default {
name: 'DisplayDraft',
components: {
RunPlanLoad,
@ -91,7 +102,7 @@
MenuScreen,
MenuScript,
MenuSchema,
MenuSystemTime,
MenuSystemTime
// ThreeTest,
// Jl3dSimulation
},
@ -111,14 +122,14 @@
panelShow: true,
simulationShow: false,
drivingShow: false,
questId: 0, //Id
questId: 0, // Id
group: '',
prdTypeMap: {
'01': '01', // =>
'02': '02', // =>
'04': '02', // =>
}
'01': '01', // =>
'02': '02', // =>
'04': '02' // =>
}
};
},
computed: {
...mapGetters([
@ -157,7 +168,7 @@
return this.mode === 'plan';
},
isDrive() {
return this.$route.query.prdType == "04";
return this.$route.query.prdType == '04';
}
},
watch: {
@ -202,8 +213,8 @@
},
methods: {
resizeHandler() {
let width = this._clientWidth;
let height = this._clientHeight;
const width = this._clientWidth;
const height = this._clientHeight;
this.$store.dispatch('config/resize', { width, height });
@ -257,7 +268,7 @@
}
}
}
}, 1000)
}, 1000);
},
mousemove(e) {
this.mouseNum = 1;
@ -265,8 +276,8 @@
setPosition() {
this.$nextTick(() => {
let offset = 15;
let menuBar = document.getElementById('menuBar');
let menuTool = document.getElementById('menuTool');
const menuBar = document.getElementById('menuBar');
const menuTool = document.getElementById('menuTool');
if (menuBar) {
offset += (menuBar.offsetHeight || 0);
}
@ -277,7 +288,7 @@
if (this.offset != offset) {
this.offset = offset;
}
})
});
},
//
endViewLoading(isSuccess) {
@ -287,19 +298,19 @@
this.$nextTick(() => {
eventBus.$emit('viewLoading', false);
})
});
},
// 仿
async loadSimulationInfo() {
let resp = await getSimulationInfo(this.group);
const resp = await getSimulationInfo(this.group);
if (resp && resp.code == 200) {
this.questId = resp.data.questId || 0;
this.questId = Number(resp.data.questId) || 0;
}
},
//
async initLoadData() {
let width = document.documentElement.clientWidth;
let height = document.documentElement.clientHeight + 200;
const width = document.documentElement.clientWidth;
const height = document.documentElement.clientHeight + 200;
this.$store.dispatch('config/resize', { width, height });
this.$store.dispatch('training/reset');
@ -330,16 +341,16 @@
//
async initLoadLessonOrExamData() {
this.$store.dispatch('training/end', null);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
let trainingId = this.$route.query.trainingId;
const trainingId = this.$route.query.trainingId;
if (parseInt(trainingId)) {
//
//
let resp = await getTrainingStepsDetail(trainingId, { group: this.group });
const resp = await getTrainingStepsDetail(trainingId, { group: this.group });
if (resp && resp.code == 200) {
let stepdData = this.trainingObj = resp.data;
let rest = await getProductDetail(stepdData.prdCode);
const stepdData = this.trainingObj = resp.data;
const rest = await getProductDetail(stepdData.prdCode);
if (rest && rest.code == 200) {
await this.$store.dispatch('training/setPrdType', rest.data.prdType);
await this.loadMapData(resp.data.skinStyle);
@ -356,10 +367,10 @@
//
async initLoadReplayData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '');
let skinStyle = this.$route.query.skinStyle;
const skinStyle = this.$route.query.skinStyle;
if (parseInt(skinStyle)) {
await this.loadMapData(skinStyle);
@ -370,10 +381,10 @@
// 仿
async initLoadDemonData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.$route.query.prdType]);
let skinStyle = this.$route.query.skinStyle;
const skinStyle = this.$route.query.skinStyle;
if (parseInt(skinStyle)) {
await this.loadMapData(skinStyle);
@ -384,10 +395,10 @@
//
async initLoadScreenData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01');
let skinStyle = this.$route.query.skinStyle;
const skinStyle = this.$route.query.skinStyle;
if (parseInt(skinStyle)) {
await this.loadMapData(skinStyle);
@ -398,10 +409,10 @@
//
async initLoadTaskData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.switchMode('01');
let skinStyle = this.$route.query.skinStyle;
const skinStyle = this.$route.query.skinStyle;
if (parseInt(skinStyle)) {
await this.loadMapData(skinStyle);
@ -412,10 +423,10 @@
//
async initLoadTestRunData() {
this.$store.dispatch('training/end', TrainingMode.NORMAL);
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); //
this.$store.dispatch('training/setPrdType', '01');
let skinStyle = this.$route.query.skinStyle;
const skinStyle = this.$route.query.skinStyle;
if (parseInt(skinStyle)) {
await this.loadMapData(skinStyle);
@ -423,13 +434,13 @@
this.endViewLoading();
}
},
//
//
async runQuestLoadShow() {
this.$refs.addQuest.doShow();
},
//
async selectQuest(row) {
let res = await loadQuest(row.id, this.group);
async selectQuest(row, role) {
const res = await loadQuest(row.id, this.group);
if (res && res.code == 200) {
this.questId = parseInt(row.id);
}
@ -479,10 +490,10 @@
},
// 使
async tryTime(param) {
let data = {
const data = {
goodsId: param.goodsId,
time: param.time
}
};
if (data.goodsId) {
await setGoodsTryUse(data);
}
@ -519,7 +530,7 @@
this.$refs.faultChoose.doShow();
}
}
}
};
</script>
<style>
.main {

View File

@ -1,32 +1,36 @@
<template>
<div class="schema" :style="{top: offset+'px'}">
<el-select size="small" v-model="swch" v-if="isScript" @change="switchMode" placeholder="请选择产品类型">
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value">
</el-option>
<el-select v-if="isScript" v-model="swch" size="small" placeholder="请选择产品类型" @change="switchMode">
<el-option v-for="item in swchList" :key="item.value" :label="item.name" :value="item.value" />
</el-select>
<el-button-group>
<el-button size="small" @click="viewRunQuest" v-if="isDemon" :disabled="viewDisabled" type="success">加载任务
<el-button v-if="isDemon" size="small" :disabled="viewDisabled" type="success" @click="viewRunQuest">加载剧本
</el-button>
<el-button size="small" @click="viewRunPlan" v-if="runing" :disabled="viewDisabled">运行图预览</el-button>
<el-button size="small" @click="loadRunPlan" v-if="!runing && !isPlan" :disabled="viewDisabled"
type="warning">运行图加载</el-button>
<el-button size="small" @click="setFault" v-if="mode==OperateMode.FAULT" type="danger">故障设置</el-button>
<el-button v-if="runing" size="small" :disabled="viewDisabled" @click="viewRunPlan">运行图预览</el-button>
<el-button
v-if="!runing && !isPlan"
size="small"
:disabled="viewDisabled"
type="warning"
@click="loadRunPlan"
>运行图加载</el-button>
<el-button v-if="mode==OperateMode.FAULT" size="small" type="danger" @click="setFault">故障设置</el-button>
</el-button-group>
<el-radio-group size="small" v-model="mode" v-if="!isPlan" @change="changeOperateMode(mode)">
<el-radio-group v-if="!isPlan" v-model="mode" size="small" @change="changeOperateMode(mode)">
<el-radio-button class="mode" :label="OperateMode.NORMAL">正常操作</el-radio-button>
<el-radio-button class="mode" :label="OperateMode.FAULT">故障操作</el-radio-button>
</el-radio-group>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { getStationListBySkinStyle, queryRunPlan } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
import { mapGetters } from 'vuex';
import { OperateMode } from '@/scripts/ConstDic';
import { getStationListBySkinStyle, queryRunPlan } from '@/api/runplan';
import { getEveryDayRunPlanData } from '@/api/simulation';
export default {
export default {
name: 'MenuSchema',
props: {
group: {
@ -47,13 +51,13 @@
swch: '02',
swchList: [
{ value: '01', name: '现地' },
{ value: '02', name: '行调' },
{ value: '02', name: '行调' }
]
}
};
},
computed: {
...mapGetters('runPlan', [
'stations',
'stations'
]),
isPlan() {
return this.$route.params.mode === 'plan';
@ -63,7 +67,7 @@
},
isDemon() {
return this.$route.params.mode === 'demon';
},
}
},
watch: {
'$store.state.training.started': function (val) {
@ -71,12 +75,12 @@
},
'$store.state.training.switchcount': async function () {
if (this.group) {
let started = this.$store.state.training.started;
const started = this.$store.state.training.started;
if (started) {
await this.loadRunData(this.$route.query);
}
}
},
}
},
async mounted() {
await this.loadRunData(this.$route.query);
@ -93,10 +97,10 @@
queryRunPlan(this.$route.query.planId).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
this.viewDisabled = false;
}).catch(error => {
}).catch(() => {
this.$store.dispatch('runPlan/setPlanData', []);
this.$messageBox(`获取运行图数据失败`);
})
});
} else {
getEveryDayRunPlanData(this.group).then(resp => {
this.$store.dispatch('runPlan/setPlanData', resp.data);
@ -108,14 +112,14 @@
} else {
this.$messageBox(`获取运行图数据失败`);
}
})
});
}
})
}).catch(error => {
});
}).catch(() => {
this.$messageBox(`获取车站列表失败`);
});
}
})
});
},
changeOperateMode(handle) {
this.$store.dispatch('training/changeOperateMode', { mode: handle });
@ -124,7 +128,7 @@
this.runing = run;
},
setFault() {
this.$emit('faultChooseShow')
this.$emit('faultChooseShow');
},
loadRunPlan() {
this.$emit('runPlanLoadShow');
@ -139,7 +143,7 @@
this.$emit('switchMode', swch);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.schema {

View File

@ -1,36 +1,35 @@
<template>
<div class="reminder-drag" v-drag>
<div class="reminder-box" ref="drapBox">
<div v-drag class="reminder-drag">
<div ref="drapBox" class="reminder-box">
<div class="tip-title">
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i>
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i>
<p style="color: #fff;" v-if="isShrink">
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
<p v-if="isShrink" style="color: #fff;">
<span>{{ formModel.name }}</span>
</p>
</div>
<div class="tip-body-box" ref="dragBody">
<div ref="dragBody" class="tip-body-box">
<div class="tip-body">
<el-scrollbar wrapClass="scrollbar-wrapper">
<el-scrollbar wrap-class="scrollbar-wrapper">
<p class="list-item">
<span class="list-label">任务描述</span>
<span class="list-elem">{{ formModel.description }}</span>
</p>
</el-scrollbar>
</div>
<div class="drag-right"></div>
<div class="drag-left"></div>
<div class="drag-bottom"></div>
<div class="drag-top"></div>
<div class="drag-right" />
<div class="drag-left" />
<div class="drag-bottom" />
<div class="drag-top" />
</div>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import { getQuestById } from '@/api/quest';
import { getQuestById } from '@/api/quest';
export default {
export default {
name: 'TipQuestDetail',
props: {
questId: {
@ -45,7 +44,7 @@
name: '',
description: ''
}
}
};
},
computed: {
},
@ -60,14 +59,14 @@
if (questId) {
getQuestById(questId).then(resp => {
this.formModel = resp.data;
}).catch(error => {
}).catch(() => {
this.$messageBox('获取任务信息失败');
});
}
},
shrink() {
let height = this.$refs.dragBody.offsetHeight + 40;
let top = this.$refs.drapBox.style.top;
const height = this.$refs.dragBody.offsetHeight + 40;
const top = this.$refs.drapBox.style.top;
if (this.isShrink) {
this.$refs.drapBox.style.height = '40px';
this.$refs.drapBox.style.top = '';
@ -79,7 +78,7 @@
}
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";

View File

@ -215,11 +215,11 @@ export default {
},
initLoadData() {
this.cityList = [];
// this.$Dictionary.cityType().then(list => {
// this.cityList = list;
// }).catch(() => {
// this.$messageBox('');
// });
this.$Dictionary.cityType().then(list => {
this.cityList = list;
}).catch(() => {
this.$messageBox('加载城市列表失败');
});
this.skinStyleList = [];
getSkinStyleList().then(response => {

View File

@ -1,15 +1,15 @@
'use strict'
;
// import { getBasePathConfig } from '@/utils/baseUrl'
const path = require('path')
const defaultSettings = require('./src/settings.js')
const path = require('path');
const defaultSettings = require('./src/settings.js');
function resolve(dir) {
return path.join(__dirname, dir)
return path.join(__dirname, dir);
}
const name = defaultSettings.title // page title
const port = 9527 // dev port
const name = defaultSettings.title; // page title
const port = 9527; // dev port
// All configuration item explanations can be find in https://cli.vuejs.org/config/
module.exports = {
@ -56,14 +56,14 @@ module.exports = {
}
},
chainWebpack(config) {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
config.plugins.delete('preload'); // TODO: need test
config.plugins.delete('prefetch'); // TODO: need test
// set svg-sprite-loader
config.module
.rule('svg')
.exclude.add(resolve('src/icons'))
.end()
.end();
config.module
.rule('icons')
.test(/\.svg$/)
@ -74,7 +74,7 @@ module.exports = {
.options({
symbolId: 'icon-[name]'
})
.end()
.end();
// set preserveWhitespace
config.module
@ -82,16 +82,16 @@ module.exports = {
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
options.compilerOptions.preserveWhitespace = true;
return options;
})
.end()
.end();
config
// https://webpack.js.org/configuration/devtool/#development
.when(process.env.NODE_ENV === 'development',
config => config.devtool('cheap-source-map')
)
);
config
.when(process.env.NODE_ENV !== 'development',
@ -103,7 +103,7 @@ module.exports = {
// `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/
}])
.end()
.end();
config
.optimization.splitChunks({
chunks: 'all',
@ -127,9 +127,9 @@ module.exports = {
reuseExistingChunk: true
}
}
})
config.optimization.runtimeChunk('single')
});
config.optimization.runtimeChunk('single');
}
)
);
}
}
};