|
@@ -7,9 +7,16 @@
|
|
|
*
|
|
|
-->
|
|
|
<script setup lang="ts">
|
|
|
+import Dialog from '@/components/common/CustomDialog.vue'
|
|
|
+
|
|
|
+import Table from '@/components/table/CustomTable.vue'
|
|
|
+
|
|
|
+import { useRequest } from '@/hooks/useRequest'
|
|
|
+import router from '@/router'
|
|
|
+import { useCommonStore } from '@/stores/useCommon'
|
|
|
import type { ReqConfig } from '@/types/dataAnalysis'
|
|
|
-import type { FormRules } from 'element-plus'
|
|
|
import type { DialogConfig } from '@/types/dialog'
|
|
|
+import { type FormField, FormFieldType } from '@/types/form'
|
|
|
import type {
|
|
|
QueryInfo,
|
|
|
SelectInfo,
|
|
@@ -18,18 +25,10 @@ import type {
|
|
|
TableToolsConfig
|
|
|
} from '@/types/table'
|
|
|
import { FilterType } from '@/types/table'
|
|
|
-import type { FormField } from '@/types/form'
|
|
|
-import { FormFieldType } from '@/types/form'
|
|
|
-
|
|
|
-import { useRequest } from '@/hooks/useRequest'
|
|
|
-import { useCommonStore } from '@/stores/useCommon'
|
|
|
import { FieldSpecialEffectType, TextType } from '@/types/tableText'
|
|
|
+import type { FormRules } from 'element-plus'
|
|
|
import { reactive, ref, watch } from 'vue'
|
|
|
|
|
|
-import Table from '@/components/table/CustomTable.vue'
|
|
|
-import Dialog from '@/components/common/CustomDialog.vue'
|
|
|
-import router from '@/router'
|
|
|
-
|
|
|
const { selectInfo } = useCommonStore()
|
|
|
|
|
|
const { AllApi } = useRequest()
|
|
@@ -180,7 +179,7 @@ const dialogRules = reactive<FormRules<typeof dialogRuleForm>>({
|
|
|
],
|
|
|
actionName: [
|
|
|
{ required: true, message: '事件名称是必填项', trigger: 'blur' },
|
|
|
- { min: 5, max: 20, message: '事件名称长度必须在5到20之间', trigger: 'blur' }
|
|
|
+ { min: 1, max: 20, message: '事件名称长度必须在1到20之间', trigger: 'blur' }
|
|
|
],
|
|
|
remark: [
|
|
|
{ required: false, message: '备注是可选项', trigger: 'blur' },
|
|
@@ -214,11 +213,7 @@ const FormFields: Array<FormField> = [
|
|
|
cnName: '事件名称',
|
|
|
type: FormFieldType.INPUT
|
|
|
},
|
|
|
- {
|
|
|
- name: 'remark',
|
|
|
- cnName: '备注',
|
|
|
- type: FormFieldType.RICHTEXT
|
|
|
- },
|
|
|
+
|
|
|
{
|
|
|
name: 'status',
|
|
|
cnName: '是否启用',
|
|
@@ -239,7 +234,28 @@ const FormFields: Array<FormField> = [
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'remark',
|
|
|
+ cnName: '备注',
|
|
|
+ type: FormFieldType.RICHTEXT
|
|
|
}
|
|
|
+ // {
|
|
|
+ // name: 'defaultTemplate',
|
|
|
+ // cnName: '默认模板',
|
|
|
+ // type: FormFieldType.SWITCH,
|
|
|
+ // otherOptions: {
|
|
|
+ // tip: () => {
|
|
|
+ // return ` {
|
|
|
+ // 选项ID:default_id
|
|
|
+ // 选项名称:default_name
|
|
|
+ // 选项状态:启用
|
|
|
+ // 选项类型:整数
|
|
|
+ // }`
|
|
|
+ // },
|
|
|
+ // placeholder: '启用后,将会在创建事件时,自动使用下方模板创建一个选项'
|
|
|
+ // }
|
|
|
+ // }
|
|
|
]
|
|
|
|
|
|
// 对话框需要的props
|
|
@@ -281,6 +297,12 @@ const addNewEvent = () => {
|
|
|
* 表单提交
|
|
|
*/
|
|
|
const subForm = () => {
|
|
|
+ // console.log(formData)
|
|
|
+ //
|
|
|
+ // const needTemplate = formData.defaultTemplate
|
|
|
+ // if (needTemplate) {
|
|
|
+ // const templateData = {}
|
|
|
+ // }
|
|
|
if (eventTable.value) {
|
|
|
eventTable.value.updateTableData()
|
|
|
}
|
|
@@ -324,14 +346,14 @@ defineExpose({
|
|
|
<el-table-column label="操作" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-text class="operationBtn" type="primary" @click="viewDetails(scope.row)"
|
|
|
- >详情</el-text
|
|
|
- >
|
|
|
+ >详情
|
|
|
+ </el-text>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</template>
|
|
|
</Table>
|
|
|
<div class="eventDialog">
|
|
|
- <Dialog ref="eventDialog" @form-submit="subForm" :config="dialogInfo"></Dialog>
|
|
|
+ <Dialog ref="eventDialog" @formSubmit="subForm" :config="dialogInfo"></Dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|