Merge remote-tracking branch 'origin/dev_2nd_period_test' into dev_2nd_period_test

This commit is contained in:
zyx.net
2022-11-04 13:41:17 +08:00
49 changed files with 1227 additions and 538 deletions
+1
View File
@@ -1359,5 +1359,6 @@ module.exports = {
Topping:'Topping',
cancelTopping:'Cancel Topping',
relatedProjectVersion:'Related project version',
Importfailure:'Import failure',
CuiBan:'CuiBan',
}
+1
View File
@@ -1460,5 +1460,6 @@ module.exports = {
Topping:'置顶',
cancelTopping:'取消置顶',
relatedProjectVersion:'相关项目版本',
Importfailure:'导入失败',
CuiBan:'催办',
}
@@ -0,0 +1,284 @@
<template>
<div>
<a-upload name="file" :showUploadList="false"
class="upload-text"
:multiple="false" :headers="tokenHeader"
:action="importUrl"
@change="handleImport"
:accept="accept">
<a-icon type="import" :rotate="270"/>
{{$t('import')}}
</a-upload>
<div class="loading-box" v-if="spinning">
<div class="loading-content">
<a-icon class="loading" type="loading"/>
<div class="loading-tips">
{{this.$t('Importing')}}...
</div>
</div>
</div>
<!-- 错误数据提示-->
<a-modal
:title="$t('Importfailure')"
:width="860"
v-model="visibleoperationFailed"
:maskClosable="false"
:footer="null"
>
<a-row :gutter="24">
<a-col :span="24">
<div>
<span style='font-size: 16px;margin-bottom: 20px;' v-for='(item,key) in operationFailedValue'>
<span v-html="item"></span>
</span>
</div>
</a-col>
</a-row>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn" type="primary" @click="cancleoperationFailed">{{$t('cancel')}}</a-button>
</div>
</div>
</a-modal>
</div>
</template>
<script>
import Vue from 'vue'
import {ACCESS_TOKEN} from '@/store/mutation-types'
import eventBUs from '../../common/event'
import {Modal} from 'ant-design-vue'
import store from '@/store'
export default {
name: 'index',
props: {
url: {
type: Object,
default: {}
},
//判断当前文档库还是其余的页面
isTrue: {
type: Boolean,
default: false
},
accept: {
type: String,
default: ''
},
projectId: {
type: String,
default: ''
},
dummyInventoryBaseId: {
type: String,
default: ''
},
paramsTemplateId: {
type: String,
default: ''
},
paramsManifestId: {
type: String,
default: ''
},
projectLibraryId: {
type: String,
default: ''
}
},
data() {
return {
tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
spinning: false,
operationFailedValue:[],
visibleoperationFailed: false, // 数据失败的弹框
cut: ''
}
},
computed: {
importUrl() {
if (this.projectId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&projectId=' + this.projectId
} else if (this.dummyInventoryBaseId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&dummyInventoryBaseId=' + this.dummyInventoryBaseId
} else if (this.paramsTemplateId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&paramsTemplateId=' + this.paramsTemplateId
} else if (this.projectLibraryId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&projectLibraryId=' + this.projectLibraryId
} else if (this.paramsManifestId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&paramsManifestId=' + this.paramsManifestId
}
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut
}
},
mounted() {
let long = localStorage.getItem('language')
this.cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
},
methods: {
handleImport(info) {
this.spinning = true
if (info.file.status !== 'uploading') {
this.$emit('getList')
}
if (info.file.status === 'done') {
if (info.file.response.success) {
if (info.file.response.code === 201) {
let {message} = info.file.response
let {name} = info.file
let content = []
if (message) {
message = message.split('</br>')
message.forEach(res => {
if (res) {
content.push( < div > {res} < /div>)
}
})
}
this.$warning({
title: name,
content: (
< div >
{content}
< /div>
)
})
} else {
if (this.isTrue) {
this.$emit('getList')
} else {
eventBUs.$emit('searchReset')
}
console.log(info.file.response.message)
if(info.file.response.message == null){
console.log(111)
this.operationFailedValue = info.file.response.result
this.visibleoperationFailed = true
}else{
this.$message.success(info.file.response.message || `${info.file.name} 文件导入成功`)
}
}
this.spinning = false
} else {
let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN)
if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token')) || (token && data.message.includes('用户不存在'))) {
this.spinning = false
Modal.error({
title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
}
})
return
}
let {message} = info.file.response
let {name} = info.file
let content = []
if (message) {
message = message.split('</br>')
message.forEach(res => {
if (res) {
content.push( < div > {res} < /div>)
}
})
}
this.$warning({
title: name,
content: (
< div >
{content}
< /div>
)
})
this.spinning = false
}
} else if (info.file.status === 'error') {
if (info.file.response.status === 500) {
let data = info.file.response
const token = Vue.ls.get(ACCESS_TOKEN)
if ((token && data.message.includes('Token失效')) || (token && data.message.includes('token')) || (token && data.message.includes('用户不存在'))) {
Modal.error({
title: '登录已过期',
content: '很抱歉,登录已过期,请重新登录',
okText: '重新登录',
mask: false,
onOk: () => {
store.dispatch('Logout').then(() => {
Vue.ls.remove(ACCESS_TOKEN)
window.location.reload()
})
}
})
}
this.spinning = false
} else {
this.$message.error(`文件导入失败: ${info.file.msg} `)
this.spinning = false
}
}
},
// 错误数据的弹框
cancleoperationFailed() {
this.operationFailedValue = []
this.visibleoperationFailed = false
},
}
}
</script>
<style>
.upload-text .ant-upload {
font-size: 14px !important;
font-weight: 400 !important;
color: #040B29 !important;
}
</style>
<style scoped lang="less">
.loading-box {
position: fixed;
top: 0;
left: 0;
z-index: 9999900;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.9);
border-radius: 8px;
user-select: none;
.loading-content {
position: absolute;
top: 50%;
left: 50%;
color: #21c9cc;
transform: translate(-50%, -50%);
text-align: center;
.loading {
font-size: 28px;
}
.spin-loading {
animation: rotating 2s linear infinite;
}
.loading-tips {
margin-top: 5px;
font-size: 16px;
color: #21c9cc;
}
}
}
</style>
@@ -26,11 +26,11 @@
<a-icon type="codepen"/>
{{$t('DocumentSplitting')}}
</div>
<div @click="DocumentTranslationClick" v-has="'bussLog:translation'" class="operator-text-text"
:title="$t('DocumentTranslation')">
<a-icon type="file-pdf"/>
{{$t('DocumentTranslation')}}
</div>
<!-- <div @click="DocumentTranslationClick" v-has="'bussLog:translation'" class="operator-text-text"-->
<!-- :title="$t('DocumentTranslation')">-->
<!-- <a-icon type="file-pdf"/>-->
<!-- {{$t('DocumentTranslation')}}-->
<!-- </div>-->
<div @click="DocumentComparisonClick" v-has="'bussLog:comparison'" class="operator-text-text"
:title="$t('DocumentComparison')">
<a-icon type="wallet"/>
@@ -42,7 +42,7 @@
{{title && title.length > 18?title.slice(0,17)+'...':title}}
</span>
<template #overlay>
<a-menu v-if="$route.query.createBy == userData.username"
<a-menu v-if="$route.query.createBy == userData.username || administrators"
@click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey, record)">
<a-menu-item key="1" @click="orgAdd" v-has="'split:sarFileSplitMenu:add'">{{$t('newNode')}}
</a-menu-item>
@@ -67,19 +67,19 @@
</div>
<div class="table-operator">
<div class="operator-text" @click="handleCopyManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:copy'">
<a-icon type="copy"/>
{{ $t('copy') }}
</div>
<div class="operator-text" @click="handleAddManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:add'">
<a-icon type="plus"/>
{{ $t('add') }}
</div>
<div class="operator-text upload-split"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
@click="handleImportManage" v-has="'split:sarFileSplitItems:import'">
<a-icon type="import" :rotate="-90" v-if="uploadMenuId===undefined||uploadMenuId===''"/>
{{ (uploadMenuId===''||uploadMenuId===undefined)? $t('import'):'' }}
@@ -94,25 +94,25 @@
{{ $t('export') }}
</div>
<div class="operator-text" @click="handleDownManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:template'">
<a-icon type="download"/>
{{ $t('TemplateDownload') }}
</div>
<div class="operator-text" @click="handleMergeManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:merge'">
<a-icon type="snippets"/>
{{ $t('MergerClause') }}
</div>
<div class="operator-text" @click="handleManage"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:set'">
<a-icon type="setting"/>
{{ $t('BatchSetting') }}
</div>
<div class="operator-text" @click="handleBatCancel"
v-if="$route.query.createBy == userData.username"
v-if="$route.query.createBy == userData.username || administrators"
v-has="'split:sarFileSplitItems:delete'">
<a-icon type="delete"/>
{{ $t('BatchDelete') }}
@@ -126,7 +126,7 @@
:OperationList="OperationList"
:infoId="$route.query.infoId"
:menuId="menuId"
:showAction="$route.query.createBy == userData.username ? true :false"
:showAction="$route.query.createBy == userData.username || administrators ? true :false"
@onSelectChange="onSelectChange"
@deleteClick="deleteClick"
@editClick="editClick"
@@ -320,7 +320,8 @@
parameter: {},
widthBrown: '',
creenWidth: document.body.clientWidth,
brownHeight: document.documentElement.clientHeight
brownHeight: document.documentElement.clientHeight,
administrators:false,
}
},
watch: {
@@ -357,6 +358,14 @@
this.userData = this.userInfo()
this.administrators = false
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
this.userInfo().userRoleList.forEach(res => {
if (res.roleCode == 'admin') {
this.administrators = true
}
})
}
this.infoId = this.$route.query.infoId
console.log('info', this.$route.query)
this.loadMenuData()
@@ -223,7 +223,7 @@
...this.queryParam
}
this.loading = true
postAction('document/bussDocumentLibraryEO/ocrPageInfo', query).then((res) => {
postAction('document/bussDocumentLibraryEO/transPageInfo', query).then((res) => {
if (res.success) {
this.dataList = res.result.records || []
this.total = res.result.total
@@ -416,6 +416,7 @@ export default {
controlValues: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('controlAlternatives'), trigger: 'blur' },
{ min:1, max: 500, message: this.$t('cantExeed')+'500'+this.$t('characters'), trigger: 'blur' },
{ validator: this.test }
],
titleDefaultValue: [
{ required: true, message: this.$t('PleaseEnter')+this.$t('DefaultValue'), trigger: 'blur' },
@@ -453,6 +454,14 @@ export default {
}
},
methods: {
test(rule, value, callback) {
var money = /^[^##!!]*$/
if (money.test(value)) {
callback()
} else {
callback(new Error(this.$t('disableInput') + '!#'))
}
},
getcontentListedEdit() {
getAction('sys/dict/getDictItems/cert_category', { }).then((res) => {
if (res.success) {
@@ -113,7 +113,8 @@
if (this.idList && this.idList.length > 0) {
id = this.idList.join(',')
} else {
id = this.$route.query.id
id = this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id
// id = this.$route.query.id
}
getAction('project/projectLibraryBase/getProjectDetailsStatisticsCollectManifestLabel', {id:id}).then((res) => {
if (res.success) {
@@ -463,7 +463,7 @@
import AdjustareaSofrespon from '@/components/AdjustareaSofrespon/index'
import ReferenceParameter from '@/components/ReferenceParameter/index'
import AssignedBy from '@/components/AssignedBy/index'
import ImportFileOnlyList from '@/components/ImportFileOnlyList/index'
import ImportFileOnlyList from '@/components/ImportFileOnlyListtag/index'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
@@ -684,12 +684,11 @@
// }
},
mounted() {
console.log(this.$route.query)
this.GetgetLoginUserType()
console.log(this.currentPersonRole)
if(this.$route.query.type == '1'){
this.handleOkRoleSwitching()
}
this.GetgetLoginUserType()
console.log(this.currentPersonRole)
setTimeout(() => {
if (this.currentPersonRole == 'dre') {
this.handlePreservation()
@@ -724,7 +723,7 @@
handleOkRoleSwitching() {
if(this.$route.query.type == '1'){
let query = {
userType:this.$route.query.userType,
userType:this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType,
paramsManifestId: this.$route.query.id,
projectId: this.$route.query.projectId,
userId: this.userInfo().id
@@ -732,10 +731,10 @@
this.confirmLoadingRoleSwitching = true
postAction('/params/userTypeLog/edit', query).then((res) => {
if (res.success) {
this.currentPersonRole = this.$route.query.userType
this.currentPersonRole = this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType
this.visibleRoleSwitching = false
this.confirmLoadingRoleSwitching = false
localStorage.setItem('currentPersonRole', JSON.stringify(this.$route.query.userType))
localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode ? this.formInlineRoleSwitching.roleSwitchingCode : this.$route.query.userType))
this.RoleType.forEach((item,index) => {
if(item.value == this.currentPersonRole){
this.rolename = item.label
@@ -935,7 +934,7 @@
ids: this.selectedRowKeys.join(','),
exportName:this.$route.query.projectName + '(' + this.$route.query.title + ')'
}
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.xlsx'
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
downloadFile('/params/collectManifest/exportDre', name , query , this.selectClear)
},
getList(){
@@ -189,8 +189,8 @@
<TaskListModel @TaskListModelList="TaskListModelList" ref="TaskListModelRef"/>
<taskBatSetting @taskBatSettingForm="taskBatSettingForm" ref="taskBatSettingRef"></taskBatSetting>
<batchChangeModel @batchChangeModel="batchChangeModel" ref="batchChangeModelRef"/>
<batchModel @batchModel="batchModel" ref="batchModelRef"/>
<cuibanModel @cibanModel="cibanModel" ref="cModelRef"/>
<batchModel @batchModel="batchModel" ref="batchModelRef"/>
<!-- 错误数据提示-->
<a-modal
:title="$t('operationFailed')"
@@ -222,8 +222,8 @@
import batchChangeModel from './batchChangeModel'
import batchModel from './batchModel'
import TaskListModel from './TaskListModel'
import taskBatSetting from './taskBatSetting'
import cuibanModel from './cuibanModel'
import taskBatSetting from './taskBatSetting'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import { mapGetters } from 'vuex'
import store from '@/store/'
@@ -618,6 +618,17 @@
}
},
// 催办
cuibanClick(){
if(this.selectionRowsArray.length <1){
this.$message.warning(this.$t('selectLeastOne'))
}else{
this.$refs.cModelRef.getData(this.selectionRowsArray)
}
},
cibanModel(){
this.getList()
},
cancleoperationFailed(){
this.visibleoperationFailed = false
},
@@ -66,6 +66,7 @@
:expandIconAsCell='false'
:expandIconColumnIndex="5"
:expandIcon="expandIcon"
:expandRowByClick="true"
:loading="loading"
@expand="expandChange"
@change="handleTableChange">
@@ -167,42 +167,97 @@
},
//待填写数量
waitFillClick(item) {
let _this = this
item.type = '1'
item.userType = 'dre'
console.log(item)
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
let query = {
paramsManifestId: item.id,
projectId: item.projectId
}
this.loading = true
let userType = ''
let valueList = []
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
if(res.result){
res.result.find((item,index) => {
if(item.value){
valueList.push(item.value)
}
})
let flag = valueList.find((item,index) => {
return item == 'dre'
})
let _this = this
item.type = '1'
item.userType = _this.flag == undefined ? valueList[0] : 'dre'
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
})
window.open(newUrl.href, '_blank')
}
})
window.open(newUrl.href, '_blank')
},
//待分配填写人数量
waitSdtClick(item) {
let _this = this
item.type = '1'
item.userType = 'sdt'
console.log(item)
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
let query = {
paramsManifestId: item.id,
projectId: item.projectId
}
this.loading = true
let userType = ''
let valueList = []
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
if(res.result){
res.result.find((item,index) => {
if(item.value){
valueList.push(item.value)
}
})
let flag = valueList.find((item,index) => {
return item == 'sdt'
})
let _this = this
item.type = '1'
item.userType = _this.flag == undefined ? valueList[0] : 'sdt'
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
})
window.open(newUrl.href, '_blank')
}
})
window.open(newUrl.href, '_blank')
},
//参数待发起数量
waitCollectClick(item) {
let _this = this
item.type = '1'
item.userType = 'homo'
console.log(item)
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
let query = {
paramsManifestId: item.id,
projectId: item.projectId
}
this.loading = true
let userType = ''
let valueList = []
getAction('params/collectManifest/getLoginUserType', query).then((res) => {
if(res.result){
res.result.find((item,index) => {
if(item.value){
valueList.push(item.value)
}
})
let flag = valueList.find((item,index) => {
return item == 'homo'
})
let _this = this
item.type = '1'
item.userType = _this.flag == undefined ? valueList[0] : 'homo'
let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection',
query: item
// projectName:this.$route.query.projectName
})
window.open(newUrl.href, '_blank')
}
})
window.open(newUrl.href, '_blank')
},
SizeChange(page, pageSize) {
this.pageNo = 1