Commit 4c834c2c authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 304ba144 6d217452
......@@ -14,12 +14,11 @@
<!-- 富文本 -->
<quill-editor
class="editor ql-editor"
v-model="value"
v-model="contnet"
ref="myQuillEditor"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@change="onEditorChange($event)"
>
</quill-editor>
</div>
......@@ -106,9 +105,7 @@ export default {
data() {
return {
quillUpdateImg: false, // 根据图片上传状态来确定是否显示loading动画,刚开始是false,不显示
api: process.env.VUE_APP_API_BASE_URL.includes("base")
? process.env.VUE_APP_API_BASE_URL.replace("base", "")
: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_BASE_URL + "/",
editorOption: {
theme: "snow", // or 'bubble'
placeholder: "请输入文本......",
......@@ -151,7 +148,16 @@ export default {
},
};
},
computed: {
contnet: {
get() {
return this.value;
},
set(val) {
this.$emit("input", val);
},
},
},
methods: {
onEditorBlur() {
//失去焦点事件
......@@ -159,10 +165,6 @@ export default {
onEditorFocus() {
//获得焦点事件
},
onEditorChange() {
//内容改变事件
this.$emit("input", this.value);
},
// 富文本图片上传前
beforeUpload() {
......
......@@ -18,7 +18,7 @@ module.exports = {
multiPage: true, //多页签模式,true:开启,false:不开启
cachePage: true, //是否缓存页面数据,仅多页签模式下生效,true 缓存, false 不缓存
hideSetting: false, //隐藏设置抽屉,true:隐藏,false:不隐藏
systemName: "智慧政务一体化综合管理平台", //系统名称
systemName: "基础设置平台", //系统名称
copyright: "2021 ICZER 信宏翔科技有限公司", //copyright
asyncRoutes: false, //异步加载路由,true:开启,false:不开启
showPageTitle: true, //是否显示页面标题(PageLayout 布局中的页面标题),true:显示,false:不显示
......
......@@ -4,8 +4,8 @@
<a-layout-header class="header">
<div class="flex aic">
<router-link to="/" class="flex aic">
<!-- <img width="32" src="@/assets/img/logo.png" /> -->
<h1>{{ systemName }}</h1>
<img class="mr10" width="32" src="@/assets/img/logo.png" />
<h1 class="title">基础设置平台</h1>
</router-link>
<HeaderSite class="ml20"></HeaderSite>
</div>
......@@ -72,11 +72,12 @@ export default {
<style lang="less" scoped>
.ant-layout-header {
padding: 0px 24px;
background-color: #2681e8;
// background-color: #2681e8;
font-size: 14px;
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(90deg, #1845c6 0%, #2999ff 100%);
h1 {
color: #fff;
font-size: 16px;
......@@ -85,6 +86,10 @@ export default {
a {
color: #fff;
}
.title {
font-size: 20px;
font-weight: bold;
}
}
.main {
height: calc(100vh - 64px);
......
......@@ -157,7 +157,7 @@ export default {
<style lang="less" scoped>
.ant-dropdown-link {
padding: 0 20px;
font-size: 14px;
font-size: 16px;
min-width: 200px;
display: inline-block;
color: #fff;
......
......@@ -34,6 +34,22 @@
</a-form-model-item>
<a-form-model-item label="应用图标" prop="appIconPath">
<a-upload
name="file"
list-type="picture-card"
:action="api + 'base/file/commonupload'"
:file-list="iconFileList"
@change="handleChangeIcon"
:accept="accept"
:before-upload="iconBeforeUpload"
@preview="handlePreview"
>
<div v-if="iconFileList.length < 1">
<a-icon type="plus" />
<div class="ant-upload-text">选择图标</div>
</div>
</a-upload>
<!-- <a-upload
name="file"
list-type="picture-card"
class="avatar-uploader"
......@@ -51,7 +67,7 @@
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">选择图标</div>
</div>
</a-upload>
</a-upload> -->
</a-form-model-item>
<a-form-model-item label="应用简介" prop="summary">
<a-textarea
......@@ -150,6 +166,11 @@
<a-button type="primary" @click="onSubmit"> 保存 </a-button>
</a-space>
</div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-drawer>
</div>
</template>
......@@ -159,9 +180,11 @@ import YSwitch from "../../../../components/yswitch/YSwitch.vue";
import { saveApp } from "@/services/market";
import { mapGetters } from "vuex";
import { changeCodeNumber } from "@/utils/validate";
import PrevieModal from "@/components/PrevieModal.vue";
export default {
components: {
YSwitch,
PrevieModal,
},
props: {
title: {
......@@ -184,8 +207,12 @@ export default {
},
data() {
return {
accept: "image/jpeg,image/png,image/svg+xml",
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
previewData: {}, // 预览
previewVisible: false,
iconFileList: [],
labelCol: {
span: 3,
},
......@@ -290,27 +317,51 @@ export default {
// 图标上传之前
iconBeforeUpload(file) {
const isJpgOrPng =
file.type === "image/jpeg" || file.type === "image/png";
file.type === "image/jpeg" ||
file.type === "image/png" ||
file.type === "image/svg+xml";
if (!isJpgOrPng) {
this.$message.error("请上传jpeg或者png格式图片!");
this.$message.error("请上传jpeg、png或者svg格式图片!");
}
const isLt2M = file.size / 1024 / 1024 < 2;
if (!isLt2M) {
this.$message.error("图片大小不能超过 2MB!");
const isLt5M = file.size / 1024 / 1024 < 5;
if (!isLt5M) {
this.$message.error("图片大小不能超过 5MB!");
}
return isJpgOrPng && isLt2M;
return isJpgOrPng && isLt5M;
},
// 上传图标
handleChangeIcon(info) {
if (info.file.status === "uploading") {
this.loading = true;
return;
}
if (info.file.status === "done") {
this.form.appIconPath = info.file.response.url;
this.loading = false;
handleChangeIcon({ fileList }) {
// if (info.file.status === "uploading") {
// this.loading = true;
// return;
// }
// if (info.file.status === "done") {
// this.form.appIconPath = info.file.response.url;
// this.loading = false;
// }
this.iconFileList = [...fileList].slice(-1);
this.iconFileList = this.iconFileList.map((v) => {
if (v.response) {
v.url2 = v.response.url;
v.url = this.api2 + v.response.url;
}
return v;
});
if (this.iconFileList[0]) {
this.form.appIconPath = this.iconFileList[0].url2;
} else {
this.form.appIconPath = "";
}
},
// 预览
handlePreview(info) {
this.previewData = {
type: "img",
url: info.url,
};
this.previewVisible = true;
},
// 上传应用
handleChangeFile(info) {
let fileList = [...info.fileList];
......@@ -338,7 +389,6 @@ export default {
},
// 编辑
onEdit(data) {
console.log(data);
this.form = { ...data };
this.fileList = [
{
......@@ -348,6 +398,15 @@ export default {
url: this.form.filePath,
},
];
this.iconFileList = [
{
uid: "-2",
name: this.form.appIconPath,
status: "done",
url: this.api2 + this.form.appIconPath,
url2: this.form.appIconPath,
},
];
},
// 选中站点
changeSite(value, label) {
......
......@@ -57,6 +57,7 @@
</template>
<!-- 展现类型 -->
<template slot="displayType" slot-scope="text">
<!-- {{ text.displayType || "--" }} -->
<a-tag>{{ filterItems(text.displayType, dict.displayType) }} </a-tag>
</template>
<!-- 操作 -->
......
......@@ -41,6 +41,7 @@
</a-select>
</a-form-model-item>
<a-form-model-item label="展现类型" prop="displayType">
<!-- <a-input v-model="form.displayType" placeholder="请输入排序" /> -->
<a-select v-model="form.displayType" placeholder="请选择展现类型">
<a-select-option
v-for="(v, key) in dict.displayType"
......
package com.mortals.xhx.module.app.service.impl;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.ZipUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.google.common.net.InternetDomainName;
import com.mortals.framework.model.DbMatchMode;
import com.google.common.collect.Maps;
import cn.hutool.core.io.FileUtil;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.pdu.app.AppPdu;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.common.utils.ZipUtils;
import com.mortals.xhx.feign.app.device.IAppFeign;
import com.mortals.xhx.module.app.dao.AppDao;
import com.mortals.xhx.module.app.model.*;
import com.mortals.xhx.module.app.service.*;
import com.mortals.xhx.module.device.model.DeviceBlackappEntity;
import com.mortals.xhx.module.device.model.DeviceBlackappQuery;
import com.mortals.xhx.module.device.service.DeviceBlackappService;
import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.service.SiteService;
import com.mortals.xhx.utils.EncodeUtil;
import com.mortals.xhx.version.model.VersionEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.app.dao.AppDao;
import org.springframework.util.ObjectUtils;
import java.io.File;
......@@ -79,43 +69,31 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
private DeviceBlackappService deviceBlackappService;
/**
* @param params
* @param pageInfo
* @param context
* @return
* @throws AppException
*/
@Override
protected AppEntity findBefore(AppEntity params, PageInfo pageInfo, Context context) throws AppException {
return super.findBefore(params, pageInfo, context);
}
@Override
protected void findAfter(AppEntity params, PageInfo pageInfo, Context context, List<AppEntity> list) throws AppException {
//判断是否存在设备编码。存在 查询设备编码应用黑名单
checkDeviceBlackApp(params, list);
//根据指定的idlist顺序进行排序
sortAppByIdList(params, list);
//统计站点
list.forEach(item -> {
String domainUrl = "";
if (!ObjectUtils.isEmpty(params.getServerName()) && Validator.isIpv4(params.getServerName())) {
domainUrl = String.format("http://%s:%d", params.getServerName(), params.getServerPort() > 0 ? params.getServerPort() : 11078);
} else {
boolean isDomain = ReUtil.isMatch("^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*\\.[a-zA-Z]{2,}$", params.getServerName());
if (isDomain) {
domainUrl = String.format("https://%s", params.getServerName());
} else {
domainUrl = "";
}
}
for (AppEntity item : list) {
List<AppEntity> appEntityList = this.find(new AppQuery().appCode(item.getAppCode()), context);
item.setApplianceSiteScope(appEntityList.size());
item.setSiteIdList(appEntityList.stream().map(AppEntity::getSiteId).collect(Collectors.toList()));
//构建访问地址
SiteEntity siteEntity = siteService.getCache(item.getSiteId().toString());
String domainUrl = "";
if (!ObjectUtils.isEmpty(params.getServerName()) && Validator.isIpv4(params.getServerName())) {
domainUrl = String.format("http://%s:%d", params.getServerName(), params.getServerPort() > 0 ? params.getServerPort() : 11078);
} else {
boolean isDomain = ReUtil.isMatch("^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*\\.[a-zA-Z]{2,}$", params.getServerName());
if (isDomain) {
domainUrl = String.format("https://%s", params.getServerName());
} else {
domainUrl = "";
}
}
if (!ObjectUtils.isEmpty(siteEntity)) {
//请求地址 http://domian/app/siteCode/appcode/html
......@@ -137,7 +115,7 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
item.setAppIconUrl(item.getAppIconPath());
}
});
};
super.findAfter(params, pageInfo, context, list);
}
......@@ -331,6 +309,59 @@ public class AppServiceImpl extends AbstractCRUDServiceImpl<AppDao, AppEntity, L
return Rest.ok("克隆应用完成!");
}
/**
* @param appEntity
* @param context
* @return
*/
@Override
public Rest<String> cloneAppBySameSite(AppEntity appEntity, Context context) {
Long sourceAppId = appEntity.getSourceAppId();
Long targetAppId = appEntity.getTargetAppId();
AppEntity sourceAppEntity = this.get(sourceAppId, context);
AppEntity targetAppEntity = this.get(targetAppId, context);
//删除应用的数据集
Long[] delIds = targetAppEntity.getAppDatasetList().stream().map(i -> i.getId()).toArray(Long[]::new);
if (ObjectUtils.isEmpty(delIds)) {
appDatasetService.remove(delIds, context);
}
//保存数据集
List<AppDatasetEntity> appDatasetList = sourceAppEntity.getAppDatasetList();
if (!ObjectUtils.isEmpty(appDatasetList)) {
for (AppDatasetEntity appDatasetEntity : appDatasetList) {
AppDatasetEntity appDatasetClone = new AppDatasetEntity();
appDatasetClone.initAttrValue();
BeanUtils.copyProperties(appDatasetEntity, appDatasetClone, BeanUtil.getNullPropertyNames(appDatasetEntity));
appDatasetClone.setAppId(targetAppEntity.getId());
appDatasetService.save(appDatasetClone, context);
//查询属性列表
List<AppInfoFieldEntity> appInfoFieldList = appInfoFieldService.find(new AppInfoFieldQuery().datasetId(appDatasetEntity.getId()));
if (!ObjectUtils.isEmpty(appInfoFieldList)) {
ArrayList<AppInfoFieldEntity> cloneList = new ArrayList<>();
for (AppInfoFieldEntity appInfoFieldEntity : appInfoFieldList) {
AppInfoFieldEntity appInfoFieldClone = new AppInfoFieldEntity();
appInfoFieldClone.initAttrValue();
BeanUtils.copyProperties(appInfoFieldEntity, appInfoFieldClone, BeanUtil.getNullPropertyNames(appInfoFieldEntity));
appInfoFieldClone.setDatasetId(appDatasetClone.getId());
cloneList.add(appInfoFieldClone);
}
if (!ObjectUtils.isEmpty(cloneList)) {
appInfoFieldService.save(cloneList, context);
}
}
}
}
return Rest.ok();
}
@Override
public AppDao getAppDao() {
......
......@@ -15,13 +15,17 @@ import java.util.List;
@Data
public class SkinBaseVo extends BaseEntityLong {
/** 产品编码 */
private String productCode;
private String imageResolutionValue;
private String serverName;
private Integer serverPort;
/** 属性列表 */
private List<SkinFieldEntity> skinFieldList;
......
package com.mortals.xhx.module.skin.service.impl;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.net.URLDecoder;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.exception.AppException;
......@@ -78,31 +80,50 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
protected void findAfter(SkinBaseEntity entity, PageInfo pageInfo, Context context, List<SkinBaseEntity> list) throws AppException {
Map<String, String> imageResolutionMap = paramService.getParamBySecondOrganize("SkinBase", "imageResolution");
list.stream().forEach(item -> {
String domainUrl = "";
if (!ObjectUtils.isEmpty(entity.getServerName()) && Validator.isIpv4(entity.getServerName())) {
domainUrl = String.format("http://%s:%d", entity.getServerName(), entity.getServerPort() > 0 ? entity.getServerPort() : 11078);
} else {
boolean isDomain = ReUtil.isMatch("^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*\\.[a-zA-Z]{2,}$", entity.getServerName());
if (isDomain) {
domainUrl = String.format("https://%s", entity.getServerName());
} else {
domainUrl = "";
}
}
for (SkinBaseEntity item : list) {
List<SkinFieldEntity> skinFieldEntities = skinFieldService.find(new SkinFieldQuery().skinId(item.getId()));
String domain = GlobalSysInfo.getParamValue(Constant.DOMAIN, "http://192.168.0.98:11071/");
skinFieldEntities.forEach(field -> {
// String domain = GlobalSysInfo.getParamValue(Constant.DOMAIN, "http://192.168.0.98:11071/");
for (SkinFieldEntity field : skinFieldEntities) {
if ("2".equals(field.getFieldType())) {
UrlBuilder builder = UrlBuilder.ofHttp(domain, CharsetUtil.CHARSET_UTF_8).addPath(field.getFieldValue());
field.setFieldValueUrl(builder.build());
String fieldUrl = String.format("%s/%s", domainUrl, field.getFieldValue());
//UrlBuilder builder = UrlBuilder.ofHttp(domainUrl, CharsetUtil.CHARSET_UTF_8).addPath(field.getFieldValue());
field.setFieldValueUrl(fieldUrl);
}
});
}
ProductEntity productEntity = productService.get(item.getProductId());
item.setProductCode(productEntity == null ? "" : productEntity.getProductCode());
item.setImageResolutionValue(imageResolutionMap.get(entity.getImageResolution() == null ? "1" : entity.getImageResolution()));
item.setSkinFieldList(skinFieldEntities);
if (!ObjectUtils.isEmpty(item.getPreviewImagePath())) {
UrlBuilder builder = UrlBuilder.ofHttp(domain, CharsetUtil.CHARSET_UTF_8).addPath(item.getPreviewImagePath());
item.setPreviewImagePath(builder.build());
// UrlBuilder builder = UrlBuilder.ofHttp(domainUrl, CharsetUtil.CHARSET_UTF_8).addPath(item.getPreviewImagePath());
String fieldUrl = String.format("%s/%s", domainUrl, item.getPreviewImagePath());
// item.setPreviewImagePath(builder.build());
item.setPreviewImagePath(fieldUrl);
//log.info("cssUrl:" + URLDecoder.decode(item.getPreviewImagePath(), CharsetUtil.CHARSET_UTF_8));
}
if (!ObjectUtils.isEmpty(item.getCssFilePath())) {
UrlBuilder builder = UrlBuilder.ofHttp(domain, CharsetUtil.CHARSET_UTF_8).addPath(item.getCssFilePath());
item.setCssFilePath(builder.build());
//UrlBuilder builder = UrlBuilder.ofHttp(domainUrl, CharsetUtil.CHARSET_UTF_8).addPath(item.getCssFilePath());
//item.setCssFilePath(builder.build());
String fieldUrl = String.format("%s/%s", domainUrl, item.getCssFilePath());
item.setCssFilePath(fieldUrl);
//log.info("cssUrl:" + URLDecoder.decode(item.getCssFilePath(), CharsetUtil.CHARSET_UTF_8));
}
});
}
super.findAfter(entity, pageInfo, context, list);
}
......
package com.mortals.xhx.module.skin.web;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.key.Constant;
......@@ -13,14 +17,17 @@ import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.module.skin.model.SkinFieldEntity;
import com.mortals.xhx.module.skin.model.SkinFieldQuery;
import com.mortals.xhx.module.skin.service.SkinFieldService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.skin.model.SkinBaseEntity;
import com.mortals.xhx.module.skin.model.SkinBaseQuery;
......@@ -33,21 +40,26 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 系统基础皮肤
*
* @author zxfei
* @date 2022-05-24
*/
* 系统基础皮肤
*
* @author zxfei
* @date 2022-05-24
*/
@RestController
@RequestMapping("skin/base")
public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBaseService,SkinBaseEntity,Long> {
@Slf4j
public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBaseService, SkinBaseEntity, Long> {
@Autowired
private ParamService paramService;
......@@ -56,21 +68,27 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa
@Autowired
private SkinFieldService skinFieldService;
public SkinBaseController(){
super.setModuleDesc( "系统基础皮肤");
public SkinBaseController() {
super.setModuleDesc("系统基础皮肤");
}
@Override
protected void doListBefore(SkinBaseEntity query, Map<String, Object> model, Context context) throws AppException {
if(!ObjectUtils.isEmpty(query.getProductCode())){
if (!ObjectUtils.isEmpty(query.getProductCode())) {
ProductEntity productEntity = productService.selectOne(new ProductQuery().productCode(query.getProductCode()));
if(!ObjectUtils.isEmpty(productEntity)){
if (!ObjectUtils.isEmpty(productEntity)) {
query.setProductId(productEntity.getId());
query.setProductCode(null);
}
}
String serverName = request.getHeader("server-name");
Integer serverPort = DataUtil.converStr2Int(request.getHeader("server-port"), 0);
log.info("【应用请求】【请求体】-->serverName{} ,port:{}", serverName, serverPort);
query.setServerName(serverName);
query.setServerPort(serverPort);
super.doListBefore(query, model, context);
}
......@@ -85,17 +103,37 @@ public class SkinBaseController extends BaseCRUDJsonBodyMappingController<SkinBa
@Override
protected int viewAfter(Long id, Map<String, Object> model, SkinBaseEntity entity, Context context) throws AppException {
List<SkinFieldEntity> skinFieldEntities = skinFieldService.find(new SkinFieldQuery().skinId(entity.getId()));
skinFieldEntities.forEach(skinFieldEntity -> updateUrl(skinFieldEntity));
entity.setSkinFieldList(skinFieldEntities);
return super.viewAfter(id, model, entity, context);
}
private void updateUrl(SkinFieldEntity field) {
if ("2".equals(field.getFieldType())) {
String domain = GlobalSysInfo.getParamValue(Constant.DOMAIN, "http://192.168.0.98:11071/");
UrlBuilder builder = UrlBuilder.ofHttp(domain, CharsetUtil.CHARSET_UTF_8).addPath(field.getFieldValue());
field.setFieldValue(builder.build());
String serverName = request.getHeader("server-name");
Integer serverPort = DataUtil.converStr2Int(request.getHeader("server-port"), 0);
String domainUrl = "";
if (!ObjectUtils.isEmpty(serverName) && Validator.isIpv4(serverName)) {
domainUrl = String.format("http://%s:%d",serverName, serverPort > 0 ? serverPort : 11078);
} else {
boolean isDomain = ReUtil.isMatch("^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*\\.[a-zA-Z]{2,}$", entity.getServerName());
if (isDomain) {
domainUrl = String.format("https://%s", serverName);
} else {
serverName = "";
}
}
for (SkinFieldEntity field : skinFieldEntities) {
if ("2".equals(field.getFieldType())) {
// String domain = GlobalSysInfo.getParamValue(Constant.DOMAIN, "http://192.168.0.98:11071/");
// UrlBuilder builder = UrlBuilder.ofHttp(domain, CharsetUtil.CHARSET_UTF_8).addPath(field.getFieldValue());
// field.setFieldValue(builder.build());
String fieldUrl = String.format("%s/%s", domainUrl, field.getFieldValue());
field.setFieldValueUrl(fieldUrl);
}
}
entity.setSkinFieldList(skinFieldEntities);
return super.viewAfter(id, model, entity, context);
}
......
......@@ -19,7 +19,7 @@ Content-Type: application/json
{
"page":1,
"size":10
"size":1
}
......
......@@ -11,6 +11,3 @@ VUE_APP_API_PHP_URL=http://8.136.255.30:8090
#正式
VUE_APP_API_PRP_RUL=http://112.19.80.237:11007
#易政秀报表
VUE_APP_API_TEST_RUL=http://8.136.255.30
This diff is collapsed.
import http from "../request/http";
let baseURL = process.env.VUE_APP_API_TEST_RUL
let baseURL = "http://8.136.255.30"
let proURL = process.env.VUE_APP_API_PRP_RUL;
// 查询客户管理列表
......
......@@ -190,4 +190,4 @@ export function getImpossibleInfo(params) {
*/
export function getKqalert(params) {
return http.get(`${BASEURL}/admin/kqalert/list`, params);
}
}
\ No newline at end of file
import http from "../request/http";
let baseURL = process.env.VUE_APP_API_BASE_URL;
// ----------ps-----------------
// 查询产品信息列表
export function getProduct(params) {
return http.post(`${baseURL}/zwfw/product/list`, params);
}
// 产品信息
export function saveProduct(params) {
return http.post(`${baseURL}/zwfw/product/save`, params);
}
// 产品信息
export function deleteProduct(params) {
return http.get(`${baseURL}/zwfw/product/delete`, params);
}
//-------------xj: --------------------
// 产品接口
export function getInterfaceList(params) {
return http.post(`${baseURL}/zwfw/product/interface/list`, params);
}
// 新增编辑产品接口
export function getInterfaceSave(params) {
return http.post(`${baseURL}/zwfw/product/interface/save`, params);
}
// 查看产品接口
export function getInterfaceInfo(params) {
return http.get(`${baseURL}/zwfw/product/interface/info`, params);
}
// 删除产品接口
export function getInterfaceDelete(params) {
return http.get(`${baseURL}/zwfw/product/interface/delete`, params);
}
\ No newline at end of file
......@@ -4,7 +4,8 @@
<div>
<a-button
:loading="btnLoading"
type="primary" class="addclass"
type="primary"
class="addclass"
@click="handleExportTable"
>
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
......@@ -50,7 +51,9 @@
>
</a-range-picker>
<a-button type="primary" class="addclass" @click="handleSearch">搜索</a-button>
<a-button type="primary" class="addclass" @click="handleSearch"
>搜索</a-button
>
<a-button @click="handleReset">重置</a-button>
</a-space>
</span>
......@@ -184,7 +187,7 @@ export default {
searchName: undefined,
searchForm: {
type: 1, // 事项或者材料搜索
type: 2, // 事项或者材料搜索
status: "", // 打印或者提交
searchName: "", // 搜索内容
BegindAndEndTime: [
......
......@@ -28,10 +28,14 @@
orderInfo.endtime
}}
</p>
<p>
<span>预约方式:</span>{{ orderInfo.up_type=='phone'?'微官网':orderInfo.up_type=='app'?'自助终端':orderInfo.up_type=='tftb'?'天府通办':'--' }}
</p>
</div>
<div class="qrcode">
<!-- <img src="~@/assets/images/logo.png" alt="" />
<p>预约信息二维码</p> -->
<!-- <img src="~@/assets/images/logo.png" alt="" /> -->
<img :src="baseurl + '/'+ orderInfo.qrcode" alt="" />
<p>预约信息二维码</p>
</div>
</div>
<ul class="bottom">
......@@ -145,6 +149,7 @@ export default {
statusItem,
style,
orderInfo: {}, // 预约信息
baseurl: process.env.VUE_APP_API_PHP_URL,
};
},
......
......@@ -4,7 +4,8 @@
<div>
<a-button
:loading="btnLoading"
type="primary" class="addclass"
type="primary"
class="addclass"
@click="handleExportTable"
>
<span>{{ tableSelectedRows.length ? "导出" : "导出全部" }}</span>
......@@ -40,7 +41,9 @@
>
</a-range-picker>
<a-button type="primary" class="addclass" @click="handleSearch">搜索</a-button>
<a-button type="primary" class="addclass" @click="handleSearch"
>搜索</a-button
>
<a-button @click="handleReset">重置</a-button>
</a-space>
</span>
......@@ -140,7 +143,7 @@ export default {
},
],
searchForm: {
type: 1, // 事项或者材料搜索
type: 2, // 事项或者材料搜索
status: "", // 打印或者提交
searchName: "", // 搜索内容
BegindAndEndTime: [
......
......@@ -2,6 +2,7 @@
<a-layout class="Container">
<a-layout-header class="header_box">
<div class="logo">
<img style="width: 40px;margin-right: 20px;" src="@/assets/images/logo.jpg" alt="">
<i class="title">智慧大厅集成化综合管理平台</i>
<!-- <i class="title">智慧政务一体化综合管理平台4.0</i> -->
<div class="selectOnptions">
......
......@@ -2,14 +2,14 @@
<div class="PoliticsShow-Container">
<div class="header_box">
<div>
<button class="add_btn">
<button class="add_btn" @click="openDetails('新增',{})">
<span>新增</span>
</button>
</div>
<span>
<a-input
allowClear
v-model="searchName"
v-model="query.interfaceName"
placeholder="请输入接口名称查询"
>
<a-icon slot="prefix" type="search" />
......@@ -67,14 +67,14 @@
:dataSource="tableSourceData"
>
<template slot="operation" slot-scope="text, record, index">
<a-button type="link" @click="openDetails"
>详情{{ index + 1 }}</a-button
<a-button type="link" @click="openDetails('详情',record)"
>详情</a-button
>
<a-button type="link" @click="openDetails"
>编辑{{ index + 1 }}</a-button
<a-button type="link" @click="openDetails('编辑',record)"
>编辑</a-button
>
<a-button type="link" style="color: #ff4420"
>删除{{ index + 1 }}</a-button
>删除</a-button
>
</template>
</a-table>
......@@ -86,6 +86,7 @@
<script>
import table from "@/mixins/table";
import Details from "./components/Details.vue";
import {getInterfaceList} from '@/api/thePlatformIsSet.js'
export default {
mixins: [table],
name: "PortalAdminVueAlerting",
......@@ -103,42 +104,47 @@ export default {
{
title: "API名称",
align: "center",
dataIndex: "API名称",
dataIndex: "interfaceName",
},
{
title: "请求类型",
align: "center",
dataIndex: "请求类型",
dataIndex: "requestType",
customRender: (text, record, index) => `${record.requestType == 1 ? 'POST' : 'GET'}`,
},
{
title: "标签",
align: "center",
dataIndex: "标签",
dataIndex: "interfaceTag",
},
{
title: "请求协议",
align: "center",
dataIndex: "请求协议",
dataIndex: "requestProtocol",
customRender: (text, record, index) => `${record.requestProtocol == 1 ? 'HTTP' : 'HTTPS'}`,
},
{
title: "版本",
align: "center",
dataIndex: "版本",
dataIndex: "versionNumber",
},
{
title: "来源",
align: "center",
dataIndex: "来源",
dataIndex: "interfaceSource",
customRender: (text, record, index) => `${record.interfaceSource == 1 ? '自有' : '非自有'}`,
},
{
title: "策略",
align: "center",
dataIndex: "策略",
dataIndex: "limitStrategy",
customRender: (text, record, index) => `${record.limitStrategy == 1 ? '分钟' : '小时'}`,
},
{
title: "访问网络",
align: "center",
dataIndex: "访问网络",
dataIndex: "network",
customRender: (text, record, index) => `${record.network == 1 ? '互联网' : '政务网'}`,
},
{
......@@ -151,29 +157,26 @@ export default {
},
},
],
searchName: undefined,
query:{
interfaceName: undefined,
page:1,
size:10,
},
total:0
};
},
components: {
Details,
},
mounted() {
this.setMoment();
for (let key = 0; key < 20; key++) {
this.tableSourceData.push({
id: `00${key + 1}`,
API名称: `排队信息查询接口${key + 1}`,
请求类型: `POST${key + 1}`,
标签: `政务外网${key + 1}`,
请求协议: `HTTP${key + 1}`,
版本: `v1.0${key + 1}`,
来源: `自有${key + 1}`,
策略: `--${key + 1}`,
访问网络: `互联网${key + 1}`,
});
}
this.getList();
},
methods: {
getList() {
getInterfaceList(this.query).then(res=>{
this.tableSourceData = res.data.data
})
},
QueueState(type) {
switch (type) {
case 0:
......@@ -185,8 +188,8 @@ export default {
return "type0";
}
},
openDetails() {
this.$refs.Details.modalInfo.title = "新增接口";
openDetails(type) {
this.$refs.Details.modalInfo.title = type;
this.$refs.Details.modalInfo.visible = true;
this.$refs.Details.modalInfo.width = "55%";
},
......
<template>
<a-modal
:title="VisibleTitle"
:centered="true"
:destroyOnClose="true"
:visible="Visible"
@cancel="Visible = false"
width="30%"
>
<a-form-model
:label-col="{
span: 5,
}"
:wrapper-col="{
span: 19,
}"
layout="horizontal"
ref="appInfoFome"
:model="appInfoFome"
:rules="appInfoRules"
>
<a-form-model-item label="产品名称" prop="appName">
<a-input
placeholder="请输入产品名称"
allowClear
v-model="appInfoFome.appName"
/>
<a-modal :title="VisibleTitle" :centered="true" :destroyOnClose="true" :visible="Visible" @cancel="Visible = false"
width="30%">
<a-form-model :label-col="{
span: 5,
}" :wrapper-col="{
span: 19,
}" layout="horizontal" ref="appInfoFome" :model="appInfoFome" :rules="appInfoRules">
<a-form-model-item label="产品名称" prop="productName">
<a-input placeholder="请输入产品名称" allowClear v-model="appInfoFome.productName" />
</a-form-model-item>
</a-form-model>
<template slot="footer">
<a-button type="primary" class="addclass" @click="Modal_Ok">确定</a-button>
<a-button type="primary" class="addclass" @click="Modal_Ok">确定</a-button>
<a-button @click="resetForm">重置</a-button>
</template>
</a-modal>
</template>
<script>
import { saveProduct } from "@/api/thePlatformIsSet.js";
export default {
name: "PortalAdminVueAddEditAppName",
data() {
......@@ -42,14 +26,15 @@ export default {
Visible: false, //模态
VisibleTitle: "新增产品",
appInfoFome: {
appName: undefined,
productName: undefined,
siteId: JSON.parse(localStorage.getItem("siteId"))
}, //页面表单信息
appInfoRules: {
appName: [
productName: [
{
required: true, //是否必选
whitespace: true, //必选时,空格是否会被视为错误
message: "请输入用户名称",
message: "请输入产品名称",
trigger: "blur",
},
// {
......@@ -61,12 +46,22 @@ export default {
};
},
mounted() {},
mounted() { },
methods: {
Modal_Ok() {
this.$refs.appInfoFome.validate((valid) => {
if (valid) {
console.log(this.appInfoFome);
saveProduct(this.appInfoFome).then(res => {
let { code, msg } = res
if (code == 1) {
this.$message.success('保存成功');
this.resetForm();
this.Visible = false
this.$parent.getList()
} else {
this.$message.error(msg);
}
})
} else {
this.$message.error(`请完善表单信息!`);
return false;
......@@ -75,7 +70,7 @@ export default {
},
resetForm() {
this.$nextTick(() => {
this.$refs.appInfoFome.resetFields();
this.appInfoFome.productName = ''
});
},
},
......
......@@ -4,29 +4,31 @@
<h3>产品管理</h3>
<h4>
<a-input placeholder="请输入产品名称关键字查询" v-model="searchVal" />
<button class="search_btn btn">
<button class="search_btn btn" @click="getList">
<span>查询</span>
</button>
</h4>
</div>
<div class="main">
<a-button type="primary" class="addclass add_btn" ghost @click="showModal(2)">
<a-button type="primary" class="addclass add_btn" ghost @click="showModal()">
新增产品
</a-button>
<ul class="content">
<li class="list" v-for="item of 5" :key="item">
<li class="list" v-for="item, index of listData" :key="index">
<a-popover placement="leftBottom">
<template slot="content">
<div class="popoverContent">
<p>
<a-button type="link" size="small" style="color: #0595fd" @click="showModal(1)">
<a-button type="link" size="small" style="color: #0595fd" @click="showModal(item)">
编辑
</a-button>
</p>
<p>
<a-button type="link" size="small" style="color: #ff4d4f">
删除
</a-button>
<a-popconfirm title="确定要删除此产品吗?" ok-text="Yes" cancel-text="No" @confirm="delModal(item)">
<a-button type="link" size="small" style="color: #ff4d4f">
删除
</a-button>
</a-popconfirm>
</p>
</div>
</template>
......@@ -34,13 +36,15 @@
</a-popover>
<img src="~@/assets/images/u52.png" alt="" class="app-img" />
<div class="app-name">排号系统</div>
<div class="app-name">{{ item.productName }}</div>
<ul class="app-option">
<li @click="routerpush1">接口管理<a-icon type="right" /></li>
<li @click="routerpush2">应用管理<a-icon type="right" /></li>
<li @click="routerpush3">文档资料<a-icon type="right" /></li>
<li @click="routerpush1(item)">接口管理<a-icon type="right" /></li>
<li @click="routerpush2(item)">应用管理<a-icon type="right" /></li>
<li @click="routerpush3(item)">文档资料<a-icon type="right" /></li>
</ul>
</li>
<div class="not-data" v-if="!listData.length">暂无数据</div>
</ul>
</div>
<AddEditAppName ref="AddEditAppName" />
......@@ -48,52 +52,80 @@
</template>
<script>
import { getProduct, deleteProduct } from "@/api/thePlatformIsSet.js";
import AddEditAppName from "./components/addEditAppName.vue";
export default {
name: "PortalAdminVueProductManage",
data() {
return {
searchVal: undefined,
searchVal: '',
listData: []
};
},
components: {
AddEditAppName,
},
mounted() { },
mounted() {
this.getList()
},
methods: {
delModal(item) {
deleteProduct({
id: item.id
}).then((res) => {
let { code, msg } = res
if (code == 1) {
this.$message.success('删除成功');
this.getList()
} else {
this.$message.error(msg);
}
})
},
getList() {
getProduct({
page: 1,
size: -1,
productName: this.searchVal
}).then((res) => {
this.listData = res.data.data
})
},
pushroeuter() {
this.$router.push({
path: "/home/thePlatformIsSet/portDocument",
// query: { testoption: "test001" },
});
},
showModal(type) {
if (type == 1) {
showModal(item) {
if (item) {
this.$refs.AddEditAppName.VisibleTitle = "编辑";
} else if (type == 2) {
this.$refs.AddEditAppName.appInfoFome.id = item.id
this.$refs.AddEditAppName.appInfoFome.productName = item.productName
} else {
this.$refs.AddEditAppName.VisibleTitle = "新增产品";
}
this.$refs.AddEditAppName.Visible = true;
},
routerpush1() {
routerpush1(item) {
// 测试
this.$router.push({
path: `/home/thePlatformIsSet/InterfaceManage/manage`,
// query: { testoption: "test001" },
query: { id: item.id },
});
},
routerpush2() {
routerpush2(item) {
// 测试
this.$router.push({
path: `/home/thePlatformIsSet/appManage/application`,
// query: { testoption: "test001" },
query: { id: item.id },
});
},
routerpush3() {
routerpush3(item) {
// 测试
this.$router.push({
path: `/home/thePlatformIsSet/docData/fileData`,
// query: { testoption: "test001" },
query: { id: item.id },
});
},
},
......@@ -101,6 +133,13 @@ export default {
</script>
<style lang="less" scoped>
.not-data{
line-height: 100px;
text-align: center;
width: 100%;
color: #999;
font-size: 14px;
}
@headerH: 4.5rem;
.Container {
......@@ -319,4 +358,5 @@ export default {
rgba(108, 53, 247, 1) 85%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3b87ff", endColorstr="#6c35f7", GradientType=1);
}
}</style>
}
</style>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment