瀏覽代碼

流程设置页面

l1069030731 2 年之前
父節點
當前提交
929ef838e1

+ 55 - 0
src/api/process/processNode.js

@@ -0,0 +1,55 @@
+import request from '@/router/axios'
+
+// 流程设置-列表
+export function processList(data = {}) {
+  return request({
+    url: '/api/service-flow/processTenant/page',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 流程设置-明细
+export function processDetails(data = {}) {
+  return request({
+    url: '/api/service-flow/processTenant/getDetails',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 流程设置-添加
+export function processAdd(data = {}) {
+  return request({
+    url: '/api/service-flow/processTenant/add',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 流程设置-新建版本
+export function processAddVersion(data = {}) {
+  return request({
+    url: '/api/service-flow/processTenant/addVersion',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 流程设置-获取指定流程版本号
+export function processGetVersionByProcessInfoId(data = {}) {
+  return request({
+    url: '/api/service-flow/processTenant/getVersionByProcessInfoId',
+    method: 'post',
+    data: data,
+  })
+}
+
+// 流程设置-切换版本
+export function processEditVersion(data = {}) {
+  return request({
+    url: '/api/service-flow/processTenant/editVersion',
+    method: 'post',
+    data: data,
+  })
+}

+ 9 - 9
src/page/index/index.vue

@@ -19,9 +19,9 @@
         <!-- 主体视图层 -->
         <div style="height:100%;overflow-y:auto;overflow-x:hidden;" id="avue-view" v-show="!isSearch">
           <keep-alive>
-            <router-view class="avue-view" v-if="$route.meta.keepAlive" />
+            <router-view class="avue-view" v-if="$route.meta.keepAlive" :key="$route.fullPath" />
           </keep-alive>
-          <router-view class="avue-view" v-if="!$route.meta.keepAlive" />
+          <router-view class="avue-view" v-if="!$route.meta.keepAlive" :key="$route.fullPath" />
         </div>
       </div>
     </div>
@@ -45,12 +45,12 @@ export default {
     top,
     tags,
     search,
-    sidebar
+    sidebar,
   },
   name: 'index',
   provide() {
     return {
-      index: this
+      index: this,
     }
   },
   data() {
@@ -60,7 +60,7 @@ export default {
       //刷新token锁
       refreshLock: false,
       //刷新token的时间
-      refreshTime: ''
+      refreshTime: '',
     }
   },
   created() {
@@ -88,7 +88,7 @@ export default {
     },
     //打开菜单
     openMenu(item = {}) {
-      this.$store.dispatch('GetMenu', item.id).then(data => {
+      this.$store.dispatch('GetMenu', item.id).then((data) => {
         if (data.length !== 0) {
           this.$router.$avueRouter.formatRoutes(data, true)
         }
@@ -121,7 +121,7 @@ export default {
         const token =
           getStore({
             name: 'token',
-            debug: true
+            debug: true,
           }) || {}
         const date = calcDate(token.datetime, new Date().getTime())
         if (validatenull(date)) return
@@ -137,7 +137,7 @@ export default {
             })
         }
       }, 10000)
-    }
-  }
+    },
+  },
 }
 </script>

+ 1 - 1
src/router/page/index.js

@@ -80,7 +80,7 @@ export default [
         props: true,
       },
       {
-        path: '/nodeConfig/:id',
+        path: '/nodeConfig',
         name: '节点配置',
         component: () => import(/* webpackChunkName: "page" */ '@/views/process/processNode/nodeConfig'),
         props: true,

+ 1 - 1
src/views/process/generalProcess/index.vue

@@ -4,7 +4,7 @@
       <el-col :span="24">
         <el-card class="box-card">
           <div slot="header">
-            <span>{{ $t('process.processList') }}</span>
+            <span>{{ $t('process.generalProcessList') }}</span>
           </div>
           <from-render ref="req" v-model="req" :form-config="queryForm"></from-render>
 

+ 230 - 221
src/views/process/processNode/index.vue

@@ -1,242 +1,251 @@
 <template>
-    <div class="video-setting">
-      <el-row>
-        <el-col :span="24">
-          <el-card class="box-card">
-            <div slot="header">
-                <span>{{$t('process.processList')}}</span>
-            </div>
-            <from-render ref="req" v-model="req" :form-config="queryForm"></from-render>
-        
-            <el-table :data="tableList" v-loading="loading">
-              <el-table-column :label="$t('process.generalProcess.serviceName')" align="center" prop="serviceName" />
-              <el-table-column :label="$t('process.generalProcess.moduleName')" align="center" prop="moduleName" />
-              <el-table-column :label="$t('process.generalProcess.codeName')" align="center" prop="code" />
-              <!-- <el-table-column :label="$t('operation')" align="center" width="80">
-                <template slot-scope="scope">
-                  <el-button type="text" @click="handleDelete(scope.row)">{{ $t('delete') }} </el-button>
-                </template>
-              </el-table-column> -->
-            </el-table>
-            <pagination v-show="total > 0" :total="total" :page.sync="req.pageNum" :limit.sync="req.pageSize" @pagination="getList" />
-            <el-dialog :title="$t('process.generalProcess.add')" :visible.sync="open" width="30%">
-              <from-render ref="form" v-model="dialogParams" :form-config="dialogForm" :insideRules="dialogRules"></from-render>
-            </el-dialog>
-          </el-card>
-        </el-col>
-      </el-row>
-    </div>
-  </template>
-  <script>
-  import * as API from '@/api/process/generalProcess.js'
-  import fromRender from '@/components/form-test/index.vue'
+  <div class="video-setting">
+    <el-row>
+      <el-col :span="24">
+        <el-card class="box-card">
+          <div slot="header">
+            <span>{{ $t('process.processList') }}</span>
+          </div>
+          <from-render ref="req" v-model="req" :form-config="queryForm"></from-render>
 
-  export default {
-    name: 'equipment-management',
-    components: { fromRender },
-    data() {
-      return {
-        
-        req: {
-          pageNum: 1,
-          pageSize: 10,
-          keyword: '',
-          serviceName: '',
-        },
-        
-        queryForm: {
-          keyword: {
-            label: this.$t('keyword'),
-            span: 4,
-          },
-          serviceName: {
-            span: 4,
-            label: this.$t('process.generalProcess.serviceName'),
-            type: 'select',
-            data: [],
-            keyName: 'id',
-            labelName: 'name',
-          },
-          operation: {
-            // 搜索按钮操作
-            query: () => {
-              this.req.pageNum = 1
-              this.getList()
-            },
-            // 重置按钮操作
-            reset: () => {
-              this.$refs.req.reset()
-              this.getList()
-            },
-          },
-          otherButton: {
-            list: [
-              {
-                name: this.$t('process.generalProcess.add'),
-                methodsText: 'add',
-                type: 'primary',
-                add: () => {
-                  this.open = true
-                },
-              },
-            ],
-          },
+          <el-table :data="tableList" v-loading="loading">
+            <el-table-column :label="$t('process.generalProcess.serviceName')" prop="serviceName" width="300" />
+            <el-table-column :label="$t('process.generalProcess.moduleName')" prop="moduleName" width="300" />
+            <el-table-column :label="$t('process.generalProcess.codeName')" prop="name" />
+            <el-table-column :label="$t('process.generalProcess.version')" align="center" width="120">
+              <template slot-scope="scope">
+                <span style="color: #409eff; cursor: pointer">v{{ scope.row.versionNumber }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column :label="$t('operation')" align="center" width="140">
+              <template slot-scope="scope">
+                <el-button type="text" @click="handleNewVersion(scope.row)">{{ $t('process.generalProcess.newVersion') }}</el-button>
+                <el-button type="text" @click="handleModify(scope.row)">{{ $t('process.generalProcess.modify') }}</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <pagination v-show="total > 0" :total="total" :page.sync="req.pageNum" :limit.sync="req.pageSize" @pagination="getList" />
+
+          <el-dialog :title="$t('process.generalProcess.add')" :visible.sync="open" width="30%">
+            <from-render ref="form" v-model="dialogParams" :form-config="dialogForm" :insideRules="dialogRules"></from-render>
+          </el-dialog>
+        </el-card>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script>
+import * as API from '@/api/process/processNode.js'
+import { getServiceNameList, processInfoList } from '@/api/process/generalProcess.js'
+import fromRender from '@/components/form-test/index.vue'
+
+export default {
+  name: 'equipment-management',
+  components: { fromRender },
+  data() {
+    return {
+      req: {
+        pageNum: 1,
+        pageSize: 10,
+        keyword: '',
+        serviceName: '',
+      },
+      queryForm: {
+        keyword: {
+          label: this.$t('keyword'),
+          span: 4,
         },
-        tableList: [],
-        total: 0,
-        loading: false,
-        open: false,
-        title: '',
-        dialogParams: {
-          fileInfoList: '',
-          videoClassifyId: '',
-          title: '',
-          richText: '',
+        serviceName: {
+          span: 4,
+          label: this.$t('process.generalProcess.serviceName'),
+          type: 'select',
+          data: [],
+          keyName: 'id',
+          labelName: 'name',
         },
-        dialogForm: {
-          loadingStatus: false,
-          serviceName: {
-            label: this.$t('process.generalProcess.serviceName'),
-            type: 'select',
-            data: [],
-            keyName: 'id',
-            labelName: 'name',
-          },
-          moduleName: {
-            label: this.$t('process.generalProcess.moduleName'),
-            type: 'input',
-          },
-          flowName: {
-            label: this.$t('process.generalProcess.flowName'),
-            type: 'input',
-          },
-          code: {
-            label: this.$t('process.generalProcess.code'),
-            span: 2,
+        operation: {
+          // 搜索按钮操作
+          query: () => {
+            this.req.pageNum = 1
+            this.getList()
           },
-          otherButton: {
-            align: 'center',
-            list: [
-              {
-                name: this.$t('cancelText'),
-                methodsText: 'cancel',
-                cancel: () => {
-                  this.$refs.form.reset()
-                  this.open = false
-                },
-              },
-              {
-                name: this.$t('submitText'),
-                methodsText: 'submit',
-                type: 'primary',
-                submit: () => {
-                  this.handleSubmit()
-                },
-              },
-            ],
+          // 重置按钮操作
+          reset: () => {
+            this.$refs.req.reset()
+            this.getList()
           },
         },
-        dialogRules: {
-          serviceName: [{ required: true, message: this.$t('process.generalProcess.serviceNameRules'), trigger: 'change' }],
-          code: [{ required: true, message: this.$t('process.generalProcess.codeRules'), trigger: 'blur' }],
-          moduleName: [{ required: true, message: this.$t('process.generalProcess.moduleNameRules'), trigger: 'blur' }],
-          flowName: [{ required: true, message: this.$t('process.generalProcess.flowNameRules'), trigger: 'blur' }],
+        otherButton: {
+          list: [
+            {
+              name: this.$t('process.generalProcess.add'),
+              methodsText: 'add',
+              type: 'primary',
+              add: () => {
+                this.open = true
+              },
+            },
+          ],
         },
-      }
-    },
-    created() {
-      //this.getSelectList()
-    },
-    mounted() {
-      this.getList()
-      this.getServiceNameList()
-    },
-    watch: {
-      
-    },
-    methods: {
-      getServiceNameList(){
-        API.getServiceNameList({}).then(
-          (res) => {
-            const listData = []
-            for (let i = 0; i < res.data.data.length; i++) {
-              const element = res.data.data[i];
-              listData.push({
-                name:element,
-                id:element
-              })
-            }
-            this.dialogForm.serviceName.data = listData
-            this.queryForm.serviceName.data = listData
-          },
-          
-        )
       },
-      reload(row){
-        console.log(row)
-        this.req.pageNum = 1
-        this.req.classifyId = row.id
-        this.getList()
+      tableList: [],
+      total: 0,
+      loading: false,
+      open: false,
+      title: '',
+      dialogParams: {
+        serviceName: '',
+        processInfoId: '',
+        name: '',
       },
-      getList() {
-        this.loading = true
-        API.page(this.req).then(
-          (res) => {
-            this.total = res.data.data.total
-            this.tableList = res.data.data.records
-            this.loading = false
+      dialogForm: {
+        loadingStatus: false,
+        serviceName: {
+          label: this.$t('process.generalProcess.serviceName'),
+          type: 'select',
+          data: [],
+          keyName: 'id',
+          labelName: 'name',
+          change: (val) => {
+            this.dialogParams.processInfoId = ''
+            processInfoList({ serviceName: val }).then((res) => {
+              this.dialogForm.processInfoId.data = res.data.data.map((item) => {
+                return {
+                  id: item.id,
+                  name: item.moduleName,
+                  flowName: item.flowName,
+                }
+              })
+            })
           },
-          (err) => {
-            console.log('tdaDevicePage: ' + err)
-            this.loading = false
+        },
+        processInfoId: {
+          label: this.$t('process.generalProcess.moduleName'),
+          type: 'select',
+          data: [],
+          keyName: 'id',
+          labelName: 'name',
+          change: (val) => {
+            let data = this.dialogForm.processInfoId.data.filter((item) => item.id === val)
+            if (data && data.length > 0) {
+              this.dialogParams.name = data[0].flowName
+            }
           },
-        )
-      },
-      handleSubmit() {
-        this.$refs.form.$refs['form'].validate((valid) => {
-          if (valid) {
-            this.dialogForm.loadingStatus = true
-            API.add(this.dialogParams).then(
-              () => {
-                this.msgSuccess(this.$t('addSuccess'))
+        },
+        name: {
+          label: this.$t('process.generalProcess.flowName'),
+          type: 'input',
+        },
+        otherButton: {
+          align: 'center',
+          list: [
+            {
+              name: this.$t('cancelText'),
+              methodsText: 'cancel',
+              cancel: () => {
                 this.$refs.form.reset()
                 this.open = false
-                this.dialogForm.loadingStatus = false
-                this.getList()
               },
-              (err) => {
-                console.log('tdaDeviceAdd: ' + err)
-                this.dialogForm.loadingStatus = false
+            },
+            {
+              name: this.$t('submitText'),
+              methodsText: 'submit',
+              type: 'primary',
+              submit: () => {
+                this.handleSubmit()
               },
-            )
-            // } else {
-            //   setTimeout(() => {
-            //     const errorDiv = document.getElementsByClassName('is-error')
-            //     errorDiv[0].scrollIntoView()
-            //   }, 0)
-          }
-        })
+            },
+          ],
+        },
       },
-      handleDelete(row) {
-        this.$confirm(this.$t('askDeleteData'), {
-          confirmButtonText: this.$t('submitText'),
-          cancelButtonText: this.$t('cancelText'),
-          type: 'warning',
-        }).then(() => {
-          API.dlt({ id: row.id }).then(() => {
-            this.msgSuccess(this.$t('deleteSuccess'))
-            this.getList()
-          })
-        })
+      dialogRules: {
+        serviceName: [{ required: true, message: this.$t('process.generalProcess.serviceNameRules'), trigger: 'change' }],
+        processInfoId: [{ required: true, message: this.$t('process.generalProcess.moduleNameRules'), trigger: 'blur' }],
+        name: [{ required: true, message: this.$t('process.generalProcess.flowNameRules'), trigger: 'blur' }],
       },
+    }
+  },
+  created() {
+    this.getServiceName()
+  },
+  mounted() {
+    this.getList()
+  },
+  watch: {},
+  methods: {
+    getServiceName() {
+      getServiceNameList({}).then((res) => {
+        const listData = []
+        for (let i = 0; i < res.data.data.length; i++) {
+          const element = res.data.data[i]
+          listData.push({
+            name: element,
+            id: element,
+          })
+        }
+        this.dialogForm.serviceName.data = listData
+        this.queryForm.serviceName.data = listData
+      })
     },
-  }
-  </script>
+    getList() {
+      this.loading = true
+      API.processList({
+        ...this.req,
+        bindingTenantId: '000000',
+      }).then(
+        (res) => {
+          this.total = res.data.data.total
+          this.tableList = res.data.data.records
+          this.loading = false
+        },
+        (err) => {
+          console.log('processList: ' + err)
+          this.loading = false
+        },
+      )
+    },
+    handleSubmit() {
+      this.$refs.form.$refs['form'].validate((valid) => {
+        if (valid) {
+          this.dialogForm.loadingStatus = true
+          API.processAdd({
+            ...this.dialogParams,
+            bindingTenantId: '000000',
+          }).then(
+            () => {
+              this.msgSuccess(this.$t('addSuccess'))
+              this.$refs.form.reset()
+              this.open = false
+              this.dialogForm.loadingStatus = false
+              this.getList()
+            },
+            (err) => {
+              console.log('processAdd: ' + err)
+              this.dialogForm.loadingStatus = false
+            },
+          )
+        }
+      })
+    },
+    handleNewVersion(row) {
+      console.log(row)
+    },
+    handleModify(row) {
+      this.$router.push({
+        path: '/nodeConfig',
+        query: {
+          id: row.id,
+        },
+      })
+    },
+  },
+}
+</script>
   
   <style lang="scss" scoped>
-
-  .box-card {
-    height: calc(100vh - 110px);
-    overflow-y: auto;
-  }
-  </style>
+.box-card {
+  height: calc(100vh - 60px);
+  overflow-y: auto;
+}
+</style>