Merge remote-tracking branch 'origin/master'

This commit is contained in:
liyawei
2022-05-18 18:19:00 +08:00
6 changed files with 91 additions and 150 deletions
+1
View File
@@ -840,4 +840,5 @@ module.exports = {
descriptionDeliverables:'Description of deliverables',
startMonth:'Start Month',
endMonth:'End Month',
Importing:'Importing',
}
+1
View File
@@ -845,4 +845,5 @@ module.exports = {
descriptionDeliverables:'交付物说明',
startMonth:'开始日期',
endMonth:'结束日期',
Importing:'导入中',
}
@@ -9,6 +9,14 @@
<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>
</div>
</template>
@@ -53,6 +61,7 @@
data() {
return {
tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
spinning: false,
cut: ''
}
},
@@ -174,4 +183,36 @@
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>
@@ -83,8 +83,15 @@
let query = {
actiProcInstId: this.$route.query.actiProcInstId
}
this.loading = true
getAction('/wkflow/processHistoryEO/list', query).then((res) => {
this.dataSource = res
if (res.success) {
this.dataSource = res.result || []
this.loading = false
} else {
this.dataSource = []
this.loading = false
}
})
}
}
@@ -81,7 +81,7 @@
<configure ref="configureRef" :url='url' :itemId='itemId'/>
<!-- 历史版本-->
<a-modal v-model="historicalVisible" :title="$t('historicalVersion')" width='750px' :footer="null">
<historical-version v-if='historicalVisible' ></historical-version>
<historical-version v-if='historicalVisible' :historicalRow='historicalRow'></historical-version>
</a-modal>
</a-card>
</template>
@@ -174,7 +174,8 @@
rowId: '',
version: 0,
itemId: '',
historicalVisible: false
historicalVisible: false,
historicalRow: {}, // 历史版本得数据
}
},
mounted() {
@@ -208,10 +209,11 @@
handleTableChange() {
},
//
historicalVersion() {
// 历史版本
historicalVersion(historicalRow) {
console.log(historicalRow)
this.historicalVisible = true
console.log('历史版本。。。。')
this.historicalRow = historicalRow
},
// 配置
configure(item) {
@@ -9,30 +9,27 @@
:dataSource='areaTable'
:pagination='false'
:loading='loading'
:scroll='{x: 600}'
@change='handleTableChange'>
:scroll='{x: 600}'>
<a slot='name' slot-scope='text'>{{ text }}</a>
<span slot='action' slot-scope='text, record'>
<a class='action-edit' @click='editArea(record.id)' v-has="'area:edit'">{{ $t('edit') }}</a>
<a style='color:red' href='javascript:;' @click=' deleteArea(record.id)'
v-has="'area:delete'">{{ $t('delete') }}</a>
</span>
</a-table>
<div class='drawer-bootom-button'>
<a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>
<a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>
</div>
</div>
</template>
<script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
export default {
name: 'diolagArea',
components: {},
data() {
return {
token:Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
@@ -63,143 +60,44 @@ export default {
}
},
props: {
historicalRow: {
type: Object,
default: {},
require: true
}
},
mounted() {
this.loadData()
},
methods: {
loadData() {
this.loading = true
let params = {
...this.form
}
getAction(`params/manifest/getParamsTemplateList`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result]
this.total = res.result.total
let _this = this
axios({
url: `/jero-boot/params/collectManifestHistory/getConfigById?id=${this.historicalRow.id}`,
method: 'get',
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
}
}).finally(() => {
this.loading = false
})
},
searchQuery() {
this.loadData()
},
searchReset() {
this.form = {}
this.loadData()
},
handleCancel() {
this.$emit('areaVisible', false)
},
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
this.selectedRowKeysDate = selectedRowKeysDate
this.selectedRowKeys = selectedRowKeys
},
handleTableChange(val) {
},
showModal() {
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
//新增
handleSubmit() {
if (this.selectedRowKeys.length == 0) {
this.$message.warning(this.$t('pleaseSelectData'))
} else if (this.selectedRowKeys.length > 1) {
this.$message.warning(this.$t('OnlyOneSelected'))
} else {
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
// 新增編輯之前 判断 标题唯一
getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id}
&title=${this.templatetitle}`, {})
.then(res => {
if (res.success) {
let postDate = {
title: this.templatetitle,
paramsTemplateId: this.rowId || this.selectedRowKeysDate[0].id,
paramsTemplatePublishVersion: this.version || this.selectedRowKeysDate[0].version,
projectId: this.projectId
}
if (this.rowId) {
//编辑
postAction(`params/manifest/edit`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$emit('areaVisible', false)
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
} else {
//新增
postAction(`params/manifest/add`, postDate).then(res => {
if (res.success) {
this.newVisible = false
this.$emit('areaVisible', false)
this.$message.success(this.$t('OperationSuccessful'))
} else {
this.$message.warning(res.message)
}
}
).finally(() => {
this.flag = false
this.spinLoading = false
this.newVisible = false
})
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
} else {
return false
.then( (res) =>{
console.log(res)
if (res.data.success) {
console.log(res,'lll')
}else{
_this.$message.warning(res.data.result)
}
})
}
},
cancelModel() {
this.newVisible = false
this.$refs.ruleForm.resetFields()
},
//删除按钮
deleteArea(val) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: '',
onOk:
async () => {
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) {
this.queryParams.pageNo = this.queryParams.pageNo - 1
}
this.loadData()
} else {
// this.$message.warning(res.message)
if (res.message == '该展示区域有关联数据无法删除') {
this.$message.warning(this.$t('noDelete'))
} else {
this.$message.warning(this.$t('operationFailed'))
}
}
})
}
})
.catch( (error) =>{
console.log(error);
});
},
//编辑按钮
editArea(val) {
@@ -217,15 +115,6 @@ export default {
})
}
},
watch: {
templateTitle(val) {
this.templatetitle = val
},
selectedRowKeyS(val) {
this.selectedRowKeys = val
}
}
}
</script>