瀏覽代碼

feat: adjust some styles

the tag columns in table support size
Casper Dai 2 年之前
父節點
當前提交
2f28021415

+ 2 - 2
src/components/table/Table/Column.vue

@@ -180,8 +180,8 @@ export default {
       return this.createTag(tag, data)
     },
     createTag (tag, data) {
-      const { label, ignore, size = '', ...tagProps } = tag
-      const { on } = this.schema
+      const { label, ignore, ...tagProps } = tag
+      const { on, size = '' } = this.schema
       return this.$createElement('el-tag', {
         staticClass: on && !ignore ? `o-tag ${size} u-pointer` : `o-tag ${size} u-readonly`,
         props: {

+ 15 - 9
src/views/ad/automation/task/AssetTask.vue

@@ -116,6 +116,9 @@ export default {
 
     return {
       schema: {
+        props: {
+          size: 'small'
+        },
         list: getDepartmentTasks,
         transform: this.transform,
         buttons: canEdit
@@ -126,7 +129,7 @@ export default {
           ]
           : null,
         cols: [
-          { prop: 'type', type: 'refresh', width: 80 },
+          { prop: 'type', type: 'refresh', width: 72 },
           { render: (data, h) => data.allowed
             ? h(
               'div',
@@ -170,7 +173,7 @@ export default {
                 input: val => this.onDateEdit(data, val)
               }
             })
-            : `${data.startDate} 至 ${data.endDate}`, width: 220, align: 'center' },
+            : `${data.startDate} 至 ${data.endDate}`, width: 200, align: 'center' },
           { label: '上播时间', render: (data, h) => canEdit && data.allowed && data.from === TaskFromType.ASSET
             ? h('div', {
               staticClass: 'o-date-picker jc',
@@ -179,9 +182,9 @@ export default {
               }
             }, data.range)
             : data.range, width: 160, align: 'center' },
-          { label: '上播时长(s)', render: (data, h) => canEdit && this.canEditDuration(data)
+          { label: '单次时长(s)', render: (data, h) => canEdit && this.canEditDuration(data)
             ? h('edit-input', {
-              staticClass: 'border',
+              staticClass: 'sm border',
               props: {
                 value: `${data.duration}`,
                 align: 'center'
@@ -193,7 +196,7 @@ export default {
             : data.duration, 'min-width': 96, align: 'center' },
           { label: '上播次数', render: (data, h) => canEdit && data.allowed && data.from === TaskFromType.ASSET
             ? h('edit-input', {
-              staticClass: 'border',
+              staticClass: 'sm border',
               props: {
                 value: `${data.count}`,
                 align: 'center'
@@ -205,7 +208,7 @@ export default {
             : data.count, align: 'center' },
           { label: '审核次数', render: (data, h) => canAudit && data.allowed
             ? h('edit-input', {
-              staticClass: 'border',
+              staticClass: 'sm border',
               props: {
                 value: `${data.auditCount}`,
                 align: 'center'
@@ -215,7 +218,7 @@ export default {
               }
             })
             : '-', align: 'center' },
-          { prop: 'tag', type: 'tag', on: canAudit && this.onAudit },
+          { prop: 'tag', type: 'tag', size: 'sm', on: canAudit && this.onAudit, width: 80 },
           { type: 'invoke', render: [
             { label: '查看', allow: ({ allowed }) => allowed, on: this.onViewTask },
             { label: '删除', allow: ({ from }) => from !== TaskFromType.ORDER, on: this.onDel }
@@ -638,8 +641,9 @@ export default {
   justify-content: space-between;
   align-items: center;
   width: auto;
-  min-height: $height;
-  padding: 3px 0;
+  height: $height--sm;
+  padding: 2px 0;
+  line-height: $height--sm - 6px;
   border: 1px solid $primary;
   border-radius: $radius--sm;
   background-color: $blue--light;
@@ -656,6 +660,7 @@ export default {
     flex: 1 1 auto;
     width: auto;
     min-width: 0;
+    font-size: $font-size--xs;
     background-color: $blue--light;
   }
 
@@ -665,6 +670,7 @@ export default {
     width: auto;
     padding: 0;
     font-size: $font-size--xs;
+    line-height: inherit;
   }
 
   .el-input__icon {

+ 11 - 8
src/views/ad/automation/task/ScreenTask.vue

@@ -141,7 +141,7 @@ export default {
           ]
           : null,
         cols: [
-          { prop: 'type', type: 'refresh', width: 80 },
+          { prop: 'type', type: 'refresh', width: 72 },
           { render: (data, h) => data.canView
             ? h(
               'div',
@@ -169,7 +169,7 @@ export default {
                 input: val => this.onDateEdit(data, val)
               }
             })
-            : `${data.startDate} 至 ${data.endDate}`, width: 220, align: 'center' },
+            : `${data.startDate} 至 ${data.endDate}`, width: 200, align: 'center' },
           { label: '上播时间', render: (data, h) => canEdit && data.allowed && data.from === TaskFromType.ASSET
             ? h('div', {
               staticClass: 'o-date-picker jc',
@@ -180,7 +180,7 @@ export default {
             : data.range, width: 160, align: 'center' },
           { label: '单次时长(s)', render: (data, h) => canEdit && this.canEditDuration(data)
             ? h('edit-input', {
-              staticClass: 'border',
+              staticClass: 'sm border',
               props: {
                 value: `${data.duration}`,
                 align: 'center'
@@ -192,7 +192,7 @@ export default {
             : data.duration, 'min-width': 96, align: 'center' },
           { label: '上播次数', render: (data, h) => canEdit && data.allowed && data.from === TaskFromType.ASSET
             ? h('edit-input', {
-              staticClass: 'border',
+              staticClass: 'sm border',
               props: {
                 value: `${data.count}`,
                 align: 'center'
@@ -204,7 +204,7 @@ export default {
             : data.count, align: 'center' },
           { label: '审核次数', render: (data, h) => canAudit && data.allowed
             ? h('edit-input', {
-              staticClass: 'border',
+              staticClass: 'sm border',
               props: {
                 value: `${data.auditCount}`,
                 align: 'center'
@@ -214,7 +214,7 @@ export default {
               }
             })
             : '-', align: 'center' },
-          { prop: 'tag', type: 'tag', on: canAudit && this.onAudit },
+          { prop: 'tag', type: 'tag', size: 'sm', on: canAudit && this.onAudit, width: 92 },
           { type: 'invoke', render: [
             { label: '查看', allow: ({ canView }) => canView, on: this.onViewTask },
             { label: '删除', allow: !canAudit && (({ from, enable }) => from !== TaskFromType.ORDER && !enable), on: this.onDel }
@@ -635,8 +635,9 @@ export default {
   justify-content: space-between;
   align-items: center;
   width: auto;
-  min-height: $height;
-  padding: 3px 0;
+  height: $height--sm;
+  padding: 2px 0;
+  line-height: $height--sm - 6px;
   border: 1px solid $primary;
   border-radius: $radius--sm;
   background-color: $blue--light;
@@ -653,6 +654,7 @@ export default {
     flex: 1 1 auto;
     width: auto;
     min-width: 0;
+    font-size: $font-size--xs;
     background-color: $blue--light;
   }
 
@@ -662,6 +664,7 @@ export default {
     width: auto;
     padding: 0;
     font-size: $font-size--xs;
+    line-height: inherit;
   }
 
   .el-input__icon {

+ 2 - 1
src/views/device/detail/components/DeviceAlarm.vue

@@ -101,10 +101,11 @@ export default {
         cols: [
           { prop: 'userName', label: '账号' },
           ...SupportedAlarmStrategies.map(({ key, label }) => {
+            const typeKey = key === 'note' ? 'phone' : key
             return {
               label,
               type: 'tag',
-              render: ({ [key]: val }) => val ? { type: 'success', label: '已绑定', msg: val } : { type: 'danger', label: '未绑定' },
+              render: ({ [typeKey]: val }) => val ? { type: 'success', label: '已绑定', msg: val } : { type: 'danger', label: '未绑定' },
               width: null
             }
           })

+ 5 - 5
src/views/device/detail/components/DeviceRuntime/OnlineDuration.vue

@@ -85,7 +85,6 @@
 </template>
 
 <script>
-import { ONE_DAY } from '@/constant'
 import { parseTime } from '@/utils'
 import {
   getOnlineDurationByDevice,
@@ -107,10 +106,11 @@ export default {
   },
   data () {
     const startDate = new Date()
-    startDate.setDate(startDate.getDate() - 1)
-    startDate.setMonth(startDate.getMonth() - 1)
+    startDate.setDate(1)
     const endDate = new Date()
-    endDate.setDate(endDate.getDate() - 1)
+    if (endDate.getDate() === 1) {
+      startDate.setMonth(startDate.getMonth() - 1)
+    }
 
     return {
       type: 'online',
@@ -183,7 +183,7 @@ export default {
   },
   methods: {
     disabledDate (date) {
-      return date >= Date.now() - ONE_DAY
+      return date > Date.now()
     },
     startRun () {
       if (!this.$running) {

+ 2 - 2
src/views/realm/report/components/OnlineDurationDialog.vue

@@ -57,14 +57,14 @@ export default {
   methods: {
     show () {
       const now = Date.now()
-      this.dateRange = [parseTime(now - ONE_DAY * 7, '{y}-{m}-{d}'), parseTime(now - ONE_DAY, '{y}-{m}-{d}')]
+      this.dateRange = [parseTime(now - ONE_DAY * 6, '{y}-{m}-{d}'), parseTime(now, '{y}-{m}-{d}')]
       this.$refs.dialog.show()
     },
     onGroupChanged (group) {
       this.$group = group
     },
     isDisableDate (date) {
-      return date >= Date.now() - ONE_DAY
+      return date > Date.now()
     },
     onConfirm (done) {
       const groupPath = this.$group.path

+ 1 - 2
src/views/screen/review/workflow/components/WorkflowDialog.vue

@@ -77,9 +77,8 @@ export default {
         list: this.getWorkflowHistory,
         cols: [
           { label: '节点', render: ({ severalReviewed }) => WorkflowStateInfo[severalReviewed], width: 60, align: 'center' },
-          { type: 'tag', render: ({ status, remark }) => status > State.READY
+          { type: 'tag', size: 'sm', render: ({ status, remark }) => status > State.READY
             ? {
-              size: 'sm',
               type: ['', 'primary', 'success', 'danger'][status],
               label: ['', '待审核', '通过', '驳回'][status],
               msg: remark