安虹睿
1 year ago
6 changed files with 1018 additions and 543 deletions
@ -0,0 +1,312 @@ |
|||||
|
<template> |
||||
|
<!-- 组件功能:普通新增编辑(目前只有主表)参数配置从api获取 --> |
||||
|
<el-dialog |
||||
|
:visible.sync="show" |
||||
|
:modal="false" |
||||
|
:modal-append-to-body="false" |
||||
|
:show-close="true" |
||||
|
@close="close" |
||||
|
class="searchPageComponents" |
||||
|
:fullscreen="true" |
||||
|
style="width:calc(100% - 28px);left:14px;top:14px;height:calc(100% - 28px)" |
||||
|
v-loading="Loading.addEditApiLoading" |
||||
|
> |
||||
|
<!-- 表单 --> |
||||
|
<div v-if="active === 0" style="height: 100%;"> |
||||
|
<!-- 标题 --> |
||||
|
<div class="dialogOuterTitle">{{formTitle}}</div> |
||||
|
<!-- 表单 --> |
||||
|
<el-form |
||||
|
class="addEditFrom" |
||||
|
ref="addEditFrom_Ref" |
||||
|
v-if="formData" |
||||
|
:model="formData" |
||||
|
:rules="formRules" |
||||
|
> |
||||
|
<el-row :gutter="40"> |
||||
|
<el-col |
||||
|
:span="item.colSpan || 12" |
||||
|
v-for="(item, index) in formItemData" |
||||
|
:key="index" |
||||
|
> |
||||
|
<el-form-item |
||||
|
:label="item.label" |
||||
|
:prop="item.prop" |
||||
|
> |
||||
|
<!-- 数值 --> |
||||
|
<el-input-number |
||||
|
v-if="item.apiBaseType === 'number'" |
||||
|
v-model="formData[item.prop]" |
||||
|
:min="item.minimum || undefined" |
||||
|
:max="item.maximum || undefined" |
||||
|
:maxlength="item.maxLength || undefined" |
||||
|
:minlength="item.minLength || undefined" |
||||
|
:disabled="Boolean(item.disabled)" |
||||
|
:placeholder="item.placeholder || '请输入' + item.label" |
||||
|
@change="changeValue(item.prop,item,$event)" |
||||
|
@clear="clearValue(item.prop,$event)" |
||||
|
></el-input-number> |
||||
|
|
||||
|
<!-- 时间转换 --> |
||||
|
<el-date-picker |
||||
|
v-else-if="item.apiBaseType === 'datetime'" |
||||
|
v-model="formData[item.prop]" |
||||
|
type="datetime" |
||||
|
placeholder="选择日期时间" |
||||
|
format="yyyy-MM-dd HH:mm:ss" |
||||
|
value-format="yyyy-MM-ddTHH:mm:ss" |
||||
|
:disabled="Boolean(item.disabled)" |
||||
|
></el-date-picker> |
||||
|
|
||||
|
<!-- 布尔、枚举 --> |
||||
|
<el-select |
||||
|
v-else-if="item.isEnums || item.apiBaseType === 'boolean'" |
||||
|
v-model="formData[item.prop]" |
||||
|
:placeholder="item.placeholder || '请选择' + item.label" |
||||
|
:disabled="Boolean(item.disabled)" |
||||
|
> |
||||
|
<el-option |
||||
|
v-for="item in getItemEnums(item)" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value" |
||||
|
></el-option> |
||||
|
</el-select> |
||||
|
|
||||
|
<!-- 文本框 --> |
||||
|
<!-- <el-input |
||||
|
v-else |
||||
|
type="textarea" |
||||
|
autosize |
||||
|
resize="none" |
||||
|
v-model="formData[item.prop]" |
||||
|
:placeholder="item.placeholder || '请输入' + item.label" |
||||
|
:disabled="Boolean(item.disabled)" |
||||
|
></el-input> --> |
||||
|
<el-input |
||||
|
v-else |
||||
|
v-model="formData[item.prop]" |
||||
|
:placeholder="item.placeholder || '请输入' + item.label" |
||||
|
:disabled="Boolean(item.disabled)" |
||||
|
></el-input> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
</el-form> |
||||
|
<!-- 操作按钮 --> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button @click="show = false">取 消</el-button> |
||||
|
<el-button type="primary" @click="submitHandle()">确 定</el-button> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 成功提示 --> |
||||
|
<div v-if="active === 1"> |
||||
|
<el-result icon="success" title="成功提示" :subTitle="formTitle + '成功'"> |
||||
|
<template slot="extra"> |
||||
|
<el-button type="primary" size="medium" @click="exitHandle" |
||||
|
>退出</el-button |
||||
|
> |
||||
|
</template> |
||||
|
</el-result> |
||||
|
</div> |
||||
|
<!-- 错误提示 --> |
||||
|
<div v-if="active === 2"> |
||||
|
<el-result icon="error" title="错误提示" :subTitle="formTitle + '失败'"> |
||||
|
<template slot="extra"> |
||||
|
<el-button type="primary" size="medium" @click="changeActive(0)" |
||||
|
>返回</el-button |
||||
|
> |
||||
|
<el-button type="primary" size="medium" @click="exitHandle" |
||||
|
>退出</el-button |
||||
|
> |
||||
|
</template> |
||||
|
</el-result> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
<script> |
||||
|
import { ApiTypePost, ApiTypePut } from "@/api/wms-api" |
||||
|
import { LoadingMixins } from "@/mixins/LoadingMixins"; |
||||
|
import { tableMixins } from "@/mixins/TableMixins" |
||||
|
export default { |
||||
|
name:"addEditFromApiPop", |
||||
|
mixins:[ LoadingMixins,tableMixins ], |
||||
|
props: { |
||||
|
// 编辑行数据 |
||||
|
editRowData:{ |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
// 操作类型:add/edit |
||||
|
handleType:{ |
||||
|
type: String, |
||||
|
default: null |
||||
|
}, |
||||
|
// 提交事件 |
||||
|
submitForm:{ |
||||
|
type:Function, |
||||
|
default:null |
||||
|
}, |
||||
|
// 特殊的【新增】接口,如果没有就走路由下的配置文件 |
||||
|
addSubmitUrl:{ |
||||
|
type: String, |
||||
|
default: null |
||||
|
}, |
||||
|
// 特殊的【编辑】接口,如果没有就走路由下的配置文件 |
||||
|
editSubmitUrl:{ |
||||
|
type: String, |
||||
|
default: null |
||||
|
} |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
currentDtos:this.$store.getters.dtoColumnTypes[this.$route.name], |
||||
|
active:0,//显示内容:0表单 1成功 2失败 |
||||
|
show:true, |
||||
|
formTitle:null,//form名称 |
||||
|
formData:{},//表单数据 |
||||
|
formItemData:null,//表单item配置 |
||||
|
formRules: {},//表单验证 |
||||
|
} |
||||
|
}, |
||||
|
mounted(){ |
||||
|
this.initTitle() |
||||
|
this.initFormItems() |
||||
|
}, |
||||
|
methods: { |
||||
|
// 初始化form名称 |
||||
|
initTitle(){ |
||||
|
if(this.handleType){ |
||||
|
this.formTitle = this.handleType == 'add' ? '新增'+this.$route.name : '编辑'+this.$route.name |
||||
|
} |
||||
|
}, |
||||
|
// 初始化表单配置、rules |
||||
|
initFormItems(){ |
||||
|
let _dtoList_type = this.handleType == 'add' ? 'C' : 'U' |
||||
|
let _dtoList = this.currentDtos[_dtoList_type].dtoList |
||||
|
this.formItemData = JSON.parse(JSON.stringify(_dtoList)) |
||||
|
// 编辑格式:特殊处理默认值 |
||||
|
if(this.handleType == 'edit' && this.editRowData){ |
||||
|
this.formData = JSON.parse(JSON.stringify(this.editRowData)) |
||||
|
}else{ |
||||
|
this.formData = {} |
||||
|
} |
||||
|
// 表单验证格式化 |
||||
|
this.formRules={} |
||||
|
_dtoList.forEach(item=>{ |
||||
|
if(item.isRequired){ |
||||
|
this.formRules[item.prop] = [{ required: true, trigger: "blur", message: "不可为空" }] |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 获取枚举、布尔 |
||||
|
getItemEnums(item){ |
||||
|
let _option = [] |
||||
|
// 布尔 |
||||
|
if(item.apiBaseType == 'boolean'){ |
||||
|
_option = [{ |
||||
|
value: true, |
||||
|
label: '是' |
||||
|
},{ |
||||
|
value: false, |
||||
|
label: '否' |
||||
|
},] |
||||
|
} |
||||
|
if(item.isEnums){ |
||||
|
_option = item.enums_list |
||||
|
} |
||||
|
return _option |
||||
|
}, |
||||
|
// 关闭弹窗 |
||||
|
close() { |
||||
|
this.show = false |
||||
|
this.$emit("closePop") |
||||
|
}, |
||||
|
// 提交表单 |
||||
|
submitHandle(){ |
||||
|
this.$refs.addEditFrom_Ref.validate((valid) => { |
||||
|
if(this.submitForm){ |
||||
|
this.submitForm(valid,this.formData,this.handleType,this.formItemData,this.formRules) |
||||
|
return |
||||
|
} |
||||
|
this.Loading.addEditApiLoading = true |
||||
|
if (valid) { |
||||
|
// 新增 |
||||
|
if(this.handleType == 'add'){ |
||||
|
ApiTypePost( |
||||
|
this.formData, |
||||
|
this.currentDtos.C.actionsUrl |
||||
|
).then(res => { |
||||
|
this.changeActive(1) |
||||
|
}).catch(err => { |
||||
|
this.changeActive(2) |
||||
|
}) |
||||
|
} |
||||
|
// 编辑 |
||||
|
else{ |
||||
|
ApiTypePut( |
||||
|
this.formData, |
||||
|
this.formData.id, |
||||
|
this.currentDtos.U.actionsUrl |
||||
|
).then(res => { |
||||
|
this.changeActive(1) |
||||
|
}).catch(err => { |
||||
|
this.changeActive(2) |
||||
|
}) |
||||
|
} |
||||
|
} else { |
||||
|
return false; |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
// 结果页退出 |
||||
|
exitHandle(){ |
||||
|
this.close() |
||||
|
if(this.active == '1')this.oldSkipCount = 1; |
||||
|
this.show = false |
||||
|
this.paging() |
||||
|
this.$nextTick(()=>{ |
||||
|
this.active = 0 |
||||
|
}) |
||||
|
}, |
||||
|
// 更改页面步骤 |
||||
|
changeActive(sta){ |
||||
|
this.active = sta |
||||
|
this.Loading.addEditApiLoading = false |
||||
|
}, |
||||
|
// 值更改函数 |
||||
|
changeValue(prop,item,val) { |
||||
|
this.$emit("changeValue", prop, item, val) |
||||
|
}, |
||||
|
// 值清除函数 |
||||
|
clearValue(prop,item,val) { |
||||
|
this.$emit("clearValue", prop, item, val) |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
::v-deep .el-dialog__header{ |
||||
|
padding: 0 !important; |
||||
|
} |
||||
|
::v-deep .el-row{ |
||||
|
width: 100%; |
||||
|
} |
||||
|
::v-deep .addEditFrom{ |
||||
|
height: calc(100% - 120px); |
||||
|
overflow: auto; |
||||
|
} |
||||
|
::v-deep .el-form-item__label{ |
||||
|
float: unset; |
||||
|
} |
||||
|
|
||||
|
::v-deep .el-input,.el-select,.el-input-number{ |
||||
|
width: 100% !important; |
||||
|
} |
||||
|
|
||||
|
.dialog-footer{ |
||||
|
padding-top: 15px; |
||||
|
text-align: right; |
||||
|
} |
||||
|
</style> |
@ -1,308 +1,322 @@ |
|||||
<template> |
<template> |
||||
<div class="currenTableFlex"> |
<div class="currenTableFlex"> |
||||
<div class="headerButtons"> |
<div class="headerButtons"> |
||||
<el-button |
<el-button |
||||
type="primary" |
type="primary" |
||||
v-if="showAddBtn" |
v-if="showAddBtn" |
||||
@click="flexOpenAddNew" |
@click="flexOpenAddNew" |
||||
icon="el-icon-plus" |
icon="el-icon-plus" |
||||
size="mini" |
size="mini" |
||||
>添加一行</el-button> |
>添加一行</el-button> |
||||
<slot name="headerBtns"></slot> |
<slot name="headerBtns"></slot> |
||||
|
</div> |
||||
|
<!-- todo:多选处理【selectionTable】 --> |
||||
|
<umyTable |
||||
|
:isEditable="isEditable" |
||||
|
class="flexTable" |
||||
|
:tableData="flexTableData" |
||||
|
:searchOptions="flexSearchOptions" |
||||
|
:tableColumns="flexTableColumns" |
||||
|
:selectionTable="selectionTable" |
||||
|
:isShowIndex="isShowIndex" |
||||
|
:setUTableHeight="setUTableHeight" |
||||
|
@push="detailsDataPush(arguments)" |
||||
|
> |
||||
|
<template v-if="showAllDeleteButton"> |
||||
|
<el-table-column |
||||
|
label="操作" |
||||
|
align="center" |
||||
|
fixed="right" |
||||
|
width="100px" |
||||
|
> |
||||
|
<template slot-scope="scope"> |
||||
|
<div |
||||
|
v-if="!scope.row.hide" |
||||
|
class="childTable" |
||||
|
@click="flexRowRemove($event, scope)" |
||||
|
> |
||||
|
<span style="color:red">删除</span> |
||||
|
</div> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</template> |
||||
|
</umyTable> |
||||
</div> |
</div> |
||||
<!-- todo:多选处理【selectionTable】 --> |
</template> |
||||
<currenTable |
<script> |
||||
class="flexTable" |
import currenTable from "@/components/currenTable" |
||||
:tableData="flexTableData" |
import { mixins } from "@/mixins/mixins" |
||||
:searchOptions="flexSearchOptions" |
export default { |
||||
:tableColumns="flexTableColumns" |
name: 'currenTableFlex', |
||||
:selectionTable="selectionTable" |
components: { |
||||
:isShowIndex="isShowIndex" |
currenTable |
||||
@push="detailsDataPush(arguments)" |
|
||||
> |
|
||||
<template v-if="showAllDeleteButton"> |
|
||||
<el-table-column |
|
||||
label="操作" |
|
||||
align="center" |
|
||||
fixed="right" |
|
||||
width="100px" |
|
||||
> |
|
||||
<template slot-scope="scope"> |
|
||||
<div |
|
||||
v-if="!scope.row.hide" |
|
||||
class="childTable" |
|
||||
@click="flexRowRemove($event, scope)" |
|
||||
> |
|
||||
<span style="color:red">删除</span> |
|
||||
</div> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</template> |
|
||||
</currenTable> |
|
||||
</div> |
|
||||
</template> |
|
||||
<script> |
|
||||
import currenTable from "@/components/currenTable" |
|
||||
import { mixins } from "@/mixins/mixins" |
|
||||
export default { |
|
||||
name: 'currenTableFlex', |
|
||||
components: { |
|
||||
currenTable |
|
||||
}, |
|
||||
mixins: [ |
|
||||
mixins, |
|
||||
], |
|
||||
filters: { |
|
||||
// formData (val) { |
|
||||
// let data = JSON.parse(JSON.stringify(val)) |
|
||||
// val.forEach((key, index) => { |
|
||||
// data[index].disabled = "true" |
|
||||
// delete data[index].focus |
|
||||
// if (key.type == "autocomplete" || key.type == "import") { |
|
||||
// data[index].type = "input" |
|
||||
// } |
|
||||
// }); |
|
||||
// return data |
|
||||
// }, |
|
||||
// formDataDetails (val) { |
|
||||
// let data = JSON.parse(JSON.stringify(val)) |
|
||||
// val.forEach((key, index) => { |
|
||||
// data[index].disabled = true |
|
||||
// delete data[index].focus |
|
||||
// delete data[index].rules |
|
||||
// if (key.type == "autocomplete" || key.type == "import") { |
|
||||
// delete data[index].type |
|
||||
// } else if (key.type == "objectAutocomplete") { |
|
||||
// data[index].type = "object" |
|
||||
// } else if (key.prop == "containerCode" && key.type == "input") { |
|
||||
// data[index].disabled = false |
|
||||
// } else if (key.isChange) { |
|
||||
// // 针对第三步预览特殊情况处理 |
|
||||
// data[index].disabled = false |
|
||||
// } |
|
||||
// }); |
|
||||
// return data |
|
||||
// } |
|
||||
}, |
|
||||
props: { |
|
||||
// 是否显示添加一行按钮 |
|
||||
showAddBtn:{ |
|
||||
type: Boolean, |
|
||||
default: true |
|
||||
}, |
}, |
||||
// 是否显示删除按钮(控制全部列) |
mixins: [ |
||||
showAllDeleteButton:{ |
mixins, |
||||
type: Boolean, |
], |
||||
default: true |
filters: { |
||||
}, |
// formData (val) { |
||||
// 是否禁止编辑行(控制全部行) |
// let data = JSON.parse(JSON.stringify(val)) |
||||
disableAllRow:{ |
// val.forEach((key, index) => { |
||||
type: Boolean, |
// data[index].disabled = "true" |
||||
default: false |
// delete data[index].focus |
||||
|
// if (key.type == "autocomplete" || key.type == "import") { |
||||
|
// data[index].type = "input" |
||||
|
// } |
||||
|
// }); |
||||
|
// return data |
||||
|
// }, |
||||
|
// formDataDetails (val) { |
||||
|
// let data = JSON.parse(JSON.stringify(val)) |
||||
|
// val.forEach((key, index) => { |
||||
|
// data[index].disabled = true |
||||
|
// delete data[index].focus |
||||
|
// delete data[index].rules |
||||
|
// if (key.type == "autocomplete" || key.type == "import") { |
||||
|
// delete data[index].type |
||||
|
// } else if (key.type == "objectAutocomplete") { |
||||
|
// data[index].type = "object" |
||||
|
// } else if (key.prop == "containerCode" && key.type == "input") { |
||||
|
// data[index].disabled = false |
||||
|
// } else if (key.isChange) { |
||||
|
// // 针对第三步预览特殊情况处理 |
||||
|
// data[index].disabled = false |
||||
|
// } |
||||
|
// }); |
||||
|
// return data |
||||
|
// } |
||||
}, |
}, |
||||
flexTableData: { |
props: { |
||||
type: Array, |
// table内表单数据是否可编辑 |
||||
default: () => { |
isEditable:{ |
||||
return []; |
type: Boolean, |
||||
|
default: false |
||||
}, |
}, |
||||
}, |
// 已app-main高度为100% 需要减掉的高度 |
||||
flexSearchOptions: { |
setUTableHeight: { |
||||
type: Object, |
type: Number, |
||||
default: () => { |
default: () => { |
||||
return {}; |
return 280; |
||||
|
} |
||||
}, |
}, |
||||
}, |
// 是否显示添加一行按钮 |
||||
flexTableColumns: { |
showAddBtn:{ |
||||
type: Array, |
type: Boolean, |
||||
default: () => { |
default: true |
||||
return []; |
|
||||
}, |
}, |
||||
}, |
// 是否显示删除按钮(控制全部列) |
||||
// 是否显示多选 |
showAllDeleteButton:{ |
||||
selectionTable: { |
type: Boolean, |
||||
type: Boolean, |
default: true |
||||
default: false, |
}, |
||||
}, |
// 是否禁止编辑行(控制全部行) |
||||
// 是否显示序号列 |
disableAllRow:{ |
||||
isShowIndex: { |
type: Boolean, |
||||
type: Boolean, |
default: false |
||||
default: false, |
}, |
||||
}, |
flexTableData: { |
||||
//名称 |
type: Array, |
||||
// formTitle: { |
default: () => { |
||||
// type: String, |
return []; |
||||
// default: '' |
}, |
||||
// }, |
}, |
||||
// //是否弹窗 |
flexSearchOptions: { |
||||
// displayDialog: { |
type: Object, |
||||
// type: Object, |
default: () => { |
||||
// default: () => { |
return {}; |
||||
// return { |
}, |
||||
// newDialog: false |
}, |
||||
// } |
flexTableColumns: { |
||||
// } |
type: Array, |
||||
// }, |
default: () => { |
||||
// //主表提交数据 |
return []; |
||||
// CreateFormData: { |
}, |
||||
// type: Object, |
}, |
||||
// default: () => { |
// 是否显示多选 |
||||
// return {} |
selectionTable: { |
||||
// } |
type: Boolean, |
||||
// }, |
default: false, |
||||
// //主表显示form |
}, |
||||
// CreateForm: { |
// 是否显示序号列 |
||||
// type: Array, |
isShowIndex: { |
||||
// default: () => { |
type: Boolean, |
||||
// return [] |
default: false, |
||||
// } |
}, |
||||
// }, |
//名称 |
||||
// //预览数据 |
// formTitle: { |
||||
// previewFormData: { |
// type: String, |
||||
// type: Object, |
// default: '' |
||||
// default: () => { |
// }, |
||||
// return {} |
// //是否弹窗 |
||||
// } |
// displayDialog: { |
||||
// }, |
// type: Object, |
||||
// Rules: { |
// default: () => { |
||||
// type: Object, |
// return { |
||||
// default: () => { |
// newDialog: false |
||||
// return {} |
// } |
||||
// } |
// } |
||||
// }, |
// }, |
||||
// //下拉选择 |
// //主表提交数据 |
||||
// Options: { |
// CreateFormData: { |
||||
// type: Object, |
// type: Object, |
||||
// default: () => { |
// default: () => { |
||||
// return {} |
// return {} |
||||
// } |
// } |
||||
// }, |
// }, |
||||
// //子表table显示 |
// //主表显示form |
||||
// detailsTableColumns: { |
// CreateForm: { |
||||
// type: Array, |
// type: Array, |
||||
// default: () => { |
// default: () => { |
||||
// return [] |
// return [] |
||||
// } |
// } |
||||
// }, |
// }, |
||||
// //子表提交数据 |
// //预览数据 |
||||
// childTableData: { |
// previewFormData: { |
||||
// type: Array, |
// type: Object, |
||||
// default: () => { |
// default: () => { |
||||
// return [] |
// return {} |
||||
// } |
// } |
||||
// }, |
// }, |
||||
// //成功后的操作 |
// Rules: { |
||||
// successHandle: { |
// type: Object, |
||||
// type: Array, |
// default: () => { |
||||
// default: () => { |
// return {} |
||||
// return [] |
// } |
||||
// } |
// }, |
||||
// }, |
// //下拉选择 |
||||
// //步骤标题 |
// Options: { |
||||
// stepArray: { |
// type: Object, |
||||
// type: Array, |
// default: () => { |
||||
// default: () => { |
// return {} |
||||
// return ["总体信息", "明细", "预览", "结果"] |
// } |
||||
// } |
// }, |
||||
// }, |
// //子表table显示 |
||||
// //添加一行 |
// detailsTableColumns: { |
||||
// addClickButton: { |
// type: Array, |
||||
// type: Boolean, |
// default: () => { |
||||
// default: () => { |
// return [] |
||||
// return true |
// } |
||||
// } |
// }, |
||||
// }, |
// //子表提交数据 |
||||
// //删除行记录 |
// childTableData: { |
||||
// isShowDeleteButton: { |
// type: Array, |
||||
// type: Boolean, |
// default: () => { |
||||
// default: () => { |
// return [] |
||||
// return true |
// } |
||||
// } |
// }, |
||||
// }, |
// //成功后的操作 |
||||
// // 隐藏第一步骤的取消按钮 |
// successHandle: { |
||||
// isHideFirstActiveCancel:{ |
// type: Array, |
||||
// type: Boolean, |
// default: () => { |
||||
// default: () => { |
// return [] |
||||
// return false |
// } |
||||
// } |
// }, |
||||
// }, |
// //步骤标题 |
||||
// // 预览视图显示删除按钮 |
// stepArray: { |
||||
// showPreviewFormDeleteButton:{ |
// type: Array, |
||||
// type: Boolean, |
// default: () => { |
||||
// default: () => { |
// return ["总体信息", "明细", "预览", "结果"] |
||||
// return false |
// } |
||||
// } |
// }, |
||||
// } |
// //添加一行 |
||||
}, |
// addClickButton: { |
||||
data () { |
// type: Boolean, |
||||
return { |
// default: () => { |
||||
// 添加一行的空置 |
// return true |
||||
addEmptyRow:null, |
// } |
||||
// active: 0, |
// }, |
||||
// formReveal: 1, |
// //删除行记录 |
||||
// activeStep: 1, |
// isShowDeleteButton: { |
||||
// pageStatus: '', |
// type: Boolean, |
||||
// addClick: this.addClickButton,//添加一行按钮 |
// default: () => { |
||||
// showDeleteButton: this.isShowDeleteButton,//操作-删除按钮 |
// return true |
||||
// hideFirstActiveCancel:this.isHideFirstActiveCancel,// 隐藏第一步骤的取消按钮 |
// } |
||||
// loading: false, |
// }, |
||||
// session: null, |
// // 隐藏第一步骤的取消按钮 |
||||
// step: this.stepArray, |
// isHideFirstActiveCancel:{ |
||||
// editHandle: [ |
// type: Boolean, |
||||
// { label: "取消", name: "cancel" }, |
// default: () => { |
||||
// { label: "下一步", type: "primary", name: "determine" }, |
// return false |
||||
// ], |
// } |
||||
} |
// }, |
||||
}, |
// // 预览视图显示删除按钮 |
||||
mounted () { |
// showPreviewFormDeleteButton:{ |
||||
// this.session = JSON.parse(JSON.stringify(this.CreateFormData)) |
// type: Boolean, |
||||
// if(this.hideFirstActiveCancel){ |
// default: () => { |
||||
// this.editHandle=[ |
// return false |
||||
// { label: "下一步", type: "primary", name: "determine" }, |
|
||||
// ]; |
|
||||
// } |
|
||||
}, |
|
||||
methods: { |
|
||||
//添加行 |
|
||||
flexOpenAddNew() { |
|
||||
let _oneRow = Object.assign({}, this.flexTableData[0]) |
|
||||
for(let key in _oneRow){ |
|
||||
_oneRow[key] = null |
|
||||
} |
|
||||
this.flexTableData.push(_oneRow) |
|
||||
// if(this.flexTableData.length <= 0)return |
|
||||
// if(!this.addEmptyRow){ |
|
||||
// let _oneRow = Object.assign({}, this.flexTableData[0]) |
|
||||
// for(let key in _oneRow){ |
|
||||
// _oneRow[key] = null |
|
||||
// } |
// } |
||||
// this.addEmptyRow = _oneRow |
|
||||
// this.addEmptyRow['disabled']=false |
|
||||
// } |
// } |
||||
// this.flexTableData.push(this.addEmptyRow) |
|
||||
}, |
|
||||
//删除行 |
|
||||
flexRowRemove(e, val) { |
|
||||
this.$confirm('您确定删除吗, 是否继续?', '提示', { |
|
||||
confirmButtonText: '确定', |
|
||||
cancelButtonText: '取消', |
|
||||
type: 'warning' |
|
||||
}).then(() => { |
|
||||
this.flexTableData.splice(val.$index, 1) |
|
||||
}).catch(() => { |
|
||||
|
|
||||
}); |
|
||||
}, |
}, |
||||
//点击selection框 |
data () { |
||||
handleSelectionChange(val) { |
return { |
||||
this.$emit("handleSelectionChange", val); |
// 添加一行的空置 |
||||
|
addEmptyRow:null, |
||||
|
// active: 0, |
||||
|
// formReveal: 1, |
||||
|
// activeStep: 1, |
||||
|
// pageStatus: '', |
||||
|
// addClick: this.addClickButton,//添加一行按钮 |
||||
|
// showDeleteButton: this.isShowDeleteButton,//操作-删除按钮 |
||||
|
// hideFirstActiveCancel:this.isHideFirstActiveCancel,// 隐藏第一步骤的取消按钮 |
||||
|
// loading: false, |
||||
|
// session: null, |
||||
|
// step: this.stepArray, |
||||
|
// editHandle: [ |
||||
|
// { label: "取消", name: "cancel" }, |
||||
|
// { label: "下一步", type: "primary", name: "determine" }, |
||||
|
// ], |
||||
|
} |
||||
}, |
}, |
||||
// //autoComplete子表 |
mounted () { |
||||
detailsDataPush (val) { |
// this.session = JSON.parse(JSON.stringify(this.CreateFormData)) |
||||
this.$emit("detailsDataPush", val) |
// if(this.hideFirstActiveCancel){ |
||||
|
// this.editHandle=[ |
||||
|
// { label: "下一步", type: "primary", name: "determine" }, |
||||
|
// ]; |
||||
|
// } |
||||
}, |
}, |
||||
|
methods: { |
||||
|
//添加行 |
||||
|
flexOpenAddNew() { |
||||
|
let _oneRow = Object.assign({}, this.flexTableData[0]) |
||||
|
for(let key in _oneRow){ |
||||
|
_oneRow[key] = null |
||||
|
} |
||||
|
this.flexTableData.push(_oneRow) |
||||
|
// if(this.flexTableData.length <= 0)return |
||||
|
// if(!this.addEmptyRow){ |
||||
|
// let _oneRow = Object.assign({}, this.flexTableData[0]) |
||||
|
// for(let key in _oneRow){ |
||||
|
// _oneRow[key] = null |
||||
|
// } |
||||
|
// this.addEmptyRow = _oneRow |
||||
|
// this.addEmptyRow['disabled']=false |
||||
|
// } |
||||
|
// this.flexTableData.push(this.addEmptyRow) |
||||
|
}, |
||||
|
//删除行 |
||||
|
flexRowRemove(e, val) { |
||||
|
this.$confirm('您确定删除吗, 是否继续?', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.flexTableData.splice(val.$index, 1) |
||||
|
}).catch(() => { |
||||
|
|
||||
|
}); |
||||
|
}, |
||||
|
//点击selection框 |
||||
|
handleSelectionChange(val) { |
||||
|
this.$emit("handleSelectionChange", val); |
||||
|
}, |
||||
|
// //autoComplete子表 |
||||
|
detailsDataPush (val) { |
||||
|
this.$emit("detailsDataPush", val) |
||||
|
}, |
||||
|
} |
||||
} |
} |
||||
} |
</script> |
||||
</script> |
<style lang="scss" scoped> |
||||
<style lang="scss" scoped> |
@import "./style/index.scss"; |
||||
@import "./style/index.scss"; |
</style> |
||||
</style> |
|
@ -1,112 +1,112 @@ |
|||||
<template> |
<template> |
||||
<div class="page-box" v-loading="Loading.tableLoading"> |
<div class="page-box" v-loading="Loading.tableLoading"> |
||||
<!-- DEMO:只有主表查询 API新增编辑删除 --> |
<!-- DEMO: API新增编辑删除 根据details判断是否有子表编辑--> |
||||
<tablePagination |
<tablePagination |
||||
v-if="apiColumns_Table" |
v-if="apiColumns_Table" |
||||
:currenButtonData="currenButtonData" |
:currenButtonData="currenButtonData" |
||||
:tableData="tableData" |
:tableData="tableData" |
||||
:tableLoading="Loading.tableLoading" |
:tableLoading="Loading.tableLoading" |
||||
:tableColumns="apiColumns_Table" |
:tableColumns="apiColumns_Table" |
||||
@rowDrop="rowDrop" |
@rowDrop="rowDrop" |
||||
:totalCount="totalCount" |
:totalCount="totalCount" |
||||
:multipleSelection="multipleSelection" |
:multipleSelection="multipleSelection" |
||||
:MaxResultCount="PageListParams.MaxResultCount" |
:MaxResultCount="PageListParams.MaxResultCount" |
||||
@topbutton="topbutton" |
@topbutton="topbutton" |
||||
@inlineDialog="inlineDialog" |
@inlineDialog="inlineDialog" |
||||
@sortChange="sortChange" |
@sortChange="sortChange" |
||||
@alertoldSkipCount="alertoldSkipCount" |
@alertoldSkipCount="alertoldSkipCount" |
||||
@alterResultCount="alterResultCount" |
@alterResultCount="alterResultCount" |
||||
@handleSelectionChange="handleSelectionChange" |
@handleSelectionChange="handleSelectionChange" |
||||
:currentPageProps="oldSkipCount" |
:currentPageProps="oldSkipCount" |
||||
:quicklySearchOption="quicklySearchOption" |
:quicklySearchOption="quicklySearchOption" |
||||
@quicklySearchClick="quicklySearchClick" |
@quicklySearchClick="quicklySearchClick" |
||||
@quicklySearchClear="quicklySearchClear" |
@quicklySearchClear="quicklySearchClear" |
||||
:primarySearchOption="primarySearchOption" |
:primarySearchOption="primarySearchOption" |
||||
@overallSearchFormClick="overallSearchFormClick" |
@overallSearchFormClick="overallSearchFormClick" |
||||
:httpOverallSearchData="httpOverallSearchData" |
:httpOverallSearchData="httpOverallSearchData" |
||||
:buttonOperationList_left="buttonOperationClick_leftBase" |
:buttonOperationList_left="buttonOperationClick_leftBase" |
||||
@buttonOperationClick_left="buttonOperationClick_left" |
@buttonOperationClick_left="buttonOperationClick_left" |
||||
:buttonOperationList_right="(data)=>{return buttonOperationList_rightApi(data,'edit|delete')}" |
:buttonOperationList_right="(data)=>{return buttonOperationList_rightApi(data,'edit|delete')}" |
||||
@buttonOperationClick_right="buttonOperationClick_right" |
@buttonOperationClick_right="buttonOperationClick_right" |
||||
></tablePagination> |
></tablePagination> |
||||
<curren-Drawer |
<curren-Drawer |
||||
ref="currenDrawer_Ref" |
ref="currenDrawer_Ref" |
||||
:title="apiColumns_DesTions" |
:title="apiColumns_DesTions" |
||||
@rowDrop="rowDrop" |
@rowDrop="rowDrop" |
||||
:tableColumns="apiColumns_DetailsTable" |
:tableColumns="apiColumns_DetailsTable" |
||||
:tabsDesTions="apiColumns_DesTions" |
:tabsDesTions="apiColumns_DesTions" |
||||
:DrawerLoading="Loading.DrawerLoading" |
:DrawerLoading="Loading.DrawerLoading" |
||||
:drawer="displayDialog.detailsDialog" |
:drawer="displayDialog.detailsDialog" |
||||
:propsData="propsData" |
:propsData="propsData" |
||||
:Butttondata="[]" |
:Butttondata="[]" |
||||
@drawerShut="(val) => (displayDialog.detailsDialog = val)" |
@drawerShut="(val) => (displayDialog.detailsDialog = val)" |
||||
@drawerbutton="drawerbutton" |
@drawerbutton="drawerbutton" |
||||
@handleCommand="drawerHandle" |
@handleCommand="drawerHandle" |
||||
@close-value="closeValue" |
@close-value="closeValue" |
||||
:totalCount="totalCountDetails" |
:totalCount="totalCountDetails" |
||||
:currentPage="oldSkipCountDetails" |
:currentPage="oldSkipCountDetails" |
||||
:MaxResultCount="MaxResultCountDetails" |
:MaxResultCount="MaxResultCountDetails" |
||||
@alterResultCountDetails="alterResultCountDetails" |
@alterResultCountDetails="alterResultCountDetails" |
||||
@alertoldSkipCountDetails="alertoldSkipCountDetails" |
@alertoldSkipCountDetails="alertoldSkipCountDetails" |
||||
:buttonOperationList_left="operationButtonsDetail" |
:buttonOperationList_left="operationButtonsDetail" |
||||
></curren-Drawer> |
></curren-Drawer> |
||||
<!-- 导出弹窗 --> |
<!-- 导出弹窗 --> |
||||
<exportDrop |
<exportDrop |
||||
v-if="displayDialog.exportDialog" |
v-if="displayDialog.exportDialog" |
||||
@closeDialog="closeExportDrop" |
@closeDialog="closeExportDrop" |
||||
@exportDropSubmit="exportDropSubmit" |
@exportDropSubmit="exportDropSubmit" |
||||
></exportDrop> |
></exportDrop> |
||||
<!-- Api新增 --> |
<!-- Api新增 --> |
||||
<addEditFromApiPop |
<addEditFromApiPop |
||||
v-if="displayDialog.addEditApiDialog" |
v-if="displayDialog.addEditApiDialog" |
||||
:handleType="addEditApiType" |
:handleType="addEditApiType" |
||||
:editRowData="editFromApiRowData" |
:editRowData="editFromApiRowData" |
||||
@closePop="closeAddEditApiPop" |
@closePop="closeAddEditApiPop" |
||||
></addEditFromApiPop> |
></addEditFromApiPop> |
||||
</div> |
</div> |
||||
</template> |
</template> |
||||
<script> |
<script> |
||||
import { tableMixins } from "@/mixins/TableMixins"; |
import { tableMixins } from "@/mixins/TableMixins"; |
||||
import { LoadingMixins } from "@/mixins/LoadingMixins"; |
import { LoadingMixins } from "@/mixins/LoadingMixins"; |
||||
import { drawerMixins } from "@/mixins/drawerMixins" |
import { drawerMixins } from "@/mixins/drawerMixins" |
||||
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; |
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins"; |
||||
import { mixins } from "@/mixins/mixins"; |
import { mixins } from "@/mixins/mixins"; |
||||
import { filterSelectMixins } from '@/mixins/filter-Select' |
import { filterSelectMixins } from '@/mixins/filter-Select' |
||||
import { getToken } from '@/utils/auth' |
import { getToken } from '@/utils/auth' |
||||
|
|
||||
|
|
||||
export default { |
export default { |
||||
name: "IncomingData", |
name: "IncomingData", |
||||
mixins: [ |
mixins: [ |
||||
tableMixins, |
tableMixins, |
||||
LoadingMixins, |
LoadingMixins, |
||||
drawerMixins, |
drawerMixins, |
||||
TableHeaderMixins, |
TableHeaderMixins, |
||||
mixins, |
mixins, |
||||
filterSelectMixins, |
filterSelectMixins, |
||||
], |
], |
||||
data() { |
data() { |
||||
return { |
return { |
||||
//常用按钮数据 |
//常用按钮数据 |
||||
currenButtonData: [ |
currenButtonData: [ |
||||
this.defaultAddBtn({ |
this.defaultAddBtn({ |
||||
name:'addFromApi' |
name:'addFromApi' |
||||
}),//新增 |
}),//新增 |
||||
this.defaultExportBtn({ |
this.defaultExportBtn({ |
||||
isRedundance:true, |
isRedundance:true, |
||||
isDetailExport:true |
isDetailExport:true |
||||
}),//导出 |
}),//导出 |
||||
this.defaultFieldSettingBtn(),//字段设置 |
this.defaultFieldSettingBtn(),//字段设置 |
||||
this.defaultFreshBtn(),//刷新 |
this.defaultFreshBtn(),//刷新 |
||||
this.defaultFilterBtn(),//筛选 |
this.defaultFilterBtn(),//筛选 |
||||
], |
], |
||||
}; |
}; |
||||
}, |
}, |
||||
mounted() { |
mounted() { |
||||
this.paging(); |
this.paging(); |
||||
}, |
}, |
||||
} |
} |
||||
</script> |
</script> |
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
@import "@/styles/basicData.scss"; |
@import "@/styles/basicData.scss"; |
||||
</style> |
</style> |
Loading…
Reference in new issue