Merge pull request 'master' (#119) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/119
This commit is contained in:
2024-05-10 04:39:58 +00:00
9 changed files with 457 additions and 55 deletions

View File

@@ -0,0 +1,67 @@
<template>
<el-upload :file-list="_value"
:action="uploadFileUrl"
:headers="headers"
:limit="maxSize"
with-credentials
:multiple="maxSize > 0"
:data="uploadParams"
:auto-upload="true"
:before-upload="beforeUpload"
:on-success="handleUploadSuccess"
>
<el-button color="#DED0B2">上传文件</el-button>
</el-upload>
</template>
<script setup>
import {defineProps, computed, ref} from "vue";
import {ElMessage} from "element-plus";
import { getToken } from '@/utils/auth'
const baseURL = import.meta.env.VITE_BASE_URL
const uploadFileUrl = ref(baseURL + "/workflow/process/file")
const headers = reactive({
authorization: getToken()
})
const disabled = ref(false)
const uploadParams = ref({})
const props = defineProps({
value: {
type: Array,
default: () => {
return []
}
},
maxSize: {
type: Number,
default: 5
}
})
const emit = defineEmits(["input","getFile"])
const fileList = ref([])
const _value = computed({
get() {
return props.value;
},
set(val) {
emit("input", val);
}
})
const beforeUpload = (file) => {
// if (props.maxSize > 0 && file.size / 1024 / 1024 > props.maxSize) {
// ElMessage.warning(`每个文件最大不超过 ${props.maxSize}MB`)
// } else {
return true
// }
}
const handleUploadSuccess = (res, file) => {
if (res.code !== 1000) {
ElMessage.error("上传失败")
}
let data = res.data
fileList.value.push(data)
emit("getFile", fileList.value)
}
</script>

View File

@@ -60,13 +60,17 @@ const props = defineProps({
toolbar: {
type: [String, Array],
default: [
"fullscreen undo redo restoredraft | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | bullist numlist | blockquote subscript superscript removeformat ",
"fullscreen undo redo | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | bullist numlist | blockquote subscript superscript removeformat ",
"styleselect formatselect fontselect fontsizeselect | table image axupimgs media pagebreak insertdatetime selectall visualblocks searchreplace | code preview | indent2em lineheight formatpainter",
],
},
fontFormats: {
type: [String, Array],
default: "微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;"
},
height:{
type: Number,
default: 450
}
})
const content = ref(props.value);
@@ -78,9 +82,9 @@ const init = reactive({
content_css: '/skins/content/default/content.css',
language: 'zh_CN',
placeholder: "在这里输入文字", //textarea中的提示信息
min_width: 320,
min_height: 220,
height: 500, //注引入autoresize插件时此属性失效
min_width: 300,
min_height: 200,
height: props.height, //注引入autoresize插件时此属性失效
resize: "both", //编辑器宽高是否可变false-否,true-高可变,'both'-宽高均可,注意引号
promotion: false,
branding: false, //tiny技术支持信息是否显示

View File

@@ -1,28 +1,28 @@
<template>
<el-form
:model="form"
v-bind="$attrs"
label-width="auto"
ref="formInstance"
class="search-form"
:model="form"
v-bind="$attrs"
label-width="auto"
ref="formInstance"
class="search-form"
>
<el-row>
<el-col
v-for="(item, index) in filterConfig"
:span="5"
:offset="index == 0 || index / 4 ==1 ? 0 : 1"
:key="item.prop"
>
<el-form-item
v-bind="item"
v-for="(item, index) in filterConfig"
:span="5"
:offset="index == 0 || index / 4 ==1 ? 0 : 1"
:key="item.prop"
>
<el-form-item
v-bind="item"
:key="item.prop"
>
<template #default>
<component
:is="item.component"
v-bind="item.props || {}"
v-on="item.on || {}"
v-model="form[item.prop]"
<component
:is="item.component"
v-bind="item.props || {}"
v-on="item.on || {}"
v-model="form[item.prop]"
>
</component>
</template>
@@ -33,7 +33,7 @@
<el-button v-if="searchConfig.length>=4" link type="primary" @click="showMore = !showMore">
{{ showMore ? '收起' : '展开' }}
</el-button>
<el-button type="primary" @click="getValues" :icon="Search">搜索</el-button>
<el-button @click="getValues" color="#DED0B2" :icon="Search">搜索</el-button>
<el-button @click="handleReset" :icon="Refresh">重置</el-button>
</el-form-item>
</el-col>
@@ -58,22 +58,22 @@ const formInstance = ref(null)
const showMore = ref(false)
const filterConfig = computed(()=>{
const arr = props.searchConfig.filter(item=>{
if(item.prop) return true
const filterConfig = computed(() => {
const arr = props.searchConfig.filter(item => {
if (item.prop) return true
})
return arr.length >= 4 && showMore.value ? arr : arr.slice(0, 3)
})
// 搜索功能表单元素默认值
const setDefaultFormValues = () => {
filterConfig.value.forEach(item=>{
filterConfig.value.forEach(item => {
form.value[item.prop] = item.props?.defaultValue || null
})
}
watchEffect(()=>{
if(filterConfig.value.length) {
watchEffect(() => {
if (filterConfig.value.length) {
setDefaultFormValues()
}
})
@@ -90,8 +90,8 @@ const handleReset = () => {
emits('search', form.value)
}
onMounted(()=>{
emits('getInstance', Object.assign({}, unref(formInstance),{
onMounted(() => {
emits('getInstance', Object.assign({}, unref(formInstance), {
getValues,
handleReset,
}))
@@ -103,9 +103,10 @@ onMounted(()=>{
.search-form {
padding-top: 18px;
}
.btn-col {
display: flex;
justify-content: space-evenly;
align-items: center;
}
</style>
</style>

View File

@@ -2,10 +2,11 @@
<div class="fv-table-container">
<!-- 表格头部按钮 -->
<div class="fv-table-btn" v-if="tableConfig.btns">
<el-button
<el-button
v-for="btn in tableConfig.btns"
:key="btn.key"
:key="btn.key"
:type="btn.type || ''"
:color="btn.color || ''"
v-perm="btn.auth || ['*:*:*']"
@click="handleClickBtns(btn.key)"
>
@@ -47,7 +48,7 @@
</template>
</el-table>
<!-- 分页 -->
<fvPagination
<fvPagination
v-if="pagination"
:current-page="localData.query.pageNum"
:page-size="localData.query.pageSize"
@@ -180,9 +181,9 @@ defineExpose({ refresh, updateLoading, getQuery, tableInstance })
onMounted(() => {
getList()
})
</script>
<style lang="scss" scoped>
</style>
</style>

View File

@@ -7,7 +7,7 @@
<div class="user-box">
<div>
<!-- <img :src="userInfo.avatar" alt="" @click.stop="handleVisitedP">-->
<span>欢迎回来{{userInfo.userName}}</span>
<span @click.stop="handleVisitedP">欢迎回来{{userInfo.userName}}</span>
</div>
<div class="person" v-if="visitedP">
<ul>
@@ -81,6 +81,7 @@ const handleLogout = () => {
align-items: center;
.user-box{
cursor: pointer;
margin-left: 10px;
position: relative;
>div:first-child{

View File

@@ -16,15 +16,19 @@
</el-col>
</el-row>
<h4>待办 ({{ todoNum }})</h4>
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick">
<template #empty>
<el-empty description="暂无待办"/>
</template>
</fvTable>
</div>
</el-col>
<el-col :xs="24" :sm="8" :md="6" :lg="4" :xl="4">
<div class="right">
<!-- <div class="right-top">-->
<!-- <h3>欢迎回来 Sunshine</h3>-->
<!-- <div>科技创新项目需求征集中 要求参见OA内部信</div>-->
<!-- </div>-->
<!-- <div class="right-top">-->
<!-- <h3>欢迎回来 Sunshine</h3>-->
<!-- <div>科技创新项目需求征集中 要求参见OA内部信</div>-->
<!-- </div>-->
<!-- <div class="right-gap"></div>-->
<div class="right-top ">
<div>
@@ -36,7 +40,7 @@
{{ item.title }}
</div>
</div>
<div class="right-down">
<div class="right-top">
<div>
<h3>工具下载</h3>
<span>常用网站</span>
@@ -115,7 +119,7 @@ const tableConfig = reactive({
label: '类型',
align: 'center',
showOverflowTooltip: false,
// currentRender: ({row, index}) => (<Tag dictType={'normal_disable'} value={row.state}/>)
currentRender: ({row, index}) => (<Tag dictType={'todo_type'} value={row.state}/>)
},
{
prop: 'createTime',
@@ -197,6 +201,12 @@ const headBtnClick = (key) => {
border-radius: 10px;
background-color: #ffffff;
.el-table__empty-block {
.el-empty {
padding: 10px 0;
}
}
.statistics {
width: 99%;
margin-bottom: 20px;
@@ -210,7 +220,7 @@ const headBtnClick = (key) => {
margin-top: 15px;
.block-right {
margin-left: 40px;
margin-left: 15%;
display: flex;
flex-direction: column;
justify-content: center;
@@ -218,11 +228,13 @@ const headBtnClick = (key) => {
font-size: 17px;
> span:first-child {
white-space: nowrap;
color: #000000;
margin-bottom: 10px;
}
> span:last-child {
white-space: nowrap;
font-size: 20px;
font-weight: bold;
@@ -257,14 +269,14 @@ const headBtnClick = (key) => {
// }
//}
.right-top, .right-down {
.right-top {
flex: 0.5;
padding: 15px;
border-radius: 10px;
background-color: #ffffff;
}
.right-down,.right-top {
.right-top {
flex: 0.48;
> div:first-child {
@@ -273,10 +285,12 @@ const headBtnClick = (key) => {
align-items: center;
h3 {
white-space: nowrap;
margin-left: 15px;
}
> span {
white-space: nowrap;
color: #927648;
font-size: 14px;
}

View File

@@ -0,0 +1,166 @@
<template>
<div v-loading="loading">
<baseTitle title="需求征集信息录入"></baseTitle>
<fvForm :schema="schame" @getInstance="getInstance" :rules="rules"></fvForm>
<baseTitle title="征集说明"></baseTitle>
<Tinymce image-url="/notice/file" file-url="/notice/file" v-model:value="instructions" height="300"/>
<baseTitle title="申请文件"></baseTitle>
<file-upload @getFile="getFile"/>
<div class="oper-page-btn">
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
<el-button @click="handleBack">返回</el-button>
</div>
</div>
</template>
<script setup lang="jsx">
import {useTagsView} from '@/stores/tagsview.js'
import {useAuthStore} from '@/stores/userstore.js'
import {ElLoading, ElNotification} from 'element-plus';
import {getMenuList} from '@/api/system/menuman.js'
import {getRoleDetail, operate, getTemRoleOption} from "@/api/role/role";
import FileUpload from "../../../components/FileUpload.vue";
const tagsViewStore = useTagsView()
const authStore = useAuthStore()
const route = useRoute()
const form = ref(null)
const fileList = ref(null)
const menuTree = ref(null)
const loading = ref(false)
const localData = reactive({
affiliatedCompany: []
})
const instructions = ref()
const schame = computed(() => {
let arr = [
{
label: '名称',
prop: 'roleName',
component: 'el-input',
props: {
placeholder: '请输入名称',
clearable: true
}
},
{
label: '所属公司',
prop: 'subCompanyId',
component: 'el-tree-select',
props: {
placeholder: '请选择所属公司',
clearable: true,
filterable: true,
checkStrictly: true,
data: localData.affiliatedCompany,
disabled: route.query.userType == 0 ? true : false
},
on: {
change: async (val) => {
const {data} = await getDeptOpt({subCompanyId: val})
localData.departmentIdOpt = data
}
}
},
{
label: '征集类型',
prop: 'subCompanyType',
component: 'el-tree-select',
props: {
placeholder: '请选择征集类型',
clearable: true,
filterable: true,
checkStrictly: true,
data: localData.affiliatedCompany,
disabled: route.query.userType == 0 ? true : false
},
on: {
change: async (val) => {
const {data} = await getDeptOpt({subCompanyId: val})
localData.departmentIdOpt = data
}
}
},
{
label: '截止时间',
prop: 'dateValue',
component: 'el-date-picker',
props: {
placeholder: '请选择截止时间',
clearable: true,
type: 'datetime'
}
}
]
return !authStore.roles.includes('superAdmin') ? arr.slice(0, arr.length - 1) : arr
})
const rules = reactive({
roleName: [{required: true, message: '请输入', trigger: 'change'}],
subCompanyId: [{required: true, message: '请输入', trigger: 'change'}]
})
const getInstance = (e) => {
form.value = e
}
const getFile=(val)=>{
console.log('fileList', val)
fileList.value=val
}
const init = async () => {
form.value.setValues({state: '1', template: false})
const res = await getTemRoleOption()
localData.tempRoleOpt = res.data
const {data} = await getMenuList()
localData.menuData = data
}
const getInfo = async () => {
if (!route.query.id) return
const {data} = await getRoleDetail(route.query.id)
data.menuIds.forEach(key => {
menuTree.value.setChecked(key, true, false)
})
form.value.setValues(data)
}
const handleSubmit = async () => {
// const loading = ElLoading.service({fullscreen: true})
// const {isValidate} = await form.value.validate()
// if (!isValidate) return Promise.reject()
// const values = form.value.getValues()
// values.menuIds = checkChange()
// operate(values).then(res => {
// ElNotification({
// title: route.query.isAdd ? '新增' : '编辑',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// loading.close()
// res.code === 1000 ? tagsViewStore.delViewAndGoView('/system/role') : null
// }).finally(() => {
// loading.close()
// })
}
const handleBack = () => {
history.back()
}
watch(localData, (val) => {
menuTree.value.filter(val.filterText)
})
onMounted(async () => {
loading.value = true
await init()
if (route.query.id) {
await getInfo()
}
loading.value = false
})
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,119 @@
<template>
<div class="detail-block">
<div class="left-info">
<baseTitle title="需求征集详情"></baseTitle>
<div class="info">
<div v-for="item in list">
<span>{{ item.title }}</span>
<span>{{ item.text }}</span>
</div>
</div>
<baseTitle title="征集说明"></baseTitle>
<el-card>
{{ instructions }}
</el-card>
<baseTitle title="申请文件"></baseTitle>
<fvTable ref="tableIns" style="max-height: 200px" :tableConfig="tableConfig" @headBtnClick="headBtnClick" :pagination="false"></fvTable>
<baseTitle title="审核意见"></baseTitle>
<el-input
v-model="auditOpinion"
:rows="3"
type="textarea"
placeholder="请输入审核意见"
/>
</div>
<div class="approval-record">
<baseTitle title="审批记录"></baseTitle>
</div>
<div class="oper-page-btn">
<el-button @click="handleSubmit">驳回</el-button>
<el-button color="#DED0B2" @click="handleBack">同意</el-button>
</div>
</div>
</template>
<script setup lang="jsx">
const list = ref([
{
title: '名称',
text: '名名称称名名称名称名称名称'
}, {
title: '所属公司',
text: '名称名称名称名称'
}, {
title: '征集类型',
text: '名称名称名称名称'
}, {
title: '截止时间',
text: '名称名称名称名称'
},
])
const instructions = ref('ds')
const auditOpinion = ref('')
const tableConfig = reactive({
columns: [
{
prop: 'roleName',
label: '文件名',
align: 'center'
},
{
prop: 'roleKey',
label: '标签',
align: 'center'
},
{
prop: 'oper',
label: '操作',
align: 'center',
width:'200px',
showOverflowTooltip: false,
currentRender: ({row, index}) => {
return (
<div>
<el-button type="primary" link onClick={() => handleDownload(row)}>下载
</el-button>
</div>
)
}
}
],
api: '/admin/role'
})
</script>
<style lang="scss" scoped>
.detail-block {
display: flex;
justify-content: space-around;
.left-info {
flex: 0.6;
margin-right: 30px;
.info {
display: flex;
flex-wrap: wrap;
> div {
width: 350px;
margin-bottom: 15px;
margin-right: 10px;
> span:first-child {
color: black;
font-size: 16px;
font-weight: bold;
}
}
}
}
.approval-record {
flex: 0.4;
}
}
</style>

View File

@@ -62,7 +62,7 @@ const tableConfig = reactive({
label: '状态',
align: 'center',
showOverflowTooltip: false,
currentRender: ({row, index}) => (<Tag dictType={'normal_disable'} value={row.state}/>)
currentRender: ({row, index}) => (<Tag dictType={'demand_collection'} value={row.state}/>)
},
{
prop: 'oper',
@@ -72,17 +72,19 @@ 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={() => handleDetail(row)}>详情
</el-button>
<el-button type="primary" link onClick={() => handleEdit(row)}>编辑</el-button>
<el-button type="primary" link onClick={() => handleReport(row)}>上报</el-button>
</div>
)
}
}
],
api: '',
api: '/admin/role',
btns: [
{name: '新增', key: 'add', auth: auths.add, type: 'primary'},
{name: '导出', key: 'add', auth: auths.add, type: 'primary'},
{name: '新增', key: 'add', auth: auths.add, color: '#DED0B2'},
{name: '导出', key: 'add', auth: auths.add, type: ''},
],
params: {}
})
@@ -91,13 +93,40 @@ const search = (val) => {
tableConfig.params = {...val}
tableIns.value.refresh()
}
const handleAdd = () => {
router.push({
path: '/projectdemand/demandadd',
query: {
isAdd: 1
}
})
}
const handleEdit = (row) => {
router.push({
path: '/projectdemand/demandedit',
query: {
id: row.roleId
}
})
}
const handleDetail = (row) => {
router.push({
path: '/projectdemand/demanddetail',
query: {
id: row.roleId
}
})
}
const headBtnClick = (key) => {
switch (key) {
case 'add':
handleAdd()
break;
case 'export':
handleExport()
case 'edit':
handleEdit()
break;
case 'detail':
handleDetail()
break;
}
}