Browse Source

addEditFromApiPop暂存

noToken
安虹睿 1 year ago
parent
commit
e975e380d1
  1. 115
      PC/InterFace.Dash/src/components/addEditFromApiPop/index.vue
  2. 2
      PC/InterFace.Dash/src/mixins/LoadingMixins.js
  3. 1
      PC/InterFace.Dash/src/mixins/TableHeaderMixins.js
  4. 1
      PC/InterFace.Dash/src/mixins/TableMixins.js
  5. 3
      PC/InterFace.Dash/src/mixins/mixins.js
  6. 6
      PC/InterFace.Dash/src/mixins/newAndEdiDialogMixins.js
  7. 5
      PC/InterFace.Dash/src/utils/baseData/urlOption.js
  8. 1
      PC/InterFace.Dash/src/views/login/index.vue
  9. 6
      PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue
  10. 101
      PC/InterFace.Dash/src/views/menuList/IncomingData copy.vue
  11. 20
      PC/InterFace.Dash/src/views/menuList/IncomingData.vue

115
PC/InterFace.Dash/src/components/addEditFromApiPop/index.vue

@ -9,11 +9,15 @@
class="searchPageComponents" class="searchPageComponents"
:fullscreen="true" :fullscreen="true"
style="width:calc(100% - 28px);left:14px;top:14px;height:calc(100% - 28px)" 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> <div class="dialogOuterTitle">{{formTitle}}</div>
<!-- 表单 --> <!-- 表单 -->
<el-form <el-form
class="addEditFrom"
ref="addEditFrom_Ref" ref="addEditFrom_Ref"
v-if="formData" v-if="formData"
:model="formData" :model="formData"
@ -81,15 +85,44 @@
</el-row> </el-row>
</el-form> </el-form>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<span slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="show = false"> </el-button> <el-button @click="show = false"> </el-button>
<el-button type="primary" @click="submitHandle()"> </el-button> <el-button type="primary" @click="submitHandle()"> </el-button>
</span> </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> </el-dialog>
</template> </template>
<script> <script>
import { postCreate, postUpdate } from "@/api/wms-api"
import { LoadingMixins } from "@/mixins/LoadingMixins";
import { tableMixins } from "@/mixins/TableMixins"
import * as allUrlOption from '@/utils/baseData/urlOption'
export default { export default {
name:"addEditFromApiPop", name:"addEditFromApiPop",
mixins:[ LoadingMixins,tableMixins ],
props: { props: {
// //
editRowData:{ editRowData:{
@ -100,10 +133,32 @@ export default {
handleType:{ handleType:{
type: String, type: String,
default: null default: null
},
//
submitForm:{
type:Function,
default:null
},
//
addSubmitUrl:{
type: String,
default: null
},
//
editSubmitUrl:{
type: String,
default: null
} }
}, },
data () { data () {
return { return {
//
URLOption_base:allUrlOption[this.$route.name].baseURL,
//
URLOption_add:allUrlOption[this.$route.name].addURL,
//
URLOption_edit:allUrlOption[this.$route.name].editURL,
active:0,//0 1 2
show:true, show:true,
formTitle:null,//form formTitle:null,//form
formData:{},// formData:{},//
@ -128,6 +183,10 @@ export default {
let _dtoList_type = this.handleType == 'add' ? 'C' : 'U' let _dtoList_type = this.handleType == 'add' ? 'C' : 'U'
let _dtoList = data[this.$route.name][_dtoList_type].dtoList let _dtoList = data[this.$route.name][_dtoList_type].dtoList
this.formItemData = JSON.parse(JSON.stringify(_dtoList)) this.formItemData = JSON.parse(JSON.stringify(_dtoList))
//
if(this.handleType == 'edit' && this.editRowData){
}
// //
this.formRules={} this.formRules={}
_dtoList.forEach(item=>{ _dtoList.forEach(item=>{
@ -162,22 +221,52 @@ export default {
// //
submitHandle(){ submitHandle(){
this.$refs.addEditFrom_Ref.validate((valid) => { this.$refs.addEditFrom_Ref.validate((valid) => {
if(this.submitForm){
this.submitForm(valid,this.formData,this.handleType,this.formItemData,this.formRules)
return
}
let _updata = this.handleType == 'add' ? this.URLOption_add : this.URLOption_edit
let _url = _updata ? _updata : this.URLOption_base
this.Loading.addEditApiLoading = true
if (valid) { if (valid) {
console.log(this.handleType,this.formData)
// //
if(this.handleType == 'add'){ if(this.handleType == 'add'){
if(!_updata){_url = _url + '/create'}
postCreate(this.formData, _url).then(res => {
this.changeActive(1)
}).catch(err => {
this.changeActive(2)
})
} }
// //
else{ else{
if(!_updata){_url = _url + '/update-by-id'}
postUpdate(this.formData, this.formData.id, _url).then(res => {
this.changeActive(1)
}).catch(err => {
this.changeActive(2)
})
} }
this.show = false
} else { } else {
return false; 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) { changeValue(prop,item,val) {
this.$emit("changeValue", prop, item, val) this.$emit("changeValue", prop, item, val)
@ -185,7 +274,7 @@ export default {
// //
clearValue(prop,item,val) { clearValue(prop,item,val) {
this.$emit("clearValue", prop, item, val) this.$emit("clearValue", prop, item, val)
} },
} }
} }
</script> </script>
@ -194,6 +283,13 @@ export default {
::v-deep .el-dialog__header{ ::v-deep .el-dialog__header{
padding: 0 !important; padding: 0 !important;
} }
::v-deep .el-row{
width: 100%;
}
::v-deep .addEditFrom{
height: calc(100% - 120px);
overflow: auto;
}
::v-deep .el-form-item__label{ ::v-deep .el-form-item__label{
float: unset; float: unset;
} }
@ -201,4 +297,9 @@ export default {
::v-deep .el-input,.el-select,.el-input-number{ ::v-deep .el-input,.el-select,.el-input-number{
width: 100% !important; width: 100% !important;
} }
.dialog-footer{
padding-top: 15px;
text-align: right;
}
</style> </style>

2
PC/InterFace.Dash/src/mixins/LoadingMixins.js

@ -9,6 +9,8 @@ export const LoadingMixins = {
newAndEdiLoading: false, newAndEdiLoading: false,
autoTableLoading: false, autoTableLoading: false,
appMainLoading: false, appMainLoading: false,
// fast-new
addEditApiLoading:false,//Api 新增编辑
}, },
//Dialog显示状态 //Dialog显示状态
displayDialog: { displayDialog: {

1
PC/InterFace.Dash/src/mixins/TableHeaderMixins.js

@ -32,6 +32,7 @@ export const TableHeaderMixins = {
// 关闭主表新增编辑api // 关闭主表新增编辑api
closeAddEditApiPop(){ closeAddEditApiPop(){
this.addEditApiType = null this.addEditApiType = null
this.editFromApiRowData = null
this.displayDialog.addEditApiDialog = false this.displayDialog.addEditApiDialog = false
}, },
// 导出功能 // 导出功能

1
PC/InterFace.Dash/src/mixins/TableMixins.js

@ -91,6 +91,7 @@ export const tableMixins = {
// 编辑 api // 编辑 api
if (item.name == "editFromApi") { if (item.name == "editFromApi") {
this.addEditApiType = 'edit' this.addEditApiType = 'edit'
this.editFromApiRowData = row
this.displayDialog.addEditApiDialog = true; this.displayDialog.addEditApiDialog = true;
} }
// 删除 // 删除

3
PC/InterFace.Dash/src/mixins/mixins.js

@ -18,8 +18,6 @@ export const mixins = {
URLOption_add:allUrlOption[this.$route.name].addURL, URLOption_add:allUrlOption[this.$route.name].addURL,
// 编辑 // 编辑
URLOption_edit:allUrlOption[this.$route.name].editURL, URLOption_edit:allUrlOption[this.$route.name].editURL,
// 新增和编辑
URLOption_updata:allUrlOption[this.$route.name].updataURL,
//明细-查看主表 //明细-查看主表
URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL, URLOption_parent:allUrlOption[this.$route.name].parentURL ? allUrlOption[this.$route.name].parentURL : allUrlOption[this.$route.name].detailURL,
//明细-查看主表的连接id //明细-查看主表的连接id
@ -67,6 +65,7 @@ export const mixins = {
], ],
addEditApiType: null,//Api新增编辑方式(add,edit) addEditApiType: null,//Api新增编辑方式(add,edit)
editFromApiRowData:null,//Api编辑方式的默认值
} }
}, },
methods: { methods: {

6
PC/InterFace.Dash/src/mixins/newAndEdiDialogMixins.js

@ -51,10 +51,10 @@ export const newAndEdiDialogMixins = {
this.ref = val this.ref = val
this.Loading.newAndEdiLoading = true this.Loading.newAndEdiLoading = true
let _updata = this.formReveal ? this.URLOption_add : this.URLOption_edit let _updata = this.formReveal ? this.URLOption_add : this.URLOption_edit
let _url = this.URLOption_updata ? this.URLOption_updata : (_updata ? _updata : this.URLOption_base) let _url = _updata ? _updata : this.URLOption_base
switch (this.formReveal) { switch (this.formReveal) {
case true: case true:
if(!_updata && !this.URLOption_updata){_url = _url + '/create'} if(!_updata){_url = _url + '/create'}
postCreate(this.CreateFormData, _url).then(res => { postCreate(this.CreateFormData, _url).then(res => {
this.oldSkipCount = 1; this.oldSkipCount = 1;
this.Loading.newAndEdiLoading = false this.Loading.newAndEdiLoading = false
@ -65,7 +65,7 @@ export const newAndEdiDialogMixins = {
}) })
break; break;
case false: case false:
if(!_updata && !this.URLOption_updata){_url = _url + '/update-by-id'} if(!_updata){_url = _url + '/update-by-id'}
postUpdate(this.editFormData, this.editFormData.id, _url).then(res => { postUpdate(this.editFormData, this.editFormData.id, _url).then(res => {
this.propsData = res this.propsData = res
this.Loading.newAndEdiLoading = false this.Loading.newAndEdiLoading = false

5
PC/InterFace.Dash/src/utils/baseData/urlOption.js

@ -6,9 +6,8 @@ export const TestSchool = {
detailListURL:'TestStudentDetail/base',//明细-列表, detailListURL:'TestStudentDetail/base',//明细-列表,
// parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL // parentURL:null,//明细-查看主表:特殊接口,如果没有则走detailURL
// deleteURL:null,//删除特殊URL // deleteURL:null,//删除特殊URL
// updataURL:null,//新增+编辑特殊URL(新增+编辑使用一个) // addURL:null,//新增特殊URL
// addURL:null,//新增特殊URL(有此参数,updataURL无效) // editURL:null,//编辑特殊URL
// editURL:null,//编辑特殊URL(有此参数,updataURL无效)
// exportURL:'exportURL',//导出特殊URL // exportURL:'exportURL',//导出特殊URL
} }

1
PC/InterFace.Dash/src/views/login/index.vue

@ -178,7 +178,6 @@ export default {
return return
this.loading = true this.loading = true
this.loginForm.userNameOrEmailAddress = this.loginForm.username this.loginForm.userNameOrEmailAddress = this.loginForm.username
// todo-new:permission
let _zh = localStorage.getItem('columnsApiNamesZh') let _zh = localStorage.getItem('columnsApiNamesZh')
login(this.loginForm).then(()=>{ login(this.loginForm).then(()=>{
// this.$store.dispatch('user/login', this.loginForm).then(() => { // this.$store.dispatch('user/login', this.loginForm).then(() => {

6
PC/InterFace.Dash/src/views/menuList/ExportCustomUserSetting.vue

@ -285,12 +285,12 @@ export default {
this.ref = val this.ref = val
this.Loading.newAndEdiLoading = true this.Loading.newAndEdiLoading = true
let _updata = this.formReveal ? this.URLOption_add : this.URLOption_edit let _updata = this.formReveal ? this.URLOption_add : this.URLOption_edit
let _url = this.URLOption_updata ? this.URLOption_updata : (_updata ? _updata : this.URLOption_base) let _url = _updata ? _updata : this.URLOption_base
switch (this.formReveal) { switch (this.formReveal) {
case true: case true:
this.CreateFormData.exportColumnName = this.CreateFormData.exportColumnNameArr.join(" ") this.CreateFormData.exportColumnName = this.CreateFormData.exportColumnNameArr.join(" ")
this.CreateFormData.exportTableName = this.CreateFormData.exportTableName_old this.CreateFormData.exportTableName = this.CreateFormData.exportTableName_old
if(!_updata && !this.URLOption_updata){_url = _url + '/create'} if(!_updata){_url = _url + '/create'}
postCreate(this.CreateFormData, _url).then(res => { postCreate(this.CreateFormData, _url).then(res => {
this.oldSkipCount = 1; this.oldSkipCount = 1;
this.Loading.newAndEdiLoading = false this.Loading.newAndEdiLoading = false
@ -302,7 +302,7 @@ export default {
}) })
break; break;
case false: case false:
if(!_updata && !this.URLOption_updata){_url = _url + '/update-by-id'} if(!_updata){_url = _url + '/update-by-id'}
this.editFormData.exportColumnName = this.editFormData.exportColumnNameArr.join(" ") this.editFormData.exportColumnName = this.editFormData.exportColumnNameArr.join(" ")
this.editFormData.exportTableName = this.editFormData.exportTableName_old this.editFormData.exportTableName = this.editFormData.exportTableName_old
postUpdate(this.editFormData, this.editFormData.id, _url).then(res => { postUpdate(this.editFormData, this.editFormData.id, _url).then(res => {

101
PC/InterFace.Dash/src/views/menuList/IncomingData copy.vue

@ -0,0 +1,101 @@
<template>
<div class="page-box" v-loading="Loading.tableLoading">
<tablePagination
v-if="apiColumns_Table"
:currenButtonData="currenButtonData"
:tableData="tableData"
:tableLoading="Loading.tableLoading"
:tableColumns="apiColumns_Table"
@rowDrop="rowDrop"
:totalCount="totalCount"
:multipleSelection="multipleSelection"
:MaxResultCount="PageListParams.MaxResultCount"
@topbutton="topbutton"
@inlineDialog="inlineDialog"
@sortChange="sortChange"
@alertoldSkipCount="alertoldSkipCount"
@alterResultCount="alterResultCount"
@handleSelectionChange="handleSelectionChange"
:currentPageProps="oldSkipCount"
:quicklySearchOption="quicklySearchOption"
@quicklySearchClick="quicklySearchClick"
@quicklySearchClear="quicklySearchClear"
:primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData"
></tablePagination>
<!-- :buttonOperationList_left="buttonOperationClick_leftBase"
@buttonOperationClick_left="buttonOperationClick_left" -->
<!-- <curren-Drawer
ref="currenDrawer_Ref"
:title="apiColumns_DesTions"
@rowDrop="rowDrop"
:tableColumns="apiColumns_DetailsTable"
:tabsDesTions="apiColumns_DesTions"
:DrawerLoading="Loading.DrawerLoading"
:drawer="displayDialog.detailsDialog"
:propsData="propsData"
:Butttondata="[]"
@drawerShut="(val) => (displayDialog.detailsDialog = val)"
@drawerbutton="drawerbutton"
@handleCommand="drawerHandle"
@close-value="closeValue"
:totalCount="totalCountDetails"
:currentPage="oldSkipCountDetails"
:MaxResultCount="MaxResultCountDetails"
@alterResultCountDetails="alterResultCountDetails"
@alertoldSkipCountDetails="alertoldSkipCountDetails"
:buttonOperationList_left="operationButtonsDetail"
></curren-Drawer> -->
<!-- 导出弹窗 -->
<exportDrop
v-if="displayDialog.exportDialog"
@closeDialog="closeExportDrop"
@exportDropSubmit="exportDropSubmit"
></exportDrop>
</div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins";
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select'
import { getToken } from '@/utils/auth'
export default {
name: "IncomingData",
mixins: [
tableMixins,
LoadingMixins,
drawerMixins,
TableHeaderMixins,
mixins,
filterSelectMixins,
newAndEdiDialogMixins
],
data() {
return {
//
currenButtonData: [
this.defaultExportBtn({
isRedundance:true,
isDetailExport:true
}),//
this.defaultFieldSettingBtn(),//
this.defaultFreshBtn(),//
this.defaultFilterBtn(),//
],
};
},
mounted() {
this.paging();
},
}
</script>
<style lang="scss" scoped>
@import "@/styles/basicData.scss";
</style>

20
PC/InterFace.Dash/src/views/menuList/IncomingData.vue

@ -23,10 +23,14 @@
:primarySearchOption="primarySearchOption" :primarySearchOption="primarySearchOption"
@overallSearchFormClick="overallSearchFormClick" @overallSearchFormClick="overallSearchFormClick"
:httpOverallSearchData="httpOverallSearchData" :httpOverallSearchData="httpOverallSearchData"
:buttonOperationList_left="buttonOperationClick_leftBase"
@buttonOperationClick_left="buttonOperationClick_left"
:buttonOperationList_right="(data)=>{return buttonOperationList_rightApi(data,'edit')}"
@buttonOperationClick_right="buttonOperationClick_right"
></tablePagination> ></tablePagination>
<!-- :buttonOperationList_left="buttonOperationClick_leftBase" <!-- :buttonOperationList_left="buttonOperationClick_leftBase"
@buttonOperationClick_left="buttonOperationClick_left" --> @buttonOperationClick_left="buttonOperationClick_left" -->
<!-- <curren-Drawer <curren-Drawer
ref="currenDrawer_Ref" ref="currenDrawer_Ref"
:title="apiColumns_DesTions" :title="apiColumns_DesTions"
@rowDrop="rowDrop" @rowDrop="rowDrop"
@ -46,13 +50,20 @@
@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新增 -->
<addEditFromApiPop
v-if="displayDialog.addEditApiDialog"
:handleType="addEditApiType"
:editRowData="editFromApiRowData"
@closePop="closeAddEditApiPop"
></addEditFromApiPop>
</div> </div>
</template> </template>
<script> <script>
@ -60,7 +71,6 @@ 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 { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
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'
@ -75,12 +85,14 @@ export default {
TableHeaderMixins, TableHeaderMixins,
mixins, mixins,
filterSelectMixins, filterSelectMixins,
newAndEdiDialogMixins
], ],
data() { data() {
return { return {
// //
currenButtonData: [ currenButtonData: [
this.defaultAddBtn({
name:'addFromApi'
}),//
this.defaultExportBtn({ this.defaultExportBtn({
isRedundance:true, isRedundance:true,
isDetailExport:true isDetailExport:true

Loading…
Cancel
Save