ocr识别修改
This commit is contained in:
@@ -94,7 +94,7 @@ module.exports = {
|
||||
newUser:'new user',
|
||||
ExistingUsers:'Existing users',
|
||||
total:'total',
|
||||
strip:'',
|
||||
strip:'data',
|
||||
RoleCode:'Role code',
|
||||
createTime:'create time',
|
||||
userName:'user name',
|
||||
@@ -386,4 +386,12 @@ module.exports = {
|
||||
DocumentLibrary:'Document Library',
|
||||
DocumentComparisonLibrary:'Document comparison Library',
|
||||
weekly:'weekly',
|
||||
SyncLibrary:'Sync to document library',
|
||||
check:'check',
|
||||
enName:'English name',
|
||||
selectLeastOne:'Please select at least one piece of data',
|
||||
sureVerified:'Are you sure this file is not verified?',
|
||||
sureSynchronize:'The file has not been verified. Are you sure you want to synchronize to the document library?',
|
||||
UploadFile:'Upload file',
|
||||
|
||||
}
|
||||
@@ -390,4 +390,13 @@ module.exports = {
|
||||
DocumentLibrary:'文档库',
|
||||
DocumentComparisonLibrary:'文档对比库',
|
||||
weekly:'周报',
|
||||
SyncLibrary:'同步至文档库',
|
||||
check:'校核',
|
||||
enName:'英文名称',
|
||||
selectLeastOne:'请选择至少一条数据',
|
||||
sureVerified:'确定对该文件未进行校验?',
|
||||
sureSynchronize:'该文件未进行校验,确定要同步至文档库?',
|
||||
UploadFile:'上传文件',
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<a-table
|
||||
class="table"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
:scroll="{x: true}"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
@change="tableOnChange"
|
||||
>
|
||||
<span slot="operation" slot-scope="record">
|
||||
<a class="text" v-for="(ol,index) in OperationList"
|
||||
@click="OperationClick(ol,record)">
|
||||
{{ol.text}}
|
||||
</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="page" v-if="dataSource.length > 0">
|
||||
<a-pagination
|
||||
:show-total="total => $t('total')+` ${total} ` +$t('strip')"
|
||||
show-quick-jumper
|
||||
show-size-changer
|
||||
:page-size.sync="pageSize"
|
||||
:total="total"
|
||||
@change="onChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eventBUs from '../../common/event'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'coTable',
|
||||
props: {
|
||||
//接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 操作按钮
|
||||
OperationList: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//是否显示操作;默认不显示
|
||||
showAction: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jsonBody: [],
|
||||
checkboxList: [],
|
||||
tableAll: false,
|
||||
indeterminate: false,
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
searchParmes: {},
|
||||
loading: false,
|
||||
orderBy: '1',
|
||||
orderByField: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
eventBUs.$on('searchQuery', search => {
|
||||
Object.keys(search).forEach(res => {
|
||||
if (search[res] instanceof Array) {
|
||||
search[res] = search[res].join(',')
|
||||
}
|
||||
})
|
||||
this.searchParmes = search
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
eventBUs.$on('searchReset', target => {
|
||||
this.searchParmes = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTextWith(text, fontStyle) {
|
||||
var canvas = document.createElement('canvas')
|
||||
var context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
var dimension = context.measureText(text)
|
||||
return dimension.width + 40
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag: this.flag
|
||||
}
|
||||
getAction(this.url.tableHeader, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
jsonHead.forEach((res, index) => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort
|
||||
})
|
||||
if (res.click) {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailClick'
|
||||
}
|
||||
} else {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailText'
|
||||
}
|
||||
}
|
||||
})
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
for (let i = 0; i < this.OperationList.length; i++) {
|
||||
width += this.getTextWith(this.OperationList[i].text)
|
||||
}
|
||||
}
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
title: this.$t('operation'),
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: width,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
this.orderByField = sorter.columnKey
|
||||
this.getTableList()
|
||||
},
|
||||
getTableList() {
|
||||
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
|
||||
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
|
||||
let params = {
|
||||
...this.searchParmes,
|
||||
orderBy: this.orderBy,
|
||||
orderByField: this.orderByField,
|
||||
pageNo: pageNo + '',
|
||||
pageSize: pageSize + ''
|
||||
}
|
||||
this.loading = true
|
||||
postAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.getTableList()
|
||||
},
|
||||
onSelectChange(value) {
|
||||
this.selectedRowKeys = value
|
||||
this.$emit('onSelectChange', value)
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table .ant-table-column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ant-table td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -6,7 +6,7 @@
|
||||
<a-col :span="24" v-if="item.field_show_type === '1'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -21,7 +21,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '2'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '5'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -54,7 +54,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '6'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -69,7 +69,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '2'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -84,7 +84,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '3'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -100,7 +100,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '4'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -116,7 +116,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'RADIO'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -131,7 +131,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '8'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -145,7 +145,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === 'treeSelect'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '7'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -172,7 +172,7 @@
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload(item.db_field_name)">
|
||||
{{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
|
||||
formInline[item.db_field_name] == null) ? '点击上传' : '查看已上传文件'
|
||||
formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
@@ -182,7 +182,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '9'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
@@ -196,7 +196,7 @@
|
||||
<a-col :span="24" v-else-if="item.field_show_type === '10'">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required" v-if="item.field_must_input == 0">*</span>
|
||||
<span class="Required" v-if="item.field_must_input == 1">*</span>
|
||||
<!-- <span :class="{'title-text-text':false}">{{item.db_field_en_name}}</span><br>-->
|
||||
<span class="title-text-text">{{item.db_field_txt}}</span>
|
||||
</div>
|
||||
@@ -271,7 +271,9 @@
|
||||
},
|
||||
methods: {
|
||||
sumber() {
|
||||
console.log('vilidate',this.$refs.ruleForm1)
|
||||
this.$refs.ruleForm1.validate(valid => {
|
||||
console.log('va',valid)
|
||||
if (valid) {
|
||||
let url = ''
|
||||
if (this.formInline.id) {
|
||||
@@ -321,8 +323,8 @@
|
||||
let rules = {}
|
||||
this.ruleList.forEach((res, index) => {
|
||||
const rule = []
|
||||
if (res.field_must_input == 0) {
|
||||
if (res.field_show_type === 'text') {
|
||||
if (res.field_must_input == 1) {
|
||||
if (res.field_show_type === '1') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
@@ -347,7 +349,13 @@
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === 'RADIO' || res.field_show_type === 'list') {
|
||||
} else if (res.field_show_type === 'RADIO' || res.field_show_type === '3') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
trigger: 'change'
|
||||
})
|
||||
}else if (res.field_show_type === '7') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + '不能为空',
|
||||
@@ -363,6 +371,7 @@
|
||||
this.$set(this, 'rules', rules)
|
||||
this.isFormInline = true
|
||||
this.confirmLoading = false
|
||||
console.log('rules',rules,this)
|
||||
},
|
||||
getForm() {
|
||||
this.confirmLoading = true
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<a-table
|
||||
class="table"
|
||||
:rowKey="(record,index)=>{return index}"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
:scroll="{x: true}"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
@change="tableOnChange"
|
||||
>
|
||||
<span slot="operation" slot-scope="record">
|
||||
<a class="text" v-for="(ol,index) in OperationList"
|
||||
@click="OperationClick(ol,record)">
|
||||
<span v-if="ol.text==$t('SyncLibrary')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('check')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('download')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('delete')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
</a>
|
||||
</span>
|
||||
<!-- <span slot="detailClick" slot-scope="text,record">-->
|
||||
<!-- <a class="text" :title="text" @click="detailClick(record)">{{text}}</a>-->
|
||||
<!-- </span>-->
|
||||
<!-- <span slot="detailText" slot-scope="text,record">-->
|
||||
<!-- <span class="text" :title="text">-->
|
||||
<!-- {{text.length > 18?text.slice(0,17)+'...':text}}-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="page" v-if="dataSource.length > 0">
|
||||
<a-pagination
|
||||
:show-total="total => $t('total')+` ${total} ` +$t('strip')"
|
||||
show-quick-jumper
|
||||
show-size-changer
|
||||
:page-size.sync="pageSize"
|
||||
:total="total"
|
||||
@change="onChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eventBUs from '../../common/event'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'docTable',
|
||||
props: {
|
||||
//接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 操作按钮
|
||||
OperationList: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//是否显示操作;默认不显示
|
||||
showAction: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jsonBody: [],
|
||||
checkboxList: [],
|
||||
tableAll: false,
|
||||
indeterminate: false,
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
searchParmes: {},
|
||||
loading: false,
|
||||
orderBy: '1',
|
||||
orderByField: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
eventBUs.$on('searchQuery', search => {
|
||||
Object.keys(search).forEach(res => {
|
||||
if (search[res] instanceof Array) {
|
||||
search[res] = search[res].join(',')
|
||||
}
|
||||
})
|
||||
this.searchParmes = search
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
eventBUs.$on('searchReset', target => {
|
||||
this.searchParmes = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTextWith(text, fontStyle) {
|
||||
var canvas = document.createElement('canvas')
|
||||
var context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
var dimension = context.measureText(text)
|
||||
return dimension.width + 40
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag: this.flag
|
||||
}
|
||||
getAction(this.url.tableHeader, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
jsonHead.forEach((res, index) => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort
|
||||
})
|
||||
if (res.click) {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailClick'
|
||||
}
|
||||
} else {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailText'
|
||||
}
|
||||
}
|
||||
})
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
for (let i = 0; i < this.OperationList.length; i++) {
|
||||
width += this.getTextWith(this.OperationList[i].text)
|
||||
}
|
||||
}
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
title: this.$t('operation'),
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: width,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
this.orderByField = sorter.columnKey
|
||||
this.getTableList()
|
||||
},
|
||||
getTableList() {
|
||||
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
|
||||
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
|
||||
let params = {
|
||||
...this.searchParmes,
|
||||
orderBy: this.orderBy,
|
||||
orderByField: this.orderByField,
|
||||
pageNo: pageNo + '',
|
||||
pageSize: pageSize + ''
|
||||
}
|
||||
this.loading = true
|
||||
postAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.getTableList()
|
||||
},
|
||||
onSelectChange(value,rows) {
|
||||
this.selectedRowKeys = value
|
||||
this.$emit('onSelectChange', value, rows)
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table .ant-table-column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ant-table td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,245 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<div class="box">
|
||||
<a-table
|
||||
class="table"
|
||||
rowKey="id"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:pagination="false"
|
||||
:scroll="{x: true}"
|
||||
:data-source="dataSource"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
@change="tableOnChange"
|
||||
>
|
||||
<span slot="operation" slot-scope="record">
|
||||
<a class="text" v-for="(ol,index) in OperationList"
|
||||
@click="OperationClick(ol,record)">
|
||||
<span v-if="ol.text==$t('SyncLibrary')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('check')">
|
||||
{{record.resultContent=='转换成功'&&record.syncState=='未同步'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('download')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
<span v-if="ol.text==$t('delete')">
|
||||
{{record.resultContent=='转换成功'?ol.text:''}}
|
||||
</span>
|
||||
</a>
|
||||
</span>
|
||||
<span slot="detailClick" slot-scope="text,record">
|
||||
<a class="text" :title="text" @click="detailClick(record)">{{text}}</a>
|
||||
</span>
|
||||
<!-- <span slot="detailText" slot-scope="text,record">-->
|
||||
<!-- <span class="text" :title="text">-->
|
||||
<!-- {{text.length > 18?text.slice(0,17)+'...':text}}-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>-->
|
||||
|
||||
</a-table>
|
||||
</div>
|
||||
<div class="page" v-if="dataSource.length > 0">
|
||||
<a-pagination
|
||||
:show-total="total => $t('total')+` ${total} ` +$t('strip')"
|
||||
show-quick-jumper
|
||||
show-size-changer
|
||||
:page-size.sync="pageSize"
|
||||
:total="total"
|
||||
@change="onChange"
|
||||
@showSizeChange="SizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import eventBUs from '../../common/event'
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'ocrTable',
|
||||
props: {
|
||||
//接口
|
||||
url: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
// 操作按钮
|
||||
OperationList: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
flag: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
//是否显示操作;默认不显示
|
||||
showAction: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
jsonBody: [],
|
||||
checkboxList: [],
|
||||
tableAll: false,
|
||||
indeterminate: false,
|
||||
columns: [],
|
||||
selectedRowKeys: [],
|
||||
dataSource: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
searchParmes: {},
|
||||
loading: false,
|
||||
orderBy: '1',
|
||||
orderByField: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
eventBUs.$on('searchQuery', search => {
|
||||
Object.keys(search).forEach(res => {
|
||||
if (search[res] instanceof Array) {
|
||||
search[res] = search[res].join(',')
|
||||
}
|
||||
})
|
||||
this.searchParmes = search
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
eventBUs.$on('searchReset', target => {
|
||||
this.searchParmes = {}
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
})
|
||||
this.getData()
|
||||
this.getTableList()
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTextWith(text, fontStyle) {
|
||||
var canvas = document.createElement('canvas')
|
||||
var context = canvas.getContext('2d')
|
||||
context.font = fontStyle || '14px' // 设置字体样式
|
||||
var dimension = context.measureText(text)
|
||||
return dimension.width + 40
|
||||
},
|
||||
getData() {
|
||||
let params = {
|
||||
flag: this.flag
|
||||
}
|
||||
getAction(this.url.tableHeader, params).then((res) => {
|
||||
if (res.success) {
|
||||
var jsonHead = res.result
|
||||
this.columns = []
|
||||
jsonHead.forEach((res, index) => {
|
||||
this.columns.push({
|
||||
title: res.db_field_txt,
|
||||
dataIndex: res.db_field_name,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
sorter: res.sort
|
||||
})
|
||||
if (res.click) {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailClick'
|
||||
}
|
||||
} else {
|
||||
this.columns[index].scopedSlots = {
|
||||
customRender: 'detailText'
|
||||
}
|
||||
}
|
||||
})
|
||||
let width = 0
|
||||
if (this.OperationList.length > 0) {
|
||||
for (let i = 0; i < this.OperationList.length; i++) {
|
||||
width += this.getTextWith(this.OperationList[i].text)
|
||||
}
|
||||
}
|
||||
if (this.showAction) {
|
||||
this.columns.push({
|
||||
title: this.$t('operation'),
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
width: width,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
tableOnChange(pagination, filters, sorter) {
|
||||
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
|
||||
this.orderByField = sorter.columnKey
|
||||
this.getTableList()
|
||||
},
|
||||
getTableList() {
|
||||
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
|
||||
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
|
||||
let params = {
|
||||
...this.searchParmes,
|
||||
orderBy: this.orderBy,
|
||||
orderByField: this.orderByField,
|
||||
pageNo: pageNo + '',
|
||||
pageSize: pageSize + ''
|
||||
}
|
||||
this.loading = true
|
||||
postAction(this.url.tableList, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records
|
||||
this.total = res.result.total
|
||||
this.loading = false
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
onChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getTableList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageSize = pageSize
|
||||
this.getTableList()
|
||||
},
|
||||
onSelectChange(value,rows) {
|
||||
this.selectedRowKeys = value
|
||||
this.$emit('onSelectChange', value, rows)
|
||||
},
|
||||
OperationClick(ol, item) {
|
||||
this.$emit(ol.ClickEvent, item)
|
||||
},
|
||||
detailClick(item, index) {
|
||||
this.$emit('detailClick', item)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.table .ant-table-column-title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ant-table td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.box {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -14,7 +14,7 @@
|
||||
:remove='remove'
|
||||
@change="handleChange">
|
||||
<p><a-icon style="font-size: 67px;color: #c0c4cc;" type="cloud-upload" /></p>
|
||||
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">点击上传</p>
|
||||
<p class="ant-upload-text" style="font-size: 14px;line-height: 30px">{{$t('clickUpload')}}</p>
|
||||
</a-upload-dragger>
|
||||
</a-modal>
|
||||
</div>
|
||||
@@ -35,7 +35,7 @@
|
||||
fileList:[],
|
||||
fileTypeSatus:false,
|
||||
headers:{},
|
||||
title:'上传文件'
|
||||
title:this.$t('UploadFile')
|
||||
}
|
||||
},
|
||||
created(){
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
|
||||
import eventBUs from '../../../common/event'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/coTable/index'
|
||||
export default {
|
||||
name:'collection',
|
||||
components:{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<!-- 上传弹框-->
|
||||
<a-modal
|
||||
class="show-content"
|
||||
title="上传文件"
|
||||
:title="$t('UploadFile')"
|
||||
:visible="fileVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="modalOk"
|
||||
@@ -41,26 +41,26 @@
|
||||
<!-- 同步弹框-->
|
||||
<a-modal
|
||||
class="show-content"
|
||||
title="同步至文档库"
|
||||
:title="$t('SyncLibrary')"
|
||||
v-if="toVisible"
|
||||
:visible="toVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleOkTo"
|
||||
@cancel="handleCancelTo"
|
||||
>
|
||||
<p style="text-align: center">该文件未进行校验,确定要同步至文档库?</p>
|
||||
<p style="text-align: center">{{$t('sureSynchronize')}}</p>
|
||||
</a-modal>
|
||||
<!-- 校核弹框-->
|
||||
<a-modal
|
||||
class="show-content"
|
||||
title="校核"
|
||||
:title="$t('check')"
|
||||
v-if="checkVisible"
|
||||
:visible="checkVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleOkCheck"
|
||||
@cancel="handleCancelCheck"
|
||||
>
|
||||
<p style="text-align: center">确定对该文件未进行校验?</p>
|
||||
<p style="text-align: center">{{$t('sureVerified')}}</p>
|
||||
</a-modal>
|
||||
<div class="table-detail">
|
||||
<tableData
|
||||
@@ -86,9 +86,9 @@
|
||||
|
||||
<script>
|
||||
import { axios } from '@/utils/request'
|
||||
import { getAction, postAction, deleteAction } from '@/api/manage'
|
||||
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/ocrTable/index'
|
||||
import addForm from '@/components/ocrAddForm/index'
|
||||
import docTable from './modules/docTable'
|
||||
import ocrUpload from '@/components/ocrUpload/index'
|
||||
@@ -108,21 +108,21 @@
|
||||
return{
|
||||
OperationList: [
|
||||
{
|
||||
text: '同步至文档库',
|
||||
text: this.$t('SyncLibrary'),
|
||||
ClickEvent: 'actionSynchron'
|
||||
},
|
||||
}, //同步至文档库
|
||||
{
|
||||
text: '校核',
|
||||
text: this.$t('check'),
|
||||
ClickEvent: 'actionCheck'
|
||||
},
|
||||
}, //校核
|
||||
{
|
||||
text: '下载',
|
||||
text: this.$t('download'),
|
||||
ClickEvent: 'actionDown'
|
||||
},
|
||||
}, //下载
|
||||
{
|
||||
text: '删除',
|
||||
text: this.$t('delete'),
|
||||
ClickEvent: 'actionDelete'
|
||||
}
|
||||
} //删除
|
||||
],
|
||||
pageSize:10,
|
||||
labelCol: { span:4 },
|
||||
@@ -189,7 +189,7 @@
|
||||
}
|
||||
if(this.selectedIds){
|
||||
this.$confirm({
|
||||
title: '确认要批量删除?',
|
||||
title: this.$t('ConfirmBatchDeletion'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
@@ -205,7 +205,7 @@
|
||||
onCancel() {},
|
||||
});
|
||||
}else{
|
||||
this.$message.warning('请选择至少一条数据!');
|
||||
this.$message.warning(this.$t('selectLeastOne'));
|
||||
}
|
||||
},
|
||||
//同步
|
||||
@@ -228,11 +228,8 @@
|
||||
},
|
||||
//下载
|
||||
actionDown(val){
|
||||
if(val.resultContent=='转换成功'){
|
||||
|
||||
}else{
|
||||
this.$message.warning('未转换成功或已同步至文档库')
|
||||
}
|
||||
console.log()
|
||||
downloadFile('/sys/common/download', val.fileName, { id: val.id })
|
||||
},
|
||||
//删除
|
||||
actionDelete(record){
|
||||
@@ -240,7 +237,7 @@
|
||||
id:record.id
|
||||
}
|
||||
this.$confirm({
|
||||
title: '确认删除?',
|
||||
title: this.$t('ConfirmDelete'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
@@ -262,7 +259,6 @@
|
||||
},
|
||||
onSelectChange(selectedRowKeys,selectedRows){
|
||||
this.selectedIds=selectedRowKeys.join(',')
|
||||
// console.log('seIds',this.selectedIds)
|
||||
|
||||
},
|
||||
//上传确定按钮
|
||||
|
||||
@@ -12,26 +12,6 @@
|
||||
<div class="doc-table-content">
|
||||
<div class="doc-header">
|
||||
<search :url="url" :flag="'condition'"></search>
|
||||
<!-- <a-form layout="inline" v-model="queryParams" @keyup.enter.native="searchQuery(queryParams)">-->
|
||||
<!-- <a-row :gutter="24">-->
|
||||
<!-- <a-col :md="6" :sm="12">-->
|
||||
<!-- <a-form-item :label="'编号'">-->
|
||||
<!-- <j-input :placeholder="'请输入编号'" v-model="queryParams.serialNumber"></j-input>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :md="6" :sm="12">-->
|
||||
<!-- <a-form-item :label="'标题'">-->
|
||||
<!-- <j-input :placeholder="'请输入标题'" v-model="queryParams.title"></j-input>-->
|
||||
<!-- </a-form-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>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="doc-table-detail">
|
||||
@@ -39,26 +19,10 @@
|
||||
:flag="'header'"
|
||||
:url="url"
|
||||
:showAction="false"
|
||||
:OperationList="OperationList"
|
||||
@onSelectChange="onSelectChange"
|
||||
/>
|
||||
</div>
|
||||
<!-- <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">-->
|
||||
<!-- {{ (queryParams.pageNo-1)*queryParams.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>-->
|
||||
<div class="doc-table-footer">
|
||||
<a-button type="primary" class="btn-export" @click="tableExport">导入</a-button>
|
||||
<a-button type="primary" @click="onClose">取消</a-button>
|
||||
@@ -70,7 +34,7 @@
|
||||
<script>
|
||||
import { getAction, postAction, deleteAction } from '@/api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/ocrTable/docTable'
|
||||
export default {
|
||||
name: 'docTable',
|
||||
components:{
|
||||
@@ -158,7 +122,8 @@
|
||||
tableList: 'document/bussDocumentLibraryEO/ocrPageInfo', //表格数据
|
||||
// getAddForm: 'ocr/ocrRecord/getForm', // 表单的字段
|
||||
// addInfo: 'ocr/OcrRestful/addOcrRecord', //新增
|
||||
}
|
||||
},
|
||||
rowId:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -193,9 +158,13 @@
|
||||
searchReset(){
|
||||
|
||||
},
|
||||
onSelectChange(rowKeys){
|
||||
|
||||
console.log('key',rowKeys)
|
||||
onSelectChange(rowKeys,rows){
|
||||
if(rowKeys.length>1){
|
||||
this.$message.warning('只能选择一条数据')
|
||||
}else{
|
||||
this.rowId=rowKeys[0]
|
||||
this.rows=rows[0]
|
||||
}
|
||||
},
|
||||
//点击页数
|
||||
onChangePage(page,pageSize){
|
||||
@@ -209,7 +178,45 @@
|
||||
},
|
||||
//导入按钮
|
||||
tableExport(){
|
||||
// this.$emit('exportVisible',true)
|
||||
if(this.rows.length>1){
|
||||
this.$message.warning('只能选择一条数据')
|
||||
}else {
|
||||
if(this.rows.file_name){
|
||||
let name = this.rows.file_name.split('.')
|
||||
let nameSuffix=name[name.length-1]
|
||||
if(nameSuffix.toLowerCase()=='pdf'){
|
||||
let params = {
|
||||
attId: this.rows.connect_id,
|
||||
standName: this.rows.title,
|
||||
standNumber: this.rows.serial_number
|
||||
}
|
||||
if(this.rows.text_info=='发布稿(必读)'){
|
||||
params.fileType='1'
|
||||
}else if(this.rows.text_info=='增补件(必读)'){
|
||||
params.fileType='2'
|
||||
}else if(this.rows.text_info=='报批稿'){
|
||||
params.fileType='3'
|
||||
}else if(this.rows.text_info=='征求意见稿'){
|
||||
params.fileType='4'
|
||||
}else if(this.rows.text_info=='测试程序'){
|
||||
params.fileType='5'
|
||||
}else if(this.rows.text_info=='相关资料'){
|
||||
params.fileType='6'
|
||||
}
|
||||
postAction(`ocr/OcrRestful/addOcrRecord`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
// this.$emit('exportVisible',true)
|
||||
}else{
|
||||
this.$message.warning('只能导入pdf文件')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<script>
|
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import tableData from '@/components/tableDate/index'
|
||||
import tableData from '@/components/coTable/index'
|
||||
import subArea from './module/subArea'
|
||||
import eventBUs from '../../../common/event'
|
||||
export default {
|
||||
|
||||
@@ -96,9 +96,9 @@
|
||||
dataIndex: 'itemText',
|
||||
},
|
||||
{
|
||||
title: this.$t('DictionaryEnName'),
|
||||
title: this.$t('enName'),
|
||||
align: "center",
|
||||
dataIndex: 'itemValue',
|
||||
dataIndex: 'enName',
|
||||
},
|
||||
{
|
||||
title: this.$t('DataValue'),
|
||||
|
||||
Reference in New Issue
Block a user