项目书 合作单位 功能添加 10.21

master
zhc077 1 month ago
parent b1a2dee3a0
commit 2cc5fc767f
  1. 97
      jeecgboot-vue3/src/views/cooperationDepart/CooperationDepart.data.ts
  2. 395
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/HeZuoDanWeiDemo.vue
  3. 3
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/xiangmushu/index.vue

@ -1,26 +1,22 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
import {BasicColumn, FormSchema} from '/@/components/Table';
//
export const columns: BasicColumn[] = [
{
title: '区域',
align:"center",
dataIndex: 'area_dictText'
},
{
title: '单位名称 ',
align:"center",
align: "center",
dataIndex: 'cooperationDepartName'
},
{
title: '主管部门',
align:"center",
align: "center",
dataIndex: 'competentDepartName'
},
{
title: '所属区域',
align: "center",
dataIndex: 'area_dictText'
},
/*{
title: '单位性质',
align:"center",
dataIndex: 'category_dictText'
@ -29,10 +25,10 @@ export const columns: BasicColumn[] = [
title: '企业登记注册类型',
align:"center",
dataIndex: 'departType_dictText',
},
},*/
{
title: '统一社会信用代码',
align:"center",
align: "center",
dataIndex: 'creditCode',
},
/*{
@ -46,12 +42,12 @@ export const columns: BasicColumn[] = [
},*/
{
title: '联系人',
align:"center",
align: "center",
dataIndex: 'linkmanName'
},
{
title: '手机',
align:"center",
align: "center",
dataIndex: 'linkmanPhone'
},
/* {
@ -61,16 +57,15 @@ export const columns: BasicColumn[] = [
},*/
];
//
export const searchFormSchema: FormSchema[] = [
];
export const searchFormSchema: FormSchema[] = [];
//
export const formSchema: FormSchema[] = [
{
label: '区域',
field: 'area',
component: 'JDictSelectTag',
componentProps:{
dictCode:"cooperation_depart_area"
componentProps: {
dictCode: "cooperation_depart_area"
},
},
{
@ -87,16 +82,16 @@ export const formSchema: FormSchema[] = [
label: '单位性质',
field: 'category',
component: 'JDictSelectTag',
componentProps:{
dictCode:"depart_category"
componentProps: {
dictCode: "depart_category"
},
},
{
label: '企业登记注册类型',
field: 'type',
field: 'departType',
component: 'JDictSelectTag',
componentProps:{
dictCode:"depart_type"
componentProps: {
dictCode: "depart_type"
},
},
{
@ -121,10 +116,10 @@ export const formSchema: FormSchema[] = [
label: '手机',
field: 'linkmanPhone',
component: 'Input',
dynamicRules: ({model,schema}) => {
dynamicRules: ({model, schema}) => {
return [
{ required: false},
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},
{required: false},
{pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},
];
},
},
@ -132,10 +127,10 @@ export const formSchema: FormSchema[] = [
label: '电子邮箱',
field: 'linkmanEmail',
component: 'Input',
dynamicRules: ({model,schema}) => {
dynamicRules: ({model, schema}) => {
return [
{ required: false},
{ pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!'},
{required: false},
{pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!'},
];
},
},
@ -150,23 +145,35 @@ export const formSchema: FormSchema[] = [
//
export const superQuerySchema = {
area: {title: '区域',order: 0,view: 'list', type: 'string',dictCode: 'cooperation_depart_area',},
cooperationDepartName: {title: '单位名称 ',order: 1,view: 'text', type: 'string',},
competentDepartName: {title: '主管部门',order: 2,view: 'text', type: 'string',},
category: {title: '单位性质',order: 3,view: 'list', type: 'string',dictCode: 'depart_category',},
type: {title: '企业登记注册类型',order: 4,view: 'text', type: 'string',},
creditCode: {title: '统一社会信用代码',order: 4,view: 'text', type: 'string',},
registerDate: {title: '注册时间',order: 5,view: 'date', type: 'string',},
linkmanName: {title: '联系人',order: 6,view: 'text', type: 'string',},
linkmanPhone: {title: '手机',order: 7,view: 'text', type: 'string',},
linkmanEmail: {title: '电子邮箱',order: 8,view: 'text', type: 'string',},
area: {
title: '区域',
order: 0,
view: 'list',
type: 'string',
dictCode: 'cooperation_depart_area',
},
cooperationDepartName: {title: '单位名称 ', order: 1, view: 'text', type: 'string',},
competentDepartName: {title: '主管部门', order: 2, view: 'text', type: 'string',},
category: {
title: '单位性质',
order: 3,
view: 'list',
type: 'string',
dictCode: 'depart_category',
},
departType: {title: '企业登记注册类型', order: 4, view: 'text', type: 'string',},
creditCode: {title: '统一社会信用代码', order: 4, view: 'text', type: 'string',},
registerDate: {title: '注册时间', order: 5, view: 'date', type: 'string',},
linkmanName: {title: '联系人', order: 6, view: 'text', type: 'string',},
linkmanPhone: {title: '手机', order: 7, view: 'text', type: 'string',},
linkmanEmail: {title: '电子邮箱', order: 8, view: 'text', type: 'string',},
};
/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[] {
// formSchema
return formSchema;
}

@ -0,0 +1,395 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增
</a-button>
<!-- <a-button type="primary" v-auth="'cooperationdepart:cooperation_depart:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'cooperationdepart:cooperation_depart:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'cooperationdepart:cooperation_depart:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>-->
<!-- 高级查询 -->
<!-- <super-query :config="superQueryConfig" @search="handleSuperQuery" />-->
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"
:dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<CooperationDepartModal @register="registerModal"
@success="handleSuccess"></CooperationDepartModal>
</div>
</template>
<script lang="ts" name="cooperationdepart-cooperationDepart" setup>
import {reactive, ref} from 'vue';
import {BasicTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import {useListPage} from '/@/hooks/system/useListPage'
import CooperationDepartModal from '/@/views/cooperationDepart/components/CooperationDepartModal.vue'
import {columns, searchFormSchema, superQuerySchema} from '/@/views/cooperationDepart/CooperationDepart.data';
import {batchDelete, deleteOne, getExportUrl, getImportUrl, list} from '/@/views/cooperationDepart/CooperationDepart.api';
import {useUserStore} from '/@/store/modules/user';
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
//model
const [registerModal, {openModal}] = useModal();
//table
const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({
tableProps: {
title: '合作单位',
api: list,
columns,
canResize: false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [],
fieldMapToTime: [],
},
actionColumn: {
width: 120,
fixed: 'right'
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "合作单位",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload}, {rowSelection, selectedRowKeys}] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
// auth: 'cooperationdepart:cooperation_depart:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
// auth: 'cooperationdepart:cooperation_depart:delete'
}
]
}
</script>
<style lang="less" scoped>
:deep(.ant-picker), :deep(.ant-input-number) {
width: 100%;
}
</style>
<!--
<template>
<div>
&lt;!&ndash;引用表格&ndash;&gt;
<BasicTable @register="registerTable" :rowSelection="rowSelection">
&lt;!&ndash;插槽:table标题&ndash;&gt;
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
</template>
&lt;!&ndash;操作栏&ndash;&gt;
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />
</template>
&lt;!&ndash;字段回显插槽&ndash;&gt;
<template v-slot:bodyCell="{ column, record, index, text }"></template>
</BasicTable>
&lt;!&ndash; 表单区域 &ndash;&gt;
<CooperationDepartModal @register="registerModal" @success="handleSuccess"></CooperationDepartModal>
</div>
&lt;!&ndash; <div type="primary" class="button-container">
<a-button @click="goBack">返回 </a-button>
</div>&ndash;&gt;
</template>
<script lang="ts" name="cooperationdepart-cooperationDepart" setup>
import {reactive, ref} from 'vue';
import {BasicTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import {useListPage} from '/@/hooks/system/useListPage'
import CooperationDepartModal from '/@/views/cooperationDepart/components/CooperationDepartModal.vue'
import {columns,searchFormSchema,superQuerySchema} from '/@/views/cooperationDepart/CooperationDepart.data';
import {
batchDelete,
deleteOne,
getExportUrl,
getImportUrl,
list
} from '@/views/cooperationDepart/CooperationDepart.api';
import {useUserStore} from '/@/store/modules/user';
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
const userStore = useUserStore();
// import { useRouter } from 'vue-router';
//model
const [registerModal, {openModal}] = useModal();
//table
const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({
tableProps: {
title: '合作单位',
api: list,
columns,
canResize: false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: true,
fieldMapToNumber: [],
fieldMapToTime: [],
},
actionColumn: {
width: 120,
fixed: 'right'
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "合作单位",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload}, {rowSelection, selectedRowKeys}] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
// const { back } = useRouter();
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
// auth: 'cooperationdepart:cooperation_depart:edit'
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
// auth: 'cooperationdepart:cooperation_depart:delete'
}
]
}
// function goBack(){
// back();
// };
</script>
<style lang="less" scoped>
:deep(.ant-picker), :deep(.ant-input-number) {
width: 100%;
}
</style>
-->

@ -4,6 +4,7 @@
<a-tabs v-model:activeKey="activeKey" @change="tabChange">
<a-tab-pane key="TianBaoShuMingDemo" tab="填报说明" force-render></a-tab-pane>
<a-tab-pane key="XiangMuHeZuoKaiFaDemo" tab="项目合作开发情况"></a-tab-pane>
<a-tab-pane key="HeZuoDanWeiDemo" tab="合作单位"></a-tab-pane>
<a-tab-pane key="JeecgComponents" tab="下拉选择组件"></a-tab-pane>
<a-tab-pane key="JEditorDemo" tab="富文本&MakeDown"></a-tab-pane>
<a-tab-pane key="ImgDragSort" tab="图片拖拽"></a-tab-pane>
@ -25,6 +26,7 @@
import JeecgComponents from './JeecgComponents.vue';
import TianBaoShuMingDemo from './TianBaoShuMingDemo.vue';
import YiJianDemo from './YiJianDemo.vue';
import HeZuoDanWeiDemo from './HeZuoDanWeiDemo.vue';
import XiangMuHeZuoKaiFaDemo from './XiangMuHeZuoKaiFaDemo.vue';
import ImgDragSort from './ImgDragSort.vue';
import ImgTurnPage from './ImgTurnPage.vue';
@ -43,6 +45,7 @@
TianBaoShuMingDemo: TianBaoShuMingDemo,
XiangMuHeZuoKaiFaDemo: XiangMuHeZuoKaiFaDemo,
YiJianDemo: YiJianDemo,
HeZuoDanWeiDemo: HeZuoDanWeiDemo,
JeecgComponents: JeecgComponents,
JEditorDemo: JEditorDemo,
ImgDragSort: ImgDragSort,

Loading…
Cancel
Save