|
@@ -29,11 +29,10 @@
|
|
<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, PaginationProps } from 'naive-ui';
|
|
import type { FormInst, FormItemRule, DataTableColumns, PaginationProps } from 'naive-ui';
|
|
-import { NButton, NTag, NInput } from 'naive-ui';
|
|
|
|
|
|
+import { NButton, NTag, NInput, NSelect } from 'naive-ui';
|
|
import { EditSelectBoxDataSource, EditSelectBoxIsShow, EditSelectBoxShowLine, EventIsShowOptions } from '@/constants';
|
|
import { EditSelectBoxDataSource, EditSelectBoxIsShow, EditSelectBoxShowLine, EventIsShowOptions } from '@/constants';
|
|
import { createRequiredFormRule } from '@/utils';
|
|
import { createRequiredFormRule } from '@/utils';
|
|
import { basicEventColumnName, fetchEventAdd, fetchEventEdit } from '@/service/api/event';
|
|
import { basicEventColumnName, fetchEventAdd, fetchEventEdit } from '@/service/api/event';
|
|
-import SelectBox from './select-box.vue';
|
|
|
|
export interface Props {
|
|
export interface Props {
|
|
/** 弹窗可见性 */
|
|
/** 弹窗可见性 */
|
|
visible: boolean;
|
|
visible: boolean;
|
|
@@ -205,8 +204,8 @@ const createColumns = (): DataTableColumns<RowField.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.cowFieldData,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.cowFieldData,
|
|
value: tableData.value[index].column_name,
|
|
value: tableData.value[index].column_name,
|
|
onUpdateTableValue(value: string) {
|
|
onUpdateTableValue(value: string) {
|
|
tableData.value[index].column_name = value;
|
|
tableData.value[index].column_name = value;
|
|
@@ -220,8 +219,8 @@ const createColumns = (): DataTableColumns<RowField.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.isRequired,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.isRequired,
|
|
value: tableData.value[index].is_required,
|
|
value: tableData.value[index].is_required,
|
|
onUpdateTableValue(value: number) {
|
|
onUpdateTableValue(value: number) {
|
|
tableData.value[index].is_required = value;
|
|
tableData.value[index].is_required = value;
|
|
@@ -235,8 +234,8 @@ const createColumns = (): DataTableColumns<RowField.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.dataSource,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.dataSource,
|
|
value: tableData.value[index].data_source,
|
|
value: tableData.value[index].data_source,
|
|
onUpdateTableValue(value: number) {
|
|
onUpdateTableValue(value: number) {
|
|
tableData.value[index].data_source = value;
|
|
tableData.value[index].data_source = value;
|
|
@@ -250,8 +249,8 @@ const createColumns = (): DataTableColumns<RowField.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.isList,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.isList,
|
|
value: tableData.value[index].is_list,
|
|
value: tableData.value[index].is_list,
|
|
onUpdateTableValue(value: number) {
|
|
onUpdateTableValue(value: number) {
|
|
tableData.value[index].is_list = value;
|
|
tableData.value[index].is_list = value;
|
|
@@ -265,10 +264,10 @@ const createColumns = (): DataTableColumns<RowField.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.isDetails,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.isDetails,
|
|
value: tableData.value[index].is_details,
|
|
value: tableData.value[index].is_details,
|
|
- onUpdateTableValue(value: number) {
|
|
|
|
|
|
+ onUpdateValue(value: number) {
|
|
tableData.value[index].is_details = value;
|
|
tableData.value[index].is_details = value;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -280,8 +279,8 @@ const createColumns = (): DataTableColumns<RowField.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.showLine,
|
|
|
|
|
|
+ return h(NSelect, {
|
|
|
|
+ options: selectBoxData.showLine,
|
|
value: tableData.value[index].show_line,
|
|
value: tableData.value[index].show_line,
|
|
onUpdateValue(value: number) {
|
|
onUpdateValue(value: number) {
|
|
tableData.value[index].show_line = value;
|
|
tableData.value[index].show_line = value;
|
|
@@ -298,7 +297,6 @@ const createColumns = (): DataTableColumns<RowField.Data> => [
|
|
h(
|
|
h(
|
|
NButton,
|
|
NButton,
|
|
{
|
|
{
|
|
- // 可在里面写按钮样式
|
|
|
|
text: true,
|
|
text: true,
|
|
style: { marginRight: '10px', color: 'red' },
|
|
style: { marginRight: '10px', color: 'red' },
|
|
onClick: () => deleteData(index) // 点击按钮后的回调
|
|
onClick: () => deleteData(index) // 点击按钮后的回调
|