拆分列表

This commit is contained in:
caoyang
2022-03-22 12:12:05 +08:00
parent 7b12ed59fe
commit 2d4ee50631
8 changed files with 242 additions and 192 deletions
@@ -77,6 +77,9 @@
import SplitText from './modules/SplitText'
import ImportResult from './modules/ImportResult'
import { getAction, postAction, deleteAction } from '@/api/manage'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import axios from 'axios'
import Vue from 'vue'
export default {
name: 'splitting',
@@ -92,46 +95,37 @@
loading:false,
total:0,
ids:[],
tableData:[
{
dbFieldTxt_dictText:'11111',
dbFieldEnName_dictText:'aaaaa',
fieldShowType_dictText:'345435435',
dbLength_dictText:'et435344354',
orderNum_dictText:'dfgdrgd',
showAreaName:'sdfsdfsd',
}
],
tableData:[],
columns:[
{
title: this.$t('standard'),
align: "center",
dataIndex: 'dbFieldTxt_dictText',
dataIndex: 'serialNumber',
},
{
title: this.$t('title'),
align: "center",
dataIndex: 'dbFieldEnName_dictText',
dataIndex: 'title',
},
{
title: this.$t('TextStatus'),
align: "center",
dataIndex: 'fieldShowType_dictText',
dataIndex: 'fileType_dictText',
},
{
title: this.$t('fileName'),
align: "center",
dataIndex: 'dbLength_dictText'
dataIndex: 'fileName'
},
{
title: this.$t('splitTime'),
align: "center",
dataIndex: 'orderNum_dictText'
dataIndex: 'createTime'
},
{
title: this.$t('splitResult'),
align: "center",
dataIndex: 'showAreaName'
dataIndex: 'splitResult_dictText'
},
{
title: this.$t('operation'),
@@ -144,7 +138,9 @@
queryParams:{
pageNo:1,
pageSize:10
}
},
token:Vue.ls.get(ACCESS_TOKEN),
}
},
props:{
@@ -163,7 +159,7 @@
let params={
...this.queryParams
}
getAction(``,params).then(res=>{
getAction(`split/sarFileSplitInfo/page`,params).then(res=>{
if(res.success){
this.tableData=[...res.result.records]
this.loading=false
@@ -193,12 +189,28 @@
content: '',
onOk:
async () => {
deleteAction(``, params).then(res => {
if (res.success) {
axios({
url: '/jero-boot/split/sarFileSplitInfo/deleteBatch',
method: 'post',
data: params,
transformRequest: [function (data) {
let ret = ''
for (let it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token':this.token
}
}).then(res => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
if(this.selectedRowKeys&&this.selectedRowKeys.length==this.tableData.length){
this.queryParams.pageNo=this.queryParams.pageNo-1
}
this.selectedRowKeys=[]
this.loadData()
}else{
this.$message.warning(this.$t('operationFailed'))
@@ -216,19 +228,21 @@
deleteDetail(val){
this.$confirm({
content: this.$t('confirmDeletion'),
onOk() {
deleteAction(``, { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){
this.queryParams.pageNo=this.queryParams.pageNo-1
onOk:
async () => {
getAction(`split/sarFileSplitInfo/delete`, { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
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'))
}
this.loadData()
} else {
this.$message.warning(res.message)
}
})
}
})
}
})
},
sVisible(val){
@@ -173,7 +173,8 @@
{ required: true, message: this.$t('enterSortingNumber'), trigger: 'change' },
]
},
areaTable:[]
areaTable:[],
flag:false, //表单提交标识
}
},
props:{
@@ -184,6 +185,7 @@
},
methods:{
loadData(){
this.loading=true
let params={
...this.queryParams
}
@@ -192,6 +194,8 @@
this.areaTable=[...res.result.records]
this.total=res.result.total
}
}).finally(()=>{
this.loading=false
})
},
onSelectChange(selectedRowKeys) {
@@ -209,6 +213,7 @@
hideModal() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag=true
//编辑
if(this.form.id){
putAction(`tag/onlCgformArea/edit`,this.form).then((res)=>{
@@ -224,7 +229,9 @@
}else{
this.$message.warning(this.$t('operationFailed'))
}
});
}).finally(()=>{
this.flag=false
})
}else{
//新增
postAction(`/tag/onlCgformArea/add`,this.form).then(res=>{
@@ -242,7 +249,9 @@
}
}
)
).finally(()=>{
this.flag=false
})
}
this.newVisible = false;
} else {
@@ -263,7 +272,7 @@
content: '',
onOk:
async () => {
deleteAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
getAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'));
if(this.areaTable.length==1&&this.queryParams.pageNo!=1){
@@ -54,18 +54,6 @@
{{item.name}}
</a-select-option>
</a-select>
<!-- <a-tree-select-->
<!-- v-model="pid"-->
<!-- style="width: 100%"-->
<!-- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"-->
<!-- :tree-data="treeData"-->
<!-- placeholder="请选择父级名称"-->
<!-- tree-default-expand-all-->
<!-- >-->
<!-- <span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }">-->
<!-- Child Node1 {{ value }}-->
<!-- </span>-->
<!-- </a-tree-select>-->
</a-form-model-item>
<a-form-model-item :label="$t('describe')" prop="description">
<a-input v-model="form.description" :placeholder="$t('PleaseEnterDescription')" />
@@ -139,7 +127,8 @@
selectedIds:[], //树形选中的id
parentData:[],
editPId:'',
tabletreeDataSource:[]
tabletreeDataSource:[],
flag:false, //提交表单标识
}
},
watch: {
@@ -151,6 +140,7 @@
},
},
mounted() {
this.loadData()
},
computed:{
@@ -190,11 +180,12 @@
postAction(`sys/category/queryPageList`,{
...this.queryParams,
// name:this.queryParams.itemText,
id:this.record.id,
sysDictId:this.record.id,
isTagDict:1
}).then(res=>{
let parentNode=[]
this.tabletreeDataSource=[...res.result]
this.total=res.result.total
let data = this.toTree(this.tabletreeDataSource)
this.tabletreeData=data
this.parentData=this.getParents
@@ -261,66 +252,78 @@
hideModal(){
this.$refs.ruleForm.validate(valid => {
if (valid) {
if(this.dictVal=='list') {
let params = {
...this.form,
dictId: this.record.id
}
if (this.isEdit) {
putAction(`sys/dictItem/edit`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.reFresh()
this.form = {}
this.loadData()
this.newVisible = false
} else {
this.$message.warning(this.$t('operationFailed'))
if(!this.flag) {
this.flag = true
if (this.dictVal == 'list') {
let params = {
...this.form,
dictId: this.record.id
}
})
} else {
postAction(`sys/dictItem/add`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.reFresh()
this.form = {}
this.loadData()
this.newVisible = false
if (this.isEdit) {
putAction(`sys/dictItem/edit`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.reFresh()
this.form = {}
this.loadData()
this.newVisible = false
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(()=>{
this.flag=false
})
} else {
this.$message.warning(this.$t('operationFailed'))
postAction(`sys/dictItem/add`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.reFresh()
this.form = {}
this.loadData()
this.newVisible = false
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(()=>{
this.flag=false
})
}
})
}
} else if (this.dictVal == 'tree') {
let params = {
...this.form,
sysDictId: this.record.id
}
if (this.isEdit) {
putAction(`sys/category/edit`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.form = {}
this.loadData()
this.newVisible = false
} else if (this.dictVal == 'tree') {
let params = {
...this.form,
sysDictId: this.record.id
}
if (this.isEdit) {
putAction(`sys/category/edit`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.form = {}
this.loadData()
this.newVisible = false
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(()=>{
this.flag=false
})
} else {
this.$message.warning(this.$t('operationFailed'))
//新增
postAction(`sys/category/add`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.form = {}
this.loadData()
this.newVisible = false
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(()=>{
this.flag=false
})
}
})
} else {
//新增
postAction(`sys/category/add`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.form = {}
this.loadData()
this.newVisible = false
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
}
}
}
})
},
@@ -1,5 +1,5 @@
<template>
<!-- <a-spin :spinning="confirmLoading">-->
<a-spin :spinning="confirmLoading">
<!-- <j-form-container :disabled="formDisabled">-->
<div class="form-tag">
<a-form>
@@ -109,7 +109,7 @@
</a-form>
</div>
<!-- </j-form-container>-->
<!-- </a-spin>-->
</a-spin>
</template>
<script>
@@ -119,7 +119,7 @@
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'OnlCgformTagForm',
name: 'TagForm',
components: {
},
props: {
@@ -229,7 +229,7 @@
contentOption2:[],
isTagContent:false,
isSearch:true,
flag:false, //表单提交标识
}
},
watch:{
@@ -349,49 +349,52 @@
this.$refs.tagEditForm.validate((valid)=>{
// console.log('valid',valid)
if (valid) {
this.confirmLoading = true;
let httpurl = '';
let method = '';
// console.log('this.editId',this.editId)
if(this.submitEdit=='add'){
httpurl+=this.url.add;
method = 'post';
this.form.id=''
this.form.isReadOnly=0
}else if(this.submitEdit=='edit'){
httpurl+=this.url.edit;
method = 'put';
this.form.id=this.editId
if(!this.flag){
this.flag=true
this.confirmLoading = true;
let httpurl = '';
let method = '';
// console.log('this.editId',this.editId)
if(this.submitEdit=='add'){
httpurl+=this.url.add;
method = 'post';
this.form.id=''
this.form.isReadOnly=0
}else if(this.submitEdit=='edit'){
httpurl+=this.url.edit;
method = 'put';
this.form.id=this.editId
}
this.form.dbIsKey='0'
this.form.dbIsNull='1'
this.form.dbPointLength='0'
this.form.isShowForm='1'
this.form.dbFieldName=this.form.dbFieldTxt
this.contentOption.forEach(item=>{
if(item.id==this.form.dictId){
// console.log('11111')
this.form.dictField=item.dictCode
this.form.dictText=item.dictName
}
})
// console.log('form',this.form)
httpAction(httpurl,this.form,method).then((res)=>{
if(res.success){
this.$message.success(this.$t('OperationSuccessful'));
postAction(`online/cgform/api/doDbSynch/48308196e7b04761b533dc31bc899707/normal
`,{}).then(res=>{
})
this.$emit('ok',false);
}else{
this.$message.warning(this.$t('operationFailed'));
}
}).finally(() => {
this.confirmLoading = false;
this.flag=false
})
}
this.form.dbIsKey='0'
this.form.dbIsNull='1'
this.form.dbPointLength='0'
this.form.isShowForm='1'
this.form.dbFieldName=this.form.dbFieldTxt
this.contentOption.forEach(item=>{
if(item.id==this.form.dictId){
// console.log('11111')
this.form.dictField=item.dictCode
this.form.dictText=item.dictName
}
})
// console.log('form',this.form)
httpAction(httpurl,this.form,method).then((res)=>{
if(res.success){
this.$message.success(this.$t('OperationSuccessful'));
postAction(`online/cgform/api/doDbSynch/48308196e7b04761b533dc31bc899707/normal
`,{}).then(res=>{
})
this.$emit('ok',false);
}else{
this.$message.warning(this.$t('operationFailed'));
}
}).finally(() => {
this.confirmLoading = false;
})
}
})
},
popupCallback(row){
@@ -408,7 +411,7 @@
}
},
handleChange(value) {
console.log(`selected ${value}`);
// console.log(`selected ${value}`);
},
}
}
@@ -16,18 +16,18 @@
<a class="action-delete" href="javascript:;" @click="onDelete(record)">{{$t('delete')}}</a>
</template>
</a-table>
<!-- <div class="page" v-if="tabData.length > 0">-->
<!-- <a-pagination-->
<!-- :show-total="total => $t('total')+` ${total} `+$t('strip')"-->
<!-- show-quick-jumper-->
<!-- show-size-changer-->
<!-- :current="queryParams.pageNo"-->
<!-- :page-size.sync="queryParams.pageSize"-->
<!-- :total="total"-->
<!-- @change="onChangePage"-->
<!-- @showSizeChange="SizeChange"-->
<!-- />-->
<!-- </div>-->
<div class="page" v-if="tabData.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:current="queryParams.pageNo"
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@showSizeChange="SizeChange"
/>
</div>
</div>
</div>
</template>
@@ -38,7 +38,8 @@
name: 'treeTable',
props:{
tabletreeData:Array,
record:Object
record:Object,
total:String
},
data(){
return{
@@ -12,7 +12,7 @@
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a class="action-edit" @click="editVisible(record.id)" v-if="record.isReadOnly==0" v-has="'tag:edit'">{{$t('edit')}}</a>
<a class="table-del" v-if="record.isReadOnly==2||record.isReadOnly==0" @click="deleteVisible(record.id)" v-has="'tag:delete'">{{$t('delete')}}</a>
<a class="table-del" v-if="record.isReadOnly==2||record.isReadOnly==0" @click="deleteVisible(record.id)" v-has="'tag:logicDelete'">{{ $t('delete')}}</a>
</span>
</a-table>
<div class="page" v-if="tableData.length > 0">
@@ -55,7 +55,7 @@
</a-form-model>
</a-modal>
<a-table :data-source="tableData" rowKey="id" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" class="tag-con-table">
<a-table :data-source="tableData" rowKey="id" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" :loading="loading" class="tag-con-table">
<template slot="action" slot-scope="text, record">
<a class="action-dict" @click="handleDicPop(record)">{{$t('DictionaryConfiguration')}}</a>
@@ -87,7 +87,6 @@
<dic-list :dictVal="dictVal" :record="record" v-if="dicVisible"></dic-list>
</a-drawer>
<!-- <tab-table :tableData="tableData" :columns="columns"></tab-table>-->
</div>
</template>
@@ -112,6 +111,7 @@
pageSize:10
},
ids:[],
loading:false,
selectedRowKeys: [],
contentVisible:false,
tableData:[],
@@ -164,6 +164,7 @@
dictVal:'list',
record: {},
isEdit:1,
flag:false, //表单提交标识
}
},
computed:{
@@ -175,6 +176,7 @@
methods:{
//获取列表数据
loadData(param){
this.loading=true
let params={
...this.queryParams,
isTagDict:1,
@@ -186,6 +188,8 @@
this.total=res.result.total
this.tableData=[...res.result.records]
}
}).finally(()=>{
this.loading=false
})
},
//查询
@@ -213,27 +217,33 @@
this.$refs.ruleForm.validate((valid)=>{
// console.log('valide',valide)
if(valid){
if(this.isEdit==1){
params.id=''
params.isTagDict=1
params.isReadOnly=0
postAction(`sys/dict/add`,params).then(res=>{
if(res.success){
this.$message.success( this.$t('OperationSuccessful'))
this.reFresh()
this.loadData()
this.contentVisible=false
this.form={}
}else{
if(res.message='标签名称不能重复'){
this.$message.warning(this.$t('labelNameCannotDuplicate'))
}else{
this.$message.warning(this.$t('operationFailed'))
if(!this.flag){
this.flag=true
if(this.isEdit==1){
params.id=''
params.isTagDict=1
params.isReadOnly=0
postAction(`sys/dict/add`,params).then(res=> {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.contentVisible = false
this.reFresh()
this.loadData()
this.form = {}
} else {
if (res.message = '标签名称不能重复') {
this.$message.warning(this.$t('labelNameCannotDuplicate'))
} else {
this.$message.warning(this.$t('operationFailed'))
}
}
}
}).finally(()=>{
this.flag=false
})
}else if(this.isEdit==0){
this.$delete(params,'isReadOnly')
@@ -249,7 +259,10 @@
}else{
this.$message.warning(this.$t('operationFailed'))
}
}).finally(()=>{
this.flag=false
})
}
}
}
})
@@ -360,7 +373,7 @@
this.dictVal='list'
this.dicVisible=true
}else{
}else if(record.attributeType=='2'){
// this.typeVisible[record.id]=false
this.dictVal='tree'
this.dicVisible=true
@@ -41,19 +41,21 @@
<a-drawer class="show-drawer" :title="titleTag" placement="right" width="1000px" @close="close" :visible="drawerVisible" :after-visible-change="afterVisibleChange" >
<div class="new-tag-drawer">
<tag-form v-if="drawerVisible&&editFlag" ref="realForm" @ok="closeTag" :isTagContent="isTagContent" :editData="editData" :editId=editId :submitEdit="submitEdit" :disabled="disableSubmit" normal> </tag-form>
<a-spin :spinning="spinningDrawer" style="width: 100%;height:100%">
<tag-form v-if="drawerVisible&&editFlag" ref="realForm" @ok="closeTag" :isTagContent="isTagContent" :editData="editData" :editId=editId :submitEdit="submitEdit" :disabled="disableSubmit" normal> </tag-form>
<div class="drawer-footer" v-if="drawerVisible&&editFlag">
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">{{$t('preservation')}}</a-button>
<a-button @click="handleCancel" style="margin-bottom: 0;">{{$t('close')}}</a-button>
</div>
<div class="drawer-footer" v-if="drawerVisible&&editFlag">
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">{{$t('preservation')}}</a-button>
<a-button @click="handleCancel" style="margin-bottom: 0;">{{$t('close')}}</a-button>
</div>
</a-spin>
</div>
</a-drawer>
<a-modal class="show-area" v-model="areaVisible" :title="$t('ExhibitionAreaManagement')" :footer="null" @cancel="hideModal">
<area-manage v-if="areaVisible" @diaHide="diaHide" @submitOk="submitOk" @deleteOk="deleteOk" @updateOk="updateOk"></area-manage>
</a-modal>
<div class="tag-doc-tab">
<a-spin :spinning="spinning" tip="Loading...">
<a-spin :spinning="spinning">
<a-tabs default-active-key="1" @change="callbackTab">
<a-tab-pane key="1" :tab="$t('DocumentLibrary')">
<tabTable v-if="spinning==false" :tableData="tableData" :columns="taglabColumns" :parm="queryParam" :selectedRowKey="selectedRowKey" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" @selecteds="selecteds" :total="total"></tabTable>
@@ -153,7 +155,9 @@
type:'input',
ids:[],
disableSubmit:false,
selectedRowKey:[]
selectedRowKey:[],
spinningDrawer:false
}
},
mounted() {
@@ -208,9 +212,9 @@
...this.queryParam,
isModel:1
}
console.log('params',params)
// console.log('params',params)
if(val==1){
console.log('1')
// console.log('1')
params.isModel=1
}else if(val==0){
params.isModel=0
@@ -267,11 +271,14 @@
let params={
id:id,
}
this.spinningDrawer=true
getAction(`tag/onlCgformTag/queryById`,params).then(res=>{
if(res.success){
this.editData=res.result
this.editFlag=true
}
}).finally(()=>{
this.spinningDrawer=false
})
},
//删除