新增学习内容
This commit is contained in:
parent
cb158d2e3d
commit
24db0aafda
|
|
@ -452,6 +452,84 @@ export function saveUser(data) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*党员学习内容分页查看
|
||||||
|
*/
|
||||||
|
export function partyLearnPage(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/partyLearnContent/partyLearnPage`,
|
||||||
|
method: "GET",
|
||||||
|
params:params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*党员学习内容新增-修改
|
||||||
|
*/
|
||||||
|
export function partyLearnSave(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/partyLearnContent/partyLearnSave`,
|
||||||
|
method: "POST",
|
||||||
|
data:params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*查看党员学习内容详情
|
||||||
|
*/
|
||||||
|
export function partyLearnDetail(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/partyLearnContent/partyLearnDetail/${params.learnContentId}`,
|
||||||
|
method: "GET",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*党员学习内容删除
|
||||||
|
*/
|
||||||
|
export function partyLearnDelete(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/partyLearnContent/partyLearnDelete/${params.learnContentId}`,
|
||||||
|
method: "DELETE",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*公开内容分页查看
|
||||||
|
*/
|
||||||
|
export function publicContentPage(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/publicContent/publicContentPage`,
|
||||||
|
method: "GET",
|
||||||
|
params:params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*查看公开内容详情
|
||||||
|
*/
|
||||||
|
export function publicContentDetail(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/publicContent/publicContentDetail/${params.publicContentId}`,
|
||||||
|
method: "GET",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*公开内容删除
|
||||||
|
*/
|
||||||
|
export function publicContentDelete(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/publicContent/publicContentDelete/${params.publicContentId}`,
|
||||||
|
method: "DELETE",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*公开内容新增-修改
|
||||||
|
*/
|
||||||
|
export function publicContentSave(params) {
|
||||||
|
return request({
|
||||||
|
url: `/admin/publicContent/publicContentSave`,
|
||||||
|
method: "POST",
|
||||||
|
data:params,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
40
src/router/modules/demands.js
Normal file
40
src/router/modules/demands.js
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
const Layout = () => import('@/layout/index.vue')
|
||||||
|
|
||||||
|
export default {
|
||||||
|
path: '/demands',
|
||||||
|
component: Layout,
|
||||||
|
name: 'Demands',
|
||||||
|
redirect: '/demands/index',
|
||||||
|
meta: {
|
||||||
|
auth: "demands",
|
||||||
|
title: '群众诉求',
|
||||||
|
icon: 'icon-home',
|
||||||
|
activeMenu: '/demands/index'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'index',
|
||||||
|
name: 'demands',
|
||||||
|
component: () => import('@/views/demands/index.vue'),
|
||||||
|
meta: {
|
||||||
|
auth: "demands",
|
||||||
|
title: '群众诉求',
|
||||||
|
sidebar: false,
|
||||||
|
breadcrumb: true, //是否显示面包屑
|
||||||
|
activeMenu: '/demands/index'
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'demands-detail',
|
||||||
|
name: 'demands-detail',
|
||||||
|
component: () => import('@/views/demands/detail.vue'),
|
||||||
|
meta: {
|
||||||
|
title: '群众诉求详情',
|
||||||
|
sidebar: false, //是否在菜单栏显示
|
||||||
|
breadcrumb: true, //是否显示面包屑
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -155,14 +155,46 @@ export default {
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'messageindex',
|
path: 'message',
|
||||||
name: 'messageindex',
|
name: 'message',
|
||||||
|
redirect: '/system/message/notice',
|
||||||
meta: {
|
meta: {
|
||||||
icon: 'point',
|
icon: 'point',
|
||||||
title: '消息管理',
|
title: '消息管理',
|
||||||
breadcrumb: true,
|
breadcrumb: true,
|
||||||
},
|
},
|
||||||
component: () => import('@/views/system/message/index.vue'),
|
children: [
|
||||||
|
{
|
||||||
|
path: 'notice',
|
||||||
|
name: 'notice',
|
||||||
|
component: () => import('@/views/system/message/notice/index.vue'),
|
||||||
|
meta: {
|
||||||
|
icon: 'point',
|
||||||
|
title: '公告管理',
|
||||||
|
breadcrumb: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'study',
|
||||||
|
name: 'study',
|
||||||
|
component: () => import('@/views/system/message/study-content/index.vue'),
|
||||||
|
meta: {
|
||||||
|
icon: 'point',
|
||||||
|
title: '党员学习内容',
|
||||||
|
breadcrumb: true, //是否显示面包屑
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'public',
|
||||||
|
name: 'public',
|
||||||
|
component: () => import('@/views/system/message/public-content/index.vue'),
|
||||||
|
meta: {
|
||||||
|
icon: 'point',
|
||||||
|
title: '公开内容',
|
||||||
|
breadcrumb: true, //是否显示面包屑
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -109,6 +109,7 @@ import trends from './modules/work-trends';
|
||||||
import manage from './modules/work-manage';
|
import manage from './modules/work-manage';
|
||||||
import statistic from './modules/statistic';
|
import statistic from './modules/statistic';
|
||||||
import bigData from './modules/big-data';
|
import bigData from './modules/big-data';
|
||||||
|
import demands from './modules/demands';
|
||||||
|
|
||||||
// 动态路由(异步路由、导航栏路由)
|
// 动态路由(异步路由、导航栏路由)
|
||||||
let asyncRoutes = [
|
let asyncRoutes = [
|
||||||
|
|
@ -123,6 +124,7 @@ let asyncRoutes = [
|
||||||
base,
|
base,
|
||||||
emergency,
|
emergency,
|
||||||
trends,
|
trends,
|
||||||
|
demands,
|
||||||
manage,
|
manage,
|
||||||
statistic,
|
statistic,
|
||||||
system,
|
system,
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@ export enum FileType {
|
||||||
messageCover = 'messageCover',//消息管理封面
|
messageCover = 'messageCover',//消息管理封面
|
||||||
system = 'system',//系统设置Logo
|
system = 'system',//系统设置Logo
|
||||||
agreement = 'agreement',//协议
|
agreement = 'agreement',//协议
|
||||||
|
studyContent = 'studyContent',//党员学习内容
|
||||||
|
studyContentCover = 'studyContentCover',//党员学习内容封面
|
||||||
|
publicContent = 'publicContent',//党员学习内容
|
||||||
|
publicContentCover = 'publicContentCover',//党员学习内容封面
|
||||||
}
|
}
|
||||||
// 文件接口类型
|
// 文件接口类型
|
||||||
export enum ApiFile {
|
export enum ApiFile {
|
||||||
|
|
|
||||||
231
src/views/demands/detail.vue
Normal file
231
src/views/demands/detail.vue
Normal file
|
|
@ -0,0 +1,231 @@
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<div class="content">
|
||||||
|
<div>
|
||||||
|
<TitleC titleName="户籍信息">
|
||||||
|
<template v-slot:option>
|
||||||
|
<div class="h-layout option">
|
||||||
|
<div class="h-layout h-titlec" @click="getDetail">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span class="span">刷新</span>
|
||||||
|
</div>
|
||||||
|
<div class="h-layout h-titlec" @click="clone">
|
||||||
|
<svg-icon name="close" class="icon" />
|
||||||
|
<span class="span">关闭</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</TitleC>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-width="150px"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="detailForm"
|
||||||
|
>
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请输入"
|
||||||
|
type="input"
|
||||||
|
v-model="detailForm.name"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="性别" prop="sortId">
|
||||||
|
<el-select
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="detailForm.sex"
|
||||||
|
>
|
||||||
|
<el-option label="男" :value="1">男</el-option>
|
||||||
|
<el-option label="女" :value="0">女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="areaCode" label="所属区域">
|
||||||
|
<el-cascader
|
||||||
|
:disabled="formEnable"
|
||||||
|
ref="cascader"
|
||||||
|
v-model="detailForm.areaCode"
|
||||||
|
placeholder="请选择地区"
|
||||||
|
:options="orgList"
|
||||||
|
:props="{
|
||||||
|
checkStrictly: true,
|
||||||
|
label: 'orgname',
|
||||||
|
value: 'orgcode',
|
||||||
|
}"
|
||||||
|
clearable
|
||||||
|
></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="婚姻状态" prop="marriageState">
|
||||||
|
<el-select
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="detailForm.marriageState"
|
||||||
|
>
|
||||||
|
<el-option label="已婚" :value="1">已婚</el-option>
|
||||||
|
<el-option label="未婚" :value="2">未婚</el-option>
|
||||||
|
<el-option label="离婚" :value="3">离婚</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出生日期" prop="birthday">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="formEnable"
|
||||||
|
v-model="detailForm.birthday"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择出生日期"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="户籍创建时间" prop="changeTime">
|
||||||
|
<el-date-picker
|
||||||
|
:disabled="formEnable"
|
||||||
|
v-model="detailForm.changeTime"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择户籍创建时间"
|
||||||
|
size="default"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证号" prop="idCard">
|
||||||
|
<el-input
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请输入身份证号"
|
||||||
|
type="input"
|
||||||
|
v-model="detailForm.idCard"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="现居地址" prop="address">
|
||||||
|
<el-input
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请输入"
|
||||||
|
type="input"
|
||||||
|
v-model="detailForm.address"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="经度" prop="lon">
|
||||||
|
<el-input
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请输入"
|
||||||
|
type="input"
|
||||||
|
v-model="detailForm.lon"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="纬度" prop="lat">
|
||||||
|
<el-input
|
||||||
|
:disabled="formEnable"
|
||||||
|
placeholder="请输入"
|
||||||
|
type="input"
|
||||||
|
v-model="detailForm.lat"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formEnable ? false : true"
|
||||||
|
label="地图:"
|
||||||
|
style="width: 94%;"
|
||||||
|
>
|
||||||
|
<Map
|
||||||
|
@change="handleMapChange"
|
||||||
|
:longlat="
|
||||||
|
detailForm.lon && detailForm.lat
|
||||||
|
? [detailForm.lon, detailForm.lat]
|
||||||
|
: latAndLon
|
||||||
|
"
|
||||||
|
></Map>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
import { ElMessage, FormInstance, FormRules, ElMessageBox } from "element-plus";
|
||||||
|
import { areaTree } from "@/api/account";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
|
//控制form框操作
|
||||||
|
const formEnable = ref(true);
|
||||||
|
const detailForm = ref<any>({});
|
||||||
|
//道孚地图坐标
|
||||||
|
const latAndLon = ref([101.13, 30.98]);
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
//诉求详情
|
||||||
|
const form = ref({});
|
||||||
|
|
||||||
|
//关闭
|
||||||
|
const clone = () => {
|
||||||
|
router.go(-1);
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取详情
|
||||||
|
const getDetail = () => {
|
||||||
|
// domicileDetail({domicileId:route.query.id}).then((res: any) => {
|
||||||
|
// console.log(res.data,'res===>');
|
||||||
|
|
||||||
|
// detailForm.value = res.data;
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取地区
|
||||||
|
const orgList = ref([]);
|
||||||
|
const getAreaTree = () => {
|
||||||
|
areaTree(userId.value).then((res: any) => {
|
||||||
|
orgList.value = res.data;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//刷新
|
||||||
|
const refurbish = () => {
|
||||||
|
getDetail();
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
refurbish();
|
||||||
|
getAreaTree();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: scroll;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-o-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-ms-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 45%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
283
src/views/demands/index.vue
Normal file
283
src/views/demands/index.vue
Normal file
|
|
@ -0,0 +1,283 @@
|
||||||
|
<!-- 户籍管理 -->
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<div class="content">
|
||||||
|
<div style="margin-bottom: 16px;" class="h-layout space-between h-center">
|
||||||
|
<div>
|
||||||
|
<div class="h-layout h-center">
|
||||||
|
<div class="tool-item" @click="getList">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span>刷新</span>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="label-select filter-tab">
|
||||||
|
<label>户籍状态</label>
|
||||||
|
<el-select
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="search.domicileState"
|
||||||
|
clearable
|
||||||
|
@change="getList"
|
||||||
|
>
|
||||||
|
<el-option label="正常" :value="1">正常</el-option>
|
||||||
|
<el-option label="注销" :value="2">注销</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div> -->
|
||||||
|
<!-- <div class="label-select filter-tab">
|
||||||
|
<label>婚姻状态</label>
|
||||||
|
<el-select
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="search.marriageState"
|
||||||
|
clearable
|
||||||
|
@change="getList"
|
||||||
|
>
|
||||||
|
<el-option label="已婚" :value="1">已婚</el-option>
|
||||||
|
<el-option label="未婚" :value="2">未婚</el-option>
|
||||||
|
<el-option label="离婚" :value="3">离婚</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div> -->
|
||||||
|
<!-- <div class="label-select filter-tab">
|
||||||
|
<label>性别</label>
|
||||||
|
<el-select
|
||||||
|
placeholder="请选择"
|
||||||
|
v-model="search.sex"
|
||||||
|
clearable
|
||||||
|
@change="getList"
|
||||||
|
>
|
||||||
|
<el-option label="男" :value="1">男</el-option>
|
||||||
|
<el-option label="女" :value="0">女</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 30%;">
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="search.condition"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
class="search-input"
|
||||||
|
@keydown.enter.native="getList"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<span class="search-bottom">
|
||||||
|
<svg-icon name="search" class="icon_class" />
|
||||||
|
<span>搜索</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 表格 -->
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
:data="tableData"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
type="index"
|
||||||
|
align="center"
|
||||||
|
label="序列"
|
||||||
|
width="60"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="姓名"
|
||||||
|
prop="name"
|
||||||
|
width="130"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="性别"
|
||||||
|
prop="sex"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{
|
||||||
|
scope.row.sex == 1 ? "男" : scope.row.sex == 0 ? "女" : "--"
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="出生日期"
|
||||||
|
prop="birthday"
|
||||||
|
width="200"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{ scope.row.birthday ? scope.row.birthday : "--" }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="婚姻状况"
|
||||||
|
prop="marriageState"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span>{{
|
||||||
|
scope.row.marriageState == 1
|
||||||
|
? "已婚"
|
||||||
|
: scope.row.marriageState == 2
|
||||||
|
? "未婚"
|
||||||
|
: scope.row.marriageState == 3
|
||||||
|
? "离婚"
|
||||||
|
: "--"
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="居住地址"
|
||||||
|
prop="address"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="所在地区"
|
||||||
|
prop="areaName"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="户籍状态"
|
||||||
|
prop="domicileState"
|
||||||
|
width="100"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span class="table_ormal" v-if="scope.row.domicileState == 1"
|
||||||
|
>正常</span
|
||||||
|
>
|
||||||
|
<span class="table_cancel" v-else-if="scope.row.domicileState == 2"
|
||||||
|
>注销</span
|
||||||
|
>
|
||||||
|
<span v-else>--</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
label="操作"
|
||||||
|
width="350"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="toDetail(scope.row.domicileId)"
|
||||||
|
>
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">详情</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
@size-change="getList"
|
||||||
|
@current-change="getList"
|
||||||
|
v-model:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
v-model:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
background
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
import { domicilePage, domicileDel, domicileRestore } from "@/api/base";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
const router = useRouter();
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const dialogForm = ref({});
|
||||||
|
const readonly = ref(false);
|
||||||
|
const search = ref({
|
||||||
|
condition: "",
|
||||||
|
domicileState: "",
|
||||||
|
marriageState:"",
|
||||||
|
sex:"",
|
||||||
|
});
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const total = ref(0);
|
||||||
|
const tableData = ref([]);
|
||||||
|
//获取列表
|
||||||
|
const tableDataloading = ref(false);
|
||||||
|
const getList = () => {
|
||||||
|
tableDataloading.value = true;
|
||||||
|
let params = {
|
||||||
|
limit: pageSize.value,
|
||||||
|
page: currentPage.value,
|
||||||
|
condition: search.value.condition,
|
||||||
|
userId: userId.value,
|
||||||
|
domicileState:search.value.domicileState,
|
||||||
|
marriageState:search.value.marriageState,
|
||||||
|
sex:search.value.sex,
|
||||||
|
};
|
||||||
|
domicilePage(params).then((res: any) => {
|
||||||
|
tableData.value = res.data.list;
|
||||||
|
total.value = res.data.total;
|
||||||
|
tableDataloading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//调整详情
|
||||||
|
const toDetail = (id) => {
|
||||||
|
router.push({
|
||||||
|
name: "demands-detail",
|
||||||
|
query: { id: id },
|
||||||
|
});
|
||||||
|
};
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-o-box-sizing: border-box;
|
||||||
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
||||||
|
-ms-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.dialog-footer button:first-child {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.content-top {
|
||||||
|
padding: 16px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0 0 6px rgb(0 120 255 / 10%);
|
||||||
|
border-radius: 6px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
184
src/views/system/message/public-content/add.vue
Normal file
184
src/views/system/message/public-content/add.vue
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="
|
||||||
|
readonly ? '公开内容详情' : props.form.publicContentId ? '编辑公开内容' : '新增公开内容'
|
||||||
|
"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="props.readonly ? false : true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-position="right"
|
||||||
|
label-width="100"
|
||||||
|
:disabled="readonly"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="addMessageForm"
|
||||||
|
>
|
||||||
|
<el-form-item label="标题名称:" prop="title" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model="addMessageForm.title"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="内容:" prop="content" style="width: 100%;">
|
||||||
|
<div class="qedit">
|
||||||
|
<QuillEditor
|
||||||
|
class="qedit"
|
||||||
|
:value="addMessageForm.content"
|
||||||
|
@updateValue="getMsg"
|
||||||
|
:id="addMessageForm.publicContentId || uuid"
|
||||||
|
:userId="userId"
|
||||||
|
:FileType="FileType.publicContent"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="封面:" prop="coverImg" style="width: 100%;">
|
||||||
|
<CustomUpload
|
||||||
|
:listPic="fileList"
|
||||||
|
:OTCType="FileType.publicContentCover"
|
||||||
|
:uuid="addMessageForm.publicContentId || uuid"
|
||||||
|
:userId="userId"
|
||||||
|
:baseUrl="baseUrl"
|
||||||
|
:max="1"
|
||||||
|
@onUpdate="updateFile"
|
||||||
|
:readonly="props.readonly"
|
||||||
|
></CustomUpload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
import { publicContentSave, publicContentDetail } from "@/api/Sys";
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref("");
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: String,
|
||||||
|
});
|
||||||
|
const addMessageForm = ref<any>({ content: "",title:"" });
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
//富文本
|
||||||
|
const msgContent = ref('')
|
||||||
|
const getMsg = (val) => {
|
||||||
|
// addMessageForm.content = val;
|
||||||
|
msgContent.value = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
...addMessageForm.value,
|
||||||
|
coverPath:fileList.value[0].filepath,
|
||||||
|
publicContentId:addMessageForm.value.publicContentId||uuid.value,
|
||||||
|
content : msgContent.value
|
||||||
|
}
|
||||||
|
publicContentSave(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "保存成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//上传封面
|
||||||
|
const fileList = ref([]);
|
||||||
|
const baseUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
/**
|
||||||
|
* 文件列表更新
|
||||||
|
*/
|
||||||
|
const updateFile = (files: any) => {
|
||||||
|
fileList.value = files;
|
||||||
|
};
|
||||||
|
//图片查询
|
||||||
|
const getFiles = (FileType) => {
|
||||||
|
getFile(addMessageForm.value.publicContentId || uuid.value, FileType).then(
|
||||||
|
(res: any) => {
|
||||||
|
fileList.value = res.data;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
//查询详情
|
||||||
|
const getNoticeDetail = (id) =>{
|
||||||
|
let params = {
|
||||||
|
publicContentId:id
|
||||||
|
}
|
||||||
|
publicContentDetail(params).then(
|
||||||
|
(res: any) => {
|
||||||
|
addMessageForm.value = res.data;
|
||||||
|
getFiles(FileType.publicContentCover);
|
||||||
|
msgContent.value = res.data.content;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
emits("close");
|
||||||
|
addMessageForm.value = {};
|
||||||
|
addMessageForm.value.content = "";
|
||||||
|
addMessageForm.value.title = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
() => {
|
||||||
|
uuid.value = getUUID();
|
||||||
|
if (props.form.publicContentId) {
|
||||||
|
getNoticeDetail(props.form.publicContentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onMounted(() => {});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
225
src/views/system/message/public-content/index.vue
Normal file
225
src/views/system/message/public-content/index.vue
Normal file
|
|
@ -0,0 +1,225 @@
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<div class="content">
|
||||||
|
<div class="h-layout space-between h-center">
|
||||||
|
<div>
|
||||||
|
<div class="h-layout">
|
||||||
|
<div class="tool-item" @click="getList">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span>刷新</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="tool-item"
|
||||||
|
@click="(dialogVisible = true), (form = {}), (readonly = false)"
|
||||||
|
>
|
||||||
|
<svg-icon name="add" class="icon" />
|
||||||
|
<span>新增</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 30%;">
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="search"
|
||||||
|
@keydown.enter.native="getList"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
class="search-input"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<span @click="getList" class="search-bottom">
|
||||||
|
<svg-icon name="search" class="icon_class" />
|
||||||
|
<span>搜索</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
:data="tableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
:resizable="true"
|
||||||
|
width="100"
|
||||||
|
label="序列"
|
||||||
|
type="index"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.$index + 1 + (currentPage - 1) * pageSize }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="coverImg"
|
||||||
|
:resizable="true"
|
||||||
|
label="封面"
|
||||||
|
width="100"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<img class="coverImg" :src="baseUrl+scope.row.coverPath" alt="">
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
:resizable="true"
|
||||||
|
label="标题"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
width="300"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = false)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
|
<span class="edit">编辑</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = true)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">详情</span>
|
||||||
|
</span>
|
||||||
|
<span class="operate" @click="del(scope.row.publicContentId)">
|
||||||
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
|
<span class="delete">删除</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
@size-change="getList"
|
||||||
|
@current-change="getList"
|
||||||
|
v-model:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
v-model:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
background
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
<!-- 新增/修改 -->
|
||||||
|
<Add
|
||||||
|
:visible="dialogVisible"
|
||||||
|
:form="form"
|
||||||
|
:readonly="readonly"
|
||||||
|
@close="onclone"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
import { publicContentPage, publicContentDelete } from "@/api/Sys";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import Add from "./add.vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const baseUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const search = ref('');
|
||||||
|
const tableData = ref([]);
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const form = ref({});
|
||||||
|
const readonly = ref(false);
|
||||||
|
|
||||||
|
//获取列表
|
||||||
|
const tableDataloading = ref(false);
|
||||||
|
const getList = () => {
|
||||||
|
tableDataloading.value = true;
|
||||||
|
let params = {
|
||||||
|
condition: search.value,
|
||||||
|
limit: pageSize.value,
|
||||||
|
page: currentPage.value,
|
||||||
|
};
|
||||||
|
publicContentPage(params).then((res: any) => {
|
||||||
|
console.log(res,'res==>');
|
||||||
|
tableData.value = res.data.list;
|
||||||
|
total.value = res.data.total;
|
||||||
|
tableDataloading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//删除列表
|
||||||
|
const del = (id) => {
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
let params = {
|
||||||
|
publicContentId:id
|
||||||
|
}
|
||||||
|
publicContentDelete(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.table {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.coverImg {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
184
src/views/system/message/study-content/add.vue
Normal file
184
src/views/system/message/study-content/add.vue
Normal file
|
|
@ -0,0 +1,184 @@
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BaseDialog
|
||||||
|
:dialogVisible="props.visible"
|
||||||
|
@close="onclone"
|
||||||
|
:titleName="
|
||||||
|
readonly ? '党员学习内容详情' : props.form.learnContentId ? '编辑党员学习内容' : '新增党员学习内容'
|
||||||
|
"
|
||||||
|
width="50%"
|
||||||
|
@onSubmit="handleSubmit"
|
||||||
|
:footerclosed="true"
|
||||||
|
:diafooter="true"
|
||||||
|
:footerkeepnaem="props.readonly ? false : true"
|
||||||
|
>
|
||||||
|
<div class="detailForm-content">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
label-position="right"
|
||||||
|
label-width="100"
|
||||||
|
:disabled="readonly"
|
||||||
|
:rules="ruleForm"
|
||||||
|
:model="addMessageForm"
|
||||||
|
>
|
||||||
|
<el-form-item label="标题名称:" prop="title" style="width: 100%;">
|
||||||
|
<el-input
|
||||||
|
placeholder="请输入"
|
||||||
|
v-model="addMessageForm.title"
|
||||||
|
></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="内容:" prop="content" style="width: 100%;">
|
||||||
|
<div class="qedit">
|
||||||
|
<QuillEditor
|
||||||
|
class="qedit"
|
||||||
|
:value="addMessageForm.content"
|
||||||
|
@updateValue="getMsg"
|
||||||
|
:id="addMessageForm.learnContentId || uuid"
|
||||||
|
:userId="userId"
|
||||||
|
:FileType="FileType.studyContent"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="封面:" prop="coverImg" style="width: 100%;">
|
||||||
|
<CustomUpload
|
||||||
|
:listPic="fileList"
|
||||||
|
:OTCType="FileType.studyContentCover"
|
||||||
|
:uuid="addMessageForm.learnContentId || uuid"
|
||||||
|
:userId="userId"
|
||||||
|
:baseUrl="baseUrl"
|
||||||
|
:max="1"
|
||||||
|
@onUpdate="updateFile"
|
||||||
|
:readonly="props.readonly"
|
||||||
|
></CustomUpload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</BaseDialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" >
|
||||||
|
import { reactive, ref, onMounted, watch } from "vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
import { getYears, getUUID, FileType } from "@/utils/common";
|
||||||
|
import { ElMessage, FormInstance, FormRules } from "element-plus";
|
||||||
|
import { uploadFile, getFile, delFile } from "@/api/file";
|
||||||
|
import { partyLearnSave, partyLearnDetail } from "@/api/Sys";
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
const uuid = ref("");
|
||||||
|
const ruleForm = reactive<FormRules>({
|
||||||
|
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: Object,
|
||||||
|
readonly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
id: String,
|
||||||
|
});
|
||||||
|
const addMessageForm = ref<any>({ content: "",title:"" });
|
||||||
|
const emits = defineEmits(["close", "onSubmit"]);
|
||||||
|
//富文本
|
||||||
|
const msgContent = ref('')
|
||||||
|
const getMsg = (val) => {
|
||||||
|
// addMessageForm.content = val;
|
||||||
|
msgContent.value = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
//保存并退出
|
||||||
|
const handleSubmit = () => {
|
||||||
|
formRef.value?.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let params = {
|
||||||
|
...addMessageForm.value,
|
||||||
|
coverPath:fileList.value[0].filepath,
|
||||||
|
learnContentId:addMessageForm.value.learnContentId||uuid.value,
|
||||||
|
content : msgContent.value
|
||||||
|
}
|
||||||
|
partyLearnSave(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "保存成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
onclone();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
//上传封面
|
||||||
|
const fileList = ref([]);
|
||||||
|
const baseUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
/**
|
||||||
|
* 文件列表更新
|
||||||
|
*/
|
||||||
|
const updateFile = (files: any) => {
|
||||||
|
fileList.value = files;
|
||||||
|
};
|
||||||
|
//图片查询
|
||||||
|
const getFiles = (FileType) => {
|
||||||
|
getFile(addMessageForm.value.learnContentId || uuid.value, FileType).then(
|
||||||
|
(res: any) => {
|
||||||
|
fileList.value = res.data;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
//查询详情
|
||||||
|
const getNoticeDetail = (id) =>{
|
||||||
|
let params = {
|
||||||
|
learnContentId:id
|
||||||
|
}
|
||||||
|
partyLearnDetail(params).then(
|
||||||
|
(res: any) => {
|
||||||
|
addMessageForm.value = res.data;
|
||||||
|
getFiles(FileType.studyContentCover);
|
||||||
|
msgContent.value = res.data.content;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//关闭弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
emits("close");
|
||||||
|
addMessageForm.value = {};
|
||||||
|
addMessageForm.value.content = "";
|
||||||
|
addMessageForm.value.title = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
() => {
|
||||||
|
uuid.value = getUUID();
|
||||||
|
if (props.form.learnContentId) {
|
||||||
|
getNoticeDetail(props.form.learnContentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onMounted(() => {});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.detailForm-content {
|
||||||
|
margin-right: 30px;
|
||||||
|
}
|
||||||
|
:deep(.el-form) {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
:deep(.el-form-item) {
|
||||||
|
width: 47%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
225
src/views/system/message/study-content/index.vue
Normal file
225
src/views/system/message/study-content/index.vue
Normal file
|
|
@ -0,0 +1,225 @@
|
||||||
|
<template>
|
||||||
|
<div class="percentage-content">
|
||||||
|
<div class="content">
|
||||||
|
<div class="h-layout space-between h-center">
|
||||||
|
<div>
|
||||||
|
<div class="h-layout">
|
||||||
|
<div class="tool-item" @click="getList">
|
||||||
|
<svg-icon name="refurbish" class="icon" />
|
||||||
|
<span>刷新</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="tool-item"
|
||||||
|
@click="(dialogVisible = true), (form = {}), (readonly = false)"
|
||||||
|
>
|
||||||
|
<svg-icon name="add" class="icon" />
|
||||||
|
<span>新增</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width: 30%;">
|
||||||
|
<div>
|
||||||
|
<el-input
|
||||||
|
v-model="search"
|
||||||
|
@keydown.enter.native="getList"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
class="search-input"
|
||||||
|
>
|
||||||
|
<template #append>
|
||||||
|
<span @click="getList" class="search-bottom">
|
||||||
|
<svg-icon name="search" class="icon_class" />
|
||||||
|
<span>搜索</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="loading"
|
||||||
|
class="table"
|
||||||
|
v-loading="tableDataloading"
|
||||||
|
:data="tableData"
|
||||||
|
header-row-class-name="el-one-header"
|
||||||
|
border
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
:resizable="true"
|
||||||
|
width="100"
|
||||||
|
label="序列"
|
||||||
|
type="index"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
{{ scope.$index + 1 + (currentPage - 1) * pageSize }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="coverImg"
|
||||||
|
:resizable="true"
|
||||||
|
label="封面"
|
||||||
|
width="100"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<img class="coverImg" :src="baseUrl+scope.row.coverPath" alt="">
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="title"
|
||||||
|
:resizable="true"
|
||||||
|
label="标题"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:resizable="true"
|
||||||
|
align="center"
|
||||||
|
width="300"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template #default="scope">
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = false)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="edit" class="icon"></svg-icon>
|
||||||
|
<span class="edit">编辑</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
class="operate"
|
||||||
|
@click="
|
||||||
|
(dialogVisible = true), (form = scope.row), (readonly = true)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<svg-icon name="detail" class="icon"></svg-icon>
|
||||||
|
<span class="detail">详情</span>
|
||||||
|
</span>
|
||||||
|
<span class="operate" @click="del(scope.row.learnContentId)">
|
||||||
|
<svg-icon name="delete" class="icon"></svg-icon>
|
||||||
|
<span class="delete">删除</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<el-pagination
|
||||||
|
class="pagination"
|
||||||
|
@size-change="getList"
|
||||||
|
@current-change="getList"
|
||||||
|
v-model:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
v-model:page-size.sync="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total"
|
||||||
|
background
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
<!-- 新增/修改 -->
|
||||||
|
<Add
|
||||||
|
:visible="dialogVisible"
|
||||||
|
:form="form"
|
||||||
|
:readonly="readonly"
|
||||||
|
@close="onclone"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang='ts' setup>
|
||||||
|
import { onMounted, reactive, ref } from "vue";
|
||||||
|
import { partyLearnPage, partyLearnDelete } from "@/api/Sys";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import Add from "./add.vue";
|
||||||
|
import useUserStore from "@/store/modules/user";
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const user = ref(JSON.parse(userStore.userInfo));
|
||||||
|
const userId = ref(user.value.userId);
|
||||||
|
|
||||||
|
const baseUrl = ref(import.meta.env.VITE_UPLOAD_URL);
|
||||||
|
const search = ref('');
|
||||||
|
const tableData = ref([]);
|
||||||
|
const currentPage = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const dialogVisible = ref(false);
|
||||||
|
const form = ref({});
|
||||||
|
const readonly = ref(false);
|
||||||
|
|
||||||
|
//获取列表
|
||||||
|
const tableDataloading = ref(false);
|
||||||
|
const getList = () => {
|
||||||
|
tableDataloading.value = true;
|
||||||
|
let params = {
|
||||||
|
condition: search.value,
|
||||||
|
limit: pageSize.value,
|
||||||
|
page: currentPage.value,
|
||||||
|
};
|
||||||
|
partyLearnPage(params).then((res: any) => {
|
||||||
|
console.log(res,'res==>');
|
||||||
|
tableData.value = res.data.list;
|
||||||
|
total.value = res.data.total;
|
||||||
|
tableDataloading.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//删除列表
|
||||||
|
const del = (id) => {
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "提示", {
|
||||||
|
confirmButtonText: "是",
|
||||||
|
cancelButtonText: "否",
|
||||||
|
type: "warning",
|
||||||
|
}).then(() => {
|
||||||
|
let params = {
|
||||||
|
learnContentId:id
|
||||||
|
}
|
||||||
|
partyLearnDelete(params).then((res: any) => {
|
||||||
|
if (res.code == 1) {
|
||||||
|
ElMessage.success({
|
||||||
|
message: "删除成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error({
|
||||||
|
message: res.message,
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//关闭新增弹窗
|
||||||
|
const onclone = () => {
|
||||||
|
dialogVisible.value = false;
|
||||||
|
form.value = {};
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 0.26042vw;
|
||||||
|
box-shadow: 0 0 0.41667vw 0 rgb(8 33 85 / 10%);
|
||||||
|
height: 100%;
|
||||||
|
padding: 0.83333vw;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden !important;
|
||||||
|
box-sizing: border-box;
|
||||||
|
.table {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.coverImg {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user