From 45838623f185bb6426b7a233f3ecb8924e520750 Mon Sep 17 00:00:00 2001
From: yuxc <653031404@qq.com>
Date: 星期二, 11 七月 2023 18:36:02 +0800
Subject: [PATCH] 1、主要对主数据修改的数据复制进行了修改。
---
Source/UBCS-WEB/src/views/modeling/cycle.vue | 250 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 196 insertions(+), 54 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/modeling/cycle.vue b/Source/UBCS-WEB/src/views/modeling/cycle.vue
index 4e3a4d6..7c171f6 100644
--- a/Source/UBCS-WEB/src/views/modeling/cycle.vue
+++ b/Source/UBCS-WEB/src/views/modeling/cycle.vue
@@ -1,66 +1,208 @@
<template>
- <div>
- <p>鐢熷懡鍛ㄦ湡妯″瀷</p>
- <el-button @click="tabs=!tabs">杞寲</el-button><br /><br />
- <avue-form @tab-click="handleTabClick" :option="option" v-model="form" @submit="handleSubmit">
- <template slot="group1Header">
- <h4>鑷畾涔夎〃澶�</h4>
- </template>
- </avue-form>
- </div>
+ <basic-container class="">
+ <avue-crud
+ :data="data"
+ :option="option"
+ :page="page"
+ :table-loading="loading"
+ @refresh-change="search"
+ @search-change="search('search', ...arguments)"
+ @search-reset="search('reset', ...arguments)"
+ >
+ <template slot-scope="scope" slot="menuLeft">
+ <el-button
+ type="primary"
+ icon="el-icon-plus"
+ size="small"
+ @click="openDialog('add', {})"
+ >鏂板</el-button
+ >
+ </template>
+ <template slot-scope="{ row, index }" slot="menu">
+ <el-button
+ type="text"
+ icon="el-icon-edit"
+ size="mini"
+ @click="openDialog('edit', row)"
+ >缂栬緫</el-button
+ >
+ <el-button
+ type="text"
+ icon="el-icon-view"
+ size="mini"
+ @click="openDialog('detail', row)"
+ >棰勮</el-button
+ >
+ </template></avue-crud
+ >
+ <el-dialog
+ :visible="visible"
+ :width="dialogWidth"
+ :title="title"
+ append-to-body
+ :before-close="
+ () => {
+ visible = false;
+ }
+ "
+ top="10vh"
+ >
+ <CycleFlow
+ v-if="visible"
+ class="cycle_flow"
+ :type="type"
+ :chart-data="rowData.data || {}"
+ :chart-data-node-items="flowChartNodeItems"
+ :rowData="rowData"
+ ref="vueFlowchartEditor"
+ @save-data="save"
+ />
+ <template #footer v-if="type !== 'detail'">
+ <el-button type="primary" size="mini" @click="submit">淇濆瓨</el-button>
+ <el-button type="" size="mini" @click="visible = false">鍙栨秷</el-button>
+ </template>
+ </el-dialog>
+ </basic-container>
</template>
<script>
+import API from "@/api/modeling/cycle";
+import CycleFlow from "@/components/flow-cycle/flowchartEditor.vue";
export default {
name: "cycle.vue",
- data(){
- return{
- tabs:true,
- form:{
- text:'鏂囨湰',
- text1:'鏂囨湰1',
- text2:'鏂囨湰2',
- text3:'鏂囨湰3',
+ components: { CycleFlow },
+ data() {
+ return {
+ form: {},
+ page: {
+ pageSize: 10,
+ total: 0,
+ currentPage: 1,
+ layout: "total, sizes, prev, pager, next, jumper"
},
- }
- },
- computed:{
- option(){
- return{
- tabs:this.tabs,
- tabsActive:2,
- column: [{
- label: '鍐呭1',
- prop: 'text1',
- }],
- group:[
+ option: {
+ searchMenuSpan: 12,
+ searchMenuPosition: "right",
+ border: true,
+ align: "center",
+ menuAlign: "center",
+ menu: true,
+ delBtn: false,
+ editBtn: false,
+ addBtn: false,
+ column: [
{
- icon:'el-icon-info',
- label: '鍒嗙粍1',
- prop: 'group1',
- column: [{
- label: '鍐呭1',
- prop: 'text1',
- }]
- },{
- icon:'el-icon-info',
- label: '鍒嗙粍2',
- prop: 'group2',
- column: [{
- label: '閫夐」鍗�2',
- prop: 'text2',
- }, {
- label: '閫夐」鍗�3',
- prop: 'text3',
- }]
- }
- ]
+ label: "缂栧彿",
+ prop: "id",
+ },
+ {
+ label: "鍚嶇О",
+ prop: "name",
+ search: true,
+ },
+ {
+ label: "璧峰鐘舵��",
+ prop: "startStatusName",
+ search: true,
+ },
+ {
+ label: "鎻忚堪",
+ prop: "description",
+ },
+ ],
+ },
+ data: [],
+ title: "棰勮鐢熷懡鍛ㄦ湡娴佺▼鍥�",
+ visible: false,
+ flowChartNodeItems: [],
+ rowData: {},
+ dialogWidth: "50%",
+ type: "detail",
+ loading: false,
+ };
+ },
+ created() {
+ this.search("search", {});
+ },
+ methods: {
+ search(type, params, done) {
+ if (type === "search") {
+ this.page.currentPage = 1;
+ } else if (type === "reset") {
+ this.page = {
+ pageSize: 10,
+ total: 0,
+ currentPage: 1,
+ };
}
- }
- }
-}
+ this.loading = true;
+ console.log(
+ Object.assign({}, params, this.page),
+ "Object.assign({}, params, this.page)"
+ );
+ const { limit, page } = this.page;
+ API.getList(Object.assign({}, params, { limit, page })).then((res) => {
+ this.loading = false;
+ this.data = res.data.data.records;
+ this.page.total = res.data.data.total;
+ this.loading = false;
+ done && done();
+ });
+ },
+ openDialog(type, row) {
+ if (type === "detail") {
+ this.title = "棰勮鐢熷懡鍛ㄦ湡娴佺▼鍥�";
+ this.dialogWidth = "50%";
+ } else if (type === "edit") {
+ this.title = "缂栬緫鐢熷懡鍛ㄦ湡娴佺▼鍥�";
+ this.dialogWidth = "95%";
+ } else if (type === "add") {
+ this.title = "鏂板鐢熷懡鍛ㄦ湡娴佺▼鍥�";
+ this.dialogWidth = "95%";
+ }
+ this.type = type;
+ this.rowData = row;
+ this.visible = true;
+ },
+ async submit() {
+ const newRowData = await this.$refs.vueFlowchartEditor.getNewRowData();
+ console.log(newRowData, 'newRowDatanewRowData');
+ if (!newRowData) {
+ return;
+ }
+ const flowData = this.$refs.vueFlowchartEditor.getFlowData();
+ let params = {
+ ...flowData,
+ ...newRowData
+ }
+ console.log(flowData, newRowData);
+ API.add(params).then(res => {
+ console.log(res, 'res');
+ })
+ },
+ },
+ watch: {
+ page: {
+ deep: true,
+ immediate: true,
+ handler(newV) {
+ this.page.page = newV.currentPage;
+ this.page.limit = newV.pageSize;
+ },
+ },
+ },
+};
</script>
-<style scoped>
-
+<style lang="scss" scoped>
+/deep/ .el-dialog__body {
+ padding: 0 20px;
+}
+.cycle_flow {
+ height: 600px !important;
+ display: flex;
+ flex-direction: column;
+ margin: 0;
+ padding: 0;
+}
</style>
--
Gitblit v1.9.3