浏览代码

数据流程

zhengnaiwen_citu 1 月之前
父节点
当前提交
f12e542f1e

+ 170 - 0
src/router/routes.js

@@ -566,6 +566,49 @@ export default {
           metastr: '{"keepAlive":false,"allowClick":false,"enName":"Data Standard","editModules":false,"title":"数据标准","fullScreen":false,"target":false}',
           open: null
         },
+        {
+          meun: '',
+          code: '',
+          hidden: 0,
+          rootId: 2000,
+          icon: '',
+          remark: '',
+          type: 1,
+          title: '数据流程',
+          local: '',
+          path: '/data-governance/data-process',
+          urls: '',
+          children: [],
+          enName: 'Data Process',
+          id: 1191,
+          redirect: '',
+          level: 2,
+          openPath: '',
+          active: '',
+          label: '数据流程',
+          sort: 10,
+          parentId: 1187,
+          effectiveStatus: true,
+          parentName: 'data-governance',
+          component: 'dataGovernance/dataProcess',
+          meta: {
+            keepAlive: false,
+            allowClick: false,
+            roles: [],
+            enName: 'Data Process',
+            icon: '',
+            editModules: false,
+            title: '数据流程',
+            fullScreen: false,
+            target: false,
+            effectiveStatus: true
+          },
+          name: 'data-process',
+          style: '',
+          alwaysShow: 0,
+          metastr: '{"keepAlive":false,"allowClick":false,"enName":"Data Process","editModules":false,"title":"数据流程","fullScreen":false,"target":false}',
+          open: null
+        },
         {
           meun: '',
           code: '',
@@ -1920,6 +1963,133 @@ export default {
           metastr: '{"allowClick":true,"enName":"data Indicator","title":"数据标准","target":false}',
           open: null
         },
+        {
+          meun: '',
+          code: '',
+          hidden: 0,
+          rootId: 2001,
+          icon: '',
+          remark: '',
+          type: 0,
+          title: '数据流程',
+          local: '',
+          path: '/data-book/data-process',
+          urls: '',
+          children: [
+            {
+              meun: '',
+              code: '',
+              hidden: 1,
+              rootId: 2002,
+              icon: '',
+              remark: '',
+              type: 1,
+              title: '数据流程',
+              local: '',
+              path: '/data-book/data-process',
+              urls: '',
+              children: [],
+              enName: 'data process',
+              id: 1269,
+              redirect: '',
+              level: 3,
+              openPath: '',
+              active: '',
+              label: '数据流程',
+              sort: 1,
+              parentId: 2001,
+              effectiveStatus: true,
+              parentName: '',
+              component: 'dataBook/dataProcess',
+              meta: {
+                keepAlive: false,
+                allowClick: true,
+                roles: [],
+                enName: 'data process',
+                icon: '',
+                editModules: false,
+                title: '数据流程',
+                fullScreen: false,
+                target: false,
+                effectiveStatus: true
+              },
+              name: 'data-book-process-index',
+              style: '',
+              alwaysShow: 0,
+              metastr: '{"keepAlive":false,"allowClick":true,"enName":"data Indicator","editModules":false,"title":"数据标准","fullScreen":false,"target":false}',
+              open: null
+            },
+            {
+              meun: '',
+              code: '',
+              hidden: 1,
+              rootId: 1225,
+              icon: '',
+              remark: '',
+              type: 1,
+              title: '数据流程详情',
+              local: '',
+              path: '/data-book/data-process/details/:id/:name',
+              urls: '',
+              children: [],
+              enName: 'data process',
+              id: 1270,
+              redirect: '',
+              level: 3,
+              openPath: '',
+              active: '',
+              label: '数据流程详情',
+              sort: 10,
+              parentId: 2001,
+              effectiveStatus: true,
+              parentName: '',
+              component: 'dataBook/dataProcess/details',
+              meta: {
+                keepAlive: false,
+                allowClick: true,
+                roles: [],
+                enName: 'data process',
+                icon: '',
+                editModules: false,
+                title: '数据流程详情',
+                fullScreen: false,
+                target: false,
+                effectiveStatus: true
+              },
+              name: 'data-book-process-details',
+              style: '',
+              alwaysShow: 0,
+              metastr: '{"keepAlive":false,"allowClick":true,"enName":"data Indicator","editModules":false,"title":"数据标准详情","fullScreen":false,"target":false}',
+              open: null
+            }
+          ],
+          enName: 'data process',
+          id: 1202,
+          redirect: '',
+          level: 2,
+          openPath: '',
+          active: '',
+          label: '数据流程',
+          sort: 35,
+          parentId: 1225,
+          effectiveStatus: true,
+          parentName: '',
+          component: '',
+          meta: {
+            allowClick: true,
+            roles: [],
+            enName: 'data process',
+            icon: '',
+            title: '数据流程',
+            target: false,
+            effectiveStatus: true
+          },
+          name: 'data-book-process',
+          style: '',
+          alwaysShow: 0,
+          metastr: '{"allowClick":true,"enName":"data Indicator","title":"数据标准","target":false}',
+          open: null
+        },
         {
           meun: '',
           code: '',

+ 15 - 0
src/views/dataBook/dataProcess/index.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'dataProcess'
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 230 - 0
src/views/dataGovernance/dataProcess/components/edit.vue

@@ -0,0 +1,230 @@
+<template>
+  <div class="d-flex fullscreen" v-loading="loading">
+    <v-card style="width: 400px;" class="mr-3 fullHeight">
+      <v-banner>方案列表</v-banner>
+      <v-list>
+        <v-list-item
+          v-for="item in items"
+          :key="item.performanceSolutionId"
+        >
+          <v-list-item-content>
+            <v-list-item-title v-text="item.title"></v-list-item-title>
+          </v-list-item-content>
+          <v-list-item-action>
+              <v-btn
+                text
+                color="primary"
+                :disabled="item.performanceSolutionId === clickId"
+                @click.stop="onClick(item)"
+              >
+                查看方案
+              </v-btn>
+            </v-list-item-action>
+        </v-list-item>
+      </v-list>
+    </v-card>
+    <v-card class="width-auto">
+      <div class="pa-3 fullscreen">
+        <div class="fullscreen d-flex flex-column">
+          <template v-if="clickItem">
+            <div class="mb-3">
+              <v-tabs v-model="active">
+                <v-tab
+                  v-for="item in clickItem"
+                  :key="item.category"
+                >{{ item.category }}</v-tab>
+              </v-tabs>
+            </div>
+            <v-card outlined class="height-auto">
+              <div class="fullHeight d-flex">
+                <div>
+                  <v-tabs v-model="tab" vertical>
+                    <v-tab>计算规则</v-tab>
+                    <v-tab>参数</v-tab>
+                  </v-tabs>
+                </div>
+                <div class="pa-3 width-auto">
+                  <div class="fullscreen overflow-y-auto">
+                    <v-tabs-items v-model="tab">
+                      <v-tab-item>
+                        <div v-html="ruleItem.calculateFormulas[0]?.content"></div>
+                      </v-tab-item>
+                      <v-tab-item class="pa-3">
+                        <v-expansion-panels
+                          v-model="panelActive"
+                          multiple
+                        >
+                          <v-expansion-panel
+                            v-for="(item,i) in ruleItem.calculateConfigurations"
+                            :key="i"
+                          >
+                            <v-expansion-panel-header>{{ item.name }}</v-expansion-panel-header>
+                            <v-expansion-panel-content>
+                              <div class="d-flex mb-3">
+                                <div>参数名称:</div>
+                                <div>{{ item.name }}</div>
+                              </div>
+                              <div class="d-flex">
+                                <div>参数值:</div>
+                                <div>
+                                  <template v-if="item.valueCategory === 0">
+                                    {{ item.value }}
+                                  </template>
+                                  <template v-else>
+                                    <v-card outlined>
+                                      <v-simple-table style="min-width: 500px;">
+                                        <template v-slot:default>
+                                          <thead>
+                                            <tr>
+                                              <th class="text-left"> 名称 </th>
+                                              <th class="text-left"> 值 </th>
+                                            </tr>
+                                          </thead>
+                                          <tbody>
+                                            <tr
+                                              v-for="val in JSON.parse(item.value)"
+                                              :key="val.name"
+                                            >
+                                              <td>{{ val.name }}</td>
+                                              <td>{{ val.value }}</td>
+                                            </tr>
+                                          </tbody>
+                                        </template>
+                                      </v-simple-table>
+                                    </v-card>
+                                  </template>
+                                </div>
+                              </div>
+                            </v-expansion-panel-content>
+                          </v-expansion-panel>
+                        </v-expansion-panels>
+                      </v-tab-item>
+                    </v-tabs-items>
+                  </div>
+                </div>
+              </div>
+            </v-card>
+          </template>
+          <div class="height-auto" v-else>
+            <none-page></none-page>
+          </div>
+          <div class="mt-3">
+            <v-textarea
+              v-model="code"
+              outlined
+              hide-details
+              label="请输入执行代码"
+              dense
+            ></v-textarea>
+          </div>
+        </div>
+      </div>
+    </v-card>
+  </div>
+</template>
+
+<script>
+import NonePage from '@/components/Common/empty.vue'
+import axios from 'axios'
+export default {
+  name: 'editPage',
+  components: {
+    NonePage
+  },
+  data () {
+    return {
+      loading: false,
+      items: [],
+      rulesItems: [],
+      active: 0,
+      tab: 0,
+      panelActive: [],
+      clickItem: null,
+      clickId: null
+    }
+  },
+  computed: {
+    ruleItem () {
+      if (!this.clickItem) {
+        return {
+          calculateFormulas: [],
+          calculateConfigurations: []
+        }
+      }
+      return this.clickItem[this.active]
+    }
+  },
+  created () {
+    this.init()
+  },
+  methods: {
+    async init () {
+      try {
+        this.loading = true
+        const { data } = await this.fetchData('/op/base/performance/solution/page', {
+          page: {
+            size: 999,
+            current: 1
+          }
+        })
+        this.items = data.records.map(e => e.entity)
+      } catch (err) {
+        this.items = []
+        this.$snackbar.error(err)
+      } finally {
+        this.loading = false
+      }
+    },
+    fetchData (url, params) {
+      return new Promise((resolve, reject) => {
+        axios.post(url, params, { // 配置对象
+          headers: {
+            'Content-Type': 'application/json'
+          },
+          timeout: 5000, // 超时时间(毫秒)
+          responseType: 'json' // 响应数据类型
+        }).then(res => {
+          const { data } = res
+          if (data.code !== 20000) {
+            reject(data.message)
+            return
+          }
+          resolve(data)
+        }).catch(reject)
+      })
+    },
+    async onClick (e) {
+      this.loading = true
+      try {
+        const { data } = await this.fetchData('/op/base/performance/solution/detail', {
+          performanceSolutionId: e.performanceSolutionId
+        })
+        this.clickId = data.entity.performanceSolutionId
+        this.clickItem = data.performanceSolutionDetailRespCategoryVos
+      } catch (error) {
+        this.$snackbar.error(error)
+      } finally {
+        this.loading = false
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.fullscreen {
+  height: 100%;
+  width: 100%;
+}
+.fullHeight {
+  height: 100%;
+}
+.width-auto {
+  width: 0;
+  flex: 1;
+}
+.height-auto {
+  height: 0;
+  flex: 1;
+}
+</style>

+ 110 - 0
src/views/dataGovernance/dataProcess/index.vue

@@ -0,0 +1,110 @@
+<template>
+  <div class="white pa-3">
+    <m-filter :option="filter" @search="handleSearch" />
+    <m-table
+      class="mt-3"
+      :loading="loading"
+      :headers="headers"
+      :items="items"
+      :total="total"
+      :page-info="pageInfo"
+      :show-select="false"
+      :can-delete="false"
+      @add="handleAdd"
+      @edit="handleEdit"
+      @delete="handleDelete"
+      @pageHandleChange="pageHandleChange"
+      @sort="handleSort"
+    >
+    </m-table>
+    <m-dialog :title="title" :visible.sync="show" showDrawer @submit="handleSubmit">
+      <edit-page v-if="show" ref="edit" :item-data="itemData"></edit-page>
+    </m-dialog>
+  </div>
+</template>
+
+<script>
+import MFilter from '@/components/Filter'
+import MTable from '@/components/List/table.vue'
+import MDialog from '@/components/Dialog'
+import EditPage from './components/edit'
+export default {
+  name: 'template-name',
+  components: { MFilter, MTable, MDialog, EditPage },
+  data () {
+    return {
+      loading: false,
+      show: false,
+      filter: {
+        list: [
+          { type: 'textField', value: '', label: '名称', key: 'name' },
+          { type: 'autocomplete', value: null, label: '选择', key: 'type', items: [] }
+        ]
+      },
+      queryData: {
+        name: null
+      },
+      headers: [
+        { text: '名称', align: 'start', value: 'name' }
+      ],
+      itemData: {},
+      items: [],
+      orders: [],
+      pageInfo: {
+        size: 10,
+        current: 1
+      },
+      total: 0
+    }
+  },
+  computed: {
+    title () {
+      return Object.keys(this.itemData).length ? '编辑' : '新增'
+    }
+  },
+  created () {
+    this.init()
+  },
+  methods: {
+    async init () {},
+    handleSearch (val) {
+      Object.assign(this.queryData, val)
+      this.pageInfo.current = 1
+      this.init()
+    },
+    handleAdd () {
+      this.itemData = {}
+      this.show = true
+    },
+    async handleEdit (item) {
+      this.itemData = item
+      this.show = true
+    },
+    handleDelete (ids) {
+      if (Array.isArray(ids) && !ids.length) return this.$snackbar.warning('请选择要删除的选项')
+      this.$confirm('提示', '是否删除该选项')
+        .then(async () => {
+          try {
+            this.$snackbar.success('删除成功')
+            this.init()
+          } catch (error) {
+            this.$snackbar.error('删除失败')
+          }
+        })
+    },
+    pageHandleChange (page) {
+      this.pageInfo.current = page
+      this.init()
+    },
+    handleSort (val) {
+      this.orders = val
+      this.init()
+    },
+    handleSubmit () {}
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>