This commit is contained in:
fan 2019-10-30 13:07:27 +08:00
commit b6f11064da
15 changed files with 1405 additions and 1363 deletions

View File

@ -228,10 +228,13 @@ export default {
endTime: 'End time',
editPlanningTrain: 'Edit planning train',
runGraphName: 'Run graph name',
tipOperationTime: '请先设置区段站间运行时间, 【文件】-> 【修改站间运行时间】',
serverTrainNum: '表号车次号',
tipOperationTime: 'Please set the running time between the stations, [File] -> [Modify the running time between stations]',
serverTrainNum: ' service trip Number',
explanation: 'Explanation',
creationDate: 'Creation date',
load: 'Load',
modifyName: 'Modify name'
modifyName: 'Modify name',
applyRelease:'Apply for release',
preview:'Preview',
revoke:'Revoke'
};

View File

@ -206,5 +206,14 @@ export default {
rejectedCourseReleaseApplicationSuccessful: 'Rejected course release application successful!',
rejectedCourseReleaseApplicationFailed: 'Rejected course release application failed!',
duplicatePlanFailedTips: 'The interval needs to be more than 30 seconds or the times is more than 1',
createSwitchPortion: 'The relevant turnout is not formed'
createSwitchPortion: 'The relevant turnout is not formed',
publishRunPlanTips:'This action will publish run plan, whether to continue?',
applyRunPlanTips:'This action will initiate a run plan release requestwhether to continue?',
publishRunPlanSuccess:'Publish run plan success!',
publishRunPlanFail:'Publish run plan fail!',
applyRunPlanSuccess:'Submit run plan to publish success!',
applyRunPlanFail:'Submit run plan to publish fail!',
cancelRunPlanTips:'This action will revoke the run plan request, whether to continue?',
cancelRunPlanSuccess:'Revoke run plan success!',
cancelRunPlanFail:'Revoke run plan fail!'
};

View File

@ -236,5 +236,8 @@ export default {
explanation: '驳回说明',
creationDate: '创建日期',
load: '加载',
modifyName: '修改名称'
modifyName: '修改名称',
applyRelease:'申请发布',
preview:'预览',
revoke:'撤回'
};

View File

@ -206,5 +206,14 @@ export default {
rejectedCourseReleaseApplicationSuccessful: '驳回课程发布申请成功!',
rejectedCourseReleaseApplicationFailed: '驳回课程发布申请失败!',
duplicatePlanFailedTips: '间隔时间需要大于30秒或次数大于1',
createSwitchPortion: '相关道岔未生成'
createSwitchPortion: '相关道岔未生成',
publishRunPlanTips:'此操作将发布运行图,是否继续?',
applyRunPlanTips:'此操作将发起运行图发布申请,是否继续?',
publishRunPlanSuccess:'发布运行图成功!',
publishRunPlanFail:'发布运行图失败!',
applyRunPlanSuccess:'提交运行图发布申请成功!',
applyRunPlanFail:'提交运行图发布申请失败!',
cancelRunPlanTips:'此操作将撤销发布运行图申请,是否继续?',
cancelRunPlanSuccess:'撤销运行图发布申请成功!',
cancelRunPlanFail:'撤销运行图发布申请失败!'
};

View File

@ -19,8 +19,9 @@ import JointTraining from '@/views/jointTraining/index';
import Error401 from '@/views/error-page/401';
import Errpr404 from '@/views/error-page/404';
import SkinCode from '@/views/map/skinCode/index';
import SkinCodeDraft from '@/views/map/skinCode/draft';
import SkinCode from '@/views/system/skinCode/index';
import SkinCodeDraft from '@/views/system/skinCode/draft';
import Mapdraft from '@/views/map/mapdraft/index';
import Mapedit from '@/views/map/mapdraft/mapedit/index';
import Runplan from '@/views/map/runplan/index';
@ -523,46 +524,46 @@ export const asyncRouter = [
},
hidden: true
},
{
path: '/map',
meta: {
i18n: 'router.mapManage',
roles: [admin, mapCreater, userDesign]
},
hidden: true,
component: Layout,
children: [
{
path: 'draw',
redirect: '/map/draw/0/draft',
component: Mapdraft,
meta: {
i18n: 'router.mapDraw'
},
children: [
{
path: ':mapId/:view',
component: Mapedit,
hidden: true
}
]
},
{
path: 'runPlan',
redirect: '/map/runPlan/view/draft',
component: Runplan,
meta: {
i18n: 'router.runPlanManage'
},
children: [{
path: 'view/:mode',
component: RunplanView,
hidden: true
}]
}
]
},
{
// {
// path: '/map',
// meta: {
// i18n: 'router.mapManage',
// roles: [admin, mapCreater, userDesign]
// },
// hidden: true,
// component: Layout,
// children: [
// {
// path: 'draw',
// redirect: '/map/draw/0/draft',
// component: Mapdraft,
// meta: {
// i18n: 'router.mapDraw'
// },
// children: [
// {
// path: ':mapId/:view',
// component: Mapedit,
// hidden: true
// }
// ]
// },
// {
// path: 'runPlan',
// redirect: '/map/runPlan/view/draft',
// component: Runplan,
// meta: {
// i18n: 'router.runPlanManage'
// },
// children: [{
// path: 'view/:mode',
// component: RunplanView,
// hidden: true
// }]
// }
// ]
// },
{ // 实训平台
path: '/trainingPlatform',
component: Layout,
hidden: true,
@ -655,35 +656,35 @@ export const asyncRouter = [
}
]
},
{
path: '/dp',
hidden: true,
redirect: '/dp/home',
component: ScreenMonitor,
meta: {
roles: [admin, userScreen, user]
},
children: [
{
path: 'home',
component: ScreenMonitorHome,
meta: {
i18n: 'router.dpSystem'
},
target: true
},
{
path: 'detail/:lessonId',
component: ScreenMonitorDetail,
hidden: true
},
{
path: 'pay/:lessonId',
component: Pay,
hidden: true
}
]
},
// {
// path: '/dp',
// hidden: true,
// redirect: '/dp/home',
// component: ScreenMonitor,
// meta: {
// roles: [admin, userScreen, user]
// },
// children: [
// {
// path: 'home',
// component: ScreenMonitorHome,
// meta: {
// i18n: 'router.dpSystem'
// },
// target: true
// },
// {
// path: 'detail/:lessonId',
// component: ScreenMonitorDetail,
// hidden: true
// },
// {
// path: 'pay/:lessonId',
// component: Pay,
// hidden: true
// }
// ]
// },
{
path: '/plan/usertool',
component: PlanMonitorEditUserTool,

View File

@ -3,10 +3,10 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -196,6 +196,7 @@ export default {
.card-box {
padding-top: 20px;
height: 100%;
margin: 0 auto;
}
.steps {

View File

@ -1,212 +0,0 @@
<template>
<div class="card-box">
<!-- <turnback-bar :title="turnbackBarTitle" /> -->
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step title="" icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -160 + 'px'}" style="padding-top: 40px">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</el-scrollbar>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isAdd" type="primary" style="margin-left: 120px" @click="create">{{ $t('global.create') }}</el-button>
<el-button v-if="isEdit" type="warning" style="margin-left: 120px" @click="update">{{ $t('global.update') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { addSkinCode, querySkinCode, updateSkinCode, querySkinCodeExistByCode } from '@/api/management/mapskin';
export default {
name: 'DictionaryDetailEdit',
data() {
return {
display: 1,
formModel: {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false
}
};
},
computed: {
title() {
if (this.isAdd) {
return this.$t('map.addMapSkin');
}
if (this.isEdit) {
return this.$t('map.updateMapSkin');
}
return '';
},
isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
},
isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
},
isDisabled() {
return this.isEdit;
},
form() {
const form = {
labelWidth: '140px',
items: [
{ prop: 'code', label: this.$t('map.skinCoding'), type: 'text', required: false, disabled: this.isDisabled },
{ prop: 'name', label: this.$t('map.skinDesignation'), type: 'text', required: false },
{ prop: 'origin', label: this.$t('map.coordinatesOrigin'), type: 'point', required: false },
{ prop: 'scaling', label: this.$t('map.scaling'), type: 'number', required: false, message: this.$t('rules.maxScaling') }
]
};
return form;
},
rules() {
const baseRules = {
code: [
{ required: true, message: this.$t('rules.skinCodingInput'), trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('rules.skinDesignationInput'), trigger: 'blur' }
],
origin: [
{ required: true, message: this.$t('rules.coordinatesOriginInput'), trigger: 'blur' }
],
scaling: [
{ required: true, message: this.$t('rules.scalingInput'), trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number(value) >= 1 && Number(value) <= 8) {
callback();
} else {
callback(new Error(this.$t('rules.scalingInputPrompt')));
}
},
trigger: 'blur'
}
]
};
//
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
return baseRules;
},
height() {
return this.$store.state.app.height - 130;
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
//
this.display = 1;
this.formModel = {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1'
};
if (this.isEdit) {
querySkinCode(this.$route.params.skinCodeId).then(response => {
this.formModel = response.data;
});
}
//
this.$nextTick(() => {
this.$refs.dataform.resetForm();
});
},
create() {
this.formModel.id = '';
this.$refs.dataform.validateForm(() => {
querySkinCodeExistByCode(this.formModel.code).then(resp => {
addSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.creatingSuccessful'));
}).catch(() => {
this.$messageBox(this.$t('tip.creatingFailed'));
});
}).catch(() => {
this.$messageBox(this.$t('tip.skinCodingExist'));
});
});
},
update() {
this.formModel.id = this.$route.params.skinCodeId;
this.$refs.dataform.validateForm(() => {
updateSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.updateFailed'));
});
});
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.steps {
width: 940px;
margin: 0 auto;
margin-top: 20px;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 20px;
/deep/ {
.el-select {
float: left;
width: calc(600px);
}
.el-form-item__content>.el-input>.el-input__inner {
float: left;
width: calc(600px);
}
.el-input-number {
float: left;
width: calc(250px);
}
}
}
.draft {
width: 300px;
margin: 20px auto;
}
</style>

View File

@ -1,124 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { UrlConfig } from '@/router/index';
import { getSkinCodePageList, delSkinCode } from '@/api/management/mapskin';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'SkinCode',
data() {
return {
prdTypeList: [],
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('map.skinDesignation')
},
code: {
type: 'text',
label: this.$t('map.skinCoding')
}
}
},
queryList: {
query: getSkinCodePageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.skinCoding'),
prop: 'code'
},
{
title: this.$t('map.skinDesignation'),
prop: 'name'
},
{
title: this.$t('map.coordinatesOrigin'),
prop: 'origin',
type: 'tag',
columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})`; },
tagType: () => { return ''; }
},
{
title: this.$t('map.scalingColon'),
prop: 'scaling'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit,
type: ''
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
]
}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.prdTypeList = [];
this.$Dictionary.productPostType().then(list => {
this.prdTypeList = list;
});
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
handleAdd() {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/add/null`);
},
handleEdit(index, row) {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/edit/${row.id}`);
},
handleDelete(index, row) {
this.$confirm(this.$t('tip.skinDeleteConfirmation'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
delSkinCode(row.id).then(() => {
this.$message.success(this.$t('tip.skinDeleteSuccessfully'),);
}).catch(() => {
this.$messageBox(this.$t('tip.skinDeleteFailed'));
});
}).catch(() => {
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -33,7 +33,7 @@ import { addOrganization, getOrganizationList } from '@/api/management/organizat
import { getSellerList } from '@/api/management/user';
import { createPermission } from '@/api/management/order';
import PremissionList from './list';
import { deepAssign } from '@/utils/index';
// import { deepAssign } from '@/utils/index';
export default {
name: 'OrderForm',
@ -364,10 +364,11 @@ export default {
this.orderList = [];
this.goodsList.forEach(item => {
this.formModel.organizationId = this.buildModel();
const param = deepAssign({}, this.formModel);
param.goodsId = item.id;
param.goodsName = item.name;
param.price = item.price;
// const param = deepAssign({}, this.formModel);
const param = {
goodItem: item.goodItem,
permissionType: item.permissionType
};
this.orderList.push(param);
});
this.packForm(); //
@ -379,9 +380,27 @@ export default {
return nor.permissionId;
});
const param = {
createVO: {isPackage: false, relPermissions: arr},
orderList: this.orderList,
canDistribute: this.formModel.canDistribute == '01'
// createVO: {isPackage: false, relPermissions: arr},
// orderList: this.orderList,
// canDistribute: this.formModel.canDistribute == '01'
isPackage: false,
organizationId: this.formModel.organizationId,
packageNum: this.formModel.amount,
amount: this.formModel.amount,
monthAmount: this.formModel.monthAmount,
packageName: this.goodsVo.name,
totalPrice: this.formModel.totalPrice,
orderType: this.formModel.orderType,
distributeType: this.formModel.canDistribute == '01',
startTime: this.formModel.startTime,
payStatus: this.formModel.payStatus,
bizType: this.formModel.bizType,
payWays: this.formModel.payWays,
forever: this.formModel.forever,
// mapId: this.goodsList[0].mapId,
relPermissions: arr,
orderDetailList: this.orderList
};
createPermission(param).then(res => {
this.urlInfo = {
@ -389,8 +408,8 @@ export default {
title: this.$t('orderAuthor.permissionToDistributeQRCode')
};
this.$emit('orderNext', this.urlInfo);
}).catch(error => {
console.log(error);
}).catch((error) => {
this.$messageBox(`${error.message}`);
});
} else {
this.$messageBox(this.$t('tip.selectPackagingRecord'));
@ -401,16 +420,40 @@ export default {
this.$refs.dataform.validateForm(() => {
this.formModel.organizationId = this.buildModel();
const param = {
createVO: {
// createVO: {
// isPackage: true,
// relPermissions: this.permissionVo.relPermissions,
// name: this.permissionVo.name,
// id: this.permissionVo.id,
// remarks: this.permissionVo.remarks
// },
// goodsVO: this.goodsVo,
// orderList: [this.formModel],
// canDistribute: this.formModel.canDistribute == '01'
isPackage: true,
organizationId: this.formModel.organizationId,
packageNum: this.formModel.amount,
startTime: this.formModel.startTime,
monthAmount: this.formModel.monthAmount,
distributeType: this.formModel.canDistribute == '01',
bizType: this.formModel.bizType,
payWays: this.formModel.payWays,
forever: this.formModel.forever,
payStatus: this.formModel.payStatus,
totalPrice: this.formModel.totalPrice,
contractNo: this.formModel.contractNo,
orderType: this.formModel.orderType,
packageName: this.goodsVo.name,
remarks: this.goodsVo.remarks,
price: this.goodsVo.price,
tryUse: this.goodsVo.tryUse,
tryUseTime: this.goodsVo.tryUseTime,
tryUseTimeUnit: this.goodsVo.tryUseTimeUnit,
relPermissions: this.permissionVo.relPermissions,
name: this.permissionVo.name,
id: this.permissionVo.id,
remarks: this.permissionVo.remarks
},
goodsVO: this.goodsVo,
orderList: [this.formModel],
canDistribute: this.formModel.canDistribute == '01'
mapId: this.permissionVo.mapId
// prdCode: this.permissionVo.prdCode
};
createPermission(param).then(res => {
this.urlInfo = {

View File

@ -194,7 +194,7 @@ export default {
},
changeRadio(data) {
this.$emit('changeType', data);
if (data == '02') {
if (data == '02' && this.ruleList.length) {
const arr = this.ruleList.map(item => {
return item.id;
});
@ -323,7 +323,22 @@ export default {
item.goods = ele;
}
});
item.goods && this.goodsList.push(item.goods);
const param = {
goodItem: {
name: item.name,
permissionId: item.id,
permissionName: item.goods.name,
id: item.goods.id
},
permissionType: item.type,
// mapId: item.mapId,
permissionId: item.id,
isPackage: item.isPackage,
name: item.goods.name,
price: item.goods.price,
remarks: item.goods.remarks
};
item.goods && this.goodsList.push(param);
});
if (this.goodsList.length == this.ruleList.length) {
this.$emit('permissionNext', this.goodsList);

View File

@ -29,9 +29,9 @@
<el-button size="mini" class="button_box" type="success" @click="handleConfirm(scope.row)" v-if="scope.row.status !=='1'">{{$t('planMonitor.load')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handleEdit(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('planMonitor.modifyName')}}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handleDelete(scope.row)" v-if="isCreate && scope.row.status !=='1'">{{$t('global.delete')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)" v-if="isCreate && scope.row.status ==='0'">{{hasRelease?$t('global.release'):'申请发布'}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)" v-if="scope.row.status === '1'">预览</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)" v-if="scope.row.status === '1'" >撤销</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePublish(scope.row)" v-if="isCreate && scope.row.status ==='0'">{{hasRelease?$t('global.release'):$t('planMonitor.applyRelease')}}</el-button>
<el-button size="mini" class="button_box" type="primary" @click="handlePreview(scope.row)" v-if="scope.row.status === '1'">{{$t('planMonitor.preview')}}</el-button>
<el-button size="mini" class="button_box" type="danger" @click="handelRevert(scope.row)" v-if="scope.row.status === '1'" >{{$t('planMonitor.revoke')}}</el-button>
</template>
</el-table-column>
</el-table>
@ -185,41 +185,41 @@ export default {
}).catch(() => { });
},
handlePublish(row) {
this.$confirm(this.hasRelease? '此操作将发布运行图,是否继续?':'此操作将发起运行图发布申请,是否继续?',this.$t('tip.hint'),{
this.$confirm(this.hasRelease? this.$t('tip.publishRunPlanTips'):this.$t('tip.applyRunPlanTips'),this.$t('tip.hint'),{
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
if (this.hasRelease){
publishRunPlan(row.id,{runPlanName: name}).then(resp => {
this.$message.success('发布运行图成功!');
this.$message.success(this.$t('tip.publishRunPlanSuccess'));
this.refresh();
}).catch(() => {
this.$messageBox('发布运行图失败!');
this.$messageBox(this.$t('tip.publishRunPlanFail'));
this.refresh();
})
} else {
releaseOrCancelRunPlan(row.id, '1').then(resp => {
this.$message.success('提交运行图发布申请成功!');
this.$message.success(this.$t('tip.applyRunPlanSuccess'));
this.refresh();
}).catch(() => {
this.$messageBox('提交运行图发布申请失败!');
this.$messageBox(this.$t('tip.applyRunPlanFail'));
this.refresh();
})
}
});
},
handelRevert(row) {
this.$confirm('此操作将撤销发布运行图申请,是否继续?',this.$t('tip.hint'),{
this.$confirm(this.$t('tip.cancelRunPlanTips'),this.$t('tip.hint'),{
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type:'warning'
}).then(() => {
releaseOrCancelRunPlan(row.id,'0').then(resp=> {
this.$message.success('撤销运行图发布申请成功!');
this.$message.success(this.$t('tip.cancelRunPlanSuccess'));
this.refresh();
}).catch(() => {
this.$messageBox('撤销运行图发布申请失败!')
this.$messageBox(this.$t('tip.cancelRunPlanFail'))
this.refresh();
})
})
@ -243,8 +243,7 @@ export default {
return lessonStatus;
},
handleTime(time) {
let timeList = time.split("T");
return timeList[0] + ' ' +timeList[1];
return time.replace("T"," ");
},
handlePreview(row){
previewRunPlan(row.id).then(resp => {
@ -269,41 +268,10 @@ export default {
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
// .title {
// font-weight: bold
// }
// .time-item {
// font-size: 24px;
// color: black !important;
// }
// .time-label {
// display: -moz-inline-box;
// display: inline-block;
// text-align: right;
// margin-left: 14px;
// }
// .time-elem {
// color: rgb(90, 89, 89) !important;
// }
// .list-item {
// font-size: 16px;
// margin-bottom: 20px;
// }
// .list-label {
// display: -moz-inline-box;
// display: inline-block;
// text-align: right;
// /* width: 160px; */
// }
// .list-elem {
// color: #808080 !important;
// }
.el-button+.el-button{
margin-top:5px;
margin-left: 0px;
}
.createRunPlan{
display:inline-block;float:right;margin-right:20px;

View File

@ -0,0 +1,202 @@
<template>
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<div style="padding-top: 40px; padding-bottom: 20px;">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isAdd" type="primary" style="margin-left: 120px" @click="create">{{ $t('global.create') }}</el-button>
<el-button v-if="isEdit" type="warning" style="margin-left: 120px" @click="update">{{ $t('global.update') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { addSkinCode, querySkinCode, updateSkinCode, querySkinCodeExistByCode } from '@/api/management/mapskin';
export default {
name: 'DictionaryDetailEdit',
data() {
return {
display: 1,
formModel: {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false
}
};
},
computed: {
title() {
if (this.isAdd) {
return this.$t('map.addMapSkin');
}
if (this.isEdit) {
return this.$t('map.updateMapSkin');
}
return '';
},
isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
},
isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
},
isDisabled() {
return this.isEdit;
},
form() {
const form = {
labelWidth: '140px',
items: [
{ prop: 'code', label: this.$t('map.skinCoding'), type: 'text', required: false, disabled: this.isDisabled },
{ prop: 'name', label: this.$t('map.skinDesignation'), type: 'text', required: false },
{ prop: 'origin', label: this.$t('map.coordinatesOrigin'), type: 'point', required: false },
{ prop: 'scaling', label: this.$t('map.scaling'), type: 'number', required: false, message: this.$t('rules.maxScaling') }
]
};
return form;
},
rules() {
const baseRules = {
code: [
{ required: true, message: this.$t('rules.skinCodingInput'), trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('rules.skinDesignationInput'), trigger: 'blur' }
],
origin: [
{ required: true, message: this.$t('rules.coordinatesOriginInput'), trigger: 'blur' }
],
scaling: [
{ required: true, message: this.$t('rules.scalingInput'), trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number(value) >= 1 && Number(value) <= 8) {
callback();
} else {
callback(new Error(this.$t('rules.scalingInputPrompt')));
}
},
trigger: 'blur'
}
]
};
return baseRules;
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
//
this.display = 1;
this.formModel = {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1'
};
if (this.isEdit) {
querySkinCode(this.$route.params.skinCodeId).then(response => {
this.formModel = response.data;
});
}
//
this.$nextTick(() => {
this.$refs.dataform.resetForm();
});
},
create() {
this.formModel.id = '';
this.$refs.dataform.validateForm(() => {
querySkinCodeExistByCode(this.formModel.code).then(resp => {
addSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.creatingSuccessful'));
}).catch(() => {
this.$messageBox(this.$t('tip.creatingFailed'));
});
}).catch(() => {
this.$messageBox(this.$t('tip.skinCodingExist'));
});
});
},
update() {
this.formModel.id = this.$route.params.skinCodeId;
this.$refs.dataform.validateForm(() => {
updateSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.updateFailed'));
});
});
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.steps {
width: 940px;
margin: 0 auto;
margin-top: 20px;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 20px;
/deep/ {
.el-select {
float: left;
width: calc(600px);
}
.el-form-item__content>.el-input>.el-input__inner {
float: left;
width: calc(600px);
}
.el-input-number {
float: left;
width: calc(250px);
}
}
}
.draft {
width: 300px;
margin: 20px auto;
}
</style>

View File

@ -0,0 +1,124 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { UrlConfig } from '@/router/index';
import { getSkinCodePageList, delSkinCode } from '@/api/management/mapskin';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'SkinCode',
data() {
return {
prdTypeList: [],
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('map.skinDesignation')
},
code: {
type: 'text',
label: this.$t('map.skinCoding')
}
}
},
queryList: {
query: getSkinCodePageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.skinCoding'),
prop: 'code'
},
{
title: this.$t('map.skinDesignation'),
prop: 'name'
},
{
title: this.$t('map.coordinatesOrigin'),
prop: 'origin',
type: 'tag',
columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})`; },
tagType: () => { return ''; }
},
{
title: this.$t('map.scalingColon'),
prop: 'scaling'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit,
type: ''
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
]
}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.prdTypeList = [];
this.$Dictionary.productPostType().then(list => {
this.prdTypeList = list;
});
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
handleAdd() {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/add/null`);
},
handleEdit(index, row) {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/edit/${row.id}`);
},
handleDelete(index, row) {
this.$confirm(this.$t('tip.skinDeleteConfirmation'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
delSkinCode(row.id).then(() => {
this.$message.success(this.$t('tip.skinDeleteSuccessfully'),);
}).catch(() => {
this.$messageBox(this.$t('tip.skinDeleteFailed'));
});
}).catch(() => {
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>