feat: 样式修改和政务管理全选,加接口loading
This commit is contained in:
parent
ddd33ae0c7
commit
6ae15e8667
@ -6,7 +6,7 @@
|
||||
"author": "SpicyBoy <848130454@qq.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "vite --mode production",
|
||||
"dev": "vite --mode development",
|
||||
"serve": "vite",
|
||||
"build:dev": "vue-tsc --noEmit && vite build --mode development",
|
||||
"build:test": "vue-tsc --noEmit && vite build --mode test",
|
||||
|
||||
42
src/Test.vue
42
src/Test.vue
@ -1,42 +0,0 @@
|
||||
<!-- <template>
|
||||
<div class="test">
|
||||
<div class="item" v-for="item in data" :key="item.id">
|
||||
<slot>
|
||||
{{ item.name }}
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import axios from 'axios';
|
||||
import { onMounted, ref, computed } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
url: string;
|
||||
data?: object;
|
||||
params?: object;
|
||||
request?(): any;
|
||||
}>();
|
||||
|
||||
const request = computed(() => props.request ? props.request : () => axios({
|
||||
method: 'post',
|
||||
url: props.url,
|
||||
data: props.data,
|
||||
params: props.params
|
||||
}))
|
||||
|
||||
const data = ref([])
|
||||
|
||||
const requestData = async () => {
|
||||
const { result } = await request.value();
|
||||
data.value = result;
|
||||
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
requestData();
|
||||
}),
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style> -->
|
||||
@ -84,7 +84,7 @@ export const noticedelMyPost = (params: { noticeId: number }) => {
|
||||
};
|
||||
// 通过id查询通知公告表信息
|
||||
export const noticeDetailMyPost = (params: { noticeId: string }) => {
|
||||
return http.post(BASEURL + `/xmgl/notice/queryById`, params);
|
||||
return http.post(BASEURL + `/xmgl/notice/queryById`, params, { headers: { noLoading: true } });
|
||||
};
|
||||
// 阅读通知公告
|
||||
export const noticeReadMyPost = (params: { noticeId: string }) => {
|
||||
|
||||
@ -120,15 +120,15 @@ export const getRoleNamelist = (params: { state: number | string }) => {
|
||||
|
||||
// 列表查询系统用户表信息 用户通知公告中获取政务人员
|
||||
export const getgovNamelist = (params: {}) => {
|
||||
return http.post(BASEURL + `/gov/systemUser/list`, params);
|
||||
return http.post(BASEURL + `/gov/systemUser/list`, params, { headers: { noLoading: true } });
|
||||
};
|
||||
// 政务列表查询企业 通知通告的企业
|
||||
export const getentNamelist = (params: {}) => {
|
||||
return http.post(BASEURL + `/gov/enterprise/list`, params);
|
||||
return http.post(BASEURL + `/gov/enterprise/list`, params, { headers: { noLoading: true } });
|
||||
};
|
||||
// 同上 项目
|
||||
export const getproNamelist = (params: {}) => {
|
||||
return http.post(BASEURL + `/gov/project/list`, params);
|
||||
return http.post(BASEURL + `/gov/project/list`, params, { headers: { noLoading: true } });
|
||||
};
|
||||
|
||||
// 部门管理!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
@ -16,7 +16,7 @@ const BASEURL = import.meta.env.VITE_API_URL;
|
||||
export const loginApi = (params: Login.ReqLoginForm) => {
|
||||
return http.post<Login.ResLogin>(BASEURL + `/xmgl/systemUser/login`, params, { headers: { noLoading: true } }); // 正常 post json 请求 ==> application/json
|
||||
// return http.post<Login.ResLogin>(BASEURL + `/xmgl/systemUser/login`, params, { headers: { noLoading: true } }); // 控制当前请求不显示 loading
|
||||
// return http.post<Login.ResLogin>(BASEURL + `/xmgl/systemUser/login`, {}, { params }); // post 请求携带 query 参数 ==> ?username=admin&password=123456
|
||||
// return http.post<Login.ResLogin>(BASEURL + `/xmgl/systemUser/login`, {}, { params }); // post 请求携带 query 参数 ==> ?username=admin&password=123456 //标记
|
||||
// return http.post<Login.ResLogin>(BASEURL + `/xmgl/systemUser/login`, qs.stringify(params)); // post 请求携带表单参数 ==> application/x-www-form-urlencoded
|
||||
// return http.get<Login.ResLogin>(BASEURL + `/xmgl/systemUser/login?${qs.stringify(params, { arrayFormat: "repeat" })}`); // 如果是 get 请求可以携带数组等复杂参数
|
||||
};
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
<template>
|
||||
<div class="card table-search" v-if="columns.length">
|
||||
<el-form :inline="true" style="display: flex; flex-wrap: wrap" ref="formRef" :model="searchParam">
|
||||
<!-- <Grid ref="gridRef" :collapsed="collapsed" :gap="[20, 0]" :cols="searchCol"> -->
|
||||
<!-- <GridItem v-for="(item, index) in columns" class="girdItem" :key="item.prop" v-bind="getResponsive(item)" :index="index"> -->
|
||||
<div v-for="(item, index) in columns" class="girdItem" :key="item.prop">
|
||||
<el-form-item :label="`${item.label} `">
|
||||
<SearchFormItem :column="item" :searchParam="searchParam" />
|
||||
@ -14,54 +12,15 @@
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
<el-button style="background-color: #ffb750; color: #fff" v-if="onReset" @click="reset">刷新</el-button>
|
||||
<slot name="formButton" style="margin: 0 10px"></slot>
|
||||
<!-- <el-button type="success" v-if="addButton" @click="reset">新增</el-button> -->
|
||||
|
||||
<!-- <el-button v-if="showCollapse" type="primary" link class="search-isOpen" @click="collapsed = !collapsed">
|
||||
{{ collapsed ? "展开" : "合并" }}
|
||||
<el-icon class="el-icon--right">
|
||||
<component :is="collapsed ? ArrowDown : ArrowUp"></component>
|
||||
</el-icon>
|
||||
</el-button> -->
|
||||
</div>
|
||||
<!-- <GridItem suffix> </GridItem> -->
|
||||
<!-- </Grid> -->
|
||||
</el-form>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
|
||||
<!-- <el-form ref="formRef" :model="searchParam">
|
||||
<Grid ref="gridRef" :collapsed="collapsed" :gap="[20, 0]" :cols="searchCol">
|
||||
<GridItem v-for="(item, index) in columns" class="girdItem" :key="item.prop" v-bind="getResponsive(item)" :index="index">
|
||||
<el-form-item :label="`${item.label} `">
|
||||
<SearchFormItem :column="item" :searchParam="searchParam" />
|
||||
</el-form-item>
|
||||
</GridItem>
|
||||
<div class="operation">
|
||||
<el-button type="primary" @click="search">查询</el-button>
|
||||
<el-button style="background-color: #ffb750; color: #fff" v-if="onReset" @click="reset">刷新</el-button>
|
||||
<slot name="formButton" style="margin: 0 10px"></slot> -->
|
||||
<!-- <el-button type="success" v-if="addButton" @click="reset">新增</el-button> -->
|
||||
|
||||
<!-- <el-button v-if="showCollapse" type="primary" link class="search-isOpen" @click="collapsed = !collapsed">
|
||||
{{ collapsed ? "展开" : "合并" }}
|
||||
<el-icon class="el-icon--right">
|
||||
<component :is="collapsed ? ArrowDown : ArrowUp"></component>
|
||||
</el-icon>
|
||||
</el-button> -->
|
||||
<!-- </div> -->
|
||||
<!-- <GridItem suffix> </GridItem> -->
|
||||
<!-- </Grid> -->
|
||||
<!-- </el-form> -->
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts" name="SearchForm">
|
||||
import { computed, ref } from "vue";
|
||||
import { ColumnProps } from "@/components/ProTable/interface";
|
||||
import { BreakPoint } from "@/components/Grid/interface";
|
||||
import { Search, ArrowDown, ArrowUp } from "@element-plus/icons-vue";
|
||||
import SearchFormItem from "./components/SearchFormItem.vue";
|
||||
import Grid from "@/components/Grid/index.vue";
|
||||
import GridItem from "@/components/Grid/components/GridItem.vue";
|
||||
|
||||
interface ProTableProps {
|
||||
columns?: ColumnProps[]; // 搜索配置列
|
||||
@ -79,51 +38,23 @@ const props = withDefaults(defineProps<ProTableProps>(), {
|
||||
searchParam: () => ({})
|
||||
});
|
||||
|
||||
// 获取响应式设置
|
||||
const getResponsive = (item: ColumnProps) => {
|
||||
return {
|
||||
span: item.search?.span,
|
||||
offset: item.search?.offset ?? 0,
|
||||
xs: item.search?.xs,
|
||||
sm: item.search?.sm,
|
||||
md: item.search?.md,
|
||||
lg: item.search?.lg,
|
||||
xl: item.search?.xl
|
||||
};
|
||||
};
|
||||
|
||||
// 是否默认折叠搜索项
|
||||
const collapsed = ref(false);
|
||||
|
||||
// 获取响应式断点
|
||||
const gridRef = ref();
|
||||
const breakPoint = computed<BreakPoint>(() => gridRef.value?.breakPoint);
|
||||
|
||||
// 判断是否显示 展开/合并 按钮
|
||||
// const showCollapse = computed(() => {
|
||||
// let show = false;
|
||||
// props.columns.reduce((prev, current) => {
|
||||
// prev +=
|
||||
// (current.search![breakPoint.value]?.span ?? current.search?.span ?? 1) +
|
||||
// (current.search![breakPoint.value]?.offset ?? current.search?.offset ?? 0);
|
||||
// if (typeof props.searchCol !== "number") {
|
||||
// if (prev >= props.searchCol[breakPoint.value]) show = true;
|
||||
// } else {
|
||||
// if (prev > props.searchCol) show = true;
|
||||
// }
|
||||
// return prev;
|
||||
// }, 0);
|
||||
// return show;
|
||||
// });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.girdItem {
|
||||
display: flex;
|
||||
}
|
||||
// .girdItem {
|
||||
// padding-top: 6px;
|
||||
// }
|
||||
:deep(.el-form .el-form-item__content .el-range-editor) {
|
||||
width: 200px;
|
||||
}
|
||||
.card {
|
||||
box-shadow: none;
|
||||
}
|
||||
// :deep(.el-form-item--default) {
|
||||
// margin-bottom: 0;
|
||||
// }
|
||||
// .table-search :deep(.operation) {
|
||||
// margin-bottom: 0;
|
||||
// }
|
||||
</style>
|
||||
|
||||
@ -88,17 +88,17 @@ const goHome = () => {
|
||||
.el-menu-item {
|
||||
&.is-active {
|
||||
// background: var(--el-color-primary-light-9);
|
||||
// &::before {
|
||||
// position: absolute;
|
||||
// top: 12px;
|
||||
// bottom: 0;
|
||||
// right: 0;
|
||||
// width: 4px;
|
||||
// height: 38px;
|
||||
// content: "";
|
||||
// background: var(--el-color-primary);
|
||||
// }
|
||||
border-right: 4px solid #008bff;
|
||||
&::before {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
width: 4px;
|
||||
height: 38px;
|
||||
content: "";
|
||||
background: var(--el-color-primary);
|
||||
}
|
||||
// border-right: 4px solid #008bff;
|
||||
&.is:hover {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
@ -31,10 +31,6 @@ import pinia from "@/stores/index";
|
||||
// svg icons
|
||||
import "virtual:svg-icons-register";
|
||||
|
||||
// import "@/assets/js/jquery-1.12.4.min.js";
|
||||
// import "@/assets/js/jsencrypt.min.js";
|
||||
// import "@/assets/js/jsWebControl-1.0.0.min.js";
|
||||
|
||||
// errorHandler
|
||||
// import errorHandler from "@/utils/errorHandler";
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
// border: 1px solid var(--el-border-color-light);
|
||||
border-radius: 8px;
|
||||
// box-shadow: 0 0 12px rgb(0 0 0 / 5%);
|
||||
height: 56px;
|
||||
// height: 56px;
|
||||
}
|
||||
|
||||
// * 不需要 card 卡片样式(在组件内使用 proTable 会使用到)
|
||||
@ -94,9 +94,11 @@
|
||||
|
||||
// table-search 表格搜索样式
|
||||
.table-search {
|
||||
padding: 12px 0 12px 36px;
|
||||
margin-bottom: 10px;
|
||||
padding: 12px 0 0px 36px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 8px;
|
||||
// background-color: pink;
|
||||
box-sizing: border-box;
|
||||
.el-form {
|
||||
.el-form-item__content > * {
|
||||
width: 160px;
|
||||
|
||||
@ -129,7 +129,7 @@ const columns: ColumnProps[] = [
|
||||
{ prop: "content", label: "通知内容", search: { el: "input" } },
|
||||
{ prop: "createByName", label: "发布人名称" },
|
||||
{ prop: "createTime", label: "发布时间" },
|
||||
{ prop: "createTime", label: "阅读状态" },
|
||||
{ prop: "isRead", label: "阅读状态" },
|
||||
{ prop: "operation", label: "操作", fixed: "right" }
|
||||
];
|
||||
|
||||
|
||||
@ -130,7 +130,13 @@ const columns: ColumnProps[] = [
|
||||
{ prop: "content", label: "通知内容", search: { el: "input" } },
|
||||
{ prop: "createByName", label: "发布人名称" },
|
||||
{ prop: "createTime", label: "发布时间" },
|
||||
{ prop: "createTime", label: "阅读状态" },
|
||||
{
|
||||
prop: "isRead",
|
||||
label: "阅读状态",
|
||||
render: scoped => {
|
||||
return scoped.row.isRead === 1 ? "已读" : "未读";
|
||||
}
|
||||
},
|
||||
{ prop: "operation", label: "操作", fixed: "right" }
|
||||
];
|
||||
|
||||
|
||||
@ -4,19 +4,22 @@
|
||||
.base-box {
|
||||
// height: calc(100% + 20px);
|
||||
flex: 1;
|
||||
margin: 20px 10px 0 10px;
|
||||
margin: 10px 10px 0 10px;
|
||||
background-color: #ffffff;
|
||||
border-radius: 12px;
|
||||
}
|
||||
.protable {
|
||||
// flex: 1;
|
||||
padding: 10px;
|
||||
height: calc(100% - 134px);
|
||||
height: calc(100% - 150px);
|
||||
}
|
||||
:deep(.el-card) {
|
||||
margin: 2px 10px 0px;
|
||||
margin: 2px 10px 10px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
height: 56px;
|
||||
// padding-bottom: 6px;
|
||||
}
|
||||
:deep(.el-card__body) {
|
||||
padding: 12px 0 0 36px;
|
||||
}
|
||||
|
||||
@ -517,4 +517,11 @@ onMounted(async () => {
|
||||
.blueText {
|
||||
color: #008bff;
|
||||
}
|
||||
:deep(.table-search) {
|
||||
margin-bottom: 0;
|
||||
border-radius: 8px 8px 0 0;
|
||||
}
|
||||
:deep(.el-form) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -114,7 +114,8 @@
|
||||
<div class="allModular">
|
||||
<!-- 标记全选 -->
|
||||
<!-- <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="checkedState" label="全选" size="large" /> -->
|
||||
<el-checkbox v-model="checkAll" @change="checkedState" label="全选" size="large" />
|
||||
<!-- <el-checkbox v-model="checkAll" @change="checkedState" label="全选" size="large" /> -->
|
||||
<el-checkbox v-model="checkAll" label="全选" @change="changeChecked" size="large" />
|
||||
</div>
|
||||
<div class="littleTitle">政务模块</div>
|
||||
<div class="allModular">
|
||||
@ -161,7 +162,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx" name="jxjGovernMent">
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import { ref, reactive, onMounted, watch, computed } from "vue";
|
||||
import { ElMessage, ElMessageBox, FormRules, FormInstance } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
import { User } from "@/api/interface";
|
||||
@ -177,7 +178,8 @@ import {
|
||||
getGoverType,
|
||||
getGoverForm,
|
||||
editGoverCheck,
|
||||
getDicList
|
||||
getDicList,
|
||||
goverMentlist
|
||||
} from "@/api/modules/jxjview";
|
||||
import { checkPhoneNumber } from "@/utils/eleValidate";
|
||||
|
||||
@ -355,20 +357,29 @@ const onRadio = async (val: number) => {
|
||||
governmentSelectList.value = res1.result.government;
|
||||
projectSelectList.value = res1.result.project;
|
||||
companySelectList.value = res1.result.enterprise;
|
||||
const res2 = await getGoverForm({ governmentSn: governmentSn.value });
|
||||
governmentSelectList.value.concat(projectSelectList.value, companySelectList.value).forEach((itemA, indexA) => {
|
||||
res2.result.forEach((itemB, indexB) => {
|
||||
if (itemA.moduleId == itemB) {
|
||||
// governmentSelectList.value[indexA].select = true;
|
||||
itemA.select = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const checkedState = () => {
|
||||
// console.log("执行方法啦");
|
||||
if (checkAll.value) {
|
||||
governmentSelectList.value.concat(projectSelectList.value, companySelectList.value).forEach((item, index, array) => {
|
||||
item.select = true;
|
||||
// isIndeterminate.value = false;
|
||||
});
|
||||
} else if (checkAll.value == false) {
|
||||
governmentSelectList.value.concat(projectSelectList.value, companySelectList.value).forEach((item, index, array) => {
|
||||
item.select = false;
|
||||
});
|
||||
}
|
||||
watch(
|
||||
() => governmentSelectList.value.concat(projectSelectList.value, companySelectList.value),
|
||||
val => {
|
||||
checkAll.value = val.every(item => item.select);
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
const changeChecked = val => {
|
||||
governmentSelectList.value.concat(projectSelectList.value, companySelectList.value).forEach(item => {
|
||||
item.select = val;
|
||||
});
|
||||
};
|
||||
|
||||
const onSubmitConfig = async (formEl: FormInstance | undefined) => {
|
||||
@ -401,6 +412,8 @@ const onSubmitConfig = async (formEl: FormInstance | undefined) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const governmentSn = ref("");
|
||||
// 授权配置btn
|
||||
const onConfiguration = async (row: any) => {
|
||||
configureDialogVisible.value = true;
|
||||
@ -414,6 +427,7 @@ const onConfiguration = async (row: any) => {
|
||||
governmentSelectList.value = res1.result.government;
|
||||
projectSelectList.value = res1.result.project;
|
||||
companySelectList.value = res1.result.enterprise;
|
||||
governmentSn.value = row.governmentSn;
|
||||
const res2 = await getGoverForm({ governmentSn: row.governmentSn });
|
||||
governmentSelectList.value.concat(projectSelectList.value, companySelectList.value).forEach((itemA, indexA) => {
|
||||
res2.result.forEach((itemB, indexB) => {
|
||||
|
||||
@ -65,7 +65,7 @@ const loginRules = reactive({
|
||||
});
|
||||
|
||||
const loading = ref(false);
|
||||
const loginForm = reactive<Login.ReqLoginForm>({ account: "admin", showPassword: "123456" });
|
||||
const loginForm = reactive<Login.ReqLoginForm>({ account: "", showPassword: "" });
|
||||
const login = (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid, params) => {
|
||||
@ -80,7 +80,7 @@ const login = (formEl: FormInstance | undefined) => {
|
||||
globalStore.setAccount(result.account);
|
||||
globalStore.setAccountType(result.accountType);
|
||||
globalStore.setProjectDateAuth(result.projectDateAuth);
|
||||
globalStore.setIsManager(result.isManager);
|
||||
globalStore.setIsManager(result.isManager); //我已知晓
|
||||
|
||||
// 2.添加动态路由
|
||||
// await initDynamicRouter();
|
||||
|
||||
@ -94,7 +94,7 @@ import { ref, reactive, onMounted } from "vue";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ColumnProps } from "@/components/ProTable/interface";
|
||||
import ProTable from "@/components/ProTable/index.vue";
|
||||
import { myNoticeReceivePage, noticeDetailMyPost } from "@/api/modules/common";
|
||||
import { myNoticeReceivePage, noticeDetailMyPost, noticeReadMyPost } from "@/api/modules/common";
|
||||
import { GlobalStore } from "@/stores";
|
||||
import type { Options } from "@/views/goverment/approve/company/components/unit-table.vue";
|
||||
import type { UploadFile } from "@/components/FilesUpload/FilesUpload.vue";
|
||||
@ -129,7 +129,7 @@ const columns: ColumnProps[] = [
|
||||
{ prop: "content", label: "通知内容", search: { el: "input" } },
|
||||
{ prop: "createByName", label: "发布人名称" },
|
||||
{ prop: "createTime", label: "发布时间" },
|
||||
{ prop: "createTime", label: "阅读状态" },
|
||||
{ prop: "isRead", label: "阅读状态" },
|
||||
{ prop: "operation", label: "操作", fixed: "right" }
|
||||
];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user