feat(house): 添加房源类型筛选功能
- 在 houseInfo 组件中新增 type 参数用于筛选房源类型 - 更新 houseInfoEdit 组件以支持传递和显示房源类型 - 修改接口模型增加 type 字段定义 - 调整页面布局及样式以适应新字段展示需求 - 配置开发环境 API 地址并更新相关组件请求路径 - 引入路由监听实现动态类型查询 - 优化表格行键值确保唯一性 - 更新系统设置中微信相关的域名配置为本地地址 - 修改文件上传接口地址为本地服务 - 调整项目库组件中的 ID 键名以匹配后端返回结构 - 移除冗余的表单字段声明提升代码整洁度 - 更新
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
VITE_APP_NAME=后台管理(开发环境)
|
||||
VITE_API_URL=http://127.0.0.1:9200/api
|
||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||
|
||||
|
||||
|
||||
@@ -64,5 +64,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
<script
|
||||
async
|
||||
defer
|
||||
id="sqlbot-assistant-float-script-7400549959767953408"
|
||||
src="https://sql-bot.websoft.top/assistant.js?id=7400549959767953408"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -8,6 +8,8 @@ export interface HouseInfo {
|
||||
houseId?: number;
|
||||
// 房源标题
|
||||
houseTitle?: string;
|
||||
// 房源类型
|
||||
type?: number;
|
||||
// 房产所在的城市
|
||||
cityByHouse?: string;
|
||||
// 户型
|
||||
|
||||
@@ -310,6 +310,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 顶栏菜单标题中样式调整
|
||||
.ele-admin-header-nav{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
// 顶栏菜单标题中样式调整
|
||||
.ele-admin-header-nav > .ant-menu {
|
||||
& > .ant-menu-item,
|
||||
|
||||
@@ -49,7 +49,7 @@ const DEFAULT_STATE: ThemeState = Object.freeze({
|
||||
// 侧栏风格: light(亮色), dark(暗色)
|
||||
sideStyle: 'light',
|
||||
// 布局风格: side(默认), top(顶栏导航), mix(混合导航)
|
||||
layoutStyle: 'side',
|
||||
layoutStyle: 'mix',
|
||||
// 侧栏菜单风格: default(默认), mix(双排侧栏)
|
||||
sideMenuStyle: 'default',
|
||||
// 页签风格: default(默认), dot(圆点), card(卡片)
|
||||
|
||||
@@ -322,6 +322,8 @@
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: HouseInfo | null;
|
||||
// 类型
|
||||
type?: null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="houseInfoId"
|
||||
row-key="houseId"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
@@ -51,7 +51,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { createVNode, ref,unref, watch } from 'vue';
|
||||
import {useRouter} from 'vue-router';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
@@ -65,6 +66,7 @@
|
||||
import { pageHouseInfo, removeHouseInfo, removeBatchHouseInfo } from '@/api/house/houseInfo';
|
||||
import type { HouseInfo, HouseInfoParam } from '@/api/house/houseInfo/model';
|
||||
|
||||
const {currentRoute} = useRouter();
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
@@ -78,6 +80,8 @@
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
// 房产类型
|
||||
const type = ref(0);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
@@ -380,7 +384,7 @@
|
||||
/* 删除单个 */
|
||||
const remove = (row: HouseInfo) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeHouseInfo(row.houseInfoId)
|
||||
removeHouseInfo(row.houseId)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
@@ -405,7 +409,7 @@
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchHouseInfo(selection.value.map((d) => d.houseInfoId))
|
||||
removeBatchHouseInfo(selection.value.map((d) => d.houseId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
@@ -438,6 +442,22 @@
|
||||
};
|
||||
};
|
||||
query();
|
||||
|
||||
watch(
|
||||
currentRoute,
|
||||
(route) => {
|
||||
console.log(route,'12312312route')
|
||||
const {params} = unref(route);
|
||||
console.log(params,'ppp')
|
||||
const {id} = params;
|
||||
if (id) {
|
||||
type.value = Number(id);
|
||||
console.log(type.value,'.......TYPE');
|
||||
}
|
||||
reload();
|
||||
},
|
||||
{immediate: true}
|
||||
);
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
|
||||
@@ -376,6 +376,8 @@ import {ref, reactive, watch, computed} from 'vue';
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: HouseInfo | null;
|
||||
// 类型
|
||||
type?: number;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -691,7 +693,8 @@ import {ref, reactive, watch, computed} from 'vue';
|
||||
content: content.value,
|
||||
files: JSON.stringify(files.value),
|
||||
houseLabel: JSON.stringify(houseLabelData.value),
|
||||
monthlyRent: monthlyRent.value
|
||||
monthlyRent: monthlyRent.value,
|
||||
type: props.type
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value ? updateHouseInfo : addHouseInfo;
|
||||
saveOrUpdate(formData)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="ele-body">
|
||||
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||
<a-card :bordered="false">
|
||||
<!-- 表格 -->
|
||||
<ele-pro-table
|
||||
@@ -30,7 +30,7 @@
|
||||
style="margin-right: 4px"
|
||||
>
|
||||
<template #icon>
|
||||
<UserOutlined />
|
||||
<UserOutlined/>
|
||||
</template>
|
||||
</a-avatar>
|
||||
<div class="user-info">
|
||||
@@ -103,324 +103,346 @@
|
||||
v-model:visible="showEdit"
|
||||
:data="current"
|
||||
:organization-list="data"
|
||||
:type="type"
|
||||
@done="reload"
|
||||
/>
|
||||
</div>
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue/es';
|
||||
import {
|
||||
ExclamationCircleOutlined,
|
||||
UserOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro/es';
|
||||
import { formatNumber, messageLoading, toDateString } from 'ele-admin-pro/es';
|
||||
import type {
|
||||
ColumnItem,
|
||||
DatasourceFunction
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import InfoEdit from './components/info-edit.vue';
|
||||
import {
|
||||
pageHouseInfo,
|
||||
removeBatchHouseInfo,
|
||||
updateHouseInfo,
|
||||
updateBatchHouseInfo
|
||||
} from '@/api/house/houseInfo';
|
||||
import type { HouseInfo, HouseInfoParam } from '@/api/house/houseInfo/model';
|
||||
import { Organization } from '@/api/system/organization/model';
|
||||
import Search from './components/search.vue';
|
||||
import {createVNode, watch, unref, ref} from 'vue';
|
||||
import {message, Modal} from 'ant-design-vue/es';
|
||||
import {useRouter} from 'vue-router';
|
||||
import {
|
||||
ExclamationCircleOutlined,
|
||||
UserOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import type {EleProTable} from 'ele-admin-pro/es';
|
||||
import {formatNumber, messageLoading, toDateString} from 'ele-admin-pro/es';
|
||||
import type {
|
||||
ColumnItem,
|
||||
DatasourceFunction
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import InfoEdit from './components/info-edit.vue';
|
||||
import {
|
||||
pageHouseInfo,
|
||||
removeBatchHouseInfo,
|
||||
updateHouseInfo,
|
||||
updateBatchHouseInfo
|
||||
} from '@/api/house/houseInfo';
|
||||
import type {HouseInfo, HouseInfoParam} from '@/api/house/houseInfo/model';
|
||||
import {Organization} from '@/api/system/organization/model';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from "@/utils/common";
|
||||
|
||||
// 树形数据
|
||||
const data = ref<Organization[]>([]);
|
||||
// 表格选中数据
|
||||
const selection = ref<HouseInfo[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<HouseInfo | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
const {currentRoute} = useRouter();
|
||||
// 树形数据
|
||||
const data = ref<Organization[]>([]);
|
||||
// 表格选中数据
|
||||
const selection = ref<HouseInfo[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<HouseInfo | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 房产类型
|
||||
const type = ref(0);
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
// {
|
||||
// key: 'index',
|
||||
// width: 48,
|
||||
// align: 'center',
|
||||
// fixed: 'left',
|
||||
// hideInSetting: true,
|
||||
// customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
// },
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'houseId',
|
||||
width: 80,
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '经纪人',
|
||||
dataIndex: 'nickname',
|
||||
key: 'nickname',
|
||||
ellipsis: true,
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'houseTitle',
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
title: '区域',
|
||||
dataIndex: 'region'
|
||||
},
|
||||
{
|
||||
title: '户型',
|
||||
key: 'houseType',
|
||||
dataIndex: 'houseType'
|
||||
},
|
||||
{
|
||||
title: '租赁方式',
|
||||
dataIndex: 'leaseMethod'
|
||||
},
|
||||
{
|
||||
title: '租金(元/m²)',
|
||||
dataIndex: 'rent',
|
||||
key: 'rent',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '月租金',
|
||||
dataIndex: 'monthlyRent',
|
||||
key: 'monthlyRent',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '面积(m²)',
|
||||
dataIndex: 'extent',
|
||||
key: 'extent',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor'
|
||||
},
|
||||
{
|
||||
title: '朝向',
|
||||
dataIndex: 'toward'
|
||||
},
|
||||
{
|
||||
title: '房号',
|
||||
dataIndex: 'roomNumber'
|
||||
},
|
||||
{
|
||||
title: '入房密码',
|
||||
dataIndex: 'password'
|
||||
},
|
||||
{
|
||||
title: '上架',
|
||||
key: 'status',
|
||||
dataIndex: 'status',
|
||||
width: 90,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '推荐',
|
||||
key: 'recommend',
|
||||
dataIndex: 'recommend',
|
||||
width: 90,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '必看',
|
||||
key: 'mustSee',
|
||||
dataIndex: 'mustSee',
|
||||
width: 90,
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// title: '详细地址',
|
||||
// dataIndex: 'address',
|
||||
// width: 300
|
||||
// },
|
||||
// {
|
||||
// title: '房屋标签',
|
||||
// dataIndex: 'houseLabel',
|
||||
// key: 'houseLabel',
|
||||
// width: 300
|
||||
// },
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
width: 170,
|
||||
showSorterTooltip: false,
|
||||
ellipsis: true,
|
||||
customRender: ({ text }) => toDateString(text)
|
||||
}
|
||||
]);
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
where.showProfile = true;
|
||||
where.roleId = filters.roles;
|
||||
return pageHouseInfo({ page, limit, ...where, ...orders });
|
||||
};
|
||||
/* 搜索 */
|
||||
const reload = (where?: HouseInfoParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where });
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: HouseInfo) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
// {
|
||||
// key: 'index',
|
||||
// width: 48,
|
||||
// align: 'center',
|
||||
// fixed: 'left',
|
||||
// hideInSetting: true,
|
||||
// customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
// },
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'houseId',
|
||||
width: 80,
|
||||
showSorterTooltip: false
|
||||
},
|
||||
{
|
||||
title: '经纪人',
|
||||
dataIndex: 'nickname',
|
||||
key: 'nickname',
|
||||
ellipsis: true,
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
dataIndex: 'houseTitle',
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
title: '区域',
|
||||
dataIndex: 'region'
|
||||
},
|
||||
{
|
||||
title: '户型',
|
||||
key: 'houseType',
|
||||
dataIndex: 'houseType'
|
||||
},
|
||||
{
|
||||
title: '租赁方式',
|
||||
dataIndex: 'leaseMethod'
|
||||
},
|
||||
{
|
||||
title: '租金(元/m²)',
|
||||
dataIndex: 'rent',
|
||||
key: 'rent',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '月租金',
|
||||
dataIndex: 'monthlyRent',
|
||||
key: 'monthlyRent',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '面积(m²)',
|
||||
dataIndex: 'extent',
|
||||
key: 'extent',
|
||||
sorter: true
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor'
|
||||
},
|
||||
{
|
||||
title: '朝向',
|
||||
dataIndex: 'toward'
|
||||
},
|
||||
{
|
||||
title: '房号',
|
||||
dataIndex: 'roomNumber'
|
||||
},
|
||||
{
|
||||
title: '入房密码',
|
||||
dataIndex: 'password'
|
||||
},
|
||||
{
|
||||
title: '上架',
|
||||
key: 'status',
|
||||
dataIndex: 'status',
|
||||
width: 90,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '推荐',
|
||||
key: 'recommend',
|
||||
dataIndex: 'recommend',
|
||||
width: 90,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '必看',
|
||||
key: 'mustSee',
|
||||
dataIndex: 'mustSee',
|
||||
width: 90,
|
||||
align: 'center'
|
||||
},
|
||||
// {
|
||||
// title: '详细地址',
|
||||
// dataIndex: 'address',
|
||||
// width: 300
|
||||
// },
|
||||
// {
|
||||
// title: '房屋标签',
|
||||
// dataIndex: 'houseLabel',
|
||||
// key: 'houseLabel',
|
||||
// width: 300
|
||||
// },
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
width: 170,
|
||||
showSorterTooltip: false,
|
||||
ellipsis: true,
|
||||
customRender: ({text}) => toDateString(text)
|
||||
}
|
||||
]);
|
||||
|
||||
/* 修改推荐状态 */
|
||||
const editRecommend = (checked: boolean, row: HouseInfo) => {
|
||||
const recommend = checked ? 1 : 0;
|
||||
updateHouseInfo({
|
||||
houseId: row.houseId,
|
||||
userId: row.userId,
|
||||
recommend
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
orders,
|
||||
filters
|
||||
}) => {
|
||||
where.showProfile = true;
|
||||
where.roleId = filters.roles;
|
||||
where.type = type.value;
|
||||
return pageHouseInfo({page, limit, ...where, ...orders});
|
||||
};
|
||||
/* 搜索 */
|
||||
const reload = (where?: HouseInfoParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({where});
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: HouseInfo) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
|
||||
/* 修改推荐状态 */
|
||||
const editRecommend = (checked: boolean, row: HouseInfo) => {
|
||||
const recommend = checked ? 1 : 0;
|
||||
updateHouseInfo({
|
||||
houseId: row.houseId,
|
||||
userId: row.userId,
|
||||
recommend
|
||||
})
|
||||
.then((msg) => {
|
||||
row.recommend = recommend;
|
||||
message.success(msg);
|
||||
})
|
||||
.then((msg) => {
|
||||
row.recommend = recommend;
|
||||
message.success(msg);
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
/* 修改上架状态 */
|
||||
const editStatus = (checked: boolean, row: HouseInfo) => {
|
||||
const status = checked ? 0 : 10;
|
||||
updateHouseInfo({
|
||||
houseId: row.houseId,
|
||||
userId: row.userId,
|
||||
status
|
||||
})
|
||||
.then((msg) => {
|
||||
row.status = status;
|
||||
message.success(msg);
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
const editMustSee = (checked: boolean, row: HouseInfo) => {
|
||||
const mustSee = checked ? 1 : 0;
|
||||
updateHouseInfo({
|
||||
houseId: row.houseId,
|
||||
userId: row.userId,
|
||||
mustSee
|
||||
})
|
||||
.then((msg) => {
|
||||
row.mustSee = mustSee;
|
||||
message.success(msg);
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的房源吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = messageLoading('请求中..', 0);
|
||||
removeBatchHouseInfo(selection.value.map((d) => d.houseId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/* 批量下架 */
|
||||
const banBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要下架选中的房源吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = messageLoading('请求中..', 0);
|
||||
updateBatchHouseInfo({
|
||||
ids:selection.value.map((d) => d.houseId),
|
||||
data: {
|
||||
status: 10
|
||||
}
|
||||
/* 修改上架状态 */
|
||||
const editStatus = (checked: boolean, row: HouseInfo) => {
|
||||
const status = checked ? 0 : 10;
|
||||
updateHouseInfo({
|
||||
houseId: row.houseId,
|
||||
userId: row.userId,
|
||||
status
|
||||
})
|
||||
.then((msg) => {
|
||||
row.status = status;
|
||||
message.success(msg);
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
|
||||
const editMustSee = (checked: boolean, row: HouseInfo) => {
|
||||
const mustSee = checked ? 1 : 0;
|
||||
updateHouseInfo({
|
||||
houseId: row.houseId,
|
||||
userId: row.userId,
|
||||
mustSee
|
||||
})
|
||||
.then((msg) => {
|
||||
row.mustSee = mustSee;
|
||||
message.success(msg);
|
||||
})
|
||||
.catch((e) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选中的房源吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = messageLoading('请求中..', 0);
|
||||
removeBatchHouseInfo(selection.value.map((d) => d.houseId))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: HouseInfo) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
/* 批量下架 */
|
||||
const banBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要下架选中的房源吗?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = messageLoading('请求中..', 0);
|
||||
updateBatchHouseInfo({
|
||||
ids: selection.value.map((d) => d.houseId),
|
||||
data: {
|
||||
status: 10
|
||||
}
|
||||
})
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: HouseInfo) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
// console.log(record);
|
||||
},
|
||||
// 行双击事件
|
||||
onDblclick: () => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
watch(
|
||||
currentRoute,
|
||||
(route) => {
|
||||
const {query} = unref(route);
|
||||
if (query.type) {
|
||||
type.value = Number(query.type);
|
||||
}
|
||||
reload();
|
||||
},
|
||||
{immediate: true}
|
||||
);
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'HouseInfo'
|
||||
};
|
||||
export default {
|
||||
name: 'HouseInfo'
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.user-box {
|
||||
.user-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.user-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: start;
|
||||
}
|
||||
flex-direction: column;
|
||||
align-items: start;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<a-upload
|
||||
v-model:file-list="fileList"
|
||||
name="file"
|
||||
action="https://server.websoft.top/api/oss/upload"
|
||||
action="http://192.168.222.129:8000/api/oss/upload"
|
||||
:headers="headers"
|
||||
@change="onUpload"
|
||||
>
|
||||
|
||||
@@ -167,7 +167,6 @@
|
||||
image: undefined,
|
||||
content: undefined,
|
||||
files: undefined,
|
||||
comments: undefined,
|
||||
recommend: undefined,
|
||||
status: undefined,
|
||||
deleted: undefined,
|
||||
@@ -175,11 +174,7 @@
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
pwlProjectLibraryId: undefined,
|
||||
pwlProjectLibraryName: '',
|
||||
status: 0,
|
||||
comments: '',
|
||||
sortNumber: 100
|
||||
comments: ''
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||
<ele-pro-table
|
||||
ref="tableRef"
|
||||
row-key="pwlProjectLibraryId"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:datasource="datasource"
|
||||
:customRow="customRow"
|
||||
@@ -224,7 +224,7 @@
|
||||
/* 删除单个 */
|
||||
const remove = (row: PwlProjectLibrary) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removePwlProjectLibrary(row.pwlProjectLibraryId)
|
||||
removePwlProjectLibrary(row.id)
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
@@ -249,7 +249,7 @@
|
||||
maskClosable: true,
|
||||
onOk: () => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeBatchPwlProjectLibrary(selection.value.map((d) => d.pwlProjectLibraryId))
|
||||
removeBatchPwlProjectLibrary(selection.value.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
hide();
|
||||
message.success(msg);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="ele-text-center">
|
||||
<span>只能上传xls、xlsx文件,</span>
|
||||
<a
|
||||
href="https://server.websoft.top/api/system/user/import/template"
|
||||
href="http://192.168.222.129:8000/api/system/user/import/template"
|
||||
download="用户导入模板.xlsx"
|
||||
>
|
||||
下载导入模板
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<div class="ele-text-center">
|
||||
<span>只能上传xls、xlsx文件,</span>
|
||||
<a
|
||||
href="https://server.websoft.top/api/system/user/import/template"
|
||||
href="http://192.168.222.129:8000/api/system/user/import/template"
|
||||
download="用户导入模板.xlsx"
|
||||
>
|
||||
下载导入模板
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
</div>
|
||||
<a-form-item label="request合法域名" name="request">
|
||||
<a-input-group compact>
|
||||
<a-input :value="`https://server.websoft.top;https://cms-api.websoft.top;`" placeholder="请输入小程序AppSecret" style="width: calc(100% - 50px)" />
|
||||
<a-input :value="`http://192.168.222.129:8000;https://cms-api.websoft.top;`" placeholder="请输入小程序AppSecret" style="width: calc(100% - 50px)" />
|
||||
<a-tooltip title="复制">
|
||||
<a-button @click="onCopyText(`https://server.websoft.top;https://cms-api.websoft.top;`)">
|
||||
<a-button @click="onCopyText(`http://192.168.222.129:8000;https://cms-api.websoft.top;`)">
|
||||
<template #icon><CopyOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
@@ -44,12 +44,12 @@
|
||||
<a-form-item label="网页授权域名" name="authorize">
|
||||
<a-input-group compact>
|
||||
<a-input
|
||||
:value="`https://server.websoft.top`"
|
||||
:value="`http://192.168.222.129:8000`"
|
||||
placeholder="请输入网页授权域名"
|
||||
style="width: calc(100% - 50px)"
|
||||
/>
|
||||
<a-tooltip title="复制">
|
||||
<a-button @click="onCopyText(`https://server.websoft.top`)">
|
||||
<a-button @click="onCopyText(`http://192.168.222.129:8000`)">
|
||||
<template #icon><CopyOutlined /></template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
@@ -68,7 +68,7 @@ export default defineConfig(({ command }) => {
|
||||
// 代理配置
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: process.env.VITE_API_URL || 'https://server.websoft.top',
|
||||
target: process.env.VITE_API_URL || 'http://192.168.222.129:8000',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
configure: (proxy, _options) => {
|
||||
|
||||
Reference in New Issue
Block a user