zhangnuoyan
2024-08-25 54f5cd85e43bf92266a2617994642e1b8aa5bcb5
feat: 增加一些组件
1个文件已添加
5个文件已修改
395 ■■■■ 已修改文件
src/styles/theme.scss 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/the-a-tabs/index.vue 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/the-box-card/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/the-img-card/index.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneThree/actualPopulation/index.vue 240 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneThree/comprehensive/index.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/styles/theme.scss
@@ -243,7 +243,7 @@
    .arco-card {
        border: none;
    }
    .card-bg-1 {
    .card-bg-custom {
        background: #0d2448;
    }
    .arco-timepicker-container {
@@ -256,5 +256,10 @@
        &:hover {
            opacity: 0.9;
        }
        &.arco-btn-status-danger {
            color: #fff;
            background-color: rgb(var(--danger-6));
            border-color: transparent;
        }
    }
}
src/views/components/the-a-tabs/index.vue
New file
@@ -0,0 +1,44 @@
<template>
    <div>
        <p v-for="(item, key) in data" :key="key" :class="index === key ? 'active' : ''">{{ item }}</p>
    </div>
</template>
<script lang="ts" setup name="TheATabs">
const props = withDefaults(
    defineProps<{
        index: number;
        data?: Array<any>;
    }>(),
    {
        index: 0,
        data: () => []
    }
);
</script>
<style lang="scss" scoped>
div {
    display: flex;
    align-items: center;
    padding-bottom: 1px;
    border-bottom: 2px solid var(--color-bg-5);
    > p {
        margin-right: 10px;
        width: 86px;
        height: 38px;
        font-size: 14px;
        color: var(--color-text-1);
        line-height: 38px;
        text-align: center;
        border-radius: 6px 6px 0px 0px;
        background: var(--color-bg-2);
        &.active {
            background: #1057fd;
            color: #fff;
        }
        cursor: pointer;
        &:hover {
            opacity: 0.8;
        }
    }
}
</style>
src/views/components/the-box-card/index.vue
@@ -1,7 +1,7 @@
<template>
    <!-- 小卡片 -->
    <div class="the-box-card" :class="currentThemeMode === 'dark' ? 'box-card-dark' : ''">
        <a-card class="card-box card-bg-1">
        <a-card class="card-box card-bg-custom">
            <div class="card-title">
                <div class="title-left">
                    <icon-home />
src/views/components/the-img-card/index.vue
@@ -3,38 +3,21 @@
    <div class="the-img-card" :class="currentThemeMode === 'dark' ? 'card-img-dark' : ''">
        <div class="img-box-card">
            <div class="card-icon" :style="dynamicStyle">
                <a-image
                    width="140"
                    height="140"
                    border-radius="14px"
                    :preview="false"
                    src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp"
                />
                <a-image width="140" height="140" border-radius="14px" :preview="false" :src="icon" />
            </div>
            <div class="card-content">
                <div class="card-content-top">
                    <div class="card-name">
                        <span class="name">张三</span>
                        <span class="name">{{ title }}</span>
                        <icon-woman v-if="sex && sex === 'woman'" />
                        <icon-man v-if="!sex && sex === 'woman'" />
                    </div>
                    <div @click="handleChange" class="card-detail">详情 ></div>
                    <div class="card-detail" @click="handleChange">详情 ></div>
                </div>
                <div>
                    <span>人员编号</span>:
                    <span>H324343</span>
                </div>
                <div>
                    <span>出现天数</span>:
                    <span>2天</span>
                </div>
                <div>
                    <span>居住地址</span>:
                    <span>经济快速等级考试</span>
                </div>
                <div>
                    <span>身份证号</span>:
                    <span>3673672627722</span>
                <div v-for="(content, key) in contents" :key="key">
                    <span>{{ content.key }}</span
                    >:
                    <span>{{ content.value }}</span>
                </div>
            </div>
        </div>
@@ -49,29 +32,14 @@
    defineProps<{
        icon?: string;
        title?: string;
        unit?: string;
        metering?: number;
        colorBg?: string;
        sex?: boolean;
        isIcon?: boolean;
        contents?: Array<any>;
    }>(),
    {
        icon: "",
        title: "",
        unit: "",
        metering: 0,
        colorBg: "#fff",
        sex: true,
        isIcon: true
        contents: () => []
    }
);
const colorBg = computed(() => {
    return props.colorBg;
});
const dynamicStyle = {
    backgroundColor: colorBg.value // 动态背景色
};
const emits = defineEmits<{
    (e: "handleChange", data: object): void;
src/views/oneThree/actualPopulation/index.vue
@@ -1,7 +1,241 @@
<template>
    <div class="actualPopulation">实有人口</div>
    <div class="comprehensive">
        <div class="top-title">
            <the-icon-card
                v-for="(item, index) in dataList"
                :key="index"
                :title="item.title"
                :icon="item.icon"
                :unit="item.unit"
                :metering="item.metering"
                :color-bg="item.colorBg"
            ></the-icon-card>
        </div>
        <div class="menus">
            <the-a-cascader :data="cascaderData" placeholder="请选择" title="区域"></the-a-cascader>
            <div><the-a-search placeholder="请输入" title="搜索"></the-a-search></div>
            <div><the-a-change :data="changeData" default-value="custom"></the-a-change></div>
            <div><a-time-picker type="time-range" style="width: 250px" /></div>
            <div>
                <a-button type="primary">
                    <template #icon>
                        <icon-search />
                    </template>
                    <template #default>搜索</template>
                </a-button>
            </div>
            <div>
                <a-button>
                    <template #icon>
                        <icon-refresh />
                    </template>
                    <template #default>重置</template>
                </a-button>
            </div>
        </div>
        <the-a-tabs style="margin: 8px 0" :data="['流动人口', '实有人口']" :index="0" />
        <div class="main">
            <div class="cards">
                <a-card v-for="(item, key) in list" :key="key" class="card-box card-bg-custom">
                    <the-img-card :title="item.title" :icon="item.icon" :contents="item.contents"></the-img-card>
                    <div class="card-box-right">
                        <div>
                            <a-space>
                                <a-button type="primary" size="mini">{{ item.tags[0] }}</a-button>
                                <a-button type="primary" status="danger" size="mini">{{ item.tags[1] }}</a-button>
                            </a-space>
                        </div>
                        <div>
                            <a-space>
                                <icon-book />
                                <icon-bar-chart />
                            </a-space>
                        </div>
                    </div>
                </a-card>
            </div>
            <a-pagination :total="50" show-total show-jumper show-page-size style="margin-top: 8px" />
        </div>
    </div>
</template>
<script lang="ts" setup name="actualPopulation"></script>
<script lang="ts" setup name="comprehensive">
import { Svg } from "@easyfe/admin-component";
const list = reactive(
    new Array(5).fill({
        icon: "https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp",
        title: "张三",
        tags: ["上访", "涉毒"],
        contents: [
            {
                key: "人员编号",
                value: "H324343"
            },
            {
                key: "出现天数",
                value: "2天"
            },
            {
                key: "居住地址",
                value: "经济快速等级考试"
            },
            {
                key: "身份证号",
                value: "3673672627722"
            }
        ]
    })
);
const cascaderData = reactive([
    {
        value: "beijing",
        label: "Beijing",
        children: [
            {
                value: "chaoyang",
                label: "ChaoYang",
                children: [
                    {
                        value: "datunli",
                        label: "Datunli"
                    }
                ]
            },
            {
                value: "haidian",
                label: "Haidian"
            },
            {
                value: "dongcheng",
                label: "Dongcheng"
            },
            {
                value: "xicheng",
                label: "Xicheng",
                children: [
                    {
                        value: "jinrongjie",
                        label: "Jinrongjie"
                    },
                    {
                        value: "tianqiao",
                        label: "Tianqiao"
                    }
                ]
            }
        ]
    },
    {
        value: "shanghai",
        label: "Shanghai",
        children: [
            {
                value: "huangpu",
                label: "Huangpu"
            }
        ]
    }
]);
const dataList = reactive([
    {
        title: "实有房屋",
        icon: "icon-house",
        unit: "栋",
        metering: 110,
        colorBg: "#2e85ff"
    },
    {
        title: "自主",
        icon: "icon-people",
        unit: "栋",
        metering: 10,
        colorBg: "#30C1A9"
    },
    {
        title: "出租",
        icon: "icon-house",
        unit: "栋",
        metering: 220,
        colorBg: "#E36B4D"
    },
    {
        title: "实有人口",
        icon: "icon-people",
        unit: "人",
        metering: 420,
        colorBg: "#2E85FF"
    },
    {
        title: "流动人员",
        icon: "icon-people",
        unit: "人",
        metering: 220,
        colorBg: "#30C1A9"
    },
    {
        title: "实有单位",
        icon: "menu-house",
        unit: "个",
        metering: 220,
        colorBg: "#FF4343"
    },
    {
        title: "再业",
        icon: "menu-house",
        unit: "个",
        metering: 220,
        colorBg: "#9747FF"
    }
]);
<style lang="scss" scoped></style>
const handleClick = (item: any) => {
    console.log(item, 888);
};
const handleDetails = (item: any) => {
    console.log(item, 666);
};
</script>
<style lang="scss" scoped>
.comprehensive {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    .menus {
        background: var(--color-bg-2);
        margin-top: 8px;
        padding: 14px 20px;
        display: flex;
        > div {
            margin-left: 20px;
        }
    }
    .main {
        padding: 8px 20px;
        background: var(--color-bg-2);
        margin-top: 8px;
        flex: 1;
        .cards {
            overflow: hidden;
            > div {
                float: left;
                margin: 0 20px 20px 0;
            }
        }
    }
    .top-title {
        display: flex;
    }
    .card-box {
        width: 391px;
        height: 202px;
        border-radius: 5px;
    }
    .card-box-right {
        margin-top: 10px;
        display: flex;
        justify-content: space-between;
    }
}
</style>
src/views/oneThree/comprehensive/index.vue
@@ -34,6 +34,7 @@
            </div>
        </div>
        <div class="main">
            <div class="cards">
            <the-box-card
                v-for="(item, index) in list"
                :id="item.id"
@@ -53,6 +54,7 @@
                @handleClick="handleClick(item)"
                @handleDetails="handleDetails(item)"
            ></the-box-card>
            </div>
            <a-pagination :total="50" show-total show-jumper show-page-size style="margin-top: 8px" />
        </div>
    </div>
@@ -179,8 +181,8 @@
        colorBg: "#9747FF"
    }
]);
const list = reactive([
    {
const list = reactive(
    new Array(5).fill({
        icon: "",
        title: "A小区",
        unitTitle: "实有小区",
@@ -195,43 +197,8 @@
        selfOccupation: 45,
        service: 23,
        closes: 54
    }
]);
//列表
const columns = [
    {
        title: "序号",
        key: "1",
        dataIndex: "index",
        slotName: "index",
        width: 80
    },
    {
        title: "Name",
        dataIndex: "name",
        key: "2"
    },
    {
        title: "Address",
        dataIndex: "address",
        key: "3"
    },
    {
        title: "Email",
        dataIndex: "email",
        key: "4"
    },
    {
        title: "操作",
        key: "5",
        slotName: "action",
        width: 200
    }
    // 更多列...
];
    })
);
const handleClick = (item: any) => {
    console.log(item, 888);
@@ -261,6 +228,13 @@
        background: var(--color-bg-2);
        margin-top: 8px;
        flex: 1;
        .cards {
            overflow: hidden;
            > div {
                float: left;
                margin: 0 20px 20px 0;
            }
        }
    }
    .top-title {
        display: flex;