Commit 5d8ae8d9 authored by “yiyousong”'s avatar “yiyousong”

feat:添加模块分类

parent ffbaf379
...@@ -35,14 +35,13 @@ ...@@ -35,14 +35,13 @@
> >
</div> </div>
<div class="site-btn"> <div class="site-btn">
<a-button <a-button @click="show = false" style="margin-right: 10px"
type="primary" >取消</a-button
style="margin-right: 10px" >
@click="onSucessSite"
:disabled="isSite" <a-button type="primary" @click="onSucessSite" :disabled="isSite"
>确定</a-button >确定</a-button
> >
<a-button @click="show = false">取消</a-button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -69,6 +69,10 @@ ...@@ -69,6 +69,10 @@
<template slot="sort" slot-scope="text"> <template slot="sort" slot-scope="text">
{{ text.sort ? text.sort : "--" }} {{ text.sort ? text.sort : "--" }}
</template> </template>
<!-- 类型 -->
<template slot="type" slot-scope="text">
{{ text.type ? dict.type[text.type] : "--" }}
</template>
<!-- 创建时间 --> <!-- 创建时间 -->
<template slot="createTime" slot-scope="text"> <template slot="createTime" slot-scope="text">
{{ text.createTime | dateFormat }} {{ text.createTime | dateFormat }}
...@@ -148,6 +152,21 @@ ...@@ -148,6 +152,21 @@
/> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-model-item label="类型" prop="type">
<a-select v-model="formData.type" placeholder="请选择类型">
<a-select-option
v-for="(v, key) in dict.type"
:key="key"
:value="Number(key)"
>
{{ v }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="排序" prop="sort"> <a-form-model-item label="排序" prop="sort">
<a-input-number <a-input-number
...@@ -180,27 +199,6 @@ ...@@ -180,27 +199,6 @@
<div class="ant-upload-text">点击上传</div> <div class="ant-upload-text">点击上传</div>
</div> </div>
</a-upload> </a-upload>
<!-- <a-upload
name="file"
list-type="picture-card"
:action="api + 'base/file/commonupload'"
@change="handleUpload"
:before-upload="beforeUpload"
:show-upload-list="false"
:accept="accept"
>
<div v-if="formData.modelIcon">
<div class="svg-box" v-if="isSvg(formData.modelIcon)">
<img :src="api + formData.modelIcon" />
</div>
<img v-else :src="api + formData.modelIcon" />
</div>
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">点击上传</div>
</div>
</a-upload> -->
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -275,6 +273,10 @@ const columns = [ ...@@ -275,6 +273,10 @@ const columns = [
width: "5%", width: "5%",
scopedSlots: { customRender: "sort" }, scopedSlots: { customRender: "sort" },
}, },
{
title: "类型",
scopedSlots: { customRender: "type" },
},
{ {
title: "创建时间", title: "创建时间",
width: "12%", width: "12%",
...@@ -317,6 +319,7 @@ export default { ...@@ -317,6 +319,7 @@ export default {
modelUrl: "", // 模块地址 modelUrl: "", // 模块地址
remark: "", // 备注 remark: "", // 备注
sort: "", // 排序 sort: "", // 排序
type: undefined, // 类型
}, },
current: 1, current: 1,
size: 10, size: 10,
...@@ -336,9 +339,13 @@ export default { ...@@ -336,9 +339,13 @@ export default {
modelIcon: [ modelIcon: [
{ required: true, message: "模块图标不能为空", trigger: "change" }, { required: true, message: "模块图标不能为空", trigger: "change" },
], ],
type: [
{ required: true, message: "模块类型不能为空", trigger: "change" },
],
}, },
StatementVisible: false, StatementVisible: false,
modelInfo: {}, modelInfo: {},
dict: {},
}; };
}, },
created() { created() {
...@@ -354,13 +361,16 @@ export default { ...@@ -354,13 +361,16 @@ export default {
modelName: `%${this.searchValue}%`, modelName: `%${this.searchValue}%`,
...search, ...search,
}); });
let { pageInfo, data } = res.data.data; if (res.data.code == 1) {
if (!data.length && this.current > 1) { let { pageInfo, data, dict } = res.data.data;
this.current -= 1; if (!data.length && this.current > 1) {
this.getmodelList(); this.current -= 1;
this.getmodelList();
}
this.dict = dict;
this.total = pageInfo.totalResult;
this.modelList = data;
} }
this.total = pageInfo.totalResult;
this.modelList = data;
this.loading = false; this.loading = false;
}, },
// 新增按钮 // 新增按钮
......
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