| | |
| | | data
|
| | | })
|
| | | }
|
| | | // 修改
|
| | | export const edit = (data) => {
|
| | | return request({
|
| | | url: '/api/ubcs-omd/lifeCycle/edit-save',
|
| | | method: 'put',
|
| | | data
|
| | | })
|
| | | }
|
| | | export const detail = (params) => {
|
| | | return request({
|
| | | url: '/api/ubcs-omd/lifeCycle/detail',
|
| | |
| | | params
|
| | | })
|
| | | }
|
| | | // 删除
|
| | | export const del = (data, isBatch) => {
|
| | | let url = '/api/ubcs-omd/lifeCycle/remove'
|
| | | if (isBatch) {
|
| | | url = '/api/ubcs-omd/lifeCycle/batch-remove'
|
| | | }
|
| | | return request({
|
| | | url,
|
| | | method: 'post',
|
| | | data
|
| | | })
|
| | | }
|
| | | export default {
|
| | | getList,
|
| | | add,
|
| | | detail
|
| | | detail,
|
| | | del,
|
| | | edit
|
| | | }
|
| | |
| | | border
|
| | | :data="tab1Table"
|
| | | style="width: 100%"
|
| | | height="400px"
|
| | | height="40vh"
|
| | | highlight-current-row
|
| | | @current-change="resembleRowChange"
|
| | | @selection-change="tab1TableSelectChange"
|
| | | v-if="cloNamesList.length > 1"
|
| | | v-loading="tab1Loading"
|
| | | >
|
| | | <el-table-column
|
| | | v-if="type !== 'batchApplyCode'"
|
| | |
| | | border
|
| | | :data="currentSelectedResemble"
|
| | | style="width: 100%"
|
| | | height="200px"
|
| | | height="20vh"
|
| | | v-loading="tab1BottomTableLoading"
|
| | | >
|
| | | <el-table-column
|
| | | v-for="item in resembleColumList"
|
| | |
| | | <el-tab-pane :label="tab2Name" name="tab2">
|
| | | <el-table
|
| | | border
|
| | | v-loading="tab2Loading"
|
| | | :data="tab2Table"
|
| | | :height="
|
| | | type === 'batchApplyCode' && tab2Table.length > 0
|
| | | ? '400px'
|
| | | : '700px'
|
| | | "
|
| | | height="60vh"
|
| | | >
|
| | | <el-table-column
|
| | | v-for="item in successTableColumns"
|
| | |
| | | </div>
|
| | | <template #footer>
|
| | | <div>
|
| | | <el-button size="small" type="primary" @click="submit"
|
| | | <el-button size="small" type="primary" @click="submit" :loading="submitLoading"
|
| | | >确定导入</el-button
|
| | | >
|
| | | <el-button size="small" @click="dialogVisible = false">取消</el-button>
|
| | |
| | | },
|
| | | batchApplyCodeTableData: {},
|
| | | savedList: [],
|
| | | tab1Loading: false,
|
| | | tab2Loading: false,
|
| | | tab1BottomTableLoading: false,
|
| | | submitLoading: false
|
| | | };
|
| | | },
|
| | |
|
| | |
| | | this.localCodeClassifyOid = data.codeClassifyOid;
|
| | | this.cloNamesList = data.cloNamesList;
|
| | | this.templateOid = data.oid;
|
| | | this.tab1Loading = true
|
| | | getResembleTable({
|
| | | codeClassifyOid:
|
| | | this.type === "batchApplyCode" ? data.codeRuleOid : this.templateOid,
|
| | | redisOid: this.redisOid + "-resemble",
|
| | | }).then((res) => {
|
| | | this.tab1Loading = false
|
| | | this.tab1Table = res.data.data.filter(
|
| | | (item) => !this.savedList.includes(item.oid)
|
| | | );
|
| | |
| | | this.tab1Table;
|
| | | }
|
| | | });
|
| | | this.tab2Loading = true
|
| | | // 获取正确数据
|
| | | getSuccessTable({
|
| | | codeClassifyOid:
|
| | | this.type === "batchApplyCode" ? data.codeRuleOid : this.templateOid,
|
| | | redisOid: this.redisOid + "-ok",
|
| | | }).then((res) => {
|
| | | this.tab2Loading = false
|
| | | this.tab2Table = res.data.data;
|
| | | if (this.tab2Table.length > 0 && this.type === "batchApplyCode") {
|
| | | this.batchApplyCodeTableData[data.codeRuleOid]["codeApply"] = {};
|
| | |
| | | if (!row || !row.oid) {
|
| | | return;
|
| | | }
|
| | | this.tab1BottomTableLoading = true
|
| | | getCurretnSelectedRowResemble({
|
| | | redisOid: this.redisOid + "-resemble-data",
|
| | | dataOid: row.oid,
|
| | | }).then((res) => {
|
| | | this.tab1BottomTableLoading = false
|
| | | this.currentSelectedResemble = res.data.data;
|
| | | });
|
| | | },
|
| | |
| | | },
|
| | | ];
|
| | | }
|
| | | this.submitLoading = true
|
| | | submitHistoryimport(params).then((res) => {
|
| | | console.log(res);
|
| | | this.submitLoading = false
|
| | | console.log(res);
|
| | | if (res.data.code === 200) {
|
| | | this.$message.success(res.data.msg);
|
| | | } else {
|
| | | this.$message.error(res.data.msg);
|
| | | }
|
| | | });
|
| | | },
|
| | |
| | | }
|
| | | }
|
| | | .right {
|
| | | transition: all 0.5s;
|
| | | margin-left: 20px;
|
| | | margin-top: 30px;
|
| | | }
|
| | |
| | | if (uniqueFlag === 'CODEEDIT') return this.editHandler() |
| | | if (uniqueFlag === 'CODEBATCHADD') return this.openBatchImport('batchImportApply') |
| | | if (uniqueFlag === 'CODEIMPORTHISTORY') return this.openBatchImport('historyImport') |
| | | if (uniqueFlag === 'batchApplyCode') return this.openBatchImport('batchApplyCode') |
| | | // 批量申请编码 |
| | | // if(uniqueFlag === 'CODEEDIT') return this.openBatchImport('batchApplyCode') |
| | | if (uniqueFlag === 'CODESTARTPROCESS') return this.setHandler() |
| | |
| | | <el-form-item label="名称" prop="name"> |
| | | <el-input v-model.trim="newRowData.name" :maxLength="20" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="标签" prop="id"> |
| | | <el-form-item label="编号" prop="id"> |
| | | <el-input v-model.trim="newRowData.id" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="起始状态" prop="startStatus"> |
| | | <el-select |
| | | v-model="newRowData.startStatus" |
| | | placeholder="请选择起始状态" |
| | | :disabled="type === 'edit'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | |
| | | <group-panel :status="status"> |
| | | <detail-form type="group" /> |
| | | </group-panel> |
| | | <multi-panel :status="status" /> |
| | | <canvas-panel :status="status" /> |
| | | <node-panel :status="status"> |
| | | <div class="event"> |
| | | <hr /> |
| | | <div class="btn_box"> |
| | | <el-button type="primary" size="mini">新增</el-button> |
| | | <el-button type="danger" size="mini">删除</el-button> |
| | | <el-button type="primary" size="mini">保存</el-button> |
| | | </div> |
| | | <div class="flex" v-for="(item, index) in eventList" :key="index" :class="{active: index === currentActive}"> |
| | | <el-select size="mini" style="width: 70%" v-if="item.isEdit"> |
| | | <el-option></el-option> |
| | | </el-select> |
| | | <span v-else style="width: 70%">{{item.evenName}}</span> |
| | | <el-button size="mini" type="text" class="red">删除</el-button> |
| | | <el-button size="mini" type="text" @click="editChange(item)">{{item.isEdit ? '暂存' : '编辑'}}</el-button> |
| | | </div> |
| | | </div> |
| | | </node-panel> |
| | | |
| | | <!-- <multi-panel :status="status" /> --> |
| | | <!-- <canvas-panel :status="status" /> --> |
| | | </template> |
| | | </detail-panel> |
| | | </div> |
| | |
| | | DetailPanel, |
| | | DetailForm, |
| | | }, |
| | | props: ["rowData", "existNodes"], |
| | | props: ["rowData", "existNodes", "type"], |
| | | data() { |
| | | return { |
| | | newRowData: { |
| | | startStatus: undefined, |
| | | name: undefined, |
| | | id: undefined, |
| | | remark: undefined |
| | | remark: undefined, |
| | | }, |
| | | rules: { |
| | | name: [{ required: true, message: "名称不能为空", trigger: "blur" }], |
| | | id: [ |
| | | { required: true, message: "标签不能为空", trigger: "blur" }, |
| | | { pattern: /^[A-z]+$/g, message: "标签只能输入英文", trigger: "blur" } |
| | | { |
| | | pattern: /^[A-z]+$/g, |
| | | message: "标签只能输入英文", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | startStatus: [ |
| | | { required: true, message: "起始状态不能为空", trigger: "change" }, |
| | | ], |
| | | }, |
| | | eventList: [{evenName: '123123'}], |
| | | currentActive: 0 |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | editChange(row) { |
| | | this.$set(row, 'isEdit', !row.isEdit) |
| | | } |
| | | }, |
| | | watch: { |
| | | rowData: { |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .event { |
| | | margin-top: 20px; |
| | | text-align: center; |
| | | } |
| | | .flex { |
| | | margin-top: 10px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .red { |
| | | color: red; |
| | | } |
| | | .active { |
| | | box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4) |
| | | } |
| | | </style> |
| | |
| | | </div> |
| | | <div class="vfe-chart-panel" v-if="type !== 'detail'"> |
| | | <div class="vfe-chart-panel-detail"> |
| | | <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" :existNodes="existNodes"/> |
| | | <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" :existNodes="existNodes" :type="type"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | tooltipShow: true, |
| | | tooltipData: [], |
| | | existNodes: [] |
| | | existNodes: this.chartData.nodes || [] |
| | | }; |
| | | }, |
| | | |
| | |
| | | width: 300px; |
| | | background-color: #fafafa; |
| | | border-left: 1px solid #e6e9ed; |
| | | overflow-y: scroll; |
| | | |
| | | .vfe-chart-panel-detail { |
| | | box-sizing: border-box; |
| | |
| | | :option="option" |
| | | :page="page" |
| | | :table-loading="loading" |
| | | selection |
| | | @size-change="search('size', ...arguments)" |
| | | @current-change="search('current', ...arguments)" |
| | | @refresh-change="search" |
| | | @search-change="search('search', ...arguments)" |
| | | @search-reset="search('reset', ...arguments)" |
| | | @selection-change="selectionChange" |
| | | > |
| | | <template slot-scope="scope" slot="menuLeft"> |
| | | <el-button |
| | |
| | | @click="openDialog('add', {})" |
| | | >新增</el-button |
| | | > |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | size="small" |
| | | @click="batchDel()" |
| | | v-if="selectedData.length > 0" |
| | | :loading="delLoading" |
| | | >删除</el-button |
| | | > |
| | | </template> |
| | | <template slot-scope="{ row, index }" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :loading="row.editLoading" |
| | | @click="openDialog('edit', row)" |
| | | >编辑</el-button |
| | | > |
| | |
| | | type="text" |
| | | icon="el-icon-view" |
| | | size="mini" |
| | | :loading="row.detailLoading" |
| | | @click="openDialog('detail', row)" |
| | | >预览</el-button |
| | | > |
| | | <el-button |
| | | class="btn_link_del" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :loading="row.delLoading" |
| | | @click="rowDel(row)" |
| | | >删除</el-button |
| | | > |
| | | </template></avue-crud |
| | | > |
| | |
| | | @save-data="save" |
| | | /> |
| | | <template #footer v-if="type !== 'detail'"> |
| | | <el-button type="primary" size="mini" @click="submit">保存</el-button> |
| | | <el-button |
| | | type="primary" |
| | | size="mini" |
| | | @click="submit" |
| | | :loading="submitLoading" |
| | | >保存</el-button |
| | | > |
| | | <el-button type="" size="mini" @click="visible = false">取消</el-button> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | components: { CycleFlow }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | form: { |
| | | // 'contionMap[id]': 'qwe' |
| | | // contionMap: [ |
| | | // {id: 'qwe'} |
| | | // ] |
| | | }, |
| | | page: { |
| | | pageSize: 10, |
| | | total: 0, |
| | |
| | | layout: "total, sizes, prev, pager, next, jumper", |
| | | }, |
| | | option: { |
| | | searchMenuSpan: 12, |
| | | selection: true, |
| | | searchMenuSpan: 6, |
| | | searchMenuPosition: "right", |
| | | border: true, |
| | | align: "center", |
| | |
| | | { |
| | | label: "编号", |
| | | prop: "id", |
| | | search: true, |
| | | }, |
| | | { |
| | | label: "名称", |
| | |
| | | }, |
| | | { |
| | | label: "起始状态", |
| | | prop: "startStatusName", |
| | | prop: "startStatus", |
| | | search: true, |
| | | }, |
| | | { |
| | |
| | | dialogWidth: "50%", |
| | | type: "detail", |
| | | loading: false, |
| | | delLoading: false, |
| | | submitLoading: false, |
| | | selectedData: [], |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | total: 0, |
| | | currentPage: 1, |
| | | }; |
| | | } else if (type === "size") { |
| | | this.page.pageSize = params; |
| | | } else if (type === "current") { |
| | | this.page.currentPage = params; |
| | | } |
| | | this.loading = true; |
| | | const { limit, page } = this.page; |
| | | API.getList(Object.assign({}, params, { limit, page })).then((res) => { |
| | | API.getList( |
| | | Object.assign({}, params, { |
| | | size: this.page.pageSize, |
| | | current: this.page.currentPage, |
| | | }) |
| | | ).then((res) => { |
| | | this.loading = false; |
| | | this.data = res.data.data.records; |
| | | this.page.total = res.data.data.total; |
| | |
| | | this.$set(row, "detailLoading", false); |
| | | this.$set(row, "editLoading", false); |
| | | this.rowData = row; |
| | | this.nodesEdgesData = {nodes: res.nodes, edges: res.edges} |
| | | const nodes = res.data.data.nodes.map((item) => { |
| | | item.label = item.id; |
| | | item.index = item.indexNum; |
| | | return item; |
| | | }); |
| | | const edges = res.data.data.edges.map((item) => { |
| | | item.label = item.name; |
| | | item.width = 80; |
| | | item.height = 48; |
| | | item.index = 1; |
| | | item.index = item.indexNum; |
| | | return item; |
| | | }); |
| | | this.nodesEdgesData = { nodes, edges }; |
| | | this.visible = true; |
| | | }); |
| | | } else { |
| | | this.nodesEdgesData = {}; |
| | | this.rowData = {}; |
| | | this.title = "新增生命周期流程图"; |
| | | this.dialogWidth = "95%"; |
| | | this.visible = true; |
| | | } |
| | | }, |
| | | // 选中数据 |
| | | selectionChange(selectedData) { |
| | | this.selectedData = selectedData; |
| | | }, |
| | | // 删除 |
| | | rowDel(row) { |
| | | this.$confirm("确认删除该条数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | this.$set(row, "delLoading", true); |
| | | API.del({ oid: row.oid, id: row.id }) |
| | | .then((res) => { |
| | | this.$set(row, "delLoading", false); |
| | | if (res.data.code === 200) { |
| | | this.$message.success("删除成功!"); |
| | | this.search(); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.$set(row, "delLoading", false); |
| | | }); |
| | | }); |
| | | }, |
| | | batchDel() { |
| | | this.$confirm("确认删除所选数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | const data = this.selectedData.map((item) => { |
| | | return { |
| | | id: item.id, |
| | | oid: item.oid, |
| | | }; |
| | | }); |
| | | this.delLoading = true; |
| | | API.del(data, true) |
| | | .then((res) => { |
| | | this.delLoading = false; |
| | | if (res.data.code === 200) { |
| | | this.$message.success("删除成功!"); |
| | | this.search(); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.delLoading = false; |
| | | }); |
| | | }); |
| | | }, |
| | | async submit() { |
| | | const newRowData = await this.$refs.vueFlowchartEditor.getNewRowData(); |
| | | console.log(newRowData, "newRowDatanewRowData"); |
| | | if (!newRowData) { |
| | | return; |
| | | } |
| | | const flowData = this.$refs.vueFlowchartEditor.getFlowData(); |
| | | const flowData = await this.$refs.vueFlowchartEditor.getFlowData(); |
| | | if (Array.isArray(flowData.nodes)) { |
| | | flowData.nodes = flowData.nodes.map((item) => { |
| | | item.name = item.id; |
| | | item.indexNum = item.index; |
| | | return item; |
| | | }); |
| | | } |
| | | if (Array.isArray(flowData.edges)) { |
| | | flowData.edges = flowData.edges.map((item) => { |
| | | item.name = item.label; |
| | | item.indexNum = item.index; |
| | | return item; |
| | | }); |
| | | } |
| | | |
| | | let params = { |
| | | ...flowData, |
| | | ...newRowData, |
| | | ...flowData, |
| | | }; |
| | | 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; |
| | | }, |
| | | |
| | | this.submitLoading = true; |
| | | let APIFun = API.add; |
| | | if (this.type === "edit") { |
| | | APIFun = API.edit; |
| | | this.$delete(params, "id"); |
| | | } |
| | | APIFun(params) |
| | | .then((res) => { |
| | | this.submitLoading = false; |
| | | if (res.data.code === 200) { |
| | | this.$message.success( |
| | | this.type === "edit" ? "修改成功!" : "新增成功!" |
| | | ); |
| | | this.visible = false; |
| | | this.search(); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.submitLoading = false; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | margin: 0; |
| | | padding: 0; |
| | | } |
| | | .btn_link_del { |
| | | color: red; |
| | | } |
| | | </style> |