bug修改

This commit is contained in:
caoyang
2022-03-10 18:13:57 +08:00
parent e010e93588
commit 53476930ca
7 changed files with 83 additions and 39 deletions
@@ -222,12 +222,12 @@
//删除 //删除
deleteDetail(val){ deleteDetail(val){
this.$confirm({ this.$confirm({
content: '确认删除?', content: this.$t('confirmDeletion'),
onOk() { onOk() {
deleteAction(``, { id: val.id }).then((res) => { deleteAction(``, { id: val.id }).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
if(this.tableData&&this.tableData.length==1){ if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo=this.queryParams.pageNo-1
} }
this.loadData() this.loadData()
@@ -270,7 +270,19 @@
}, },
//回传至文档库 //回传至文档库
backDocument(val){ backDocument(val){
this.$confirm({
content: this.$t('backDocument'),
onOk() {
deleteAction(``, { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
})
}, },
//查看 //查看
detail(val){ detail(val){
@@ -89,7 +89,7 @@
</div> </div>
</div> </div>
<div class="split-detail-table"> <div class="split-detail-table">
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :loading="loading" class="tag-con-table"> <a-table bordered :data-source="tableData" :columns="columns" rowKey="id" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :loading="loading" class="tag-con-table">
<template slot="action" slot-scope="text, record"> <template slot="action" slot-scope="text, record">
<a class="action-edit" href="javascript:;" @click="onEdit(record)">{{$t('edit')}}</a> <a class="action-edit" href="javascript:;" @click="onEdit(record)">{{$t('edit')}}</a>
<a class="action-delete" href="javascript:;" @click="onCancel(record)">{{$t('delete')}}</a> <a class="action-delete" href="javascript:;" @click="onCancel(record)">{{$t('delete')}}</a>
@@ -110,18 +110,22 @@
</div> </div>
</div> </div>
</div> </div>
<splitAddForm v-if="addVisible" :addVisible="addVisible" @closeVisible="closeVisible"></splitAddForm> <splitAddForm v-if="addVisible" :addVisible="addVisible" @closeVisible="closeVisible"></splitAddForm>
<upload ref="uploadSplit" @uploadSuccess="uploadSuccess"></upload>
</div> </div>
</a-card> </a-card>
</div> </div>
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import upload from '@/components/uploadFile/file.vue'
import splitAddForm from './splitAddForm' import splitAddForm from './splitAddForm'
export default { export default {
name: 'splitDetail', name: 'splitDetail',
components:{ components:{
splitAddForm splitAddForm,
upload
}, },
data() { data() {
return { return {
@@ -170,7 +174,7 @@
], ],
} }
], ],
selecIds:'', selecIds:[],
loading:false, loading:false,
columns: [ columns: [
{ {
@@ -213,7 +217,9 @@
width: 120 width: 120
} }
], ],
addVisible:false addVisible:false,
attId:'',
} }
}, },
mounted() { mounted() {
@@ -293,22 +299,22 @@
} }
this.loadData() this.loadData()
}, },
//删除 //复制按钮
handleCopyManage(record){ handleCopyManage(record){
let params={ let params={
id:record.id id:record.id
} }
this.$confirm({ this.$confirm({
title: '确认删除?', title: this.$t('ConfirmReplication'),
content: '', content: '',
onOk: onOk:
async () => { async () => {
deleteAction(``,params).then(res=> { deleteAction(``,params).then(res=> {
if(res.success){ if(res.success){
this.$message.success(res.message) this.$message.success(this.$t('OperationSuccessful'))
this.loadData() this.loadData()
}else{ }else{
this.$message.warning(res.message) this.$message.warning(this.$t('operationFailed'))
} }
}) })
}, },
@@ -324,7 +330,17 @@
}, },
//导入 //导入
handleImportManage(){ handleImportManage(){
this.$refs.uploadSplit.visible=true
},
//上传成功
uploadSuccess(data){
let attIdList = []
if(data && data.length > 0){
data.forEach(item => {
attIdList.push(item.id || data.name)
})
this.attId = attIdList.join(',')
}
}, },
//导出 //导出
handleExportManage(){ handleExportManage(){
@@ -332,7 +348,7 @@
}, },
//模板下载 //模板下载
handleDownManage(){ handleDownManage(){
// downloadFile('', fileName, { fileName: val.docRealName })
}, },
//合并条款 //合并条款
handleMergeManage(){ handleMergeManage(){
@@ -344,11 +360,32 @@
}, },
//批量删除 //批量删除
handleBatCancel(){ handleBatCancel(){
let params={
id:this.selecIds.join(',')
}
this.$confirm({
title: this.$t('ConfirmBatchDeletion'),
content: '',
onOk:
async () => {
deleteAction(``,params).then(res=> {
if(res.success){
this.$message.success(this.$t('OperationSuccessful'))
if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!=1){
this.queryParams.pageNo=this.queryParams.pageNo-1
}
this.loadData()
}else{
this.$message.warning(this.$t('operationFailed'))
}
})
},
onCancel() {},
});
}, },
//编辑 //编辑
onEdit(val){ onEdit(val){
this.addVisible=true
}, },
//删除 //删除
onCancel(val){ onCancel(val){
@@ -357,13 +394,7 @@
//选择框 //选择框
onSelectChange(selectedRowKeys,rows) { onSelectChange(selectedRowKeys,rows) {
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
let ids=[] this.selecIds=selectedRowKeys
if(rows && rows.length>0){
rows.forEach(item=>{
ids.push(item.id)
})
}
this.selecIds=ids.join(',')
}, },
//点击页数 //点击页数
onChangePage(page,pageSize){ onChangePage(page,pageSize){
@@ -36,8 +36,6 @@
<a-col :span="24"> <a-col :span="24">
<a-form-model-item :label="$t('AttributeType')" prop="fieldShowType" > <a-form-model-item :label="$t('AttributeType')" prop="fieldShowType" >
<j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type" :placeholder="$t('PleaseSelectAttributeType')" /> <j-dict-select-tag type="list" v-model="form.fieldShowType" dictCode="field_show_type" :placeholder="$t('PleaseSelectAttributeType')" />
<!-- <j-dict-select-tag type="list" v-if="type=='input'" v-model="form.fieldShowType" dictCode="sys_dict_item,item_text,item_value,dict_id='1493098515761917954' and (item_text = '输入框(字符串)' or item_text = '输入框(数字)' or item_text = '单日期选择' or item_text = '多日期选择' or item_text = '文件' or item_text = '文本框' or item_text='标准选择' or item_text = '输入框(链接)' or item_text = '人员选择') " placeholder="请选择属性类型" />-->
<!-- <j-dict-select-tag type="list" v-if="type=='select'" v-model="form.fieldShowType" dictCode="sys_dict_item,item_text,item_value,dict_id='1493098515761917954' and (item_text = '单选下拉框' or item_text = '多选下拉框' or item_text = '树形结构')" placeholder="请选择属性类型" />-->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24" v-if="isTagContent"> <a-col :span="24" v-if="isTagContent">
@@ -65,8 +63,6 @@
<j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn" :placeholder="$t('selectWhetherRequired')" /> <j-dict-select-tag type="list" v-model="form.fieldMustInput" dictCode="yn" :placeholder="$t('selectWhetherRequired')" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<p class="tag-info">{{$t('DocumentLibraryModuleDisplay')}}</p> <p class="tag-info">{{$t('DocumentLibraryModuleDisplay')}}</p>
<a-divider dashed /> <a-divider dashed />
<a-col :span="24"> <a-col :span="24">
@@ -85,7 +81,7 @@
<!-- <j-dict-select-tag type="list" v-model="form.showArea" dictCode="" placeholder="请选择展示区域" />--> <!-- <j-dict-select-tag type="list" v-model="form.showArea" dictCode="" placeholder="请选择展示区域" />-->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="24"> <a-col :span="24" v-if="isSearch">
<a-form-model-item :label="$t('Search')" prop="isQuery"> <a-form-model-item :label="$t('Search')" prop="isQuery">
<j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn" :placeholder="$t('SelectWhetherToSearch')" /> <j-dict-select-tag type="list" v-model="form.isQuery" dictCode="yn" :placeholder="$t('SelectWhetherToSearch')" />
</a-form-model-item> </a-form-model-item>
@@ -230,6 +226,8 @@
contentOption1:[], contentOption1:[],
contentOption2:[], contentOption2:[],
isTagContent:false, isTagContent:false,
isSearch:true,
} }
}, },
watch:{ watch:{
@@ -241,8 +239,11 @@
}else if(val==3||val==4){ }else if(val==3||val==4){
this.contentOption=[...this.contentOption1] this.contentOption=[...this.contentOption1]
this.isTagContent=true this.isTagContent=true
}else if(val==7) {
this.isSearch=false
}else{ }else{
this.isTagContent=false this.isTagContent=false
this.isSearch=true
} }
}, },
contentOption(){ contentOption(){
@@ -196,7 +196,7 @@
}) })
}, },
onSelectChange(selectedRowKeys) { onSelectChange(selectedRowKeys) {
console.log('selectedRowKeys changed: ', selectedRowKeys); // console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
}, },
handleTableChange(){ handleTableChange(){
@@ -267,7 +267,9 @@
deleteAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => { deleteAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
if (res.success) { if (res.success) {
this.$message.success(this.$t('OperationSuccessful')); this.$message.success(this.$t('OperationSuccessful'));
this.queryParams.pageNo=1 if(this.areaTable.length==1&&this.queryParams.pageNo!=1){
this.queryParams.pageNo=this.queryParams.pageNo-1
}
this.loadData() this.loadData()
}else{ }else{
this.$message.warning(this.$t('operationFailed')); this.$message.warning(this.$t('operationFailed'));
@@ -23,7 +23,7 @@
</div> </div>
</div> </div>
<div class="dic-list-table"> <div class="dic-list-table">
<list-table v-if="dictVal=='list'&&dataFlag" :tableData="tableData" @editDict="editDict" @deleteDict="deleteDict" :total="total" @selected="selectedKeys" @ok="ok"></list-table> <list-table v-if="dictVal=='list'&&dataFlag" :tableData="tableData" @editDict="editDict" @deleteDict="deleteDict" :total="total" @selected="selectedKeys" @ok="ok"></list-table>
<tree-table v-if="dictVal=='tree'&&dataFlag" :tabletreeData="tabletreeData" :record="record" @editDict="editTreeDict" @selectedKeys="selectedKeys" @ok="ok" :total="total"></tree-table> <tree-table v-if="dictVal=='tree'&&dataFlag" :tabletreeData="tabletreeData" :record="record" @editDict="editTreeDict" @selectedKeys="selectedKeys" @ok="ok" :total="total"></tree-table>
</div> </div>
<a-modal class="dict-module" v-model="newVisible" :title="title" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="newVisible"> <a-modal class="dict-module" v-model="newVisible" :title="title" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
@@ -257,7 +257,6 @@
}, },
//保存 //保存
hideModal(){ hideModal(){
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
if(this.dictVal=='list') { if(this.dictVal=='list') {
@@ -289,7 +288,6 @@
}) })
} }
} else if (this.dictVal == 'tree') { } else if (this.dictVal == 'tree') {
console.log('tree1111')
let params = { let params = {
...this.form, ...this.form,
sysDictId: this.record.id sysDictId: this.record.id
@@ -393,11 +391,12 @@
if(this.dictVal=='list'){ if(this.dictVal=='list'){
deleteAction(`sys/dictItem/logicDeleteBatch`, params).then(res => { deleteAction(`sys/dictItem/logicDeleteBatch`, params).then(res => {
if(res.success){ if(res.success){
if(this.ids.length==this.tableData.length&&this.queryParams.pageNo!=1){ this.$message.success(this.$t('OperationSuccessful'))
if(this.selectedIds.length==this.tableData.length&&this.queryParams.pageNo!=1){
this.queryParams.pageNo=this.queryParams.pageNo-1 this.queryParams.pageNo=this.queryParams.pageNo-1
} }
this.loadData() this.loadData()
this.$message.success(this.$t('OperationSuccessful'))
}else{ }else{
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
@@ -27,7 +27,7 @@
name: 'listTable', name: 'listTable',
props:{ props:{
tableData:Array, tableData:Array,
total:Number total:Number,
}, },
data(){ data(){
return{ return{
@@ -96,7 +96,6 @@
this.$emit('deleteDict',val.id,true) this.$emit('deleteDict',val.id,true)
}, },
onSelectChange(selectedRowKeys) { onSelectChange(selectedRowKeys) {
console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
this.$emit('selected',this.selectedRowKeys) this.$emit('selected',this.selectedRowKeys)
}, },
@@ -287,13 +287,13 @@
if (res.success) { if (res.success) {
if (this.key == 1) { if (this.key == 1) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
if(this.tableData&&this.tableData.length==1){ if(this.tableData&&this.tableData.length==1&&this.queryParam.pageNo!=1){
this.queryParam.pageNo=this.queryParam.pageNo-1 this.queryParam.pageNo=this.queryParam.pageNo-1
} }
this.loadData(1) this.loadData(1)
} else if (this.key == 2) { } else if (this.key == 2) {
this.$message.success(this.$t('OperationSuccessful')) this.$message.success(this.$t('OperationSuccessful'))
if(this.tableData&&this.tableData.length==1){ if(this.tableData&&this.tableData.length==1&&this.queryParam.pageNo!=1){
this.queryParam.pageNo=this.queryParam.pageNo-1 this.queryParam.pageNo=this.queryParam.pageNo-1
} }
this.loadData(0) this.loadData(0)