|
|
@@ -21,19 +21,25 @@
|
|
|
<el-row :gutter="40">
|
|
|
<el-col :xs="24" :sm="24" :lg="12" v-for="(item,key) in news" :key="key">
|
|
|
<el-card class="box-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <span>{{$t('dashboard.articleNotification')}}</span>
|
|
|
- <el-button type="text" class="box-card-more">
|
|
|
- <router-link :to="`/article/list/${item.ID}`">{{$t('dashboard.more')}}+</router-link>
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <template v-if="item.LISTS.length>0">
|
|
|
- <div v-for="(o,k) in item.LISTS" :key="k" class="text item">
|
|
|
- <router-link :to="`/article/detail/${o.ID}`" :title="o.TITLE">{{sub_str(o.TITLE)}}</router-link>
|
|
|
- <span>{{ formatDate(o.CREATED_AT) }}</span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <div v-if="item.LISTS.length==0">No content</div><!--暂无内容-->
|
|
|
+ <el-table :data="item.LISTS" lazy stripe fit highlight-current-row>
|
|
|
+ <el-table-column align="left" :label="$t('article.title')" prop="TITLE">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span @click="handleArticle(row.ID)">
|
|
|
+ <el-link type="primary" href="#" target="_self" >{{ row.TITLE }}</el-link>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="right">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <el-button type="text" class="box-card-more">
|
|
|
+ <router-link :to="`/article/article-list`">{{$t('dashboard.more')}}+</router-link>
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.CREATED_AT | parseTime('{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -48,6 +54,17 @@
|
|
|
<box-card />
|
|
|
</el-col>
|
|
|
</el-row> -->
|
|
|
+
|
|
|
+ <el-dialog :title="article.TITLE" :visible.sync="dialog" :width="screenWidth" v-loading="loading" center style="margin-top: -70px;">
|
|
|
+ <div class="white-box" style="text-align: center;">
|
|
|
+ <div class="white-box-title">
|
|
|
+ <h1>{{ article.TITLE }}</h1>
|
|
|
+ <span>{{ article.CREATED_AT | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
+ </div>
|
|
|
+ <div v-html="article.CONTENT" class="white-box-content">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -62,6 +79,8 @@ import TransactionTable from './components/TransactionTable'
|
|
|
import TodoList from './components/TodoList'
|
|
|
import BoxCard from './components/BoxCard'
|
|
|
import tool from '@/utils/tool'
|
|
|
+import {getScreenWidth} from "@/utils";
|
|
|
+import {fetchArticleOne} from "@/api/article";
|
|
|
|
|
|
const lineChartData = {
|
|
|
newVisitis: {
|
|
|
@@ -113,7 +132,20 @@ export default {
|
|
|
cycle: '',//当前业绩期
|
|
|
rmBv: '',
|
|
|
endTime: '',
|
|
|
- num: 0
|
|
|
+ num: 0,
|
|
|
+
|
|
|
+ loading: false,
|
|
|
+ dialog: false,
|
|
|
+ article: {
|
|
|
+ ID: '',
|
|
|
+ CID: '',
|
|
|
+ TITLE: '',
|
|
|
+ CONTENT: '',
|
|
|
+ CREATED_AT: '',
|
|
|
+ },
|
|
|
+
|
|
|
+ screenWidth: getScreenWidth() > 600 ? '70%' : getScreenWidth() + 'px',
|
|
|
+ labelPosition: getScreenWidth() > 600 ? 'right' : 'top',
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -138,7 +170,19 @@ export default {
|
|
|
},
|
|
|
formatDate(data) {
|
|
|
return tool.formatDate(data,false)
|
|
|
- }
|
|
|
+ },
|
|
|
+ handleArticle(id) {
|
|
|
+ this.loading = true
|
|
|
+ this.listLoading = true
|
|
|
+ fetchArticleOne(id).then(response => {
|
|
|
+ this.article = response.data
|
|
|
+ this.dialog = true
|
|
|
+ this.listLoading = false
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false
|
|
|
+ }, 0.5 * 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$store.dispatch('dashboard/getIndex', {})
|