3 changed files with 269 additions and 69 deletions
-
74src/vendors/pdf/PdfView.vue
-
95src/views/preview/index.vue
-
167src/views/system/fileLibraryManage/processManage/index-old.vue
@ -0,0 +1,167 @@ |
|||||
|
<template> |
||||
|
<div class="process-container"> |
||||
|
<div v-for="item in filteredFlowList" :key="item.id" class="process-item"> |
||||
|
<span>{{ item.name }}</span> |
||||
|
<p>{{ item.flowName }}<i class="iconfont icon-shezhi" @click="toProcessSelected(item)" /></p> |
||||
|
<el-switch v-model="item.status" class="isEnable-chapter" @change="changeCategoryState(item)" /> |
||||
|
</div> |
||||
|
<eForm ref="cuform" :selected-category="selectedCategory" :edit-info-flow="editInfoFlow" @refresh="getInitCategoryFlowBase" /> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { FetchInitCategoryFlowBase, FetchReDocumentInitFlowByCategoryId, FetchChangeCategoryState, FetchgetCategoryFlow } from '@/api/system/category/process' |
||||
|
import eForm from './module/form' |
||||
|
export default { |
||||
|
name: 'ProcessManage', |
||||
|
components: { eForm }, |
||||
|
props: { |
||||
|
selectedCategory: { |
||||
|
type: Object, |
||||
|
default: function() { |
||||
|
return {} |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
flowBaseList: [], |
||||
|
flowSetting: [], |
||||
|
editInfoFlow: null |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
filteredFlowList() { |
||||
|
if (this.selectedCategory.pid === '0' && this.selectedCategory.isType === 1) { |
||||
|
return this.flowBaseList.filter(item => item.id === '5') |
||||
|
} else { |
||||
|
return this.flowBaseList.filter(item => item.id !== '5') |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.getInitCategoryFlowBase() |
||||
|
}, |
||||
|
methods: { |
||||
|
getInitCategoryFlowBase() { |
||||
|
FetchInitCategoryFlowBase().then((res) => { |
||||
|
this.flowBaseList = res.map(item => { |
||||
|
return { |
||||
|
...item, |
||||
|
status: false |
||||
|
} |
||||
|
}) |
||||
|
this.getReDocumentInitFlowByCategoryId() |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
getReDocumentInitFlowByCategoryId() { |
||||
|
console.log(this.selectedCategory) |
||||
|
FetchReDocumentInitFlowByCategoryId({ 'documentId': this.selectedCategory.pid !== '0' ? this.selectedCategory.id : null }).then((res) => { |
||||
|
this.flowSetting = res |
||||
|
this.flowBaseList.forEach(item => { |
||||
|
this.flowSetting.forEach(v => { |
||||
|
if (item.id === v.flowManageId) { |
||||
|
item.status = !!v.status |
||||
|
item.flowName = v.flowName |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
toProcessSelected(item) { |
||||
|
const params = { |
||||
|
'categoryId': this.selectedCategory.pid !== '0' ? this.selectedCategory.id : null, |
||||
|
'manageId': item.id |
||||
|
} |
||||
|
FetchgetCategoryFlow(params).then((res) => { |
||||
|
if (res) { |
||||
|
// 判断所有值是否都为 null |
||||
|
if (this.allValuesNull(res)) { |
||||
|
// console.log('所有值都为 null') 新增 |
||||
|
this.editInfoFlow = null |
||||
|
} else { |
||||
|
// console.log('不是所有值都为 null') 编辑 |
||||
|
this.editInfoFlow = res |
||||
|
} |
||||
|
} else { |
||||
|
this.editInfoFlow = null |
||||
|
this.$message({ message: '数据请求失败', type: 'error', offset: 8 }) |
||||
|
} |
||||
|
console.log('this.editInfoFlow', this.editInfoFlow) |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.cuform.cuDialogVisible = true |
||||
|
this.$refs.cuform.setPocessCurrent = item |
||||
|
this.$refs.cuform.getEditInfoFlow = this.editInfoFlow ? this.editInfoFlow : {} |
||||
|
this.$refs.cuform.handleEditInfoFlow(this.editInfoFlow) |
||||
|
}) |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
changeCategoryState(item) { |
||||
|
const filterItem = this.flowSetting.find(v => item.id === v.flowManageId) |
||||
|
const params = { |
||||
|
'categoryId': this.selectedCategory.id, |
||||
|
'id': filterItem.id, |
||||
|
'status': item.status ? 1 : 0 |
||||
|
} |
||||
|
FetchChangeCategoryState(params).then((res) => { |
||||
|
if (res === 'SUCCESS') { |
||||
|
this.$message({ message: '操作成功', type: 'success', offset: 8 }) |
||||
|
} else { |
||||
|
this.$message({ message: '操作失败', type: 'error', offset: 8 }) |
||||
|
} |
||||
|
}).catch(err => { |
||||
|
console.log(err) |
||||
|
}) |
||||
|
}, |
||||
|
allValuesNull(jsonObject) { |
||||
|
for (const key in jsonObject) { |
||||
|
if (jsonObject[key] !== null) { |
||||
|
return false |
||||
|
} |
||||
|
} |
||||
|
return true |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang='scss' scoped> |
||||
|
.process-item{ |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
padding: 36px 40px 0 40px; |
||||
|
font-size: 14px; |
||||
|
height: 32px; |
||||
|
line-height: 32px; |
||||
|
margin-bottom: 20px; |
||||
|
span{ |
||||
|
display: block; |
||||
|
margin-right: 12px; |
||||
|
} |
||||
|
p{ |
||||
|
position: relative; |
||||
|
width: 324px; |
||||
|
height: 32px; |
||||
|
line-height: 32px; |
||||
|
padding: 0 13px; |
||||
|
margin-right: 16px; |
||||
|
color: #0C0E1E; |
||||
|
background-color: #F5F7FA; |
||||
|
i{ |
||||
|
position: absolute; |
||||
|
right: 10px; |
||||
|
top: 50%; |
||||
|
transform: translateY(-50%); |
||||
|
color: #0348F3; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue