From b28a825dd4dee120f70398308c04cf97fa0688d8 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期一, 01 四月 2024 23:35:53 +0800
Subject: [PATCH] 1

---
 src/views/console/system/dict.vue |  102 +++++++++++++++++++++++++++------------------------
 1 files changed, 54 insertions(+), 48 deletions(-)

diff --git a/src/views/console/system/dict.vue b/src/views/console/system/dict.vue
index 92e39e1..2f05ad4 100644
--- a/src/views/console/system/dict.vue
+++ b/src/views/console/system/dict.vue
@@ -10,21 +10,17 @@
 	<div class="dict-main">
 		<el-form :inline="true" :model="searchData" abel-width="120px">
 			<el-form-item label="瀛楀吀缂栧彿">
-				<el-input v-model="searchData.test" placeholder="瀛楀吀缂栧彿" clearable />
+				<el-input v-model="searchData.code" placeholder="瀛楀吀缂栧彿" clearable />
 			</el-form-item>
 			<el-form-item label="瀛楀吀鍚嶇О">
-				<el-select
-					v-model="searchData.test"
-					placeholder="瀛楀吀鍚嶇О"
-					clearable
-				>
+				<el-select v-model="searchData.dictValue" placeholder="瀛楀吀鍚嶇О" clearable>
 					<el-option label="Zone one" value="shanghai" />
 					<el-option label="Zone two" value="beijing" />
 				</el-select>
 			</el-form-item>
 			<el-form-item>
-				<el-button type="primary" @click="searchBtn">鎼滅储</el-button>
-				<el-button @click="searchBtn">娓呯┖</el-button>
+				<el-button type="primary" @click="searchclick">鎼滅储</el-button>
+				<el-button @click="searchClearBtn">娓呯┖</el-button>
 			</el-form-item>
 		</el-form>
 		<div>
@@ -37,10 +33,14 @@
 			<div class="dict-table">
 				<el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange">
 					<el-table-column type="selection" width="55" />
-					<el-table-column prop="date" label="瀛楀吀缂栧彿"></el-table-column>
-					<el-table-column prop="name" label="瀛楀吀鍚嶇О"></el-table-column>
-					<el-table-column prop="name" label="瀛楀吀鎺掑簭"></el-table-column>
-					<el-table-column prop="name" label="灏佸瓨"></el-table-column>
+					<el-table-column prop="code" label="瀛楀吀缂栧彿"></el-table-column>
+					<el-table-column prop="dictValue" label="瀛楀吀鍚嶇О"></el-table-column>
+					<el-table-column prop="sort" label="瀛楀吀鎺掑簭"></el-table-column>
+					<el-table-column prop="isSealed" label="灏佸瓨">
+						<template #default="scope">
+							<div>{{scope.row.isSealed == 0?"鍚�":"鏄�"}}</div>
+						</template>
+					</el-table-column>
 					<el-table-column fixed="right" label="鎿嶄綔">
 						<template #default="scope">
 							<el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">鏌ョ湅</el-button>
@@ -51,19 +51,20 @@
 					</el-table-column>
 				</el-table>
 				<el-pagination
+					style="margin-top: 12px;"
 					@size-change="handleSizeChange"
 					@current-change="handleCurrentChange"
 					:current-page="currentPage4"
-					:page-sizes="[100, 200, 300, 400]"
-					:page-size="100"
+					:page-sizes="[15, 50, 100]"
+					:page-size="15"
 					layout="total, sizes, prev, pager, next, jumper"
-					:total="400">
+					:total="total">
 				</el-pagination>
 			</div>
 		</div>
 	</div>
 	
-	<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
+	<save-dialog v-if="dialog.save" ref="saveDialog" @success="addDictSuccess" @closed="dialog.save=false"></save-dialog>
 	<allocation-dialog v-if="dialog.allocation" ref="allocationDialog" @success="handleSuccess" @closed="dialog.allocation=false"></allocation-dialog>
 </template>
 <script>
@@ -73,8 +74,12 @@
 		name: "allocation",
 		data(){
 			return {
+				total: 0,
 				searchData: {
-					test: ""
+					code: "",
+					dictValue: "",
+					current: "1",
+					size: "15"
 				},
 				dialog: {
 					save: false,
@@ -87,48 +92,44 @@
 					label: '榛勯噾绯�'
 				}],
 				input3: '',
-				tableData: [{
-					date: '2016-05-02',
-					name: '鐜嬪皬铏�',
-					province: '涓婃捣',
-					city: '鏅檧鍖�',
-					address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�',
-					zip: 200333
-					}, {
-					date: '2016-05-04',
-					name: '鐜嬪皬铏�',
-					province: '涓婃捣',
-					city: '鏅檧鍖�',
-					address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�',
-					zip: 200333
-					}, {
-					date: '2016-05-01',
-					name: '鐜嬪皬铏�',
-					province: '涓婃捣',
-					city: '鏅檧鍖�',
-					address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�',
-					zip: 200333
-					}, {
-					date: '2016-05-03',
-					name: '鐜嬪皬铏�',
-					province: '涓婃捣',
-					city: '鏅檧鍖�',
-					address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1516 寮�',
-					zip: 200333
-				}]
+				tableData: []
 			}
 		},
 		created(){
 			
 		},
 		mounted(){
-			
+			this.searchBtn();
 		},
 		components: {
 			saveDialog,allocationDialog
 		},
 		methods: {
-			searchBtn() {},
+			addDictSuccess(addDictForm) {
+				this.searchClearBtn();
+			},
+			searchClearBtn() {
+				this.searchData = {
+					code: "",
+					dictValue: "",
+					current: "1",
+					size: "15"
+				}
+				this.searchBtn();
+			},
+			searchclick() {
+				this.searchData.current = "1";
+				this.searchData.size = "15";
+				this.searchBtn();
+			},
+			searchBtn() {
+				this.$HTTP.get("/api/blade-system/dict/parent-list",this.searchData).then(res=> {
+					if(res.code == 200) {
+						this.tableData = res.data.records;
+						this.total = res.data.total;
+					}
+				})
+			},
 			//瀛楀吀閰嶇疆
 			table_allocation(row) {
 				this.dialog.allocation = true;
@@ -172,9 +173,14 @@
 			},
 			handleSizeChange(val) {
 				console.log(`姣忛〉 ${val} 鏉);
+				this.searchData.current = "1";
+				this.searchData.size = val;
+				this.searchBtn();
 			},
 			handleCurrentChange(val) {
 				console.log(`褰撳墠椤�: ${val}`);
+				this.searchData.current = val;
+				this.searchBtn();
 			}
 		}
 	}

--
Gitblit v1.9.3