Commit 9e36f7cf authored by xinzhedeai's avatar xinzhedeai

statisc init

parent 4ac2107f
......@@ -1218,14 +1218,35 @@ var reqApis = function(){
name: '信息统计',
Dict: {
baseInfo: {
"companyName": {name:"企业名称", must:true},
"incubatorId": {name:"所属孵化器", must:true, 'type':'select', key:'name', },
"entryDate": {name:"入住时间", },
"companyType": {name:"企业类型", 'type':'select', key:'name', },
"incubationStatus": {name:"企业孵化状态", 'type':'select', key:'name', },
"mentorId": {name:"创业导师", 'type':'select', key:'name',},
"contactPhone": {name:"联系方式", },
"revenueLastYear": {name:"上年营业收入(万元)", },
"companyName": {name:"企业名称", must:true, fixed:true,'width': '300px',},
"incubatorName": {name:"所属孵化器", must:true, fixed:true, key:'name', 'width': '180px',},
"entryDate": {name:"入驻时间", 'width': '180px', },
"companyType": {name:"企业类型", 'type':'select', key:'name','width': '180px', },
"incubationStatus": {name:"企业孵化状态", 'type':'select', key:'name','width': '180px', },
"incubatorId": {name:"企业负责人", key:'name', 'width': '200px',},
"contactPhone": {name:"联系方式",'width': '180px', },
"technicalFieldName": {name:"企业所属技术领域", must:true, key:'name', 'width': '180px'},
"inventionPatentsNumber": {name:"发明专利数(件)", must:true, key:'name', 'width': '180px', },
"inventionApplicationsNumber": {name:"发明申请数(件)", must:true, key:'name', 'width': '180px', },
"utilityModelsNumber": {name:"实用新型数(件)", must:true, key:'name', 'width': '180px',},
"softwareCopyrightNumber": {name:"软件著作权数(件)", must:true, key:'name', 'width': '180px',},
"companyLevel": {name:"企业级别", must:true, 'type':'select', key:'name', 'width': '180px',},
"totalEmployees": {name:"今年从业人数(人)", must:true, key:'name', 'width': '180px',},
"phdEmployees": {name:"博士人数(人)", must:true, key:'name', 'width': '180px',},
"overseasEmployees": {name:"留学人数(人)", must:true, key:'name', 'width': '180px',},
"revenueLastYear": {name:"上年营业收入(万元)", must:true, key:'name', 'width': '180px',},
"netProfit": {name:"净利润(万元)", must:true, key:'name', 'width': '180px',},
"taxesPaid": {name:"上缴税费(万元)", must:true, key:'name', 'width': '180px',},
"investmentProportion": {name:"研发投入占比", must:true, key:'name', 'width': '180px',},
"grossIncome": {name:"总收入(万元)", must:true, key:'name', 'width': '180px',},
"researchInput": {name:"研发投入(万元)", must:true, key:'name', 'width': '180px',},
// "mentorId": {name:"创业导师", 'type':'select', key:'name','width': '180px',},
},
selectList: {
incubatorId: function(slist) {
......
<!--
/**
* 表单通用组件
* @example1:
1, 引入
import cuTable from '@/components/cuTable';
2, 注册
export default {
components: {
cuTable
},
data() {
return {
Dict:{selectList:[]},
table:{
page: 1,
size: 10,
total: 0,
loading: false,
dataList:[],
},
rules: {},
}
},
mounted(){
// 获取基本信息
this.pageApi = Config.getModuleInfo(this);
this.Dict = this.pageApi.Dict;
this.form.config = this.pageApi.config;
this.rules = reqApi.getRules(this.Dict.baseInfo) || (this.Dict.rules || {});
},
methods: {
loadData(searchItem) {
var that = this;
//reqApi.common.getRequst.call(this, searchItem);
},
}
}
3, 创建
<cu-table
ref="cuTable"
:table="table"
:Dict="Dict"
:config="form.config"
/>
#4, 使用
* @author: Kimber
* @updatetime: 2022/5/13(周五)
* @createtime: 2021/12/09
*/
-->
<template>
<div class="content cu-table">
<!-- :style="'width:'+ (item.fixed ? '400px' : 'auto') +" -->
<el-table :data="table.dataList" v-loading="table.loading" border style="width: 100%;" :row-class-name="tableRowClassName">
<template v-for="(item, key) in Dict.baseInfo" v-if="item.table !== 0">
<el-table-column v-if="item.type === 'select'" :prop="key" :label="item.name" :fixed="fixed" :width="item.width||'200px'">
<template slot-scope="scope">
<template v-for="sitem in Dict.selectList[key]">
<template v-if="typeof scope.row[key] === 'object'">
<span v-for="val in scope.row[key]" v-if="val===sitem[item.val||'value']">
{{sitem[item.key||'name']}}
</span>
</template>
<span v-else-if="sitem[item.val||'value']===scope.row[key]" class="orange" :style="'color:'+(sitem.color||'')+';'">
<i v-if="item.icon" :class="item.icon" style="font-size:16px;"></i>{{sitem[item.key||'name']}}
</span>
</template>
</template>
</el-table-column>
<el-table-column v-else-if="item.type === 'img'" :prop="key" :label="item.name" width="150px">
<img slot-scope="scope" :src="item.src ? item.src.call(_self, scope.row, key) :scope.row[key]" style="width:100%;border:0;height:auto;" @click="item.click ? item.click(scope.row[key]) :function(){}"/>
</el-table-column>
<el-table-column v-else-if="item.type === 'tableFormat'" :prop="key" :label="item.name" width="150px">
<template slot-scope="scope">{{item.tableFormat.call(scope.row, scope.row[key])}}</template>
</el-table-column>
<el-table-column v-else-if="item.type === 'button'" :prop="key" :label="item.name" :align="item.align" width="150px">
<el-button size="mini" slot-scope="scope" :type="item.btnType" :icon="item.icon" @click="item.click.call(_self, scope.row[key])">{{item.name}}</el-button>
</el-table-column>
<el-table-column v-else :prop="key" :label="item.name" :fixed="item.fixed" :width="item.width||'200px'"></el-table-column>
</template>
<el-table-column v-if="config.buttons && config.buttons[0]" label="操作" :width="(config.operWidth || 180)+'px'" align="center" fixed="right">
<template slot-scope="scope" class="oper">
<el-button v-for="(bitem, i) in config.buttons" size="mini" :type="bitem.type" :icon="bitem.icon" :disabled="bitem.isvalid && (typeof bitem.isvalid==='function'?bitem.isvalid(scope.row):!scope.row[bitem.isvalid])" @click="bitem.callback ? bitem.callback.call(_self, scope.row, $event) : btnClick(scope.row, bitem.fn)">{{bitem.name}}</el-button>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<el-pagination v-if="config.pagination!==false" :total="table.total" :current-page="table.page" style="margin-top:8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" />
</div>
</template>
<script>
var watchParams = {};
export default {
data() {
return {
loading: false,
}
},
props:{
table: {
type: Object,
default: {},
},
Dict: {
type: Object,
default: {},
},
config: {
type: Object,
default: {},
},
loadData:{
type: Function,
default: () => {}
},
},
beforeCreate(){
},
created(){
},
mounted() {
},
/* watch:{
'form.item.paperfilename':{
immediate:true,
handler(aa){
this.form.item.paperfilename = aa;
},
},
}, */
methods: {
tableRowClassName({row, rowIndex}) {
if (rowIndex === 1) {
return 'warning-row';
} else if (rowIndex === 3) {
return 'success-row';
}return '';
},
pageChange(e) {
this.table.page = e
this.loadData()
},
sizeChange(e) {
this.table.page = 1
this.table.size = e
this.loadData()
},
btnClick(row, fnName){
new Function('this.$parent.'+fnName+'('+JSON.stringify(row)+')').call(this);
},
},
}
</script>
<style lang="scss" scope>
.cu-table{
.el-table{
font-size:14px;
thead{
th{color:#666;background-color:#f8f8f8;}
}
tbody{color:#777;}
}
.content-between{
padding-right:10px;height:40px;line-height:40px;
.r-btn{padding:5px 10px;border:1px solid #58ACFF;border-radius:5px;}
}
.el-button{
margin-left:5px;margin-top:4px;
span{margin-left:1px;}
}
}
</style>
\ No newline at end of file
......@@ -19,11 +19,13 @@
<el-button v-for="(item, key) in form.config.otherBtn" size="mini" :type="item.type" :icon="item.icon" @click="item.callback.call(_self, $event)">{{item.name}}</el-button>
<div class="info" style="font-size:16px;">
{{'孵化器总数:'+table.body.incubatorAllCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'在孵企业数:'+table.body.incubatorInCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'毕业企业数:'+table.body.incubatorGraduateCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'创业导师数:'+table.body.mentorCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'中介机构数:'+table.body.incubatorIntermediaryCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'孵化器:'+table.body.incubatorAllCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'在孵企业:'+table.body.incubatorInCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'毕业企业:'+table.body.incubatorGraduateCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
<!-- {{'创业导师数:'+table.body.mentorCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp; -->
{{'中介机构:'+table.body.incubatorIntermediaryCount || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
{{'今年毕业企业'+table.body.incubatorGraduateCountYear || ''}}&nbsp;&nbsp;&nbsp;&nbsp;
</div>
</div>
<div>
......@@ -62,7 +64,7 @@ import { Tools } from '@/assets/js/common.js';
import DateRangePicker from '@/components/DateRangePicker';
import TableFilter from '@/components/TableFilter';
import cuForm from '@/components/cuForm';
import cuTable from '@/components/cuTable';
import cuTable from '@/components/cuTable/index2';
export default {
name: 'Dashboard',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment