|
@@ -28,25 +28,63 @@
|
|
row-key="code"
|
|
row-key="code"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:data-source="data"
|
|
:data-source="data"
|
|
- :pagination="{ pageSize: 10 }"
|
|
|
|
|
|
+ :pagination="{
|
|
|
|
+ pageSize: pageSize,
|
|
|
|
+ current: pageNo,
|
|
|
|
+ total: totalElements,
|
|
|
|
+ showTotal: (total: number) => `总数:${total}`,
|
|
|
|
+ onChange: (pageNoChanged: number, pageSizeChanged: number) => {
|
|
|
|
+ pageNo = pageNoChanged;
|
|
|
|
+ pageSize = pageSizeChanged;
|
|
|
|
+ }
|
|
|
|
+ }"
|
|
>
|
|
>
|
|
<template #enable="{ text }">
|
|
<template #enable="{ text }">
|
|
<a>{{ $filters.booleanEnableDisableFilter(text) }}</a>
|
|
<a>{{ $filters.booleanEnableDisableFilter(text) }}</a>
|
|
</template>
|
|
</template>
|
|
<template #action="{ record }">
|
|
<template #action="{ record }">
|
|
<span>
|
|
<span>
|
|
- <a-button>编辑</a-button>
|
|
|
|
|
|
+ <a-button @click="showModal(record)">编辑</a-button>
|
|
|
|
+ <a-button @click="editRootOrgSettings(record.id)"
|
|
|
|
+ >特殊设置</a-button
|
|
|
|
+ >
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
</a-table>
|
|
</a-table>
|
|
</div>
|
|
</div>
|
|
|
|
+ <a-modal
|
|
|
|
+ v-model:visible="visible"
|
|
|
|
+ title="顶级机构信息页"
|
|
|
|
+ @ok="handleOk"
|
|
|
|
+ ok-text="确定"
|
|
|
|
+ cancel-text="取消"
|
|
|
|
+ >
|
|
|
|
+ <a-form>
|
|
|
|
+ <a-form-item label="顶级机构代码">
|
|
|
|
+ <a-input disabled v-model:value="rootOrgObj.code"></a-input>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="顶级机构名称">
|
|
|
|
+ <a-input disabled v-model:value="rootOrgObj.name"></a-input>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="状态">
|
|
|
|
+ <a-radio-group disabled v-model:value="rootOrgObj.enable">
|
|
|
|
+ <a-radio :value="true">启用</a-radio>
|
|
|
|
+ <a-radio :value="false">禁用</a-radio>
|
|
|
|
+ </a-radio-group>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item label="顶级机构域名">
|
|
|
|
+ <a-input v-model:value="rootOrgObj.domainName"></a-input>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-form>
|
|
|
|
+ </a-modal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { getRootOrgList } from "@/api/rootOrgPage";
|
|
|
|
|
|
+import { getRootOrgList, updateRootOrg } from "@/api/rootOrgPage";
|
|
|
|
+import router from "@/router";
|
|
import { useMainStore } from "@/store";
|
|
import { useMainStore } from "@/store";
|
|
-import { ref, onMounted } from "vue";
|
|
|
|
|
|
+import { ref, onMounted, reactive } from "vue";
|
|
|
|
|
|
const store = useMainStore();
|
|
const store = useMainStore();
|
|
store.currentLocation = "基础管理 / 顶级机构管理";
|
|
store.currentLocation = "基础管理 / 顶级机构管理";
|
|
@@ -56,10 +94,17 @@ let name = $ref("");
|
|
let enable = $ref(undefined as undefined | string);
|
|
let enable = $ref(undefined as undefined | string);
|
|
|
|
|
|
let data = $ref([]);
|
|
let data = $ref([]);
|
|
|
|
+let pageSize = $ref(10);
|
|
|
|
+let pageNo = $ref(1);
|
|
|
|
+let totalElements = $ref(0);
|
|
|
|
+
|
|
async function search() {
|
|
async function search() {
|
|
- const res = await getRootOrgList({ code, name, enable });
|
|
|
|
- console.log(res);
|
|
|
|
|
|
+ const res = await getRootOrgList({ code, name, enable, pageSize, pageNo });
|
|
|
|
+ // console.log(res);
|
|
data = res.data.content;
|
|
data = res.data.content;
|
|
|
|
+ pageNo = res.data.pageNo;
|
|
|
|
+ pageSize = res.data.pageSize;
|
|
|
|
+ totalElements = res.data.totalElements;
|
|
}
|
|
}
|
|
|
|
|
|
const columns = [
|
|
const columns = [
|
|
@@ -96,4 +141,28 @@ const columns = [
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
await search();
|
|
await search();
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+const visible = ref<boolean>(false);
|
|
|
|
+
|
|
|
|
+const showModal = (record: any) => {
|
|
|
|
+ Object.assign(rootOrgObj, record);
|
|
|
|
+ visible.value = true;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const editRootOrgSettings = (orgId: number) => {
|
|
|
|
+ router.push("/basic/rootOrg/edit/" + orgId);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const handleOk = async (e: MouseEvent) => {
|
|
|
|
+ await updateRootOrg({ domainName: rootOrgObj.domainName });
|
|
|
|
+ visible.value = false;
|
|
|
|
+ await search();
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const rootOrgObj = reactive({
|
|
|
|
+ code: "",
|
|
|
|
+ name: "",
|
|
|
|
+ enable: true,
|
|
|
|
+ domainName: "",
|
|
|
|
+});
|
|
</script>
|
|
</script>
|