From 76e49eb32372b05ecf3b3e4c63567c5a987430bd Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 09 八月 2023 09:27:17 +0800
Subject: [PATCH] 1.编码规格完成80%
---
src/utils/request.js | 4
src/api/systemSetting.js | 10 +
src/styles/global.css | 42 ++++++-
src/views/systemSetting/encodingRules.vue | 228 ++++++++++++---------------------------------
src/layout/components/Sidebar/index.vue | 1
src/store/modules/permission.js | 1
src/components/ThemePicker/index.vue | 11 ++
7 files changed, 119 insertions(+), 178 deletions(-)
diff --git a/src/api/systemSetting.js b/src/api/systemSetting.js
index 9532f19..f1f818b 100644
--- a/src/api/systemSetting.js
+++ b/src/api/systemSetting.js
@@ -17,7 +17,15 @@
data
})
}
-
+// 缂栫爜瑙勫垯鍒犻櫎
+export function DeleteEncodingRules(data) {
+ return request({
+ url: 'SystemSetting/DeleteEncodingRules',
+ method: 'post',
+ params: data
+ })
+}
+// 缂栫爜瑙勫垯鑾峰彇鍙缃殑鍔熻兘鑿滃崟淇℃伅
export function CodeMenuSelect() {
return request({
url: 'SystemSetting/CodeMenuSelect',
diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue
index 28c5f66..ec71d54 100644
--- a/src/components/ThemePicker/index.vue
+++ b/src/components/ThemePicker/index.vue
@@ -176,4 +176,15 @@
.theme-picker-dropdown .el-color-dropdown__link-btn {
display: none;
}
+
+.el-color-dropdown__btns{
+ display: flex;
+ justify-content: space-between;
+}
+.el-color-dropdown__btns .el-button--text {
+ display: none !important;
+}
+.el-color-dropdown__btns .el-button--default {
+ height: 28px !important;
+}
</style>
diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue
index 1cf2f64..2e7e9ee 100644
--- a/src/layout/components/Sidebar/index.vue
+++ b/src/layout/components/Sidebar/index.vue
@@ -76,6 +76,7 @@
activeMenu() {
const route = this.$route
const { meta, path } = route
+
// if set path, the sidebar will highlight the path you set
removeCookie('ruleCode')
setCookie('ruleCode', meta.code)// 灏嗙紪鐮佽鍒檆ode瀛樺埌cookie閲岄潰
diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js
index 706fed9..0831d2e 100644
--- a/src/store/modules/permission.js
+++ b/src/store/modules/permission.js
@@ -17,6 +17,7 @@
* @param {*} menu
*/
export function getAsyncRoutes(routes, menu) {
+ console.log(routes, menu, 6)
// menu 涓璮lag "0" 琛ㄧず true "1"琛ㄧずfalse
const menuCode = []// 灏嗗悗绔痗ode鍙栧嚭瀛樻垚鏁扮粍褰㈠紡
const menuNameAndCode = []// 灏嗗悗绔痗ode涓巒ame鍙栧嚭瀛樻垚鏁扮粍褰㈠紡
diff --git a/src/styles/global.css b/src/styles/global.css
index 8dc9f35..d291fc1 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -23,16 +23,42 @@
padding: 0 10px;
}
-.el-table__body-wrapper{
+.el-table .custom-row {
background: #f8f8fa;
}
-.el-input__inner{
+.el-table__body-wrapper{
+ background: #f8f8fa;
+}
+.el-table__body .el-table__row.hover-row td {
+ background-color: #eaecef !important;
+}
+
+.body .el-input__inner{
height: 34px !important;
}
.el-dialog__body{
padding:50px 80px !important;
+}
+.el-dialog__body .el-input__inner{
+ height: 34px !important;
+}
+
+.el-icon-delete,.el-icon-edit-outline{
+ cursor: pointer;
+ margin-right: 15px;
+}
+
+.operationClass {
+ height: 23px;
+ display: flex;
+ align-items: center;
+}
+
+.el-message-box__btns{
+ display: flex;
+ justify-content: flex-end;
}
@@ -102,12 +128,12 @@
position: relative;
}
-.operationClass {
- height: 23px;
- display: flex;
- justify-content: space-between;
- align-items: center;
-}
+/*.operationClass {*/
+/* height: 23px;*/
+/* display: flex;*/
+/* justify-content: space-between;*/
+/* align-items: center;*/
+/*}*/
/*瀵硅瘽妗嗘寜閽簳閮�*/
diff --git a/src/utils/request.js b/src/utils/request.js
index 570a643..3061c33 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -1,7 +1,7 @@
import axios from 'axios'
import { Message, Notification } from 'element-ui'
import store from '@/store'
-import { removeCookie } from '@/utils/auth'
+import { getCookie, removeCookie } from '@/utils/auth'
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
@@ -14,6 +14,8 @@
config => {
// do something before request is sent
config.headers['Token'] = localStorage.getItem('token')
+
+ config.headers['ruleCode'] = getCookie('ruleCode') // 缂栫爜瑙勫垯
return config
},
error => {
diff --git a/src/views/systemSetting/encodingRules.vue b/src/views/systemSetting/encodingRules.vue
index 1a7f313..7b18f23 100644
--- a/src/views/systemSetting/encodingRules.vue
+++ b/src/views/systemSetting/encodingRules.vue
@@ -1,7 +1,7 @@
<template>
<div>
<div class="body" :style="{height:mainHeight+'px'}">
- <div class="bodyTopButtonGroup" style="justify-content: space-between">
+ <div class="bodyTopButtonGroup">
<el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
</div>
@@ -14,7 +14,7 @@
style="display: flex;"
>
<div class="elForm">
- <el-form-item label="缂栫爜鍚嶇О" style=" display: flex;">
+ <el-form-item label="鑿滃崟鍚嶇О" style=" display: flex;">
<el-input v-model="form.rightname" placeholder="璇疯緭鍏�" style="width: 200px" />
</el-form-item>
<el-form-item label="鍥哄畾瀛楃" style=" display: flex;">
@@ -22,32 +22,20 @@
</el-form-item>
</div>
- <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}">
- <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+ <div
+ class="bodySearchReset"
+ :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+ >
+ <el-button v-waves type="primary" icon="el-icon-search" @click="getEncodingRules">鏌ヨ</el-button>
<el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
</div>
</el-form>
<div
class="bodyTopFormExpand"
- >
- <!-- <svg-icon-->
- <!-- v-show="mouseHoverType==='mouseout'"-->
- <!-- style="cursor: pointer"-->
- <!-- :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
- <!-- @mouseenter="mouseHoverType=$event.type"-->
- <!-- />-->
- <!-- <svg-icon-->
- <!-- v-show="mouseHoverType==='mouseenter'"-->
- <!-- style="cursor: pointer"-->
- <!-- :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
- <!-- @click="isExpandForm=!isExpandForm"-->
- <!-- @mouseout="mouseHoverType=$event.type"-->
- <!-- />-->
- </div>
+ />
</div>
<div class="elTableDiv">
- <!-- :row-class-name="tableRowClassName"-->
<el-table
ref="tableDataRef"
@@ -55,6 +43,7 @@
:data="tableData"
:height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
border
+ row-class-name="custom-row"
:style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
highlight-current-row
:header-cell-style="this.$headerCellStyle"
@@ -62,39 +51,48 @@
@sort-change="sortChange"
>
<el-table-column
- prop="RowNum"
+ prop="rowNum"
width="50"
fixed
label="搴忓彿"
/>
<el-table-column
- prop="org_code"
- label="缂栫爜"
+ prop="menucode"
+ label="鑿滃崟缂栫爜"
sortable="custom"
/>
<el-table-column
- prop="org_name"
- label="缂栫爜鍚嶇О"
+ prop="menuname"
+ label="鑿滃崟鍚嶇О"
sortable="custom"
/>
<el-table-column
- prop="description"
- label="绫诲瀷"
+ prop="type"
+ label="鑿滃崟绫诲瀷"
sortable="custom"
/>
<el-table-column
- prop="parentorg_name"
+ prop="prefix"
label="鍥哄畾瀛楃"
sortable="custom"
/>
<el-table-column
- prop="lm_user"
+ prop="filingdate"
label="缂栫爜鏍煎紡"
+ sortable="custom"
+ >
+ <template slot-scope="{row}">
+ <div>{{ dateType.find(i=>i.code===row.filingdate).name }}</div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ prop="incbit"
+ label="鑷浣嶆暟"
sortable="custom"
/>
<el-table-column
- prop="lm_date"
- label="鍒涘缓鏃堕棿"
+ prop="value"
+ label="娴佹按鍙�"
width="160"
sortable="custom"
/>
@@ -106,10 +104,14 @@
<template slot-scope="{row}">
<div class="operationClass">
<el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
- <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+ <i
+ class="el-icon-edit-outline"
+ :style="{color:$store.state.settings.theme}"
+ @click="edit('edit',row)"
+ />
</el-tooltip>
<el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
- <i class="el-icon-delete" @click="del(row)" />
+ <i class="el-icon-delete" :style="{color:$store.state.settings.theme}" @click="del(row)" />
</el-tooltip>
</div>
</template>
@@ -202,13 +204,11 @@
<script>
import Pagination from '@/components/Pagination'
-import { AddUpdateOrganization, DeleteOrganization, OrganizationSearch, PrentOrganization } from '@/api/basicSettings'
import { getCookie } from '@/utils/auth'
import { validateCode } from '@/utils/global'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
-import { LoginMenu } from '@/api/user'
-import { CodeMenuSelect, EncodingRules, SaveEncodingRules } from '@/api/systemSetting'
+import { CodeMenuSelect, DeleteEncodingRules, EncodingRules, SaveEncodingRules } from '@/api/systemSetting'
import arrayToTree from 'array-to-tree'
export default {
@@ -309,7 +309,7 @@
childrenProperty: 'children'
})
this.menuOptions = this.menuOptionsAll.filter(i => i.type === this.dialogForm.type)
- console.log(this.menuOptions, 2)
+ // console.log(this.menuOptions, 2)
},
radioChange() {
this.menuOptions = this.menuOptionsAll.filter(i => i.type === this.dialogForm.type)
@@ -332,17 +332,12 @@
this.form.prop = prop
this.getEncodingRules()
},
- // 鏌ヨ
- search() {
- this.getEncodingRules()
- },
// 閲嶇疆
reset() {
this.form.rightname = ''
this.form.prefix = ''
this.getEncodingRules()
},
-
// 鏂板鎸夐挳
add(operation) {
this.operation = operation
@@ -354,9 +349,24 @@
this.dialogVisible = true
this.$nextTick(() => {
- this.dialogForm.OrgCode = row.org_code
- this.dialogForm.OrgName = row.org_name
- this.dialogForm.SupUnit = row.parent_id
+ this.dialogForm.type = row.type
+
+ let parentCode = ''
+ this.menuOptions.forEach(item => {
+ if (item.children && item.children.length) {
+ item.children.forEach(it => {
+ if (it.menucode === row.menucode) {
+ parentCode = it.parent_id
+ }
+ })
+ }
+ })
+
+ this.$refs.cascader.checkedValue = [parentCode, row.menucode]
+ this.dialogForm.rightcode = row.menucode
+ this.dialogForm.incbit = row.incbit
+ this.dialogForm.filingdate = row.filingdate
+ this.dialogForm.prefix = row.prefix
})
},
// 鍒犻櫎鎸夐挳
@@ -366,9 +376,9 @@
cancelButtonText: '鍙栨秷',
type: 'warning'
}).then(() => {
- DeleteOrganization({ orgid: row.code }).then(res => {
+ DeleteEncodingRules({ menucode: row.menucode }).then(res => {
if (res.code === '200') {
- this.$message.success('鍒犻櫎鎴愬姛!')
+ this.$notify.success('鍒犻櫎鎴愬姛!')
if (this.form.page > 1 && this.tableData.length === 1) {
this.form.page--
}
@@ -376,7 +386,7 @@
}
})
}).catch(() => {
- this.$message.info('宸插彇娑堝垹闄�')
+ this.$notify.info('宸插彇娑堝垹闄�')
})
},
// 瀵硅瘽妗嗗叧闂簨浠�
@@ -397,7 +407,8 @@
dialogVisibleConfirm() {
this.$refs.dialogForm.validate(valid => {
if (valid) {
- const rightcode = this.$refs.cascader.checkedValue[ this.$refs.cascader.checkedValue.length - 1]
+ // console.log(this.$refs.cascader.checkedValue, 1)
+ const rightcode = this.$refs.cascader.checkedValue[this.$refs.cascader.checkedValue.length - 1]
this.dialogForm.rightcode = rightcode
this.dialogForm.rightname = this.menuOptions[this.menuOptions.findIndex(i => i.menucode === this.$refs.cascader.checkedValue[0])].children.find(i => i.menucode === rightcode).menuname
@@ -421,125 +432,6 @@
this.$refs.tableDataRef.doLayout()
})
}
- // tableRowClassName({ row, rowIndex }) {
- // return 'custom-row'
- // }
}
}
</script>
-
-<!--鍏叡椤甸潰鏍峰紡-->
-<!--<style lang="scss" scoped>-->
-<!--$main_color: #42b983;-->
-<!--::v-deep .el-button--text{-->
-<!-- font-size: 14px ;-->
-<!-- cursor: pointer ;-->
-<!--}-->
-<!--.el-icon-share ,.el-icon-delete,.el-icon-edit-outline{-->
-<!-- color: $main_color;-->
-<!-- cursor: pointer;-->
-<!--}-->
-<!--.el-icon-edit-outline{-->
-<!-- margin-right: 15px;-->
-<!--}-->
-
-<!--::v-deep .el-button--primary, .el-button--default, .el-button--info {-->
-<!-- height: 34px;-->
-<!-- display: flex;-->
-<!-- align-items: center;-->
-<!-- padding: 0 15px;-->
-<!--}-->
-
-<!--::v-deep .el-button--primary {-->
-<!-- //background-color: $main_color !important;-->
-<!--}-->
-
-<!--::v-deep .el-button--default {-->
-<!-- background-color: #f8f8fa;-->
-<!-- border: none;-->
-<!--}-->
-
-<!--::v-deep .el-input__inner {-->
-<!-- height: 34px;-->
-<!-- line-height: 34px;-->
-<!-- //color: #a7a7a7;-->
-<!--}-->
-
-<!--::v-deep .el-dialog__body {-->
-<!-- padding: 20px 100px !important;-->
-<!--}-->
-
-<!--::v-deep .dialogVisibleRoles .el-dialog__body {-->
-<!-- padding: 20px 20px !important;-->
-<!--}-->
-
-<!--::v-deep .importPickerClass .el-dialog__body {-->
-<!-- padding: 20px 20px !important;-->
-<!--}-->
-
-<!--::v-deep .el-dialog__footer {-->
-<!-- display: flex;-->
-<!-- justify-content: flex-end;-->
-<!--}-->
-
-<!--::v-deep .el-table .caret-wrapper {-->
-<!-- transform: scale(0.8);-->
-<!--}-->
-
-<!--::v-deep .cell {-->
-<!-- display: flex;-->
-<!-- align-items: center;-->
-<!-- justify-content: space-between;-->
-<!--}-->
-
-<!--::v-deep .el-table::before {-->
-<!-- height: 0;-->
-<!--}-->
-
-<!--::v-deep .el-table__body-wrapper {-->
-<!-- background-color: #f8f8fa;-->
-<!--}-->
-
-<!--::v-deep .el-table__body .el-table__row.hover-row td{-->
-<!-- background-color: #eaecef ;-->
-<!--}-->
-
-<!--::v-deep .el-form--inline .el-form-item__label {-->
-<!-- color: #a7a7a7;-->
-<!--}-->
-
-<!--.body ::v-deep .el-divider {-->
-<!-- border: 1px solid #eee;-->
-<!-- width: 99%;-->
-<!-- margin: 10px auto;-->
-<!--}-->
-
-<!--.body ::v-deep .el-form-item {-->
-<!-- margin-bottom: 0;-->
-<!--}-->
-
-<!--.userDialogVisible ::v-deep .el-form-item {-->
-<!-- margin-bottom: 0;-->
-<!--}-->
-
-<!--::v-deep .el-select__caret{-->
-<!-- display: flex;-->
-<!-- align-items: center;-->
-<!-- justify-content: center;-->
-<!--}-->
-
-<!--.tableFixed{-->
-<!-- ::v-deep .el-table__fixed-right{-->
-<!-- height: 100% !important;-->
-<!-- }-->
-<!-- ::v-deep .el-table__fixed{-->
-<!-- height: 100% !important;-->
-<!-- }-->
-<!--}-->
-<!--</style>-->
-<!--<style>-->
-
-<!--.el-table .custom-row {-->
-<!-- background: #f8f8fa;-->
-<!--}-->
-<!--</style>-->
--
Gitblit v1.9.3