修改上报库管理
This commit is contained in:
@@ -33,6 +33,10 @@
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<div @click="syncToListClick" class="operator-text" v-has="'params:template:syncToList'">
|
||||
<a-icon type="plus"/>
|
||||
{{$t('syncToList')}}
|
||||
</div>
|
||||
<div @click="handleAdd" class="operator-text" v-has="'params:template:add'">
|
||||
<a-icon type="plus"/>
|
||||
{{$t('newlyAdded')}}
|
||||
@@ -72,6 +76,12 @@
|
||||
<a class="text-operation" v-has="'params:template:setupMaintainer'"
|
||||
@click="setupMaintainerClick(record)">{{$t('setupMaintainer')}}</a>
|
||||
|
||||
<a class="text-operation"
|
||||
v-has="'params:template:subscribe'"
|
||||
:disabled="record.authorityFlag == '1'? true : false"
|
||||
@click="subscribeClick(record)">
|
||||
{{!record.readFlag || record.readFlag == 0 ? $t('subscribe') : $t('CancelSubscribe')}}
|
||||
</a>
|
||||
<a class="text-operation"
|
||||
:disabled="record.status == '1' || record.authorityFlag == '1'? true : false"
|
||||
v-has="'params:template:edit'"
|
||||
@@ -110,6 +120,7 @@
|
||||
<JLoading :loading="JLoading">{{ $t('pleaseWaitWhileRunning') }}</JLoading>
|
||||
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
|
||||
<setupMaintainerModel ref="setupMaintainerModelRef" @setupMaintainerModelForm="setupMaintainerModelForm"/>
|
||||
<syncToList ref="syncToListRef" @syncToListForm="syncToListForm"/>
|
||||
<a-modal class="show-copy" v-model="areaVisible" :title="$t('templateCopy')" :footer="null" @cancel="hideModal">
|
||||
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
<a-row :gutter="24">
|
||||
@@ -142,18 +153,21 @@
|
||||
<script>
|
||||
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
|
||||
import addModel from './components/addModel'
|
||||
import syncToList from './components/syncToList'
|
||||
import setupMaintainerModel from './components/setupMaintainerModel'
|
||||
import axios from 'axios'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import eventBUs from '../../../common/event'
|
||||
import Vue from 'vue'
|
||||
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
components: {
|
||||
addModel,
|
||||
setupMaintainerModel
|
||||
setupMaintainerModel,
|
||||
syncToList
|
||||
},
|
||||
mixins: [ResizeHeader, ResizeColumnProvide],
|
||||
data() {
|
||||
@@ -262,7 +276,7 @@
|
||||
title: this.$t('operation'),
|
||||
align: 'left',
|
||||
fixed: 'right',
|
||||
width: 280,
|
||||
width: 360,
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
}
|
||||
],
|
||||
@@ -275,6 +289,40 @@
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
...mapGetters(['userInfo']),
|
||||
subscribeClick(val) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: val.readFlag == 0 || !val.readFlag ? _this.$t('ConfirmSubscribe') : _this.$t('cancelConfirmSubscribe'),
|
||||
onOk() {
|
||||
let url = ''
|
||||
let action
|
||||
let query = {}
|
||||
if (val.readFlag == 0 || !val.readFlag) {
|
||||
url = 'template/paramsTemplateSubscribeEO/add'
|
||||
action = postAction
|
||||
query = {
|
||||
paramsTemplateId: val.id,
|
||||
userId: _this.userInfo().id
|
||||
}
|
||||
} else {
|
||||
url = 'template/paramsTemplateSubscribeEO/cancelSubscribe'
|
||||
action = getAction
|
||||
query = {
|
||||
id: val.id
|
||||
}
|
||||
}
|
||||
action(url, query).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.getList()
|
||||
} else {
|
||||
_this.$message.warning(_this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.areaVisible = false
|
||||
this.$refs['ruleForm'].resetFields()
|
||||
@@ -305,6 +353,35 @@
|
||||
this.selectedRowKeys = value
|
||||
this.selectedRowKeysArray = this.selectedRowKeys.join(',')
|
||||
},
|
||||
syncToListForm() {
|
||||
this.selectedRowKeys = []
|
||||
this.getList()
|
||||
},
|
||||
syncToListClick() {
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
if (this.selectedRowKeys.length == 1) {
|
||||
let dataList = []
|
||||
this.selectedRowKeys.forEach(res => {
|
||||
this.dataSource.forEach(val => {
|
||||
if (res == val.id) {
|
||||
dataList.push(val)
|
||||
}
|
||||
})
|
||||
})
|
||||
if (dataList && dataList.length > 0) {
|
||||
if (dataList[0].status == 1) {
|
||||
this.$refs.syncToListRef.getData(dataList[0])
|
||||
} else {
|
||||
this.$message.warning(this.$t('pleaseSelectPublishedData'))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('OnlyOneSelected'))
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('PleaseSelectData'))
|
||||
}
|
||||
},
|
||||
//添加
|
||||
handleAdd() {
|
||||
this.$refs.addModelRef.addModel()
|
||||
|
||||
Reference in New Issue
Block a user