merge lll-user-organ into master
新增nodata组件 和 组织管理 Created-by: LovableCat Commit-by: LovableCat Merged-by: user8949 Description: 新增nodata组件 和 组织管理 See merge request: hk_openRepo/OpenRepo_Portal!7
This commit is contained in:
BIN
src/assets/imgs/jyh/nodata.png
Normal file
BIN
src/assets/imgs/jyh/nodata.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
32
src/components/NoData/NoData.vue
Normal file
32
src/components/NoData/NoData.vue
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<template>
|
||||||
|
<div class="bg-white w-full flex flex-col items-center py-[20px]">
|
||||||
|
<slot name="img">
|
||||||
|
<img
|
||||||
|
v-if="!hideImg"
|
||||||
|
class="block mb-[20px]"
|
||||||
|
width="300"
|
||||||
|
height="240"
|
||||||
|
src="/src/assets/imgs/jyh/nodata.png"
|
||||||
|
alt="NoData"
|
||||||
|
/>
|
||||||
|
</slot>
|
||||||
|
<slot>
|
||||||
|
<div>没有查询到数据</div>
|
||||||
|
</slot>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
hideImg: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.bg-white {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div v-if="hasOrganization"></div>
|
||||||
|
<div v-else>
|
||||||
|
<NoData>
|
||||||
|
<div class="font-bold mb-[20px]">很抱歉,当前无任何组织,赶快去</div>
|
||||||
|
<d-button
|
||||||
|
size="lg"
|
||||||
|
variant="solid"
|
||||||
|
@click="createOrganizationBtnClick"
|
||||||
|
>新建组织</d-button>
|
||||||
|
</NoData>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<d-modal
|
||||||
|
v-model="createOrganizationModalCtrl"
|
||||||
|
title="新建组织"
|
||||||
|
class="w-[600px]"
|
||||||
|
>
|
||||||
|
<d-form
|
||||||
|
ref="createFormRef"
|
||||||
|
layout="vertical"
|
||||||
|
:data="createFormData"
|
||||||
|
message-type="none"
|
||||||
|
>
|
||||||
|
<d-form-item
|
||||||
|
field="organizationName"
|
||||||
|
label="组织名称"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<d-input v-model="createFormData.organizationName" />
|
||||||
|
</d-form-item>
|
||||||
|
<d-form-item field="organizationProfile" label="组织简介" required>
|
||||||
|
<d-textarea
|
||||||
|
v-model="createFormData.organizationProfile"
|
||||||
|
show-count
|
||||||
|
maxlength="200"
|
||||||
|
/>
|
||||||
|
</d-form-item>
|
||||||
|
</d-form>
|
||||||
|
|
||||||
|
<div class="flex justify-center">
|
||||||
|
<d-button
|
||||||
|
variant="solid"
|
||||||
|
class="mr-[8px]"
|
||||||
|
@click="confirmCreateOrganizationBtnClick"
|
||||||
|
>确定</d-button>
|
||||||
|
<d-button @click="createOrganizationModalClose">取消</d-button>
|
||||||
|
</div>
|
||||||
|
</d-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import {reactive, ref} from "vue";
|
||||||
|
import NoData from "@/components/NoData/NoData.vue";
|
||||||
|
|
||||||
|
const hasOrganization = ref(false);
|
||||||
|
|
||||||
|
const createOrganizationModalCtrl = ref(false);
|
||||||
|
const createFormData = reactive({
|
||||||
|
organizationName: "",
|
||||||
|
organizationProfile: "", // 组织简介
|
||||||
|
});
|
||||||
|
const createFormRef = ref();
|
||||||
|
|
||||||
|
|
||||||
|
function confirmCreateOrganizationBtnClick() {
|
||||||
|
createFormRef.value.validate(isValid => {
|
||||||
|
if (isValid) {
|
||||||
|
createOrganization();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function createOrganization() {
|
||||||
|
const params = {
|
||||||
|
organizationName: createFormData.organizationName,
|
||||||
|
organizationProfile: createFormData.organizationProfile,
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createOrganizationBtnClick(): void {
|
||||||
|
createOrganizationModalCtrl.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createOrganizationModalClose(): void {
|
||||||
|
createOrganizationModalCtrl.value = false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
@@ -22,12 +22,14 @@
|
|||||||
<d-tabs class="jyh-tabs jyh-tabs-2 jyh-tabs-3" type="wrapped" v-model="selectTab">
|
<d-tabs class="jyh-tabs jyh-tabs-2 jyh-tabs-3" type="wrapped" v-model="selectTab">
|
||||||
<d-tab id="yjtzlb" title="预警通知列表"></d-tab>
|
<d-tab id="yjtzlb" title="预警通知列表"></d-tab>
|
||||||
<d-tab id="dylb" title="订阅列表"></d-tab>
|
<d-tab id="dylb" title="订阅列表"></d-tab>
|
||||||
|
<d-tab id="organizationManage" title="组织管理"></d-tab>
|
||||||
</d-tabs>
|
</d-tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="version-detail-content">
|
<div class="version-detail-content">
|
||||||
<early-warning v-if="selectTab==='yjtzlb'"/>
|
<early-warning v-if="selectTab==='yjtzlb'"/>
|
||||||
<subscribe-list v-if="selectTab==='dylb'"/>
|
<subscribe-list v-if="selectTab==='dylb'"/>
|
||||||
|
<OrganizationManage v-if="selectTab === 'organizationManage'" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -38,6 +40,8 @@ import { useRouter, useRoute } from 'vue-router';
|
|||||||
import { getOrgInfo } from '@/views/Org/hooks/orgInfo';
|
import { getOrgInfo } from '@/views/Org/hooks/orgInfo';
|
||||||
import EarlyWarning from './Detail/EarlyWarning.vue';
|
import EarlyWarning from './Detail/EarlyWarning.vue';
|
||||||
import SubscribeList from './Detail/SubscribeList.vue';
|
import SubscribeList from './Detail/SubscribeList.vue';
|
||||||
|
import OrganizationManage from './OrganizationManage/OrganizationManage.vue';
|
||||||
|
|
||||||
const { namespace } = getOrgInfo();
|
const { namespace } = getOrgInfo();
|
||||||
const avatarUrl = '/src/assets/imgs/avatar/male.png';
|
const avatarUrl = '/src/assets/imgs/avatar/male.png';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user