1 |
- {"remainingRequest":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\boman-framwork\\ruoyi-ui\\src\\views\\activiti\\TemplateManagementNew\\index.vue?vue&type=style&index=0&lang=scss&","dependencies":[{"path":"E:\\boman-framwork\\ruoyi-ui\\src\\views\\activiti\\TemplateManagementNew\\index.vue","mtime":1620609644503},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\css-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\postcss-loader\\src\\index.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\sass-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"E:\\boman-framwork\\ruoyi-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK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0KICAuYnVyZ2Vvbi1zdGVwcy1pdGVtLmJ1cmdlb24tc3RlcHMtc3RhdHVzLWZpbmlzaCAuYnVyZ2Vvbi1zdGVwcy1oZWFkLWlubmVyew0KICAgIGJvcmRlci1jb2xvcjogIzA5QTE1NTsNCiAgICBiYWNrZ3JvdW5kOiAjMDlBMTU1Ow0KICB9DQp9DQo="},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmfA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA","file":"index.vue","sourceRoot":"src/views/activiti/TemplateManagementNew","sourcesContent":["<template>\r\n <div class=\"TemplateManagementNew\">\r\n <!-- <Breadcrumb separator=\">\" class=\"breadcrumb\">\r\n <BreadcrumbItem to=\"/TemplateManagementLists\">模版管理</BreadcrumbItem>\r\n <BreadcrumbItem>{{$route.params.id != '-1'?'编辑模版':'新建模版'}}</BreadcrumbItem>\r\n\r\n </Breadcrumb> -->\r\n <!-- 预览状态 -->\r\n <div class=\"content\" v-if=\"this.readOnly\">\r\n <div class=\"tips\" v-if=\"currentSteps === 2\">\r\n <p>\r\n <span>单据类型:</span><span>{{data.businessTypeText}}</span>\r\n </p>\r\n <p>\r\n <span>模版名称:</span><span>{{data.name}}</span>\r\n </p>\r\n <p>\r\n <span>查询索引:</span><span>{{data.businessKey}}</span>\r\n </p>\r\n <p>\r\n <span>模版描述:</span><span>{{data.description}}</span>\r\n </p>\r\n <p>\r\n <span>自动处理:</span><span>{{data.autoClose?'开':'关'}}</span>\r\n </p>\r\n <p>\r\n <span>业务数据检查:</span><span>{{data.businessCheckUrl}}</span>\r\n </p>\r\n </div>\r\n <FlowChartComponent\r\n v-if=\"currentSteps === 2\"\r\n :data=\"data\"\r\n :currentSteps=\"2\"\r\n :readOnly=\"readOnly\"\r\n ref=\"component_2\"\r\n >\r\n </FlowChartComponent>\r\n <p class=\"buttonGroups\" v-if=\"currentSteps === 2\">\r\n <Button type=\"primary\" @click=\"close\">关闭</Button>\r\n </p>\r\n </div>\r\n\r\n <!-- 编辑状态 -->\r\n <Steps :current=\"currentSteps\" class=\"steps\" v-if=\"!this.readOnly\">\r\n <Step title=\"参数配置\" ></Step>\r\n <Step title=\"流程设计器\" ></Step>\r\n <Step title=\"保存发布模版\" ></Step>\r\n </Steps>\r\n\r\n <div class=\"content\" v-if=\"!this.readOnly\">\r\n <keep-alive exclude=\"component_2\" >\r\n <component\r\n :is=\"currentComponent\"\r\n :ref=\"currentComponent\"\r\n class=\"block\"\r\n :editable=\"currentSteps === 1?true:false\"\r\n :data=\"data\"\r\n :currentSteps=\"currentSteps\"\r\n :noFreshFlag=\"noFreshFlag\"\r\n @dataChange=dataChange\r\n >\r\n </component>\r\n </keep-alive>\r\n <p class=\"buttonGroups\">\r\n <Button type=\"primary\" v-if=\"currentSteps > 0\" @click=\"previousSteps\">上一步</Button>\r\n <Button type=\"primary\" v-if=\"currentSteps < 2\" @click=\"nextSteps\">下一步</Button>\r\n <Button type=\"primary\" v-if=\"(currentSteps === 2 && this.data.status !== 1)\" @click=\"confirm(false)\">保存</Button>\r\n <Button type=\"primary\" v-if=\"(currentSteps === 2 && this.data.status !== 1)\" @click=\"confirmAndPublish()\">保存并发布</Button>\r\n </p>\r\n </div>\r\n </div>\r\n</template>\r\n<script>\r\nimport '@/utils/go'\r\nimport Vue from 'vue'\r\nimport ParameterConfiguration from '@/components/ParameterConfiguration'\r\nimport FlowChartComponent from '@/components/FlowChartComponent'\r\nimport FlowSuccess from '@/components/FlowSuccess'\r\nimport { mapMutations } from 'vuex';\r\nimport { setTimeout } from 'timers';\r\nimport {\r\n getLoad,\r\n getCommit,\r\n getDuplicate,\r\n getPublish\r\n } from '@/api/modeler.js'\r\nexport default {\r\n name:'TemplateManagementNew',\r\n components:{ParameterConfiguration,FlowChartComponent,FlowSuccess},\r\n data () {\r\n return {\r\n currentSteps:0,\r\n currentComponent:null,\r\n imgBase:'',\r\n defaultData:{\r\n guiStyle:JSON.stringify({\r\n \"class\": \"NewGraphLinksModel\",\r\n \"linkFromPortIdProperty\": \"fromPort\",\r\n \"linkToPortIdProperty\": \"toPort\",\r\n \"nodeDataArray\": [\r\n {\"key\":-1, \"category\":\"Start\", \"loc\":\"175 0\", \"text\":\"开始\", \"type\": 1},\r\n {\"key\":0, \"loc\":\"175 100\", \"text\":\"审批节点\",\"type\": 0, \"category\": 'Approval'},\r\n {\"key\":-2, \"category\":\"End\", \"loc\":\"175 200\", \"text\":\"结束\", \"type\": 2}\r\n ],\r\n \"linkDataArray\": [\r\n {\"from\":-1, \"to\":0, \"fromPort\":\"B\", \"toPort\":\"T\",\"key\":0},\r\n {\"from\":0, \"to\":-2, \"fromPort\":\"B\", \"toPort\":\"T\",\"key\":1}\r\n ]\r\n }),\r\n nodeMsg:[\r\n {\"key\":-1, \"category\":\"Start\", \"loc\":\"175 0\", \"text\":\"开始\", \"name\":\"开始\", \"type\": 1,\"ruleList\":[]},\r\n {\"key\":0, \"loc\":\"175 100\", \"text\":\"审批节点\", \"name\":\"审批节点\", \"category\": 'Approval',\"type\": 0,\"ruleList\":[],\"actServiceS\":[],\"actionConfig\":[],\"approvelList\":[],\"approverStyle\":0},\r\n {\"key\":-2, \"category\":\"End\", \"loc\":\"175 200\", \"text\":\"结束\", \"name\":\"结束\", \"type\": 2,\"actionConfig\":[{\r\n handleValue:null,\r\n extra_msg:{},\r\n handleType:31\r\n },\r\n {\r\n handleValue:'{}',\r\n extra_msg:{},\r\n handleType:41\r\n }]}\r\n ],\r\n pathMsg:[\r\n {\"from\":-1, \"to\":0, \"fromPort\":\"B\", \"toPort\":\"T\",\"ruleList\":[],\"key\":0},\r\n {\"from\":0, \"to\":-2, \"fromPort\":\"B\", \"toPort\":\"T\",\"ruleList\":[],\"key\":1}\r\n ],\r\n removeNode:[],\r\n removePath:[],\r\n },\r\n data:{\r\n guiStyle:JSON.stringify({\r\n \"class\": \"NewGraphLinksModel\",\r\n \"linkFromPortIdProperty\": \"fromPort\",\r\n \"linkToPortIdProperty\": \"toPort\",\r\n \"nodeDataArray\": [\r\n {\"key\":-1, \"category\":\"Start\", \"loc\":\"175 0\", \"text\":\"开始\", \"type\": 1},\r\n {\"key\":0, \"loc\":\"175 100\", \"text\":\"审批节点\",\"type\": 0, \"category\": 'Approval'},\r\n {\"key\":-2, \"category\":\"End\", \"loc\":\"175 200\", \"text\":\"结束\", \"type\": 2}\r\n ],\r\n \"linkDataArray\": [\r\n {\"from\":-1, \"to\":0, \"fromPort\":\"B\", \"toPort\":\"T\",\"key\":0},\r\n {\"from\":0, \"to\":-2, \"fromPort\":\"B\", \"toPort\":\"T\",\"key\":1}\r\n ]\r\n }),\r\n nodeMsg:[\r\n {\"key\":-1, \"category\":\"Start\", \"loc\":\"175 0\", \"text\":\"开始\", \"name\":\"开始\", \"type\": 1,\"ruleList\":[]},\r\n {\"key\":0, \"loc\":\"175 100\", \"text\":\"审批节点\", \"name\":\"审批节点\", \"category\": 'Approval',\"type\": 0,\"ruleList\":[],\"actServiceS\":[],\"actionConfig\":[],\"approvelList\":[],\"approverStyle\":0},\r\n {\"key\":-2, \"category\":\"End\", \"loc\":\"175 200\", \"text\":\"结束\", \"name\":\"结束\", \"type\": 2,\"actionConfig\":[{\r\n handleValue:null,\r\n extra_msg:{},\r\n handleType:31\r\n },\r\n {\r\n handleValue:'{}',\r\n extra_msg:{},\r\n handleType:41\r\n }]}\r\n ],\r\n pathMsg:[\r\n {\"from\":-1, \"to\":0, \"fromPort\":\"B\", \"toPort\":\"T\",\"ruleList\":[],\"key\":0},\r\n {\"from\":0, \"to\":-2, \"fromPort\":\"B\", \"toPort\":\"T\",\"ruleList\":[],\"key\":1}\r\n ],\r\n removeNode:[],\r\n removePath:[],\r\n autoClose: true,\r\n moduleType: 0\r\n },\r\n noFreshFlag:false,\r\n\r\n readOnly:false, //是否只读为预览模式\r\n //存放三步骤的数据\r\n\r\n\r\n defaultModuleType: null, //暂存模版类型\r\n\r\n }\r\n },\r\n watch:{\r\n currentSteps (val) {\r\n if(this.readOnly){\r\n return\r\n }\r\n let componentName = `component_${val}`\r\n if(Vue.component(componentName) === undefined){\r\n if(val === 0 ){\r\n Vue.component(componentName,ParameterConfiguration)\r\n }else if(val === 1){\r\n\r\n Vue.component(componentName,FlowChartComponent)\r\n }else if(val === 2){\r\n Vue.component(componentName,FlowSuccess)\r\n }\r\n }\r\n\r\n this.currentComponent = componentName\r\n\r\n\r\n }\r\n },\r\n methods:{\r\n ...mapMutations(['currentChange']),\r\n getModuleInfo (id) {\r\n getLoad({id:id}).then((res) => {\r\n if(res.resultCode === 0){\r\n res.data.businessType = [{\r\n ID:res.data.businessType,\r\n Label:res.data.businessTypeName,\r\n val:res.data.businessTypeText\r\n }]\r\n\r\n res.data.businessNumber = [{\r\n ID:String(res.data.businessKeyId),\r\n Label:res.data.businessKey,\r\n val:res.data.businessKeyName\r\n }]\r\n this.data = res.data\r\n this.data.guiStyle = JSON.parse(res.data.guiStyle)\r\n this.data.moduleId = res.data.id\r\n\r\n this.$nextTick(() => {\r\n if(this.readOnly){\r\n this.currentSteps = 2\r\n this.noFreshFlag = false\r\n }else{\r\n this.$refs.component_1.init()\r\n this.noFreshFlag = false\r\n }\r\n\r\n })\r\n }\r\n });\r\n },\r\n async nextSteps () { //下一步\r\n if(await this.checkModuleName()){\r\n return false\r\n }\r\n\r\n if(this.currentSteps === 0 && (this.defaultModuleType != this.data.moduleType) && this.defaultModuleType !== null){\r\n this.$Modal.fcWarning({\r\n title:'警告',\r\n content:'您已修改模板类型/单据类型,这将导致下一步的流程设计器内所有设置恢复初始化,是否确定更改?',\r\n showCancel: true,\r\n mask: true,\r\n onOk: () => {\r\n this.defaultModuleType = this.data.moduleType\r\n this.data = Object.assign(this.data,JSON.parse(JSON.stringify(this.defaultData)))\r\n if(this.data.businessType && this.data.businessType.length > 0 && this.data.name){\r\n this.defaultModuleType = this.data.moduleType\r\n ++this.currentSteps\r\n }else{\r\n this.$Modal.fcWarning({\r\n title:'警告',\r\n content:'请填写必填项!',\r\n mask:true\r\n })\r\n }\r\n },\r\n onCancel: () => {\r\n }\r\n })\r\n return\r\n }\r\n\r\n\r\n if( this.data.name && (this.data.moduleType === 0?(this.data.businessType && this.data.businessType.length > 0):true) ){\r\n this.defaultModuleType = this.data.moduleType\r\n ++this.currentSteps\r\n }else{\r\n this.$Modal.fcWarning({\r\n title:'警告',\r\n content:'请填写必填项!',\r\n mask:true\r\n })\r\n }\r\n\r\n\r\n\r\n },\r\n async checkModuleName () {\r\n await new Promise((resolve, reject) => {\r\n let jsonObject = {\r\n ID:this.data.moduleId,\r\n NAME:this.data.name\r\n }\r\n getDuplicate(jsonObject).then(res => {\r\n if(res.resultCode !== 0){\r\n this.$Modal.fcWarning({\r\n title:'警告',\r\n content:res.resultMsg,\r\n mask:true\r\n })\r\n reject()\r\n }\r\n resolve(res)\r\n })\r\n })\r\n },\r\n previousSteps () { //上一步\r\n --this.currentSteps\r\n },\r\n async confirm (flag) { //确定\r\n\r\n return await new Promise((resolve,reject) => {\r\n\r\n var svg = this.data.myDisplay.makeImage({\r\n scale: 2\r\n });\r\n this.imgBase = svg.getAttribute('src')\r\n\r\n let nodeMsg = []\r\n Object.keys(this.data.nodeMsg).map(item => {\r\n nodeMsg.push(this.data.nodeMsg[item])\r\n return item\r\n })\r\n\r\n let pathMsg = []\r\n Object.keys(this.data.pathMsg).map(item => {\r\n pathMsg.push(this.data.pathMsg[item])\r\n return item\r\n })\r\n let jsonObject = {\r\n id:this.data.moduleId,\r\n name:this.data.name,\r\n description:this.data.description,\r\n GUI_STYLE:this.data.guiStyle,\r\n url:svg.getAttribute('src'),\r\n moduleType: this.data.moduleType,\r\n BUSINESS_TYPE:this.data.businessType?this.data.businessType[0].ID:null,\r\n BUSINESS_TYPE_NAME:this.data.businessType?this.data.businessType[0].Label:null,\r\n businessTypeText:this.data.businessType?this.data.businessType[0].val:null,\r\n businessKeyId:(this.data.businessNumber && this.data.businessNumber.length > 0)?this.data.businessNumber[0].ID:null,\r\n businessKey:(this.data.businessNumber && this.data.businessNumber.length > 0)?this.data.businessNumber[0].Label:null,\r\n businessKeyName:(this.data.businessNumber && this.data.businessNumber.length > 0)?this.data.businessNumber[0].val:null,\r\n autoClose:this.data.autoClose,\r\n businessCheckUrl:this.data.businessCheckUrl,\r\n nodeMsg: nodeMsg,\r\n pathMsg: pathMsg,\r\n removeNode: this.data.removeNode,\r\n removePath: this.data.removePath\r\n }\r\n getCommit(jsonObject).then(res => {\r\n if(res.data.resultCode === 0){\r\n // this.data = {\r\n // guiStyle:{\r\n // \"class\": \"go.GraphLinksModel\",\r\n // \"linkFromPortIdProperty\": \"fromPort\",\r\n // \"linkToPortIdProperty\": \"toPort\",\r\n // \"nodeDataArray\": [],\r\n // \"linkDataArray\": []\r\n // }\r\n // }\r\n if(!flag){\r\n window.flag = true\r\n this.$router.push('/TemplateManagementLists')\r\n this.currentChange({\r\n path:'/TemplateManagementLists'\r\n });\r\n }\r\n\r\n resolve(res)\r\n }\r\n\r\n })\r\n })\r\n\r\n\r\n },\r\n async formatGuiStyle () { //format整个流程图\r\n await new Promise((resolve) => {\r\n let startNode = {} //获取开始节点\r\n this.data.guiStyle.nodeDataArray.map(item => {\r\n if(item.key === -1){\r\n startNode = item\r\n }\r\n })\r\n\r\n let startlink = {}\r\n //获取第一根线的数据\r\n this.data.guiStyle.linkDataArray.map(item => {\r\n if(item.from === -1){\r\n startlink = item\r\n }\r\n })\r\n\r\n //获取连线的正确排序\r\n let linkMap = []\r\n new Array(this.data.guiStyle.linkDataArray.length).fill(null).map(() => {\r\n this.data.guiStyle.linkDataArray.map(item => {\r\n if(linkMap.length === 0 && item.from === -1){\r\n linkMap.push(item)\r\n }\r\n if(linkMap.length > 0 && item.from === linkMap[linkMap.length-1].to){\r\n linkMap.push(item)\r\n }\r\n })\r\n })\r\n this.data.guiStyle.linkDataArray = linkMap\r\n\r\n\r\n //获取节点的正确顺序\r\n // let nodeMap = [startNode]\r\n this.data.guiStyle.nodeDataArray = this.data.guiStyle.linkDataArray.reduce((sum,item) => {\r\n sum.push(this.data.Diagram.model.findNodeDataForKey(item.to))\r\n return sum\r\n },[startNode])\r\n\r\n\r\n //将所有节点的x轴与开始节点对齐\r\n this.data.guiStyle.nodeDataArray.map((item,index) => {\r\n let loc = item.loc.split(' ')\r\n loc[0] = startNode.loc.split(' ')[0]\r\n loc[1] = Number(startNode.loc.split(' ')[1]) + index*80\r\n item.loc = loc.join(' ')\r\n })\r\n\r\n //将所有连线的x轴与开始节点对齐\r\n this.data.guiStyle.linkDataArray.map((item,index) => {\r\n item.points.j.map(temp => {\r\n temp.F = startlink.points.j[0].F\r\n })\r\n\r\n item.points.j.map((temp,j) => {\r\n if(index === 0){\r\n if(j !== item.points.j.length-1){\r\n temp.G = Number(this.data.guiStyle.nodeDataArray[index].loc.split(' ')[1])+20\r\n }else{\r\n temp.G = Number(this.data.guiStyle.nodeDataArray[index+1].loc.split(' ')[1])-20\r\n }\r\n }else if(index === this.data.guiStyle.linkDataArray.length - 1){\r\n if(j !== item.points.j.length-1){\r\n temp.G = Number(this.data.guiStyle.nodeDataArray[index].loc.split(' ')[1])+20\r\n }else{\r\n temp.G = Number(this.data.guiStyle.nodeDataArray[index+1].loc.split(' ')[1])-20\r\n }\r\n }else{\r\n if(j !== item.points.j.length-1){\r\n temp.G = Number(this.data.guiStyle.nodeDataArray[index].loc.split(' ')[1])+20\r\n }else{\r\n temp.G = Number(this.data.guiStyle.nodeDataArray[index+1].loc.split(' ')[1])-20\r\n }\r\n }\r\n\r\n })\r\n })\r\n\r\n this.data.Diagram.model = go.Model.fromJson(this.data.guiStyle)\r\n\r\n setTimeout(() => {\r\n resolve()\r\n },100)\r\n })\r\n },\r\n dataChange (data) { //每一步中的数据变化\r\n this.data = Object.assign(this.data,data)\r\n },\r\n close () {\r\n this.$router.push('/TemplateManagementLists')\r\n this.currentChange({\r\n path:'/TemplateManagementLists'\r\n });\r\n },\r\n confirmAndPublish () { //保存并发布\r\n this.confirm(true).then(res => {\r\n getPublish({id:res.data.data.id}).then((response) => {\r\n if(response.data.resultCode === 0){\r\n this.$router.push('/TemplateManagementLists')\r\n this.currentChange({\r\n path:'/TemplateManagementLists'\r\n });\r\n }\r\n })\r\n })\r\n }\r\n },\r\n created () {\r\n Vue.component(`component_${this.currentSteps}`,Vue.extend(Object.assign({isKeepAliveModel:true},ParameterConfiguration)))\r\n this.currentComponent = `component_${this.currentSteps}`\r\n console.log(this.$route.params.id,99998)\r\n if(this.$route.params.flag === '1'){\r\n this.readOnly = true\r\n this.noFreshFlag = true\r\n this.getModuleInfo(this.$route.params.id)\r\n return\r\n }\r\n if(this.$route.params.id === undefined){ //新增\r\n console.log(22233)\r\n }else{ //编辑\r\n this.noFreshFlag = true\r\n this.currentSteps = 1\r\n this.getModuleInfo(this.$route.params.id)\r\n }\r\n },\r\n beforeDestroy () {\r\n\r\n }\r\n}\r\n</script>\r\n<style lang=\"scss\" >\r\n.TemplateManagementNew{\r\n padding:16px;\r\n background: white;\r\n display: flex;\r\n flex-direction: column;\r\n\r\n .breadcrumb{\r\n margin-bottom: 30px;\r\n font-size: 18px;\r\n }\r\n\r\n .steps{\r\n width: 75%;\r\n margin-left: 12.5%;\r\n margin-bottom: 30px;\r\n }\r\n\r\n .content{\r\n flex:1;\r\n border:1px solid rgba(220,222,226,1);\r\n display: flex;\r\n flex-direction: column;\r\n position: relative;\r\n // 预览tips\r\n .tips{\r\n width:260px;\r\n height:204px;\r\n background:rgba(236,236,236,1);\r\n padding: 16px;\r\n box-sizing: border-box;\r\n display: inline-block;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n z-index: 99;\r\n >p{\r\n font-weight:400;\r\n color:rgba(52,52,52,1);\r\n line-height:16px;\r\n margin-bottom: 12px;\r\n display: flex;\r\n\r\n >span:first-child{\r\n margin-right: 8px;\r\n white-space: nowrap;\r\n }\r\n\r\n >span:last-child{\r\n word-break: break-all;\r\n }\r\n }\r\n }\r\n\r\n .block{\r\n flex: 1;\r\n }\r\n\r\n .buttonGroups{\r\n text-align: right;\r\n padding-bottom: 16px;\r\n\r\n button{\r\n margin-right: 10px;\r\n\r\n &:last-child{\r\n margin-right:16px;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .burgeon-steps-item.burgeon-steps-status-finish .burgeon-steps-head-inner > .burgeon-steps-icon, .burgeon-steps-item.burgeon-steps-status-finish .burgeon-steps-head-inner span{\r\n color: white;\r\n }\r\n\r\n .burgeon-steps-item.burgeon-steps-status-finish .burgeon-steps-head-inner{\r\n border-color: #09A155;\r\n background: #09A155;\r\n }\r\n}\r\n</style>\r\n"]}]}
|