| | |
| | | <basic-container |
| | | :class="[ |
| | | 'hasButTwo', |
| | | $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '', |
| | | $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize', |
| | | $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '' |
| | | ]" |
| | | > |
| | | <avue-crud |
| | | class="tablesss" |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | |
| | | update, |
| | | add, |
| | | getDept, |
| | | getDeptTree, |
| | | getDeptTree |
| | | } from "@/api/system/dept"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from "@/config/website"; |
| | |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | ...this.$store.state.control.changePageSize, |
| | | ...this.$store.state.control.changePageSize |
| | | }, |
| | | option: { |
| | | lazy: true, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入机构名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // label: "所属保安单位", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入机构全称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "上级机构", |
| | |
| | | hide: true, |
| | | addDisabled: false, |
| | | props: { |
| | | label: "title", |
| | | label: "title" |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "请选择上级机构", |
| | | trigger: "click", |
| | | }, |
| | | ], |
| | | trigger: "click" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "机构类型", |
| | |
| | | dicUrl: "/api/blade-system/dict/dictionary?code=org_category", |
| | | props: { |
| | | label: "dictValue", |
| | | value: "dictKey", |
| | | value: "dictKey" |
| | | }, |
| | | dataType: "number", |
| | | width: 120, |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入机构类型", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "排序", |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入排序", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "备注", |
| | |
| | | { |
| | | required: false, |
| | | message: "请输入备注", |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | hide: true, |
| | | }, |
| | | ], |
| | | hide: true |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | data: [] |
| | | }; |
| | | }, |
| | | computed: { |
| | |
| | | addBtn: this.vaildData(this.permission.dept_add, false), |
| | | viewBtn: this.vaildData(this.permission.dept_view, false), |
| | | delBtn: this.vaildData(this.permission.dept_delete, false), |
| | | editBtn: this.vaildData(this.permission.dept_edit, false), |
| | | editBtn: this.vaildData(this.permission.dept_edit, false) |
| | | }; |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | }, |
| | | methods: { |
| | | initData() { |
| | | getDeptTree().then((res) => { |
| | | getDeptTree().then(res => { |
| | | const column = this.findObject(this.option.column, "parentId"); |
| | | column.dicData = res.data.data; |
| | | }); |
| | |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | add(row).then( |
| | | (res) => { |
| | | res => { |
| | | // 获取新增数据的相关字段 |
| | | const data = res.data.data; |
| | | row.id = data.id; |
| | |
| | | row.tenantId = data.tenantId; |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | () => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | | }, |
| | | (error) => { |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | // 数据回调进行刷新 |
| | | done(row); |
| | |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | this.initData(); |
| | | } |
| | | if (["edit", "view"].includes(type)) { |
| | | getDept(this.form.id).then((res) => { |
| | | getDept(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getLazyList(this.parentId, Object.assign(params, this.query)).then( |
| | | (res) => { |
| | | res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | this.$store.commit("setWindowSizeHeightAdd"); |
| | | this.selectionClear(); |
| | | } |
| | | ); |
| | | }, |
| | | treeLoad(tree, treeNode, resolve) { |
| | | const parentId = tree.id; |
| | | getLazyList(parentId).then((res) => { |
| | | getLazyList(parentId).then(res => { |
| | | resolve(res.data.data); |
| | | }); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |