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

feat:添加模块分类

parent ffbaf379
......@@ -35,14 +35,13 @@
>
</div>
<div class="site-btn">
<a-button
type="primary"
style="margin-right: 10px"
@click="onSucessSite"
:disabled="isSite"
<a-button @click="show = false" style="margin-right: 10px"
>取消</a-button
>
<a-button type="primary" @click="onSucessSite" :disabled="isSite"
>确定</a-button
>
<a-button @click="show = false">取消</a-button>
</div>
</div>
</div>
......
......@@ -69,6 +69,10 @@
<template slot="sort" slot-scope="text">
{{ text.sort ? text.sort : "--" }}
</template>
<!-- 类型 -->
<template slot="type" slot-scope="text">
{{ text.type ? dict.type[text.type] : "--" }}
</template>
<!-- 创建时间 -->
<template slot="createTime" slot-scope="text">
{{ text.createTime | dateFormat }}
......@@ -148,6 +152,21 @@
/>
</a-form-model-item>
</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-form-model-item label="排序" prop="sort">
<a-input-number
......@@ -180,27 +199,6 @@
<div class="ant-upload-text">点击上传</div>
</div>
</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-col>
</a-row>
......@@ -275,6 +273,10 @@ const columns = [
width: "5%",
scopedSlots: { customRender: "sort" },
},
{
title: "类型",
scopedSlots: { customRender: "type" },
},
{
title: "创建时间",
width: "12%",
......@@ -317,6 +319,7 @@ export default {
modelUrl: "", // 模块地址
remark: "", // 备注
sort: "", // 排序
type: undefined, // 类型
},
current: 1,
size: 10,
......@@ -336,9 +339,13 @@ export default {
modelIcon: [
{ required: true, message: "模块图标不能为空", trigger: "change" },
],
type: [
{ required: true, message: "模块类型不能为空", trigger: "change" },
],
},
StatementVisible: false,
modelInfo: {},
dict: {},
};
},
created() {
......@@ -354,13 +361,16 @@ export default {
modelName: `%${this.searchValue}%`,
...search,
});
let { pageInfo, data } = res.data.data;
if (!data.length && this.current > 1) {
this.current -= 1;
this.getmodelList();
if (res.data.code == 1) {
let { pageInfo, data, dict } = res.data.data;
if (!data.length && this.current > 1) {
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;
},
// 新增按钮
......
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