Commit cb0d63df authored by LiXuyang's avatar LiXuyang

Merge remote-tracking branch 'origin/master'

parents dad997a7 8887da59
<template>
<BasicModal width="50%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicModal
width="50%"
v-bind="$attrs"
@register="registerModal"
:title="getTitle"
@ok="handleSubmit"
>
<BasicTable @register="registerTable"></BasicTable>
</BasicModal>
</template>
<script lang="ts" setup>
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue';
import { reactive, unref, onDeactivated, onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { useMessage } from '@/hooks/web/useMessage';
import { useModal } from '@/components/Modal';
import {addUserData, columns, searchFormSchema, TreeData} from './institutionData';
import { addUserData, columns, searchFormSchema, TreeData } from './institutionData';
import { useGo } from '@/hooks/web/usePage';
import { downloadByData } from '@/utils/file/download';
import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { useRoute, onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData';
import {useUserStore} from "@/store/modules/user";
import { userData } from "@/views/dataSharingAndExchange/catalogingManagement/institutionData";
import { useUserStore } from '@/store/modules/user';
import { userData } from '@/views/dataSharingAndExchange/catalogingManagement/institutionData';
defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const go = useGo();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const emit = defineEmits(['success', 'register']);
const tableData = ref([])
const isAdd = ref(true)
const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,getRowSelection }] = useTable({
defineOptions({ name: 'AccountManagement' });
const { createMessage } = useMessage();
const filterStore = useFilterStore();
const route = useRoute();
const go = useGo();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const emit = defineEmits(['success', 'register']);
const tableData = ref([]);
const isAdd = ref(true);
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
] = useTable({
title: '添加编目',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
pageNu: '1',
pageSize: '10',
pages: '1',
total: tableData.value.length,
code:'',
message:'',
code: '',
message: '',
data: [],
};
var data = []
data = tableData.value
if (params.name != undefined && params.name != '' && params.name != null){
var data = [];
data = tableData.value;
if (params.name != undefined && params.name != '' && params.name != null) {
//过滤出名字包含params.name的数据
data = data.filter((item) => item.name.includes(params.name));
}
if (params.username != undefined && params.username != '' && params.username != null){
if (params.username != undefined && params.username != '' && params.username != null) {
data = data.filter((item) => item.username.includes(params.username));
}
return { ...response, data: data };
......@@ -65,7 +74,7 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,get
handleSearchInfoFn(info) {
return info;
},
});
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
......@@ -73,23 +82,20 @@ const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,get
isAdd.value = !!data?.isAdd;
});
/** 新增成功*/
function handleSubmit() {
/** 新增成功*/
function handleSubmit() {
const rowSelection = getRowSelection().selectedRowKeys;
if (rowSelection.length>0){
if (rowSelection.length > 0) {
//已选中
//根据选中的查询用户 然后进行添加
let data = []
let data = [];
data = tableData.value.filter((item) => rowSelection.includes(item.businessId));
emit('success', { isAdd: unref(isAdd), values: { ...data },length: rowSelection.length });
emit('success', { isAdd: unref(isAdd), values: { ...data }, length: rowSelection.length });
closeModal();
}
}
onMounted(() => {
}
tableData.value = addUserData
});
onMounted(() => {
tableData.value = addUserData;
});
</script>
......@@ -45,9 +45,9 @@
</PageWrapper>
</template>
<script lang="ts" setup>
import { reactive,unref,onDeactivated,onMounted,ref } from 'vue';
import { reactive, unref, onDeactivated, onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import {getAccountList, deleteUser,exportUserList} from '@/api/system/user/user';
import { getAccountList, deleteUser, exportUserList } from '@/api/system/user/user';
import { PageWrapper } from '@/components/Page';
import DeptTree from './DeptTree.vue';
import { useMessage } from '@/hooks/web/useMessage';
......@@ -58,14 +58,14 @@
import { columns, searchFormSchema } from './institution.data';
import { useGo } from '@/hooks/web/usePage';
import { downloadByData } from '@/utils/file/download';
import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { useRoute, onBeforeRouteLeave } from 'vue-router';
import { useFilterStore } from '@/store/modules/filterData';
import {useUserStore} from "@/store/modules/user";
import {getMenuListByPage} from "@/api/system/menu/menu";
import { userData } from "@/views/dataSharingAndExchange/catalogingManagement/institutionData";
import { useUserStore } from '@/store/modules/user';
import { getMenuListByPage } from '@/api/system/menu/menu';
import { userData } from '@/views/dataSharingAndExchange/catalogingManagement/institutionData';
import AddUserModal from './AddUserModal.vue';
import user from "../../../../mock/sys/user";
import {forEach} from "lodash-es";
import user from '../../../../mock/sys/user';
import { forEach } from 'lodash-es';
defineOptions({ name: 'AccountManagement' });
const { createMessage, createConfirm } = useMessage();
......@@ -73,36 +73,39 @@
const route = useRoute();
const go = useGo();
const [registerModal, { openModal }] = useModal();
const [registerAddUserModal, { openModal:addUserModal }] = useModal();
const [registerAddUserModal, { openModal: addUserModal }] = useModal();
const [registerMoveUser, { openModal: openMoveUserModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const tableData = ref([])
const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,getRowSelection }] = useTable({
const tableData = ref([]);
const [
registerTable,
{ reload, updateTableDataRecord, getSearchInfo, getForm, getRowSelection },
] = useTable({
title: '编目管理列表',
api: async (params) => {
console.log(params)
console.log(params);
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
pageNu: '1',
pageSize: '10',
pages: '1',
total: tableData.value.length,
code:'',
message:'',
code: '',
message: '',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
var data = []
var data = [];
//按照部门筛选 如果有进行过滤相应部门的 没有就赋值全部
if (params.institutionId != undefined && params.institutionId != ''){
if (params.institutionId != undefined && params.institutionId != '') {
data = tableData.value.filter((item) => item.institutionId === params.institutionId);
} else {
data = tableData.value
data = tableData.value;
}
if (params.name != undefined && params.name != '' && params.name != null){
if (params.name != undefined && params.name != '' && params.name != null) {
//过滤出名字包含params.name的数据
data = data.filter((item) => item.name.includes(params.name));
}
if (params.username != undefined && params.username != '' && params.username != null){
if (params.username != undefined && params.username != '' && params.username != null) {
data = data.filter((item) => item.username.includes(params.username));
}
return { ...response, data: data };
......@@ -115,7 +118,7 @@
schemas: searchFormSchema,
autoSubmitOnEnter: true,
resetFunc: () => {
searchInfo.institutionId=''
searchInfo.institutionId = '';
},
},
useSearchForm: true,
......@@ -137,14 +140,14 @@
isAdd: true,
});
}
function updateData(){
console.log()
function updateData() {
console.log();
}
/**批量移动*/
function handleMoveBatch() {
const rowSelection = getRowSelection().selectedRowKeys;
openMoveUserModal(true, {
idList:rowSelection,
idList: rowSelection,
isMove: true,
});
}
......@@ -164,7 +167,7 @@
isAdd: true,
});
}
/** 编辑按钮*/
/** 编辑按钮*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
......@@ -180,8 +183,11 @@
content: '确认批量删除选中数据吗?',
onOk() {
const rowSelection = getRowSelection().selectedRowKeys;
for (let i = 0; i < rowSelection.length; i++){
tableData.value.splice(tableData.value.findIndex(item => item.businessId === rowSelection[i]), 1);
for (let i = 0; i < rowSelection.length; i++) {
tableData.value.splice(
tableData.value.findIndex((item) => item.businessId === rowSelection[i]),
1,
);
}
createMessage.success('删除成功!');
reload();
......@@ -191,14 +197,17 @@
/** 删除按钮*/
function handleDelete(record: Recordable) {
tableData.value.splice(tableData.value.findIndex(item => item.businessId === record.businessId), 1);
tableData.value.splice(
tableData.value.findIndex((item) => item.businessId === record.businessId),
1,
);
createMessage.success('删除成功!');
reload();
}
/** 导出按钮*/
async function handleExport() {
const params = Object.assign({},getSearchInfo(),getForm().getFieldsValue());
const params = Object.assign({}, getSearchInfo(), getForm().getFieldsValue());
const data = await exportUserList(params);
downloadByData(data, '用户列表' + '.xlsx');
}
......@@ -216,7 +225,7 @@
const result = updateTableDataRecord(values.businessId, values);
reload();
} else {
tableData.value.push(values)
tableData.value.push(values);
reload();
}
}
......@@ -224,12 +233,12 @@
/** 移动*/
function handleMoveSuccess({ isMove, values }) {
const rowSelection = getRowSelection().selectedRowKeys;
if (rowSelection.length > 0){
if (rowSelection.length > 0) {
//批量移动
for (let i = 0; i < rowSelection.length; i++){
for (let i = 0; i < rowSelection.length; i++) {
const result = updateTableDataRecord(values[i].institutionId, values[i]);
}
}else {
} else {
//单个移动
const result = updateTableDataRecord(values.businessId, values);
}
......@@ -237,11 +246,11 @@
}
/** 添加用户*/
function handleAddSuccess({ isAdd, values,length }) {
if (length > 0){
function handleAddSuccess({ isAdd, values, length }) {
if (length > 0) {
//批量添加
for (let i = 0; i < length; i++){
tableData.value.push(values[i])
for (let i = 0; i < length; i++) {
tableData.value.push(values[i]);
}
}
reload();
......@@ -258,31 +267,29 @@
}
onMounted(() => {
tableData.value = userData
const path = route.path
if(filterStore.getSearchParams[path]) {
if(JSON.parse(filterStore.getSearchParams[path] !== {})){
const params = JSON.parse(filterStore.getSearchParams[path])
tableData.value = userData;
const path = route.path;
if (filterStore.getSearchParams[path]) {
if (JSON.parse(filterStore.getSearchParams[path] !== {})) {
const params = JSON.parse(filterStore.getSearchParams[path]);
getForm().setFieldsValue({
page: params.page,
pageSize: params.pageSize,
username: params.username,
flag: params.flag,
})
searchInfo.institutionId = params.institutionId
});
searchInfo.institutionId = params.institutionId;
}
}
});
onBeforeRouteLeave((to, from, next) => {
const params = Object.assign({},getSearchInfo(),getForm().getFieldsValue());
filterStore.setSearchParams(
{
const params = Object.assign({}, getSearchInfo(), getForm().getFieldsValue());
filterStore.setSearchParams({
path: from.path,
param: {
...params
}
}
)
...params,
},
});
next(); // 允许导航
});
</script>
<template>
<div style="background: white; padding: 20px">
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex" style="padding: 20px">
<PageWrapper
dense
contentFullHeight
fixedHeight
contentClass="flex flex-col"
class="toolbar"
style="width: 910px"
<BasicModal
:canFullscreen="false"
width="50%"
v-bind="$attrs"
@register="registerModal"
:showCancelBtn="false"
:showOkBtn="false"
:title="title"
>
<template #closeIcon>
<span></span>
</template>
<template #title>
<div class="toolbar">
<div style="display: flex; align-items: center; justify-content: space-between; width: 100%;">
<h1 style="margin-top: 15px">{{ title }}</h1>
<div style="display: flex; gap: 15px;">
<a-button type="primary" @click="goBack">取消</a-button>
<a-button type="primary">申请检测</a-button>
<a-button
type="primary"
@click="submitForm"
<div
style="display: flex; align-items: center; justify-content: space-between; width: 100%"
>
提交申请
</a-button>
<h3 style="margin-top: 15px">{{ title }}</h3>
<div style="display: flex; gap: 15px">
<a-button type="primary" @click="closeModal">取消</a-button>
<a-button type="primary">申请检测</a-button>
<a-button type="primary" @click="submitForm"> 提交申请 </a-button>
</div>
</div>
</div>
<hr style="border: 1px solid #dee3f0; width: 100%; margin: 20px auto" />
</template>
<p style="margin: 35px; color: #1b8bf8; font-weight: bold">申请信息</p>
<BasicForm size="middle" :bordered="false" :column="2" @register="registerGuideModeForm" />
<p style="margin: 35px; color: #1b8bf8; font-weight: bold">推送配置</p>
<p style="color: #1b8bf8; font-weight: bold">申请信息</p>
<BasicForm
class="bf1"
size="middle"
:bordered="false"
:column="2"
@register="registerGuideModeForm"
/>
<p style="color: #1b8bf8; font-weight: bold">推送配置</p>
<BasicForm
class="bf2"
size="middle"
:bordered="false"
:column="2"
@register="pushConfigurationModeForm"
/>
</PageWrapper>
</PageWrapper>
</div>
</BasicModal>
</template>
<script lang="ts" setup>
import { PageWrapper } from '@/components/Page';
import { BasicModal, useModalInner } from '@/components/Modal';
import { personSchema, pushConfiguration } from './mock';
import { ref } from 'vue';
import { BasicForm, useForm } from '@/components/Form';
import {useMessage} from "@/hooks/web/useMessage";
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false });
});
const title = ref('申请推送<wyx_contact>等1个资源');
const [registerGuideModeForm,{validate,getFieldsValue: getFieldsValueValiate,}] = useForm({
const [registerGuideModeForm, { validate, getFieldsValue: getFieldsValueValiate }] = useForm({
labelWidth: 100,
labelAlign: 'right',
schemas: personSchema,
showActionButtonGroup: false,
actionColOptions: {
......@@ -59,9 +68,12 @@
},
});
const [pushConfigurationModeForm,{validate: validatePushConfig,getFieldsValue: getFieldsValueValiateL,}] = useForm({
const [
pushConfigurationModeForm,
{ validate: validatePushConfig, getFieldsValue: getFieldsValueValiateL },
] = useForm({
labelWidth: 100,
labelAlign: 'right',
schemas: pushConfiguration,
showActionButtonGroup: false,
actionColOptions: {
......@@ -69,29 +81,18 @@
},
});
// 提交表单的方法
const submitForm = () => {
validate()
validate();
validatePushConfig()
.then(() => {
console.log(getFieldsValueValiate(),getFieldsValueValiateL());
console.log(getFieldsValueValiate(), getFieldsValueValiateL());
createMessage.success(`表单已提交`);
})
.catch(() => {
createMessage.error(`请输入必填项`);
});
};
const goBack = () => {
window.history.back();
};
</script>
<style scoped></style>
<style lang="less" scoped></style>
......@@ -146,6 +146,7 @@
show-quick-jumper
/>
</PageWrapper>
<ApplyForPushNotificationsModal @register="registerApplyForPushNotificationsModal" />
</div>
</template>
......@@ -173,6 +174,8 @@
import GroupTree from './GroupTree.vue';
import { Columns } from '@/views/mallResourceDevelopment/dataSet/commonDataSet/commonDataSet.data';
import { router } from '@/router';
import { useModal } from '@/components/Modal';
import ApplyForPushNotificationsModal from '@/views/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal.vue';
const { createMessage, createConfirm } = useMessage();
const route = useRouter();
......@@ -200,6 +203,11 @@
},
]);
const [
registerApplyForPushNotificationsModal,
{ openModal: openApplyForPushNotificationsModal },
] = useModal();
const [registerTable, { reload, getRowSelection }] = useTable({
api: async () => {
let filteredList = cardList.filter((item) => {
......@@ -215,7 +223,7 @@
workSpaceName.value === '' ||
workSpaceName.value === '公共数据集' ||
item.parentWorkSpaceName === workSpaceName.value;
return titleMatch && shareMatch && workspaceMatch;
return titleMatch.value && shareMatch && workspaceMatch;
});
if (sortOrder.value === 'latest') {
filteredList.sort(
......@@ -327,10 +335,11 @@
/**批量推送推送*/
function pushNotifications() {
router.push({
path: '/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal',
query: {},
});
openApplyForPushNotificationsModal(true);
// router.push({
// path: '/mallResourceDevelopment/dataSet/commonDataSet/applyForPushNotificationsModal',
// query: {},
// });
}
function onSearch() {
......
import {FormSchema} from "@/components/Form";
import { FormSchema } from '@/components/Form';
export const tableList: any[] = [
{
......@@ -400,7 +400,6 @@ export const cardList = [
},
];
export const columnInformationList: any[] = [
{
businessId: 1,
......@@ -492,56 +491,50 @@ export const columnInformationList: any[] = [
},
];
export const treeDataList = [
{
name: '资源信息',
selectedDeptId: 21,
children: [
],
children: [],
},
{
name: '列信息',
selectedDeptId: 22,
children: [
],
children: [],
},
{
name: '采样数据',
selectedDeptId: 23,
children: [
],
children: [],
},
];
/** 推送*/
export const personSchema: FormSchema[] = [
{
field: 'titleApplication',
component: 'Input',
colProps: { lg: 11, md: 11 },
colProps: { lg: 12, md: 12 },
label: '申请标题',
componentProps: {
placeholder: '请输入标题',
},
required: true,
},
{
field: 'reasonForApplication',
component: 'Input',
colProps: { lg: 11, md: 11 },
colProps: { lg: 12, md: 12 },
label: '申请理由',
componentProps: {
placeholder: '请输入申请理由',
},
},
];
/** 推送*/
export const pushConfiguration: FormSchema[] = [
{
field: 'whetherToAutomaticallyCreateATable',
component: 'Switch',
colProps: { lg: 22, md: 22 },
......@@ -555,17 +548,17 @@ export const pushConfiguration: FormSchema[] = [
componentProps: {
options: [
{
label: '18inceptor(商场工作区)',
value: '1'
label: '18interceptor(商场工作区)',
value: '1',
},
{
label: '19inceptor(商场工作区)',
value: '2'
label: '19interceptor(商场工作区)',
value: '2',
},
],
placeholder: '18inceptor(商场工作区)',
placeholder: '请选择目标数据源',
},
colProps: { span: 11 },
colProps: { span: 12 },
},
{
field: 'database',
......@@ -577,9 +570,9 @@ export const pushConfiguration: FormSchema[] = [
{ label: 'dataset_push', value: '1' },
{ label: 'dataset', value: '2' },
],
placeholder: 'dataset_push',
placeholder: '请选择数据库',
},
colProps: { span: 11 },
colProps: { span: 12 },
},
{
field: 'pushCycle',
......@@ -598,9 +591,9 @@ export const pushConfiguration: FormSchema[] = [
{ label: '十二周期', value: '8' },
{ label: '二十四周期', value: '9' },
],
placeholder: '周期',
placeholder: '请选择周期',
},
colProps: { span: 11 },
colProps: { span: 12 },
},
{
field: 'HDFSDataSource',
......@@ -612,9 +605,9 @@ export const pushConfiguration: FormSchema[] = [
{ label: 'hdfs', value: '1' },
{ label: 'hdfsE', value: '2' },
],
placeholder: 'hdfs',
placeholder: '请选择HDFS数据源',
},
colProps: { span: 11 },
colProps: { span: 12 },
},
{
......@@ -634,9 +627,8 @@ export const pushConfiguration: FormSchema[] = [
label: '目标端',
value: '2',
},
],
placeholder: '请选择使用资源',
},
},
];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment