提交 f0cdfc5f authored 作者: 张伊明's avatar 张伊明

合并分支 'zym-dev' 到 'pre'

Zym dev 查看合并请求 !374
流水线 #566 已通过 于阶段
in 4 分 10 秒
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<el-icon color="var(--color-primary-100)"> <el-icon color="var(--color-primary-100)">
<ArrowRightBold /> <ArrowRightBold />
</el-icon> </el-icon>
<div class="item-dot" v-if="item.delta">+{{ item.delta }}</div> <div class="item-dot" v-if="item.delta">{{ dotPrefix }}{{ item.delta }}</div>
</div> </div>
<div v-if="shouldShowMoreCard" class="summary-item" @click="emit('more-click')"> <div v-if="shouldShowMoreCard" class="summary-item" @click="emit('more-click')">
...@@ -100,6 +100,10 @@ const props = defineProps({ ...@@ -100,6 +100,10 @@ const props = defineProps({
loading: { loading: {
type: Boolean, type: Boolean,
default: false default: false
},
dotPrefix: {
type: String,
default: "+"
} }
}); });
......
...@@ -35,7 +35,7 @@ const billRoutes = [ ...@@ -35,7 +35,7 @@ const billRoutes = [
component: BillAllCommittee, component: BillAllCommittee,
meta: { meta: {
title: "法案委员会列表", title: "法案委员会列表",
isShowHeader: true isShowHeader: false
} }
}, },
{ {
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
placeholder="搜索委员会" placeholder="搜索委员会"
/> />
</div> </div>
<div class="hard-select">
<el-select v-model="committeeInfo.metricType" @change="onAllCommittee()" placeholder="统计口径" style="width: 160px; margin-left: 8px">
<el-option label="政令数据总量" :value="1" />
<el-option label="政令新增数量" :value="2" />
</el-select>
</div>
</div> </div>
<div class="date-box"> <div class="date-box">
...@@ -30,7 +36,7 @@ ...@@ -30,7 +36,7 @@
<div class="item-name one-line-ellipsis">{{ item.name }}</div> <div class="item-name one-line-ellipsis">{{ item.name }}</div>
<div class="item-chamber one-line-ellipsis">{{ item.chamber }}</div> <div class="item-chamber one-line-ellipsis">{{ item.chamber }}</div>
</div> </div>
<div class="item-total">{{ item.count }}</div> <div class="item-total">{{ getDisplayCount(item) }}</div>
<el-icon color="var(--color-primary-100)"> <el-icon color="var(--color-primary-100)">
<ArrowRightBold /> <ArrowRightBold />
</el-icon> </el-icon>
...@@ -48,6 +54,12 @@ ...@@ -48,6 +54,12 @@
/> />
</div> </div>
</div> </div>
<div class="back-bnt" @click="handleBack">
<el-icon>
<Back />
</el-icon>
<div class="back-text">返回</div>
</div>
</div> </div>
</template> </template>
...@@ -55,6 +67,7 @@ ...@@ -55,6 +67,7 @@
import { onMounted, reactive, ref } from "vue"; import { onMounted, reactive, ref } from "vue";
import { Search } from "@element-plus/icons-vue"; import { Search } from "@element-plus/icons-vue";
import { ArrowRightBold } from "@element-plus/icons-vue"; import { ArrowRightBold } from "@element-plus/icons-vue";
import { Back } from "@element-plus/icons-vue";
import router from "@/router"; import router from "@/router";
import TimeTabPane from "@/components/base/TimeTabPane/index.vue"; import TimeTabPane from "@/components/base/TimeTabPane/index.vue";
import { getStatisticsBillCountByCommittee } from "@/api/bill/billHome"; import { getStatisticsBillCountByCommittee } from "@/api/bill/billHome";
...@@ -66,6 +79,7 @@ const committeeInfo = reactive({ ...@@ -66,6 +79,7 @@ const committeeInfo = reactive({
pageSize: 8, pageSize: 8,
total: 0, total: 0,
keyWord: "", keyWord: "",
metricType: 1,
dateDesc: "近一年", dateDesc: "近一年",
list: [] list: []
}); });
...@@ -89,10 +103,11 @@ const onAllCommittee = async num => { ...@@ -89,10 +103,11 @@ const onAllCommittee = async num => {
id: `${item.orgType || ""}-${item.orgName || ""}`, id: `${item.orgType || ""}-${item.orgName || ""}`,
name: item.orgName, name: item.orgName,
chamber: getChamberLabel(item.orgType), chamber: getChamberLabel(item.orgType),
count: Number(item.count || 0) totalCount: Number(item.count || 0),
recentCount: Number(item.countRecent || item.totalRecent || item.recentCount || item.recent || item.newCount || 0)
})) }))
.filter(item => !committeeInfo.keyWord || item.name?.includes(committeeInfo.keyWord)) .filter(item => !committeeInfo.keyWord || item.name?.includes(committeeInfo.keyWord))
.sort((a, b) => (b.count || 0) - (a.count || 0)); .sort((a, b) => getSortValue(b) - getSortValue(a));
committeeInfo.total = source.length; committeeInfo.total = source.length;
const start = (committeeInfo.pageNum - 1) * committeeInfo.pageSize; const start = (committeeInfo.pageNum - 1) * committeeInfo.pageSize;
...@@ -108,20 +123,36 @@ const onAllCommittee = async num => { ...@@ -108,20 +123,36 @@ const onAllCommittee = async num => {
committeeInfo.loading = false; committeeInfo.loading = false;
}; };
const getSortValue = item => {
if (committeeInfo.metricType === 2) return Number(item?.recentCount || 0);
return Number(item?.totalCount || 0);
};
const getDisplayCount = item => {
return getSortValue(item);
};
const handleDateChange = event => { const handleDateChange = event => {
committeeInfo.dateDesc = event?.time || "近一年"; committeeInfo.dateDesc = event?.time || "近一年";
onAllCommittee(); onAllCommittee();
}; };
const handleToDataLibrary = item => { const handleToDataLibrary = item => {
const route = router.resolve({ router.push({
path: "/dataLibrary/countryBill", path: "/dataLibrary/countryBill",
query: { query: {
selectedOrg: item.name, selectedOrg: item.name,
selectedCongress: item.chamber selectedCongress: item.chamber
} }
}); });
window.open(route.href, "_blank"); };
const handleBack = () => {
if (window.history.length > 1) {
router.back();
return;
}
router.push("/billHome");
}; };
const refCommittee = ref(); const refCommittee = ref();
...@@ -143,6 +174,28 @@ onMounted(() => { ...@@ -143,6 +174,28 @@ onMounted(() => {
background-size: 100% 100%; background-size: 100% 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
position: relative;
.back-bnt {
position: absolute;
top: 16px;
left: 30px;
width: 86px;
height: 38px;
background-color: white;
border-radius: 19px;
display: flex;
align-items: center;
justify-content: center;
color: var(--text-primary-65-color);
font-family: Source Han Sans CN;
font-size: 16px;
cursor: pointer;
}
.back-text {
margin-left: 6px;
}
.container-box { .container-box {
width: 1600px; width: 1600px;
...@@ -180,6 +233,11 @@ onMounted(() => { ...@@ -180,6 +233,11 @@ onMounted(() => {
width: 180px; width: 180px;
height: 32px; height: 32px;
} }
.hard-select {
height: 42px;
padding: 5px 0;
}
} }
.date-box { .date-box {
......
...@@ -69,7 +69,7 @@ const getDoublePieChart = (data1, data2) => { ...@@ -69,7 +69,7 @@ const getDoublePieChart = (data1, data2) => {
const name = truncateLabel(params?.name, 6) const name = truncateLabel(params?.name, 6)
const value = params?.value ?? 0 const value = params?.value ?? 0
const percent = typeof params?.percent === 'number' ? params.percent : 0 const percent = typeof params?.percent === 'number' ? params.percent : 0
return `{name|${name}}\n{time|${value} ${percent}%}` return `{name|${name}}\n{time|${value} ${percent}%}`
}, },
minMargin: 5, minMargin: 5,
edgeDistance: 10, edgeDistance: 10,
......
...@@ -10,6 +10,7 @@ const truncateLabel = (value, maxLen = 6) => { ...@@ -10,6 +10,7 @@ const truncateLabel = (value, maxLen = 6) => {
const getPieChart = (data, colorList, options = {}) => { const getPieChart = (data, colorList, options = {}) => {
const showCount = options.showCount !== false const showCount = options.showCount !== false
const countUnit = options.countUnit || '条'
const chartColors = Array.isArray(colorList) && colorList.length ? colorList : MUTICHARTCOLORS const chartColors = Array.isArray(colorList) && colorList.length ? colorList : MUTICHARTCOLORS
let option = { let option = {
color: chartColors, color: chartColors,
...@@ -38,7 +39,7 @@ const getPieChart = (data, colorList, options = {}) => { ...@@ -38,7 +39,7 @@ const getPieChart = (data, colorList, options = {}) => {
const name = truncateLabel(params?.name, 6) const name = truncateLabel(params?.name, 6)
const value = params?.value ?? 0 const value = params?.value ?? 0
const percent = typeof params?.percent === 'number' ? params.percent : 0 const percent = typeof params?.percent === 'number' ? params.percent : 0
const labelText = showCount ? `${value} ${percent}%` : `${percent}%` const labelText = showCount ? `${value}${countUnit} ${percent}%` : `${percent}%`
return `{name|${name}}\n{time|${labelText}}` return `{name|${name}}\n{time|${labelText}}`
}, },
minMargin: 5, minMargin: 5,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论