|
@@ -4,7 +4,7 @@
|
|
<MinHeader
|
|
<MinHeader
|
|
:is-auth="true"
|
|
:is-auth="true"
|
|
:is-statuser="true"
|
|
:is-statuser="true"
|
|
- @addForm="addServiceHandler"
|
|
|
|
|
|
+ @addForm="addServiceDialogShow"
|
|
>
|
|
>
|
|
<template #header>
|
|
<template #header>
|
|
<div class="status flex-wrap">
|
|
<div class="status flex-wrap">
|
|
@@ -23,24 +23,27 @@
|
|
:table-btn-group="tableBtnGroup"
|
|
:table-btn-group="tableBtnGroup"
|
|
btn-group-width="310px"
|
|
btn-group-width="310px"
|
|
:table-property="{ rowKey: 'ID' }"
|
|
:table-property="{ rowKey: 'ID' }"
|
|
- @btn-click="btnClickHandler"
|
|
|
|
|
|
+ @btn-click="tableButtonClickHandler"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
<Dialog
|
|
<Dialog
|
|
:width="serviceDialogWidth"
|
|
:width="serviceDialogWidth"
|
|
:flag="serviceDialogVisible"
|
|
:flag="serviceDialogVisible"
|
|
- :type="type"
|
|
|
|
|
|
+ :type="serviceDialogType"
|
|
:del-name="delName"
|
|
:del-name="delName"
|
|
:msg-title="msgTitle"
|
|
:msg-title="msgTitle"
|
|
- @delRest="delCancelHandler"
|
|
|
|
|
|
+ @del-remove="delSubmitHandler"
|
|
|
|
+ @del-rest="delDialogHide"
|
|
|
|
+ @submit-form="serviceSubmitHandler"
|
|
|
|
+ @reset-form="serviceDialogHide"
|
|
>
|
|
>
|
|
<el-form
|
|
<el-form
|
|
- ref="serviceForm"
|
|
|
|
|
|
+ ref="serviceFormRef"
|
|
class="service-form"
|
|
class="service-form"
|
|
:model="serviceForm"
|
|
:model="serviceForm"
|
|
:rules="serviceFormRules"
|
|
:rules="serviceFormRules"
|
|
label-position="right"
|
|
label-position="right"
|
|
- label-width="82px"
|
|
|
|
|
|
+ label-width="90px"
|
|
size="mini"
|
|
size="mini"
|
|
>
|
|
>
|
|
<el-row :gutter="36" type="flex">
|
|
<el-row :gutter="36" type="flex">
|
|
@@ -56,7 +59,7 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item
|
|
<el-form-item
|
|
label="前序输出编号"
|
|
label="前序输出编号"
|
|
- label-width="114px"
|
|
|
|
|
|
+ label-width="120px"
|
|
prop="serviceOutputID"
|
|
prop="serviceOutputID"
|
|
>
|
|
>
|
|
<el-input
|
|
<el-input
|
|
@@ -100,7 +103,7 @@
|
|
type="primary"
|
|
type="primary"
|
|
size="small"
|
|
size="small"
|
|
style="height: 28px; line-height: 0px"
|
|
style="height: 28px; line-height: 0px"
|
|
- @click="addDataSourceHandler"
|
|
|
|
|
|
+ @click="addDataSourceDialogShow"
|
|
>新增</el-button
|
|
>新增</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
@@ -108,7 +111,7 @@
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
<el-form-item
|
|
<el-form-item
|
|
label="数据来源对象"
|
|
label="数据来源对象"
|
|
- label-width="114px"
|
|
|
|
|
|
+ label-width="120px"
|
|
prop="sourceObjectName"
|
|
prop="sourceObjectName"
|
|
>
|
|
>
|
|
<el-input
|
|
<el-input
|
|
@@ -131,7 +134,7 @@
|
|
<el-form-item
|
|
<el-form-item
|
|
label="生命周期ID键名"
|
|
label="生命周期ID键名"
|
|
prop="lifeCycleCol"
|
|
prop="lifeCycleCol"
|
|
- label-width="114px"
|
|
|
|
|
|
+ label-width="120px"
|
|
>
|
|
>
|
|
<el-input
|
|
<el-input
|
|
v-model="serviceForm.lifeCycleCol"
|
|
v-model="serviceForm.lifeCycleCol"
|
|
@@ -269,11 +272,41 @@
|
|
</Dialog>
|
|
</Dialog>
|
|
<Dialog
|
|
<Dialog
|
|
type="add"
|
|
type="add"
|
|
- width="600px"
|
|
|
|
|
|
+ width="500px"
|
|
:flag="dataSourceDialogVisible"
|
|
:flag="dataSourceDialogVisible"
|
|
msg-title="新增数据来源"
|
|
msg-title="新增数据来源"
|
|
- @delRest="delCancelHandler"
|
|
|
|
- ></Dialog>
|
|
|
|
|
|
+ @submit-form="dataSourceSubmitHandler"
|
|
|
|
+ @reset-form="dataSourceDialogHide"
|
|
|
|
+ >
|
|
|
|
+ <el-form ref="sourceFormRef" label-width="100px" :model="sourceForm">
|
|
|
|
+ <el-form-item label="数据源名称">
|
|
|
|
+ <el-input v-model="sourceForm.dataSourceName" size="small" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="协议名称">
|
|
|
|
+ <el-select
|
|
|
|
+ size="small"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ v-model="sourceForm.protocolName"
|
|
|
|
+ placeholder="请选择活动区域"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="protocol in protocolList"
|
|
|
|
+ :key="protocol.protocolID"
|
|
|
|
+ :label="protocol.protocolName"
|
|
|
|
+ :value="protocol.protocolID"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="连接参数">
|
|
|
|
+ <el-input
|
|
|
|
+ size="small"
|
|
|
|
+ type="textarea"
|
|
|
|
+ rows="3"
|
|
|
|
+ v-model="sourceForm.connectConfig"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </Dialog>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -281,15 +314,65 @@
|
|
import DataTable from '@/components/tableTemp/index.vue'
|
|
import DataTable from '@/components/tableTemp/index.vue'
|
|
import MinHeader from '@/components/minheader/index.vue'
|
|
import MinHeader from '@/components/minheader/index.vue'
|
|
import Dialog from '@/components/dialog/index.vue'
|
|
import Dialog from '@/components/dialog/index.vue'
|
|
|
|
+import { ElMessage, FormInstance } from 'element-plus'
|
|
|
|
+import { Query } from '@/api/dataIntegration'
|
|
|
|
+import {
|
|
|
|
+ CommonTableColumn,
|
|
|
|
+ CommonQueryResult,
|
|
|
|
+ SelectOptionQueryResult,
|
|
|
|
+} from '~/common'
|
|
|
|
|
|
interface DataSource {
|
|
interface DataSource {
|
|
- dataSourceID: string
|
|
|
|
|
|
+ dataSourceID: string | number
|
|
dataSourceName: string
|
|
dataSourceName: string
|
|
}
|
|
}
|
|
|
|
+interface Protocol {
|
|
|
|
+ protocolID: string | number
|
|
|
|
+ protocolName: string
|
|
|
|
+}
|
|
|
|
|
|
// 表格
|
|
// 表格
|
|
-const tableColumns = ref([])
|
|
|
|
|
|
+const tableColumns = ref<CommonTableColumn[]>([])
|
|
const tableData = ref<any[]>([])
|
|
const tableData = ref<any[]>([])
|
|
|
|
+const page = ref(0)
|
|
|
|
+const noMore = ref(false)
|
|
|
|
+const rowTitle = ref('')
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getTableData()
|
|
|
|
+})
|
|
|
|
+const getTableData = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const {
|
|
|
|
+ code,
|
|
|
|
+ returnData: { columnSet, listValues },
|
|
|
|
+ message,
|
|
|
|
+ }: CommonQueryResult = await Query({
|
|
|
|
+ id: DATACONTENT_ID.sysServiceTable,
|
|
|
|
+ dataContent: [],
|
|
|
|
+ needPage: ++page.value,
|
|
|
|
+ })
|
|
|
|
+ if (Number(code) !== 0) {
|
|
|
|
+ throw new Error(message || '失败')
|
|
|
|
+ }
|
|
|
|
+ if (listValues.length === 0) {
|
|
|
|
+ page.value--
|
|
|
|
+ noMore.value = false
|
|
|
|
+ }
|
|
|
|
+ const titleColumn = columnSet.find(column => column.needShow === 1)
|
|
|
|
+ if (titleColumn) {
|
|
|
|
+ rowTitle.value = titleColumn.columnName
|
|
|
|
+ }
|
|
|
|
+ tableColumns.value = columnSet.map(column => ({
|
|
|
|
+ key: column.columnName,
|
|
|
|
+ label: column.columnLabel,
|
|
|
|
+ ...column,
|
|
|
|
+ }))
|
|
|
|
+ tableData.value.push(...listValues)
|
|
|
|
+ } catch (error: any) {
|
|
|
|
+ page.value--
|
|
|
|
+ ElMessage.error(error.message)
|
|
|
|
+ }
|
|
|
|
+}
|
|
const tableBtnGroup = [
|
|
const tableBtnGroup = [
|
|
{
|
|
{
|
|
name: '查看',
|
|
name: '查看',
|
|
@@ -312,23 +395,46 @@ const tableBtnGroup = [
|
|
param: 4,
|
|
param: 4,
|
|
},
|
|
},
|
|
]
|
|
]
|
|
-const btnClickHandler = (rowIndex: number, row: Object, param: number) => {}
|
|
|
|
|
|
+const tableButtonClickHandler = (
|
|
|
|
+ rowIndex: number,
|
|
|
|
+ row: object,
|
|
|
|
+ param: number
|
|
|
|
+) => {
|
|
|
|
+ switch (param) {
|
|
|
|
+ case 1:
|
|
|
|
+ break
|
|
|
|
+ case 2:
|
|
|
|
+ break
|
|
|
|
+ case 3:
|
|
|
|
+ break
|
|
|
|
+ case 4:
|
|
|
|
+ break
|
|
|
|
+ default:
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
-// 新增/删除-弹窗
|
|
|
|
|
|
+// 新增/删除服务-弹窗
|
|
const serviceDialogVisible = ref(false) // 弹窗开关
|
|
const serviceDialogVisible = ref(false) // 弹窗开关
|
|
-const type = ref('del') // 弹窗类型是否删除
|
|
|
|
|
|
+const serviceDialogType = ref('del') // 弹窗类型是否删除
|
|
const serviceDialogWidth = computed(() =>
|
|
const serviceDialogWidth = computed(() =>
|
|
- type.value === 'del' ? '600px' : '878px'
|
|
|
|
|
|
+ serviceDialogType.value === 'del' ? '600px' : '878px'
|
|
)
|
|
)
|
|
const delName = ref('') // 删除对象名
|
|
const delName = ref('') // 删除对象名
|
|
const msgTitle = '新增服务管理' // 新增弹窗-标题
|
|
const msgTitle = '新增服务管理' // 新增弹窗-标题
|
|
-const addServiceHandler = () => {
|
|
|
|
- type.value = 'add'
|
|
|
|
|
|
+const addServiceDialogShow = () => {
|
|
|
|
+ getSelectOptions(DATACONTENT_ID.dataSourceOptions)
|
|
|
|
+ serviceDialogType.value = 'add'
|
|
serviceDialogVisible.value = true
|
|
serviceDialogVisible.value = true
|
|
}
|
|
}
|
|
-const delCancelHandler = () => {}
|
|
|
|
-
|
|
|
|
|
|
+const delSubmitHandler = () => {}
|
|
|
|
+const delDialogHide = () => {}
|
|
|
|
+const serviceDialogHide = () => {
|
|
|
|
+ serviceFormRef.value?.resetFields()
|
|
|
|
+ serviceDialogVisible.value = false
|
|
|
|
+}
|
|
// 新增服务-表单
|
|
// 新增服务-表单
|
|
|
|
+const serviceFormRef = ref<FormInstance | null>(null)
|
|
const serviceForm = reactive({
|
|
const serviceForm = reactive({
|
|
serviceName: '',
|
|
serviceName: '',
|
|
serviceOutputID: null,
|
|
serviceOutputID: null,
|
|
@@ -361,11 +467,63 @@ const serviceFormRules = {
|
|
],
|
|
],
|
|
}
|
|
}
|
|
const dataSourceList = ref<DataSource[]>([])
|
|
const dataSourceList = ref<DataSource[]>([])
|
|
|
|
+const serviceSubmitHandler = () => {
|
|
|
|
+ serviceDialogHide()
|
|
|
|
+}
|
|
|
|
|
|
// 新增数据来源-弹窗
|
|
// 新增数据来源-弹窗
|
|
const dataSourceDialogVisible = ref(false)
|
|
const dataSourceDialogVisible = ref(false)
|
|
-const addDataSourceHandler = () => {}
|
|
|
|
|
|
+const addDataSourceDialogShow = () => {
|
|
|
|
+ getSelectOptions(DATACONTENT_ID.protocolOptions)
|
|
|
|
+ dataSourceDialogVisible.value = true
|
|
|
|
+}
|
|
|
|
+const dataSourceDialogHide = () => {
|
|
|
|
+ sourceFormRef.value?.resetFields()
|
|
|
|
+ dataSourceDialogVisible.value = false
|
|
|
|
+}
|
|
// 新增数据来源-表单
|
|
// 新增数据来源-表单
|
|
|
|
+const sourceFormRef = ref<FormInstance | null>(null)
|
|
|
|
+const sourceForm = reactive({
|
|
|
|
+ dataSourceName: '',
|
|
|
|
+ protocolName: '',
|
|
|
|
+ connectConfig: '',
|
|
|
|
+})
|
|
|
|
+const protocolList = ref<Protocol[]>([])
|
|
|
|
+const dataSourceSubmitHandler = () => {
|
|
|
|
+ dataSourceDialogHide()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const getSelectOptions = async (id: number) => {
|
|
|
|
+ try {
|
|
|
|
+ const {
|
|
|
|
+ code,
|
|
|
|
+ returnData: { listValues },
|
|
|
|
+ message,
|
|
|
|
+ }: SelectOptionQueryResult = await Query({
|
|
|
|
+ id,
|
|
|
|
+ dataContent: [],
|
|
|
|
+ })
|
|
|
|
+ if (Number(code) !== 0) {
|
|
|
|
+ throw new Error(message || '失败')
|
|
|
|
+ }
|
|
|
|
+ const options = listValues.map(item => ({
|
|
|
|
+ [item.setlabel]: item.k,
|
|
|
|
+ [item.setvalue]: item.v,
|
|
|
|
+ }))
|
|
|
|
+ switch (id) {
|
|
|
|
+ case DATACONTENT_ID.dataSourceOptions:
|
|
|
|
+ dataSourceList.value = options as DataSource[]
|
|
|
|
+ break
|
|
|
|
+ case DATACONTENT_ID.protocolOptions:
|
|
|
|
+ protocolList.value = options as Protocol[]
|
|
|
|
+ break
|
|
|
|
+ default:
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ } catch (error: any) {
|
|
|
|
+ ElMessage.error(error.message)
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.app-containers {
|
|
.app-containers {
|
|
@@ -405,6 +563,7 @@ const addDataSourceHandler = () => {}
|
|
.service-form:deep {
|
|
.service-form:deep {
|
|
display: flex;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
|
|
+ padding-left: 20px;
|
|
> .el-row {
|
|
> .el-row {
|
|
flex-wrap: wrap;
|
|
flex-wrap: wrap;
|
|
> .el-col .el-form-item {
|
|
> .el-col .el-form-item {
|
|
@@ -455,8 +614,10 @@ const addDataSourceHandler = () => {}
|
|
color: #101116;
|
|
color: #101116;
|
|
&::-webkit-outer-spin-button,
|
|
&::-webkit-outer-spin-button,
|
|
&::-webkit-inner-spin-button {
|
|
&::-webkit-inner-spin-button {
|
|
|
|
+ appearance: none;
|
|
-webkit-appearance: none !important;
|
|
-webkit-appearance: none !important;
|
|
&[type='number'] {
|
|
&[type='number'] {
|
|
|
|
+ appearance: textfield;
|
|
-moz-appearance: textfield !important;
|
|
-moz-appearance: textfield !important;
|
|
}
|
|
}
|
|
}
|
|
}
|