Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/H5/threeSide
New file |
| | |
| | | {
|
| | | "marscode.codeCompletionPro": {
|
| | | "enableCodeCompletionPro": true
|
| | | },
|
| | | "marscode.enableInlineCommand": true
|
| | | } |
| | |
| | | <script> |
| | | export default { |
| | | onLaunch: function() { |
| | | console.log('App Launch') |
| | | |
| | | }, |
| | | onShow: function() { |
| | | console.log('App Show') |
| | | |
| | | }, |
| | | onHide: function() { |
| | | console.log('App Hide') |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | export default { |
| | | // BASE_URL: 'https://huacheng.psciio.com', |
| | | BASE_URL: 'http://192.168.110.188:6194', |
| | | BASE_URL: 'https://huacheng.psciio.com', |
| | | // BASE_URL: 'http://192.168.110.188:6194', |
| | | imageUrl: 'https://huacheng.psciio.com/api/huacheng-applets/common/uploadimages', |
| | | } |
| | |
| | | longPressActions: { |
| | | itemList: ['发送给朋友', '保存图片', '收藏'], |
| | | success: function(data) { |
| | | console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片'); |
| | | |
| | | }, |
| | | fail: function(err) { |
| | | console.log(err.errMsg); |
| | | |
| | | } |
| | | } |
| | | }); |
| | |
| | | }, |
| | | getproblem() { |
| | | getproblem().then((resp => { |
| | | console.log(resp, '问题类型') |
| | | |
| | | this.columns = [resp.data.map(item => { |
| | | return item.name |
| | | })] |
| | |
| | | videos: this.videos.join(','), |
| | | } |
| | | save(data).then(resp => { |
| | | console.log(resp, '保存'); |
| | | |
| | | if (resp.code == 200) { |
| | | uni.showToast({ |
| | | title: '保存成功', |
| | |
| | | }) |
| | | }, |
| | | confirmone(e) { |
| | | console.log(e, 'eeee'); |
| | | |
| | | this.time = dayjs(e.value).format('YYYY-MM-DD') |
| | | this.showDate = false |
| | | }, |
| | | confirmtwo(e) { |
| | | console.log(e, 'eeee'); |
| | | |
| | | this.problemType = e.value[0] |
| | | this.showList = false |
| | | }, |
| | |
| | | this.showList = false |
| | | }, |
| | | goTopagelocation() { |
| | | console.log('0000000000000000'); |
| | | |
| | | uni.navigateTo({ |
| | | url: '/pages/location/location' |
| | | }) |
| | |
| | | sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 |
| | | sourceType: ['album'], //从相册选择 |
| | | success: (res) => { |
| | | console.log(res, 'res'); |
| | | |
| | | uni.showLoading() |
| | | uni.uploadFile({ |
| | | url: config.imageUrl, |
| | |
| | | 'Authorization': uni.getStorageSync('token') |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | console.log(JSON.parse(uploadFileRes.data), 'uploadFileRes'); |
| | | |
| | | this.images = [...this.images, JSON.parse(uploadFileRes.data).data] |
| | | uni.hideLoading() |
| | | }, |
| | |
| | | count: 1, //默认9 |
| | | sourceType: ['camera', 'album'], |
| | | success: (res) => { |
| | | console.log(res, 'res'); |
| | | const videoExtensions = /\.(mp4|avi|rmvb)$/i; |
| | | if (!videoExtensions.test(res.name)) { |
| | | uni.showToast({ |
| | | title: '请上传mp4, avi, rmvb格式的视频', |
| | | icon: 'none', |
| | | duration: 3000 |
| | | }) |
| | | return |
| | | } |
| | | uni.showLoading() |
| | | uni.uploadFile({ |
| | | url: config.imageUrl, |
| | |
| | | 'Authorization': uni.getStorageSync('token') |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | console.log(JSON.parse(uploadFileRes.data).data, 'uploadFileRes'); |
| | | |
| | | this.videos = [...this.videos, JSON.parse(uploadFileRes.data).data] |
| | | uni.hideLoading() |
| | | }, |
| | |
| | | methods: { |
| | | open() { |
| | | getInfo().then(resp => { |
| | | console.log(resp, '党员信息'); |
| | | |
| | | if(resp.code==200){ |
| | | this.info =resp.data |
| | | } |
| | |
| | | <view class="top_content"> |
| | | <image src="/static/home/bg@2x.png" class="bg-img vw100" style="z-index: 1;" mode=""></image> |
| | | <view class="main"> |
| | | <image src="/static/home/img6.png" class="h-85" mode=""></image> |
| | | <image class="w-275 h-28 mt-15" src="/static/home/img3.png" mode=""></image> |
| | | <image src="/static/home/img6.png" mode="widthFix"></image> |
| | | <image class="w-275 mt-15" src="/static/home/img3.png" mode="widthFix"></image> |
| | | <view class="flex a-center mt-17 mb-31"> |
| | | <image class="h-32" src="/static/home/img5.png" mode=""></image> |
| | | <image src="/static/home/img5.png" mode="widthFix"></image> |
| | | </view> |
| | | <swiper class="swiper " :indicator-dots="false" :autoplay="true" :interval="3000"> |
| | | <swiper-item v-for="item,index in bannerlist" :key="index"> |
| | |
| | | methods: { |
| | | Allread() { |
| | | getread().then(resp => { |
| | | console.log(resp, '====='); |
| | | |
| | | this.getMessagelist() |
| | | }) |
| | | }, |
| | | getBanner() { |
| | | getBanner().then(resp => { |
| | | console.log(resp, '获取banner'); |
| | | |
| | | this.bannerlist = resp.data |
| | | }) |
| | | }, |
| | | getappletcinfo() { |
| | | getappletcinfo().then(resp => { |
| | | console.log(resp, '-----判断角色'); |
| | | |
| | | this.userInfo = resp.data |
| | | this.member = resp.data ? 2 : 1 |
| | | uni.setStorageSync('userInfo', resp.data) |
| | |
| | | pageSize: 5 |
| | | } |
| | | getMessagelist(data).then(resp => { |
| | | console.log(resp, '获取消息列表'); |
| | | |
| | | if (resp.data.records.length < 5 && this.pageNum == 1) { |
| | | this.msgListTotal = resp.data.records |
| | | this.isLoading = true |
| | |
| | | 1) |
| | | this.noreadlists = this.msgLists.filter(item => item.readStatus === 0) |
| | | this.noreadlist = this.msgList.filter(item => item.readStatus === 0) |
| | | console.log(this.msgListTotal, 'this.msgListTotal'); |
| | | |
| | | }) |
| | | }, |
| | | changeActive(value) { |
| | |
| | | |
| | | }, |
| | | change() { |
| | | console.log('1111'); |
| | | |
| | | }, |
| | | |
| | | onClick() { |
| | | this.isClick = true |
| | | console.log('this.isClick', this.isClick); |
| | | |
| | | }, |
| | | goTopage() { |
| | | uni.navigateTo({ |
| | |
| | | result.id = index + 1 |
| | | return result |
| | | }); |
| | | console.log(this.locationList); |
| | | |
| | | } |
| | | }) |
| | | return |
| | |
| | | ak: '3mHKIXMArjgIkgADzOlTYp4XssNSNkwr' // 替换为你自己的 AK |
| | | }, |
| | | success: (res) => { |
| | | console.log(res, '-------'); |
| | | |
| | | if (res.data.status === 0) { |
| | | this.searchResults = res.data.results; |
| | | this.latitude = res.data.results[0].location.lat |
| | |
| | | }, |
| | | onReady() { |
| | | this.map = new BMapGL.Map("container"); // 创建地图实例 |
| | | console.log(this.map); |
| | | |
| | | // uni.getLocation({ |
| | | // type: 'wgs84', |
| | | // success: (res) => { |
| | |
| | | const longitude = position.coords.longitude; |
| | | const accuracy = position.coords.accuracy; // 精度,单位米 |
| | | |
| | | console.log(`纬度: ${latitude}, 经度: ${longitude}, 精度: ${accuracy}`); |
| | | |
| | | // 在这里可以使用获取到的经纬度信息,例如在地图上显示位置等。 |
| | | } |
| | | |
| | | function error(err) { |
| | | console.log(err); |
| | | |
| | | switch (err.code) { |
| | | case err.PERMISSION_DENIED: |
| | | console.error("用户拒绝了位置请求。"); |
| | |
| | | item.id = index + 1 |
| | | return item |
| | | }) |
| | | console.log(this.locationList); |
| | | |
| | | }) |
| | | this.map.addEventListener('click', (e) => { |
| | | this.clearMarkers() |
| | |
| | | var myGeo = new BMapGL.Geocoder(); |
| | | // 根据坐标得到地址描述 |
| | | myGeo.getLocation(new BMapGL.Point(e.latlng.lng, e.latlng.lat), (result) => { |
| | | console.log(result, 'result'); |
| | | |
| | | this.locationList = result.surroundingPois.map((item, index) => { |
| | | item.id = index + 1 |
| | | return item |
| | |
| | | }); |
| | | // }, |
| | | // error:err=>{ |
| | | // console.log(err,'err'); |
| | | // |
| | | // } |
| | | // }); |
| | | |
| | |
| | | return dayjs(val).format('YYYY-MM-DD HH:mm:ss') |
| | | } |
| | | }, |
| | | onLoad(params) { |
| | | onShow(params) { |
| | | this.id = params.id |
| | | if (params.type) { |
| | | this.type = false |
| | |
| | | getComplaintDetail({ |
| | | id: params.id |
| | | }).then(res => { |
| | | console.log('res', res) |
| | | |
| | | this.info = { |
| | | ...res.data |
| | | } |
| | |
| | | }) |
| | | }, |
| | | uploadImg(type) { |
| | | // if (!this.againCklicFlag) return |
| | | this.againCklicFlag = false |
| | | if (type == 1) { |
| | | uni.chooseImage({ |
| | | count: 1, |
| | | success: (chooseImageRes) => { |
| | | this.completionImages.push('loading') |
| | | this.againCklicFlag = true |
| | | let imgPathList = chooseImageRes.tempFilePaths; |
| | | if (imgPathList.length > 0) { |
| | | uni.uploadFile({ |
| | |
| | | this.localImageUrls.push(imgPathList[0]) |
| | | }) |
| | | } else { |
| | | this.againCklicFlag = true |
| | | this.completionImages = this.completionImages.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | this.againCklicFlag = true |
| | | this.completionImages = this.completionImages.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }) |
| | | } else { |
| | | uni.chooseVideo({ |
| | | camera: 'back', |
| | | count: 1, //默认9 |
| | | success: (res) => { |
| | | const videoExtensions = /\.(mp4|avi|rmvb)$/i; |
| | | if (!videoExtensions.test(res.name)) { |
| | | uni.showToast({ |
| | | title: '请上传mp4, avi, rmvb格式的视频', |
| | | icon: 'none', |
| | | duration: 3000 |
| | | }) |
| | | return |
| | | } |
| | | this.completionVideos.push('loading') |
| | | this.againCklicFlag = true |
| | | const tempFilePath = res.tempFilePath; |
| | | uni.uploadFile({ |
| | | url: config.imageUrl, |
| | |
| | | .data) |
| | | }) |
| | | } else { |
| | | this.againCklicFlag = true |
| | | this.completionVideos = this.completionVideos.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | } |
| | | }, |
| | | fail: (err) => { |
| | | this.againCklicFlag = true |
| | | this.completionVideos = this.completionVideos.filter( |
| | | item => item != 'loading') |
| | | uni.showToast({ |
| | |
| | | uni.chooseVideo({ |
| | | camera: 'back', |
| | | success: (res) => { |
| | | const videoExtensions = /\.(mp4|avi|rmvb)$/i; |
| | | if (!videoExtensions.test(res.name)) { |
| | | uni.showToast({ |
| | | title: '请上传mp4, avi, rmvb格式的视频', |
| | | icon: 'none', |
| | | duration: 3000 |
| | | }) |
| | | return |
| | | } |
| | | this.video.push('loading') |
| | | this.againCklicFlag = true |
| | | const tempFilePath = res.tempFilePath; |
| | |
| | | </view> |
| | | |
| | | <!-- 上级显示 --> |
| | | <view class="btnButtom" v-if="[0,1,2,6].includes(orderInfo.status) && !isParty"> |
| | | <view class="btnButtom" v-if="[0, 1, 2, 6].includes(orderInfo.status) && !isParty && orderInfo.auditButtonStatus == 1"> |
| | | <view class="btnDown" @click.stop="toUp" v-if="userInfo.accountLevel>1" |
| | | :class="[2,3].includes(userInfo.accountLevel)?'':'partyUp'">问题上报</view> |
| | | <view class="btnDown" @click.stop="toDown" v-if="userInfo.accountLevel<4" |
| | |
| | | <view class="btnAdd" @click="addProgress">添加办理进度</view> |
| | | <view class="btnAdd" @click="resultEntery">办理结果录入</view> |
| | | </view> |
| | | <view class="btnButtom" v-if="[5,7].includes(orderInfo.status) && !isParty"> |
| | | <view class="btnButtom" v-if="[5, 7].includes(orderInfo.status) && !isParty && orderInfo.auditButtonStatus == 0"> |
| | | <view class="cancel" @click.stop="showPop=true">驳回</view> |
| | | <view class="sure" @click.stop="submitReSolve">审核通过</view> |
| | | </view> |
| | |
| | | } |
| | | |
| | | getUserInfo().then(res => { |
| | | if (res.data == null) { |
| | | if (res.data == null || res.data.accountLevel == 5) { |
| | | this.isParty = true |
| | | } |
| | | this.userInfo = { |
| | |
| | | item.height = uni.$u.addUnit(rowHeight) |
| | | rows.push(item) |
| | | } |
| | | // console.log(rows); |
| | | // |
| | | return rows |
| | | }, |
| | | uTitleWidth() { |
| | |
| | | // width: `${this.startX + this.deltaX}px` |
| | | // } |
| | | // }) |
| | | // // console.log(this.startX + this.deltaX); |
| | | // // |
| | | // animation.transition(button, { |
| | | // styles: { |
| | | // transform: `translateX(${this.startX + this.deltaX}px)` |
| | |
| | | this.barStyle = { |
| | | width: `${width}px` |
| | | } |
| | | // console.log('width', width); |
| | | // |
| | | if (drag) { |
| | | this.$emit('drag', { |
| | | value |
| | |
| | | |
| | | // 开发环境才提示,生产环境不会提示 |
| | | if (process.env.NODE_ENV === 'development') { |
| | | console.log(`\n %c uView V${version} %c https://uviewui.com/ \n\n`, 'color: #ffffff; background: #3c9cff; padding:5px 0; border-radius: 5px;'); |
| | | |
| | | } |
| | | |
| | | export default { |
| | |
| | | * @param m solar month |
| | | * @param d solar day |
| | | * @return JSON object |
| | | * @eg:console.log(calendar.solar2lunar(1987,11,01)); |
| | | * @eg: |
| | | */ |
| | | solar2lunar: function (y, m, d) { // 参数区间1900.1.31~2100.12.31 |
| | | // 年份限定、上限 |
| | |
| | | * @param d lunar day |
| | | * @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可] |
| | | * @return JSON object |
| | | * @eg:console.log(calendar.lunar2solar(1987,9,10)); |
| | | * @eg: |
| | | */ |
| | | lunar2solar: function (y, m, d, isLeapMonth) { // 参数区间1900.1.31~2100.12.1 |
| | | var isLeapMonth = !!isLeapMonth |
| | |
| | | }, |
| | | favicons: [], |
| | | requestRecord: {}, |
| | | publicPath: REACT_APP_ENV === 'prod' ? '/admin/' : '/', |
| | | publicPath: REACT_APP_ENV === 'prod' ? './' : '/', |
| | | }); |
| | |
| | | export default { |
| | | dev: { |
| | | SERVER_URL: 'http://192.168.110.188:6194', |
| | | // SERVER_URL: 'https://huacheng.psciio.com', |
| | | }, |
| | | test: { |
| | | SERVER_URL: '', |
| | | }, |
| | | prod: { |
| | | SERVER_URL: '', |
| | | SERVER_URL: 'https://huacheng.psciio.com', |
| | | }, |
| | | }; |
| | |
| | | name: '人员管理', |
| | | path: '/setting/user', |
| | | component: './setting/user', |
| | | // access: '/system_setting/user_management', |
| | | access: '/system_setting/people_management', |
| | | } |
| | | ], |
| | | }, |
| | |
| | | ); |
| | | }, |
| | | ...initialState?.settings, |
| | | pageTitleRender: () => '“三个身边”群众工作机制平台' |
| | | }; |
| | | }; |
| | | |
| | |
| | | // |
| | | |
| | | const { currentUser } = initialState || {}; |
| | | console.log('currentUser currentUser currentUser currentUser',currentUser) |
| | | return <span className="anticon">{currentUser?.userName || '超级管理员'}</span>; |
| | | }; |
| | | |
| | |
| | | const { initialState, setInitialState } = useModel('@@initialState'); |
| | | |
| | | const [unreadCount, setUnreadCount] = useState(0); |
| | | const { currentUser } = initialState || {}; |
| | | useEffect(() => { |
| | | // const timer = setInterval(() => { |
| | | // getUnreadCount().then((res: any) => { |
| | | // setUnreadCount(res.data || 0); |
| | | // }); |
| | | // }, 1000 * 5) |
| | | const timer = setInterval(() => { |
| | | getUnreadCount().then((res: any) => { |
| | | setUnreadCount(res.data || 0); |
| | | }); |
| | | }, 1000 * 5) |
| | | |
| | | // return () => clearInterval(timer); |
| | | return () => clearInterval(timer); |
| | | }, []); |
| | | |
| | | |
| | | const onMenuClick = async () => { |
| | | await outLogin(); |
| | | localStorage.clear(); |
| | | history.push('/login'); |
| | | flushSync(() => { |
| | | setInitialState((s) => ({ ...s, currentUser: undefined })); |
| | | }); |
| | |
| | | <div style={{ border: '1px solid red', borderRadius: '50%', width: '18px', lineHeight: '16px', marginLeft: '5px', textAlign: 'center', color: 'red', flexShrink: 0 }}>{unreadCount}</div> |
| | | </div> |
| | | } |
| | | <div style={{ marginRight: '25px' }} >{currentUser?.userName || '超级管理员'}</div> |
| | | <div className="logoOut" onClick={onMenuClick}>退出登录<LogoutOutlined style={{ marginLeft: '5px' }} /></div> |
| | | </div> |
| | | }; |
| | |
| | | :where(.css-dev-only-do-not-override-17md30i).ant-menu-light>.ant-menu .ant-menu-submenu-selected>.ant-menu-submenu-title{ |
| | | color: rgba(0, 0, 0, 0.95); |
| | | } |
| | | |
| | | .del-confirm { |
| | | .del-icon { |
| | | margin-right: 5px; |
| | | width: 22px; |
| | | height: 22px; |
| | | background-color: rgba(233, 157, 66, 1); |
| | | color: #fff; |
| | | border-radius: 50%; |
| | | align-content: center; |
| | | text-align: center; |
| | | } |
| | | |
| | | .ant-modal-confirm-btns { |
| | | .ant-btn-default:last-child { |
| | | border-color: red !important; |
| | | color: #fff !important; |
| | | background-color: red !important; |
| | | } |
| | | |
| | | .ant-btn-default { |
| | | color: #000 !important; |
| | | border-color: #d9d9d9 !important; |
| | | } |
| | | } |
| | | } |
| | |
| | | id: 'pages.login.success', |
| | | defaultMessage: '登录成功!', |
| | | }); |
| | | const userInfo = { userName: data.name }; |
| | | const userInfo = { userName: data.name,...data }; |
| | | localStorage.setItem('userInfo', JSON.stringify(userInfo)); |
| | | let permissionList: any[] = [ |
| | | "/work_order_transaction_management/work_order_item_configuration", |
| | |
| | | "/system_setting/people_management/edit", |
| | | "/work_order_transaction_management/problem_type_management/add", |
| | | "/system_setting/unit_management/add", |
| | | "/system_setting/people_management/detail", |
| | | "/system_setting/role_management/detail", |
| | | "/system_setting/unit_management", |
| | | "/message_notification", |
| | | "/system_setting/role_management/add", |
| | |
| | | "/system_setting/position_management", |
| | | "/system_setting", |
| | | "/system_setting/people_management", |
| | | "/work_order_transaction_management/work_order_item_configuration/save", |
| | | ]; |
| | | let accessObj: any = {}; |
| | | permissionList.map((item) => { |
| | |
| | | setInitialState((s: any) => ({ |
| | | ...s, |
| | | token: data.token, |
| | | userName:data.name, |
| | | permission: accessObj, |
| | | currentUser: userInfo, |
| | | settings: Settings, |
| | |
| | | > |
| | | <div style={{ width: '787px', fontSize: '26px', textAlign: 'center' }}> |
| | | <h1> |
| | | “三个身边”群众工作机制问题化解 |
| | | “三个身边”群众工作机制 |
| | | </h1> |
| | | <h1>平台</h1> |
| | | </div> |
| | |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { Button, message, Space, Select } from 'antd'; |
| | | import { useRef, useState } from 'react'; |
| | | import { Button, message, Space, Select, Cascader } from 'antd'; |
| | | import { useRef, useState, useEffect } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import { getList, setStatus } from './service' |
| | | import { getList, setStatus, getUnitList,systemPostList } from './service' |
| | | import { render } from 'react-dom'; |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | | const access = useAccess(); |
| | | const [items, setItems] = useState([]); |
| | | const [positionList, setPositionList] = useState([]); |
| | | |
| | | const columns = [ |
| | | { |
| | |
| | | }, |
| | | { |
| | | title: '所在单位', |
| | | dataIndex: 'department', |
| | | renderFormItem: (_, { type, defaultRender, ...rest }, form) => { |
| | | dataIndex: 'departmentId', |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | placeholder="请选择" |
| | | filterOption={false} |
| | | options={[{ label: '市级', value: '1' }, { label: '区县', value: '2' }, { label: '街道', value: '3' }, { label: '社区', value: '4' }, { label: '党员', value: '5' }]} |
| | | > |
| | | </Select > |
| | | ) |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | render: (_, record) => { |
| | | return record.department |
| | |
| | | allowClear |
| | | placeholder="请选择" |
| | | filterOption={false} |
| | | options={[{ label: '市级', value: '1' }, { label: '区县', value: '2' }, { label: '街道', value: '3' }, { label: '社区', value: '4' }, { label: '党员', value: '5' }]} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | | options={positionList} |
| | | > |
| | | </Select > |
| | | ) |
| | |
| | | title: '诉求应处理时间', |
| | | dataIndex: 'responseTime', |
| | | hideInSearch: true, |
| | | render: (_, record) => { |
| | | return record.responseTime.split('T')[0] |
| | | |
| | | } |
| | | }, |
| | | { |
| | | title: '提示类型', |
| | |
| | | render: (text, record) => { |
| | | return ( |
| | | <Space> |
| | | {record.readStatus == 0 && ( |
| | | <Access accessible={access['/message_notification/mark_read']}> |
| | | <Button |
| | | type="link" |
| | |
| | | if (status) { |
| | | actionRef.current.reload(); |
| | | } |
| | | }, '确认将所选信息标记为已读吗?'); |
| | | }, '确认将所选信息标记为已读吗?', '确定', '取消', '操作提示'); |
| | | }} |
| | | > |
| | | 标记已读 |
| | | </Button> |
| | | </Access> |
| | | )} |
| | | |
| | | </Space > |
| | | ); |
| | | }, |
| | | }, |
| | | ] |
| | | useEffect(() => { |
| | | fetchUnit(); |
| | | systemPostList({ pageNum: 1, pageSize: 10000 }).then(res => { |
| | | setPositionList(() => res.data.records) |
| | | }) |
| | | }, []); |
| | | |
| | | const fetchUnit = () => { |
| | | getUnitList().then((res) => { |
| | | if (res.code == 200 && res.data) { |
| | | const traverseItems = (items) => { |
| | | return items.map((item) => { |
| | | item.key = item.id; |
| | | item.title = '1'; |
| | | if (item.child && item.child.length > 0) { |
| | | item.children = traverseItems(item.child); |
| | | } |
| | | return item; |
| | | }); |
| | | }; |
| | | setItems(traverseItems(res.data)); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | return <div> |
| | | <PageContainer title='消息通知'> |
| | | <PageContainer title='消息通知' header={{ |
| | | breadcrumb: {}, |
| | | }}> |
| | | <ProTable |
| | | rowKey='id' |
| | | actionRef={actionRef} |
| | |
| | | }} |
| | | search={{ labelWidth: 140 }} |
| | | request={(params) => { |
| | | params.bannerType = Number(params.bannerType) |
| | | if (params.departmentId) { |
| | | params.departmentId = params.departmentId[params.departmentId.length - 1]; |
| | | } |
| | | return buildProTableDataSource(getList, params) |
| | | }} |
| | | toolBarRender={false} |
| | |
| | | export const getList = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/messageNotification/list`, { |
| | | method: 'GET', |
| | | data |
| | | params:data |
| | | }); |
| | | } |
| | | // 设置已读 |
| | |
| | | }); |
| | | } |
| | | |
| | | // 单位列表 |
| | | export const getUnitList = async (params) => { |
| | | return request(`/api/huacheng-sangeshenbian/department/list`, { |
| | | method: 'GET', |
| | | params |
| | | }); |
| | | } |
| | | // 获取职位列表数据 |
| | | export const systemPostList = async (params) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemPost/list`, { |
| | | method: 'GET',params |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 详情列表 |
| | | export const getDetailList = async (data) => { |
| | |
| | | } |
| | | { |
| | | !record.admin && |
| | | <Access accessible={access['/position_management/del']}> |
| | | <Access accessible={access['/system_setting/position_management/del']}> |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | let status = await sendRequest(del, record.deptId); |
| | | let status = await sendRequest(del, record); |
| | | if (status) { |
| | | actionRef.current.reload(); |
| | | } |
| | |
| | | const okHandle = () => { |
| | | form.validateFields().then((values) => { |
| | | setSpinning(true) |
| | | values.menuIds = treeSeletKeys |
| | | values.systemMenuIds = treeSeletKeys |
| | | delete values.tree |
| | | if (data.id) { |
| | | values.id = data.id |
| | |
| | | return ( |
| | | <Space> |
| | | { |
| | | record.roleId != 1 && |
| | | record.id != 1 && |
| | | <Access accessible={access['/system_setting/role_management/edit']}> |
| | | <Button |
| | | type="link" |
| | |
| | | </Access> |
| | | } |
| | | { |
| | | record.roleId != 1 && |
| | | record.id != 1 && |
| | | <Access accessible={access['/system_setting/role_management/del']}> |
| | | <Button |
| | | type="link" |
| | |
| | | </Button> |
| | | </Access> |
| | | } |
| | | <Access accessible={access['/system_setting/role_management/detail'] || false}> |
| | | <Access accessible={access['/system_setting/role_management/detail']}> |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | |
| | | }, |
| | | ] |
| | | |
| | | return <PageContainer title='角色管理'> |
| | | return <PageContainer title='角色管理' header={{ |
| | | breadcrumb: {}, |
| | | }}> |
| | | <ProTable |
| | | rowKey='id' |
| | | actionRef={actionRef} |
| | |
| | | import { Form, Input, Modal, Tree, Button, Spin, Row, Col, Select, Radio } from 'antd'; |
| | | import { Form, Input, Modal, Tree, Button, Spin, Row, Col, Select, Radio, Cascader } from 'antd'; |
| | | import { forwardRef, useImperativeHandle, useState } from 'react'; |
| | | import { useEffect } from 'react'; |
| | | import { getDepartmentList } from '../service'; |
| | | import { Color } from 'antd/es/color-picker'; |
| | | import { getDepartmentList, systemPostList, systemRoleList, getSystemUserInfo, getCityList, addSystemUserInfo, editSystemUserInfo } from '../service'; |
| | | import CryptoJS from 'crypto-js'; |
| | | const formItemLayout = { |
| | | labelCol: { span: 8 }, |
| | | wrapperCol: { span: 16 }, |
| | |
| | | const AddAndEdit = ({ visible, onSave, onUpdate, onCancel }, ref) => { |
| | | const [form] = Form.useForm(); |
| | | const [data, setData] = useState({}) |
| | | const [treeData, setTreeData] = useState([]);//权限树 |
| | | const [treeSeletKeys, setTreeSeletKeys] = useState([]); //勾选权限 |
| | | const [detailType, setDetailType] = useState(false);//是否详情 |
| | | const [spinning, setSpinning] = useState(false); |
| | | |
| | | const [oneCompanyList, setOneCompanyList] = useState([]) |
| | | |
| | | const [twoCompanyList, setTwoCompanyList] = useState([]) |
| | | const [threeCompanyList, setThreeCompanyList] = useState([]) |
| | | const [fourCompanyList, setFourCompanyList] = useState([]) |
| | | |
| | | const [adminLevel, setAdminLevel] = useState(1) |
| | | |
| | | //所属职位 |
| | | const [positionList, setPositionList] = useState([]) |
| | |
| | | const [roleList, setRoleList] = useState([]) |
| | | //账号层级 |
| | | const [levelList, setLevelList] = useState([{ name: '市级账号', value: 1 }, { name: '区县账号', value: 2 }, { name: '街道账号', value: 3 }, { name: '社区账号', value: 4 }, { name: '党员账号', value: 5 }]) |
| | | //选择的层级 |
| | | const [activeLevel, setActiveLevel] = useState('') |
| | | //所属区县 |
| | | const [countyList, setCountyList] = useState([]) |
| | | const [activeCounty, setActiveCounty] = useState({}) |
| | | //所属街道 |
| | | const [streetList, setStreetList] = useState([]) |
| | | const [activeStreet, setActiveStreet] = useState({}) |
| | | //所属社区 |
| | | const [communityList, setCommunityList] = useState([]) |
| | | const [activeCommunity, setActiveCommunity] = useState({}) |
| | | |
| | | |
| | | |
| | | |
| | | useEffect(() => { |
| | | // 获取单位 |
| | | getDepartmentList(1).then(res => { |
| | | setOneCompanyList(() => res.data) |
| | | }) |
| | | getDepartmentList(2).then(res => { |
| | | setTwoCompanyList(() => res.data) |
| | | }) |
| | | getDepartmentList(3).then(res => { |
| | | setThreeCompanyList(() => res.data) |
| | | }) |
| | | getDepartmentList(4).then(res => { |
| | | setThreeCompanyList(() => res.data) |
| | | }) |
| | | |
| | | }, []) |
| | | |
| | | useImperativeHandle(ref, () => { |
| | | return { |
| | | refreshData: (data, type) => { |
| | | setDetailType(type || false) |
| | | if (data.id) { |
| | | // 获取角色的权限树 |
| | | getTree(data.id).then(res => { |
| | | setTreeSeletKeys(res.data.systemMenuIds || []); |
| | | refreshData: (data, companyList) => { |
| | | getCountyList() |
| | | setOneCompanyList(() => companyList) |
| | | console.log('companyList', companyList) |
| | | |
| | | systemPostList({ pageNum: 1, pageSize: 10000 }).then(res => { |
| | | setPositionList(() => res.data.records) |
| | | }) |
| | | systemRoleList({ pageNum: 1, pageSize: 10000 }).then(res => { |
| | | setRoleList(() => res.data.records) |
| | | }) |
| | | // 权限判断 |
| | | let adminInfo = JSON.parse(localStorage.getItem('userInfo')) |
| | | setAdminLevel(() => adminInfo.accountLevel) |
| | | switch (adminInfo.accountLevel) { |
| | | case 1: |
| | | setLevelList(() => [{ name: '市级账号', value: 1 }, { name: '区县账号', value: 2 }, { name: '街道账号', value: 3 }, { name: '社区账号', value: 4 }, { name: '党员账号', value: 5 }]) |
| | | break; |
| | | case 2: |
| | | getStreetList(adminInfo.districtsCode) |
| | | setLevelList(() => [{ name: '区县账号', value: 2 }, { name: '街道账号', value: 3 }, { name: '社区账号', value: 4 }, { name: '党员账号', value: 5 }]) |
| | | this.$nextTick(() => { |
| | | form.setFieldsValue({ districtsCode: adminInfo.districtsCode }) |
| | | }) |
| | | |
| | | break; |
| | | case 3: |
| | | getStreetList(adminInfo.districtsCode) |
| | | getcommunityList(adminInfo.streetId) |
| | | setLevelList(() => [{ name: '街道账号', value: 3 }, { name: '社区账号', value: 4 }, { name: '党员账号', value: 5 }]) |
| | | form.setFieldsValue({ districtsCode: adminInfo.districtsCode }) |
| | | form.setFieldsValue({ streetId: adminInfo.streetId }) |
| | | break; |
| | | case 4: |
| | | getStreetList(adminInfo.districtsCode) |
| | | getcommunityList(adminInfo.streetId) |
| | | setLevelList(() => [{ name: '社区账号', value: 4 }, { name: '党员账号', value: 5 }]) |
| | | // this.$nextTick(() => { |
| | | form.setFieldsValue({ districtsCode: adminInfo.districtsCode }) |
| | | form.setFieldsValue({ streetId: adminInfo.streetId }) |
| | | form.setFieldsValue({ communityId: adminInfo.communityId * 1 }) |
| | | // }) |
| | | |
| | | |
| | | break; |
| | | case 5: |
| | | getStreetList(adminInfo.districtsCode) |
| | | getcommunityList(adminInfo.streetId) |
| | | setLevelList(() => [{ name: '党员账号', value: 5 }]) |
| | | form.setFieldsValue({ districtsCode: adminInfo.districtsCode }) |
| | | form.setFieldsValue({ streetId: adminInfo.streetId }) |
| | | form.setFieldsValue({ communityId: adminInfo.communityId * 1 }) |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | setData(data) |
| | | form.setFieldsValue(data); |
| | | |
| | | |
| | | |
| | | if (data.id) { |
| | | getInfo(data.id) |
| | | } |
| | | setData(() => data) |
| | | if (data.unitId) { |
| | | let result = [] |
| | | findParent(companyList, data.unitId * 1, result) |
| | | form.setFieldsValue({ DepartmentId: result }) |
| | | } |
| | | }, |
| | | clean: () => { |
| | | setSpinning(false) |
| | |
| | | // 保存 |
| | | const okHandle = () => { |
| | | form.validateFields().then((values) => { |
| | | setSpinning(true) |
| | | values.menuIds = treeSeletKeys |
| | | delete values.tree |
| | | values.password = CryptoJS.MD5(values.password).toString(); |
| | | if (values.DepartmentId) { |
| | | values.oneDepartmentId = values.DepartmentId.length > 0 ? values.DepartmentId[0] : null |
| | | values.twoDepartmentId = values.DepartmentId.length > 1 ? values.DepartmentId[1] : null |
| | | values.threeDepartmentId = values.DepartmentId.length > 2 ? values.DepartmentId[2] : null |
| | | values.fourDepartmentId = values.DepartmentId.length > 3 ? values.DepartmentId[3] : null |
| | | } |
| | | if (data.id) { |
| | | values.id = data.id |
| | | onUpdate(values) |
| | |
| | | } |
| | | }); |
| | | }; |
| | | const getCountyList = (id) => { |
| | | getCityList({ id: '510400', tier: 2 }).then(res => { |
| | | setCountyList(() => res.data) |
| | | }) |
| | | } |
| | | const getStreetList = (id) => { |
| | | getCityList({ id: id, tier: 3 }).then(res => { |
| | | setStreetList(() => res.data) |
| | | }) |
| | | } |
| | | const getcommunityList = (id) => { |
| | | getCityList({ id: id, tier: 4 }).then(res => { |
| | | setCommunityList(() => res.data) |
| | | }) |
| | | } |
| | | const changeCountry = (value, label) => { |
| | | setActiveCounty(label) |
| | | getStreetList(value) |
| | | form.setFieldsValue({ streetId: '', communityId: '' }) |
| | | setActiveCommunity({ name: '', id: '' }) |
| | | setActiveStreet({ name: '', id: '' }) |
| | | |
| | | } |
| | | const changeStreet = (value, label) => { |
| | | setActiveStreet(label) |
| | | getcommunityList(value) |
| | | form.setFieldsValue({ communityId: '' }) |
| | | setActiveCommunity({ name: '', id: '' }) |
| | | } |
| | | const changeCommunity = (value, label) => { |
| | | setActiveCommunity(label) |
| | | } |
| | | const getInfo = (id) => { |
| | | getSystemUserInfo(id).then(res => { |
| | | if (res.data.districtsCode) { |
| | | setActiveStreet({ name: res.data.districts, id: res.data.districtsCode }) |
| | | getStreetList(res.data.districtsCode) |
| | | } |
| | | if (res.data.streetId) { |
| | | setActiveCounty({ name: res.data.street, id: res.data.streetId }) |
| | | getcommunityList(res.data.streetId) |
| | | } |
| | | if (res.data.communityId) { |
| | | setActiveCommunity({ name: res.data.community, id: res.data.communityId }) |
| | | } |
| | | // delete res.data.password |
| | | |
| | | let departmentId = [] |
| | | if (res.data.oneDepartmentId) { |
| | | departmentId.push(res.data.oneDepartmentId) |
| | | } |
| | | if (res.data.twoDepartmentId) { |
| | | departmentId.push(res.data.twoDepartmentId) |
| | | } |
| | | if (res.data.threeDepartmentId) { |
| | | departmentId.push(res.data.threeDepartmentId) |
| | | } |
| | | if (res.data.fourDepartmentId) { |
| | | departmentId.push(res.data.fourDepartmentId) |
| | | } |
| | | res.data.DepartmentId = departmentId |
| | | console.log('departmentId', departmentId) |
| | | setActiveLevel(() => res.data.accountLevel) |
| | | |
| | | form.setFieldsValue({ ...res.data, password: '' }) |
| | | }) |
| | | } |
| | | const findParent = (data, target, result) => { |
| | | for (let item of data) { |
| | | if (item.id === target) { |
| | | //将查找到的目标数据加入结果数组中 |
| | | //可根据需求unshift(item.id)或unshift(item) |
| | | result.unshift(item.id) |
| | | return true |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | //根据查找到的结果往上找父级节点 |
| | | let isFind = findParent(item.children, target, result) |
| | | if (isFind) { |
| | | result.unshift(item.id) |
| | | return true |
| | | } |
| | | } |
| | | } |
| | | //走到这说明没找到目标 |
| | | return false |
| | | } |
| | | |
| | | return ( |
| | | <Modal |
| | | getContainer={false} |
| | | width="65%" |
| | | destroyOnClose |
| | | title={detailType ? '人员详情' : data.id ? '编辑人员' : '添加人员'} |
| | | title={data.type == 'detail' ? '人员详情' : data.type == 'edit' ? '编辑人员' : '添加人员'} |
| | | open={visible} |
| | | onCancel={() => onCancel(false)} |
| | | afterClose={() => { |
| | | form.resetFields() |
| | | setTreeSeletKeys([]) |
| | | }} |
| | | footer={ |
| | | !detailType ? |
| | | (data.type == 'edit' || data.type == 'add') ? |
| | | [ |
| | | <Button key="back" onClick={() => onCancel(false)}>取消</Button>, |
| | | <Button key="submit" type="primary" onClick={okHandle}> |
| | |
| | | label="姓名" |
| | | rules={[{ required: true, message: '请输入人员姓名' }]} |
| | | > |
| | | <Input disabled={detailType} placeholder='请输入人员姓名' /> |
| | | <Input disabled={data.type == 'detail'} placeholder='请输入人员姓名' /> |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | <Row> |
| | | <Col span={8}> |
| | | <Col span={16}> |
| | | <Form.Item |
| | | name="oneDepartmentId" |
| | | label="所属一级单位" |
| | | rules={[{ required: true, message: '请选择所属一级单位' }]} |
| | | name="DepartmentId" |
| | | label="所属单位" |
| | | labelCol={{ span: 4 }} |
| | | rules={[{ required: true, message: '请选择所属单位' }]} |
| | | > |
| | | <Select |
| | | {/* <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | disabled={data.type == 'detail'} |
| | | placeholder="请选择" |
| | | options={oneCompanyList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | | filterOption={false} |
| | | > |
| | | </Select > |
| | | </Select > */} |
| | | <Cascader |
| | | changeSelect |
| | | options={oneCompanyList} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | placeholder="请选择" |
| | | // displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | {/* <Col span={8}> |
| | | <Form.Item |
| | | name="twoDepartmentId" |
| | | label="所属二级单位" |
| | |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | disabled={data.type == 'detail'} |
| | | placeholder="请选择" |
| | | options={twoCompanyList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | disabled={data.type == 'detail'} |
| | | placeholder="请选择" |
| | | options={threeCompanyList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | |
| | | > |
| | | </Select > |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> */} |
| | | </Row> |
| | | <Row> |
| | | {/* <Row> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="fourDepartmentId" |
| | |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | disabled={data.type == 'detail'} |
| | | placeholder="请选择" |
| | | options={fourCompanyList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | |
| | | </Select > |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Row> */} |
| | | <Row> |
| | | <Col span={8}> |
| | | <Form.Item |
| | |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | disabled={data.type == 'detail'} |
| | | placeholder="请选择" |
| | | options={positionList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | disabled={data.type == 'detail'} |
| | | placeholder="请选择" |
| | | options={roleList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | onChange={(e) => setActiveLevel(e)} |
| | | disabled={data.type == 'detail'} |
| | | placeholder="请选择" |
| | | options={levelList} |
| | | fieldNames={{ label: 'name', value: 'value' }} |
| | |
| | | rules={[{ required: true, message: '是否管理员' }]} |
| | | > |
| | | <Radio.Group |
| | | disabled={data.type == 'detail'} |
| | | // style={style} |
| | | // onChange={onChange} |
| | | // value={value} |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | {activeLevel != 1 && ( |
| | | <Row> |
| | | {[2, 3, 4, 5].includes(activeLevel) && ( |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="districts" |
| | | name="districtsCode" |
| | | label="所属区县" |
| | | rules={[{ required: true, message: '请选择所属区县' }]} |
| | | > |
| | | {/* <Select |
| | | // onChange={changeCountry} |
| | | // value={activeCounty} |
| | | placeholder="请选择" |
| | | options={levelList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | | > |
| | | </Select > */} |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | disabled={data.type == 'detail' || [2, 3, 4, 5].includes(adminLevel)} |
| | | onChange={changeCountry} |
| | | value={activeCounty.id} |
| | | placeholder="请选择" |
| | | options={oneCompanyList} |
| | | options={countyList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | | filterOption={false} |
| | | // filterOption={false} |
| | | > |
| | | </Select > |
| | | </Form.Item> |
| | | </Col> |
| | | )} |
| | | {[3, 4, 5].includes(activeLevel) && ( |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="street" |
| | | name="streetId" |
| | | label="所属街道" |
| | | rules={[{ required: true, message: '请选择所属街道' }]} |
| | | > |
| | | <Select |
| | | onChange={changeStreet} |
| | | disabled={!activeCounty || data.type == 'detail' || [3, 4, 5].includes(adminLevel)} |
| | | key="searchSelect" |
| | | allowClear |
| | | value={activeStreet.id} |
| | | placeholder="请选择" |
| | | options={twoCompanyList} |
| | | options={streetList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | | filterOption={false} |
| | | > |
| | | </Select > |
| | | </Form.Item> |
| | | </Col> |
| | | )} |
| | | |
| | | {[4, 5].includes(activeLevel) && ( |
| | | <Col span={8}> |
| | | <Form.Item |
| | | name="community" |
| | | name="communityId" |
| | | label="所属社区" |
| | | rules={[{ required: true, message: '请选择所属社区' }]} |
| | | > |
| | | <Select |
| | | onChange={changeCommunity} |
| | | disabled={!activeStreet || data.type == 'detail' || [4, 5].includes(adminLevel)} |
| | | key="searchSelect" |
| | | allowClear |
| | | value={activeCommunity.id} |
| | | placeholder="请选择" |
| | | options={threeCompanyList} |
| | | options={communityList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | | filterOption={false} |
| | | > |
| | | </Select > |
| | | </Form.Item> |
| | | </Col> |
| | | )} |
| | | </Row> |
| | | )} |
| | | |
| | | <Row> |
| | | <Col span={16}> |
| | | <Form.Item |
| | | label="联系方式" |
| | | required |
| | | labelCol={{ span: 4 }} |
| | | wrapperCol={{ span: 20 }} |
| | | style={{ marginBottom: 0 }} |
| | |
| | | <div style={{ display: "flex", flex: 1 }}> |
| | | <Form.Item |
| | | name="phone" |
| | | |
| | | rules={[{ |
| | | validator: (rule, value) => { |
| | | return new Promise((resolve, reject) => { |
| | |
| | | }, |
| | | }]} |
| | | > |
| | | <Input disabled={detailType} placeholder='请输入联系方式' /> |
| | | <Input disabled={data.type == 'detail'} placeholder='请输入联系方式' /> |
| | | </Form.Item> |
| | | <div style={{ fontSize: '12px', color: "rgba(0,0,0,0.5)", marginLeft: "10px" }}>联系方式将作为登录账号使用</div> |
| | | </div> |
| | |
| | | <Row> |
| | | <Col span={8}> |
| | | <Form.Item |
| | | required |
| | | required={data.type == 'add'} |
| | | name="password" |
| | | label="登录密码" |
| | | rules={[{ |
| | | validator: (rule, value) => { |
| | | return new Promise((resolve, reject) => { |
| | | if (!value) { |
| | | if (!value && data.type == 'add') { |
| | | reject('请输入新密码'); |
| | | } |
| | | const passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/; |
| | | if (!passwordRegex.test(value)) { |
| | | if (!passwordRegex.test(value) && data.type == 'add') { |
| | | reject('密码需要包含大小写字母,数字和特殊符号,且长度为8位以上'); |
| | | } |
| | | resolve(''); |
| | |
| | | }, |
| | | }]} |
| | | > |
| | | <Input.Password disabled={detailType} placeholder='请输入' /> |
| | | <Input.Password disabled={data.type == 'detail'} placeholder='请输入' /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={16}> |
| | | <Form.Item |
| | | label="确认密码" |
| | | required |
| | | required={data.type == 'add'} |
| | | labelCol={{ span: 4 }} |
| | | wrapperCol={{ span: 20 }} |
| | | style={{ marginBottom: 0 }} |
| | |
| | | rules={[{ |
| | | validator: (rule, value) => { |
| | | return new Promise((resolve, reject) => { |
| | | if (!value) { |
| | | if (!value && data.type == 'add') { |
| | | reject('请再次输入新密码'); |
| | | } |
| | | if (value != form.getFieldValue('password')) { |
| | | if (value != form.getFieldValue('password') && data.type == 'add') { |
| | | reject('两次密码请保持一致'); |
| | | } |
| | | resolve(''); |
| | |
| | | }, |
| | | },]} |
| | | > |
| | | <Input.Password disabled={detailType} placeholder='请输入' /> |
| | | <Input.Password disabled={data.type == 'detail'} placeholder='请输入' /> |
| | | </Form.Item> |
| | | <div style={{ fontSize: '12px', color: "rgba(0,0,0,0.5)", marginLeft: "10px" }}>密码需要包含大小写字母,数字和特殊符号,且长度为8位以上</div> |
| | | </div> |
New file |
| | |
| | | import { Button, Form, Input, Modal } from 'antd';
|
| | | import { forwardRef, useImperativeHandle, useState } from 'react';
|
| | |
|
| | | const formItemLayout = {
|
| | | labelCol: { span: 7 },
|
| | | wrapperCol: { span: 12 },
|
| | | };
|
| | |
|
| | | const AddEditView = ({ visible, onSave, onUpdate, onCancel }, ref) => {
|
| | | const [form] = Form.useForm();
|
| | | const [editData, setEditData] = useState({});
|
| | | const [rolesList, setRolesList] = useState();
|
| | |
|
| | | /**
|
| | | * 确定按钮事件
|
| | | */
|
| | | const okHandle = () => {
|
| | | form.validateFields().then((values) => {
|
| | | if (editData.id && editData.type === 'edit') {
|
| | | values.id = editData.id;
|
| | | if (editData.pid) {
|
| | | values.pid = editData.pid;
|
| | | }
|
| | | onUpdate(values);
|
| | | } else {
|
| | | if (editData.type === 'add') {
|
| | | values.pid = editData.id;
|
| | | }
|
| | | onSave(values);
|
| | | }
|
| | | });
|
| | | };
|
| | |
|
| | | useImperativeHandle(ref, () => {
|
| | | return {
|
| | | refreshData: (data) => {
|
| | | form.resetFields();
|
| | | if (data.id && data.type === 'edit') {
|
| | | form.setFieldsValue(data);
|
| | | }
|
| | | setEditData(data);
|
| | | },
|
| | | clean: () => {
|
| | | form.resetFields();
|
| | | },
|
| | | };
|
| | | });
|
| | |
|
| | | return (
|
| | | <Modal
|
| | | getContainer={false}
|
| | | width="25%"
|
| | | destroyOnClose
|
| | | title={editData.type === 'edit' ? '编辑单位' : '添加单位'}
|
| | | open={visible}
|
| | | onCancel={() => onCancel(false)}
|
| | | footer={[
|
| | | <Button key="back" onClick={() => onCancel(false)}>
|
| | | 关闭
|
| | | </Button>,
|
| | | <Button key="submit" type="primary" onClick={okHandle}>
|
| | | 确认
|
| | | </Button>,
|
| | | ]}
|
| | | >
|
| | | <Form layout="horizontal" {...formItemLayout} form={form} initialValues={{ isAuctioneer: 1 }}>
|
| | | <Form.Item
|
| | | name="name"
|
| | | required
|
| | | label="单位名称"
|
| | | rules={[{ required: true, message: '请输入单位名称' }]}
|
| | | >
|
| | | <Input placeholder="请输入单位名称" />
|
| | | </Form.Item>
|
| | | </Form>
|
| | | </Modal>
|
| | | );
|
| | | };
|
| | |
|
| | | export default forwardRef(AddEditView);
|
| | |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm } from '@/utils/antdUtils'; |
| | | import { buildProTableDataSource, sendRequest, showDelConfirm, showConfirm } from '@/utils/antdUtils'; |
| | | import { DeleteOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import { PageContainer, ProFormText, ProTable, QueryFilter } from '@ant-design/pro-components'; |
| | | import { Button, Col, Menu, Row, Space } from 'antd'; |
| | | import { Button, Cascader, Col, Menu, Row, Select, Space } from 'antd'; |
| | | import { useEffect, useRef, useState } from 'react'; |
| | | import { Access, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/addAndEdit'; |
| | | import { add, del, edit, getList, getUnitList } from './service'; |
| | | import AddUnit from './components/addUnit'; |
| | | import { |
| | | addSystemUserInfo, |
| | | addUnit, |
| | | del, |
| | | delUnit, |
| | | editSystemUserInfo, |
| | | editUnit, |
| | | getList, |
| | | getUnitList, |
| | | systemRoleList, |
| | | unfreezeApi, |
| | | freezeApi, |
| | | } from './service'; |
| | | |
| | | const Role = () => { |
| | | const actionRef = useRef(); |
| | | const addViewRef = useRef(); |
| | | const [modalVisible, handleModalVisibles] = useState(true); |
| | | const addViewRef1 = useRef(); |
| | | const [modalVisible, handleModalVisibles] = useState(false); |
| | | const [modalVisible1, handleModalVisibles1] = useState(false); |
| | | const [roleList, setRoleList] = useState([]); |
| | | const [unitId, setUnitId] = useState(''); |
| | | const access = useAccess(); |
| | | const [items, setItems] = useState([]); |
| | | const { SubMenu } = Menu; |
| | | useEffect(() => { |
| | | getUnitList().then((res) => { |
| | | console.log(res); |
| | | fetchUnit(); |
| | | systemRoleList({ pageNum: 1, pageSize: 10000 }).then((res) => { |
| | | setRoleList(() => res.data.records); |
| | | }); |
| | | }, []); |
| | | const items = [ |
| | | { |
| | | key: '1', |
| | | icon: ( |
| | | const node = (item) => { |
| | | return ( |
| | | <div |
| | | style={{ |
| | | display: 'flex', |
| | |
| | | width: '100%', |
| | | }} |
| | | > |
| | | <span>组织部</span> |
| | | <span>{item.name}</span> |
| | | <div> |
| | | {item.tier < 4 && ( |
| | | <Access accessible={access['/system_setting/unit_management/add']}> |
| | | <PlusOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | console.log(e); |
| | | addViewRef1.current.refreshData({ ...item, type: 'add' }); |
| | | handleModalVisibles1(true); |
| | | }} |
| | | /> |
| | | </Access> |
| | | )} |
| | | <Access accessible={access['/system_setting/unit_management/edit']}> |
| | | <EditOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | console.log(e); |
| | | addViewRef1.current.refreshData({ ...item, type: 'edit' }); |
| | | handleModalVisibles1(true); |
| | | }} |
| | | /> |
| | | </Access> |
| | | <Access accessible={access['/system_setting/unit_management/del']}> |
| | | <DeleteOutlined |
| | | onClick={(e) => { |
| | | e.stopPropagation(); |
| | | console.log(e); |
| | | showDelConfirm(async () => { |
| | | let status = await sendRequest(delUnit, item.id); |
| | | if (status) { |
| | | fetchUnit(); |
| | | } |
| | | }, '确认删除该单位吗?'); |
| | | }} |
| | | /> |
| | | </Access> |
| | | </div> |
| | | </div> |
| | | ), |
| | | children: [ |
| | | { |
| | | key: '11', |
| | | label: 'Option 1', |
| | | }, |
| | | { |
| | | key: '12', |
| | | label: 'Option 2', |
| | | }, |
| | | { |
| | | key: '13', |
| | | label: 'Option 3', |
| | | }, |
| | | { |
| | | key: '14', |
| | | label: 'Option 4', |
| | | }, |
| | | ], |
| | | }, |
| | | ]; |
| | | ); |
| | | }; |
| | | const renderMenuItems = (items) => { |
| | | return items.map((item) => { |
| | | if (item.children && item.children.length > 0) { |
| | | return ( |
| | | <SubMenu |
| | | key={item.key} |
| | | title={node(item)} |
| | | onTitleClick={(item) => { |
| | | setUnitId(item.key); |
| | | actionRef.current.reload(); |
| | | }} |
| | | > |
| | | {renderMenuItems(item.children)} |
| | | </SubMenu> |
| | | ); |
| | | } |
| | | return ( |
| | | <Menu.Item |
| | | onClick={(item) => { |
| | | setUnitId(item.key); |
| | | actionRef.current.reload(); |
| | | }} |
| | | key={item.key} |
| | | > |
| | | {node(item)} |
| | | </Menu.Item> |
| | | ); |
| | | }); |
| | | }; |
| | | const fetchUnit = (params) => { |
| | | getUnitList(params).then((res) => { |
| | | if (res.code == 200 && res.data) { |
| | | const traverseItems = (items) => { |
| | | return items.map((item) => { |
| | | item.key = item.id; |
| | | item.title = '1'; |
| | | if (item.child && item.child.length > 0) { |
| | | item.children = traverseItems(item.child); |
| | | } |
| | | return item; |
| | | }); |
| | | }; |
| | | setItems(traverseItems(res.data)); |
| | | } |
| | | }); |
| | | }; |
| | | const columns = [ |
| | | { |
| | | title: '角色名称', |
| | | title: '姓名', |
| | | dataIndex: 'name', |
| | | }, |
| | | { |
| | | title: '联系方式', |
| | | dataIndex: 'phone', |
| | | }, |
| | | { |
| | | title: '所在单位', |
| | | dataIndex: 'departmentName', |
| | | hideInSearch: true, |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | hideInTable: true, |
| | | title: '所在单位', |
| | | dataIndex: 'departmentId', |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Cascader |
| | | options={items} |
| | | fieldNames={{ value: 'key', label: 'name' }} |
| | | placeholder="请选择" |
| | | displayRender={(label) => label[label.length - 1]} |
| | | changeOnSelect={true} |
| | | /> |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | title: '所属职位', |
| | | dataIndex: 'systemPostName', |
| | | hideInSearch: true, |
| | | }, |
| | | { |
| | | title: '所属角色', |
| | | dataIndex: 'systemRoleName', |
| | | hideInSearch: true, |
| | | }, |
| | | { |
| | | title: '所属角色', |
| | | dataIndex: 'systemRoleId', |
| | | hideInTable: true, |
| | | renderFormItem: () => { |
| | | return ( |
| | | <Select |
| | | key="searchSelect" |
| | | allowClear |
| | | placeholder="请选择" |
| | | options={roleList} |
| | | fieldNames={{ label: 'name', value: 'id' }} |
| | | filterOption={false} |
| | | ></Select> |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | title: '账号层级', |
| | | dataIndex: 'accountLevel', |
| | | // (1=市级账号,2=区县账号,3=街道账号,4=社区账号) |
| | | render: (text, record) => { |
| | | let role = ''; |
| | | switch (record.accountLevel) { |
| | | case 1: |
| | | role = '市'; |
| | | break; |
| | | case 2: |
| | | role = '区县'; |
| | | break; |
| | | case 3: |
| | | role = '街道'; |
| | | break; |
| | | case 4: |
| | | role = '社区'; |
| | | break; |
| | | case 5: |
| | | role = '党员'; |
| | | break; |
| | | default: |
| | | role = ''; |
| | | } |
| | | return role; |
| | | }, |
| | | valueEnum: { |
| | | 1: '市', |
| | | 2: '区县', |
| | | 3: '街道', |
| | | 4: '社区', |
| | | 5: '党员', |
| | | }, |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | // (1=使用中,2=已冻结) |
| | | hideInSearch: true, |
| | | render: (text, record) => { |
| | | let status = ''; |
| | | switch (record.status) { |
| | | case 1: |
| | | status = '使用中'; |
| | | break; |
| | | case 2: |
| | | status = '已冻结'; |
| | | break; |
| | | default: |
| | | status = ''; |
| | | } |
| | | return status; |
| | | }, |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | return ( |
| | | <Space> |
| | | {record.roleId != 1 && ( |
| | | <Access accessible={access['/system_setting/role_management/edit']}> |
| | | <Button |
| | | type="link" |
| | | <Access accessible={access['/system_setting/people_management/edit']}> |
| | | <a |
| | | onClick={() => { |
| | | addViewRef.current.refreshData(record); |
| | | addViewRef.current.refreshData({ ...record, type: 'edit' },items); |
| | | handleModalVisibles(true); |
| | | }} |
| | | > |
| | | 编辑 |
| | | </Button> |
| | | </a> |
| | | </Access> |
| | | )} |
| | | {record.roleId != 1 && ( |
| | | <Access accessible={access['/system_setting/role_management/del']}> |
| | | <Button |
| | | type="link" |
| | | <Access accessible={access['/system_setting/people_management/del']}> |
| | | <a |
| | | onClick={() => { |
| | | showDelConfirm(async () => { |
| | | let status = await sendRequest(del, record.id); |
| | |
| | | }} |
| | | > |
| | | 删除 |
| | | </Button> |
| | | </a> |
| | | </Access> |
| | | )} |
| | | <Access accessible={access['/system_setting/role_management/detail'] || false}> |
| | | <Button |
| | | type="link" |
| | | <Access accessible={access['/system_setting/people_management/detail']}> |
| | | <a |
| | | onClick={() => { |
| | | addViewRef.current.refreshData(record, true); |
| | | addViewRef.current.refreshData({ ...record, type: 'detail' },items); |
| | | handleModalVisibles(true); |
| | | }} |
| | | > |
| | | 查看详情 |
| | | </Button> |
| | | </a> |
| | | </Access> |
| | | <Access accessible={access['/system_setting/people_management/freeze']}> |
| | | <a |
| | | onClick={() => { |
| | | showConfirm(`确认${record.status === 1 ? '冻结' : '解冻'}该人员吗?`,'', async () => { |
| | | let status = await sendRequest( |
| | | record.status === 1 ? freezeApi : unfreezeApi, |
| | | record.id, |
| | | ); |
| | | if (status) { |
| | | actionRef.current.reload(); |
| | | } |
| | | }); |
| | | }} |
| | | > |
| | | {record.status === 1 ? '冻结' : '解冻'} |
| | | </a> |
| | | </Access> |
| | | </Space> |
| | | ); |
| | |
| | | <PageContainer |
| | | header={{ |
| | | breadcrumb: {}, |
| | | title: '人员管理', |
| | | }} |
| | | > |
| | | <div style={{ background: '#fff' }}> |
| | | <QueryFilter> |
| | | <QueryFilter |
| | | onReset={(values) => { |
| | | fetchUnit(values); |
| | | setUnitId(''); |
| | | actionRef.current.reload(); |
| | | }} |
| | | onFinish={(values) => { |
| | | fetchUnit(values); |
| | | setUnitId(''); |
| | | actionRef.current.reload(); |
| | | }} |
| | | > |
| | | <ProFormText name="name" label="单位名称" /> |
| | | </QueryFilter> |
| | | </div> |
| | | <Row style={{ marginTop: 20, background: '#fff' }}> |
| | | <Col span={4}> |
| | | <Menu |
| | | mode="inline" |
| | | defaultSelectedKeys={['231']} |
| | | style={{ |
| | | // width: 256, |
| | | height: '100%', |
| | | <Space style={{ margin: '10px 0' }}> |
| | | <span style={{ margin: '0 27px' }}>单位管理</span> |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | addViewRef1.current.refreshData({}); |
| | | handleModalVisibles1(true); |
| | | }} |
| | | items={items} |
| | | /> |
| | | > |
| | | 添加 |
| | | </Button> |
| | | </Space> |
| | | |
| | | <Menu mode="inline">{renderMenuItems(items)}</Menu> |
| | | </Col> |
| | | <Col span={20} style={{ minHeight: 650 }}> |
| | | <ProTable |
| | |
| | | showQuickJumper: true, |
| | | defaultPageSize: 10, |
| | | }} |
| | | // request={(params) => buildProTableDataSource(getList, params)} |
| | | search={{ |
| | | labelWidth: 'auto', |
| | | span: 6, |
| | | defaultCollapsed: false, // 默认是否收起 |
| | | }} |
| | | request={(params) => { |
| | | let obj = { ...params }; |
| | | if (unitId) { |
| | | obj.departmentId = unitId; |
| | | } |
| | | if (params.departmentId) { |
| | | obj.departmentId = params.departmentId[params.departmentId.length - 1]; |
| | | } |
| | | return buildProTableDataSource(getList, obj); |
| | | }} |
| | | toolBarRender={(action, selectRows) => [ |
| | | <Access accessible={access['/system_setting/role_management/add']}> |
| | | <Access accessible={access['/system_setting/people_management/add']}> |
| | | <Space> |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | addViewRef.current.refreshData({}); |
| | | addViewRef.current.refreshData({ type: 'add', unitId : unitId },items); |
| | | handleModalVisibles(true); |
| | | }} |
| | | > |
| | |
| | | ref={addViewRef} |
| | | visible={modalVisible} |
| | | onSave={async (fileds) => { |
| | | let success = await sendRequest(add, fileds); |
| | | let success = await sendRequest(addSystemUserInfo, fileds); |
| | | if (success) { |
| | | handleModalVisibles(false); |
| | | actionRef.current.reload(); |
| | |
| | | addViewRef.current.clean(); |
| | | }} |
| | | onUpdate={async (fileds) => { |
| | | let success = await sendRequest(edit, fileds); |
| | | let success = await sendRequest(editSystemUserInfo, fileds); |
| | | if (success) { |
| | | handleModalVisibles(false); |
| | | actionRef.current.reload(); |
| | |
| | | }} |
| | | onCancel={() => handleModalVisibles(false)} |
| | | /> |
| | | <AddUnit |
| | | ref={addViewRef1} |
| | | visible={modalVisible1} |
| | | onSave={async (fileds) => { |
| | | let success = await sendRequest(addUnit, fileds); |
| | | if (success) { |
| | | handleModalVisibles1(false); |
| | | fetchUnit(); |
| | | } |
| | | }} |
| | | onUpdate={async (fileds) => { |
| | | let success = await sendRequest(editUnit, fileds); |
| | | if (success) { |
| | | handleModalVisibles1(false); |
| | | fetchUnit(); |
| | | } |
| | | }} |
| | | onCancel={() => handleModalVisibles1(false)} |
| | | /> |
| | | </PageContainer> |
| | | ); |
| | | }; |
| | |
| | | |
| | | // 列表 |
| | | export const getList = async (params) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemRole/list`, { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/list`, { |
| | | method: 'GET', |
| | | params |
| | | }); |
| | |
| | | }); |
| | | } |
| | | |
| | | // 新增单位 |
| | | export const addUnit = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/department/add', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // 编辑单位 |
| | | export const editUnit = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/department/edit', { |
| | | method: 'POST', |
| | | data, |
| | | }); |
| | | } |
| | | |
| | | // 编辑 |
| | | export const edit = async (data) => { |
| | | return request('/api/huacheng-sangeshenbian/systemRole/edit', { |
| | |
| | | |
| | | // 删除 |
| | | export const del = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemRole/delete/${id}`, { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/delete/${id}`, { |
| | | method: 'DELETE', |
| | | }); |
| | | } |
| | | |
| | | // 删除单位 |
| | | export const delUnit = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/department/delete/${id}`, { |
| | | method: 'DELETE', |
| | | }); |
| | | } |
| | |
| | | }); |
| | | } |
| | | // 获取职位列表数据 |
| | | export const systemPostList = async (tier) => { |
| | | export const systemPostList = async (params) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemPost/list`, { |
| | | method: 'GET', |
| | | method: 'GET',params |
| | | }); |
| | | } |
| | | |
| | | // 获取角色列表数据 |
| | | export const systemRoleList = async (tier) => { |
| | | export const systemRoleList = async (params) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemRole/list`, { |
| | | method: 'GET',params |
| | | }); |
| | | } |
| | | // 获取人员详情数据 |
| | | export const getSystemUserInfo = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/getSystemUserInfo/${id}`, { |
| | | method: 'GET', |
| | | }); |
| | | }// 添加人员数据 |
| | | export const addSystemUserInfo = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/add`, { |
| | | method: 'POST', |
| | | data |
| | | }); |
| | | } |
| | | |
| | | // 编辑人员数据 |
| | | export const editSystemUserInfo = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/edit`, { |
| | | method: 'POST', |
| | | data |
| | | }); |
| | | } |
| | | // 获取省市区 |
| | | export const getCityList = async (data) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/getAdministrativeDivision/${data.id}/${data.tier}`, { |
| | | method: 'GET', |
| | | }); |
| | | } |
| | | |
| | | // 冻结 |
| | | export const freezeApi = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/freeze/${id}`, { |
| | | method: 'PUT', |
| | | }); |
| | | } |
| | | // 解冻 |
| | | export const unfreezeApi = async (id) => { |
| | | return request(`/api/huacheng-sangeshenbian/systemUser/unfreeze/${id}`, { |
| | | method: 'PUT', |
| | | }); |
| | | } |
| | |
| | | <Card> |
| | | <Form scrollToFirstError form={form}> |
| | | <Card> |
| | | <div style={{ marginBottom: 20 }}><span style={{ fontSize: '14px', fontWeight: 600 }}>*诉求处理时间: |
| | | </span><span style={{ marginLeft: 8, color: '#a5a5a5' }}>超过时间未处理诉求,系统自动对该事件承办者发送短信提醒,并知会至上一级管理层进行督办。 |
| | | </span></div> |
| | | <Form.Item label="添加后处理时间" name="demandProcessingTime" rules={ |
| | | [{ required: true, message: '请输入添加后处理时间' }] |
| | | }> |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | </Card> |
| | | <Card> |
| | | <div><span style={{ fontSize: '14px', fontWeight: 600 }}>*时限临期提醒配置: |
| | | </span><span style={{ marginLeft: 8, color: '#a5a5a5' }}>当事件处理时限即将到达时,系统将自动通过微信消息以及短信的方式提醒单位管理员。 |
| | | </span></div> |
| | | <Space style={{ marginTop: 20, display: 'flex', flexWrap: 'wrap' }}> |
| | | |
| | | <Form.Item label="市级账号" name="cityDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入市级账号' }] |
| | | }> |
| | | <InputNumber precision={0} max={form.getFieldValue('demandProcessingTime')} min={0} addonAfter="天前" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | |
| | | <Form.Item label="区县账号" name="districtDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入区县账号' }] |
| | | }> |
| | | <InputNumber precision={0} max={form.getFieldValue('demandProcessingTime')} min={0} addonAfter="天前" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | |
| | | <Form.Item label="街道账号" name="streetDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入街道账号' }] |
| | | }> |
| | | <InputNumber precision={0} max={form.getFieldValue('demandProcessingTime')} min={0} addonAfter="天前" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | <Form.Item label="社区账号" name="communityDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入社区账号' }] |
| | | }> |
| | | <InputNumber precision={0} max={form.getFieldValue('demandProcessingTime')} min={0} addonAfter="天前" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | <Form.Item label="党员账号" name="partyMemberDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入党员账号' }] |
| | | }> |
| | | <InputNumber precision={0} max={form.getFieldValue('demandProcessingTime')} min={0} addonAfter="天前" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | </Space> |
| | | </Card> |
| | | <Card> |
| | | <div><span style={{ fontSize: '14px', fontWeight: 600 }}>*诉求处理时间配置: |
| | | </span><span style={{ marginLeft: 8, color: '#a5a5a5' }}>超过时间未处理诉求,系统自动对该事件承办者发送短信提醒,并知会至上一级管理层进行督办。 |
| | | </span></div> |
| | |
| | | </Form.Item> |
| | | </Space> |
| | | </Card> |
| | | <Card> |
| | | <div><span style={{ fontSize: '14px', fontWeight: 600 }}>*时限临期提醒配置: |
| | | </span><span style={{ marginLeft: 8, color: '#a5a5a5' }}>超过时间未处理诉求,系统自动对该事件承办者发送短信提醒,并知会至上一级管理层进行督办。 |
| | | </span></div> |
| | | <Space style={{ marginTop: 20, display: 'flex', flexWrap: 'wrap' }}> |
| | | |
| | | <Form.Item label="市级账号" name="cityDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入市级账号' }] |
| | | }> |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | |
| | | <Form.Item label="区县账号" name="districtDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入区县账号' }] |
| | | }> |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | |
| | | <Form.Item label="街道账号" name="streetDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入街道账号' }] |
| | | }> |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | <Form.Item label="社区账号" name="communityDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入社区账号' }] |
| | | }> |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | <Form.Item label="党员账号" name="partyMemberDeadlineReminder" rules={ |
| | | [{ required: true, message: '请输入党员账号' }] |
| | | }> |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | </Space> |
| | | </Card> |
| | | <Card> |
| | | <div style={{ marginBottom: 20 }}><span style={{ fontSize: '14px', fontWeight: 600 }}>*诉求处理时间: |
| | | </span><span style={{ marginLeft: 8, color: '#a5a5a5' }}>超过时间未处理诉求,系统自动对该事件承办者发送短信提醒,并知会至上一级管理层进行督办。 |
| | | </span></div> |
| | | <Form.Item label="添加后处理时间" name="demandProcessingTime" rules={ |
| | | [{ required: true, message: '请输入添加后处理时间' }] |
| | | }> |
| | | <InputNumber precision={0} min={0} addonAfter="天内" controls={false}></InputNumber> |
| | | </Form.Item> |
| | | </Card> |
| | | <Access accessible={access['/work_order_transaction_management/work_order_item_configuration/save'] || false}> |
| | | <Access accessible={access['/work_order_transaction_management/work_order_item_configuration/save']}> |
| | | <div style={{ marginTop: 20, display: 'flex', justifyContent: 'center' }}> |
| | | <Button type="primary" htmlType="submit" style={{ marginRight: 20 }} onClick={() => {save()}} > |
| | | 保存 |
| | |
| | | import { customRequest } from '@/utils/utils'; |
| | | const AddOrEditOrDetail = () => { |
| | | |
| | | const config = { |
| | | name: 'file', |
| | | action: 'https://huacheng.psciio.com/api/huacheng-communitybackstage/communitypartybuilding/uploadimage', |
| | | headers: { |
| | | Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0MTY1OTg5MywiY3JlYXRlZCI6MTc0MDM2Mzg5MzE2MH0.o3Gc0g1LAo_kkL3X3QrC6qKwztxsp6psoTcpTreDzQUXGqPzUXw89fNSR5YKz8gzhtSuSKI2d6TJJYPX1IQCgw', |
| | | }, |
| | | }; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | rules={[ |
| | | { |
| | | required: fileList.length == 0 ? true : false, |
| | | required: true, |
| | | message: '请上传banner图片', |
| | | }, |
| | | ]} |
| | |
| | | showUploadList={{ |
| | | showPreviewIcon: false, |
| | | }} |
| | | customRequest={customRequest} |
| | | // accept="image/png, image/jpeg, image/jpg" |
| | | // customRequest={customRequest} |
| | | accept="image/png, image/jpeg, image/jpg" |
| | | fileList={fileList} |
| | | disabled={searchParams.get('detail')} |
| | | > |
| | |
| | | import { LoadingOutlined, PlusOutlined } from '@ant-design/icons'; |
| | | import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; |
| | | import { customRequest } from '@/utils/utils'; |
| | | import { add, Edit, getDetail } from '../service' |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { span: 7 }, |
| | |
| | | name: 'file', |
| | | action: 'https://huacheng.psciio.com/api/huacheng-communitybackstage/communitypartybuilding/uploadimage', |
| | | headers: { |
| | | authorization: localStorage.getItem('token'), |
| | | Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0MTY1OTg5MywiY3JlYXRlZCI6MTc0MDM2Mzg5MzE2MH0.o3Gc0g1LAo_kkL3X3QrC6qKwztxsp6psoTcpTreDzQUXGqPzUXw89fNSR5YKz8gzhtSuSKI2d6TJJYPX1IQCgw', |
| | | }, |
| | | }; |
| | | const formItemLayout = { |
| | |
| | | url: res.data.url |
| | | }] |
| | | setFileList(obj) |
| | | form.setFieldsValue({ image: obj }) |
| | | } |
| | | form.setFieldsValue(res.data) |
| | | form.setFieldsValue({name: res.data.name}) |
| | | }) |
| | | } |
| | | }, |
| | | clean: () => { |
| | | form.resetFields(); |
| | | setFileList([]) |
| | | }, |
| | | }; |
| | | }); |
| | |
| | | delete values.image |
| | | if (editData.id) { |
| | | values.id = editData.id |
| | | let state = await sendRequest(add, values) |
| | | if (state) { |
| | | history.back() |
| | | } |
| | | onUpdate(values) |
| | | return |
| | | } |
| | | let state = await sendRequest(Edit, values) |
| | | if (state) { |
| | | history.back() |
| | | } |
| | | onSave(values) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | rules={[ |
| | | { |
| | | required: fileList.length == 0 ? true : false, |
| | | required: true, |
| | | message: '请上传banner图片', |
| | | }, |
| | | ]} |
| | |
| | | showPreviewIcon: false, |
| | | }} |
| | | // customRequest={customRequest} |
| | | // accept="image/png, image/jpeg, image/jpg" |
| | | accept="image/png, image/jpeg, image/jpg" |
| | | fileList={fileList} |
| | | disabled={editData.type == 'detail'} |
| | | > |
| | |
| | | import { useRef, useState } from 'react'; |
| | | import { Access, history, useAccess } from 'umi'; |
| | | import AddAndEdit from './components/index'; |
| | | import { getList, updateStatus, deleteBanner } from './service' |
| | | import { getList, updateStatus, deleteBanner, add, Edit } from './service' |
| | | const Banner = () => { |
| | | |
| | | const actionRef = useRef(); |
| | |
| | | <Button |
| | | type="link" |
| | | onClick={() => { |
| | | history.push(`/marketing/banner/add?id=${record.id}&edit=true`); |
| | | addViewRef.current.clean(); |
| | | addViewRef.current.refreshData({ ...record, type: 'edit' }); |
| | | handleModalVisible(true); |
| | | }} |
| | | > |
| | | 编辑 |
| | |
| | | ] |
| | | |
| | | return <div> |
| | | <PageContainer title='banner管理'> |
| | | <PageContainer title='banner管理' header={{ |
| | | breadcrumb: {}, |
| | | }}> |
| | | <ProTable |
| | | rowKey='id' |
| | | actionRef={actionRef} |
| | |
| | | <Button |
| | | type="primary" |
| | | onClick={() => { |
| | | addViewRef.current.clean(); |
| | | addViewRef.current.refreshData({}); |
| | | handleModalVisible(true); |
| | | }} |
| | |
| | | ]; |
| | | return ( |
| | | <div> |
| | | <PageContainer> |
| | | <PageContainer title="问题类型管理" header={{ |
| | | breadcrumb: {}, |
| | | }}> |
| | | <ProTable |
| | | rowKey="id" |
| | | actionRef={actionRef} |
| | |
| | | // import { getToken } from '@/utils/authority'; |
| | | import pathRegexp from 'path-to-regexp'; |
| | | import { parse } from 'querystring'; |
| | | import { uploadFile } from './service' |
| | | /* eslint no-useless-escape:0 import/prefer-default-export:0 */ |
| | |
| | | }) |
| | | .catch(error => console.error('Error downloading file:', error)); |
| | | } |
| | | export const getAuthorityFromRouter = (router = [], pathname) => { |
| | | const authority = router.find( |
| | | ({ routes, path = '/' }) => |
| | | (path && pathRegexp(path).exec(pathname)) || |
| | | (routes && getAuthorityFromRouter(routes, pathname)), |
| | | ); |
| | | if (authority) return authority; |
| | | return undefined; |
| | | }; |
| | | export const getRouteAuthority = (path, routeData) => { |
| | | let authorities; |
| | | routeData.forEach((route) => { |
| | | // match prefix |
| | | if (pathRegexp(`${route.path}/(.*)`).test(`${path}/`)) { |
| | | if (route.authority) { |
| | | authorities = route.authority; |
| | | } // exact match |
| | | |
| | | if (route.path === path) { |
| | | authorities = route.authority || authorities; |
| | | } // get children authority recursively |
| | | |
| | | if (route.routes) { |
| | | authorities = getRouteAuthority(path, route.routes) || authorities; |
| | | } |
| | | } |
| | | }); |
| | | return authorities; |
| | | }; |