Commit fe5cf3a5 authored by Jay-Fan's avatar Jay-Fan

标签信息模块,更改页面按钮出现的bug

parent b14d749a
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
opacity: 0.85; opacity: 0.85;
border: none; border: none;
background: #2288ff; background: #2288ff;
color: #696974; //color: #696974;
border-radius: 0.25rem; border-radius: 0.25rem;
} }
} }
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
opacity: 0.85; opacity: 0.85;
border: none; border: none;
background: #2288ff; background: #2288ff;
color: #696974; //color: #696974;
border-radius: 0.25rem; border-radius: 0.25rem;
} }
} }
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
opacity: 0.85; opacity: 0.85;
border: none; border: none;
background: #2288ff; background: #2288ff;
color: #696974; // color: #696974;
border-radius: 0.25rem; border-radius: 0.25rem;
} }
} }
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
opacity: 0.85; opacity: 0.85;
border: none; border: none;
background: #2288ff; background: #2288ff;
color: #696974; //color: #696974;
border-radius: 0.25rem; border-radius: 0.25rem;
} }
} }
...@@ -155,8 +155,8 @@ ...@@ -155,8 +155,8 @@
&:focus { &:focus {
opacity: 0.85; opacity: 0.85;
border: none; border: none;
background: #f1f1f5 !important; background: #2288ff !important;
color: #696974 !important; //color: #696974 !important;
border-radius: 0.25rem !important; border-radius: 0.25rem !important;
} }
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="queryBtn" type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button class="queryBtn" type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button class="resetBtn" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button class="resetBtn" type="primary" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button <el-button
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="queryBtn" type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button class="queryBtn" type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button class="resetBtn" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button class="resetBtn" type="primary" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
<div style="float: right"> <div style="float: right">
<el-form-item> <el-form-item>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="queryBtn" type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button> <el-button class="queryBtn" type="primary" size="small" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button class="resetBtn" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button class="resetBtn" type="primary" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button <el-button
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true"> <div v-if="themeType == '8'" class="tableTitle">标签管理列表</div>
<el-form-item label="名称" prop="labelName"> <div class="search">
<el-input <el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
v-model="queryParams.labelName" <el-form-item label="标签名称" prop="labelName">
placeholder="请输入名称" <el-input
clearable v-model="queryParams.labelName"
:maxlength="255" placeholder="请输入标签名称"
size="small" clearable
style="width: 150px" :maxlength="255"
/> size="small"
</el-form-item> style="width: 150px"
<el-form-item label="分类(1模版,2镜像,3数据集)" prop="labelType">
<el-input
v-model="queryParams.labelType"
placeholder="请输入分类(1模版,2镜像,3数据集)"
clearable
:maxlength="1"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="状态" prop="flag">
<el-select v-model="queryParams.flag" placeholder="请选择状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/> />
</el-select> </el-form-item>
</el-form-item> <el-form-item label="标签分类" prop="labelType">
<el-form-item> <el-select v-model="queryParams.labelType" placeholder="请选择标签分类" clearable size="small">
<el-button <el-option
:class="commonField.queryClass" v-for="dict in sortOptions"
:type="commonField.typePrimary" :key="dict.dictValue"
:icon="commonField.queryIcon" :label="dict.dictLabel"
:size="commonField.smallSize" :value="dict.dictValue"
@click="handleQuery" />
>查询</el-button> </el-select>
<el-button </el-form-item>
:class="commonField.resetClass" <el-form-item label="状态" prop="flag">
:icon="commonField.resetIcon" <el-select v-model="queryParams.flag" placeholder="请选择状态" clearable size="small">
:size="commonField.smallSize" <el-option
@click="resetQuery" v-for="dict in statusOptions"
>重置</el-button> :key="dict.dictValue"
</el-form-item> :label="dict.dictLabel"
<div style="float: right"> :value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
:class="commonField.addClass" :class="commonField.queryClass"
:type="commonField.typePrimary" :type="commonField.typePrimary"
:icon="commonField.addIcon" :icon="commonField.queryIcon"
:size="commonField.smallSize" :size="commonField.smallSize"
@click="handleAdd" @click="handleQuery"
>新增</el-button> >查询</el-button>
<el-button <el-button
:class="commonField.exportClass" :class="commonField.resetClass"
:type="commonField.typeSuccess" :type="commonField.typePrimary"
:icon="commonField.exportIcon" :icon="commonField.resetIcon"
:size="commonField.smallSize" :size="commonField.smallSize"
@click="handleExport" @click="resetQuery"
>导出</el-button> >重置</el-button>
</el-form-item> </el-form-item>
</div> <div style="float: right">
</el-form> <el-form-item>
<div class="placeholder" /> <el-button
:class="commonField.addClass"
:type="commonField.typePrimary"
:icon="commonField.addIcon"
:size="commonField.smallSize"
@click="handleAdd"
>新增</el-button>
<el-button
:class="commonField.exportClass"
:type="commonField.typePrimary"
:icon="commonField.exportIcon"
:size="commonField.smallSize"
@click="handleExport"
>导出</el-button>
</el-form-item>
</div>
</el-form>
</div>
<div style="padding:5px 10px"> <div style="padding:5px 10px">
<div class="mb12 font-small-bold">标签信息列表</div> <div v-if="themeType !== '8'" class="tableTitle">标签管理列表</div>
<el-table v-loading="loading" border :data="resLabelInfoList"> <el-table v-loading="loading" border :data="resLabelInfoList">
<el-table-column type="index" label="序号" width="55" align="center" /> <el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="名称" prop="labelName" :show-overflow-tooltip="true"> <el-table-column label="标签名称" prop="labelName" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.labelName || '-' }} {{ scope.row.labelName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="分类(1模版,2镜像,3数据集)" prop="labelType" :show-overflow-tooltip="true"> <el-table-column label="标签分类" prop="labelType" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.labelType || '-' }} {{ scope.row.labelTypeName || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="权重" prop="weight" :show-overflow-tooltip="true"> <el-table-column label="权重" prop="weight" :show-overflow-tooltip="true">
...@@ -134,14 +137,18 @@ ...@@ -134,14 +137,18 @@
<!-- 添加或修改标签信息配置对话框 --> <!-- 添加或修改标签信息配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px"> <el-form ref="form" :model="form" :rules="rules" size="small" label-width="90px">
<el-form-item label="名称" prop="labelName"> <el-form-item label="标签名称" prop="labelName">
<el-input v-model.trim="form.labelName" show-word-limit :maxlength="255" placeholder="请输入名称" /> <el-input v-model.trim="form.labelName" show-word-limit :maxlength="255" placeholder="请输入标签名称" />
</el-form-item> </el-form-item>
<el-form-item label="分类(1模版,2镜像,3数据集)" prop="labelType"> <el-form-item label="标签分类">
<el-input v-model.trim="form.labelType" show-word-limit :maxlength="1" placeholder="请输入分类(1模版,2镜像,3数据集)" /> <el-radio-group v-model="form.labelType">
<el-radio label="1">模板</el-radio>
<el-radio label="2">镜像</el-radio>
<el-radio label="3">数据集</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="权重" prop="weight"> <el-form-item label="权重" prop="weight">
<el-input-number v-model.trim="form.weight" controls-position="right" :min="0" /> <el-input-number v-model="form.weight" style="width: 100%" controls-position="right" :min="0" />
</el-form-item> </el-form-item>
<el-form-item label="状态"> <el-form-item label="状态">
<el-radio-group v-model="form.flag"> <el-radio-group v-model="form.flag">
...@@ -169,9 +176,14 @@ import { ...@@ -169,9 +176,14 @@ import {
addResLabelInfo, addResLabelInfo,
updateResLabelInfo, updateResLabelInfo,
exportResLabelInfo } from '@/api/resLabelInfo' exportResLabelInfo } from '@/api/resLabelInfo'
import {
selectDictType
} from '@/api/system/dict/type'
import { getDataCache, setDataCache } from '@/assets/js/filterData'
import commonField from '@/utils/commonField' import commonField from '@/utils/commonField'
export default { export default {
name: 'ResLabelInfo', name: 'ResLabelInfo',
dicts: ['res_label_type'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -195,6 +207,20 @@ export default { ...@@ -195,6 +207,20 @@ export default {
dictValue: '0' dictValue: '0'
} }
], ],
sortOptions: [
{
dictLabel: '模板',
dictValue: '1'
},
{
dictLabel: '镜像',
dictValue: '2'
},
{
dictLabel: '数据集',
dictValue: '3'
}
],
// 查询参数 // 查询参数
queryParams: { queryParams: {
page: 1, page: 1,
...@@ -206,28 +232,53 @@ export default { ...@@ -206,28 +232,53 @@ export default {
}, },
// 表单参数 // 表单参数
form: {}, form: {},
dictList: [],
// 表单校验 // 表单校验
rules: { rules: {
labelName: [
{ required: true, message: '标签名称不能为空', trigger: 'blur' }
],
labelType: [
{ required: true, message: '标签分类不能为空', trigger: 'blur' }
],
weight: [
{ required: true, message: '权重不能为空', trigger: 'blur' }
]
} }
} }
}, },
computed: { computed: {
themeType() {
return localStorage.getItem('theme')
},
commonField() { commonField() {
return commonField return commonField
} }
}, },
/** 路由离开前存储筛选条件*/
beforeRouteLeave(to, from, next) {
setDataCache(this.$route.path, this.queryParams)
next()
},
created() { created() {
this.queryParams = JSON.parse(getDataCache(this.$route.path))
this.getList() // 列表查询 this.getList() // 列表查询
}, },
methods: { methods: {
/** 查询标签信息列表 */ /** 查询标签信息列表 */
getList() { getList() {
this.loading = true this.loading = true
selectDictType('res_label_type').then(response => {
this.dictList = response.data
})
listResLabelInfo(this.queryParams).then( listResLabelInfo(this.queryParams).then(
response => { response => {
this.resLabelInfoList = response.rows this.resLabelInfoList = response.rows
this.total = response.total this.total = response.total
this.loading = false this.loading = false
this.resLabelInfoList.forEach(item => {
item.labelTypeName = this.dictList.find(item1 => item1.dictValue === item.labelType).dictLabel
})
} }
) )
}, },
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<!-- //重置按钮--> <!-- //重置按钮-->
<el-button <el-button
:class="commonField.resetClass" :class="commonField.resetClass"
:type="commonField.typePrimary"
:icon="commonField.resetIcon" :icon="commonField.resetIcon"
:size="commonField.smallSize" :size="commonField.smallSize"
@click="resetQuery" @click="resetQuery"
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button class="queryBtn" type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button> <el-button class="queryBtn" type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button class="resetBtn" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button> <el-button class="resetBtn" type="primary" icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
<div style="padding-bottom: 15px" class="dictBtnRow"> <div style="padding-bottom: 15px" class="dictBtnRow">
<coolbutton :class-name="commonField.addClass" :type="commonField.typePrimary" :name="commonField.addName" :icon="commonField.addIcon" :size="commonField.size" :haspermi="hasDataAddPerm" @btn-click="handleAdd" /> <coolbutton :class-name="commonField.addClass" :type="commonField.typePrimary" :name="commonField.addName" :icon="commonField.addIcon" :size="commonField.size" :haspermi="hasDataAddPerm" @btn-click="handleAdd" />
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
</div> </div>
</el-form> </el-form>
</div> </div>
<div class="placeholder" />
<div style="padding:10px"> <div style="padding:10px">
<div v-if="themeType !== '8'" class="tableTitle">字典参数列表</div> <div v-if="themeType !== '8'" class="tableTitle">字典参数列表</div>
<el-table v-loading="loading" :data="dataList" border @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" border @selection-change="handleSelectionChange">
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
<!-- //重置按钮--> <!-- //重置按钮-->
<el-button <el-button
:class="commonField.resetClass" :class="commonField.resetClass"
:type="commonField.typePrimary"
:icon="commonField.resetIcon" :icon="commonField.resetIcon"
:size="commonField.smallSize" :size="commonField.smallSize"
@click="resetQuery" @click="resetQuery"
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<!-- //重置按钮--> <!-- //重置按钮-->
<el-button <el-button
:class="commonField.resetClass" :class="commonField.resetClass"
:type="commonField.typePrimary"
:icon="commonField.resetIcon" :icon="commonField.resetIcon"
:size="commonField.smallSize" :size="commonField.smallSize"
@click="resetQuery" @click="resetQuery"
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<!-- //重置按钮--> <!-- //重置按钮-->
<el-button <el-button
:class="commonField.resetClass" :class="commonField.resetClass"
:type="commonField.typePrimary"
:icon="commonField.resetIcon" :icon="commonField.resetIcon"
:size="commonField.smallSize" :size="commonField.smallSize"
@click="resetQuery" @click="resetQuery"
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<!-- //重置按钮--> <!-- //重置按钮-->
<el-button <el-button
:class="commonField.resetClass" :class="commonField.resetClass"
:type="commonField.typePrimary"
:icon="commonField.resetIcon" :icon="commonField.resetIcon"
:size="commonField.smallSize" :size="commonField.smallSize"
@click="resetQuery" @click="resetQuery"
......
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