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', descriptionDeliverables:'Description of deliverables',
startMonth:'Start Month', startMonth:'Start Month',
endMonth:'End Month', endMonth:'End Month',
Importing:'Importing',
} }
+1
View File
@@ -845,4 +845,5 @@ module.exports = {
descriptionDeliverables:'交付物说明', descriptionDeliverables:'交付物说明',
startMonth:'开始日期', startMonth:'开始日期',
endMonth:'结束日期', endMonth:'结束日期',
Importing:'导入中',
} }
@@ -9,6 +9,14 @@
<a-icon type="import" :rotate="270"/> <a-icon type="import" :rotate="270"/>
{{$t('import')}} {{$t('import')}}
</a-upload> </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> </div>
</template> </template>
@@ -53,6 +61,7 @@
data() { data() {
return { return {
tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) }, tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
spinning: false,
cut: '' cut: ''
} }
}, },
@@ -174,4 +183,36 @@
font-weight: 400 !important; font-weight: 400 !important;
color: #040B29 !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> </style>
@@ -83,8 +83,15 @@
let query = { let query = {
actiProcInstId: this.$route.query.actiProcInstId actiProcInstId: this.$route.query.actiProcInstId
} }
this.loading = true
getAction('/wkflow/processHistoryEO/list', query).then((res) => { 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'/> <configure ref="configureRef" :url='url' :itemId='itemId'/>
<!-- 历史版本--> <!-- 历史版本-->
<a-modal v-model="historicalVisible" :title="$t('historicalVersion')" width='750px' :footer="null"> <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-modal>
</a-card> </a-card>
</template> </template>
@@ -174,7 +174,8 @@
rowId: '', rowId: '',
version: 0, version: 0,
itemId: '', itemId: '',
historicalVisible: false historicalVisible: false,
historicalRow: {}, // 历史版本得数据
} }
}, },
mounted() { mounted() {
@@ -208,10 +209,11 @@
handleTableChange() { handleTableChange() {
}, },
// // 历史版本
historicalVersion() { historicalVersion(historicalRow) {
console.log(historicalRow)
this.historicalVisible = true this.historicalVisible = true
console.log('历史版本。。。。') this.historicalRow = historicalRow
}, },
// 配置 // 配置
configure(item) { configure(item) {
@@ -9,30 +9,27 @@
:dataSource='areaTable' :dataSource='areaTable'
:pagination='false' :pagination='false'
:loading='loading' :loading='loading'
:scroll='{x: 600}' :scroll='{x: 600}'>
@change='handleTableChange'>
<a slot='name' slot-scope='text'>{{ text }}</a> <a slot='name' slot-scope='text'>{{ text }}</a>
<span slot='action' slot-scope='text, record'> <span slot='action' slot-scope='text, record'>
<a class='action-edit' @click='editArea(record.id)' v-has="'area:edit'">{{ $t('edit') }}</a> <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> </span>
</a-table> </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> </div>
</template> </template>
<script> <script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage' 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 { export default {
name: 'diolagArea', name: 'diolagArea',
components: {}, components: {},
data() { data() {
return { return {
token:Vue.ls.get(ACCESS_TOKEN),
title: this.$t('add'), title: this.$t('add'),
total: 0, total: 0,
selectedRowKeysDate: {}, selectedRowKeysDate: {},
@@ -63,143 +60,44 @@ export default {
} }
}, },
props: { props: {
historicalRow: {
type: Object,
default: {},
require: true
}
}, },
mounted() { mounted() {
this.loadData() this.loadData()
}, },
methods: { methods: {
loadData() { loadData() {
this.loading = true let _this = this
let params = { axios({
...this.form url: `/jero-boot/params/collectManifestHistory/getConfigById?id=${this.historicalRow.id}`,
} method: 'get',
getAction(`params/manifest/getParamsTemplateList`, params).then(res => { transformRequest: [function (data) {
if (res.success) { let ret = ''
this.areaTable = [...res.result] for (let it in data) {
this.total = res.result.total 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
}) })
}, .then( (res) =>{
searchQuery() { console.log(res)
this.loadData() if (res.data.success) {
}, console.log(res,'lll')
searchReset() { }else{
this.form = {} _this.$message.warning(res.data.result)
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
} }
}) })
} .catch( (error) =>{
}, console.log(error);
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'))
}
}
})
}
})
}, },
//编辑按钮 //编辑按钮
editArea(val) { editArea(val) {
@@ -217,15 +115,6 @@ export default {
}) })
} }
}, },
watch: {
templateTitle(val) {
this.templatetitle = val
},
selectedRowKeyS(val) {
this.selectedRowKeys = val
}
}
} }
</script> </script>