Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly

This commit is contained in:
fan 2022-10-17 18:03:46 +08:00
commit c7f1984f92
22 changed files with 1683 additions and 118 deletions

View File

@ -214,3 +214,33 @@ export function getQuestionAmount(data) {
data,
})
}
/**
* @param {Number} pcId 试卷蓝图Id
*/
export function lockPaper(pcId) {
return request({
url: `/api/v2/paper/composition/${pcId}/lock`,
method: 'PUT',
})
}
/**
* @param {Number} pcId 试卷蓝图Id
*/
export function unlockPaper(pcId) {
return request({
url: `/api/v2/paper/composition/${pcId}/unlock`,
method: 'PUT',
})
}
/**
* @param {Number} pcId 试卷蓝图Id
*/
export function deletePaper(pcId) {
return request({
url: `/api/v2/paper/composition/${pcId}`,
method: 'DELETE',
})
}

View File

@ -11,7 +11,7 @@ export function listQuestionPage(params) {
}
// 标签列表
export function getLableList() {
export function getLabelList() {
return request({
url: `/api/question/org/label`,
method: 'get'

View File

@ -8,7 +8,7 @@
<script>
// import { UrlConfig } from '@/scripts/ConstDic';
import { listQuestionPage, deleteQuestion, getLableList } from '@/api/questionBank.js';
import { listQuestionPage, deleteQuestion, getLabelList } from '@/api/questionBank.js';
import DialogDetail from './dialog-detail';
import PreviewAnswer from './previewAnswer';
import { convertSheetToList } from '@/jmapNew/theme/parser/util.js';
@ -152,7 +152,7 @@ export default {
// this.companyMap[item.id] = item.name;
// });
// });
getLableList().then(res => {
getLabelList().then(res => {
res.data.forEach(item => {
this.queryForm.queryObject.labels.config.data.push({ value: item, label: item });
});

View File

@ -4,6 +4,7 @@
<div v-for="(el,i) in optionList" :key="i" class="option__item">
<div> 选项-{{ $asc2chart(65+i) }} </div>
<item-rich v-model="el.content" :remove="remove" @modify="doModify(el)" @remove="doRemove(i)" />
<span v-if="!el.content" class="error">选项不能为空</span>
</div>
<el-button v-if="add" class="item__button" type="primary" size="mini" icon="el-icon-plus" @click="doAppend" />
</template>
@ -57,6 +58,19 @@ export default {
.option {
&__item {
margin-bottom: 10px;
position: relative;
.error {
color: #F56C6C;
font-size: 12px;
line-height: 1;
padding-top: 4px;
position: absolute;
top: 100%;
left: 0;
}
}
.item__button {
margin-top: 20px;
}
}
</style>

View File

@ -67,9 +67,19 @@ export default {
tagsChange(list) {
this.tagsArr = list;
},
hasNullOption() { //
const s = this.formModel.optionList.find(item => {
return item.content == '';
});
return s;
},
create() {
this.$refs.info.validate().then(valid => {
if (valid) {
if (this.hasNullOption()) {
this.$message.warning('选项不能为空!');
return;
}
// this.formModel.companyId = parseInt(this.companyId);
this.formModel.tags = this.tagsArr.join(',');
createQuestion(this.formModel).then(resp => {

View File

@ -37,7 +37,7 @@ import ItemOptions from './item-options';
import ItemAnswer from './item-answer';
import { getCompanyList } from '@/api/company';
import { getSessionStorage } from '@/utils/auth';
import { getLableList } from '@/api/questionBank.js';
import { getLabelList } from '@/api/questionBank.js';
export default {
components: {
@ -143,7 +143,7 @@ export default {
});
},
created() {
getLableList().then(res => {
getLabelList().then(res => {
this.labelList = res.data || [];
}).catch(err => {
console.log(err);

View File

@ -83,8 +83,18 @@ export default {
doModify(node) {
this.$refs.rich.doShow(node);
},
hasNullOption() { //
const s = this.formModel.optionList.find(item => {
return item.content == '';
});
return s;
},
update() {
this.$refs.info.validate().then(valid => {
if (this.hasNullOption()) {
this.$message.warning('选项不能为空!');
return;
}
if (this.$route.query.draft && valid) {
this.$store.state.race.preTheoryData[this.questionId] = this.formModel;
this.doBack();

View File

@ -45,7 +45,7 @@
<div class="bottom-box-in">
<div v-for="button in buttonList" :key="button.id" class="eachButtonTop">
<div class="eachButton" :class="buttonId==button.id?'active':''" @click="showSubMenu(button)">
<img :src="button.icon" class="eachButtonIcon">
<img :src="button.icon" class="eachButtonIco n">
<span class="eachButtonText">{{ button.name }}</span>
</div>
<div v-if="button.children&&button.children.length>0" class="childGroup" :class="isActive(button)">

View File

@ -1,20 +1,22 @@
<template>
<div>
<station-nav v-if="$route.query.group" />
<div style="height:100%">
<station-nav v-if="$route.query.group" @selectIscsPane="selectIscsPane" />
<div class="content-box-station iscs_content_box" :class="{'displayStationIscs': $route.query.group}">
<router-view />
<station-config ref="stationConfig" />
</div>
</div>
</template>
<script>
import StationNav from './stationNav.vue';
import StationConfig from './stationConfig/index.vue';
export default {
name:'IscsSystem',
components: {
// TopNav,
// GroupNav,
// MenuBar,
StationNav
StationNav,
StationConfig
},
data() {
return {
@ -25,7 +27,18 @@ export default {
},
methods:{
selectIscsPane(param) {
this.$refs.stationConfig.showPane(param);
}
}
};
</script>
<style lang="scss" scoped>
.content-box-station{
width: 100%;
height: 100%;
padding: 65px 0 50px 0;
background: #45607B;
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="iscs_fuzhou-01__systerm route-detail"
title="直流1500V保护"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-table border :data="elemList" style="width: 100%;" height="300px">
<el-table-column label="描述" prop="name" />
<el-table-column label="类型" prop="types" />
<el-table-column label="状态" prop="status" />
<el-table-column label="操作" width="120">
<template slot-scope="scope" style="padding: 0;">
<el-button size="mini" type="" style="width: 100%; height: 100%" @click="handleOption(scope.$index, scope.row)">复归选择</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog
v-dialogDrag
class="iscs_fuzhou-01__systerm route-detail"
title="请执行或取消操作"
:visible.sync="showSublayer"
width="400px"
:before-close="doCloseSublayer"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form label-width="100px" size="small" label-position="left" :model="formModel">
<el-form-item label="控制点">
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.name }}</div>
</el-form-item>
<el-form-item label="控制动作">
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.action }}</div>
</el-form-item>
<el-form-item label="操作信息">
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.info }}</div>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button type="primary" @click="commit">执行</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button @click="doCloseSublayer">取消</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
export default {
name: '',
data() {
return {
dialogShow: false,
showSublayer: false,
elemList: [],
model: {},
rowData: {},
activeIndex: -1,
formModel: {
name: '直流1500V 保护开关控制阀',
action: '某某开关控制阀 保护动作复归',
info: '复归'
}
};
},
computed: {
show() {
return this.dialogShow;
}
},
mounted() {
},
methods: {
doShow(models) {
this.model = models;
this.dialogShow = true;
this.elemList = [
{
name: '1500V 201保护动作复归',
types: 'DO',
status: '',
fault: models['fault'] || false
},
{
name: '1500V 202保护动作复归',
types: 'DO',
status: '',
fault: models['fault'] || false
},
{
name: '1500V 211保护动作复归',
types: 'DO',
status: '',
fault: models['fault'] || false
},
{
name: '1500V 212保护动作复归',
types: 'DO',
status: '',
fault: models['fault'] || false
},
{
name: '1500V 213保护动作复归',
types: 'DO',
status: '',
fault: models['fault'] || false
},
{
name: '1500V 214保护动作复归',
types: 'DO',
status: '',
fault: models['fault'] || false
}
];
},
handleOption(index, row) {
this.activeIndex = index;
this.rowData = JSON.parse(JSON.stringify(row));
this.showSublayer = true;
},
commit() {
this.showSublayer = false;
this.rowData.fault = false;
this.rowData.status = '完成';
this.elemList.splice(this.activeIndex, 1, this.rowData);
this.activeIndex = -1;
const arr = [];
this.elemList.forEach(item => {
if (item.fault) {
arr.push(item);
}
});
if (!arr.length) {
const device = this.$iscs.iscsDevice['IscsButton_6'];
device.model['fault'] = false;
if (device && device.instance) {
device.instance.setState({
backgroundColor: '#00CC00'
});
}
const arr = [];
this.$store.state.iscs.faultList.forEach(item => {
if (item.stationName == this.$route.query.stationName) {
item.list.forEach(ele => {
if (ele.code == 'IscsButton_6') {
ele.fault = false;
}
});
}
arr.push(item);
});
this.$store.commit('iscs/setFaultList', arr);
}
},
doCloseSublayer() {
this.showSublayer = false;
},
doClose() {
this.dialogShow = false;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -0,0 +1,337 @@
<template>
<div>
<el-dialog
v-dialogDrag
class="iscs_fuzhou-01__systerm route-detail"
:title="title"
:visible.sync="show"
width="500px"
:before-close="doClose"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-table border :data="elemList" style="width: 100%;" height="300px">
<el-table-column label="描述" prop="name" />
<el-table-column label="类型" prop="types" />
<el-table-column label="状态" prop="status" />
<el-table-column label="操作" width="120">
<template slot-scope="scope" style="padding: 0;">
<el-button size="mini" type="" style="width: 100%; height: 100%" @click="handleOption(scope.$index, scope.row)">{{ scope.row[scope.row.key] ? list[scope.row.key][0] : list[scope.row.key][1] }}选择</el-button>
</template>
</el-table-column>
</el-table>
</el-dialog>
<el-dialog
v-dialogDrag
class="iscs_fuzhou-01__systerm route-detail"
title="请执行或取消操作"
:visible.sync="showSublayer"
width="400px"
:before-close="doCloseSublayer"
:z-index="2000"
:modal="false"
:close-on-click-modal="false"
>
<el-form label-width="100px" size="small" label-position="left" :model="formModel">
<el-form-item label="控制点">
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.name }}</div>
</el-form-item>
<el-form-item label="控制动作">
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.action }}</div>
</el-form-item>
<el-form-item label="操作信息">
<div style="line-height: 15px; box-shadow: 0px 0px 2px inset #a2a2a2; padding: 5px;">{{ formModel.info }}</div>
</el-form-item>
</el-form>
<el-row justify="center" class="button-group">
<el-col :span="10" :offset="2">
<el-button type="primary" @click="commit">执行</el-button>
</el-col>
<el-col :span="8" :offset="4">
<el-button @click="doCloseSublayer">取消</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</template>
<script>
import mapElement from '@/iscs/status/mapElement.js';
import {deviceFactory} from '@/iscs/utils/parser';
import { setNum } from '@/iscs/status/mapElement.js';
export default {
name: '',
data() {
return {
dialogShow: false,
showSublayer: false,
activeIndex: -1,
title: '',
rowData: {},
elemList: [],
model: {},
formModel: {
name: '35KV高压开关室 35KV动力变馈线柜-CT5/1',
action: '短路器遥控开关分闸',
info: ''
},
list: {
valve: ['控合', '控分']
}
};
},
computed: {
show() {
return this.dialogShow;
}
},
methods: {
doShow(models) {
this.model = models;
this.dialogShow = true;
this.title = models.name || '弹窗名称';
this.elemList = [];
models.statusList.forEach(item => {
if (!this.elemList.length) {
this.elemList = [
{
name: item.des,
types: 'DO',
key: item.key,
status: '',
[item.key]: models[item.key] || false
}
];
} else {
const arr = this.elemList.filter(ele => ele.key == item.key);
if (!arr.length) {
this.elemList.push({
name: item.des,
types: 'DO',
key: item.key,
status: '',
[item.key]: false
});
}
}
});
},
commit() {
this.showSublayer = false;
this.rowData[this.rowData.key] = !this.rowData[this.rowData.key];
this.elemList.splice(this.activeIndex, 1, this.rowData);
if (this.model.code == 'group_3' || this.model.code == 'group_16') {
if (this.rowData[this.rowData.key]) {
this.model[this.rowData.key] = this.rowData[this.rowData.key];
this.handleModel(this.model);
this.relevance();
} else {
if (this.$iscs.iscsDevice['group_15'].model['valve']) {
this.model[this.rowData.key] = this.rowData[this.rowData.key];
this.handleModel(this.model);
} else {
console.log('不允许点击');
}
}
} else if (this.model.code == 'group_24' || this.model.code == 'group_53' || this.model.code == 'group_35' || this.model.code == 'group_43' || this.model.code == 'group_47' || this.model.code == 'group_48') {
if (this.rowData[this.rowData.key]) {
this.model[this.rowData.key] = this.rowData[this.rowData.key];
this.handleModel(this.model);
} else {
if (!this.$iscs.iscsDevice['IscsButton_6'].model['fault']) {
this.model[this.rowData.key] = this.rowData[this.rowData.key];
this.handleModel(this.model);
} else {
console.log('不允许点击');
}
}
} else {
this.model[this.rowData.key] = this.rowData[this.rowData.key];
this.handleModel(this.model);
this.relevance();
}
},
//
relevance() {
let time = 0;
let modelRelevance = {};
if (this.model.code == 'group_2' && this.model['valve']) {
modelRelevance = this.$iscs.iscsDevice['group_34'].model;
modelRelevance['valve'] = this.model['valve'];
} else if (this.model.code == 'group_52' && this.model['valve']) {
modelRelevance = this.$iscs.iscsDevice['group_22'].model;
modelRelevance['valve'] = this.model['valve'];
}
if (modelRelevance && modelRelevance.code) {
this.handleModel(modelRelevance);
time = 1500;
}
setTimeout(() => {
if ((this.model.code == 'group_2' && this.model['valve']) || (this.model.code == 'group_52' && this.model['valve'])) {
const model1 = this.$iscs.iscsDevice['group_9'].model;
model1['valve'] = this.model['valve'];
const model2 = this.$iscs.iscsDevice['group_21'].model;
model2['valve'] = this.model['valve'];
const model3 = this.$iscs.iscsDevice['group_19'].model;
model3['valve'] = this.model['valve'];
const model4 = this.$iscs.iscsDevice['group_8'].model;
model4['valve'] = this.model['valve'];
this.handleModel(model1);
this.handleModel(model2);
this.handleModel(model3);
this.handleModel(model4);
time = 1500;
}
setTimeout(() => {
let model = {};
// valve true 绿 false
if (this.model.code == 'group_2' || this.model.code == 'group_52') {
model = this.$iscs.iscsDevice['group_54'].model;
model['valve'] = !(this.$iscs.iscsDevice['group_2'].model['valve'] || this.$iscs.iscsDevice['group_52'].model['valve']);
} else if (this.model.code == 'group_3' || this.model.code == 'group_16') {
model = this.$iscs.iscsDevice['group_15'].model;
model['valve'] = !(this.$iscs.iscsDevice['group_3'].model['valve'] || this.$iscs.iscsDevice['group_16'].model['valve']);
}
if (model && model.code) {
this.handleModel(model);
time = 1500;
}
setTimeout(() => {
if (this.model.code == 'group_2' && !this.model['valve']) {
modelRelevance = this.$iscs.iscsDevice['group_34'].model;
modelRelevance['valve'] = this.model['valve'];
} else if (this.model.code == 'group_52' && !this.model['valve']) {
modelRelevance = this.$iscs.iscsDevice['group_22'].model;
modelRelevance['valve'] = this.model['valve'];
}
if (modelRelevance && modelRelevance.code) {
this.handleModel(modelRelevance);
}
}, time);
}, time);
}, time);
},
//
handleModel(model) {
const arr = [];
model.statusList.forEach(item => {
if (item.key == 'valve' && item.value == model.valve) {
item.childList.forEach(ele => {
Object.values(model.elemMap).forEach(elem => {
if (elem.type == ele.type) {
arr.push({
code: elem.code,
...mapElement[ele.type].stateMap[ele.status]
});
}
});
});
}
});
const models = [{...model, valve: model.valve}];
this.$store.dispatch('iscs/updateIscsDevices', models.map(el => {
const device = deviceFactory(el._type, el);
return device.model;
}));
if (model.lineCode) {
//
model.lineCode.forEach(item => {
arr.push({
code: item,
strokeColor: model.valve ? '#00FF1E' : '#FF0000'
});
});
}
//
arr.forEach(el => {
const device = this.$iscs.iscsDevice[el.code];
if (device && device.instance) {
device.instance.setState(el);
}
});
const textList = setNum(Object.values(model.elemMap), model.valve);
textList.forEach(el => {
const device = this.$iscs.iscsDevice[el.code];
if (device && device.instance) {
device.instance.setState(el);
}
});
const params = {
name: model.name,
times: this.filterTime(),
station: this.$route.query.stationName,
key: 'valve',
valve: model.valve
};
this.$store.dispatch('iscs/setAddAlarmList', params);
this.$store.dispatch('iscs/setAddIncidentList', params);
const arrList = [];
this.$store.state.iscs.faultList.forEach(item => {
if (item.stationName == this.$route.query.stationName) {
item.list.forEach(ele => {
if (ele.code == model.code) {
ele.valve = false;
}
});
}
arrList.push(item);
});
this.$store.commit('iscs/setFaultList', arrList);
if (model.code == 'group_34' || model.code == 'group_22') {
const judge = !(this.$iscs.iscsDevice['group_34'].model['valve'] || this.$iscs.iscsDevice['group_22'].model['valve']);
['IscsText_112', 'IscsText_113', 'IscsText_114', 'IscsText_116', 'IscsText_117', 'IscsText_118', 'IscsText_119', 'IscsText_120'].forEach(code => {
const device = this.$iscs.iscsDevice[code];
if (device && device.instance) {
device.instance.setState({
gbColor: judge ? '#2aff00' : '#ff0000'
});
}
});
}
},
doClose() {
this.dialogShow = false;
},
handleOption(index, row) {
this.activeIndex = index;
this.formModel.info = row[row.key] ? this.list[row.key][0] : this.list[row.key][1];
this.rowData = JSON.parse(JSON.stringify(row));
this.showSublayer = true;
},
doCloseSublayer() {
this.showSublayer = false;
},
filterTime() {
const date = new Date();
const dateTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', date);
return dateTime;
},
dateFormat(fmt, date) {
let ret;
const opt = {
'Y+': date.getFullYear().toString(), //
'm+': (date.getMonth() + 1).toString(), //
'd+': date.getDate().toString(), //
'H+': date.getHours().toString(), //
'M+': date.getMinutes().toString(), //
'S+': date.getSeconds().toString() //
};
for (const k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt);
if (ret) {
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0')));
}
}
return fmt;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>

View File

@ -0,0 +1,202 @@
<template>
<div v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.6)" style="width:100%;height:100%;">
<div class="Substation" :style="{'background':bacground}">
<div class="Substation_header">{{ title }}</div>
<div v-if="mode.includes('environmentFive')" class="environmentFive-box">
<div class="button_box" :class="{'active': mode == 'environmentFive01'}" @click="handleButton('01', mode == 'environmentFive01')">小系统1模式</div>
<div class="button_box" :class="{'active': mode == 'environmentFive02'}" @click="handleButton('02', mode == 'environmentFive02')">小系统2模式</div>
<div class="button_box" :class="{'active': mode == 'environmentFive03'}" @click="handleButton('03', mode == 'environmentFive03')">小系统3模式</div>
</div>
<div v-if="mode.includes('environmentNine')" class="environmentFive-box">
<div class="button_box" :class="{'active': mode == 'environmentNine01'}" @click="handleIllumination('01', mode == 'environmentNine01')">照明系统</div>
<div class="button_box" :class="{'active': mode == 'environmentNine02'}" @click="handleIllumination('02', mode == 'environmentNine02')">照明系统监测</div>
</div>
<div v-if="mode.includes('environmentEleven') || mode.includes('environmentTwelve')" class="environmentFive-box">
<div class="button_box" :class="{'active': mode == 'environmentEleven'}" @click="handleEnvironment('environmentEleven', mode == 'environmentEleven', '人防门')">人防门</div>
<div class="button_box" :class="{'active': mode == 'environmentTwelve'}" @click="handleEnvironment('environmentTwelve', mode == 'environmentTwelve', '防淹门系统')">防淹门</div>
</div>
<div>
<iscsSystem ref="iscsPlate" />
</div>
<!-- <div class="psdSystem_footer">
<div class="prevButton">{{}}</div>
<div class="nextButton">{{}}</div>
</div> -->
</div>
</div>
</template>
<script>
import iscsSystem from './iscsCanvas';
import {getIscsData} from '@/api/iscs';
export default {
name:'Environment',
components:{
iscsSystem
},
props: {
stationName: {
type: String,
default: ''
},
stationId: {
type: String,
default: ''
},
mode: {
type: String,
default: ''
}
},
data() {
return {
title: '',
bacground: 'rgba(0,0,0,0)',
loading: false,
width: window.innerWidth,
scaleRate: window.innerWidth / 1920,
height: 1000,
system: ''
};
},
watch:{
'mode':function() {
this.getInitData();
}
},
methods:{
handleButton(type, judge) {
if (!judge) {
this.mode = `environmentFive${type}`;
this.system = 'environmentFive';
this.title = `${this.stationName} 小系统${Number(type)}原理图`;
this.getDetail();
}
},
handleIllumination(type, judge) {
if (!judge) {
this.mode = `environmentNine${type}`;
this.system = 'environmentNine';
this.title = `${this.stationName} 照明系统`;
this.getDetail();
}
},
handleEnvironment(type, judge, name) {
if (!judge) {
this.mode = type;
this.title = `${this.stationName} ${name}`;
this.getDetail();
}
},
getInitData() {
this.system = 'environment';
if (this.mode == 'environmentThree') {
this.title = this.stationName + ' 隧道通风系统';
this.scaleRate = window.innerWidth / 2000;
this.height = 1000;
} else if (this.mode == 'environmentFour') {
this.title = this.stationName + ' 大系统';
this.scaleRate = window.innerWidth / 2000;
this.height = 900;
} else if (this.mode == 'environmentFive') {
this.mode = 'environmentFive01';
this.system = 'environmentFive';
this.title = this.stationName + ' 小系统1原理图';
this.scaleRate = window.innerWidth / 2000;
this.height = 800;
} else if (this.mode == 'environmentSix') {
this.title = this.stationName + ' 冷水系统 原理图';
this.scaleRate = window.innerWidth / 2000;
this.height = 900;
} else if (this.mode == 'environmentSeven') {
this.title = this.stationName + ' 多联空调 原理图';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
} else if (this.mode == 'environmentEight') {
this.title = this.stationName + ' A端 给排水系统';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
} else if (this.mode == 'environmentNine') {
this.system = 'environmentNine';
this.mode = 'environmentNine01';
this.title = this.stationName + ' 照明系统';
this.scaleRate = window.innerWidth / 1920;
this.height = 800;
} else if (this.mode == 'environmentTen') {
this.title = this.stationName + ' 自动扶梯系统';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
} else if (this.mode == 'environmentThirteen') {
this.title = this.stationName + ' 传感器';
this.scaleRate = window.innerWidth / 1920;
this.height = 1000;
} else if (this.mode == 'environmentEleven') {
this.title = this.stationName + ' 人防门';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
} else if (this.mode == 'environmentTwelve') {
this.title = this.stationName + ' 防淹门系统';
this.scaleRate = window.innerWidth / 1920;
this.height = 900;
}
this.getDetail();
},
getDetail() {
const params = {
// lineCode: this.$route.query.lineCode,
mapId: this.$route.query.mapId,
system: this.system,
totalSystem :'environment02',
userInterface : this.mode
};
this.loading = true;
this.$refs.iscsPlate.show({}, this.width, this.height, this.scaleRate);
getIscsData(params).then(resp=>{
this.loading = false;
if (resp.data) {
const data = JSON.parse(resp.data.graphData);
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
document.querySelector('.Substation').scrollTop = 0;
} else {
this.loading = false;
}
});
}
}
};
</script>
<style lang="scss" scoped>
.Substation_header{
text-align: center;
margin-top: 15px;
color: #d8e9a5;
font-size: 25px;
}
.Substation{
display: inline-block;
width:100%;
height:100%;
overflow-x: hidden;
overflow-y: auto;
vertical-align: top;
}
.SubstationIn{
display: inline-block;
}
.environmentFive-box{
position: absolute;
right: 60px;
top: 68px;
z-index: 100;
.button_box{
background: #D1C1C4;
border: 1px solid #fff;
float: left;
padding: 8px 10px;
cursor: pointer;
font-size: 14px;
&.active{
color: #939393;
}
}
}
</style>

View File

@ -0,0 +1,53 @@
<template>
<div style="height: 100%; width: 100%;overflow-y:hidden;overflow-x:hidden;position: relative;">
<psd-system v-if="mode=='psdSystem'" :station-name="stationName" />
<substation v-else-if="mode=='substation'" :station-id="stationId" :station-name="stationName" />
<environment v-else-if="mode.includes('environment')" :station-id="stationId" :station-name="stationName" :mode="mode" />
<fas v-else-if="fasList.includes(mode)" />
<signal-system v-else-if="mode === 'signal'" />
</div>
</template>
<script>
import PsdSystem from './psdSystem.vue';
import Substation from './substation.vue';
import Environment from './environment.vue';
import Fas from './fas.vue';
import SignalSystem from './signalSystem.vue';
export default {
name:'StationConfig',
components: {
PsdSystem,
Substation,
Environment,
Fas,
SignalSystem
},
data() {
return {
mode: '',
stationName:'',
fasList:[
'sensing',
'gas',
'section',
'linkage',
'stationHall',
'platform'
]
};
},
methods:{
showPane(param) {
this.mode = param.type;
this.stationName = param.stationName;
this.stationId = param.stationId;
// debugger;
// this.getInitData
}
}
};
</script>

View File

@ -0,0 +1,327 @@
<template>
<div class="iscsCanvas">
<div :id="iscsId" v-loading="loading" :style="{ width: widthCanvas +'px', height: canvasHeight +'px' }" class="iscs-canvas" />
<valve-dialog ref="valve" />
<protect-reset ref="protectReset" />
<audio id="teleRing" :src="teleRing" preload loop />
</div>
</template>
<script>
import teleRing from '@/assets/AlarmSoundUrgent.wav';
import Vue from 'vue';
import { parser } from '@/iscs/utils/parser';
import Iscs from '@/iscs/iscs';
import ValveDialog from './dialog/valve';
import ProtectReset from './dialog/protectReset';
import mapElement from '@/iscs/status/mapElement.js';
import {deviceFactory} from '@/iscs/utils/parser';
import { setNum } from '@/iscs/status/mapElement.js';
export default {
name: 'IscsStation',
components: {
ValveDialog,
ProtectReset
},
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
loading:false,
widthCanvas:1200,
canvasHeight:500,
scaleRate:1,
teleRing: teleRing
};
},
computed: {
iscsId() {
return ['iscs', (Math.random().toFixed(5)) * 100000].join('_');
}
},
watch: {
'$store.state.iscs.alarmList': function(list) {
if (list.length) {
if (document.querySelector('#teleRing')) {
document.querySelector('#teleRing').play();
}
}
},
'$store.state.iscs.closeMusicNum': function(val) {
if (val) {
document.querySelector('#teleRing').pause();
this.$store.commit('iscs/setCloseMusic', 0);
}
}
},
methods:{
show(iscsData, widthCanvas, canvasHeight, scaleRate) {
this.loading = true;
this.widthCanvas = widthCanvas;
this.canvasHeight = canvasHeight;
this.scaleRate = scaleRate;
const parserData = parser(iscsData, {width: this.widthCanvas, height: this.canvasHeight});
this.$iscs = new Iscs({
dom: document.getElementById(this.iscsId),
config: {
renderer: 'canvas',
width: this.widthCanvas,
height: this.canvasHeight
},
options: {
scaleRate: this.scaleRate,
offsetX: 0,
offsetY: 0
},
methods: {
viewLoaded: this.handleViewLoaded
}
});
Vue.prototype.$iscs = this.$iscs;
this.setIscs(parserData, iscsData);
this.$store.dispatch('iscs/setIscsData', iscsData);
if (this.$route.query.group) {
this.$iscs.on('dblclick', this.onDblclick, this);
this.$iscs.on('click', this.onlclick, this);
}
},
onDblclick(em) {
//
if (em.deviceType == 'IscsGroup') {
this.$iscs.iscsDevice[em.deviceModel.code].instance.hide();
this.$refs.valve.doShow(em.deviceModel);
} else if (em.deviceType == 'IscsButton' && ['OperatingButton'].includes(em.deviceModel.function)) {
this.$refs.protectReset.doShow(em.deviceModel);
}
},
onlclick(em) {
//
const query = {
stationName: this.$route.query.stationName,
stationId: this.$route.query.stationId,
group: this.$route.query.group,
mapId: this.$route.query.mapId,
lineCode:'02',
noPreLogout:this.$route.query.noPreLogout,
partId: ''
};
let type = '';
if (em.deviceType == 'IscsButton') {
if (em.deviceModel.function == 'goToStand') {
type = 'afcTwo02';
} else if (em.deviceModel.function == 'goToStation') {
type = 'afcOne02';
} else if (em.deviceModel.function.includes('goFireStation-') ) {
type = 'stationHall';
query.partSign = em.deviceModel.function.replace('goFireStation-', '');
} else if (em.deviceModel.function.includes('goFireStand-') ) {
type = 'platform';
query.partSign = em.deviceModel.function.replace('goFireStand-', '');
} else if (em.deviceModel.function === 'ElementShow') {
type = '';
switch (em.deviceModel.hideType) {
case 'alarmLamp':
this.$iscs.hideShowElementType('IscsPicture', 'alarmLamp');
break;
case 'smokeDetector':
this.$iscs.hideShowElementType('IscsPicture', 'smokeDetector');
break;
case 'fireDamper':
this.$iscs.hideShowElementType('IscsPicture', 'fireDamper');
break;
case 'alarmButton':
this.$iscs.hideShowElementType('IscsPicture', 'alarmButton');
break;
}
}
if (type) {
this.$router.replace({ path: `/displayIscs/system/stationConfig/${type}`, query: query });
}
}
},
//
handleViewLoaded() {
this.loading = false;
var arr = Object.keys(this.$iscs.iscsDevice);
if (arr.length != 0) {
this.$store.state.iscs.faultList.forEach(item => {
if (item.stationName == this.$route.query.stationName) {
item.list.forEach(ele => {
const device = this.$iscs.iscsDevice[ele.code];
device.model = Object.assign(device.model, ele);
if (device.model._type == 'IscsButton') {
if (device && device.instance) {
device.instance.setState({
backgroundColor: device.model['fault'] ? '#FF0000' : '#00CC00'
});
}
} else {
this.handleModel(device.model);
}
});
}
});
}
this.$emit('viewLoaded');
},
setIscs(data, oldData) {
this.$iscs.setIscs(oldData, data, this.$route.query.lineCode);
},
//
handleModel(model) {
const arr = [];
model.statusList.forEach(item => {
if (item.key == 'valve' && item.value == model.valve) {
item.childList.forEach(ele => {
Object.values(model.elemMap).forEach(elem => {
if (elem.type == ele.type) {
arr.push({
code: elem.code,
...mapElement[ele.type].stateMap[ele.status]
});
}
});
});
}
});
const models = [{...model, valve: model.valve}];
this.$store.dispatch('iscs/updateIscsDevices', models.map(el => {
const device = deviceFactory(el._type, el);
return device.model;
}));
if (model.lineCode) {
//
model.lineCode.forEach(item => {
arr.push({
code: item,
strokeColor: model.valve ? '#00FF1E' : '#FF0000'
});
});
}
//
arr.forEach(el => {
const device = this.$iscs.iscsDevice[el.code];
if (device && device.instance) {
device.instance.setState(el);
}
});
const textList = setNum(Object.values(model.elemMap), model.valve);
textList.forEach(el => {
const device = this.$iscs.iscsDevice[el.code];
if (device && device.instance) {
device.instance.setState(el);
}
});
if (model.code == 'group_34' || model.code == 'group_22') {
const judge = !(this.$iscs.iscsDevice['group_34'].model['valve'] || this.$iscs.iscsDevice['group_22'].model['valve']);
['IscsText_112', 'IscsText_113', 'IscsText_114', 'IscsText_116', 'IscsText_117', 'IscsText_118', 'IscsText_119', 'IscsText_120'].forEach(code => {
const device = this.$iscs.iscsDevice[code];
if (device && device.instance) {
device.instance.setState({
gbColor: judge ? '#2aff00' : '#ff0000'
});
}
});
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.iscs-button{
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.iscs-canvas{
margin: 0 auto;
}
.iscsCanvas{
width: 100%;
height: 100%;
overflow-y: auto;
overflow-x: hidden;
}
</style>
<style>
.iscs_fuzhou-01__systerm .el-dialog {
background: rgba(100, 100, 100, 0.3);
border: 2px solid rgb(144, 144, 144, 0.8);
border-radius: 6px;
color: #000;
font-size: 14px;
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__header {
padding: 5px;
height: 26px;
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__footer {
background: #F0F0F0;
opacity: 1;
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__body {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 5px;
padding-right: 5px;
margin: 0px 5px 5px;
border: 2px solid rgba(120, 121, 123, 0.5);
box-shadow: 1px hsla(240, 0%, 100%, 0.5) inset;
background: #F0F0F0;
opacity: 1;
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__title {
position: absolute;
top: 4px;
color: #000;
border-radius: 4px;
padding: 0px 2px;
height: 20px;
line-height: 20px
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__title::before {
content: '';
position: absolute;
top: 0;
left: 0;
-webkit-filter: blur(10px);
filter: blur(10px);
height: 20px;
width: -webkit-fill-available;
background: rgba(128, 128, 128, 0.8);
z-index: -1;
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__headerbtn {
background: linear-gradient(#CD98A0, #C27D6E, #B63022, #C68770);
border: 1px solid #fff;
border-radius: 4px;
top: 4px;
right: 5px;
line-height: 16px;
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__headerbtn .el-icon-close:before {
font-size: 16px;
}
.iscs_fuzhou-01__systerm .el-dialog .el-dialog__headerbtn .el-dialog__close {
color: #fff;
}
</style>

View File

@ -0,0 +1,40 @@
<template>
<div class="psdSystem">
<div class="psdSystem_header">{{ stationName+' 屏蔽门系统' }}</div>
<div>
<!-- <iscsSystem ref="iscsPlate" @viewLoaded="viewLoaded" /> -->
<!-- :width-canvas="width" :canvas-height="height" -->
</div>
<!-- <div class="psdSystem_footer">
<div class="prevButton">{{}}</div>
<div class="nextButton">{{}}</div>
</div> -->
</div>
</template>
<script>
export default {
name:'PsdSystem',
props: {
stationName: {
type: String,
default: ''
}
},
data() {
return {
};
}
};
</script>
<style lang="scss" scoped>
.psdSystem_header{
text-align: center;
margin-top: 15px;
color: #d8e9a5;
font-size: 25px;
}
.psdSystem{
}
</style>

View File

@ -0,0 +1,144 @@
<template>
<div v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.6)" style="width:100%;height:100%;">
<div class="Substation" :style="{'background':bacground}">
<div class="Substation_header">{{ title }}</div>
<div>
<iscsSystem ref="iscsPlate" />
</div>
<!-- <div class="psdSystem_footer">
<div class="prevButton">{{}}</div>
<div class="nextButton">{{}}</div>
</div> -->
</div>
</div>
</template>
<script>
import iscsSystem from './iscsCanvas';
import {getIscsData} from '@/api/iscs';
export default {
name:'Substation',
components:{
iscsSystem
},
props: {
stationName: {
type: String,
default: ''
},
stationId: {
type: String,
default: ''
}
},
data() {
return {
title:'',
bacground:'rgba(0,0,0,0)',
loading:false,
width:window.innerWidth,
scaleRate:window.innerWidth / 2200
};
},
computed:{
height() {
return 970;
}
},
watch:{
'stationId':function() {
this.getInitData();
}
},
methods:{
getInitData() {
const params = {
// lineCode: this.$route.query.lineCode,
mapId: this.$route.query.mapId,
system: 'powerMonitoring',
totalSystem :'powerMonitoring02'
};
if (this.stationId == 'mainHouseOne' || this.stationId == 'mainHouseTwo') {
this.bacground = 'rgba(0,0,0,0)';
this.scaleRate = window.innerWidth / 2200;
if (this.stationId == 'mainHouseOne') {
//
this.title = '主所1主变电所接线图';
} else {
//
this.title = '主所2主变电所接线图';
}
params.userInterface = 'substation';
// parkingLotName
// stationDepotName
} else if (this.stationId == 'controlCenter') {
this.title = '';
this.bacground = '#000';
this.scaleRate = window.innerWidth / 2000;
params.userInterface = 'hybrid';
} else if (this.stationId == 'parkingLot') {
this.title = '清凉山停车场接触网图';
this.scaleRate = window.innerWidth / 2000;
this.bacground = 'rgba(0,0,0,0)';
params.userInterface = 'catenary';
} else if (this.stationId == 'stationDepot') {
this.title = '新店车辆段接触网图';
this.bacground = 'rgba(0,0,0,0)';
this.scaleRate = window.innerWidth / 2000;
params.userInterface = 'catenary';
} else {
const tractionList = ['象峰站', '罗汉山站', '树兜站', '东街口站', '达道站', '三叉街站', '葫芦阵站', '城门站', '胪雷站', '安平站', '梁厝站', '三江口站'];
if (tractionList.includes(this.stationName)) {
this.title = this.stationName + ' 牵引降压混合变电所主接线图';
if (this.stationName == '象峰站') {
params.userInterface = 'combined01';
} else if (this.stationName == '罗汉山站') {
params.userInterface = 'combined02';
} else if (this.stationName == '树兜站') {
params.userInterface = 'combined03';
} else {
params.userInterface = 'combined02';
}
params.system = 'combined';
} else {
this.title = this.stationName + ' 降压变电所主接线图';
params.userInterface = 'stepDown';
}
this.scaleRate = window.innerWidth / 2000;
this.bacground = 'rgba(0,0,0,0)';
}
this.loading = true;
this.$refs.iscsPlate.show({}, this.width, this.height, this.scaleRate);
getIscsData(params).then(resp=>{
if (resp.data) {
this.loading = false;
const data = JSON.parse(resp.data.graphData);
this.$refs.iscsPlate.show(data, this.width, this.height, this.scaleRate);
document.querySelector('.Substation').scrollTop = 0;
} else {
this.loading = false;
}
});
}
}
};
</script>
<style lang="scss" scoped>
.Substation_header{
text-align: center;
margin-top: 15px;
color: #d8e9a5;
font-size: 25px;
}
.Substation{
display: inline-block;
width:100%;
height:100%;
overflow-x: hidden;
overflow-y: auto;
vertical-align: top;
}
.SubstationIn{
display: inline-block;
}
</style>

View File

@ -13,6 +13,32 @@
<div class="station-name" :class="index==0?'station-name-first':index%2==1?'station-name-up':'station-name-down'">{{ item.name }}</div>
</div>
</div>
<div class="rightButtonGroup">
<div class="rightButtonGroupL">
<div class="controlCenter">
<div class="station-list-button" :class="{'active': selectStation == 'controlCenter'}" @click="changeStation('controlCenter')" />
</div>
<div class="stationDepot">
<div class="station-list-button" :class="{'active': selectStation == 'stationDepot'}" @click="changeStation('stationDepot')" />
</div>
<div class="parkingLot">
<div class="station-list-button" :class="{'active': selectStation == 'parkingLot'}" @click="changeStation('parkingLot')" />
</div>
<div class="controlCenterName">控制中心</div>
<div class="parkingLotName">停车场</div>
<div class="stationDepotName">车辆段</div>
</div>
<div class="rightButtonGroupR">
<div class="mainHouseOne">
<div class="station-list-button" :class="{'active': selectStation == 'mainHouseOne'}" @click="changeStation('mainHouseOne')" />
</div>
<div class="mainHouseTwo">
<div class="station-list-button" :class="{'active': selectStation == 'mainHouseTwo'}" @click="changeStation('mainHouseTwo')" />
</div>
<div class="mainHouseOneName">主所1</div>
<div class="mainHouseTwoName">主所2</div>
</div>
</div>
</div>
</div>
</div>
@ -22,6 +48,7 @@ import { getByGroupStationList } from '@/api/jmap/map';
import iscs_icon1 from '@/assets/iscs_system/iscs_icon1.png';
import iscs_icon2 from '@/assets/iscs_system/iscs_icon2.png';
import iscs_icon3 from '@/assets/iscs_system/iscs_icon3.png';
import iscs_icon4 from '@/assets/iscs_system/iscs_icon4.png';
import iscs_icon5 from '@/assets/iscs_system/iscs_icon5.png';
import iscs_icon6 from '@/assets/iscs_system/iscs_icon6.png';
import iscs_icon7 from '@/assets/iscs_system/iscs_icon7.png';
@ -31,7 +58,9 @@ export default {
return {
selectStation: 'mainHouseOne',
stationList:[],
tractionList:[],
buttonId:'substation',
// buttonId:'psdSystem',
buttonList:{
stationDescription:{name:'车站概要', type:'totalSystem', id: 'stationDescription', active:false, icon:iscs_icon1 },
electric: {name:'电力监控系统', type:'totalSystem', id: 'powerMonitoring', active:false, icon:iscs_icon2,
@ -261,7 +290,6 @@ export default {
// }
]}
}
// mode: 'substation'
};
},
async created () {
@ -275,18 +303,14 @@ export default {
name: station.runPlanName.includes('站') ? station.runPlanName : `${station.runPlanName}`,
id: station.code
};
if (station.centralized) {
this.tractionList.push(param.name);
}
this.stationList.push(param);
}
});
}
// if (!this.$route.params.mode) {
// this.selectChildren(this.buttonId, true);
// }
this.selectChildren(this.buttonId);
},
methods:{
changeStation(item) {
@ -294,8 +318,223 @@ export default {
this.selectChildren(this.buttonId);
},
selectChildren(type) { //
let stationName = '';
const station = this.stationList.find(each=>{ return each.id == this.selectStation; });
if (station) {
stationName = station.name;
}
const param = {
stationName: stationName,
stationId: this.selectStation,
type:type
};
this.$emit('selectIscsPane', param);
// const query = {
// stationName: stationName,
// stationId: this.selectStation,
// group: this.group,
// mapId: this.$route.query.mapId,
// lineCode:'02',
// noPreLogout:this.$route.query.noPreLogout
// };
// if (isReplace) {
// this.$router.replace({ path: `/displayIscs/system/stationConfig/${type}`, query: query });
// } else {
// this.$router.push({ path: `/displayIscs/system/stationConfig/${type}`, query: query });
// }
}
}
};
</script>
<style lang="scss" scoped>
.station-nav-out{
position: absolute;
left: 0;
top: 0;
width: 100%;
}
.station-nav{
width: 100%;
height: 65px;
background-color: #ACACAC;
position: relative;
padding-left: 5px;
}
.station-line{
height: 12px;
width: 100%;
position: absolute;
background-image: linear-gradient(to bottom , #9c9c9c, #F0F0F0,#9c9c9c);
top: 25px;
border: 1px #505050 solid;
}
.station-list-box{
width: 1vw;
height: 1vw;
border-radius: 1vw;
background: #ccc;
left: 4px;
top: 50%;
position: absolute;
border-left: 1px #fdfdfd solid;
border-right: 1px #262626 solid;
transform: translateY(-50%);
}
.station-list-box.currentStation::before{
content: '';
width: 128%;
height: 124%;
border: 1px #10ff00 solid;
position: absolute;
left: -16%;
top: -10%;
border-radius: 130%;
}
.station-list-box.active,.station-list-button.active{
background:#cdcd37;
}
.station-name{
font-size:12px;
position:absolute;
}
.station-name-first{
transform: translateX(0%);
top: 45px;
white-space: nowrap;
left: 0%;
}
.station-name-up{
top: 5px;
transform: translateX(-50%);
left: 25%;
white-space: nowrap;
}
.station-name-down{
top: 45px;
// transform: translateX(-25%);
transform: translateX(-38%);
white-space: nowrap;
left: 0%;
}
.station-box-out{
height: 100%;
display: inline-block;
position: relative;
}
.station-box{
display: inline-block;
position: relative;
// margin-right: 1.8vw;
width: 1.5vw;
margin-top: 20px;
cursor: pointer;
}
.leftRect{
width: 6px;
height: 19px;
background-image: linear-gradient(to bottom, #686868, #e9e9e9, #686868);
border: 1px #585858 solid;
display: inline-block;
vertical-align: top;
}
.rightRect{
width: 6px;
height: 19px;
position: absolute;
margin-left: 0.8vw;
background-image: linear-gradient(to bottom, #686868, #e9e9e9, #686868);
border: 1px #585858 solid;
display: inline-block;
vertical-align: top;
}
.stationList{
// display: inline-block;
display: flex;
position: relative;
justify-content: space-between;
float: left;
height: 100%;
width: 82%;
}
.rightButtonGroup{
display: inline-block;
float: right;
width: 17vw;
height: 100%;
}
.rightButtonGroupL{
width: 10vw;
height: 100%;
display: inline-block;
float: left;
position: relative;
border-left: 1px #000 solid;
border-right: 1px #000 solid;
}
.rightButtonGroupR{
width: 7vw;
height: 100%;
display: inline-block;
position: relative;
}
.controlCenter,.stationDepot,.parkingLot{
display: inline-block;
position: relative;
width: 31%;
height: 100%;
vertical-align: top;
float: left;
}
.controlCenterName{
font-size: 12px;
position: absolute;
top: 5px;
left: 0.3vw;
}
.stationDepotName{
font-size: 12px;
position: absolute;
top: 45px;
left: 38%;
}
.parkingLotName{
font-size: 12px;
position: absolute;
top: 5px;
right: 11%;
}
.station-list-button{
width: 1vw;
height: 1vw;
border-radius: 1vw;
background: #ccc;
position: absolute;
border-left: 1px #fdfdfd solid;
border-right: 1px #262626 solid;
left: 50%;
top: 21px;
transform: translateX(-47%);
cursor: pointer;
}
.mainHouseOne,.mainHouseTwo{
display: inline-block;
position: relative;
width: 49%;
height: 100%;
vertical-align: top;
float: left;
}
.mainHouseOneName{
font-size: 12px;
position: absolute;
top: 5px;
left: 0.3vw;
}
.mainHouseTwoName{
font-size: 12px;
position: absolute;
top: 45px;
right: 8%;
}
</style>

View File

@ -16,7 +16,7 @@ const paperStateMap = {
'2': '封存',
'3': '已使用',
}
import { getExamListProject, getPapaerListOfOrg, setExamEffectivey, setExamEfficacy } from '@/api/management/exam'
import { getPapaerListOfOrg, lockPaper, unlockPaper, deletePaper } from '@/api/management/exam'
import { getPublishMapListOnline } from '@/api/jmap/map'
export default {
@ -39,10 +39,6 @@ export default {
type: 'text',
label: '试卷名称:',
},
// creatorName: {
// type: 'text',
// label: ':'
// },
state: {
type: 'select',
label: '状态:',
@ -53,7 +49,6 @@ export default {
},
},
examQueryList: {
// query: getExamListProject,
query: obj => getPapaerListOfOrg({ ...obj, orgId: this.orgId }),
selectCheckShow: false,
indexShow: false,
@ -63,32 +58,8 @@ export default {
prop: 'name',
},
{
title: '归属地图',
prop: 'mapId',
type: 'tag',
width: '200',
columnValue: row => {
return this.$convertField(row.mapId, this.mapIdList, ['id', 'name'])
},
tagType: row => {
return ''
},
},
{
title: '产品类型',
prop: 'prdType',
type: 'tag',
width: '110',
columnValue: row => {
if (row.prdType === '01') {
return '现地工作站'
} else if (row.prdType === '02') {
return '行调工作站'
}
},
tagType: row => {
return ''
},
title: '简介',
prop: 'profile',
},
{
title: '状态',
@ -98,21 +69,7 @@ export default {
columnValue: row => {
return paperStateMap[row.state]
},
tagType: row => {
return ''
},
},
{
title: '试卷规则状态',
prop: 'abnormal',
type: 'tag',
width: '80',
columnValue: row => {
return row.abnormal ? '异常' : '正常'
},
tagType: row => {
return row.abnormal ? 'danger' : 'success'
},
tagType: row => '',
},
{
title: '开始时间',
@ -144,6 +101,7 @@ export default {
title: '创建人',
prop: 'creatorName',
width: '150',
formatter: row => row.creatorInfo.name,
},
{
type: 'button',
@ -162,26 +120,34 @@ export default {
},
{
name: '编辑',
handleClick: this.handleEditExam,
handleClick: this.handleEdit,
type: 'primary',
showControl: row => {
return row.creatorId == this.userId
return row.creatorId == this.userId && row.state === 1
},
},
{
name: '启用',
handleClick: this.handleEnableExam,
name: '封存',
handleClick: this.handleLock,
type: 'warning',
showControl: row => {
return row.creatorId == this.userId /* && row.status == '0' */
return row.creatorId == this.userId && row.state === 1
},
},
{
name: '禁用',
handleClick: this.handleDeleteExam,
name: '解封',
handleClick: this.handleUnlock,
type: 'danger',
showControl: row => {
return row.creatorId == this.userId /* && row.status == '1' */
return row.creatorId == this.userId && row.state === 2
},
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger',
showControl: row => {
return row.creatorId == this.userId && row.state === 1
},
},
],
@ -200,11 +166,6 @@ export default {
},
},
created() {
// const params = localStore.get(this.$route.path) || {}
// if (!params.status) {
// params.status = '1'
// }
// localStore.set(this.$route.path, params)
this.mapIdList = []
getPublishMapListOnline().then(response => {
this.mapIdList = response.data
@ -217,49 +178,67 @@ export default {
handleGradeStatistics(index, row) {
this.$router.push({ path: '/info/gradeStatistics', query: { examId: row.id, name: row.name } })
},
handleEditExam(index, row) {
handleEdit(index, row) {
this.$router.push({ path: `/info/examRule/draft/edit/${row.id}`, query: { source: 'org' } })
},
examCreate() {
this.$router.push({ path: `/info/examRule/draft/add/0`, query: { source: 'org' } })
},
handleEnableExam(index, data) {
setExamEffectivey(data)
handleLock(index, data) {
lockPaper(data.id)
.then(res => {
this.examRefresh()
this.$message.success('启用试卷成功!')
this.$message.success('封存试卷成功!')
})
.catch(error => {
this.$message.error('启用试卷失败:' + error.message)
this.$message.error('封存试卷失败:' + error.message)
})
},
handleDeleteExam(index, data) {
this.$confirm('该操作将禁用试卷,是否继续?', this.$t('global.tips'), {
handleUnlock(index, data) {
this.$confirm('该操作将解封试卷,是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning',
})
.then(() => {
setExamEfficacy(data)
unlockPaper(data.id)
.then(res => {
this.examRefresh()
this.$message({
type: 'success',
message: '禁用试卷成功!',
message: '解封试卷成功!',
})
})
.catch(res => {
if (res.code == '10004') {
this.$message({ type: 'error', message: '禁用失败:试卷已被使用,无法禁用!' })
this.$message({ type: 'error', message: '解封失败:试卷已被使用,无法解封!' })
} else if (res.code == '10003') {
this.$message({ type: 'warning', message: '禁用失败:无权限禁用!' })
this.$message({ type: 'warning', message: '解封失败:无权限解封!' })
} else {
this.$message({ type: 'error', message: '禁用试卷失败!' })
this.$message({ type: 'error', message: '解封试卷失败!' })
}
})
})
.catch(() => {})
},
handleDelete(index, data) {
this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning',
})
.then(() => deletePaper(data.id))
.then(resp => {
this.examRefresh()
this.$message({
type: 'success',
message: '删除成功!',
})
})
.catch(res => {
this.$message({ type: 'error', message: '删除试卷失败!' })
})
},
examRefresh() {
this.$nextTick(() => {
this.$refs.examQueryListPage.refresh(true)

View File

@ -38,7 +38,9 @@
</el-select>
</el-form-item>
<el-form-item label="标签" prop="tags">
<el-select v-model="form.tags"></el-select>
<el-select multiple v-model="form.tags" @change="getQuestionAmount">
<el-option v-for="label in labels" :key="label" :label="label" :value="label"></el-option>
</el-select>
</el-form-item>
<el-form-item label="题目数量" prop="amount">
<el-input-number
@ -65,6 +67,7 @@
<script>
import { getQuestionAmount } from '@/api/management/exam'
import { getLabelList } from '@/api/questionBank'
export default {
name: 'EditRule',
props: {},
@ -116,6 +119,7 @@ export default {
amount: 1,
score: 1,
},
labels: [],
topicNum: 0,
dialogShow: false,
rules: {
@ -127,7 +131,9 @@ export default {
}
},
created() {
getLabelList().then(resp => {
this.labels = resp.data.map(v => ({ label: v, value: v }))
})
},
mounted() {},
methods: {
@ -157,6 +163,7 @@ export default {
orgId: this.$store.state.user.companyId,
groupType: this.form.type,
subType: this.form.subtype,
tags: this.form.tags,
}
getQuestionAmount(param).then(resp => {
this.topicNum = resp.data

View File

@ -25,7 +25,7 @@
</template>
</el-table-column>
<el-table-column prop="score" :label="$t('publish.eachScore')" width="100" />
<el-table-column :label="$t('publish.totalScore')" width="100">
<el-table-column :label="$t('publish.totalScore')" width="90">
<template slot-scope="scope">
<span>{{ Number(scope.row.amount) * Number(scope.row.score) }}</span>
</template>
@ -35,6 +35,11 @@
<span>{{ scope.row.topicNum }}</span>
</template>
</el-table-column>
<el-table-column label="标签">
<template slot-scope="scope">
<el-tag v-for="tag in scope.row.tags" :key="tag">{{ tag }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('global.operate')" width="100">
<template slot-scope="scope">
<el-button type="text" size="small" @click="editRow(scope)">{{ $t('global.edit') }}</el-button>
@ -91,7 +96,6 @@ export default {
created() {},
methods: {
handleAdd() {
this.changeCourseDisable()
this.$refs.addRule.show()
},
handleRuleSubmit(formData, isEdit) {
@ -112,35 +116,11 @@ export default {
const index = data.$index
this.ruleList.splice(index, 1)
},
//
changeCourseDisable() {
this.trainingTypeList.forEach(item => {
item.disabled = false
})
for (const val in this.operationTypeMap) {
this.operationTypeMap[val].forEach(item => {
item.disabled = false
})
}
this.ruleList.forEach(ele => {
this.trainingTypeList.forEach(item => {
if (ele.trainingType == item.value && !ele.operateType) {
item.disabled = true
}
})
;(this.operationTypeMap[ele.trainingType] || []).forEach(item => {
if (ele.operateType && ele.operateType == item.value) {
item.disabled = true
}
})
})
},
checkTotolScores() {
console.log(this.currentTotalScore === this.examData.fullScore)
return this.currentTotalScore === this.examData.fullScore
},
editRow(data) {
this.changeCourseDisable()
this.editingIndex = data.$index
const list = JSON.stringify(data.row)
const detail = JSON.parse(list)