Przeglądaj źródła

[Style 0000] 嵌套表格无数据显示内容样式优化与算法页面样式优化

houzekong 2 miesięcy temu
rodzic
commit
3bb936d5f1

+ 4 - 2
src/layouts/default/feature/SimpleMap.vue

@@ -129,9 +129,10 @@
     const node: any = last(historyStack.value);
     if (!node) return;
 
-    appStore.setSimpleMapParams({ deptId: node.id, isLeaf: node.isLeaf });
+    // 避免依赖isLeaf的首页进入矿端模式
+    appStore.setSimpleMapParams({ deptId: node.id, isLeaf: false });
 
-    // 标点点击后,如果是叶节点需要显示CAD图
+    // 标点点击后,如果是叶节点需要显示详情框,点击标题后进CAD图
     if (!node.isLeaf) {
       map.setFilter(CIRCLE_LAYER_ID, ['==', node.id, ['get', 'parentId']]);
       map.setFilter(SYMBOL_LAYER_ID, ['==', node.id, ['get', 'parentId']]);
@@ -148,6 +149,7 @@
         node,
         callback() {
           toggleCADMap(true, node).then(() => {
+            appStore.setSimpleMapParams({ deptId: node.id, isLeaf: true });
             // 将历史栈推一个进去,因为用户要点击返回上一级时需要
             historyStack.value.push(node);
           });

+ 1 - 0
src/views/dashboard/basicInfo/minesInfo/index.vue

@@ -22,6 +22,7 @@
               <SvgIcon name="edit" />
             </button>
           </template> -->
+        <template #emptyText> 暂无数据 </template>
       </BasicTable>
     </template>
   </BasicTable>

+ 17 - 17
src/views/system/algorithm/algorithm.data.ts

@@ -287,7 +287,7 @@ export const schemasCoalExpression: FormSchema[] = [
   {
     label: '规则名称:',
     field: 'ruleName',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
 
     colProps: { span: 24 },
@@ -295,13 +295,13 @@ export const schemasCoalExpression: FormSchema[] = [
   {
     field: 'm1',
     label: '密闭内外压差变化风险提示模型',
-    // labelWidth: 110,
+    // labelWidth: 140,
     component: 'Divider',
   },
   {
     field: 'ycWarn1',
     label: '预警等级(Ⅰ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
     // required: true,
@@ -309,35 +309,35 @@ export const schemasCoalExpression: FormSchema[] = [
   {
     field: 'ycWarn2',
     label: '预警等级(Ⅱ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'ycWarn3',
     label: '预警等级(Ⅲ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'ycWarn4',
     label: '预警等级(Ⅳ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'm2',
     label: '闭内煤自燃发火隐患分级预警模型',
-    // labelWidth: 110,
+    // labelWidth: 140,
     component: 'Divider',
   },
   {
     field: 'fireWarn1',
     label: '预警等级(Ⅰ):',
     suffix: '',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
@@ -345,7 +345,7 @@ export const schemasCoalExpression: FormSchema[] = [
     field: 'fireWarn2',
     label: '预警等级(Ⅱ):',
     suffix: '',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
@@ -353,7 +353,7 @@ export const schemasCoalExpression: FormSchema[] = [
     field: 'fireWarn3',
     label: '预警等级(Ⅲ):',
     suffix: '',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
@@ -361,48 +361,48 @@ export const schemasCoalExpression: FormSchema[] = [
     field: 'fireWarn4',
     label: '预警等级(Ⅳ):',
     suffix: '',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'm3',
     label: '闭外煤自燃发火隐患分级预警模型',
-    // labelWidth: 110,
+    // labelWidth: 140,
     component: 'Divider',
   },
   {
     field: 'fireOutWarn1',
     label: '预警等级(Ⅰ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'fireOutWarn2',
     label: '预警等级(Ⅱ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'fireOutWarn3',
     label: '预警等级(Ⅲ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'fireOutWarn4',
     label: '预警等级(Ⅳ):',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },
   {
     field: 'openWarn',
     label: '火区密闭启封判定:',
-    labelWidth: 118,
+    labelWidth: 140,
     component: 'Input',
     slot: 'relation',
   },

+ 4 - 3
src/views/system/algorithm/components/RelationBuilder.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="relation-builder">
     <div class="w-full flex justify-between mb-10px" v-if="compact">
-      <a-space style="width: calc(100% - 100px)" wrap>
+      <a-space :style="{ width: `calc(100% - ${isOperator ? '100' : '0'}px)` }" wrap>
         <template v-for="(item, index) in items" :key="index">
           <a-input-number v-if="item.type === 'number'" v-model:value="item.value" style="width: 30px" placeholder="-" @blur="confirm" />
           <a-tag v-if="item.type === 'operand' || item.type === 'logic' || item.type === 'operator'" :color="tagColors[item.type]" class="expr-tag">
@@ -9,7 +9,7 @@
           </a-tag>
         </template>
       </a-space>
-      <a-button class="w-100px" type="primary" @click="enterAdvancedMode"> 高级编辑 </a-button>
+      <a-button v-if="isOperator" class="w-100px" type="primary" @click="enterAdvancedMode"> 高级编辑 </a-button>
     </div>
     <a-row v-else :gutter="8">
       <!-- 左侧:元素库 -->
@@ -131,6 +131,7 @@
   }
 
   // 常量配置
+  const isOperator = ref(false);
   const activeKey = ref<string[]>(['gas', 'operator', 'logic', 'number', 'paren']);
 
   const templateOptions = ref([
@@ -604,7 +605,7 @@
     emit('change', finalExpr);
     emit('confirm', finalExpr);
     inputString.value = finalExpr;
-    message.success('已提交');
+    message.success('已更新');
   };
 
   // 重置

+ 8 - 43
src/views/system/algorithm/index.vue

@@ -13,6 +13,7 @@
       </template> -->
       <template #expandedRowRender>
         <BasicTable @register="registerInnerTable">
+          <template #emptyText> 暂无数据 </template>
           <template #action="{ record }">
             <button @click="handleEdit(record, 'goaf')" class="action-btn" title="编辑">
               <SvgIcon name="edit" />
@@ -52,42 +53,6 @@
   </Flex>
   <BasicModal width="60%" @register="registerModal" @ok="handleSubmit" title="预警参数设置">
     <BasicForm v-if="modalSign === 'coal'" @register="registerCoalForm">
-      <template #InputRangeNumber="{ model, field, schema }">
-        <a-form-item>
-          <a-input-group>
-            <a-input-number v-model:value="model[`${field}Start`]" style="width: calc(50% - 100px)" placeholder="-" />
-            <a-input style="width: 200px; border-left: 0; pointer-events: none; color: inherit" :value="schema.groupName" disabled />
-            <a-input-number v-model:value="model[`${field}End`]" style="width: calc(50% - 100px); border-left: 0" placeholder="-" />
-          </a-input-group>
-        </a-form-item>
-      </template>
-      <template #InputGreaterNumber="{ model, field, schema }">
-        <a-form-item>
-          <a-input-group>
-            <a-input-number style="width: calc(50% - 100px)" placeholder="-" disabled />
-            <a-input style="width: 200px; border-left: 0; pointer-events: none; color: inherit" :value="schema.groupName" disabled />
-            <a-input-number v-model:value="model[field]" style="width: calc(50% - 100px); border-left: 0" placeholder="-" />
-          </a-input-group>
-        </a-form-item>
-      </template>
-      <template #InputLowerNumber="{ model, field, schema }">
-        <a-form-item>
-          <a-input-group>
-            <a-input-number v-model:value="model[field]" style="width: calc(50% - 100px)" placeholder="-" />
-            <a-input style="width: 200px; border-left: 0; pointer-events: none; color: inherit" :value="schema.groupName" disabled />
-            <a-input-number style="width: calc(50% - 100px); border-left: 0" placeholder="-" disabled />
-          </a-input-group>
-        </a-form-item>
-      </template>
-      <template #InputRangeGoaf="{ model, field, schema }">
-        <a-form-item v-if="model[field]">
-          <a-input-group>
-            <a-input-number v-model:value="model[field][`lowerLimit`]" style="width: calc(50% - 100px)" placeholder="-" />
-            <a-input style="width: 200px; border-left: 0; pointer-events: none; color: inherit" :value="schema.groupName" disabled />
-            <a-input-number v-model:value="model[field][`upperLimit`]" style="width: calc(50% - 100px); border-left: 0" placeholder="-" />
-          </a-input-group>
-        </a-form-item>
-      </template>
       <template #relation="{ model, field }">
         <RelationBuilder class="h-full" v-model="model[field]" />
       </template>
@@ -132,29 +97,29 @@
     schemasCoalExpression,
     schemasGoafLimit,
     searchFormSchema,
-    limitationModel,
+    // limitationModel,
     schemasGoafInfo,
   } from './algorithm.data';
   import {
-    addCoalSeamAlarmRule,
+    // addCoalSeamAlarmRule,
     deleteCoalSeamAlarmRule,
     deleteGoafDataLimit,
     getCoalSeam,
     getGoafList,
-    updateCoalSeamAlarmRule,
+    // updateCoalSeamAlarmRule,
     getCoalSeamAlarmRule,
-    getGoafDataLimit,
-    patchGoafDataLimit,
+    // getGoafDataLimit,
+    // patchGoafDataLimit,
     patchCoalSeamAlarmRule,
     patchCoalLimit,
     patchGoafLimit,
     updateGoaf,
-    fetchGoafLimit,
+    // fetchGoafLimit,
     fetchCoalLimit,
   } from './algorithm.api';
   import { Flex } from 'ant-design-vue';
   // import { PlusOutlined } from '@ant-design/icons-vue';
-  import { forEach, last, isString } from 'lodash-es';
+  import { last, isString } from 'lodash-es';
   import { message } from 'ant-design-vue';
   import { SvgIcon } from '/@/components/Icon';
   import RelationBuilder from './components/RelationBuilder.vue';