@ -1,7 +1,7 @@ | |||||
NODE_ENV=development | |||||
VUE_APP_API_BASE_URL=http://localhost:8000/api/ | |||||
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas | |||||
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview | |||||
# 微应用列表必须VUE_APP_SUB_开头,jeecg-app-1为子应用的项目名称,也是子应用的路由父路径 | |||||
VUE_APP_SUB_jeecg-app-1 = '//localhost:8092' | |||||
NODE_ENV=development | |||||
VUE_APP_API_BASE_URL=http://localhost:8001/api/ | |||||
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas | |||||
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview | |||||
# 微应用列表必须VUE_APP_SUB_开头,jeecg-app-1为子应用的项目名称,也是子应用的路由父路径 | |||||
VUE_APP_SUB_jeecg-app-1 = '//localhost:8092' |
@ -1,4 +1,4 @@ | |||||
NODE_ENV=production | |||||
VUE_APP_API_BASE_URL=http://localhost:8000/api/ | |||||
VUE_APP_CAS_BASE_URL=http://localhost:8888/cas | |||||
NODE_ENV=production | |||||
VUE_APP_API_BASE_URL=http://localhost:8001/api/ | |||||
VUE_APP_CAS_BASE_URL=http://localhost:8888/cas | |||||
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview | VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview |
@ -0,0 +1,171 @@ | |||||
package org.jeecg.modules.cityMoneyLog.controller; | |||||
import java.util.Arrays; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.stream.Collectors; | |||||
import java.io.IOException; | |||||
import java.io.UnsupportedEncodingException; | |||||
import java.net.URLDecoder; | |||||
import javax.servlet.http.HttpServletRequest; | |||||
import javax.servlet.http.HttpServletResponse; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.common.system.query.QueryGenerator; | |||||
import org.jeecg.common.util.oConvertUtils; | |||||
import org.jeecg.modules.cityMoneyLog.entity.CityMoneyLog; | |||||
import org.jeecg.modules.cityMoneyLog.service.ICityMoneyLogService; | |||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.jeecgframework.poi.excel.ExcelImportUtil; | |||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||||
import org.jeecgframework.poi.excel.entity.ExportParams; | |||||
import org.jeecgframework.poi.excel.entity.ImportParams; | |||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||||
import org.jeecg.common.system.base.controller.JeecgController; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import org.springframework.web.multipart.MultipartFile; | |||||
import org.springframework.web.multipart.MultipartHttpServletRequest; | |||||
import org.springframework.web.servlet.ModelAndView; | |||||
import com.alibaba.fastjson.JSON; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import org.jeecg.common.aspect.annotation.AutoLog; | |||||
/** | |||||
* @Description: 佣金流水 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-04 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Api(tags="佣金流水") | |||||
@RestController | |||||
@RequestMapping("/cityMoneyLog/cityMoneyLog") | |||||
@Slf4j | |||||
public class CityMoneyLogController extends JeecgController<CityMoneyLog, ICityMoneyLogService> { | |||||
@Autowired | |||||
private ICityMoneyLogService cityMoneyLogService; | |||||
/** | |||||
* 分页列表查询 | |||||
* | |||||
* @param cityMoneyLog | |||||
* @param pageNo | |||||
* @param pageSize | |||||
* @param req | |||||
* @return | |||||
*/ | |||||
//@AutoLog(value = "佣金流水-分页列表查询") | |||||
@ApiOperation(value="佣金流水-分页列表查询", notes="佣金流水-分页列表查询") | |||||
@GetMapping(value = "/list") | |||||
public Result<IPage<CityMoneyLog>> queryPageList(CityMoneyLog cityMoneyLog, | |||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||||
HttpServletRequest req) { | |||||
QueryWrapper<CityMoneyLog> queryWrapper = QueryGenerator.initQueryWrapper(cityMoneyLog, req.getParameterMap()); | |||||
Page<CityMoneyLog> page = new Page<CityMoneyLog>(pageNo, pageSize); | |||||
IPage<CityMoneyLog> pageList = cityMoneyLogService.page(page, queryWrapper); | |||||
return Result.OK(pageList); | |||||
} | |||||
/** | |||||
* 添加 | |||||
* | |||||
* @param cityMoneyLog | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "佣金流水-添加") | |||||
@ApiOperation(value="佣金流水-添加", notes="佣金流水-添加") | |||||
@PostMapping(value = "/add") | |||||
public Result<String> add(@RequestBody CityMoneyLog cityMoneyLog) { | |||||
cityMoneyLogService.save(cityMoneyLog); | |||||
return Result.OK("添加成功!"); | |||||
} | |||||
/** | |||||
* 编辑 | |||||
* | |||||
* @param cityMoneyLog | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "佣金流水-编辑") | |||||
@ApiOperation(value="佣金流水-编辑", notes="佣金流水-编辑") | |||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||||
public Result<String> edit(@RequestBody CityMoneyLog cityMoneyLog) { | |||||
cityMoneyLogService.updateById(cityMoneyLog); | |||||
return Result.OK("编辑成功!"); | |||||
} | |||||
/** | |||||
* 通过id删除 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "佣金流水-通过id删除") | |||||
@ApiOperation(value="佣金流水-通过id删除", notes="佣金流水-通过id删除") | |||||
@DeleteMapping(value = "/delete") | |||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||||
cityMoneyLogService.removeById(id); | |||||
return Result.OK("删除成功!"); | |||||
} | |||||
/** | |||||
* 批量删除 | |||||
* | |||||
* @param ids | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "佣金流水-批量删除") | |||||
@ApiOperation(value="佣金流水-批量删除", notes="佣金流水-批量删除") | |||||
@DeleteMapping(value = "/deleteBatch") | |||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||||
this.cityMoneyLogService.removeByIds(Arrays.asList(ids.split(","))); | |||||
return Result.OK("批量删除成功!"); | |||||
} | |||||
/** | |||||
* 通过id查询 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
//@AutoLog(value = "佣金流水-通过id查询") | |||||
@ApiOperation(value="佣金流水-通过id查询", notes="佣金流水-通过id查询") | |||||
@GetMapping(value = "/queryById") | |||||
public Result<CityMoneyLog> queryById(@RequestParam(name="id",required=true) String id) { | |||||
CityMoneyLog cityMoneyLog = cityMoneyLogService.getById(id); | |||||
if(cityMoneyLog==null) { | |||||
return Result.error("未找到对应数据"); | |||||
} | |||||
return Result.OK(cityMoneyLog); | |||||
} | |||||
/** | |||||
* 导出excel | |||||
* | |||||
* @param request | |||||
* @param cityMoneyLog | |||||
*/ | |||||
@RequestMapping(value = "/exportXls") | |||||
public ModelAndView exportXls(HttpServletRequest request, CityMoneyLog cityMoneyLog) { | |||||
return super.exportXls(request, cityMoneyLog, CityMoneyLog.class, "佣金流水"); | |||||
} | |||||
/** | |||||
* 通过excel导入数据 | |||||
* | |||||
* @param request | |||||
* @param response | |||||
* @return | |||||
*/ | |||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||||
return super.importExcel(request, response, CityMoneyLog.class); | |||||
} | |||||
} |
@ -0,0 +1,70 @@ | |||||
package org.jeecg.modules.cityMoneyLog.entity; | |||||
import java.io.Serializable; | |||||
import java.io.UnsupportedEncodingException; | |||||
import java.util.Date; | |||||
import java.math.BigDecimal; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.Data; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
import org.jeecg.common.aspect.annotation.Dict; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
/** | |||||
* @Description: 佣金流水 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-04 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Data | |||||
@TableName("city_money_log") | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = false) | |||||
@ApiModel(value="city_money_log对象", description="佣金流水") | |||||
public class CityMoneyLog implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/**主键*/ | |||||
@TableId(type = IdType.ASSIGN_ID) | |||||
@ApiModelProperty(value = "主键") | |||||
private java.lang.String id; | |||||
/**创建人*/ | |||||
@ApiModelProperty(value = "创建人") | |||||
private java.lang.String createBy; | |||||
/**创建日期*/ | |||||
@ApiModelProperty(value = "创建日期") | |||||
private java.util.Date createTime; | |||||
/**更新人*/ | |||||
@ApiModelProperty(value = "更新人") | |||||
private java.lang.String updateBy; | |||||
/**更新日期*/ | |||||
@ApiModelProperty(value = "更新日期") | |||||
private java.util.Date updateTime; | |||||
/**所属部门*/ | |||||
@ApiModelProperty(value = "所属部门") | |||||
private java.lang.String sysOrgCode; | |||||
/**金额*/ | |||||
@Excel(name = "金额", width = 15) | |||||
@ApiModelProperty(value = "金额") | |||||
private java.math.BigDecimal intger; | |||||
/**用户*/ | |||||
@Excel(name = "用户", width = 15, dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||||
@Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") | |||||
@ApiModelProperty(value = "用户") | |||||
private java.lang.String userId; | |||||
/**类型0获得1消耗*/ | |||||
@Excel(name = "类型0获得1消耗", width = 15) | |||||
@ApiModelProperty(value = "类型0获得1消耗") | |||||
private java.lang.Integer type; | |||||
/**名称*/ | |||||
@Excel(name = "名称", width = 15) | |||||
@ApiModelProperty(value = "名称") | |||||
private java.lang.String title; | |||||
} |
@ -0,0 +1,17 @@ | |||||
package org.jeecg.modules.cityMoneyLog.mapper; | |||||
import java.util.List; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.jeecg.modules.cityMoneyLog.entity.CityMoneyLog; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
/** | |||||
* @Description: 佣金流水 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-04 | |||||
* @Version: V1.0 | |||||
*/ | |||||
public interface CityMoneyLogMapper extends BaseMapper<CityMoneyLog> { | |||||
} |
@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="org.jeecg.modules.cityMoneyLog.mapper.CityMoneyLogMapper"> | |||||
</mapper> |
@ -0,0 +1,14 @@ | |||||
package org.jeecg.modules.cityMoneyLog.service; | |||||
import org.jeecg.modules.cityMoneyLog.entity.CityMoneyLog; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* @Description: 佣金流水 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-04 | |||||
* @Version: V1.0 | |||||
*/ | |||||
public interface ICityMoneyLogService extends IService<CityMoneyLog> { | |||||
} |
@ -0,0 +1,19 @@ | |||||
package org.jeecg.modules.cityMoneyLog.service.impl; | |||||
import org.jeecg.modules.cityMoneyLog.entity.CityMoneyLog; | |||||
import org.jeecg.modules.cityMoneyLog.mapper.CityMoneyLogMapper; | |||||
import org.jeecg.modules.cityMoneyLog.service.ICityMoneyLogService; | |||||
import org.springframework.stereotype.Service; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
/** | |||||
* @Description: 佣金流水 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-04 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Service | |||||
public class CityMoneyLogServiceImpl extends ServiceImpl<CityMoneyLogMapper, CityMoneyLog> implements ICityMoneyLogService { | |||||
} |
@ -0,0 +1,190 @@ | |||||
<template> | |||||
<a-card :bordered="false"> | |||||
<!-- 查询区域 --> | |||||
<div class="table-page-search-wrapper"> | |||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> | |||||
<a-row :gutter="24"> | |||||
</a-row> | |||||
</a-form> | |||||
</div> | |||||
<!-- 查询区域-END --> | |||||
<!-- 操作按钮区域 --> | |||||
<div class="table-operator"> | |||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||||
<a-button type="primary" icon="download" @click="handleExportXls('佣金流水')">导出</a-button> | |||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||||
<a-button type="primary" icon="import">导入</a-button> | |||||
</a-upload> | |||||
<!-- 高级查询区域 --> | |||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||||
<a-dropdown v-if="selectedRowKeys.length > 0"> | |||||
<a-menu slot="overlay"> | |||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||||
</a-menu> | |||||
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||||
</a-dropdown> | |||||
</div> | |||||
<!-- table区域-begin --> | |||||
<div> | |||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||||
</div> | |||||
<a-table | |||||
ref="table" | |||||
size="middle" | |||||
:scroll="{x:true}" | |||||
bordered | |||||
rowKey="id" | |||||
:columns="columns" | |||||
:dataSource="dataSource" | |||||
:pagination="ipagination" | |||||
:loading="loading" | |||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||||
class="j-table-force-nowrap" | |||||
@change="handleTableChange"> | |||||
<template slot="htmlSlot" slot-scope="text"> | |||||
<div v-html="text"></div> | |||||
</template> | |||||
<template slot="imgSlot" slot-scope="text,record"> | |||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||||
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||||
</template> | |||||
<template slot="fileSlot" slot-scope="text"> | |||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||||
<a-button | |||||
v-else | |||||
:ghost="true" | |||||
type="primary" | |||||
icon="download" | |||||
size="small" | |||||
@click="downloadFile(text)"> | |||||
下载 | |||||
</a-button> | |||||
</template> | |||||
<span slot="action" slot-scope="text, record"> | |||||
<a @click="handleEdit(record)">编辑</a> | |||||
<a-divider type="vertical" /> | |||||
<a-dropdown> | |||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||||
<a-menu slot="overlay"> | |||||
<a-menu-item> | |||||
<a @click="handleDetail(record)">详情</a> | |||||
</a-menu-item> | |||||
<a-menu-item> | |||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||||
<a>删除</a> | |||||
</a-popconfirm> | |||||
</a-menu-item> | |||||
</a-menu> | |||||
</a-dropdown> | |||||
</span> | |||||
</a-table> | |||||
</div> | |||||
<city-money-log-modal ref="modalForm" @ok="modalFormOk"></city-money-log-modal> | |||||
</a-card> | |||||
</template> | |||||
<script> | |||||
import '@/assets/less/TableExpand.less' | |||||
import { mixinDevice } from '@/utils/mixin' | |||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||||
import CityMoneyLogModal from './modules/CityMoneyLogModal' | |||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||||
export default { | |||||
name: 'CityMoneyLogList', | |||||
mixins:[JeecgListMixin, mixinDevice], | |||||
components: { | |||||
CityMoneyLogModal | |||||
}, | |||||
data () { | |||||
return { | |||||
description: '佣金流水管理页面', | |||||
// 表头 | |||||
columns: [ | |||||
{ | |||||
title: '#', | |||||
dataIndex: '', | |||||
key:'rowIndex', | |||||
width:60, | |||||
align:"center", | |||||
customRender:function (t,r,index) { | |||||
return parseInt(index)+1; | |||||
} | |||||
}, | |||||
{ | |||||
title:'金额', | |||||
align:"center", | |||||
dataIndex: 'intger' | |||||
}, | |||||
{ | |||||
title:'用户', | |||||
align:"center", | |||||
dataIndex: 'userId_dictText' | |||||
}, | |||||
{ | |||||
title:'类型0获得1消耗', | |||||
align:"center", | |||||
dataIndex: 'type' | |||||
}, | |||||
{ | |||||
title:'名称', | |||||
align:"center", | |||||
dataIndex: 'title' | |||||
}, | |||||
{ | |||||
title: '操作', | |||||
dataIndex: 'action', | |||||
align:"center", | |||||
fixed:"right", | |||||
width:147, | |||||
scopedSlots: { customRender: 'action' } | |||||
} | |||||
], | |||||
url: { | |||||
list: "/cityMoneyLog/cityMoneyLog/list", | |||||
delete: "/cityMoneyLog/cityMoneyLog/delete", | |||||
deleteBatch: "/cityMoneyLog/cityMoneyLog/deleteBatch", | |||||
exportXlsUrl: "/cityMoneyLog/cityMoneyLog/exportXls", | |||||
importExcelUrl: "cityMoneyLog/cityMoneyLog/importExcel", | |||||
}, | |||||
dictOptions:{}, | |||||
superFieldList:[], | |||||
} | |||||
}, | |||||
created() { | |||||
this.getSuperFieldList(); | |||||
}, | |||||
computed: { | |||||
importExcelUrl: function(){ | |||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||||
}, | |||||
}, | |||||
methods: { | |||||
initDictConfig(){ | |||||
}, | |||||
getSuperFieldList(){ | |||||
let fieldList=[]; | |||||
fieldList.push({type:'BigDecimal',value:'intger',text:'金额',dictCode:''}) | |||||
fieldList.push({type:'sel_search',value:'userId',text:'用户',dictTable:"han_hai_member", dictText:'nick_name', dictCode:'id'}) | |||||
fieldList.push({type:'int',value:'type',text:'类型0获得1消耗',dictCode:''}) | |||||
fieldList.push({type:'string',value:'title',text:'名称',dictCode:''}) | |||||
this.superFieldList = fieldList | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style scoped> | |||||
@import '~@assets/less/common.less'; | |||||
</style> |
@ -0,0 +1,119 @@ | |||||
<template> | |||||
<a-spin :spinning="confirmLoading"> | |||||
<j-form-container :disabled="formDisabled"> | |||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||||
<a-row> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="intger"> | |||||
<a-input-number v-model="model.intger" placeholder="请输入金额" style="width: 100%" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId"> | |||||
<j-search-select-tag v-model="model.userId" dict="han_hai_member,nick_name,id" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="类型0获得1消耗" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="type"> | |||||
<a-input-number v-model="model.type" placeholder="请输入类型0获得1消耗" style="width: 100%" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||||
<a-input v-model="model.title" placeholder="请输入名称" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
</a-row> | |||||
</a-form-model> | |||||
</j-form-container> | |||||
</a-spin> | |||||
</template> | |||||
<script> | |||||
import { httpAction, getAction } from '@/api/manage' | |||||
import { validateDuplicateValue } from '@/utils/util' | |||||
export default { | |||||
name: 'CityMoneyLogForm', | |||||
components: { | |||||
}, | |||||
props: { | |||||
//表单禁用 | |||||
disabled: { | |||||
type: Boolean, | |||||
default: false, | |||||
required: false | |||||
} | |||||
}, | |||||
data () { | |||||
return { | |||||
model:{ | |||||
}, | |||||
labelCol: { | |||||
xs: { span: 24 }, | |||||
sm: { span: 5 }, | |||||
}, | |||||
wrapperCol: { | |||||
xs: { span: 24 }, | |||||
sm: { span: 16 }, | |||||
}, | |||||
confirmLoading: false, | |||||
validatorRules: { | |||||
}, | |||||
url: { | |||||
add: "/cityMoneyLog/cityMoneyLog/add", | |||||
edit: "/cityMoneyLog/cityMoneyLog/edit", | |||||
queryById: "/cityMoneyLog/cityMoneyLog/queryById" | |||||
} | |||||
} | |||||
}, | |||||
computed: { | |||||
formDisabled(){ | |||||
return this.disabled | |||||
}, | |||||
}, | |||||
created () { | |||||
//备份model原始值 | |||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||||
}, | |||||
methods: { | |||||
add () { | |||||
this.edit(this.modelDefault); | |||||
}, | |||||
edit (record) { | |||||
this.model = Object.assign({}, record); | |||||
this.visible = true; | |||||
}, | |||||
submitForm () { | |||||
const that = this; | |||||
// 触发表单验证 | |||||
this.$refs.form.validate(valid => { | |||||
if (valid) { | |||||
that.confirmLoading = true; | |||||
let httpurl = ''; | |||||
let method = ''; | |||||
if(!this.model.id){ | |||||
httpurl+=this.url.add; | |||||
method = 'post'; | |||||
}else{ | |||||
httpurl+=this.url.edit; | |||||
method = 'put'; | |||||
} | |||||
httpAction(httpurl,this.model,method).then((res)=>{ | |||||
if(res.success){ | |||||
that.$message.success(res.message); | |||||
that.$emit('ok'); | |||||
}else{ | |||||
that.$message.warning(res.message); | |||||
} | |||||
}).finally(() => { | |||||
that.confirmLoading = false; | |||||
}) | |||||
} | |||||
}) | |||||
}, | |||||
} | |||||
} | |||||
</script> |
@ -0,0 +1,84 @@ | |||||
<template> | |||||
<a-drawer | |||||
:title="title" | |||||
:width="width" | |||||
placement="right" | |||||
:closable="false" | |||||
@close="close" | |||||
destroyOnClose | |||||
:visible="visible"> | |||||
<city-money-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></city-money-log-form> | |||||
<div class="drawer-footer"> | |||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||||
</div> | |||||
</a-drawer> | |||||
</template> | |||||
<script> | |||||
import CityMoneyLogForm from './CityMoneyLogForm' | |||||
export default { | |||||
name: 'CityMoneyLogModal', | |||||
components: { | |||||
CityMoneyLogForm | |||||
}, | |||||
data () { | |||||
return { | |||||
title:"操作", | |||||
width:800, | |||||
visible: false, | |||||
disableSubmit: false | |||||
} | |||||
}, | |||||
methods: { | |||||
add () { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.add(); | |||||
}) | |||||
}, | |||||
edit (record) { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.edit(record); | |||||
}); | |||||
}, | |||||
close () { | |||||
this.$emit('close'); | |||||
this.visible = false; | |||||
}, | |||||
submitCallback(){ | |||||
this.$emit('ok'); | |||||
this.visible = false; | |||||
}, | |||||
handleOk () { | |||||
this.$refs.realForm.submitForm(); | |||||
}, | |||||
handleCancel () { | |||||
this.close() | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less" scoped> | |||||
/** Button按钮间距 */ | |||||
.ant-btn { | |||||
margin-left: 30px; | |||||
margin-bottom: 30px; | |||||
float: right; | |||||
} | |||||
.drawer-footer{ | |||||
position: absolute; | |||||
bottom: -8px; | |||||
width: 100%; | |||||
border-top: 1px solid #e8e8e8; | |||||
padding: 10px 16px; | |||||
text-align: right; | |||||
left: 0; | |||||
background: #fff; | |||||
border-radius: 0 0 2px 2px; | |||||
} | |||||
</style> |
@ -0,0 +1,60 @@ | |||||
<template> | |||||
<j-modal | |||||
:title="title" | |||||
:width="width" | |||||
:visible="visible" | |||||
switchFullscreen | |||||
@ok="handleOk" | |||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||||
@cancel="handleCancel" | |||||
cancelText="关闭"> | |||||
<city-money-log-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></city-money-log-form> | |||||
</j-modal> | |||||
</template> | |||||
<script> | |||||
import CityMoneyLogForm from './CityMoneyLogForm' | |||||
export default { | |||||
name: 'CityMoneyLogModal', | |||||
components: { | |||||
CityMoneyLogForm | |||||
}, | |||||
data () { | |||||
return { | |||||
title:'', | |||||
width:800, | |||||
visible: false, | |||||
disableSubmit: false | |||||
} | |||||
}, | |||||
methods: { | |||||
add () { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.add(); | |||||
}) | |||||
}, | |||||
edit (record) { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.edit(record); | |||||
}) | |||||
}, | |||||
close () { | |||||
this.$emit('close'); | |||||
this.visible = false; | |||||
}, | |||||
handleOk () { | |||||
this.$refs.realForm.submitForm(); | |||||
}, | |||||
submitCallback(){ | |||||
this.$emit('ok'); | |||||
this.visible = false; | |||||
}, | |||||
handleCancel () { | |||||
this.close() | |||||
} | |||||
} | |||||
} | |||||
</script> |
@ -0,0 +1,61 @@ | |||||
import {defHttp} from '/@/utils/http/axios'; | |||||
import {Modal} from 'ant-design-vue'; | |||||
enum Api { | |||||
list = '/cityMoneyLog/cityMoneyLog/list', | |||||
save='/cityMoneyLog/cityMoneyLog/add', | |||||
edit='/cityMoneyLog/cityMoneyLog/edit', | |||||
deleteOne = '/cityMoneyLog/cityMoneyLog/delete', | |||||
deleteBatch = '/cityMoneyLog/cityMoneyLog/deleteBatch', | |||||
importExcel = '/cityMoneyLog/cityMoneyLog/importExcel', | |||||
exportXls = '/cityMoneyLog/cityMoneyLog/exportXls', | |||||
} | |||||
/** | |||||
* 导出api | |||||
* @param params | |||||
*/ | |||||
export const getExportUrl = Api.exportXls; | |||||
/** | |||||
* 导入api | |||||
*/ | |||||
export const getImportUrl = Api.importExcel; | |||||
/** | |||||
* 列表接口 | |||||
* @param params | |||||
*/ | |||||
export const list = (params) => | |||||
defHttp.get({url: Api.list, params}); | |||||
/** | |||||
* 删除单个 | |||||
*/ | |||||
export const deleteOne = (params,handleSuccess) => { | |||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||||
handleSuccess(); | |||||
}); | |||||
} | |||||
/** | |||||
* 批量删除 | |||||
* @param params | |||||
*/ | |||||
export const batchDelete = (params, handleSuccess) => { | |||||
Modal.confirm({ | |||||
title: '确认删除', | |||||
content: '是否删除选中数据', | |||||
okText: '确认', | |||||
cancelText: '取消', | |||||
onOk: () => { | |||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||||
handleSuccess(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
/** | |||||
* 保存或者更新 | |||||
* @param params | |||||
*/ | |||||
export const saveOrUpdate = (params, isUpdate) => { | |||||
let url = isUpdate ? Api.edit : Api.save; | |||||
return defHttp.post({url: url, params}); | |||||
} |
@ -0,0 +1,56 @@ | |||||
import {BasicColumn} from '/@/components/Table'; | |||||
import {FormSchema} from '/@/components/Table'; | |||||
import { rules} from '/@/utils/helper/validator'; | |||||
import { render } from '/@/utils/common/renderUtils'; | |||||
//列表数据 | |||||
export const columns: BasicColumn[] = [ | |||||
{ | |||||
title: '金额', | |||||
align:"center", | |||||
dataIndex: 'intger' | |||||
}, | |||||
{ | |||||
title: '用户', | |||||
align:"center", | |||||
dataIndex: 'userId_dictText' | |||||
}, | |||||
{ | |||||
title: '类型0获得1消耗', | |||||
align:"center", | |||||
dataIndex: 'type' | |||||
}, | |||||
{ | |||||
title: '名称', | |||||
align:"center", | |||||
dataIndex: 'title' | |||||
}, | |||||
]; | |||||
//查询数据 | |||||
export const searchFormSchema: FormSchema[] = [ | |||||
]; | |||||
//表单数据 | |||||
export const formSchema: FormSchema[] = [ | |||||
{ | |||||
label: '金额', | |||||
field: 'intger', | |||||
component: 'InputNumber', | |||||
}, | |||||
{ | |||||
label: '用户', | |||||
field: 'userId', | |||||
component: 'JSearchSelect', | |||||
componentProps:{ | |||||
dict:"han_hai_member,nick_name,id" | |||||
}, | |||||
}, | |||||
{ | |||||
label: '类型0获得1消耗', | |||||
field: 'type', | |||||
component: 'InputNumber', | |||||
}, | |||||
{ | |||||
label: '名称', | |||||
field: 'title', | |||||
component: 'Input', | |||||
}, | |||||
]; |
@ -0,0 +1,162 @@ | |||||
<template> | |||||
<div> | |||||
<!--引用表格--> | |||||
<BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||||
<!--插槽:table标题--> | |||||
<template #tableTitle> | |||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||||
<a-dropdown v-if="checkedKeys.length > 0"> | |||||
<template #overlay> | |||||
<a-menu> | |||||
<a-menu-item key="1" @click="batchHandleDelete"> | |||||
<Icon icon="ant-design:delete-outlined"></Icon> | |||||
删除 | |||||
</a-menu-item> | |||||
</a-menu> | |||||
</template> | |||||
<a-button>批量操作 | |||||
<Icon icon="mdi:chevron-down"></Icon> | |||||
</a-button> | |||||
</a-dropdown> | |||||
</template> | |||||
<!--操作栏--> | |||||
<template #action="{ record }"> | |||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||||
</template> | |||||
<!--字段回显插槽--> | |||||
<template #htmlSlot="{text}"> | |||||
<div v-html="text"></div> | |||||
</template> | |||||
<template #fileSlot="{text}"> | |||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||||
</template> | |||||
</BasicTable> | |||||
<!-- 表单区域 --> | |||||
<CityMoneyLogModal @register="registerModal" @success="handleSuccess"></CityMoneyLogModal> | |||||
</div> | |||||
</template> | |||||
<script lang="ts" name="cityMoneyLog-cityMoneyLog" setup> | |||||
import {ref, computed, unref} from 'vue'; | |||||
import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||||
import {useModal} from '/@/components/Modal'; | |||||
import { useListPage } from '/@/hooks/system/useListPage' | |||||
import CityMoneyLogModal from './components/CityMoneyLogModal.vue' | |||||
import {columns, searchFormSchema} from './cityMoneyLog.data'; | |||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './cityMoneyLog.api'; | |||||
const checkedKeys = ref<Array<string | number>>([]); | |||||
//注册model | |||||
const [registerModal, {openModal}] = useModal(); | |||||
//注册table数据 | |||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||||
tableProps:{ | |||||
title: '佣金流水', | |||||
api: list, | |||||
columns, | |||||
canResize:false, | |||||
formConfig: { | |||||
labelWidth: 120, | |||||
schemas: searchFormSchema, | |||||
autoSubmitOnEnter:true, | |||||
showAdvancedButton:true, | |||||
fieldMapToTime: [ | |||||
], | |||||
}, | |||||
actionColumn: { | |||||
width: 120, | |||||
}, | |||||
}, | |||||
exportConfig: { | |||||
name:"佣金流水", | |||||
url: getExportUrl, | |||||
}, | |||||
importConfig: { | |||||
url: getImportUrl | |||||
}, | |||||
}) | |||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||||
/** | |||||
* 新增事件 | |||||
*/ | |||||
function handleAdd() { | |||||
openModal(true, { | |||||
isUpdate: false, | |||||
showFooter: true, | |||||
}); | |||||
} | |||||
/** | |||||
* 编辑事件 | |||||
*/ | |||||
function handleEdit(record: Recordable) { | |||||
openModal(true, { | |||||
record, | |||||
isUpdate: true, | |||||
showFooter: true, | |||||
}); | |||||
} | |||||
/** | |||||
* 详情 | |||||
*/ | |||||
function handleDetail(record: Recordable) { | |||||
openModal(true, { | |||||
record, | |||||
isUpdate: true, | |||||
showFooter: false, | |||||
}); | |||||
} | |||||
/** | |||||
* 删除事件 | |||||
*/ | |||||
async function handleDelete(record) { | |||||
await deleteOne({id: record.id}, reload); | |||||
} | |||||
/** | |||||
* 批量删除事件 | |||||
*/ | |||||
async function batchHandleDelete() { | |||||
await batchDelete({ids: checkedKeys.value}, reload); | |||||
} | |||||
/** | |||||
* 成功回调 | |||||
*/ | |||||
function handleSuccess() { | |||||
reload(); | |||||
} | |||||
/** | |||||
* 操作栏 | |||||
*/ | |||||
function getTableAction(record){ | |||||
return [ | |||||
{ | |||||
label: '编辑', | |||||
onClick: handleEdit.bind(null, record), | |||||
} | |||||
] | |||||
} | |||||
/** | |||||
* 下拉操作栏 | |||||
*/ | |||||
function getDropDownAction(record){ | |||||
return [ | |||||
{ | |||||
label: '详情', | |||||
onClick: handleDetail.bind(null, record), | |||||
}, { | |||||
label: '删除', | |||||
popConfirm: { | |||||
title: '是否确认删除', | |||||
confirm: handleDelete.bind(null, record), | |||||
} | |||||
} | |||||
] | |||||
} | |||||
</script> | |||||
<style scoped> | |||||
</style> |
@ -0,0 +1,58 @@ | |||||
<template> | |||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||||
<BasicForm @register="registerForm"/> | |||||
</BasicModal> | |||||
</template> | |||||
<script lang="ts" setup> | |||||
import {ref, computed, unref} from 'vue'; | |||||
import {BasicModal, useModalInner} from '/@/components/Modal'; | |||||
import {BasicForm, useForm} from '/@/components/Form/index'; | |||||
import {formSchema} from '../cityMoneyLog.data'; | |||||
import {saveOrUpdate} from '../cityMoneyLog.api'; | |||||
// Emits声明 | |||||
const emit = defineEmits(['register','success']); | |||||
const isUpdate = ref(true); | |||||
//表单配置 | |||||
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||||
labelWidth: 150, | |||||
schemas: formSchema, | |||||
showActionButtonGroup: false, | |||||
}); | |||||
//表单赋值 | |||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||||
//重置表单 | |||||
await resetFields(); | |||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||||
isUpdate.value = !!data?.isUpdate; | |||||
if (unref(isUpdate)) { | |||||
//表单赋值 | |||||
await setFieldsValue({ | |||||
...data.record, | |||||
}); | |||||
} | |||||
// 隐藏底部时禁用整个表单 | |||||
setProps({ disabled: !data?.showFooter }) | |||||
}); | |||||
//设置标题 | |||||
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||||
//表单提交事件 | |||||
async function handleSubmit(v) { | |||||
try { | |||||
let values = await validate(); | |||||
setModalProps({confirmLoading: true}); | |||||
//提交表单 | |||||
await saveOrUpdate(values, isUpdate.value); | |||||
//关闭弹窗 | |||||
closeModal(); | |||||
//刷新列表 | |||||
emit('success'); | |||||
} finally { | |||||
setModalProps({confirmLoading: false}); | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less" scoped> | |||||
</style> |
@ -0,0 +1,171 @@ | |||||
package org.jeecg.modules.commonHome.controller; | |||||
import java.util.Arrays; | |||||
import java.util.List; | |||||
import java.util.Map; | |||||
import java.util.stream.Collectors; | |||||
import java.io.IOException; | |||||
import java.io.UnsupportedEncodingException; | |||||
import java.net.URLDecoder; | |||||
import javax.servlet.http.HttpServletRequest; | |||||
import javax.servlet.http.HttpServletResponse; | |||||
import org.jeecg.common.api.vo.Result; | |||||
import org.jeecg.common.system.query.QueryGenerator; | |||||
import org.jeecg.common.util.oConvertUtils; | |||||
import org.jeecg.modules.commonHome.entity.CommonHome; | |||||
import org.jeecg.modules.commonHome.service.ICommonHomeService; | |||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||||
import com.baomidou.mybatisplus.core.metadata.IPage; | |||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.jeecgframework.poi.excel.ExcelImportUtil; | |||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; | |||||
import org.jeecgframework.poi.excel.entity.ExportParams; | |||||
import org.jeecgframework.poi.excel.entity.ImportParams; | |||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; | |||||
import org.jeecg.common.system.base.controller.JeecgController; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.web.bind.annotation.*; | |||||
import org.springframework.web.multipart.MultipartFile; | |||||
import org.springframework.web.multipart.MultipartHttpServletRequest; | |||||
import org.springframework.web.servlet.ModelAndView; | |||||
import com.alibaba.fastjson.JSON; | |||||
import io.swagger.annotations.Api; | |||||
import io.swagger.annotations.ApiOperation; | |||||
import org.jeecg.common.aspect.annotation.AutoLog; | |||||
/** | |||||
* @Description: 房源信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-03 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Api(tags="房源信息表") | |||||
@RestController | |||||
@RequestMapping("/commonHome/commonHome") | |||||
@Slf4j | |||||
public class CommonHomeController extends JeecgController<CommonHome, ICommonHomeService> { | |||||
@Autowired | |||||
private ICommonHomeService commonHomeService; | |||||
/** | |||||
* 分页列表查询 | |||||
* | |||||
* @param commonHome | |||||
* @param pageNo | |||||
* @param pageSize | |||||
* @param req | |||||
* @return | |||||
*/ | |||||
//@AutoLog(value = "房源信息表-分页列表查询") | |||||
@ApiOperation(value="房源信息表-分页列表查询", notes="房源信息表-分页列表查询") | |||||
@GetMapping(value = "/list") | |||||
public Result<IPage<CommonHome>> queryPageList(CommonHome commonHome, | |||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | |||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | |||||
HttpServletRequest req) { | |||||
QueryWrapper<CommonHome> queryWrapper = QueryGenerator.initQueryWrapper(commonHome, req.getParameterMap()); | |||||
Page<CommonHome> page = new Page<CommonHome>(pageNo, pageSize); | |||||
IPage<CommonHome> pageList = commonHomeService.page(page, queryWrapper); | |||||
return Result.OK(pageList); | |||||
} | |||||
/** | |||||
* 添加 | |||||
* | |||||
* @param commonHome | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "房源信息表-添加") | |||||
@ApiOperation(value="房源信息表-添加", notes="房源信息表-添加") | |||||
@PostMapping(value = "/add") | |||||
public Result<String> add(@RequestBody CommonHome commonHome) { | |||||
commonHomeService.save(commonHome); | |||||
return Result.OK("添加成功!"); | |||||
} | |||||
/** | |||||
* 编辑 | |||||
* | |||||
* @param commonHome | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "房源信息表-编辑") | |||||
@ApiOperation(value="房源信息表-编辑", notes="房源信息表-编辑") | |||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) | |||||
public Result<String> edit(@RequestBody CommonHome commonHome) { | |||||
commonHomeService.updateById(commonHome); | |||||
return Result.OK("编辑成功!"); | |||||
} | |||||
/** | |||||
* 通过id删除 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "房源信息表-通过id删除") | |||||
@ApiOperation(value="房源信息表-通过id删除", notes="房源信息表-通过id删除") | |||||
@DeleteMapping(value = "/delete") | |||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) { | |||||
commonHomeService.removeById(id); | |||||
return Result.OK("删除成功!"); | |||||
} | |||||
/** | |||||
* 批量删除 | |||||
* | |||||
* @param ids | |||||
* @return | |||||
*/ | |||||
@AutoLog(value = "房源信息表-批量删除") | |||||
@ApiOperation(value="房源信息表-批量删除", notes="房源信息表-批量删除") | |||||
@DeleteMapping(value = "/deleteBatch") | |||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { | |||||
this.commonHomeService.removeByIds(Arrays.asList(ids.split(","))); | |||||
return Result.OK("批量删除成功!"); | |||||
} | |||||
/** | |||||
* 通过id查询 | |||||
* | |||||
* @param id | |||||
* @return | |||||
*/ | |||||
//@AutoLog(value = "房源信息表-通过id查询") | |||||
@ApiOperation(value="房源信息表-通过id查询", notes="房源信息表-通过id查询") | |||||
@GetMapping(value = "/queryById") | |||||
public Result<CommonHome> queryById(@RequestParam(name="id",required=true) String id) { | |||||
CommonHome commonHome = commonHomeService.getById(id); | |||||
if(commonHome==null) { | |||||
return Result.error("未找到对应数据"); | |||||
} | |||||
return Result.OK(commonHome); | |||||
} | |||||
/** | |||||
* 导出excel | |||||
* | |||||
* @param request | |||||
* @param commonHome | |||||
*/ | |||||
@RequestMapping(value = "/exportXls") | |||||
public ModelAndView exportXls(HttpServletRequest request, CommonHome commonHome) { | |||||
return super.exportXls(request, commonHome, CommonHome.class, "房源信息表"); | |||||
} | |||||
/** | |||||
* 通过excel导入数据 | |||||
* | |||||
* @param request | |||||
* @param response | |||||
* @return | |||||
*/ | |||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) | |||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { | |||||
return super.importExcel(request, response, CommonHome.class); | |||||
} | |||||
} |
@ -0,0 +1,224 @@ | |||||
package org.jeecg.modules.commonHome.entity; | |||||
import java.io.Serializable; | |||||
import java.io.UnsupportedEncodingException; | |||||
import java.util.Date; | |||||
import java.math.BigDecimal; | |||||
import com.baomidou.mybatisplus.annotation.IdType; | |||||
import com.baomidou.mybatisplus.annotation.TableId; | |||||
import com.baomidou.mybatisplus.annotation.TableName; | |||||
import lombok.Data; | |||||
import com.fasterxml.jackson.annotation.JsonFormat; | |||||
import org.springframework.format.annotation.DateTimeFormat; | |||||
import org.jeecgframework.poi.excel.annotation.Excel; | |||||
import org.jeecg.common.aspect.annotation.Dict; | |||||
import io.swagger.annotations.ApiModel; | |||||
import io.swagger.annotations.ApiModelProperty; | |||||
import lombok.EqualsAndHashCode; | |||||
import lombok.experimental.Accessors; | |||||
/** | |||||
* @Description: 房源信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-03 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Data | |||||
@TableName("common_home") | |||||
@Accessors(chain = true) | |||||
@EqualsAndHashCode(callSuper = false) | |||||
@ApiModel(value="common_home对象", description="房源信息表") | |||||
public class CommonHome implements Serializable { | |||||
private static final long serialVersionUID = 1L; | |||||
/**主键*/ | |||||
@TableId(type = IdType.ASSIGN_ID) | |||||
@ApiModelProperty(value = "主键") | |||||
private java.lang.String id; | |||||
/**创建人*/ | |||||
@ApiModelProperty(value = "创建人") | |||||
private java.lang.String createBy; | |||||
/**创建日期*/ | |||||
@ApiModelProperty(value = "创建日期") | |||||
private java.util.Date createTime; | |||||
/**更新人*/ | |||||
@ApiModelProperty(value = "更新人") | |||||
private java.lang.String updateBy; | |||||
/**更新日期*/ | |||||
@ApiModelProperty(value = "更新日期") | |||||
private java.util.Date updateTime; | |||||
/**图片*/ | |||||
@Excel(name = "图片", width = 15) | |||||
@ApiModelProperty(value = "图片") | |||||
private java.lang.String image; | |||||
/**标题*/ | |||||
@Excel(name = "标题", width = 15) | |||||
@ApiModelProperty(value = "标题") | |||||
private java.lang.String title; | |||||
/**分类标识*/ | |||||
@Excel(name = "分类标识", width = 15, dictTable = "common_class", dicText = "title", dicCode = "id") | |||||
@Dict(dictTable = "common_class", dicText = "title", dicCode = "id") | |||||
@ApiModelProperty(value = "分类标识") | |||||
private java.lang.String classId; | |||||
/**左上角图标*/ | |||||
@Excel(name = "左上角图标", width = 15) | |||||
@ApiModelProperty(value = "左上角图标") | |||||
private java.lang.String iconImage; | |||||
/**标签*/ | |||||
@Excel(name = "标签", width = 15) | |||||
@ApiModelProperty(value = "标签") | |||||
private java.lang.String iconTitle; | |||||
/**价格*/ | |||||
@Excel(name = "价格", width = 15) | |||||
@ApiModelProperty(value = "价格") | |||||
private java.math.BigDecimal price; | |||||
/**单位*/ | |||||
@Excel(name = "单位", width = 15) | |||||
@ApiModelProperty(value = "单位") | |||||
private java.lang.String unit; | |||||
/**地址*/ | |||||
@Excel(name = "地址", width = 15) | |||||
@ApiModelProperty(value = "地址") | |||||
private java.lang.String address; | |||||
/**浏览量*/ | |||||
@Excel(name = "浏览量", width = 15) | |||||
@ApiModelProperty(value = "浏览量") | |||||
private java.lang.Integer num; | |||||
/**年限*/ | |||||
@Excel(name = "年限", width = 15) | |||||
@ApiModelProperty(value = "年限") | |||||
private java.lang.Integer timeGo; | |||||
/**热点名称*/ | |||||
@Excel(name = "热点名称", width = 15) | |||||
@ApiModelProperty(value = "热点名称") | |||||
private java.lang.String iconName; | |||||
/**所属分类*/ | |||||
@Excel(name = "所属分类", width = 15, dictTable = "common_icon_image", dicText = "title", dicCode = "id") | |||||
@Dict(dictTable = "common_icon_image", dicText = "title", dicCode = "id") | |||||
@ApiModelProperty(value = "所属分类") | |||||
private java.lang.String commonClass; | |||||
/**视频*/ | |||||
@Excel(name = "视频", width = 15) | |||||
@ApiModelProperty(value = "视频") | |||||
private java.lang.String homeMp4; | |||||
/**户型*/ | |||||
@Excel(name = "户型", width = 15) | |||||
@ApiModelProperty(value = "户型") | |||||
private java.lang.String homeType; | |||||
/**面积*/ | |||||
@Excel(name = "面积", width = 15) | |||||
@ApiModelProperty(value = "面积") | |||||
private java.lang.String homeMi; | |||||
/**房屋结构*/ | |||||
@Excel(name = "房屋结构", width = 15) | |||||
@ApiModelProperty(value = "房屋结构") | |||||
private java.lang.String homeJg; | |||||
/**房屋编号*/ | |||||
@Excel(name = "房屋编号", width = 15) | |||||
@ApiModelProperty(value = "房屋编号") | |||||
private java.lang.String homeNo; | |||||
/**房屋周边*/ | |||||
@Excel(name = "房屋周边", width = 15) | |||||
@ApiModelProperty(value = "房屋周边") | |||||
private java.lang.String homeBian; | |||||
/**房间数量*/ | |||||
@Excel(name = "房间数量", width = 15) | |||||
@ApiModelProperty(value = "房间数量") | |||||
private java.lang.String homeNum; | |||||
/**菜地*/ | |||||
@Excel(name = "菜地", width = 15) | |||||
@ApiModelProperty(value = "菜地") | |||||
private java.lang.String homeCai; | |||||
/**距离场镇距离*/ | |||||
@Excel(name = "距离场镇距离", width = 15) | |||||
@ApiModelProperty(value = "距离场镇距离") | |||||
private java.lang.String homeJl; | |||||
/**距离成都西三环*/ | |||||
@Excel(name = "距离成都西三环", width = 15) | |||||
@ApiModelProperty(value = "距离成都西三环") | |||||
private java.lang.String homeShjl; | |||||
/**房屋主体是否改造*/ | |||||
@Excel(name = "房屋主体是否改造", width = 15) | |||||
@ApiModelProperty(value = "房屋主体是否改造") | |||||
private java.lang.String homeGz; | |||||
/**房屋面积*/ | |||||
@Excel(name = "房屋面积", width = 15) | |||||
@ApiModelProperty(value = "房屋面积") | |||||
private java.lang.String homeMj; | |||||
/**院子总面积*/ | |||||
@Excel(name = "院子总面积", width = 15) | |||||
@ApiModelProperty(value = "院子总面积") | |||||
private java.lang.String homeYzmj; | |||||
/**房屋朝向及海拔*/ | |||||
@Excel(name = "房屋朝向及海拔", width = 15) | |||||
@ApiModelProperty(value = "房屋朝向及海拔") | |||||
private java.lang.String homeHb; | |||||
/**是否经过安置*/ | |||||
@Excel(name = "是否经过安置", width = 15) | |||||
@ApiModelProperty(value = "是否经过安置") | |||||
private java.lang.String homeAz; | |||||
/**交通*/ | |||||
@Excel(name = "交通", width = 15) | |||||
@ApiModelProperty(value = "交通") | |||||
private java.lang.String homeJt; | |||||
/**坟包及电塔 工厂噪音*/ | |||||
@Excel(name = "坟包及电塔 工厂噪音", width = 15) | |||||
@ApiModelProperty(value = "坟包及电塔 工厂噪音") | |||||
private java.lang.String homeZy; | |||||
/**水电气网*/ | |||||
@Excel(name = "水电气网", width = 15) | |||||
@ApiModelProperty(value = "水电气网") | |||||
private java.lang.String homeSd; | |||||
/**停车*/ | |||||
@Excel(name = "停车", width = 15) | |||||
@ApiModelProperty(value = "停车") | |||||
private java.lang.String homeCat; | |||||
/**付款方式及押金*/ | |||||
@Excel(name = "付款方式及押金", width = 15) | |||||
@ApiModelProperty(value = "付款方式及押金") | |||||
private java.lang.String homePay; | |||||
/**租期*/ | |||||
@Excel(name = "租期", width = 15) | |||||
@ApiModelProperty(value = "租期") | |||||
private java.lang.String homeTime; | |||||
/**非正常死亡*/ | |||||
@Excel(name = "非正常死亡", width = 15) | |||||
@ApiModelProperty(value = "非正常死亡") | |||||
private java.lang.String homeSw; | |||||
/**邻居对房东评价*/ | |||||
@Excel(name = "邻居对房东评价", width = 15) | |||||
@ApiModelProperty(value = "邻居对房东评价") | |||||
private java.lang.String homePj; | |||||
/**佣金*/ | |||||
@Excel(name = "佣金", width = 15) | |||||
@ApiModelProperty(value = "佣金") | |||||
private java.math.BigDecimal homeMoney; | |||||
/**钥匙*/ | |||||
@Excel(name = "钥匙", width = 15) | |||||
@ApiModelProperty(value = "钥匙") | |||||
private java.lang.Integer homeYs; | |||||
/**户主家庭职业*/ | |||||
@Excel(name = "户主家庭职业", width = 15) | |||||
@ApiModelProperty(value = "户主家庭职业") | |||||
private java.lang.String homeJtzy; | |||||
/**报建手续*/ | |||||
@Excel(name = "报建手续", width = 15) | |||||
@ApiModelProperty(value = "报建手续") | |||||
private java.lang.String homeBjsx; | |||||
/**府市民云房屋信息档案查询*/ | |||||
@Excel(name = "府市民云房屋信息档案查询", width = 15) | |||||
@ApiModelProperty(value = "府市民云房屋信息档案查询") | |||||
private java.lang.String homeTf; | |||||
/**户主年龄*/ | |||||
@Excel(name = "户主年龄", width = 15) | |||||
@ApiModelProperty(value = "户主年龄") | |||||
private java.lang.String homeAge; | |||||
/**产权证照片*/ | |||||
@Excel(name = "产权证照片", width = 15) | |||||
@ApiModelProperty(value = "产权证照片") | |||||
private java.lang.String homeImage; | |||||
/**备注*/ | |||||
@Excel(name = "备注", width = 15) | |||||
@ApiModelProperty(value = "备注") | |||||
private java.lang.String homeBz; | |||||
} |
@ -0,0 +1,17 @@ | |||||
package org.jeecg.modules.commonHome.mapper; | |||||
import java.util.List; | |||||
import org.apache.ibatis.annotations.Param; | |||||
import org.jeecg.modules.commonHome.entity.CommonHome; | |||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
/** | |||||
* @Description: 房源信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-03 | |||||
* @Version: V1.0 | |||||
*/ | |||||
public interface CommonHomeMapper extends BaseMapper<CommonHome> { | |||||
} |
@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="org.jeecg.modules.commonHome.mapper.CommonHomeMapper"> | |||||
</mapper> |
@ -0,0 +1,14 @@ | |||||
package org.jeecg.modules.commonHome.service; | |||||
import org.jeecg.modules.commonHome.entity.CommonHome; | |||||
import com.baomidou.mybatisplus.extension.service.IService; | |||||
/** | |||||
* @Description: 房源信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-03 | |||||
* @Version: V1.0 | |||||
*/ | |||||
public interface ICommonHomeService extends IService<CommonHome> { | |||||
} |
@ -0,0 +1,19 @@ | |||||
package org.jeecg.modules.commonHome.service.impl; | |||||
import org.jeecg.modules.commonHome.entity.CommonHome; | |||||
import org.jeecg.modules.commonHome.mapper.CommonHomeMapper; | |||||
import org.jeecg.modules.commonHome.service.ICommonHomeService; | |||||
import org.springframework.stereotype.Service; | |||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |||||
/** | |||||
* @Description: 房源信息表 | |||||
* @Author: jeecg-boot | |||||
* @Date: 2024-12-03 | |||||
* @Version: V1.0 | |||||
*/ | |||||
@Service | |||||
public class CommonHomeServiceImpl extends ServiceImpl<CommonHomeMapper, CommonHome> implements ICommonHomeService { | |||||
} |
@ -0,0 +1,456 @@ | |||||
<template> | |||||
<a-card :bordered="false"> | |||||
<!-- 查询区域 --> | |||||
<div class="table-page-search-wrapper"> | |||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> | |||||
<a-row :gutter="24"> | |||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||||
<a-form-item label="分类标识"> | |||||
<j-search-select-tag placeholder="请选择分类标识" v-model="queryParam.classId" dict="common_class,title,id"/> | |||||
</a-form-item> | |||||
</a-col> | |||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||||
<a-form-item label="所属分类"> | |||||
<j-search-select-tag placeholder="请选择所属分类" v-model="queryParam.commonClass" dict="common_icon_image,title,id"/> | |||||
</a-form-item> | |||||
</a-col> | |||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> | |||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> | |||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> | |||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> | |||||
<a @click="handleToggleSearch" style="margin-left: 8px"> | |||||
{{ toggleSearchStatus ? '收起' : '展开' }} | |||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> | |||||
</a> | |||||
</span> | |||||
</a-col> | |||||
</a-row> | |||||
</a-form> | |||||
</div> | |||||
<!-- 查询区域-END --> | |||||
<!-- 操作按钮区域 --> | |||||
<div class="table-operator"> | |||||
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> | |||||
<a-button type="primary" icon="download" @click="handleExportXls('房源信息表')">导出</a-button> | |||||
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> | |||||
<a-button type="primary" icon="import">导入</a-button> | |||||
</a-upload> | |||||
<!-- 高级查询区域 --> | |||||
<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> | |||||
<a-dropdown v-if="selectedRowKeys.length > 0"> | |||||
<a-menu slot="overlay"> | |||||
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> | |||||
</a-menu> | |||||
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> | |||||
</a-dropdown> | |||||
</div> | |||||
<!-- table区域-begin --> | |||||
<div> | |||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> | |||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 | |||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> | |||||
</div> | |||||
<a-table | |||||
ref="table" | |||||
size="middle" | |||||
:scroll="{x:true}" | |||||
bordered | |||||
rowKey="id" | |||||
:columns="columns" | |||||
:dataSource="dataSource" | |||||
:pagination="ipagination" | |||||
:loading="loading" | |||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" | |||||
class="j-table-force-nowrap" | |||||
@change="handleTableChange"> | |||||
<template slot="htmlSlot" slot-scope="text"> | |||||
<div v-html="text"></div> | |||||
</template> | |||||
<template slot="imgSlot" slot-scope="text,record"> | |||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> | |||||
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> | |||||
</template> | |||||
<template slot="fileSlot" slot-scope="text"> | |||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||||
<a-button | |||||
v-else | |||||
:ghost="true" | |||||
type="primary" | |||||
icon="download" | |||||
size="small" | |||||
@click="downloadFile(text)"> | |||||
下载 | |||||
</a-button> | |||||
</template> | |||||
<span slot="action" slot-scope="text, record"> | |||||
<a @click="handleEdit(record)">编辑</a> | |||||
<a-divider type="vertical" /> | |||||
<a-dropdown> | |||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> | |||||
<a-menu slot="overlay"> | |||||
<a-menu-item> | |||||
<a @click="handleDetail(record)">详情</a> | |||||
</a-menu-item> | |||||
<a-menu-item> | |||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> | |||||
<a>删除</a> | |||||
</a-popconfirm> | |||||
</a-menu-item> | |||||
</a-menu> | |||||
</a-dropdown> | |||||
</span> | |||||
</a-table> | |||||
</div> | |||||
<common-home-modal ref="modalForm" @ok="modalFormOk"></common-home-modal> | |||||
</a-card> | |||||
</template> | |||||
<script> | |||||
import '@/assets/less/TableExpand.less' | |||||
import { mixinDevice } from '@/utils/mixin' | |||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' | |||||
import CommonHomeModal from './modules/CommonHomeModal' | |||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' | |||||
export default { | |||||
name: 'CommonHomeList', | |||||
mixins:[JeecgListMixin, mixinDevice], | |||||
components: { | |||||
CommonHomeModal | |||||
}, | |||||
data () { | |||||
return { | |||||
description: '房源信息表管理页面', | |||||
// 表头 | |||||
columns: [ | |||||
{ | |||||
title: '#', | |||||
dataIndex: '', | |||||
key:'rowIndex', | |||||
width:60, | |||||
align:"center", | |||||
customRender:function (t,r,index) { | |||||
return parseInt(index)+1; | |||||
} | |||||
}, | |||||
{ | |||||
title:'创建日期', | |||||
align:"center", | |||||
sorter: true, | |||||
dataIndex: 'createTime' | |||||
}, | |||||
{ | |||||
title:'图片', | |||||
align:"center", | |||||
dataIndex: 'image', | |||||
scopedSlots: {customRender: 'imgSlot'} | |||||
}, | |||||
{ | |||||
title:'标题', | |||||
align:"center", | |||||
dataIndex: 'title' | |||||
}, | |||||
{ | |||||
title:'分类标识', | |||||
align:"center", | |||||
dataIndex: 'classId_dictText' | |||||
}, | |||||
{ | |||||
title:'左上角图标', | |||||
align:"center", | |||||
dataIndex: 'iconImage', | |||||
scopedSlots: {customRender: 'imgSlot'} | |||||
}, | |||||
{ | |||||
title:'标签', | |||||
align:"center", | |||||
dataIndex: 'iconTitle' | |||||
}, | |||||
{ | |||||
title:'价格', | |||||
align:"center", | |||||
dataIndex: 'price' | |||||
}, | |||||
{ | |||||
title:'单位', | |||||
align:"center", | |||||
dataIndex: 'unit' | |||||
}, | |||||
{ | |||||
title:'地址', | |||||
align:"center", | |||||
dataIndex: 'address' | |||||
}, | |||||
{ | |||||
title:'浏览量', | |||||
align:"center", | |||||
dataIndex: 'num' | |||||
}, | |||||
{ | |||||
title:'年限', | |||||
align:"center", | |||||
dataIndex: 'timeGo' | |||||
}, | |||||
{ | |||||
title:'热点名称', | |||||
align:"center", | |||||
dataIndex: 'iconName' | |||||
}, | |||||
{ | |||||
title:'所属分类', | |||||
align:"center", | |||||
dataIndex: 'commonClass_dictText' | |||||
}, | |||||
{ | |||||
title:'视频', | |||||
align:"center", | |||||
dataIndex: 'homeMp4', | |||||
scopedSlots: {customRender: 'fileSlot'} | |||||
}, | |||||
{ | |||||
title:'户型', | |||||
align:"center", | |||||
dataIndex: 'homeType' | |||||
}, | |||||
{ | |||||
title:'面积', | |||||
align:"center", | |||||
dataIndex: 'homeMi' | |||||
}, | |||||
{ | |||||
title:'房屋结构', | |||||
align:"center", | |||||
dataIndex: 'homeJg' | |||||
}, | |||||
{ | |||||
title:'房屋编号', | |||||
align:"center", | |||||
dataIndex: 'homeNo' | |||||
}, | |||||
{ | |||||
title:'房屋周边', | |||||
align:"center", | |||||
dataIndex: 'homeBian' | |||||
}, | |||||
{ | |||||
title:'房间数量', | |||||
align:"center", | |||||
dataIndex: 'homeNum' | |||||
}, | |||||
{ | |||||
title:'菜地', | |||||
align:"center", | |||||
dataIndex: 'homeCai' | |||||
}, | |||||
{ | |||||
title:'距离场镇距离', | |||||
align:"center", | |||||
dataIndex: 'homeJl' | |||||
}, | |||||
{ | |||||
title:'距离成都西三环', | |||||
align:"center", | |||||
dataIndex: 'homeShjl' | |||||
}, | |||||
{ | |||||
title:'房屋主体是否改造', | |||||
align:"center", | |||||
dataIndex: 'homeGz' | |||||
}, | |||||
{ | |||||
title:'房屋面积', | |||||
align:"center", | |||||
dataIndex: 'homeMj' | |||||
}, | |||||
{ | |||||
title:'院子总面积', | |||||
align:"center", | |||||
dataIndex: 'homeYzmj' | |||||
}, | |||||
{ | |||||
title:'房屋朝向及海拔', | |||||
align:"center", | |||||
dataIndex: 'homeHb' | |||||
}, | |||||
{ | |||||
title:'是否经过安置', | |||||
align:"center", | |||||
dataIndex: 'homeAz' | |||||
}, | |||||
{ | |||||
title:'交通', | |||||
align:"center", | |||||
dataIndex: 'homeJt' | |||||
}, | |||||
{ | |||||
title:'坟包及电塔 工厂噪音', | |||||
align:"center", | |||||
dataIndex: 'homeZy' | |||||
}, | |||||
{ | |||||
title:'水电气网', | |||||
align:"center", | |||||
dataIndex: 'homeSd' | |||||
}, | |||||
{ | |||||
title:'停车', | |||||
align:"center", | |||||
dataIndex: 'homeCat' | |||||
}, | |||||
{ | |||||
title:'付款方式及押金', | |||||
align:"center", | |||||
dataIndex: 'homePay' | |||||
}, | |||||
{ | |||||
title:'租期', | |||||
align:"center", | |||||
dataIndex: 'homeTime' | |||||
}, | |||||
{ | |||||
title:'非正常死亡', | |||||
align:"center", | |||||
dataIndex: 'homeSw' | |||||
}, | |||||
{ | |||||
title:'邻居对房东评价', | |||||
align:"center", | |||||
dataIndex: 'homePj' | |||||
}, | |||||
{ | |||||
title:'佣金', | |||||
align:"center", | |||||
dataIndex: 'homeMoney' | |||||
}, | |||||
{ | |||||
title:'钥匙', | |||||
align:"center", | |||||
dataIndex: 'homeYs' | |||||
}, | |||||
{ | |||||
title:'户主家庭职业', | |||||
align:"center", | |||||
dataIndex: 'homeJtzy' | |||||
}, | |||||
{ | |||||
title:'报建手续', | |||||
align:"center", | |||||
dataIndex: 'homeBjsx' | |||||
}, | |||||
{ | |||||
title:'府市民云房屋信息档案查询', | |||||
align:"center", | |||||
dataIndex: 'homeTf', | |||||
scopedSlots: {customRender: 'imgSlot'} | |||||
}, | |||||
{ | |||||
title:'户主年龄', | |||||
align:"center", | |||||
dataIndex: 'homeAge' | |||||
}, | |||||
{ | |||||
title:'产权证照片', | |||||
align:"center", | |||||
dataIndex: 'homeImage', | |||||
scopedSlots: {customRender: 'imgSlot'} | |||||
}, | |||||
{ | |||||
title:'备注', | |||||
align:"center", | |||||
dataIndex: 'homeBz' | |||||
}, | |||||
{ | |||||
title: '操作', | |||||
dataIndex: 'action', | |||||
align:"center", | |||||
fixed:"right", | |||||
width:147, | |||||
scopedSlots: { customRender: 'action' } | |||||
} | |||||
], | |||||
url: { | |||||
list: "/commonHome/commonHome/list", | |||||
delete: "/commonHome/commonHome/delete", | |||||
deleteBatch: "/commonHome/commonHome/deleteBatch", | |||||
exportXlsUrl: "/commonHome/commonHome/exportXls", | |||||
importExcelUrl: "commonHome/commonHome/importExcel", | |||||
}, | |||||
dictOptions:{}, | |||||
superFieldList:[], | |||||
} | |||||
}, | |||||
created() { | |||||
this.getSuperFieldList(); | |||||
}, | |||||
computed: { | |||||
importExcelUrl: function(){ | |||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; | |||||
}, | |||||
}, | |||||
methods: { | |||||
initDictConfig(){ | |||||
}, | |||||
getSuperFieldList(){ | |||||
let fieldList=[]; | |||||
fieldList.push({type:'datetime',value:'createTime',text:'创建日期'}) | |||||
fieldList.push({type:'Text',value:'image',text:'图片',dictCode:''}) | |||||
fieldList.push({type:'string',value:'title',text:'标题',dictCode:''}) | |||||
fieldList.push({type:'sel_search',value:'classId',text:'分类标识',dictTable:"common_class", dictText:'title', dictCode:'id'}) | |||||
fieldList.push({type:'Text',value:'iconImage',text:'左上角图标',dictCode:''}) | |||||
fieldList.push({type:'string',value:'iconTitle',text:'标签',dictCode:''}) | |||||
fieldList.push({type:'BigDecimal',value:'price',text:'价格',dictCode:''}) | |||||
fieldList.push({type:'string',value:'unit',text:'单位',dictCode:''}) | |||||
fieldList.push({type:'string',value:'address',text:'地址',dictCode:''}) | |||||
fieldList.push({type:'int',value:'num',text:'浏览量',dictCode:''}) | |||||
fieldList.push({type:'int',value:'timeGo',text:'年限',dictCode:''}) | |||||
fieldList.push({type:'string',value:'iconName',text:'热点名称',dictCode:''}) | |||||
fieldList.push({type:'sel_search',value:'commonClass',text:'所属分类',dictTable:"common_icon_image", dictText:'title', dictCode:'id'}) | |||||
fieldList.push({type:'Text',value:'homeMp4',text:'视频',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeType',text:'户型',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeMi',text:'面积',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeJg',text:'房屋结构',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeNo',text:'房屋编号',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeBian',text:'房屋周边',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeNum',text:'房间数量',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeCai',text:'菜地',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeJl',text:'距离场镇距离',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeShjl',text:'距离成都西三环',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeGz',text:'房屋主体是否改造',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeMj',text:'房屋面积',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeYzmj',text:'院子总面积',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeHb',text:'房屋朝向及海拔',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeAz',text:'是否经过安置',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeJt',text:'交通',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeZy',text:'坟包及电塔 工厂噪音',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeSd',text:'水电气网',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeCat',text:'停车',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homePay',text:'付款方式及押金',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeTime',text:'租期',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeSw',text:'非正常死亡',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homePj',text:'邻居对房东评价',dictCode:''}) | |||||
fieldList.push({type:'BigDecimal',value:'homeMoney',text:'佣金',dictCode:''}) | |||||
fieldList.push({type:'int',value:'homeYs',text:'钥匙',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeJtzy',text:'户主家庭职业',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeBjsx',text:'报建手续',dictCode:''}) | |||||
fieldList.push({type:'Text',value:'homeTf',text:'府市民云房屋信息档案查询',dictCode:''}) | |||||
fieldList.push({type:'string',value:'homeAge',text:'户主年龄',dictCode:''}) | |||||
fieldList.push({type:'Text',value:'homeImage',text:'产权证照片',dictCode:''}) | |||||
fieldList.push({type:'Text',value:'homeBz',text:'备注',dictCode:''}) | |||||
this.superFieldList = fieldList | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style scoped> | |||||
@import '~@assets/less/common.less'; | |||||
</style> |
@ -0,0 +1,314 @@ | |||||
<template> | |||||
<a-spin :spinning="confirmLoading"> | |||||
<j-form-container :disabled="formDisabled"> | |||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> | |||||
<a-row> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="image"> | |||||
<j-image-upload isMultiple v-model="model.image" ></j-image-upload> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="title"> | |||||
<a-input v-model="model.title" placeholder="请输入标题" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="分类标识" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="classId"> | |||||
<j-search-select-tag v-model="model.classId" dict="common_class,title,id" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="左上角图标" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iconImage"> | |||||
<j-image-upload isMultiple v-model="model.iconImage" ></j-image-upload> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="标签" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iconTitle"> | |||||
<a-input v-model="model.iconTitle" placeholder="请输入标签" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="price"> | |||||
<a-input-number v-model="model.price" placeholder="请输入价格" style="width: 100%" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unit"> | |||||
<a-input v-model="model.unit" placeholder="请输入单位" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address"> | |||||
<a-input v-model="model.address" placeholder="请输入地址" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="浏览量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="num"> | |||||
<a-input-number v-model="model.num" placeholder="请输入浏览量" style="width: 100%" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="年限" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="timeGo"> | |||||
<a-input-number v-model="model.timeGo" placeholder="请输入年限" style="width: 100%" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="热点名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iconName"> | |||||
<a-input v-model="model.iconName" placeholder="请输入热点名称" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="所属分类" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="commonClass"> | |||||
<j-search-select-tag v-model="model.commonClass" dict="common_icon_image,title,id" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="视频" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeMp4"> | |||||
<j-upload v-model="model.homeMp4" ></j-upload> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="户型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeType"> | |||||
<a-input v-model="model.homeType" placeholder="请输入户型" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeMi"> | |||||
<a-input v-model="model.homeMi" placeholder="请输入面积" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="房屋结构" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeJg"> | |||||
<a-input v-model="model.homeJg" placeholder="请输入房屋结构" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="房屋编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeNo"> | |||||
<a-input v-model="model.homeNo" placeholder="请输入房屋编号" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="房屋周边" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeBian"> | |||||
<a-input v-model="model.homeBian" placeholder="请输入房屋周边" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="房间数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeNum"> | |||||
<a-input v-model="model.homeNum" placeholder="请输入房间数量" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="菜地" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeCai"> | |||||
<a-input v-model="model.homeCai" placeholder="请输入菜地" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="距离场镇距离" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeJl"> | |||||
<a-input v-model="model.homeJl" placeholder="请输入距离场镇距离" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="距离成都西三环" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeShjl"> | |||||
<a-input v-model="model.homeShjl" placeholder="请输入距离成都西三环" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="房屋主体是否改造" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeGz"> | |||||
<a-input v-model="model.homeGz" placeholder="请输入房屋主体是否改造" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="房屋面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeMj"> | |||||
<a-input v-model="model.homeMj" placeholder="请输入房屋面积" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="院子总面积" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeYzmj"> | |||||
<a-input v-model="model.homeYzmj" placeholder="请输入院子总面积" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="房屋朝向及海拔" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeHb"> | |||||
<a-input v-model="model.homeHb" placeholder="请输入房屋朝向及海拔" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="是否经过安置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeAz"> | |||||
<a-input v-model="model.homeAz" placeholder="请输入是否经过安置" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="交通" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeJt"> | |||||
<a-input v-model="model.homeJt" placeholder="请输入交通" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="坟包及电塔 工厂噪音" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeZy"> | |||||
<a-input v-model="model.homeZy" placeholder="请输入坟包及电塔 工厂噪音" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="水电气网" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeSd"> | |||||
<a-input v-model="model.homeSd" placeholder="请输入水电气网" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="停车" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeCat"> | |||||
<a-input v-model="model.homeCat" placeholder="请输入停车" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="付款方式及押金" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homePay"> | |||||
<a-input v-model="model.homePay" placeholder="请输入付款方式及押金" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="租期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeTime"> | |||||
<a-input v-model="model.homeTime" placeholder="请输入租期" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="非正常死亡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeSw"> | |||||
<a-input v-model="model.homeSw" placeholder="请输入非正常死亡" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="邻居对房东评价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homePj"> | |||||
<a-input v-model="model.homePj" placeholder="请输入邻居对房东评价" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="佣金" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeMoney"> | |||||
<a-input-number v-model="model.homeMoney" placeholder="请输入佣金" style="width: 100%" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="钥匙" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeYs"> | |||||
<a-input-number v-model="model.homeYs" placeholder="请输入钥匙" style="width: 100%" /> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="户主家庭职业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeJtzy"> | |||||
<a-input v-model="model.homeJtzy" placeholder="请输入户主家庭职业" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="报建手续" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeBjsx"> | |||||
<a-input v-model="model.homeBjsx" placeholder="请输入报建手续" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="府市民云房屋信息档案查询" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeTf"> | |||||
<j-image-upload isMultiple v-model="model.homeTf" ></j-image-upload> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="户主年龄" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeAge"> | |||||
<a-input v-model="model.homeAge" placeholder="请输入户主年龄" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="产权证照片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeImage"> | |||||
<j-image-upload isMultiple v-model="model.homeImage" ></j-image-upload> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
<a-col :span="24"> | |||||
<a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="homeBz"> | |||||
<a-input v-model="model.homeBz" placeholder="请输入备注" ></a-input> | |||||
</a-form-model-item> | |||||
</a-col> | |||||
</a-row> | |||||
</a-form-model> | |||||
</j-form-container> | |||||
</a-spin> | |||||
</template> | |||||
<script> | |||||
import { httpAction, getAction } from '@/api/manage' | |||||
import { validateDuplicateValue } from '@/utils/util' | |||||
export default { | |||||
name: 'CommonHomeForm', | |||||
components: { | |||||
}, | |||||
props: { | |||||
//表单禁用 | |||||
disabled: { | |||||
type: Boolean, | |||||
default: false, | |||||
required: false | |||||
} | |||||
}, | |||||
data () { | |||||
return { | |||||
model:{ | |||||
}, | |||||
labelCol: { | |||||
xs: { span: 24 }, | |||||
sm: { span: 5 }, | |||||
}, | |||||
wrapperCol: { | |||||
xs: { span: 24 }, | |||||
sm: { span: 16 }, | |||||
}, | |||||
confirmLoading: false, | |||||
validatorRules: { | |||||
}, | |||||
url: { | |||||
add: "/commonHome/commonHome/add", | |||||
edit: "/commonHome/commonHome/edit", | |||||
queryById: "/commonHome/commonHome/queryById" | |||||
} | |||||
} | |||||
}, | |||||
computed: { | |||||
formDisabled(){ | |||||
return this.disabled | |||||
}, | |||||
}, | |||||
created () { | |||||
//备份model原始值 | |||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); | |||||
}, | |||||
methods: { | |||||
add () { | |||||
this.edit(this.modelDefault); | |||||
}, | |||||
edit (record) { | |||||
this.model = Object.assign({}, record); | |||||
this.visible = true; | |||||
}, | |||||
submitForm () { | |||||
const that = this; | |||||
// 触发表单验证 | |||||
this.$refs.form.validate(valid => { | |||||
if (valid) { | |||||
that.confirmLoading = true; | |||||
let httpurl = ''; | |||||
let method = ''; | |||||
if(!this.model.id){ | |||||
httpurl+=this.url.add; | |||||
method = 'post'; | |||||
}else{ | |||||
httpurl+=this.url.edit; | |||||
method = 'put'; | |||||
} | |||||
httpAction(httpurl,this.model,method).then((res)=>{ | |||||
if(res.success){ | |||||
that.$message.success(res.message); | |||||
that.$emit('ok'); | |||||
}else{ | |||||
that.$message.warning(res.message); | |||||
} | |||||
}).finally(() => { | |||||
that.confirmLoading = false; | |||||
}) | |||||
} | |||||
}) | |||||
}, | |||||
} | |||||
} | |||||
</script> |
@ -0,0 +1,84 @@ | |||||
<template> | |||||
<a-drawer | |||||
:title="title" | |||||
:width="width" | |||||
placement="right" | |||||
:closable="false" | |||||
@close="close" | |||||
destroyOnClose | |||||
:visible="visible"> | |||||
<common-home-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></common-home-form> | |||||
<div class="drawer-footer"> | |||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> | |||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> | |||||
</div> | |||||
</a-drawer> | |||||
</template> | |||||
<script> | |||||
import CommonHomeForm from './CommonHomeForm' | |||||
export default { | |||||
name: 'CommonHomeModal', | |||||
components: { | |||||
CommonHomeForm | |||||
}, | |||||
data () { | |||||
return { | |||||
title:"操作", | |||||
width:800, | |||||
visible: false, | |||||
disableSubmit: false | |||||
} | |||||
}, | |||||
methods: { | |||||
add () { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.add(); | |||||
}) | |||||
}, | |||||
edit (record) { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.edit(record); | |||||
}); | |||||
}, | |||||
close () { | |||||
this.$emit('close'); | |||||
this.visible = false; | |||||
}, | |||||
submitCallback(){ | |||||
this.$emit('ok'); | |||||
this.visible = false; | |||||
}, | |||||
handleOk () { | |||||
this.$refs.realForm.submitForm(); | |||||
}, | |||||
handleCancel () { | |||||
this.close() | |||||
} | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less" scoped> | |||||
/** Button按钮间距 */ | |||||
.ant-btn { | |||||
margin-left: 30px; | |||||
margin-bottom: 30px; | |||||
float: right; | |||||
} | |||||
.drawer-footer{ | |||||
position: absolute; | |||||
bottom: -8px; | |||||
width: 100%; | |||||
border-top: 1px solid #e8e8e8; | |||||
padding: 10px 16px; | |||||
text-align: right; | |||||
left: 0; | |||||
background: #fff; | |||||
border-radius: 0 0 2px 2px; | |||||
} | |||||
</style> |
@ -0,0 +1,60 @@ | |||||
<template> | |||||
<j-modal | |||||
:title="title" | |||||
:width="width" | |||||
:visible="visible" | |||||
switchFullscreen | |||||
@ok="handleOk" | |||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" | |||||
@cancel="handleCancel" | |||||
cancelText="关闭"> | |||||
<common-home-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></common-home-form> | |||||
</j-modal> | |||||
</template> | |||||
<script> | |||||
import CommonHomeForm from './CommonHomeForm' | |||||
export default { | |||||
name: 'CommonHomeModal', | |||||
components: { | |||||
CommonHomeForm | |||||
}, | |||||
data () { | |||||
return { | |||||
title:'', | |||||
width:800, | |||||
visible: false, | |||||
disableSubmit: false | |||||
} | |||||
}, | |||||
methods: { | |||||
add () { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.add(); | |||||
}) | |||||
}, | |||||
edit (record) { | |||||
this.visible=true | |||||
this.$nextTick(()=>{ | |||||
this.$refs.realForm.edit(record); | |||||
}) | |||||
}, | |||||
close () { | |||||
this.$emit('close'); | |||||
this.visible = false; | |||||
}, | |||||
handleOk () { | |||||
this.$refs.realForm.submitForm(); | |||||
}, | |||||
submitCallback(){ | |||||
this.$emit('ok'); | |||||
this.visible = false; | |||||
}, | |||||
handleCancel () { | |||||
this.close() | |||||
} | |||||
} | |||||
} | |||||
</script> |
@ -0,0 +1,61 @@ | |||||
import {defHttp} from '/@/utils/http/axios'; | |||||
import {Modal} from 'ant-design-vue'; | |||||
enum Api { | |||||
list = '/commonHome/commonHome/list', | |||||
save='/commonHome/commonHome/add', | |||||
edit='/commonHome/commonHome/edit', | |||||
deleteOne = '/commonHome/commonHome/delete', | |||||
deleteBatch = '/commonHome/commonHome/deleteBatch', | |||||
importExcel = '/commonHome/commonHome/importExcel', | |||||
exportXls = '/commonHome/commonHome/exportXls', | |||||
} | |||||
/** | |||||
* 导出api | |||||
* @param params | |||||
*/ | |||||
export const getExportUrl = Api.exportXls; | |||||
/** | |||||
* 导入api | |||||
*/ | |||||
export const getImportUrl = Api.importExcel; | |||||
/** | |||||
* 列表接口 | |||||
* @param params | |||||
*/ | |||||
export const list = (params) => | |||||
defHttp.get({url: Api.list, params}); | |||||
/** | |||||
* 删除单个 | |||||
*/ | |||||
export const deleteOne = (params,handleSuccess) => { | |||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { | |||||
handleSuccess(); | |||||
}); | |||||
} | |||||
/** | |||||
* 批量删除 | |||||
* @param params | |||||
*/ | |||||
export const batchDelete = (params, handleSuccess) => { | |||||
Modal.confirm({ | |||||
title: '确认删除', | |||||
content: '是否删除选中数据', | |||||
okText: '确认', | |||||
cancelText: '取消', | |||||
onOk: () => { | |||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { | |||||
handleSuccess(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
/** | |||||
* 保存或者更新 | |||||
* @param params | |||||
*/ | |||||
export const saveOrUpdate = (params, isUpdate) => { | |||||
let url = isUpdate ? Api.edit : Api.save; | |||||
return defHttp.post({url: url, params}); | |||||
} |
@ -0,0 +1,488 @@ | |||||
import {BasicColumn} from '/@/components/Table'; | |||||
import {FormSchema} from '/@/components/Table'; | |||||
import { rules} from '/@/utils/helper/validator'; | |||||
import { render } from '/@/utils/common/renderUtils'; | |||||
//列表数据 | |||||
export const columns: BasicColumn[] = [ | |||||
{ | |||||
title: '创建日期', | |||||
align:"center", | |||||
sorter: true, | |||||
dataIndex: 'createTime' | |||||
}, | |||||
{ | |||||
title: '图片', | |||||
align:"center", | |||||
dataIndex: 'image', | |||||
customRender:render.renderAvatar, | |||||
}, | |||||
{ | |||||
title: '标题', | |||||
align:"center", | |||||
dataIndex: 'title' | |||||
}, | |||||
{ | |||||
title: '分类标识', | |||||
align:"center", | |||||
dataIndex: 'classId_dictText' | |||||
}, | |||||
{ | |||||
title: '左上角图标', | |||||
align:"center", | |||||
dataIndex: 'iconImage', | |||||
customRender:render.renderAvatar, | |||||
}, | |||||
{ | |||||
title: '标签', | |||||
align:"center", | |||||
dataIndex: 'iconTitle' | |||||
}, | |||||
{ | |||||
title: '价格', | |||||
align:"center", | |||||
dataIndex: 'price' | |||||
}, | |||||
{ | |||||
title: '单位', | |||||
align:"center", | |||||
dataIndex: 'unit' | |||||
}, | |||||
{ | |||||
title: '地址', | |||||
align:"center", | |||||
dataIndex: 'address' | |||||
}, | |||||
{ | |||||
title: '浏览量', | |||||
align:"center", | |||||
dataIndex: 'num' | |||||
}, | |||||
{ | |||||
title: '年限', | |||||
align:"center", | |||||
dataIndex: 'timeGo' | |||||
}, | |||||
{ | |||||
title: '热点名称', | |||||
align:"center", | |||||
dataIndex: 'iconName' | |||||
}, | |||||
{ | |||||
title: '所属分类', | |||||
align:"center", | |||||
dataIndex: 'commonClass_dictText' | |||||
}, | |||||
{ | |||||
title: '视频', | |||||
align:"center", | |||||
dataIndex: 'homeMp4', | |||||
slots: { customRender: 'fileSlot' }, | |||||
}, | |||||
{ | |||||
title: '户型', | |||||
align:"center", | |||||
dataIndex: 'homeType' | |||||
}, | |||||
{ | |||||
title: '面积', | |||||
align:"center", | |||||
dataIndex: 'homeMi' | |||||
}, | |||||
{ | |||||
title: '房屋结构', | |||||
align:"center", | |||||
dataIndex: 'homeJg' | |||||
}, | |||||
{ | |||||
title: '房屋编号', | |||||
align:"center", | |||||
dataIndex: 'homeNo' | |||||
}, | |||||
{ | |||||
title: '房屋周边', | |||||
align:"center", | |||||
dataIndex: 'homeBian' | |||||
}, | |||||
{ | |||||
title: '房间数量', | |||||
align:"center", | |||||
dataIndex: 'homeNum' | |||||
}, | |||||
{ | |||||
title: '菜地', | |||||
align:"center", | |||||
dataIndex: 'homeCai' | |||||
}, | |||||
{ | |||||
title: '距离场镇距离', | |||||
align:"center", | |||||
dataIndex: 'homeJl' | |||||
}, | |||||
{ | |||||
title: '距离成都西三环', | |||||
align:"center", | |||||
dataIndex: 'homeShjl' | |||||
}, | |||||
{ | |||||
title: '房屋主体是否改造', | |||||
align:"center", | |||||
dataIndex: 'homeGz' | |||||
}, | |||||
{ | |||||
title: '房屋面积', | |||||
align:"center", | |||||
dataIndex: 'homeMj' | |||||
}, | |||||
{ | |||||
title: '院子总面积', | |||||
align:"center", | |||||
dataIndex: 'homeYzmj' | |||||
}, | |||||
{ | |||||
title: '房屋朝向及海拔', | |||||
align:"center", | |||||
dataIndex: 'homeHb' | |||||
}, | |||||
{ | |||||
title: '是否经过安置', | |||||
align:"center", | |||||
dataIndex: 'homeAz' | |||||
}, | |||||
{ | |||||
title: '交通', | |||||
align:"center", | |||||
dataIndex: 'homeJt' | |||||
}, | |||||
{ | |||||
title: '坟包及电塔 工厂噪音', | |||||
align:"center", | |||||
dataIndex: 'homeZy' | |||||
}, | |||||
{ | |||||
title: '水电气网', | |||||
align:"center", | |||||
dataIndex: 'homeSd' | |||||
}, | |||||
{ | |||||
title: '停车', | |||||
align:"center", | |||||
dataIndex: 'homeCat' | |||||
}, | |||||
{ | |||||
title: '付款方式及押金', | |||||
align:"center", | |||||
dataIndex: 'homePay' | |||||
}, | |||||
{ | |||||
title: '租期', | |||||
align:"center", | |||||
dataIndex: 'homeTime' | |||||
}, | |||||
{ | |||||
title: '非正常死亡', | |||||
align:"center", | |||||
dataIndex: 'homeSw' | |||||
}, | |||||
{ | |||||
title: '邻居对房东评价', | |||||
align:"center", | |||||
dataIndex: 'homePj' | |||||
}, | |||||
{ | |||||
title: '佣金', | |||||
align:"center", | |||||
dataIndex: 'homeMoney' | |||||
}, | |||||
{ | |||||
title: '钥匙', | |||||
align:"center", | |||||
dataIndex: 'homeYs' | |||||
}, | |||||
{ | |||||
title: '户主家庭职业', | |||||
align:"center", | |||||
dataIndex: 'homeJtzy' | |||||
}, | |||||
{ | |||||
title: '报建手续', | |||||
align:"center", | |||||
dataIndex: 'homeBjsx' | |||||
}, | |||||
{ | |||||
title: '府市民云房屋信息档案查询', | |||||
align:"center", | |||||
dataIndex: 'homeTf', | |||||
customRender:render.renderAvatar, | |||||
}, | |||||
{ | |||||
title: '户主年龄', | |||||
align:"center", | |||||
dataIndex: 'homeAge' | |||||
}, | |||||
{ | |||||
title: '产权证照片', | |||||
align:"center", | |||||
dataIndex: 'homeImage', | |||||
customRender:render.renderAvatar, | |||||
}, | |||||
{ | |||||
title: '备注', | |||||
align:"center", | |||||
dataIndex: 'homeBz' | |||||
}, | |||||
]; | |||||
//查询数据 | |||||
export const searchFormSchema: FormSchema[] = [ | |||||
{ | |||||
label: "分类标识", | |||||
field: "classId", | |||||
component: 'JSearchSelect', | |||||
componentProps:{ | |||||
dict:"common_class,title,id" | |||||
}, | |||||
colProps: {span: 6}, | |||||
}, | |||||
{ | |||||
label: "所属分类", | |||||
field: "commonClass", | |||||
component: 'JSearchSelect', | |||||
componentProps:{ | |||||
dict:"common_icon_image,title,id" | |||||
}, | |||||
colProps: {span: 6}, | |||||
}, | |||||
]; | |||||
//表单数据 | |||||
export const formSchema: FormSchema[] = [ | |||||
{ | |||||
label: '图片', | |||||
field: 'image', | |||||
component: 'JImageUpload', | |||||
componentProps:{ | |||||
}, | |||||
}, | |||||
{ | |||||
label: '标题', | |||||
field: 'title', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '分类标识', | |||||
field: 'classId', | |||||
component: 'JSearchSelect', | |||||
componentProps:{ | |||||
dict:"common_class,title,id" | |||||
}, | |||||
}, | |||||
{ | |||||
label: '左上角图标', | |||||
field: 'iconImage', | |||||
component: 'JImageUpload', | |||||
componentProps:{ | |||||
}, | |||||
}, | |||||
{ | |||||
label: '标签', | |||||
field: 'iconTitle', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '价格', | |||||
field: 'price', | |||||
component: 'InputNumber', | |||||
}, | |||||
{ | |||||
label: '单位', | |||||
field: 'unit', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '地址', | |||||
field: 'address', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '浏览量', | |||||
field: 'num', | |||||
component: 'InputNumber', | |||||
}, | |||||
{ | |||||
label: '年限', | |||||
field: 'timeGo', | |||||
component: 'InputNumber', | |||||
}, | |||||
{ | |||||
label: '热点名称', | |||||
field: 'iconName', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '所属分类', | |||||
field: 'commonClass', | |||||
component: 'JSearchSelect', | |||||
componentProps:{ | |||||
dict:"common_icon_image,title,id" | |||||
}, | |||||
}, | |||||
{ | |||||
label: '视频', | |||||
field: 'homeMp4', | |||||
component: 'JUpload', | |||||
componentProps:{ | |||||
}, | |||||
}, | |||||
{ | |||||
label: '户型', | |||||
field: 'homeType', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '面积', | |||||
field: 'homeMi', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '房屋结构', | |||||
field: 'homeJg', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '房屋编号', | |||||
field: 'homeNo', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '房屋周边', | |||||
field: 'homeBian', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '房间数量', | |||||
field: 'homeNum', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '菜地', | |||||
field: 'homeCai', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '距离场镇距离', | |||||
field: 'homeJl', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '距离成都西三环', | |||||
field: 'homeShjl', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '房屋主体是否改造', | |||||
field: 'homeGz', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '房屋面积', | |||||
field: 'homeMj', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '院子总面积', | |||||
field: 'homeYzmj', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '房屋朝向及海拔', | |||||
field: 'homeHb', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '是否经过安置', | |||||
field: 'homeAz', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '交通', | |||||
field: 'homeJt', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '坟包及电塔 工厂噪音', | |||||
field: 'homeZy', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '水电气网', | |||||
field: 'homeSd', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '停车', | |||||
field: 'homeCat', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '付款方式及押金', | |||||
field: 'homePay', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '租期', | |||||
field: 'homeTime', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '非正常死亡', | |||||
field: 'homeSw', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '邻居对房东评价', | |||||
field: 'homePj', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '佣金', | |||||
field: 'homeMoney', | |||||
component: 'InputNumber', | |||||
}, | |||||
{ | |||||
label: '钥匙', | |||||
field: 'homeYs', | |||||
component: 'InputNumber', | |||||
}, | |||||
{ | |||||
label: '户主家庭职业', | |||||
field: 'homeJtzy', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '报建手续', | |||||
field: 'homeBjsx', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '府市民云房屋信息档案查询', | |||||
field: 'homeTf', | |||||
component: 'JImageUpload', | |||||
componentProps:{ | |||||
}, | |||||
}, | |||||
{ | |||||
label: '户主年龄', | |||||
field: 'homeAge', | |||||
component: 'Input', | |||||
}, | |||||
{ | |||||
label: '产权证照片', | |||||
field: 'homeImage', | |||||
component: 'JImageUpload', | |||||
componentProps:{ | |||||
}, | |||||
}, | |||||
{ | |||||
label: '备注', | |||||
field: 'homeBz', | |||||
component: 'Input', | |||||
}, | |||||
]; |
@ -0,0 +1,162 @@ | |||||
<template> | |||||
<div> | |||||
<!--引用表格--> | |||||
<BasicTable @register="registerTable" :rowSelection="rowSelection"> | |||||
<!--插槽:table标题--> | |||||
<template #tableTitle> | |||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> | |||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> | |||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button> | |||||
<a-dropdown v-if="checkedKeys.length > 0"> | |||||
<template #overlay> | |||||
<a-menu> | |||||
<a-menu-item key="1" @click="batchHandleDelete"> | |||||
<Icon icon="ant-design:delete-outlined"></Icon> | |||||
删除 | |||||
</a-menu-item> | |||||
</a-menu> | |||||
</template> | |||||
<a-button>批量操作 | |||||
<Icon icon="mdi:chevron-down"></Icon> | |||||
</a-button> | |||||
</a-dropdown> | |||||
</template> | |||||
<!--操作栏--> | |||||
<template #action="{ record }"> | |||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/> | |||||
</template> | |||||
<!--字段回显插槽--> | |||||
<template #htmlSlot="{text}"> | |||||
<div v-html="text"></div> | |||||
</template> | |||||
<template #fileSlot="{text}"> | |||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> | |||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button> | |||||
</template> | |||||
</BasicTable> | |||||
<!-- 表单区域 --> | |||||
<CommonHomeModal @register="registerModal" @success="handleSuccess"></CommonHomeModal> | |||||
</div> | |||||
</template> | |||||
<script lang="ts" name="commonHome-commonHome" setup> | |||||
import {ref, computed, unref} from 'vue'; | |||||
import {BasicTable, useTable, TableAction} from '/@/components/Table'; | |||||
import {useModal} from '/@/components/Modal'; | |||||
import { useListPage } from '/@/hooks/system/useListPage' | |||||
import CommonHomeModal from './components/CommonHomeModal.vue' | |||||
import {columns, searchFormSchema} from './commonHome.data'; | |||||
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './commonHome.api'; | |||||
const checkedKeys = ref<Array<string | number>>([]); | |||||
//注册model | |||||
const [registerModal, {openModal}] = useModal(); | |||||
//注册table数据 | |||||
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({ | |||||
tableProps:{ | |||||
title: '房源信息表', | |||||
api: list, | |||||
columns, | |||||
canResize:false, | |||||
formConfig: { | |||||
labelWidth: 120, | |||||
schemas: searchFormSchema, | |||||
autoSubmitOnEnter:true, | |||||
showAdvancedButton:true, | |||||
fieldMapToTime: [ | |||||
], | |||||
}, | |||||
actionColumn: { | |||||
width: 120, | |||||
}, | |||||
}, | |||||
exportConfig: { | |||||
name:"房源信息表", | |||||
url: getExportUrl, | |||||
}, | |||||
importConfig: { | |||||
url: getImportUrl | |||||
}, | |||||
}) | |||||
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext | |||||
/** | |||||
* 新增事件 | |||||
*/ | |||||
function handleAdd() { | |||||
openModal(true, { | |||||
isUpdate: false, | |||||
showFooter: true, | |||||
}); | |||||
} | |||||
/** | |||||
* 编辑事件 | |||||
*/ | |||||
function handleEdit(record: Recordable) { | |||||
openModal(true, { | |||||
record, | |||||
isUpdate: true, | |||||
showFooter: true, | |||||
}); | |||||
} | |||||
/** | |||||
* 详情 | |||||
*/ | |||||
function handleDetail(record: Recordable) { | |||||
openModal(true, { | |||||
record, | |||||
isUpdate: true, | |||||
showFooter: false, | |||||
}); | |||||
} | |||||
/** | |||||
* 删除事件 | |||||
*/ | |||||
async function handleDelete(record) { | |||||
await deleteOne({id: record.id}, reload); | |||||
} | |||||
/** | |||||
* 批量删除事件 | |||||
*/ | |||||
async function batchHandleDelete() { | |||||
await batchDelete({ids: checkedKeys.value}, reload); | |||||
} | |||||
/** | |||||
* 成功回调 | |||||
*/ | |||||
function handleSuccess() { | |||||
reload(); | |||||
} | |||||
/** | |||||
* 操作栏 | |||||
*/ | |||||
function getTableAction(record){ | |||||
return [ | |||||
{ | |||||
label: '编辑', | |||||
onClick: handleEdit.bind(null, record), | |||||
} | |||||
] | |||||
} | |||||
/** | |||||
* 下拉操作栏 | |||||
*/ | |||||
function getDropDownAction(record){ | |||||
return [ | |||||
{ | |||||
label: '详情', | |||||
onClick: handleDetail.bind(null, record), | |||||
}, { | |||||
label: '删除', | |||||
popConfirm: { | |||||
title: '是否确认删除', | |||||
confirm: handleDelete.bind(null, record), | |||||
} | |||||
} | |||||
] | |||||
} | |||||
</script> | |||||
<style scoped> | |||||
</style> |
@ -0,0 +1,58 @@ | |||||
<template> | |||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" @ok="handleSubmit"> | |||||
<BasicForm @register="registerForm"/> | |||||
</BasicModal> | |||||
</template> | |||||
<script lang="ts" setup> | |||||
import {ref, computed, unref} from 'vue'; | |||||
import {BasicModal, useModalInner} from '/@/components/Modal'; | |||||
import {BasicForm, useForm} from '/@/components/Form/index'; | |||||
import {formSchema} from '../commonHome.data'; | |||||
import {saveOrUpdate} from '../commonHome.api'; | |||||
// Emits声明 | |||||
const emit = defineEmits(['register','success']); | |||||
const isUpdate = ref(true); | |||||
//表单配置 | |||||
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({ | |||||
labelWidth: 150, | |||||
schemas: formSchema, | |||||
showActionButtonGroup: false, | |||||
}); | |||||
//表单赋值 | |||||
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => { | |||||
//重置表单 | |||||
await resetFields(); | |||||
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter}); | |||||
isUpdate.value = !!data?.isUpdate; | |||||
if (unref(isUpdate)) { | |||||
//表单赋值 | |||||
await setFieldsValue({ | |||||
...data.record, | |||||
}); | |||||
} | |||||
// 隐藏底部时禁用整个表单 | |||||
setProps({ disabled: !data?.showFooter }) | |||||
}); | |||||
//设置标题 | |||||
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑')); | |||||
//表单提交事件 | |||||
async function handleSubmit(v) { | |||||
try { | |||||
let values = await validate(); | |||||
setModalProps({confirmLoading: true}); | |||||
//提交表单 | |||||
await saveOrUpdate(values, isUpdate.value); | |||||
//关闭弹窗 | |||||
closeModal(); | |||||
//刷新列表 | |||||
emit('success'); | |||||
} finally { | |||||
setModalProps({confirmLoading: false}); | |||||
} | |||||
} | |||||
</script> | |||||
<style lang="less" scoped> | |||||
</style> |