画面调整暂提

This commit is contained in:
fan 2022-07-15 09:57:03 +08:00
parent 39369648bb
commit 1d6997db39
3 changed files with 23 additions and 1 deletions

View File

@ -83,7 +83,10 @@ class Jlmap {
loadStyle(lineCode) { loadStyle(lineCode) {
return selectLineCode(lineCode); return selectLineCode(lineCode);
} }
reloadStyle(lineCode) {
this.style = selectLineCode(lineCode);
this.$zr.dom.style.backgroundColor = this.style.backgroundColor || '#000';
}
loadDefaultState() { // 加载默认状态 loadDefaultState() { // 加载默认状态
const defaultStateDict = {}; const defaultStateDict = {};

View File

@ -24,6 +24,11 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="显示风格:" prop="lineCode">
<el-select v-model="ruleForm.lineCode" placeholder="请选择">
<el-option v-for="item in skinCodeList" :key="item.code" :label="item.name" :value="item.code" />
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="submitForm('ruleForm')">创建</el-button> <el-button type="primary" @click="submitForm('ruleForm')">创建</el-button>
</el-form-item> </el-form-item>
@ -34,11 +39,13 @@
<script> <script>
import {mapGetters} from 'vuex'; import {mapGetters} from 'vuex';
import { saveMap } from '@/api/jmap/mapdraft'; import { saveMap } from '@/api/jmap/mapdraft';
import { getLineCodeList } from '@/api/management/mapline';
export default { export default {
name: 'CreatePicture', name: 'CreatePicture',
data() { data() {
return { return {
centerDialogVisible: false, centerDialogVisible: false,
skinCodeList: [],
ruleForm: { name: '', type: '', stationCode: '', deviceMap: {} }, ruleForm: { name: '', type: '', stationCode: '', deviceMap: {} },
rules: { rules: {
name: [{ required: true, message: '请输入画面名称', trigger: 'blur' }], name: [{ required: true, message: '请输入画面名称', trigger: 'blur' }],
@ -53,6 +60,17 @@ export default {
'stationList' 'stationList'
]) ])
}, },
mounted() {
this.skinCodeList = [];
getLineCodeList().then(response => {
this.skinCodeList = response.data.map(item => {
const params = {};
params.label = item.name;
params.value = item.code;
return params;
});
});
},
methods: { methods: {
submitForm() { submitForm() {
this.$refs.ruleForm.validate((valid) => { this.$refs.ruleForm.validate((valid) => {

View File

@ -480,6 +480,7 @@ export default {
for (const deviceCode in mapDevice) { for (const deviceCode in mapDevice) {
deviceList.push(deviceCode); deviceList.push(deviceCode);
} }
this.$jlmap.reloadStyle('07');
this.$jlmap.updatePicture(deviceList); this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(map.scaling || '1', map.origin); this.$jlmap.updateTransform(map.scaling || '1', map.origin);
this.$message.success('删除画面成功!'); this.$message.success('删除画面成功!');