Merge pull request 'xqhz' (#160) from xqhz into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/160
This commit is contained in:
@@ -8,7 +8,7 @@ export const hasPerm = (el, binding, vnode) => {
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const permissiosFlag = value
|
||||
const hasPermission = permisstions.some(permission => {
|
||||
return allPermission === permission || permissiosFlag.includes(permission)
|
||||
return permissiosFlag[0] === allPermission || permissiosFlag[0] === permission
|
||||
})
|
||||
if (!hasPermission) {
|
||||
el.parentNode && el.parentNode.removeChild(el)
|
||||
|
||||
182
src/views/projectdemand/demandsummary/add.vue
Normal file
182
src/views/projectdemand/demandsummary/add.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<template>
|
||||
<fvForm :schema="schame" @getInstance="getInstance"></fvForm>
|
||||
<div class="oper-page-btn">
|
||||
<el-button type="primary" @click="staging">存为草稿</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">发布</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import { markRaw } from 'vue';
|
||||
import FileUpload from './components/FileUpload.vue';
|
||||
|
||||
const localData = reactive({
|
||||
form: null
|
||||
})
|
||||
|
||||
const schame = computed(()=>{
|
||||
let arr = [
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'name',
|
||||
component: 'el-input',
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
prop: 'startTime',
|
||||
component: 'el-date-picker',
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '所属公司',
|
||||
prop: 'company',
|
||||
component: 'el-input',
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '项目类型',
|
||||
prop: 'projectType',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
prop: 'endTime',
|
||||
component: 'el-date-picker',
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '出资类型',
|
||||
prop: 'monenyType',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '项目影响',
|
||||
prop: 'projectEffect',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '所属业务板块',
|
||||
prop: 'ywbank',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '预期成果形式',
|
||||
prop: 'yuqichengg',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '预期技术标准制定',
|
||||
prop: 'yuqizhidingbiaozhu',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '产学研联合',
|
||||
prop: 'chanxue',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '开展政府申报',
|
||||
prop: 'zhengfushenbao',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '知识产权状况',
|
||||
prop: 'zhishichanquan',
|
||||
component: markRaw(fvSelect),
|
||||
props: {},
|
||||
colProps: {
|
||||
span: 12
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '现有业务描述',
|
||||
prop: 'yewudes',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
type: 'textarea'
|
||||
},
|
||||
colProps: {
|
||||
span: 24
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '研发项目关键内容描述',
|
||||
prop: 'contentnesss',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
type: 'textarea'
|
||||
},
|
||||
colProps: {
|
||||
span: 24
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
prop: 'fileList',
|
||||
component: markRaw(FileUpload),
|
||||
props: {
|
||||
url: '',
|
||||
tip: '上传txt文件'
|
||||
},
|
||||
colProps: {
|
||||
span: 24
|
||||
}
|
||||
}
|
||||
]
|
||||
return arr
|
||||
})
|
||||
|
||||
const getInstance = (e) => {
|
||||
localData.form = e
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {}
|
||||
|
||||
const staging = async () => {}
|
||||
</script>
|
||||
12
src/views/projectdemand/demandsummary/api/index.js
Normal file
12
src/views/projectdemand/demandsummary/api/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export const fileUp = (url, data) => {
|
||||
return request({
|
||||
url,
|
||||
method: 'post',
|
||||
data,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
v-bind="$attrs"
|
||||
drag
|
||||
:action="url"
|
||||
multiple
|
||||
:on-change="change"
|
||||
:on-progress="progress"
|
||||
:on-remove="remove"
|
||||
:before-remove="beforeRemove"
|
||||
v-model:file-list="fileList"
|
||||
:http-request="uploadRequest"
|
||||
style="width: 50%;"
|
||||
>
|
||||
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
||||
<div class="el-upload__text">
|
||||
拖拽上传/<em>点击上传</em>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">
|
||||
{{ tip }}
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { reactive, ref } from 'vue';
|
||||
import { fileUp } from '../api';
|
||||
|
||||
const props = defineProps({
|
||||
url: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
tip: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
|
||||
const fileList = ref([])
|
||||
const uploadRef = ref()
|
||||
|
||||
const localData = reactive({
|
||||
|
||||
})
|
||||
|
||||
const change = (file, files) => {
|
||||
console.log(file, 'file');
|
||||
}
|
||||
|
||||
const progress = (UploadProgressEvent, UploadFile, UploadFiles) => {
|
||||
|
||||
}
|
||||
|
||||
const remove = (file, files) => {}
|
||||
|
||||
const beforeRemove = (file, files) => {}
|
||||
|
||||
const uploadRequest = (UploadRequestOptions) => {
|
||||
console.log(UploadRequestOptions, 'UploadRequestOptions');
|
||||
// UploadRequestOptions.data = {}
|
||||
const formData = new FormData()
|
||||
formData.append('file', UploadRequestOptions.file)
|
||||
// formData.append('params', UploadRequestOptions.data)
|
||||
fileUp(url, formData)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -1,21 +1,28 @@
|
||||
<template>
|
||||
<fvSearchForm :searchConfig="searchConfig"></fvSearchForm>
|
||||
<fvTable :table-config="tableConfig"></fvTable>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import { reactive, shallowRef } from 'vue';
|
||||
import fvSelect from './../../../fvcomponents/fvSelect/index.vue'
|
||||
import { reactive, ref, shallowRef } from 'vue';
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const localData = reactive({
|
||||
// 表格配置
|
||||
|
||||
})
|
||||
|
||||
const tableIns= ref()
|
||||
const router = useRouter()
|
||||
|
||||
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'name',
|
||||
props: {
|
||||
placeholder: '请输入'
|
||||
},
|
||||
component: 'el-input',
|
||||
colProps: {}
|
||||
},
|
||||
@@ -114,14 +121,46 @@ const tableConfig = reactive({
|
||||
currentRender: ({row, index}) => {
|
||||
return (
|
||||
<div>
|
||||
<el-button type={'primary'} link onClick={()=>{}}>详情</el-button>
|
||||
<el-button type={'primary'} link onClick={()=>{}}>上报</el-button>
|
||||
<el-button type={'primary'} link onClick={()=>{}} >详情</el-button>
|
||||
<el-button type={'primary'} link onClick={()=>{}} >上报</el-button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
],
|
||||
api: '',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '新增上报', key: 'add', type: 'primary', auth: ''},
|
||||
{name: '年度计划导出', key: '_export', type: 'primary', auth: ''},
|
||||
{name: '经费预算生成', key: 'preMonty', type: 'primary', auth: ''},
|
||||
]
|
||||
})
|
||||
|
||||
const search = (val) => {
|
||||
let obj = {...val}
|
||||
if(obj.time) {
|
||||
obj.startTime = obj.time[0]
|
||||
obj.endTime = obj.time[1]
|
||||
delete obj.dateValue
|
||||
}
|
||||
tableConfig.params = obj
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
|
||||
const headBtnClick = (key) => {
|
||||
switch(key) {
|
||||
case 'add': handleAdd()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
name: 'Demandsummaryadd',
|
||||
query: {}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user