Browse Source

修复:黄家明项目已知bug

dev
科技小王子 2 months ago
parent
commit
061a7a2812
  1. 4
      .env.development
  2. 4
      src/api/hjm/hjmCar/model/index.ts
  3. 18
      src/components/SelectFence/components/select-data.vue
  4. 1
      src/views/hjm/hjmBxLog/components/hjmBxLogEdit.vue
  5. 46
      src/views/hjm/hjmCar/components/hjmCarEdit.vue
  6. 23
      src/views/hjm/hjmCar/index.vue
  7. 1
      src/views/hjm/hjmFence/components/hjmFenceEdit.vue
  8. 10
      src/views/hjm/staff/components/org-user-search.vue
  9. 225
      src/views/hjm/staff/index.vue
  10. 97
      src/views/hjm/userVerify/index.vue
  11. 97
      src/views/hjm/userVerify2/index.vue

4
.env.development

@ -1,10 +1,10 @@
VITE_APP_NAME=后台管理系统
VITE_SOCKET_URL=wss://server.gxwebsoft.com
VITE_SERVER_URL=https://server.gxwebsoft.com/api
#VITE_API_URL=https://cms-api.websoft.top/api
VITE_API_URL=https://cms-api.websoft.top/api
#VITE_SOCKET_URL=ws://127.0.0.1:9191
#VITE_SERVER_URL=http://127.0.0.1:8000/api
VITE_API_URL=http://127.0.0.1:9000/api
#VITE_API_URL=http://127.0.0.1:9000/api
#/booking/bookingItem

4
src/api/hjm/hjmCar/model/index.ts

@ -33,6 +33,8 @@ export interface HjmCar {
fenceId?: number;
// 电子围栏名称
fenceName?: string;
// 车辆是否在电子围栏内
inFence?: boolean;
// 电子围栏名称
fence?: HjmFence;
// 位置
@ -51,6 +53,8 @@ export interface HjmCar {
organizationParentId?: number;
// 用户ID
userId?: number;
// 绑定用户
toUser?: string;
// 排序(数字越小越靠前)
sortNumber?: number;
// 备注

18
src/components/SelectFence/components/select-data.vue

@ -98,15 +98,15 @@
title: '围栏名称',
dataIndex: 'name'
},
{
title: '经纬度',
dataIndex: 'location',
key: 'location'
},
{
title: '半径',
dataIndex: 'district'
},
// {
// title: '',
// dataIndex: 'location',
// key: 'location'
// },
// {
// title: '',
// dataIndex: 'district'
// },
{
title: '操作',
key: 'action',

1
src/views/hjm/hjmBxLog/components/hjmBxLogEdit.vue

@ -30,7 +30,6 @@
name="image">
<SelectFile
:placeholder="`请选择图片`"
:limit="1"
:data="images"
@done="chooseImage"
@del="onDeleteItem"

46
src/views/hjm/hjmCar/components/hjmCarEdit.vue

@ -21,10 +21,10 @@
>
<a-form-item
label="车辆图片"
name="image">
name="image" v-if="isUpdate">
<SelectFile
:placeholder="`请选择图片`"
:limit="1"
:limit="5"
:data="images"
@done="chooseImage"
@del="onDeleteItem"
@ -82,6 +82,13 @@
{{ form.driver }} {{ form.driverPhone }}
<!-- <a-select placeholder="选择绑定的操作员" :options="users" v-model:value="form.driver" @change="chooseDriverId" />-->
</a-form-item>
<a-form-item label="接收提醒" name="toUser">
<a-input
allow-clear
placeholder="请输入openId"
v-model:value="form.toUser"
/>
</a-form-item>
<a-form-item label="排序" name="sortNumber">
<a-input-number
:min="0"
@ -199,6 +206,7 @@ const form = reactive<HjmCar>({
organizationId: undefined,
organizationParentId: undefined,
userId: undefined,
toUser: undefined,
comments: undefined,
status: 0,
deleted: undefined,
@ -230,6 +238,14 @@ const rules = reactive({
trigger: 'blur'
}
],
fenceName: [
{
required: true,
type: 'string',
message: '请选择电子围栏',
trigger: 'blur'
}
],
insuranceStatus: [
{
required: true,
@ -315,23 +331,16 @@ const getUsers = () => {
})
}
const chooseDriverId = (index: number,item: User) => {
form.driver = item.realName;
form.driverId = item.userId;
}
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
form.image = data.path;
};
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
form.image = '';
};
const {resetFields} = useForm(form, rules);
@ -346,7 +355,8 @@ const save = () => {
.then(() => {
loading.value = true;
const formData = {
...form
...form,
image: JSON.stringify(images.value),
};
const saveOrUpdate = isUpdate.value ? updateHjmCar : addHjmCar;
saveOrUpdate(formData)
@ -392,19 +402,19 @@ watch(
if (props.data) {
assignObject(form, props.data);
if (props.data.image) {
images.value.push({
uid: uuid(),
url: props.data.image,
status: 'done'
})
const arr = JSON.parse(props.data.image);
arr.map((item) => {
images.value.push({
uid: uuid(),
url: item.url,
status: 'done'
});
});
}
if(props.data.organizationParentId){
organizationId.value = props.data.organizationParentId;
getUsers()
}
if(props.data.insuranceStatus == 1){
form.insuranceStatus = 1;
}
isUpdate.value = true;
} else {
isUpdate.value = false;

23
src/views/hjm/hjmCar/index.vue

@ -36,6 +36,11 @@
<a-tag v-if="record.insuranceStatus === '在保'">在保</a-tag>
<a-tag v-if="record.insuranceStatus === '过保'">过保</a-tag>
</template>
<template v-if="column.key === 'inFence'">
<a-tag v-if="record.inFence" color="green">围栏内</a-tag>
<a-tag v-else color="red">围栏外</a-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 1" color="green">已安装</a-tag>
<a-tag v-if="record.status === 0" color="red">未安装</a-tag>
@ -178,17 +183,17 @@ const columns = ref<ColumnItem[]>([
align: 'center',
},
{
title: '车辆图片',
dataIndex: 'image',
key: 'image',
title: '围栏名称',
dataIndex: 'fenceName',
key: 'fenceName',
align: 'center',
},
// {
// title: '',
// dataIndex: 'fence',
// key: 'fence',
// align: 'center',
// },
{
title: '是否围栏内',
dataIndex: 'inFence',
key: 'inFence',
align: 'center'
},
// {
// title: '',
// dataIndex: 'sortNumber',

1
src/views/hjm/hjmFence/components/hjmFenceEdit.vue

@ -120,7 +120,6 @@ import {addHjmFence, updateHjmFence} from '@/api/hjm/hjmFence';
import {HjmFence} from '@/api/hjm/hjmFence/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {AimOutlined} from "@ant-design/icons-vue";
import {CenterPoint} from "ele-admin-pro/es/ele-map-picker/types";
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FormInstance} from 'ant-design-vue/es/form';

10
src/views/hjm/staff/components/org-user-search.vue

@ -1,11 +1,11 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap">
<SelectUser
:placeholder="`添加成员`"
:organizationId="0"
@done="updateOrganizationId"
/>
<!-- <SelectUser-->
<!-- :placeholder="`添加成员`"-->
<!-- :organizationId="0"-->
<!-- @done="updateOrganizationId"-->
<!-- />-->
</a-space>
</template>

225
src/views/hjm/staff/index.vue

@ -1,76 +1,77 @@
<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-split-layout
width="266px"
allow-collapse
:right-style="{ overflow: 'hidden' }"
:style="{ minHeight: 'calc(100vh - 152px)' }"
>
<div>
<ele-toolbar theme="default">
<a-space :size="10">
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
<template #icon>
<plus-outlined/>
</template>
<span>新建</span>
</a-button>
<a-button
type="primary"
:disabled="!current"
class="ele-btn-icon"
@click="openEdit(current)"
>
<template #icon>
<edit-outlined/>
</template>
<span>修改</span>
</a-button>
<a-button
danger
type="primary"
:disabled="!current"
class="ele-btn-icon"
@click="remove"
>
<template #icon>
<delete-outlined/>
</template>
<span>删除</span>
</a-button>
</a-space>
</ele-toolbar>
<div class="ele-border-split sys-organization-list">
<a-tree
:tree-data="(data as any)"
:show-line="true"
v-model:expanded-keys="expandedRowKeys"
v-model:selected-keys="selectedRowKeys"
@select="onTreeSelect"
/>
</div>
</div>
<template #content>
<org-user-list
:organization-list="data"
:organization-id="current?.organizationId"
@done="query"
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-split-layout
width="266px"
allow-collapse
:right-style="{ overflow: 'hidden' }"
:style="{ minHeight: 'calc(100vh - 152px)' }"
>
<div>
<ele-toolbar theme="default">
<a-space :size="10">
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
<template #icon>
<plus-outlined/>
</template>
<span>新建</span>
</a-button>
<a-button
type="primary"
:disabled="!current"
class="ele-btn-icon"
@click="openEdit(current)"
>
<template #icon>
<edit-outlined/>
</template>
<span>修改</span>
</a-button>
<a-button
danger
type="primary"
:disabled="!current"
class="ele-btn-icon"
@click="remove"
>
<template #icon>
<delete-outlined/>
</template>
<span>删除</span>
</a-button>
</a-space>
</ele-toolbar>
<div class="ele-border-split sys-organization-list">
<a-tree
:tree-data="(data as any)"
:show-line="true"
v-model:expanded-keys="expandedRowKeys"
v-model:selected-keys="selectedRowKeys"
@select="onTreeSelect"
/>
</template>
</ele-split-layout>
</a-card>
<!-- 编辑弹窗 -->
<org-edit
v-model:visible="showEdit"
:data="editData"
:organization-list="data"
:organization-id="current?.organizationId"
@done="query"
/>
</div>
</div>
</div>
</div>
<template #content>
<org-user-list
:organization-list="data"
:organization-id="current?.organizationId"
@done="query"
/>
</template>
</ele-split-layout>
</a-card>
<!-- 编辑弹窗 -->
<org-edit
v-model:visible="showEdit"
:data="editData"
:organization-list="data"
:organization-id="current?.organizationId"
@done="query"
/>
</a-page-header>
</template>
<script lang="ts" setup>
@ -90,6 +91,8 @@ import {
removeOrganization
} from '@/api/system/organization';
import type {Organization} from '@/api/system/organization/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/system/user/components/Extra.vue";
//
const loading = ref(true);
@ -116,39 +119,39 @@ const editData = ref<Organization | null>(null);
const query = () => {
loading.value = true;
listOrganizations()
.then((list) => {
loading.value = false;
const eks: number[] = [];
list.forEach((d, i) => {
d.title = d.organizationName + `[${d.organizationId}]`;
d.key = d.organizationId;
d.value = d.organizationId;
if (typeof d.key === 'number') {
eks.push(d.key);
}
});
expandedRowKeys.value = eks;
data.value = toTreeData({
data: list,
idField: 'organizationId',
parentIdField: 'parentId'
});
if (list.length) {
// if (typeof list[0].key === 'number') {
// selectedRowKeys.value = [list[0].key];
// }
// current.value = list[0];
// current.value.organizationId = 0;
} else {
selectedRowKeys.value = [];
current.value = null;
.then((list) => {
loading.value = false;
const eks: number[] = [];
list.forEach((d, i) => {
d.title = d.organizationName + `[${d.organizationId}]`;
d.key = d.organizationId;
d.value = d.organizationId;
if (typeof d.key === 'number') {
eks.push(d.key);
}
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
expandedRowKeys.value = eks;
data.value = toTreeData({
data: list,
idField: 'organizationId',
parentIdField: 'parentId'
});
if (list.length) {
// if (typeof list[0].key === 'number') {
// selectedRowKeys.value = [list[0].key];
// }
// current.value = list[0];
// current.value.organizationId = 0;
} else {
selectedRowKeys.value = [];
current.value = null;
}
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
};
/* 选择数据 */
@ -177,15 +180,15 @@ const remove = () => {
onOk: () => {
const hide = messageLoading('请求中..', 0);
removeOrganization(current.value?.organizationId)
.then((msg) => {
hide();
message.success(msg);
query();
})
.catch((e) => {
hide();
message.error(e.message);
});
.then((msg) => {
hide();
message.success(msg);
query();
})
.catch((e) => {
hide();
message.error(e.message);
});
}
});
};

97
src/views/hjm/userVerify/index.vue

@ -1,55 +1,56 @@
<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">待审核</a-tag>
<a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="red">已驳回</a-tag>
<div class="text-orange-500 py-1" v-if="record.status == 2">原因{{ record.comments }}</div>
</template>
<template v-if="column.key === 'action'">
<div>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</div>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">待审核</a-tag>
<a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="red">已驳回</a-tag>
<div class="text-orange-500 py-1" v-if="record.status == 2">原因{{ record.comments }}</div>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<div>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</div>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</div>
</div>
<!-- 编辑弹窗 -->
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>

97
src/views/hjm/userVerify2/index.vue

@ -1,55 +1,56 @@
<template>
<div class="page">
<div class="ele-body">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<template #extra>
<Extra/>
</template>
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
row-key="id"
:columns="columns"
:datasource="datasource"
:customRow="customRow"
tool-class="ele-toolbar-form"
class="sys-org-table"
>
<template #toolbar>
<search
@search="reload"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">待审核</a-tag>
<a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="red">已驳回</a-tag>
<div class="text-orange-500 py-1" v-if="record.status == 2">原因{{ record.comments }}</div>
</template>
<template v-if="column.key === 'action'">
<div>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</div>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="orange">待审核</a-tag>
<a-tag v-if="record.status === 1" color="green">审核通过</a-tag>
<a-tag v-if="record.status === 2" color="red">已驳回</a-tag>
<div class="text-orange-500 py-1" v-if="record.status == 2">原因{{ record.comments }}</div>
</template>
</ele-pro-table>
</a-card>
<template v-if="column.key === 'action'">
<div>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
>
<a class="ele-text-danger">删除</a>
</a-popconfirm>
</div>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</div>
</div>
<!-- 编辑弹窗 -->
<UserVerifyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>

Loading…
Cancel
Save