浏览代码

refactor: confirmation box content

Casper Dai 3 年之前
父节点
当前提交
5372fa8c58

+ 5 - 7
src/api/base.js

@@ -28,17 +28,15 @@ export function messageSend (config, message) {
 export function confirm (message) {
   return MessageBox.confirm(
     message,
-    '提示',
-    {
-      type: 'warning',
-      confirmButtonText: '确定',
-      cancelButtonText: '取消'
-    }
+    { type: 'warning' }
   )
 }
 
 export function confirmAndSend (type, tip, config) {
-  return confirm(tip ? `确定${type} ${tip}?` : `确定${type}?`).then(() => messageSend(config, type))
+  return MessageBox.confirm(
+    tip ? `确定${type} ${tip}?` : `确定${type}?`,
+    { type: 'warning' }
+  ).then(() => messageSend(config, type))
 }
 
 export function add (config) {

+ 1 - 7
src/components/Schedule/ScheduleCalendar/index.vue

@@ -245,7 +245,6 @@ export default {
       if (this.programs.some(({ endDateTime }) => new Date(endDateTime).getTime() <= endTime)) {
         return this.$confirm(
           '存在过期或将要过期(<=60s)节目,是否移除?',
-          '提示',
           {
             type: 'warning',
             distinguishCancelAndClose: true,
@@ -319,12 +318,7 @@ export default {
     removeProgram ({ key, name }) {
       this.$confirm(
         `确定移除节目 ${name}`,
-        '提示',
-        {
-          type: 'warning',
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }
+        { type: 'warning' }
       ).then(() => {
         this.dirty = true
         this._removeProgram(key)

+ 1 - 6
src/components/Schedule/ScheduleSwiper/index.vue

@@ -204,12 +204,7 @@ export default {
     toDel ({ name }, index) {
       this.$confirm(
         `确定移除节目 ${name}?`,
-        '提示',
-        {
-          type: 'warning',
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }
+        { type: 'warning' }
       ).then(() => {
         this.programs.splice(index, 1)
       })

+ 3 - 13
src/utils/upload.js

@@ -107,12 +107,7 @@ function analyzeByWorker (obj) {
           if (videoTrack.Format !== 'AVC') {
             MessageBox.confirm(
               `视频 ${obj.name} 非H264编码将无法预览,确定上传?`,
-              '提示',
-              {
-                type: 'warning',
-                confirmButtonText: '确定',
-                cancelButtonText: '取消'
-              }
+              { type: 'warning' }
             ).then(resolve, reject)
           } else {
             resolve()
@@ -141,13 +136,8 @@ export function removeFile (id) {
       emitChange()
     } else {
       MessageBox.confirm(
-        `确定移除文件${obj.name}?`,
-        '提示',
-        {
-          type: 'warning',
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }
+        `确定取消上传文件${obj.name}?`,
+        { type: 'warning' }
       ).then(() => {
         console.log(`${obj.name}已取消`)
         files.splice(index, 1)

+ 1 - 6
src/views/bigscreen/core/base.js

@@ -232,12 +232,7 @@ export default {
       if (warning) {
         return this.$confirm(
           `${warning},确定保存?`,
-          '提示',
-          {
-            type: 'warning',
-            confirmButtonText: '确定',
-            cancelButtonText: '取消'
-          }
+          { type: 'warning' }
         )
       }
       return Promise.resolve()

+ 2 - 7
src/views/bigscreen/core/components/ContentMenu.vue

@@ -82,12 +82,7 @@ export default {
     deleteLayer () {
       this.$confirm(
         '确定删除所选图层?',
-        '提示',
-        {
-          type: 'warning',
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }
+        { type: 'warning' }
       ).then(() => {
         this.$emit('delete')
         this.$message({
@@ -122,7 +117,7 @@ export default {
   padding: 0;
   list-style: none;
   color: #bcc9d4;
-  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
+  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
   background-color: #27343e;
   z-index: 99999;
 

+ 2 - 12
src/views/bigscreen/designer/index.vue

@@ -495,12 +495,7 @@ export default {
     clear () {
       this.$confirm(
         '清空后所有数据将丢失,确定清空画布?',
-        '提示',
-        {
-          type: 'warning',
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }
+        { type: 'warning' }
       ).then(() => {
         this.tabIndex = 0
         this.selectedWidgetIndex = -1
@@ -696,12 +691,7 @@ export default {
     delAsset (index) {
       this.$confirm(
         '确定移除该数据?',
-        '提示',
-        {
-          type: 'warning',
-          confirmButtonText: '确定',
-          cancelButtonText: '取消'
-        }
+        { type: 'warning' }
       ).then(() => {
         this.sources.splice(index, 1)
       })

+ 1 - 6
src/views/device/remote/index.vue

@@ -363,12 +363,7 @@ export default {
       if (this.$devices?.length) {
         return this.$confirm(
           `确定将所选设备进行${tip}?`,
-          '提示',
-          {
-            type: 'warning',
-            confirmButtonText: '确定',
-            cancelButtonText: '取消'
-          }
+          { type: 'warning' }
         )
       }
       this.$message({