|
@@ -169,23 +169,23 @@
|
|
|
|
|
|
<script setup>
|
|
|
/* eslint-disable vue/no-unused-components */
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
-import byTable from '@/components/byTable/index'
|
|
|
-import byForm from '@/components/byForm/index'
|
|
|
-import treeList from '@/components/treeList/index'
|
|
|
-import { computed, defineComponent, ref } from 'vue'
|
|
|
-const loading = ref(false)
|
|
|
-const submitLoading = ref(false)
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+import byTable from "@/components/byTable/index";
|
|
|
+import byForm from "@/components/byForm/index";
|
|
|
+import treeList from "@/components/treeList/index";
|
|
|
+import { computed, defineComponent, ref } from "vue";
|
|
|
+const loading = ref(false);
|
|
|
+const submitLoading = ref(false);
|
|
|
const sourceList = ref({
|
|
|
- data: [],
|
|
|
- pagination: {
|
|
|
- total: 3,
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- },
|
|
|
-})
|
|
|
-let dialogVisible = ref(false)
|
|
|
-let modalType = ref('add')
|
|
|
+ data: [],
|
|
|
+ pagination: {
|
|
|
+ total: 3,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+});
|
|
|
+let dialogVisible = ref(false);
|
|
|
+let modalType = ref("add");
|
|
|
let rules = ref({
|
|
|
roleKey: [{ required: true, message: '请选择部门', trigger: 'blur' }],
|
|
|
orderNum: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
|
|
@@ -193,8 +193,8 @@ let rules = ref({
|
|
|
})
|
|
|
const { proxy } = getCurrentInstance()
|
|
|
const selectConfig = computed(() => {
|
|
|
- return []
|
|
|
-})
|
|
|
+ return [];
|
|
|
+});
|
|
|
const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -268,16 +268,16 @@ const config = computed(() => {
|
|
|
})
|
|
|
|
|
|
let formData = reactive({
|
|
|
- data: {},
|
|
|
-})
|
|
|
+ data: {},
|
|
|
+});
|
|
|
const formOption = reactive({
|
|
|
- inline: true,
|
|
|
- labelWidth: 100,
|
|
|
- itemWidth: 100,
|
|
|
- rules: [],
|
|
|
-})
|
|
|
-const byform = ref(null)
|
|
|
-const treeListData = ref([])
|
|
|
+ inline: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ itemWidth: 100,
|
|
|
+ rules: [],
|
|
|
+});
|
|
|
+const byform = ref(null);
|
|
|
+const treeListData = ref([]);
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -402,26 +402,26 @@ const getList = async (req) => {
|
|
|
}
|
|
|
|
|
|
const treeChange = (e) => {
|
|
|
- sourceList.value.pagination.tenantId = e.id
|
|
|
- getList({ tenantId: e.id })
|
|
|
-}
|
|
|
+ sourceList.value.pagination.tenantId = e.id;
|
|
|
+ getList({ tenantId: e.id });
|
|
|
+};
|
|
|
|
|
|
const openModal = () => {
|
|
|
- dialogVisible.value = true
|
|
|
- modalType.value = 'add'
|
|
|
- formData.data = {}
|
|
|
-}
|
|
|
-const TreetenantId = ref('')
|
|
|
+ dialogVisible.value = true;
|
|
|
+ modalType.value = "add";
|
|
|
+ formData.data = {};
|
|
|
+};
|
|
|
+const TreetenantId = ref("");
|
|
|
const selection = ref({
|
|
|
- data: [],
|
|
|
-})
|
|
|
+ data: [],
|
|
|
+});
|
|
|
|
|
|
const select = (_selection, row) => {
|
|
|
- selection.value.data = _selection
|
|
|
- console.log(_selection.length)
|
|
|
-}
|
|
|
+ selection.value.data = _selection;
|
|
|
+ console.log(_selection.length);
|
|
|
+};
|
|
|
|
|
|
-const tree = ref(null)
|
|
|
+const tree = ref(null);
|
|
|
const submitForm = () => {
|
|
|
byform.value.handleSubmit((valid) => {
|
|
|
const method = modalType.value == 'add' ? 'POST' : 'PUT'
|
|
@@ -493,14 +493,14 @@ getList()
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.dept {
|
|
|
- padding: 20px;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- .tree {
|
|
|
- width: 300px;
|
|
|
- }
|
|
|
- .content {
|
|
|
- width: calc(100% - 320px);
|
|
|
- }
|
|
|
+ padding: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ .tree {
|
|
|
+ width: 300px;
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ width: calc(100% - 320px);
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|