| | |
| | | # 页面 title 前缀 |
| | | VUE_APP_TITLE=Basic |
| | | NODE_ENV=development |
| | | VUE_APP_BATH_PATH='http://192.168.20.119:9083' |
| | | VUE_APP_BATH_PATH='http://192.168.20.119:9081' |
| | | # 网络请求公用地址 |
| | | VUE_APP_API=/api/ |
| | | |
| | |
| | | |
| | | # 页面 title 前缀 |
| | | VUE_APP_TITLE=Basic |
| | | VUE_APP_BATH_PATH='http://192.168.20.119:9083' |
| | | VUE_APP_BATH_PATH='http://192.168.20.119:9081' |
| | | |
| | |
| | | import request from "@/common/untils/request.js" |
| | | |
| | | // 左侧菜单 |
| | | export function getMenuTreeByRole(data) { |
| | | // 等级列表 |
| | | export const getListRole = async (data) => { |
| | | return request({ |
| | | url: "/api/menu/getMenuTreeByRole", |
| | | url: "/api/role/listRole", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 根据角色id获取用户列表 |
| | | export const getUserList = async (data) => { |
| | | return request({ |
| | | url: "/api/role/usersById", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 新增角色 |
| | | export const addRole = (data) => { |
| | | return request({ |
| | | url: "/api/role/add", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 编辑角色 |
| | | export const updateRole = (data) => { |
| | | return request({ |
| | | url: "/api/role/update", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 获取参考角色 页面权限 菜单 的数据 |
| | | export const getDataRole = (data) => { |
| | | return request({ |
| | | url: "/api/role/prepare?useType=" + data.useType, |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | | // 角色启用、停用 |
| | | export const roleChange = (data) => { |
| | | return request({ |
| | | url: "/api/role/change", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // 删除角色 |
| | | export const deleteRole = (id) => { |
| | | return request({ |
| | | url: `/api/role/delete/${id}`, |
| | | method: "delete", |
| | | id |
| | | }) |
| | | } |
| | |
| | | import request from "@/common/untils/request.js" |
| | | |
| | | // 销售明细列表 |
| | | export function getSalesDetailsList(data) { |
| | | // 查询用户列表getUsers |
| | | export function listUser(data) { |
| | | return request({ |
| | | url: "/api/salesDetails/list", |
| | | url: "/api/user/getUsers", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 获取所有等级 |
| | | export function getRoleIDs(data) { |
| | | return request({ |
| | | url: "/api/role/listByOrg?useType=" + data.useType, |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | | // 修改用户状态 |
| | | export function changeStatus(data) { |
| | | return request({ |
| | | url: "/api/user/changeStatus", |
| | | method: "post", |
| | | data |
| | | }) |
| | |
| | | |
| | | <script> |
| | | // import codeMixin from "@/components/makepager/mixin/codeMixin" |
| | | import { addRole, updateRole, getDataRole } from "@/api/unifiedManage/userLevel" |
| | | export default { |
| | | name: "AddUserLevel", |
| | | // mixins: [codeMixin], |
| | |
| | | title: "新建", |
| | | infomation: {} |
| | | } |
| | | } |
| | | }, |
| | | editRow: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | |
| | | watch: { |
| | | "editCommonConfig.visible"(val) { |
| | | if (val) { |
| | | console.log(val, "sssssss") |
| | | this.isOpen = val |
| | | this.$refs.form.resetFields() |
| | | this.getDataInfo() |
| | | } |
| | | }, |
| | | "editCommonConfig.infomation"(val) { |
| | | if (this.isopen) { |
| | | this.$refs.form.resetFields() |
| | | if (val.id) { |
| | | this.getDataInfo(val) |
| | | } |
| | | } |
| | | console.log(val, "aaaa") |
| | | // if (this.isopen) { |
| | | // this.$refs.form.resetFields() |
| | | // if (val.id) { |
| | | // this.getDataInfo(val) |
| | | // } |
| | | // } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getDataInfo() |
| | | console.log(this.editConfig.infomation, "sdddd") |
| | | this.getDataInfo(this.editConfig.infomation) |
| | | }, |
| | | methods: { |
| | | handleClose() { |
| | |
| | | }, |
| | | // 获取参考角色 页面权限 菜单 的数据 |
| | | async getDataInfo(val) { |
| | | console.log(val) |
| | | // const rsp = await getDataRole({ useType: 1 }) |
| | | // if (rsp.code == 200) { |
| | | // // 参考角色 |
| | | // this.prepareRoleList = rsp.data.roles ? rsp.data.roles : [] |
| | | // this.menusList = rsp.data.menus ? rsp.data.menus : [] |
| | | // // 页面权限 |
| | | // this.completeList = rsp.data.subsystems ? rsp.data.subsystems : [] |
| | | // this.form.completeType = this.completeList.length > 0 ? this.completeList[0].systemType : 1 |
| | | // } |
| | | // if (this.isopen) { |
| | | // this.resetForm(val) |
| | | // } |
| | | const rsp = await getDataRole({ useType: 2 }) |
| | | if (rsp.code == 200) { |
| | | // 参考角色 |
| | | this.prepareRoleList = rsp.data.roles ? rsp.data.roles : [] |
| | | this.menusList = rsp.data.menus ? rsp.data.menus : [] |
| | | // 页面权限 |
| | | this.completeList = rsp.data.subsystems ? rsp.data.subsystems : [] |
| | | this.form.completeType = this.completeList.length > 0 ? this.completeList[0].systemType : 1 |
| | | } |
| | | if (this.editConfig.visible) { |
| | | this.resetForm(val) |
| | | } |
| | | }, |
| | | getMenuCheck(val) { |
| | | if (val && val.length > 0) { |
| | |
| | | this.completeList.length > 0 && this.completeList[0].systemType ? this.completeList[0].systemType : 1 |
| | | if (this.form.menuIDs && this.form.menuIDs.length > 0) { |
| | | for (let i in this.menusList) { |
| | | this.$refs["menuTree&" + this.menusList[i].systemType][0].setCheckedKeys(this.form.allMenu.split(",")) |
| | | console.log(this.$refs["menuTree&" + this.menusList[i].systemType]) |
| | | // this.$refs["menuTree&" + this.menusList[i].systemType][0].setCheckedKeys(this.form.allMenu.split(",")) |
| | | } |
| | | } |
| | | } else { |
| | | console.log(this.menusList) |
| | | for (let i in this.menusList) { |
| | | this.$refs["menuTree&" + this.menusList[i].systemType][0].setCheckedKeys([]) |
| | | console.log(this.$refs["menuTree&" + this.menusList[i]?.systemType]) |
| | | // this.$refs["menuTree&" + this.menusList[i]?.systemType][0].setCheckedKeys([]) |
| | | } |
| | | } |
| | | }, |
| | | imgClick(item) { |
| | | imgClick(item, index) { |
| | | console.log(index) |
| | | this.form.completeType = item.systemType |
| | | this.$forceUpdate() |
| | | }, |
| | |
| | | this.$refs[formName].validate((valid) => { |
| | | console.log(valid) |
| | | if (valid) { |
| | | // let submitFn = this.editRow.id ? updateRole : addRole |
| | | // let param = this.saveParams() |
| | | // submitFn(param).then((reply) => { |
| | | // if (reply && reply.code === 200) { |
| | | // this.$message.success("保存成功") |
| | | // this.$emit("shutdown", false) |
| | | // } |
| | | // }) |
| | | let submitFn = this.editRow.id ? updateRole : addRole |
| | | let param = this.saveParams() |
| | | submitFn(param).then((reply) => { |
| | | if (reply && reply.code === 200) { |
| | | this.$message.success("保存成功") |
| | | this.$emit("shutdown", false) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | id: this.editRow.id, |
| | | comment: data.comment || "", |
| | | name: data.name || "", |
| | | useType: 1 |
| | | useType: 2 |
| | | }, |
| | | menuIDs: menuIds |
| | | } |
| | | return params |
| | | }, |
| | | shutdown() { |
| | | this.$emit("shutdown", false) |
| | | } |
| | | } |
| | | } |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- 新建/编辑 --> |
| | | <AddUserLevel v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | <div class="overSpread" v-show="isopen"></div> |
| | | <!-- 添加/编辑 --> |
| | | <AddUserLevel :isopen="isopen" @shutdown="shutdown" :editRow="editRow" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import AddUserLevel from "@/views/unifiedManage/userLevel/components/AddUserLevel" |
| | | import { getListRole, getUserList, roleChange, deleteRole } from "@/api/unifiedManage/userLevel" |
| | | export default { |
| | | name: "UserLevel", |
| | | props: { |
| | | isDetail: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | addConfig: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | props: {}, |
| | | mixins: [pageMixin], |
| | | components: { AddUserLevel }, |
| | | computed: {}, |
| | |
| | | ], |
| | | showBottomCol: ["用户名", "姓名", "手机号", "岗位职务", "状态"], |
| | | isopen: false, |
| | | editRow: {}, |
| | | editConfig: { |
| | | visible: false, |
| | | title: "新建", |
| | |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | // 角色列表 |
| | | async getData(val) { |
| | | this.data.page = this.pagerOptions.currPage |
| | | this.data.pageSize = this.pagerOptions.pageSize |
| | | const res = await getListRole(this.data) |
| | | console.log(res) |
| | | this.tableList.tableInfomation = res.data.list |
| | | this.pagerOptions.totalCount = res.data.total |
| | | |
| | | if (this.pagerOptions.totalCount > 0) { |
| | | let row = this.tableList.tableInfomation[0] |
| | | this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {} |
| | | this.getUserList(row.id) |
| | | } |
| | | if (val !== "search") { |
| | | // this.overview(); |
| | | } |
| | | }, |
| | | // 用户列表 |
| | | async getUserList(id) { |
| | | let params = { |
| | | page: 0, |
| | | pageSize: 0, |
| | | id: id |
| | | } |
| | | const res = await getUserList(params) |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | let dutyList = [] |
| | | item.dutyIDs.forEach((val) => { |
| | | dutyList.push(val.dutyName) |
| | | }) |
| | | return { |
| | | ...item, |
| | | dutyNames: dutyList.join(", ") |
| | | } |
| | | }) |
| | | this.bottomTableList.tableInfomation = list || [] |
| | | } else { |
| | | this.bottomTableList.tableInfomation = [] |
| | | } |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.infomation = { ...this.addConfig, currency: "人民币" } |
| | | this.editConfig.visible = true |
| | | // this.editConfig.title = "新建" |
| | | // this.editConfig.visible = true |
| | | // this.editConfig.infomation = {} |
| | | this.isopen = true |
| | | this.editRow = {} |
| | | }, |
| | | // 搜索 |
| | | searchClick(val) { |
| | |
| | | // 启用 停用请求 |
| | | async getRoleChange(row) { |
| | | console.log(row) |
| | | // await roleChange({ |
| | | // id: row.id, |
| | | // status: !row.status, |
| | | // }).then((reply) => { |
| | | // if (reply && reply.code == 200) { |
| | | // let tips = row.status ? "停用成功" : "启用成功"; |
| | | // this.getData(); |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: tips, |
| | | // }); |
| | | // } |
| | | // }); |
| | | await roleChange({ |
| | | id: row.id, |
| | | status: !row.status |
| | | }).then((reply) => { |
| | | if (reply && reply.code == 200) { |
| | | let tips = row.status ? "停用成功" : "启用成功" |
| | | this.getData() |
| | | this.$message({ |
| | | type: "success", |
| | | message: tips |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 编辑 |
| | | handleClick(val) { |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...val } |
| | | this.editConfig.visible = true |
| | | console.log(val) |
| | | // this.editConfig.title = "编辑" |
| | | // this.editConfig.infomation = { ...val } |
| | | // this.editConfig.visible = true |
| | | this.editRow = val |
| | | this.isopen = true |
| | | }, |
| | | // 删除等级 |
| | | delClick(row) { |
| | |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | // deleteRole(row.id).then((reply) => { |
| | | // if (reply && reply.code == 200) { |
| | | // this.getData(); |
| | | // this.$message({ |
| | | // type: "success", |
| | | // message: "删除成功", |
| | | // }); |
| | | // } |
| | | // }); |
| | | deleteRole(row.id).then((reply) => { |
| | | if (reply && reply.code == 200) { |
| | | this.getData() |
| | | this.$message({ |
| | | type: "success", |
| | | message: "删除成功" |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | .catch(() => {}) |
| | | }, |
| | | shutdown() { |
| | | this.isopen = false |
| | | setTimeout(() => { |
| | | this.getData() |
| | | }, 200) |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | |
| | | // bottom |
| | | this.setBottomList() |
| | | }, |
| | | // 等级列表 |
| | | // 列表 |
| | | setTableList(tableList) { |
| | | tableList.allcol = tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < tableList.tableColumn.length; i++) { |
| | | const label = tableList.tableColumn[i].label |
| | | const value = tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | } |
| | | }, |
| | | // bom 列表 |
| | | setBottomList() { |
| | |
| | | background-color: #fff; |
| | | border-radius: 12px; |
| | | min-height: 70px; |
| | | height: calc(52% - 60px); |
| | | height: calc(52% - 50px); |
| | | margin-top: 10px; |
| | | // padding: 10px 20px; |
| | | .list-view { |
| | |
| | | custom-class="iframe-dialog" |
| | | > |
| | | <div class="drawerContent" style="overflow: auto"> |
| | | <el-form ref="form" :rules="rules" :model="form" label-position="right" label-width="100px"> |
| | | <el-form ref="form" :rules="rules" :model="editConfig.form" label-position="right" label-width="100px"> |
| | | <el-form-item label="用户名:" prop="username"> |
| | | <el-input v-model="form.username" placeholder="请输入" disabled></el-input> |
| | | <el-input v-model="editConfig.form.username" placeholder="--" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="密码:" prop="password"> |
| | | <el-input v-model="form.password" placeholder="请输入" disabled></el-input> |
| | | <el-input v-model="editConfig.form.password" placeholder="--" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="手机号:" prop="phone"> |
| | | <el-input-number |
| | | v-model="form.phone" |
| | | v-model="editConfig.form.phone" |
| | | placeholder="" |
| | | :min="0" |
| | | :controls="false" |
| | |
| | | style="width: 100%" |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="公司名称:" prop="company"> |
| | | <el-input v-model="form.company" placeholder="请输入" disabled></el-input> |
| | | <el-form-item label="公司名称:" prop="companyName"> |
| | | <el-input v-model="editConfig.form.company" placeholder="--" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系人名称:" prop="contact"> |
| | | <el-input v-model="form.contact" placeholder="请输入" disabled></el-input> |
| | | <el-form-item label="联系人名称:" prop="nickName"> |
| | | <el-input v-model="editConfig.form.contact" placeholder="--" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱:" prop="email"> |
| | | <el-input v-model="form.email" placeholder="请输入" disabled></el-input> |
| | | <el-form-item label="邮箱:" prop="companyEmail"> |
| | | <el-input v-model="editConfig.form.email" placeholder="--" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="行业:" prop="industry"> |
| | | <el-input v-model="form.industry" placeholder="请输入" disabled></el-input> |
| | | <el-input v-model="editConfig.form.industry" placeholder="--" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="地区:" prop="region"> |
| | | <el-input v-model="form.region" placeholder="请输入" disabled></el-input> |
| | | <el-input v-model="editConfig.form.region" placeholder="--" disabled></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="用户等级:" prop="level"> |
| | | <el-radio-group v-model="form.level" :disabled="editConfig.title == '查看' ? true : false"> |
| | | <div style="margin-top: 10px"> |
| | | <el-radio :label="1">三合一经典会员</el-radio> |
| | | <el-radio :label="2">APS+WMS普通会员</el-radio> |
| | | </div> |
| | | <div style="margin-top: 10px"> |
| | | <el-radio :label="3">四合一超级会员</el-radio> |
| | | <el-radio :label="4">APS普通会员</el-radio> |
| | | </div> |
| | | </el-radio-group> |
| | | <el-form-item label="用户等级:" prop="roleIDs"> |
| | | <el-checkbox-group v-model="editConfig.form.roleIDs"> |
| | | <el-checkbox v-for="role in roleList" :label="role.id" :key="role.id">{{ role.name }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getRoleIDs } from "@/api/unifiedManage/userManage" |
| | | export default { |
| | | name: "EditUserInfo", |
| | | props: { |
| | |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | form: {} |
| | | } |
| | | } |
| | | } |
| | |
| | | return { |
| | | dialogWidth: "30%", |
| | | editConfig: this.editCommonConfig, |
| | | form: {}, |
| | | // form: {}, |
| | | rules: { |
| | | username: [{ required: true, message: "请输入用户名", trigger: "blur" }], |
| | | password: [{ required: true, message: "请输入密码", trigger: "blur" }], |
| | | phone: [{ required: true, message: "请输入手机号", trigger: "blur" }], |
| | | company: [{ required: true, message: "请输入公司名称", trigger: "blur" }], |
| | | contact: [{ required: true, message: "请输入联系人名称", trigger: "blur" }], |
| | | level: [{ required: true, message: "请选择用户等级", trigger: "change" }] |
| | | } |
| | | companyName: [{ required: true, message: "请输入公司名称", trigger: "blur" }], |
| | | nickName: [{ required: true, message: "请输入联系人名称", trigger: "blur" }], |
| | | roleIDs: [{ required: true, message: "请选择用户等级", trigger: "change" }] |
| | | }, |
| | | roleList: [] // 用户等级 |
| | | } |
| | | }, |
| | | watch: { |
| | | "editCommonConfig.visible"(val) { |
| | | console.log("sssssssssss") |
| | | if (val) { |
| | | this.$refs.form.resetFields() |
| | | // this.getDataInfo() |
| | | // this.formInfo() |
| | | console.log(val) |
| | | } |
| | | }, |
| | | "editCommonConfig.infomation"(val) { |
| | | if (this.isopen) { |
| | | "editCommonConfig.form.username"(val) { |
| | | console.log(val) |
| | | if (this.editConfig.visible) { |
| | | this.$refs.form.resetFields() |
| | | if (val.id) { |
| | | // this.getDataInfo(val) |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | // this.getDataInfo() |
| | | this.getDataInfo() |
| | | }, |
| | | methods: { |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 获取等级信息 |
| | | async getDataInfo() { |
| | | const rsp = await getRoleIDs({ useType: 1 }) |
| | | if (rsp.code == 200) { |
| | | this.roleList = rsp.data ? rsp.data : [] |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | text-align: right; |
| | | padding-right: 20px; |
| | | } |
| | | .el-input__inner { |
| | | text-align: left; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <el-table-column label="操作" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button @click="viewClick(scope.row)" type="text" size="small">查看</el-button> |
| | | <el-button @click="approveClick(scope.row)" type="text" size="small">审核</el-button> |
| | | <el-button |
| | | v-if="scope.row.status == 0 || scope.row.status == 3" |
| | | @click="changeStatusClick(scope.row, 1)" |
| | | type="text" |
| | | size="small" |
| | | >启用</el-button |
| | | > |
| | | <el-button |
| | | v-else-if="scope.row.status == 1" |
| | | @click="changeStatusClick(scope.row, 0)" |
| | | type="text" |
| | | size="small" |
| | | >禁用</el-button |
| | | > |
| | | <el-button v-else-if="scope.row.status == 2" @click="approveClick(scope.row)" type="text" size="small" |
| | | >审核</el-button |
| | | > |
| | | <el-button @click="editClick(scope.row)" type="text" size="small">编辑</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import EditUserInfo from "@/views/unifiedManage/userManage/components/EditUserInfo" |
| | | import ReviewDialog from "@/views/unifiedManage/userManage/components/ReviewDialog" |
| | | import { listUser, changeStatus } from "@/api/unifiedManage/userManage" |
| | | |
| | | export default { |
| | | name: "UserManage", |
| | | props: {}, |
| | |
| | | tableColumn: [ |
| | | { label: "用户名", prop: "username", default: true }, |
| | | { label: "手机号", prop: "phone" }, |
| | | { label: "公司名称", prop: "company" }, |
| | | { label: "联系人姓名", prop: "contact" }, |
| | | { label: "邮箱", prop: "email" }, |
| | | { label: "公司名称", prop: "companyName" }, |
| | | { label: "联系人姓名", prop: "nickName" }, |
| | | { label: "邮箱", prop: "companyEmail" }, |
| | | { label: "行业", prop: "industry" }, |
| | | { label: "地区", prop: "region" }, |
| | | { label: "状态", prop: "status" } |
| | | { label: "状态", prop: "status", isCallMethod: true, getCallMethod: this.getStatus } |
| | | ], |
| | | showCol: ["用户名", "手机号", "公司名称", "联系人姓名", "邮箱", "行业", "地区", "状态"], |
| | | editConfig: { |
| | |
| | | reviewConfig: { |
| | | visible: false, |
| | | infomation: {} |
| | | }, |
| | | obj: { |
| | | page: 1, |
| | | pageSize: 15, |
| | | keyword: "", |
| | | useType: 1 |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | // 获取列表值 |
| | | getData() { |
| | | this.obj.pageSize = this.pagerOptions.pageSize |
| | | this.obj.page = this.pagerOptions.currPage |
| | | listUser(this.obj).then((res) => { |
| | | console.log(res) |
| | | this.tableList.tableInfomation = res.data.list || [] |
| | | this.pagerOptions.totalCount = res.data.total |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | onFilterSearch(val) { |
| | | console.log(val) |
| | | this.obj.keyword = val |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 查看 |
| | | viewClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "查看" |
| | | this.editConfig.tableInfomation = { ...row } |
| | | this.editConfig.form = row |
| | | }, |
| | | // 审核 |
| | | approveClick(row) { |
| | | console.log(row) |
| | | this.reviewConfig.visible = true |
| | | this.reviewConfig.title = "用户审核" |
| | | this.reviewConfig.tableInfomation = { ...row } |
| | | this.reviewConfig.infomation = { ...row } |
| | | }, |
| | | // 停用 |
| | | changeStatusClick(row, status) { |
| | | if (status === 0) { |
| | | this.$confirm("是否禁用此用户?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | this.changeStatus(row, status) |
| | | }) |
| | | .catch(() => {}) |
| | | } else { |
| | | this.changeStatus(row, status) |
| | | } |
| | | }, |
| | | // 启用/禁用 |
| | | changeStatus(row, status) { |
| | | changeStatus({ |
| | | status: status, |
| | | userId: row.id |
| | | }).then((res) => { |
| | | console.log(res) |
| | | let messageStr = status === 0 ? "禁用成功" : "启用成功" |
| | | this.$message.success(messageStr) |
| | | this.getData() |
| | | }) |
| | | }, |
| | | // 编辑 |
| | | editClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.tableInfomation = { ...row } |
| | | this.editConfig.form = { ...row } |
| | | }, |
| | | // 列表初始化 |
| | | setTable() { |
| | |
| | | selectIndex: true, |
| | | tableInfomation: [ |
| | | { |
| | | usename: "测试", |
| | | username: "测试", |
| | | status: 1 |
| | | } |
| | | ], |
| | |
| | | tableColumn: this.setColumnVisible(this.showCol) |
| | | } |
| | | this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | const value = this.tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | } |
| | | }, |
| | | setColumnVisible(showCol) { |
| | | return this.tableColumn.map((ele) => { |
| | |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val) |
| | | }, |
| | | // 状态 |
| | | getStatus(val) { |
| | | return val === 0 |
| | | ? "禁用" |
| | | : val === 1 |
| | | ? "启用中" |
| | | : val === 2 |
| | | ? "待审核" |
| | | : val === 3 |
| | | ? "待启用" |
| | | : val === 4 |
| | | ? "已拒绝" |
| | | : "" |
| | | } |
| | | } |
| | | } |
| | |
| | | .body-card { |
| | | background-color: #fff; |
| | | border-radius: 12px; |
| | | height: 100%; |
| | | height: calc(100% - 10px); |
| | | overflow: hidden; |
| | | } |
| | | .list-view { |
| | |
| | | productionSourceMap: false, // 如果你不需要生产环境的source map, 可以将其设置为false 以加速生产环境构建 |
| | | devServer: { |
| | | proxy: { |
| | | "/api/menu": { |
| | | target: "http://192.168.20.119:8001", // http://192.168.20.119:8002 http://fai365.com:30150/ |
| | | // 建道本地环境 |
| | | // target: "http://192.168.20.118:8002", |
| | | ws: true, |
| | | changeOrigin: true |
| | | }, |
| | | "/api": { |
| | | target: "http://192.168.20.119:8002", // http://192.168.20.119:8002 http://fai365.com:30150/ |
| | | target: "http://192.168.20.119:8001", // http://fai365.com:30150/ |
| | | // 建道本地环境 |
| | | // target: "http://192.168.20.118:8002", |
| | | // target: "http://192.168.20.118:8001", |
| | | ws: true, |
| | | changeOrigin: true |
| | | } |