散点工程 坐标系选择
6
built.js
|
@ -7,13 +7,13 @@ sshPublish();
|
|||
async function sshPublish() {
|
||||
let privateKeyPath = '';
|
||||
|
||||
const publishDir = 'D:/nginx-1.25.1/nginx-1.25.1/html/dist';
|
||||
const publishDir = '/www/server/nginx/html/deepdragon';
|
||||
let remoteConfig = undefined;
|
||||
|
||||
privateKeyPath = '';
|
||||
remoteConfig = {
|
||||
host: '139.224.252.239',
|
||||
username: 'Administrator',
|
||||
host: '119.3.156.115',
|
||||
username: 'root',
|
||||
password: 'Jsld.0813',
|
||||
port: 22,
|
||||
readyTimeout: 5000000
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>遁地龙智慧系统</title>
|
||||
</head>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"build:prod": "vite build && node ./built.js",
|
||||
"built": "node ./built.js",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -17,10 +18,12 @@
|
|||
"dependencies": {
|
||||
"@arcgis/core": "^4.27.6",
|
||||
"@element-plus/icons-vue": "2.0.10",
|
||||
"@turf/turf": "^6.5.0",
|
||||
"@vue-office/excel": "^1.4.5",
|
||||
"@vueup/vue-quill": "1.1.0",
|
||||
"@vueuse/core": "9.5.0",
|
||||
"axios": "0.27.2",
|
||||
"dxf-writer": "^1.18.4",
|
||||
"echarts": "5.4.0",
|
||||
"element-plus": "2.2.27",
|
||||
"esri-leaflet": "^3.0.11",
|
||||
|
@ -49,9 +52,9 @@
|
|||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^4.2.3",
|
||||
"@vue/compiler-sfc": "3.2.45",
|
||||
"leaflet": "^1.9.4",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"sass": "1.56.1",
|
||||
"terser": "^5.31.0",
|
||||
"unplugin-auto-import": "0.11.4",
|
||||
"vite": "^4.4.5",
|
||||
"vite-plugin-compression": "0.5.1",
|
||||
|
|
5459
pnpm-lock.yaml
|
@ -0,0 +1,74 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//获取用户列表
|
||||
export function wxuserList(query) {
|
||||
return request({
|
||||
url: '/wxuser/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//获取用户列表
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/wxuser/add',
|
||||
method: 'post',
|
||||
baseURL: "/afterSales-api",
|
||||
data
|
||||
})
|
||||
}
|
||||
//修改用户
|
||||
|
||||
export function update(data) {
|
||||
return request({
|
||||
url: '/wxuser/update',
|
||||
method: 'post',
|
||||
baseURL: "/afterSales-api",
|
||||
data
|
||||
})
|
||||
}
|
||||
//删除用户
|
||||
|
||||
export function remove(userIds) {
|
||||
return request({
|
||||
url: '/wxuser/remove/'+userIds,
|
||||
method: 'delete',
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//获取用户列表
|
||||
export function supporterApply(query) {
|
||||
return request({
|
||||
url: '/supporterApply/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//审核通过
|
||||
export function agree(applyId) {
|
||||
return request({
|
||||
url: '/supporterApply/agree/'+applyId,
|
||||
method: 'post',
|
||||
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//审核驳回
|
||||
export function reject(applyId) {
|
||||
return request({
|
||||
url: '/supporterApply/reject/'+applyId,
|
||||
method: 'post',
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//审核删除
|
||||
export function deleteAppId(applyId) {
|
||||
return request({
|
||||
url: '/supporterApply/remove/'+applyId,
|
||||
method: 'delete',
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//获取设备配件列表
|
||||
export function devicePartslist(query) {
|
||||
return request({
|
||||
url: '/deviceParts/list',
|
||||
method: 'get',
|
||||
baseURL: "/afterSales-api",
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
//新增配件
|
||||
export function devicePartsPost(query) {
|
||||
return request({
|
||||
url: '/deviceParts',
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
|
||||
//修改配件
|
||||
export function devicePartsPut(query) {
|
||||
return request({
|
||||
url: '/deviceParts',
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'put',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
//删除配件
|
||||
|
||||
export function devicePartsdel(partsId) {
|
||||
return request({
|
||||
url: '/deviceParts'+partsId,
|
||||
method: 'delete',
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//场景列表
|
||||
export function sceneList(query) {
|
||||
return request({
|
||||
url: '/deviceRepairScene/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//新增场景
|
||||
export function deviceRepairPOST(data) {
|
||||
return request({
|
||||
url: '/deviceRepairScene',
|
||||
method: 'post',
|
||||
data: data,
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//修改场景
|
||||
export function deviceRepairPUT(data) {
|
||||
return request({
|
||||
url: '/deviceRepairScene',
|
||||
method: 'put',
|
||||
data: data,
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//删除场景
|
||||
export function deviceRepairDEL(sceneIds) {
|
||||
return request({
|
||||
url: '/deviceRepairScene/'+sceneIds,
|
||||
method: 'delete',
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
||||
//查询配件
|
||||
export function deviceRepairParts(sceneIds) {
|
||||
return request({
|
||||
url: '/deviceRepairScene/parts/'+sceneIds,
|
||||
method: 'get',
|
||||
baseURL: "/afterSales-api",
|
||||
})
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//获取操作日志记录列表
|
||||
|
||||
export function operloglist(query) {
|
||||
return request({
|
||||
url: '/monitor/operlog/list',
|
||||
method: 'get',
|
||||
baseURL: "/afterSales-api",
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//获取访问记录列表
|
||||
|
||||
|
||||
export function logininforlist(query) {
|
||||
return request({
|
||||
url: '/monitor/logininfor/list',
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//批量删除操作日志记录
|
||||
|
||||
|
||||
export function operlogDel(operIds) {
|
||||
return request({
|
||||
url: '/monitor/operlog/'+operIds,
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//获取工单列表
|
||||
export function getorderList(query) {
|
||||
return request({
|
||||
url: '/deviceRepair/order/list',
|
||||
method: 'get',
|
||||
baseURL: "/afterSales-api",
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//获取工单详情
|
||||
export function orderDetailByid(orderId) {
|
||||
return request({
|
||||
url: '/deviceRepair/order/orderDetail/'+orderId,
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//获取工单操作
|
||||
export function orderactionByid(orderId) {
|
||||
return request({
|
||||
url: '/deviceRepair/order/action/'+orderId,
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//工单评价
|
||||
export function companyRating(data) {
|
||||
return request({
|
||||
url: '/deviceRepair/order/companyRating/'+data.orderId,
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'post',
|
||||
data
|
||||
|
||||
})
|
||||
}
|
||||
//获取待结算工单列表
|
||||
export function settlementList(query) {
|
||||
return request({
|
||||
url: '/deviceRepairOrder/settlementList',
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'get',
|
||||
params: query
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
//结算
|
||||
export function settlementAction(data) {
|
||||
return request({
|
||||
url: '/deviceRepairOrder/settlementAction/'+data.orderId,
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'post',
|
||||
data: data
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
export function upload(data) {
|
||||
return request({
|
||||
url:'/support/oss/upload',
|
||||
method: 'post',
|
||||
baseURL: "/afterSales-api",
|
||||
data,
|
||||
headers:{
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
isNosessionObj:true,
|
||||
isNoLoading:true
|
||||
})
|
||||
}
|
||||
export function uploadDel(ossIds) {
|
||||
return request({
|
||||
url:'/support/oss/'+ossIds,
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
//查看银行付款回单
|
||||
export function bankReceip(orderId) {
|
||||
return request({
|
||||
url:'/deviceRepairOrder/bankReceip/'+orderId,
|
||||
baseURL: "/afterSales-api",
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
import request from '@/utils/request'
|
||||
// 查询档案列表
|
||||
export function regonlist(query) {
|
||||
return request({
|
||||
url: '/pipe/profilesRecognition/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//查询用户列表
|
||||
export function regonlayerUsers(profilesId) {
|
||||
return request({
|
||||
url: '/pipe/profilesRecognition/layerAuthUsers/'+profilesId,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
//查询档案已授权用户
|
||||
export function regonauthUserGet(profilesId) {
|
||||
return request({
|
||||
url: '/pipe/profilesRecognition/authUser/'+profilesId,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
//档案授权
|
||||
export function regonauthUserPut(data) {
|
||||
return request({
|
||||
url: '/pipe/profilesRecognition/authUser',
|
||||
method: 'PUT',
|
||||
data:data
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
//删除档案
|
||||
export function regonprofilesDel(ids) {
|
||||
return request({
|
||||
url: '/pipe/profilesRecognition/'+ids,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
// 查询档案列表
|
||||
export function linelist(query) {
|
||||
return request({
|
||||
url: '/pipe/profilesPipeline/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
//查询用户列表
|
||||
export function linelayerUsers(profilesId) {
|
||||
return request({
|
||||
url: '/pipe/profilesPipeline/layerAuthUsers/'+profilesId,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
//查询档案已授权用户
|
||||
export function lineauthUserGet(profilesId) {
|
||||
return request({
|
||||
url: '/pipe/profilesPipeline/authUser/'+profilesId,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
//档案授权
|
||||
export function lineauthUserPut(data) {
|
||||
return request({
|
||||
url: '/pipe/profilesPipeline/authUser',
|
||||
method: 'PUT',
|
||||
data:data
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
//删除档案
|
||||
export function lineprofilesDel(ids) {
|
||||
return request({
|
||||
url: '/pipe/profilesPipeline/'+ids,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
import request from '@/utils/request'
|
||||
// 改造方案列表
|
||||
|
||||
export function list(query) {
|
||||
return request({
|
||||
url: '/renovationPlan/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
baseURL: "/water-api"
|
||||
})
|
||||
}
|
||||
// 站点列表
|
||||
export function devices(query) {
|
||||
return request({
|
||||
url: '/renovationPlan/devices',
|
||||
method: 'get',
|
||||
params: query,
|
||||
baseURL: "/plan-api"
|
||||
})
|
||||
}
|
||||
// 查询施工信息和审核信息
|
||||
export function build(query) {
|
||||
return request({
|
||||
url: '/renovationPlan/build',
|
||||
method: 'get',
|
||||
params: query,
|
||||
baseURL: "/plan-api"
|
||||
})
|
||||
}
|
||||
// 查询改造详情
|
||||
export function details(query) {
|
||||
return request({
|
||||
url: '/renovationPlan/details',
|
||||
method: 'get',
|
||||
params: query,
|
||||
baseURL: "/plan-api"
|
||||
})
|
||||
}
|
||||
// 审核驳回
|
||||
export function reject(data) {
|
||||
return request({
|
||||
url: '/renovationPlan/review/reject',
|
||||
method: 'post',
|
||||
data,
|
||||
baseURL: "/plan-api"
|
||||
})
|
||||
}
|
||||
// 审核通过
|
||||
export function complete(data) {
|
||||
return request({
|
||||
url: '/renovationPlan/review/complete',
|
||||
method: 'post',
|
||||
data,
|
||||
baseURL: "/plan-api"
|
||||
})
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function excel(planId) {
|
||||
return request({
|
||||
url: '/renovationPlan/export/excel?planId='+planId,
|
||||
method: 'post',
|
||||
// data,
|
||||
baseURL: "/plan-api"
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -34,7 +34,16 @@ router.beforeEach((to, from, next) => {
|
|||
router.addRoute(route) // 动态添加可访问路由表
|
||||
}
|
||||
})
|
||||
if(to.path==='/'){
|
||||
// next({ name:"Layers" }) // hack方法 确保addRoutes已完成
|
||||
let name = accessRoutes[0].children[0].name
|
||||
router.push({name})
|
||||
}else{
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
}).catch(err => {
|
||||
useUserStore().logOut().then(() => {
|
||||
|
|
|
@ -57,19 +57,19 @@ export const constantRoutes = [
|
|||
component: () => import('@/views/error/401'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: '/index',
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// path: '',
|
||||
// component: Layout,
|
||||
// redirect: '/index',
|
||||
// children: [
|
||||
// {
|
||||
// path: '/index',
|
||||
// component: () => import('@/views/index'),
|
||||
// name: 'Index',
|
||||
// meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
|
@ -83,7 +83,8 @@ export const constantRoutes = [
|
|||
meta: { title: '个人中心', icon: 'user' }
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
// 动态路由,基于用户权限动态去加载
|
||||
|
|
|
@ -134,6 +134,7 @@ export function filterDynamicRoutes(routes) {
|
|||
}
|
||||
}
|
||||
})
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,214 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
|
||||
<el-form-item label="请求地址" prop="noticeTitle">
|
||||
<el-input
|
||||
v-model="queryParams.operUrl"
|
||||
placeholder="请输入公告标题"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="noticeList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" width="80" />
|
||||
<el-table-column label="名称" align="center" prop="title">
|
||||
</el-table-column>
|
||||
<el-table-column label="请求地址" align="center" prop="operUrl">
|
||||
</el-table-column>
|
||||
<el-table-column label="请求参数" prop="operParam" :show-overflow-tooltip="true"> </el-table-column>
|
||||
<el-table-column label="请求类型" prop="requestMethod"> </el-table-column>
|
||||
<el-table-column
|
||||
label="返回参数"
|
||||
align="center"
|
||||
prop="jsonResult"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="IP" align="center" prop="operIp">
|
||||
</el-table-column>
|
||||
<el-table-column label="地址/源" align="center" prop="operLocation">
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- <el-table-column label="创建者" align="center" prop="createBy" width="100" /> -->
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="operTime"
|
||||
|
||||
>
|
||||
<!-- <template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
import { operloglist } from "@/api/aftersales/log";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_notice_status, sys_notice_type } = proxy.useDict(
|
||||
"sys_notice_status",
|
||||
"sys_notice_type"
|
||||
);
|
||||
|
||||
const noticeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
rules: {
|
||||
noticeTitle: [
|
||||
{ required: true, message: "公告标题不能为空", trigger: "blur" },
|
||||
],
|
||||
noticeType: [
|
||||
{ required: true, message: "公告类型不能为空", trigger: "change" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询公告列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
operloglist(queryParams.value).then((response) => {
|
||||
noticeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
noticeId: undefined,
|
||||
noticeTitle: undefined,
|
||||
noticeType: undefined,
|
||||
noticeContent: undefined,
|
||||
status: "0",
|
||||
};
|
||||
proxy.resetForm("noticeRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.noticeId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加公告";
|
||||
}
|
||||
/**修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const noticeId = row.noticeId || ids.value;
|
||||
getNotice(noticeId).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改公告";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["noticeRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.noticeId != undefined) {
|
||||
updateNotice(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addNotice(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const noticeIds = row.noticeId || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delNotice(noticeIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -0,0 +1,207 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
|
||||
<el-form-item label="登录手机号" prop="noticeTitle">
|
||||
<el-input
|
||||
v-model="queryParams.phonenumber"
|
||||
placeholder="请输入公告标题"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="noticeList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" type="index" width="80" />
|
||||
<el-table-column label="登录手机号" align="center" prop="phonenumber">
|
||||
</el-table-column>
|
||||
<el-table-column label="设备" align="center" prop="os">
|
||||
</el-table-column>
|
||||
<el-table-column label="登录信息" prop="msg"> </el-table-column>
|
||||
|
||||
|
||||
|
||||
<el-table-column label="IP" align="center" prop="ipaddr">
|
||||
</el-table-column>
|
||||
<el-table-column label="地址/源" align="center" prop="loginLocation">
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<!-- <el-table-column label="创建者" align="center" prop="createBy" width="100" /> -->
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="loginTime"
|
||||
|
||||
>
|
||||
<!-- <template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
import { logininforlist } from "@/api/aftersales/log";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_notice_status, sys_notice_type } = proxy.useDict(
|
||||
"sys_notice_status",
|
||||
"sys_notice_type"
|
||||
);
|
||||
|
||||
const noticeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
rules: {
|
||||
noticeTitle: [
|
||||
{ required: true, message: "公告标题不能为空", trigger: "blur" },
|
||||
],
|
||||
noticeType: [
|
||||
{ required: true, message: "公告类型不能为空", trigger: "change" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询公告列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
logininforlist(queryParams.value).then((response) => {
|
||||
noticeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
noticeId: undefined,
|
||||
noticeTitle: undefined,
|
||||
noticeType: undefined,
|
||||
noticeContent: undefined,
|
||||
status: "0",
|
||||
};
|
||||
proxy.resetForm("noticeRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.noticeId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加公告";
|
||||
}
|
||||
/**修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const noticeId = row.noticeId || ids.value;
|
||||
getNotice(noticeId).then((response) => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改公告";
|
||||
});
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["noticeRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.noticeId != undefined) {
|
||||
updateNotice(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addNotice(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const noticeIds = row.noticeId || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delNotice(noticeIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -0,0 +1,319 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
||||
|
||||
<el-form-item label="姓名" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.phonenumber"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:notice:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="noticeList">
|
||||
|
||||
<el-table-column label="序号" align="center" type="index" width="80" />
|
||||
<el-table-column
|
||||
label="姓名"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{scope.row.nickName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="区域"
|
||||
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{scope.row.provinceName}}--{{scope.row.cityName}}--{{scope.row.areaName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="手机号" align="center" prop="phonenumber">
|
||||
</el-table-column>
|
||||
<el-table-column label="人员类型" align="center" prop="role" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="warning" v-if="scope.row.status=='0'">待审核</el-tag>
|
||||
<el-tag type="success" v-else-if="scope.row.status=='1'">已通过</el-tag>
|
||||
<el-tag type="danger" v-else>已驳回</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="创建者" align="center" prop="createBy" width="100" /> -->
|
||||
<el-table-column label="申请时间" align="center" prop="createTime" >
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']">审核</el-button>
|
||||
<!-- <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice:remove']" >删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="40%" append-to-body>
|
||||
<el-form :model="form" :rules="rules" ref="userRef" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="用户姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName" placeholder="请输入用户昵称" disabled maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input v-model="form.phonenumber" placeholder="请输入手机号码" disabled maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="区域" prop="phonenumber">
|
||||
<el-cascader v-model="addr"
|
||||
:options="options"
|
||||
disabled
|
||||
style="width: 100%;"
|
||||
|
||||
:props="cityProps" clearable/>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="身份证号" prop="phonenumber">
|
||||
<el-input v-model="form.identityNumber" placeholder="请输入" disabled maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="银行卡号" prop="phonenumber">
|
||||
<el-input v-model="form.bankCardNumber" placeholder="请输入" disabled maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="开户行" prop="phonenumber">
|
||||
<el-input v-model="form.bankName" placeholder="请输入" disabled maxlength="11" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="agreeAppId">通 过</el-button>
|
||||
<el-button type="danger" @click="rejectAppId">驳回</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
|
||||
import { supporterApply, agree, reject,deleteAppId } from "@/api/aftersales/afteruser";
|
||||
import cityData from './city.json'
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_user_sex,sys_normal_disable } = proxy.useDict("sys_user_sex","sys_normal_disable" );
|
||||
|
||||
const noticeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const options =ref(cityData)
|
||||
const cityProps = ref({
|
||||
value:'code',
|
||||
label:'name' ,
|
||||
children: 'children',
|
||||
})
|
||||
const roleOptions = ref([
|
||||
{
|
||||
roleId: 0,
|
||||
roleName: '客户',
|
||||
},
|
||||
{
|
||||
roleId: 1,
|
||||
roleName: '售后',
|
||||
|
||||
}
|
||||
])
|
||||
const addr =ref()
|
||||
const applyId =ref()
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
const { queryParams, form } = toRefs(data);
|
||||
|
||||
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
supporterApply(queryParams.value).then(response => {
|
||||
noticeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
applyId: undefined,
|
||||
|
||||
};
|
||||
proxy.resetForm("applyRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.applyId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加公告";
|
||||
}
|
||||
function handleChange(e){
|
||||
console.log(e)
|
||||
console.log(addr.value)
|
||||
|
||||
}
|
||||
/**修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
form.value = row;
|
||||
open.value = true;
|
||||
applyId.value =row.applyId
|
||||
title.value = row.nickName;
|
||||
addr.value = [row.provinceCode.toString().substr(0,2), row.cityCode.toString().substr(0,4), row.areaCode.toString()]
|
||||
|
||||
}
|
||||
function rejectAppId(){
|
||||
reject( applyId.value).then(res=>{
|
||||
proxy.$modal.msgSuccess("驳回成功");
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
|
||||
function agreeAppId() {
|
||||
console.log(addr.value)
|
||||
agree( applyId.value).then(res=>{
|
||||
proxy.$modal.msgSuccess("通过成功");
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const applyIds = row.applyId || ids.value
|
||||
proxy.$modal.confirm('是否确认人员为"' + row.nickName + '"的数据项?').then(function() {
|
||||
return deleteAppId(applyIds);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -0,0 +1,435 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
<el-form-item label="姓名">
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="手机号">
|
||||
<el-input
|
||||
v-model="queryParams.phonenumber"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="人员类型">
|
||||
<el-select
|
||||
v-model="queryParams.role"
|
||||
placeholder="人员类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option label="维修人员" value="supporter" />
|
||||
<el-option label="客户角色" value="customer" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:notice:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="noticeList">
|
||||
<el-table-column label="序号" align="center" type="index" width="80" />
|
||||
<el-table-column label="手机号" align="center" prop="phonenumber">
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
{{ scope.row.nickName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="区域" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
{{ scope.row.provinceName }}--{{ scope.row.cityName }}--{{
|
||||
scope.row.areaName
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="人员类型" align="center" prop="role" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag type="primary" v-if="scope.row.role == 'customer'"
|
||||
>客户角色</el-tag
|
||||
>
|
||||
<el-tag type="success" v-else>维修人员</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="创建者" align="center" prop="createBy" width="100" /> -->
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="100"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, "{y}-{m}-{d}") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="780px" append-to-body>
|
||||
<el-form :model="form" :rules="rules" ref="userRef" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户姓名" prop="nickName">
|
||||
<el-input
|
||||
v-model="form.nickName"
|
||||
placeholder="请输入用户昵称"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号码" prop="phonenumber">
|
||||
<el-input
|
||||
v-model="form.phonenumber"
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="区域" prop="phonenumber">
|
||||
<el-cascader
|
||||
ref="myCascader"
|
||||
v-model="addArea"
|
||||
:options="options"
|
||||
style="width: 100%"
|
||||
@change="handleChange"
|
||||
:props="cityProps"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户性别">
|
||||
<el-select v-model="form.sex" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="dict in sys_user_sex"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="form.role" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in roleOptions"
|
||||
:key="item.roleId"
|
||||
:label="item.roleName"
|
||||
:value="item.roleId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="邮箱">
|
||||
<el-input
|
||||
v-model="form.email"
|
||||
placeholder="请输入邮箱"
|
||||
maxlength="50"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-if="form.role=='supporter'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="identityNumber">
|
||||
<el-input
|
||||
v-model="form.identityNumber"
|
||||
placeholder="请输入"
|
||||
maxlength="30"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行卡号" prop="bankCardNumber">
|
||||
<el-input
|
||||
v-model="form.bankCardNumber"
|
||||
placeholder="请输入"
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行" prop="bankName">
|
||||
<el-input
|
||||
v-model="form.bankName"
|
||||
placeholder="请输入"
|
||||
maxlength="11"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
import { wxuserList, update, remove, add } from "@/api/aftersales/afteruser";
|
||||
import cityData from "./city.json";
|
||||
console.log();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_user_sex, sys_normal_disable } = proxy.useDict(
|
||||
"sys_user_sex",
|
||||
"sys_normal_disable"
|
||||
);
|
||||
|
||||
const noticeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const options = ref(cityData);
|
||||
const cityProps = ref({
|
||||
value: "code",
|
||||
label: "name",
|
||||
children: "children",
|
||||
});
|
||||
const roleOptions = ref([
|
||||
{
|
||||
roleId: "customer",
|
||||
roleName: "客户角色",
|
||||
},
|
||||
{
|
||||
roleId: "supporter",
|
||||
roleName: "维修人员",
|
||||
},
|
||||
]);
|
||||
const addArea = ref();
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
rules: {
|
||||
noticeTitle: [
|
||||
{ required: true, message: "公告标题不能为空", trigger: "blur" },
|
||||
],
|
||||
noticeType: [
|
||||
{ required: true, message: "公告类型不能为空", trigger: "change" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询公告列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
wxuserList(queryParams.value).then((response) => {
|
||||
noticeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
userId: undefined,
|
||||
|
||||
status: "0",
|
||||
};
|
||||
proxy.resetForm("userRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
function handleChange(value, e) {
|
||||
console.log();
|
||||
let pathLabels = proxy.$refs.myCascader.getCheckedNodes()[0].pathLabels;
|
||||
console.log(value, e);
|
||||
form.value.provinceCode = value[0] + "0000";
|
||||
form.value.cityCode = value[1] + "00";
|
||||
form.value.areaCode = value[2];
|
||||
form.value.provinceName = pathLabels[0];
|
||||
form.value.cityName = pathLabels[1];
|
||||
form.value.areaName = pathLabels[2];
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
addArea.value = [];
|
||||
title.value = "添加用户";
|
||||
}
|
||||
/**修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
console.log(row);
|
||||
form.value = Object.assign({}, row);
|
||||
open.value = true;
|
||||
|
||||
title.value = row.nickName;
|
||||
addArea.value = [
|
||||
row.provinceCode.toString().substr(0, 2),
|
||||
row.cityCode.toString().substr(0, 4),
|
||||
row.areaCode.toString(),
|
||||
];
|
||||
console.log(addArea.value);
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["userRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.userId != undefined) {
|
||||
update(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
add(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const userId = row.userId;
|
||||
proxy.$modal
|
||||
.confirm('是否确认用户为"' + row.nickName + '"的数据项?')
|
||||
.then(function () {
|
||||
return remove(userId);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -0,0 +1,409 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="deviceName"
|
||||
placeholder="请输入设备型号"
|
||||
clearable
|
||||
prefix-icon="Search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="DeviceVersion"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="VersionRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
<el-form-item label="物料名称" prop="partsName">
|
||||
<el-input
|
||||
v-model="queryParams.partsName"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:notice:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="noticeList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
width="80"
|
||||
/>
|
||||
|
||||
<el-table-column label="物料编码" align="center" prop="partsCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
{{ scope.row.partsName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="规格型号" align="center" prop="partsModel">
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" prop="partsUnit">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="库存"
|
||||
align="center"
|
||||
prop="quantityMolecular"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="价格"
|
||||
align="center"
|
||||
prop="price"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="100"
|
||||
>
|
||||
<!-- <template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="780px" append-to-body>
|
||||
<el-form ref="noticeRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="物料编码" prop="partsCode">
|
||||
<el-input v-model="form.partsCode" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备类型" prop="deviceVersion">
|
||||
<el-select
|
||||
v-model="form.deviceVersion"
|
||||
placeholder="设备类型"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in device_version"
|
||||
:key="item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="物料名称" prop="partsName">
|
||||
<el-input v-model="form.partsName" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="规格型号" prop="partsModel">
|
||||
<el-input v-model="form.partsModel" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="单位" prop="partsUnit">
|
||||
<el-input v-model="form.partsUnit" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="库存" prop="quantityMolecular">
|
||||
<el-input v-model="form.quantityMolecular" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="价格">
|
||||
<el-input v-model="form.price" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
import {
|
||||
devicePartslist,
|
||||
devicePartsPut,
|
||||
devicePartsdel,
|
||||
} from "@/api/aftersales/deviceParts";
|
||||
import { getDicts } from "@/api/system/dict/data";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const noticeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const DeviceVersion = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
rules: {
|
||||
partsCode: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
partsModel: [{ required: true, message: "不能为空", trigger: "change" }],
|
||||
partsName: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
deviceVersion: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
partsUnit: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
quantityMolecular: [
|
||||
{ required: true, message: "不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const deviceName = ref("");
|
||||
const device_version = ref([]);
|
||||
function getVersion() {
|
||||
getDicts("device_version").then((res) => {
|
||||
device_version.value = res.data;
|
||||
DeviceVersion.value = [
|
||||
{
|
||||
id: 0,
|
||||
label: "所有类型",
|
||||
parentId: -1,
|
||||
children: res.data.map((item) => {
|
||||
return {
|
||||
id: item.dictValue,
|
||||
label: item.dictLabel,
|
||||
parentId: 0,
|
||||
...item,
|
||||
};
|
||||
}),
|
||||
},
|
||||
];
|
||||
});
|
||||
}
|
||||
getVersion();
|
||||
/** 根据名称筛选部门树 */
|
||||
watch(deviceName, (val) => {
|
||||
proxy.$refs["VersionRef"].filter(val);
|
||||
});
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
function handleNodeClick(e) {
|
||||
console.log(e);
|
||||
queryParams.value.deviceVersion = e.dictValue;
|
||||
getList();
|
||||
}
|
||||
/** 查询公告列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
devicePartslist(queryParams.value).then((response) => {
|
||||
noticeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
noticeId: undefined,
|
||||
noticeTitle: undefined,
|
||||
noticeType: undefined,
|
||||
noticeContent: undefined,
|
||||
status: "0",
|
||||
};
|
||||
proxy.resetForm("noticeRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
const idName = ref();
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.partsId);
|
||||
idName.value = selection.map((item) => item.partsName);
|
||||
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
if (queryParams.value.deviceVersion) {
|
||||
form.value.deviceVersion = queryParams.value.deviceVersion;
|
||||
open.value = true;
|
||||
title.value = "添加公告";
|
||||
} else {
|
||||
proxy.$modal.msgWarning("请先选择设备型号");
|
||||
}
|
||||
}
|
||||
/**修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
form.value = Object.assign({}, row);
|
||||
open.value = true;
|
||||
title.value = row.partsName;
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["noticeRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.partsId != undefined) {
|
||||
devicePartsPut(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
devicePartsPost(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const partsId = row.partsId || ids.value;
|
||||
const partsName = row.partsName || idName.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除物料"' + partsName + '"的数据项?')
|
||||
.then(function () {
|
||||
return devicePartsdel(partsId);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -0,0 +1,410 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="deviceName"
|
||||
placeholder="请输入设备型号"
|
||||
clearable
|
||||
prefix-icon="Search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="DeviceVersion"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="deptTreeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
<el-form-item label="物料名称" prop="partsName">
|
||||
<el-input
|
||||
v-model="queryParams.partsName"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:notice:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="noticeList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="序号"
|
||||
align="center"
|
||||
type="index"
|
||||
width="80"
|
||||
/>
|
||||
|
||||
<el-table-column label="场景名称" align="center" prop="sceneName">
|
||||
</el-table-column>
|
||||
<el-table-column label="价格区间" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
{{ scope.row.minPrice }} ~ {{ scope.row.maxPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
|
||||
>
|
||||
<!-- <template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:notice:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 添加或修改公告对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="780px" append-to-body>
|
||||
<el-form ref="VersionRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="场景名称" prop="sceneName">
|
||||
<el-input v-model="form.sceneName" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备类型" prop="deviceVersion">
|
||||
<el-select
|
||||
v-model="form.deviceVersion"
|
||||
placeholder="设备类型"
|
||||
@change="changeVerson"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in device_version"
|
||||
:key="item.dictValue"
|
||||
:label="item.dictLabel"
|
||||
:value="item.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="配件选择" prop="deviceVersion">
|
||||
<el-transfer v-model="device_value"
|
||||
:titles="['未选配件', '已选配件']"
|
||||
|
||||
:data="device_list" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
import {
|
||||
devicePartslist,
|
||||
devicePartsPut,
|
||||
devicePartsdel,
|
||||
deviceRepairDEL,
|
||||
deviceRepairParts,
|
||||
deviceRepairPUT,
|
||||
deviceRepairPOST,
|
||||
sceneList
|
||||
} from "@/api/aftersales/deviceParts";
|
||||
import { getDicts } from '@/api/system/dict/data'
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
|
||||
const noticeList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const DeviceVersion = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
noticeTitle: undefined,
|
||||
createBy: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
rules: {
|
||||
sceneName: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
|
||||
deviceVersion: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
partsUnit: [{ required: true, message: "不能为空", trigger: "blur" }],
|
||||
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
const device_value=ref([])
|
||||
const device_list=ref([])
|
||||
const deviceName = ref("");
|
||||
const device_version =ref([])
|
||||
function getVersion(){
|
||||
getDicts('device_version').then(res=>{
|
||||
device_version.value =res.data
|
||||
DeviceVersion.value = [
|
||||
{
|
||||
id: 0,
|
||||
label: "所有类型",
|
||||
parentId: -1,
|
||||
children: res.data.map((item) => {
|
||||
return {
|
||||
id: item.dictValue,
|
||||
label: item.dictLabel,
|
||||
parentId: 0,
|
||||
...item,
|
||||
};
|
||||
}),
|
||||
},
|
||||
];
|
||||
})
|
||||
}
|
||||
getVersion()
|
||||
/** 根据名称筛选部门树 */
|
||||
watch(deviceName, (val) => {
|
||||
proxy.$refs["deptTreeRef"].filter(val);
|
||||
});
|
||||
|
||||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
function handleNodeClick(e) {
|
||||
console.log(e);
|
||||
queryParams.value.deviceVersion = e.dictValue;
|
||||
getList();
|
||||
}
|
||||
/** 查询公告列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
sceneList(queryParams.value).then((response) => {
|
||||
noticeList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
function changeVerson(e){
|
||||
device_value.value=[]
|
||||
getDeviceList(e)
|
||||
}
|
||||
/** 查询所属列表 */
|
||||
function getDeviceList(deviceVersion) {
|
||||
|
||||
devicePartslist({pageNum:1,pageSize:1000,deviceVersion}).then((response) => {
|
||||
device_list.value = response.rows.map(item=>{
|
||||
return {
|
||||
label:item.partsName,
|
||||
key:item.partsId,
|
||||
...item
|
||||
}
|
||||
});
|
||||
console.log(device_list.value)
|
||||
open.value = true;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
noticeId: undefined,
|
||||
noticeTitle: undefined,
|
||||
noticeType: undefined,
|
||||
noticeContent: undefined,
|
||||
status: "0",
|
||||
};
|
||||
proxy.resetForm("VersionRef");
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
const idName = ref();
|
||||
/** 多选框选中数据 */
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.sceneId);
|
||||
idName.value = selection.map((item) => item.sceneName);
|
||||
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
if (queryParams.value.deviceVersion) {
|
||||
getDeviceList(queryParams.value.deviceVersion)
|
||||
form.value.deviceVersion = queryParams.value.deviceVersion
|
||||
title.value = "添加维修场景";
|
||||
} else {
|
||||
proxy.$modal.msgWarning("请先选择设备型号");
|
||||
}
|
||||
}
|
||||
/**修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
form.value = Object.assign({}, row);
|
||||
device_value.value=[]
|
||||
getDeviceList(row.deviceVersion)
|
||||
deviceRepairParts(row.sceneId).then(res=>{
|
||||
console.log(res)
|
||||
device_value.value=res.data
|
||||
})
|
||||
|
||||
title.value = "修改维修场景";
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
console.log(device_value.value)
|
||||
console.log(form.value)
|
||||
form.value.partsIds = device_value.value
|
||||
|
||||
proxy.$refs["VersionRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (form.value.sceneId != undefined) {
|
||||
deviceRepairPUT(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
deviceRepairPOST(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const partsId = row.sceneId || ids.value;
|
||||
const partsName = row.sceneName || idName.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除维修场景"' + partsName + '"的数据项?')
|
||||
.then(function () {
|
||||
return deviceRepairDEL(partsId);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
|
@ -0,0 +1,727 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
<el-form-item label="站点名称" prop="noticeTitle">
|
||||
<el-input
|
||||
v-model="queryParams.noticeTitle"
|
||||
placeholder="请输入站点名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="请输入联系人"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="createBy">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="noticeType">
|
||||
<el-select
|
||||
v-model="queryParams.noticeType"
|
||||
placeholder="工单类型"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in sys_notice_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:notice:add']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:notice:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="orderList">
|
||||
<el-table-column label="序号" align="center" type="index" width="80" />
|
||||
<el-table-column label="站点名称" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
{{ scope.row.device.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="区域" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
{{ scope.row.device.provinceName }}-{{ scope.row.device.cityName }}-{{
|
||||
scope.row.device.areaName
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报修人" align="center" prop="contactName">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.contactName }}({{ scope.row.contactPhone }})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="报修时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="接单人" align="center" prop="">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.contactName}}({{scope.row.contactPhone}})</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="接单时间" align="center" prop="createTime" width="100">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column
|
||||
label="报修问题"
|
||||
align="center"
|
||||
prop="faultDesc"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
align="center"
|
||||
prop="orderStatus"
|
||||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tag :type="orderStatus[scope.row.orderStatus].type">{{
|
||||
orderStatus[scope.row.orderStatus].label
|
||||
}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
@click="handleView(scope.row)"
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="scope.row.orderStatus !== 5"
|
||||
@click="handlesCore(scope.row)"
|
||||
>主管评价</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改工单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="50%" append-to-body>
|
||||
<el-timeline style="width: 100%">
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[0].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 0"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="用户报修"
|
||||
:column="3"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">设备信息</div>
|
||||
</template>
|
||||
<div>{{ detailAction[0].actionInfo.device.ownerName }}</div>
|
||||
<div>{{ detailAction[0].actionInfo.device.ownerPhone }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">设备地址</div>
|
||||
</template>
|
||||
{{ detailAction[0].actionInfo.device.provinceName
|
||||
}}{{ detailAction[0].actionInfo.device.cityName
|
||||
}}{{ detailAction[0].actionInfo.device.areaName
|
||||
}}{{ detailAction[0].actionInfo.device.townName
|
||||
}}{{ detailAction[0].actionInfo.device.community }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">保修时间</div>
|
||||
</template>
|
||||
<div style="width: 75px">
|
||||
{{ detailAction[0].actionInfo.device.warrantyPeriod }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">报修联系人</div>
|
||||
</template>
|
||||
<div style="width: 100px">
|
||||
{{ detailAction[0].actionInfo.contactName }}
|
||||
</div>
|
||||
<div>{{ detailAction[0].actionInfo.contactPhone }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<template #label>
|
||||
<div class="cell-item">故障描述</div>
|
||||
</template>
|
||||
<div>{{ detailAction[0].actionInfo.faultDesc }}</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">图片/视频</div>
|
||||
</template>
|
||||
|
||||
<div v-for="item in detailAction[0].actionInfo.faultImg">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px;float: left;margin: 5px;"
|
||||
:src="item"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="[item]"
|
||||
:initial-index="4"
|
||||
fit="cover"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[1].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 1"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="维修师傅接单"
|
||||
:column="3"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">维修人员</div>
|
||||
</template>
|
||||
{{ detailAction[1].actionInfo?.nickName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">手机号</div>
|
||||
</template>
|
||||
{{ detailAction[1].actionInfo?.phonenumber }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[2].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 2"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="维修师傅上门签到"
|
||||
:column="3"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">签到地址</div>
|
||||
</template>
|
||||
{{ detailAction[2].actionInfo.location }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[3].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 3"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="维修信息"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">更换配件</div>
|
||||
</template>
|
||||
<div>
|
||||
<el-table
|
||||
:data="detailAction[3].actionInfo.parts"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="partsName"
|
||||
label="配件名"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column prop="partsModel" label="型号" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" />
|
||||
<el-table-column prop="price" label="价格" width="80" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">维修事项</div>
|
||||
</template>
|
||||
{{ detailAction[3].actionInfo.desc }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">维修图片</div>
|
||||
</template>
|
||||
<div v-for="item in detailAction[3].actionInfo.img">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px;float: left;margin: 5px;"
|
||||
:src="item"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="[item]"
|
||||
:initial-index="4"
|
||||
fit="cover"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[4].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 4"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="用户评价"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">服务描述</div>
|
||||
</template>
|
||||
{{ detailAction[4].actionInfo.desc }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">服务星级</div>
|
||||
</template>
|
||||
<div>
|
||||
服务态度:<el-rate
|
||||
v-model="detailAction[4].actionInfo.serviceAttitudeScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
技术水平:<el-rate
|
||||
v-model="detailAction[4].actionInfo.technicalLevelScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
规范操作:<el-rate
|
||||
v-model="detailAction[4].actionInfo.standardOperationScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
沟通能力:<el-rate
|
||||
v-model="detailAction[4].actionInfo.communicationSkillScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[5].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 5"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="主管评价"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">回访描述</div>
|
||||
</template>
|
||||
{{detailAction[5].actionInfo.desc}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">星级评价</div>
|
||||
</template>
|
||||
<el-rate
|
||||
v-model="detailAction[5].actionInfo.starScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[6].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 6"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="主管评价"
|
||||
:column="2"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">身份证号</div>
|
||||
</template>
|
||||
{{ detailAction[6].actionInfo?.identityNumber }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">银行卡号</div>
|
||||
</template>
|
||||
{{ detailAction[6].actionInfo?.bankCardNumber }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<template #label>
|
||||
<div class="cell-item">开户行</div>
|
||||
</template>
|
||||
{{ detailAction[6].actionInfo?.bankName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<template #label>
|
||||
<div class="cell-item">打款凭证</div>
|
||||
</template>
|
||||
<div v-for="item in detailAction[6].actionInfo.bankReceiptUrl">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px;float: left;margin: 5px;"
|
||||
:src="item"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="[item]"
|
||||
:initial-index="4"
|
||||
fit="cover"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<template #label>
|
||||
<div class="cell-item">备注</div>
|
||||
</template>
|
||||
{{ detailAction[6].actionInfo?.remark }}
|
||||
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" v-model="openScore" width="40%" append-to-body>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="电话回访客户评价"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item" style="width: 100px">维修人员</div>
|
||||
</template>
|
||||
<div></div>
|
||||
<el-input
|
||||
v-model="form.desc"
|
||||
style="width: 100%"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
placeholder="输入回访信息"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">星级评价</div>
|
||||
</template>
|
||||
<el-rate v-model="form.starScore" text-color="#ff9900" />
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
import {
|
||||
getorderList,
|
||||
orderDetailByid,
|
||||
companyRating,
|
||||
orderactionByid,
|
||||
} from "@/api/aftersales/order";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_notice_status, sys_notice_type } = proxy.useDict(
|
||||
"sys_notice_status",
|
||||
"sys_notice_type"
|
||||
);
|
||||
|
||||
const orderList = ref([]);
|
||||
const open = ref(false);
|
||||
const openScore = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const detailAction = ref([]);
|
||||
const data = reactive({
|
||||
form: {
|
||||
orderId: undefined,
|
||||
desc: undefined,
|
||||
starScore: 0,
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
|
||||
status: undefined,
|
||||
},
|
||||
});
|
||||
const orderStatus = ref({
|
||||
1: {
|
||||
label: "待维修人员接单",
|
||||
type: "warning",
|
||||
},
|
||||
2: {
|
||||
label: "维修人员已接单",
|
||||
type: "warning",
|
||||
},
|
||||
3: {
|
||||
label: "待上门维修",
|
||||
type: "warning",
|
||||
},
|
||||
4: {
|
||||
label: "待用户评价",
|
||||
type: "warning",
|
||||
},
|
||||
5: {
|
||||
label: "待主管评价",
|
||||
type: "danger",
|
||||
},
|
||||
6: {
|
||||
label: "未打款",
|
||||
type: "success",
|
||||
},
|
||||
7: {
|
||||
label: "财务已打款",
|
||||
type: "success",
|
||||
},
|
||||
});
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询工单列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
getorderList(queryParams.value).then((response) => {
|
||||
orderList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
openScore.value=false
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
orderId: undefined,
|
||||
desc: undefined,
|
||||
starScore: null,
|
||||
};
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/**查看按钮操作 */
|
||||
function handleView(row) {
|
||||
const Id = row.orderId;
|
||||
Promise.all([orderactionByid(Id), orderDetailByid(Id)]).then((res) => {
|
||||
res[0].data[0].actionInfo = res[1].data;
|
||||
detailAction.value = res[0].data;
|
||||
|
||||
open.value = true;
|
||||
title.value = row.device.name;
|
||||
console.log(detailAction.value);
|
||||
});
|
||||
}
|
||||
function handlesCore(row) {
|
||||
reset()
|
||||
form.value.orderId = row.orderId;
|
||||
openScore.value = true;
|
||||
title.value = row.device.name;
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
if (form.value.orderId && form.value.desc && form.value.starScore!= null) {
|
||||
companyRating(form.value).then((response) => {
|
||||
|
||||
proxy.$modal.msgSuccess("提交成功");
|
||||
openScore.value = false;
|
||||
|
||||
getList();
|
||||
});
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const orderIds = row.orderId || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除工单编号为"' + orderIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delNotice(orderIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
function checkFileSuffix(url){
|
||||
|
||||
}
|
||||
getList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.cell-item {
|
||||
min-width: 80px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,612 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryRef"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
>
|
||||
|
||||
<el-form-item label="联系人" prop="assigneeName">
|
||||
<el-input
|
||||
v-model="queryParams.assigneeName"
|
||||
placeholder="请输入联系人"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="orderList">
|
||||
<el-table-column label="序号" align="center" type="index" width="80" />
|
||||
<el-table-column label="联系人" prop="assigneeName"></el-table-column>
|
||||
|
||||
<el-table-column label="手机号" prop="assigneePhonenumber"></el-table-column>
|
||||
<el-table-column label="身份证号" prop="identityNumber"></el-table-column>
|
||||
<el-table-column label="银行卡号" prop="bankCardNumber"></el-table-column>
|
||||
<el-table-column label="开户行" prop="bankName"></el-table-column>
|
||||
<el-table-column label="打款金额" prop="orderPrice"></el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
:disabled="scope.row.orderStatus!=6"
|
||||
|
||||
@click="handlesCore(scope.row)"
|
||||
>打款</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="View"
|
||||
:disabled="scope.row.orderStatus!=7"
|
||||
@click="handleView(scope.row)"
|
||||
>查看凭证</el-button
|
||||
>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改工单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="50%" append-to-body>
|
||||
<el-timeline style="width: 100%">
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[0].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 0"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="用户报修"
|
||||
:column="3"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">设备信息</div>
|
||||
</template>
|
||||
<div>{{ detailAction[0].actionInfo.device.ownerName }}</div>
|
||||
<div>{{ detailAction[0].actionInfo.device.ownerPhone }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">设备地址</div>
|
||||
</template>
|
||||
{{ detailAction[0].actionInfo.device.provinceName
|
||||
}}{{ detailAction[0].actionInfo.device.cityName
|
||||
}}{{ detailAction[0].actionInfo.device.areaName
|
||||
}}{{ detailAction[0].actionInfo.device.townName
|
||||
}}{{ detailAction[0].actionInfo.device.community }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">保修时间</div>
|
||||
</template>
|
||||
<div style="width: 75px">
|
||||
{{ detailAction[0].actionInfo.device.warrantyPeriod }}
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">报修联系人</div>
|
||||
</template>
|
||||
<div style="width: 100px">
|
||||
{{ detailAction[0].actionInfo.contactName }}
|
||||
</div>
|
||||
<div>{{ detailAction[0].actionInfo.contactPhone }}</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2">
|
||||
<template #label>
|
||||
<div class="cell-item">故障描述</div>
|
||||
</template>
|
||||
<div>{{ detailAction[0].actionInfo.faultDesc }}</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">图片/视频</div>
|
||||
</template>
|
||||
|
||||
<div v-for="item in detailAction[0].actionInfo.faultImg">
|
||||
<ImagePreview
|
||||
v-if="checkFileSuffix(item)"
|
||||
:width="100" :height="100"
|
||||
:src="item"
|
||||
:preview-src-list="[item]"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[1].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 1"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="维修师傅接单"
|
||||
:column="3"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">维修人员</div>
|
||||
</template>
|
||||
{{ detailAction[1].actionInfo?.nickName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">手机号</div>
|
||||
</template>
|
||||
{{ detailAction[1].actionInfo?.phonenumber }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[2].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 2"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="维修师傅上门签到"
|
||||
:column="3"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">签到地址</div>
|
||||
</template>
|
||||
{{ detailAction[2].actionInfo.location }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[3].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 3"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="维修信息"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">更换配件</div>
|
||||
</template>
|
||||
<div>
|
||||
<el-table
|
||||
:data="detailAction[3].actionInfo.parts"
|
||||
stripe
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="partsName"
|
||||
label="配件名"
|
||||
width="180"
|
||||
/>
|
||||
<el-table-column prop="partsModel" label="型号" />
|
||||
<el-table-column prop="quantity" label="数量" width="80" />
|
||||
<el-table-column prop="price" label="价格" width="80" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">维修事项</div>
|
||||
</template>
|
||||
{{ detailAction[3].actionInfo.desc }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">维修图片</div>
|
||||
</template>
|
||||
<img
|
||||
:src="item"
|
||||
v-for="item in detailAction[3].actionInfo.img"
|
||||
alt=""
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[4].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 4"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="用户评价"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">服务描述</div>
|
||||
</template>
|
||||
{{ detailAction[4].actionInfo.desc }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">服务星级</div>
|
||||
</template>
|
||||
<div>
|
||||
服务态度:<el-rate
|
||||
v-model="detailAction[4].actionInfo.serviceAttitudeScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
技术水平:<el-rate
|
||||
v-model="detailAction[4].actionInfo.technicalLevelScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
规范操作:<el-rate
|
||||
v-model="detailAction[4].actionInfo.standardOperationScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
沟通能力:<el-rate
|
||||
v-model="detailAction[4].actionInfo.communicationSkillScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
<el-timeline-item
|
||||
:timestamp="detailAction[5].actionTime"
|
||||
placement="top"
|
||||
v-if="detailAction.length > 5"
|
||||
>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="主管评价"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">回访描述</div>
|
||||
</template>
|
||||
{{detailAction[5].actionInfo.desc}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">星级评价</div>
|
||||
</template>
|
||||
<el-rate
|
||||
v-model="detailAction[5].actionInfo.starScore"
|
||||
disabled
|
||||
text-color="#ff9900"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" v-model="openHistory" width="40%" append-to-body>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="打款凭证确认"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label >
|
||||
<div class="cell-item" style="width: 0px">打款凭证</div>
|
||||
</template>
|
||||
<div v-for="item in bankReceipData.bankReceiptUrl">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px;float: left;margin: 5px;"
|
||||
:src="item"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
:preview-src-list="bankReceipData.bankReceiptUrl"
|
||||
:initial-index="4"
|
||||
fit="cover"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">备注</div>
|
||||
</template>
|
||||
{{bankReceipData.remark}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" v-model="openRepair" width="40%" append-to-body>
|
||||
<el-card>
|
||||
<el-descriptions
|
||||
class="margin-top"
|
||||
title="打款凭证确认"
|
||||
:column="1"
|
||||
border
|
||||
>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item" style="width: 100px">打款凭证</div>
|
||||
</template>
|
||||
<el-upload
|
||||
v-model:file-list="fileList"
|
||||
action="#"
|
||||
:http-request="uploadFile"
|
||||
list-type="picture-card"
|
||||
:before-upload="beforeUpload"
|
||||
|
||||
:on-change="handleChange"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:on-remove="handleRemove"
|
||||
>
|
||||
<el-icon><Plus /></el-icon>
|
||||
</el-upload>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">备注</div>
|
||||
</template>
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
style="width: 100%"
|
||||
:rows="2"
|
||||
type="textarea"
|
||||
placeholder="输入备注"
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Notice">
|
||||
import {
|
||||
settlementList,
|
||||
settlementAction,
|
||||
orderDetailByid,
|
||||
orderactionByid,
|
||||
upload,
|
||||
uploadDel,
|
||||
bankReceip
|
||||
} from "@/api/aftersales/order";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { sys_notice_status, sys_notice_type } = proxy.useDict(
|
||||
"sys_notice_status",
|
||||
"sys_notice_type"
|
||||
);
|
||||
|
||||
const orderList = ref([]);
|
||||
const open = ref(false);
|
||||
const openHistory =ref(false)
|
||||
const openRepair = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const fileList =ref([])
|
||||
const detailAction = ref([]);
|
||||
const bankReceipData =ref({})
|
||||
const data = reactive({
|
||||
form: {
|
||||
orderId: undefined,
|
||||
desc: undefined,
|
||||
starScore: 0,
|
||||
},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
|
||||
status: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询工单列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
settlementList(queryParams.value).then((response) => {
|
||||
orderList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
openHistory.value =false
|
||||
openRepair.value=false
|
||||
reset();
|
||||
}
|
||||
/** 表单重置 */
|
||||
function reset() {
|
||||
form.value = {
|
||||
orderId: undefined,
|
||||
desc: undefined,
|
||||
starScore: null,
|
||||
};
|
||||
}
|
||||
function handleRemove(e){
|
||||
|
||||
form.value.bankReceip.forEach(element => {
|
||||
if(element.uid == e.uid){
|
||||
uploadDel(element.ossId)
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/** 打款凭证上传 */
|
||||
function uploadFile(e){
|
||||
|
||||
let param = new FormData();
|
||||
param.append('file',e.file)
|
||||
upload(param).then(res=>{
|
||||
|
||||
form.value.bankReceip.push({...res.data,uid:e.file.uid})
|
||||
console.log(form.value.bankReceip)
|
||||
})
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/**查看按钮操作 */
|
||||
function handleView(row) {
|
||||
const Id = row.orderId;
|
||||
// Promise.all([orderactionByid(Id), orderDetailByid(Id)]).then((res) => {
|
||||
// res[0].data[0].actionInfo = res[1].data;
|
||||
// detailAction.value = res[0].data;
|
||||
|
||||
// open.value = true;
|
||||
// title.value = row.assigneeName;
|
||||
// console.log(detailAction.value);
|
||||
// });
|
||||
bankReceip(Id).then(res=>{
|
||||
bankReceipData.value = res.data
|
||||
openHistory.value =true
|
||||
title.value = row.assigneeName;
|
||||
})
|
||||
|
||||
}
|
||||
function handlesCore(row) {
|
||||
reset()
|
||||
form.value.orderId = row.orderId;
|
||||
form.value.bankReceip=[]
|
||||
openRepair.value = true;
|
||||
title.value = row.assigneeName;
|
||||
}
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
if (form.value.bankReceip.length) {
|
||||
let data = {
|
||||
bankReceiptUrl:'',
|
||||
remark:form.value.remark,
|
||||
orderId: form.value.orderId
|
||||
}
|
||||
data.bankReceiptUrl= form.value.bankReceip.map(item=>{
|
||||
return item. url
|
||||
})
|
||||
|
||||
settlementAction(data).then((response) => {
|
||||
|
||||
proxy.$modal.msgSuccess("提交成功");
|
||||
openRepair.value = false;
|
||||
|
||||
getList();
|
||||
});
|
||||
}else{
|
||||
proxy.$modal.msgWarning("请上传打款凭证");
|
||||
}
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const orderIds = row.orderId || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除工单编号为"' + orderIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delNotice(orderIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
function checkFileSuffix(url){
|
||||
|
||||
}
|
||||
getList();
|
||||
</script>
|
||||
<style scoped>
|
||||
.cell-item {
|
||||
min-width: 80px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,509 @@
|
|||
<template>
|
||||
<div class="">
|
||||
<slot></slot>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="siteParams.layerName"
|
||||
placeholder="请输入站点名称"
|
||||
clearable
|
||||
prefix-icon="Search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="layerOptions"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="depTreeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
>
|
||||
<template #default="{ node, data }">
|
||||
<span class="custom-tree-node">
|
||||
<span>
|
||||
<el-icon color="blue" v-if="getFlagCheck(data.type)">
|
||||
<CircleCheckFilled />
|
||||
</el-icon>
|
||||
<el-icon color="red" v-if="getFlagClose(data.type)"
|
||||
><CircleCloseFilled
|
||||
/></el-icon>
|
||||
<el-icon v-if="getFlagFill(data.type)"
|
||||
><RemoveFilled
|
||||
/></el-icon>
|
||||
|
||||
{{ node.label }}
|
||||
</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-descriptions class="margin-top" :column="3" border>
|
||||
<template #title>
|
||||
<div style="height: 32px; line-height: 43px">
|
||||
{{ planData.planName }}
|
||||
</div>
|
||||
</template>
|
||||
<template #extra>
|
||||
<div v-if="getApplyShow">
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="rejectInfo"
|
||||
v-hasPermi="['renovation:siteIndex:reject']"
|
||||
>驳回</el-button
|
||||
>
|
||||
<el-button
|
||||
type="success"
|
||||
@click="completeInfo"
|
||||
v-hasPermi="['renovation:siteIndex:complete']"
|
||||
>通过</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<el-descriptions-item width="10%">
|
||||
<template #label>
|
||||
<div class="cell-item">建设单位</div>
|
||||
</template>
|
||||
{{ buildInfo?.devCompany }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item width="10%">
|
||||
<template #label>
|
||||
<div class="cell-item">施工单位</div>
|
||||
</template>
|
||||
{{ buildInfo?.consCompany }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item width="10%">
|
||||
<template #label>
|
||||
<div class="cell-item">设备生产厂家</div>
|
||||
</template>
|
||||
{{ buildInfo?.manufacturer }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">施工日期</div>
|
||||
</template>
|
||||
<el-tag size="small" v-if="buildInfo?.buildDate"> {{ buildInfo?.buildDate }}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item>
|
||||
<template #label>
|
||||
<div class="cell-item">反馈图片</div>
|
||||
</template>
|
||||
<el-image
|
||||
style="width: 30px; height: 35px"
|
||||
:src="item"
|
||||
:zoom-rate="1.2"
|
||||
:max-scale="7"
|
||||
:min-scale="0.2"
|
||||
v-for="item in buildInfo?.img"
|
||||
:preview-src-list="buildInfo?.img"
|
||||
:initial-index="4"
|
||||
fit="cover"
|
||||
/>
|
||||
<!-- <img style="width: 30px;height: 30px;" src="http://localhost/src/admin/assets/logo/logo.png" v-for="item in 4" /> -->
|
||||
<!-- <img :src="item" v-for="item in buildInfo?.img" /> -->
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="renovationList"
|
||||
height="calc(100vh - 360px)"
|
||||
>
|
||||
<el-table-column
|
||||
label="改造类型"
|
||||
align="center"
|
||||
prop="renovationType"
|
||||
width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.renovationType.dictName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="改造内容"
|
||||
align="center"
|
||||
prop="renovationContent"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.renovationContent.dictName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="整改原因"
|
||||
align="center"
|
||||
prop="renovationReason"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.renovationReason.dictName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="整改方案"
|
||||
align="center"
|
||||
prop="renovationMeasure"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.renovationMeasure.dictName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品名称" align="center" prop="prodName">
|
||||
<template #default="scope">
|
||||
{{ scope.row.prodInfo.prodName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="型号"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
prop="prodModel"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.prodInfo.prodModel }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单价" align="center" prop="prodPrice">
|
||||
<template #default="scope">
|
||||
{{ scope.row.prodInfo.prodPrice }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="操作(核对金额)"
|
||||
align="center"
|
||||
width="150"
|
||||
v-if="getPriceShow"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
|
||||
<div v-if="reviewStatus=='2'">{{scope.row.reviewPrice}}</div>
|
||||
<div v-else>
|
||||
<el-input
|
||||
|
||||
v-model="scope.row.reviewPrice"
|
||||
style="width: 100px"
|
||||
placeholder="核对金额"
|
||||
v-hasPermi="['renovation:siteIndex:price']"
|
||||
:formatter="
|
||||
(value) =>
|
||||
`¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
||||
"
|
||||
:parser="(value) => value.replace(/\¥\s?|(,*)/g, '')"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getBuild"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="porfiles">
|
||||
import { ElMessage } from "element-plus";
|
||||
import {
|
||||
build,
|
||||
details,
|
||||
reject,
|
||||
complete,
|
||||
devices,
|
||||
} from "@/api/system/siteplan";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const props = defineProps({
|
||||
arrSite: Object,
|
||||
planData: Object,
|
||||
});
|
||||
console.log(props);
|
||||
|
||||
const planData = ref(props.planData);
|
||||
const data = reactive({
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 图层管理表格数据
|
||||
dataList: [],
|
||||
planList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
createBy: undefined,
|
||||
layersId: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
});
|
||||
const input = ref("");
|
||||
const {
|
||||
open,
|
||||
showSearch,
|
||||
queryParams,
|
||||
form,
|
||||
ids,
|
||||
title,
|
||||
dataList,
|
||||
total,
|
||||
multiple,
|
||||
single,
|
||||
loading,
|
||||
planList,
|
||||
buttonLoading,
|
||||
} = toRefs(data);
|
||||
const planDialog = ref("测试方案1");
|
||||
const applyDialog = ref(false);
|
||||
const layerName = ref();
|
||||
const renovationList = ref([]);
|
||||
|
||||
const siteParams = reactive({
|
||||
layerName: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
});
|
||||
|
||||
const filterNode = (value, data) => {
|
||||
|
||||
if (!value) return true;
|
||||
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
|
||||
const reviewStatus = ref(-1);
|
||||
|
||||
// technology
|
||||
|
||||
const getPriceShow = ref(false);
|
||||
|
||||
const roles = useUserStore().roles;
|
||||
|
||||
// '0':{label:'技术审核中', type:'warning'},
|
||||
// '1':{label:'财务审核中',type:'warning'},
|
||||
// '2':{label:'审核完成',type:'success'},
|
||||
// '3':{label:'驳回待修改',type:'danger'},
|
||||
const getApplyShow = computed(() => {
|
||||
if (buildInfo.value?.reviewStatus == 0 && roles.indexOf("technology") != -1) {
|
||||
return true;
|
||||
}
|
||||
if (buildInfo.value?.reviewStatus == 1 && roles.indexOf("finance") != -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
console.log(roles.indexOf("finance"));
|
||||
console.log(roles.indexOf("technology"));
|
||||
watch(reviewStatus, (val) => {
|
||||
if (val == 2) getPriceShow.value = true;
|
||||
else if (val == 1 && roles.indexOf("finance") != -1) {
|
||||
getPriceShow.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
const getFlagCheck = (reviewStatus) => {
|
||||
if (
|
||||
(reviewStatus == 1 && roles.indexOf("technology") != -1) ||
|
||||
reviewStatus == 2
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const getFlagClose = (reviewStatus) => {
|
||||
if (reviewStatus == 3) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const getFlagFill = (reviewStatus) => {
|
||||
if (
|
||||
(reviewStatus == 0 && roles.indexOf("technology") != -1) ||
|
||||
(reviewStatus == 1 && roles.indexOf("finance") != -1)
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
const layerOptions = ref();
|
||||
const setLayerTree = (data) => {
|
||||
let parent = [
|
||||
{
|
||||
id: 0,
|
||||
label: "所有站点",
|
||||
parentId: -1,
|
||||
children: data.map((item, index) => {
|
||||
return {
|
||||
id: item.id,
|
||||
code: item.code,
|
||||
label: item.name,
|
||||
parentId: 0,
|
||||
type: item.reviewStatus,
|
||||
};
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
layerOptions.value = parent;
|
||||
};
|
||||
setLayerTree(props.arrSite);
|
||||
const userData = ref([]);
|
||||
const userQuery = ref([]);
|
||||
|
||||
const filterMethod = (query, item) => {
|
||||
return item.initial.toLowerCase().includes(query.toLowerCase());
|
||||
};
|
||||
|
||||
const buildInfo = ref({});
|
||||
/** 查询图层管理列表 */
|
||||
function getBuild() {
|
||||
build({
|
||||
planId: planData.value.planId,
|
||||
deviceId: queryParams.value.deviceId,
|
||||
}).then((response) => {
|
||||
response.data.img = JSON.parse(response.data.img);
|
||||
buildInfo.value = response.data;
|
||||
reviewStatus.value = response.data.reviewStatus;
|
||||
});
|
||||
}
|
||||
function getDetails() {
|
||||
loading.value = true;
|
||||
details({
|
||||
planId: planData.value.planId,
|
||||
deviceId: queryParams.value.deviceId,
|
||||
}).then((response) => {
|
||||
renovationList.value = response.rows.map(item=>{
|
||||
return {
|
||||
...item,
|
||||
reviewPrice:JSON.stringify(item.reviewPrice)=='{}'?'':item.reviewPrice
|
||||
}
|
||||
});
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
const handleNodeClick = (e) => {
|
||||
console.log(e);
|
||||
queryParams.value.deviceId = e.id;
|
||||
getBuild();
|
||||
getDetails();
|
||||
};
|
||||
const rejectInfo = () => {
|
||||
proxy.$modal
|
||||
.prompt("是否确认驳回当前站点方案,请输入驳回理由!")
|
||||
.then((e) => {
|
||||
console.log(e.value);
|
||||
return reject({
|
||||
planId: planData.value.planId,
|
||||
deviceId: queryParams.value.deviceId,
|
||||
reviewRemark: e.value,
|
||||
});
|
||||
})
|
||||
.then(async () => {
|
||||
let res = await devices({ planId: planData.value.planId });
|
||||
setLayerTree(res.data);
|
||||
getBuild();
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
const completeInfo = () => {
|
||||
let details=[];
|
||||
if (roles.indexOf("finance") != -1) {
|
||||
let flagIndex = -1;
|
||||
for (let i=0; i < renovationList.value.length; i++) {
|
||||
let item = renovationList.value[i];
|
||||
|
||||
let reviewPrice =
|
||||
item.reviewPrice &&
|
||||
parseFloat(item.reviewPrice.replace(/\¥\s?|(,*)/g, ""));
|
||||
if (isNaN(reviewPrice)|| reviewPrice == undefined) {
|
||||
flagIndex = i + 1;
|
||||
break;
|
||||
} else {
|
||||
details.push({
|
||||
listId: item.listId,
|
||||
reviewPrice,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (flagIndex != -1) {
|
||||
ElMessage({
|
||||
message: `第${flagIndex}项目填写错误,请核对`,
|
||||
type: "error",
|
||||
duration: 5 * 1000,
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
proxy.$modal
|
||||
.prompt("是否通过当前站点方案,请输入通过备注!")
|
||||
.then((e) => {
|
||||
console.log(e.value);
|
||||
|
||||
return complete({
|
||||
planId: planData.value.planId,
|
||||
deviceId: queryParams.value.deviceId,
|
||||
reviewRemark: e.value,
|
||||
details,
|
||||
});
|
||||
})
|
||||
.then(async () => {
|
||||
let res = await devices({ planId: planData.value.planId });
|
||||
setLayerTree(res.data);
|
||||
getBuild();
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
.margin-top {
|
||||
margin-top: -45px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,7 @@
|
|||
export const planStatus={
|
||||
'0':{label:'技术审核中', type:'warning'},
|
||||
'1':{label:'财务审核中',type:'warning'},
|
||||
'2':{label:'审核完成',type:'success'},
|
||||
'3':{label:'驳回待修改',type:'danger'},
|
||||
|
||||
}
|
|
@ -0,0 +1,304 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<transition name="fade">
|
||||
<el-row :gutter="20" v-if="!showDetail">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="方案名称" prop="layerName">
|
||||
<el-input
|
||||
v-model="queryParams.planName"
|
||||
placeholder="请输入方案"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人" prop="layerName">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="请输入创建人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="layerName">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder=""
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="档案编号"
|
||||
align="center"
|
||||
prop="planId"
|
||||
width="150"
|
||||
/>
|
||||
<el-table-column label="方档案名称" align="center" prop="planName" />
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
|
||||
<el-table-column label="状态" align="center" prop="createBy">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-tag :type="planStatus[scope.row.reviewStatus]?.type"
|
||||
>{{planStatus[scope.row.reviewStatus]?.label}}</el-tag
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
v-hasPermi="['renovation:siteIndex:apply']"
|
||||
@click="handleOpen(scope.row)"
|
||||
>审核</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
|
||||
>导出excel</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
|
||||
>导出world</el-button
|
||||
> -->
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:porfiles:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-dropdown style="margin: 2px 7px;" v-hasPermi="['renovation:siteIndex:apply']">
|
||||
<el-button type="primary" link>
|
||||
导出<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="handleExcel(scope.row)">导出excel</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleWorld(scope.row)">导出world</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-row>
|
||||
</transition>
|
||||
|
||||
<transition name="detail">
|
||||
<detailCom v-if="showDetail" :arrSite="arrSite" :planData = "planData">
|
||||
<el-button
|
||||
|
||||
type="primary"
|
||||
icon="ArrowLeft"
|
||||
style="margin-bottom: 10px"
|
||||
@click="backCall"
|
||||
>返回</el-button
|
||||
>
|
||||
</detailCom>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="porfiles">
|
||||
import { list,devices,excel } from "@/api/system/siteplan";
|
||||
import {planStatus} from './dist.js'
|
||||
import detailCom from "./detail";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const showDetail = ref(false);
|
||||
const backCall = () => {
|
||||
if (!document.startViewTransition) {
|
||||
showDetail.value = false;
|
||||
return;
|
||||
}
|
||||
document.startViewTransition(() => (showDetail.value = false));
|
||||
getList()
|
||||
// showDetail.value = false
|
||||
};
|
||||
const data = reactive({
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 图层管理表格数据
|
||||
dataList: [
|
||||
|
||||
],
|
||||
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
createBy: undefined,
|
||||
layersId: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
});
|
||||
const input = ref("");
|
||||
const {
|
||||
open,
|
||||
showSearch,
|
||||
queryParams,
|
||||
form,
|
||||
ids,
|
||||
title,
|
||||
dataList,
|
||||
total,
|
||||
multiple,
|
||||
single,
|
||||
loading,
|
||||
planList,
|
||||
buttonLoading,
|
||||
} = toRefs(data);
|
||||
const planDialog = ref("");
|
||||
const applyDialog = ref(false);
|
||||
const layerName = ref();
|
||||
|
||||
const filterMethod = (query, item) => {
|
||||
return item.initial.toLowerCase().includes(query.toLowerCase());
|
||||
};
|
||||
const handleExcel = ( item) => {
|
||||
excel(item.planId)
|
||||
proxy.download("/renovationPlan/export/excel", {
|
||||
planId:item.planId
|
||||
}, `${item.planName}.xlsx`,{
|
||||
baseURL: "/plan-api"
|
||||
});
|
||||
}
|
||||
const handleWorld = ( item) => {
|
||||
excel(item.planId)
|
||||
proxy.download("/renovationPlan/export/word", {
|
||||
planId:item.planId
|
||||
}, `${item.planName}.docx`,{
|
||||
baseURL: "/plan-api"
|
||||
});
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加图层管理";
|
||||
}
|
||||
//详情
|
||||
const arrSite = ref([])
|
||||
const planData = ref({})
|
||||
async function handleOpen(row) {
|
||||
let res = await devices({planId:row.planId});
|
||||
planData.value =row
|
||||
arrSite.value = res.data
|
||||
showDetail.value = true;
|
||||
applyDialog.value = true;
|
||||
}
|
||||
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 查询理列表 */
|
||||
function getList() {
|
||||
// loading.value = false;
|
||||
loading.value = true;
|
||||
list(queryParams.value).then((response) => {
|
||||
response = response.data;
|
||||
dataList.value = response.items;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryForm");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.fade-enter-active {
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
.fade-leave-active {
|
||||
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
|
||||
}
|
||||
.fade-enter-from,
|
||||
.fade-leave-to {
|
||||
transform: translateX(-120px);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.detail-enter-active,
|
||||
.detail-leave-active {
|
||||
transition: opacity 0.5s ease;
|
||||
}
|
||||
.detail-enter-from,
|
||||
.detail-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
|
@ -74,7 +74,22 @@
|
|||
<el-table-column label="图层地址" align="center" prop="layerUrl" />
|
||||
<el-table-column label="航拍图地址" align="center" prop="tiffUrl" />
|
||||
<el-table-column label="高程文件" align="center" prop="ascUrl" />
|
||||
<el-table-column label="JPG文件" align="center" prop="jpgUrl" />
|
||||
<el-table-column label="JPG文件是否生成" align="center" prop="jpgUrl">
|
||||
<template #default="scope">
|
||||
<span>
|
||||
<el-tag v-if="scope.row.jpgUrl"> 已生成 </el-tag>
|
||||
<el-tag v-else type="danger"> 未生成 </el-tag>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图层坐标体系" align="center" prop="jpgUrl">
|
||||
<template #default="scope">
|
||||
<span>
|
||||
{{(coordList.filter(item=>item.value==scope.row.coordinateSystem))[0].label}}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
|
@ -169,6 +184,18 @@
|
|||
placeholder="请输入高成文件"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="坐标体系" prop="ascUrl">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="form.coordinateSystem"
|
||||
|
||||
placeholder="请选择"
|
||||
size="large"
|
||||
>
|
||||
<el-option :label="item.label" :value="item.value" v-for="item in coordList" />
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -282,6 +309,11 @@ const {
|
|||
buttonLoading,
|
||||
} = toRefs(data);
|
||||
const userSelect = ref("图层分配用户");
|
||||
|
||||
const coordList=ref([
|
||||
{ label:'WGS84',value:1},
|
||||
{ label:'CGCS2000',value:2},
|
||||
])
|
||||
const openUser = ref(false);
|
||||
|
||||
const generateData = () => {
|
||||
|
@ -336,12 +368,11 @@ function handleAdd() {
|
|||
}
|
||||
//用户分配
|
||||
function handleOpenUser(row) {
|
||||
authUserGet(row.id).then(res=>{
|
||||
authUserGet(row.id).then((res) => {
|
||||
form.value.id = row.id;
|
||||
userQuery.value = res.data;
|
||||
openUser.value = true;
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
function handleCheck(row) {
|
||||
proxy.$modal
|
||||
|
@ -424,20 +455,17 @@ function submitUser() {
|
|||
let data = {
|
||||
layersId: form.value.id,
|
||||
userIds: userQuery.value,
|
||||
}
|
||||
};
|
||||
console.log(data);
|
||||
proxy.$modal
|
||||
.confirm("是否将当前图层分配给已选用户?")
|
||||
.then(() => {
|
||||
|
||||
authUserPut(data).then((res) => {
|
||||
proxy.$modal.msgSuccess("分配成功");
|
||||
openUser.value = false;
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
<el-table-column label="文件后缀" align="center" prop="fileSuffix" />
|
||||
<el-table-column label="文件展示" align="center" prop="url">
|
||||
<template #default="scope">
|
||||
|
||||
<ImagePreview
|
||||
v-if="previewListResource && checkFileSuffix(scope.row.fileSuffix)"
|
||||
:width="100" :height="100"
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="特征物档案" name="regon">
|
||||
<profiles type = 'regon'></profiles>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="管网布线档案" name="line">
|
||||
<profiles type = 'line' ></profiles>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup name="porfiles">
|
||||
import profiles from './profiles'
|
||||
|
||||
const activeName = ref('regon')
|
||||
|
||||
const handleClick = (tab, event) => {
|
||||
console.log(tab, event)
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,428 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="4" :xs="24">
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="layerParams.layerName"
|
||||
placeholder="请输入图层名称"
|
||||
clearable
|
||||
prefix-icon="Search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<el-tree
|
||||
:data="layerOptions"
|
||||
:props="{ label: 'label', children: 'children' }"
|
||||
:expand-on-click-node="false"
|
||||
:filter-node-method="filterNode"
|
||||
ref="layerTreeRef"
|
||||
node-key="id"
|
||||
highlight-current
|
||||
default-expand-all
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="创建人" prop="layerName">
|
||||
<el-input
|
||||
v-model="queryParams.createBy"
|
||||
placeholder="请输入创建人"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="layersList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column
|
||||
label="档案编号"
|
||||
align="center"
|
||||
prop="id"
|
||||
width="150"
|
||||
/>
|
||||
<el-table-column label="创建人" align="center" prop="createBy" />
|
||||
<el-table-column label="存档时间" align="center" prop="createTime" />
|
||||
|
||||
<el-table-column label="是否分配" align="center" prop="createBy">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-tag v-if="scope.row.authUserCount" type="success"
|
||||
>已分配({{ scope.row.authUserCount }})</el-tag
|
||||
>
|
||||
<el-tag v-else type="danger">无分配</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleOpenUser(scope.row)"
|
||||
>存档分配</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:porfiles:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-dialog
|
||||
:title="userSelect"
|
||||
v-model="openUser"
|
||||
width="700px"
|
||||
append-to-body
|
||||
>
|
||||
<el-transfer
|
||||
v-model="userQuery"
|
||||
filterable
|
||||
:filter-method="filterMethod"
|
||||
filter-placeholder="筛选用户"
|
||||
:titles="['图层所属用户', '档案分配用户']"
|
||||
:button-texts="['移除', '添加']"
|
||||
:data="userData"
|
||||
/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitUser">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="profiles">
|
||||
import * as requestUrl from "@/api/system/porfiles";
|
||||
import { listLayers } from "@/api/system/layers";
|
||||
import { listUser } from "@/api/system/user";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const props = defineProps({
|
||||
type:String
|
||||
})
|
||||
const data = reactive({
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 图层管理表格数据
|
||||
layersList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
createBy: undefined,
|
||||
layersId: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
});
|
||||
|
||||
const {
|
||||
open,
|
||||
showSearch,
|
||||
queryParams,
|
||||
form,
|
||||
ids,
|
||||
title,
|
||||
layersList,
|
||||
total,
|
||||
multiple,
|
||||
single,
|
||||
loading,
|
||||
buttonLoading,
|
||||
} = toRefs(data);
|
||||
const userSelect = ref("档案分配用户");
|
||||
const openUser = ref(false);
|
||||
const layerName = ref();
|
||||
|
||||
const layerParams = reactive({
|
||||
layerName: undefined,
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
});
|
||||
watch(layerParams, (val) => {
|
||||
|
||||
console.log(val.layerName);
|
||||
proxy.$refs["layerTreeRef"].filter(val.layerName);
|
||||
});
|
||||
const getLayerTree = () => {
|
||||
const data = [];
|
||||
return new Promise((resolve, reject) => {
|
||||
listLayers(layerParams).then((res) => {
|
||||
let parent = [
|
||||
{
|
||||
id: 0,
|
||||
label: "所有图层",
|
||||
parentId: -1,
|
||||
children: res.rows.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
label: item.layerName,
|
||||
parentId: 0,
|
||||
};
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
resolve(parent);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const userData = ref([]);
|
||||
const userQuery = ref([]);
|
||||
|
||||
const filterMethod = (query, item) => {
|
||||
return item.initial.toLowerCase().includes(query.toLowerCase());
|
||||
};
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: undefined,
|
||||
layerName: undefined,
|
||||
layerUrl: undefined,
|
||||
tiffUrl: undefined,
|
||||
ascUrl: undefined,
|
||||
jpgUrl: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
createBy: undefined,
|
||||
updateBy: undefined,
|
||||
fileLoad: undefined,
|
||||
};
|
||||
proxy.resetForm("deptRef");
|
||||
}
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加图层管理";
|
||||
}
|
||||
//用户分配
|
||||
async function handleOpenUser(row) {
|
||||
let res = await requestUrl[props.type+'layerUsers'](row.id);
|
||||
form.value.id = row.id;
|
||||
userData.value = res.data.map((item) => {
|
||||
return {
|
||||
label: item.nickName,
|
||||
key: item.userId,
|
||||
initial: item.nickName,
|
||||
};
|
||||
});
|
||||
res = await requestUrl[props.type+'authUserGet'](row.id);
|
||||
userQuery.value = res.data
|
||||
openUser.value = true;
|
||||
}
|
||||
const filterNode=(value,data)=>{
|
||||
if (!value) return true
|
||||
return data.label.indexOf(value) !== -1
|
||||
}
|
||||
|
||||
//所有用户
|
||||
const generateData = () => {
|
||||
const data = [];
|
||||
return new Promise((resolve, reject) => {
|
||||
listUser().then((res) => {
|
||||
console.log(res);
|
||||
|
||||
const states = res.rows;
|
||||
|
||||
states.forEach((item, index) => {
|
||||
data.push({
|
||||
label: item.nickName,
|
||||
key: item.userId,
|
||||
initial: item.nickName,
|
||||
});
|
||||
});
|
||||
console.log(data);
|
||||
resolve(data);
|
||||
});
|
||||
});
|
||||
};
|
||||
// generateData().then((res) => {
|
||||
// console.log(res)
|
||||
// debugger
|
||||
// userData.value = res;
|
||||
// });
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["deptRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id != null) {
|
||||
updateLayers(form.value)
|
||||
.then((response) => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
})
|
||||
.finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
} else {
|
||||
addLayers(form.value)
|
||||
.then((response) => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
})
|
||||
.finally(() => {
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
openUser.value = false;
|
||||
reset();
|
||||
}
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length !== 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
/** 查询图层管理列表 */
|
||||
function getList() {
|
||||
// loading.value = false;
|
||||
loading.value = true;
|
||||
|
||||
requestUrl[props.type+'list'](queryParams.value).then((response) => {
|
||||
layersList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryForm");
|
||||
handleQuery();
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const idsData = row.id || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除档案管理编号为"' + idsData + '"的数据项?')
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
return profilesDel(idsData);
|
||||
})
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
//开始分配
|
||||
function submitUser() {
|
||||
console.log(userQuery.value);
|
||||
let data = {
|
||||
profilesId: form.value.id,
|
||||
userIds: userQuery.value,
|
||||
};
|
||||
console.log(data);
|
||||
proxy.$modal
|
||||
.confirm("是否将当前图层分配给已选用户?")
|
||||
.then(() => {
|
||||
requestUrl[props.type+'authUserPut'](data).then((res) => {
|
||||
proxy.$modal.msgSuccess("分配成功");
|
||||
openUser.value = false;
|
||||
getList()
|
||||
});
|
||||
})
|
||||
.then(() => {})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
const layerOptions = ref();
|
||||
getLayerTree().then((res) => {
|
||||
layerOptions.value = res;
|
||||
});
|
||||
const handleNodeClick = (e) => {
|
||||
console.log(e);
|
||||
queryParams.value.layersId = e.id;
|
||||
getList();
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
</style>
|
|
@ -403,6 +403,7 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 通过条件过滤节点 */
|
||||
const filterNode = (value, data) => {
|
||||
if (!value) return true;
|
||||
debugger
|
||||
return data.label.indexOf(value) !== -1;
|
||||
};
|
||||
/** 根据名称筛选部门树 */
|
||||
|
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 148 KiB |
|
@ -11,7 +11,7 @@ import App from './App'
|
|||
|
||||
import router from './router'
|
||||
|
||||
import { download } from '@/utils/request'
|
||||
|
||||
|
||||
// svg图标
|
||||
import 'virtual:svg-icons-register'
|
||||
|
@ -19,50 +19,8 @@ import SvgIcon from '@/components/SvgIcon'
|
|||
import elementIcons from '@/components/SvgIcon/svgicon'
|
||||
|
||||
|
||||
import { useDict } from '@/utils/dict'
|
||||
import { getConfigKey, updateConfigByKey } from "@/api/system/config";
|
||||
import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
|
||||
|
||||
// 分页组件
|
||||
import Pagination from '@/components/Pagination'
|
||||
// 自定义表格工具组件
|
||||
import RightToolbar from '@/components/RightToolbar'
|
||||
// 富文本组件
|
||||
import Editor from "@/components/Editor"
|
||||
// 文件上传组件
|
||||
import FileUpload from "@/components/FileUpload"
|
||||
// 图片上传组件
|
||||
import ImageUpload from "@/components/ImageUpload"
|
||||
// 图片预览组件
|
||||
import ImagePreview from "@/components/ImagePreview"
|
||||
// 自定义树选择组件
|
||||
import TreeSelect from '@/components/TreeSelect'
|
||||
// 字典标签组件
|
||||
import DictTag from '@/components/DictTag'
|
||||
import modal from './utils/modal'
|
||||
const app = createApp(App)
|
||||
import './permission' // permission control
|
||||
// 全局方法挂载
|
||||
app.config.globalProperties.useDict = useDict
|
||||
app.config.globalProperties.getConfigKey = getConfigKey
|
||||
app.config.globalProperties.updateConfigByKey = updateConfigByKey
|
||||
app.config.globalProperties.download = download
|
||||
app.config.globalProperties.parseTime = parseTime
|
||||
app.config.globalProperties.resetForm = resetForm
|
||||
app.config.globalProperties.handleTree = handleTree
|
||||
app.config.globalProperties.addDateRange = addDateRange
|
||||
app.config.globalProperties.selectDictLabel = selectDictLabel
|
||||
app.config.globalProperties.selectDictLabels = selectDictLabels
|
||||
app.config.globalProperties.$modal = modal
|
||||
// 全局组件挂载
|
||||
app.component('DictTag', DictTag)
|
||||
app.component('Pagination', Pagination)
|
||||
app.component('TreeSelect', TreeSelect)
|
||||
app.component('FileUpload', FileUpload)
|
||||
app.component('ImageUpload', ImageUpload)
|
||||
app.component('ImagePreview', ImagePreview)
|
||||
app.component('RightToolbar', RightToolbar)
|
||||
app.component('Editor', Editor)
|
||||
|
||||
app.use(router)
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
import router from './router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { isHttp } from '@/utils/validate'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
import useSettingsStore from '@/store/modules/settings'
|
||||
import usePermissionStore from '@/store/modules/permission'
|
||||
|
||||
|
||||
NProgress.configure({ showSpinner: false });
|
||||
|
||||
|
@ -23,11 +21,7 @@ router.beforeEach((to, from, next) => {
|
|||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
} else {
|
||||
// if (useUserStore().roles.length === 0) {
|
||||
|
||||
// } else {
|
||||
// next()
|
||||
// }
|
||||
next()
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
<script setup lang="ts">
|
||||
import index from './components/index.vue'
|
||||
|
||||
</script>
|
||||
<script setup lang="ts"></script>
|
||||
|
||||
<template>
|
||||
|
||||
<index />
|
||||
<router-view />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.logo {
|
||||
|
||||
height: 6em;
|
||||
padding: 1.5em;
|
||||
will-change: filter;
|
||||
|
|
|
@ -38,4 +38,15 @@ export function pipelineUpdate(data){
|
|||
})
|
||||
}
|
||||
|
||||
//获取高程信息
|
||||
export function getElevation(data){
|
||||
return request({
|
||||
url:'/pipe/algorithm/getElevation',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -103,3 +103,20 @@ export function recognUpdate(data){
|
|||
|
||||
})
|
||||
}
|
||||
//布线算法数据编辑
|
||||
export function pipelineUpdate(data){
|
||||
return request({
|
||||
url:'/pipe/pipeline/updateData',
|
||||
method: 'post',
|
||||
data
|
||||
|
||||
})
|
||||
}
|
||||
//获取散点高程信息
|
||||
export function findSkeleton(profilesId){
|
||||
return request({
|
||||
url:'/pipe/algorithm/findSkeleton/'+profilesId,
|
||||
method: 'get',
|
||||
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
import request from '@map/utils/request'
|
||||
export function list(params){
|
||||
return request({
|
||||
url:'/pipe/layersPoint/list',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function add(data){
|
||||
return request({
|
||||
url:'/pipe/layersPoint',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function del(id){
|
||||
return request({
|
||||
url:'/pipe/layersPoint/'+id,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
import request from '@map/utils/request'
|
||||
//查询存档列表
|
||||
export function recognitionlistProfiles(params){
|
||||
return request({
|
||||
url:'/pipe/recognition/profiles/list',
|
||||
params,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//加载存档
|
||||
export function recognitionprofilesLoad(profilesId){
|
||||
return request({
|
||||
url:'/pipe/recognition/profilesLoad/'+profilesId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//删除存档
|
||||
export function recognitionprofilesDel(profilesId){
|
||||
return request({
|
||||
url:'/pipe/recognition/'+profilesId,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
||||
//查询存档列表
|
||||
export function pipelinelistProfiles(params){
|
||||
return request({
|
||||
url:'/pipe/pipeline/profiles/list',
|
||||
params,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//加载存档
|
||||
export function pipelineprofilesLoad(profilesId){
|
||||
return request({
|
||||
url:'/pipe/pipeline/profilesLoad/'+profilesId,
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
//删除存档
|
||||
export function pipelineprofilesDel(profilesId){
|
||||
return request({
|
||||
url:'/pipe/pipeline/'+profilesId,
|
||||
method: 'DELETE',
|
||||
})
|
||||
}
|
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 13 KiB |
|
@ -26,6 +26,7 @@
|
|||
|
||||
<div class="footBottm">
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
@click="add()"
|
||||
style="margin-right: 50px"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
<div class="footBottm">
|
||||
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
@click="add()"
|
||||
style="margin-right: 50px"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
<div class="footBottm">
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
@click="add()"
|
||||
style="margin-right: 50px"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<el-col :span="24">
|
||||
<el-form :model="form" ref="dataRef" label-width="90px" :rules="rules">
|
||||
<el-form-item label="标识码:" prop="code">
|
||||
<el-input placeholder="请输入" v-model="form.code" class="inputCss"/>
|
||||
<el-input placeholder="请输入" v-model="form.code" class="inputCss" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型:" prop="pipelineType">
|
||||
<el-select
|
||||
|
@ -52,152 +52,215 @@
|
|||
<span class="info"></span>
|
||||
</el-form-item>
|
||||
<el-form-item label="长度:" prop="length">
|
||||
<el-input placeholder="请输入" v-model="form.length" readonly class="inputCss"/>
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
v-model="form.length"
|
||||
readonly
|
||||
class="inputCss"
|
||||
/>
|
||||
<span class="info">米</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="管线起点:" prop="startData">
|
||||
<div class="inputBg">
|
||||
<div class="flex">
|
||||
<div>经度: {{form.path[0][0].toFixed(4)}}</div>
|
||||
<div>纬度: {{form.path[0][1].toFixed(4)}}</div>
|
||||
<div>经度: {{ parseFloat(form.path[0][0]).toFixed(4) }}</div>
|
||||
<div>纬度: {{ parseFloat(form.path[0][1]).toFixed(4) }}</div>
|
||||
</div>
|
||||
<div class="magringTop10">
|
||||
海拔: <el-input placeholder="请输入" v-model="form.startAltitude" class="inputCss"/>
|
||||
海拔:
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
v-model="form.startAltitude"
|
||||
class="inputCss"
|
||||
@input="inputMate"
|
||||
/>
|
||||
</div>
|
||||
<div class="magringTop10">
|
||||
标高: <el-input placeholder="请输入" v-model="form.startElevation" class="inputCss"/>
|
||||
标高:
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
v-model="form.startElevation"
|
||||
class="inputCss"
|
||||
@input="inputMate"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="管线终点:" prop="endData">
|
||||
<div class="inputBg">
|
||||
<div class="flex">
|
||||
<div>经度: {{form.path[1][0].toFixed(4)}}</div>
|
||||
<div>纬度: {{form.path[1][1].toFixed(4)}}</div>
|
||||
<div>经度: {{ parseFloat(form.path[1][0]).toFixed(4) }}</div>
|
||||
<div>纬度: {{ parseFloat(form.path[1][1]).toFixed(4) }}</div>
|
||||
</div>
|
||||
<div class="magringTop10">
|
||||
海拔: <el-input placeholder="请输入" v-model="form.endAltitude" class="inputCss"/>
|
||||
海拔:
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
v-model="form.endAltitude"
|
||||
class="inputCss"
|
||||
/>
|
||||
</div>
|
||||
<div class="magringTop10">
|
||||
标高: <el-input placeholder="请输入" v-model="form.endElevation" class="inputCss"/>
|
||||
标高:
|
||||
<el-input
|
||||
placeholder="请输入"
|
||||
v-model="form.endElevation"
|
||||
class="inputCss"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<div class="footBottm">
|
||||
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
@click="add()"
|
||||
style="margin-right: 50px"
|
||||
style="margin-right: 30px"
|
||||
:loading="loading"
|
||||
>确定</el-button
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="danger"
|
||||
@click="del()"
|
||||
style="margin-right: 30px"
|
||||
:loading="loading"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
@click="
|
||||
()=>{emit('closeDialog',false)}
|
||||
() => {
|
||||
emit('closeDialog', false);
|
||||
}
|
||||
"
|
||||
>取消</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {pipelineUpdate} from "@map/api/exit.js"
|
||||
const loading = ref(false)
|
||||
import { pipelineUpdate,getElevation } from "@map/api/exit.js";
|
||||
import ldMap from "@map/utils/map/init";
|
||||
const loading = ref(false);
|
||||
const $ldMap = inject("$ldMap"); // 调用全局变量
|
||||
const props = defineProps({
|
||||
layerId:String,
|
||||
detailInfo:{
|
||||
type:Object,
|
||||
default:{
|
||||
}
|
||||
}
|
||||
layerId: String,
|
||||
detailInfo: {
|
||||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
});
|
||||
|
||||
const checkStart = (rule,value,callback)=>{
|
||||
if(form.value.startAltitude&&form.value.startElevation){
|
||||
return callback()
|
||||
|
||||
|
||||
const checkStart = (rule, value, callback) => {
|
||||
if (form.value.startAltitude && form.value.startElevation) {
|
||||
return callback();
|
||||
}
|
||||
callback(new Error("请输入起点的海拔与标高"))
|
||||
}
|
||||
const checkEnd = (rule,value,callback)=>{
|
||||
if(form.value.endAltitude&&form.value.endElevation){
|
||||
return callback()
|
||||
callback(new Error("请输入起点的海拔与标高"));
|
||||
};
|
||||
const checkEnd = (rule, value, callback) => {
|
||||
if (form.value.endAltitude && form.value.endElevation) {
|
||||
return callback();
|
||||
}
|
||||
callback(new Error("请输入终点的海拔与标高"))
|
||||
}
|
||||
const emit = defineEmits(['closeDialog'])
|
||||
callback(new Error("请输入终点的海拔与标高"));
|
||||
};
|
||||
const emit = defineEmits(["closeDialog"]);
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const rules=ref( {
|
||||
code: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
pipelineType: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
material: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
const rules = ref({
|
||||
// code: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
// pipelineType: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
// material: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
diameter: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
length: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
startData:[{required: true,validator:checkStart,trigger: "blur"}],
|
||||
endData:[{required: true,validator:checkEnd,trigger: "blur"}]
|
||||
})
|
||||
// length: [{ required: true, message: "数据不能为空", trigger: "blur" }],
|
||||
// startData:[{required: true,validator:checkStart,trigger: "blur"}],
|
||||
// endData:[{required: true,validator:checkEnd,trigger: "blur"}]
|
||||
});
|
||||
|
||||
const form =ref( {...props.detailInfo})
|
||||
let diameter = form.value.diameter
|
||||
const form = ref({ ...props.detailInfo });
|
||||
|
||||
const typesList=ref([
|
||||
{label:'污水', value:'污水'},
|
||||
let diameter = form.value.diameter;
|
||||
onMounted(() => {
|
||||
|
||||
])
|
||||
const materialList=ref([
|
||||
{label:'PVC管道', value:'PVC管道'},
|
||||
{label:'PE管道', value:'PE管道'},
|
||||
{label:'铸铁管道', value:'铸铁管道'},
|
||||
{label:'钢制管道', value:'钢制管道'},
|
||||
{label:'玻璃钢管道', value:'玻璃钢管道'},
|
||||
|
||||
])
|
||||
const diameterList = ref([
|
||||
{label:'150管径', value:150},
|
||||
{label:'200管径', value:200},
|
||||
{label:'250管径', value:250},
|
||||
{label:'300管径', value:300},
|
||||
{label:'400管径', value:400},
|
||||
{label:'其他', value:999},
|
||||
])
|
||||
function add(){
|
||||
|
||||
proxy.$refs["dataRef"].validate(valid => {
|
||||
if (valid) {
|
||||
let data ={
|
||||
let lineId = form.value.lineId||form.value.id
|
||||
let graphics =ldMap.lineLayer.graphics.items
|
||||
let garphic = graphics.filter(element => {
|
||||
return element.id == lineId
|
||||
})[0];
|
||||
getElevation({
|
||||
layersId:props.layerId,
|
||||
geoJsonData:garphic.geometry.paths[0]
|
||||
}).then(res=>{
|
||||
form.value.startElevation = res.data[0]
|
||||
form.value.endElevation = res.data[1]
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
const inputMate=(e)=>{
|
||||
|
||||
}
|
||||
const typesList = ref([{ label: "污水", value: "污水" }]);
|
||||
const materialList = ref([
|
||||
{ label: "PVC管道", value: "PVC管道" },
|
||||
{ label: "PE管道", value: "PE管道" },
|
||||
{ label: "铸铁管道", value: "铸铁管道" },
|
||||
{ label: "钢制管道", value: "钢制管道" },
|
||||
{ label: "玻璃钢管道", value: "玻璃钢管道" },
|
||||
]);
|
||||
const diameterList = ref([
|
||||
{ label: "110管径", value: 110 },
|
||||
{ label: "200管径", value: 200 },
|
||||
{ label: "250管径", value: 250 },
|
||||
{ label: "300管径", value: 300 },
|
||||
{ label: "400管径", value: 400 },
|
||||
{ label: "其他", value: 999 },
|
||||
]);
|
||||
function setOldValue() {
|
||||
props.detailInfo.code = form.value.code;
|
||||
props.detailInfo.pipelineType = form.value.pipelineType;
|
||||
props.detailInfo.material = form.value.material;
|
||||
props.detailInfo.diameter = form.value.diameter;
|
||||
props.detailInfo.styleId = form.value.diameter.toString();
|
||||
props.detailInfo.startAltitude = form.value.startAltitude;
|
||||
props.detailInfo.startElevation = form.value.startElevation;
|
||||
props.detailInfo.endAltitude = form.value.endAltitude;
|
||||
props.detailInfo.endElevation = form.value.endElevation;
|
||||
}
|
||||
function del(){
|
||||
|
||||
|
||||
$ldMap.delSketch()
|
||||
emit("closeDialog",false);
|
||||
}
|
||||
function add() {
|
||||
proxy.$refs["dataRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
let data = {
|
||||
layersId: props.layerId,
|
||||
...form.value,
|
||||
path:JSON.stringify(form.value.path)
|
||||
path: form.value.path,
|
||||
};
|
||||
delete data.color;
|
||||
delete data.width;
|
||||
console.log(data);
|
||||
|
||||
if (data.id) {
|
||||
pipelineUpdate(data).then((res) => {
|
||||
setOldValue();
|
||||
emit("closeDialog", diameter != form.value.diameter);
|
||||
});
|
||||
} else {
|
||||
setOldValue();
|
||||
emit("closeDialog", diameter != form.value.diameter);
|
||||
}
|
||||
delete data.color
|
||||
delete data.width
|
||||
console.log(data)
|
||||
pipelineUpdate(data).then(res=>{
|
||||
props.detailInfo.code=form.value.code
|
||||
props.detailInfo.pipelineType=form.value.pipelineType
|
||||
props.detailInfo.material=form.value.material
|
||||
props.detailInfo.diameter=form.value.diameter
|
||||
props.detailInfo.startAltitude=form.value.startAltitude
|
||||
props.detailInfo.startElevation=form.value.startElevation
|
||||
props.detailInfo.endAltitude=form.value.endAltitude
|
||||
props.detailInfo.endElevation=form.value.endElevation
|
||||
emit('closeDialog',diameter!=form.value.diameter)
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
@ -220,26 +283,25 @@ function add(){
|
|||
display: flex;
|
||||
justify-content: end;
|
||||
}
|
||||
.inputCss{
|
||||
width:80%;
|
||||
.inputCss {
|
||||
width: 80%;
|
||||
}
|
||||
.info{
|
||||
color:#fff;
|
||||
padding-left:8px;
|
||||
.info {
|
||||
color: #fff;
|
||||
padding-left: 8px;
|
||||
}
|
||||
.inputBg{
|
||||
color:#fff;
|
||||
background:rgb(15,36,86,0.6);
|
||||
padding:5px;
|
||||
width:100%;
|
||||
border-radius:5px;
|
||||
.inputBg {
|
||||
color: #fff;
|
||||
background: rgb(15, 36, 86, 0.6);
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.flex{
|
||||
.flex {
|
||||
justify-content: space-evenly;
|
||||
display:flex
|
||||
display: flex;
|
||||
}
|
||||
.magringTop10{
|
||||
margin-top:10px;
|
||||
.magringTop10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form ref="dataRef" :model="form" label-width="120px" :rules="rules">
|
||||
<el-form ref="dataRef" :model="form" label-width="120px" >
|
||||
<el-form-item label="户数:" prop="households">
|
||||
<el-input v-model="form.households" type="number" placeholder="请输入" class="inputCss" />
|
||||
</el-form-item>
|
||||
|
@ -46,6 +46,7 @@
|
|||
|
||||
<div class="footBottm">
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
@click="add()"
|
||||
style="margin-right: 50px"
|
||||
|
@ -121,8 +122,8 @@ function add(){
|
|||
if (valid) {
|
||||
let data ={
|
||||
...props.detailInfo,
|
||||
path:JSON.stringify(props.detailInfo.path),
|
||||
innerings:JSON.stringify(props.detailInfo.innerings),
|
||||
path:props.detailInfo.path,
|
||||
innerings:props.detailInfo.innerings,
|
||||
layersId:props.layerId,
|
||||
geometryId:props.detailInfo.geometryId,
|
||||
type:'House',
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
<el-icon @click.stop="()=>{emit('cadShow',scope.row)}" color="rgb(64,158,255)" size="22" style="margin-left: 10px;"><VideoCamera /></el-icon>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除CAD" placement="right">
|
||||
<el-icon color="rgb(252,84,48)" @click.stop="delCadItem(scope.row)" size="20" style="margin-left: 10px;"><DeleteFilled /></el-icon>
|
||||
<el-icon v-hasPermi="['ldmap:role:edit']" color="rgb(252,84,48)" @click.stop="delCadItem(scope.row)" size="20" style="margin-left: 10px;"><DeleteFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table
|
||||
:data="exitContent"
|
||||
|
||||
ref="refTable"
|
||||
|
||||
>
|
||||
<!-- <el-table-column type="index" width="55" label="序号" /> -->
|
||||
|
||||
<el-table-column
|
||||
prop="mapType"
|
||||
width="86"
|
||||
label="类型"
|
||||
|
||||
>
|
||||
<template #default="scope">
|
||||
{{scope.$index+1}}.{{ getMapType(scope.row.mapType)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="actionType"
|
||||
|
||||
label="状态"
|
||||
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-tooltip
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
:content="scope.row.time"
|
||||
placement="top"
|
||||
>
|
||||
{{ getActionType(scope.row.actionType) }}
|
||||
</el-tooltip>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
show-overflow-tooltip
|
||||
|
||||
label="信息"
|
||||
|
||||
>
|
||||
<template #default="scope">
|
||||
{{getExitType(scope.row.tips)}}
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
prop="unit"
|
||||
|
||||
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!scope.row.isrevoke"
|
||||
size="small"
|
||||
@click="exitRecogn(scope.row,scope.$index)"
|
||||
><span style="color: #fff">恢复</span></el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import {storeToRefs} from 'pinia'
|
||||
import useMapLog from "@map/store/modules/mapLog"
|
||||
const mapLog = useMapLog()
|
||||
const {exitContent} = storeToRefs(mapLog)
|
||||
const { proxy } = getCurrentInstance();
|
||||
const $ldMap = inject("$ldMap");
|
||||
const getMapType = (val)=>{
|
||||
return val =='regon'?'特征物':'管线'
|
||||
}
|
||||
const getActionType =(val)=>{
|
||||
let action ={
|
||||
'add': '新增',
|
||||
'edit': '编辑',
|
||||
'delete': '删除',
|
||||
'save':'保存',
|
||||
'data':'初始化'
|
||||
}
|
||||
return action[val]
|
||||
}
|
||||
const getExitType=(val=>{
|
||||
|
||||
let action ={
|
||||
'House': '房屋',
|
||||
'River': '河流',
|
||||
'Road': '道路',
|
||||
'Station':'站点',
|
||||
'h':'房屋投影点',
|
||||
'x':'检修井投影点',
|
||||
's':'站点',
|
||||
|
||||
}
|
||||
return val? action[val]:'数据'
|
||||
})
|
||||
const exitRecogn = (data,index)=>{
|
||||
$ldMap.recoveryData(data).then(()=>{
|
||||
proxy.$modal.msgSuccess("恢复成功");
|
||||
mapLog.revokeContent(index)
|
||||
|
||||
}).catch(()=>{
|
||||
proxy.$modal.msgSuccess("功能完善中");
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
|
@ -20,16 +20,14 @@
|
|||
<div>图层:</div>
|
||||
<el-select
|
||||
class="m-2 select"
|
||||
v-model="value"
|
||||
v-model="layerId"
|
||||
placeholder="Select"
|
||||
size="large"
|
||||
@change="selectLayer"
|
||||
>
|
||||
|
||||
<el-option
|
||||
v-for="item in layerDate"
|
||||
:key="item.name"
|
||||
|
||||
:label="item.layerName"
|
||||
:value="item.id"
|
||||
/>
|
||||
|
@ -37,27 +35,37 @@
|
|||
</div>
|
||||
<div>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
style="margin-left: 15px"
|
||||
type="success"
|
||||
@click="()=>{emit('uploadShow')}"
|
||||
@click="
|
||||
() => {
|
||||
emit('uploadShow');
|
||||
}
|
||||
"
|
||||
>
|
||||
<span style="color: #fff">上传航拍图</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="layerslist"
|
||||
|
||||
|
||||
>
|
||||
<el-table :data="layerslist" style=" height: calc(100vh - 230px);">
|
||||
<el-table-column type="index" width="55" label="序号" />
|
||||
<el-table-column prop="houseFloors" width="100" label="图层名称">
|
||||
<template #default="scope">
|
||||
{{ scope.row.layerName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="geometryId" show-overflow-tooltip label="航拍文件" >
|
||||
<template #default="scope" >
|
||||
{{ scope.row.tiffUrl.substr(scope.row.tiffUrl.lastIndexOf('/')+1,scope.row.tiffUrl.length) }}
|
||||
<el-table-column
|
||||
prop="geometryId"
|
||||
show-overflow-tooltip
|
||||
label="航拍文件"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.tiffUrl.substr(
|
||||
scope.row.tiffUrl.lastIndexOf("/") + 1,
|
||||
scope.row.tiffUrl.length
|
||||
)
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="unit">
|
||||
|
@ -65,12 +73,9 @@
|
|||
<el-tag
|
||||
class="mx-1"
|
||||
effect="dark"
|
||||
|
||||
|
||||
|
||||
:type="scope.row.layerUrl?'success':'danger'"
|
||||
:type="scope.row.layerUrl ? 'success' : 'danger'"
|
||||
>
|
||||
{{scope.row.layerUrl?'已发布':'待发布' }}
|
||||
{{ scope.row.layerUrl ? "已发布" : "待发布" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -105,7 +110,6 @@
|
|||
</div>
|
||||
<el-table
|
||||
:data="tableDate"
|
||||
|
||||
ref="refTable"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
|
@ -258,7 +262,7 @@
|
|||
<div v-else style="display: flex; justify-content: space-between">
|
||||
<div>{{ node.label }}{{ node.distance }}</div>
|
||||
<div style="margin-right: 20px">
|
||||
<el-icon color="rgb(64,158,255, 0.8)" @click="exitLine(node)"
|
||||
<el-icon :color="getColor(node)" @click="exitLine(node)"
|
||||
><EditPen
|
||||
/></el-icon>
|
||||
</div>
|
||||
|
@ -291,7 +295,7 @@
|
|||
</el-row>
|
||||
<div class="line-legend">点位颜色</div>
|
||||
<div style="display: flex; padding: 5px 15px">
|
||||
<div :span="24" class="legend-point" v-for="item in legendPointeData" >
|
||||
<div :span="24" class="legend-point" v-for="item in legendPointeData">
|
||||
<div style="text-align: right">{{ item.label }}:</div>
|
||||
<div
|
||||
:style="{
|
||||
|
@ -309,6 +313,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="selectId == 4">
|
||||
<log></log>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -318,10 +325,11 @@ import leftIcon from "@map/assets/tool/left.png";
|
|||
import rightIcon from "@map/assets/tool/right.png";
|
||||
import useMapDataStore from "@map/store/modules/mapData";
|
||||
import useDistStore from "@map/store/modules/dist";
|
||||
import emitter from "@map/utils/emitter"
|
||||
import emitter from "@map/utils/emitter";
|
||||
import log from "./component/log";
|
||||
import { toRaw } from "vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const emit = defineEmits(["changeExit", "lineExit","uploadShow"]);
|
||||
const emit = defineEmits(["changeExit", "lineExit", "uploadShow"]);
|
||||
let mapdata = useMapDataStore();
|
||||
const {
|
||||
house,
|
||||
|
@ -332,6 +340,7 @@ const {
|
|||
setLineStyle,
|
||||
watertotal,
|
||||
layerId,
|
||||
layerName,
|
||||
checkedLegend,
|
||||
} = storeToRefs(mapdata);
|
||||
const tableDate = ref();
|
||||
|
@ -344,7 +353,7 @@ const $ldMap = inject("$ldMap"); // 调用全局变量
|
|||
const treeHeight = ref("");
|
||||
treeHeight.value = window.innerHeight - 258;
|
||||
const layerslist = ref();
|
||||
const layerDate = ref([])
|
||||
const layerDate = ref([]);
|
||||
const props = {
|
||||
value: "id",
|
||||
label: "label",
|
||||
|
@ -357,59 +366,69 @@ onMounted(() => {
|
|||
};
|
||||
tableDate.value = house.value;
|
||||
$ldMap.initMap().then((e) => {
|
||||
getLayerList().then(()=>{
|
||||
getLayerList().then(() => {
|
||||
if (layerslist.value) {
|
||||
selectLayer(layerslist.value[0].id);
|
||||
}
|
||||
})
|
||||
});
|
||||
getlegend();
|
||||
});
|
||||
emitter.on('loadLayer',() => {
|
||||
getLayerList()
|
||||
})
|
||||
emitter.on('polyon',(e)=>{
|
||||
if(e&&e.action!=2){
|
||||
emitter.on("loadLayer", () => {
|
||||
getLayerList();
|
||||
});
|
||||
emitter.on("polyon", (e) => {
|
||||
if (e && e.action != 2 && selectId.value == 2) {
|
||||
try {
|
||||
proxy.$refs["refTable"].setCurrentRow(e);
|
||||
tableDate.value.forEach((item,index)=>{
|
||||
|
||||
if(item == e){
|
||||
tableScrollToRow(proxy.$refs["refTable"],index+1,false)
|
||||
tableDate.value.forEach((item, index) => {
|
||||
if (item == e) {
|
||||
tableScrollToRow(proxy.$refs["refTable"], index + 1, false);
|
||||
}
|
||||
})
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
//定位到表格某一行
|
||||
|
||||
function tableScrollToRow(tableElement, rowindex, isprecise = false) {
|
||||
const theTableRows = tableElement.$el.querySelectorAll('.el-table__body tbody .el-table__row')
|
||||
const theTableRows = tableElement.$el.querySelectorAll(
|
||||
".el-table__body tbody .el-table__row"
|
||||
);
|
||||
let scrollTop = 0;
|
||||
for (let i = 0; i < theTableRows.length; i++) {
|
||||
if (i === rowindex) {
|
||||
break
|
||||
}
|
||||
scrollTop += theTableRows[i].offsetHeight
|
||||
if (!isprecise) {
|
||||
scrollTop *= (rowindex - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
scrollTop += theTableRows[i].offsetHeight;
|
||||
if (!isprecise) {
|
||||
scrollTop *= rowindex - 1;
|
||||
break;
|
||||
}
|
||||
tableElement.scrollTo(0, scrollTop)
|
||||
}
|
||||
tableElement.scrollTo(0, scrollTop);
|
||||
}
|
||||
const getColor = (node) => {
|
||||
node = node.data;
|
||||
let flag =
|
||||
node.startAltitude ||
|
||||
node.startElevation ||
|
||||
node.endAltitude ||
|
||||
node.endElevation;
|
||||
return flag == true ? "rgb(64,158,255, 0.8)" : "rgb(251,213,2, 0.8)";
|
||||
};
|
||||
//获取图层列表
|
||||
const getLayerList=()=>{
|
||||
return new Promise((resolve,reject)=>{
|
||||
|
||||
const getLayerList = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
mapdata.getMylayerList().then((res) => {
|
||||
layerslist.value = res.data;
|
||||
layerDate.value = res.data.filter(item=>item.layerUrl)
|
||||
resolve()
|
||||
layerDate.value = res.data.filter((item) => item.layerUrl);
|
||||
resolve();
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
let dist = useDistStore();
|
||||
const { deviceDist, standard } = storeToRefs(dist);
|
||||
|
@ -444,10 +463,9 @@ const getlegend = () => {
|
|||
legendlineData.value.push(line[i]);
|
||||
}
|
||||
for (let i in point) {
|
||||
if(point[i].visible ){
|
||||
if (point[i].visible) {
|
||||
legendPointeData.value.push(point[i]);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -464,6 +482,7 @@ function selectLayer(e) {
|
|||
if (item.id == e) {
|
||||
console.log(item);
|
||||
layerId.value = item.id;
|
||||
layerName.value = item.layerName
|
||||
$ldMap.addLayer({
|
||||
url: item.layerUrl,
|
||||
id: e,
|
||||
|
@ -472,11 +491,9 @@ function selectLayer(e) {
|
|||
});
|
||||
}
|
||||
|
||||
watch([house, road, river], (newhouse, newroad, newriver) => {
|
||||
console.log(newhouse);
|
||||
selectId.value = 2;
|
||||
|
||||
tableDate.value = newhouse[selectType.value];
|
||||
watch([house, river, road], (newData) => {
|
||||
selectId.value != 4 && (selectId.value = 2);
|
||||
tableDate.value = newData[selectType.value];
|
||||
});
|
||||
const lineNowData = ref([]);
|
||||
watch(lineArray, (val) => {
|
||||
|
@ -542,6 +559,8 @@ watch(checkedLegend, (val) => {
|
|||
});
|
||||
|
||||
async function showLineArrMap(data) {
|
||||
$ldMap.removePoint();
|
||||
$ldMap.removeLine()
|
||||
let treeData = await $ldMap.addDefaultByline(data);
|
||||
setTreeData(treeData);
|
||||
}
|
||||
|
@ -653,12 +672,7 @@ const tabList = reactive([
|
|||
background: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
:deep(.el-table) {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: transparent;
|
||||
height: calc(100vh - 170px);
|
||||
}
|
||||
|
||||
:deep(.el-table tr):hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
|
|
@ -39,12 +39,12 @@
|
|||
<el-button
|
||||
link type="primary" icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
link type="danger" icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:layers:remove']"
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -89,7 +89,7 @@
|
|||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button :loading="buttonLoading" type="primary" v-hasPermi="['ldmap:role:edit']" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@ -188,7 +188,6 @@ const {
|
|||
} = toRefs(data);
|
||||
|
||||
queryParams.value.layersId = props.layerId
|
||||
alert(queryParams.value.layersId)
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
|
|
|
@ -23,45 +23,88 @@
|
|||
><span style="color: #fff">数据核验</span></el-button> -->
|
||||
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
color="rgb(18, 180, 106, 0.6)"
|
||||
:disabled="recognition"
|
||||
@click="setPolygonData"
|
||||
><span style="color: #fff">特征物保存</span></el-button
|
||||
>
|
||||
<div class="loadStyle">
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="success"
|
||||
:disabled="recognition"
|
||||
color="rgb(255,0,0, 0.6)"
|
||||
@click="addPolygon('House')"
|
||||
><span style="color: #fff">新增房屋</span></el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="warning"
|
||||
color="rgb(94,208,81, 0.6)"
|
||||
:disabled="recognition"
|
||||
@click="addPolygon('River')"
|
||||
><span style="color: #fff">新增河流</span></el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
:disabled="recognition"
|
||||
color="rgb(118,116,218, 0.6)"
|
||||
@click="addPolygon('Road')"
|
||||
><span style="color: #fff">新增道路</span></el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
color="rgb(8, 240, 36, 0.6)"
|
||||
:disabled="recognition"
|
||||
@click="addPointDevice()"
|
||||
><span style="color: #fff">新增站点</span></el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 10px"></div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
color="rgb(28, 140, 196, 0.6)"
|
||||
:disabled="recognition"
|
||||
@click="cutPolygon()"
|
||||
><span style="color: #fff">切割特征物</span></el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
color="rgb(128, 40, 96, 0.6)"
|
||||
:disabled="recognition"
|
||||
@click="elevationPolygon()"
|
||||
><span style="color: #fff">
|
||||
|
||||
<template v-if="!isShow">展示</template>
|
||||
<template v-else> 关闭</template>道路高程</span></el-button
|
||||
>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
:disabled="recognition"
|
||||
type="info"
|
||||
color="rgb(180, 100, 166, 0.6)"
|
||||
@click="exportPng()"
|
||||
><span style="color: #fff">导 出</span></el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
:disabled="recognition"
|
||||
type="info"
|
||||
color="rgb(180, 100, 6, 0.6)"
|
||||
@click="exportCad()"
|
||||
><span style="color: #fff">导 出 Cad</span></el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
|
@ -75,23 +118,68 @@
|
|||
<div v-if="lineSecond" class="item-data">
|
||||
<el-button type="primary" @click="emitLine">开始布线</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
:disabled="pipeline"
|
||||
color="rgb(18, 180, 106, 0.6)"
|
||||
@click="optimizeMaxLength"
|
||||
><span style="color: #fff">检修井优化</span></el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
:disabled="pipeline"
|
||||
color="rgb(18, 180, 106, 0.6)"
|
||||
@click="optimizePoline"
|
||||
><span style="color: #fff">检修井优化</span></el-button
|
||||
> -->
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="info"
|
||||
:disabled="pipeline"
|
||||
color="rgb(18, 180, 106, 0.6)"
|
||||
@click="setPolineData"
|
||||
><span style="color: #fff">管线数据保存</span></el-button
|
||||
>
|
||||
<div style="margin-top: 10px"></div>
|
||||
|
||||
<div style="margin-top: 10px">
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
:disabled="pipeline"
|
||||
color="rgb(255,0,0, 0.6)"
|
||||
@click="addPointBy('h')"
|
||||
><span style="color: #fff">新增房屋点</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
:disabled="pipeline"
|
||||
color="rgb(7, 253, 253, 0.6)"
|
||||
@click="addPointBy"
|
||||
><span style="color: #fff">新增检修井</span></el-button
|
||||
@click="addPointBy('x')"
|
||||
><span style="color: #fff">新增检修井</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-button
|
||||
color="rgb(152, 51, 147, 0.6)"
|
||||
:disabled="pipeline"
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
@click="addLine('once')"
|
||||
>
|
||||
<el-button color="rgb(152, 51, 147, 0.6)" @click="addLine">
|
||||
<span style="color: #fff">新增管线</span></el-button
|
||||
<span style="color: #fff">新增管线</span>
|
||||
</el-button>
|
||||
<el-button
|
||||
color="rgb(12, 51, 200, 0.6)"
|
||||
:disabled="pipeline"
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
@click="addLine('multiple')"
|
||||
>
|
||||
<div style="margin-top: 10px"></div>
|
||||
<div v-if="showCheck">
|
||||
<span style="color: #fff">多点管线</span>
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div v-if="showCheck" style="margin-top: 10px">
|
||||
<el-checkbox-group
|
||||
v-model="checkedpoint"
|
||||
@change="handleCheckedPointChange"
|
||||
|
@ -99,6 +187,7 @@
|
|||
<el-checkbox
|
||||
v-for="item in legendPointeData"
|
||||
:key="item.styleId"
|
||||
:disabled="pipeline"
|
||||
:label="item.styleId"
|
||||
border
|
||||
style="width: 30%; margin-right: 3%"
|
||||
|
@ -106,6 +195,23 @@
|
|||
>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
<el-checkbox
|
||||
v-model="checkedqdf"
|
||||
label="qdf"
|
||||
border
|
||||
style="width: 30%; margin-right: 3%"
|
||||
>户用机</el-checkbox
|
||||
>
|
||||
<el-button
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
type="primary"
|
||||
v-if="checkedqdf"
|
||||
color="rgb(20, 3, 153, 0.6)"
|
||||
@click="addPointByPng('png')"
|
||||
><span style="color: #fff">新增户用机</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left-tabs">
|
||||
|
@ -127,30 +233,91 @@ import rightIcon from "@map/assets/tool/right.png";
|
|||
import upIcon from "@map/assets/tool/up.png";
|
||||
import downIcon from "@map/assets/tool/down.png";
|
||||
import useMapDataStore from "@map/store/modules/mapData";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import useMapLogStore from "@map/store/modules/mapLog";
|
||||
|
||||
import cut from "@map/utils/map/cut";
|
||||
import exporGis from "@map/utils/map/export";
|
||||
let mapLog = useMapLogStore();
|
||||
let mapdata = useMapDataStore();
|
||||
import { storeToRefs } from "pinia";
|
||||
const $ldMap = inject("$ldMap"); // 调用全局变量
|
||||
const value = ref(null);
|
||||
|
||||
const pipeline = ref(true);
|
||||
const recognition = ref(true);
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { showCheck, pointArray, checkedLegend, checkedpoint,layerId } =
|
||||
storeToRefs(mapdata);
|
||||
const {
|
||||
showCheck,
|
||||
pointArray,
|
||||
maxPointIndex,
|
||||
checkedLegend,
|
||||
checkedpoint,
|
||||
layerName,
|
||||
layerId,
|
||||
profilesId,
|
||||
secen,
|
||||
} = storeToRefs(mapdata);
|
||||
onMounted(() => {
|
||||
getlegend();
|
||||
|
||||
document.addEventListener("keyup", (e) => {
|
||||
if (e.key == "Delete") {
|
||||
let layerVal = $ldMap.delSketch();
|
||||
if (layerVal) {
|
||||
mapdata.delData(layerVal);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
watch(profilesId, (val) => {
|
||||
if(secen.value=='recognition'){
|
||||
recognition.value = val == null;
|
||||
pipeline.value = true
|
||||
}else{
|
||||
pipeline.value = val ==null;
|
||||
recognition.value=true
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
const legendlineData = ref([]);
|
||||
const legendPointeData = ref([]);
|
||||
const checkAll = ref(true);
|
||||
|
||||
watch(layerId, (val) => {
|
||||
if (checkedqdf.value) {
|
||||
mapdata.getSetpointStyle().then((e) => {
|
||||
septicTank.value = e;
|
||||
imgUlr.value = e.img;
|
||||
$ldMap.addsepticTank(e);
|
||||
});
|
||||
} else {
|
||||
septicTank.value = null;
|
||||
}
|
||||
});
|
||||
const checkedqdf = ref(false);
|
||||
const septicTank = ref();
|
||||
const imgUlr = ref();
|
||||
watch(checkedqdf, (val) => {
|
||||
console.log(val);
|
||||
if (val) {
|
||||
if (septicTank.value) {
|
||||
$ldMap.setPngPoint(true);
|
||||
} else {
|
||||
mapdata.getSetpointStyle().then((e) => {
|
||||
septicTank.value = e;
|
||||
imgUlr.value = e.img;
|
||||
$ldMap.addsepticTank(e);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$ldMap.setPngPoint(false);
|
||||
}
|
||||
});
|
||||
function addPointByPng(type) {
|
||||
$ldMap.addOpionPoint(type, imgUlr.value);
|
||||
}
|
||||
|
||||
const isIndeterminate = ref(true);
|
||||
const handleCheckAllChange = (val) => {
|
||||
checkedLegend.value = val
|
||||
|
@ -189,8 +356,7 @@ const getlegend = () => {
|
|||
legendlineData.value.push(line[i]);
|
||||
}
|
||||
for (let i in point) {
|
||||
if(point[i].visible)
|
||||
legendPointeData.value.push(point[i]);
|
||||
if (point[i].visible) legendPointeData.value.push(point[i]);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -205,10 +371,25 @@ const lineThird = ref(false);
|
|||
const emit = defineEmits();
|
||||
const a = ref("");
|
||||
function emitFind() {
|
||||
secen.value = "recognition";
|
||||
emit("update:findValue", true);
|
||||
//叠加图层
|
||||
}
|
||||
function optimizeMaxLength(){
|
||||
$ldMap.ponitBindByFivety()
|
||||
}
|
||||
function optimizePoline() {
|
||||
|
||||
let length = 5;
|
||||
let num = $ldMap.pointBindByLength(length);
|
||||
ElMessageBox.alert(
|
||||
`检查井相近距离${length}米优化,已经优化点位:${num}个`,
|
||||
"优化提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
callback: (action) => {},
|
||||
}
|
||||
);
|
||||
|
||||
// 高层文件 航拍文件
|
||||
}
|
||||
function exportPng() {
|
||||
$ldMap.arcgisPrint();
|
||||
|
@ -216,14 +397,26 @@ function exportPng() {
|
|||
function mergeOpt() {
|
||||
$ldMap.MergeOptimization();
|
||||
}
|
||||
function addPointBy() {
|
||||
$ldMap.addOpionPoint()
|
||||
function addPointBy(type) {
|
||||
mapdata.setMaxPointIndex(1);
|
||||
$ldMap.addOpionPoint(type, maxPointIndex.value);
|
||||
}
|
||||
function addLine() {
|
||||
$ldMap.startDrawLine();
|
||||
function addLine(type) {
|
||||
$ldMap.startDrawLine(type);
|
||||
}
|
||||
const isShow = ref(false)
|
||||
function elevationPolygon(){
|
||||
|
||||
mapdata.getfindSkeleton().then(res=>{
|
||||
isShow.value = !isShow.value
|
||||
$ldMap.elevationData(isShow.value,res.data);
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
function addPointMap(val) {
|
||||
$ldMap.removePoint();
|
||||
|
||||
val.forEach((data) => {
|
||||
$ldMap.addDefaultByPoint(data);
|
||||
});
|
||||
|
@ -231,7 +424,13 @@ function addPointMap(val) {
|
|||
function getAllMapData() {
|
||||
$ldMap.getAllData();
|
||||
}
|
||||
|
||||
function cutPolygon() {
|
||||
let { flag, data } = cut();
|
||||
if (flag) {
|
||||
} else {
|
||||
ElMessage({ message: "请选择需要切割区域", type: "error" });
|
||||
}
|
||||
}
|
||||
function addPolygon(type) {
|
||||
// console.log(mapdata.house)
|
||||
$ldMap.DrawSketch("polygon", type);
|
||||
|
@ -257,10 +456,33 @@ function addPointDevice() {
|
|||
function verificationChange() {
|
||||
emit("changeVerification");
|
||||
}
|
||||
function setPolineData(){
|
||||
let data = $ldMap.getpointByStart()
|
||||
function setPolineData() {
|
||||
let data = $ldMap.getpointByStart();
|
||||
|
||||
console.log(JSON.stringify(data))
|
||||
console.log(JSON.stringify(data));
|
||||
|
||||
let lineList = data.line.filter((item) => {
|
||||
return item[item.length - 1][2] != "s";
|
||||
});
|
||||
|
||||
if (lineList.length) {
|
||||
$ldMap.hightLineLayer(lineList[0]);
|
||||
ElMessageBox.confirm("当前所以管线未连接到设备点,是否继续保存", {
|
||||
confirmButtonText: "保存",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
mapdata.saveLine(data).then(() => {
|
||||
mapLog.clearExitContent();
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
mapdata.saveLine(data).then(() => {
|
||||
mapLog.clearExitContent();
|
||||
});
|
||||
}
|
||||
}
|
||||
//保存特征物
|
||||
function setPolygonData() {
|
||||
|
@ -303,6 +525,7 @@ function setPolygonData() {
|
|||
peopleNum,
|
||||
};
|
||||
}
|
||||
|
||||
arrParam.push({
|
||||
id,
|
||||
layersId,
|
||||
|
@ -310,33 +533,37 @@ function setPolygonData() {
|
|||
geometryId,
|
||||
type,
|
||||
extend,
|
||||
path: JSON.stringify(path),
|
||||
innerings: JSON.stringify(innerings),
|
||||
path: path,
|
||||
innerings: innerings,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
let deviceObj = {}
|
||||
if(pointdata.length){
|
||||
let deviceObj = {};
|
||||
if (pointdata.length) {
|
||||
pointdata.forEach((res) => {
|
||||
deviceObj={
|
||||
action:1,
|
||||
deviceObj = {
|
||||
action: 1,
|
||||
type: "Station",
|
||||
path: JSON.stringify([[res.geometry.x, res.geometry.y]]),
|
||||
layersId:layerId.value,
|
||||
geometryId: Date.now()
|
||||
path: [[res.geometry.x, res.geometry.y]],
|
||||
layersId: layerId.value,
|
||||
geometryId: "Station:" + Date.now(),
|
||||
};
|
||||
});
|
||||
|
||||
}else{
|
||||
deviceObj={
|
||||
action:0,
|
||||
} else {
|
||||
deviceObj = {
|
||||
action: 0,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
console.log(arrParam,deviceObj);
|
||||
mapdata.updateRecon(arrParam,deviceObj).then((res) => {
|
||||
console.log(arrParam, deviceObj);
|
||||
mapdata.updateRecon(arrParam, deviceObj).then((res) => {
|
||||
mapLog.clearExitContent();
|
||||
mapLog.addContent({
|
||||
mapType: "regon", //regon:特征物,line:线
|
||||
actionType: "data", //add,exit,del,
|
||||
isrevoke: false, //是否允许撤回,
|
||||
});
|
||||
$ldMap.removeAllLayer();
|
||||
$ldMap.addDefaultData(mapdata.road, "Road");
|
||||
$ldMap.addDefaultData(mapdata.house, "House");
|
||||
|
@ -344,17 +571,29 @@ function setPolygonData() {
|
|||
$ldMap.addDeviceData(mapdata.station, "Station");
|
||||
});
|
||||
}
|
||||
function exportCad(){
|
||||
// exporGis()
|
||||
if(profilesId.value){
|
||||
proxy.download("/pipe/recognition/exportCad?profilesId="+profilesId.value, {},
|
||||
`${layerName.value}.dxf`,{
|
||||
baseURL: "/map-api"
|
||||
},true);
|
||||
|
||||
}else{
|
||||
ElMessage({ message: "请先选择特征物数据", type: "error" });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setPrice() {
|
||||
mapdata.createcsvFile().then((res) => {
|
||||
emit("update:priceFlag", true);
|
||||
});
|
||||
}
|
||||
function set() {
|
||||
|
||||
}
|
||||
function set() {}
|
||||
|
||||
function emitLine() {
|
||||
secen.value = "pipeline";
|
||||
emit("update:lineValue", true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,36 +1,22 @@
|
|||
<template>
|
||||
<!-- <div @click="goDown">导出</div> -->
|
||||
<Header class="header" @change-menu = "changemenu"></Header>
|
||||
<Header class="header" @change-menu="changemenu"></Header>
|
||||
|
||||
<component
|
||||
|
||||
@change-exit="regconChange"
|
||||
ref="leftComponent"
|
||||
@line-exit="lineDataChange"
|
||||
@cad-add = "openCadDialog"
|
||||
@cad-show = "openCadShowDialog"
|
||||
@cad-add="openCadDialog"
|
||||
@cad-show="openCadShowDialog"
|
||||
@upload-show="uploadShowDialog"
|
||||
|
||||
class="left"
|
||||
:is="componentId"
|
||||
|
||||
></component>
|
||||
<Right
|
||||
v-if="comid=='sj'"
|
||||
v-if="comid == 'sj'"
|
||||
class="right"
|
||||
@change-verification="verificationChange"
|
||||
@update:findValue="
|
||||
(e) => {
|
||||
findValue = e;
|
||||
sseData = [];
|
||||
}
|
||||
"
|
||||
@update:lineValue="
|
||||
(e) => {
|
||||
lineValue = e;
|
||||
sseData = [];
|
||||
}
|
||||
"
|
||||
@update:findValue="setFindVal"
|
||||
@update:lineValue="setLineVal"
|
||||
@update:priceFlag="
|
||||
(e) => {
|
||||
priceFlag = e;
|
||||
|
@ -39,7 +25,6 @@
|
|||
></Right>
|
||||
<div class="main">
|
||||
<div id="viewDiv" ref="mapDiv"></div>
|
||||
|
||||
</div>
|
||||
<el-dialog
|
||||
v-model="findValue"
|
||||
|
@ -51,6 +36,49 @@
|
|||
<div class="my-header">识别算法</div>
|
||||
</template>
|
||||
<el-form :model="findForm" label-width="80px">
|
||||
<el-row>
|
||||
<div class="tableCss">
|
||||
<el-table
|
||||
:data="profilesList"
|
||||
style="width: 100%; height: 210px"
|
||||
:row-class-name="tableRowClassName"
|
||||
highlight-current-row
|
||||
v-if="findValue"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="createTime" label="存档历史" width="180" />
|
||||
|
||||
<el-table-column prop="address" center label="类型">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.type == 1" round
|
||||
>私有</el-tag
|
||||
>
|
||||
<el-tag type="info" v-else round>分配</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createBy" label="用户" />
|
||||
<el-table-column prop="address" center label="数据">
|
||||
<template #default="scope">
|
||||
<el-tag type="primary" v-if="scope.row.privateType == 1" round
|
||||
>初始</el-tag
|
||||
>
|
||||
<el-tag type="warning" v-else round>编辑</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" prop="unit">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="!scope.row.type"
|
||||
size="small"
|
||||
@click.stop="profilesDelete(scope.row)"
|
||||
><span style="color: #fff">删除</span></el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="14">
|
||||
<el-form-item label="尺寸:">
|
||||
|
@ -74,8 +102,15 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="10" style="padding-left: 10px">
|
||||
<div class="scroCss" >
|
||||
<p v-for="(item,index) in sseData" :class="[index==sseData.length-1&&loading?'scroll-to-bottom':'']">
|
||||
<div class="scroCss">
|
||||
<p
|
||||
v-for="(item, index) in sseData"
|
||||
:class="[
|
||||
index == sseData.length - 1 && loading
|
||||
? 'scroll-to-bottom'
|
||||
: '',
|
||||
]"
|
||||
>
|
||||
{{ item.time.substring(10, 16) }} {{ item.data }}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -95,6 +130,7 @@
|
|||
@click="findArea(1)"
|
||||
style="margin-right: 50px"
|
||||
:loading="loading"
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
>开始识别</el-button
|
||||
>
|
||||
<el-button
|
||||
|
@ -117,6 +153,49 @@
|
|||
<template #header="{ close, titleId, titleClass }">
|
||||
<div class="my-header">布线算法</div>
|
||||
</template>
|
||||
<el-row>
|
||||
<div class="tableCss">
|
||||
<el-table
|
||||
:data="profilesList"
|
||||
style="width: 100%; height: 210px"
|
||||
:row-class-name="tableRowClassName"
|
||||
highlight-current-row
|
||||
v-if="lineValue"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
<el-table-column prop="createTime" label="存档历史" width="180" />
|
||||
|
||||
<el-table-column prop="address" center label="类型">
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.type == 1" round
|
||||
>私有</el-tag
|
||||
>
|
||||
<el-tag type="info" v-else round>分配</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createBy" label="用户" />
|
||||
<el-table-column prop="address" center label="数据">
|
||||
<template #default="scope">
|
||||
<el-tag type="primary" v-if="scope.row.privateType == 1" round
|
||||
>初始</el-tag
|
||||
>
|
||||
<el-tag type="warning" v-else round>编辑</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" prop="unit">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="!scope.row.type"
|
||||
size="small"
|
||||
@click.stop="profilesDelete(scope.row)"
|
||||
><span style="color: #fff">删除</span></el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="15">
|
||||
<el-form :model="lineForm" label-width="120px">
|
||||
|
@ -144,7 +223,12 @@
|
|||
|
||||
<el-col :span="9" style="padding-left: 10px">
|
||||
<div class="scroCss" style="height: 270px">
|
||||
<p v-for="(item,index) in sseData" :class="[index==sseData.length-1&&loading?'scroll-to-bottom':'']">
|
||||
<p
|
||||
v-for="(item, index) in sseData"
|
||||
:class="[
|
||||
index == sseData.length - 1 && loading ? 'scroll-to-bottom' : '',
|
||||
]"
|
||||
>
|
||||
{{ item.time.substring(10, 16) }} {{ item.data }}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -157,13 +241,16 @@
|
|||
style="margin-right: 30px"
|
||||
@click="findLine(0)"
|
||||
:loading="loading"
|
||||
>仅加载/显示已有识别结果</el-button>
|
||||
>仅加载/显示已有结果</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="findLine(1)"
|
||||
style="margin-right: 50px"
|
||||
v-hasPermi="['ldmap:role:edit']"
|
||||
:loading="loading"
|
||||
>开始布线</el-button >
|
||||
>开始布线</el-button
|
||||
>
|
||||
<el-button
|
||||
type="warning"
|
||||
@click="
|
||||
|
@ -202,14 +289,11 @@
|
|||
<div class="my-header">管线属性编辑</div>
|
||||
</template>
|
||||
<line-exit
|
||||
|
||||
:layerId="layerId"
|
||||
:detailInfo = "detailInfoLine"
|
||||
@closeDialog ="closeExitLine"
|
||||
:detailInfo="detailInfoLine"
|
||||
@closeDialog="closeExitLine"
|
||||
v-if="linetionExit"
|
||||
|
||||
></line-exit>
|
||||
|
||||
</el-dialog>
|
||||
<!-- 房屋编辑 -->
|
||||
<el-dialog
|
||||
|
@ -224,11 +308,11 @@
|
|||
</template>
|
||||
<recon-exit
|
||||
:layerId="layerId"
|
||||
:detailInfo = "detailInfoHouse"
|
||||
@closeDialog ="closeRecognition"
|
||||
v-if="recognitionExit">
|
||||
:detailInfo="detailInfoHouse"
|
||||
@closeDialog="closeRecognition"
|
||||
v-if="recognitionExit"
|
||||
>
|
||||
</recon-exit>
|
||||
|
||||
</el-dialog>
|
||||
<!-- 数据核验 -->
|
||||
<el-dialog
|
||||
|
@ -243,51 +327,62 @@
|
|||
</template>
|
||||
<data-value-exit
|
||||
:layerId="layerId"
|
||||
:detailInfo = "detailInfoVerification"
|
||||
:detailInfo="detailInfoVerification"
|
||||
v-if="dataAllExit"
|
||||
@closeDialog ="()=>{dataAllExit=false}"
|
||||
@closeDialog="
|
||||
() => {
|
||||
dataAllExit = false;
|
||||
}
|
||||
"
|
||||
></data-value-exit>
|
||||
|
||||
</el-dialog>
|
||||
<!-- cad展示 -->
|
||||
<div class="cadCssDialog">
|
||||
<el-dialog
|
||||
|
||||
v-model="cadMapbox"
|
||||
destroy-on-close
|
||||
:title="cadSelectData?.name||''"
|
||||
:title="cadSelectData?.name || ''"
|
||||
:close-on-click-modal="false"
|
||||
width="80%"
|
||||
top="5vh"
|
||||
>
|
||||
<cad-map :cadSelectData="cadSelectData" >
|
||||
</cad-map>
|
||||
<cad-map :cadSelectData="cadSelectData"> </cad-map>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<!-- 新增cad -->
|
||||
<el-dialog
|
||||
|
||||
v-model="addCadDialog"
|
||||
title="cad展示"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
width="40%"
|
||||
>
|
||||
<add-cad @closeAddDialog ="()=>{addCadDialog = false}">
|
||||
>
|
||||
<add-cad
|
||||
@closeAddDialog="
|
||||
() => {
|
||||
addCadDialog = false;
|
||||
}
|
||||
"
|
||||
>
|
||||
</add-cad>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 新增航拍图 -->
|
||||
<el-dialog
|
||||
v-model = "uploadDialog"
|
||||
<!-- 新增航拍图 -->
|
||||
<el-dialog
|
||||
v-model="uploadDialog"
|
||||
title="上传航拍图"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
|
||||
>
|
||||
<layer-upload @closeAddDialog ="()=>{uploadDialog = false}"></layer-upload>
|
||||
</el-dialog>
|
||||
>
|
||||
<layer-upload
|
||||
@closeAddDialog="
|
||||
() => {
|
||||
uploadDialog = false;
|
||||
}
|
||||
"
|
||||
></layer-upload>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
@ -299,59 +394,52 @@ import LdMap from "./map/LdMap.vue";
|
|||
import priceExcel from "./comRight/priceExcel";
|
||||
import costSet from "./comRight/costSet";
|
||||
import useMapDataStore from "@map/store/modules/mapData";
|
||||
import useMapLogStore from "@map/store/modules/mapLog";
|
||||
import lineExit from "./comExit/lineExit";
|
||||
import addCad from "./cadMap/addCad"
|
||||
import addCad from "./cadMap/addCad";
|
||||
import reconExit from "./comExit/reconExit";
|
||||
import dataValueExit from "./comExit/dataExit";
|
||||
import layerUpload from "./comExit/layerUpload"
|
||||
import layerUpload from "./comExit/layerUpload";
|
||||
import cadMap from "./cadMap";
|
||||
import {recognitionQuery,verificationQyery} from "@map/api/exit.js"
|
||||
import emitter from "@map/utils/emitter"
|
||||
import html2canvas from "html2canvas"
|
||||
import { recognitionQuery, verificationQyery } from "@map/api/exit.js";
|
||||
import emitter from "@map/utils/emitter";
|
||||
import html2canvas from "html2canvas";
|
||||
import { ElMessage } from "element-plus";
|
||||
const $ldMap = inject("$ldMap"); // 调用全局变量
|
||||
const $ldBox = inject("$ldBox"); // 调用全局变量
|
||||
const componentId = ref(sjLeft)
|
||||
const comid = ref('sj')
|
||||
|
||||
const changemenu = (e)=>{
|
||||
if(comid.value!=e){
|
||||
comid.value = e
|
||||
document.getElementById('viewDiv').innerHTML = ''
|
||||
switch(e){
|
||||
case 'sj':componentId.value = sjLeft;break;
|
||||
case 'cad':componentId.value = cadLeft; $ldBox.init(); break;
|
||||
const componentId = ref(sjLeft);
|
||||
const comid = ref("sj");
|
||||
const changemenu = (e) => {
|
||||
if (comid.value != e) {
|
||||
comid.value = e;
|
||||
document.getElementById("viewDiv").innerHTML = "";
|
||||
switch (e) {
|
||||
case "sj":
|
||||
componentId.value = sjLeft;
|
||||
break;
|
||||
case "cad":
|
||||
componentId.value = cadLeft;
|
||||
$ldBox.init();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const tableRowClassName = ({ row, rowIndex }) => {
|
||||
if (rowIndex === 1) {
|
||||
return "warning-row";
|
||||
} else if (rowIndex === 3) {
|
||||
return "success-row";
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
const mapDiv = ref()
|
||||
const posterimg = ref()
|
||||
const goDown = ()=> {
|
||||
html2canvas(mapDiv.value,{
|
||||
backgroundColor:'#f5f5f5',//海报的背景颜色
|
||||
useCORS:true, // 允许跨域
|
||||
width:1000, //生成海报的w
|
||||
height:2000, //生成海报的h 默认是px
|
||||
}).then(canvas=>{
|
||||
// canvas 其实就是我们所讲的res 的意思 返回报文的意思
|
||||
let baseImg = canvas.toDataURL("image/png");
|
||||
posterimg.value =baseImg;
|
||||
let save = document.createElement('a');
|
||||
// <a href=''></a>
|
||||
save.href = baseImg;
|
||||
// 下载的名字
|
||||
save.download = 'yz'
|
||||
// 直接回调a的点击事件
|
||||
save.click()
|
||||
})
|
||||
}
|
||||
const mapDiv = ref();
|
||||
const posterimg = ref();
|
||||
|
||||
let mapdata = useMapDataStore();
|
||||
const { sseData } = storeToRefs(mapdata);
|
||||
|
||||
let mapLog = useMapLogStore();
|
||||
const { sseData, profilesList, secen } = storeToRefs(mapdata);
|
||||
|
||||
const setFlag = ref(false);
|
||||
const priceRef = ref();
|
||||
|
@ -369,122 +457,197 @@ const lineForm = ref<lineFormType>({
|
|||
name: "",
|
||||
});
|
||||
//航拍图
|
||||
const uploadDialog = ref(false)
|
||||
const uploadShowDialog =()=>{
|
||||
uploadDialog.value = true
|
||||
}
|
||||
const uploadDialog = ref(false);
|
||||
const uploadShowDialog = () => {
|
||||
uploadDialog.value = true;
|
||||
};
|
||||
//cad
|
||||
const cadMapbox = ref(false)
|
||||
const cadSelectData = ref()
|
||||
const addCadDialog = ref(false)
|
||||
const openCadDialog = ()=>{
|
||||
const cadMapbox = ref(false);
|
||||
const cadSelectData = ref();
|
||||
const addCadDialog = ref(false);
|
||||
const openCadDialog = () => {
|
||||
addCadDialog.value = true;
|
||||
}
|
||||
};
|
||||
|
||||
const openCadShowDialog=(e)=>{
|
||||
|
||||
cadMapbox.value = true
|
||||
cadSelectData.value = e
|
||||
|
||||
}
|
||||
const openCadShowDialog = (e) => {
|
||||
cadMapbox.value = true;
|
||||
cadSelectData.value = e;
|
||||
};
|
||||
|
||||
//编辑特征物
|
||||
const recognitionExit = ref(false)
|
||||
const detailInfoHouse = ref({})
|
||||
const regconChange = (e)=>{
|
||||
detailInfoHouse.value = e
|
||||
const recognitionExit = ref(false);
|
||||
const detailInfoHouse = ref({});
|
||||
const regconChange = (e) => {
|
||||
detailInfoHouse.value = e;
|
||||
recognitionExit.value = true;
|
||||
}
|
||||
const closeRecognition=(e)=>{
|
||||
recognitionExit.value = false
|
||||
if(e){
|
||||
$ldMap.setReconLabel(e.geometryId,e.extend.houseMaterial+e.extend.houseFloors)
|
||||
};
|
||||
const closeRecognition = (e) => {
|
||||
recognitionExit.value = false;
|
||||
if (e) {
|
||||
$ldMap.setReconLabel(
|
||||
e.geometryId,
|
||||
(e.extend.houseMaterial || "") + (e.extend.houseFloors || "")
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
//编辑管线
|
||||
const linetionExit = ref(false)
|
||||
const detailInfoLine =ref({})
|
||||
const leftComponent = ref()
|
||||
const lineDataChange = (data)=>{
|
||||
detailInfoLine.value = data
|
||||
linetionExit.value = true
|
||||
|
||||
}
|
||||
const closeExitLine = (e)=>{
|
||||
const linetionExit = ref(false);
|
||||
const detailInfoLine = ref({});
|
||||
const leftComponent = ref();
|
||||
const lineDataChange = (data) => {
|
||||
detailInfoLine.value = data;
|
||||
linetionExit.value = true;
|
||||
};
|
||||
const closeExitLine = (e) => {
|
||||
linetionExit.value = false;
|
||||
if(e){
|
||||
let { color,width} = mapdata.setLineStyle[detailInfoLine.value.diameter]
|
||||
leftComponent.value.exitLineMaterial({...detailInfoLine.value,color,width})
|
||||
if (e) {
|
||||
let { color, width } = mapdata.setLineStyle[detailInfoLine.value.diameter];
|
||||
leftComponent.value.exitLineMaterial({
|
||||
...detailInfoLine.value,
|
||||
color,
|
||||
width,
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
//编辑数据核验
|
||||
|
||||
const dataAllExit = ref(false)
|
||||
const detailInfoVerification = ref({})
|
||||
const verificationChange=()=>{
|
||||
verificationQyery({layersId:layerId.value,}).then(res=>{
|
||||
const dataAllExit = ref(false);
|
||||
const detailInfoVerification = ref({});
|
||||
const verificationChange = () => {
|
||||
verificationQyery({ layersId: layerId.value }).then((res) => {
|
||||
dataAllExit.value = true;
|
||||
detailInfoVerification.value=res.data;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
detailInfoVerification.value = res.data;
|
||||
});
|
||||
};
|
||||
|
||||
const findValue = ref<Boolean>(false);
|
||||
const lineValue = ref<Boolean>(false);
|
||||
const loading = ref(false);
|
||||
watch([lineValue, findValue], (val) => {
|
||||
!val[0] && !val[1] && (loading.value = false);
|
||||
});
|
||||
const setFindVal = (e) => {
|
||||
mapdata.getProfilesList().then((res) => {
|
||||
findValue.value = e;
|
||||
sseData.value = [];
|
||||
});
|
||||
};
|
||||
const setLineVal = (e) => {
|
||||
mapdata.getProfilesList().then((res) => {
|
||||
lineValue.value = e;
|
||||
sseData.value = [];
|
||||
});
|
||||
};
|
||||
|
||||
const current = ref("");
|
||||
const handleCurrentChange = (e) => {
|
||||
current.value = e.id;
|
||||
};
|
||||
const profilesDelete = (e) => {
|
||||
mapdata
|
||||
.delProfiles(e.id)
|
||||
.then((res) => {
|
||||
|
||||
mapdata.getProfilesList().then((res) => {});
|
||||
})
|
||||
.catch((e) => {});
|
||||
};
|
||||
|
||||
const priceFlag = ref(false);
|
||||
function findArea(override) {
|
||||
loading.value = true;
|
||||
$ldMap.removeAllLayer();
|
||||
if (override) {
|
||||
mapdata
|
||||
.setMapData(override)
|
||||
.then(() => {
|
||||
setValue();
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
} else {
|
||||
if (current.value) {
|
||||
mapdata.setMapByHistry(current.value).then((res) => {
|
||||
current.value = "";
|
||||
setValue();
|
||||
});
|
||||
} else {
|
||||
loading.value = false;
|
||||
ElMessage({ message: "请先选择存档历史", type: "warning" });
|
||||
}
|
||||
}
|
||||
function setValue() {
|
||||
mapLog.clearExitContent();
|
||||
if (findValue.value) {
|
||||
findValue.value = false;
|
||||
loading.value = false;
|
||||
mapLog.addContent({
|
||||
mapType: "regon", //regon:特征物,line:线
|
||||
actionType: "data", //add,exit,del,
|
||||
isrevoke: false, //是否允许撤回,
|
||||
});
|
||||
$ldMap.addDefaultData(mapdata.road, "Road");
|
||||
$ldMap.addDefaultData(mapdata.house, "House");
|
||||
$ldMap.addDefaultData(mapdata.river, "River");
|
||||
$ldMap.addDeviceData(mapdata.station, "Station");
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
function findLine(override) {
|
||||
loading.value = true;
|
||||
if(override){
|
||||
mapdata
|
||||
.setLineData(override)
|
||||
.then((res) => {
|
||||
if (lineValue.value) {
|
||||
loading.value = false;
|
||||
lineValue.value = false;
|
||||
}
|
||||
setLine()
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
}else{
|
||||
if(current.value){
|
||||
|
||||
mapdata.setHisctoryByline(current.value).then((res) => {
|
||||
current.value=''
|
||||
setLine()
|
||||
}) } else {
|
||||
loading.value = false;
|
||||
ElMessage({ message: "请先选择存档历史", type: "warning" });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function setLine(){
|
||||
mapLog.clearExitContent();
|
||||
if (lineValue.value) {
|
||||
mapLog.addContent({
|
||||
mapType: "line", //regon:特征物,line:线
|
||||
actionType: "data", //add,exit,del,
|
||||
isrevoke: false, //是否允许撤回,
|
||||
});
|
||||
loading.value = false;
|
||||
lineValue.value = false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
//初始化地图
|
||||
|
||||
emitter.on('line',(e)=>{
|
||||
console.log(e)
|
||||
if(e){
|
||||
lineDataChange(e)
|
||||
|
||||
emitter.on("line", (e) => {
|
||||
console.log(e);
|
||||
if (e) {
|
||||
lineDataChange(e);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
:deep(.el-dialog__body){
|
||||
:deep(.el-dialog__body) {
|
||||
padding: 0;
|
||||
}
|
||||
.dialogDeep {
|
||||
|
@ -518,7 +681,11 @@ onMounted(() => {
|
|||
position: fixed;
|
||||
z-index: 1;
|
||||
width: 100vw;
|
||||
background: linear-gradient(to top, rgba(11,38,61,.9), rgba(11,38,61,.9));
|
||||
background: linear-gradient(
|
||||
to top,
|
||||
rgba(11, 38, 61, 0.9),
|
||||
rgba(11, 38, 61, 0.9)
|
||||
);
|
||||
}
|
||||
.left {
|
||||
width: 20%;
|
||||
|
@ -569,8 +736,50 @@ background: linear-gradient(to top, rgba(11,38,61,.9), rgba(11,38,61,.9));
|
|||
color: #fff;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.tableCss {
|
||||
border: 1px solid #fff;
|
||||
width: 100%;
|
||||
height: 210px;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
margin: 5px 0 10px 10px;
|
||||
}
|
||||
.cadCssDialog {
|
||||
width: 80%;
|
||||
}
|
||||
:deep(.ivu-tabs-nav .ivu-tabs-tab) {
|
||||
padding: 8px 5px !important;
|
||||
}
|
||||
:deep(.el-table tr) {
|
||||
background: transparent;
|
||||
color: #fff;
|
||||
}
|
||||
:deep(.el-table) {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background: transparent;
|
||||
height: calc(100vh - 170px);
|
||||
}
|
||||
:deep(.el-table tr):hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.cadCssDialog{
|
||||
width: 80%;
|
||||
:deep(.el-table__body tr.current-row > td.el-table__cell) {
|
||||
background-color: rgba(27, 124, 125, 0.5) !important;
|
||||
}
|
||||
:deep(
|
||||
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell
|
||||
) {
|
||||
background: rgb(184, 224, 250, 0.5) !important;
|
||||
}
|
||||
:deep(.el-table th.el-table__cell) {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
:deep(.el-table__row) {
|
||||
&:hover {
|
||||
background: rgb(184, 224, 250);
|
||||
border: 1px solid #313463;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -5,6 +5,10 @@ import esriConfig from "@arcgis/core/config";
|
|||
import ldMap from './utils/map/init';
|
||||
import ldBox from './utils/map/mapBox';
|
||||
import { download } from './utils/request';
|
||||
|
||||
import directive from '@/directive' // directive
|
||||
|
||||
import router from './router'
|
||||
// 分页组件
|
||||
import Pagination from '@/components/Pagination'
|
||||
import {useDict} from './utils/dict';
|
||||
|
@ -17,6 +21,7 @@ import store from './store'
|
|||
import elementIcons from '@/components/SvgIcon/svgicon'
|
||||
import plugins from '@/plugins' // plugins
|
||||
const app = createApp(App)
|
||||
import './permission'
|
||||
app.component('Pagination', Pagination)
|
||||
// app.config.globalProperties.$ldMap = ldMap
|
||||
// app.config.globalProperties.$ldBox = ldBox
|
||||
|
@ -24,8 +29,10 @@ app.config.globalProperties.useDict = useDict
|
|||
app.config.globalProperties.download = download
|
||||
app.provide('$ldMap', ldMap)
|
||||
app.provide('$ldBox', ldBox)
|
||||
directive(app)
|
||||
app.use(elementIcons)
|
||||
app.use(ElementPlus)
|
||||
app.use(plugins)
|
||||
app.use(router)
|
||||
app.use(store)
|
||||
app.mount('#app')
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
import router from './router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { isHttp } from '@/utils/validate'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import useSettingsStore from '@/store/modules/settings'
|
||||
import usePermissionStore from '@/store/modules/permission'
|
||||
|
||||
NProgress.configure({ showSpinner: false });
|
||||
|
||||
const whiteList = ['/login', '/register'];
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
|
||||
NProgress.start()
|
||||
console.log(getToken())
|
||||
if (getToken()) {
|
||||
to.meta.title && useSettingsStore().setTitle(to.meta.title)
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
} else {
|
||||
if (useUserStore().roles.length === 0) {
|
||||
isRelogin.show = true
|
||||
// 判断当前用户是否已拉取完user_info信息
|
||||
useUserStore().getInfo().then(() => {
|
||||
isRelogin.show = false
|
||||
usePermissionStore().generateRoutes().then(accessRoutes => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
accessRoutes.forEach(route => {
|
||||
if (!isHttp(route.path)) {
|
||||
router.addRoute(route) // 动态添加可访问路由表
|
||||
}
|
||||
})
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
})
|
||||
}).catch(err => {
|
||||
useUserStore().logOut().then(() => {
|
||||
ElMessage.error(err)
|
||||
next({ path: '/' })
|
||||
})
|
||||
})
|
||||
} else {
|
||||
|
||||
next()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 没有token
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 在免登录白名单,直接进入
|
||||
next()
|
||||
} else {
|
||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
NProgress.done()
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
NProgress.done()
|
||||
})
|
|
@ -0,0 +1,25 @@
|
|||
import { createWebHistory, createWebHashHistory,createRouter } from 'vue-router'
|
||||
|
||||
export const constantRoutes = [
|
||||
|
||||
{
|
||||
path: '',
|
||||
component: () => import('./components/index'),
|
||||
hidden: true
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
|
||||
routes: constantRoutes,
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
} else {
|
||||
return { top: 0 }
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
export default router;
|
|
@ -2,18 +2,33 @@
|
|||
import { getToken } from '@/utils/auth'
|
||||
import { ElMessageBox, ElLoading, ElMessage } from 'element-plus'
|
||||
import { EventSourcePolyfill } from 'event-source-polyfill';
|
||||
// import {listProfiles,profilesLoad,profilesDel} from '@map/api/profiles.js'
|
||||
import * as profiles from '@map/api/profiles.js'
|
||||
import {
|
||||
recognitionreload,
|
||||
pipelinereload,
|
||||
pipelineload,
|
||||
sseClose, writeCsv,
|
||||
layersList, recognitionload, recognitionList, recognUpdate
|
||||
layersList, recognitionload, recognitionList,
|
||||
recognUpdate,
|
||||
findSkeleton,
|
||||
pipelineUpdate
|
||||
} from '@map/api/layer.js'
|
||||
|
||||
import { list, add, del } from '@map/api/layerPoint'
|
||||
import home from '@map/assets/qdf.png'
|
||||
import water from '@map/assets/water.png'
|
||||
import device from '@map/assets/device.png'
|
||||
import qdf from "@map/assets/qdf.png"
|
||||
const useMapDataStore = defineStore(
|
||||
'mapData',
|
||||
{
|
||||
state: () => ({
|
||||
profilesList: [],
|
||||
profilesId: '',
|
||||
layerId: '',
|
||||
layerName: '',
|
||||
secen: '',
|
||||
actionList: [], //变更后的特征物数据
|
||||
house: [],
|
||||
road: [],
|
||||
|
@ -21,8 +36,9 @@ const useMapDataStore = defineStore(
|
|||
station: [],
|
||||
lineArray: [],
|
||||
pointArray: [],
|
||||
maxPointIndex: '-1',
|
||||
setLineStyle: {
|
||||
'150': { styleId: '150', width: 1, color: [251, 213, 2, 200], label: '150管径', },
|
||||
'110': { styleId: '110', width: 1, color: [251, 213, 2, 200], label: '110管径', },
|
||||
'200': { styleId: '200', width: 3, color: [144, 238, 145, 200], label: '200管径', },
|
||||
'250': { styleId: '250', width: 3, color: [254, 3, 252, 200], label: '250管径', },
|
||||
'300': { styleId: '300', width: 4, color: [255, 194, 204, 200], label: '300管径', },
|
||||
|
@ -30,10 +46,10 @@ const useMapDataStore = defineStore(
|
|||
'999': { styleId: '999', width: 4, color: [28, 181, 233, 200], label: '其他管径', },
|
||||
},
|
||||
setPointStyle: {
|
||||
'y': { styleId: 'y', size: '10px', color: [223, 131, 2, 255], label: '转接', visible:false,styleVal:'400'},
|
||||
'h': { styleId: 'h', size: '10px', color: [223, 3, 2, 255], label: '房屋', visible:true ,styleVal:'200'},
|
||||
'x': { styleId: 'x', size: '14px', color: [7, 253, 253, 255], label: '井' , visible:true,styleVal:'400'},
|
||||
's': { styleId: 's', size: '18px', color: [8, 240, 36, 255], label: '设备', visible:true,styleVal:'400' },
|
||||
'y': { styleId: 'y', size: '10px', color: [223, 131, 2, 255], label: '转接', visible: false, styleVal: '400', jpg: water, width: 10, height: 10, },
|
||||
'h': { styleId: 'h', size: '10px', color: [223, 3, 2, 255], label: '房屋', visible: true, styleVal: '200', jpg: home, width: 12, height: 12 },
|
||||
'x': { styleId: 'x', size: '14px', color: [7, 253, 253, 255], label: '井', visible: true, styleVal: '400', jpg: water, width: 14, height: 14 },
|
||||
's': { styleId: 's', size: '18px', color: [8, 240, 36, 255], label: '设备', visible: true, styleVal: '400', jpg: device, width: 20, height: 20 },
|
||||
},
|
||||
watertotal: '0',
|
||||
showCheck: false,
|
||||
|
@ -43,9 +59,23 @@ const useMapDataStore = defineStore(
|
|||
clientId: '',
|
||||
}),
|
||||
actions: {
|
||||
getProfilesList(type) {
|
||||
return new Promise((resolve, reject) => {
|
||||
profiles[type ? type : this.secen + 'listProfiles']({ layersId: this.layerId }).then(res => {
|
||||
this.profilesList = res.data
|
||||
resolve()
|
||||
})
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
getMylayerList() {
|
||||
return new Promise((resolve, reject) => {
|
||||
layersList().then(res => {
|
||||
if (res.data.length > 0) {
|
||||
|
||||
this.layerId = res.data[0].id
|
||||
}
|
||||
resolve(res)
|
||||
})
|
||||
|
||||
|
@ -68,9 +98,9 @@ const useMapDataStore = defineStore(
|
|||
return new Promise((resolve, reject) => {
|
||||
if (override) {
|
||||
this.sseConfig('recognition').then(mapData => {
|
||||
|
||||
this.secen = 'recognition'
|
||||
this.profilesId = mapData.Road[0].profilesId
|
||||
this.house = mapData['House'].map(item => {
|
||||
|
||||
let arr = {
|
||||
isExit: item.extend,
|
||||
...item,
|
||||
|
@ -92,11 +122,12 @@ const useMapDataStore = defineStore(
|
|||
} else {
|
||||
recognitionload({ layersId: this.layerId, override }).then(res => {
|
||||
if (res.data) {
|
||||
|
||||
this.secen = 'recognition'
|
||||
let mapData = res.data
|
||||
if (mapData) {
|
||||
this.house = mapData['House'].map(item => {
|
||||
let arr = {
|
||||
isExit: item.extend&&item.extend.houseMaterial&&item.extend.houseFloors,
|
||||
isExit: item.extend && (item.extend.houseMaterial || item.extend.houseFloors),
|
||||
...item,
|
||||
...item.extend
|
||||
}
|
||||
|
@ -108,6 +139,12 @@ const useMapDataStore = defineStore(
|
|||
mapData.Station && (this.station = mapData['Station']);
|
||||
this.actionList = [];
|
||||
resolve()
|
||||
|
||||
} else {
|
||||
ElMessage({ message: '暂无数据,请重新识别', type: 'error' })
|
||||
reject()
|
||||
}
|
||||
|
||||
} else {
|
||||
ElMessage({ message: res.msg, type: 'error' })
|
||||
reject()
|
||||
|
@ -117,6 +154,92 @@ const useMapDataStore = defineStore(
|
|||
}
|
||||
})
|
||||
},
|
||||
getProfileByLoad(id) {
|
||||
return profiles[this.secen + 'profilesLoad'](id)
|
||||
},
|
||||
setMapByHistry(id) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
let res = await this.getProfileByLoad(id)
|
||||
if (res.data) {
|
||||
this.profilesId = id
|
||||
this.secen = 'recognition'
|
||||
let mapData = res.data
|
||||
if (mapData) {
|
||||
this.house = mapData['House'].map(item => {
|
||||
let arr = {
|
||||
isExit: item.extend && (item.extend.houseMaterial || item.extend.houseFloors),
|
||||
...item,
|
||||
...item.extend
|
||||
}
|
||||
delete arr.extend
|
||||
return arr
|
||||
})
|
||||
this.road = mapData['Road'];
|
||||
this.river = mapData['River'];
|
||||
mapData.Station && (this.station = mapData['Station']);
|
||||
this.actionList = [];
|
||||
resolve()
|
||||
|
||||
} else {
|
||||
ElMessage({ message: '暂无数据,请重新识别', type: 'error' })
|
||||
reject()
|
||||
}
|
||||
|
||||
} else {
|
||||
ElMessage({ message: res.msg, type: 'error' })
|
||||
reject()
|
||||
}
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
delProfiles(id) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
if (id == this.profilesId) {
|
||||
ElMessage({ message: '当前档案已加载到页面,不可删除', type: 'warning' })
|
||||
reject()
|
||||
|
||||
} else {
|
||||
ElMessageBox.confirm('是否删除当前项', '提示',
|
||||
{
|
||||
confirmButtonText: '确定', cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
profiles[this.secen + 'profilesDel'](id).then(res => {
|
||||
|
||||
|
||||
if (res.code == 200) {
|
||||
ElMessage({ message: '删除成功', type: 'success' })
|
||||
resolve(id == this.profilesId)
|
||||
} else {
|
||||
ElMessage({ message: res.msg, type: 'error' })
|
||||
reject()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
}).catch(() => {
|
||||
|
||||
reject()
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
//修改特征物数据
|
||||
sethouseData(e) {
|
||||
console.log(e)
|
||||
|
@ -208,6 +331,7 @@ const useMapDataStore = defineStore(
|
|||
return setLineStyle[width]
|
||||
},
|
||||
returnlineData(mapData) {
|
||||
this.secen = 'pipeline'
|
||||
let lineArr = []
|
||||
let pointArr = []
|
||||
this.watertotal = mapData.water
|
||||
|
@ -216,30 +340,31 @@ const useMapDataStore = defineStore(
|
|||
let pointSetArr = {};
|
||||
|
||||
this.lineArray = mapData.pipeline.map(element => {
|
||||
element.path = JSON.parse(element.path)
|
||||
element.path = element.path
|
||||
|
||||
|
||||
let leftId = element.startIndex
|
||||
let rightId = element.endIndex
|
||||
|
||||
if(pointSetArr[leftId]){
|
||||
pointSetArr[leftId].endIndex=element.id
|
||||
}else{
|
||||
pointSetArr[leftId]={
|
||||
pointId:leftId,
|
||||
endIndex:element.id,
|
||||
this.maxPointIndex = Math.max(this.maxPointIndex, leftId, rightId)
|
||||
if (pointSetArr[leftId]) {
|
||||
pointSetArr[leftId].endIndex = element.id
|
||||
} else {
|
||||
pointSetArr[leftId] = {
|
||||
pointId: leftId,
|
||||
endIndex: element.id,
|
||||
point: [element.path[0][0], element.path[0][1]],
|
||||
pointType: element.pointType,
|
||||
...this.setPointStyle[element.pointType]
|
||||
}
|
||||
}
|
||||
|
||||
if(pointSetArr[rightId]){
|
||||
pointSetArr[rightId].startIndex=element.id
|
||||
}else{
|
||||
pointSetArr[rightId]={
|
||||
pointId:rightId,
|
||||
startIndex:element.id,
|
||||
if (pointSetArr[rightId]) {
|
||||
pointSetArr[rightId].startIndex = element.id
|
||||
} else {
|
||||
pointSetArr[rightId] = {
|
||||
pointId: rightId,
|
||||
startIndex: element.id,
|
||||
point: [element.path[1][0], element.path[1][1]],
|
||||
pointType: element.pointType,
|
||||
...this.setPointStyle[element.pointType]
|
||||
|
@ -252,24 +377,27 @@ const useMapDataStore = defineStore(
|
|||
});
|
||||
|
||||
mapData.point.map(point => {
|
||||
point.point = [JSON.parse(point.path)[0][0], JSON.parse(point.path)[0][1]]
|
||||
point.point = [point.path[0][0], point.path[0][1]]
|
||||
console.log(point.startIndex)
|
||||
this.maxPointIndex = Math.max(this.maxPointIndex, point.startIndex)
|
||||
point.pointId = point.startIndex
|
||||
if(!pointSetArr[point.pointId]){
|
||||
pointSetArr[point.pointId]={
|
||||
if (!pointSetArr[point.pointId]) {
|
||||
pointSetArr[point.pointId] = {
|
||||
...point,
|
||||
startIndex:undefined,
|
||||
endIndex:undefined,
|
||||
startIndex: undefined,
|
||||
endIndex: undefined,
|
||||
...this.setPointStyle[point.pointType]
|
||||
}
|
||||
}else{
|
||||
let data = {...pointSetArr[point.point]}
|
||||
pointSetArr[point.pointId]={
|
||||
} else {
|
||||
let data = { ...pointSetArr[point.point] }
|
||||
pointSetArr[point.pointId] = {
|
||||
...data,
|
||||
...point,
|
||||
...this.setPointStyle[point.pointType]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
let setlineArr = new Set();
|
||||
this.pointArray = []
|
||||
lineArr.forEach((item) => {
|
||||
|
@ -281,7 +409,8 @@ const useMapDataStore = defineStore(
|
|||
}
|
||||
});
|
||||
})
|
||||
for(let i in pointSetArr ){
|
||||
console.log(this.maxPointIndex)
|
||||
for (let i in pointSetArr) {
|
||||
this.pointArray.push(pointSetArr[i])
|
||||
}
|
||||
this.checkedLegend = []
|
||||
|
@ -296,11 +425,14 @@ const useMapDataStore = defineStore(
|
|||
},
|
||||
setLineData(override) {
|
||||
let self = this;
|
||||
this.setMaxPointIndex(0)
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
if (override) {
|
||||
|
||||
self.sseConfig('pipeline').then(res => {
|
||||
|
||||
this.profilesId = res.pipeline[0].profilesId
|
||||
self.returnlineData(res)
|
||||
resolve()
|
||||
}).catch(data => {
|
||||
|
@ -325,6 +457,22 @@ const useMapDataStore = defineStore(
|
|||
|
||||
|
||||
|
||||
},
|
||||
setHisctoryByline(id) {
|
||||
|
||||
|
||||
return new Promise(async (resolve, reject) => {
|
||||
|
||||
let res = await this.getProfileByLoad(id)
|
||||
this.profilesId = id
|
||||
if (res.data) {
|
||||
this.returnlineData(res.data)
|
||||
resolve()
|
||||
} else {
|
||||
ElMessage({ message: res.msg, type: 'error' })
|
||||
reject()
|
||||
}
|
||||
})
|
||||
},
|
||||
createcsvFile() {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
@ -347,8 +495,8 @@ const useMapDataStore = defineStore(
|
|||
})
|
||||
} else {
|
||||
data.action = 0
|
||||
data.path = JSON.stringify(data.path)
|
||||
data.innerings = JSON.stringify(data.innerings)
|
||||
data.path = data.path
|
||||
data.innerings = data.innerings
|
||||
this.actionList.push(data)
|
||||
}
|
||||
if (val) {
|
||||
|
@ -382,7 +530,7 @@ const useMapDataStore = defineStore(
|
|||
}
|
||||
return item.action == 1 || item.type == 'Station'
|
||||
})
|
||||
|
||||
let stationData = []
|
||||
if (this.station.length) {
|
||||
let deviceData = this.station[0]
|
||||
if (deviceObj.action == 0) {
|
||||
|
@ -393,46 +541,109 @@ const useMapDataStore = defineStore(
|
|||
deviceData.action = 1
|
||||
|
||||
}
|
||||
this.actionList.push(deviceData)
|
||||
stationData.push(deviceData)
|
||||
} else {
|
||||
if (deviceObj.action != 0) {
|
||||
//新增
|
||||
deviceObj.action = 2
|
||||
this.actionList.push(deviceObj)
|
||||
stationData.push(deviceObj)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
let data = [...newArr, ...this.actionList]
|
||||
|
||||
let data = [...newArr, ...this.actionList, ...stationData]
|
||||
if (data.length > 0) {
|
||||
recognUpdate(data).then(res => {
|
||||
let params = {
|
||||
data,
|
||||
profilesId: this.profilesId
|
||||
}
|
||||
recognUpdate(params).then(res => {
|
||||
ElMessage({ message: res.msg, type: 'success' })
|
||||
|
||||
this.actionList = [];
|
||||
this.station = []
|
||||
this.setMapData(0).then(res => {
|
||||
|
||||
this.profilesId = res.data
|
||||
this.setMapByHistry(this.profilesId).then(res => {
|
||||
resolve()
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
ElMessage({ message: '请先编辑特侦物', type: 'warning' })
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
setMaxPointIndex(val) {
|
||||
if (val) {
|
||||
this.maxPointIndex += val
|
||||
} else {
|
||||
this.maxPointIndex = -1
|
||||
}
|
||||
return this.maxPointIndex
|
||||
},
|
||||
addPngStyle(point) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let { x, y } = point
|
||||
let params = {
|
||||
"type": "1",
|
||||
"point": [x, y],
|
||||
"profilesId": this.profilesId
|
||||
}
|
||||
add(params).then(res => {
|
||||
resolve(res.data)
|
||||
})
|
||||
})
|
||||
},
|
||||
delPngTyle(id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
del(id).then(res => {
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
},
|
||||
getSetpointStyle() {
|
||||
return new Promise((resolve, reject) => {
|
||||
list({ type: '1', profilesId: this.profilesId }).then(res => {
|
||||
resolve({ data: res.data, img: qdf })
|
||||
})
|
||||
})
|
||||
},
|
||||
//更新值
|
||||
addByTypeData(type, data) {
|
||||
data.layersId = this.layerId
|
||||
type = type.toUpperCase().toLowerCase();
|
||||
this[type].push(data)
|
||||
this.actionList.push(this[type][this[type].length - 1])
|
||||
this.actionList.push(data)
|
||||
console.log(this[type][this[type].length - 1])
|
||||
return this[type][this[type].length - 1]
|
||||
},
|
||||
//布线数据保存
|
||||
saveLine(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
data.profilesId = this.profilesId
|
||||
pipelineUpdate(data).then(res => {
|
||||
ElMessage({ message: '保存成功', type: 'success' })
|
||||
this.setHisctoryByline(res.data)
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
},
|
||||
getfindSkeleton() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.profilesId) {
|
||||
findSkeleton(this.profilesId).then(res => {
|
||||
if (res.data) {
|
||||
resolve(res)
|
||||
} else {
|
||||
reject()
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
ElMessage({ message: '请先选择特征物数据', type: 'warning' })
|
||||
reject()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
import { defineStore } from "pinia";
|
||||
import moment from "moment";
|
||||
const useMapLog = defineStore('mapLog',{
|
||||
state: ()=>({
|
||||
exitContent:[
|
||||
|
||||
]
|
||||
}),
|
||||
actions: {
|
||||
addContent(data){
|
||||
console.log(moment().format("HH : mm"))
|
||||
let val = {
|
||||
mapType:'',//regon:特征物,line:线
|
||||
actionType:'',//add,exit,del,
|
||||
isrevoke:false,//是否允许撤回,
|
||||
oldGeometry:[],
|
||||
oldAttributes:[],
|
||||
tips:'',
|
||||
id:'',
|
||||
time:'',
|
||||
...data
|
||||
}
|
||||
val.oldGeometry = val.oldGeometry.map(item=>{
|
||||
return JSON.stringify(item)
|
||||
})
|
||||
val.oldAttributes = val.oldAttributes.map(item=>{
|
||||
return JSON.stringify(item)
|
||||
})
|
||||
val.time = moment().format("HH : mm")
|
||||
this.exitContent.push(val)
|
||||
},
|
||||
revokeContent(index){
|
||||
this.exitContent.splice(index,1)
|
||||
},
|
||||
clearExitContent(){
|
||||
this.exitContent = []
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
)
|
||||
export default useMapLog
|
|
@ -0,0 +1,55 @@
|
|||
import { getInfo } from '@/api/login'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import defAva from '@/assets/images/profile.jpg'
|
||||
|
||||
const useUserStore = defineStore(
|
||||
'user',
|
||||
{
|
||||
state: () => ({
|
||||
token: getToken(),
|
||||
name: '',
|
||||
avatar: '',
|
||||
roles: [],
|
||||
permissions: []
|
||||
}),
|
||||
actions: {
|
||||
|
||||
// 获取用户信息
|
||||
getInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo().then(res => {
|
||||
const user = res.data.user
|
||||
const avatar = (user.avatar == "" || user.avatar == null) ? defAva : user.avatar;
|
||||
|
||||
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.data.roles
|
||||
this.permissions = res.data.permissions
|
||||
} else {
|
||||
this.roles = ['ROLE_DEFAULT']
|
||||
}
|
||||
this.name = user.userName
|
||||
this.avatar = avatar;
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// // 退出系统
|
||||
// logOut() {
|
||||
// return new Promise((resolve, reject) => {
|
||||
// logout(this.token).then(() => {
|
||||
// this.token = ''
|
||||
// this.roles = []
|
||||
// this.permissions = []
|
||||
// removeToken()
|
||||
// resolve()
|
||||
// }).catch(error => {
|
||||
// reject(error)
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
}
|
||||
})
|
||||
|
||||
export default useUserStore
|
|
@ -0,0 +1,106 @@
|
|||
import ldMap from "./init";
|
||||
import Draw from "@arcgis/core/views/draw/Draw.js";
|
||||
import Graphic from "@arcgis/core/Graphic.js";
|
||||
import * as geometryEngine from "@arcgis/core/geometry/geometryEngine.js";
|
||||
import useMapDataStore from "@map/store/modules/mapData"
|
||||
|
||||
let selectGraphic
|
||||
function cut(){
|
||||
if(ldMap.sketchLayer.selectGraphic){
|
||||
selectGraphic = ldMap.sketchLayer.selectGraphic
|
||||
startDrawLine()
|
||||
|
||||
return {flag:true,data:''}
|
||||
}else{
|
||||
return {flag:false,data:''}
|
||||
}
|
||||
}
|
||||
function destroyDraw(){
|
||||
let mapdata = useMapDataStore()
|
||||
let polyline = ldMap.view.graphics.items[0].geometry
|
||||
let boundaryPolygon = selectGraphic.geometry
|
||||
|
||||
const geometries = geometryEngine.cut(boundaryPolygon, polyline);
|
||||
geometries.forEach(polygon=>{
|
||||
let id = selectGraphic.attributes.type + ':' + Date.now()+Math.floor(Math.random() * (1000 - 1) + 0);
|
||||
console.log(id)
|
||||
let val = {
|
||||
geometryId: id,
|
||||
action: 2,
|
||||
"innerings":polygon.rings.length?polygon.rings.slice(1):[],
|
||||
"extend": null,
|
||||
type: selectGraphic.attributes.type,
|
||||
path: polygon.rings[0],
|
||||
}
|
||||
let data = mapdata.addByTypeData(selectGraphic.attributes.type, val)
|
||||
|
||||
const newPolygonGraphic = new Graphic({
|
||||
id,
|
||||
geometry: polygon,
|
||||
symbol: selectGraphic.symbol,
|
||||
attributes: {
|
||||
...selectGraphic.attributes,
|
||||
data
|
||||
}
|
||||
});
|
||||
ldMap.sketchLayer.polygonLayer.add(newPolygonGraphic)
|
||||
|
||||
})
|
||||
|
||||
ldMap.sketchLayer.polygonLayer.remove(selectGraphic);
|
||||
mapdata.delData(selectGraphic.attributes.data)
|
||||
ldMap.view.graphics.removeAll();
|
||||
ldMap.sketchLayer.polygonLayer.sublayers.items.forEach(item=>{
|
||||
item.visible=true
|
||||
})
|
||||
}
|
||||
function startDrawLine(){
|
||||
ldMap.sketchLayer.polygonLayer.sublayers.items.forEach(item=>{
|
||||
if(item!=selectGraphic){
|
||||
item.visible=false
|
||||
}
|
||||
})
|
||||
ldMap.draw = new Draw({
|
||||
view: ldMap.view,
|
||||
})
|
||||
let action = ldMap.draw.create("polyline", {
|
||||
mode: 'click'
|
||||
});
|
||||
action.on("vertex-add", (event) => creatLineByClick(event));
|
||||
|
||||
// 鼠标移动事件
|
||||
action.on("cursor-update", (event) => creatLineByClick(event));
|
||||
|
||||
// 绘制完成事件
|
||||
action.on("draw-complete", (e) => {
|
||||
destroyDraw()
|
||||
});
|
||||
|
||||
}
|
||||
function creatLineByClick(event){
|
||||
ldMap.view.graphics.removeAll();
|
||||
var vertices = event.vertices;
|
||||
|
||||
|
||||
|
||||
let polyline = {
|
||||
type: "polyline", // autocasts as new Polyline()
|
||||
paths: vertices,
|
||||
spatialReference: ldMap.view.spatialReference
|
||||
}
|
||||
|
||||
let graphic = new Graphic({
|
||||
geometry: polyline,
|
||||
symbol: {
|
||||
type: "simple-line", // autocasts as new SimpleFillSymbol
|
||||
color: [0, 206, 209],
|
||||
width: 3,
|
||||
cap: "round",
|
||||
join: "round"
|
||||
}
|
||||
})
|
||||
ldMap.view.graphics.add(graphic)
|
||||
|
||||
}
|
||||
|
||||
export default cut
|
|
@ -0,0 +1,91 @@
|
|||
import ldMap from "./init";
|
||||
import Polyline from "@arcgis/core/geometry/Polyline.js";
|
||||
|
||||
import * as geometryEngine from "@arcgis/core/geometry/geometryEngine.js";
|
||||
|
||||
|
||||
function exporGis(){
|
||||
|
||||
|
||||
let alllayer =ldMap.sketchLayer.polygonLayer.graphics.items
|
||||
let textLayer = ldMap.textLayer.graphics.items
|
||||
;let geojson = {
|
||||
type: "FeatureCollection",
|
||||
features: [],
|
||||
textLayer: []
|
||||
};
|
||||
|
||||
|
||||
alllayer.forEach(function(graphic) {
|
||||
let geometry = graphic.geometry;
|
||||
let attributes = graphic.attributes;
|
||||
|
||||
var geojsonGeometry;
|
||||
|
||||
switch(geometry.type) {
|
||||
case "polygon":
|
||||
let rings = []
|
||||
geometry.rings.forEach(item => {
|
||||
let ringsVal = []
|
||||
item.forEach(val=>{
|
||||
ringsVal.push( getCenterDistance(val))
|
||||
})
|
||||
rings.push(ringsVal)
|
||||
})
|
||||
|
||||
|
||||
geojsonGeometry = {
|
||||
type: "Polygon",
|
||||
coordinates:rings
|
||||
};
|
||||
break;
|
||||
|
||||
//其他几何类型
|
||||
}
|
||||
geojson.features.push({
|
||||
type: "Feature",
|
||||
geometry: geojsonGeometry,
|
||||
type:attributes.type
|
||||
});
|
||||
|
||||
});
|
||||
textLayer.forEach(item=>{
|
||||
let arr={
|
||||
coordinates: getCenterDistance([item.geometry.x,item.geometry.y]),
|
||||
text: item.symbol.text
|
||||
}
|
||||
geojson.textLayer.push(arr)
|
||||
})
|
||||
|
||||
|
||||
console.log(JSON.stringify(geojson))
|
||||
|
||||
}
|
||||
function getCenterDistance(p2){
|
||||
|
||||
let p1 = []
|
||||
let px,py,polyline;
|
||||
|
||||
let layer = ldMap.map.layers.items
|
||||
layer.forEach(item=>{
|
||||
if(item.url){
|
||||
p1=[item.fullExtent.center.x,item.fullExtent.center.y]
|
||||
}
|
||||
})
|
||||
|
||||
polyline = new Polyline({
|
||||
paths: [p1, [p1[0], p2[1]]],
|
||||
})
|
||||
py = geometryEngine.geodesicLength(polyline, "meters");
|
||||
if(p1[1]>p2[1]) py = -py
|
||||
|
||||
polyline = new Polyline({
|
||||
paths: [p1, [p2[0], p1[1]]],
|
||||
})
|
||||
|
||||
px = geometryEngine.geodesicLength(polyline, "meters");
|
||||
if(p1[0]>p2[0]) px = -px
|
||||
console.log([ px, py ])
|
||||
return [ px, py ]
|
||||
}
|
||||
export default exporGis
|
|
@ -62,7 +62,6 @@ const ldBox = {
|
|||
})
|
||||
},
|
||||
addLayer(data){
|
||||
debugger
|
||||
let self = this;
|
||||
let laryerId = data.id.toString();
|
||||
if(self.Map.getLayer(laryerId)){
|
||||
|
|
|
@ -137,7 +137,7 @@ service.interceptors.response.use(res => {
|
|||
)
|
||||
|
||||
// 通用下载方法
|
||||
export function download(url, params, filename, config) {
|
||||
export function download(url, params, filename, config,isSave) {
|
||||
|
||||
downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)", })
|
||||
return service.post(url, params, {
|
||||
|
@ -146,12 +146,18 @@ export function download(url, params, filename, config) {
|
|||
responseType: 'blob',
|
||||
...config
|
||||
}).then(async (data) => {
|
||||
|
||||
downloadLoadingInstance.close();
|
||||
|
||||
const isBlob = blobValidate(data);
|
||||
if (isBlob) {
|
||||
if(isSave){
|
||||
const blob = new Blob([data])
|
||||
saveAs(blob, filename)
|
||||
}else if (isBlob) {
|
||||
const blob = new Blob([data])
|
||||
const URL = window.URL;
|
||||
return Promise.resolve( URL.createObjectURL(blob))
|
||||
|
||||
} else {
|
||||
const resText = await data.text();
|
||||
const rspObj = JSON.parse(resText);
|
||||
|
|
|
@ -39,7 +39,7 @@ export default defineConfig(({ mode, command }) => {
|
|||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
'/dev-api': {
|
||||
target: 'http://139.224.252.239:8080/',
|
||||
target: 'http://119.3.156.115:8080/',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, '')
|
||||
},
|
||||
|
@ -53,6 +53,16 @@ export default defineConfig(({ mode, command }) => {
|
|||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/water-api/, '')
|
||||
},
|
||||
'/plan-api': {
|
||||
target: 'http://water.lidinghb.com:9070/',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/plan-api/, '')
|
||||
},
|
||||
'/afterSales-api': {
|
||||
target: 'http://119.3.156.115:9050/',
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/afterSales-api/, '')
|
||||
},
|
||||
}
|
||||
},
|
||||
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
|
||||
|
@ -73,13 +83,53 @@ export default defineConfig(({ mode, command }) => {
|
|||
}
|
||||
},
|
||||
build:{
|
||||
minify:'terser',
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true
|
||||
}
|
||||
},
|
||||
rollupOptions:{
|
||||
input:{
|
||||
index:'./index.html',
|
||||
admin:'./admin.html',
|
||||
ldmap:'./ldmap.html',
|
||||
},
|
||||
output:{
|
||||
manualChunks(id){
|
||||
if(id.includes('node_modules')){
|
||||
if(id.includes('excel')){
|
||||
return 'excel'
|
||||
}
|
||||
if(id.includes('mapbox')){
|
||||
return 'mapbox'
|
||||
}
|
||||
if(id.includes('mxdraw')){
|
||||
return 'mxdraw'
|
||||
}
|
||||
if(id.includes('three')){
|
||||
return 'three'
|
||||
}
|
||||
if(id.includes('echarts')){
|
||||
return 'echarts'
|
||||
}
|
||||
if(id.includes('moment')){
|
||||
return 'moment'
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
//关闭文件计算
|
||||
reportCompressedSize:false,
|
||||
//关闭生成map文件 减小打包体积
|
||||
sourcemap:false,
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|