|
|
@@ -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>`
|