jeecg-boot 1.1 稳定版本发布

This commit is contained in:
zhangdaihao
2019-04-14 16:20:04 +08:00
parent c0b489a0e7
commit cd327c4895
375 changed files with 48784 additions and 7523 deletions

View File

@ -2,14 +2,19 @@
<a-card :bordered="false">
<!-- 操作按钮区域 -->
<div class="table-operator">
<div class="table-operator" :md="24" :sm="24" style="margin: -25px 0px 10px 0px">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<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-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-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
</div>
@ -22,7 +27,7 @@
<a-table
ref="table"
size="default"
size="middle"
bordered
rowKey="id"
:columns="columns"
@ -34,13 +39,13 @@
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down" />
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item >
<a-menu-item>
<a href="javascript:;" @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
@ -55,238 +60,101 @@
</div>
<!-- table区域-end -->
<!-- 表单区域 -->
<jeecgOrderCustomer-modal ref="JeecgOrderCustomerModal" @ok="modalFormOk"></jeecgOrderCustomer-modal>
<jeecgOrderCustomer-modal ref="modalForm" @ok="modalFormOk"></jeecgOrderCustomer-modal>
</a-card>
</template>
<script>
import JeecgOrderCustomerModal from './form/JeecgOrderCustomerModal'
import { filterObj } from '@/utils/util'
import { deleteAction,getAction } from '@/api/manage'
import JeecgOrderDMainList from './JeecgOrderDMainList'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction} from '@/api/manage'
export default {
name: "JeecgOrderCustomerList",
mixins: [JeecgListMixin],
components: {
JeecgOrderDMainList,
JeecgOrderCustomerModal
},
data () {
data() {
return {
description: '订单客户信息',
// 查询条件
queryParam: {
orderId:null,
},
// 表头
columns: [
{
title: '客户名',
align:"center",
align: "center",
width: 100,
dataIndex: 'name',
key: 'name',
fixed: 'left'
},
{
title: '性别',
align:"center",
align: "center",
dataIndex: 'sex',
customRender:function (text) {
if(text==1){
customRender: function (text) {
if (text == 1) {
return "";
}else if(text==2){
} else if (text == 2) {
return "";
}else{
} else {
return text;
}
}
},
{
title: '身份证号码',
align:"center",
align: "center",
dataIndex: 'idcard',
},
{
title: '电话',
dataIndex: 'telphone',
align:"center",
align: "center",
},
{
title: '操作',
key: 'operation',
align: 'center',
fixed: 'right',
width: 130,
scopedSlots: { customRender: 'action' },
scopedSlots: {customRender: 'action'},
},
],
//数据集
dataSource:[],
// 分页参数
ipagination:{
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + "-" + range[1] + " " + total + ""
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter:{
column: 'createTime',
order: 'desc',
},
loading:false,
selectedRowKeys: [],
selectedRows: [],
url: {
list: "/test/order/queryOrderCustomerListByMainId",
list: "/test/order/listOrderCustomerByMainId",
delete: "/test/order/deleteCustomer",
deleteBatch: "/test/order/deleteBatchCustomer",
},
}
}
},
created() {
this.loadData();
},
methods: {
loadData (arg){
//加载数据 若传入参数1则加载第一页的内容
if(arg===1){
loadData(arg) {
if (arg === 1) {
this.ipagination.current = 1;
}
var params = this.getQueryParams();//查询条件
getAction(this.url.list,{id:params.orderId}).then((res)=>{
if(res.success){
var params = this.getQueryParams();
getAction(this.url.list, {mainId: params.mainId}).then((res) => {
if (res.success) {
this.dataSource = res.result;
/*
this.ipagination.total = res.result.total;
*/
}else{
} else {
this.dataSource = null;
/* this.ipagination.total = 0;*/
}
})
},
getQueryParams(){
var param = Object.assign({}, this.queryParam,this.isorter);
param.orderId = this.queryParam.orderId;
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
return filterObj(param);
},
getQueryField(){
//TODO 字段权限控制
var str = "id,";
for(var a = 0;a<this.columns.length;a++){
str+=","+this.columns[a].dataIndex;
}
return str;
},
onSelectChange (selectedRowKeys,selectionRows) {
this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows;
},
onClearSelected(){
this.selectedRowKeys = [];
this.selectionRows = [];
},
searchQuery(){
getOrderMain(orderId) {
this.queryParam.mainId = orderId;
this.loadData(1);
},
searchReset(){
var that = this;
for(var a in that.queryParam){
that.queryParam[a] = '';
}
that.loadData(1);
handleAdd: function () {
this.$refs.modalForm.add(this.queryParam.mainId);
this.$refs.modalForm.title = "添加客户信息";
},
batchDel: function(){
if(this.selectedRowKeys.length<=0){
this.$message.warning('请选择一条记录!');
return ;
}else{
var ids = "";
for(var a =0;a<this.selectedRowKeys.length;a++){
ids+=this.selectedRowKeys[a]+",";
}
var that = this;
this.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
deleteAction(that.url.deleteBatch,{ids: ids}).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
that.onClearSelected();
}else{
that.$message.warning(res.message);
}
});
}
});
}
},
handleDelete: function(id){
var that = this;
this.$confirm({
title:"确认删除",
content:"是否删除选中数据?",
onOk: function(){
deleteAction(that.url.delete,{id: id}).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.loadData();
}else{
that.$message.warning(res.message);
}
});
}
});
},
handleEdit: function(record){
this.$refs.JeecgOrderCustomerModal.edit(record,'e');
this.$refs.JeecgOrderCustomerModal.title="编辑";
},
handleAdd: function(){
this.$refs.JeecgOrderCustomerModal.add(this.queryParam.orderId);
this.$refs.JeecgOrderCustomerModal.title="添加客户信息";
},
handleDetail: function(record){
this.$refs.JeecgOrderCustomerModal.detail(record);
this.$refs.JeecgOrderCustomerModal.title="添加客户信息";
},
handleTableChange(pagination, filters, sorter){
//分页、排序、筛选变化时触发
console.log(sorter);
//TODO 筛选
if (Object.keys(sorter).length>0){
this.isorter.column = sorter.field;
this.isorter.order = "ascend"==sorter.order?"asc":"desc"
}
this.ipagination = pagination;
this.loadData();
},
modalFormOk () {
// 新增/修改 成功时,重载列表
this.loadData();
},
getOrderMain(orderId){
this.queryParam.orderId = orderId.toString();
this.loadData(1);
}
}
}
</script>
<style scoped>
.ant-card{
.ant-card {
margin-left: -30px;
margin-right: -30px;
}