From c3dcd74cee7cb20aa069c9c57eb2701141f26f1b Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 07 三月 2024 10:46:56 +0800 Subject: [PATCH] 考核发布 --- src/api/platform/publish.js | 46 +++++ src/views/system/publish/index.vue | 389 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 435 insertions(+), 0 deletions(-) diff --git a/src/api/platform/publish.js b/src/api/platform/publish.js new file mode 100644 index 0000000..c611782 --- /dev/null +++ b/src/api/platform/publish.js @@ -0,0 +1,46 @@ +import request from '@/utils/request' + +// 鏌ヨ鑰冩牳鍙戝竷鍒楄〃 +export function listPublish(query) { + return request({ + url: '/system/publish/list', + method: 'get', + params: query + }) +} + +// 鏌ヨ鑰冩牳鍙戝竷璇︾粏 +export function getPublish(id) { + return request({ + url: '/system/publish/' + id, + method: 'get' + }) +} + +// 鏂板鑰冩牳鍙戝竷 +export function addPublish(data) { + return request({ + url: '/system/publish', + method: 'post', + data: data + }) +} + +// 淇敼鑰冩牳鍙戝竷 +export function updatePublish(data) { + return request({ + url: '/system/publish', + method: 'put', + data: data + }) +} + +// 鍒犻櫎鑰冩牳鍙戝竷 +export function delPublish(id) { + return request({ + url: '/system/publish/' + id, + method: 'delete' + }) +} + + diff --git a/src/views/system/publish/index.vue b/src/views/system/publish/index.vue new file mode 100644 index 0000000..d66b793 --- /dev/null +++ b/src/views/system/publish/index.vue @@ -0,0 +1,389 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="鑰冩牳鍚�" prop="examineName"> + <el-input + v-model="queryParams.examineName" + placeholder="璇疯緭鍏ヨ�冩牳鍚�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鑰冩牳鑼冨洿" prop="timeRange"> + <el-select + v-model="queryParams.timeRange" + placeholder="鑰冩牳鑼冨洿" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.platform_examine_range" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="鑰冩牳棰戠巼" prop="frequency"> + <el-select + v-model="queryParams.frequency" + placeholder="鑰冩牳棰戠巼" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.platform_examine_frequency" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="鑰冩牳鐘舵��" prop="state"> + <el-select + v-model="queryParams.state" + placeholder="鑰冩牳鐘舵��" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.sys_normal_disable" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['system:publish:add']" + >鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + plain + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['system:publish:edit']" + >淇敼</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['system:publish:remove']" + >鍒犻櫎</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['system:publish:export']" + >瀵煎嚭</el-button> + </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + + <el-table v-loading="loading" :data="publishList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="鑰冩牳鍚�" align="center" prop="examineName" /> + <el-table-column label="鑰冩牳鑼冨洿" align="center" prop="timeRange" > + <template slot-scope="scope"> + <dict-tag :options="dict.type.platform_examine_range" :value="scope.row.timeRange"/> + </template> + </el-table-column> + <el-table-column label="鑰冩牳棰戠巼" align="center" prop="frequency"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.platform_examine_frequency" :value="scope.row.frequency"/> + </template> + </el-table-column> + <el-table-column label="鑰冩牳鐘舵��" align="center" prop="state"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.state"/> + </template> + </el-table-column> + <el-table-column label="鍒涘缓浜�" align="center" prop="createUser" /> + <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" /> + <el-table-column label="淇敼浜�" align="center" prop="updateUser" /> + <el-table-column label="淇敼鏃堕棿" align="center" prop="updateTime" /> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['system:publish:edit']" + >淇敼</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['system:publish:remove']" + >鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 娣诲姞鎴栦慨鏀硅�冩牳鍙戝竷瀵硅瘽妗� --> + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="鑰冩牳鍚�" prop="examineName"> + <el-input v-model="form.examineName" placeholder="璇疯緭鍏ヨ�冩牳鍚�" /> + </el-form-item> + + <el-form-item label="鑰冩牳妯℃澘" prop="templateId"> + <el-select v-model="queryParams.templateId" @change="handleQuery" clearable placeholder="鑰冩牳妯℃澘"> + <el-option + v-for="item in templateList" + :key="item.id" + :label="item.value" + :value="item.id"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="鑰冩牳鑼冨洿" prop="timeRange"> + <el-select + v-model="queryParams.timeRange" + placeholder="鑰冩牳鑼冨洿" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.platform_examine_range" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="鑰冩牳棰戠巼" prop="frequency"> + <el-select + v-model="queryParams.frequency" + placeholder="鑰冩牳棰戠巼" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.platform_examine_frequency" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="鑰冩牳鐘舵��" prop="state"> + <el-select + v-model="queryParams.state" + placeholder="鑰冩牳鐘舵��" + clearable + style="width: 170px" + > + <el-option + v-for="dict in dict.type.sys_normal_disable" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="鎻忚堪" prop="description"> + <el-input v-model="form.description" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { listPublish, getPublish, delPublish, addPublish, updatePublish } from "@/api/platform/publish"; + +export default { + name: "Publish", + dicts: ['sys_normal_disable','platform_examine_range','platform_examine_frequency'], + data() { + return { + // 閬僵灞� + loading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 鑰冩牳鍙戝竷琛ㄦ牸鏁版嵁 + publishList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + examineName: null, + frequency: null, + state: null, + timeRange: null, + }, + // 鑰冩牳妯℃澘 + templateList: [], + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + } + }; + }, + created() { + this.getList(); + this.getTemplateSelect(); + }, + methods: { + getTemplateSelect() { + // 鑰冩牳妯℃澘涓嬫媺鍒楄〃 + unitSelect().then((res) => { + this.unitList = res.data; + }) + }, + /** 鏌ヨ鑰冩牳鍙戝竷鍒楄〃 */ + getList() { + this.loading = true; + listPublish(this.queryParams).then(response => { + this.publishList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + examineName: null, + templateId: null, + timeRange: null, + frequency: null, + state: null, + createTime: null, + createUser: null, + updateTime: null, + updateUser: null, + description: null + }; + this.resetForm("form"); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "娣诲姞鑰冩牳鍙戝竷"; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids + getPublish(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "淇敼鑰冩牳鍙戝竷"; + }); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updatePublish(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addPublish(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎鑰冩牳鍙戝竷缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { + return delPublish(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download('system/publish/export', { + ...this.queryParams + }, `publish_${new Date().getTime()}.xlsx`) + } + } +}; +</script> -- Gitblit v1.8.0