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

This commit is contained in:
joylink_cuiweidong 2022-10-26 18:17:36 +08:00
commit 1381bd8a9c
32 changed files with 1693 additions and 100 deletions

View File

@ -0,0 +1,53 @@
import request from '@/utils/request';
/** 创建权限分发*/
export function createDistribute(data) {
return request({
url: `/api/v3/permission/distribute/create`,
method: 'post',
data
});
}
/** 分页获取权限分发列表*/
export function getDistributeList(data) {
return request({
url: `/api/v3/permission/distribute/paging`,
method: 'post',
data
});
}
// /** 设置权限分发立即失效*/
// export function setDistributeInvalidate(pdId) {
// return request({
// url: `/api/v2/permission/distribute/${pdId}/invalidate`,
// method: 'put'
// });
// }
/** 获取权限分发明细*/
export function getDistributeDetail(disId) {
return request({
url: `/api/v3/permission/distribute/list/distribute/${disId}`,
method: 'get'
});
}
/** 从权限分发,直接分发给指定主体*/
export function setDistributeToSubject(pdId, subjectType, subjectId) {
return request({
url: `/api/v3/permission/distribute/${pdId}/to/${subjectType}/${subjectId}`,
method: 'post'
});
}
/** 生成分发二维码*/
export function getDistributeQrCode(pdId) {
return request({
url: `/api/v3/permission/distribute/${pdId}/qrCode`,
method: 'get'
});
}

View File

@ -0,0 +1,27 @@
import request from '@/utils/request';
/** 删除第三方配置 */
export function deleteThirdAccountConfig(id) {
return request({
url: `/api/thirdAccountConfig/${id}`,
method: 'delete'
});
}
/** 分页查询所有配置 */
export function queryThirdAccountConfig(params) {
return request({
url: `/api/thirdAccountConfig/paged`,
method: 'get',
params
});
}
/** 新增或更新第三方配置 */
export function updateThirdAccountConfig(data) {
return request({
url: `/api/thirdAccountConfig`,
method: 'post',
data
});
}

View File

@ -0,0 +1,27 @@
import request from '@/utils/request';
/** 设置权限失效或有效*/
export function setPermissonInValid(subjectId) {
return request({
url: `/api/v2/permission/subject/inValid/${subjectId}`,
method: 'get'
});
}
/** 用户权限列表*/
export function listPermision(params) {
return request({
url: `/api/v2/permission/subject/page`,
method: 'get',
params: params
});
}
/** 查看用户分发的下级所有用户权限*/
export function getPermissonInDistribute(subjectId) {
return request({
url: `/api/v2/permission/subject/distribute/${subjectId}`,
method: 'get'
});
}

View File

@ -93,7 +93,7 @@
:sort-by="column.sortBy" :sort-by="column.sortBy"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div v-html="scope.row[column.prop]" /> <div style="white-space: pre-wrap;" v-html="scope.row[column.prop]" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

@ -105,7 +105,7 @@ export default {
selectScope: '请选择范围', selectScope: '请选择范围',
questionNumbers: '题数', questionNumbers: '题数',
allNumberTipOne: '此类型有', allNumberTipOne: '此类型有',
allNumberTipTwo: '题', allNumberTipTwo: '题',
scorePerQuestion: '每题分值', scorePerQuestion: '每题分值',
inputQuestionNumber: '请输入题数', inputQuestionNumber: '请输入题数',
inputQuestionNumberError: '输入的题数大于0', inputQuestionNumberError: '输入的题数大于0',

View File

@ -224,9 +224,14 @@ const PisScreen = () => import('@/views/pis/index');
const TransitionIndex = () => import('@/views/temporary/transitionIndex'); const TransitionIndex = () => import('@/views/temporary/transitionIndex');
const Temporary = () => import('@/views/temporary/index'); const Temporary = () => import('@/views/temporary/index');
const ThirdPartyAccounts = () => import('@/views/thirdPartyAccounts/index');
const FunctionManage = () => import('@/views/functionManage/index'); const FunctionManage = () => import('@/views/functionManage/index');
const PermissionManage = () => import('@/views/permissionManage/index'); const PermissionManage = () => import('@/views/permissionManage/index');
const UserRulesManage = () => import('@/views/userRulesManage/index');
const AuthorityTransfer = () => import('@/views/authorityTransfer/index');
const CreateDistribute = () => import('@/views/authorityTransfer/create/index');
const DistributeDetail = () => import('@/views/authorityTransfer/detail');
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth'; // import { getSessionStorage } from '@/utils/auth';
@ -1770,6 +1775,11 @@ export const asyncRouter = [
path: 'usermap/map/draw/:mapId/:view', path: 'usermap/map/draw/:mapId/:view',
component: NewMapDraft, component: NewMapDraft,
hidden: true hidden: true
},
{
path: 'usermap/map/pictureDraw/:mapId/draft',
component: MapDraftPicture,
hidden: true
} }
] ]
}, },
@ -1838,7 +1848,7 @@ export const asyncRouter = [
}, },
{ // 第三方账户配置 { // 第三方账户配置
path: 'ThirdPartyAccounts', path: 'ThirdPartyAccounts',
component: Temporary, component: ThirdPartyAccounts,
meta: { meta: {
i18n: 'newRouter.ThirdPartyAccounts' i18n: 'newRouter.ThirdPartyAccounts'
} }
@ -2061,7 +2071,8 @@ export const asyncRouter = [
{ {
// 权限分发管理 // 权限分发管理
path: 'authorityTransferManage', path: 'authorityTransferManage',
component: Permission, component: AuthorityTransfer,
// component: Permission,
meta: { meta: {
i18n: 'newRouter.authorityTransferManage' i18n: 'newRouter.authorityTransferManage'
} }
@ -2069,10 +2080,17 @@ export const asyncRouter = [
{ {
// 用户权限管理 // 用户权限管理
path: 'userRulesManage', path: 'userRulesManage',
component: UserRules, component: UserRulesManage,
// component: UserRules,
meta: { meta: {
i18n: 'newRouter.userRulesManage' i18n: 'newRouter.userRulesManage'
} }
},
{
// 权限分发管理-创建
path: 'createDistribute',
component: CreateDistribute,
hidden: true
} }
] ]
}, },

View File

@ -0,0 +1,30 @@
<template>
<el-dialog v-dialogDrag title="选择权限" :visible.sync="dialogShow" width="1400px" :before-close="close">
<PermissionList :only-select="true" table-height="450" v-bind="$attrs" v-on="$listeners" />
</el-dialog>
</template>
<script>
import PermissionList from '@/views/permissionManage/index';
export default {
name: 'AddPermission',
components: {
PermissionList
},
data() {
return {
dialogShow: false
};
},
methods: {
doShow() {
this.dialogShow = true;
},
close() {
this.dialogShow = false;
}
}
};
</script>

View File

@ -0,0 +1,201 @@
<template>
<div>
<div class="forms pack-rule">
<el-form ref="dataform" label-position="right" :model="formModel" label-width="80px" :rules="rules" size="mini" @submit.native.prevent>
<el-form-item label="关联权限" prop="permissionIds">
<div>
<el-button size="mini" style="margin-bottom:10px" @click="buttonClick">添加权限</el-button>
<el-table :data="formModel.permissionIds" size="mini" border class="table_item" max-height="400">
<el-table-column prop="permissionId" label="权限id" width="80" />
<el-table-column prop="permissionName" :label="$t('orderAuthor.permissionName')" />
<el-table-column :label="$t('orderAuthor.totalPermissions')" width="160">
<template slot-scope="scope">
<el-input-number v-model="scope.row.amount" :step="1" :min="1" :precision="0" />
</template>
</el-table-column>
<el-table-column :label="$t('global.operate')" width="80">
<template slot-scope="scope">
<el-button type="text" size="small" @click="removePermissions(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-form-item>
<el-form-item :label="$t('orderAuthor.permanenceOrNot')" prop="forever">
<el-radio v-model="formModel.forever" :label="false"></el-radio>
<el-radio v-model="formModel.forever" :label="true"></el-radio>
</el-form-item>
<el-form-item :label="$t('orderAuthor.startTime')" prop="startTime">
<el-date-picker v-model="formModel.startTime" type="datetime" placeholder="选择日期时间" align="right" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item>
<el-form-item v-if="noForever" :label="$t('orderAuthor.endTime')">
<el-date-picker v-model="formModel.endTime" type="datetime" placeholder="选择日期时间" align="right" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss" />
</el-form-item>
<el-form-item label="备注" prop="dsc">
<el-input v-model="formModel.dsc" placeholder="请输入" />
</el-form-item>
</el-form>
</div>
<div class="draft">
<el-button @click="turnback">{{ $t('global.back') }}</el-button>
<el-button type="primary" @click="saveAs">{{ $t('map.confirm') }}</el-button>
</div>
<addPermission ref="addPermission" :select-ids="formModel.permissionIds" @handleSelect="addPermissions" />
</div>
</template>
<script>
import addPermission from '@/views/authorityTransfer/create/addPermission';
import { createDistribute } from '@/api/authorityTransfer';
export default {
name: 'OrderForm',
components: {
addPermission
},
data() {
return {
errorTip: '请输入数量',
errorIntTip: '数量必须为整数',
formModel: {
forever: false,
startTime: '',
endTime: '',
dsc: '',
permissionIds:[]
},
pickerOptions: {
shortcuts: [{
text: '今天',
onClick(picker) {
picker.$emit('pick', new Date());
}
}, {
text: '昨天',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
picker.$emit('pick', date);
}
}, {
text: '一周前',
onClick(picker) {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', date);
}
}]
}
};
},
computed: {
noForever() {
return !this.formModel.forever;
},
rules() {
const _this = this;
const baseRules = {
permissionIds: [
{ required: true, message: '请添加权限', trigger: 'change' },
{
validator(rule, value, callback) {
if (Array.isArray(value) && value.length > 0) {
callback();
} else {
callback(new Error('请添加权限'));
}
},
trigger: 'blur'
}
],
forever: [
{ required: true, message: this.$t('rules.pleaseSelect'), trigger: 'change' }
],
amount: [
{ required: true, message: this.$t('rules.authorAmountInput'), trigger: 'change' },
{
validator(rule, value, callback) {
if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback();
} else {
callback(new Error(_this.$t('rules.authorAmountInputError')));
}
},
trigger: 'blur'
}
],
startTime: [
{ required: true, message: this.$t('rules.startTimePick'), trigger: 'change' }
],
dsc: [
{ required: true, message: '请输入备注', trigger: 'change' }
]
};
//
this.$nextTick(function () {
this.$refs.dataform.clearValidate();
});
return baseRules;
}
},
methods: {
buttonClick() {
this.$refs.addPermission.doShow();
},
validateChoose(rule, value, callback) {
if (value || value === 0) {
if (Number.isInteger(value)) {
callback();
} else {
callback(new Error(this.errorIntTip));
}
} else {
callback(new Error(this.errorTip));
}
},
addPermissions(row) {
const data = {
'permissionId': row.id,
'permissionName': row.name,
'amount': 1
};
this.formModel.permissionIds.push(data);
},
removePermissions(data) {
this.formModel.permissionIds = this.formModel.permissionIds.filter(({ permissionId }) => permissionId !== data.permissionId);
},
turnback() {
this.$router.go(-1);
},
saveAs() {
this.$refs['dataform'].validate((valid) => {
if (!valid) { return; }
this.loading = true;
createDistribute(this.formModel).then(response => {
this.loading = false;
this.$message.success('创建成功!');
this.turnback();
}).catch(() => {
this.loading = false;
this.$message.error('创建失败!');
});
});
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.pack-rule {
width: 800px;
margin: 0 auto;
margin-top: 12px;
padding: 40px;
}
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<el-dialog v-dialogDrag title="权限详情" :visible.sync="dialogShow" width="800px" :before-close="handleClose">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div slot="footer">
<el-button type="primary" @click="handleClose">{{ $t('global.return') }}</el-button>
</div>
</el-dialog>
</template>
<script>
import { getDistributeDetail } from '@/api/authorityTransfer';
export default {
name: 'DistributeDetail',
data() {
return {
dialogShow: false,
height: 0,
disId: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
show: false
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
paginationHiden: true,
indexShow: true,
columns: [
{
title: '权限id',
width: '80',
prop: 'permissionId'
},
{
title: '权限名称',
prop: 'permissionName'
},
{
title: '总数量',
width: '80',
prop: 'amount'
},
{
title: '剩余数量',
width: '80',
prop: 'remains'
}
]
}
};
},
methods: {
doShow(row) {
this.disId = row.id || '';
this.reloadTable();
this.dialogShow = true;
},
queryFunction(params) {
return getDistributeDetail(this.disId);
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
handleClose() {
this.dialogShow = false;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -0,0 +1,186 @@
<template>
<el-dialog title="权限分发到指定用户" :visible.sync="dialogVisible" width="1200px" :before-close="doClose" center :close-on-click-modal="false">
<QueryListPage ref="queryListPage1" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { getUserList } from '@/api/management/user';
import { setDistributeToSubject } from '@/api/authorityTransfer';
import { getCompanyList } from '@/api/company';
export default {
name:'DistributePackage',
data() {
return {
packageId:'',
dialogVisible:false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
companyMap: {},
companyList: [],
countTypeList:[
{label:'个人账户', value:'1'},
{label:'企业账户', value:'2'},
{label:'企业账户下子账户', value:'3'}
],
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('system.name')
},
id: {
type: 'text',
label: 'id'
},
roles: {
type: 'select',
label: this.$t('system.roles'),
config: {
data: this.$ConstSelect.roleList
}
},
nickname: {
type: 'text',
label: '昵称'
},
mobile: {
type: 'text',
label: '手机号'
},
email: {
type: 'text',
label: '邮箱'
},
companyId: {
type: 'select',
label: '组织',
config: {
data: []
}
},
type:{
type: 'select',
label: '类型',
config: {
data: []
}
}
}
},
queryList: {
query: getUserList,
selectCheckShow: false,
height: '420',
indexShow: true,
columns: [
{
title: 'id',
prop: 'id',
width: 80
},
{
title: this.$t('system.name'),
prop: 'name'
},
{
title: this.$t('system.nickname'),
prop: 'nickname'
},
{
title: '类型',
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.getCountType(row.type); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('global.mobile'),
prop: 'mobile'
},
{
title: this.$t('global.email'),
prop: 'email'
},
{
title: '组织',
prop: 'companyId',
type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.companyId); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.roles'),
prop: 'roles',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '90',
buttons: [
{
name: '选择',
handleClick: this.distributePackage
}
]
}
]
}
};
},
created() {
this.companyMap = {};
this.companyList = [];
getCompanyList().then(resp => {
if (resp && resp.data && resp.data.length) {
resp.data.forEach(item => {
this.companyMap[item.id] = item.name;
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
this.queryForm.queryObject.companyId.config.data = this.companyList;
this.queryForm.queryObject.type.config.data = this.countTypeList;
}
}).catch((error) => {
console.error(error);
});
},
methods:{
doShow(data) {
this.packageId = data.id;
this.dialogVisible = true;
},
doClose() {
this.dialogVisible = false;
},
getCountType(type) {
const countType = this.countTypeList.find(each=>{ return each.value == type; });
return countType ? countType.label : '';
},
getCompanyName(companyId) {
return this.companyMap[companyId];
},
distributePackage(index, row) {
if (this.packageId) {
const accountId = row.id;
const subjectType = row.type == '1' ? 'user' : 'org';
setDistributeToSubject(this.packageId, subjectType, accountId).then(resp=> {
this.$message.success('权限分发给指定账户成功!');
this.$emit('reloadTable');
this.doClose();
}).catch(() => {
this.$messageBox('权限分发给指定账户失败');
});
}
}
}
};
</script>

View File

@ -0,0 +1,152 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<qr-code ref="qrCode" />
<distribute-package ref="distributePackage" @reloadTable="reloadTable" />
<Detail ref="detail" />
</div>
</template>
<script>
import { admin } from '@/router/index';
import { getDistributeList, getDistributeQrCode } from '@/api/authorityTransfer';
import QrCode from '@/components/QrCode';
import DistributePackage from './distributePackage';
import Detail from './detail';
export default {
name: 'Author',
components: {
QrCode,
Detail,
DistributePackage
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '100px',
reset: false,
queryObject: {
dsc: {
type: 'text',
label: '备注'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '权限分发Id',
width: '100',
prop: 'id'
},
{
title: '备注',
prop: 'dsc'
},
{
title: this.$t('orderAuthor.founder'),
prop: 'nickName'
},
{
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
width: '80',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: this.$t('orderAuthor.startTime'),
prop: 'startTime',
width: '160'
},
{
title: this.$t('orderAuthor.endTime'),
prop: 'endTime',
width: '160'
},
{
title: '创建时间',
prop: 'createTime',
width: '160'
},
{
title: '更新时间',
prop: 'updateTime',
width: '160'
},
{
type: 'button',
title: this.$t('global.operate'),
width: this.$i18n.locale == 'en' ? '400' : '300',
hide: (row) => { return this.$store.state.user.roles.indexOf(admin) < 0; },
buttons: [
{
name: this.$t('orderAuthor.obtainQrCode'),
handleClick: this.handleRtCodeShow,
type: ''
},
{
name: '权限详情',
handleClick: this.handleDetailShow,
type: ''
},
{
name: '领取到',
handleClick: this.distributePackage,
type: ''
}
]
}
],
actions: [
{ text: '创建权限分发', handler: this.handleCreatePackage }
]
}
};
},
methods: {
queryFunction(params) {
return getDistributeList(params);
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
handleDetailShow(index, row) {
this.$refs.detail.doShow(row);
},
handleRtCodeShow(index, row) {
getDistributeQrCode(row.id).then(resp => {
this.$refs.qrCode.doShow({
url: resp.data,
title: this.$t('orderAuthor.privilegeTransferQRCode')
});
}).catch(() => {
this.$message.error('获取二维码失败!');
});
},
handleCreatePackage() {
this.$router.push({ path: `/systemManagement/permissionDataManage/createDistribute` });
},
distributePackage(index, row) {
this.$refs.distributePackage.doShow(row);
}
}
};
</script>

View File

@ -119,8 +119,4 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style> </style>

View File

@ -0,0 +1,69 @@
<template>
<div>
<station-diagram ref="stationDiagram" @setSelected="setSelected" />
</div>
</template>
<script>
import StationDiagram from '../stationDiagram/index';
import {mapGetters} from 'vuex';
export default {
name: 'BigScreen',
components: {
StationDiagram
},
data() {
return {
selected: null
};
},
computed: {
...mapGetters('map', [
'sectionList',
'signalList',
'trainWindowList'
]),
mapData() {
return this.$store.state.map.map;
},
mapDevice() {
return this.$store.state.map.mapDevice;
}
},
watch: {
'$store.state.map.initJlmapLoadedCount': function (val) {
this.handleBigScreenData();
},
mapDevice() {
return this.$store.state.map.mapDevice;
}
},
methods: {
setSelected(val) {
this.selected = val;
},
handleBigScreenData() {
const logicData = {routeData:this.$store.state.map.routeData, autoReentryData: this.$store.state.map.autoReentryData};
const repaint = this.$store.state.map.initJlmapLoadedCount === 1;
this.$jlmap.setMap(this.mapData, this.mapDevice, logicData, repaint);
if (this.mapData && this.mapData.pictureList) {
const picture = this.$store.state.map.map.pictureList.find(picture => picture.type === 'bigScreen');
if (picture) {
this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap);
const deviceList = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const deviceCode in mapDevice) {
deviceList.push(deviceCode);
}
this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(picture.scaling, picture.origin);
}
}
}
}
};
</script>
<style scoped>
</style>

View File

@ -16,9 +16,8 @@
<psl-terminal v-else-if="picture === 'psl'" ref="pslTerminal" /> <psl-terminal v-else-if="picture === 'psl'" ref="pslTerminal" />
<large-passenger-strategy v-else-if="picture === 'largePassengerStrategy'" ref="largePassengerStrategy" /> <large-passenger-strategy v-else-if="picture === 'largePassengerStrategy'" ref="largePassengerStrategy" />
<large-passenger-view v-else-if="picture === 'largePassengerView'" ref="largePassengerView" /> <large-passenger-view v-else-if="picture === 'largePassengerView'" ref="largePassengerView" />
<!-- <terminal-menu v-if="menuShow" ref="terminalMenu" @pictureChange="pictureChange" @popupTerminalShow="popupTerminalShow" @loadingChange="loadingChange" /> -->
<dispatcher-manage v-else-if="picture === 'dispatcherManage'" ref="dispatcherManage" @pictureChange="pictureChange" @loadingChange="loadingChange" /> <dispatcher-manage v-else-if="picture === 'dispatcherManage'" ref="dispatcherManage" @pictureChange="pictureChange" @loadingChange="loadingChange" />
<big-screen v-else-if="picture === 'bigScreen'" />
<terminal-menu <terminal-menu
v-if="menuShow" v-if="menuShow"
ref="terminalMenu" ref="terminalMenu"
@ -51,6 +50,7 @@ import PslTerminal from './psl';
import DispatcherManage from './dispatcherManage'; import DispatcherManage from './dispatcherManage';
import LargePassengerStrategy from './largePassengerStrategy'; import LargePassengerStrategy from './largePassengerStrategy';
import LargePassengerView from './largePassengerView'; import LargePassengerView from './largePassengerView';
import BigScreen from './bigScreen';
export default { export default {
name: 'Index', name: 'Index',
@ -71,7 +71,8 @@ export default {
LargePassengerStrategy, LargePassengerStrategy,
LargePassengerView, LargePassengerView,
PslTerminal, PslTerminal,
DispatcherManage DispatcherManage,
BigScreen
}, },
data() { data() {
return { return {

View File

@ -83,6 +83,12 @@ export default {
roleList: ['DISPATCHER', 'STATION_SUPERVISOR'], roleList: ['DISPATCHER', 'STATION_SUPERVISOR'],
click: this.changePictureShow click: this.changePictureShow
}, },
{
name: '大屏',
code: 'bigScreen',
roleList: ['DISPATCHER'],
click: this.changePictureShow
},
// { // {
// name: '', // name: '',
// code: 'jlmap3dFault', // code: 'jlmap3dFault',

View File

@ -366,7 +366,8 @@ export default {
}, },
backRoute() { backRoute() {
this.$router.push({ path: `/design/usermap/home` }); // this.$router.push({ path: `/design/usermap/home` });
this.$router.go(-1);
}, },
createPicture() { // createPicture() { //
this.$refs.createPicture.doShow(); this.$refs.createPicture.doShow();

View File

@ -195,7 +195,7 @@ export default {
this.$store.dispatch('app/transitionAnimations'); this.$store.dispatch('app/transitionAnimations');
} }
this.$router.push({ this.$router.push({
path: `/design/usermap/map/pictureDraw/${obj.mapId}/draft`, path: `/lineDesign/usermap/map/pictureDraw/${obj.mapId}/draft`,
query: { name: obj.mapName, lineCode: obj.lineCode } query: { name: obj.mapName, lineCode: obj.lineCode }
}); });
break; break;

View File

@ -39,7 +39,7 @@ export default {
}, },
findState: { findState: {
type: 'select', type: 'select',
label: '分类:', label: '状态:',
value: 1, value: 1,
config: { config: {
data: paperStateQueryArr.map((v, i) => ({ value: i + 1, label: v })), data: paperStateQueryArr.map((v, i) => ({ value: i + 1, label: v })),

View File

@ -15,6 +15,22 @@ export default {
components: { components: {
Create Create
}, },
props: {
onlySelect: {
type: Boolean,
default: false
},
selectIds: {
type: Array,
default: () => {
return [];
}
},
tableHeight: {
type: String,
default: ''
}
},
data() { data() {
return { return {
// PermissionTypeList: [], // PermissionTypeList: [],
@ -82,13 +98,21 @@ export default {
{ {
name: this.$t('global.edit'), name: this.$t('global.edit'),
handleClick: this.handleEdit, handleClick: this.handleEdit,
showControl: (row) => { return !this.onlySelect; },
type: ''
},
{
name: '选择',
handleClick: this.handleSelect,
showControl: (row) => { return this.onlySelect; },
isDisabled: this.selectDisabled,
type: '' type: ''
} }
] ]
} }
], ],
actions: [ actions: [
{ text: this.$t('orderAuthor.createPermission'), handler: this.create } { text: this.$t('orderAuthor.createPermission'), handler: this.create, show: !this.onlySelect }
] ]
} }
}; };
@ -96,8 +120,21 @@ export default {
created() { created() {
this.getAllAbility(); this.getAllAbility();
if (this.tableHeight) {
this.queryList.height = this.tableHeight;
}
}, },
methods: { methods: {
selectDisabled(index, row) {
let s = false;
const findObj = this.selectIds.find(item => {
return item.permissionId == row.id;
});
if (findObj) {
s = true;
}
return s;
},
getAllAbility() { getAllAbility() {
getAllAbility().then(res => { getAllAbility().then(res => {
res.data && res.data.forEach(item => { res.data && res.data.forEach(item => {
@ -130,6 +167,9 @@ export default {
handleEdit(index, row) { handleEdit(index, row) {
this.$refs.create.doShow(row); this.$refs.create.doShow(row);
}, },
handleSelect(index, row) {
this.$emit('handleSelect', row);
},
create() { create() {
this.$refs.create.doShow(); this.$refs.create.doShow();
} }
@ -137,8 +177,4 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/
.el-row .el-button+.el-button{
margin-top: 10px;
}
</style> </style>

View File

@ -32,7 +32,7 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="标签" prop="tags"> <el-form-item label="分类" prop="tags">
<el-select multiple v-model="form.tags" @change="getQuestionAmount"> <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-option v-for="label in labels" :key="label" :label="label" :value="label"></el-option>
</el-select> </el-select>
@ -40,12 +40,12 @@
<el-form-item label="题目数量" prop="amount"> <el-form-item label="题目数量" prop="amount">
<el-input-number <el-input-number
v-model="form.amount" v-model="form.amount"
:precision="0"
:min="0" :min="0"
style="width: calc(100% - 280px); float: left; margin-right: 10px;" style="width: calc(100% - 280px); float: left; margin-right: 10px;"
/> />
<span v-if="this.form.type === 1" style="width: 190px; float: left;"> <span v-if="this.form.type === 1" style="width: 190px; float: left;">
{{ $t('publish.allNumberTipOne') }} {{ topicNum }} {{ $t('publish.allNumberTipTwo') }} {{ $t('publish.allNumberTipOne') }} {{ topicNum }} {{ $t('publish.allNumberTipTwo') }}, 剩余
{{ remainNum }}
</span> </span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('publish.scorePerQuestion')" prop="score"> <el-form-item :label="$t('publish.scorePerQuestion')" prop="score">
@ -64,7 +64,11 @@ import { getQuestionAmount } from '@/api/management/exam'
import { getLabelList } from '@/api/questionBank' import { getLabelList } from '@/api/questionBank'
export default { export default {
name: 'EditRule', name: 'EditRule',
props: {}, props: {
ruleList: {
type: Array,
},
},
computed: { computed: {
types() { types() {
return [{ value: 1, label: '理论题' }, { value: 2, label: '实训题' }] return [{ value: 1, label: '理论题' }, { value: 2, label: '实训题' }]
@ -90,7 +94,7 @@ export default {
message(new Error(this.$t('publish.inputQuestionNumberError'))) message(new Error(this.$t('publish.inputQuestionNumberError')))
} else if (!Number(value)) { } else if (!Number(value)) {
message(new Error(this.$t('publish.inputValidNumber'))) message(new Error(this.$t('publish.inputValidNumber')))
} else if (Number(value) > this.topicNum && this.form.type === 1) { } else if (Number(value) > this.remainNum && this.form.type === 1) {
message(new Error(this.$t('publish.inputNumberError'))) message(new Error(this.$t('publish.inputNumberError')))
} else { } else {
message() message()
@ -115,6 +119,8 @@ export default {
}, },
labels: [], labels: [],
topicNum: 0, topicNum: 0,
remainNum: 0,
index: -1,
dialogShow: false, dialogShow: false,
rules: { rules: {
type: [{ required: true, message: this.$t('publish.selectTestType'), trigger: 'change' }], type: [{ required: true, message: this.$t('publish.selectTestType'), trigger: 'change' }],
@ -137,22 +143,42 @@ export default {
this.$refs.form.resetFields() this.$refs.form.resetFields()
if (detail) { if (detail) {
this.isEditMode = true this.isEditMode = true
this.index = detail.index
this.form = { this.form = {
type: detail.type, type: detail.type,
subtype: detail.subtype, subtype: detail.subtype,
amount: detail.amount, amount: detail.amount,
score: detail.score, score: detail.score,
id: detail.id || '', id: detail.id || '',
tags: detail.tags
} }
this.topicNum = detail.topicNum this.topicNum = detail.topicNum
this.remainNum = detail.remainNum
} else { } else {
this.isEditMode = false this.isEditMode = false
this.remainNum = 0
} }
}) })
}, },
isDuplicated() {
const isDuplicated =
this.ruleList.length > 0 &&
this.ruleList.some(
rule =>
rule.type === this.form.type &&
rule.subtype === this.form.subtype &&
rule.tags.length === this.form.tags.length &&
rule.tags.every(tag => this.form.tags.includes(tag))
)
return isDuplicated
},
getQuestionAmount(e) { getQuestionAmount(e) {
if (!(this.form.type && this.form.subtype)) return if (!(this.form.type && this.form.subtype)) return
if (this.form.type === 2) return // if (this.form.type === 2) return //
// if (this.isDuplicated()) {
// this.$message.warning(', ')
// return
// }
const param = { const param = {
orgId: this.$store.state.user.companyId, orgId: this.$store.state.user.companyId,
groupType: this.form.type, groupType: this.form.type,
@ -160,7 +186,37 @@ export default {
tags: this.form.tags, tags: this.form.tags,
} }
getQuestionAmount(param).then(resp => { getQuestionAmount(param).then(resp => {
this.topicNum = resp.data const num = resp.data
this.topicNum = num
const { type, subtype, tags } = this.form
if (this.ruleList.length > 0) {
const smallerRangeRules = this.ruleList.filter(
(rule, i) =>
rule.type === type &&
rule.subtype === subtype &&
rule.tags.length >= tags.length &&
(tags.every(tag => rule.tags.includes(tag)) || tags.length === 0) &&
(this.isEditMode ? this.index !== i : true) //
)
//()
const amount1 = smallerRangeRules.reduce((prev, curr) => prev + curr.amount, 0)
const largerRangeRules = this.ruleList.filter(
(rule, i) =>
rule.type === type &&
rule.subtype === subtype &&
rule.tags.length < tags.length &&
(rule.tags.every(tag => tags.includes(tag)) || rule.tags.length === 0) &&
(this.isEditMode ? this.index !== i : true)
)
//
const amount2 = largerRangeRules.reduce(
(prev, curr) => (curr.topicNum - curr.amount < prev ? curr.topicNum - curr.amount : prev),
num
)
this.remainNum = amount2 - amount1
} else {
this.remainNum = num
}
}) })
}, },
clearSubtype() { clearSubtype() {
@ -169,7 +225,17 @@ export default {
handleOk() { handleOk() {
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
this.$emit('submit', { ...this.form, topicNum: this.topicNum }, this.isEditMode) if (this.ruleList.length > 0 && !this.isEditMode) {
if (this.isDuplicated()) {
this.$message.warning('与已有规则重复, 请重新选择')
return
}
}
this.$emit(
'submit',
{ ...this.form, topicNum: this.topicNum, remainNum: this.remainNum },
this.isEditMode
)
this.handleCancel() this.handleCancel()
} }
}) })

View File

@ -19,23 +19,23 @@
<span>{{ subtypes[scope.row.subtype] }}</span> <span>{{ subtypes[scope.row.subtype] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" label="题目数量" width="100">
<template slot-scope="scope">
<span>{{ scope.row.amount }}</span>
</template>
</el-table-column>
<el-table-column prop="score" :label="$t('publish.eachScore')" width="100" /> <el-table-column prop="score" :label="$t('publish.eachScore')" width="100" />
<el-table-column :label="$t('publish.totalScore')" width="90"> <el-table-column :label="$t('publish.totalScore')" width="90">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ Number(scope.row.amount) * Number(scope.row.score) }}</span> <span>{{ Number(scope.row.amount) * Number(scope.row.score) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" label="题目数量" width="100">
<template slot-scope="scope">
<span>{{ scope.row.amount }}</span>
</template>
</el-table-column>
<el-table-column label="题库题数"> <el-table-column label="题库题数">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.topicNum }}</span> <span>{{ scope.row.topicNum }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标签"> <el-table-column label="分类">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-for="tag in scope.row.tags" :key="tag">{{ tag }}</el-tag> <el-tag v-for="tag in scope.row.tags" :key="tag">{{ tag }}</el-tag>
</template> </template>
@ -47,7 +47,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<edit-rule @submit="handleRuleSubmit" ref="addRule" /> <edit-rule @submit="handleRuleSubmit" :ruleList="ruleList" ref="addRule" />
</div> </div>
</template> </template>
@ -105,6 +105,8 @@ export default {
amount: formData.amount, amount: formData.amount,
score: formData.score, score: formData.score,
topicNum: formData.topicNum, topicNum: formData.topicNum,
remainNum: formData.remainNum,
tags: formData.tags,
} }
if (isEdit) { if (isEdit) {
this.$set(this.ruleList, this.editingIndex, data) this.$set(this.ruleList, this.editingIndex, data)
@ -116,7 +118,7 @@ export default {
const index = data.$index const index = data.$index
this.ruleList.splice(index, 1) this.ruleList.splice(index, 1)
}, },
checkTotolScores() { checkTotolScores() {
return this.currentTotalScore === this.examData.fullScore return this.currentTotalScore === this.examData.fullScore
}, },
@ -124,7 +126,7 @@ export default {
this.editingIndex = data.$index this.editingIndex = data.$index
const list = JSON.stringify(data.row) const list = JSON.stringify(data.row)
const detail = JSON.parse(list) const detail = JSON.parse(list)
this.$refs.addRule.show(detail) this.$refs.addRule.show({ ...detail, index: data.$index })
}, },
getSummaries({ columns, data }) { getSummaries({ columns, data }) {
const sums = [] const sums = []
@ -142,9 +144,9 @@ export default {
return prev return prev
} }
}, 0) }, 0)
} else if (index === 4) { } else if (index === 3) {
const values = data.map(item => Number(item.amount) * Number(item.score)) const values = data.map(item => Number(item.amount) * Number(item.score))
this.currentTotalScore = sums[4] = values.reduce((prev, curr) => { this.currentTotalScore = sums[3] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr return prev + curr

View File

@ -1,6 +1,56 @@
<template> <template>
<el-dialog v-dialogDrag :title="this.$t('publish.copyMapAs')" :visible.sync="dialogVisible" width="30%" center> <el-dialog v-dialogDrag :title="this.$t('publish.copyMapAs')" :visible.sync="dialogVisible" width="30%" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" /> <el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
<el-form-item label="地图名称:" prop="name">
<el-input v-model="formModel.name" />
</el-form-item>
<el-row>
<el-col :span="8">
<el-form-item label="地图数据:" prop="mapData">
<el-checkbox v-model="formModel.mapData" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="运行图数据:" prop="runPlan">
<el-checkbox v-model="formModel.runPlan" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="3d数据" prop="map3dData">
<el-checkbox v-model="formModel.map3dData" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="ibp数据" prop="ibp">
<el-checkbox v-model="formModel.ibp" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="iscs数据" prop="iscs">
<el-checkbox v-model="formModel.iscs" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="线路配置:" prop="realLineConfig">
<el-checkbox v-model="formModel.realLineConfig" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="子系统数据:" prop="mapSystem">
<el-checkbox v-model="formModel.mapSystem" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实训数据:" prop="training">
<el-checkbox v-model="formModel.training" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button> <el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
@ -17,23 +67,20 @@ export default {
dialogVisible: false, dialogVisible: false,
formModel: { formModel: {
name: '', name: '',
copyOtherData: false mapData: false,
runPlan: false,
map3dData: false,
ibp: false,
iscs: false,
realLineConfig: false,
mapSystem: false,
training: false
}, },
loading: false, loading: false,
mapId: '', mapId: '',
form:{
labelWidth: '100px',
items: [
{ prop: 'name', label: this.$t('publish.mapName'), type: 'text', required: true},
{ prop: 'copyOtherData', label: this.$t('publish.whetherToCopyData'), type: 'switch', required: true}
]
},
rules: { rules: {
name: [ name: [
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' } { required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
],
copyOtherData: [
{ required: true, message: this.$t('global.choose'), trigger: 'change' }
] ]
} }
}; };
@ -51,7 +98,20 @@ export default {
return; return;
} }
this.loading = true; this.loading = true;
copyMapAs(this.mapId, this.formModel).then(resp =>{ const data = {
name: this.formModel.name,
copyDataConfig: {
mapData: this.formModel.mapData,
runPlan: this.formModel.runPlan,
map3dData: this.formModel.map3dData,
ibp: this.formModel.ibp,
iscs: this.formModel.iscs,
realLineConfig: this.formModel.realLineConfig,
mapSystem: this.formModel.mapSystem,
training: this.formModel.training
}
};
copyMapAs(this.mapId, data).then(resp =>{
this.$message.success(this.$t('tip.copyMapSuccess')); this.$message.success(this.$t('tip.copyMapSuccess'));
this.loading = false; this.loading = false;
this.dialogVisible = false; this.dialogVisible = false;

View File

@ -27,9 +27,9 @@ export default {
{ label: '3d数据', value: 'MAP_3D_DATA' }, { label: '3d数据', value: 'MAP_3D_DATA' },
{ label: 'ibp数据', value: 'ibp' }, { label: 'ibp数据', value: 'ibp' },
{ label: 'iscs数据', value: 'iscs' }, { label: 'iscs数据', value: 'iscs' },
{ label: '指令定义', value: 'COMMAND_DEFINITION' }, { label: '线路配置', value: 'REAL_LINE_CONFIG'},
{ label: '剧本数据', value: 'script' }, { label: '子系统数据', value: 'mapSystem' },
{ label: '线路配置', value: 'REAL_LINE_CONFIG'} { label: '实训数据', value: 'training' }
] ]
}; };
}, },
@ -59,9 +59,9 @@ export default {
map3dData: this.checkList.includes('MAP_3D_DATA'), map3dData: this.checkList.includes('MAP_3D_DATA'),
ibp: this.checkList.includes('ibp'), ibp: this.checkList.includes('ibp'),
iscs: this.checkList.includes('iscs'), iscs: this.checkList.includes('iscs'),
script:this.checkList.includes('script'), realLineConfig: this.checkList.includes('REAL_LINE_CONFIG'),
commandDefinition: this.checkList.includes('COMMAND_DEFINITION'), mapSystem: this.checkList.includes('mapSystem'),
realLineConfig: this.checkList.includes('REAL_LINE_CONFIG') training: this.checkList.includes('training')
}; };
const res = await getPublishMapExportNew(this.row.id, data); const res = await getPublishMapExportNew(this.row.id, data);
const resultData = res.data; const resultData = res.data;

View File

@ -122,7 +122,7 @@ export default {
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: this.$i18n.locale == 'en' ? '650' : '650', width: '750',
buttons: [ buttons: [
{ {
name: '编辑信息', name: '编辑信息',

View File

@ -4,16 +4,6 @@
<el-form-item label="code" prop="code"> <el-form-item label="code" prop="code">
<el-input v-model="formModel.code" style="width: 200px;" /> <el-input v-model="formModel.code" style="width: 200px;" />
</el-form-item> </el-form-item>
<el-form-item label="地图" prop="mapId">
<el-select v-model="formModel.mapId" placeholder="请选择" @change="mapIdChange">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="车站" prop="station"> <el-form-item label="车站" prop="station">
<el-select v-model="formModel.station" placeholder="请选择"> <el-select v-model="formModel.station" placeholder="请选择">
<el-option <el-option
@ -55,7 +45,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button> <el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
@ -69,12 +58,6 @@ import { getStationList } from '@/api/runplan';
export default { export default {
name: 'DeviceAdd', name: 'DeviceAdd',
props: { props: {
mapList: {
type: Array,
default: function () {
return [];
}
},
positionList: { positionList: {
type: Array, type: Array,
default: function () { default: function () {
@ -136,33 +119,34 @@ export default {
}, },
title() { title() {
return this.formModel.id ? '修改ISCS设备' : '创建ISCS设备'; return this.formModel.id ? '修改ISCS设备' : '创建ISCS设备';
},
mapId() {
return this.$route.query.mapId;
} }
}, },
mounted() { mounted() {
getStationList(this.mapId).then(resp => {
this.stationList = resp.data;
}).catch(() => {
this.$message.error('获取车站列表失败!');
});
}, },
methods: { methods: {
show(data) { show(data) {
if (data) { if (data) {
this.formModel.id = data.id; this.formModel.id = data.id;
this.formModel.mapId = data.mapId;
this.formModel.system = data.system; this.formModel.system = data.system;
this.formModel.code = data.code; this.formModel.code = data.code;
this.formModel.station = data.station; this.formModel.station = data.station;
this.formModel.position = data.position; this.formModel.position = data.position;
this.formModel.type = data.type; this.formModel.type = data.type;
} }
this.formModel.mapId = this.mapId;
this.dialogVisible = true; this.dialogVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
}); });
}, },
mapIdChange(value) {
getStationList(value).then(resp => {
this.stationList = resp.data;
}).catch(() => {
this.$message.error('获取车站列表失败!');
});
},
doSave() { doSave() {
this.$refs.ruleForm.validate(() => { this.$refs.ruleForm.validate(() => {
this.loading = true; this.loading = true;

View File

@ -1,16 +1,6 @@
<template> <template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false"> <el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px"> <el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="100px">
<el-form-item label="地图" prop="mapId">
<el-select v-model="formModel.mapId" placeholder="请选择">
<el-option
v-for="item in mapList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="系统" prop="system"> <el-form-item label="系统" prop="system">
<el-select v-model="formModel.system" placeholder="请选择"> <el-select v-model="formModel.system" placeholder="请选择">
<el-option <el-option
@ -108,6 +98,9 @@ export default {
}, },
title() { title() {
return this.formModel.id ? '修改ISCS资源' : '创建ISCS资源'; return this.formModel.id ? '修改ISCS资源' : '创建ISCS资源';
},
mapId() {
return this.$route.query.mapId;
} }
}, },
mounted() { mounted() {
@ -119,9 +112,9 @@ export default {
}, },
methods: { methods: {
show(data) { show(data) {
this.formModel.mapId = this.mapId;
if (data) { if (data) {
this.formModel.id = data.id; this.formModel.id = data.id;
this.formModel.mapId = data.mapId;
this.formModel.system = data.system; this.formModel.system = data.system;
this.formModel.type = data.type; this.formModel.type = data.type;
this.formModel.resourceIds = data.resourceIds; this.formModel.resourceIds = data.resourceIds;

View File

@ -13,14 +13,12 @@
</el-tabs> </el-tabs>
<add-resources <add-resources
ref="addResources" ref="addResources"
:map-list="mapList"
:system-list="iscsSystemList" :system-list="iscsSystemList"
:type-list="iscsResourcesTypeList" :type-list="iscsResourcesTypeList"
@reloadTable="resourceReloadTable" @reloadTable="resourceReloadTable"
/> />
<add-iscs-device <add-iscs-device
ref="addDevice" ref="addDevice"
:map-list="mapList"
:position-list="iscsPositionList" :position-list="iscsPositionList"
:type-list="iscsTypeList" :type-list="iscsTypeList"
:system-list="iscsSystemList" :system-list="iscsSystemList"
@ -157,7 +155,8 @@ export default {
], ],
actions: [ actions: [
{ text: this.$t('global.add'), handler: this.createIscsDevice}, { text: this.$t('global.add'), handler: this.createIscsDevice},
{ text: '批量创建', handler: this.batchCrateIscsDevice } { text: '批量创建', handler: this.batchCrateIscsDevice },
{ text: '返回', handler: this.goBack }
] ]
}, },
resourceQueryForm: { resourceQueryForm: {
@ -232,7 +231,8 @@ export default {
} }
], ],
actions: [ actions: [
{ text: this.$t('global.add'), handler: this.createAudioResources} { text: this.$t('global.add'), handler: this.createAudioResources},
{ text: '返回', handler: this.goBack }
] ]
}, },
voiceQueryForm: { voiceQueryForm: {
@ -292,7 +292,8 @@ export default {
], ],
actions: [ actions: [
{ text: this.$t('global.add'), handler: this.createAudioResources}, { text: this.$t('global.add'), handler: this.createAudioResources},
{ text: '生成', handler: this.generateAudioResources } { text: '生成', handler: this.generateAudioResources },
{ text: '返回', handler: this.goBack }
] ]
} }
}; };
@ -315,6 +316,9 @@ export default {
}); });
}, },
methods: { methods: {
goBack() {
this.$router.go(-1);
},
queryDeviceFunction(params) { queryDeviceFunction(params) {
params.mapId = this.mapId; params.mapId = this.mapId;
return pagedIscsDevice(params); return pagedIscsDevice(params);

View File

@ -173,7 +173,6 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
this.loading = false; this.loading = false;
} }
} }
}; };
</script> </script>

View File

@ -0,0 +1,104 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="250px">
<el-form-item label="第三方账户:" prop="account">
<el-input v-model="formModel.account" />
</el-form-item>
<el-form-item label="用户仿真使用记录同步第三方url" prop="userSimulationRecordSyncUrl">
<el-input v-model="formModel.userSimulationRecordSyncUrl" />
</el-form-item>
<el-form-item label="用户考试成绩记录同步第三方url" prop="userExamRecordSyncUrl">
<el-input v-model="formModel.userExamRecordSyncUrl" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { updateThirdAccountConfig } from '@/api/thirdAccountConfig';
export default {
name: 'Add',
data() {
return {
dialogVisible: false,
formModel: {
id: '',
account: '',
userSimulationRecordSyncUrl: '',
userExamRecordSyncUrl: ''
},
loading: false
};
},
computed: {
rules() {
const crules = {
account: [
{ required: true, message: '请填写第三方账户', trigger: 'blur' }
],
userSimulationRecordSyncUrl: [
{ required: true, message: '请填写用户仿真使用记录同步第三方url', trigger: 'blur' }
],
userExamRecordSyncUrl: [
{ required: true, message: '请填写用户考试成绩记录同步第三方url', trigger: 'blur' }
]
};
return crules;
},
title() {
return this.formModel.id ? '修改第三方配置' : '创建第三方配置';
}
},
mounted() {},
methods: {
show(data) {
if (data) {
this.formModel.id = data.id;
this.formModel.account = data.account;
this.formModel.userSimulationRecordSyncUrl = data.interfaceConfig.userSimulationRecordSyncUrl;
this.formModel.userExamRecordSyncUrl = data.interfaceConfig.userExamRecordSyncUrl;
}
this.dialogVisible = true;
},
doSave() {
this.$refs.ruleForm.validate(() => {
this.loading = true;
const data = {
id: this.formModel.id,
account: this.formModel.account,
interfaceConfig: {
userSimulationRecordSyncUrl: this.formModel.userSimulationRecordSyncUrl,
userExamRecordSyncUrl: this.formModel.userExamRecordSyncUrl
}
};
updateThirdAccountConfig(data).then(resp => {
this.$message.success(this.formModel.id ? '更新第三方配置成功!' : '创建第三方配置成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
});
},
handleClose() {
this.formModel = {
id: '',
account: '',
userSimulationRecordSyncUrl: '',
userExamRecordSyncUrl: ''
};
this.dialogVisible = false;
this.loading = false;
}
}
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,111 @@
<template>
<div class="temporary">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<add-third-account ref="addThirdAccount" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { deleteThirdAccountConfig, queryThirdAccountConfig } from '@/api/thirdAccountConfig';
import AddThirdAccount from './add';
export default {
name: 'Temporary',
components: {
AddThirdAccount
},
data() {
return {
queryForm: {
labelWidth: '120px',
reset: true,
leftSpan: 16
},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryList: {
query: queryThirdAccountConfig,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '第三方账户',
prop: 'account',
width: '200'
},
{
title: '用户仿真使用记录同步第三方url',
prop: 'interfaceConfig',
type: 'tag',
columnValue: (row) => { return row.interfaceConfig.userSimulationRecordSyncUrl; },
tagType: (row) => { return 'success'; }
},
{
title: '类型',
prop: 'interfaceConfig',
type: 'tag',
columnValue: (row) => { return row.interfaceConfig.userExamRecordSyncUrl; },
tagType: (row) => { return 'success'; }
},
{
title: '创建时间',
prop: 'createTime',
width: '200'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '200',
buttons: [
{
name: '编辑',
handleClick: this.editConfig
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.createThirdAccount}
]
}
};
},
methods: {
createThirdAccount() {
this.$refs.addThirdAccount.show();
},
editConfig(index, row) {
this.$refs.addThirdAccount.show(row);
},
handleDelete(index, row) {
this.$confirm('此操作将删除该第三方配置!', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteThirdAccountConfig(row.id).then(response => {
this.$message.success('删除成功!');
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style lang="scss" scoped>
.temporary {
height: 100%;
width: 100%;
}
</style>

View File

@ -0,0 +1,203 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<PermissionList ref="list" :effective-type-list="EffectiveTypeList" :sub-type-list="subTypeList" />
</div>
</template>
<script>
import { listPermision, setPermissonInValid } from '@/api/userRulesManage';
import PermissionList from './permissionList';
export default {
name: 'UserRulesManage',
components: {
PermissionList
},
data() {
return {
PermissionTypeList: [],
belongForm: {},
EffectiveTypeList: [
{ value: '1', label: '有效'},
{ value: '2', label: '无效'}
],
subTypeList: [
{ value: 'user', label: '个人'},
{ value: 'org', label: '组织'}
],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
reset: true,
queryObject: {
named: {
type: 'text',
label: '主体名称'
},
subType: {
type: 'select',
label: '主体类型',
config: {
data: []
}
},
status: {
type: 'select',
label: this.$t('permission.statusType'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
defaultSort:{prop:'sortOrder', order:''},
columns: [
{
title: '主体名称',
prop: 'named'
},
{
title: this.$t('permission.nickName'),
prop: 'nickName'
},
{
title: this.$t('permission.permissionName'),
prop: 'permissionName'
},
{
title: '主体类型',
prop: 'subjectType',
width: '80',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.subjectType, this.subTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('permission.isForever'),
width: '80',
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: this.$t('permission.permissionTotal'),
width: '80',
prop: 'amount'
},
{
title: this.$t('permission.permissionRemains'),
width: '80',
prop: 'remains'
},
{
title:this.$t('global.startTime'),
prop: 'startTime',
width: '160'
},
{
title: this.$t('permission.endTime'),
prop: 'endTime',
width: '160'
},
{
title: this.$t('permission.permissionStatus'),
prop: 'status',
width: '80',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
default: return 'danger';
}
}
},
{
type: 'button',
title: this.$t('global.operate'),
width: '200',
buttons: [
{
name: this.$t('orderAuthor.setupFailure'), //
handleClick: this.handleEfficacy,
showControl: (row) => { return row.status === '1'; },
type: 'warning'
},
{
name: '权限流向',
handleClick: this.handleRestoreList,
showControl: (row) => { return row.amount !== row.remains; },
type: ''
}
]
}
],
actions: [
]
}
};
},
mounted() {
this.loadInitData();
},
methods: {
loadInitData() {
this.EffectiveTypeList.forEach(elem => {
this.queryForm.queryObject.status.config.data.push(elem);
});
this.subTypeList.forEach(elem => {
this.queryForm.queryObject.subType.config.data.push(elem);
});
},
formatterDate(row, porpInfo) {
return row[porpInfo.property] ? row[porpInfo.property] : this.$t('global.perpetual');
},
handleRestoreList(index, row) {
this.$refs.list.doShow(index, row);
},
queryFunction(params) {
// params.distributeId = this.$route.query.distributeId;
return listPermision(params);
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
handleEfficacy(index, row) {
this.$confirm(this.$t('tip.modifyTheUserPermissionStatus'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
setPermissonInValid(row.id).then(res => {
this.$message.success(this.$t('tip.operationSuccessfully'));
this.reloadTable();
}).catch(() => {
this.$messageBox(this.$t('tip.operationFailed'));
this.reloadTable();
});
}).catch(() => { });
}
}
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,182 @@
<template>
<el-dialog v-dialogDrag title="权限流向" :visible.sync="dialogShow" width="1000px" :before-close="close">
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="close">{{ $t('map.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getPermissonInDistribute } from '@/api/userRulesManage';
export default {
name: 'PermissionList',
components: {
},
props: {
effectiveTypeList: {
required: true,
type: Array
},
subTypeList:{
required:true,
type:Array
}
},
data() {
return {
dialogShow: false,
id: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
show: false,
queryObject: {
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
paginationHiden: true,
indexShow: true,
columns: [
{
title: '主体名称',
prop: 'named'
},
{
title: this.$t('permission.nickName'),
prop: 'nickName'
},
{
title: this.$t('permission.permissionName'),
prop: 'permissionName'
},
{
title: '主体类型',
prop: 'subjectType',
width: '80',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.subjectType, this.subTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('permission.isForever'),
prop: 'forever',
width: '80',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: this.$t('permission.permissionTotal'),
width: '80',
prop: 'amount'
},
{
title: this.$t('permission.permissionRemains'),
width: '80',
prop: 'remains'
},
{
title:this.$t('global.startTime'),
prop: 'startTime',
width: '160'
},
{
title: this.$t('permission.endTime'),
prop: 'endTime',
width: '160'
},
{
title: this.$t('permission.permissionStatus'),
prop: 'status',
width: '80',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
default: return 'danger';
}
}
}
// {
// type: 'button',
// title: this.$t('global.operate'),
// buttons: [
// {
// name: '',
// handleClick: this.handleRestore,
// type: 'danger',
// showControl: (row) => {
// return row.status === '1';
// }
// }
// ]
// }
],
actions: [
]
}
};
},
methods: {
doShow(index, row) {
if (!row.id) { return; }
this.id = row.id;
this.dialogShow = true;
this.reloadTable();
},
close() {
this.id = '';
this.dialogShow = false;
},
// handleRestore(index, row) {
// this.$confirm('', this.$t('global.tips'), {
// confirmButtonText: this.$t('global.confirm'),
// cancelButtonText: this.$t('global.cancel'),
// type: 'warning'
// }).then(() => {
// putUserPermissionBackUser(row.id).then(resp => {
// this.reloadTable();
// this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
// }).catch(() => {
// this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
// });
// }).catch(() => { });
// },
queryFunction() {
if (this.id) {
return getPermissonInDistribute(this.id);
}
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>