zhengnaiwen_citu пре 3 месеци
родитељ
комит
99d112b183

+ 53 - 76
src/views/salary/solution/components/solutionDetails.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-descriptions class="margin-top" :column="1" border>
+    <el-descriptions v-if="!onlyParam" class="margin-top" :column="1" border>
       <el-descriptions-item
         v-for="header in columnHeaders"
         :key="header.prop"
@@ -14,81 +14,54 @@
         </template>
       </el-descriptions-item>
     </el-descriptions>
-    <m-divider content-position="left">参数及公式</m-divider>
-      <el-tabs v-model="activeNames">
-        <!-- <template> -->
-          <el-tab-pane
-            v-for="(item, index) in rules"
-            :key="item.category"
-            :label="item.category"
-            :name="index.toString()"
-          >
-            <!-- <template> -->
-              <!-- <m-card shadow="never" > -->
-                <el-form label-width="100px">
-                  <el-form-item label="系数">
-                    <!-- <m-card shadow="never"> -->
-                      <el-descriptions
-                        :labelStyle="{ width: '180px'}"
-                        :column="1"
-                        border
-                      >
-                        <el-descriptions-item
-                          v-for="(calculateConfiguration, index) in item.calculateConfigurations"
-                          :key="index"
-                          :label="calculateConfiguration.name"
-                        >
-                          <template v-if="calculateConfiguration.valueCategory === 0">
-                            <el-tag size="small">{{ calculateConfiguration.value }}</el-tag>
-                          </template>
-                          <template v-else>
-                            <m-table
-                              clearHeader
-                              shadow="never"
-                              :headers="[
-                                { label: '名称', prop: 'name' },
-                                { label: '值', prop: 'value' }
-                              ]"
-                              :items="calculateConfiguration.value"
-                            >
-                            </m-table>
-                          </template>
-                        </el-descriptions-item>
-                      </el-descriptions>
-                    <!-- </m-card> -->
-                  </el-form-item>
-                  <!-- <el-form-item
-                    v-for="(calculateConfiguration, index) in item.calculateConfigurations"
-                    :key="index"
-                    :label="calculateConfiguration.name"
-                  >
-                    <template v-if="calculateConfiguration.valueCategory === 0">
-                      <el-tag>{{ calculateConfiguration.value }}</el-tag>
-                    </template>
-                    <template v-else>
-                      <m-table
-                        clearHeader
-                        shadow="never"
-                        :headers="[
-                          { label: '名称', prop: 'name' },
-                          { label: '值', prop: 'value' }
-                        ]"
-                        :items="calculateConfiguration.value"
-                      >
-                      </m-table>
-                    </template>
-                  </el-form-item> -->
-                  <el-form-item label="计算公式">
-                    <m-card shadow="never" :bodyStyle="{ maxHeight: '300px', overflow: 'auto' }">
-                      <div v-html="item.calculateFormulas?.[0]?.content"></div>
-                    </m-card>
-                  </el-form-item>
-                </el-form>
-              <!-- </m-card> -->
-            <!-- </template> -->
-          </el-tab-pane>
-        <!-- </template> -->
-      </el-tabs>
+    <m-divider v-if="!onlyParam" content-position="left">参数及公式</m-divider>
+    <el-tabs v-model="activeNames">
+      <el-tab-pane
+        v-for="(item, index) in rules"
+        :key="item.category"
+        :label="item.category"
+        :name="index.toString()"
+      >
+        <el-form label-width="100px">
+          <el-form-item label="系数">
+            <!-- <m-card shadow="never"> -->
+              <el-descriptions
+                :labelStyle="{ width: '180px'}"
+                :column="1"
+                border
+              >
+                <el-descriptions-item
+                  v-for="(calculateConfiguration, index) in item.calculateConfigurations"
+                  :key="index"
+                  :label="calculateConfiguration.name"
+                >
+                  <template v-if="calculateConfiguration.valueCategory === 0">
+                    <el-tag size="small">{{ calculateConfiguration.value }}</el-tag>
+                  </template>
+                  <template v-else>
+                    <m-table
+                      clearHeader
+                      shadow="never"
+                      :headers="[
+                        { label: '名称', prop: 'name' },
+                        { label: '值', prop: 'value' }
+                      ]"
+                      :items="calculateConfiguration.value"
+                    >
+                    </m-table>
+                  </template>
+                </el-descriptions-item>
+              </el-descriptions>
+            <!-- </m-card> -->
+          </el-form-item>
+          <el-form-item label="计算公式" v-if="!onlyParam">
+            <m-card shadow="never" :bodyStyle="{ maxHeight: '300px', overflow: 'auto' }">
+              <div v-html="item.calculateFormulas?.[0]?.content"></div>
+            </m-card>
+          </el-form-item>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
     <m-empty v-if="rules.length === 0"></m-empty>
   </div>
 </template>
@@ -100,6 +73,10 @@ export default {
     itemData: {
       type: Object,
       default: () => ({})
+    },
+    onlyParam: {
+      type: Boolean,
+      default: false
     }
   },
   data () {

+ 7 - 1
src/views/sandbox/sandboxDetails.vue

@@ -3,7 +3,7 @@
     <template #button-after>
       <slot name="button" :row="itemData"></slot>
     </template>
-    <SolutionDetails :item-data="itemData" v-loading="loading"></SolutionDetails>
+    <SolutionDetails :only-param="onlyParam" :item-data="itemData" v-loading="loading"></SolutionDetails>
   </m-dialog>
 </template>
 
@@ -14,6 +14,12 @@ import {
 } from '@/api/salary'
 export default {
   name: 'salarySolutionDetails',
+  props: {
+    onlyParam: {
+      type: Boolean,
+      default: false
+    }
+  },
   components: {
     SolutionDetails
   },

+ 2 - 2
src/views/sandbox/sandboxHistory.vue

@@ -15,13 +15,13 @@
         </div>
       </template>
       <template #actions="{ row }">
-        <m-button text type="primary" @click="onDetails(row)">查看规则</m-button>
+        <m-button text type="primary" @click="onDetails(row)">系数明细</m-button>
         <m-button text type="primary" @click="onResult(row)">查看结果</m-button>
         <m-button text type="success" @click="$emit('issue', itemData)">发布</m-button>
       </template>
     </m-table>
     <SandboxResult ref="sandboxResultRefs" append-to-body></SandboxResult>
-    <SandboxDetails ref="sandboxDetailsRefs" append-to-body></SandboxDetails>
+    <SandboxDetails :only-param="true" ref="sandboxDetailsRefs" append-to-body></SandboxDetails>
     <SandboxComparison ref="sandboxComparisonRefs" append-to-body></SandboxComparison>
   </m-dialog>
 </template>