Merge pull request 'feat : 项目归档页面初始化' (#191) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/191
This commit is contained in:
2024-05-17 13:27:15 +00:00
4 changed files with 257 additions and 2 deletions

View File

@@ -9,7 +9,7 @@
@cancel="handleCancel"
>
<template #reference>
<el-button :type="btnType" size="mini" :disabled="isDisabled" :icon="btnIcon" :plain="isPlain" :link="link">
<el-button :type="btnType" size="mini" :disabled="isDisabled" :icon="btnIcon" :plain="isPlain" :link="link">
{{ btnText }}
</el-button>
</template>
@@ -24,7 +24,7 @@ const props = defineProps({
},
btnType: {
type: String,
default: 'text'
default: 'danger'
},
type: {
type: String,

View File

@@ -0,0 +1,72 @@
<template>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<el-card style="width: 100%">
<file-upload @getFile="getOtherFile" :showFileList="true"/>
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" :tableConfig="tableConfig"
:data="otherFileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>
</template>
<script setup lang="jsx">
const searchConfig = reactive([
{
label: '关键词',
prop: 'collectType',
component: 'el-input',
props: {
placeholder: '请输入',
clearable: true,
filterable: true,
}
}
])
const tableConfig = reactive({
columns: [
{
prop: 'originalFileName',
label: '附件名称',
align: 'center',
},
{
prop: 'tag',
label: '自定义标签',
align: 'center'
},
{
prop: 'tag',
label: '内置标签',
align: 'center'
},
{
prop: 'tag',
label: '上传时间',
align: 'center'
},
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (
<div>
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
</div>
)
}
}
]
})
const showTable=ref(true)
const otherFileList = ref([])
const getOtherFile = () => {
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,133 @@
<template>
<div class="apply-block">
<el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules">
<baseTitle title="项目结项"></baseTitle>
<el-row>
<el-col :span="24">
<el-form-item label="项目结项附件" prop="attachment">
<file-upload @getFile="getAttachment" :showFileList="true"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="其他文件">
<el-card style="width: 100%">
<file-upload @getFile="getOtherFile" :showFileList="true"/>
<fvTable style="width: 100%;max-height: 250px" v-if="showTable" :tableConfig="tableConfig"
:data="otherFileList" :isSettingCol="false" :pagination="false">
<template #empty>
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template>
</fvTable>
</el-card>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit(applyForm)">提交</el-button>
</div>
</div>
</template>
<script setup lang="jsx">
import FileUpload from "@/components/FileUpload.vue";
const formData = ref({})
const rules = reactive({
attachment: [{required: true, message: '请上传项目结项附件', trigger: 'blur'}],
})
const fileList = ref(null)
const applyForm = ref()
const showTable = ref(true)
const otherFileList = ref([])
const tableConfig = reactive({
columns: [
{
prop: 'index',
type: 'index',
label: '序号',
align: 'center',
width: '80',
},
{
prop: 'originalFileName',
label: '文件名',
align: 'center',
},
{
prop: 'tag',
label: '标签',
align: 'center'
},
{
prop: 'size',
label: '文件大小',
align: 'center',
currentRender: ({row, index}) => (parseInt(row.size / 1024) + 'KB')
},
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
return (
<div>
<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>
<el-button type="primary" size="large" link onClick={() => beforeRemove(row)}>删除</el-button>
</div>
)
}
}
]
})
const compositeParam = (item) => {
return {
fileId: item.id,
size: item.size,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
processNodeTag: null,
tag: formData.value.collectType
}
}
const getAttachment = (val) => {
console.log('上传文件', val)
showTable.value = false
nextTick(() => {
showTable.value = true
})
let fileObj = {}
let newFileArray = []
if (route.query.isAdd === undefined) {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
formData.value.fileList.push(fileObj)
})
fileList.value = formData.value.fileList
} else {
val.forEach(item => {
fileObj = compositeParam(item)
newFileArray.push(fileObj)
})
formData.value.fileList = newFileArray
fileList.value = newFileArray
}
}
const getOtherFile = () => {
}
const handleSubmit = (instance) => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
})
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,50 @@
<template>
<div class="detail-block">
<el-tabs
v-model="activeName"
type="card"
class="demo-tabs"
@tab-click="handleClick"
>
<el-tab-pane label="需求征集" name="first">
</el-tab-pane>
<el-tab-pane label="需求上报" name="second"></el-tab-pane>
<el-tab-pane label="项目立项" name="third" ></el-tab-pane>
<el-tab-pane label="项目实施" name="third"></el-tab-pane>
<el-tab-pane label="项目归档" name="third" :disabled="true"></el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="jsx">
const activeName = ref('first')
const handleClick = (tab, event) => {
console.log(tab, event)
if(tab.index.value === 0){
}
}
</script>
<style scoped lang="scss">
.detail-block{
padding-top: 15px;
:deep(.el-tabs__nav-scroll){
width: 100%;
display: flex;
.el-tabs__nav{
display: flex;
flex: 1;
.el-tabs__item{
flex: 1;
font-size: 16px;
}
.is-active{
color: black;
background-color: #DED0B2;
}
}
}
}
</style>