Browse Source

样式调整

zhangchong 2 years ago
parent
commit
c742bb98c1

+ 1 - 1
src/theme/app.scss

@@ -355,7 +355,7 @@ li {
 
 
 /* 外边距、内边距全局样式
 /* 外边距、内边距全局样式
 ------------------------------- */
 ------------------------------- */
-@for $i from 1 through 35 {
+@for $i from 0 through 35 {
 	.mt#{$i} {
 	.mt#{$i} {
 		margin-top: #{$i}px !important;
 		margin-top: #{$i}px !important;
 	}
 	}

+ 8 - 6
src/views/knowledge/config/type/index.vue

@@ -3,14 +3,14 @@
 		<div class="layout-padding-auto layout-padding-view pd20">
 		<div class="layout-padding-auto layout-padding-view pd20">
 			<div class="flex-center-between mb20">
 			<div class="flex-center-between mb20">
 				<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
 				<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
-					<el-form-item label="关键字" prop="keyword">
+					<el-form-item label="关键字" prop="keyword" class="mb0">
 						<el-input v-model="state.queryParams.keyword" placeholder="类型名称" clearable @keyup.enter="handleQuery" style="width: 250px" />
 						<el-input v-model="state.queryParams.keyword" placeholder="类型名称" clearable @keyup.enter="handleQuery" style="width: 250px" />
 					</el-form-item>
 					</el-form-item>
-					<el-form-item>
-						<el-button type="primary" @click="handleQuery" :loading="state.loading" v-waves>
+					<el-form-item class="mb0">
+						<el-button type="primary" @click="handleQuery" :loading="state.loading">
 							<SvgIcon name="ele-Search" class="mr5" />查询
 							<SvgIcon name="ele-Search" class="mr5" />查询
 						</el-button>
 						</el-button>
-						<el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
+						<el-button @click="resetQuery(ruleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
 					</el-form-item>
 					</el-form-item>
 				</el-form>
 				</el-form>
 				<div>
 				<div>
@@ -84,6 +84,7 @@ const knowledgeTypeEditRef = ref();
 const ruleFormRef = ref();
 const ruleFormRef = ref();
 const state = reactive({
 const state = reactive({
 	tableData: <any>[], // 获取所有菜单
 	tableData: <any>[], // 获取所有菜单
+	staticArr: <any>[], // 获取所有菜单
 	loading: false,
 	loading: false,
 	isExpand: true,
 	isExpand: true,
 	queryParams: {
 	queryParams: {
@@ -93,8 +94,8 @@ const state = reactive({
 });
 });
 // 过滤表格
 // 过滤表格
 const formatTable = (list: any[], keyword: string) => {
 const formatTable = (list: any[], keyword: string) => {
-	if (!list.length || !Array.isArray(list)) return [];
 	let emptyArr: any[] = [];
 	let emptyArr: any[] = [];
+	console.log(list)
 	list.map((item) => {
 	list.map((item) => {
 		if (item.name.includes(keyword)) {
 		if (item.name.includes(keyword)) {
 			if (item.child && Array.isArray(item.child) && item.child.length > 0) {
 			if (item.child && Array.isArray(item.child) && item.child.length > 0) {
@@ -114,7 +115,7 @@ const formatTable = (list: any[], keyword: string) => {
 const handleQuery = throttle(() => {
 const handleQuery = throttle(() => {
 	if (state.queryParams.keyword) {
 	if (state.queryParams.keyword) {
 		state.loading = true;
 		state.loading = true;
-		state.tableData = formatTable(state.tableData, state.queryParams.keyword);
+		state.tableData = formatTable(JSON.parse(JSON.stringify(state.staticArr)), state.queryParams.keyword);
 		state.loading = false;
 		state.loading = false;
 	} else {
 	} else {
 		getList();
 		getList();
@@ -214,6 +215,7 @@ const getList = () => {
 	treelist()
 	treelist()
 		.then((res: any) => {
 		.then((res: any) => {
 			state.tableData = res?.result ?? [];
 			state.tableData = res?.result ?? [];
+			state.staticArr = res?.result ?? [];
 			state.loading = false;
 			state.loading = false;
 		})
 		})
 		.catch(() => {
 		.catch(() => {

+ 5 - 3
src/views/system/config/dict/index.vue

@@ -31,10 +31,10 @@
 						<div class="flex-column">
 						<div class="flex-column">
 							<div class="flex-between mb10">
 							<div class="flex-between mb10">
 								<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
 								<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
-									<el-form-item label="关键字" prop="keyword">
+									<el-form-item label="关键字" prop="keyword"  class="mb0">
 										<el-input v-model="state.queryParams.keyword" placeholder="字典值名称/字典值" clearable @keyup.enter="handleQuery" />
 										<el-input v-model="state.queryParams.keyword" placeholder="字典值名称/字典值" clearable @keyup.enter="handleQuery" />
 									</el-form-item>
 									</el-form-item>
-									<el-form-item>
+									<el-form-item  class="mb0">
 										<el-button type="primary" @click="handleQuery" :loading="state.tableLoading" v-waves>
 										<el-button type="primary" @click="handleQuery" :loading="state.tableLoading" v-waves>
 											<SvgIcon name="ele-Search" class="mr5" />查询
 											<SvgIcon name="ele-Search" class="mr5" />查询
 										</el-button>
 										</el-button>
@@ -112,6 +112,7 @@ const state = reactive<any>({
 		loading: false,
 		loading: false,
 	},
 	},
 	tableData: [],
 	tableData: [],
+	staticArr:[],
 	total: 0,
 	total: 0,
 	loading: false,
 	loading: false,
 	tableLoading: false,
 	tableLoading: false,
@@ -179,7 +180,7 @@ const handleQuery = throttle(() => {
 		state.tableLoading = true;
 		state.tableLoading = true;
 		state.expandedRowKeys = [];
 		state.expandedRowKeys = [];
 		emptyArr = [];
 		emptyArr = [];
-		state.tableData = formatTable(state.tableData, state.queryParams.keyword);
+		state.tableData = formatTable(JSON.parse(JSON.stringify(state.staticArr)), state.queryParams.keyword);
 		state.expandedRowKeys = getExpand(state.tableData);
 		state.expandedRowKeys = getExpand(state.tableData);
 		state.tableLoading = false;
 		state.tableLoading = false;
 	} else {
 	} else {
@@ -227,6 +228,7 @@ const getList = () => {
 		getDataByTypeid(state.queryParams)
 		getDataByTypeid(state.queryParams)
 			.then((response: any) => {
 			.then((response: any) => {
 				state.tableData = response?.result ?? [];
 				state.tableData = response?.result ?? [];
+				state.staticArr = response?.result ?? [];
 				state.tableLoading = false;
 				state.tableLoading = false;
 			})
 			})
 			.catch(() => {
 			.catch(() => {

+ 6 - 4
src/views/system/menu/index.vue

@@ -3,10 +3,10 @@
 		<div class="layout-padding-auto layout-padding-view pd20">
 		<div class="layout-padding-auto layout-padding-view pd20">
 			<div class="flex-center-between mb20">
 			<div class="flex-center-between mb20">
 				<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
 				<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
-					<el-form-item label="关键字" prop="keyword">
+					<el-form-item label="关键字" prop="keyword" class="mb0">
 						<el-input v-model="state.queryParams.keyword" placeholder="菜单名称" clearable @keyup.enter="handleQuery" style="width: 250px" />
 						<el-input v-model="state.queryParams.keyword" placeholder="菜单名称" clearable @keyup.enter="handleQuery" style="width: 250px" />
 					</el-form-item>
 					</el-form-item>
-					<el-form-item>
+					<el-form-item class="mb0">
 						<el-button type="primary" @click="handleQuery" :loading="state.loading" v-waves>
 						<el-button type="primary" @click="handleQuery" :loading="state.loading" v-waves>
 							<SvgIcon name="ele-Search" class="mr5" />查询
 							<SvgIcon name="ele-Search" class="mr5" />查询
 						</el-button>
 						</el-button>
@@ -68,11 +68,12 @@ const editMenuRef = ref();
 const ruleFormRef = ref();
 const ruleFormRef = ref();
 const state = reactive({
 const state = reactive({
 	menuTableData: <any>[], // 获取所有菜单
 	menuTableData: <any>[], // 获取所有菜单
+	staticArr: <any>[],
 	loading: false,
 	loading: false,
 	queryParams: {
 	queryParams: {
 		keyword: '',
 		keyword: '',
 	},
 	},
-	expandedRowKeys:<any>[],
+	expandedRowKeys: <any>[],
 	columns: [
 	columns: [
 		{
 		{
 			key: 'pageName',
 			key: 'pageName',
@@ -249,7 +250,7 @@ const handleQuery = throttle(() => {
 		state.loading = true;
 		state.loading = true;
 		state.expandedRowKeys = [];
 		state.expandedRowKeys = [];
 		emptyArr = [];
 		emptyArr = [];
-		state.menuTableData = formatTable(state.menuTableData, state.queryParams.keyword);
+		state.menuTableData = formatTable(JSON.parse(JSON.stringify(state.staticArr)), state.queryParams.keyword);
 		state.expandedRowKeys = getExpand(state.menuTableData);
 		state.expandedRowKeys = getExpand(state.menuTableData);
 		state.loading = false;
 		state.loading = false;
 	} else {
 	} else {
@@ -314,6 +315,7 @@ const getMenuListApi = () => {
 	getMenuList()
 	getMenuList()
 		.then((res: any) => {
 		.then((res: any) => {
 			state.menuTableData = res?.result ?? [];
 			state.menuTableData = res?.result ?? [];
+			state.staticArr = res?.result ?? [];
 			state.loading = false;
 			state.loading = false;
 		})
 		})
 		.catch(() => {
 		.catch(() => {

+ 6 - 4
src/views/system/organize/index.vue

@@ -3,10 +3,10 @@
 		<div class="layout-padding-auto layout-padding-view pd20">
 		<div class="layout-padding-auto layout-padding-view pd20">
 			<div class="flex-center-between mb20">
 			<div class="flex-center-between mb20">
 				<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
 				<el-form :model="state.queryParams" ref="ruleFormRef" :inline="true" @submit.native.prevent>
-					<el-form-item label="关键字" prop="keyword">
-						<el-input v-model="state.queryParams.keyword" placeholder="部门名称" clearable @keyup.enter="handleQuery" style="width: 250px;"/>
+					<el-form-item label="关键字" prop="keyword" class="mb0">
+						<el-input v-model="state.queryParams.keyword" placeholder="部门名称" clearable @keyup.enter="handleQuery" style="width: 250px" />
 					</el-form-item>
 					</el-form-item>
-					<el-form-item>
+					<el-form-item class="mb0">
 						<el-button type="primary" @click="handleQuery" :loading="state.loading" v-waves>
 						<el-button type="primary" @click="handleQuery" :loading="state.loading" v-waves>
 							<SvgIcon name="ele-Search" class="mr5" />查询
 							<SvgIcon name="ele-Search" class="mr5" />查询
 						</el-button>
 						</el-button>
@@ -66,6 +66,7 @@ const addOrgRef = ref();
 const editOrgRef = ref();
 const editOrgRef = ref();
 const state = reactive({
 const state = reactive({
 	orgTableData: <any>[], // 获取所有菜单
 	orgTableData: <any>[], // 获取所有菜单
+	staticArr: <any>[],
 	loading: false,
 	loading: false,
 	queryParams: {
 	queryParams: {
 		keyword: '',
 		keyword: '',
@@ -167,7 +168,7 @@ const handleQuery = throttle(() => {
 		state.loading = true;
 		state.loading = true;
 		state.expandedRowKeys = [];
 		state.expandedRowKeys = [];
 		emptyArr = [];
 		emptyArr = [];
-		state.orgTableData = formatTable(state.orgTableData, state.queryParams.keyword);
+		state.orgTableData = formatTable(JSON.parse(JSON.stringify(state.staticArr)), state.queryParams.keyword);
 		state.expandedRowKeys = getExpand(state.orgTableData);
 		state.expandedRowKeys = getExpand(state.orgTableData);
 		state.loading = false;
 		state.loading = false;
 	} else {
 	} else {
@@ -228,6 +229,7 @@ const getOrgListApi = () => {
 	getOrgList()
 	getOrgList()
 		.then((res: any) => {
 		.then((res: any) => {
 			state.orgTableData = res?.result ?? [];
 			state.orgTableData = res?.result ?? [];
+			state.staticArr = res?.result ?? [];
 			state.loading = false;
 			state.loading = false;
 		})
 		})
 		.catch(() => {
 		.catch(() => {