提交 c71b13ec authored 作者: 刘旭's avatar 刘旭

更新内账外账

上级 7e2bdc31
import { createApp } from 'vue'
import App from './App.vue'
// 注入路由
import router from './router';
import { start, close } from '@/utils/nprogress'
......
//查询列表的参数类型
export interface ListParm{
searchName:string;
}
//返回值
export interface DeptListRes{
list:any
}
//部门表格每行数据的格式
export interface DeptModel {
id: number;
pid: number;
likeId: number;
parentName: string;
manager: string;
name: string;
deptCode: string;
deptAddress: string;
deptPhone: string;
orderNum: number;
open: boolean;
children: Array<DeptModel>
}
//表单提交的数据类型
export interface AddDeptModel {
type: string;
id: string | number;
pid: string |number;
parentName: string;
manager: string;
deptAddress: string;
deptPhone: string;
name: string;
deptCode: string;
orderNum: string;
}
//上级部门树选中的数据
export interface SelectNode{
id:string | number;
name:string;
}
\ No newline at end of file
import httpRequest from "@/services/common";
import { urlConfig } from '@/services/config';
\ No newline at end of file
import httpRequest from "@/services/common";
import { userUrlConfig, authUrlConfig } from '@/services/config'
import { AddDeptModel, ListParm } from './DeptModel'
enum Api {
getDeptList = '/api/department/list',
getParent = '/api/department/parent',
add = '/api/department',
edit = '/api/department',
delete = '/api/department'
}
//查询部门列表
export const getDeptListApi = async (parms: ListParm) => {
return await httpRequest.get(Api.getDeptList, parms)
}
//查询上级部门树
export const getDeptParentApi = async () => {
return await httpRequest.get(Api.getParent)
}
//新增
export const addDeptApi = async (parms: AddDeptModel) => {
return await httpRequest.post(Api.add, parms)
}
//编辑
export const editDeptApi = async (parms: AddDeptModel) => {
return await httpRequest.put(Api.edit, parms)
}
//删除
export const deleteDeptApi = async (parms: any) => {
return await httpRequest.delete(Api.delete, parms)
}
import httpRequest from "@/services/common";
import { urlConfig } from '@/services/config'
export const test = async () => {
return httpRequest.get(urlConfig['test'])
}
\ No newline at end of file
<template>
<div class="app-container">
<el-card shadow="always" :body-style="{ padding: '20px' }">
<el-tabs>
<el-tab-pane label="事业部">
<bizunit-table></bizunit-table>
</el-tab-pane>
<el-tab-pane label="部门角色">
</el-tab-pane>
<el-tab-pane label="事业部角色人员">
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script lang="ts">
import BizunitTabel from './components/bizunitTable.vue'
export default {
name: 'Bizunit',
components: {
'bizunit-table': BizunitTabel
},
setup() {
}
}
</script>
<style lang="scss">
</style>
<template>
<Custom-table
:tableConfigData="tableConfigData"
@handle-show="handleShow"
>
<template v-slot:drawer>
<el-form-item
v-for="(item, index) in editData"
:key="index"
:label="item.label"
:prop="item.prop"
>
<custom-form-item
v-model:modValue="tableConfigData.drawerformData[item.prop]"
:type="item.type"
:inputType="item.inputValue"
:options="tableData"
:selectProp="item.selectProp"
>
</custom-form-item>
</el-form-item>
</template>
</Custom-table>
</template>
<script lang="ts">
import { bizunitData } from '../tableConfigData/bizunit'
import { Scope } from '@/table/type'
import { ref, Ref, reactive } from 'vue'
export default {
name: 'bizunitTable',
setup() {
const tableConfigData = reactive(bizunitData)
const tableData: Ref<any[]> = ref([])
const editData: Ref<any[]> = ref([])
tableConfigData.tableTitle.forEach(item => {
if (item.type) {
editData.value.push(item)
}
})
const handleShow = ref((params: { key: string, tableData: object[], scope?: Scope }) => {
tableData.value = params.tableData
const key = params.key
switch (key) {
case '新增':
tableConfigData.drawerformData = {
id: '',
type: 0,
cname: '',
ename: '',
code: '',
product: ''
}
break
case '编辑': {
if (!params.scope) return false
const row = params.scope.row
tableConfigData.drawerformData = {
id: row.id,
type: row.type,
cname: row.cname,
ename: row.ename,
code: row.code,
product: row.product
}
break
}
}
})
return {
tableConfigData,
handleShow,
tableData,
editData
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="app-container">
<el-row :gutter="5">
<el-col :span="16">
<el-card shadow="always" :body-style="{ padding: '20px' }">
<template #header>
<div class="card-header">我的部门</div>
</template>
<Custom-table
:tableConfigData="tableConfigData"
@handle-show="handleShow"
>
<template v-slot:drawer>
<el-form-item
v-for="(item, index) in editData"
:key="index"
:label="item.label"
:prop="item.prop"
>
<custom-form-item
v-model:modValue="tableConfigData.drawerformData[item.prop]"
:type="item.type"
:inputType="item.inputValue"
:options="tableData"
:selectProp="item.selectProp"
>
</custom-form-item>
</el-form-item>
</template>
</Custom-table>
</el-card>
</el-col>
<el-col :span="8">
<el-card shadow="always" :body-style="{ padding: '20px' }">
<el-tabs>
<el-tab-pane label="基本信息"></el-tab-pane>
<el-tab-pane label="部门权限"></el-tab-pane>
</el-tabs>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script lang="ts">
import { departmentData } from './tableConfigData/departmentManage'
import { Scope } from '@/table/type'
import { ref, Ref, reactive } from 'vue'
export default {
name: 'departmentManage',
setup() {
const tableConfigData = reactive(departmentData)
const tableData: Ref<any[]> = ref([])
const editData: Ref<any[]> = ref([])
tableConfigData.tableTitle.forEach(item => {
if (item.type) {
editData.value.push(item)
}
})
const handleShow = ref((params: { key: string, tableData: object[], scope?: Scope }) => {
console.log(params.tableData)
tableData.value = params.tableData
const key = params.key
switch (key) {
case '新增':
tableConfigData.drawerformData = {
id: '',
type: 0,
cname: '',
ename: '',
code: ''
}
break
case '编辑': {
if (!params.scope) return false
const row = params.scope.row
tableConfigData.drawerformData = {
id: row.id,
type: row.type,
cname: row.cname,
ename: row.ename,
code: row.code
}
break
}
}
})
return {
tableConfigData,
handleShow,
tableData,
editData
}
}
}
</script>
<style>
</style>
import { TableConfigData } from "@/table/type";
const bizunitData: TableConfigData = {
title: '事业部',
tableTitle: [
{
label: '事业部名称',
prop: 'cname',
type: 'input'
},
{
label: '英文名称',
prop: 'ename',
type: 'input'
},
{
label: '编号',
prop: 'code',
type: 'input'
},
{
label: '对应部门',
prop: 'depart',
type: 'input'
},
{
label: '关联产品线',
prop: 'product',
type: 'input'
}
],
drawerformData: {
id: '',
type: 0,
cname: '',
ename: '',
code: '',
product: ''
},
rules: {
cname: [
{ required: true, message: '事业部名称', trigger: 'blur' }
]
},
btnObj: {
width: '200',
isAdd: true,
isDelete: true
},
apiKey: 'department',
tableApi: '/bizunit',
dataKey: ''
}
export { bizunitData }
import { TableConfigData } from "@/table/type";
const departmentData: TableConfigData = {
title: '部门',
tableTitle: [
{
label: '部门名称',
prop: 'cname',
type: 'input'
},
{
label: '英文名称',
prop: 'ename',
type: 'input'
},
{
label: '编号',
prop: 'code',
type: 'input'
},
{
label: '类型',
prop: 'type',
type: 'input'
}
],
drawerformData: {
id: '',
type: 0,
cname: '',
ename: '',
code: ''
},
rules: {
cname: [
{ required: true, message: '请输入部门名称', trigger: 'blur' }
]
},
btnObj: {
width: '200',
isAdd: true,
isDelete: true
},
apiKey: 'department',
tableApi: '/index',
dataKey: ''
}
export { departmentData }
<!-- 下拉选择筛选 -->
<template>
<el-dropdown ref="dropdown" :hide-on-click="false" trigger="contextmenu">
<span class="el-dropdown-link" @click="dropData.show">
{{title}}<el-icon class="el-icon--right"><arrow-down /></el-icon>
</span>
<template #dropdown>
<div class="space-between" style="width: 120px; padding: 10px 20px">
<el-checkbox
v-model="dropData.checkAll"
:indeterminate="dropData.isIndeterminate"
@change="dropData.handleCheckAllChange"
>全选</el-checkbox
>
<el-button type="primary" size="small" @click="dropData.confirm">确定</el-button>
</div>
<div style="height: 400px;width: 160px; overflow: auto">
<el-checkbox-group
v-model="dropData.checkedList"
@change="dropData.handleCheckedChange"
>
<el-dropdown-menu>
<el-dropdown-item v-for="(item, index) in list" :key="index">
<el-checkbox :label="item">
<div class="over1">
{{item[prop]}}
</div>
</el-checkbox>
</el-dropdown-item>
</el-dropdown-menu>
</el-checkbox-group>
</div>
</template>
</el-dropdown>
</template>
<script lang="ts">
import { reactive, ref } from 'vue'
export default {
name: 'DropDownCheck',
props: {
modValue: {
type: Array,
default: null,
required: true
},
title: {
type: String,
default: ''
},
list: {
type: Array,
default: null
},
prop: {
type: String,
default: ''
}
},
setup(props, context) {
const dropdown = ref()
const dropData = reactive({
checkAll: false,
isIndeterminate: true,
checkedList: props.modValue,
handleCheckAllChange: (val: boolean) => {
dropData.checkedList = val ? props.list : []
dropData.isIndeterminate = false
context.emit('update:modValue', dropData.checkedList)
},
handleCheckedChange: (value: string[]) => {
const checkedCount = value.length
dropData.checkAll = checkedCount === props.list.length
dropData.isIndeterminate = checkedCount > 0 && checkedCount < props.list.length
context.emit('update:modValue', dropData.checkedList)
},
show: () => {
dropdown.value.handleOpen()
},
confirm: () => {
dropdown.value.handleClose()
context.emit('onConfirm', props.title)
}
})
return {
dropData,
dropdown
}
}
}
</script>
<style>
</style>
<template>
<el-drawer
v-model="drawerData.drawerShow"
title="配置交付文档"
direction="rtl"
:before-close="drawerData.handleClose"
>
<el-tabs class="demo-tabs" stretch>
<el-tab-pane v-for="(item, index) in list" :key="index">
<template #label>
<span class="custom-tabs-label">
<span>{{item.label}}</span>
</span>
<span class="count" v-if="item.children.length ">{{item.children.length}}</span>
</template>
<el-descriptions
v-for="(child, childIndex) in item.children"
:key="childIndex"
class="margin-top"
:title="child.name"
:column="3"
:size="size"
border
>
<template #extra>
<el-button type="primary" size="small" @click="drawerData.onAdd(index)">编辑</el-button>
<el-button type="primary" size="small" @click="drawerData.delete(childIndex)">删除</el-button>
<el-button type="primary" size="small" @click="drawerData.editRole">权限配置</el-button>
<el-button type="primary" size="small">审批路径</el-button>
</template>
<el-descriptions-item>
<template #label>
<div class="cell-item">
必须上传
</div>
</template>
{{child.isUpload}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
必须审批
</div>
</template>
{{child.isComment}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
默认文件夹
</div>
</template>
{{child.folder}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
评审方式
</div>
</template>
{{child.isComment}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
秘级
</div>
</template>
{{child.level}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
文档编号
</div>
</template>
{{child.code}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
前置交付文档
</div>
</template>
{{ child.beforeFolder}}
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<div class="cell-item">
文档说明
</div>
</template>
{{ child.desc }}
</el-descriptions-item>
</el-descriptions>
<el-empty description="暂无文档" v-if="item.children.length === 0" />
<el-button type="primary" style="margin-top: 10px" size="small" @click="drawerData.onAdd(index)">添加交付文档清单</el-button>
<el-button type="primary" style="margin-top: 10px" size="small">设置排序</el-button>
</el-tab-pane>
</el-tabs>
</el-drawer>
<el-dialog v-model="dialogData.visible" title="交付文档">
<el-form :model="dialogData.formData" :rules="dialogData.rules" label-width="120px">
<el-form-item
v-for="(item, index) in dialogData.formItem"
:key="index"
:label="item.label"
:prop="item.prop"
>
<custom-form-item
v-model:modValue="dialogData.formData[item.prop]"
:type="item.type"
:inputType="item.inputValue"
:options="list"
:selectProp="item.selectProp"
>
<template v-slot:radios>
<el-radio :label="0">机密</el-radio>
<el-radio :label="1">秘密</el-radio>
<el-radio :label="2">内部公开</el-radio>
<el-radio :label="3">公开</el-radio>
</template>
</custom-form-item>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogData.visible = false">取消</el-button>
<el-button type="primary" @click="dialogData.onConfirm"
>确定</el-button
>
</span>
</template>
</el-dialog>
</template>
<script lang="ts">
import { reactive } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
import { FormItem } from '@/table/type'
export default {
name: 'ExpectDoc',
props: {
list: {
type: Array as any,
default: () => {
return []
}
}
},
setup(props) {
const drawerData = reactive({
drawerShow: false,
index: 0,
show: () => {
drawerData.drawerShow = true
},
onAdd: (index: number) => {
drawerData.index = index
dialogData.visible = true
},
delete: (index: number) => {
ElMessageBox.confirm('确定删除吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
ElMessage({
type: 'success',
message: '删除成功',
})
})
},
editRole: () => {
ElMessage({
type: 'error',
message: '部门功能未开发,暂无法配置权限',
})
}
})
const formItem: FormItem[] = [
{
label: '交付文档名称',
prop: 'name',
type: 'input'
},
{
label: '默认存放文件夹',
prop: 'folder',
type: 'input'
},
{
label: '所属阶段',
prop: 'pharse',
type: 'select',
selectProp: {
value: 'id',
label: 'label'
}
},
{
label: '文档分类',
prop: 'type',
type: 'select',
selectProp: {
value: 'id',
label: 'label'
}
},
{
label: '文档编号',
prop: 'code',
type: 'input'
},
{
label: '评审方式',
prop: 'commentType',
type: 'select',
selectProp: {
value: 'id',
label: 'label'
}
},
{
label: '密级',
prop: 'level',
type: 'radio'
},
{
label: '必须上传',
prop: 'isUpload',
type: 'switch'
},
{
label: '必须审批',
prop: 'isComment',
type: 'switch'
},
{
label: '前置交付文档',
prop: 'beforeFolder',
type: 'select',
selectProp: {
value: 'id',
label: 'label'
}
},
{
label: '文档说明',
prop: 'desc',
type: 'input',
inputType: 'textarea'
},
]
const dialogData = reactive({
visible: false,
formItem: formItem,
formData: {
id: '',
name: '',
folder: '',
pharse: '',
type: '',
code: '',
commentType: '',
level: 0,
isUpload: true,
isComment: true,
beforeFolder: '',
desc: ''
},
rules: {
name: [
{ required: true, message: '请输入交付文档名称', trigger: 'blur' }
],
commentType: [
{ required: true, message: '请输入选择评审类型', trigger: 'blur' }
]
},
onConfirm: () => {
props.list[drawerData.index].children.push(dialogData.formData)
dialogData.visible = false
}
})
return { drawerData, dialogData }
}
}
</script>
<style lang="scss" scoped>
.count{
position: absolute;
top: 0px; right: 0;
width: 20px;
height: 20px;
display: flex; align-items: center; justify-content: center;
border-radius: 50%;
}
.margin-top{
margin-top: 20px;
}
</style>
<template>
<el-drawer
v-model="drawerData.drawerShow"
title="编辑文件夹"
direction="rtl"
:before-close="drawerData.handleClose"
>
<CustomInputTable
:tableTitle="drawerData.tableTitle"
:tableData="drawerData.tableData"
@onAdd="drawerData.onAdd"
>
<template #default="scope">
<el-button type="danger" size="small" @click="drawerData.delete(scope.$index)">删除</el-button>
</template>
</CustomInputTable>
</el-drawer>
</template>
<script lang="ts">
import { reactive } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
export default {
name: 'Folder',
setup() {
const tableData: {
isLeaf: true;
key: string;
level: number;
name: string;
parentId: string;
title: string;
value: string;
}[] = []
const drawerData = reactive({
drawerShow: false,
tableTitle: [
{
lable: '文件夹',
prop: 'name'
}
],
tableData: tableData,
show: () => {
drawerData.drawerShow = true
},
onAdd: (value: string) => {
if (!value) {
return false
}
drawerData.tableData.push({
isLeaf: true,
key: '',
level: 0,
name: value,
parentId: '',
title: value,
value: ''
})
},
delete: (index: number) => {
ElMessageBox.confirm('确定删除吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
drawerData.tableData.splice(index, 1)
ElMessage({
type: 'success',
message: '删除成功',
})
})
}
})
return { drawerData }
}
}
</script>
<style>
</style>
<template>
<el-drawer
v-model="drawerData.drawerShow"
title="评审配置"
direction="rtl"
:before-close="drawerData.handleClose"
size="70%"
>
<el-row :gutter="20">
<el-col :span="6">
<div style="height: 40px">评审流程</div>
<el-tree
:data="drawerData.treeData"
accordion
@node-click="drawerData.handleNodeClick"
/>
</el-col>
<el-col :span="18">
<el-tabs class="demo-tabs">
<el-tab-pane v-for="(item, index) in list" :key="index">
<template #label>
<span class="custom-tabs-label">
<span>{{item.label}}</span>
</span>
</template>
<el-table :data="drawerData.tableData" style="width: 100%">
<el-table-column type="selection" />
<el-table-column prop="name" label="交付物" />
<el-table-column prop="type" label="评审方式" width="100" />
<el-table-column prop="isComment" label="必须审批" width="100" />
</el-table>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
</el-drawer>
</template>
<script lang="ts">
import { reactive } from 'vue'
interface Tree {
label: string
children?: Tree[]
}
interface JudgeTableObj{
name: string;
type: string;
isComment: '是' | '否'
}
export default {
name: 'Judge',
props: {
list: {
type: Array,
default: null
}
},
setup() {
const data: Tree[] = [
{
label: '无分类',
children: [
{
label: '重大里程碑节点'
},
{
label: '立项评审'
},
{
label: '研发方案评审'
},
{
label: '文档评审流程'
},
{
label: '项目计划发布评审'
},
{
label: 'GR1质量阀里程碑评审'
},
{
label: '新文档评审流程'
}
]
},
{
label: 'DCP',
children: [
{
label: '重大里程碑节点'
},
{
label: '立项评审'
},
{
label: '研发方案评审'
}
]
},
{
label: 'TR',
children: [
{
label: '项目计划发布评审'
},
{
label: 'GR1质量阀里程碑评审'
},
{
label: '新文档评审流程'
}
]
},
{
label: '文档',
children: []
}
]
const tableData: JudgeTableObj[] = [
{
name: 'admin',
type: '不需要评审',
isComment: '否'
},
{
name: '测试',
type: '不需要评审',
isComment: '是'
}
]
const drawerData = reactive({
drawerShow: false,
activeName: '',
treeData: data,
tableData: tableData,
show: () => {
drawerData.drawerShow = true
},
handleNodeClick: (data: Tree) => {
console.log(data)
}
})
return { drawerData }
}
}
</script>
<style lang="scss" scoped>
.el-row {
margin-bottom: 20px;
}
.el-row:last-child {
margin-bottom: 0;
}
.el-col {
border-radius: 4px;
}
.grid-content {
border-radius: 4px;
min-height: 36px;
}
</style>
<template>
<el-drawer
v-model="drawerData.drawerShow"
title="编辑计划"
direction="rtl"
:before-close="drawerData.handleClose"
size="70%"
>
<el-button type="primary" size="small" @click="drawerData.visible = true">新增计划</el-button>
<el-tabs class="demo-tabs">
<el-tab-pane v-for="(item, index) in drawerData.list" :label="item.name" :key="index">
<CustomInputTable
:tableTitle="drawerData.tableTitle"
:tableData="drawerData.tableData"
@onAdd="drawerData.onAdd"
>
<template #default="scope">
<el-button type="danger" size="small" @click="drawerData.delete(scope.$index)">删除</el-button>
</template>
</CustomInputTable>
</el-tab-pane>
</el-tabs>
</el-drawer>
<el-dialog v-model="drawerData.visible" title="新增计划">
<el-form :model="drawerData.formData" :rules="drawerData.rules" label-width="100px">
<el-form-item label="计划名称" prop="name">
<el-input v-model="drawerData.formData.name" autocomplete="off" />
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="drawerData.visible = false">取消</el-button>
<el-button type="primary" @click="drawerData.addPlan"
>确定</el-button
>
</span>
</template>
</el-dialog>
</template>
<script lang="ts">
import { reactive } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
export default {
name: 'Plan',
setup() {
const tableData: {
id: number;
task: string;
count: string;
time: string;
beforeTask: string;
pharse: string;
folder: string;
role: string;
more: string;
}[] = []
const drawerData = reactive({
drawerShow: false,
list: [
{
name: '主计划'
}
],
tableTitle: [
{
lable: '序号',
prop: 'id'
},
{
lable: '任务',
prop: 'task'
},
{
lable: '工期',
prop: 'count'
},
{
lable: '标准工时',
prop: 'time'
},
{
lable: '前置任务',
prop: 'beforeTask'
},
{
lable: '关联阶段',
prop: 'pharse'
},
{
lable: '预期交付文档',
prop: 'folder'
},
{
lable: '责任角色',
prop: 'role'
},
{
lable: '更多属性',
prop: 'more'
},
],
tableData: tableData,
visible: false,
formData: {
name: ''
},
rules: {
name: [{
required: true, message: '请输入计划名称', trigger: 'blur'
}]
},
show: () => {
drawerData.drawerShow = true
},
addPlan: ()=> {
drawerData.list.push({
name: drawerData.formData.name
})
drawerData.visible = false
},
onAdd: (value: string) => {
if (!value) {
return false
}
drawerData.tableData.push({
id: Date.now(),
task: value,
count: '',
time: '',
beforeTask: '',
pharse: '',
folder: '',
role: '',
more: '更多详情',
})
},
delete: (index: number) => {
ElMessageBox.confirm('确定删除吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
drawerData.tableData.splice(index, 1)
ElMessage({
type: 'success',
message: '删除成功',
})
})
}
})
return { drawerData }
}
}
</script>
<style>
</style>
<template>
<el-dialog v-model="dialogData.visible" title="项目模板">
<el-form :model="dialogData.formData" :rules="dialogData.rules" label-width="100px">
<el-form-item label="模板名称" prop="name">
<el-input v-model="dialogData.formData.name" autocomplete="off" />
</el-form-item>
<el-form-item label="事业部">
<el-select v-model="dialogData.formData.bizUnits" placeholder="请选择事业部" multiple>
<el-option label="研发事业部" value="研发事业部" />
<el-option label="业务事业部" value="业务事业部" />
<el-option label="电梯事业部" value="电梯事业部" />
</el-select>
</el-form-item>
<el-form-item label="适用于">
<el-radio-group v-model="dialogData.formData.radioType" class="ml-4">
<el-radio label="0" size="large">项目类型</el-radio>
<el-radio label="1" size="large">项目分类</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="范围选择" v-show="dialogData.formData.radioType === '0'">
<el-radio-group v-model="dialogData.formData.range" class="ml-4">
<el-radio label="0" size="large">所有项目类型</el-radio>
<el-radio label="1" size="large">部分项目类型</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="项目类型" v-show="dialogData.formData.radioType === '1'">
<el-radio-group v-model="dialogData.formData.projectType" class="ml-4">
<el-radio :label="item.id" size="large" v-for="(item, index) in list" :key="index">{{item.cname}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="项目类型" v-show="dialogData.formData.range === '1'">
<el-checkbox-group v-model="dialogData.formData.checkList1">
<el-checkbox :label="item.cname" v-for="(item, index) in list" :key="index"/>
</el-checkbox-group>
</el-form-item>
<el-form-item label="项目分类" v-show="dialogData.formData.radioType === '1'">
<el-checkbox-group v-model="dialogData.formData.checkList2">
<el-checkbox :label="item.cname" v-for="(item, index) in list" :key="index"/>
</el-checkbox-group>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogData.visible = false">取消</el-button>
<el-button type="primary" @click="dialogData.onConfirm"
>确定</el-button
>
</span>
</template>
</el-dialog>
</template>
<script lang="ts">
import { reactive } from 'vue'
export default {
name: 'ProjectMasterEdit',
props: {
list: {
type: Array,
default: null
}
},
setup(props, context) {
const dialogData = reactive({
visible: false,
formData: {
name: '',
bizUnits: '',
radioType: '0',
range: '0',
projectType: '',
checkList1: [],
checkList2: []
},
rules: {
name: {
required: true, message: '请输入模板名称', trigger: 'blur'
}
},
show: () => {
dialogData.visible = true
},
onConfirm: () => {
context.emit('onConfirm', dialogData.formData)
}
})
return {
dialogData
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<el-dialog v-model="dialogData.visible" title="配置阶段">
<el-table :data="master.templatePhases" style="width: 100%" height="400px">
<el-table-column label="阶段名称" width="400px">
<template #default="scope">
<div style="display: flex; align-items: center">
<el-input v-model="scope.row.label" placeholder="Please input" />
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="180px" align="center">
<template #default="scope">
<div style="display: flex; align-items: center; justify-content: center">
<el-button type="danger" size="small" @click="dialogData.deletePharse(scope.$index)">删除</el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="flex-center-h" style="margin-top: 10px">
<el-input v-model="dialogData.addInput" placeholder="输入阶段名称" style="width: 300px">
<template #prepend>
<el-icon><Plus /></el-icon>
</template>
</el-input>
<el-button type="primary" style="margin-left: 10px" @click="dialogData.addPhases">新增</el-button>
</div>
</el-dialog>
</template>
<script lang="ts">
import { reactive } from 'vue'
import { ElMessageBox, ElMessage } from 'element-plus'
export default {
name: 'TemplatePhases',
props: {
master: {
type: Object,
default: null
}
},
setup(props, context) {
const dialogData = reactive({
visible: false,
addInput: '',
show: () => {
dialogData.visible = true
},
addPhases: () => {
if (!dialogData.addInput) {
return false
}
props.master.templatePhases.push({
children: [],
data: null,
displayShow: null,
id: 1,
isLeaf: true,
label: dialogData.addInput,
selected: false,
text: '',
title: '',
value: '',
})
dialogData.addInput = ''
},
deletePharse: (index: number) => {
ElMessageBox.confirm('确定删除吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
props.master.templatePhases.splice(index, 1)
ElMessage({
type: 'success',
message: '删除成功',
})
})
}
})
return {
dialogData
}
}
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div class="app-container">
<Custom-table
:tableConfigData="tableConfigData"
>
</Custom-table>
</div>
</template>
<script lang="ts">
import { reactive } from 'vue'
import { projectListData } from './tableConfigData/projectList'
export default {
name: 'ProjectList',
setup() {
const tableConfigData = reactive(projectListData)
return { tableConfigData }
}
}
</script>
<style>
</style>
<template>
<el-dialog :model-value="props.showDialog"></el-dialog>
</template>
<script setup lang="ts">
interface Props {
showDialog:boolean
}
const props = withDefaults(defineProps<Props>(),{
showDialog:false
})
</script>
<style scoped></style>
\ No newline at end of file
<template>
<div class="app-container">
<div class="flex-center-h" style="margin-bottom: 20px">
<dropdown-check
v-model:modValue="projectMasterData.projectTypeSelect"
title="项目类型"
:list="projectMasterData.projectType"
prop="cname"
@onConfirm="projectMasterData.onConfirm"
/>
<dropdown-check
v-model:modValue="projectMasterData.projectTypeChildSelect"
title="项目子类"
:list="projectMasterData.projectType"
prop="cname"
@onConfirm="projectMasterData.onConfirm"
style="margin-left: 20px"
/>
<el-button type="primary" style="margin-left: 20px" size="small" @click="projectMasterData.showDialog">新建模板</el-button>
</div>
<div class="list" v-for="(item, index) in projectMasterData.list" :key="index">
<el-card class="box-card">
<template #header>
<div class="card-header space-between">
<div class="flex-center-h">
<el-icon style="margin-right: 10px"><CopyDocument /></el-icon>
<span style="margin-right: 10px">{{item.name}}</span>
<el-dropdown style="margin-right: 10px">
<span class="el-dropdown-link" style="color: #1890ff">
<el-icon><Setting /></el-icon>
操作
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="projectMasterData.showDialog(item.id)">编辑</el-dropdown-item>
<el-dropdown-item @click="projectMasterData.delete(item.id)">删除</el-dropdown-item>
<el-dropdown-item @click="projectMasterData.showDialog(item.id)">复制现有模板</el-dropdown-item>
<el-dropdown-item>复制现有项目</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<el-dropdown>
<span class="el-dropdown-link" style="color: #1890ff">
{{ item.isEnabled ? '停用' : '启用' }}
<el-icon class="el-icon--right">
<arrow-down />
</el-icon>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="item.isEnabled = false">启用</el-dropdown-item>
<el-dropdown-item @click="item.isEnabled = true">停用</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<div class="flex-center-h">
<el-link type="primary" link @click="projectMasterData.showPhases(item)">配置阶段</el-link>
<el-link type="primary" link @click="projectMasterData.showFolder(item.id)">配置文件夹</el-link>
<el-link type="primary" link @click="projectMasterData.showExpectDoc(item)">配置交付文档</el-link>
<el-link type="primary" link @click="projectMasterData.showPlan(item.id)">配置WBS计划</el-link>
<el-link type="primary" link @click="projectMasterData.showJudge(item)">评审配置</el-link>
</div>
</div>
<div style="width: 600px; margin-top: 10px;">
<el-descriptions :column="3">
<el-descriptions-item label="项目类型">全局模板</el-descriptions-item>
<el-descriptions-item label="事业部">{{item.bizUnit}}</el-descriptions-item>
<el-descriptions-item label="创建日期">{{item.createTime}}</el-descriptions-item>
</el-descriptions>
</div>
</template>
<el-steps :active="item.templatePhases.length" finish-status="success" simple>
<el-step v-for="(step, index) in item.templatePhases" :key="index" :title="step.label" />
</el-steps>
</el-card>
</div>
</div>
<project-master-edit ref="masterEdit" :list="projectMasterData.projectType" />
<template-phases ref="templatePhasesDialog" :master="projectMasterData.master" />
<folder ref="folderWrap" />
<expectDoc ref="expectDocWrap" :list="projectMasterData.expectDocList" />
<plan ref="planWrap" />
<judge ref="judgeWrap" :list="projectMasterData.master.templatePhases" />
</template>
<script lang="ts">
import { getTableList } from '@/services/api/customTable'
import { reactive, ref } from 'vue'
import DropDownCheck from './components/dropdownCheck.vue'
import ProjectMasterEdit from './components/projectMasterEdit.vue'
import TemplatePhases from './components/templatePhases.vue'
import Folder from './components/folder.vue'
import ExpectDoc from './components/expectDoc.vue'
import Plan from './components/plan.vue'
import Judge from './components/judge.vue'
import { ElMessageBox } from 'element-plus'
export default {
name: 'ProjectMaster',
components: {
'dropdown-check': DropDownCheck,
'project-master-edit': ProjectMasterEdit,
'template-phases': TemplatePhases,
'folder': Folder,
'expectDoc': ExpectDoc,
'plan': Plan,
'judge': Judge
},
setup() {
const masterEdit = ref() // 编辑组件
const templatePhasesDialog = ref() // 配置阶段组件
const folderWrap = ref() // 配置阶段组件
const expectDocWrap = ref()
const planWrap = ref()
const judgeWrap = ref()
const projectMasterData = reactive({
list: [],
projectType: [],
projectTypeSelect: [],
projectTypeChildSelect: [],
master: {},
expectDocList: [],
onConfirm: (key: string) => {
if (key === '项目类型') {
console.log(projectMasterData.projectTypeSelect)
} else {
console.log(projectMasterData.projectTypeChildSelect)
}
},
// 编辑模板
showDialog: (id?: string) => {
masterEdit.value.dialogData.show()
},
// 配置阶段
showPhases: (item: any) => {
projectMasterData.master = item
templatePhasesDialog.value.dialogData.show()
},
// 配置文件
showFolder: () => {
folderWrap.value.drawerData.show()
},
// 配置交付清单
showExpectDoc: (item: any) => {
expectDocWrap.value.drawerData.show(),
projectMasterData.expectDocList = item.templatePhases
},
// 打开计划
showPlan: () => {
planWrap.value.drawerData.show()
},
// 配置评审
showJudge: (item: any) => {
projectMasterData.master = item
judgeWrap.value.drawerData.show()
},
// 删除模板
delete: (id: string) => {
ElMessageBox.confirm('确定删除吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
})
}
})
const init = () => {
getTableList('project/projectMaster').then((res: any) => {
if (res.code === 200) {
console.log(res)
projectMasterData.list = res.data
}
})
getTableList('project/projectType').then((res: any) => {
if (res.code === 200) {
console.log('项目类型', res)
projectMasterData.projectType = res.data
}
})
}
init()
return {
projectMasterData,
masterEdit,
templatePhasesDialog,
folderWrap,
expectDocWrap,
planWrap,
judgeWrap
}
}
}
</script>
<style lang="scss" scoped>
.el-link{
margin-left: 10px;
}
</style>>
<template>
<div class="app-container">
<Custom-table
:tableConfigData="tableConfigData"
@handle-show="handleShow"
>
<template v-slot:drawer>
<el-form-item
v-for="(item, index) in editData"
:key="index"
:label="item.label"
:prop="item.prop"
>
<custom-form-item
v-model:modValue="tableConfigData.drawerformData[item.prop]"
:type="item.type"
:inputType="item.inputValue"
:options="tableData"
:selectProp="item.selectProp"
>
</custom-form-item>
</el-form-item>
</template>
</Custom-table>
</div>
</template>
<script lang="ts">
import { projectTypeData } from './tableConfigData/projectType'
import { Scope } from '@/table/type'
import { ref, Ref, reactive } from 'vue'
export default {
name: 'ProjectType',
setup() {
const tableConfigData = reactive(projectTypeData)
const tableData: Ref<any[]> = ref([])
const editData: Ref<any[]> = ref([])
tableConfigData.tableTitle.forEach(item => {
if (item.type) {
editData.value.push(item)
}
})
const handleShow = ref((params: { key: string, tableData: object[], scope?: Scope }) => {
tableData.value = params.tableData
const key = params.key
switch (key) {
case '新增':
tableConfigData.drawerformData = {
id: '',
cname: '',
ename: '',
code: '',
bizunits: '',
effect_time: '',
lose_effect_time: '',
detail: ''
}
break
case '编辑': {
if (!params.scope) return false
const row = params.scope.row
tableConfigData.drawerformData = {
id: row.id,
cname: row.cname,
ename: row.ename,
code: row.code,
bizunits: row.bizunit,
effect_time: row.effect_time,
lose_effect_time: row.lose_effect_time,
detail: row.detail
}
break
}
}
})
return {
tableConfigData,
handleShow,
tableData,
editData
}
}
}
</script>
<style>
</style>
import { TableConfigData } from "@/table/type";
const projectListData: TableConfigData = {
title: '项目',
tableTitle: [
{
label: '快捷',
prop: 'quick',
type: '',
viewType: 'module',
width: '80',
fixed: 'left'
},
{
label: '状态',
prop: 'delayLevelName',
type: '',
viewType: 'module',
width: '80',
fixed: 'left'
},
{
label: '项目编号',
prop: 'code',
type: '',
viewType: 'field',
fixed: 'left'
},
{
label: '项目名称',
prop: 'name',
type: '',
viewType: 'module',
width: '200',
fixed: 'left'
},
{
label: '项目经理',
prop: 'managerName',
type: '',
viewType: 'field',
width: '120'
},
{
label: '项目阶段',
prop: 'phase',
type: '',
viewType: 'field',
width: '120'
},
{
label: '项目状态',
prop: 'state',
type: '',
viewType: 'field',
width: '120'
}
],
drawerformData: {
},
btnObj: {
width: '100',
isAdd: false,
isDelete: false
},
apiKey: 'project',
tableApi: '/projectList',
dataKey: ''
}
export { projectListData }
import { TableConfigData } from "@/table/type";
const projectTypeData: TableConfigData = {
title: '事业部',
tableTitle: [
{
label: '项目类型',
prop: 'cname',
type: 'input'
},
{
label: '英文名称',
prop: 'ename',
type: 'input'
},
{
label: '编号',
prop: 'code',
type: 'input'
},
{
label: '适用事业部',
prop: 'bizunits',
type: 'input'
},
{
label: '生效时间',
prop: 'effect_time',
type: 'input'
},
{
label: '失效日期',
prop: 'lose_effect_time',
type: 'input'
},
{
label: '详细配置',
prop: 'detail',
type: 'input'
}
],
drawerformData: {
id: '',
cname: '',
ename: '',
code: '',
bizunits: '',
effect_time: '',
lose_effect_time: '',
detail: ''
},
rules: {
cname: [
{ required: true, message: '项目类型名称', trigger: 'blur' }
]
},
btnObj: {
width: '200',
isAdd: true,
isDelete: true
},
apiKey: 'project',
tableApi: '/projectType',
dataKey: ''
}
export { projectTypeData }
const projectListFormTitile = [
{
name: '快捷',
prop: ''
},
{
name: '项目名称',
prop: 'name'
},
{
name: '项目亮灯',
prop: 'progressLight'
},
{
name: '项目经理',
prop: 'managerName'
},
{
name: '项目阶段',
prop: 'phase'
},
{
name: '项目状态',
prop: 'state'
},
{
name: '项目进度',
prop: 'progress'
},
{
name: '项目类型',
prop: 'classificationName'
},
{
name: '计划开始',
prop: 'start'
},
{
name: '计划结束',
prop: 'finish'
},
{
name: '创建人',
prop: 'creatorName'
},
{
name: '创建时间',
prop: 'createTime'
},
{
name: '操作',
prop: 'operate'
},
]
\ No newline at end of file
<template>
<div class="router">
<!-- 查询区域 -->
<el-form :inline="true">
<el-form-item label="团队名称">
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script setup lang="ts">
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div class="router">
<el-row :gutter="5">
<el-col :span="12">
<el-card shadow="always" :body-style="{ padding: '20px' }">
<template #header>
<div class="card-header">我的部门</div>
</template>
<el-form :inline="true">
<el-form-item label="" >
<el-button type="primary" @click="handleAdd">添加部门</el-button>
<el-button type="primary">删除部门</el-button>
</el-form-item>
</el-form>
<el-input placeholder="请输入部门名称"></el-input>
<el-tree
:data="departmentList"
:props="treeProps"
show-checkbox
/>
</el-card>
</el-col>
<el-col :span="12">
<el-card shadow="always" :body-style="{ padding: '20px' }">
<el-tabs>
<el-tab-pane label="基本信息"></el-tab-pane>
<el-tab-pane label="部门权限"></el-tab-pane>
</el-tabs>
<el-empty description="请选择部门" />
</el-card>
</el-col>
</el-row>
<el-dialog v-model="showDialog" :title="dialogTitle">
<el-card>
<el-form ref="form">
<el-form-item prop="departmentName" label="部门名称">
<el-input></el-input>
</el-form-item>
<el-form-item prop="departmentType" label="部门类型">
<el-input></el-input>
</el-form-item>
</el-form>
</el-card>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const treeProps = ref({
label:'label',
children:'children'
})
const showDialog = ref(false)
let departmentList = ref([
{
label:'平田宅邸',
children:[
{
label:'凤凰城'
}
]
}
])
let dialogTitle = ref('')
function handleAdd(){
dialogTitle.value = '添加部门'
showDialog.value = true
}
</script>
<style scoped>
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
\ No newline at end of file
......@@ -33,7 +33,7 @@ const props = defineProps({
}
})
const emit = defineEmits(['close-drawer', 'init'])
let formData = reactive({})
let formData = reactive<any>({})
const rules = reactive<FormRules>({
title: [{ required: true, message: '请输入菜单名称', trigger: 'blur' }],
path: [{ required: true, message: '请输入菜单路径', trigger: 'blur' }],
......
import { TableConfigData } from "@/table/type";
const menuConfigData: TableConfigData = {
title: '菜单',
title: "菜单",
tableTitle: [
{
label: '菜单名称',
prop: 'title',
type: 'input'
label: "菜单名称",
prop: "title",
type: "input",
},
{
label: '菜单类型',
prop: 'type',
type: 'radio'
label: "菜单类型",
prop: "type",
type: "radio",
},
{
label: '上级菜单',
prop: 'parentId',
type: 'select',
label: "上级菜单",
prop: "parentId",
type: "select",
selectProp: {
value: 'id',
label: 'title'
}
value: "id",
label: "title",
},
},
{
label: 'icon',
prop: 'icon',
type: 'input'
label: "icon",
prop: "icon",
type: "input",
},
{
label: '组件',
prop: 'component',
type: 'input'
label: "组件",
prop: "component",
type: "input",
},
{
label: '路径',
prop: 'path',
type: 'input'
label: "路径",
prop: "path",
type: "input",
},
/* {
label: '控制器',
prop: 'apiKey',
type: 'input',
hidden: true
},
{
label: '是否显示',
prop: 'is_show',
type: 'switch',
hidden: true
}, */
{
label: '排序',
prop: 'sortNo',
type: 'input',
inputType: 'number'
}
label: "排序",
prop: "sortNo",
type: "input",
inputType: "number",
},
],
drawerformData: {
id: '',
id: "",
type: 0,
title: '',
component: '',
path: '',
title: "",
component: "",
path: "",
sortNo: 0,
apiKey: '',
parentId: '',
icon: '',
is_show: true
apiKey: "",
parentId: "",
icon: "",
is_show: true,
},
rules: {
title: [
{ required: true, message: '请输入菜单名称', trigger: 'blur' }
],
component: [
{ required: true, message: '请输入菜单组件', trigger: 'blur' }
],
path: [
{ required: true, message: '请输入菜单路径', trigger: 'blur' }
],
apiKey: [
{ required: true, message: '请输入接口路径', trigger: 'blur' }
]
title: [{ required: true, message: "请输入菜单名称", trigger: "blur" }],
component: [{ required: true, message: "请输入菜单组件", trigger: "blur" }],
path: [{ required: true, message: "请输入菜单路径", trigger: "blur" }],
apiKey: [{ required: true, message: "请输入接口路径", trigger: "blur" }],
},
btnObj: {
width: '200',
width: "200",
isAdd: true,
isDelete: true
isDelete: true,
},
apiKey: 'permission',
tableApi: '/getMenuTree',
dataKey: ''
}
apiKey: "permission",
tableApi: "/getMenuTree",
dataKey: "",
};
export { menuConfigData }
export { menuConfigData };
<template>
<div class="router">
<!-- 查询区域 -->
<el-form :inline="true">
<el-form-item v-for="i in queryList" :label="i.label">
<el-input v-if="i.type == 'input'" v-model="i.value"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
</el-form-item>
</el-form>
<!-- 操作区域 -->
<el-form>
<el-form-item>
<el-button v-for="b in buttonList" type="primary" @click="handleButton(b.prop)">{{b.label}}</el-button>
</el-form-item>
</el-form>
<!-- 表格区域 -->
<el-table :data="tableData" border>
<el-table-column type="selection"></el-table-column>
<el-table-column v-for="c in tableColumn" :prop="c.prop" :label="c.label"></el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="text">编辑</el-button>
<el-popconfirm title="确定删除吗?">
<template #reference>
<el-button type="text">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<!-- 表单输入区域 -->
<el-dialog v-model="showDialog"></el-dialog>
</div>
</template>
<script setup lang="ts">
import {reactive,ref} from "vue";
import {queryTable} from '@/services/api/table/tableAPI'
let tableData = ref()
let showDialog = ref(false)
const queryList = ref([
{
label:'表名',
type:'input',
value:''
},
{
label:'表类型',
type:'input',
value:''
},
{
label:'表描述',
type:'input',
value:''
},
])
const buttonList = ref([
{
label:'新增',
prop:'add'
}
])
const tableColumn = ref([
{
prop:'fname',
label:'表名'
}
])
function init() {
queryTable().then((res) => {
tableData.value = res.data.records
})
}
function handleButton(param:string){
if(param == 'add'){
showDialog.value = true
}
}
init()
</script>
<style scoped>
</style>
<template>
<div class="app-container">
<Custom-table
title="菜单"
isAdd
>
</Custom-table>
</div>
</template>
<script lang="ts">
export default {
name: 'Index'
}
</script>
<style lang="scss">
</style>
<template>TASK list</template>
<script setup lang="ts">
</script>
<style></style>
\ No newline at end of file
<template>
<div class="kingdeelog-container">
</div>
</template>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论