Commit 819fff89 authored by feiwenli's avatar feiwenli

差不多结尾

parent 4409d85a
node_modules/
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
window.SITE_CONFIG = {}; window.SITE_CONFIG = {};
window.SITE_CONFIG['version'] = 'v1.0.0'; window.SITE_CONFIG['version'] = 'v1.0.0';
window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>'; window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>';
window.SITE_CONFIG['apiURL'] = 'http://192.168.10.169:8080/hmit-admin'; // api请求地址 window.SITE_CONFIG['apiURL'] = 'http://192.168.10.164:8080/hmit-admin'; // api请求地址
window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态) window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象 window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象
'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径) 'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
......
...@@ -10,11 +10,13 @@ import { ...@@ -10,11 +10,13 @@ import {
} from "../utils/request"; } from "../utils/request";
//会议详情 //会议详情
export function getwoFaultTypeList() { export function getMeetingDetail(id) {
return getData("/workorder/wofaulttype/woFaultTypeList"); return getData(`/meeting/meeting/${id}`);
} }
//会议保存 //会议保存
export function getMeeting(dto) { export function getMeeting(dto) {
return postData("/meeting/meeting", dto); return postData("/meeting/meeting", dto);
} }
//会议修改/meeting/meeting
\ No newline at end of file
...@@ -37,7 +37,7 @@ export const moduleRoutes = { ...@@ -37,7 +37,7 @@ export const moduleRoutes = {
{ path: '/memberManageDetail', component: () => import('@/views/modules/memberManage/memberManageDetail'), name: '会员信息详情', meta: { title: '会员信息详情', isTab: false } }, { path: '/memberManageDetail', component: () => import('@/views/modules/memberManage/memberManageDetail'), name: '会员信息详情', meta: { title: '会员信息详情', isTab: false } },
{ path: '/meetingsAdd', component: () => import('@/views/modules/meeting/meetingsAdd'), name: '会议新增', meta: { title: '会议新增', isTab: false } }, { path: '/meetingsAdd', component: () => import('@/views/modules/meeting/meetingsAdd'), name: '会议新增', meta: { title: '会议新增', isTab: false } },
{ path: '/meetingsDetail', component: () => import('@/views/modules/meeting/meetingsDetail'), name: '会议详情', meta: { title: '会议详情', isTab: true } }, { path: '/meetingsDetail', component: () => import('@/views/modules/meeting/meetingsDetail'), name: '会议详情', meta: { title: '会议详情', isTab: false } },
{ path: '/member', component: () => import('@/views/modules/user/user'), name: '会员信息管理', meta: { title: '会员信息管理', isTab: true } }, { path: '/member', component: () => import('@/views/modules/user/user'), name: '会员信息管理', meta: { title: '会员信息管理', isTab: true } },
{ path: '/shenhe', component: () => import('@/views/modules/auditInformationManage/auditInformationManage'), name: '审核信息管理', meta: { title: '审核信息管理', isTab: true } }, { path: '/shenhe', component: () => import('@/views/modules/auditInformationManage/auditInformationManage'), name: '审核信息管理', meta: { title: '审核信息管理', isTab: true } },
] ]
......
<template> <template>
<div v-loading.fullscreen.lock="loading" :element-loading-text="$t('loading')" :class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]"> <div
v-loading.fullscreen.lock="loading"
:element-loading-text="$t('loading')"
:class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]"
>
<template v-if="!loading"> <template v-if="!loading">
<main-navbar /> <main-navbar />
<main-sidebar /> <main-sidebar />
...@@ -12,94 +16,106 @@ ...@@ -12,94 +16,106 @@
</template> </template>
<script> <script>
import MainNavbar from './main-navbar' import MainNavbar from "./main-navbar";
import MainSidebar from './main-sidebar' import MainSidebar from "./main-sidebar";
import MainContent from './main-content' import MainContent from "./main-content";
import MainThemeTools from './main-theme-tools' import MainThemeTools from "./main-theme-tools";
import debounce from 'lodash/debounce' import debounce from "lodash/debounce";
export default { export default {
provide () { provide() {
return { return {
// 刷新 // 刷新
refresh () { refresh() {
this.$store.state.contentIsNeedRefresh = true this.$store.state.contentIsNeedRefresh = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$store.state.contentIsNeedRefresh = false this.$store.state.contentIsNeedRefresh = false;
}) });
} },
} };
}, },
data () { data() {
return { return {
loading: true loading: true,
} };
}, },
components: { components: {
MainNavbar, MainNavbar,
MainSidebar, MainSidebar,
MainContent, MainContent,
MainThemeTools MainThemeTools,
}, },
watch: { watch: {
$route: 'routeHandle' $route: "routeHandle",
}, },
created () { created() {
this.windowResizeHandle() this.windowResizeHandle();
this.routeHandle(this.$route) this.routeHandle(this.$route);
Promise.all([ Promise.all([this.getUserInfo(), this.getPermissions()]).then(() => {
this.getUserInfo(), this.loading = false;
this.getPermissions() });
]).then(() => {
this.loading = false
})
}, },
methods: { methods: {
// 窗口改变大小 // 窗口改变大小
windowResizeHandle () { windowResizeHandle() {
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false this.$store.state.sidebarFold =
window.addEventListener('resize', debounce(() => { document.documentElement["clientWidth"] <= 992 || false;
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false window.addEventListener(
}, 150)) "resize",
debounce(() => {
this.$store.state.sidebarFold =
document.documentElement["clientWidth"] <= 992 || false;
}, 150)
);
}, },
// 路由, 监听 // 路由, 监听
routeHandle (route) { routeHandle(route) {
if (!route.meta.isTab) { if (!route.meta.isTab) {
return false return false;
} }
var tab = this.$store.state.contentTabs.filter(item => item.name === route.name)[0] var tab = this.$store.state.contentTabs.filter(
(item) => item.name === route.name
)[0];
if (!tab) { if (!tab) {
tab = { tab = {
...window.SITE_CONFIG['contentTabDefault'], ...window.SITE_CONFIG["contentTabDefault"],
...route.meta, ...route.meta,
'name': route.name, name: route.name,
'params': { ...route.params }, params: { ...route.params },
'query': { ...route.query } query: { ...route.query },
} };
this.$store.state.contentTabs = this.$store.state.contentTabs.concat(tab) this.$store.state.contentTabs = this.$store.state.contentTabs.concat(
tab
);
} }
this.$store.state.sidebarMenuActiveName = tab.menuId this.$store.state.sidebarMenuActiveName = tab.menuId;
this.$store.state.contentTabsActiveName = tab.name this.$store.state.contentTabsActiveName = tab.name;
}, },
// 获取当前管理员信息 // 获取当前管理员信息
getUserInfo () { getUserInfo() {
return this.$http.get('/sys/user/info').then(({ data: res }) => { return this.$http
.get("/sys/user/info")
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} }
this.$store.state.user.id = res.data.id this.$store.state.user.id = res.data.id;
this.$store.state.user.name = res.data.username this.$store.state.user.name = res.data.username;
this.$store.state.user.superAdmin = res.data.superAdmin this.$store.state.user.superAdmin = res.data.superAdmin;
}).catch(() => {}) })
.catch(() => {});
}, },
// 获取权限 // 获取权限
getPermissions () { getPermissions() {
return this.$http.get('/sys/menu/permissions').then(({ data: res }) => { return this.$http
.get("/sys/menu/permissions")
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
}
window.SITE_CONFIG['permissions'] = res.data
}).catch(() => {})
}
} }
} window.SITE_CONFIG["permissions"] = res.data;
})
.catch(() => {});
},
},
};
</script> </script>
...@@ -95,6 +95,7 @@ export default { ...@@ -95,6 +95,7 @@ export default {
pid: "", pid: "",
parentName: "", parentName: "",
sort: 0, sort: 0,
type: 0,
}, },
}; };
}, },
...@@ -170,6 +171,12 @@ export default { ...@@ -170,6 +171,12 @@ export default {
}, },
// 上级部门树, 选中 // 上级部门树, 选中
deptListTreeCurrentChangeHandle(data) { deptListTreeCurrentChangeHandle(data) {
// console.log(data);
/* if (data.children.length <0) {
this.dataForm.type = 0;
} else {
this.dataForm.type = 1;
} */
this.dataForm.pid = data.id; this.dataForm.pid = data.id;
this.dataForm.parentName = data.name; this.dataForm.parentName = data.name;
this.deptListVisible = false; this.deptListVisible = false;
......
...@@ -143,7 +143,7 @@ export default { ...@@ -143,7 +143,7 @@ export default {
data() { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: "/user/user/page", getDataListURL: "/user/user/page?check=0",
getDataListIsPage: true, getDataListIsPage: true,
exportURL: "/user/user/export", exportURL: "/user/user/export",
deleteURL: "/user/user", deleteURL: "/user/user",
......
...@@ -33,10 +33,16 @@ ...@@ -33,10 +33,16 @@
<el-form-item label="职位"> <el-form-item label="职位">
<el-input v-model="dataForm.position"></el-input> <el-input v-model="dataForm.position"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系电话"> <el-form-item
label="联系电话"
prop="mobile"
>
<el-input v-model="dataForm.mobile"></el-input> <el-input v-model="dataForm.mobile"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="邮箱"> <el-form-item
label="邮箱"
prop="email"
>
<el-input v-model="dataForm.email"></el-input> <el-input v-model="dataForm.email"></el-input>
</el-form-item> </el-form-item>
...@@ -66,7 +72,7 @@ ...@@ -66,7 +72,7 @@
v-if="dataForm.ifCheck==1" v-if="dataForm.ifCheck==1"
label="所属市区级" label="所属市区级"
> >
<el-select <!-- <el-select
style="width:100%" style="width:100%"
v-model="dataForm.areaName" v-model="dataForm.areaName"
placeholder="请选择所属市区级" placeholder="请选择所属市区级"
...@@ -78,34 +84,37 @@ ...@@ -78,34 +84,37 @@
:value="item.value" :value="item.value"
> >
</el-option> </el-option>
</el-select> </el-select> -->
<!-- <el-cascader <el-cascader
style="width:100%" style="width:100%"
v-model="dataForm.areaName" v-model="dataForm.areaId"
placeholder="请选择所属市区级" placeholder="请选择所属市区级"
:options="optionsOfLocation" :options="optionsOfLocation"
:props="{ checkStrictly: true }" :props="props"
ref="myCascader"
@change="changearea"
clearable clearable
></el-cascader> --> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
required required
prop="committeeName" prop="committeeId"
v-if="dataForm.ifCheck==1" v-if="dataForm.ifCheck==1"
label="所属委员会" label="所属委员会"
> >
<el-select <el-select
style="width:100%" style="width:100%"
v-model="dataForm.committeeName" @change="changename"
v-model="dataForm.committeeId"
placeholder="请选择所属委员会" placeholder="请选择所属委员会"
clearable clearable
> >
<el-option <el-option
v-for="item in optionsOfCommittee" v-for="item in optionsOfCommittee"
:key="item.value" :key="item.id"
:label="item.label" :label="item.name"
:value="item.value" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -140,7 +149,12 @@ export default { ...@@ -140,7 +149,12 @@ export default {
data() { data() {
return { return {
type: this.$route.query.type, type: this.$route.query.type,
props: {
checkStrictly: true,
value: "id",
label: "name",
children: "children",
},
dataForm: { dataForm: {
id: "", id: "",
name: "", name: "",
...@@ -155,7 +169,7 @@ export default { ...@@ -155,7 +169,7 @@ export default {
uploadDate: "", //上传日期 */ uploadDate: "", //上传日期 */
}, },
optionsOfLocation: [ optionsOfLocation: [
{ /* {
value: "宁波市", value: "宁波市",
label: "宁波市", label: "宁波市",
}, },
...@@ -174,7 +188,7 @@ export default { ...@@ -174,7 +188,7 @@ export default {
{ {
value: "镇海区", value: "镇海区",
label: "镇海区", label: "镇海区",
}, }, */
/* { /* {
value: "ningbo", value: "ningbo",
label: "宁波市", label: "宁波市",
...@@ -198,28 +212,7 @@ export default { ...@@ -198,28 +212,7 @@ export default {
], ],
}, */ }, */
], ],
optionsOfCommittee: [ optionsOfCommittee: [],
{
value: "网络安全协会",
label: "网络安全协会",
},
{
value: "网络安全协会1",
label: "网络安全协会1",
},
{
value: "网络安全协会2",
label: "网络安全协会2",
},
{
value: "网络安全协会3",
label: "网络安全协会3",
},
{
value: "网络安全协会4",
label: "网络安全协会4",
},
],
}; };
}, },
computed: { computed: {
...@@ -232,6 +225,20 @@ export default { ...@@ -232,6 +225,20 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], */ ], */
email: [
{
required: true,
trigger: "blur",
validator: this.checkEmail,
},
],
mobile: [
{
required: true,
trigger: "blur",
validator: this.checkPhone,
},
],
ifCheck: [ ifCheck: [
{ {
required: true, required: true,
...@@ -246,7 +253,7 @@ export default { ...@@ -246,7 +253,7 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
committeeName: [ committeeId: [
{ {
required: true, required: true,
message: this.$t("validate.required"), message: this.$t("validate.required"),
...@@ -263,6 +270,38 @@ export default { ...@@ -263,6 +270,38 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
checkPhone(rule, value, callback) {
if (!value) {
return callback(new Error("请输入正确的手机号"));
} else if (value == null) {
return callback(new Error("手机号不能为空"));
} else {
const reg = /^((0\d{2,3}-\d{7,8})|(1[35789]\d{9}))$/;
console.log(reg.test(value));
if (reg.test(value)) {
callback();
} else {
return callback(new Error("请输入正确的手机号或座机号"));
}
}
},
checkEmail(rule, value, callback) {
if (!value) {
return callback(new Error("请输入正确的邮箱号"));
} else if (value == null) {
return callback(new Error("邮箱号不能为空"));
} else {
const reg = /^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*\.[a-z]{2,}$/;
console.log(reg.test(value));
if (reg.test(value)) {
callback();
} else {
return callback(new Error("请输入正确的邮箱号"));
}
}
},
init() { init() {
this.dataForm.id = this.$route.query.id; this.dataForm.id = this.$route.query.id;
this.$nextTick(() => { this.$nextTick(() => {
...@@ -272,7 +311,10 @@ export default { ...@@ -272,7 +311,10 @@ export default {
} }
}); });
}, },
// 获取信息 // 获取信息
///committee/committee/list
getInfo() { getInfo() {
this.$http this.$http
.get(`/user/user/${this.dataForm.id}`) .get(`/user/user/${this.dataForm.id}`)
...@@ -294,7 +336,44 @@ export default { ...@@ -294,7 +336,44 @@ export default {
console.log(this.dataForm); console.log(this.dataForm);
}) })
.catch(() => {}); .catch(() => {});
this.$http
.get("/committee/committee/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsOfCommittee = res.data;
})
.catch(() => {});
this.$http
.get("/area/area/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsOfLocation = this.getTreeData(res.data);
console.log(res.data);
})
.catch(() => {});
}, },
getTreeData(data) {
// 循环遍历json数据
for (var i = 0; i < data.length; i++) {
if (data[i].children.length < 1) {
// children若为空数组,则将children设为undefined
data[i].children = undefined;
} else {
// children若不为空数组,则继续 递归调用 本方法
this.getTreeData(data[i].children);
}
}
return data;
},
// 表单提交 // 表单提交
dataFormSubmitHandle: function () { dataFormSubmitHandle: function () {
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
...@@ -304,6 +383,13 @@ export default { ...@@ -304,6 +383,13 @@ export default {
this.$confirm("确定提交吗?") this.$confirm("确定提交吗?")
.then((_) => { .then((_) => {
if (this.dataForm.ifCheck == 1) {
this.dataForm.member = 1;
} else if (this.dataForm.ifCheck == 2) {
this.dataForm.member = 2;
}
console.log("data", this.dataForm);
this.$http[!this.dataForm.id ? "post" : "put"]( this.$http[!this.dataForm.id ? "post" : "put"](
"/user/user/", "/user/user/",
this.dataForm this.dataForm
...@@ -348,9 +434,28 @@ export default { ...@@ -348,9 +434,28 @@ export default {
}) })
.catch((_) => {}); .catch((_) => {});
}, */ }, */
changeAuditStatus(value) { changeAuditStatus(value) {
this.dataForm.ifCheck = value; this.dataForm.ifCheck = value;
}, },
changename(value) {
this.optionsOfCommittee.forEach((ele) => {
if (value == ele.id) {
this.dataForm.committeeName = ele.name;
}
});
},
changearea(value) {
console.log(value);
if (value.length > 0) {
this.dataForm.areaId = value[value.length - 1];
let areaNames = this.$refs.myCascader.getCheckedNodes()[0].pathLabels;
this.dataForm.areaName = areaNames[areaNames.length - 1];
}
// console.log(this.$refs.myCascader.getCheckedNodes()[0].pathLabels);
},
//返回按钮事件 //返回按钮事件
goback() { goback() {
this.$router.go(-1); this.$router.go(-1);
......
...@@ -22,13 +22,15 @@ ...@@ -22,13 +22,15 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
label="排序"
prop="sort" prop="sort"
label="排序"
> >
<el-input <el-input-number
v-model="dataForm.sort" v-model="dataForm.sort"
placeholder="排序" controls-position="right"
></el-input> :min="0"
label="排序"
></el-input-number>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
label="排序" label="排序"
header-align="center" header-align="center"
align="center" align="center"
width="150"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
......
...@@ -3,14 +3,23 @@ ...@@ -3,14 +3,23 @@
<el-form <el-form
:inline="true" :inline="true"
:model="dataForm" :model="dataForm"
@keyup.enter.native="getDataList()" @keyup.enter.native="getdatalist()"
> >
<el-form-item> <el-form-item>
<el-input <el-select
style="width:100%"
v-model="dataForm.committee" v-model="dataForm.committee"
placeholder="委员会名称" placeholder="请选择所属委员会"
clearable clearable
></el-input> >
<el-option
v-for="item in optionsOfCommittee"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
...@@ -23,7 +32,7 @@ ...@@ -23,7 +32,7 @@
<el-form-item> <el-form-item>
<el-button <el-button
@click="getDataList()" @click="getdatalist()"
type="primary" type="primary"
>{{ $t('query') }}</el-button> >{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
...@@ -59,11 +68,12 @@ ...@@ -59,11 +68,12 @@
row-key="id" row-key="id"
border border
:indent="16" :indent="16"
:default-expand-all="true"
:select-on-indeterminate="false" :select-on-indeterminate="false"
@select="select" @select="select"
@select-all="selectAll" @select-all="selectAll"
@selection-change="selectionChange" @selection-change="selectionChange"
:tree-props="{children: 'childList'}" :tree-props="{children: 'userInfoList'}"
> >
<el-table-column <el-table-column
type="selection" type="selection"
...@@ -78,7 +88,7 @@ ...@@ -78,7 +88,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
{{ selectArr.map(el => el.id) }} <!-- {{ selectArr.map(el => el.id) }} -->
</div> </div>
</template> </template>
...@@ -87,42 +97,46 @@ import mixinViewModule from "@/mixins/view-module"; ...@@ -87,42 +97,46 @@ import mixinViewModule from "@/mixins/view-module";
export default { export default {
name: "committee-table", name: "committee-table",
mixins: [mixinViewModule], mixins: [mixinViewModule],
props: ["invitedUserNames"],
data() { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: "/sys/dept/list", getDataListURL: "/user/user/committeeList",
deleteURL: "/sys/dept", // deleteURL: "/sys/dept",
}, },
tableData: [ tableData: [
{ /* {
id: 1, id: "10",
name: "会长及副会长", name: "会长及副会长",
childList: [ childList: [
{ {
id: 31, id: "1",
name: "王小虎", name: "小明",
}, },
{ {
id: 32, id: "2",
name: "王小虎", name: "小明",
}, },
], ],
}, },
{ {
id: 2, id: "3",
name: "协会监事", name: "协会监事",
childList: [ childList: [
{ {
id: 3, id: "4",
name: "张亮亮", name: "小明同学",
}, },
{ {
id: 4, id: "5",
name: "王小虎", name: "小明的同学小红",
}, },
], ],
}, }, */
], ],
tempaalist: [],
tempbblist: [],
optionsOfCommittee: [],
selectArr: [], selectArr: [],
dataForm: { dataForm: {
committee: "", committee: "",
...@@ -130,21 +144,130 @@ export default { ...@@ -130,21 +144,130 @@ export default {
}, },
}; };
}, },
mounted() {
this.getdatalist();
this.getInfo();
},
methods: { methods: {
getInfo() {
this.$http
.get("/committee/committee/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsOfCommittee = res.data;
})
.catch(() => {});
},
getdatalist() {
this.$http
.get(
"/user/user/committeeList?committee=" +
this.dataForm.committee +
"&name=" +
this.dataForm.name
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.tableData = res.data;
// console.log("this.tableData", this.tableData);
})
.then(() => {
this.toggleSelections(this.tableData);
})
.catch(() => {});
},
getInclude1(arr1, arr2) {
let temp = [];
for (const item of arr2) {
arr1.find((i) => i.id === item.id) ? temp.push(item) : "";
}
return temp;
},
toggleSelections(rows) {
// console.log("Wodoap", this.tableData);
if (rows) {
rows.forEach((row) => {
if (row.userInfoList) {
row.userInfoList.map((j) => {
// console.log("Wodoapjjj", j);
this.invitedUserNames.map((i) => {
if (i.id == j.id) {
this.toggleSelection(j, true);
}
});
});
let templist = this.getInclude1(
this.invitedUserNames,
row.userInfoList
);
if (templist.length == row.userInfoList.length) {
this.$refs.table.toggleRowSelection(row);
}
// console.log("log", templist);
}
// console.log(row);
});
} else {
this.$refs.table.clearSelection();
}
},
getTreeData(data) {
// 循环遍历json数据
for (var i = 0; i < data.length; i++) {
if (data[i].userInfoList.length < 1) {
// children若为空数组,则将children设为undefined
data[i].userInfoList = undefined;
} else {
// children若不为空数组,则继续 递归调用 本方法
this.getTreeData(data[i].userInfoList);
}
}
return data;
},
select(selection, row) { select(selection, row) {
// console.log("selection", selection);
//this.$refs.table.toggleRowSelection(1, false);
let aatemplist = [];
let bbtemplist = [];
selection.some((el) => {
if (el.userInfoList) {
aatemplist.push(el);
} else {
bbtemplist.push(el);
}
});
aatemplist.some((ele, index) => {
ele.userInfoList.forEach((el) => {
// console.log("el", el.id);
if (el.id == row.id) {
this.$refs.table.toggleRowSelection(this.tableData[index], false);
}
});
});
// console.log("temp", templist);
if ( if (
selection.some((el) => { selection.some((el) => {
return row.id === el.id; return row.id === el.id;
}) })
) { ) {
if (row.childList) { if (row.userInfoList) {
row.childList.map((j) => { row.userInfoList.map((j) => {
this.toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} }
} else { } else {
if (row.childList) { if (row.userInfoList) {
row.childList.map((j) => { row.userInfoList.map((j) => {
this.toggleSelection(j, false); this.toggleSelection(j, false);
}); });
} }
...@@ -163,8 +286,8 @@ export default { ...@@ -163,8 +286,8 @@ export default {
}); });
if (isSelect) { if (isSelect) {
selection.map((el) => { selection.map((el) => {
if (el.childList) { if (el.userInfoList) {
el.childList.map((j) => { el.userInfoList.map((j) => {
this.toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} }
...@@ -172,8 +295,8 @@ export default { ...@@ -172,8 +295,8 @@ export default {
} }
if (isCancel) { if (isCancel) {
this.tableData.map((el) => { this.tableData.map((el) => {
if (el.childList) { if (el.userInfoList) {
el.childList.map((j) => { el.userInfoList.map((j) => {
this.toggleSelection(j, false); this.toggleSelection(j, false);
}); });
} }
...@@ -182,6 +305,43 @@ export default { ...@@ -182,6 +305,43 @@ export default {
}, },
selectionChange(selection) { selectionChange(selection) {
this.selectArr = selection; this.selectArr = selection;
let childByValueContent = [];
selection.forEach((ele) => {
if (ele.userInfoList == undefined) {
childByValueContent.push(ele);
}
});
let aatemplist = [];
let bbtemplist = [];
selection.some((el) => {
if (el.userInfoList) {
aatemplist.push(el);
} else {
bbtemplist.push(el);
}
});
/* let templist2 = [];
templist2 = this.getInclude1(this.tableData, aa);
console.log("aaa", this.tableData.length);
console.log("bbb", templist2.length); */
this.tableData.forEach((ele, index) => {
let templist = [];
templist = this.getInclude1(ele.userInfoList, bbtemplist);
/* console.log("aaa", ele.userInfoList.length);
console.log("bbb", templist.length); */
if (ele.userInfoList.length == templist.length) {
this.$refs.table.toggleRowSelection(this.tableData[index], true);
} else {
this.$refs.table.toggleRowSelection(this.tableData[index], false);
}
});
this.$emit("childByValue", childByValueContent);
}, },
toggleSelection(row, select) { toggleSelection(row, select) {
if (row) { if (row) {
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<el-form <el-form
:inline="true" :inline="true"
:model="dataForm" :model="dataForm"
@keyup.enter.native="getDataList()" @keyup.enter.native="getdatalist()"
> >
<el-form-item> <el-form-item>
<el-cascader <el-cascader
v-model="dataForm.location" v-model="dataForm.area"
placeholder="请选择所属市区级" placeholder="请选择所属市区级"
:options="optionsOfLocation" :options="optionsOfLocation"
:props="{ checkStrictly: true }" :props="props"
clearable clearable
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
@click="getDataList()" @click="getdatalist()"
type="primary" type="primary"
>{{ $t('query') }}</el-button> >{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
...@@ -64,27 +64,29 @@ ...@@ -64,27 +64,29 @@
style="width: 100%;margin-bottom: 20px;" style="width: 100%;margin-bottom: 20px;"
row-key="id" row-key="id"
border border
:indent="16" :indent="50"
:select-on-indeterminate="false" :select-on-indeterminate="false"
@select="select" @select="select"
@select-all="selectAll" @select-all="selectAll"
@selection-change="selectionChange" @selection-change="selectionChange"
:tree-props="{children: 'childList'}" default-expand-all
:tree-props="{children: 'userInfo'}"
> >
<el-table-column <el-table-column
type="selection" type="selection"
width="55" width="55"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="name" prop="name"
label="委员会人员" label="委员会人员"
header-align="center"
> >
</el-table-column> </el-table-column>
</el-table> </el-table>
{{ selectArr.map(el => el.id) }} <!-- {{ selectArr.map(el => el.id) }} -->
<!-- <div style="margin-top: 20px"> <!-- <div style="margin-top: 20px">
<el-button @click="cancelAll()">取消选择</el-button> <el-button @click="cancelAll()">取消选择</el-button>
</div> --> </div> -->
...@@ -95,38 +97,100 @@ ...@@ -95,38 +97,100 @@
import mixinViewModule from "@/mixins/view-module"; import mixinViewModule from "@/mixins/view-module";
export default { export default {
name: "location-table", name: "location-table",
props: ["invitedUserNames"],
mixins: [mixinViewModule], mixins: [mixinViewModule],
data() { data() {
return { return {
tableData: [ tableData: [
{ /* {
id: 1, id: "10",
name: "鄞州区", name: "鄞州区",
childList: [ childList: [
{ {
id: 31, areaId: "1343843631169024001",
name: "王小虎", areaName: null,
committeeId: "1343392971822821377",
committeeName: null,
company: "邻家",
createDate: null,
creator: null,
email: "222",
id: "4",
ifCheck: 1,
member: 1,
mobile: "333",
name: "小明同学",
openid: null,
position: "小喽喽",
sex: 1,
updateDate: "2020-12-31 00:42:46",
}, },
{ {
id: 32, areaId: "1343843631169024001",
name: "王小虎", areaName: null,
committeeId: "1343392971822821377",
committeeName: null,
company: "哦哦哦",
createDate: null,
creator: null,
email: "22",
id: "5",
ifCheck: 1,
member: 1,
mobile: "133",
name: "小明的朋友小红",
openid: null,
position: "客服",
sex: 2,
updateDate: "2020-12-31 00:42:48",
}, },
], ],
}, },
{ {
id: 2, id: "3",
name: "海曙区", name: "海曙区",
childList: [ childList: [
{ {
id: 311, areaId: "1343843631169024001",
name: "张亮亮", areaName: null,
committeeId: "1343392971822821377",
committeeName: null,
company: "哦哦哦",
createDate: null,
creator: null,
email: "22",
id: "1",
ifCheck: 1,
member: 1,
mobile: "133",
name: "小明",
openid: null,
position: "客服",
sex: 2,
updateDate: "2020-12-31 00:42:48",
}, },
{ {
id: 321, areaId: "1",
name: "王小虎", areaName: null,
committeeId: "1344173596351778818",
committeeName: null,
company: "金网",
createDate: null,
creator: null,
email: "1111",
id: "2",
ifCheck: 1,
member: 1,
mobile: "11111",
name: "小小明",
openid: null,
position: "大Boss",
sex: 1,
updateDate: "2021-01-01 06:17:06",
}, },
], ],
}, }, */
], ],
selectArr: [], selectArr: [],
...@@ -137,10 +201,16 @@ export default { ...@@ -137,10 +201,16 @@ export default {
dataListSelections: [], dataListSelections: [],
dataForm: { dataForm: {
name: "", name: "",
location: "", area: "",
},
props: {
checkStrictly: true,
value: "id",
label: "name",
children: "children",
}, },
optionsOfLocation: [ optionsOfLocation: [
{ /* {
value: "ningbo", value: "ningbo",
label: "宁波", label: "宁波",
children: [ children: [
...@@ -161,29 +231,150 @@ export default { ...@@ -161,29 +231,150 @@ export default {
label: "镇海区", label: "镇海区",
}, },
], ],
}, }, */
], ],
}; };
}, },
mounted() {
this.getInfo();
this.getdatalist();
//this.toggleSelections(this.tableData);
},
watch: {
tableData: function (newval, oldval) {
// console.log(newval);
},
},
methods: { methods: {
getInfo() {
this.$http
.get("/area/area/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
// console.log("parent", this.invitedUserNames);
let selectlist = this.invitedUserNames;
// this.selectionChange(selectlist);
//this.$refs.table.toggleRowSelection(2, true);
this.optionsOfLocation = this.getTreeData(res.data);
})
.catch(() => {});
},
getdatalist() {
let area = "";
if (this.dataForm.area.length > 0) {
area = this.dataForm.area[1];
} else {
area = "";
}
this.$http
.get("/user/user/areaList?area=" + area + "&name=" + this.dataForm.name)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.tableData = res.data;
// console.log("this.tableData", this.tableData);
})
.then(() => {
this.toggleSelections(this.tableData);
})
.catch(() => {});
},
getInclude1(arr1, arr2) {
let temp = [];
for (const item of arr2) {
arr1.find((i) => i.id === item.id) ? temp.push(item) : "";
}
return temp;
},
toggleSelections(rows) {
// console.log("Wodoap", this.tableData);
if (rows) {
rows.forEach((row) => {
if (row.userInfo) {
row.userInfo.map((j) => {
// console.log("Wodoapjjj", j);
this.invitedUserNames.map((i) => {
if (i.id == j.id) {
this.toggleSelection(j, true);
}
});
});
let templist = this.getInclude1(
this.invitedUserNames,
row.userInfo
);
if (templist.length == row.userInfo.length) {
this.$refs.table.toggleRowSelection(row);
}
// console.log("log", templist);
}
// console.log(row);
});
} else {
this.$refs.table.clearSelection();
}
},
getTreeData(data) {
// 循环遍历json数据
for (var i = 0; i < data.length; i++) {
if (data[i].children.length < 1) {
// children若为空数组,则将children设为undefined
data[i].children = undefined;
} else {
// children若不为空数组,则继续 递归调用 本方法
this.getTreeData(data[i].children);
}
}
return data;
},
dataListSelectionChangeHandle1(val) { dataListSelectionChangeHandle1(val) {
this.dataListSelections = val; this.dataListSelections = val;
console.log(val); // console.log(val);
}, },
select(selection, row) { select(selection, row) {
// console.log("selection", selection);
//this.$refs.table.toggleRowSelection(1, false);
let aatemplist = [];
let bbtemplist = [];
selection.some((el) => {
if (el.userInfo) {
aatemplist.push(el);
} else {
bbtemplist.push(el);
}
});
aatemplist.some((ele, index) => {
ele.userInfo.forEach((el) => {
// console.log("el", el.id);
if (el.id == row.id) {
this.$refs.table.toggleRowSelection(this.tableData[index], false);
}
});
});
// console.log("temp", templist);
if ( if (
selection.some((el) => { selection.some((el) => {
return row.id === el.id; return row.id === el.id;
}) })
) { ) {
if (row.childList) { if (row.userInfo) {
row.childList.map((j) => { row.userInfo.map((j) => {
this.toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} }
} else { } else {
if (row.childList) { if (row.userInfo) {
row.childList.map((j) => { row.userInfo.map((j) => {
this.toggleSelection(j, false); this.toggleSelection(j, false);
}); });
} }
...@@ -202,8 +393,8 @@ export default { ...@@ -202,8 +393,8 @@ export default {
}); });
if (isSelect) { if (isSelect) {
selection.map((el) => { selection.map((el) => {
if (el.childList) { if (el.userInfo) {
el.childList.map((j) => { el.userInfo.map((j) => {
this.toggleSelection(j, true); this.toggleSelection(j, true);
}); });
} }
...@@ -211,8 +402,8 @@ export default { ...@@ -211,8 +402,8 @@ export default {
} }
if (isCancel) { if (isCancel) {
this.tableData.map((el) => { this.tableData.map((el) => {
if (el.childList) { if (el.userInfo) {
el.childList.map((j) => { el.userInfo.map((j) => {
this.toggleSelection(j, false); this.toggleSelection(j, false);
}); });
} }
...@@ -221,7 +412,45 @@ export default { ...@@ -221,7 +412,45 @@ export default {
}, },
selectionChange(selection) { selectionChange(selection) {
this.selectArr = selection; this.selectArr = selection;
let childByValueContent = [];
selection.forEach((ele) => {
if (ele.userInfo == undefined) {
childByValueContent.push(ele);
}
});
let aatemplist = [];
let bbtemplist = [];
selection.some((el) => {
if (el.userInfo) {
aatemplist.push(el);
} else {
bbtemplist.push(el);
}
});
/* let templist2 = [];
templist2 = this.getInclude1(this.tableData, aa);
console.log("aaa", this.tableData.length);
console.log("bbb", templist2.length); */
this.tableData.forEach((ele, index) => {
let templist = [];
templist = this.getInclude1(ele.userInfo, bbtemplist);
/* console.log("aaa", ele.userInfoList.length);
console.log("bbb", templist.length); */
if (ele.userInfo.length == templist.length) {
this.$refs.table.toggleRowSelection(this.tableData[index], true);
} else {
this.$refs.table.toggleRowSelection(this.tableData[index], false);
}
});
this.$emit("childByValue", childByValueContent);
}, },
toggleSelection(row, select) { toggleSelection(row, select) {
if (row) { if (row) {
this.$nextTick(() => { this.$nextTick(() => {
......
...@@ -39,9 +39,7 @@ ...@@ -39,9 +39,7 @@
@click="deleteHandle()" @click="deleteHandle()"
>{{ $t('deleteBatch') }}</el-button> >{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item>
<el-button @click="detail()">详情测试</el-button>
</el-form-item>
</el-form> </el-form>
<el-table <el-table
v-loading="dataListLoading" v-loading="dataListLoading"
...@@ -57,7 +55,7 @@ ...@@ -57,7 +55,7 @@
width="50" width="50"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="name" prop="title"
label="会议名称" label="会议名称"
header-align="center" header-align="center"
align="center" align="center"
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
class="meeting" class="meeting"
style="width:100%;border:2px solid #ccc;border-radius:5px;margin-bottom:20px" style="width:100%;border:2px solid #ccc;border-radius:5px;margin-bottom:20px"
> >
<el-form-item prop="name"> <el-form-item prop="title">
<el-input <el-input
v-model="dataForm.name" v-model="dataForm.title"
style="font-size:22px;border:0" style="font-size:22px;border:0"
placeholder="请在这里输入会议标题" placeholder="请在这里输入会议标题"
></el-input> ></el-input>
...@@ -39,25 +39,25 @@ ...@@ -39,25 +39,25 @@
</div> </div>
<el-form-item <el-form-item
label="选择发送人员:" label="选择发送人员:"
prop="allPeople" prop="invitedUserIDs"
> >
<el-tooltip <!-- <el-tooltip
:content="dataForm.allPeople" :content="allPeople"
placement="left" placement="left"
:disabled="people.length>0?false:true" :disabled="dataForm.invitedUserNames.length>0?false:true"
> > -->
<div class="peoplehide"> <div class="peoplehide">
<span <span
v-for="(item,index) in people.slice(0,200)" v-for="(item,index) in dataForm.invitedUserNames.slice(0,200)"
:key="index" :key="index"
> >
{{item}} {{item.name}}
<span v-if="index<199&&index<people.length-1"></span> <span v-if="index<199&&index<dataForm.invitedUserNames.length-1"></span>
</span> </span>
<span v-if="people.length>200">...</span> <span v-if="dataForm.invitedUserNames.length>200">...</span>
<el-button <el-button
@click="isShow=true" @click="isShow=true"
class="sendbtn" class="sendbtn"
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
></el-button> ></el-button>
</div> </div>
</el-tooltip> <!-- </el-tooltip> -->
</el-form-item> </el-form-item>
...@@ -86,13 +86,19 @@ ...@@ -86,13 +86,19 @@
label="委员会选择" label="委员会选择"
name="first" name="first"
> >
<committeeTable /> <committeeTable
v-on:childByValue="childByValue"
:invitedUserNames="dataForm.invitedUserNames"
/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane <el-tab-pane
label="市区级选择" label="市区级选择"
name="second" name="second"
> >
<locationTable /> <locationTable
v-on:childByValue="childByValue"
:invitedUserNames="dataForm.invitedUserNames"
/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -139,19 +145,28 @@ export default { ...@@ -139,19 +145,28 @@ export default {
isShow: false, isShow: false,
activeName: "first", activeName: "first",
people: ["111", "222"], allPeople: "",
peoplelist: [],
dataForm: { dataForm: {
id: "", id: "",
name: "", title: "",
content: "", content: "",
allPeople: "", /* allPeople: "", */
invitedUserIDs: [],
invitedUserNames: [],
}, },
}; };
}, },
/* watch: {
invitedUserNames: function (newval, oldval) {
console.log("11", newval);
},
}, */
computed: { computed: {
dataRule() { dataRule() {
return { return {
name: [ title: [
{ {
required: true, required: true,
message: this.$t("validate.required"), message: this.$t("validate.required"),
...@@ -165,41 +180,83 @@ export default { ...@@ -165,41 +180,83 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
allPeople: [ /* allPeople: [
{ {
required: true, required: true,
message: this.$t("validate.required"), message: this.$t("validate.required"),
trigger: "blur", trigger: "blur",
}, },
], ], */
}; };
}, },
}, },
created() { created() {
this.init(); this.init();
this.dataForm.allPeople = this.people.join(",");
}, },
methods: { methods: {
init() { init() {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["dataForm"].resetFields(); this.$refs["dataForm"].resetFields();
if (this.$route.query.id) { // console.log("uuuuuuu", this.$route.query.id);
if (this.$route.query.id != undefined) {
this.dataForm.id = this.$route.query.id; this.dataForm.id = this.$route.query.id;
// console.log(this.dataForm.id);
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo(); this.getInfo();
} }
} }
}); });
}, },
unique(arr) {
return Array.from(new Set(arr));
},
unique2(arr) {
const res = new Map();
return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
},
//确定选择人员 //确定选择人员
sub() { sub() {
this.$confirm("确定提交吗?") this.$confirm("确定提交吗?")
.then((_) => { .then((_) => {
this.isShow = false; this.isShow = false;
this.dataForm.invitedUserNames = this.peoplelist;
// console.log("pppp", this.peoplelist);
this.dataForm.invitedUserNames = this.unique2(
this.dataForm.invitedUserNames
);
/* console.log(
"this.dataForm.invitedUserNames",
this.dataForm.invitedUserNames
); */
}) })
.catch((_) => {}); .catch((_) => {});
}, },
childByValue: function (childValue) {
// childValue就是子组件传过来的值
if (childValue) {
//console.log("childValue", childValue);
/* childValue.forEach((ele) => {
this.peoplelist.push(ele);
this.dataForm.invitedUserIDs.push(ele.id);
// this.dataForm.invitedUserNames.push(ele.name);
}); */
this.peoplelist = childValue;
this.dataForm.invitedUserIDs = childValue.map((el) => el.id);
// this.dataForm.invitedUserIDs = childValue;
this.peoplelist = this.unique2(this.peoplelist);
this.dataForm.invitedUserIDs = this.unique(
this.dataForm.invitedUserIDs
);
}
/* this.dataForm.invitedUserNames = this.unique(
this.dataForm.invitedUserNames
); */
// this.allPeople = this.dataForm.invitedUserNames.join(",");
},
// 获取信息 // 获取信息
getInfo() { getInfo() {
this.$http this.$http
...@@ -208,11 +265,17 @@ export default { ...@@ -208,11 +265,17 @@ export default {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg);
} }
this.dataForm = { this.dataForm = {
...this.dataForm, ...this.dataForm,
...res.data, ...res.data,
}; };
console.log(this.dataForm); // console.log(this.dataForm);
// this.peoplelist=this.dataForm.
//this.allPeople = this.dataForm.invitedUserNames.join(",");
/* if (this.dataForm.invitedUserIDs == null) {
this.dataForm.invitedUserIDs = [];
} */
}) })
.catch(() => {}); .catch(() => {});
}, },
...@@ -238,6 +301,9 @@ export default { ...@@ -238,6 +301,9 @@ export default {
type: "success", type: "success",
}); });
}) })
.then(() => {
this.$router.go(-1);
})
.catch(() => {}); .catch(() => {});
}) })
.catch((_) => {}); .catch((_) => {});
...@@ -276,7 +342,7 @@ export default { ...@@ -276,7 +342,7 @@ export default {
.catch((_) => {}); .catch((_) => {});
}, },
handleClick(tab, event) { handleClick(tab, event) {
console.log(tab, event); //console.log(tab, event);
}, },
//返回按钮事件 //返回按钮事件
......
...@@ -7,7 +7,36 @@ ...@@ -7,7 +7,36 @@
<div class="title"><span class="substyle">会议内容 </span> </div> <div class="title"><span class="substyle">会议内容 </span> </div>
<div class="meetingsContent"> <div class="meetingsContent">
<el-form> <el-form>
<el-form-item label=""> <div
class="meeting"
style="width:100%;border:2px solid #ccc;border-radius:5px;margin-bottom:20px"
>
<el-form-item prop="title">
<el-input
v-model="dataform1.title"
style="font-size:22px;border:0"
disabled
placeholder="暂无标题"
></el-input>
</el-form-item>
<el-form-item
prop="content"
label=""
>
<el-input
type="textarea"
:rows="14"
resize="none"
v-model="dataform1.content"
disabled
:autosize="{ minRows: 6, maxRows: 14 }"
placeholder="暂无内容"
></el-input>
</el-form-item>
</div>
<!-- <el-form-item label="">
<el-input <el-input
type="textarea" type="textarea"
:autosize="{ minRows: 6, maxRows: 14 }" :autosize="{ minRows: 6, maxRows: 14 }"
...@@ -16,15 +45,13 @@ ...@@ -16,15 +45,13 @@
placeholder="暂无" placeholder="暂无"
disabled disabled
></el-input> ></el-input>
</el-form-item> </el-form-item> -->
<el-form-item <el-form-item label="已发送人员:">
required
label="发送人员:"
>
<el-input <el-input
disabled disabled
type="textarea" type="textarea"
:rows="4" :rows="4"
resize="none"
class="sendpeople" class="sendpeople"
placeholder="暂无" placeholder="暂无"
v-model="dataform1.people" v-model="dataform1.people"
...@@ -83,43 +110,44 @@ ...@@ -83,43 +110,44 @@
width="50" width="50"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="company" prop="userInfo.company"
label="单位" label="单位"
header-align="center" header-align="center"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="name" prop="userInfo.name"
label="姓名" label="姓名"
header-align="center" header-align="center"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="email" prop="userInfo.email"
label="邮箱" label="邮箱"
header-align="center" header-align="center"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="mobile" prop="userInfo.mobile"
label="手机号" label="手机号"
sortable="custom" sortable="custom"
header-align="center" header-align="center"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="gender" prop="userInfo.sex"
label="性别" label="性别"
sortable="custom" sortable="custom"
header-align="center" header-align="center"
align="center" align="center"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ $getDictLabel("gender", scope.row.gender) }} <span v-if="scope.row.userInfo.sex==1"></span>
<span v-if="scope.row.userInfo.sex==2"></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="position" prop="userInfo.position"
label="职位" label="职位"
header-align="center" header-align="center"
align="center" align="center"
...@@ -144,6 +172,16 @@ ...@@ -144,6 +172,16 @@
> >
</el-pagination> </el-pagination>
</div> </div>
<div class="footer">
<el-button
style="border:1px solid #17B3A3;color:#17B3A3;width:100px;float:right;margin-top:20px"
@click="goback"
>
返回
</el-button>
</div>
</div> </div>
</el-card> </el-card>
...@@ -157,16 +195,17 @@ export default { ...@@ -157,16 +195,17 @@ export default {
data() { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: "/sys/user/page", getDataListURL:
"/meeting/wlmeetingstaff/page?registrationState=1&meetingId=" +
this.$route.query.id,
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: "/sys/user",
deleteIsBatch: true, deleteIsBatch: true,
exportURL: "/sys/user/export", exportURL: "/meeting/wlmeetingstaff/export",
}, },
dataform1: { dataform1: {
meetingContent: "1111", meetingContent: "1111",
people: people: "",
"张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧,张网吧",
}, },
dataForm: { dataForm: {
company: "", company: "",
...@@ -174,35 +213,38 @@ export default { ...@@ -174,35 +213,38 @@ export default {
}, },
}; };
}, },
created() {
this.init();
},
methods: { methods: {
//返回按钮事件
goback() {
this.$router.go(-1);
},
init() { init() {
console.log(this.$route.query.id); console.log(this.$route.query.id);
this.dataForm.id = this.$route.query.id; this.dataform1.id = this.$route.query.id;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["dataForm"].resetFields(); // this.$refs["dataForm"].resetFields();
if (this.dataForm.id) { if (this.dataform1.id) {
this.getInfo(); this.getInfo();
} }
}); });
console.log("ppp", this.dataForm.sex);
console.log("pppo", typeof this.dataForm.sex);
}, },
// 获取信息 // 获取信息
getInfo() { getInfo() {
this.$http this.$http
.get(`/meeting/meeting/${this.dataForm.id}`) .get(`/meeting/meeting/${this.dataform1.id}`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg); return this.$message.error(res.msg);
} }
this.dataForm = { this.dataform1 = {
...this.dataForm, ...this.dataform1,
...res.data, ...res.data,
}; };
console.log("ppppppp", this.dataForm); console.log("ppppppp", this.dataform1);
console.log("ppp", this.dataForm.sex); this.dataform1.people = this.dataform1.invitedUserNames.join(",");
this.dataForm.sex = this.dataForm.sex + "";
}) })
.catch(() => {}); .catch(() => {});
}, },
...@@ -211,9 +253,18 @@ export default { ...@@ -211,9 +253,18 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
/deep/.el-textarea__inner { .meeting {
font-size: 22px; /deep/.el-input__inner {
font-size: 22px !important;
border: 0;
}
/deep/.el-textarea__inner {
font-size: 16px;
border: 0;
padding: 0 0 0 30px;
}
} }
/deep/.el-input.is-disabled .el-input__inner { /deep/.el-input.is-disabled .el-input__inner {
color: #000; color: #000;
background: #fff; background: #fff;
...@@ -245,6 +296,9 @@ export default { ...@@ -245,6 +296,9 @@ export default {
padding-left: 10px; padding-left: 10px;
} }
} }
.footer {
width: 100%;
}
.other { .other {
//background: #eee; //background: #eee;
......
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <el-dialog
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> :visible.sync="visible"
<el-form-item prop="username" :label="$t('user.username')"> :title="!dataForm.id ? $t('add') : $t('update')"
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input> :close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
:model="dataForm"
:rules="dataRule"
ref="dataForm"
@keyup.enter.native="dataFormSubmitHandle()"
label-width="120px"
>
<el-form-item
prop="username"
:label="$t('user.username')"
>
<el-input
v-model="dataForm.username"
:placeholder="$t('user.username')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="deptName" :label="$t('user.deptName')"> <!-- <el-form-item prop="deptName" :label="$t('user.deptName')">
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :dept-name.sync="dataForm.deptName"></ren-dept-tree> <ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :dept-name.sync="dataForm.deptName"></ren-dept-tree>
</el-form-item> -->
<el-form-item
prop="password"
:label="$t('user.password')"
:class="{ 'is-required': !dataForm.id }"
>
<el-input
v-model="dataForm.password"
type="password"
:placeholder="$t('user.password')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password" :label="$t('user.password')" :class="{ 'is-required': !dataForm.id }"> <el-form-item
<el-input v-model="dataForm.password" type="password" :placeholder="$t('user.password')"></el-input> prop="confirmPassword"
:label="$t('user.confirmPassword')"
:class="{ 'is-required': !dataForm.id }"
>
<el-input
v-model="dataForm.confirmPassword"
type="password"
:placeholder="$t('user.confirmPassword')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="confirmPassword" :label="$t('user.confirmPassword')" :class="{ 'is-required': !dataForm.id }"> <el-form-item
<el-input v-model="dataForm.confirmPassword" type="password" :placeholder="$t('user.confirmPassword')"></el-input> prop="realName"
:label="$t('user.realName')"
>
<el-input
v-model="dataForm.realName"
:placeholder="$t('user.realName')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="realName" :label="$t('user.realName')"> <el-form-item
<el-input v-model="dataForm.realName" :placeholder="$t('user.realName')"></el-input> prop="gender"
:label="$t('user.gender')"
>
<ren-radio-group
v-model="dataForm.gender"
dict-type="gender"
></ren-radio-group>
</el-form-item> </el-form-item>
<el-form-item prop="gender" :label="$t('user.gender')"> <el-form-item
<ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group> prop="email"
:label="$t('user.email')"
>
<el-input
v-model="dataForm.email"
:placeholder="$t('user.email')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="email" :label="$t('user.email')"> <el-form-item
<el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input> prop="mobile"
:label="$t('user.mobile')"
>
<el-input
v-model="dataForm.mobile"
:placeholder="$t('user.mobile')"
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="mobile" :label="$t('user.mobile')"> <!-- <el-form-item
<el-input v-model="dataForm.mobile" :placeholder="$t('user.mobile')"></el-input> prop="roleIdList"
</el-form-item> :label="$t('user.roleIdList')"
<el-form-item prop="roleIdList" :label="$t('user.roleIdList')" class="role-list"> class="role-list"
<el-select v-model="dataForm.roleIdList" multiple :placeholder="$t('user.roleIdList')"> >
<el-option v-for="role in roleList" :key="role.id" :label="role.name" :value="role.id"></el-option> <el-select
v-model="dataForm.roleIdList"
multiple
:placeholder="$t('user.roleIdList')"
>
<el-option
v-for="role in roleList"
:key="role.id"
:label="role.name"
:value="role.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item prop="status" :label="$t('user.status')" size="mini"> <el-form-item
prop="status"
:label="$t('user.status')"
size="mini"
>
<el-radio-group v-model="dataForm.status"> <el-radio-group v-model="dataForm.status">
<el-radio :label="0">{{ $t('user.status0') }}</el-radio> <el-radio :label="0">{{ $t('user.status0') }}</el-radio>
<el-radio :label="1">{{ $t('user.status1') }}</el-radio> <el-radio :label="1">{{ $t('user.status1') }}</el-radio>
...@@ -39,166 +113,244 @@ ...@@ -39,166 +113,244 @@
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> <el-button
type="primary"
@click="dataFormSubmitHandle()"
>{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from "lodash/debounce";
import { isEmail, isMobile } from '@/utils/validate' import { isEmail, isMobile } from "@/utils/validate";
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
roleList: [], roleList: [],
roleIdListDefault: [], roleIdListDefault: [],
dataForm: { dataForm: {
id: '', id: "",
username: '', username: "",
deptId: '', deptId: "",
deptName: '', deptName: "",
password: '', password: "",
confirmPassword: '', confirmPassword: "",
realName: '', realName: "",
gender: 0, gender: 0,
email: '', email: "",
mobile: '', mobile: "",
roleIdList: [], roleIdList: [],
status: 1 status: 1,
} },
} };
}, },
computed: { computed: {
dataRule () { dataRule() {
var validatePassword = (rule, value, callback) => { var validatePassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) { if (!this.dataForm.id && !/\S/.test(value)) {
return callback(new Error(this.$t('validate.required'))) return callback(new Error(this.$t("validate.required")));
}
callback()
} }
callback();
};
var validateConfirmPassword = (rule, value, callback) => { var validateConfirmPassword = (rule, value, callback) => {
if (!this.dataForm.id && !/\S/.test(value)) { if (!this.dataForm.id && !/\S/.test(value)) {
return callback(new Error(this.$t('validate.required'))) return callback(new Error(this.$t("validate.required")));
} }
if (this.dataForm.password !== value) { if (this.dataForm.password !== value) {
return callback(new Error(this.$t('user.validate.confirmPassword'))) return callback(new Error(this.$t("user.validate.confirmPassword")));
}
callback()
} }
callback();
};
var validateEmail = (rule, value, callback) => { var validateEmail = (rule, value, callback) => {
if (value && !isEmail(value)) { if (value && !isEmail(value)) {
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.email') }))) return callback(
} new Error(
callback() this.$t("validate.format", { attr: this.$t("user.email") })
)
);
} }
callback();
};
var validateMobile = (rule, value, callback) => { var validateMobile = (rule, value, callback) => {
if (value && !isMobile(value)) { if (value && !isMobile(value)) {
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.mobile') }))) return callback(
} new Error(
callback() this.$t("validate.format", { attr: this.$t("user.mobile") })
)
);
} }
callback();
};
return { return {
username: [ username: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } {
], required: true,
deptName: [ trigger: "blur",
{ required: true, message: this.$t('validate.required'), trigger: 'change' } validator: this.checkName,
], },
password: [
{ validator: validatePassword, trigger: 'blur' }
], ],
/* deptName: [
{
required: true,
message: this.$t("validate.required"),
trigger: "change",
},
], */
password: [{ validator: validatePassword, trigger: "blur" }],
confirmPassword: [ confirmPassword: [
{ validator: validateConfirmPassword, trigger: 'blur' } { validator: validateConfirmPassword, trigger: "blur" },
], ],
realName: [ realName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } {
], required: true,
email: [ message: this.$t("validate.required"),
{ validator: validateEmail, trigger: 'blur' } trigger: "blur",
},
], ],
mobile: [ email: [{ validator: validateEmail, trigger: "blur" }],
{ validator: validateMobile, trigger: 'blur' } mobile: [{ validator: validateMobile, trigger: "blur" }],
] };
},
},
methods: {
checkName(rule, value, callback) {
if (!value) {
return callback(new Error("请输入英文字符"));
} else if (value == null) {
return callback(new Error("请输入英文字符"));
} else {
const reg = /[a-zA-z]$/;
console.log(reg.test(value));
if (reg.test(value)) {
callback();
} else {
return callback(new Error("请输入英文字符"));
} }
} }
}, },
methods: { checkPhone(rule, value, callback) {
init () { if (!value) {
this.visible = true return callback(new Error("请输入正确的手机号"));
this.dataForm.deptId = '' } else if (value == null) {
return callback(new Error("手机号不能为空"));
} else {
const reg = /^((0\d{2,3}-\d{7,8})|(1[35789]\d{9}))$/;
console.log(reg.test(value));
if (reg.test(value)) {
callback();
} else {
return callback(new Error("请输入正确的手机号或座机号"));
}
}
},
checkEmail(rule, value, callback) {
if (!value) {
return callback(new Error("请输入正确的邮箱号"));
} else if (value == null) {
return callback(new Error("邮箱号不能为空"));
} else {
const reg = /^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*\.[a-z]{2,}$/;
console.log(reg.test(value));
if (reg.test(value)) {
callback();
} else {
return callback(new Error("请输入正确的邮箱号"));
}
}
},
init() {
this.visible = true;
this.dataForm.deptId = "";
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs["dataForm"].resetFields();
this.roleIdListDefault = [] this.roleIdListDefault = [];
Promise.all([ Promise.all([this.getRoleList()]).then(() => {
this.getRoleList()
]).then(() => {
if (this.dataForm.id) { if (this.dataForm.id) {
this.getInfo() this.getInfo();
} }
}) });
}) });
}, },
// 获取角色列表 // 获取角色列表
getRoleList () { getRoleList() {
return this.$http.get('/sys/role/list').then(({ data: res }) => { return this.$http
.get("/sys/role/list")
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} }
this.roleList = res.data this.roleList = res.data;
}).catch(() => {}) })
.catch(() => {});
}, },
// 获取信息 // 获取信息
getInfo () { getInfo() {
this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => { this.$http
.get(`/sys/user/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} }
this.dataForm = { this.dataForm = {
...this.dataForm, ...this.dataForm,
...res.data, ...res.data,
roleIdList: [] roleIdList: [],
} };
// 角色配置, 区分是否为默认角色 // 角色配置, 区分是否为默认角色
for (var i = 0; i < res.data.roleIdList.length; i++) { for (var i = 0; i < res.data.roleIdList.length; i++) {
if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) { if (
this.dataForm.roleIdList.push(res.data.roleIdList[i]) this.roleList.filter(
continue (item) => item.id === res.data.roleIdList[i]
)[0]
) {
this.dataForm.roleIdList.push(res.data.roleIdList[i]);
continue;
} }
this.roleIdListDefault.push(res.data.roleIdList[i]) this.roleIdListDefault.push(res.data.roleIdList[i]);
} }
}).catch(() => {}) })
.catch(() => {});
}, },
// 表单提交 // 表单提交
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(
this.$refs['dataForm'].validate((valid) => { function () {
this.$refs["dataForm"].validate((valid) => {
if (!valid) { if (!valid) {
return false return false;
} }
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/user', { this.$http[!this.dataForm.id ? "post" : "put"]("/sys/user", {
...this.dataForm, ...this.dataForm,
roleIdList: [ roleIdList: [
...this.dataForm.roleIdList, ...this.dataForm.roleIdList,
...this.roleIdListDefault ...this.roleIdListDefault,
] ],
}).then(({ data: res }) => { })
.then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg);
} }
this.$message({ this.$message({
message: this.$t('prompt.success'), message: this.$t("prompt.success"),
type: 'success', type: "success",
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false;
this.$emit('refreshDataList') this.$emit("refreshDataList");
} },
}) });
}).catch(() => {})
}) })
}, 1000, { 'leading': true, 'trailing': false }) .catch(() => {});
} });
} },
1000,
{ leading: true, trailing: false }
),
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
......
...@@ -26,10 +26,11 @@ ...@@ -26,10 +26,11 @@
<el-form-item> <el-form-item>
<el-form-item> <el-form-item>
<el-cascader <el-cascader
v-model="dataForm.location" v-model="dataForm.area"
placeholder="请选择所属市区级" placeholder="请选择所属市区级"
:options="optionsOfLocation" :options="optionsOfLocation"
:props="{ checkStrictly: true }" @change="changearea"
:props="props"
clearable clearable
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
...@@ -195,8 +196,14 @@ export default { ...@@ -195,8 +196,14 @@ export default {
deleteIsBatch: true, deleteIsBatch: true,
exportURL: "/sys/user/export", exportURL: "/sys/user/export",
}, },
props: {
checkStrictly: true,
value: "id",
label: "name",
children: "children",
},
optionsOfLocation: [ optionsOfLocation: [
{ /* {
value: "ningbo", value: "ningbo",
label: "宁波", label: "宁波",
children: [ children: [
...@@ -217,15 +224,50 @@ export default { ...@@ -217,15 +224,50 @@ export default {
label: "镇海区", label: "镇海区",
}, },
], ],
}, }, */
], ],
dataForm: { dataForm: {
username: "", username: "",
deptId: "", area: "",
gender: "", gender: "",
}, },
}; };
}, },
methods: {
getInfo() {
this.$http
.get("/area/area/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsOfLocation = this.getTreeData(res.data);
console.log(res.data);
})
.catch(() => {});
},
changearea(value) {
console.log(value);
this.dataForm.area = value[value.length - 1];
},
getTreeData(data) {
// 循环遍历json数据
for (var i = 0; i < data.length; i++) {
if (data[i].children.length < 1) {
// children若为空数组,则将children设为undefined
data[i].children = undefined;
} else {
// children若不为空数组,则继续 递归调用 本方法
this.getTreeData(data[i].children);
}
}
return data;
},
},
created() {
this.getInfo();
},
components: { components: {
AddOrUpdate, AddOrUpdate,
}, },
......
...@@ -29,21 +29,23 @@ ...@@ -29,21 +29,23 @@
v-model="dataForm.area" v-model="dataForm.area"
placeholder="请选择所属市区级" placeholder="请选择所属市区级"
:options="optionsOfLocation" :options="optionsOfLocation"
:props="{ checkStrictly: true }" @change="changearea"
:props="props"
clearable clearable
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select <el-select
@change="changename"
v-model="dataForm.committee" v-model="dataForm.committee"
placeholder="请选择所属委员会" placeholder="请选择所属委员会"
clearable clearable
> >
<el-option <el-option
v-for="item in optionsOfCommittee" v-for="item in optionsOfCommittee"
:key="item.value" :key="item.id"
:label="item.label" :label="item.name"
:value="item.value" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
...@@ -191,12 +193,18 @@ export default { ...@@ -191,12 +193,18 @@ export default {
data() { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: "/user/user/page", getDataListURL: "/user/user/page?check=1",
getDataListIsPage: true, getDataListIsPage: true,
exportURL: "/user/user/export", exportURL: "/user/user/export",
deleteURL: "/user/user", deleteURL: "/user/user",
deleteIsBatch: true, deleteIsBatch: true,
}, },
props: {
checkStrictly: true,
value: "id",
label: "name",
children: "children",
},
dataForm: { dataForm: {
company: "", company: "",
name: "", name: "",
...@@ -204,7 +212,7 @@ export default { ...@@ -204,7 +212,7 @@ export default {
committee: "", committee: "",
}, },
optionsOfLocation: [ optionsOfLocation: [
{ /* {
value: "ningbo", value: "ningbo",
label: "宁波", label: "宁波",
children: [ children: [
...@@ -225,10 +233,10 @@ export default { ...@@ -225,10 +233,10 @@ export default {
label: "镇海区", label: "镇海区",
}, },
], ],
}, }, */
], ],
optionsOfCommittee: [ optionsOfCommittee: [
{ /* {
value: "网络安全协会", value: "网络安全协会",
label: "网络安全协会", label: "网络安全协会",
}, },
...@@ -247,11 +255,61 @@ export default { ...@@ -247,11 +255,61 @@ export default {
{ {
value: "网络安全协会4", value: "网络安全协会4",
label: "网络安全协会4", label: "网络安全协会4",
}, }, */
], ],
}; };
}, },
created() {
this.getInfo();
},
methods: { methods: {
getInfo() {
this.$http
.get("/committee/committee/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsOfCommittee = res.data;
})
.catch(() => {});
this.$http
.get("/area/area/list")
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.optionsOfLocation = this.getTreeData(res.data);
})
.catch(() => {});
},
getTreeData(data) {
// 循环遍历json数据
for (var i = 0; i < data.length; i++) {
if (data[i].children.length < 1) {
// children若为空数组,则将children设为undefined
data[i].children = undefined;
} else {
// children若不为空数组,则继续 递归调用 本方法
this.getTreeData(data[i].children);
}
}
return data;
},
changename(value) {
/* this.optionsOfCommittee.forEach((ele) => {
if (value == ele.id) {
this.dataForm.committeeName = ele.name;
}
}); */
this.dataForm.committee = value;
},
changearea(value) {
console.log(value);
this.dataForm.area = value[value.length - 1];
},
taozhuan(id) { taozhuan(id) {
this.$router.push({ this.$router.push({
path: "/memberManageExamine", path: "/memberManageExamine",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment