基数数据统计

master
ihzero 2024-01-31 12:08:12 +08:00
parent 156643ea77
commit abdb92ee74
18 changed files with 232 additions and 129 deletions

View File

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title></title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/static/index.97465e7b.css"></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.959091ef.js"></script><script src="/static/js/index.63387dfa.js"></script></body></html>
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/static/index.97465e7b.css"></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.959091ef.js"></script><script src="/static/js/index.656eb39e.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -66,10 +66,10 @@ export default {
},
},
isEdit() {
return !!this.$listeners.onEdit && checkPermission(this.editAuth)
return (!!this.$listeners.onEdit && checkPermission(this.editAuth)) || (!!this.$listeners.onEdit && this.editAuth.length==0)
},
isDel() {
return !!this.$listeners.onDel && checkPermission(this.delAuth)
return (!!this.$listeners.onDel && checkPermission(this.delAuth)) || (!!this.$listeners.onDel && this.delAuth.length==0)
},
columsList() {
const arr = []

View File

@ -3,9 +3,17 @@
<view class="bg-white p-30rpx">
<view class="flex justify-between items-center">
<view class="text-32rpx">全市数据统计</view>
<u-button size="mini" v-auth="['endpoint.town_street.base_statistics_edit']" @click="cityEditShow = true"></u-button>
<u-button
size="mini"
v-auth="['endpoint.town_street.base_statistics_edit']"
@click="cityEditShow = true"
>编辑</u-button
>
</view>
<view class="grid grid-cols-2 mt-20rpx" v-auth="['endpoint.town_street.base_statistics']">
<view
class="grid grid-cols-2 mt-20rpx"
v-auth="['endpoint.town_street.base_statistics']"
>
<CountItem
v-for="(item, i) in showCityList"
:key="i"
@ -88,7 +96,29 @@
@onEdit="handleEdit"
:colums="baseTableColums"
:data="currentData"
:editAuth="['endpoint.town_street.edit']"
>
<template v-slot:extends="{ data }">
<view class="w-full">
<view v-for="(item, i) in formtExtends(data)" :key="i">
<view class="flex items-center">
<view class="flex-1 flex-center">
{{ item.name }}
</view>
<view class="flex-1">
<u-cell-item
v-for="(va, ii) in item.value"
:key="ii"
:title="va.year"
:value="va.value"
:arrow="false"
></u-cell-item>
</view>
</view>
<u-line></u-line>
</view>
</view>
</template>
</BaseTablePopup>
</view>
</template>
@ -98,6 +128,8 @@ import cuPopup from '@/components/cu-popup/index.vue'
import CountEdit from './components/town-count-edit.vue'
import BaseTablePopup from '@/components/base-table/popup.vue'
import CityEdit from './components/town-city-edit'
import checkPermission from '@/utils/permission.js'
import { concat } from 'lodash-es'
const filterCityCount = [
'city_data_chart_nongye',
'city_data_chart_yuye',
@ -105,6 +137,28 @@ const filterCityCount = [
'city_data_chart_lingye',
'city_data_chart_activity',
]
const defaultData = {
chart_nongye: {
label: '统计数据-农业',
unit: '万元',
},
chart_yuye: {
label: '统计数据-渔业',
unit: '万元',
},
chart_xumuye: {
label: '统计数据-畜牧业',
unit: '万元',
},
chart_lingye: {
label: '统计数据-林业',
unit: '万元',
},
chart_activity: {
label: '统计数据-其他',
unit: '万元',
},
}
const baseTableColums = [
{
title: '街镇名称',
@ -130,6 +184,10 @@ const baseTableColums = [
title: '街镇描述',
dataIndex: 'description',
},
{
title: '统计数据',
dataIndex: 'extends',
},
]
import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js'
export default {
@ -147,20 +205,23 @@ export default {
(item) => !filterCityCount.includes(item.slug)
)
},
options() {
return [
{
text: '编辑',
style: {
backgroundColor: '#007aff',
},
permission: ['endpoint.town_street.edit'],
},
].filter((e) => checkPermission(e.permission))
},
},
data() {
return {
baseTablePopupShow: false,
baseTableColums,
cityItemShow: false,
options: [
{
text: '编辑',
style: {
backgroundColor: '#007aff',
},
},
],
cityList: [],
cityEditShow: false,
dataList: [],
@ -184,6 +245,48 @@ export default {
this.getCityData()
},
methods: {
isObject(val) {
return Object.prototype.toString.call(val) === '[object Object]'
},
isArray(val) {
return Object.prototype.toString.call(val) === '[object Array]'
},
formtExtends({ value }) {
const defaultObj = value
const tempData = Object.keys(defaultObj).reduce((pre, cur) => {
const currentData = defaultData[cur]
const obj = {
name: currentData.label,
unit: currentData.unit,
slug: cur,
}
const extend = defaultObj[cur]
if (this.isObject(extend) || this.isArray(extend)) {
const temp = []
if (Object.keys(extend).length === 0) {
temp.push({
value: '',
year: null,
})
}
for (const key in extend) {
temp.push({
value: extend[key],
year: key,
})
}
return concat(pre, {
...obj,
isMore: true,
value: temp,
})
}
}, [])
return tempData ?? []
},
handleEdit(e) {
this.currentData = e
this.baseTablePopupShow = false