调整互动以及租户未激活时标红

This commit is contained in:
lai
2024-06-27 15:24:52 +08:00
parent a2672d300f
commit c38855acf8
2 changed files with 27 additions and 11 deletions

View File

@@ -1768,14 +1768,14 @@ export default {
classId:'Number', classId:'Number',
classSort:'Sorting', classSort:'Sorting',
status:'Status', status:'Status',
type:' Tenancy Type', type:' Tenancy Asset',
createTime:'Creation Time', createTime:'Creation Time',
highClass:'Root Level', highClass:'Root Level',
key:'Tenancy Key', key:'Asset Key',
emailTip:'Please input the correct email address', emailTip:'Please input the correct email address',
phoneTip:'Please enter the correct phone number', phoneTip:'Please enter the correct phone number',
node:'Root Node', node:'Root Node',
delSure:'Are you sure to delete the data item with department number [{deptId}]?', delSure:'Are you sure to delete the data item with number [{deptId}]?',
open:'Exhibition', open:'Exhibition',
close:'Fold', close:'Fold',
addClass:'Add Tenant', addClass:'Add Tenant',

View File

@@ -224,13 +224,13 @@ const modalStateTypeFrom = Form.useForm(
/**表格字段列 */ /**表格字段列 */
let tableColumns: ColumnsType = [ let tableColumns: ColumnsType = [
{ {
title: 'Tenancy Type', title: 'Tenancy Asset',
dataIndex: 'tenancyType', dataIndex: 'tenancyType',
key: 'tenancyType', key: 'tenancyType',
align: 'left', align: 'left',
}, },
{ {
title: 'Tenancy Key', title: 'Asset Key',
dataIndex: 'tenancyKey', dataIndex: 'tenancyKey',
align: 'left', align: 'left',
}, },
@@ -363,11 +363,11 @@ function fnModalOk() {
content: t('common.msgSuccess', { msg: modalState.title }), content: t('common.msgSuccess', { msg: modalState.title }),
duration: 2, duration: 2,
}); });
console.log(res.data);
modalState.visibleByEdit = false; modalState.visibleByEdit = false;
modalStateFrom.resetFields(); modalStateFrom.resetFields();
fnGetList(undefined, 'tree'); //渲染树状 resetModal();
tableState.data = []; //清空表格数据
} else { } else {
message.error({ message.error({
content: `${res.msg}`, content: `${res.msg}`,
@@ -402,7 +402,7 @@ function fnRecordDelete(tenantId: string | number) {
content: t('common.msgSuccess', { msg: t('common.deleteText') }), content: t('common.msgSuccess', { msg: t('common.deleteText') }),
duration: 2, duration: 2,
}); });
fnGetList(undefined, 'tree'); //渲染树状 resetModal();
} else { } else {
message.error({ message.error({
content: `${res.msg}`, content: `${res.msg}`,
@@ -424,6 +424,7 @@ function fnModalVisibleByType(
parentId?: string | number parentId?: string | number
) { ) {
if (!tenantId) { if (!tenantId) {
//新增租赁类型时
modalStateTypeFrom.resetFields(); modalStateTypeFrom.resetFields();
modalState.typeFrom.parentId = state.selectedNode; modalState.typeFrom.parentId = state.selectedNode;
@@ -539,6 +540,14 @@ function hideButtons() {
showButtonsKey.value = null; showButtonsKey.value = null;
} }
function resetModal() {
fnGetList(undefined, 'tree'); //渲染树状
tableState.data = [];
state.selectedName = '';
modalState.typeButton = false;
state.selectedNode = '';
}
onMounted(() => { onMounted(() => {
Promise.allSettled([ Promise.allSettled([
getDict('sys_normal_disable'), getDict('sys_normal_disable'),
@@ -580,13 +589,18 @@ onMounted(() => {
<a-tree :tree-data="state.tenantTreeData" @select="fnSelectNode"> <a-tree :tree-data="state.tenantTreeData" @select="fnSelectNode">
<!-- treeKey is tenantId --> <!-- treeKey is tenantId -->
<template #title="{ key: treeKey, title }"> <template #title="{ key: treeKey, title, status }">
<div <div
@mouseover="showButtons(treeKey)" @mouseover="showButtons(treeKey)"
@mouseleave="hideButtons" @mouseleave="hideButtons"
style="display: flex; align-items: center" style="display: flex; align-items: center"
> >
<span>{{ title }}</span> <span
:style="
status == 1 ? { color: 'green' } : { color: 'red' }
"
>{{ title }}</span
>
<div style="flex: 1"></div> <div style="flex: 1"></div>
<!-- 占位符推动后面的按钮到最右边 --> <!-- 占位符推动后面的按钮到最右边 -->
<EditOutlined <EditOutlined
@@ -633,7 +647,9 @@ onMounted(() => {
<a-space :size="8" align="center"> <a-space :size="8" align="center">
<a-tooltip> <a-tooltip>
<template #title>{{ <template #title>{{
modalState.typeButton ? 'Add Tenancy Type' : 'Please Select Tenant' modalState.typeButton
? 'Add Tenancy Asset'
: 'Please Select Tenant'
}}</template> }}</template>
<a-button <a-button
size="small" size="small"