|
@@ -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>
|