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)">
<el-form-item :prop="name" :label="field.label">
<el-select
v-if="field.show !== false"
v-if="field.show !== false && !(field.noClearable)"
:ref="name"
v-model="formModel[name]"
:multiple="field.config.multiple"
@ -106,6 +106,22 @@
</template>
</template>
</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>
</template>
<template v-else-if="checkFieldType(field, 'complete')">
@ -285,9 +301,13 @@ export default {
case 'select':
if (field.config.multiple) {
defaultValue = [];
} else {
if (field.default) {
defaultValue = field.default;
} else {
defaultValue = '';
}
}
break;
case 'daterange':
defaultValue = [];

View File

@ -37,5 +37,6 @@ export default {
numOfTransfer:'Num of transfer',
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.',
distributeId: 'Distribute id'
distributeId: 'Distribute id',
sortType:'SortType'
};

View File

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

View File

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

View File

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

View File

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

View File

@ -61,6 +61,18 @@ export default {
config: {
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>
<style lang="scss" scoped>
</style>