巴林闲侠 2 years ago
parent
commit
38d285d3bc
  1. 4
      api/app/lib/controllers/organization/department.js
  2. 34
      scripts/1.2.2/schema/4.insert_resource.sql
  3. 23
      web/client/src/sections/organization/components/depModal.js

4
api/app/lib/controllers/organization/department.js

@ -52,7 +52,7 @@ async function getdep(ctx) {
async function editDep(ctx) { async function editDep(ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { depId, name, dependence, areaCode, area } = ctx.request.body const { depId, name, dependence, areaCode } = ctx.request.body
//console.log(ctx.request.body, '111111wed') //console.log(ctx.request.body, '111111wed')
if (dependence) { if (dependence) {
let dep = await models.Department.findOne({ let dep = await models.Department.findOne({
@ -101,7 +101,7 @@ async function editDep(ctx) {
name: name, name: name,
delete: false, delete: false,
dependence: dependence || null, dependence: dependence || null,
areaCode: area || null areaCode: areaCode || null
}) })
} }
ctx.status = 204; ctx.status = 204;

34
scripts/1.2.2/schema/4.insert_resource.sql

@ -1,15 +1,19 @@
INSERT INTO resource (code, name, parent_resource) VALUES ('ALLSELECT', '全选', null); INSERT INTO public.resource (code, name, parent_resource) VALUES ('ALLSELECT', '全选', null);
INSERT INTO resource (code, name, parent_resource) VALUES ('USERMANAGE', '用户管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('USERMANAGE', '用户管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('AUTHORIMANAGE', '权限管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('AUTHORIMANAGE', '权限管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('OVERLOADMANAGE', '治超管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('OVERLOADMANAGE', '治超管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('ROADMANAGE', '道路管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('ROADMANAGE', '道路管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('BRIDGEMANAGE', '桥梁管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('BRIDGEMANAGE', '桥梁管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('MAINTENANCEMANAGE', '管养管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('MAINTENANCEMANAGE', '管养管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('TRANSPORTATIONMANAGE', '运政管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('TRANSPORTATIONMANAGE', '运政管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('CONSERVATIONMANAGE', '养护管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('CONSERVATIONMANAGE', '养护管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('PATROLMANAGE', '巡查管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('PATROLMANAGE', '巡查管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('PUBLICTRANSPORTMANAGE', '公交管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('PUBLICTRANSPORTMANAGE', '公交管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('FILEMANAGE', '档案管理', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('FILEMANAGE', '档案管理', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('PUBLICITYVIDEO', '宣传视频', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('PUBLICITYVIDEO', '宣传视频', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('FEEDBACKMANAGE', '异常反馈', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('FEEDBACKMANAGE', '异常反馈', 'ALLSELECT');
INSERT INTO resource (code, name, parent_resource) VALUES ('REPORTMANAGE', '建设上报', 'ALLSELECT'); INSERT INTO public.resource (code, name, parent_resource) VALUES ('REPORTMANAGE', '建设上报', 'ALLSELECT');
INSERT INTO public.resource (code, name, parent_resource) VALUES ('WXPATROLREPORT', '小程序巡查上报', 'ALLSELECT');
INSERT INTO public.resource (code, name, parent_resource) VALUES ('WXMAINTENANCEREPORT', '小程序养护上报', 'ALLSELECT');
INSERT INTO public.resource (code, name, parent_resource) VALUES ('WXFEEDBACKMANAGE', '小程序异常反馈', 'ALLSELECT');
INSERT INTO public.resource (code, name, parent_resource) VALUES ('WXBUILDINGROAD', '小程序在建道路', 'ALLSELECT');

23
web/client/src/sections/organization/components/depModal.js

@ -4,7 +4,8 @@ import { Spin, Card, Modal, TreeSelect } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
const DepModal = (props) => { const DepModal = (props) => {
const { visible, onVisibleChange, onConfirm, depModalType, depData, data } = props; const { visible, onVisibleChange, onConfirm, depModalType, depData, data } = props
console.log('data', data)
const formRef = useRef(); const formRef = useRef();
const roadCode = [ const roadCode = [
{ title: "莲塘镇", value: "360121100000" }, { title: "莲塘镇", value: "360121100000" },
@ -16,22 +17,22 @@ const DepModal = (props) => {
{ title: "武阳镇", value: "360121106000" }, { title: "武阳镇", value: "360121106000" },
{ title: "冈上镇", value: "360121107000" }, { title: "冈上镇", value: "360121107000" },
{ title: "广福镇", value: "360121108000" }, { title: "广福镇", value: "360121108000" },
{ title: "昌东镇", value: "360121191000" }, //{ title: "昌东镇", value: "360121191000" },
{ title: "麻丘镇", value: "360121192000" }, //{ title: "麻丘镇", value: "360121192000" },
{ title: "泾口乡", value: "360121200000" }, { title: "泾口乡", value: "360121200000" },
{ title: "南新乡", value: "360121201000" }, { title: "南新乡", value: "360121201000" },
{ title: "塔城乡", value: "360121202000" }, { title: "塔城乡", value: "360121202000" },
{ title: "黄马乡", value: "360121203000" }, { title: "黄马乡", value: "360121203000" },
{ title: "富山乡", value: "360121204000" }, { title: "富山乡", value: "360121204000" },
{ title: "东新乡", value: "360121205000" }, //{ title: "东新乡", value: "360121205000" },
{ title: "八一乡", value: "360121206000" }, { title: "八一乡", value: "360121206000" },
{ title: "小蓝经济开发区", value: "360121403000" }, //{ title: "小蓝经济开发区", value: "360121403000" },
{ title: "银三角管理委员会", value: "360121501000" }, { title: "银三角管理委员会", value: "360121471000" },
{ title: "五星垦殖场", value: "360121501000" }, // { title: "五星垦殖场", value: "360121501000" },
{ title: "良种繁殖场", value: "360121572000" }, // { title: "良种繁殖场", value: "360121572000" },
] ]
useEffect(() => { useEffect(() => {
console.log('depData', depData) //console.log('depData', depData)
}, []) }, [])
const onFinish = (values) => { const onFinish = (values) => {
@ -41,7 +42,7 @@ const DepModal = (props) => {
name: values.name, name: values.name,
depId: data.id, depId: data.id,
dependence: values.dependence, dependence: values.dependence,
areaCode: values.area areaCode: values.areaCode
} }
onConfirm(value) onConfirm(value)
} else { } else {
@ -92,7 +93,7 @@ const DepModal = (props) => {
}} }}
/> />
<ProFormTreeSelect <ProFormTreeSelect
name={['area']} name={['areaCode']}
width="md" width="md"
label="所属区域" label="所属区域"
autocomplete='off' autocomplete='off'

Loading…
Cancel
Save