Browse Source

新首页组件icon修改及功能问题修复

cfort 2 years ago
parent
commit
8d74b2d758

+ 1 - 0
src/views/platform/office/mixin/utils.js

@@ -28,6 +28,7 @@ export default {
             importFormVisible: false,
             formPrintDialogVisible: false,
             defId: '',
+            taskId: '',
             editId: '',
             proInstId: '',
             instanceId: '',

+ 29 - 12
src/views/system/dashboard/components/util.js

@@ -6,8 +6,6 @@ import ActionUtils from '@/utils/action'
 import Utils from '@/utils/util'
 import { findAllByCurrUserId, saveCalendarInfos, removeCalendarInfos } from '@/api/detection/newHomeApi'
 import { delQuickNavigation, addQuickNavigation, getQuickNavigation } from '@/api/platform/message/innerMessage'
-import { add, isObject } from 'lodash'
-const defaultRouterAlias = '/router-alias/'
 import newPng from '@/assets/images/homepage/new.png'
 
 /**
@@ -17,7 +15,9 @@ export function buildComponent (name, column, preview) {
     try {
         return {
             name: name,
-            components: {},
+            components: {
+                VueDraggable: () => import('vuedraggable')
+            },
             props: {
                 params: {
                     type: Object,
@@ -84,7 +84,7 @@ export function buildComponent (name, column, preview) {
 
                     activeName: 'innerMessage',
                     unreadMessageOption: {},
-                    formName: 'form',
+                    formName: 'quickNavform',
                     dialogFormVisible: false,
                     formLabelWidth: '120px',
                     quickNavform: {
@@ -126,8 +126,17 @@ export function buildComponent (name, column, preview) {
                         jieShuShiJian: '',
                         formDate: []
                     },
-                    colorStatus: ['#e7505a', '#f3c200', '#578ebe', '#1BBC9B']
+                    colorStatus: ['#e7505a', '#f3c200', '#578ebe', '#1BBC9B'],
                     // const status = ['急', '重', '轻','缓']
+                    isDragging: false,
+                    draggableOptions: {
+                        handle: '.draggable',
+                        ghostClass: 'sortable-ghost',
+                        distance: 1,
+                        disabled: false,
+                        animation: 200,
+                        axis: 'y'
+                    }
                 }
             },
             computed: {
@@ -144,6 +153,7 @@ export function buildComponent (name, column, preview) {
             methods: {
                 fetchData (columns, params = {}) {
                     this.loading = true
+                    this.data = []
                     this.showHeight = this.getHeight()
                     const param = Utils.isNotEmpty(columns) && (column.alias === 'unreadMessage' || column.alias === 'pendingBusiness')
                         ? { dataMode: column.dataMode, dataFrom: column.dataFrom }
@@ -396,14 +406,14 @@ export function buildComponent (name, column, preview) {
                     this.showHeight = this.bodyShow ? this.getHeight() : 0
                     this.$refs['toolbar'].callback(actions)
                 },
-                formValidate () {
+                formValidate (formName) {
                     this.$nextTick(() => {
-                        this.$refs[this.formName].validate(() => {})
+                        this.$refs[formName].validate(() => {})
                     })
                 },
                 getFormData () {
                     this.quickNavform = JSON.parse(JSON.stringify(this.defaultForm))
-                    this.formValidate()
+                    this.formValidate('quickNavform')
                     this.dialogFormVisible = true
                 },
                 handleNavRemove (navId, i) {
@@ -432,9 +442,10 @@ export function buildComponent (name, column, preview) {
                 saveQuickNav () {
                     this.$refs[this.formName].validate(valid => {
                         if (valid) {
-                            addQuickNavigation({ id: '', ...this.quickNavform }).then(() => {
+                            addQuickNavigation({ id: '', ...this.quickNavform }).then(res => {
                                 this.$message.success('添加成功!')
-                                this.quickNavigationData.push(this.quickNavform)
+                                const { id } = res.variables || {}
+                                this.quickNavigationData.push({ id, ...this.quickNavform })
                                 this.dialogFormVisible = false
                             })
                         } else {
@@ -470,9 +481,15 @@ export function buildComponent (name, column, preview) {
                 },
                 // 公告栏是否显示new图标
                 showNewIcon (date, days) {
-                    const nowDate = new Date().getTime
-                    const targetDate = new Date(date).getTime
+                    const nowDate = new Date().getTime()
+                    const targetDate = new Date(date).getTime()
                     return targetDate + days * 24 * 60 * 60 * 1000 > nowDate
+                },
+                handleOverflow (val, length) {
+                    if (val.length > length) {
+                        return val.slice(0, length - 2) + '...'
+                    }
+                    return val
                 }
             },
             template: column.templateHtml !== '' ? `${column.templateHtml}` : `<div></div>`

+ 6 - 5
src/views/system/dashboard/templates/myCalendar.vue

@@ -1,17 +1,18 @@
 <template>
-    <el-card :style="{height:cardHeight}" class="home-card changeShadow">
+    <el-card :style="{height: cardHeight}" class="home-card changeShadow">
         <div slot="header" class="clearfix">
-            <span>{{  }}</span>
+            <i class="el-icon-date" />
+            <span>{{ title }}</span>
             <ibps-desktop-toolbar
                 ref="toolbar"
-                :actions="[{key:'refresh'},{key:'fullscreen'},{key:'collapse'}]"
+                :actions="[{key: 'refresh'}, {key: 'fullscreen'}, {key: 'collapse'}]"
                 @action-event="handleActionEvent"
             />
         </div>
         <transition name="draw" mode="in-out" appear>
-            <div ref="body" :style="{height:showHeight,width:'100%'}" class="text item">
+            <div ref="body" :style="{height: showHeight, width:'100%'}" class="text item">
                 <v-full-calendar :options="getFullCalendarConfig(data)" :style="{height:getHeight(),width:'100%'}" />
             </div>
         </transition>
     </el-card>
-</template>
+</template>

+ 1 - 1
src/views/system/dashboard/templates/myFavorites.vue

@@ -1,7 +1,7 @@
 <template>
     <el-card class="home-card changeShadow">
         <div slot="header" class="clearfix">
-            <ibps-icon name="logo" />
+            <ibps-icon name="star" />
             <span>{{ title }}</span>
             <ibps-desktop-toolbar
                 ref="toolbar"

+ 1 - 1
src/views/system/dashboard/templates/myMessage.vue

@@ -107,7 +107,7 @@
     <!-- 无选项卡版本 -->
     <el-card :style="{height: cardHeight}" class="home-card changeShadow">
         <div slot="header" class="clearfix">
-            <ibps-icon name="commenting" />
+            <i class="el-icon-message" />
             <div style="width: 50%; display: inline-flex; align-items: center;">
                 <span>{{ title }}</span>
                 <span class="totalityClass">{{ totality ? totality.totalCount > 999 ? '999+' : totality.totalCount : '0' }}</span>

+ 1 - 1
src/views/system/dashboard/templates/notice.vue

@@ -1,7 +1,7 @@
 <template>
     <el-card class="home-card changeShadow">
         <div slot="header" class="clearfix">
-            <ibps-icon name="commenting" />
+            <i class="el-icon-news" />
             <span>{{ title }}</span>
             <ibps-desktop-toolbar
                 ref="toolbar"

+ 31 - 36
src/views/system/dashboard/templates/paddingApprove.vue

@@ -1,38 +1,33 @@
 <template>
-  <el-card
-    :style="{width:'100%'}"
-    class="ibps-desktop-dashboard changeShadow verticalCenterFlex"
-  >
-    <el-row ref="row" :gutter="12">
-      <template v-if="data && data.length >0">
-        <el-col v-for="item in data" :key="item.id" :span="24" :sm="6" :md="6" :lg="6" :xl="6">
-          <div :class="'bg-'+item.color" class="item pendingAssigneeClass" @click="openPlate(item.url)">
-            <div class="item-header">
-              <p class="item-headerH">{{ item.dataContent }}</p>
-            </div>
-            <div class="item-body">
-              <h2><count-to :end-val="parseInt(item.dataText,10)" :duration="2000" /></h2>
-            </div>
-            <p class="item-tip">{{ item.dataContent |firstStr }}</p>
-          </div>
-        </el-col>
-      </template>
-      <template v-else>
-        <el-col v-for="(item,i) in 6" :key="i" :span="24" :sm="6" :md="6" :lg="6" :xl="6">
-          <div class="item bg-grey-steel">
-            <div class="item-header">&nbsp;</div>
-            <div class="item-body">
-              <h2>&nbsp;</h2>
-            </div>
-            <p class="item-tip">&nbsp;</p>
-          </div>
-        </el-col>
-      </template>
-    </el-row>
-  </el-card>
-
+    <el-card
+        :style="{width:'100%'}"
+        class="ibps-desktop-dashboard changeShadow verticalCenterFlex"
+    >
+        <el-row ref="row" :gutter="12">
+            <template v-if="data && data.length">
+                <el-col v-for="item in data" :key="item.id" :span="24" :sm="6" :md="6" :lg="6" :xl="6">
+                    <div :class="'bg-'+item.color" class="item pendingAssigneeClass" @click="openPlate(item.url)">
+                        <div class="item-header">
+                            <p class="item-headerH">{{ item.dataContent }}</p>
+                        </div>
+                        <div class="item-body">
+                            <h2><count-to :end-val="parseInt(item.dataText,10)" :duration="2000" /></h2>
+                        </div>
+                        <p class="item-tip">{{ item.dataContent | firstStr }}</p>
+                    </div>
+                </el-col>
+            </template>
+            <template v-else>
+                <el-col v-for="(item,i) in 6" :key="i" :span="24" :sm="6" :md="6" :lg="6" :xl="6">
+                    <div class="item bg-grey-steel">
+                        <div class="item-header">&nbsp;</div>
+                        <div class="item-body">
+                            <h2>&nbsp;</h2>
+                        </div>
+                        <p class="item-tip">&nbsp;</p>
+                    </div>
+                </el-col>
+            </template>
+        </el-row>
+    </el-card>
 </template>
-
-
-
-//height:getDashboardHeight()

+ 48 - 14
src/views/system/dashboard/templates/quickNavigation.vue

@@ -11,15 +11,31 @@
         </div>
         <div ref="body" :style="{height: showHeight, width: '100%'}">
             <div :style="{height: showHeight, width: '100%'}" class="nav-content">
-                <el-tag
-                    v-for="(tag, i) in quickNavigationData"
-                    :key="i"
-                    closable
-                    :disable-transitions="false"
-                    @close="handleNavRemove(tag.id, i)"
+                <vue-draggable
+                    v-if="quickNavigationData && quickNavigationData.length"
+                    v-model="quickNavigationData"
+                    v-bind="draggableOptions"
+                    class="list-group"
+                    @start="isDragging = true"
+                    @end="()=>{ isDragging = false }"
                 >
-                    <a :href="tag.urlAddr" :target="tag.display">{{ tag.urlName }}</a>
-                </el-tag>
+                    <el-tag
+                        v-for="(tag, i) in quickNavigationData"
+                        :key="i"
+                        closable
+                        :disable-transitions="false"
+                        class="draggable"
+                        @close="handleNavRemove(tag.id, i)"
+                    >
+                        <el-tooltip
+                            :disabled="tag.urlName.length <= 8"
+                            :content="tag.urlName"
+                            placement="top"
+                        >
+                            <a :href="tag.urlAddr" :target="tag.display">{{ handleOverflow(tag.urlName, 8) }}</a>
+                        </el-tooltip>
+                    </el-tag>
+                </vue-draggable>
             </div>
         </div>
         <el-dialog
@@ -29,14 +45,32 @@
             title="添加快捷导航"
             append-to-body
         >
-            <el-form ref="form" :model="quickNavform" :rules="rules" :label-width="formLabelWidth" @submit.native.prevent>
-                <el-form-item label="名称:" prop="label">
-                    <el-input v-model="quickNavform.urlName" autocomplete="off" />
+            <el-form
+                ref="quickNavform"
+                :model="quickNavform"
+                :rules="rules"
+                :label-width="formLabelWidth"
+                @submit.native.prevent
+            >
+                <el-form-item label="名称:" prop="urlName">
+                    <el-input
+                        v-model="quickNavform.urlName"
+                        type="text"
+                        autocomplete="off"
+                        :maxlength="64"
+                        show-word-limit
+                    />
                 </el-form-item>
-                <el-form-item label="url地址:" prop="url">
-                    <el-input v-model="quickNavform.urlAddr" autocomplete="off" placeholder="请填写完整的URL地址,如https://www.szjyxt.com" />
+                <el-form-item label="url地址:" prop="urlAddr">
+                    <el-input
+                        v-model="quickNavform.urlAddr"
+                        type="textarea"
+                        :autosize="{ minRows: 4, maxRows: 8 }"
+                        autocomplete="off"
+                        placeholder="请填写完整的URL地址,如https://www.szjyxt.com"
+                    />
                 </el-form-item>
-                <el-form-item label="打开方式:" prop="target">
+                <el-form-item label="打开方式:" prop="display">
                     <el-select v-model="quickNavform.display" placeholder="请选择" style="width:100%">
                         <el-option label="新页面打开" value="_blank" />
                         <el-option label="当前页面打开" value="_self" />