This commit is contained in:
fan 2019-12-10 17:56:08 +08:00
commit 214a74a55a
7 changed files with 139 additions and 81 deletions

View File

@ -90,7 +90,7 @@
<template v-else-if="checkFieldType(field, 'select', name)"> <template v-else-if="checkFieldType(field, 'select', name)">
<el-form-item :prop="name" :label="field.label"> <el-form-item :prop="name" :label="field.label">
<el-select <el-select
v-if="field.show !== false" v-if="field.show !== false && !(field.noClearable)"
:ref="name" :ref="name"
v-model="formModel[name]" v-model="formModel[name]"
:multiple="field.config.multiple" :multiple="field.config.multiple"
@ -106,6 +106,22 @@
</template> </template>
</template> </template>
</el-select> </el-select>
<el-select
v-if="field.show !== false && field.noClearable"
:ref="name"
v-model="formModel[name]"
:multiple="field.config.multiple"
:placeholder="field.placeholder || $t('global.choose')"
filterable
@change="selectChange(field, formModel)"
>
<template v-if="field.config.data instanceof Array ? true : false">
<template v-for="(item, idx) in field.config.data">
<el-option :key="idx" :value="item.value" :label="item.label">{{
item.label }}</el-option>
</template>
</template>
</el-select>
</el-form-item> </el-form-item>
</template> </template>
<template v-else-if="checkFieldType(field, 'complete')"> <template v-else-if="checkFieldType(field, 'complete')">
@ -285,9 +301,13 @@ export default {
case 'select': case 'select':
if (field.config.multiple) { if (field.config.multiple) {
defaultValue = []; defaultValue = [];
} else {
if (field.default) {
defaultValue = field.default;
} else { } else {
defaultValue = ''; defaultValue = '';
} }
}
break; break;
case 'daterange': case 'daterange':
defaultValue = []; defaultValue = [];

View File

@ -37,5 +37,6 @@ export default {
numOfTransfer:'Num of transfer', numOfTransfer:'Num of transfer',
transferTips:'You can receive multiple permissions at a time, and the permissions you receive can continue to be transferred.', transferTips:'You can receive multiple permissions at a time, and the permissions you receive can continue to be transferred.',
distributeTips:'Only one permission can be obtained at a time. The permission received is a dedicated permission and cannot be redistributed.', distributeTips:'Only one permission can be obtained at a time. The permission received is a dedicated permission and cannot be redistributed.',
distributeId: 'Distribute id' distributeId: 'Distribute id',
sortType:'SortType'
}; };

View File

@ -44,5 +44,6 @@ export default {
numOfTransfer:'转赠权限数量', numOfTransfer:'转赠权限数量',
transferTips:'一次可以领取多个权限,领到的权限可以继续转赠', transferTips:'一次可以领取多个权限,领到的权限可以继续转赠',
distributeTips:'一次只能领取一个权限,领到的权限是专用权限,不可再次分发', distributeTips:'一次只能领取一个权限,领到的权限是专用权限,不可再次分发',
distributeId: '分发ID' distributeId: '分发ID',
sortType:'排序方式'
}; };

View File

@ -4,6 +4,7 @@ const config = {
namespaced: true, namespaced: true,
state: { state: {
maskOpen: false, // 开关
width: document.documentElement.clientWidth, // 地图canvas 容器 宽度 width: document.documentElement.clientWidth, // 地图canvas 容器 宽度
height: document.documentElement.clientHeight, // 地图canvas 容器 高度 height: document.documentElement.clientHeight, // 地图canvas 容器 高度
menuBarLoadedCount: 0, // menuBar加载完成 menuBarLoadedCount: 0, // menuBar加载完成
@ -44,6 +45,9 @@ const config = {
}, },
changeSwitchMap: (state, swtichMap) => { changeSwitchMap: (state, swtichMap) => {
state.switchMap = swtichMap; state.switchMap = swtichMap;
},
setMaskOpen: (state, flag) => {
state.maskOpen = flag;
} }
}, },
actions: { actions: {
@ -76,6 +80,9 @@ const config = {
}, },
changeSwitchMap: ({ commit, state}, switchMap) => { changeSwitchMap: ({ commit, state}, switchMap) => {
commit('changeSwitchMap', switchMap); commit('changeSwitchMap', switchMap);
},
setMaskOpen: ({ commit }, flag) => {
commit('setMaskOpen', flag);
} }
} }
}; };

View File

@ -1,10 +1,9 @@
<template> <template>
<div <div
ref="drapBox" ref="drapBox"
class="drapWidth" class="drapWidth"
:style="{width: width + 'px', height: height + 'px', left: widthLeft +'px'}" :style="{width: width + 'px', height: height + 'px', left: widthLeft +'px'}"
@mousedown="mousedown" @mousedown.stop="mousedown"
/> />
</template> </template>
@ -59,10 +58,9 @@ export default {
oDiv.onmousedown = function() { oDiv.onmousedown = function() {
return false; return false;
}; };
e.stopPropagation();
window.event.cancelBubble = true;
const odiv = e.target; const odiv = e.target;
const disX = e.clientX - odiv.offsetLeft; const disX = e.clientX - odiv.offsetLeft;
this.$store.dispatch('config/setMaskOpen', true);
document.onmousemove = (e) => { document.onmousemove = (e) => {
let left = e.clientX - disX; let left = e.clientX - disX;
if (left > maxNum) { if (left > maxNum) {
@ -80,6 +78,7 @@ export default {
localStore('LeftWidth', JSON.stringify(this.widthLefts)); localStore('LeftWidth', JSON.stringify(this.widthLefts));
} }
} }
this.$store.dispatch('config/setMaskOpen', false);
document.onmousemove = null; document.onmousemove = null;
document.onmouseup = null; document.onmouseup = null;
}; };

View File

@ -1,6 +1,7 @@
<template> <template>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
<div class="mapPaint"> <div class="mapPaint">
<div v-show="maskOpen" class="mask" />
<div class="map-view"> <div class="map-view">
<div class="operation_box"> <div class="operation_box">
<el-button-group> <el-button-group>
@ -84,7 +85,10 @@ export default {
...mapGetters('map', [ ...mapGetters('map', [
'stepData', 'stepData',
'recoverStepData' 'recoverStepData'
]) ]),
maskOpen() {
return this.$store.state.config.maskOpen;
}
}, },
watch: { watch: {
'$store.state.map.mapDataLoadedCount': function (val) { '$store.state.map.mapDataLoadedCount': function (val) {
@ -136,7 +140,7 @@ export default {
}); });
this.setDelayUnlockStatus(response.data, '00'); this.setDelayUnlockStatus(response.data, '00');
this.initAutoSaveTask(); this.initAutoSaveTask();
}).catch((error) => { }).catch(() => {
this.$message.error(this.$t('tip.failedLoadMap')); this.$message.error(this.$t('tip.failedLoadMap'));
this.endViewLoading(); this.endViewLoading();
}); });
@ -338,6 +342,16 @@ export default {
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss"; @import "src/styles/mixin.scss";
.mask{
opacity: 0;
background: #000;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9;
}
.operation_box{ .operation_box{
position: absolute; position: absolute;
right: 20px; right: 20px;
@ -360,6 +374,7 @@ export default {
.mapPaint{ .mapPaint{
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
position: relative;
} }
.map-view { .map-view {

View File

@ -61,6 +61,18 @@ export default {
config: { config: {
data: [] data: []
} }
},
sortOrder:{
type: 'select',
label: this.$t('permission.sortType'),
default:'id desc',
noClearable:true,
config: {
data: [
{value:'id desc', label:'ID倒序'},
{value:'userName', label:'用户名正序'}
]
}
} }
} }
}, },
@ -246,3 +258,6 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
</style>