Commit 6dddf2eb authored by p-wanping.song's avatar p-wanping.song

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/ruoyi-ui into develop

parents 17699257 eb8cfab3
...@@ -5,4 +5,4 @@ VUE_APP_TITLE = 融通物管安全管理平台 ...@@ -5,4 +5,4 @@ VUE_APP_TITLE = 融通物管安全管理平台
ENV = 'production' ENV = 'production'
# 融通物管安全管理平台/生产环境 # 融通物管安全管理平台/生产环境
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/dev-api'
import request from '@/utils/request'
// 查询评估模型信息列表
export function listFactor(query) {
return request({
url: '/system/evaluation/factor/list',
method: 'get',
params: query
})
}
// 查询评估模型信息详细
export function getFactor(id) {
return request({
url: '/system/evaluation/factor/' + id,
method: 'get'
})
}
// 新增评估模型信息
export function addFactor(data) {
return request({
url: '/system/evaluation/factor',
method: 'post',
data: data
})
}
// 修改评估模型信息
export function updateFactor(data) {
return request({
url: '/system/evaluation/factor',
method: 'put',
data: data
})
}
// 删除评估模型信息
export function delFactor(id) {
return request({
url: '/system/evaluation/factor/' + id,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询评估选项管理列表
export function listItems(query) {
return request({
url: '/evaluation/items/list',
method: 'get',
params: query
})
}
// 查询评估选项管理详细
export function getItems(id) {
return request({
url: '/evaluation/items/' + id,
method: 'get'
})
}
// 新增评估选项管理
export function addItems(data) {
return request({
url: '/evaluation/items',
method: 'post',
data: data
})
}
// 修改评估选项管理
export function updateItems(data) {
return request({
url: '/evaluation/items',
method: 'put',
data: data
})
}
// 删除评估选项管理
export function delItems(id) {
return request({
url: '/evaluation/items/' + id,
method: 'delete'
})
}
...@@ -20,7 +20,7 @@ export function getPlan(id) { ...@@ -20,7 +20,7 @@ export function getPlan(id) {
// 新增风险计划 // 新增风险计划
export function addPlan(data) { export function addPlan(data) {
return request({ return request({
url: '/system/risk/plan', url: '/app-api/risk/plan',
method: 'post', method: 'post',
data: data data: data
}) })
...@@ -29,7 +29,7 @@ export function addPlan(data) { ...@@ -29,7 +29,7 @@ export function addPlan(data) {
// 修改风险计划 // 修改风险计划
export function updatePlan(data) { export function updatePlan(data) {
return request({ return request({
url: '/system/risk/plan', url: '/app-api/risk/plan',
method: 'put', method: 'put',
data: data data: data
}) })
...@@ -64,3 +64,56 @@ export function exportRiskList(inherentId) { ...@@ -64,3 +64,56 @@ export function exportRiskList(inherentId) {
method: 'get', method: 'get',
}) })
} }
//项目列表
export function getProjectList(projectName) {
return request({
url: '/system/ledger/project/listByQuery/'+projectName,
method: 'get',
})
}
//楼栋列表
export function getBuildingList(projectId) {
return request({
url: '/app-api/risk/plan/building/list/'+projectId,
method: 'get',
})
}
//根据单位id查询用户列表
export function getUserListByDeptId(deptId) {
return request({
url: '/app-api/risk/plan/user/list/'+deptId,
method: 'get',
})
}
//根据固有风险id查看固有风险信息
export function getInherentById(inherentId) {
return request({
url: '/app-api/risk/plan/inherent/details/'+inherentId,
method: 'get',
})
}
//风险现有风险清单
export function getExsitingList(query) {
return request({
url: '/system/risk/existing/list/',
method: 'get',
params: query
})
}
//根据固有风险id查看固有风险信息
export function getExistingById(exsitingId) {
return request({
url: '/app-api/risk/plan/existing/details/'+exsitingId,
method: 'get',
})
}
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
const first = matched[0] const first = matched[0]
if (!this.isDashboard(first)) { if (!this.isDashboard(first)) {
matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) matched = [{ path: '/index', meta: { title: '风险态势分析图' }}].concat(matched)
} }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
......
...@@ -70,7 +70,7 @@ export const constantRoutes = [ ...@@ -70,7 +70,7 @@ export const constantRoutes = [
path: 'index', path: 'index',
component: () => import('@/views/index'), component: () => import('@/views/index'),
name: 'Index', name: 'Index',
meta: { title: '首页', icon: 'dashboard', affix: true } meta: { title: '风险态势分析图', icon: 'dashboard', affix: true }
} }
] ]
}, },
...@@ -134,6 +134,20 @@ export const dynamicRoutes = [ ...@@ -134,6 +134,20 @@ export const dynamicRoutes = [
} }
] ]
}, },
{
path: '/system/evaluation-items',
component: Layout,
hidden: true,
permissions: ['evaluation:items:list'],
children: [
{
path: 'index/:factorId(\\d+)',
component: () => import('@/views/evaluation/factor/items'),
name: 'Data',
meta: { title: '因素数据', activeMenu: '/evaluation/factor' }
}
]
},
{ {
path: '/risk/plan/ledgerdata', path: '/risk/plan/ledgerdata',
component: Layout, component: Layout,
...@@ -144,7 +158,49 @@ export const dynamicRoutes = [ ...@@ -144,7 +158,49 @@ export const dynamicRoutes = [
path: 'index/:id(\\d+)', path: 'index/:id(\\d+)',
component: () => import('@/views/risk/plan/ledgerdata'), component: () => import('@/views/risk/plan/ledgerdata'),
name: 'ledgerdata', name: 'ledgerdata',
meta: { title: '台账数据', activeMenu: '/risk/plan/ledgerdata' } meta: { title: '任务详情', activeMenu: '/risk/plan/ledgerdata' }
}
]
},
{
path: '/risk/plan/inherentdata',
component: Layout,
hidden: true,
permissions: ['system:dict:list'],
children: [
{
path: 'index/:id(\\d+)',
component: () => import('@/views/risk/plan/inherentdata'),
name: 'inherentdata',
meta: { title: '固有风险详情', activeMenu: '/risk/plan/inherentdata' }
}
]
},
{
path: '/risk/plan/existingdata',
component: Layout,
hidden: true,
permissions: ['system:dict:list'],
children: [
{
path: 'index/:id(\\d+)',
component: () => import('@/views/risk/plan/existingdata'),
name: 'existingdata',
meta: { title: '现状风险详情', activeMenu: '/risk/plan/existingdata' }
}
]
},
{
path: '/risk/drawCanvas/index',
component: Layout,
hidden: true,
permissions: ['system:ledgerRoom:list'],
children: [
{
path: 'index/:id(\\d+)',
component: () => import('@/views/risk/drawCanvas/index'),
name: 'drawCanvas',
meta: { title: '四色图', activeMenu: '/risk/drawCanvas/index' }
} }
] ]
}, },
......
...@@ -73,7 +73,7 @@ service.interceptors.response.use(res => { ...@@ -73,7 +73,7 @@ service.interceptors.response.use(res => {
const msg = errorCode[code] || res.data.msg || errorCode['default'] const msg = errorCode[code] || res.data.msg || errorCode['default']
// 二进制数据则直接返回 // 二进制数据则直接返回
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
return res.data return res
} }
if (code === 401) { if (code === 401) {
if (!isRelogin.show) { if (!isRelogin.show) {
...@@ -100,7 +100,7 @@ service.interceptors.response.use(res => { ...@@ -100,7 +100,7 @@ service.interceptors.response.use(res => {
} else { } else {
return res.data return res.data
} }
}, },
error => { error => {
console.log('err' + error) console.log('err' + error)
let { message } = error; let { message } = error;
...@@ -124,7 +124,12 @@ export function download(url, params, filename, config) { ...@@ -124,7 +124,12 @@ export function download(url, params, filename, config) {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob', responseType: 'blob',
...config ...config
}).then(async (data) => { }).then(async (response) => {
var data = response.data;
if (!filename) {
filename = decodeURIComponent(response.headers["content-disposition"].split(';')[1].split('filename=')[1]);
console.log(filename);
}
const isBlob = blobValidate(data); const isBlob = blobValidate(data);
if (isBlob) { if (isBlob) {
const blob = new Blob([data]) const blob = new Blob([data])
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['ledger/project:project:add']" v-hasPermi="['system:ledgerProject:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['ledger/project:project:edit']" v-hasPermi="['system:ledgerProject:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['ledger/project:project:remove']" v-hasPermi="['system:ledgerProject:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['ledger/project:project:export']" v-hasPermi="['system:ledgerProject:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -134,14 +134,14 @@ ...@@ -134,14 +134,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['ledger/project:project:edit']" v-hasPermi="['system:ledgerProject:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['ledger/project:project:remove']" v-hasPermi="['system:ledgerProject:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:room:add']" v-hasPermi="['system:ledgerRoom:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:room:edit']" v-hasPermi="['system:ledgerRoom:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:room:remove']" v-hasPermi="['system:ledgerRoom:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:room:export']" v-hasPermi="['system:ledgerRoom:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -110,14 +110,14 @@ ...@@ -110,14 +110,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:room:edit']" v-hasPermi="['system:ledgerRoom:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:room:remove']" v-hasPermi="['system:ledgerRoom:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
......
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form
ref="loginForm"
:model="loginForm"
:rules="loginRules"
class="login-form"
>
<h3 class="title">融通物管安全管理平台</h3> <h3 class="title">融通物管安全管理平台</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
...@@ -9,7 +14,11 @@ ...@@ -9,7 +14,11 @@
auto-complete="off" auto-complete="off"
placeholder="账号" placeholder="账号"
> >
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" /> <svg-icon
slot="prefix"
icon-class="user"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
...@@ -20,7 +29,11 @@ ...@@ -20,7 +29,11 @@
placeholder="密码" placeholder="密码"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
> >
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> <svg-icon
slot="prefix"
icon-class="password"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code" v-if="captchaEnabled"> <el-form-item prop="code" v-if="captchaEnabled">
...@@ -31,26 +44,36 @@ ...@@ -31,26 +44,36 @@
style="width: 63%" style="width: 63%"
@keyup.enter.native="handleLogin" @keyup.enter.native="handleLogin"
> >
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> <svg-icon
slot="prefix"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</el-input> </el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/> <img :src="codeUrl" @click="getCode" class="login-code-img" />
</div> </div>
</el-form-item> </el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox> <el-checkbox
<el-form-item style="width:100%;"> v-model="loginForm.rememberMe"
style="margin: 0px 0px 25px 0px"
>记住密码</el-checkbox
>
<el-form-item style="width: 100%">
<el-button <el-button
:loading="loading" :loading="loading"
size="medium" size="medium"
type="primary" type="primary"
style="width:100%;" style="width: 100%"
@click.native.prevent="handleLogin" @click.native.prevent="handleLogin"
> >
<span v-if="!loading">登 录</span> <span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span> <span v-else>登 录 中...</span>
</el-button> </el-button>
<div style="float: right;" v-if="register"> <div style="float: right" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link> <router-link class="link-type" :to="'/register'"
>立即注册</router-link
>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -64,7 +87,7 @@ ...@@ -64,7 +87,7 @@
<script> <script>
import { getCodeImg } from "@/api/login"; import { getCodeImg } from "@/api/login";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt' import { encrypt, decrypt } from "@/utils/jsencrypt";
export default { export default {
name: "Login", name: "Login",
...@@ -72,36 +95,36 @@ export default { ...@@ -72,36 +95,36 @@ export default {
return { return {
codeUrl: "", codeUrl: "",
loginForm: { loginForm: {
username: "admin", username: "",
password: "admin123", password: "",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "" uuid: "",
}, },
loginRules: { loginRules: {
username: [ username: [
{ required: true, trigger: "blur", message: "请输入您的账号" } { required: true, trigger: "blur", message: "请输入您的账号" },
], ],
password: [ password: [
{ required: true, trigger: "blur", message: "请输入您的密码" } { required: true, trigger: "blur", message: "请输入您的密码" },
], ],
code: [{ required: true, trigger: "change", message: "请输入验证码" }] code: [{ required: true, trigger: "change", message: "请输入验证码" }],
}, },
loading: false, loading: false,
// 验证码开关 // 验证码开关
captchaEnabled: true, captchaEnabled: true,
// 注册开关 // 注册开关
register: false, register: false,
redirect: undefined redirect: undefined,
}; };
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function (route) {
this.redirect = route.query && route.query.redirect; this.redirect = route.query && route.query.redirect;
}, },
immediate: true immediate: true,
} },
}, },
created() { created() {
this.getCode(); this.getCode();
...@@ -109,8 +132,9 @@ export default { ...@@ -109,8 +132,9 @@ export default {
}, },
methods: { methods: {
getCode() { getCode() {
getCodeImg().then(res => { getCodeImg().then((res) => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled; this.captchaEnabled =
res.captchaEnabled === undefined ? true : res.captchaEnabled;
if (this.captchaEnabled) { if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img; this.codeUrl = "data:image/gif;base64," + res.img;
this.loginForm.uuid = res.uuid; this.loginForm.uuid = res.uuid;
...@@ -120,29 +144,37 @@ export default { ...@@ -120,29 +144,37 @@ export default {
getCookie() { getCookie() {
const username = Cookies.get("username"); const username = Cookies.get("username");
const password = Cookies.get("password"); const password = Cookies.get("password");
const rememberMe = Cookies.get('rememberMe') const rememberMe = Cookies.get("rememberMe");
this.loginForm = { this.loginForm = {
username: username === undefined ? this.loginForm.username : username, username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password), password:
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe) password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
}; };
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
if (this.loginForm.rememberMe) { if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 }); Cookies.set("username", this.loginForm.username, { expires: 30 });
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 }); Cookies.set("password", encrypt(this.loginForm.password), {
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); expires: 30,
});
Cookies.set("rememberMe", this.loginForm.rememberMe, {
expires: 30,
});
} else { } else {
Cookies.remove("username"); Cookies.remove("username");
Cookies.remove("password"); Cookies.remove("password");
Cookies.remove('rememberMe'); Cookies.remove("rememberMe");
} }
this.$store.dispatch("Login", this.loginForm).then(() => { this.$store
this.$router.push({ path: this.redirect || "/" }).catch(()=>{}); .dispatch("Login", this.loginForm)
}).catch(() => { .then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {});
})
.catch(() => {
this.loading = false; this.loading = false;
if (this.captchaEnabled) { if (this.captchaEnabled) {
this.getCode(); this.getCode();
...@@ -150,8 +182,8 @@ export default { ...@@ -150,8 +182,8 @@ export default {
}); });
} }
}); });
} },
} },
}; };
</script> </script>
......
<template> <template>
<div class="wrap" ref="mapmidbox"> <div class="wrap" ref="mapmidbox">
<!-- <div class="north"> <div id="printDiv">
<img src="../../assets/imgs/north.png" alt="" /> <div class="north" style="margin-right: 20px">
</div> --> <img src="../../../assets/images/north.png" alt="" />
</div>
<grid-layout <grid-layout
id="gridView"
:layout.sync="layout" :layout.sync="layout"
:col-num="colNum" :col-num="colNum"
:row-height="30" :row-height="30"
...@@ -27,7 +29,7 @@ ...@@ -27,7 +29,7 @@
@moved="movedEvent" @moved="movedEvent"
:style="{ :style="{
backgroundColor: item.c, backgroundColor: item.c,
border: item.type == 'thorough' ? 'none !important' : '' border: item.type == 'thorough' ? 'none !important' : '',
}" }"
> >
<span class="text" :class="item.w > item.h * 5 ? '' : 'rowText'">{{ <span class="text" :class="item.w > item.h * 5 ? '' : 'rowText'">{{
...@@ -36,19 +38,33 @@ ...@@ -36,19 +38,33 @@
<!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> --> <!-- <span class="remove" @click="removeItem(item.i)" v-if="item.i && isEdit">x</span> -->
</grid-item> </grid-item>
</grid-layout> </grid-layout>
<el-row :gutter="5" style="margin-top: 20px; margin-left: 20px">
<el-col :span="2"> 风险等级图例:</el-col>
<el-col :span="3"> <span class="riskTab type1"></span>重大风险</el-col>
<el-col :span="3"> <span class="riskTab type2"></span>较大风险</el-col>
<el-col :span="3"> <span class="riskTab type3"></span>一般风险</el-col>
<el-col :span="3"> <span class="riskTab type4"></span>较小风险</el-col>
</el-row>
</div>
<el-row style="margin-top: 20px; margin-left: 20px">
<el-button type="primary" @click="getPdf">导 出</el-button>
<el-button @click="cancelDraw">取 消</el-button>
</el-row>
</div> </div>
</template> </template>
<script> <script>
import html2Canvas from "html2canvas";
import JsPDF from "jspdf";
import { GridLayout, GridItem } from "vue-grid-layout"; import { GridLayout, GridItem } from "vue-grid-layout";
import { ledgerRoomList ,getDictList} from "@/api/risk/draw"; import { ledgerRoomList, getDictList } from "@/api/risk/draw";
// 动态添加/删除 // 动态添加/删除
export default { export default {
name: "riskView", name: "riskView",
components: { components: {
GridLayout, GridLayout,
GridItem GridItem,
}, },
data() { data() {
return { return {
...@@ -78,14 +94,14 @@ export default { ...@@ -78,14 +94,14 @@ export default {
isBase: false, isBase: false,
baseName: "", baseName: "",
baseArr: [], baseArr: [],
layoutData: [] layoutData: [],
}; };
}, },
props: { props: {
isView: { isView: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}, },
mounted() { mounted() {
// screenfull.toggle(this.$refs.mapbox); // screenfull.toggle(this.$refs.mapbox);
...@@ -110,6 +126,45 @@ export default { ...@@ -110,6 +126,45 @@ export default {
this.getRoomInfo(); this.getRoomInfo();
}, },
methods: { methods: {
getPdf() {
var title = "四色图";
// html2Canvas(document.querySelector('#pdfDom'), { //这是在界面上设置一个id
//只下载id为pdfDom的内容
html2Canvas(document.querySelector("#printDiv"), {}).then(function (
canvas
) {
console.log(canvas.width, canvas.height);
let contentWidth = canvas.width;
let contentHeight = canvas.height;
let pageHeight = (contentWidth / 592.28) * 841.89; // 一页pdf显示html页面生成的canvas高度;
let leftHeight = contentHeight; //未生成pdf的html页面高度
let position = 0; //pdf页面偏移
//a4纸的尺寸[595.28,841.89],html页面生成的canvas在pdf中图片的宽高
let imgWidth = 595.28;
let imgHeight = (592.28 / contentWidth) * contentHeight;
let pageData = canvas.toDataURL("image/jpeg", 1.0);
let PDF = new JsPDF("", "pt", "a4");
console.log(pageData, "111");
// 有两个高度需要区分,一个是html页面的实际高度,和生成pdf的页面高度(841.89)
//当内容未超过pdf一页显示的范围,无需分页
if (leftHeight < pageHeight) {
PDF.addImage(pageData, "JPEG", 0, 0, imgWidth, imgHeight);
} else {
while (leftHeight > 0) {
PDF.addImage(pageData, "JPEG", 20, position, imgWidth, imgHeight);
leftHeight -= pageHeight;
position -= 841.89;
if (leftHeight > 0) {
PDF.addPage();
}
}
}
PDF.save(title + ".pdf");
});
},
cancelDraw() {
this.$router.go(-1);
},
orientationChange() { orientationChange() {
if (window.orientation === 180 || window.orientation === 0) { if (window.orientation === 180 || window.orientation === 0) {
console.log("竖屏状态!"); console.log("竖屏状态!");
...@@ -179,14 +234,14 @@ export default { ...@@ -179,14 +234,14 @@ export default {
}, },
getRoomInfo() { getRoomInfo() {
let data = { let data = {
floorId: this.$route.params.floorId ? this.$route.params.floorId : "4" floorId: this.$route.params.floorId ? this.$route.params.floorId : "4",
}; };
ledgerRoomList(data) ledgerRoomList(data)
.then(res => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.layout = []; this.layout = [];
this.layoutData = res.data; this.layoutData = res.data;
res.data.forEach(item => { res.data.forEach((item) => {
item.position = JSON.parse(item.position); item.position = JSON.parse(item.position);
item.position.i = item.id; item.position.i = item.id;
item.position.id = item.id; item.position.id = item.id;
...@@ -212,14 +267,14 @@ export default { ...@@ -212,14 +267,14 @@ export default {
// }else if (item.score>=0 && item.score <= 6) { //差 // }else if (item.score>=0 && item.score <= 6) { //差
// item.position.c = this.colorList[0] // item.position.c = this.colorList[0]
// } // }
item.position.c = this.colorList[Math.floor(Math.random() * 4)]; item.position.c = item.color;
// } // }
this.layout.push(item.position); this.layout.push(item.position);
}); });
// console.log('layout==>>',this.layout) // console.log('layout==>>',this.layout)
} }
}) })
.catch(err => { .catch((err) => {
console.log("err==>>", err); console.log("err==>>", err);
}); });
...@@ -236,11 +291,11 @@ export default { ...@@ -236,11 +291,11 @@ export default {
}, },
// 增加 // 增加
addItem() { addItem() {
if (this.layout.find(item => item.i == "")) { if (this.layout.find((item) => item.i == "")) {
Toast.fail({ Toast.fail({
title: "提示", title: "提示",
forbidClick: true, forbidClick: true,
message: "请先点击确定,保存当前房间信息" message: "请先点击确定,保存当前房间信息",
}); });
return; return;
} }
...@@ -253,11 +308,11 @@ export default { ...@@ -253,11 +308,11 @@ export default {
}, },
// 添加其他 // 添加其他
addOther() { addOther() {
if (this.layout.find(item => item.i == "")) { if (this.layout.find((item) => item.i == "")) {
Toast.fail({ Toast.fail({
title: "提示", title: "提示",
forbidClick: true, forbidClick: true,
message: "请先点击确定,保存当前房间信息" message: "请先点击确定,保存当前房间信息",
}); });
return; return;
} }
...@@ -271,11 +326,11 @@ export default { ...@@ -271,11 +326,11 @@ export default {
//添加基础设施 //添加基础设施
addBase() { addBase() {
if (this.layout.find(item => item.i == "")) { if (this.layout.find((item) => item.i == "")) {
Toast.fail({ Toast.fail({
title: "提示", title: "提示",
forbidClick: true, forbidClick: true,
message: "请先点击确定,保存当前房间信息" message: "请先点击确定,保存当前房间信息",
}); });
return; return;
} }
...@@ -294,7 +349,7 @@ export default { ...@@ -294,7 +349,7 @@ export default {
// console.log('this.layout==>>',this.layout) // console.log('this.layout==>>',this.layout)
}, },
// 调整大小后的事件 // 调整大小后的事件
resizedEvent: function(i, newH, newW) { resizedEvent: function (i, newH, newW) {
this.layOutItem.w = newW; this.layOutItem.w = newW;
this.layOutItem.h = newH; this.layOutItem.h = newH;
// console.log('layOutItem==>>',this.layOutItem) // console.log('layOutItem==>>',this.layOutItem)
...@@ -342,8 +397,8 @@ export default { ...@@ -342,8 +397,8 @@ export default {
this.roomName = value.dictValue; this.roomName = value.dictValue;
} }
this.showPicker = false; this.showPicker = false;
} },
} },
}; };
</script> </script>
...@@ -353,14 +408,14 @@ export default { ...@@ -353,14 +408,14 @@ export default {
} }
.wrap { .wrap {
/* height: 100vh; */ /* height: 100vh; */
width: 100vw; width: 105%;
position: relative; position: relative;
} }
.north { .north {
position: absolute; position: absolute;
display: inline-block; display: inline-block;
top: 1.5rem; top: 1.5rem;
right: 0.5rem; right: 5rem;
z-index: 999; z-index: 999;
} }
.north img { .north img {
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['risk:inherent:add']" v-hasPermi="['system:riskInherent:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['risk:inherent:edit']" v-hasPermi="['system:riskInherent:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['risk:inherent:remove']" v-hasPermi="['system:riskInherent:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['risk:inherent:export']" v-hasPermi="['system:riskInherent:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<el-table-column label="楼层名称" align="center" prop="floorName" /> <el-table-column label="楼层名称" align="center" prop="floorName" />
<el-table-column label="房间名称" align="center" prop="roomName" /> <el-table-column label="房间名称" align="center" prop="roomName" />
<el-table-column label="评估人" align="center" prop="userName" /> <el-table-column label="评估人" align="center" prop="userName" />
<el-table-column label="计划id" align="center" prop="planId" /> <!-- <el-table-column label="计划id" align="center" prop="planId" /> -->
<el-table-column label="风险源名称" align="center" prop="name" /> <el-table-column label="风险源名称" align="center" prop="name" />
<el-table-column label="风险点类型" align="center" prop="pointType"> <el-table-column label="风险点类型" align="center" prop="pointType">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -203,8 +203,8 @@ ...@@ -203,8 +203,8 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="存在部位" align="center" prop="presenceLocation" /> <el-table-column label="存在部位" align="center" prop="presenceLocation" />
<el-table-column label="工程技术措施" align="center" prop="measuresProject" /> <!-- <el-table-column label="工程技术措施" align="center" prop="measuresProject" /> -->
<el-table-column label="应采取的管理措施" align="center" prop="measuresAdministration" /> <!-- <el-table-column label="应采取的管理措施" align="center" prop="measuresAdministration" /> -->
<el-table-column label="管控责任单位" align="center" prop="measuresDeptName" /> <el-table-column label="管控责任单位" align="center" prop="measuresDeptName" />
<el-table-column label="管控责任人" align="center" prop="measuresUserName" /> <el-table-column label="管控责任人" align="center" prop="measuresUserName" />
<el-table-column label="应急措施" align="center" prop="measuresEmergency" /> <el-table-column label="应急措施" align="center" prop="measuresEmergency" />
...@@ -215,14 +215,14 @@ ...@@ -215,14 +215,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['risk:inherent:edit']" v-hasPermi="['system:riskInherent:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['risk:inherent:remove']" v-hasPermi="['system:riskInherent:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,78 +4,6 @@ ...@@ -4,78 +4,6 @@
<el-form-item label="任务名称" prop="name"> <el-form-item label="任务名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.name" placeholder="请输入任务名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<!-- <el-form-item label="任务编号" prop="no">
<el-input
v-model="queryParams.no"
placeholder="请输入任务编号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目id" prop="projectId">
<el-input
v-model="queryParams.projectId"
placeholder="请输入项目id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="楼栋ids" prop="buildingIds">
<el-input
v-model="queryParams.buildingIds"
placeholder="请输入楼栋ids"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建人员id" prop="createUserId">
<el-input
v-model="queryParams.createUserId"
placeholder="请输入创建人员id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建单位" prop="createDeptId">
<el-input
v-model="queryParams.createDeptId"
placeholder="请输入创建单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="负责人id" prop="leaderUserId">
<el-input
v-model="queryParams.leaderUserId"
placeholder="请输入负责人id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="执行人员ids" prop="workUserIds">
<el-input
v-model="queryParams.workUserIds"
placeholder="请输入执行人员ids"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择结束时间">
</el-date-picker>
</el-form-item> -->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -88,25 +16,49 @@ ...@@ -88,25 +16,49 @@
<span>{{ scope.$index + 1 }}</span> <span>{{ scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务名称" align="center" prop="name" /> <el-table-column label="任务名称" align="left" prop="name" width="220px"/>
<el-table-column label="任务编号" align="center" prop="no" /> <!-- <el-table-column label="任务编号" align="center" prop="no" /> -->
<el-table-column label="项目名称" align="center" prop="projectName" /> <el-table-column label="项目名称" align="left" prop="projectName" width="220px"/>
<el-table-column label="楼栋名称" align="center" prop="buildingNames" /> <el-table-column label="楼栋名称" align="left" prop="buildingNames" width="220px">
<el-table-column label="创建人员" align="center" prop="createUserName" /> <template slot-scope="scope">
<el-table-column label="创建单位" align="center" prop="createDeptName" />
<el-popover
placement="top-start"
title="楼栋名称"
width="200"
trigger="hover"
:content="scope.row.buildingNames">
<span slot="reference">{{ scope.row.buildingNames.length>25?scope.row.buildingNames.substring(0,25)+"...":scope.row.buildingNames}}</span>
</el-popover>
</template>
</el-table-column>
<!-- <el-table-column label="创建人员" align="center" prop="createUserName" />
<el-table-column label="创建单位" align="center" prop="createDeptName" /> -->
<el-table-column label="负责人" align="center" prop="leaderUserName" /> <el-table-column label="负责人" align="center" prop="leaderUserName" />
<el-table-column label="执行人员" align="center" prop="workUserNames" /> <el-table-column label="执行人员" align="center" prop="workUserNames" />
<el-table-column label="开始时间" align="center" prop="startTime" width="180"> <el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.startTime, "{y}-{m}-{d}") }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime" width="180"> <el-table-column label="结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.endTime, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="statusName" >
<template slot-scope="scope">
<div>
<div v-if="scope.row.statusName=='项目完成'"><el-tag type="info">项目完成</el-tag></div>
<div v-else-if="scope.row.statusName=='审批任务'"><el-tag >审批任务</el-tag></div>
<div v-else-if="scope.row.statusName=='任务待执行'"><el-tag type="warning">任务待执行</el-tag></div>
<div v-else-if="scope.row.statusName=='验收任务'"><el-tag type="success">验收任务</el-tag></div>
<div v-else><el-tag type="danger">{{scope.row.statusName}}</el-tag></div>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="status" />
<el-table-column label="操作" align="center" :show-overflow-tooltip="true"> <el-table-column label="操作" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<router-link :to="'/risk/plan/ledgerdata/index/' + scope.row.id" class="link-type"> <router-link :to="'/risk/plan/ledgerdata/index/' + scope.row.id" class="link-type">
...@@ -118,14 +70,17 @@ ...@@ -118,14 +70,17 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
</div> </div>
</template> </template>
<script> <script>
import { listPlan, addPlan, updatePlan } from "@/api/risk/plan"; import {
listPlan,
addPlan,
updatePlan
} from "@/api/risk/plan";
export default { export default {
name: "Plan", name: "Plan",
data() { data() {
return { return {
...@@ -153,6 +108,7 @@ export default { ...@@ -153,6 +108,7 @@ export default {
pageSize: 10, pageSize: 10,
name: null, name: null,
no: null, no: null,
isLedger:"ledger",
projectId: null, projectId: null,
buildingIds: null, buildingIds: null,
createUserId: null, createUserId: null,
...@@ -166,8 +122,7 @@ export default { ...@@ -166,8 +122,7 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
}
}; };
}, },
created() { created() {
...@@ -177,7 +132,7 @@ export default { ...@@ -177,7 +132,7 @@ export default {
/** 查询风险计划列表 */ /** 查询风险计划列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listPlan(this.queryParams).then(response => { listPlan(this.queryParams).then((response) => {
this.planList = response.rows; this.planList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -207,7 +162,7 @@ export default { ...@@ -207,7 +162,7 @@ export default {
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null updateTime: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -223,11 +178,10 @@ export default { ...@@ -223,11 +178,10 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id) this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
},
}, },
} };
};
</script> </script>
\ No newline at end of file
This diff is collapsed.
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