Former-commit-id: 2d6357f3978d4c0d62d2fa2baef8e7c9136a72b2
master
wangbing 5 years ago
parent 884c6e4fa5
commit 95295edda4

@ -18,7 +18,7 @@ public class CacheConfig {
@Bean(name = TOKEN_CACHE) @Bean(name = TOKEN_CACHE)
public EhCacheCacheManager getCacheManager() { public EhCacheCacheManager getCacheManager() {
net.sf.ehcache.config.Configuration configuration = new net.sf.ehcache.config.Configuration(); net.sf.ehcache.config.Configuration configuration = new net.sf.ehcache.config.Configuration();
configuration.setMaxBytesLocalHeap("1G"); configuration.setMaxBytesLocalHeap("100M");
configuration.updateCheck(false); configuration.updateCheck(false);
configuration.addDiskStore(new DiskStoreConfiguration().path("java.io.tmpdir")); configuration.addDiskStore(new DiskStoreConfiguration().path("java.io.tmpdir"));
CacheManager cacheManager = CacheManager.create(configuration); CacheManager cacheManager = CacheManager.create(configuration);

@ -10,7 +10,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-25 * @since 2019-12-26
*/ */
@SheetName("资源") @SheetName("资源")
public class Resource extends BaseEntity { public class Resource extends BaseEntity {
@ -28,23 +28,17 @@ public class Resource extends BaseEntity {
@ColumnDescription("") @ColumnDescription("")
private String comment; private String comment;
/** /**
* RESOURCE_TYPE - * RESOURCE_MODULE -
*/
@ColumnName("资源类型")
@ColumnDescription("")
private String resourceType;
/**
* NODE -
*/ */
@ColumnName("是否节点") @ColumnName("资源模块")
@ColumnDescription("") @ColumnDescription("")
private Boolean node; private String resourceModule;
/** /**
* SUP_ID - * RESOURCE_TYPE -
*/ */
@ColumnName("上级主键") @ColumnName("资源类型")
@ColumnDescription("") @ColumnDescription("")
private Long supId; private String resourceType;
/** /**
* VALID - * VALID -
*/ */
@ -68,28 +62,20 @@ public class Resource extends BaseEntity {
this.comment = comment; this.comment = comment;
} }
public String getResourceType() { public String getResourceModule() {
return this.resourceType; return this.resourceModule;
} }
public void setResourceType(String resourceType) { public void setResourceModule(String resourceModule) {
this.resourceType = resourceType; this.resourceModule = resourceModule;
}
public Boolean getNode() {
return this.node;
}
public void setNode(Boolean node) {
this.node = node;
} }
public Long getSupId() { public String getResourceType() {
return this.supId; return this.resourceType;
} }
public void setSupId(Long supId) { public void setResourceType(String resourceType) {
this.supId = supId; this.resourceType = resourceType;
} }
public Boolean getValid() { public Boolean getValid() {

@ -7,16 +7,15 @@
<sql id="table">`SYS_RESOURCE`</sql> <sql id="table">`SYS_RESOURCE`</sql>
<sql id="entityColumnList"> <sql id="entityColumnList">
`ID`,`VALUE`,`COMMENT`,`RESOURCE_TYPE`,`NODE`,`SUP_ID`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` `ID`,`VALUE`,`COMMENT`,`RESOURCE_MODULE`,`RESOURCE_TYPE`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
</sql> </sql>
<resultMap id="resource" type="${basePackage}.module.system.ent.Resource"> <resultMap id="resource" type="${basePackage}.module.system.ent.Resource">
<result column="ID" jdbcType="BIGINT" property="id"/> <result column="ID" jdbcType="BIGINT" property="id"/>
<result column="VALUE" jdbcType="VARCHAR" property="value"/> <result column="VALUE" jdbcType="VARCHAR" property="value"/>
<result column="COMMENT" jdbcType="VARCHAR" property="comment"/> <result column="COMMENT" jdbcType="VARCHAR" property="comment"/>
<result column="RESOURCE_MODULE" jdbcType="VARCHAR" property="resourceModule"/>
<result column="RESOURCE_TYPE" jdbcType="VARCHAR" property="resourceType"/> <result column="RESOURCE_TYPE" jdbcType="VARCHAR" property="resourceType"/>
<result column="NODE" jdbcType="BIT" property="node"/>
<result column="SUP_ID" jdbcType="BIGINT" property="supId"/>
<result column="VALID" jdbcType="BIT" property="valid"/> <result column="VALID" jdbcType="BIT" property="valid"/>
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/> <result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/> <result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
@ -39,15 +38,12 @@
<if test="request.comment != null and request.comment != ''"> <if test="request.comment != null and request.comment != ''">
AND `COMMENT` = ${r"#"}{request.comment} AND `COMMENT` = ${r"#"}{request.comment}
</if> </if>
<if test="request.resourceModule != null and request.resourceModule != ''">
AND `RESOURCE_MODULE` = ${r"#"}{request.resourceModule}
</if>
<if test="request.resourceType != null and request.resourceType != ''"> <if test="request.resourceType != null and request.resourceType != ''">
AND `RESOURCE_TYPE` = ${r"#"}{request.resourceType} AND `RESOURCE_TYPE` = ${r"#"}{request.resourceType}
</if> </if>
<if test="request.node != null">
AND `NODE` = ${r"#"}{request.node}
</if>
<if test="request.supId != null and request.supId != 0">
AND `SUP_ID` = ${r"#"}{request.supId}
</if>
<if test="request.valid != null"> <if test="request.valid != null">
AND `VALID` = ${r"#"}{request.valid} AND `VALID` = ${r"#"}{request.valid}
</if> </if>
@ -76,9 +72,8 @@
${r"#"}{request.id}, ${r"#"}{request.id},
${r"#"}{request.value,jdbcType=VARCHAR}, ${r"#"}{request.value,jdbcType=VARCHAR},
${r"#"}{request.comment,jdbcType=VARCHAR}, ${r"#"}{request.comment,jdbcType=VARCHAR},
${r"#"}{request.resourceModule,jdbcType=VARCHAR},
${r"#"}{request.resourceType,jdbcType=VARCHAR}, ${r"#"}{request.resourceType,jdbcType=VARCHAR},
${r"#"}{request.node,jdbcType=BIT},
${r"#"}{request.supId,jdbcType=BIGINT},
${r"#"}{request.valid,jdbcType=BIT}, ${r"#"}{request.valid,jdbcType=BIT},
0, 0,
0, 0,
@ -101,9 +96,8 @@
${r"#"}{item.id}, ${r"#"}{item.id},
${r"#"}{item.value,jdbcType=VARCHAR}, ${r"#"}{item.value,jdbcType=VARCHAR},
${r"#"}{item.comment,jdbcType=VARCHAR}, ${r"#"}{item.comment,jdbcType=VARCHAR},
${r"#"}{item.resourceModule,jdbcType=VARCHAR},
${r"#"}{item.resourceType,jdbcType=VARCHAR}, ${r"#"}{item.resourceType,jdbcType=VARCHAR},
${r"#"}{item.node,jdbcType=BIT},
${r"#"}{item.supId,jdbcType=BIGINT},
${r"#"}{item.valid,jdbcType=BIT}, ${r"#"}{item.valid,jdbcType=BIT},
0, 0,
0, 0,
@ -129,9 +123,8 @@
SET SET
`VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR}, `VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR},
`COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR}, `COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR},
`RESOURCE_MODULE` = ${r"#"}{request.resourceModule,jdbcType=VARCHAR},
`RESOURCE_TYPE` = ${r"#"}{request.resourceType,jdbcType=VARCHAR}, `RESOURCE_TYPE` = ${r"#"}{request.resourceType,jdbcType=VARCHAR},
`NODE` = ${r"#"}{request.node,jdbcType=BIT},
`SUP_ID` = ${r"#"}{request.supId,jdbcType=BIGINT},
`VALID` = ${r"#"}{request.valid,jdbcType=BIT}, `VALID` = ${r"#"}{request.valid,jdbcType=BIT},
`ROW_VERSION` = `ROW_VERSION` + 1, `ROW_VERSION` = `ROW_VERSION` + 1,
`LAST_UPDATE_BY` = ${r"#"}{token.userId}, `LAST_UPDATE_BY` = ${r"#"}{token.userId},

@ -11,7 +11,7 @@ import ${basePackage}.frame.validation.Dict;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-22 * @since 2019-12-26
*/ */
public class ResourceCreateRequest extends BaseRequest { public class ResourceCreateRequest extends BaseRequest {
@ -28,6 +28,13 @@ public class ResourceCreateRequest extends BaseRequest {
@Length(min = 0, max = 255, message = "[comment]资源描述长度不合法(0-255)") @Length(min = 0, max = 255, message = "[comment]资源描述长度不合法(0-255)")
private String comment; private String comment;
/**
*
*/
@NotNull(message = "[resourceModule]资源模块不能为NULL")
@Dict(name = "RESOURCE_MODULE")
private String resourceModule;
/** /**
* *
*/ */
@ -35,17 +42,6 @@ public class ResourceCreateRequest extends BaseRequest {
@Dict(name = "RESOURCE_TYPE") @Dict(name = "RESOURCE_TYPE")
private String resourceType; private String resourceType;
/**
*
*/
@NotNull(message = "[node]是否节点不能为NULL")
private Boolean node;
/**
*
*/
private Long supId;
/** /**
* *
*/ */
@ -68,28 +64,20 @@ public class ResourceCreateRequest extends BaseRequest {
this.comment = comment; this.comment = comment;
} }
public String getResourceType() { public String getResourceModule() {
return this.resourceType; return this.resourceModule;
} }
public void setResourceType(String resourceType) { public void setResourceModule(String resourceModule) {
this.resourceType = resourceType; this.resourceModule = resourceModule;
}
public Boolean getNode() {
return this.node;
}
public void setNode(Boolean node) {
this.node = node;
} }
public Long getSupId() { public String getResourceType() {
return this.supId; return this.resourceType;
} }
public void setSupId(Long supId) { public void setResourceType(String resourceType) {
this.supId = supId; this.resourceType = resourceType;
} }
public Boolean getValid() { public Boolean getValid() {

@ -6,9 +6,9 @@ import javax.validation.constraints.NotNull;
/** /**
* ResourceDeleteRequest - * ResourceDeleteRequest -
* *
* @author author * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2017-01-01 * @since 2019-12-26
*/ */
public class ResourceDeleteRequest extends BaseUpdateRequest { public class ResourceDeleteRequest extends BaseUpdateRequest {

@ -6,9 +6,9 @@ import ${basePackage}.frame.validation.Dict;
/** /**
* ResourceRequest - * ResourceRequest -
* *
* @author author * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2017-01-01 * @since 2019-12-26
*/ */
public class ResourceFindRequest extends BaseFindRequest { public class ResourceFindRequest extends BaseFindRequest {
@ -22,6 +22,12 @@ public class ResourceFindRequest extends BaseFindRequest {
*/ */
private String comment; private String comment;
/**
*
*/
@Dict(name = "RESOURCE_MODULE")
private String resourceModule;
/** /**
* *
*/ */
@ -33,16 +39,6 @@ public class ResourceFindRequest extends BaseFindRequest {
*/ */
private Boolean valid; private Boolean valid;
/**
*
*/
private Boolean node;
/**
*
*/
private Long supId;
public String getValue() { public String getValue() {
return this.value; return this.value;
} }
@ -59,6 +55,14 @@ public class ResourceFindRequest extends BaseFindRequest {
this.comment = comment; this.comment = comment;
} }
public String getResourceModule() {
return this.resourceModule;
}
public void setResourceModule(String resourceModule) {
this.resourceModule = resourceModule;
}
public String getResourceType() { public String getResourceType() {
return this.resourceType; return this.resourceType;
} }
@ -74,20 +78,4 @@ public class ResourceFindRequest extends BaseFindRequest {
public void setValid(Boolean valid) { public void setValid(Boolean valid) {
this.valid = valid; this.valid = valid;
} }
public Boolean getNode() {
return this.node;
}
public void setNode(Boolean node) {
this.node = node;
}
public Long getSupId() {
return this.supId;
}
public void setSupId(Long supId) {
this.supId = supId;
}
} }

@ -6,9 +6,9 @@ import javax.validation.constraints.NotNull;
/** /**
* ResourceGetRequest - * ResourceGetRequest -
* *
* @author author * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2017-01-01 * @since 2019-12-26
*/ */
public class ResourceGetRequest extends BaseRequest { public class ResourceGetRequest extends BaseRequest {

@ -11,7 +11,7 @@ import ${basePackage}.frame.validation.Dict;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-22 * @since 2019-12-26
*/ */
public class ResourceUpdateRequest extends BaseUpdateRequest { public class ResourceUpdateRequest extends BaseUpdateRequest {
@ -34,6 +34,13 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
@Length(min = 0, max = 255, message = "[comment]资源描述长度不合法(0-255)") @Length(min = 0, max = 255, message = "[comment]资源描述长度不合法(0-255)")
private String comment; private String comment;
/**
*
*/
@NotNull(message = "[resourceModule]资源模块不能为NULL")
@Dict(name = "RESOURCE_MODULE")
private String resourceModule;
/** /**
* *
*/ */
@ -41,17 +48,6 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
@Dict(name = "RESOURCE_TYPE") @Dict(name = "RESOURCE_TYPE")
private String resourceType; private String resourceType;
/**
*
*/
@NotNull(message = "[node]是否节点不能为NULL")
private Boolean node;
/**
*
*/
private Long supId;
/** /**
* *
*/ */
@ -82,28 +78,20 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
this.comment = comment; this.comment = comment;
} }
public String getResourceType() { public String getResourceModule() {
return this.resourceType; return this.resourceModule;
} }
public void setResourceType(String resourceType) { public void setResourceModule(String resourceModule) {
this.resourceType = resourceType; this.resourceModule = resourceModule;
}
public Boolean getNode() {
return this.node;
}
public void setNode(Boolean node) {
this.node = node;
} }
public Long getSupId() { public String getResourceType() {
return this.supId; return this.resourceType;
} }
public void setSupId(Long supId) { public void setResourceType(String resourceType) {
this.supId = supId; this.resourceType = resourceType;
} }
public Boolean getValid() { public Boolean getValid() {

@ -2,15 +2,14 @@
-- Table structure for RESOURCE - 资源 -- Table structure for RESOURCE - 资源
-- Target : MySQL -- Target : MySQL
-- Author : wangbing -- Author : wangbing
-- Date: : 2019-12-22 -- Date: : 2019-12-26
-- ---------------------------- -- ----------------------------
CREATE TABLE `SYS_RESOURCE` ( CREATE TABLE `SYS_RESOURCE` (
`ID` BIGINT(20) NOT NULL COMMENT '主键', `ID` BIGINT(20) NOT NULL COMMENT '主键',
`VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容', `VALUE` VARCHAR(100) NOT NULL COMMENT '资源内容',
`COMMENT` VARCHAR(250) COMMENT '资源描述', `COMMENT` VARCHAR(250) COMMENT '资源描述',
`RESOURCE_MODULE` VARCHAR(20) NOT NULL COMMENT '资源模块',
`RESOURCE_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型', `RESOURCE_TYPE` VARCHAR(20) NOT NULL COMMENT '资源类型',
`NODE` TINYINT(1) NOT NULL COMMENT '是否节点',
`SUP_ID` BIGINT(20) COMMENT '上级主键',
`VALID` TINYINT(1) NOT NULL COMMENT '是否有效', `VALID` TINYINT(1) NOT NULL COMMENT '是否有效',
`ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本', `ROW_VERSION` BIGINT(20) NOT NULL DEFAULT 0 COMMENT '行版本',
`IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除', `IS_DELETED` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已删除',

@ -4,7 +4,7 @@
<projectBasePackage>xyz.wbsite</projectBasePackage> <projectBasePackage>xyz.wbsite</projectBasePackage>
<projectAuthor>wangbing</projectAuthor> <projectAuthor>wangbing</projectAuthor>
<multiDB>false</multiDB> <multiDB>false</multiDB>
<sysMD>true</sysMD> <sysMD>false</sysMD>
<modules> <modules>
<module> <module>
<moduleComment>系统</moduleComment> <moduleComment>系统</moduleComment>
@ -48,9 +48,8 @@
<field IsSystem="true" defaultValue="" fieldComment="主键" fieldLength="0" fieldName="ID" fieldType="Long" isMust="true" isPrimaryKey="true" isQuery="false" isSearch="false"/> <field IsSystem="true" defaultValue="" fieldComment="主键" fieldLength="0" fieldName="ID" fieldType="Long" isMust="true" isPrimaryKey="true" isQuery="false" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源内容" fieldLength="100" fieldName="VALUE" fieldType="String_var100" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/> <field IsSystem="false" defaultValue="NULL" fieldComment="资源内容" fieldLength="100" fieldName="VALUE" fieldType="String_var100" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源描述" fieldLength="255" fieldName="COMMENT" fieldType="String_var255" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false"/> <field IsSystem="false" defaultValue="NULL" fieldComment="资源描述" fieldLength="255" fieldName="COMMENT" fieldType="String_var255" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源模块" fieldLength="20" fieldName="RESOURCE_MODULE" fieldType="Dict" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="资源类型" fieldLength="20" fieldName="RESOURCE_TYPE" fieldType="Dict" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/> <field IsSystem="false" defaultValue="NULL" fieldComment="资源类型" fieldLength="20" fieldName="RESOURCE_TYPE" fieldType="Dict" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="是否节点" fieldLength="0" fieldName="NODE" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="上级主键" fieldLength="0" fieldName="SUP_ID" fieldType="Long" isMust="false" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="false" defaultValue="NULL" fieldComment="是否有效" fieldLength="0" fieldName="VALID" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/> <field IsSystem="false" defaultValue="NULL" fieldComment="是否有效" fieldLength="0" fieldName="VALID" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="true" isSearch="false"/>
<field IsSystem="true" defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/> <field IsSystem="true" defaultValue="" fieldComment="行版本" fieldLength="0" fieldName="ROW_VERSION" fieldType="Long" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/>
<field IsSystem="true" defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/> <field IsSystem="true" defaultValue="0" fieldComment="是否已删除" fieldLength="0" fieldName="IS_DELETED" fieldType="Boolean" isMust="true" isPrimaryKey="false" isQuery="false" isSearch="false"/>

@ -7,19 +7,11 @@
<el-form-item label="资源描述" prop="comment"> <el-form-item label="资源描述" prop="comment">
<el-input v-model="vm.comment" clearable size="small" placeholder="请输入资源描述"></el-input> <el-input v-model="vm.comment" clearable size="small" placeholder="请输入资源描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="资源类型" prop="resourceType"> <el-form-item label="资源模块" prop="resourceModule">
<el-input-dict v-model="vm.resourceType" clearable size="small" placeholder="请输入资源类型" <el-input-dict v-model="vm.resourceModule" clearable size="small" placeholder="请输入资源模块" dict-name="RESOURCE_MODULE" ></el-input-dict>
dict-name="RESOURCE_TYPE"></el-input-dict>
</el-form-item>
<el-form-item label="是否节点" prop="node">
<el-radio-group v-model="vm.node" clearable size="small">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="上级主键" prop="supId"> <el-form-item label="资源类型" prop="resourceType">
<el-input-number v-model="vm.supId" clearable size="small" placeholder="请输入上级主键" :step="1" <el-input-dict v-model="vm.resourceType" clearable size="small" placeholder="请输入资源类型" dict-name="RESOURCE_TYPE" ></el-input-dict>
step-strictly></el-input-number>
</el-form-item> </el-form-item>
<el-form-item label="是否有效" prop="valid"> <el-form-item label="是否有效" prop="valid">
<el-radio-group v-model="vm.valid" clearable size="small"> <el-radio-group v-model="vm.valid" clearable size="small">
@ -42,36 +34,19 @@
<el-button type="warning" size="small" icon="el-icon-download" @click="onExport">导出</el-button> <el-button type="warning" size="small" icon="el-icon-download" @click="onExport">导出</el-button>
<el-dialog class="form" :title="form.title" :visible.sync="form.dialog"> <el-dialog class="form" :title="form.title" :visible.sync="form.dialog">
<el-form :model="form" :inline="true" :rules="formRules" ref="form" label-position="right" <el-form :model="form" :inline="true" :rules="formRules" ref="form" label-position="right" label-width="90px">
label-width="90px">
<el-form-item label="是否节点" prop="node">
<el-radio-group v-model="form.node" clearable size="small">
<el-radio :label="true">是</el-radio>
<el-radio :label="false">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="上级节点" v-if="form.node" prop="supId">
<el-cascader
:options="options"
size="small"
:props="{ checkStrictly: true }"
clearable></el-cascader>
</el-form-item>
<el-form-item label="资源内容" prop="value"> <el-form-item label="资源内容" prop="value">
<el-input v-model="form.value" clearable size="small" placeholder="请输入资源内容"></el-input> <el-input v-model="form.value" clearable size="small" placeholder="请输入资源内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="资源描述" prop="comment"> <el-form-item label="资源描述" prop="comment">
<el-input v-model="form.comment" clearable size="small" placeholder="请输入资源描述"></el-input> <el-input v-model="form.comment" clearable size="small" placeholder="请输入资源描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="资源模块" prop="resourceModule">
<el-form-item label="资源类型" v-if="!form.node" prop="resourceType"> <el-input-dict v-model="form.resourceModule" clearable size="small" placeholder="请输入资源模块" dict-name="RESOURCE_MODULE" ></el-input-dict>
<el-input-dict v-model="form.resourceType" clearable size="small" placeholder="请输入资源类型" </el-form-item>
dict-name="RESOURCE_TYPE"></el-input-dict> <el-form-item label="资源类型" prop="resourceType">
<el-input-dict v-model="form.resourceType" clearable size="small" placeholder="请输入资源类型" dict-name="RESOURCE_TYPE" ></el-input-dict>
</el-form-item> </el-form-item>
<el-form-item label="是否有效" prop="valid"> <el-form-item label="是否有效" prop="valid">
<el-radio-group v-model="form.valid" clearable size="small"> <el-radio-group v-model="form.valid" clearable size="small">
<el-radio :label="true">是</el-radio> <el-radio :label="true">是</el-radio>
@ -135,18 +110,13 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="resourceType" prop="resourceModule"
label="资源类型"> label="资源模块">
</el-table-column>
<el-table-column
align="center"
prop="node"
label="是否节点">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
prop="supId" prop="resourceType"
label="上级主键"> label="资源类型">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
@ -199,15 +169,14 @@
vm: {//条件及分页参数 vm: {//条件及分页参数
value: "", value: "",
comment: "", comment: "",
resourceModule: "",
resourceType: "", resourceType: "",
node: "",
supId: "",
valid: "", valid: "",
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
totalCount: 0, totalCount: 0,
sortKey: 'CREATE_TIME', sortKey:'CREATE_TIME',
sortType: 'DESC' sortType:'DESC'
}, },
form: {//待提交表单 form: {//待提交表单
title: "", title: "",
@ -215,9 +184,8 @@
id: '', id: '',
value: "", value: "",
comment: "", comment: "",
resourceModule: "",
resourceType: "", resourceType: "",
node: "",
supId: "",
valid: "", valid: "",
rowVersion: "" rowVersion: ""
}, },
@ -229,31 +197,16 @@
comment: [ comment: [
{min: 1, max: 255, message: '资源描述长度在 1 到 255 个字符', trigger: 'blur'} {min: 1, max: 255, message: '资源描述长度在 1 到 255 个字符', trigger: 'blur'}
], ],
resourceModule: [
{required: true, message: '资源模块不能为空', trigger: 'blur'},
],
resourceType: [ resourceType: [
{required: true, message: '资源类型不能为空', trigger: 'blur'}, {required: true, message: '资源类型不能为空', trigger: 'blur'},
], ],
node: [
{required: true, message: '是否节点不能为空', trigger: 'blur'},
],
supId: [],
valid: [ valid: [
{required: true, message: '是否有效不能为空', trigger: 'blur'}, {required: true, message: '是否有效不能为空', trigger: 'blur'},
], ],
}, }
options: [
{
value: "111",
label: "指南",
children: [{
value: 'shejiyuanze',
label: '设计原则',
children: [{
value: 'yizhi',
label: '一致'
}]
}]
}
]
}, },
methods: { methods: {
onCreate: function () { onCreate: function () {
@ -262,10 +215,9 @@
this.form.id = ""; this.form.id = "";
this.form.value = ""; this.form.value = "";
this.form.comment = ""; this.form.comment = "";
this.form.resourceModule = "";
this.form.resourceType = ""; this.form.resourceType = "";
this.form.node = false; this.form.valid = "";
this.form.supId = "";
this.form.valid = true;
}, },
onCommand: function (arg) { onCommand: function (arg) {
const cmd = arg[0]; const cmd = arg[0];
@ -277,9 +229,8 @@
this.form.id = item.id; this.form.id = item.id;
this.form.value = item.value; this.form.value = item.value;
this.form.comment = item.comment; this.form.comment = item.comment;
this.form.resourceModule = item.resourceModule;
this.form.resourceType = item.resourceType; this.form.resourceType = item.resourceType;
this.form.node = item.node;
this.form.supId = item.supId;
this.form.valid = item.valid; this.form.valid = item.valid;
this.form.rowVersion = item.rowVersion; this.form.rowVersion = item.rowVersion;
break; break;
@ -291,19 +242,9 @@
break; break;
} }
}, },
getTree: function () {
this.$ajax.find("system", "resource", {node: true}).then(function (response) {
if (response.errors.length > 0) {
console.error(response.errors[0].message)
} else {
this.options = response.result;
}
}.bind(this))
}
}, },
mounted: function () { mounted: function () {
this.onFind(); this.onFind();
this.getTree();
}, },
}) })
</script> </script>

Loading…
Cancel
Save

Powered by TurnKey Linux.