提交 856e0f41 authored 作者: jianglw's avatar jianglw

1.增加json文件修改功能

2.初始化可自动存入redis
上级 0305b0f9
......@@ -227,9 +227,6 @@
<packaging>pom</packaging>
<dependencies>
</dependencies>
<build>
<plugins>
......@@ -325,6 +322,11 @@
</build>
<distributionManagement>
<repository>
<id>maven-hrhx</id>
<name>maven-releases</name>
<url>http://192.168.2.103:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-hrhx</id>
<name>maven-snapshots</name>
......
......@@ -77,6 +77,7 @@
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>topology</artifactId>
<version>3.3.0-SNAPSHOT</version>
</dependency>
<!-- 代码生成-->
<dependency>
......
......@@ -95,6 +95,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.authorizeRequests()
// 对于登录login 验证码captchaImage 允许匿名访问
.antMatchers( "/login", "/captchaImage" ).anonymous()
.antMatchers( "/static/**" ).permitAll()
.antMatchers( "/topology/listAll" ).anonymous()
.antMatchers( "/topology/listAll" ).permitAll()
.antMatchers( "/topology/getTopology/**" ).anonymous()
......@@ -137,6 +138,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
, "/**/*.txt"
, "/**/*.ico"
,"/**/*.map"
,"/**/*.html"
).anonymous()
.antMatchers( "/" ).anonymous()
// 除上面外的所有请求全部需要鉴权认证
......
package com.ruoyi.topology.config;
import com.ruoyi.topology.common.constant.Constants;
import com.ruoyi.topology.common.utils.StringUtils;
import com.ruoyi.topology.domain.TopologyData;
import com.ruoyi.topology.service.ITopologyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @Description TODO
* @Author jianglw
* @Date 2022/8/5 15:00
**/
@Component
@Slf4j
public class TopologyJsonInitConfig {
@Autowired
private ITopologyService iTopologyService;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Bean
public void handleJsonStr(){
TopologyData topologyData = new TopologyData();
List<TopologyData> list = iTopologyService.getTopology( topologyData );
for(TopologyData topologyData1:list){
if(StringUtils.isNotEmpty(topologyData1.getData())){
stringRedisTemplate.opsForValue().set( Constants.TOPOLOGY_DATA+topologyData1.getId(), topologyData1.getData() );
}
}
}
}
......@@ -5,6 +5,7 @@ import com.ruoyi.topology.common.constant.Constants;
import com.ruoyi.topology.common.core.domain.AjaxResults;
import com.ruoyi.topology.common.core.domain.page.TableDataInfo;
import com.ruoyi.topology.domain.TopologyData;
import com.ruoyi.topology.pojo.TopologyDataPojo;
import com.ruoyi.topology.service.ITopologyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
......@@ -30,33 +31,29 @@ public class IndexController extends BaseController {
@Autowired
private StringRedisTemplate stringRedisTemplate;
// @RequestMapping("/")
// public String index() {
// return "index";
// }
/**
* 保存组态数据
*
* @param topologyData
* @param topologyDataPojo
* @return AjaxResults
*/
@PostMapping("/save")
@ResponseBody
public AjaxResults save(@RequestBody TopologyData topologyData) throws IOException {
public AjaxResults save(@RequestBody TopologyDataPojo topologyDataPojo) throws IOException {
List<TopologyData> list =null;
TopologyData t=null;
if (topologyData.getId() == null) {
iTopologyService.saveTopologyToId(topologyData );
stringRedisTemplate.opsForValue().set( Constants.TOPOLOGY_DATA+topologyData.getId(),JSONObject.toJSONString( topologyData.getData()) );
return AjaxResults.success( topologyData );
if (topologyDataPojo.getId() == null) {
iTopologyService.saveTopologyToId(topologyDataPojo );
stringRedisTemplate.opsForValue().set( Constants.TOPOLOGY_DATA+topologyDataPojo.getId(),JSONObject.toJSONString(topologyDataPojo.getData()) );
return AjaxResults.success( topologyDataPojo );
}else{
t =iTopologyService.getTopologyById( topologyData.getId() );
t =iTopologyService.getTopologyById( topologyDataPojo.getId() );
if(t!=null){
iTopologyService.updateTopologyById(topologyData);
stringRedisTemplate.opsForValue().set( Constants.TOPOLOGY_DATA+topologyData.getId(),JSONObject.toJSONString( topologyData.getData()) );
return AjaxResults.success( topologyData );
iTopologyService.updateTopologyById(topologyDataPojo);
stringRedisTemplate.opsForValue().set( Constants.TOPOLOGY_DATA+topologyDataPojo.getId(),JSONObject.toJSONString(topologyDataPojo.getData()) );
return AjaxResults.success( topologyDataPojo );
}
}
return AjaxResults.error( "保存失败,请检查id是否存在" );
......@@ -65,8 +62,8 @@ public class IndexController extends BaseController {
@PostMapping("/updateTopology")
@ResponseBody
public AjaxResults updateTopology(@RequestBody TopologyData topologyData) throws IOException {
iTopologyService.updateTopologyById(topologyData);
public AjaxResults updateTopology(@RequestBody TopologyDataPojo topologyDataPojo) throws IOException {
iTopologyService.updateTopologyById(topologyDataPojo);
return AjaxResults.success();
}
......@@ -78,7 +75,6 @@ public class IndexController extends BaseController {
TopologyData topologyData = new TopologyData();
List<TopologyData> list = iTopologyService.getTopology( topologyData );
for(TopologyData t:list){
System.out.println(stringRedisTemplate.opsForValue().get( Constants.TOPOLOGY_DATA+t.getId() ));
t.setData( stringRedisTemplate.opsForValue().get( Constants.TOPOLOGY_DATA+t.getId() ) );
}
return getDataTable(list);
......@@ -115,29 +111,4 @@ public class IndexController extends BaseController {
stringRedisTemplate.opsForValue().set( Constants.TOPOLOGY_DATA+id,jsonObject.toJSONString() );
return AjaxResults.success();
}
public void test(@RequestParam(value = "id") String id) throws IOException {
// System.out.println(data);
// JSONObject jsonObject= JSON.parseObject( "{\n" +
// " tag: 'numA', //tag节点\n" +
// " fontColor: 'red', //数据颜色\n" +
// " text: 'test', //文本内容\n" +
// " }" );
// webSocketServer.sendInfo(jsonObject.toJSONString() ,"1" );
// iTopologyService.ces();
System.out.println("他请求成功了"+id);
}
//-------------------公共接口可匿名访问------------------
@GetMapping("/listAll")
@ResponseBody
public TableDataInfo listAll() {
startPage();
TopologyData topologyData = new TopologyData();
List<TopologyData> list = iTopologyService.getTopologyToSwitchIt( topologyData );
for(TopologyData t:list){
t.setData( stringRedisTemplate.opsForValue().get( Constants.TOPOLOGY_DATA+t.getId() ) );
}
return getDataTable(list);
}
}
package com.ruoyi.topology.domain;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.topology.pojo.TopologyDataPojo;
/**
* topology数据
* @author jianglw
......@@ -9,11 +12,35 @@ package com.ruoyi.topology.domain;
public class TopologyData {
private Integer id;
private String name;
private Object data;
private String data;
private String switchIt;
private String createdTime;
private String alterTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getSwitchIt() {
return switchIt;
}
......@@ -38,29 +65,14 @@ public class TopologyData {
this.alterTime = alterTime;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
public static TopologyData copyTopology(TopologyDataPojo topologyDataPojo){
TopologyData topologyData=new TopologyData();
topologyData.setId(topologyDataPojo.getId());
topologyData.setData(JSONObject.toJSONString(topologyDataPojo.getData()));
topologyData.setAlterTime(topologyDataPojo.getAlterTime());
topologyData.setCreatedTime(topologyDataPojo.getCreatedTime());
topologyData.setSwitchIt(topologyDataPojo.getSwitchIt());
topologyData.setName(topologyDataPojo.getName());
return topologyData;
}
}
......@@ -5,13 +5,13 @@
<mapper namespace="com.ruoyi.topology.mapper.TopologyMapper">
<insert id="saveTopologyToId" parameterType="com.ruoyi.topology.domain.TopologyData"
useGeneratedKeys="true" keyProperty="id">
insert into topology (name, created_time, switch_it)
values (#{name}, now(), 1)
insert into topology (name, created_time, switch_it,data)
values (#{name}, now(), 1,#{data})
</insert>
<select id="getTopology" parameterType="com.ruoyi.topology.domain.TopologyData"
resultType="com.ruoyi.topology.domain.TopologyData">
select id,name as name,date_format(created_time,'%Y-%m-%d %H:%i:%s') as
createdTime,date_format(alter_time,'%Y-%m-%d %H:%i:%s') as alterTime,switch_it as switchIt from topology
createdTime,date_format(alter_time,'%Y-%m-%d %H:%i:%s') as alterTime,switch_it as switchIt,data from topology
<where>
<if test="id !=null and id!=''">and id = #{id}</if>
<if test="switchIt !=null and switchIt!=''">and switch_it = #{switchIt}</if>
......@@ -22,7 +22,8 @@
name as name,
date_format(created_time, '%Y-%m-%d %H:%i:%s') as createdTime,
date_format(alter_time, '%Y-%m-%d %H:%i:%s') as alterTime,
switch_it as switchIt
switch_it as switchIt,
data
from topology
where id = #{id}
</select>
......@@ -31,6 +32,7 @@
<trim prefix="set" suffixOverrides=",">
<if test="name !=null and name !=''">name = #{name},</if>
<if test="switchIt !=null and switchIt !=''">switch_it = #{switchIt},</if>
<if test="data !=null and data !=''">data = #{data},</if>
alter_time = now()
</trim>
where id =#{id}
......
package com.ruoyi.topology.pojo;
/**
* @Description TODO
* @Author jianglw
* @Date 2022/8/8 13:37
**/
public class TopologyDataPojo {
private Integer id;
private String name;
private Object data;
private String switchIt;
private String createdTime;
private String alterTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getSwitchIt() {
return switchIt;
}
public void setSwitchIt(String switchIt) {
this.switchIt = switchIt;
}
public String getCreatedTime() {
return createdTime;
}
public void setCreatedTime(String createdTime) {
this.createdTime = createdTime;
}
public String getAlterTime() {
return alterTime;
}
public void setAlterTime(String alterTime) {
this.alterTime = alterTime;
}
}
package com.ruoyi.topology.service;
import com.ruoyi.topology.domain.TopologyData;
import com.ruoyi.topology.pojo.TopologyDataPojo;
import java.util.List;
import java.util.Map;
......@@ -11,14 +12,14 @@ import java.util.Map;
* @date 2021/3/29 15:00
*/
public interface ITopologyService {
void saveTopologyToId(TopologyData topologyData);
void saveTopologyToId(TopologyDataPojo topologyDataPojo);
List<TopologyData> getTopology(TopologyData topologyData);
List<TopologyData> getTopologyToSwitchIt(TopologyData topologyData);
TopologyData getTopologyById(Integer id);
void updateTopologyById(TopologyData topologyData);
void updateTopologyById(TopologyDataPojo topologyDataPojo);
Integer deleteTopologyById(Integer id);
......
package com.ruoyi.topology.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.topology.domain.TopologyData;
import com.ruoyi.topology.mapper.TopologyMapper;
import com.ruoyi.topology.pojo.TopologyDataPojo;
import com.ruoyi.topology.service.ITopologyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -20,15 +22,13 @@ public class TopologyService implements ITopologyService {
@Autowired
private TopologyMapper topologyMapper;
@Override
public void saveTopologyToId(TopologyData topologyData) {
public void saveTopologyToId(TopologyDataPojo topologyDataPojo) {
TopologyData topologyData=TopologyData.copyTopology(topologyDataPojo);
topologyMapper.saveTopologyToId(topologyData);
}
@Override
public List<TopologyData> getTopology(TopologyData topologyData) {
// if(!SecurityUtils.isAdmin( SecurityUtils.getLoginUser().getUser().getUserId() )){
// topologyData.setSwitchIt( "1" );
// }
return topologyMapper.getTopology(topologyData);
}
......@@ -44,7 +44,8 @@ public class TopologyService implements ITopologyService {
}
@Override
public void updateTopologyById(TopologyData topologyData) {
public void updateTopologyById(TopologyDataPojo topologyDataPojo) {
TopologyData topologyData=TopologyData.copyTopology(topologyDataPojo);
topologyMapper.updateTopologyById(topologyData);
}
......
.steps-content{margin-top:16px;border:1px dashed #e9e9e9;border-radius:6px;background-color:#fafafa;min-height:62vh}.steps-action{margin-top:24px}image-slot{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background:#f5f7fa;color:#909298;font-size:30px}.tools{position:absolute;left:0;top:0;right:0;display:flex}.tools>div{flex-grow:1}.tools button{margin:12px 16px}.el-col{margin-bottom:10px}
\ No newline at end of file
.steps-content{margin-top:16px;border:1px dashed #e9e9e9;border-radius:6px;background-color:#fafafa;min-height:62vh}.steps-action{margin-top:24px}.text-formated-container .monaco-editor-con[data-v-336d3040]{min-height:150px;height:calc(100vh - 730px);clear:both;overflow:hidden;background:none}.text-formated-container .monaco-editor .codicon[data-v-336d3040]{font-family:codicon!important}.text-formated-container .monaco-editor .scrollbar[data-v-336d3040]{background:#eaeaea;border-radius:4px}.dark-mode .text-formated-container .monaco-editor .scrollbar[data-v-336d3040]{background:#475156}.text-formated-container .monaco-editor .scrollbar[data-v-336d3040]:hover{background:#e0e0dd}.dark-mode .text-formated-container .monaco-editor .scrollbar[data-v-336d3040]:hover{background:#565656}.text-formated-container .monaco-editor-con .monaco-editor .slider[data-v-336d3040]{border-radius:4px;background:#c1c1c1}.dark-mode .text-formated-container .monaco-editor-con .monaco-editor .slider[data-v-336d3040]{background:#5d676d}.text-formated-container .monaco-editor-con .monaco-editor .slider[data-v-336d3040]:hover{background:#7d7d7d}.monaco-editor-con .monaco-editor-background[data-v-336d3040],.monaco-editor-con .monaco-editor .inputarea.ime-input[data-v-336d3040],.monaco-editor-con .monaco-editor[data-v-336d3040],.text-formated-container .monaco-editor .margin[data-v-336d3040]{background-color:inherit}.monaco-editor-con .mtk4[data-v-336d3040]{color:#111}.dark-mode .monaco-editor-con .mtk4[data-v-336d3040]{color:#ebebec}.monaco-editor-con .mtk5[data-v-336d3040]{color:#42b983}.monaco-editor-con .mtk6[data-v-336d3040]{color:#fc1e70}.monaco-editor-con .mtk9[data-v-336d3040]{color:#111}.dark-mode .monaco-editor-con .mtk9[data-v-336d3040]{color:#b6b6b9}.monaco-editor-con .mtk1[data-v-336d3040]{color:#606266}.dark-mode .monaco-editor-con .mtk1[data-v-336d3040]{color:#f3f3f4}.monaco-editor[data-v-268d3bc5]{width:100%;height:500px}image-slot{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background:#f5f7fa;color:#909298;font-size:30px}.tools{position:absolute;left:0;top:0;right:0;display:flex}.tools>div{flex-grow:1}.tools button{margin:12px 16px}.el-col{margin-bottom:10px}
\ No newline at end of file
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0ecf0b3c"],{"1da1":function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));r("d3b7");function n(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(s){return void r(s)}c.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,u,"next",t)}function u(t){n(a,o,i,c,u,"throw",t)}c(void 0)}))}}},2909:function(t,e,r){"use strict";r.d(e,"a",(function(){return u}));var n=r("6b75");function o(t){if(Array.isArray(t))return Object(n["a"])(t)}var i=r("db90"),a=r("06c5");r("d9e2");function c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t){return o(t)||Object(i["a"])(t)||Object(a["a"])(t)||c()}},"4f96":function(t,e,r){"use strict";function n(t){if(Array.isArray(t))return t}r.d(e,"a",(function(){return c}));var o=r("db90"),i=r("06c5");r("d9e2");function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t){return n(t)||Object(o["a"])(t)||Object(i["a"])(t)||a()}},"96cf":function(t,e){!function(e){"use strict";var r,n=Object.prototype,o=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag",s="object"===typeof t,h=e.regeneratorRuntime;if(h)s&&(t.exports=h);else{h=e.regeneratorRuntime=s?t.exports:{},h.wrap=b;var f="suspendedStart",l="suspendedYield",d="executing",p="completed",y={},v={};v[a]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(P([])));g&&g!==n&&o.call(g,a)&&(v=g);var w=E.prototype=L.prototype=Object.create(v);j.prototype=w.constructor=E,E.constructor=j,E[u]=j.displayName="GeneratorFunction",h.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===j||"GeneratorFunction"===(e.displayName||e.name))},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(w),t},h.awrap=function(t){return{__await:t}},O(_.prototype),_.prototype[c]=function(){return this},h.AsyncIterator=_,h.async=function(t,e,r,n){var o=new _(b(t,e,r,n));return h.isGeneratorFunction(e)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},O(w),w[u]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},h.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){while(e.length){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},h.values=P,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,o){return c.type="throw",c.arg=t,e.next=n,o&&(e.method="next",e.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),y}}}function b(t,e,r,n){var o=e&&e.prototype instanceof L?e:L,i=Object.create(o.prototype),a=new N(n||[]);return i._invoke=k(t,r,a),i}function x(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}function L(){}function j(){}function E(){}function O(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function _(t){function e(r,n,i,a){var c=x(t[r],t,n);if("throw"!==c.type){var u=c.arg,s=u.value;return s&&"object"===typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then((function(t){e("next",t,i,a)}),(function(t){e("throw",t,i,a)})):Promise.resolve(s).then((function(t){u.value=t,i(u)}),a)}a(c.arg)}var r;function n(t,n){function o(){return new Promise((function(r,o){e(t,n,r,o)}))}return r=r?r.then(o,o):o()}this._invoke=n}function k(t,e,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return R()}r.method=o,r.arg=i;while(1){var a=r.delegate;if(a){var c=I(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=x(t,e,r);if("normal"===u.type){if(n=r.done?p:l,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}function I(t,e){var n=t.iterator[e.method];if(n===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=r,I(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=x(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,y;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,y):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function P(t){if(t){var e=t[a];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){while(++n<t.length)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}return{next:R}}function R(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())},a434:function(t,e,r){"use strict";var n=r("23e7"),o=r("da84"),i=r("23cb"),a=r("5926"),c=r("07fa"),u=r("7b0b"),s=r("65f0"),h=r("8418"),f=r("1dde"),l=f("splice"),d=o.TypeError,p=Math.max,y=Math.min,v=9007199254740991,m="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!l},{splice:function(t,e){var r,n,o,f,l,g,w=u(this),b=c(w),x=i(t,b),L=arguments.length;if(0===L?r=n=0:1===L?(r=0,n=b-x):(r=L-2,n=y(p(a(e),0),b-x)),b+r-n>v)throw d(m);for(o=s(w,n),f=0;f<n;f++)l=x+f,l in w&&h(o,f,w[l]);if(o.length=n,r<n){for(f=x;f<b-n;f++)l=f+n,g=f+r,l in w?w[g]=w[l]:delete w[g];for(f=b;f>b-n+r;f--)delete w[f-1]}else if(r>n)for(f=b-n;f>x;f--)l=f+n-1,g=f+r-1,l in w?w[g]=w[l]:delete w[g];for(f=0;f<r;f++)w[f+x]=arguments[f+2];return w.length=b-n+r,o}})},c90a:function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r("69d8"),o={};function i(t,e){Object(n["k"])(t,e);var r=o.echarts;!r&&window&&(r=window["echarts"]),e.data&&r&&("string"===typeof e.data&&(e.data=JSON.parse(e.data)),e.data.echarts&&(void 0!==e.elementId&&null!==e.elementId||(e.elementId=Object(n["m"])()),e.elementLoaded||(o[e.id]={div:Object(n["h"])(e)},e.elementLoaded=!0,document.body.appendChild(o[e.id].div),e.addToDiv(),o[e.id].chart=r.init(o[e.id].div,e.data.echarts.theme),e.elementRendered=!1,setTimeout((function(){o[e.id].chart.resize()}))),e.elementRendered||setTimeout((function(){o[e.id].chart.setOption(e.data.echarts.option,!0),o[e.id].chart.resize(),e.elementRendered=!0,setTimeout((function(){var t=new Image;t.src=o[e.id].chart.getDataURL({pixelRatio:2}),e.img=t}),100)}))))}function a(t){o.echarts=t,o.echarts||i||Object(n["j"])("https://cdn.bootcdn.net/ajax/libs/echarts/4.8.0/echarts.min.js",void 0,!0),Object(n["l"])("echarts",i,void 0,(function(t){t.iconRect=new n["f"](t.rect.x,t.rect.y,t.rect.width,t.rect.height),t.fullIconRect=t.rect}),void 0)}},db90:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),r("a630");function n(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}}}]);
\ No newline at end of file
......@@ -411,3 +411,26 @@ CREATE TABLE `images` (
SET FOREIGN_KEY_CHECKS = 1;
```
## 打包设置
### 前台设置
```
前端UI项目 修改 request.js 文件
window.document.location.pathname.substring(0, window.document.location.pathname.indexOf("/topology.html")) || "/"
```
### 后台设置
```
2、后端static修改
2.1 index.html 改为 topology.html,其他文件放入 新创建/topology文件下
2.2 修改topology.html,因为其他文件位置变了,所以引用js和css文件都需要改
href="/css...." 改为 href="topology/css...."
src="/js...." 改为 src="topology/js...."
js中引用的 js和css文件需单独处理
举例:
i.p+"js/" 改为 i.p+"topology/js/"
i.p+"css/" 改为 i.p+"topology/css/"
i.p="/" 改为 i.p=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/topology.html"))+"/"
```
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论