我的订阅

This commit is contained in:
caoyang
2022-02-21 11:30:07 +08:00
parent 5865b6a3b5
commit 3c1740cfc3
7 changed files with 495 additions and 24 deletions
@@ -0,0 +1,199 @@
<template>
<div class="collection">
<a-card :bordered="false">
<div class="collection-search-wrapper">
<div class="collection-search-header">
<!-- <search ></search>-->
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-form-model
class="collection-content"
:model="queryParams"
ref="tagEditForm"
>
<a-row :gutter="44">
<a-col :md="6" :sm="12">
<a-form-model-item :label="'编号'">
<j-input :placeholder="'请输入编号'" v-model="queryParams.serialNumber"></j-input>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-model-item :label="'标题'">
<j-input :placeholder="'请输入标题'" v-model="queryParams.title"></j-input>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-model-item :label="'状态'">
<j-dict-select-tag type="list" v-model="queryParams.state" dictCode="file_type" :placeholder="'请选择状态'" />
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button @click="searchReset" icon="reload" style="margin-left: 8px">清空</a-button>
</span>
</a-col>
</a-row>
</a-form-model>
</a-form>
</div>
</div>
<div class="table-operator" style="margin-top: 10px">
<a-button @click="handleBatCancel" type="primary">批量取消收藏</a-button>
</div>
<div class="colloction-table">
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" class="tag-con-table">
<a slot="serialNumber" slot-scope="text, record" @click="numberClick(record)">{{ text }}</a>
<!-- <a slot="title" slot-scope="text, record" @click="titleClick(record)">{{ text }}</a>-->
<template slot="action" slot-scope="text, record">
<a-popconfirm
v-if="tableData.length"
title="确定取消收藏?"
@confirm="() => onCancel(record)"
>
<a class="action-delete" href="javascript:;">取消收藏</a>
</a-popconfirm>
</template>
</a-table>
<div class="page" v-if="tableData.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@showSizeChange="SizeChange"
/>
</div>
</div>
</a-card>
</div>
</template>
<script>
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
// import search from '@/components/search'
export default {
name:'collection',
data(){
return{
selectedRowKeys:[],
queryParams:{
pageNo:1,
pageSize:10
}, //搜索条件
total:0,
//列表表头
columns: [
{
title: '编号',
dataIndex: 'serialNumber',
key: 'serialNumber',
align: "center",
width: 100,
ellipsis: true,
},
{
title: '标题',
align: "center",
width: 100,
dataIndex: 'title',
ellipsis: true,
},
{
title: '状态',
align: "center",
width: 100,
dataIndex: 'state',
ellipsis: true,
},
{
title: '收藏时间',
align: "center",
width: 100,
dataIndex: 'createTime',
ellipsis: true,
},
{
title: this.$t('operation'),
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 170
}
],
tableData:[], //列表数据
}
},
mounted() {
this.loadData()
},
methods:{
//获取列表数据
loadData(){
let params={
...this.queryParams
}
getAction(`collection/onlCgformCollection/page`,params).then(res=>{
if(res.success){
this.tableData= { ...res.result.records }
}
})
},//搜索
searchQuery(){
this.loadData()
},
//批量取消收藏
handleBatCancel(){
},
//取消收藏
onCancel(record){
},
//清空
searchReset(){
this.queryParams={
pageNo: 1,
pageSize: 10
}
this.loadData()
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
//选择框
onSelectChange(selectedRowKeys,rows) {
console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
},
//点击编号
numberClick(records){
},
//点击名称
titleClick(records){
}
}
}
</script>
<style lang="less" scoped>
</style>
<style lang="less">
.collection{
.collection-content{
.ant-form-item-control-wrapper{
min-width: 180px;
}
}
}
</style>
+38 -14
View File
@@ -5,7 +5,7 @@
<!-- <search :flag="'1'" :url="url"/>-->
<div class="ocr-search-header">
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-row :gutter="24">
<a-row :gutter="44">
<a-col :md="6" :sm="12">
<a-form-item :label="'编号'">
<j-input :placeholder="'请输入编号'" v-model="queryParams.standNumber"></j-input>
@@ -16,7 +16,7 @@
<j-input :placeholder="'请输入标题'" v-model="queryParams.standName"></j-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-col :md="6" :sm="12">
<a-form-item :label="'转换结果'">
<a-select v-model="queryParams.transformation" :placeholder="$t('pleaseSelect')">
<a-select-option :value="item.value" v-for="(item) in transOptions">{{item.label}}</a-select-option>
@@ -56,7 +56,7 @@
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item ref="file" label="文件" prop="file">
<a-form-model-item ref="file" label="文件" prop="attId">
<a-button type="primary" class="button-text"
@click="fileUpload()">
{{ (file === 'null' || file === '' ||
@@ -155,6 +155,7 @@
</template>
<script>
import { axios } from '@/utils/request'
import { getAction, postAction, deleteAction } from '@/api/manage'
import search from '@/components/search/index'
import tableData from '@/components/tableDate/index'
@@ -187,8 +188,8 @@
file:'',
form:{}, //表单数据
rules:{
file:[
{ required: true, message: '请选择文件', trigger: 'blur' },
attId:[
{ required: true, message: '请选择文件', trigger: 'change' },
],
standNumber:[
{ required: true, message: '请输入编号', trigger: 'blur' },
@@ -327,9 +328,7 @@
methods:{
//获取列表数据
loadData(){
console.log('22222')
let params = this.queryParams
console.log('33333')
getAction(`ocr/ocrRecord/page`,params).then(res=> {
if(res.success){
this.total=res.result.total
@@ -427,8 +426,33 @@
//上传确定按钮
handleOk(){
this.$refs.fileForm.validate((valid)=>{
if(valid){
console.log('succ')
let params={ ...this.form }
// let formData = new FormData();
// console.log('formData',formData)
// formData.append('attId',this.form.attId);
// console.log('this.form.attId',this.form.attId)
// console.log('formData111',formData)
// formData.append('standName',this.form.standName);
// formData.append('standNumber',this.form.standNumber);
// formData.append('fileType',this.form.fileType);
let headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
// console.log('params',formData)
if(valid) {
// axios.post(`ocr/OcrRestful/addOcrRecord`,params, { headers: headers })
// .then(res => {
// if (res.success) {
// this.loadData()
// }
// })
postAction(`ocr/OcrRestful/addOcrRecord`,params).then(res=>{
if(res.success){
this.loadData()
}
})
}
})
},
@@ -439,11 +463,11 @@
uploadSuccess(data) {
console.log('updata',data)
let attIdList = []
// data.map(item => {
// attIdList.push(item.id || data.name)
// })
// // /** 赋值给当前对应的表单文件 */
// this.file = attIdList.join(',')
data.map(item => {
attIdList.push(item.id || data.name)
})
// /** 赋值给当前对应的表单文件 */
this.form.attId = attIdList.join(',')
},
fileUpload(){
this.$refs.uploadFile.visible=true
@@ -34,11 +34,22 @@
</div>
</div>
<div class="doc-table-detail">
<a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="ipagination" >
<a-table bordered :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >
<span slot="num" slot-scope="text,records,index">
{{ (ipagination.currentPage-1)*ipagination.pageSize+Number(index)+1 }}
</span>
</a-table>
<div class="page" v-if="tableSource.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@showSizeChange="SizeChange"
/>
</div>
</div>
</a-drawer>
</div>
@@ -54,6 +65,7 @@
},
data(){
return{
total:0,
visible:false,
queryParams:{
pageNo:1,
@@ -136,8 +148,17 @@
},
onSelectChange(){
}
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
},
}
</script>
@@ -0,0 +1,204 @@
<template>
<div class="subscribtion">
<a-card :bordered="false">
<div class="subscribtion-search-wrapper">
<div class="subscribtion-search-header">
<!-- <search ></search>-->
<a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">
<a-form-model
class="subscribtion-content"
:model="queryParams"
ref="tagEditForm"
>
<a-row :gutter="44">
<a-col :md="6" :sm="12">
<a-form-model-item :label="'编号'">
<j-input :placeholder="'请输入编号'" v-model="queryParams.serialNumber"></j-input>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-model-item :label="'标题'">
<j-input :placeholder="'请输入标题'" v-model="queryParams.title"></j-input>
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-model-item :label="'状态'">
<j-dict-select-tag type="list" v-model="queryParams.state" dictCode="file_type" :placeholder="'请选择状态'" />
</a-form-model-item>
</a-col>
<a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>
<a-button @click="searchReset" icon="reload" style="margin-left: 8px">清空</a-button>
</span>
</a-col>
</a-row>
</a-form-model>
</a-form>
</div>
</div>
<div class="table-operator" style="margin-top: 10px">
<a-button @click="handleBatManage" type="primary">订阅领域管理</a-button>
<a-button @click="handleBatCancel" type="danger">批量取消</a-button>
</div>
<div class="colloction-table">
<a-table bordered :data-source="tableData" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :pagination="false" class="tag-con-table">
<a slot="serialNumber" slot-scope="text, record" @click="numberClick(record)">{{ text }}</a>
<!-- <a slot="title" slot-scope="text, record" @click="titleClick(record)">{{ text }}</a>-->
<template slot="action" slot-scope="text, record">
<a-popconfirm
v-if="tableData.length"
title="确定取消订阅?"
@confirm="() => onCancel(record)"
>
<a class="action-delete" href="javascript:;">取消订阅</a>
</a-popconfirm>
</template>
</a-table>
<div class="page" v-if="tableData.length > 0">
<a-pagination
:show-total="total => ` ${total} `"
show-quick-jumper
show-size-changer
:page-size.sync="queryParams.pageSize"
:total="total"
@change="onChangePage"
@showSizeChange="SizeChange"
/>
</div>
</div>
</a-card>
</div>
</template>
<script>
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
// import search from '@/components/search'
export default {
name:'subscribtion',
data(){
return{
selectedRowKeys:[],
queryParams:{
pageNo:1,
pageSize:10
}, //搜索条件
total:0,
//列表表头
columns: [
{
title: '编号',
dataIndex: 'serialNumber',
key: 'serialNumber',
align: "center",
width: 100,
ellipsis: true,
},
{
title: '标题',
align: "center",
width: 100,
dataIndex: 'title',
ellipsis: true,
},
{
title: '状态',
align: "center",
width: 100,
dataIndex: 'state',
ellipsis: true,
},
{
title: '订阅时间',
align: "center",
width: 100,
dataIndex: 'createTime',
ellipsis: true,
},
{
title: this.$t('operation'),
dataIndex: 'action',
scopedSlots: {customRender: 'action'},
align: "center",
width: 170
}
],
tableData:[], //列表数据
}
},
mounted() {
this.loadData()
},
methods:{
//获取列表数据
loadData(){
let params={
...this.queryParams
}
getAction(``,params).then(res=>{
if(res.success){
// this.tableData= { ...res.result.records }
}
})
},//搜索
searchQuery(){
this.loadData()
},
//订阅领域管理
handleBatManage(){
},
//批量取消收藏
handleBatCancel(){
},
//取消收藏
onCancel(record){
},
//清空
searchReset(){
this.queryParams={
pageNo: 1,
pageSize: 10
}
this.loadData()
},
//点击页数
onChangePage(page,pageSize){
this.queryParams.pageNo = page
this.loadData()
},
//一页显示条数
SizeChange(page,pageSize){
this.queryParams.pageSize = pageSize
this.loadData()
},
//选择框
onSelectChange(selectedRowKeys,rows) {
console.log('selectedRowKeys changed: ', selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
},
//点击编号
numberClick(records){
},
//点击名称
titleClick(records){
}
}
}
</script>
<style lang="less" scoped>
</style>
<style lang="less">
.subscribtion{
.subscribtion-content{
.ant-form-item-control-wrapper{
min-width: 180px;
}
}
}
</style>
@@ -36,7 +36,12 @@
</a-col>
<a-col :span="24" v-if="isTagContent">
<a-form-model-item label="选项内容" prop="dictName">
<j-dict-select-tag type="list" v-model="form.dictName" dictCode="" placeholder="请选择选项内容" />
<a-select placeholder="请选择选项内容" v-model="form.dictName" @change="handleChange">
<a-select-option v-for="(item,index) in contentOption" :key="item.id" :value="item.id">
{{item.showArea}}
</a-select-option>
</a-select>
<!-- <j-dict-select-tag type="list" v-model="form.dictName" dictCode="" placeholder="请选择选项内容" />-->
</a-form-model-item>
</a-col>
<a-col :span="24">
@@ -210,7 +215,9 @@
queryById: "tag/onlCgformTag/queryById"
},
//展示区域选项内容
areaOptions:[]
areaOptions:[],
//选项内容选项
contentOption:[]
}
},
watch:{
@@ -243,6 +250,7 @@
this.showFlowData();
},
mounted() {
this.loadContent()
this.loadShowArea()
this.form={...this.editData}
// console.log('drawerVisible',this.drawerVisible)
@@ -251,9 +259,9 @@
//获取选项内容
loadContent(){
let params = {};
getAction(``,params).then((res)=>{
getAction(`sys/dict/queryDictName`,params).then((res)=>{
if(res.success){
this.contentOption=res.result
}
});
},
@@ -76,7 +76,7 @@
<a-divider type="vertical" />
<a-popconfirm
v-if="areaTable.length"
title="Sure to delete?"
title="确定删除?"
@confirm="() => deleteArea(record.id)"
>
<a style="color:red" href="javascript:;">删除</a>
@@ -182,6 +182,9 @@
if(this.form.id){
putAction(`tag/onlCgformArea/edit`,this.form).then((res)=>{
if(res.success){
this.$notification.success({
message: res.result,
});
this.$emit('updateOk',res.result)
this.form={
isModel:'',
@@ -190,12 +193,14 @@
sort:''
}
}
});
}else{
//新增
postAction(`/tag/onlCgformArea/add`,this.form).then(res=>{
if(res.success){
this.$notification.success({
message: res.result,
});
this.$emit('submitOk',res.result)
this.form={
isModel:'',
@@ -223,6 +228,9 @@
deleteArea(val){
deleteAction(`tag/onlCgformArea/delete`, {id: val}).then((res) => {
if(res.success){
this.$notification.success({
message: res.result,
});
this.$emit('deleteOk',res.result)
}
@@ -45,14 +45,16 @@
<area-manage v-if="areaVisible" @diaHide="diaHide" :areaTable="areaTable" @submitOk="submitOk" @deleteOk="deleteOk" @updateOk="updateOk"></area-manage>
</a-modal>
<div class="tag-doc-tab">
<a-spin :spinning="spinning" tip="Loading...">
<a-tabs default-active-key="1" @change="callbackTab">
<a-tab-pane key="1" tab="文档库">
<tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" :total="total"></tabTable>
</a-tab-pane>
<a-tab-pane key="2" tab="文档拆分" force-render>
<tabTable :tableData="tableData" :columns="tagSplit" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" :total="total"></tabTable>
<tabTable :tableData="tableData" :columns="taglabColumns" @visibleEd="visibleEd" @visibleDelete="visibleDelete" @queryParams="queryParams" :total="total"></tabTable>
</a-tab-pane>
</a-tabs>
</a-spin>
</div>
</div>
</template>
@@ -73,6 +75,7 @@
},
data(){
return{
spinning:false,
queryParam:{
page:1,
pageSize:10,
@@ -237,6 +240,8 @@
},
//标签项管理文档库初始数据
loadData(val){
this.spinning=true
this.tableData=[]
let params={
...this.queryParam,
isModel:1
@@ -248,8 +253,10 @@
}
getAction(`tag/onlCgformTag/page`,params).then(res=>{
if(res.success){
this.total=res.result.total
this.tableData= [ ...res.result.records]
this.spinning=false
}
})
},