上报库删除功能

This commit is contained in:
zyx.net
2022-09-13 11:37:57 +08:00
parent 7c0cc6e8f2
commit 96740e313e
3 changed files with 129 additions and 21 deletions
+6
View File
@@ -1286,4 +1286,10 @@ module.exports = {
listConfirmationRejectionReason:'List confirmation rejection reason',
taskConfirmationRejectionReason:'Task confirmation rejection reason',
onlyCompletedDataCanBeDeleted:'Only completed data can be deleted',
reportedDelete:'You\'re about to permanently delete the parameter list',
reportDelete:',including its parameters and export history. Once you confirm and press Delete, it cannot be undone or recovered.',
confirmdelete:'Confirm the listing title you want to delete',
Deletetitle:'Delete the title',
toConfirmed: 'to confirm',
confirmtitle:'The title is incorrect. Please re-enter it',
}
+7 -1
View File
@@ -1387,5 +1387,11 @@ module.exports = {
collectionLegislativeComments:'法规意见收集',
regulatoryAndTechnicalAssessment:'法规技术评估',
listConfirmationRejectionReason:'清单确认驳回原因',
taskConfirmationRejectionReason:'任务确认驳回原因'
taskConfirmationRejectionReason:'任务确认驳回原因',
reportedDelete:'您将永久删除清单',
reportDelete:',包括清单参数项及导出历史一旦删除将无法撤销或恢复',
confirmdelete:'请确认要删除的清单标题',
Deletetitle:'删除标题',
toConfirmed: '来确认',
confirmtitle:'标题不正确请重新输入',
}
@@ -48,6 +48,7 @@
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="handlecody(record)" v-has="'params:report:history'">{{$t('Exporthistory')}}</a>
<a class="text-operation" @click="deleteLib(record)" v-has="'report:detail:list'">{{$t('See')}}</a>
<a class="action-delete" @click="onDelete(record)" v-has="'dict:logicDelete'">{{$t('delete')}}</a>
</span>
</a-table>
</div>
@@ -67,6 +68,37 @@
<a-modal class="show-drawer" :title="titleTag" width="900px" v-model="drawerVisible" :footer="null">
<export-history v-if='drawerVisible' @areaVisible='drawerVisible = false' :paramsManifestId='paramsManifestId'></export-history>
</a-modal>
<!-- 删除-->
<a-modal class="show-drawer" :title="titleDelete" width="500px" v-model="deleteVisible" :footer="null">
<a-spin :spinning="confirmLoading">
<a-form>
<a-form-model :model="formInline" class="formAdd" :rules="rules1" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="12">
<div class="titletext">
<span>{{$t('reportedDelete')}}&nbsp;<span style="font-weight: bold">{{ this.deleteformtltle }}</span>&nbsp;{{$t('reportDelete')}}</span>
</div>
<div class="title-text">
<span class="title-text-text">{{$t('pleaseEnter')}}&nbsp;<span style="color: #BD3B1E;background-color: #F9E5E1">{{ this.deleteformtltle }}</span>&nbsp;{{$t('toConfirmed')}}</span>
</div>
<div class="box-title-text">
<a-form-model-item class="itemModel" prop="paramsTemplateName">
<a-input class="box-input"
:disabled="disabled"
v-model="formInline.paramsTemplateName"
:placeholder="$t('PleaseEnter')+this.deleteformtltle"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-form>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('determine')}}</a-button>
</div>
</a-modal>
</a-card>
</template>
@@ -88,6 +120,8 @@
token: Vue.ls.get(ACCESS_TOKEN),
loading: false,
toggleSearchStatus: false,
deleteVisible:false,
titleDelete:this.$t('Deletetitle'),
selectedRowKeys: [],
paramsManifestId:'',
selectedRowKeysArray: '',
@@ -97,8 +131,17 @@
{ required: true, message: this.$t('PleaseEnter') + this.$t('templateName'), trigger: 'change' }
]
},
rules1: {
paramsTemplateName:[
{ required: true, message: this.$t('PleaseEnter')+this.$t('title'), trigger: 'change' },
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' },
],
},
disabled: false,
projectNameList: [],
visible: false,
dataSource: [],
deleteformtltle:'',
confirmLoading: false,
url: {
list: 'params/report/page'
@@ -134,6 +177,7 @@
}
],
queryParam: {},
deleteform:{},
areaVisible: false,
paramsTemplateName: '',
drawerVisible: false,
@@ -145,24 +189,28 @@
},
methods: {
handleCancel() {
this.areaVisible = false
this.deleteVisible = false
this.$refs.ruleForm.resetFields()
},
handleSubmit() {
if (this.formInline.paramsTemplateName !== undefined) {
this.formInline.paramsTemplateName = this.formInline.paramsTemplateName.trim()
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
getAction(this.url.copy + `?id=${this.selectedRowKeys[0]}&paramsTemplateName=${this.formInline.paramsTemplateName}`, {}).then((res) => {
if (res.success) {
this.areaVisible = false
this.$message.success(res.message)
this.selectedRowKeys = []
this.getList()
} else {
this.$message.warning(res.message)
}
})
if(this.formInline.paramsTemplateName === this.deleteform.title){
getAction('/params/report/delete', {
id: this.deleteform.id
}).then((res) => {
if (res.success) {
this.deleteVisible = false
this.$message.success(res.message)
this.getList()
} else {
this.$message.warning(res.message)
}
})
}else{
this.$message.warning(this.$t('confirmtitle'))
}
}
})
},
@@ -226,6 +274,36 @@
this.queryParam[value] = id
this.queryParam = { ...this.queryParam }
},
//删除
onDelete(val) {
this.deleteform = val
this.deleteformtltle = val.title
this.formInline = {}
this.deleteVisible = true
this.titleDelete = this.$t('Deletetitle') + "'" + val.title + "'" + '?'
// let param = {
// id: val.id
// }
// this.$confirm({
// title: this.$t('reportedDelete'),
// content: '',
// onOk:
// async () => {
// getAction(`sys/dict/logicDelete`, param).then(res => {
// if (res.success) {
// this.$message.success(this.$t('OperationSuccessful'))
// this.reFresh()
// if (this.tableData && this.tableData.length == 1 && this.queryParams.pageNo != 1) {
// this.queryParams.pageNo = this.queryParams.pageNo - 1
// }
// this.loadData()
// } else {
// this.$message.warning(this.$t('operationFailed'))
// }
// })
// }
// })
},
getList() {
let query = {
pageNo: this.pageNo,
@@ -264,12 +342,12 @@
}
.title-text {
width: 20%;
/*width: 60%;*/
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
font-size: 16px;
margin-right: 16px;
margin-top: 3px;
text-align: right;
@@ -277,10 +355,23 @@
overflow: hidden;
text-overflow: ellipsis;
}
.titletext{
width: 460px;
min-width: 110px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 16px;
/*margin-right: 16px;*/
/*margin-top: 3px;*/
/*text-align: right;*/
/*white-space: nowrap;*/
overflow: hidden;
text-overflow: ellipsis;
}
.box-input {
display: inline-block;
width: 70%;
width: 213%;
height: 38px;
margin-top: 2px;
}
@@ -330,7 +421,8 @@
}
.itemModel {
width: calc(100% - 130px);
/*width: calc(100% - 130px);*/
width: 100%;
display: inline-block;
margin-top: 2px;
}
@@ -368,7 +460,11 @@
background: #fff!important;
opacity: 0.9;
}
/deep/.ant-modal-title{
font-weight: bold;
font-size: 18px;
letter-spacing: 1px;
}
::v-deep .ant-table-body {
background: transparent!important;
}