Browse Source

修复:文章内容不能同步更新到时的排序保存异常。

dev
科技小王子 2 months ago
parent
commit
e3b275304d
  1. 4
      .env.development
  2. 1
      .gitignore
  3. 7
      src/api/hjm/hjmCar/model/index.ts
  4. 1
      src/api/hjm/hjmGpsLog/model/index.ts
  5. 2
      src/api/system/user/model/index.ts
  6. 1
      src/api/system/userRole/model/index.ts
  7. 16
      src/views/cms/cmsArticle/components/articleEdit.vue
  8. 13
      src/views/cms/cmsArticle/index.vue
  9. 306
      src/views/hjm/count/components/hjmFenceEdit.vue
  10. 42
      src/views/hjm/count/components/search.vue
  11. 150
      src/views/hjm/count/index.vue
  12. 45
      src/views/hjm/hjmCar/components/Extra.vue
  13. 211
      src/views/hjm/hjmCar/components/hjmCarEdit.vue
  14. 180
      src/views/hjm/hjmCar/components/search.vue
  15. 35
      src/views/hjm/hjmCar/index.vue
  16. 4
      src/views/hjm/hjmFence/index.vue
  17. 33
      src/views/hjm/hjmGpsLog/components/search.vue
  18. 186
      src/views/hjm/hjmGpsLog/index.vue
  19. 2
      src/views/hjm/staff/index.vue
  20. 55
      src/views/hjm/userVerify/components/Extra.vue
  21. 2
      src/views/hjm/userVerify/index.vue
  22. 4
      src/views/system/userVerify/components/search.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

1
.gitignore

@ -25,3 +25,4 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?
node_modules

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

@ -27,6 +27,10 @@ export interface HjmCar {
driverName?: string;
// 操作员手机号
driverPhone?: string;
// 安装人员
installerId?: number;
// 安装时间
installTime?: string;
// 保险状态
insuranceStatus?: string;
// GPS设备编号
@ -57,6 +61,8 @@ export interface HjmCar {
userId?: number;
// 认领状态
claim?: number;
// 认领时间
claimTime?: string;
// 绑定用户
toUser?: string;
// 排序(数字越小越靠前)
@ -80,6 +86,7 @@ export interface HjmCarParam extends PageParam {
id?: number;
status?: number;
organizationId?: number;
installerId?: number;
organizationParentId?: number;
keywords?: string;
}

1
src/api/hjm/hjmGpsLog/model/index.ts

@ -29,5 +29,6 @@ export interface HjmGpsLog {
*/
export interface HjmGpsLogParam extends PageParam {
id?: number;
gpsNo?: string;
keywords?: string;
}

2
src/api/system/user/model/index.ts

@ -125,6 +125,8 @@ export interface User {
installed?: boolean;
label?: string;
value?: number;
// 关注数量
followers?: number;
}
/**

1
src/api/system/userRole/model/index.ts

@ -26,4 +26,5 @@ export interface UserRoleParam extends PageParam {
keywords?: any;
roleId?: number;
userId?: number;
userIds?: any;
}

16
src/views/cms/cmsArticle/components/articleEdit.vue

@ -214,11 +214,7 @@
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, htmlToText, uuid } from 'ele-admin-pro';
import {
addCmsArticle,
getCmsArticle,
updateCmsArticle
} from '@/api/cms/cmsArticle';
import { addCmsArticle, updateCmsArticle } from '@/api/cms/cmsArticle';
import { CmsArticle } from '@/api/cms/cmsArticle/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
@ -321,7 +317,7 @@
files: '',
lang: locale.value || undefined,
//
sortNumber: 100,
sortNumber: undefined,
//
comments: undefined,
//
@ -478,6 +474,10 @@
if (!formRef.value) {
return;
}
if (content.value == '') {
message.error('请输入文章内容');
return;
}
formRef.value
.validate()
.then(() => {
@ -529,13 +529,12 @@
content.value = '';
if (props.data) {
loading.value = true;
const data = props.data;
//
getCmsArticle(Number(props.data?.articleId)).then((data) => {
assignObject(form, data);
if (data.content) {
content.value = data.content;
}
if (data.image) {
images.value.push({
uid: uuid(),
@ -565,7 +564,6 @@
});
}
loading.value = false;
});
// assignObject(form, props.data);
//

13
src/views/cms/cmsArticle/index.vue

@ -133,7 +133,7 @@ import {
pageCmsArticle,
removeCmsArticle,
removeBatchCmsArticle,
updateCmsArticle
updateCmsArticle, getCmsArticle
} from '@/api/cms/cmsArticle';
import type {CmsArticle, CmsArticleParam} from '@/api/cms/cmsArticle/model';
import {formatNumber} from 'ele-admin-pro/es';
@ -142,8 +142,7 @@ import {toTreeData} from 'ele-admin-pro';
import {toDateString} from 'ele-admin-pro';
import {
detail,
getPageTitle,
navTo
getPageTitle
} from '@/utils/common';
import {listCmsNavigation} from '@/api/cms/cmsNavigation';
import {CmsNavigation} from '@/api/cms/cmsNavigation/model';
@ -293,8 +292,11 @@ const reload = (where?: CmsArticleParam) => {
};
/* 打开编辑弹窗 */
const openEdit = (row?: CmsArticle) => {
const openEdit = async (row?: CmsArticle) => {
current.value = row ?? null;
if(row?.articleId){
current.value = await getCmsArticle(row?.articleId);
}
showEdit.value = true;
};
@ -408,8 +410,7 @@ if (!navigationList.value) {
if (
d.model == 'index' ||
d.model == 'page' ||
d.model == 'order' ||
d.model == 'links'
d.model == 'order'
) {
d.disabled = true;
}

306
src/views/hjm/count/components/hjmFenceEdit.vue

@ -0,0 +1,306 @@
<!-- 编辑弹窗 -->
<template>
<ele-modal
:width="800"
:visible="visible"
:maskClosable="false"
:maxable="maxable"
:title="isUpdate ? '编辑电子围栏' : '添加电子围栏'"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
@ok="save"
>
<a-form
ref="formRef"
:model="form"
:rules="rules"
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
:wrapper-col="
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item label="围栏名称" name="name">
<a-input
allow-clear
placeholder="请输入围栏名称"
v-model:value="form.name"
/>
</a-form-item>
<!-- <a-form-item label="类型" name="type">-->
<!-- <a-radio-group v-model:value="form.type">-->
<!-- <a-radio :value="0">圆形</a-radio>-->
<!-- <a-radio :value="1">方形</a-radio>-->
<!-- </a-radio-group>-->
<!-- </a-form-item>-->
<!-- <a-form-item label="经纬度" name="location">-->
<!-- <div class="flex">-->
<!-- <a-input-->
<!-- allow-clear-->
<!-- placeholder="请选取车辆所在位置"-->
<!-- v-model:value="form.location"-->
<!-- >-->
<!-- </a-input>-->
<!-- </div>-->
<!-- </a-form-item>-->
<a-form-item label="轮廓" name="points">
<div class="flex">
<a-input
allow-clear
placeholder="请选取电子围栏的轮廓"
v-model:value="form.points"
>
</a-input>
</div>
<template #extra>
<p class="py-2">
<a class="text-blue-500" href="https://lbs.qq.com/dev/console/cloud/placeCloud/datamanage?table_id=0q3W4MrK1-_6Xag7V1" target="_blank">使用腾讯地图的工具绘制电子围栏</a>
</p>
</template>
</a-form-item>
<!-- <a-form-item label="经度" name="longitude">-->
<!-- <a-input-number-->
<!-- allow-clear-->
<!-- style="width: 120px"-->
<!-- placeholder="请输入经度"-->
<!-- v-model:value="form.longitude"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="纬度" name="latitude">-->
<!-- <a-input-number-->
<!-- allow-clear-->
<!-- style="width: 120px"-->
<!-- placeholder="请输入纬度"-->
<!-- v-model:value="form.latitude"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="半径" name="district">-->
<!-- <a-input-number-->
<!-- allow-clear-->
<!-- style="width: 120px"-->
<!-- placeholder="请输入半径"-->
<!-- v-model:value="form.district"-->
<!-- />-->
<!-- </a-form-item>-->
<!-- <a-form-item label="排序" name="sortNumber">-->
<!-- <a-input-number-->
<!-- :min="0"-->
<!-- :max="9999"-->
<!-- class="ele-fluid"-->
<!-- placeholder="请输入排序号"-->
<!-- v-model:value="form.sortNumber"-->
<!-- />-->
<!-- </a-form-item>-->
<a-form-item label="备注" name="comments">
<a-textarea
:rows="4"
:maxlength="200"
placeholder="请输入描述"
v-model:value="form.comments"
/>
</a-form-item>
</a-form>
<!-- 地图位置选择弹窗 -->
<ele-map-picker
:need-city="true"
:dark-mode="darkMode"
v-model:visible="showMap"
:center="[108.374959, 22.767024]"
:search-type="1"
:zoom="12"
@done="onDone"
/>
</ele-modal>
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject} from 'ele-admin-pro';
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 {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';
//
const isUpdate = ref(false);
const useForm = Form.useForm;
//
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
const {darkMode} = storeToRefs(themeStore);
//
const showMap = ref(false);
const props = defineProps<{
//
visible: boolean;
//
data?: HjmFence | null;
}>();
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
//
const loading = ref(false);
//
const maxable = ref(true);
//
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
//
const form = reactive<HjmFence>({
id: undefined,
name: undefined,
type: undefined,
location: undefined,
longitude: undefined,
latitude: undefined,
district: undefined,
points: undefined,
tenantId: undefined,
createTime: undefined,
updateTime: undefined,
status: 0,
comments: '',
sortNumber: 100
});
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
//
const rules = reactive({
name: [
{
required: true,
type: 'string',
message: '请填写电子围栏名称',
trigger: 'blur'
}
],
type: [
{
required: true,
type: 'number',
message: '请选择类型',
trigger: 'blur'
}
],
location: [
{
required: true,
type: 'string',
message: '请填写经纬度',
trigger: 'blur'
}
],
points: [
{
required: true,
type: 'string',
message: '请填写轮廓经纬度数组',
trigger: 'blur'
}
],
longitude: [
{
required: true,
type: 'string',
message: '请填写经度',
trigger: 'blur'
}
],
latitude: [
{
required: true,
type: 'string',
message: '请填写纬度',
trigger: 'blur'
}
],
district: [
{
required: true,
type: 'string',
message: '请填写半径',
trigger: 'blur'
}
]
});
/* 打开位置选择 */
const openMapPicker = () => {
showMap.value = true;
};
/* 地图选择后回调 */
const onDone = (location: CenterPoint) => {
if (location) {
console.log(location)
form.location = `${location.lat},${location.lng}`;
form.longitude = `${location.lng}`;
form.latitude = `${location.lat}`;
form.comments = `${location.address}`;
form.district = `1000`
}
showMap.value = false;
};
const {resetFields} = useForm(form, rules);
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
formRef.value
.validate()
.then(() => {
loading.value = true;
const formData = {
...form
};
const saveOrUpdate = isUpdate.value ? updateHjmFence : addHjmFence;
saveOrUpdate(formData)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
})
.catch(() => {
});
};
watch(
() => props.visible,
(visible) => {
if (visible) {
images.value = [];
if (props.data) {
assignObject(form, props.data);
isUpdate.value = true;
} else {
isUpdate.value = false;
}
} else {
resetFields();
}
},
{immediate: true}
);
</script>

42
src/views/hjm/count/components/search.vue

@ -0,0 +1,42 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import type { HjmFenceParam } from '@/api/hjm/hjmFence/model';
import { watch } from 'vue';
const props = withDefaults(
defineProps<{
//
selection?: [];
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: HjmFenceParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
//
const add = () => {
emit('add');
};
watch(
() => props.selection,
() => {}
);
</script>

150
src/views/hjm/count/index.vue

@ -0,0 +1,150 @@
<template>
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<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 #bodyCell="{ column, record }">
<template v-if="column.key === 'realName'">
<a-tooltip :title="`点击查询明细`"><a :href="`/website/car?installerId=${record.userId}`" class="cursor-pointer">{{ record.realName }}</a></a-tooltip>
</template>
<template v-if="column.key === 'followers'">
<a-tooltip :title="`点击更新`" class="cursor-pointer" @click="updateRowsByFollowers(record)">
<a-tag color="green">{{ record.followers }}</a-tag>
</a-tooltip>
</template>
</template>
</ele-pro-table>
</a-card>
<!-- 编辑弹窗 -->
<HjmFenceEdit v-model:visible="showEdit" :data="current" @done="reload"/>
</a-page-header>
</template>
<script lang="ts" setup>
import {ref} from 'vue';
import type {EleProTable} from 'ele-admin-pro';
import {message} from 'ant-design-vue';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import HjmFenceEdit from './components/hjmFenceEdit.vue';
import {getPageTitle} from "@/utils/common";
import {pageUsers, updateUser} from "@/api/system/user";
import {User, UserParam} from "@/api/system/user/model";
import {pageHjmCar} from "@/api/hjm/hjmCar";
//
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
//
const selection = ref<User[]>([]);
//
const current = ref<User | null>(null);
//
const showEdit = ref(false);
//
const loading = ref(true);
//
const datasource: DatasourceFunction = ({
page,
limit,
where,
orders
}) => {
where.organizationId = 440;
return pageUsers({
...where,
...orders,
page,
limit
});
};
//
const columns = ref<ColumnItem[]>([
{
title: '用户ID',
dataIndex: 'userId',
key: 'userId',
width: 90
},
{
title: '姓名',
dataIndex: 'realName',
key: 'realName',
width: 180
},
{
title: '安装数量',
dataIndex: 'followers',
key: 'followers',
width: 180
}
]);
/* 搜索 */
const reload = (where?: UserParam) => {
selection.value = [];
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: User) => {
current.value = row ?? null;
showEdit.value = true;
};
const updateRowsByFollowers = (item: User) => {
pageHjmCar({
installerId: item.userId
}).then(res => {
updateUser({
...item,
followers: res?.count
}).then(() => {
reload();
message.success('更新成功');
})
}).catch(() => {
message.error('更新失败');
})
}
/* 查询 */
const query = () => {
loading.value = true;
};
/* 自定义行属性 */
const customRow = (record: User) => {
return {
//
onClick: () => {
// console.log(record);
},
//
onDblclick: () => {
openEdit(record);
}
};
};
query();
</script>
<script lang="ts">
export default {
name: 'HjmCarCount'
};
</script>
<style lang="less" scoped></style>

45
src/views/hjm/hjmCar/components/Extra.vue

@ -1,23 +1,37 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')">
<a-space
style="flex-wrap: wrap"
v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')"
>
<a-button
type="text"
v-if="hasAnyRole(['superAdmin','admin'])"
v-if="hasAnyRole(['superAdmin', 'admin'])"
@click="openUrl('/fence')"
>电子围栏
</a-button
>
</a-button>
<a-button
type="text"
v-if="hasAnyRole(['superAdmin', 'admin'])"
@click="openUrl('/hjm/count')"
>安装车辆统计
</a-button>
<a-button
type="text"
v-if="hasAnyRole(['superAdmin', 'admin'])"
@click="openUrl('/hjm/gps-log')"
>gps定位
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import {watch, nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {hasAnyRole, hasRole} from "@/utils/permission";
import { watch, nextTick } from 'vue';
import { CmsWebsite } from '@/api/cms/cmsWebsite/model';
import { openUrl } from '@/utils/common';
import { hasAnyRole, hasRole } from '@/utils/permission';
const props = withDefaults(
const props = withDefaults(
defineProps<{
//
selection?: [];
@ -25,17 +39,16 @@ const props = withDefaults(
count?: 0;
}>(),
{}
);
);
nextTick(() => {
nextTick(() => {
if (localStorage.getItem('NotActive')) {
// IsActive.value = false
}
})
});
watch(
watch(
() => props.selection,
() => {
}
);
() => {}
);
</script>

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

@ -19,9 +19,7 @@
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
"
>
<a-form-item
label="车辆图片"
name="image" v-if="isUpdate">
<a-form-item label="车辆图片" name="image" v-if="isUpdate">
<SelectFile
:placeholder="`请选择图片`"
:limit="5"
@ -67,8 +65,7 @@
allow-clear
placeholder="请选取车辆所在位置"
v-model:value="form.location"
>
</a-input>
/>
<a-button
class="ele-btn-icon"
style="margin-left: 10px; width: 137px"
@ -80,7 +77,7 @@
</a-form-item>
<a-form-item label="操作员" name="driver" v-if="isUpdate">
{{ form.driver }} {{ form.driverPhone }}
<!-- <a-select placeholder="选择绑定的操作员" :options="users" v-model:value="form.driver" @change="chooseDriverId" />-->
<!-- <a-select placeholder="选择绑定的操作员" :options="users" v-model:value="form.driver" @change="chooseDriverId" />-->
</a-form-item>
<a-form-item label="接收提醒" name="toUser">
<a-input
@ -127,62 +124,62 @@
</template>
<script lang="ts" setup>
import {ref, reactive, watch} from 'vue';
import {Form, message} from 'ant-design-vue';
import {assignObject, uuid} from 'ele-admin-pro';
import {addHjmCar, updateHjmCar} from '@/api/hjm/hjmCar';
import {HjmCar} from '@/api/hjm/hjmCar/model';
import {useThemeStore} from '@/store/modules/theme';
import {storeToRefs} from 'pinia';
import {ItemType} from 'ele-admin-pro/es/ele-image-upload/types';
import {FormInstance} from 'ant-design-vue/es/form';
import {FileRecord} from '@/api/system/file/model';
import {AimOutlined} from "@ant-design/icons-vue";
import {CenterPoint} from "ele-admin-pro/es/ele-map-picker/types";
import OrgSelect from "@/views/system/user/components/org-select.vue";
import {Organization} from "@/api/system/organization/model";
import {User} from "@/api/system/user/model";
import {pageUsers} from "@/api/system/user";
import {listOrganizations} from "@/api/system/organization";
import {toTreeData} from "ele-admin-pro/es";
import {DictData} from "@/api/system/dict-data/model";
import {HjmFence} from "@/api/hjm/hjmFence/model";
import { ref, reactive, watch } from 'vue';
import { Form, message } from 'ant-design-vue';
import { assignObject, uuid } from 'ele-admin-pro';
import { addHjmCar, updateHjmCar } from '@/api/hjm/hjmCar';
import { HjmCar } from '@/api/hjm/hjmCar/model';
import { useThemeStore } from '@/store/modules/theme';
import { storeToRefs } from 'pinia';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FormInstance } from 'ant-design-vue/es/form';
import { FileRecord } from '@/api/system/file/model';
import { AimOutlined } from '@ant-design/icons-vue';
import { CenterPoint } from 'ele-admin-pro/es/ele-map-picker/types';
import OrgSelect from '@/views/system/user/components/org-select.vue';
import { Organization } from '@/api/system/organization/model';
import { User } from '@/api/system/user/model';
import { pageUsers } from '@/api/system/user';
import { listOrganizations } from '@/api/system/organization';
import { toTreeData } from 'ele-admin-pro/es';
import { DictData } from '@/api/system/dict-data/model';
import { HjmFence } from '@/api/hjm/hjmFence/model';
//
const isUpdate = ref(false);
const useForm = Form.useForm;
//
const themeStore = useThemeStore();
const {styleResponsive} = storeToRefs(themeStore);
const { darkMode } = storeToRefs(themeStore);
//
const isUpdate = ref(false);
const useForm = Form.useForm;
//
const themeStore = useThemeStore();
const { styleResponsive } = storeToRefs(themeStore);
const { darkMode } = storeToRefs(themeStore);
const props = defineProps<{
const props = defineProps<{
//
visible: boolean;
//
data?: HjmCar | null;
}>();
}>();
const emit = defineEmits<{
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
}>();
//
const loading = ref(false);
//
const maxable = ref(true);
//
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
//
const showMap = ref(false);
const users = ref<User[]>([])
const organizationId = ref<number>()
const organizations = ref<Organization[]>([]);
//
const loading = ref(false);
//
const maxable = ref(true);
//
const formRef = ref<FormInstance | null>(null);
const images = ref<ItemType[]>([]);
//
const showMap = ref(false);
const users = ref<User[]>([]);
const organizationId = ref<number>();
const organizations = ref<Organization[]>([]);
//
const form = reactive<HjmCar>({
//
const form = reactive<HjmCar>({
id: undefined,
name: undefined,
image: undefined,
@ -213,15 +210,15 @@ const form = reactive<HjmCar>({
tenantId: undefined,
createTime: undefined,
sortNumber: 100
});
});
/* 更新visible */
const updateVisible = (value: boolean) => {
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
};
//
const rules = reactive({
//
const rules = reactive({
organizationId: [
{
required: true,
@ -270,83 +267,88 @@ const rules = reactive({
// trigger: 'blur'
// }
// ]
});
});
const chooseInsuranceStatus = (item: DictData) => {
const chooseInsuranceStatus = (item: DictData) => {
form.insuranceStatus = item.dictDataCode;
}
};
const updateFence = (item: HjmFence) => {
const updateFence = (item: HjmFence) => {
form.fenceName = item.name;
form.fenceId = item.id;
}
};
/* 打开位置选择 */
const openMapPicker = () => {
/* 打开位置选择 */
const openMapPicker = () => {
showMap.value = true;
};
};
/* 地图选择后回调 */
const onDone = (location: CenterPoint) => {
/* 地图选择后回调 */
const onDone = (location: CenterPoint) => {
if (location) {
console.log(location)
console.log(location);
form.location = `${location.lat},${location.lng}`;
form.longitude = `${location.lng}`;
form.latitude = `${location.lat}`;
form.address = `${location.address}`;
form.district = `${location.city?.district}`
form.district = `${location.city?.district}`;
}
showMap.value = false;
};
};
const onOrganization = (index: number) => {
const onOrganization = (index: number) => {
form.driver = undefined;
users.value = []
organizations.value?.map(item => {
if(item.children?.map(d => {
const find = organizations.value?.find(i => i.organizationId == d.parentId);
if(find){
if(d.value == index){
form.code = `${find.organizationCode}${d.organizationCode}`
users.value = [];
organizations.value?.map((item) => {
if (
item.children?.map((d) => {
const find = organizations.value?.find(
(i) => i.organizationId == d.parentId
);
if (find) {
if (d.value == index) {
form.code = `${find.organizationCode}${d.organizationCode}`;
form.organizationParentId = find.organizationId;
form.organizationId = d.organizationId;
organizationId.value = find.organizationId;
getUsers()
}
getUsers();
}
}))
if(index == item.value){
form.kuaidi = item.organizationName
}
})
}
)
if (index == item.value) {
form.kuaidi = item.organizationName;
}
});
};
const getUsers = () => {
pageUsers({organizationId: organizationId.value}).then(res => {
users.value = res?.list.map(d => {
const getUsers = () => {
pageUsers({ organizationId: organizationId.value }).then((res) => {
users.value =
res?.list.map((d) => {
d.label = d.realName || d.nickname;
d.value = d.userId;
return d;
}) || [];
})
}
});
};
const chooseImage = (data: FileRecord) => {
const chooseImage = (data: FileRecord) => {
images.value.push({
uid: data.id,
url: data.path,
status: 'done'
});
};
};
const onDeleteItem = (index: number) => {
const onDeleteItem = (index: number) => {
images.value.splice(index, 1);
};
};
const {resetFields} = useForm(form, rules);
const { resetFields } = useForm(form, rules);
/* 保存编辑 */
const save = () => {
/* 保存编辑 */
const save = () => {
if (!formRef.value) {
return;
}
@ -356,7 +358,7 @@ const save = () => {
loading.value = true;
const formData = {
...form,
image: JSON.stringify(images.value),
image: JSON.stringify(images.value)
};
const saveOrUpdate = isUpdate.value ? updateHjmCar : addHjmCar;
saveOrUpdate(formData)
@ -371,11 +373,10 @@ const save = () => {
message.error(e.message);
});
})
.catch(() => {
});
};
.catch(() => {});
};
watch(
watch(
() => props.visible,
(visible) => {
if (visible) {
@ -411,9 +412,9 @@ watch(
});
});
}
if(props.data.organizationParentId){
if (props.data.organizationParentId) {
organizationId.value = props.data.organizationParentId;
getUsers()
getUsers();
}
isUpdate.value = true;
} else {
@ -423,6 +424,6 @@ watch(
resetFields();
}
},
{immediate: true}
);
{ immediate: true }
);
</script>

180
src/views/hjm/hjmCar/components/search.vue

@ -3,7 +3,7 @@
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined/>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
@ -15,7 +15,7 @@
@click="removeBatch"
>
<template #icon>
<DeleteOutlined/>
<DeleteOutlined />
</template>
<span>批量删除</span>
</a-button>
@ -33,34 +33,52 @@
v-model:value="where.keywords"
@search="reload"
/>
<a-button type="text" :icon="h(UploadOutlined)" @click="openImport">导入xls</a-button>
<a-button type="text" :icon="h(QrcodeOutlined)" @click="handleExport" :loading="exportLoading">导出二维码</a-button>
<!-- <span class="text-red-500" v-if="where.organizationId">{{ where.organizationParentName }}(ID{{where.organizationParentId}})</span>-->
<!-- <span class="text-red-500" v-if="where.organizationId">{{ where }}(ID{{where.organizationId}})</span>-->
<a-button type="text" :icon="h(UploadOutlined)" @click="openImport"
>导入xls</a-button
>
<a-button
type="text"
:icon="h(QrcodeOutlined)"
@click="handleExport"
:loading="exportLoading"
>导出二维码</a-button
>
<!-- <span class="text-red-500" v-if="where.organizationId">{{ where.organizationParentName }}(ID{{where.organizationParentId}})</span>-->
<!-- <span class="text-red-500" v-if="where.organizationId">{{ where }}(ID{{where.organizationId}})</span>-->
</a-space>
<!-- 导入弹窗 -->
<import v-model:visible="showImport" @done="reload"/>
<import v-model:visible="showImport" @done="reload" />
</template>
<script lang="ts" setup>
import {PlusOutlined} from '@ant-design/icons-vue';
import type {GradeParam} from '@/api/user/grade/model';
import {watch, ref} from 'vue';
import { h } from 'vue';
import { UploadOutlined,QrcodeOutlined } from '@ant-design/icons-vue';
import {message} from 'ant-design-vue';
import useSearch from "@/utils/use-search";
import {HjmCarParam, HjmCar} from "@/api/hjm/hjmCar/model";
import {listHjmCar} from "@/api/hjm/hjmCar";
import {Document, Packer, Paragraph, ImageRun, AlignmentType, Table, TableRow, TableCell, WidthType} from 'docx';
import {saveAs} from 'file-saver';
import QRCode from 'qrcode';
import OrgSelect from "@/views/system/admin/components/org-select.vue";
import type {Organization} from "@/api/system/organization/model";
import Import from "./Import.vue";
const props = withDefaults(
import { PlusOutlined } from '@ant-design/icons-vue';
import type { GradeParam } from '@/api/user/grade/model';
import { watch, ref } from 'vue';
import { h } from 'vue';
import { UploadOutlined, QrcodeOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
import useSearch from '@/utils/use-search';
import { HjmCarParam, HjmCar } from '@/api/hjm/hjmCar/model';
import { listHjmCar } from '@/api/hjm/hjmCar';
import {
Document,
Packer,
Paragraph,
ImageRun,
AlignmentType,
Table,
TableRow,
TableCell,
WidthType
} from 'docx';
import { saveAs } from 'file-saver';
import QRCode from 'qrcode';
import OrgSelect from '@/views/system/admin/components/org-select.vue';
import type { Organization } from '@/api/system/organization/model';
import Import from './Import.vue';
const props = withDefaults(
defineProps<{
//
selection?: [];
@ -68,47 +86,47 @@ const props = withDefaults(
organizationList: Organization[];
}>(),
{}
);
);
const emit = defineEmits<{
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
}>();
//
const {where} = useSearch<HjmCarParam>({
//
const { where } = useSearch<HjmCarParam>({
id: undefined,
keywords: '',
userId: undefined
});
});
//
const exportLoading = ref(false);
const showImport = ref(false);
//
const exportLoading = ref(false);
const showImport = ref(false);
//
const add = () => {
//
const add = () => {
emit('add');
};
};
const reload = () => {
const reload = () => {
emit('search', where);
};
};
//
const removeBatch = () => {
//
const removeBatch = () => {
emit('remove');
};
};
/* 打开编辑弹窗 */
const openImport = () => {
/* 打开编辑弹窗 */
const openImport = () => {
showImport.value = true;
};
};
// Word
const handleExport = async () => {
// Word
const handleExport = async () => {
try {
exportLoading.value = true;
message.loading('正在生成二维码文档,请稍候...', 0);
@ -136,7 +154,7 @@ const handleExport = async () => {
}
});
qrCodeImages.push({dataUrl: qrCodeDataUrl, carInfo: car});
qrCodeImages.push({ dataUrl: qrCodeDataUrl, carInfo: car });
} catch (error) {
console.error(`生成车辆 ${car.code} 的二维码失败:`, error);
}
@ -156,9 +174,10 @@ const handleExport = async () => {
console.warn('Word文档生成失败,使用HTML方式:', docError);
createHtmlDocument(qrCodeImages);
message.destroy();
message.success(`成功生成 ${qrCodeImages.length} 个车辆二维码(HTML格式,可直接打印)`);
message.success(
`成功生成 ${qrCodeImages.length} 个车辆二维码(HTML格式,可直接打印)`
);
}
} catch (error) {
console.error('导出失败:', error);
message.destroy();
@ -166,10 +185,12 @@ const handleExport = async () => {
} finally {
exportLoading.value = false;
}
};
};
// Word
const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmCar }[]) => {
// Word
const createWordDocument = async (
qrCodeImages: { dataUrl: string; carInfo: HjmCar }[]
) => {
const children: (Paragraph | Table)[] = [];
//
@ -177,7 +198,7 @@ const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmC
new Paragraph({
text: '车辆二维码清单',
alignment: AlignmentType.CENTER,
spacing: {after: 400}
spacing: { after: 400 }
})
);
@ -223,7 +244,7 @@ const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmC
alignment: AlignmentType.CENTER
})
],
width: {size: 33, type: WidthType.PERCENTAGE}
width: { size: 33, type: WidthType.PERCENTAGE }
})
);
@ -236,21 +257,21 @@ const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmC
alignment: AlignmentType.CENTER
})
],
width: {size: 33, type: WidthType.PERCENTAGE}
width: { size: 33, type: WidthType.PERCENTAGE }
})
);
} else {
//
qrCodeCells.push(
new TableCell({
children: [new Paragraph({text: ''})],
width: {size: 33, type: WidthType.PERCENTAGE}
children: [new Paragraph({ text: '' })],
width: { size: 33, type: WidthType.PERCENTAGE }
})
);
infoCells.push(
new TableCell({
children: [new Paragraph({text: ''})],
width: {size: 33, type: WidthType.PERCENTAGE}
children: [new Paragraph({ text: '' })],
width: { size: 33, type: WidthType.PERCENTAGE }
})
);
}
@ -267,7 +288,7 @@ const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmC
children: infoCells
})
],
width: {size: 100, type: WidthType.PERCENTAGE}
width: { size: 100, type: WidthType.PERCENTAGE }
})
);
@ -275,14 +296,15 @@ const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmC
children.push(
new Paragraph({
text: '',
spacing: {after: 400}
spacing: { after: 400 }
})
);
}
//
const doc = new Document({
sections: [{
sections: [
{
properties: {
page: {
size: {
@ -299,13 +321,16 @@ const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmC
}
},
children
}]
}
]
});
//
try {
const buffer = await Packer.toBlob(doc);
const fileName = `车辆二维码清单_${new Date().toISOString().slice(0, 10)}.docx`;
const fileName = `车辆二维码清单_${new Date()
.toISOString()
.slice(0, 10)}.docx`;
saveAs(buffer, fileName);
} catch (error) {
console.error('文档生成失败:', error);
@ -314,13 +339,17 @@ const createWordDocument = async (qrCodeImages: { dataUrl: string; carInfo: HjmC
const blob = new Blob([buffer], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
});
const fileName = `车辆二维码清单_${new Date().toISOString().slice(0, 10)}.docx`;
const fileName = `车辆二维码清单_${new Date()
.toISOString()
.slice(0, 10)}.docx`;
saveAs(blob, fileName);
}
};
};
// HTML
const createHtmlDocument = (qrCodeImages: { dataUrl: string; carInfo: HjmCar }[]) => {
// HTML
const createHtmlDocument = (
qrCodeImages: { dataUrl: string; carInfo: HjmCar }[]
) => {
const itemsPerRow = 3;
let htmlContent = `
<!DOCTYPE html>
@ -402,15 +431,16 @@ const createHtmlDocument = (qrCodeImages: { dataUrl: string; carInfo: HjmCar }[]
newWindow.document.close();
} else {
//
const blob = new Blob([htmlContent], {type: 'text/html;charset=utf-8'});
const fileName = `车辆二维码清单_${new Date().toISOString().slice(0, 10)}.html`;
const blob = new Blob([htmlContent], { type: 'text/html;charset=utf-8' });
const fileName = `车辆二维码清单_${new Date()
.toISOString()
.slice(0, 10)}.html`;
saveAs(blob, fileName);
}
};
};
watch(
watch(
() => props.selection,
() => {
}
);
() => {}
);
</script>

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

@ -44,12 +44,22 @@
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0 && record.claim == 0" color="red">未安装</a-tag>
<a-tag v-if="record.claim === 0 && record.status == 1" color="orange">已安装</a-tag>
<a-tag v-if="record.claim === 1 && record.status == 1" color="green" @click="updateStatus(record)">已认领</a-tag>
<a-tag v-if="record.claim === 1 && record.status == 1" color="green" @click="updateStatus(record)">已认领
</a-tag>
</template>
<template v-if="column.key === 'createTime'">
<a-space direction="vertical">
<a-tooltip title="创建时间">{{ record.createTime }}</a-tooltip>
<a-tooltip title="安装时间" class="text-orange-500">{{ record.installTime }}</a-tooltip>
<a-tooltip title="认领时间" class="text-green-500">{{ record.claimTime }}</a-tooltip>
</a-space>
</template>
<template v-if="column.key === 'action'">
<div>
<a @click="onShare(record)">二维码</a>
<a-divider type="vertical"/>
<a @click="onGpsLog(record)">GPS</a>
<a-divider type="vertical"/>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical"/>
<a-popconfirm
@ -77,7 +87,6 @@ import {createVNode, ref, watch} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import {toDateString} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
@ -111,6 +120,8 @@ const loading = ref(true);
const qrcode = ref<string>('');
//
const showQrcode = ref(false);
// ID
const installerId = ref()
//
const data = ref<Organization[]>([]);
@ -130,6 +141,9 @@ const datasource: DatasourceFunction = ({
if (filters) {
where.status = filters.status;
}
if (installerId.value) {
where.installerId = installerId.value;
}
return pageHjmCar({
...where,
...orders,
@ -218,14 +232,12 @@ const columns = ref<ColumnItem[]>([
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({text}) => toDateString(text, 'yyyy-MM-dd')
sorter: true
},
{
title: '操作',
key: 'action',
width: 180,
width: 220,
fixed: 'right',
align: 'center',
hideInSetting: true
@ -254,6 +266,10 @@ const onShare = (row?: HjmCar) => {
showQrcode.value = true;
}
const onGpsLog = (row: HjmCar) => {
window.location.href = `/hjm/gps-log?no=${row?.gpsNo}`
}
const hideShare = () => {
showQrcode.value = false;
}
@ -376,9 +392,12 @@ const customRow = (record: HjmCar) => {
};
watch(
() => router.currentRoute,
() => {
() => router.currentRoute.value.query,
(param) => {
query();
if (param.installerId) {
installerId.value = param.installerId;
}
},
{immediate: true}
);

4
src/views/hjm/hjmFence/index.vue

@ -1,8 +1,5 @@
<template>
<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"
@ -66,7 +63,6 @@ import HjmFenceEdit from './components/hjmFenceEdit.vue';
import {pageHjmFence, removeHjmFence, removeBatchHjmFence} from '@/api/hjm/hjmFence';
import type {HjmFence, HjmFenceParam} from '@/api/hjm/hjmFence/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/hjm/hjmCar/components/Extra.vue";
//
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);

33
src/views/hjm/hjmGpsLog/components/search.vue

@ -1,38 +1,47 @@
<!-- 搜索表单 -->
<template>
<a-space :size="10" style="flex-wrap: wrap">
<a-button type="primary" class="ele-btn-icon" @click="add">
<template #icon>
<PlusOutlined />
</template>
<span>添加</span>
</a-button>
<a-input-search
placeholder="请输入GPS编号"
style="width: 280px"
:disabled="gpsNo"
v-model:value="where.keywords"
@search="reload"
/>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import type { GradeParam } from '@/api/user/grade/model';
import type { HjmGpsLogParam } from '@/api/hjm/hjmGpsLog/model';
import { watch } from 'vue';
import useSearch from "@/utils/use-search";
const props = withDefaults(
defineProps<{
//
selection?: [];
gpsNo?: string;
}>(),
{}
);
const emit = defineEmits<{
(e: 'search', where?: GradeParam): void;
(e: 'search', where?: HjmGpsLogParam): void;
(e: 'add'): void;
(e: 'remove'): void;
(e: 'batchMove'): void;
}>();
//
const add = () => {
emit('add');
//
const { where } = useSearch<HjmGpsLogParam>({
id: undefined,
keywords: props.gpsNo,
userId: undefined
});
const reload = () => {
console.log(where,props.gpsNo)
emit('search', where);
};
watch(

186
src/views/hjm/hjmGpsLog/index.vue

@ -1,6 +1,5 @@
<template>
<div class="page">
<div class="ele-body">
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
<a-card :bordered="false" :body-style="{ padding: '16px' }">
<ele-pro-table
ref="tableRef"
@ -14,6 +13,7 @@
<template #toolbar>
<search
@search="reload"
:gpsNo="gpsNo"
:selection="selection"
@add="openEdit"
@remove="removeBatch"
@ -22,7 +22,7 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image :src="record.image" :width="50" />
<a-image :src="record.image" :width="50"/>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
@ -31,7 +31,7 @@
<template v-if="column.key === 'action'">
<a-space>
<a @click="openEdit(record)">修改</a>
<a-divider type="vertical" />
<a-divider type="vertical"/>
<a-popconfirm
title="确定要删除此记录吗?"
@confirm="remove(record)"
@ -45,42 +45,52 @@
</a-card>
<!-- 编辑弹窗 -->
<HjmGpsLogEdit v-model:visible="showEdit" :data="current" @done="reload" />
</div>
</div>
<HjmGpsLogEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
<script lang="ts" setup>
import { createVNode, ref } from 'vue';
import { message, Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import type { EleProTable } from 'ele-admin-pro';
import { toDateString } from 'ele-admin-pro';
import type {
import {createVNode, ref, watch} from 'vue';
import {message, Modal} from 'ant-design-vue';
import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
import type {EleProTable} from 'ele-admin-pro';
import type {
DatasourceFunction,
ColumnItem
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import HjmGpsLogEdit from './components/hjmGpsLogEdit.vue';
import { pageHjmGpsLog, removeHjmGpsLog, removeBatchHjmGpsLog } from '@/api/hjm/hjmGpsLog';
import type { HjmGpsLog, HjmGpsLogParam } from '@/api/hjm/hjmGpsLog/model';
//
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
//
const selection = ref<HjmGpsLog[]>([]);
//
const current = ref<HjmGpsLog | null>(null);
//
const showEdit = ref(false);
//
const showMove = ref(false);
//
const loading = ref(true);
//
const datasource: DatasourceFunction = ({
} from 'ele-admin-pro/es/ele-pro-table/types';
import Search from './components/search.vue';
import HjmGpsLogEdit from './components/hjmGpsLogEdit.vue';
import {
pageHjmGpsLog,
removeHjmGpsLog,
removeBatchHjmGpsLog
} from '@/api/hjm/hjmGpsLog';
import type {HjmGpsLog, HjmGpsLogParam} from '@/api/hjm/hjmGpsLog/model';
import router from "@/router";
import {getPageTitle} from "@/utils/common";
//
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
//
const selection = ref<HjmGpsLog[]>([]);
//
const current = ref<HjmGpsLog | null>(null);
//
const showEdit = ref(false);
//
const showMove = ref(false);
//
const loading = ref(true);
//
const gpsNo = ref();
//
const datasource: DatasourceFunction = ({
page,
limit,
where,
@ -90,67 +100,56 @@
if (filters) {
where.status = filters.status;
}
if (gpsNo.value) {
where.gpsNo = gpsNo.value;
}
return pageHjmGpsLog({
...where,
...orders,
page,
limit
});
};
};
//
const columns = ref<ColumnItem[]>([
//
const columns = ref<ColumnItem[]>([
{
title: '自增ID',
dataIndex: 'id',
key: 'id',
align: 'center',
width: 90,
},
{
title: '车辆ID',
dataIndex: 'carId',
key: 'carId',
align: 'center',
width: 90
},
{
title: 'gps编号',
dataIndex: 'gpsNo',
key: 'gpsNo',
align: 'center',
align: 'center'
},
{
title: '经度',
dataIndex: 'longitude',
key: 'longitude',
align: 'center',
align: 'center'
},
{
title: '纬度',
dataIndex: 'latitude',
key: 'latitude',
align: 'center',
},
{
title: '备注',
dataIndex: 'comments',
key: 'comments',
align: 'center',
align: 'center'
},
{
title: '状态, 0正常, 1冻结',
dataIndex: 'status',
key: 'status',
align: 'center',
title: '速度',
dataIndex: 'speed',
key: 'speed',
align: 'center'
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
sorter: true
},
{
title: '操作',
@ -160,29 +159,29 @@
align: 'center',
hideInSetting: true
}
]);
]);
/* 搜索 */
const reload = (where?: HjmGpsLogParam) => {
/* 搜索 */
const reload = (where?: HjmGpsLogParam) => {
selection.value = [];
tableRef?.value?.reload({ where: where });
};
tableRef?.value?.reload({where: where});
};
/* 打开编辑弹窗 */
const openEdit = (row?: HjmGpsLog) => {
/* 打开编辑弹窗 */
const openEdit = (row?: HjmGpsLog) => {
current.value = row ?? null;
showEdit.value = true;
};
};
/* 打开批量移动弹窗 */
const openMove = () => {
/* 打开批量移动弹窗 */
const openMove = () => {
showMove.value = true;
};
};
/* 删除单个 */
const remove = (row: HjmGpsLog) => {
/* 删除单个 */
const remove = (row: HjmGpsLog) => {
const hide = message.loading('请求中..', 0);
removeHjmGpsLog(row.hjmGpsLogId)
removeHjmGpsLog(row.id)
.then((msg) => {
hide();
message.success(msg);
@ -192,10 +191,10 @@
hide();
message.error(e.message);
});
};
};
/* 批量删除 */
const removeBatch = () => {
/* 批量删除 */
const removeBatch = () => {
if (!selection.value.length) {
message.error('请至少选择一条数据');
return;
@ -207,7 +206,7 @@
maskClosable: true,
onOk: () => {
const hide = message.loading('请求中..', 0);
removeBatchHjmGpsLog(selection.value.map((d) => d.hjmGpsLogId))
removeBatchHjmGpsLog(selection.value.map((d) => d.id))
.then((msg) => {
hide();
message.success(msg);
@ -219,15 +218,16 @@
});
}
});
};
};
/* 查询 */
const query = () => {
/* 查询 */
const query = () => {
loading.value = true;
};
};
/* 自定义行属性 */
const customRow = (record: HjmGpsLog) => {
/* 自定义行属性 */
const customRow = (record: HjmGpsLog) => {
return {
//
onClick: () => {
@ -238,14 +238,24 @@
openEdit(record);
}
};
};
};
watch(
() => router.currentRoute.value.query,
(param) => {
query();
if (param.no) {
gpsNo.value = param.no;
}
},
{immediate: true}
);
</script>
<script lang="ts">
export default {
export default {
name: 'HjmGpsLog'
};
};
</script>
<style lang="less" scoped></style>

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

@ -92,7 +92,7 @@ import {
} 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";
import Extra from "@/views/hjm/userVerify/components/Extra.vue";
//
const loading = ref(true);

55
src/views/hjm/userVerify/components/Extra.vue

@ -0,0 +1,55 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap" v-if="hasRole('superAdmin') || hasRole('admin') || hasRole('foundation')">
<a-button
type="text"
v-if="hasPermission('sys:org:list')"
@click="openUrl('/staff')"
>人员管理
</a-button
>
<a-button
type="text"
v-if="hasPermission('sys:userVerify:list')"
@click="openUrl('/user-verify')"
>实名认证
</a-button
>
<a-button
type="text"
v-if="hasAnyRole(['superAdmin','admin'])"
@click="openUrl('/system/admin')"
>管理员列表
</a-button
>
</a-space>
</template>
<script lang="ts" setup>
import {watch, nextTick} from 'vue';
import {CmsWebsite} from '@/api/cms/cmsWebsite/model';
import {openUrl} from "@/utils/common";
import {hasAnyRole, hasPermission, hasRole} from "@/utils/permission";
const props = withDefaults(
defineProps<{
//
selection?: [];
website?: CmsWebsite;
count?: 0;
}>(),
{}
);
nextTick(() => {
if (localStorage.getItem('NotActive')) {
// IsActive.value = false
}
})
watch(
() => props.selection,
() => {
}
);
</script>

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

@ -67,7 +67,7 @@ import UserVerifyEdit from './components/userVerifyEdit.vue';
import {pageUserVerify, removeUserVerify, removeBatchUserVerify} from '@/api/system/userVerify';
import type {UserVerify, UserVerifyParam} from '@/api/system/userVerify/model';
import {getPageTitle} from "@/utils/common";
import Extra from "@/views/system/user/components/Extra.vue";
import Extra from "./components/Extra.vue";
//
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);

4
src/views/system/userVerify/components/search.vue

@ -8,8 +8,8 @@
<!-- <span>添加</span>-->
<!-- </a-button>-->
<a-radio-group v-model:value="where.type">
<a-radio-button :value="0" @click="push(`/system/user-verify`)">个人</a-radio-button>
<a-radio-button :value="1" @click="push(`/system/user-verify2`)">企业</a-radio-button>
<a-radio-button :value="0" @click="push(`/user-verify`)">个人</a-radio-button>
<a-radio-button :value="1" @click="push(`/user-verify2`)">企业</a-radio-button>
</a-radio-group>
<a-input-search
allow-clear

Loading…
Cancel
Save