From b12df65ef993f6af68cae2bbfe5f42567d5c1532 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期六, 09 八月 2025 10:58:41 +0800
Subject: [PATCH] 修改了相关内容
---
src/views/archiveProjectName/index.vue | 239 +++++++++++++++++++++++
src/views/archivePlaceName/index.vue | 252 +++++++++++++++++++++++++
src/api/system/projectName.js | 44 ++++
src/api/system/placeName.js | 44 ++++
4 files changed, 579 insertions(+), 0 deletions(-)
diff --git a/src/api/system/placeName.js b/src/api/system/placeName.js
new file mode 100644
index 0000000..3444a33
--- /dev/null
+++ b/src/api/system/placeName.js
@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+export function listPlaceName(query) {
+ return request({
+ url: '/system/placeName/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戣缁�
+export function getName(id) {
+ return request({
+ url: '/system/placeName/' + id,
+ method: 'get'
+ })
+}
+
+// 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+export function addName(data) {
+ return request({
+ url: '/system/placeName',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+export function updateName(data) {
+ return request({
+ url: '/system/placeName',
+ method: 'put',
+ data: data
+ })
+}
+
+// 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+export function delName(id) {
+ return request({
+ url: '/system/placeName/' + id,
+ method: 'delete'
+ })
+}
diff --git a/src/api/system/projectName.js b/src/api/system/projectName.js
new file mode 100644
index 0000000..132366f
--- /dev/null
+++ b/src/api/system/projectName.js
@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛�
+export function listName(query) {
+ return request({
+ url: '/system/projectName/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戣缁�
+export function getName(id) {
+ return request({
+ url: '/system/projectName/' + id,
+ method: 'get'
+ })
+}
+
+// 鏂板銆愯濉啓鍔熻兘鍚嶇О銆�
+export function addName(data) {
+ return request({
+ url: '/system/projectName',
+ method: 'post',
+ data: data
+ })
+}
+
+// 淇敼銆愯濉啓鍔熻兘鍚嶇О銆�
+export function updateName(data) {
+ return request({
+ url: '/system/projectName',
+ method: 'put',
+ data: data
+ })
+}
+
+// 鍒犻櫎銆愯濉啓鍔熻兘鍚嶇О銆�
+export function delName(id) {
+ return request({
+ url: '/system/projectName/' + id,
+ method: 'delete'
+ })
+}
diff --git a/src/views/archivePlaceName/index.vue b/src/views/archivePlaceName/index.vue
new file mode 100644
index 0000000..a10a45d
--- /dev/null
+++ b/src/views/archivePlaceName/index.vue
@@ -0,0 +1,252 @@
+<template>
+ <div class="app-container">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
+ <el-form-item label="瀵瑰簲鐨勫尯鍙�" prop="nnumber">
+ <el-input
+ v-model="queryParams.nnumber"
+ placeholder="璇疯緭鍏ュ搴旂殑鍖哄彿"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </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:name: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:name: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:name: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:name:export']"
+ >瀵煎嚭</el-button>
+ </el-col>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+ </el-row>
+
+ <el-table v-loading="loading" :data="nameList" @selection-change="handleSelectionChange">
+ <el-table-column type="selection" width="55" align="center" />
+
+ <el-table-column label="瀵瑰簲鐨勫尯鍙�" align="center" prop="nnumber" />
+ <el-table-column label="瀵瑰簲鐨勫尯鍚嶇О" align="center" prop="name" />
+ <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:name:edit']"
+ >淇敼</el-button>
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ @click="handleDelete(scope.row)"
+ v-hasPermi="['system:name: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="100px">
+ <el-form-item label="瀵瑰簲鐨勫尯鍙�" prop="nnumber">
+ <el-input v-model="form.nnumber" placeholder="璇疯緭鍏ュ搴旂殑鍖哄彿" />
+ </el-form-item>
+ <el-form-item label="瀵瑰簲鐨勫尯鍚嶇О" prop="name">
+ <el-input v-model="form.name" 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 { listPlaceName, getName, delName, addName, updateName } from "@/api/system/placeName"
+
+export default {
+ name: "Name",
+ data() {
+ return {
+ // 閬僵灞�
+ loading: true,
+ // 閫変腑鏁扮粍
+ ids: [],
+ // 闈炲崟涓鐢�
+ single: true,
+ // 闈炲涓鐢�
+ multiple: true,
+ // 鏄剧ず鎼滅储鏉′欢
+ showSearch: true,
+ // 鎬绘潯鏁�
+ total: 0,
+ // 銆愯濉啓鍔熻兘鍚嶇О銆戣〃鏍兼暟鎹�
+ nameList: [],
+ // 寮瑰嚭灞傛爣棰�
+ title: "",
+ // 鏄惁鏄剧ず寮瑰嚭灞�
+ open: false,
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ nnumber: null,
+ name: null
+ },
+ // 琛ㄥ崟鍙傛暟
+ form: {},
+ // 琛ㄥ崟鏍¢獙
+ rules: {
+ }
+ }
+ },
+ created() {
+ this.getList()
+ },
+ methods: {
+ /** 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� */
+ getList() {
+ this.loading = true
+ listPlaceName(this.queryParams).then(response => {
+ this.nameList = response.data.data
+ this.total = response.data.total
+ this.loading = false
+ })
+ },
+ // 鍙栨秷鎸夐挳
+ cancel() {
+ this.open = false
+ this.reset()
+ },
+ // 琛ㄥ崟閲嶇疆
+ reset() {
+ this.form = {
+ id: null,
+ nnumber: null,
+ name: 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
+ getName(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) {
+ updateName(this.form).then(response => {
+ this.$modal.msgSuccess("淇敼鎴愬姛")
+ this.open = false
+ this.getList()
+ })
+ } else {
+ addName(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 delName(ids)
+ }).then(() => {
+ this.getList()
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛")
+ }).catch(() => {})
+ },
+ /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+ handleExport() {
+
+ this.download('/system/placeName/export', {
+ ...this.queryParams
+ }, `name_${new Date().getTime()}.xlsx`)
+ }
+ }
+}
+</script>
diff --git a/src/views/archiveProjectName/index.vue b/src/views/archiveProjectName/index.vue
new file mode 100644
index 0000000..53e0793
--- /dev/null
+++ b/src/views/archiveProjectName/index.vue
@@ -0,0 +1,239 @@
+<template>
+ <div class="app-container">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+ <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:projectName: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:projectName: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:projectName: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:projectName:export']"
+ >瀵煎嚭</el-button>
+ </el-col>
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+ </el-row>
+
+ <el-table v-loading="loading" :data="nameList" @selection-change="handleSelectionChange">
+ <el-table-column type="selection" width="55" align="center" />
+ <!-- <el-table-column label="${comment}" align="center" prop="id" /> -->
+ <el-table-column label="椤圭洰鍚嶇О" align="center" prop="name" />
+ <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:projectName:edit']"
+ >淇敼</el-button>
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-delete"
+ @click="handleDelete(scope.row)"
+ v-hasPermi="['system:projectName: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="name">
+ <el-input v-model="form.name" 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 { listName, getName, delName, addName, updateName } from "@/api/system/projectName"
+
+export default {
+ name: "Name",
+ data() {
+ return {
+ // 閬僵灞�
+ loading: true,
+ // 閫変腑鏁扮粍
+ ids: [],
+ // 闈炲崟涓鐢�
+ single: true,
+ // 闈炲涓鐢�
+ multiple: true,
+ // 鏄剧ず鎼滅储鏉′欢
+ showSearch: true,
+ // 鎬绘潯鏁�
+ total: 0,
+ // 銆愯濉啓鍔熻兘鍚嶇О銆戣〃鏍兼暟鎹�
+ nameList: [],
+ // 寮瑰嚭灞傛爣棰�
+ title: "",
+ // 鏄惁鏄剧ず寮瑰嚭灞�
+ open: false,
+ // 鏌ヨ鍙傛暟
+ queryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ name: null
+ },
+ // 琛ㄥ崟鍙傛暟
+ form: {},
+ // 琛ㄥ崟鏍¢獙
+ rules: {
+ }
+ }
+ },
+ created() {
+ this.getList()
+ },
+ methods: {
+ /** 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� */
+ getList() {
+ this.loading = true
+ listName(this.queryParams).then(response => {
+ this.nameList = response.data.data
+ this.total = response.data.total
+ this.loading = false
+ })
+ },
+ // 鍙栨秷鎸夐挳
+ cancel() {
+ this.open = false
+ this.reset()
+ },
+ // 琛ㄥ崟閲嶇疆
+ reset() {
+ this.form = {
+ id: null,
+ name: 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
+
+ getName(id).then(response => {
+ this.form = response.data
+ console.log(response)
+ this.open = true
+ this.title = "淇敼椤圭洰鍚嶇О"
+ })
+ },
+ /** 鎻愪氦鎸夐挳 */
+ submitForm() {
+ this.$refs["form"].validate(valid => {
+ if (valid) {
+ if (this.form.id != null) {
+ updateName(this.form).then(response => {
+ this.$modal.msgSuccess("淇敼鎴愬姛")
+ this.open = false
+ this.getList()
+ })
+ } else {
+ addName(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 delName(ids)
+ }).then(() => {
+ this.getList()
+ this.$modal.msgSuccess("鍒犻櫎鎴愬姛")
+ }).catch(() => {})
+ },
+ /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+ handleExport() {
+ this.download('system/projectName/export', {
+ ...this.queryParams
+ }, `name_${new Date().getTime()}.xlsx`)
+ }
+ }
+}
+</script>
--
Gitblit v1.9.1