|
@@ -30,7 +30,7 @@
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
import { ref, computed, reactive, watch, h } from 'vue';
|
|
import { ref, computed, reactive, watch, h } from 'vue';
|
|
import type { FormInst, FormItemRule, DataTableColumns } from 'naive-ui';
|
|
import type { FormInst, FormItemRule, DataTableColumns } from 'naive-ui';
|
|
-import { NButton, NTag, NInput, NInputNumber } from 'naive-ui';
|
|
|
|
|
|
+import { NButton, NTag, NInput, NInputNumber, NSelect } from 'naive-ui';
|
|
import {
|
|
import {
|
|
EditSelectBoxDataSource,
|
|
EditSelectBoxDataSource,
|
|
EditSelectBoxIsShow,
|
|
EditSelectBoxIsShow,
|
|
@@ -40,7 +40,6 @@ import {
|
|
} from '@/constants';
|
|
} from '@/constants';
|
|
import { createRequiredFormRule } from '@/utils';
|
|
import { createRequiredFormRule } from '@/utils';
|
|
import { basicEventList, fetchIndicatorsAdd, fetchIndicatorsEdit } from '@/service/api/event';
|
|
import { basicEventList, fetchIndicatorsAdd, fetchIndicatorsEdit } from '@/service/api/event';
|
|
-import SelectBox from '@/views/background/event/components/select-box.vue';
|
|
|
|
|
|
|
|
export interface Props {
|
|
export interface Props {
|
|
/** 弹窗可见性 */
|
|
/** 弹窗可见性 */
|
|
@@ -114,7 +113,7 @@ const createData = (): RowIndicators.Data[] => [
|
|
trigger_operation: 1,
|
|
trigger_operation: 1,
|
|
is_cumulative: 1,
|
|
is_cumulative: 1,
|
|
impact_mode: 1,
|
|
impact_mode: 1,
|
|
- impact_value: '0',
|
|
|
|
|
|
+ impact_value: 0,
|
|
start_time: 1
|
|
start_time: 1
|
|
}
|
|
}
|
|
];
|
|
];
|
|
@@ -171,10 +170,10 @@ const createColumns = (): DataTableColumns<RowIndicators.Data> => [
|
|
maxWidth: 300,
|
|
maxWidth: 300,
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
render(row, index) {
|
|
render(row, index) {
|
|
- return h(SelectBox, {
|
|
|
|
- fieldOptions: selectBoxData.cowEventData,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.cowEventData,
|
|
value: tableData.value[index].event_name,
|
|
value: tableData.value[index].event_name,
|
|
- onUpdateTableValue(value: string) {
|
|
|
|
|
|
+ onUpdateValue(value: string) {
|
|
tableData.value[index].event_name = value;
|
|
tableData.value[index].event_name = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -186,10 +185,10 @@ const createColumns = (): DataTableColumns<RowIndicators.Data> => [
|
|
maxWidth: 100,
|
|
maxWidth: 100,
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
render(row, index) {
|
|
render(row, index) {
|
|
- return h(SelectBox, {
|
|
|
|
- fieldOptions: selectBoxData.triggerOperation,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.triggerOperation,
|
|
value: tableData.value[index].trigger_operation,
|
|
value: tableData.value[index].trigger_operation,
|
|
- onUpdateTableValue(value: number) {
|
|
|
|
|
|
+ onUpdateValue(value: number) {
|
|
tableData.value[index].trigger_operation = value;
|
|
tableData.value[index].trigger_operation = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -201,10 +200,10 @@ const createColumns = (): DataTableColumns<RowIndicators.Data> => [
|
|
maxWidth: 200,
|
|
maxWidth: 200,
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
render(row, index) {
|
|
render(row, index) {
|
|
- return h(SelectBox, {
|
|
|
|
- fieldOptions: selectBoxData.isCumulative,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.isCumulative,
|
|
value: tableData.value[index].is_cumulative,
|
|
value: tableData.value[index].is_cumulative,
|
|
- onUpdateTableValue(value: number) {
|
|
|
|
|
|
+ onUpdateValue(value: number) {
|
|
tableData.value[index].is_cumulative = value;
|
|
tableData.value[index].is_cumulative = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -216,10 +215,10 @@ const createColumns = (): DataTableColumns<RowIndicators.Data> => [
|
|
maxWidth: 200,
|
|
maxWidth: 200,
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
render(row, index) {
|
|
render(row, index) {
|
|
- return h(SelectBox, {
|
|
|
|
- fieldOptions: selectBoxData.impactMode,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.impactMode,
|
|
value: tableData.value[index].impact_mode,
|
|
value: tableData.value[index].impact_mode,
|
|
- onUpdateTableValue(value: number) {
|
|
|
|
|
|
+ onUpdateValue(value: number) {
|
|
tableData.value[index].impact_mode = value;
|
|
tableData.value[index].impact_mode = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -231,9 +230,14 @@ const createColumns = (): DataTableColumns<RowIndicators.Data> => [
|
|
maxWidth: 100,
|
|
maxWidth: 100,
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
render(row, index) {
|
|
render(row, index) {
|
|
- return h(NInput, {
|
|
|
|
|
|
+ return h(NInputNumber, {
|
|
value: tableData.value[index].impact_value,
|
|
value: tableData.value[index].impact_value,
|
|
- onUpdateTableValue(value: string) {
|
|
|
|
|
|
+ showButton: false,
|
|
|
|
+ keyboard: {
|
|
|
|
+ ArrowDown: false,
|
|
|
|
+ ArrowUp: false
|
|
|
|
+ },
|
|
|
|
+ onUpdateValue(value) {
|
|
tableData.value[index].impact_value = value;
|
|
tableData.value[index].impact_value = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -245,8 +249,8 @@ const createColumns = (): DataTableColumns<RowIndicators.Data> => [
|
|
maxWidth: 200,
|
|
maxWidth: 200,
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
render(row, index) {
|
|
render(row, index) {
|
|
- return h(SelectBox, {
|
|
|
|
- fieldOptions: selectBoxData.startTime,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.startTime,
|
|
value: tableData.value[index].start_time,
|
|
value: tableData.value[index].start_time,
|
|
onUpdateValue(value: number) {
|
|
onUpdateValue(value: number) {
|
|
tableData.value[index].start_time = value;
|
|
tableData.value[index].start_time = value;
|