Merge pull request 'dj' (#169) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/169
This commit is contained in:
2024-05-14 09:56:48 +00:00
6 changed files with 218 additions and 22 deletions

View File

@@ -3,10 +3,11 @@
<!-- 表格头部按钮 --> <!-- 表格头部按钮 -->
<div class="fv-table-btn" v-if="tableConfig.btns"> <div class="fv-table-btn" v-if="tableConfig.btns">
<div class="table-head-btn"> <div class="table-head-btn">
<el-button <el-button
v-for="btn in tableConfig.btns" v-for="btn in tableConfig.btns"
:key="btn.key" :key="btn.key"
:type="btn.type || ''" :type="btn.type || ''"
:color="btn.color || ''"
v-perm="btn.auth || ['*:*:*']" v-perm="btn.auth || ['*:*:*']"
@click="handleClickBtns(btn.key)" @click="handleClickBtns(btn.key)"
> >
@@ -20,9 +21,9 @@
<el-icon size="18"><Setting /></el-icon> <el-icon size="18"><Setting /></el-icon>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
<el-popover <el-popover
placement="bottom" placement="bottom"
:width="200" :width="200"
ref="popoverRef" ref="popoverRef"
:virtual-ref="buttonRef" :virtual-ref="buttonRef"
virtual-triggering virtual-triggering
@@ -33,10 +34,10 @@
<div class="col-setting-list"> <div class="col-setting-list">
<el-checkbox-group v-model="localData.checkGroup" @change="changeColShow"> <el-checkbox-group v-model="localData.checkGroup" @change="changeColShow">
<el-space direction="vertical" alignment="flex-start" :size="0"> <el-space direction="vertical" alignment="flex-start" :size="0">
<el-checkbox <el-checkbox
v-for="item in tableConfig.columns" v-for="item in tableConfig.columns"
:key="item.prop" :key="item.prop"
:label="item.label" :label="item.label"
:value="item.prop" :value="item.prop"
/> />
</el-space> </el-space>

View File

@@ -0,0 +1,15 @@
<template>
<div>
项目立项详情
</div>
</template>
<script>
export default {
name: "add"
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,183 @@
<template>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig">
<template #empty>
<el-empty description="暂无数据"/>
</template>
</fvTable>
</template>
<script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {reactive, shallowRef} from "vue";
const router = useRouter()
const searchConfig = reactive([
{
label: '名称',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入名称查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
{
label: '项目类型',
prop: 'collectType',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目类型',
clearable: true,
filterable: true,
}
},
{
label: '项目影响',
prop: 'projectEffect',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择项目影响',
clearable: true,
filterable: true,
},
colProps: {}
},
{
label: '研发主体',
prop: 'collectType',
component: shallowRef(fvSelect),
props: {
placeholder: '请选择研发主体',
clearable: true,
filterable: true,
}
},
{
label: '起止时间',
prop: 'time',
component: 'el-date-picker',
props: {
placeholder: '请选择起止时间',
clearable: true,
},
colProps: {}
},
{
label: '最小金额',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
{
label: '最大金额',
prop: 'requirementName',
component: 'el-input',
props: {
placeholder: '请输入金额查询',
clearable: true,
filterable: true,
checkStrictly: true
}
},
])
const tableIns = ref()
const tableConfig = reactive({
columns: [
{
prop: 'name',
label: '名称',
align: 'center'
},
{
prop: 'company',
label: '所属公司',
align: 'center'
},
{
prop: 'projectType',
label: '项目类型',
align: 'center'
},
{
prop: 'productMainBody',
label: '研发主体',
align: 'center'
},
{
prop: 'projectEffect',
label: '项目影响',
align: 'center'
},
{
prop: 'survey',
label: '经营概况',
align: 'center'
},
{
prop: 'time',
label: '起止时间',
align: 'center'
},
{
prop: 'status',
label: '发布状态',
align: 'center',
currentRender: ({row, index}) => (<Tag dictType={'process_state'} value={row.state}/>)
},
{
prop: 'oper',
label: '操作',
align: 'center',
currentRender: ({row, index}) => {
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
if (row.state === '3' || row.state === '2') {
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
} else if (row.state === '4') {
btn.push({label: '申请', func: () => handleApply(row), type: 'primary'})
}
return (
<div style={{width: '100%'}}>
{
btn.map(item => (
<el-button
type={item.type}
// v-perm={item.auth}
onClick={() => item.func()}
link
>
{item.label}
</el-button>
))
}
</div>
)
}
}
],
api: '',
params: {},
})
const search = (val) => {
tableConfig.params = {...val}
tableIns.value.refresh()
}
const handleDetail = (row) => {
router.push({
path: '/project/management/detail',
query: {
id: row.requirementId
}
})
}
</script>

View File

@@ -38,7 +38,7 @@
<file-upload @getFile="getFile"/> <file-upload @getFile="getFile"/>
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig" :data="formData.fileList" :isSettingCol="false" :pagination="false"> <fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig" :data="formData.fileList" :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>
<el-empty :image-size="90" description="暂无待办" style="padding: 0"/> <el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template> </template>
</fvTable> </fvTable>
<div class="approval-record"> <div class="approval-record">

View File

@@ -39,7 +39,7 @@
<fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig" <fvTable style="width: 100%;max-height: 200px" v-if="showTable" :tableConfig="tableConfig"
:data="formData.fileList" :isSettingCol="false" :pagination="false"> :data="formData.fileList" :isSettingCol="false" :pagination="false">
<template #empty> <template #empty>
<el-empty :image-size="90" description="暂无待办" style="padding: 0"/> <el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
</template> </template>
</fvTable> </fvTable>
</el-form-item> </el-form-item>

View File

@@ -1,6 +1,10 @@
<template> <template>
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm> <fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable> <fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick">
<template #empty>
<el-empty description="暂无数据"/>
</template>
</fvTable>
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
@@ -107,7 +111,7 @@ const tableConfig = reactive({
api: '/workflow/mosr/requirement', api: '/workflow/mosr/requirement',
btns: [ btns: [
{name: '新增', key: 'add', color: '#DED0B2'}, {name: '新增', key: 'add', color: '#DED0B2'},
{name: '导出', key: 'add', type: ''}, {name: '导出', key: 'export', type: ''},
], ],
params: {} params: {}
}) })
@@ -145,16 +149,9 @@ const headBtnClick = (key) => {
case 'add': case 'add':
handleAdd() handleAdd()
break; break;
case 'edit': case 'export':
handleEdit() handleExport()
break;
case 'detail':
handleDetail()
break; break;
} }
} }
</script> </script>
<style lang="scss" scoped>
</style>