Commit c8f277df authored by kaitly205422@163.com's avatar kaitly205422@163.com

四色图

parent bd761e36
...@@ -17,3 +17,30 @@ export function getDictList(query) { ...@@ -17,3 +17,30 @@ export function getDictList(query) {
params: query, params: query,
}); });
} }
// 保存固有风险
export function updateBatch(data) {
return request({
url: "/ledger/room/update/batch",
method: "post",
data
});
}
export function getFun(url, params) {
const Url = '/app-api' + url
return request({
url: Url,
method: "get",
params,
});
}
export function postFun(url, data) {
const Url = '/app-api' + url
return request({
url: Url,
method: "post",
data,
});
}
\ No newline at end of file
import { isFunction } from './fns'
export function matchesSelectorToParentElements (el, selector, baseNode) {
let node = el
const matchesSelectorFunc = [
'matches',
'webkitMatchesSelector',
'mozMatchesSelector',
'msMatchesSelector',
'oMatchesSelector'
].find(func => isFunction(node[func]))
if (!isFunction(node[matchesSelectorFunc])) return false
do {
if (node[matchesSelectorFunc](selector)) return true
if (node === baseNode) return false
node = node.parentNode
} while (node)
return false
}
export function getComputedSize ($el) {
const style = window.getComputedStyle($el)
return [
parseFloat(style.getPropertyValue('width'), 10),
parseFloat(style.getPropertyValue('height'), 10)
]
}
export function addEvent (el, event, handler) {
if (!el) {
return
}
if (el.attachEvent) {
el.attachEvent('on' + event, handler)
} else if (el.addEventListener) {
el.addEventListener(event, handler, true)
} else {
el['on' + event] = handler
}
}
export function removeEvent (el, event, handler) {
if (!el) {
return
}
if (el.detachEvent) {
el.detachEvent('on' + event, handler)
} else if (el.removeEventListener) {
el.removeEventListener(event, handler, true)
} else {
el['on' + event] = null
}
}
export function isFunction (func) {
return (typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]')
}
export function snapToGrid (grid, pendingX, pendingY, scale = 1) {
const [scaleX, scaleY] = typeof scale === 'number' ? [scale, scale] : scale
const x = Math.round((pendingX / scaleX) / grid[0]) * grid[0]
const y = Math.round((pendingY / scaleY) / grid[1]) * grid[1]
return [x, y]
}
export function getSize (el) {
const rect = el.getBoundingClientRect()
return [
parseInt(rect.width),
parseInt(rect.height)
]
}
export function computeWidth (parentWidth, left, right) {
return parentWidth - left - right
}
export function computeHeight (parentHeight, top, bottom) {
return parentHeight - top - bottom
}
export function restrictToBounds (value, min, max) {
if (min !== null && value < min) {
return min
}
if (max !== null && max < value) {
return max
}
return value
}
.vdr {
touch-action: none;
position: absolute;
box-sizing: border-box;
border: 1px dashed black;
}
.handle {
box-sizing: border-box;
position: absolute;
width: 10px;
height: 10px;
background: #EEE;
border: 1px solid #333;
}
.handle-tl {
top: -10px;
left: -10px;
cursor: nw-resize;
}
.handle-tm {
top: -10px;
left: 50%;
margin-left: -5px;
cursor: n-resize;
}
.handle-tr {
top: -10px;
right: -10px;
cursor: ne-resize;
}
.handle-ml {
top: 50%;
margin-top: -5px;
left: -10px;
cursor: w-resize;
}
.handle-mr {
top: 50%;
margin-top: -5px;
right: -10px;
cursor: e-resize;
}
.handle-bl {
bottom: -10px;
left: -10px;
cursor: sw-resize;
}
.handle-bm {
bottom: -10px;
left: 50%;
margin-left: -5px;
cursor: s-resize;
}
.handle-br {
bottom: -10px;
right: -10px;
cursor: se-resize;
}
@media only screen and (max-width: 768px) {
[class*="handle-"]:before {
content: '';
left: -10px;
right: -10px;
bottom: -10px;
top: -10px;
position: absolute;
}
}
/** /**
* v-hasPermi 操作权限处理 * v-hasPermi 操作权限处理
* Copyright (c) 2019 ruoyi * Copyright (c) 2019 ruoyi
*/ */
import store from '@/store' import store from '@/store'
export default { export default {
......
...@@ -30,11 +30,11 @@ router.beforeEach((to, from, next) => { ...@@ -30,11 +30,11 @@ router.beforeEach((to, from, next) => {
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
}) })
}).catch(err => { }).catch(err => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
Message.error(err) Message.error(err)
next({ path: '/' }) next({ path: '/' })
})
}) })
})
} else { } else {
next() next()
} }
......
...@@ -204,13 +204,13 @@ export const dynamicRoutes = [ ...@@ -204,13 +204,13 @@ export const dynamicRoutes = [
], ],
}, },
{ {
path: "/risk/drawCanvas/index", path: "/risk/drawCanvas",
component: Layout, component: Layout,
hidden: true, hidden: true,
permissions: ["system:ledgerRoom:list"], permissions: ["system:ledgerRoom:list"],
children: [ children: [
{ {
path: "index/:id(\\d+)", path: "index",
component: () => import("@/views/risk/drawCanvas/index"), component: () => import("@/views/risk/drawCanvas/index"),
name: "drawCanvas", name: "drawCanvas",
meta: { title: "四色图", activeMenu: "/risk/drawCanvas/index" }, meta: { title: "四色图", activeMenu: "/risk/drawCanvas/index" },
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="楼宇名称" prop="buildingName"> <el-form-item label="楼宇名称" prop="buildingName">
<el-input <el-input
v-model="queryParams.buildingName" v-model="queryParams.buildingName"
...@@ -18,7 +25,11 @@ ...@@ -18,7 +25,11 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> <el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
>
<el-option <el-option
v-for="dict in dict.type.sys_normal_disable" v-for="dict in dict.type.sys_normal_disable"
:key="dict.value" :key="dict.value"
...@@ -28,8 +39,16 @@ ...@@ -28,8 +39,16 @@
</el-select> </el-select>
</el-form-item> </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
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-form-item> </el-form-item>
</el-form> </el-form>
...@@ -42,7 +61,8 @@ ...@@ -42,7 +61,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['system:ledgerFloor:add']" v-hasPermi="['system:ledgerFloor:add']"
>新增</el-button> >新增</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -53,7 +73,8 @@ ...@@ -53,7 +73,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['system:ledgerFloor:edit']" v-hasPermi="['system:ledgerFloor:edit']"
>修改</el-button> >修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -64,7 +85,8 @@ ...@@ -64,7 +85,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['system:ledgerFloor:remove']" v-hasPermi="['system:ledgerFloor:remove']"
>删除</el-button> >删除</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
...@@ -74,12 +96,20 @@ ...@@ -74,12 +96,20 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['system:ledgerFloor:export']" v-hasPermi="['system:ledgerFloor: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>
</el-row> </el-row>
<el-table v-loading="loading" :data="floorList" @selection-change="handleSelectionChange"> <el-table
v-loading="loading"
:data="floorList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center"> <el-table-column label="序号" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -89,33 +119,50 @@ ...@@ -89,33 +119,50 @@
<el-table-column label="楼宇名称" align="center" prop="buildingName" /> <el-table-column label="楼宇名称" align="center" prop="buildingName" />
<el-table-column label="楼层名称" align="center" prop="name" /> <el-table-column label="楼层名称" align="center" prop="name" />
<el-table-column label="楼层属性" align="center" prop="type" /> <el-table-column label="楼层属性" align="center" prop="type" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag
:options="dict.type.sys_normal_disable"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-home"
@click="handleManage(scope.row)"
v-hasPermi="['system:ledgerFloor:edit']"
>房间管理</el-button
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['system:ledgerFloor:edit']" v-hasPermi="['system:ledgerFloor: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:ledgerFloor:remove']" v-hasPermi="['system:ledgerFloor:remove']"
>删除</el-button> >删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
...@@ -134,6 +181,7 @@ ...@@ -134,6 +181,7 @@
<el-form-item label="楼层属性" prop="type"> <el-form-item label="楼层属性" prop="type">
<el-input v-model="form.type" placeholder="请输入楼层属性" /> <el-input v-model="form.type" placeholder="请输入楼层属性" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态"> <el-select v-model="form.status" placeholder="请选择状态">
<el-option <el-option
...@@ -144,7 +192,9 @@ ...@@ -144,7 +192,9 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="新增房间" prop="type">
<el-button type="primary" @click="showDrawCanvas">添加</el-button>
</el-form-item> -->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
...@@ -155,11 +205,17 @@ ...@@ -155,11 +205,17 @@
</template> </template>
<script> <script>
import { listFloor, getFloor, delFloor, addFloor, updateFloor } from "@/api/ledger/floor"; import {
listFloor,
getFloor,
delFloor,
addFloor,
updateFloor,
} from "@/api/ledger/floor";
export default { export default {
name: "Floor", name: "Floor",
dicts: ['sys_normal_disable', 'data_source'], dicts: ["sys_normal_disable", "data_source"],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -193,18 +249,26 @@ export default { ...@@ -193,18 +249,26 @@ export default {
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {},
}
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
handleManage({ id, buildingId }) {
this.$router.push({
name: "drawCanvas",
params: {
floorId: id,
buildingId,
},
});
},
/** 查询基础数据-楼层列表 */ /** 查询基础数据-楼层列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listFloor(this.queryParams).then(response => { listFloor(this.queryParams).then((response) => {
this.floorList = response.rows; this.floorList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -228,7 +292,7 @@ export default { ...@@ -228,7 +292,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");
}, },
...@@ -244,9 +308,9 @@ export default { ...@@ -244,9 +308,9 @@ 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;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
...@@ -257,8 +321,8 @@ export default { ...@@ -257,8 +321,8 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids;
getFloor(id).then(response => { getFloor(id).then((response) => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改基础数据-楼层"; this.title = "修改基础数据-楼层";
...@@ -266,16 +330,16 @@ export default { ...@@ -266,16 +330,16 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateFloor(this.form).then(response => { updateFloor(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
addFloor(this.form).then(response => { addFloor(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getList();
...@@ -287,19 +351,27 @@ export default { ...@@ -287,19 +351,27 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除基础数据-楼层编号为"' + ids + '"的数据项?').then(function() { this.$modal
return delFloor(ids); .confirm('是否确认删除基础数据-楼层编号为"' + ids + '"的数据项?')
}).then(() => { .then(function () {
this.getList(); return delFloor(ids);
this.$modal.msgSuccess("删除成功"); })
}).catch(() => {}); .then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('/system/ledger/floor/export', { this.download(
...this.queryParams "/system/ledger/floor/export",
}, `floor_${new Date().getTime()}.xlsx`) {
} ...this.queryParams,
} },
`floor_${new Date().getTime()}.xlsx`
);
},
},
}; };
</script> </script>
...@@ -292,6 +292,9 @@ export default { ...@@ -292,6 +292,9 @@ export default {
padding: 5px 0; padding: 5px 0;
} }
} }
::v-deep .map-content-title {
width: 30%;
}
} }
ul, ul,
li { li {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view" icon="el-icon-view"
@click="showDrawCanvas(scope.row.floorId)" @click="showDrawCanvas(scope.row.floorId,scope.row.buildingId)"
>查看四色图</el-button >查看四色图</el-button
> >
<router-link <router-link
...@@ -349,6 +349,7 @@ export default { ...@@ -349,6 +349,7 @@ export default {
name: "drawCanvas", name: "drawCanvas",
params: { params: {
floorId: floorId, floorId: floorId,
isViews: true,
}, },
}); });
}, },
......
...@@ -44,6 +44,12 @@ module.exports = { ...@@ -44,6 +44,12 @@ module.exports = {
["^" + process.env.VUE_APP_BASE_API]: "", ["^" + process.env.VUE_APP_BASE_API]: "",
}, },
}, },
"/app-api": {
// target: "http://192.168.10.137:8080/",
target: `http://192.168.4.232:8080/`, //服务器地址
// target: `http://192.168.15.230:8081`, //晓晋本地地址
changeOrigin: true,
},
}, },
disableHostCheck: true, disableHostCheck: true,
}, },
...@@ -57,7 +63,7 @@ module.exports = { ...@@ -57,7 +63,7 @@ module.exports = {
pxtorem({ pxtorem({
rootValue: 192,//这个尺寸可以根据自己的图去配置,这里配置的是宽度375的图(如果用了vant插件) rootValue: 192,//这个尺寸可以根据自己的图去配置,这里配置的是宽度375的图(如果用了vant插件)
propList: ['*'], propList: ['*'],
exclude: /(element-ui|node_modules|layout|assets)/ exclude: /(element-ui|node_modules|layout|assets|risk|drawCanvas)/
}) })
] ]
} }
......
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