fix: bug#10528

This commit is contained in:
JiangQiming 2023-03-17 14:09:23 +08:00
parent f79f511557
commit a260146ad4
4 changed files with 98 additions and 96 deletions

View File

@ -1,12 +1,12 @@
<!-- 坐标点拾取组件 -->
<template>
<div class="page-container">
<a-input allowClear v-model:value="inputPoint">
<j-input allowClear v-model:value="inputPoint">
<template #addonAfter>
<environment-outlined @click="modalVis = true" />
</template>
</a-input>
<a-modal
</j-input>
<j-modal
title="地理位置"
ok-text="确认"
cancel-text="取消"
@ -28,7 +28,7 @@
</el-amap>
{{ mapPoint }}
</div>
</a-modal>
</j-modal>
</div>
</template>

View File

@ -15,87 +15,91 @@
<j-radio-button :value="0">全屏</j-radio-button>
</j-radio-group>
<div class="screen-tool-save">
<j-tooltip title="可保存分屏配置记录">
<AIcon type="QuestionCircleOutlined" />
</j-tooltip>
<j-popover
v-model:visible="visible"
trigger="click"
title="分屏名称"
>
<template #content>
<j-form
ref="formRef"
:model="formData"
layout="vertical"
>
<j-form-item
name="name"
:rules="[
{
required: true,
message: '请输入名称',
},
{
max: 64,
message: '最多可输入64个字符',
},
]"
>
<j-textarea v-model:value="formData.name" />
</j-form-item>
<j-button
type="primary"
@click="saveHistory"
:loading="loading"
style="width: 100%; margin-top: 16px"
>
保存
</j-button>
</j-form>
</template>
<j-dropdown-button
type="primary"
@click="visible = true"
<j-space>
<j-tooltip title="可保存分屏配置记录">
<AIcon type="QuestionCircleOutlined" />
</j-tooltip>
<j-popover
v-model:visible="visible"
trigger="click"
title="分屏名称"
>
保存
<template #overlay>
<j-menu>
<j-empty
v-if="!historyList.length"
description="暂无数据"
/>
<j-menu-item
v-for="(item, index) in historyList"
:key="`his${index}`"
@click="handleHistory(item)"
<template #content>
<j-form
ref="formRef"
:model="formData"
layout="vertical"
>
<j-form-item
name="name"
:rules="[
{
required: true,
message: '请输入名称',
},
{
max: 64,
message: '最多可输入64个字符',
},
]"
>
<j-space>
<span>{{ item.name }}</span>
<j-popconfirm
title="确认删除?"
ok-text="确认"
cancel-text="取消"
@confirm="(e: any) => {
e?.stopPropagation();
deleteHistory(item.key);
}
"
>
<AIcon
type="DeleteOutlined"
@click="
(e:any) =>
e?.stopPropagation()
"
/>
</j-popconfirm>
</j-space>
</j-menu-item>
</j-menu>
<j-textarea
v-model:value="formData.name"
/>
</j-form-item>
<j-button
type="primary"
@click="saveHistory"
:loading="loading"
style="width: 100%; margin-top: 16px"
>
保存
</j-button>
</j-form>
</template>
</j-dropdown-button>
</j-popover>
<j-dropdown-button
type="primary"
@click="visible = true"
>
保存
<template #overlay>
<j-menu>
<j-empty
v-if="!historyList.length"
description="暂无数据"
/>
<j-menu-item
v-for="(item, index) in historyList"
:key="`his${index}`"
@click="handleHistory(item)"
>
<j-space>
<span>{{ item.name }}</span>
<j-popconfirm
title="确认删除?"
ok-text="确认"
cancel-text="取消"
@confirm="(e: any) => {
e?.stopPropagation();
deleteHistory(item.key);
}
"
>
<AIcon
type="DeleteOutlined"
@click="
(e:any) =>
e?.stopPropagation()
"
/>
</j-popconfirm>
</j-space>
</j-menu-item>
</j-menu>
</template>
</j-dropdown-button>
</j-popover>
</j-space>
</div>
</div>
<!-- 播放器 -->

View File

@ -726,7 +726,7 @@ const handleSubmit = () => {
// console.log('formData.value: ', formData.value);
formRef.value
.validate()
.then(async () => {
.then(() => {
const {
id,
cascadeName,
@ -750,16 +750,14 @@ const handleSubmit = () => {
],
};
btnLoading.value = true;
const res = formData.value.id
? await CascadeApi.update(params)
: await CascadeApi.save(params);
btnLoading.value = false;
if (res.success) {
message.success('操作成功');
router.back();
} else {
message.error('操作失败');
}
CascadeApi[id ? 'update' : 'save'](params)
.then(() => {
message.success('操作成功');
router.back();
})
.finally(() => {
btnLoading.value = false;
});
})
.catch((err: any) => {
console.log('err: ', err);

View File

@ -67,8 +67,8 @@
<span>{{ slotProps.channelNumber || 0 }}</span>
</template>
<template #state="slotProps">
<a-space>
<a-badge
<j-space>
<j-badge
:status="
slotProps.state.value === 'online'
? 'success'
@ -76,7 +76,7 @@
"
:text="slotProps.state.text"
/>
</a-space>
</j-space>
</template>
</JProTable>
</j-modal>