Commit aab0fa09 authored by 何鹏程's avatar 何鹏程

新增权限 详情 图片等

parent 4b1436f0
...@@ -6,8 +6,8 @@ module.exports = { ...@@ -6,8 +6,8 @@ module.exports = {
assetsPublicPath: '/', assetsPublicPath: '/',
proxyTable: { proxyTable: {
'/api': { '/api': {
target: 'http://172.16.15.117:8084/',// 开发环境地址 // target: 'http://172.16.15.117:8084/', // 开发环境地址
// target: 'http://172.16.15.100:801', target: 'http://172.16.15.100:801',
// target: 'http://122.51.94.140/teamwork', // 测试环境 // target: 'http://122.51.94.140/teamwork', // 测试环境
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
......
File deleted
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
size="small" size="small"
:label-width="labelWidth" :label-width="labelWidth"
v-loading="loading" v-loading="loading"
:disabled="disabled"
> >
<dynamic-form <dynamic-form
v-for="item in formItemList" v-for="item in formItemList"
...@@ -34,6 +35,10 @@ export default { ...@@ -34,6 +35,10 @@ export default {
default: function() { default: function() {
return [] return []
} }
},
disabled: {
type: Boolean,
default: false
} }
}, },
data() { data() {
......
...@@ -8,23 +8,28 @@ import ElementUI from 'element-ui'; ...@@ -8,23 +8,28 @@ import ElementUI from 'element-ui';
import Echarts from 'echarts'; import Echarts from 'echarts';
import store from './store' import store from './store'
import axios from './util/ajax' import axios from './util/ajax'
import checkPermission from './util/permission'
import 'sysStatic/css/theme-default-new.scss' import 'sysStatic/css/theme-default-new.scss'
//import '../mock/index.js' //import '../mock/index.js'
import './components/install' import './components/install'
import {message} from './util/resetMessage'; import {
message
} from './util/resetMessage';
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$axios = axios; Vue.prototype.$axios = axios;
Vue.prototype.$echarts = Echarts; Vue.prototype.$echarts = Echarts;
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.prototype.$message = message; Vue.prototype.$message = message;
Vue.prototype.checkPermission = checkPermission
/* eslint-disable no-new */ /* eslint-disable no-new */
new Vue({ new Vue({
el: '#app', el: '#app',
router, router,
axios, axios,
store, store,
components: { App }, components: {
App
},
template: '<App/>' template: '<App/>'
}) })
<template> <template>
<el-dialog <el-dialog
title="武汉市医疗急救车辆信息填写" :title="title"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="1200px" width="1200px"
@closed="closedHandler" @closed="closedHandler"
...@@ -13,8 +13,36 @@ ...@@ -13,8 +13,36 @@
size="small" size="small"
label-width="300px" label-width="300px"
:rules="rules" :rules="rules"
:disabled="formDisabled"
v-loading="loading" v-loading="loading"
> >
<el-row>
<el-col :span="12">
<el-form-item
label="车辆图片"
prop="emergencyCarUrl"
>
<el-upload
class="avatar-uploader"
:action="uploadUrl"
:show-file-list="false"
accept="image/jpg, image/jpeg, image/png"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img
v-if="dataForm.emergencyCarUrl"
:src="dataForm.emergencyCarUrl"
class="avatar"
>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
...@@ -265,6 +293,19 @@ import { getDic } from '../../../util/dict' ...@@ -265,6 +293,19 @@ import { getDic } from '../../../util/dict'
import { saveOrUpdateEmergencyCar, queryTeamEmergencyCarInfo } from '@/api/emergencyCar' import { saveOrUpdateEmergencyCar, queryTeamEmergencyCarInfo } from '@/api/emergencyCar'
export default { export default {
name: 'emergencyCarDialog', name: 'emergencyCarDialog',
computed: {
title: function() {
let str = '武汉市医疗急救车辆信息'
if (this.type === 'add') {
str += '填写'
} else if (this.type === 'update') {
str += '修改'
} else if (this.type === 'detail') {
str += '详情'
}
return str
}
},
data() { data() {
const checkVechieUseStatus = (rule, value, callback) => { const checkVechieUseStatus = (rule, value, callback) => {
if (value === 3 && !(this.dataForm.otherStatus)) { if (value === 3 && !(this.dataForm.otherStatus)) {
...@@ -284,6 +325,8 @@ export default { ...@@ -284,6 +325,8 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
uploadUrl: '/api/team/car/uploadEmergencyImage',
formDisabled: false,
dataForm: { dataForm: {
vehicleUsingUnit: '', vehicleUsingUnit: '',
area: '', area: '',
...@@ -306,6 +349,9 @@ export default { ...@@ -306,6 +349,9 @@ export default {
vehicleUsingUnit: [ vehicleUsingUnit: [
{ required: true, message: '请输入车辆使用单位' }, { required: true, message: '请输入车辆使用单位' },
], ],
emergencyCarUrl: [
{ required: true, message: '请上传车辆图片' },
],
area: [ area: [
{ required: true, message: '请选择辖区' }, { required: true, message: '请选择辖区' },
], ],
...@@ -389,7 +435,8 @@ export default { ...@@ -389,7 +435,8 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.loading = true this.loading = true
this.type = type this.type = type
if (type === 'update') { this.formDisabled = type === 'detail'
if (type === 'update' || type === 'detail') {
if (!id) { if (!id) {
this.$message.error('救护车id不能为空') this.$message.error('救护车id不能为空')
return return
...@@ -415,6 +462,25 @@ export default { ...@@ -415,6 +462,25 @@ export default {
}, },
closedHandler() { closedHandler() {
this.$refs.dataForm.resetFields() this.$refs.dataForm.resetFields()
},
handleAvatarSuccess(res, file) {
if (res.msg === 201) {
this.$set(this.dataForm, 'emergencyCarUrl', res.respData)
} else {
this.$message.error(res.content)
}
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png';
const isLt2M = file.size / 1024 / 1024 < 2;
console.log(file.type)
if (!isJPG) {
this.$message.error('上传车辆图片只能是 jpg/jpeg/png 格式!');
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!');
}
return isJPG && isLt2M;
} }
} }
} }
...@@ -426,5 +492,28 @@ export default { ...@@ -426,5 +492,28 @@ export default {
.el-input { .el-input {
// width: 200px; // width: 200px;
} }
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
} }
</style> </style>
...@@ -103,6 +103,10 @@ ...@@ -103,6 +103,10 @@
min-width="200px" min-width="200px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link
type="primary"
@click="showEmergencyCarDialog('detail',scope.row.id)"
>查看详情</el-link>
<el-link <el-link
type="primary" type="primary"
@click="showEmergencyCarDialog('update', scope.row.id)" @click="showEmergencyCarDialog('update', scope.row.id)"
......
<template> <template>
<el-dialog <el-dialog
title="武汉市医院急救专家资源信息填写" :title="title"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="500px" width="500px"
@closed="closedHandler" @closed="closedHandler"
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
size="small" size="small"
label-width="150px" label-width="150px"
:rules="rules" :rules="rules"
:disabled="formDisabled"
v-loading="loading" v-loading="loading"
> >
<el-form-item <el-form-item
...@@ -81,6 +82,7 @@ ...@@ -81,6 +82,7 @@
<formItem <formItem
labelWidth="150px" labelWidth="150px"
ref="formItem" ref="formItem"
:disabled="formDisabled"
:formItemList="formItemList" :formItemList="formItemList"
/> />
<span <span
...@@ -104,10 +106,25 @@ ...@@ -104,10 +106,25 @@
import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common' import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common'
import { queryInfoById, addOrUpdateEmergencyExpert } from '@/api/expert' import { queryInfoById, addOrUpdateEmergencyExpert } from '@/api/expert'
export default { export default {
computed: {
title: function() {
let str = '武汉市医院急救专家资源信息'
if (this.type === 'add') {
str += '填写'
} else if (this.type === 'update') {
str += '修改'
} else if (this.type === 'detail') {
str += '详情'
}
return str
}
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
formDisabled: false,
type: 'add',
dataForm: { dataForm: {
hospitalCode: '', hospitalCode: '',
expertName: '', expertName: '',
...@@ -147,7 +164,8 @@ export default { ...@@ -147,7 +164,8 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.loading = true this.loading = true
this.type = type this.type = type
if (type === 'update') { this.formDisabled = type === 'detail'
if (type === 'update' || type === 'detail') {
if (!id) { if (!id) {
this.$message.error('id不能为空') this.$message.error('id不能为空')
return return
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
type="primary" type="primary"
size="small" size="small"
@click="showSaveDialog()" @click="showSaveDialog()"
v-if="!checkPermission()"
>新增</el-button> >新增</el-button>
</div> </div>
<table-mixin <table-mixin
...@@ -92,17 +93,23 @@ ...@@ -92,17 +93,23 @@
min-width="200px" min-width="200px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link
type="primary"
@click="showSaveDialog('detail', scope.row.id)"
>查看详情</el-link>
<el-link <el-link
type="primary" type="primary"
@click="showSaveDialog('update', scope.row.id)" @click="showSaveDialog('update', scope.row.id)"
v-if="!checkPermission()"
>修改</el-link> >修改</el-link>
<el-link <el-link
type="primary" type="primary"
@click="delHandler(scope.row.id)" @click="delHandler(scope.row.id)"
v-if="checkPermission()"
>删除</el-link> >删除</el-link>
<el-link <el-link
type="primary" type="primary"
v-if="scope.row.auditStatus === 1" v-if="scope.row.auditStatus === 1 && checkPermission()"
@click="auditHandler(scope.row.id)" @click="auditHandler(scope.row.id)"
>审核</el-link> >审核</el-link>
</template> </template>
......
<template> <template>
<el-dialog <el-dialog
title="武汉市医疗急救绿道信息填写" :title="title"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="900px" width="900px"
@closed="closedHandler" @closed="closedHandler"
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
:model="dataForm" :model="dataForm"
size="small" size="small"
label-width="300px" label-width="300px"
:disabled="formDisabled"
:rules="rules" :rules="rules"
v-loading="loading" v-loading="loading"
> >
...@@ -121,6 +122,7 @@ ...@@ -121,6 +122,7 @@
<formItem <formItem
labelWidth="300px" labelWidth="300px"
ref="formItem" ref="formItem"
:disabled="formDisabled"
:formItemList="formItemList" :formItemList="formItemList"
/> />
<span <span
...@@ -145,6 +147,20 @@ import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common' ...@@ -145,6 +147,20 @@ import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common'
import { queryInfoById, saveOrUpdateEmergencyGreenway } from '@/api/greenWay' import { queryInfoById, saveOrUpdateEmergencyGreenway } from '@/api/greenWay'
import { getDic } from '@/util/dict' import { getDic } from '@/util/dict'
export default { export default {
computed: {
title: function() {
let str = '武汉市医疗急救绿道信息'
console.log(this.type)
if (this.type === 'add') {
str += '填写'
} else if (this.type === 'update') {
str += '修改'
} else if (this.type === 'detail') {
str += '详情'
}
return str
}
},
data() { data() {
const checkGreenCenter = (rule, value, callback) => { const checkGreenCenter = (rule, value, callback) => {
if (value.indexOf('5') > -1 && !(this.dataForm.other)) { if (value.indexOf('5') > -1 && !(this.dataForm.other)) {
...@@ -156,6 +172,7 @@ export default { ...@@ -156,6 +172,7 @@ export default {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
formDisabled: false,
dataForm: { dataForm: {
hospitalCode: '', hospitalCode: '',
unitType: '', unitType: '',
...@@ -170,6 +187,7 @@ export default { ...@@ -170,6 +187,7 @@ export default {
areaList: [], areaList: [],
hospitalGradeList: [], hospitalGradeList: [],
hospitalClassList: [], hospitalClassList: [],
type: 'add',
rules: { rules: {
hospitalCode: [ hospitalCode: [
{ required: true, message: '请选择医院' }, { required: true, message: '请选择医院' },
...@@ -218,7 +236,8 @@ export default { ...@@ -218,7 +236,8 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.loading = true this.loading = true
this.type = type this.type = type
if (type === 'update') { this.formDisabled = type === 'detail'
if (type === 'update' || type === 'detail') {
if (!id) { if (!id) {
this.$message.error('id不能为空') this.$message.error('id不能为空')
return return
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
v-if="!checkPermission()"
@click="showSaveDialog()" @click="showSaveDialog()"
>新增</el-button> >新增</el-button>
</div> </div>
...@@ -103,17 +104,23 @@ ...@@ -103,17 +104,23 @@
min-width="200px" min-width="200px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link
type="primary"
@click="showSaveDialog('detail', scope.row.id)"
>查看详情</el-link>
<el-link <el-link
type="primary" type="primary"
@click="showSaveDialog('update', scope.row.id)" @click="showSaveDialog('update', scope.row.id)"
v-if="!checkPermission()"
>修改</el-link> >修改</el-link>
<el-link <el-link
type="primary" type="primary"
v-if="checkPermission()"
@click="delHandler(scope.row.id)" @click="delHandler(scope.row.id)"
>删除</el-link> >删除</el-link>
<el-link <el-link
type="primary" type="primary"
v-if="scope.row.auditStatus === 1" v-if="scope.row.auditStatus === 1 && checkPermission()"
@click="auditHandler(scope.row.id)" @click="auditHandler(scope.row.id)"
>审核</el-link> >审核</el-link>
</template> </template>
......
<template> <template>
<el-dialog <el-dialog
title="武汉市医院急救药品耗材资源信息填写" :title="title"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="500px" width="500px"
@closed="closedHandler" @closed="closedHandler"
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
size="small" size="small"
label-width="150px" label-width="150px"
:rules="rules" :rules="rules"
:disabled="formDisabled"
v-loading="loading" v-loading="loading"
> >
<el-form-item <el-form-item
...@@ -72,6 +73,7 @@ ...@@ -72,6 +73,7 @@
<formItem <formItem
labelWidth="150px" labelWidth="150px"
ref="formItem" ref="formItem"
:disabled="formDisabled"
:formItemList="formItemList" :formItemList="formItemList"
/> />
<span <span
...@@ -95,10 +97,25 @@ ...@@ -95,10 +97,25 @@
import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common' import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common'
import { queryInfoById, addOrUpdateEmergencyMedical } from '@/api/medical' import { queryInfoById, addOrUpdateEmergencyMedical } from '@/api/medical'
export default { export default {
computed: {
title: function() {
let str = '武汉市医院急救药品耗材资源信息'
if (this.type === 'add') {
str += '填写'
} else if (this.type === 'update') {
str += '修改'
} else if (this.type === 'detail') {
str += '详情'
}
return str
}
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
formDisabled: false,
type: 'add',
dataForm: { dataForm: {
hospitalCode: '', hospitalCode: '',
materialType: '', materialType: '',
...@@ -144,7 +161,8 @@ export default { ...@@ -144,7 +161,8 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.loading = true this.loading = true
this.type = type this.type = type
if (type === 'update') { this.formDisabled = type === 'detail'
if (type === 'update' || type === 'detail') {
if (!id) { if (!id) {
this.$message.error('id不能为空') this.$message.error('id不能为空')
return return
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
type="primary" type="primary"
size="small" size="small"
@click="showSaveDialog()" @click="showSaveDialog()"
v-if="!checkPermission()"
>新增</el-button> >新增</el-button>
</div> </div>
<table-mixin <table-mixin
...@@ -103,15 +104,21 @@ ...@@ -103,15 +104,21 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-link <el-link
type="primary" type="primary"
@click="showSaveDialog('detail', scope.row.id)"
>查看详情</el-link>
<el-link
type="primary"
v-if="!checkPermission()"
@click="showSaveDialog('update', scope.row.id)" @click="showSaveDialog('update', scope.row.id)"
>修改</el-link> >修改</el-link>
<el-link <el-link
type="primary" type="primary"
@click="delHandler(scope.row.id)" @click="delHandler(scope.row.id)"
v-if="checkPermission()"
>删除</el-link> >删除</el-link>
<el-link <el-link
type="primary" type="primary"
v-if="scope.row.auditStatus === 1" v-if="scope.row.auditStatus === 1 && checkPermission()"
@click="auditHandler(scope.row.id)" @click="auditHandler(scope.row.id)"
>审核</el-link> >审核</el-link>
</template> </template>
......
<template> <template>
<el-dialog <el-dialog
title="武汉市医院急诊科资源信息填写" :title="title"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="500px" width="500px"
@closed="closedHandler" @closed="closedHandler"
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
size="small" size="small"
label-width="150px" label-width="150px"
:rules="rules" :rules="rules"
:disabled="formDisabled"
v-loading="loading" v-loading="loading"
> >
<el-form-item <el-form-item
...@@ -91,6 +92,7 @@ ...@@ -91,6 +92,7 @@
<formItem <formItem
labelWidth="150px" labelWidth="150px"
ref="formItem" ref="formItem"
:disabled="formDisabled"
:formItemList="formItemList" :formItemList="formItemList"
/> />
<span <span
...@@ -114,10 +116,25 @@ ...@@ -114,10 +116,25 @@
import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common' import { queryEmergencyHospitalList, queryExtendConfig } from '@/api/common'
import { queryInfoById, addOrUpdateEmergencyRescue } from '@/api/rescue' import { queryInfoById, addOrUpdateEmergencyRescue } from '@/api/rescue'
export default { export default {
computed: {
title: function() {
let str = '武汉市医院急诊科资源信息'
console.log(this.type)
if (this.type === 'add') {
str += '填写'
} else if (this.type === 'update') {
str += '修改'
} else if (this.type === 'detail') {
str += '详情'
}
return str
}
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
formDisabled: false,
dataForm: { dataForm: {
hospitalCode: '', hospitalCode: '',
icuBedCount: '', icuBedCount: '',
...@@ -127,6 +144,7 @@ export default { ...@@ -127,6 +144,7 @@ export default {
operateRoomCount: '', operateRoomCount: '',
operateRoomFreeCount: '' operateRoomFreeCount: ''
}, },
type: 'add',
hospitalList: [], hospitalList: [],
formItemList: [], formItemList: [],
rules: { rules: {
...@@ -173,6 +191,7 @@ export default { ...@@ -173,6 +191,7 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.loading = true this.loading = true
this.type = type this.type = type
this.formDisabled = type === 'detail'
if (type === 'update') { if (type === 'update') {
if (!id) { if (!id) {
this.$message.error('id不能为空') this.$message.error('id不能为空')
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
v-if="!checkPermission()"
@click="showSaveDialog()" @click="showSaveDialog()"
>新增</el-button> >新增</el-button>
</div> </div>
...@@ -91,17 +92,23 @@ ...@@ -91,17 +92,23 @@
min-width="200px" min-width="200px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link
type="primary"
@click="showSaveDialog('detail', scope.row.id)"
>查看详情</el-link>
<el-link <el-link
type="primary" type="primary"
@click="showSaveDialog('update', scope.row.id)" @click="showSaveDialog('update', scope.row.id)"
v-if="!checkPermission()"
>修改</el-link> >修改</el-link>
<el-link <el-link
type="primary" type="primary"
@click="delHandler(scope.row.id)" @click="delHandler(scope.row.id)"
v-if="checkPermission()"
>删除</el-link> >删除</el-link>
<el-link <el-link
type="primary" type="primary"
v-if="scope.row.auditStatus === 1" v-if="scope.row.auditStatus === 1 && checkPermission()"
@click="auditHandler(scope.row.id)" @click="auditHandler(scope.row.id)"
>审核</el-link> >审核</el-link>
</template> </template>
......
<template> <template>
<el-dialog <el-dialog
title="武汉市医疗急救站点信息填写" :title="title"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="600px" width="600px"
@closed="closedHandler" @closed="closedHandler"
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
size="small" size="small"
label-width="300px" label-width="300px"
:rules="rules" :rules="rules"
:disabled="formDisabled"
v-loading="loading" v-loading="loading"
> >
<el-form-item <el-form-item
...@@ -116,10 +117,25 @@ import { queryEmergencySiteDtoById, saveOrUpdateEmergencySite } from '@/api/site ...@@ -116,10 +117,25 @@ import { queryEmergencySiteDtoById, saveOrUpdateEmergencySite } from '@/api/site
import { queryEmergencyHospitalList } from '@/api/common' import { queryEmergencyHospitalList } from '@/api/common'
import { getDic } from '@/util/dict' import { getDic } from '@/util/dict'
export default { export default {
computed: {
title: function() {
let str = '武汉市医疗急救站点信息'
if (this.type === 'add') {
str += '填写'
} else if (this.type === 'update') {
str += '修改'
} else if (this.type === 'detail') {
str += '详情'
}
return str
}
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
loading: false, loading: false,
formDisabled: false,
type: 'add',
dataForm: { dataForm: {
siteName: '', siteName: '',
area: '', area: '',
...@@ -158,7 +174,8 @@ export default { ...@@ -158,7 +174,8 @@ export default {
this.dialogVisible = true this.dialogVisible = true
this.loading = true this.loading = true
this.type = type this.type = type
if (type === 'update') { this.formDisabled = type === 'detail'
if (type === 'update' || type === 'detail') {
if (!id) { if (!id) {
this.$message.error('救护车id不能为空') this.$message.error('救护车id不能为空')
return return
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
type="primary" type="primary"
size="small" size="small"
@click="showSaveDialog()" @click="showSaveDialog()"
v-if="!checkPermission()"
>新增</el-button> >新增</el-button>
</div> </div>
<table-mixin <table-mixin
...@@ -102,17 +103,23 @@ ...@@ -102,17 +103,23 @@
min-width="200px" min-width="200px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-link
type="primary"
@click="showSaveDialog('detail', scope.row.id)"
>查看详情</el-link>
<el-link <el-link
type="primary" type="primary"
@click="showSaveDialog('update', scope.row.id)" @click="showSaveDialog('update', scope.row.id)"
v-if="!checkPermission()"
>修改</el-link> >修改</el-link>
<el-link <el-link
type="primary" type="primary"
@click="delHandler(scope.row.id)" @click="delHandler(scope.row.id)"
v-if="checkPermission()"
>删除</el-link> >删除</el-link>
<el-link <el-link
type="primary" type="primary"
v-if="scope.row.auditStatus === 1" v-if="scope.row.auditStatus === 1 && checkPermission()"
@click="auditHandler(scope.row.id)" @click="auditHandler(scope.row.id)"
>审核</el-link> >审核</el-link>
</template> </template>
......
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
ak="OdRZ7iA9KGrKwFqufVTI3eTHOHDriGV7" ak="OdRZ7iA9KGrKwFqufVTI3eTHOHDriGV7"
> >
</baidu-map> --> </baidu-map> -->
<div <div class="map">
class="map" <div
id="allmap" id="allmap"
> style="width: 100%; height: 100%"
>
</div>
</div> </div>
</el-col> </el-col>
<el-col <el-col
...@@ -137,79 +139,84 @@ export default { ...@@ -137,79 +139,84 @@ export default {
return { return {
center: { lng: 114.3162, lat: 30.581084 }, center: { lng: 114.3162, lat: 30.581084 },
zoom: 12, zoom: 12,
BMap: null,
map: null, map: null,
areaName: '武汉市', areaName: '武汉市',
siteName: '', siteName: '',
siteListData: [], siteListData: [],
carListData: [], carListData: [],
allData: [], allData: [],
vechieTypeList: [] vechieTypeList: [],
map: null
} }
}, },
mounted() { mounted() {
var map = new BMapGL.map('allmap') this.init()
map.centerAndZoom(new BMapGL.Point(defaultCenterPoint[0], defaultCenterPoint[1])) console.log('mounted')
map.enableScrollWheelZoom(true);
var darkStyle = [
{
featureType: 'land',
elementType: 'ge'
}
]
map.setOptions({
style: 'default',
styleUrl: ''
})
}, },
methods: { methods: {
handler({ BMap, map }) { init() {
//划分出行政区 //划分出行政区
console.log('init')
const map = new BMapGL.Map('allmap')
map.centerAndZoom(new BMapGL.Point(defaultCenterPoint[0], defaultCenterPoint[1]), 11)
this.map = map
map.enableScrollWheelZoom(true); map.enableScrollWheelZoom(true);
getDic(['area', 'vechie_type', 'vechie_special_purpose']).then(res => { getDic(['area', 'vechie_type', 'vechie_special_purpose']).then(res => {
this.vechieTypeList = res.vechie_type this.vechieTypeList = res.vechie_type
this.vechieSpecialPurposeList = res.vechie_special_purpose this.vechieSpecialPurposeList = res.vechie_special_purpose
if (res.area && res.area.length > 0) { // if (res.area && res.area.length > 0) {
res.area.forEach(item => { // console.log('areaList', res.area)
this.getBoundary(item.name, BMap, map) // res.area.forEach(item => {
}) // this.getBoundary(item.name, map)
} // })
// }
}) })
// 地图上打点 // 地图上打点
queryEmergencySiteList().then(res => { queryEmergencySiteList().then(res => {
if (res.msg === 201) { if (res.msg === 201) {
console.log(res.respData)
if (res.respData && res.respData.length > 0) { if (res.respData && res.respData.length > 0) {
this.allData = res.respData
this.siteListData = res.respData
res.respData.forEach(item => { res.respData.forEach(item => {
if (item.siteLatitude && item.siteLongitude) { if (item.siteLatitude && item.siteLongitude) {
const point = new BMap.Point(item.siteLongitude, item.siteLatitude) const point = new BMapGL.Point(item.siteLongitude, item.siteLatitude)
const marker = new BMap.Marker(point) const marker = new BMapGL.Marker(point)
map.addOverlay(marker) map.addOverlay(marker)
marker.addEventListener('click', () => {
console.log('click', item)
this.getSiteListData(item.areaName)
this.$nextTick(() => {
const dataList = this.allData.filter(i => i.id === item.id) || []
this.$refs.siteListData.setCurrentRow(dataList[0]);
})
map.centerAndZoom(new BMapGL.Point(item.siteLongitude, item.siteLatitude), 18)
})
} }
}) })
this.allData = res.respData
this.siteListData = res.respData // if (res.respData && res.respData[0]) {
if (res.respData && res.respData[0]) { // this.$refs.siteListData.setCurrentRow(res.respData[0]);
this.$refs.siteListData.setCurrentRow(res.respData[0]); // }
}
} }
} else { } else {
this.$message.error(res.content) this.$message.error(res.content)
} }
}) })
}, },
getBoundary(districtName, BMap, map) { getBoundary(districtName, map) {
const bdary = new BMap.Boundary() const bdary = new BMapGL.Boundary()
const that = this const that = this
bdary.get(districtName, function(rs) { //获取行政区域 bdary.get(districtName, function(rs) { //获取行政区域
var count = rs.boundaries.length; //行政区域的点有多少个 var count = rs.boundaries.length; //行政区域的点有多少个
for (var i = 0; i < count; i++) { for (var i = 0; i < count; i++) {
var ply = new BMap.Polygon(rs.boundaries[i], { var ply = new BMapGL.Polygon(rs.boundaries[i], {
fillColor: '#' + (Math.random() * 0xFFFFFF << 0).toString(16), fillColor: '#' + (Math.random() * 0xFFFFFF << 0).toString(16),
fillOpacity: 0.3 fillOpacity: 0.3
}); //建立多边形覆盖物 }); //建立多边形覆盖物
map.addOverlay(ply); //添加覆盖物 map.addOverlay(ply); //添加覆盖物
ply.addEventListener('click', () => { ply.addEventListener('click', () => {
console.log('1111')
that.getSiteListData(districtName) that.getSiteListData(districtName)
}) })
} }
...@@ -220,7 +227,7 @@ export default { ...@@ -220,7 +227,7 @@ export default {
const dataList = this.allData.filter(i => i.areaName === districtName) const dataList = this.allData.filter(i => i.areaName === districtName)
this.siteListData = dataList || [] this.siteListData = dataList || []
if (dataList && dataList[0]) { if (dataList && dataList[0]) {
this.$refs.siteListData.setCurrentRow(dataList[0]); // this.$refs.siteListData.setCurrentRow(dataList[0]);
} else { } else {
this.siteName = '' this.siteName = ''
this.carListData = [] this.carListData = []
...@@ -239,6 +246,7 @@ export default { ...@@ -239,6 +246,7 @@ export default {
this.$message.error(res.content) this.$message.error(res.content)
} }
}) })
this.map.centerAndZoom(new BMapGL.Point(val.siteLongitude, val.siteLatitude), 18)
}, },
vechieTypeFormatter(row, column, cellValue, index) { vechieTypeFormatter(row, column, cellValue, index) {
const vechieType = this.vechieTypeList.find(i => i.val === cellValue) const vechieType = this.vechieTypeList.find(i => i.val === cellValue)
...@@ -252,10 +260,6 @@ export default { ...@@ -252,10 +260,6 @@ export default {
const vechieSpecialPurpose = this.vechieSpecialPurposeList.find(i => i.val === cellValue) const vechieSpecialPurpose = this.vechieSpecialPurposeList.find(i => i.val === cellValue)
return vechieSpecialPurpose ? vechieSpecialPurpose.name : '' return vechieSpecialPurpose ? vechieSpecialPurpose.name : ''
}, },
vechieSpecialPurposeFormatter(row, column, cellValue, index) {
const vechieSpecialPurpose = this.vechieSpecialPurposeList.find(i => i.val === cellValue)
return vechieSpecialPurpose ? vechieSpecialPurpose.name : ''
},
isPreHospitalVechieFormatter(row, column, cellValue, index) { isPreHospitalVechieFormatter(row, column, cellValue, index) {
const isPreHospitalVechieList = ['', '是', '否'] const isPreHospitalVechieList = ['', '是', '否']
return isPreHospitalVechieList[cellValue] || '' return isPreHospitalVechieList[cellValue] || ''
......
import store from '@/store'
/**
* @returns {Boolean}
*/
export default function checkPermission() {
const userInfo = store.getters && store.getters.userInfo
return userInfo && userInfo.roleId && userInfo.roleId === 1
}
...@@ -1215,6 +1215,33 @@ bluebird@^3.1.1, bluebird@^3.4.7, bluebird@^3.5.1: ...@@ -1215,6 +1215,33 @@ bluebird@^3.1.1, bluebird@^3.4.7, bluebird@^3.5.1:
resolved "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" resolved "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f"
integrity sha1-nyKcFb4nJFT/qXOs4NvueaGww28= integrity sha1-nyKcFb4nJFT/qXOs4NvueaGww28=
bmaplib.curveline@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/bmaplib.curveline/download/bmaplib.curveline-1.0.0.tgz#826eb0bf1c59fad1b23142be66fc360cf009aea2"
integrity sha1-gm6wvxxZ+tGyMUK+Zvw2DPAJrqI=
bmaplib.heatmap@^1.0.4:
version "1.0.4"
resolved "https://registry.npm.taobao.org/bmaplib.heatmap/download/bmaplib.heatmap-1.0.4.tgz#30161262771fe78af35705ff92457725de5d9850"
integrity sha1-MBYSYncf54rzVwX/kkV3Jd5dmFA=
bmaplib.lushu@^1.0.7:
version "1.0.7"
resolved "https://registry.npm.taobao.org/bmaplib.lushu/download/bmaplib.lushu-1.0.7.tgz#77c17dcf7148d30c46e8430c7ff86b20e418b8b8"
integrity sha1-d8F9z3FI0wxG6EMMf/hrIOQYuLg=
bmaplib.markerclusterer@^1.0.13:
version "1.0.13"
resolved "https://registry.npm.taobao.org/bmaplib.markerclusterer/download/bmaplib.markerclusterer-1.0.13.tgz#442d71a6c40844ee47d01f6db2166b54530b5bd1"
integrity sha1-RC1xpsQIRO5H0B9tshZrVFMLW9E=
dependencies:
bmaplib.texticonoverlay "^1.0.2"
bmaplib.texticonoverlay@^1.0.2:
version "1.0.2"
resolved "https://registry.npm.taobao.org/bmaplib.texticonoverlay/download/bmaplib.texticonoverlay-1.0.2.tgz#d78546ea0f036d9fe964983796315b6c112a05bf"
integrity sha1-14VG6g8DbZ/pZJg3ljFbbBEqBb8=
bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9:
version "4.12.0" version "4.12.0"
resolved "https://registry.npm.taobao.org/bn.js/download/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" resolved "https://registry.npm.taobao.org/bn.js/download/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88"
...@@ -2720,7 +2747,7 @@ enhanced-resolve@^3.4.0: ...@@ -2720,7 +2747,7 @@ enhanced-resolve@^3.4.0:
object-assign "^4.0.1" object-assign "^4.0.1"
tapable "^0.2.7" tapable "^0.2.7"
entities@^1.1.1: entities@^1.1.1, entities@~1.1.1:
version "1.1.2" version "1.1.2"
resolved "https://registry.npm.taobao.org/entities/download/entities-1.1.2.tgz?cache=0&sync_timestamp=1611535326982&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" resolved "https://registry.npm.taobao.org/entities/download/entities-1.1.2.tgz?cache=0&sync_timestamp=1611535326982&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fentities%2Fdownload%2Fentities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56"
integrity sha1-vfpzUplmTfr9NFKe1PhSKidf6lY= integrity sha1-vfpzUplmTfr9NFKe1PhSKidf6lY=
...@@ -4652,6 +4679,13 @@ levn@^0.3.0, levn@~0.3.0: ...@@ -4652,6 +4679,13 @@ levn@^0.3.0, levn@~0.3.0:
prelude-ls "~1.1.2" prelude-ls "~1.1.2"
type-check "~0.3.2" type-check "~0.3.2"
linkify-it@^2.0.0:
version "2.2.0"
resolved "https://registry.npm.taobao.org/linkify-it/download/linkify-it-2.2.0.tgz#e3b54697e78bf915c70a38acd78fd09e0058b1cf"
integrity sha1-47VGl+eL+RXHCjis14/QngBYsc8=
dependencies:
uc.micro "^1.0.1"
load-json-file@^1.0.0: load-json-file@^1.0.0:
version "1.1.0" version "1.1.0"
resolved "https://registry.npm.taobao.org/load-json-file/download/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" resolved "https://registry.npm.taobao.org/load-json-file/download/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"
...@@ -4825,6 +4859,17 @@ map-visit@^1.0.0: ...@@ -4825,6 +4859,17 @@ map-visit@^1.0.0:
dependencies: dependencies:
object-visit "^1.0.0" object-visit "^1.0.0"
markdown-it@^8.4.0:
version "8.4.2"
resolved "https://registry.nlark.com/markdown-it/download/markdown-it-8.4.2.tgz#386f98998dc15a37722aa7722084f4020bdd9b54"
integrity sha1-OG+YmY3BWjdyKqdyIIT0Agvdm1Q=
dependencies:
argparse "^1.0.7"
entities "~1.1.1"
linkify-it "^2.0.0"
mdurl "^1.0.1"
uc.micro "^1.0.5"
math-expression-evaluator@^1.2.14: math-expression-evaluator@^1.2.14:
version "1.3.7" version "1.3.7"
resolved "https://registry.nlark.com/math-expression-evaluator/download/math-expression-evaluator-1.3.7.tgz#1b62225db86af06f7ea1fd9576a34af605a5b253" resolved "https://registry.nlark.com/math-expression-evaluator/download/math-expression-evaluator-1.3.7.tgz#1b62225db86af06f7ea1fd9576a34af605a5b253"
...@@ -4849,6 +4894,11 @@ mdn-data@2.0.4: ...@@ -4849,6 +4894,11 @@ mdn-data@2.0.4:
resolved "https://registry.nlark.com/mdn-data/download/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" resolved "https://registry.nlark.com/mdn-data/download/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b"
integrity sha1-aZs8OKxvHXKAkaZGULZdOIUC/Vs= integrity sha1-aZs8OKxvHXKAkaZGULZdOIUC/Vs=
mdurl@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/mdurl/download/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
integrity sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=
media-typer@0.3.0: media-typer@0.3.0:
version "0.3.0" version "0.3.0"
resolved "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" resolved "https://registry.npm.taobao.org/media-typer/download/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
...@@ -7880,6 +7930,11 @@ typedarray@^0.0.6: ...@@ -7880,6 +7930,11 @@ typedarray@^0.0.6:
resolved "https://registry.nlark.com/typedarray/download/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" resolved "https://registry.nlark.com/typedarray/download/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.6"
resolved "https://registry.npm.taobao.org/uc.micro/download/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
integrity sha1-nEEagCpAmpH8bPdAgbq6NLJEmaw=
uglify-es@^3.3.4: uglify-es@^3.3.4:
version "3.3.9" version "3.3.9"
resolved "https://registry.npm.taobao.org/uglify-es/download/uglify-es-3.3.9.tgz?cache=0&sync_timestamp=1614860098333&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuglify-es%2Fdownload%2Fuglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677" resolved "https://registry.npm.taobao.org/uglify-es/download/uglify-es-3.3.9.tgz?cache=0&sync_timestamp=1614860098333&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuglify-es%2Fdownload%2Fuglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
...@@ -8123,6 +8178,17 @@ vm-browserify@^1.0.1: ...@@ -8123,6 +8178,17 @@ vm-browserify@^1.0.1:
resolved "https://registry.npm.taobao.org/vm-browserify/download/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" resolved "https://registry.npm.taobao.org/vm-browserify/download/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0"
integrity sha1-eGQcSIuObKkadfUR56OzKobl3aA= integrity sha1-eGQcSIuObKkadfUR56OzKobl3aA=
vue-baidu-map@^0.21.22:
version "0.21.22"
resolved "https://registry.npm.taobao.org/vue-baidu-map/download/vue-baidu-map-0.21.22.tgz#6b76a91ef34f18a782d732ab0f541a1a3aa069e0"
integrity sha1-a3apHvNPGKeC1zKrD1QaGjqgaeA=
dependencies:
bmaplib.curveline "^1.0.0"
bmaplib.heatmap "^1.0.4"
bmaplib.lushu "^1.0.7"
bmaplib.markerclusterer "^1.0.13"
markdown-it "^8.4.0"
vue-eslint-parser@^2.0.3: vue-eslint-parser@^2.0.3:
version "2.0.3" version "2.0.3"
resolved "https://registry.nlark.com/vue-eslint-parser/download/vue-eslint-parser-2.0.3.tgz#c268c96c6d94cfe3d938a5f7593959b0ca3360d1" resolved "https://registry.nlark.com/vue-eslint-parser/download/vue-eslint-parser-2.0.3.tgz#c268c96c6d94cfe3d938a5f7593959b0ca3360d1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment