| | |
| | | params
|
| | | })
|
| | | }
|
| | | // 新增
|
| | | export const add = (data) => {
|
| | | return request({
|
| | | url: '/api/ubcs-omd/lifeCycle/submit',
|
| | | method: 'post',
|
| | | data
|
| | | })
|
| | | }
|
| | | export default {
|
| | | getList
|
| | | getList,
|
| | | add
|
| | | }
|
| | |
| | | left="30px"
|
| | | ></Divider>
|
| | | <FormTemplate
|
| | | v-loading="!showCodeApply"
|
| | | style="margin-top: 30px"
|
| | | type="add"
|
| | | :selfColumnType="selfColumnType"
|
| | |
| | | leftTree: [],
|
| | | redisOid: "",
|
| | | pageLoading: null,
|
| | | showCodeApply: false,
|
| | | showCodeApply: true,
|
| | | currentTypeObj: {
|
| | | historyImport: {
|
| | | title: "历史数据导入",
|
| | |
| | | if (this.hasResemble) { |
| | | this.activeName = "resembleQuery"; |
| | | this.showResembleQuery = true; |
| | | } else { |
| | | this.showResembleQuery = false |
| | | } |
| | | console.log(this.hasResemble, 'this.hasResemblethis.hasResemble'); |
| | | this.$nextTick(() => { |
| | | this.$refs.FormTemplate.templateRender( |
| | | res.data.formDefineVO.items |
| | |
| | | return false; |
| | | } |
| | | } |
| | | // 进行相似项查询 |
| | | const resembleQueryList = await this.$refs.resembleQueryRef.resembleQuery( |
| | | let resembleQueryList = [] |
| | | if (this.$refs.resembleQueryRef) { |
| | | // 进行相似项查询 |
| | | resembleQueryList = await this.$refs.resembleQueryRef.resembleQuery( |
| | | this.form |
| | | ); |
| | | } |
| | | if (resembleQueryList.length === 0) { |
| | | let resForm = {}; |
| | | const { defaultValue, formValue } = this.getDefaultValueAndFormValues( |
| | |
| | | <el-form-item label="名称" prop="name"> |
| | | <el-input v-model.trim="newRowData.name" :maxLength="20" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="标签" prop="label"> |
| | | <el-input v-model.trim="newRowData.label" clearable /> |
| | | <el-form-item label="标签" prop="id"> |
| | | <el-input v-model.trim="newRowData.id" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="起始状态" prop="startState"> |
| | | <el-form-item label="起始状态" prop="startStatus"> |
| | | <el-select |
| | | v-model="newRowData.startState" |
| | | v-model="newRowData.startStatus" |
| | | placeholder="请选择起始状态" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in []" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="item in existNodes" |
| | | :key="item.id" |
| | | :label="item.id" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | DetailPanel, |
| | | DetailForm, |
| | | }, |
| | | props: ["readOnly", "rowData"], |
| | | props: ["rowData", "existNodes"], |
| | | data() { |
| | | return { |
| | | newRowData: {}, |
| | | newRowData: { |
| | | startStatus: undefined, |
| | | name: undefined, |
| | | id: undefined, |
| | | remark: undefined |
| | | }, |
| | | rules: { |
| | | name: [{ required: true, message: "名称不能为空", trigger: "blur" }], |
| | | label: [{ required: true, message: "标签不能为空", trigger: "blur" }], |
| | | startState: [ |
| | | // { required: true, message: "起始状态不能为空", trigger: "change" }, |
| | | id: [{ required: true, message: "标签不能为空", trigger: "blur" }], |
| | | startStatus: [ |
| | | { required: true, message: "起始状态不能为空", trigger: "change" }, |
| | | ], |
| | | }, |
| | | }; |
| | |
| | | } |
| | | }, |
| | | }, |
| | | existNodes(newV) { |
| | | const flag = newV.some((item) => item.id === this.newRowData.startStatus); |
| | | if (!flag) { |
| | | this.newRowData.startStatus = undefined; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | </div> |
| | | <div class="vfe-chart-panel" v-if="type !== 'detail'"> |
| | | <div class="vfe-chart-panel-detail"> |
| | | <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" /> |
| | | <editor-detail-panel :rowData="rowData" ref="EditorDetailPanel" :existNodes="existNodes"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | tooltipShow: true, |
| | | tooltipData: [], |
| | | existNodes: [] |
| | | }; |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | // onAfterChange(e) { |
| | | // const model = e.model |
| | | // console.log(JSON.parse(JSON.stringify(e))); |
| | | // if (!model.change) { |
| | | // model.id = model.label |
| | | // model.change = true |
| | | // } else { |
| | | // return |
| | | // } |
| | | // const { nodes } = this.$refs.flowChart.propsAPI.save() |
| | | // if (Array.isArray(nodes) && nodes.length > 0) { |
| | | |
| | | // } else { |
| | | // this.$refs.flowChart.propsAPI.add("node", model); |
| | | // } |
| | | // throw '禁止原生新增方法' |
| | | // }, |
| | | onAfterChange(e) { |
| | | console.log(e); |
| | | try { |
| | | if (e.action === "add" && e.model.type === "node") { |
| | | if (!e.model.change) { |
| | |
| | | this.$message.error("不能添加已存在的节点!"); |
| | | } |
| | | } |
| | | const { nodes } = this.$refs.flowChart.propsAPI.save() |
| | | this.existNodes = nodes || [] |
| | | console.log(this.$refs.flowChart.propsAPI.save()); |
| | | }, |
| | | _downloadImage(data, filename = "flowchart.png") { |
| | | const a = document.createElement("a"); |
| | |
| | | codeApplyForm: {},
|
| | | }
|
| | | },
|
| | | created() {
|
| | | if (this.type === 'batchImportApply') {
|
| | | this.getCodeRule()
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | // 获取码值申请数据
|
| | | getCodeRule() {
|
| | | getCodeRule({ codeClassifyOid: this.localCodeClassifyOid }).then((res) => {
|
| | | getCodeRule({ codeClassifyOid: this.localCodeClassifyOid || this.codeClassifyOid }).then((res) => {
|
| | | if (res.data && res.data.code === 200) {
|
| | | const typeList = [
|
| | | "codefixedsec",
|
| | |
| | | }
|
| | | this.$refs.CodeApply.templateRender(this.localSecVOList);
|
| | | });
|
| | | } else {
|
| | | this.showCodeApply = false
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | <template> |
| | | <basic-container class=""> |
| | | <avue-crud :data="data" :option="option" @refresh-change="search" :table-loading="loading"> |
| | | <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" |
| | |
| | | :width="dialogWidth" |
| | | :title="title" |
| | | append-to-body |
| | | :before-close="() => {visible = false}" |
| | | :before-close=" |
| | | () => { |
| | | visible = false; |
| | | } |
| | | " |
| | | top="10vh" |
| | | > |
| | | <CycleFlow |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import API from '@/api/modeling/cycle' |
| | | import API from "@/api/modeling/cycle"; |
| | | import CycleFlow from "@/components/flow-cycle/flowchartEditor.vue"; |
| | | export default { |
| | | name: "cycle.vue", |
| | | components: { CycleFlow }, |
| | | data() { |
| | | return { |
| | | form: { |
| | | page: 1, |
| | | limit: 10 |
| | | form: {}, |
| | | page: { |
| | | pageSize: 10, |
| | | total: 0, |
| | | currentPage: 1, |
| | | layout: "total, sizes, prev, pager, next, jumper" |
| | | }, |
| | | option: { |
| | | searchMenuSpan: 12, |
| | | searchMenuPosition: "right", |
| | | border: true, |
| | | align: "center", |
| | | menuAlign: "center", |
| | |
| | | { |
| | | label: "名称", |
| | | prop: "name", |
| | | search: true, |
| | | }, |
| | | { |
| | | label: "起始状态", |
| | | prop: "startStatusName", |
| | | search: true, |
| | | }, |
| | | { |
| | | label: "描述", |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | // data: [ |
| | | // { |
| | | // name: "我是name", |
| | | // label: "我是label", |
| | | // startState: "我是startState", |
| | | // remark: "我是remark", |
| | | // data: { |
| | | // nodes: [ |
| | | // { |
| | | // type: "node", |
| | | // size: "80*48", |
| | | // shape: "flow-rect", |
| | | // color: "#1890FF", |
| | | // label: "Auditing", |
| | | // x: 110.50303650877106, |
| | | // y: 59.22389408123915, |
| | | // id: "Auditing", |
| | | // index: 0, |
| | | // }, |
| | | // { |
| | | // type: "node", |
| | | // size: "80*48", |
| | | // shape: "flow-rect", |
| | | // color: "#1890FF", |
| | | // label: "Editing", |
| | | // x: 120.87992069414531, |
| | | // y: 156.76660542375714, |
| | | // id: "Editing", |
| | | // index: 1, |
| | | // }, |
| | | // { |
| | | // type: "node", |
| | | // size: "80*48", |
| | | // shape: "flow-rect", |
| | | // color: "#1890FF", |
| | | // label: "Released", |
| | | // x: 100.12615232339681, |
| | | // y: 252.2339399292003, |
| | | // id: "Released", |
| | | // index: 2, |
| | | // }, |
| | | // ], |
| | | // edges: [ |
| | | // { |
| | | // source: "Auditing", |
| | | // sourceAnchor: 1, |
| | | // target: "Released", |
| | | // targetAnchor: 1, |
| | | // }, |
| | | // { |
| | | // source: "Editing", |
| | | // sourceAnchor: 3, |
| | | // target: "Auditing", |
| | | // targetAnchor: 3, |
| | | // }, |
| | | // ], |
| | | // }, |
| | | // }, |
| | | // ], |
| | | data: [], |
| | | title: "预览生命周期流程图", |
| | | visible: false, |
| | | flowChartNodeItems: [], |
| | | rowData: {}, |
| | | dialogWidth: "50%", |
| | | type: "detail", |
| | | loading: false |
| | | loading: false, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.search() |
| | | this.search("search", {}); |
| | | }, |
| | | methods: { |
| | | search() { |
| | | this.loading = true |
| | | API.getList(this.form).then(res => { |
| | | this.loading = false |
| | | this.data = res.data.data |
| | | }) |
| | | 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") { |
| | |
| | | }, |
| | | async submit() { |
| | | const newRowData = await this.$refs.vueFlowchartEditor.getNewRowData(); |
| | | console.log(newRowData, 'newRowDatanewRowData'); |
| | | if (!newRowData) { |
| | | return; |
| | | } |
| | | const flowData = this.$refs.vueFlowchartEditor.getFlowData(); |
| | | console.log(JSON.stringify(flowData)); |
| | | 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; |
| | | }, |
| | | }, |
| | | }, |
| | | }; |