Переглянути джерело

月报:部分模块局中对齐

洪海涛 4 роки тому
батько
коміт
01d139deb3

+ 1 - 1
src/views/monthlyReport/childrenPage/editReport/components/MrTable/index.vue

@@ -160,7 +160,7 @@
         </div>
       </div>
       <div v-else-if="item.displayType === 'Texterea'" :style="{cursor: item.name === '问题' && scope.row.operationTarget ? 'pointer' : 'auto'}" @click.stop="item.name === '问题' && pageType.search(/edit/) < 0 && goto(scope.row.operationTarget) || editLine(scope.row, index)">
-        <TextInfo :text="scope.row[item.headerKey]" />
+        <TextInfo :text-align="item.name" :text="scope.row[item.headerKey]" />
       </div>
       <div v-else>
         <span v-html="scope.row[item.headerKey]" />

+ 14 - 1
src/views/monthlyReport/childrenPage/editReport/components/TextInfo.vue

@@ -1,5 +1,5 @@
 <template>
-	<span v-if="text" style="text-align: left; display: block"><span v-html="text.replace(/\n/g, '<br />')" /></span>
+	<span v-if="text" style="text-align: left; display: block" :style="{textAlign: setTextAlign(textAlign)}"><span v-html="text.replace(/\n/g, '<br />')" /></span>
 </template>
 <script>
 export default {
@@ -9,6 +9,19 @@ export default {
       type: String,
       required: false,
       default: ''
+    },
+    textAlign: {
+      type: String,
+      required: false,
+      default: ''
+    }
+  },
+  methods: {
+    setTextAlign(name) {
+      if (name.search(/天数|模块/) > -1) {
+        return 'center'
+      }
+      return 'left'
     }
   }
 }