浏览代码

优化dialog-confirm组件

songxy 11 月之前
父节点
当前提交
2f3bee8138

+ 17 - 20
client/src/views/OaSystem/components/DialogConfirm/index.vue

@@ -1,20 +1,19 @@
 <template>
-  <div class="dialog_confirm">
-    <el-dialog
-      title="提示"
-      v-model="visible"
-      :width="`${typeof width === 'number' ? width : parseInt(width)}px`"
-    >
-      <template v-if="footer" #footer>
-        <div class="my-header">
-          <el-button type="danger" @click="cancelHandler">{{ cancelButtonText }}</el-button>
-          <el-button type="primary" @click="confirmHandler">{{ confirmButtonText }}</el-button>
-        </div>
-      </template>
-      <p class="content" v-if="!$slots.content">{{ title }}</p>
-      <slot v-else name="content"></slot>
-    </el-dialog>
-  </div>
+  <el-dialog
+    title="提示"
+    append-to-body
+    v-model="visible"
+    :width="`${typeof width === 'number' ? width : parseInt(width)}px`"
+  >
+    <template v-if="footer" #footer>
+      <div class="my-header">
+        <el-button type="danger" @click="cancelHandler">{{ cancelButtonText }}</el-button>
+        <el-button type="primary" @click="confirmHandler">{{ confirmButtonText }}</el-button>
+      </div>
+    </template>
+    <p class="content" v-if="!$slots.content">{{ title }}</p>
+    <slot v-else name="content"></slot>
+  </el-dialog>
   <slotInstance name="reference" />
 </template>
 
@@ -69,9 +68,7 @@ const slotInstance = createSlot(slots)
 </script>
 
 <style lang="scss" scoped>
-.dialog_confirm {
-  .content {
-    font-size: 18px;
-  }
+.content {
+  font-size: 18px;
 }
 </style>

+ 1 - 0
client/src/views/OaSystem/officeCenter/mainOfficeCenter/index.vue

@@ -92,6 +92,7 @@
             color: '#233755',
             height: '50px'
           }"
+          :highlight-current-row="true"
           :cell-class-name="cellClassNameHandle"
           @row-dblclick="(item) => openFlowHandle(item, currentTab === '160' ? '160' : undefined)"
         >

+ 6 - 1
client/src/views/OaSystem/projectCenter/projectDetail/components/xmxx/ProjectMileStone.vue

@@ -170,7 +170,12 @@ const confirmHandle = (id: string, index: number) => {
             <el-button @click="handleFinish(scope.row, scope.$index + 1)" type="text"
               >{{ !scope.row.is_edit ? '编辑' : '保存' }}
             </el-button>
-            <dialog-confirm title="确定删除?" @confirm="confirmHandle(scope.row.id, scope.$index)">
+            <dialog-confirm
+              title="确定删除?"
+              confirmButtonText="确定"
+              cancelButtonText="取消"
+              @confirm="confirmHandle(scope.row.id, scope.$index)"
+            >
               <template #reference>
                 <el-button style="margin-left: 20px" type="text">刪除 </el-button>
               </template>