上报库删除功能

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', listConfirmationRejectionReason:'List confirmation rejection reason',
taskConfirmationRejectionReason:'Task confirmation rejection reason', taskConfirmationRejectionReason:'Task confirmation rejection reason',
onlyCompletedDataCanBeDeleted:'Only completed data can be deleted', 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:'法规意见收集', collectionLegislativeComments:'法规意见收集',
regulatoryAndTechnicalAssessment:'法规技术评估', regulatoryAndTechnicalAssessment:'法规技术评估',
listConfirmationRejectionReason:'清单确认驳回原因', listConfirmationRejectionReason:'清单确认驳回原因',
taskConfirmationRejectionReason:'任务确认驳回原因' taskConfirmationRejectionReason:'任务确认驳回原因',
reportedDelete:'您将永久删除清单',
reportDelete:',包括清单参数项及导出历史。一旦删除将无法撤销或恢复。',
confirmdelete:'请确认要删除的清单标题',
Deletetitle:'删除标题',
toConfirmed: '来确认',
confirmtitle:'标题不正确,请重新输入',
} }
@@ -48,6 +48,7 @@
<span slot="operation" slot-scope="text,record"> <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="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="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> </span>
</a-table> </a-table>
</div> </div>
@@ -67,6 +68,37 @@
<a-modal class="show-drawer" :title="titleTag" width="900px" v-model="drawerVisible" :footer="null"> <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> <export-history v-if='drawerVisible' @areaVisible='drawerVisible = false' :paramsManifestId='paramsManifestId'></export-history>
</a-modal> </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> </a-card>
</template> </template>
@@ -88,6 +120,8 @@
token: Vue.ls.get(ACCESS_TOKEN), token: Vue.ls.get(ACCESS_TOKEN),
loading: false, loading: false,
toggleSearchStatus: false, toggleSearchStatus: false,
deleteVisible:false,
titleDelete:this.$t('Deletetitle'),
selectedRowKeys: [], selectedRowKeys: [],
paramsManifestId:'', paramsManifestId:'',
selectedRowKeysArray: '', selectedRowKeysArray: '',
@@ -97,8 +131,17 @@
{ required: true, message: this.$t('PleaseEnter') + this.$t('templateName'), trigger: 'change' } { 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, visible: false,
dataSource: [], dataSource: [],
deleteformtltle:'',
confirmLoading: false, confirmLoading: false,
url: { url: {
list: 'params/report/page' list: 'params/report/page'
@@ -134,6 +177,7 @@
} }
], ],
queryParam: {}, queryParam: {},
deleteform:{},
areaVisible: false, areaVisible: false,
paramsTemplateName: '', paramsTemplateName: '',
drawerVisible: false, drawerVisible: false,
@@ -145,24 +189,28 @@
}, },
methods: { methods: {
handleCancel() { handleCancel() {
this.areaVisible = false this.deleteVisible = false
this.$refs.ruleForm.resetFields()
}, },
handleSubmit() { handleSubmit() {
if (this.formInline.paramsTemplateName !== undefined) {
this.formInline.paramsTemplateName = this.formInline.paramsTemplateName.trim()
}
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
getAction(this.url.copy + `?id=${this.selectedRowKeys[0]}&paramsTemplateName=${this.formInline.paramsTemplateName}`, {}).then((res) => { if(this.formInline.paramsTemplateName === this.deleteform.title){
if (res.success) { getAction('/params/report/delete', {
this.areaVisible = false id: this.deleteform.id
this.$message.success(res.message) }).then((res) => {
this.selectedRowKeys = [] if (res.success) {
this.getList() this.deleteVisible = false
} else { this.$message.success(res.message)
this.$message.warning(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[value] = id
this.queryParam = { ...this.queryParam } 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() { getList() {
let query = { let query = {
pageNo: this.pageNo, pageNo: this.pageNo,
@@ -264,12 +342,12 @@
} }
.title-text { .title-text {
width: 20%; /*width: 60%;*/
min-width: 110px; min-width: 110px;
color: #000F16; color: #000F16;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 16px;
margin-right: 16px; margin-right: 16px;
margin-top: 3px; margin-top: 3px;
text-align: right; text-align: right;
@@ -277,10 +355,23 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; 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 { .box-input {
display: inline-block; display: inline-block;
width: 70%; width: 213%;
height: 38px; height: 38px;
margin-top: 2px; margin-top: 2px;
} }
@@ -330,7 +421,8 @@
} }
.itemModel { .itemModel {
width: calc(100% - 130px); /*width: calc(100% - 130px);*/
width: 100%;
display: inline-block; display: inline-block;
margin-top: 2px; margin-top: 2px;
} }
@@ -368,7 +460,11 @@
background: #fff!important; background: #fff!important;
opacity: 0.9; opacity: 0.9;
} }
/deep/.ant-modal-title{
font-weight: bold;
font-size: 18px;
letter-spacing: 1px;
}
::v-deep .ant-table-body { ::v-deep .ant-table-body {
background: transparent!important; background: transparent!important;
} }