王露 3 роки тому
джерело
коміт
cd8367ee1d

+ 12
- 1
digital-park-web/digital-park/src/utils/common.js Переглянути файл

@@ -1,5 +1,6 @@
import router from "../router/index";
import { Message } from "element-ui";
import dayjs from "dayjs"; // 时间格式化组件

// 在新的页面打开路由
export const routerOpenInNewWindow = routerPath => {
@@ -50,6 +51,16 @@ export const parseMarkdown = (markdownText) => {
.replace(/\[(.*?)\]\((.*?)\)/gim, "<a href='$2'>$1</a>")
.replace(/\n$/gim, '<br />')
.replace(/[\r\n]/g, "<br />")
.replace(/\/filex\/img/g,'')
.replace(/\/filex\/img/g, '')
return htmlText.trim()
}

export const formatDateFun = (time, fmtstring) => {
time = new Date(time)
// 使用momentjs这个日期格式化类库实现日期的格式化功能
if (time == '' || !time) {
return '——'
} else {
return dayjs(time).format(fmtstring);
}
}

+ 10
- 3
digital-park-web/digital-park/src/views/park-enterprises/Detail.vue Переглянути файл

@@ -96,11 +96,15 @@
<div class="company_info">
<div>
法人代表:
<span>{{ companyInfo.legalPerson }}</span>
<span :title="companyInfo.legalPerson">
{{ companyInfo.legalPerson }}
</span>
</div>
<div>
统一社会信用代码:
<span>{{ companyInfo.creditCode }}</span>
<span :title="companyInfo.creditCode">
{{ companyInfo.creditCode }}
</span>
</div>
<div>
电话:
@@ -108,7 +112,9 @@
</div>
<div>
网站:
<span>{{ companyInfo.url || "--" }}</span>
<span :title="companyInfo.url || '--'">
{{ companyInfo.url || "--" }}
</span>
</div>
<div>
成立日期:
@@ -461,6 +467,7 @@ export default {
@include border-box;
> div {
width: 30%;
@include text-ellipsis;
span {
color: #334a5f;
font-weight: 600;

+ 26
- 7
digital-park-web/digital-park/src/views/park-enterprises/components/CompanyItem.vue Переглянути файл

@@ -2,9 +2,11 @@
<template>
<div class="item_box" @click="goDetail(companyInfo.companyId)">
<img class="company_img" :src="formatImg(JSON.parse(companyInfo.logo)[0])" alt="企业图片" />
<div class="info_box">
<div class="info_box pointer">
<div class="title_box">
<span class="company_title">{{ companyInfo.companyName }}</span>
<span class="company_title" :title="companyInfo.companyName">
{{ companyInfo.companyName }}
</span>
<span
:class="[
'claim_state',
@@ -18,18 +20,30 @@
{{ companyInfo.claimState.text }}
</span>
</div>
<div class="company_info">
<div
class="company_info"
:title="
`法人:${companyInfo.legalPerson};状态:${companyInfo.enterpriseState};注册资本:${companyInfo.registeredCapital};信用代码:${companyInfo.creditCode}`
"
>
<span>法人:{{ companyInfo.legalPerson }}</span>
<span>状态:{{ companyInfo.enterpriseState }}</span>
<span>注册资本:{{ companyInfo.registeredCapital }}</span>
<span>信用代码:{{ companyInfo.creditCode }}</span>
</div>
<div class="company_info">
<div
class="company_info"
:title="
`成立日期:${formatDateFun(companyInfo.establishOn, 'YYYY-MM-DD')};行业:${
companyInfo.ownerIndustry
};地址:${companyInfo.businessAddress}`
"
>
<span>成立日期:{{ companyInfo.establishOn | formatDate("YYYY-MM-DD") }}</span>
<span>行业:{{ companyInfo.ownerIndustry }}</span>
<span v-if="companyInfo.ownerIndustry">行业:{{ companyInfo.ownerIndustry }}</span>
<span>地址:{{ companyInfo.businessAddress }}</span>
</div>
<div class="advantage_box" v-if="enterpriseLabel.length > 0">
<div class="advantage_box" v-if="enterpriseLabel.length > 0" :title="enterpriseLabel">
<span v-for="item in enterpriseLabel" :key="item">
{{ item }}
</span>
@@ -39,6 +53,7 @@
'business',
!enterpriseLabel || enterpriseLabel.length === 0 ? 'two_rows' : 'one_rows',
]"
:title="companyInfo && companyInfo.businessScope ? companyInfo.businessScope : ''"
>
<template v-if="companyInfo.businessScope">
<span>主营业务:</span>
@@ -52,7 +67,7 @@
<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import { formatImg } from "@/utils/common.js";
import { formatImg, formatDateFun } from "@/utils/common.js";
export default {
//import引入的组件需要注入到对象中才能使用
props: {
@@ -77,6 +92,7 @@ export default {
//方法集合
methods: {
formatImg,
formatDateFun,
goDetail(companyId) {
this.$router.push({
path: "/company-detail",
@@ -114,10 +130,13 @@ export default {
.title_box {
@include flex(row, flex-start, center, null);
margin-bottom: 15px;
width: 100%;
.company_title {
max-width: calc(100% - 80px);
@include font(18px, #334a5f);
font-weight: 600;
margin-right: 10px;
@include text-ellipsis;
}
.claim_state {
@include size(68px, 22px);

+ 3
- 0
digital-park-web/digital-park/src/views/park-enterprises/components/OtherInfo.vue Переглянути файл

@@ -10,6 +10,7 @@
<td class="content">
<el-input
:disabled="!isEditing"
:resize="isEditing ? 'vertical' : ' none'"
type="textarea"
v-model="companyInfo.enterpriseAdvantage"
></el-input>
@@ -20,6 +21,7 @@
<td class="content">
<el-input
:disabled="!isEditing"
:resize="isEditing ? 'vertical' : ' none'"
type="textarea"
v-model="companyInfo.enterpriseCulture"
></el-input>
@@ -69,6 +71,7 @@
<div>
<el-input
:disabled="!isEditing"
:resize="isEditing ? 'vertical' : ' none'"
type="textarea"
v-model="companyInfo.otherInfo"
></el-input>

Завантаження…
Відмінити
Зберегти