|
@@ -2,133 +2,82 @@
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
|
|
<el-form-item label="标题" prop="title">
|
|
<el-form-item label="标题" prop="title">
|
|
- <el-input v-model="queryParams.title" placeholder="请输入标题" @keyup.enter.native="handleQuery" clearable class="inp"/>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="是否置顶" prop="top">
|
|
|
|
- <el-select v-model="queryParams.top" placeholder="请选择">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in topOpt"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value">
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-input v-model="queryParams.title" placeholder="请输入标题" @keyup.enter.native="handleQuery" clearable/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="状态" prop="state">
|
|
<el-form-item label="状态" prop="state">
|
|
- <el-select v-model="queryParams.state" placeholder="请选择">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in stateOpt"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value">
|
|
|
|
- </el-option>
|
|
|
|
|
|
+ <el-select v-model="queryParams.state" placeholder="状态" class="se" clearable>
|
|
|
|
+ <el-option value="0" label="启用"></el-option>
|
|
|
|
+ <el-option value="1" label="禁用"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="创建时间" prop="dateRange">
|
|
|
|
- <el-date-picker
|
|
|
|
- v-model="queryParams.dateRange"
|
|
|
|
- type="daterange"
|
|
|
|
- range-separator="至"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
- @change="changeDate"
|
|
|
|
- >
|
|
|
|
- </el-date-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-row :gutter="10" class="mb8">
|
|
- <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:notice:add']">新增</el-button>
|
|
|
|
- <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit',ids)" v-hasPermi="['work:notice:edit']">修改</el-button>
|
|
|
|
- <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:notice:remove']">删除{{ids.length>0?'('+ids.length+')':''}}</el-button>
|
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:notice:add']">新增</el-button>
|
|
|
|
+ <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit', ids)" v-hasPermi="['work:notice:edit']">修改</el-button>
|
|
|
|
+ <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:notice:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
|
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
<el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
|
|
<el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
- <el-table-column label="标题" align="center" prop="title" />
|
|
|
|
- <el-table-column label="是否置顶" align="center" prop="top" >
|
|
|
|
|
|
+ <el-table-column label="通知标题" align="left" prop="title" />
|
|
|
|
+ <el-table-column label="是否置顶" align="center" prop="top" width="140">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-tag v-if="scope.row.top">是</el-tag>
|
|
|
|
- <el-tag v-else type="danger">否</el-tag>
|
|
|
|
|
|
+ <el-tag type="success" v-if="scope.row.top == 1">是</el-tag>
|
|
|
|
+ <el-tag type="info" v-else>否</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="状态" align="center" prop="state" >
|
|
|
|
|
|
+ <el-table-column label="通知状态" align="center" prop="state" width="140">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-tag v-if="scope.row.state">启用</el-tag>
|
|
|
|
- <el-tag v-else type="danger">停用</el-tag>
|
|
|
|
|
|
+ <el-tag type="success" v-if="scope.row.state == 0">启用</el-tag>
|
|
|
|
+ <el-tag type="danger" v-if="scope.row.state == 1">停用</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="创建人" align="center" prop="createBy" />
|
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" />
|
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" width="200" />
|
|
|
|
+ <el-table-column label="操作" align="center" width="220">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:notice:list']">查看</el-button>
|
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit',scope.row)" v-hasPermi="['work:notice:edit']">修改</el-button>
|
|
|
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:notice:edit']">修改</el-button>
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:notice:remove']">删除</el-button>
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:notice:remove']">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<template slot="empty">
|
|
<template slot="empty">
|
|
- <el-empty></el-empty>
|
|
|
|
|
|
+ <el-empty></el-empty>
|
|
</template>
|
|
</template>
|
|
</el-table>
|
|
</el-table>
|
|
- <pagination v-if="response.total>0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
|
|
|
|
|
+ <pagination v-if="response.total > 0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import edit from './edit.vue'
|
|
|
|
|
|
+import edit from './edit.vue';
|
|
export default {
|
|
export default {
|
|
- name: "Notice",
|
|
|
|
|
|
+ name: 'Notice',
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
ids: [],
|
|
ids: [],
|
|
- showSearch:true,
|
|
|
|
|
|
+ showSearch: true,
|
|
response: {},
|
|
response: {},
|
|
- topOpt: [{
|
|
|
|
- value: '0',
|
|
|
|
- label: '未置顶'
|
|
|
|
- }, {
|
|
|
|
- value: '1',
|
|
|
|
- label: '已置顶'
|
|
|
|
- }],
|
|
|
|
- stateOpt: [{
|
|
|
|
- value: '0',
|
|
|
|
- label: '停用'
|
|
|
|
- }, {
|
|
|
|
- value: '1',
|
|
|
|
- label: '启用'
|
|
|
|
- }],
|
|
|
|
queryParams: {
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
title: null,
|
|
title: null,
|
|
- contents: null,
|
|
|
|
- top: null,
|
|
|
|
state: null,
|
|
state: null,
|
|
orderByColumn: 'id',
|
|
orderByColumn: 'id',
|
|
- isAsc: 'desc',
|
|
|
|
- dateRange:[],
|
|
|
|
- beginTime:null,
|
|
|
|
- endTime:null,
|
|
|
|
- },
|
|
|
|
|
|
+ isAsc: 'desc'
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- changeDate(data){
|
|
|
|
- this.queryParams.beginTime = data[0]
|
|
|
|
- this.queryParams.endTime = data[1]
|
|
|
|
- },
|
|
|
|
getList() {
|
|
getList() {
|
|
- this.ajax({ url: '/work/notice/list', data: this.queryParams }).then(response => {
|
|
|
|
- this.response = response;
|
|
|
|
|
|
+ this.ajax({ url: '/work/notice/list', data: this.queryParams }).then((response) => {
|
|
|
|
+ this.response = response;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleQuery() {
|
|
handleQuery() {
|
|
@@ -136,34 +85,29 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
resetQuery() {
|
|
resetQuery() {
|
|
- this.queryParams.beginTime = null
|
|
|
|
- this.queryParams.endTime = null
|
|
|
|
- this.resetForm("queryForm");
|
|
|
|
|
|
+ this.resetForm('queryForm');
|
|
this.handleQuery();
|
|
this.handleQuery();
|
|
},
|
|
},
|
|
selects(rows) {
|
|
selects(rows) {
|
|
- this.ids = rows.map(item => item.id)
|
|
|
|
|
|
+ this.ids = rows.map((item) => item.id);
|
|
},
|
|
},
|
|
op(tag, row) {
|
|
op(tag, row) {
|
|
- if (tag == 'add') {
|
|
|
|
- this.iframe({ obj: edit, param: {}, title:'新增',width: '45%', height: '55%'});
|
|
|
|
- }
|
|
|
|
- if (tag == 'edit') {
|
|
|
|
- const id = row.id || this.ids[0];
|
|
|
|
- this.iframe({ obj: edit, param: {id: id}, title:'编辑',width: '50%', height: '50%'});
|
|
|
|
- }
|
|
|
|
- if (tag == 'detail') {
|
|
|
|
- const id = row.id || this.ids[0];
|
|
|
|
- this.iframe({ obj: edit, param: {id: id,readonly:true}, title:'详情',width: '50%', height: '50%'});
|
|
|
|
- }
|
|
|
|
|
|
+ if (tag == 'add') {
|
|
|
|
+ this.iframe({ obj: edit, param: {}, title: '新增', width: '58%', height: '75%' });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const id = row.id || this.ids[0];
|
|
|
|
+ if (tag == 'edit') {
|
|
|
|
+ this.iframe({ obj: edit, param: { id: id }, title: '编辑', width: '58%', height: '75%' });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
del(row) {
|
|
del(row) {
|
|
- this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
|
|
|
|
- this.get({ url: '/work/notice/remove/' + (row.id || this.ids) }).then(response => {
|
|
|
|
- this.$modal.msgSuccess('删除成功');
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
|
|
|
|
+ this.get({ url: '/work/notice/remove/' + (row.id || this.ids) }).then((response) => {
|
|
|
|
+ this.$modal.msgSuccess('删除成功');
|
|
|
|
+ this.getList();
|
|
});
|
|
});
|
|
|
|
+ });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|