Merge pull request 'master' (#4) from master into prod
All checks were successful
/ Explore-Gitea-Actions (push) Successful in 19m31s

Reviewed-on: #4
This commit is contained in:
2025-08-29 23:29:45 +08:00
6 changed files with 139 additions and 68 deletions

View File

@@ -1,4 +1,4 @@
import type {PageQuery, BaseEntity} from '#/api/common';
import type { PageQuery, BaseEntity } from '#/api/common';
export interface WorkOrdersTypeVO {
/**
@@ -41,7 +41,10 @@ export interface WorkOrdersTypeVO {
* 处理优先级
*/
processingWeight: string;
/**
* 部门名称
*/
deptName?: string;
}
export interface WorkOrdersTypeForm extends BaseEntity {

View File

@@ -1,7 +1,7 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {renderDict} from "#/utils/render";
import {getDictOptions} from "#/utils/dict";
import { renderDict } from '#/utils/render';
import { getDictOptions } from '#/utils/dict';
export const querySchema: FormSchemaGetter = () => [
// {
@@ -34,7 +34,12 @@ export const columns: VxeGridProps['columns'] = [
title: '类型名称',
field: 'orderTypeName',
treeNode: true,
minWidth:180,
minWidth: 180,
},
{
title: '部门名称',
field: 'deptName',
width: 180,
},
{
title: '运作模式',
@@ -44,14 +49,16 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.operationMode, 'pro_operation_pattern');
},
},
width:180,
width: 180,
},
{
title: '处理优先级',
field: 'processingWeight',
slots: {
default: ({row}) => {
return row.processingWeight!=null?renderDict(row.processingWeight, 'pro_processing_weight'):'';
default: ({ row }) => {
return row.processingWeight != null
? renderDict(row.processingWeight, 'pro_processing_weight')
: '';
},
},
width: 100,
@@ -59,12 +66,12 @@ export const columns: VxeGridProps['columns'] = [
{
title: '排序值',
field: 'sort',
width:180,
width: 180,
},
{
title: '累计工单数量',
field: 'number',
width:180,
width: 180,
},
{
title: '是否支持转单',
@@ -74,7 +81,7 @@ export const columns: VxeGridProps['columns'] = [
return renderDict(row.isTransfers, 'support_transferring_orders');
},
},
width:180,
width: 180,
},
{
field: 'action',
@@ -101,6 +108,12 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
rules: 'required',
},
{
label: '部门名称',
fieldName: 'deptId',
component: 'TreeSelect',
rules: 'required',
},
{
label: '父级类型',
fieldName: 'parentId',

View File

@@ -1,10 +1,10 @@
<script setup lang="ts">
import type {WorkOrdersTypeVO} from '#/api/property/businessManagement/workOrdersType/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem, Rate} from 'ant-design-vue';
import {workOrdersTypeInfo} from '#/api/property/businessManagement/workOrdersType';
import {renderDict} from "#/utils/render";
import type { WorkOrdersTypeVO } from '#/api/property/businessManagement/workOrdersType/model';
import { shallowRef } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { Descriptions, DescriptionsItem, Rate } from 'ant-design-vue';
import { workOrdersTypeInfo } from '#/api/property/businessManagement/workOrdersType';
import { renderDict } from '#/utils/render';
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
@@ -20,7 +20,7 @@ async function handleOpenChange(open: boolean) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const { id } = modalApi.getData() as { id: number | string };
const response = await workOrdersTypeInfo(id);
workOrdersTypeInfoDetail.value = response;
modalApi.modalLoading(false);
@@ -28,23 +28,48 @@ async function handleOpenChange(open: boolean) {
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="工单类型信息" class="w-[70%]">
<Descriptions v-if="workOrdersTypeInfoDetail" size="small" :column="2" bordered
:labelStyle="{width:'120px'}">
<BasicModal
:footer="false"
:fullscreen-button="false"
title="工单类型信息"
class="w-[70%]"
>
<Descriptions
v-if="workOrdersTypeInfoDetail"
size="small"
:column="2"
bordered
:labelStyle="{ width: '120px' }"
>
<!-- <DescriptionsItem label="工单类型编号">-->
<!-- {{ workOrdersTypeInfoDetail.orderTypeNo }}-->
<!-- </DescriptionsItem>-->
<DescriptionsItem label="类型名称">
{{ workOrdersTypeInfoDetail.orderTypeName }}
</DescriptionsItem>
<DescriptionsItem label="运作模式" >
<component v-if="workOrdersTypeInfoDetail.operationMode!=null"
:is="renderDict(workOrdersTypeInfoDetail.operationMode,'pro_operation_pattern')"
<DescriptionsItem label="部门名称">
{{ workOrdersTypeInfoDetail.deptName }}
</DescriptionsItem>
<DescriptionsItem label="运作模式">
<component
v-if="workOrdersTypeInfoDetail.operationMode != null"
:is="
renderDict(
workOrdersTypeInfoDetail.operationMode,
'pro_operation_pattern',
)
"
/>
</DescriptionsItem>
<DescriptionsItem label="处理优先级">
<component v-if="workOrdersTypeInfoDetail.processingWeight!=null"
:is="renderDict(workOrdersTypeInfoDetail.processingWeight,'pro_processing_weight')"
<component
v-if="workOrdersTypeInfoDetail.processingWeight != null"
:is="
renderDict(
workOrdersTypeInfoDetail.processingWeight,
'pro_processing_weight',
)
"
/>
</DescriptionsItem>
<DescriptionsItem label="排序值">
@@ -53,9 +78,17 @@ async function handleOpenChange(open: boolean) {
<DescriptionsItem label="累计工单数量">
{{ workOrdersTypeInfoDetail.number }}
</DescriptionsItem>
<DescriptionsItem label="是否支持转单" v-if="workOrdersTypeInfoDetail.isTransfers!=null">
<DescriptionsItem
label="是否支持转单"
v-if="workOrdersTypeInfoDetail.isTransfers != null"
>
<component
:is="renderDict(workOrdersTypeInfoDetail.isTransfers,'support_transferring_orders')"
:is="
renderDict(
workOrdersTypeInfoDetail.isTransfers,
'support_transferring_orders',
)
"
/>
</DescriptionsItem>
</Descriptions>

View File

@@ -1,16 +1,18 @@
<script setup lang="ts">
import {computed, ref} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {$t} from '@vben/locales';
import {cloneDeep} from '@vben/utils';
import {useVbenForm} from '#/adapter/form';
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { useVbenForm } from '#/adapter/form';
import {
workOrdersTypeAdd,
workOrdersTypeInfo, workOrdersTypeListAll,
workOrdersTypeUpdate
workOrdersTypeInfo,
workOrdersTypeListAll,
workOrdersTypeUpdate,
} from '#/api/property/businessManagement/workOrdersType';
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
import {modalSchema} from './data';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
import { addFullName, cloneDeep } from '@vben/utils';
import { getDeptTree } from '#/api/system/user';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
@@ -28,14 +30,14 @@ const [BasicForm, formApi] = useVbenForm({
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
@@ -54,9 +56,10 @@ const [BasicModal, modalApi] = useVbenModal({
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id?: number | string };
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
await initTypeOptions(id)
await initTypeOptions(id);
await setupDeptSelect();
if (isUpdate.value && id) {
const record = await workOrdersTypeInfo(id);
record.operationMode = record.operationMode?.toString();
@@ -72,13 +75,15 @@ const [BasicModal, modalApi] = useVbenModal({
async function handleConfirm() {
try {
modalApi.lock(true);
const {valid} = await formApi.validate();
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? workOrdersTypeUpdate(data) : workOrdersTypeAdd(data));
await (isUpdate.value
? workOrdersTypeUpdate(data)
: workOrdersTypeAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
@@ -94,29 +99,47 @@ async function handleClosed() {
resetInitialized();
}
async function initTypeOptions(id:string) {
async function initTypeOptions(id: string) {
let params = {
excludeId:id,
filterSubNodes: true //过滤子级
}
const typeList = await workOrdersTypeListAll(params)
formApi.updateSchema([{
componentProps: () => ({
options: typeList,
showSearch: true,
optionFilterProp: 'orderTypeName',
fieldNames: {label: 'orderTypeName', value: 'id'},
allowClear: true,
}),
fieldName: 'parentId',
},
excludeId: id,
filterSubNodes: true, //过滤子级
};
const typeList = await workOrdersTypeListAll(params);
formApi.updateSchema([
{
componentProps: () => ({
options: typeList,
showSearch: true,
optionFilterProp: 'orderTypeName',
fieldNames: { label: 'orderTypeName', value: 'id' },
allowClear: true,
}),
fieldName: 'parentId',
},
]);
}
async function setupDeptSelect() {
const deptTree = await getDeptTree();
// 选中后显示在输入框的值 即父节点 / 子节点
addFullName(deptTree, 'label', ' / ');
formApi.updateSchema([
{
componentProps: {
fieldNames: { label: 'label', value: 'id' },
treeData: deptTree,
treeDefaultExpandAll: true,
treeLine: { showLeafIcon: false },
// 选中后显示在输入框的值
treeNodeLabelProp: 'fullName',
},
fieldName: 'deptId',
},
]);
}
</script>
<template>
<BasicModal :title="title">
<BasicForm/>
<BasicForm />
</BasicModal>
</template>

View File

@@ -162,12 +162,11 @@ function streamProxy(nodeData: any, cb: Function) {
pwd: nodeData.devicePwd,
channelId: nodeData.channelNo,
};
if (isSupportH265) {
addStreamProxy(params).then((res) => cb(res));
} else {
addFFmpegStreamProxy(params).then((res) => cb(res));
}
}
if (isSupportH265) {
addStreamProxy(params).then((res) => cb(res));
} else {
addStreamProxy(params).then((res) => cb(res));
}
}
@@ -181,7 +180,7 @@ function doPlayer(nodeData: any, index: number = 0) {
if (mpegts.isSupported()) {
streamProxy(nodeData, (res: AddStreamProxyResult) => {
const host = window.location.host;
const url = `http://${host}/${res.app}/${res.streamId}.live.flv`;
const url = `ws://${host}/${res.app}/${res.streamId}.live.flv`;
// 将url 绑定到 nodeData
nodeData.url = url;
closePlayer(index);

View File

@@ -308,7 +308,7 @@ function doPlayer(nodeData: any, index: number = 0) {
if (mpegts.isSupported()) {
streamProxy(nodeData, (res: AddStreamProxyResult) => {
const host = window.location.host;
const url = `http://${host}/${res.app}/${res.streamId}.live.flv`;
const url = `ws://${host}/${res.app}/${res.streamId}.live.flv`;
// 将url 绑定到 nodeData
nodeData.url = url;
closePlayer(index);