画面调整暂提

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) {
return selectLineCode(lineCode);
}
reloadStyle(lineCode) {
this.style = selectLineCode(lineCode);
this.$zr.dom.style.backgroundColor = this.style.backgroundColor || '#000';
}
loadDefaultState() { // 加载默认状态
const defaultStateDict = {};

View File

@ -24,6 +24,11 @@
/>
</el-select>
</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-button type="primary" @click="submitForm('ruleForm')">创建</el-button>
</el-form-item>
@ -34,11 +39,13 @@
<script>
import {mapGetters} from 'vuex';
import { saveMap } from '@/api/jmap/mapdraft';
import { getLineCodeList } from '@/api/management/mapline';
export default {
name: 'CreatePicture',
data() {
return {
centerDialogVisible: false,
skinCodeList: [],
ruleForm: { name: '', type: '', stationCode: '', deviceMap: {} },
rules: {
name: [{ required: true, message: '请输入画面名称', trigger: 'blur' }],
@ -53,6 +60,17 @@ export default {
'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: {
submitForm() {
this.$refs.ruleForm.validate((valid) => {

View File

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