Przeglądaj źródła

[Feat 0000]预警分析模块下使用级联组件

bobo04052021@163.com 4 miesięcy temu
rodzic
commit
f276664658

+ 5 - 80
src/views/analysis/warningAnalysis/autoFireAnalysis/index.vue

@@ -74,95 +74,20 @@ const minesData = ref([]);
 const [registerTable] = useTable({
   dataSource: minesData,
   columns,
+  api: getProvinceAlarm,
   formConfig: {
     labelWidth: 120,
     schemas: [
       {
-        label: '查询煤矿',
-        field: 'mineCode',
-        component: 'Select',
-        defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
-        componentProps: {
-          showSearch: true,
-          filterOption: (input: string, option: any) => {
-            return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-          },
-          options: deviceOptions,
-          onChange: async (e, option) => {
-            await fetchAlarmData(e);
-          },
-        },
-        colProps: {
-          span: 6,
-        },
-      },
-      {
-        field: 'mineName',
-        label: '所属执法处',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
-        label: '所属区域',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
         label: '煤矿名称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineNameAbbr',
-        label: '煤矿简称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'productStatus',
-        label: '生产状态',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '拟建矿井', value: '0' },
-            { label: '正常生产矿井', value: '1' },
-            { label: '长期停产矿井', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'riskLevel',
-        label: '自燃情况',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: 'Ⅰ类容易自燃', value: '0' },
-            { label: 'Ⅱ类自燃', value: '1' },
-            { label: 'Ⅲ类不易自燃', value: '2' },
-          ],
-        },
+        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
+        rules: [],
       },
     ],
     showAdvancedButton: false,
-    schemaGroupNames: ['常规查询', '高级查询'],
+    schemaGroupNames: ['常规查询'],
   },
   pagination: false,
   striped: false,

+ 4 - 79
src/views/analysis/warningAnalysis/fireAreaJudgeAnalysis/index.vue

@@ -74,91 +74,16 @@ const minesData = ref([]);
 const [registerTable] = useTable({
   dataSource: minesData,
   columns,
+  api: getProvinceAlarm,
   formConfig: {
     labelWidth: 120,
     schemas: [
       {
-        label: '查询煤矿',
-        field: 'mineCode',
-        component: 'Select',
-        defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
-        componentProps: {
-          showSearch: true,
-          filterOption: (input: string, option: any) => {
-            return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-          },
-          options: deviceOptions,
-          onChange: async (e, option) => {
-            await fetchAlarmData(e);
-          },
-        },
-        colProps: {
-          span: 6,
-        },
-      },
-      {
-        field: 'mineName',
-        label: '所属执法处',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
-        label: '所属区域',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
         label: '煤矿名称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineNameAbbr',
-        label: '煤矿简称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'productStatus',
-        label: '生产状态',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '拟建矿井', value: '0' },
-            { label: '正常生产矿井', value: '1' },
-            { label: '长期停产矿井', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'riskLevel',
-        label: '自燃情况',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: 'Ⅰ类容易自燃', value: '0' },
-            { label: 'Ⅱ类自燃', value: '1' },
-            { label: 'Ⅲ类不易自燃', value: '2' },
-          ],
-        },
+        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
+        rules: [],
       },
     ],
     showAdvancedButton: false,

+ 4 - 79
src/views/analysis/warningAnalysis/overlimitAlarm/index.vue

@@ -75,91 +75,16 @@ const minesData = ref([]);
 const [registerTable] = useTable({
   dataSource: minesData,
   columns,
+  api: getProvinceAlarm,
   formConfig: {
     labelWidth: 120,
     schemas: [
       {
-        label: '查询煤矿',
-        field: 'mineCode',
-        component: 'Select',
-        defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
-        componentProps: {
-          showSearch: true,
-          filterOption: (input: string, option: any) => {
-            return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-          },
-          options: deviceOptions,
-          onChange: async (e, option) => {
-            await fetchAlarmData(e);
-          },
-        },
-        colProps: {
-          span: 6,
-        },
-      },
-      {
-        field: 'mineName',
-        label: '所属执法处',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
-        label: '所属区域',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
         label: '煤矿名称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineNameAbbr',
-        label: '煤矿简称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'productStatus',
-        label: '生产状态',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '拟建矿井', value: '0' },
-            { label: '正常生产矿井', value: '1' },
-            { label: '长期停产矿井', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'riskLevel',
-        label: '自燃情况',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: 'Ⅰ类容易自燃', value: '0' },
-            { label: 'Ⅱ类自燃', value: '1' },
-            { label: 'Ⅲ类不易自燃', value: '2' },
-          ],
-        },
+        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
+        rules: [],
       },
     ],
     showAdvancedButton: false,

+ 4 - 79
src/views/analysis/warningAnalysis/pressureDiffAnalysis/index.vue

@@ -93,91 +93,16 @@ const minesData = ref([]);
 const [registerTable] = useTable({
   dataSource: minesData,
   columns,
+  api: getProvinceAlarm,
   formConfig: {
     labelWidth: 120,
     schemas: [
       {
-        label: '查询煤矿',
-        field: 'mineCode',
-        component: 'Select',
-        defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
-        componentProps: {
-          showSearch: true,
-          filterOption: (input: string, option: any) => {
-            return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-          },
-          options: deviceOptions,
-          onChange: async (e, option) => {
-            await fetchAlarmData(e);
-          },
-        },
-        colProps: {
-          span: 6,
-        },
-      },
-      {
-        field: 'mineName',
-        label: '所属执法处',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
-        label: '所属区域',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
         label: '煤矿名称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineNameAbbr',
-        label: '煤矿简称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'productStatus',
-        label: '生产状态',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '拟建矿井', value: '0' },
-            { label: '正常生产矿井', value: '1' },
-            { label: '长期停产矿井', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'riskLevel',
-        label: '自燃情况',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: 'Ⅰ类容易自燃', value: '0' },
-            { label: 'Ⅱ类自燃', value: '1' },
-            { label: 'Ⅲ类不易自燃', value: '2' },
-          ],
-        },
+        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
+        rules: [],
       },
     ],
     showAdvancedButton: false,

+ 4 - 79
src/views/analysis/warningAnalysis/sealRiskJudgeAnalysis/index.vue

@@ -77,91 +77,16 @@ const minesData = ref([]);
 const [registerTable] = useTable({
   dataSource: minesData,
   columns,
+  api: getProvinceAlarm,
   formConfig: {
     labelWidth: 120,
     schemas: [
       {
-        label: '查询煤矿',
-        field: 'mineCode',
-        component: 'Select',
-        defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
-        componentProps: {
-          showSearch: true,
-          filterOption: (input: string, option: any) => {
-            return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
-          },
-          options: deviceOptions,
-          onChange: async (e, option) => {
-            await fetchAlarmData(e);
-          },
-        },
-        colProps: {
-          span: 6,
-        },
-      },
-      {
-        field: 'mineName',
-        label: '所属执法处',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
-        label: '所属区域',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '执法一处', value: '0' },
-            { label: '执法二处', value: '1' },
-            { label: '执法三处', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineName',
         label: '煤矿名称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'mineNameAbbr',
-        label: '煤矿简称',
-        component: 'Input',
-        colProps: { span: 6 },
-      },
-      {
-        field: 'productStatus',
-        label: '生产状态',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: '拟建矿井', value: '0' },
-            { label: '正常生产矿井', value: '1' },
-            { label: '长期停产矿井', value: '2' },
-          ],
-        },
-        colProps: { span: 6 },
-      },
-      {
-        field: 'riskLevel',
-        label: '自燃情况',
-        component: 'Select',
-        componentProps: {
-          options: [
-            { label: 'Ⅰ类容易自燃', value: '0' },
-            { label: 'Ⅱ类自燃', value: '1' },
-            { label: 'Ⅲ类不易自燃', value: '2' },
-          ],
-        },
+        field: 'mineCode', // 对应组件的value.mineCode(最终传给Table的查询参数)
+        component: 'MineCascader', // 自定义组件名
         colProps: { span: 6 },
+        rules: [],
       },
     ],
     showAdvancedButton: false,