diff --git a/.env.production b/.env.production index 1953fee..99b00d4 100644 --- a/.env.production +++ b/.env.production @@ -22,4 +22,4 @@ VUE_APP_SJ_API = 'http://${VUE_APP_SJ_BASE_IP_ADDRESS}:9092/SJSE/' VUE_APP_PREVIEW_API = '${VUE_APP_SERVER_API}/sdma-preview/' # websocket连接地址 -VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/' +VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}:9100/sdma-websocket/websocket/' diff --git a/.env.test b/.env.test index 135c37a..abe1fde 100644 --- a/.env.test +++ b/.env.test @@ -22,4 +22,4 @@ VUE_APP_SJ_API = 'http://${VUE_APP_SJ_BASE_IP_ADDRESS}:9092/SJSE/' VUE_APP_PREVIEW_API = '${VUE_APP_SERVER_API}/sdma-preview/' # websocket连接地址 -VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/' +VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}:9100/sdma-websocket/websocket/' diff --git a/src/api/data_scope_department.js b/src/api/data_scope_department.js new file mode 100644 index 0000000..d7bd05c --- /dev/null +++ b/src/api/data_scope_department.js @@ -0,0 +1,9 @@ +import api from '@/utils/api' + +export function getAll(params) { + return api({ + url: '/dataScopeDepartment/all', + method: 'get', + params + }) +} diff --git a/src/components/Crud/Edit/index.vue b/src/components/Crud/Edit/index.vue index 9c80023..a4ec5b7 100644 --- a/src/components/Crud/Edit/index.vue +++ b/src/components/Crud/Edit/index.vue @@ -1,8 +1,5 @@ @@ -15,18 +12,13 @@ export default { type: Object, required: true }, + permission: { + type: Object, + required: true + }, disabledEdit: { type: Boolean, default: false - }, - flag: { - type: Boolean, - defalut: false - } - }, - methods: { - editFn() { - this.$emit('editFn', this.data) } } } diff --git a/src/components/Crud/crud.js b/src/components/Crud/crud.js index 4b8d2eb..0434f07 100644 --- a/src/components/Crud/crud.js +++ b/src/components/Crud/crud.js @@ -291,7 +291,7 @@ function CRUD(options) { if (!delAll) { dataStatus.delete = CRUD.STATUS.PROCESSING } - return crud.crudMethod.del(delAll ? { idArray: ids } : singleId).then(() => { + return crud.crudMethod.del(delAll ? { ids: ids } : singleId).then(() => { if (!delAll) { dataStatus.delete = CRUD.STATUS.PREPARED } diff --git a/src/components/drawerDialog/index.vue b/src/components/drawerDialog/index.vue index 6bc3664..b6a0964 100644 --- a/src/components/drawerDialog/index.vue +++ b/src/components/drawerDialog/index.vue @@ -57,8 +57,8 @@ placeholder="报告类型" style="width: 215px" clearable + @change="getDicCodeList" > - row.value === val) + if (!bglxs.length) { + return } + // 3. 获取对应报告类型字典数据 + const bglx = bglxs[0] + this.getDicDataByTypeCode(bglx.code, 'dicCode', bglx.id) }, getNeibuList(type, parentCode, species) { this.api({ @@ -1169,7 +1171,7 @@ export default { this.formTemplate.shebeipinzhongdaima ) this.neibuleibie = JSON.parse(this.formTemplate.neibuleibie) - this.getDicCodeList(this.formTemplate.bglx) + this.getBglxList().then(() => this.getDicCodeList(this.formTemplate.bglx, false)) this.getNeibuList( 'nblb', this.formTemplate.jianyanleibie, diff --git a/src/directive/permission/permission.js b/src/directive/permission/permission.js index 5fb6b18..ce696f7 100644 --- a/src/directive/permission/permission.js +++ b/src/directive/permission/permission.js @@ -4,7 +4,6 @@ export default { inserted(el, binding, vnode) { const { value } = binding const roles = store.getters && store.getters.permissions - console.log(roles) if (value && value instanceof Array && value.length > 0) { const permissionRoles = value const hasPermission = roles.some(role => { @@ -17,4 +16,4 @@ export default { throw new Error(`need roles! Like v-permission="['admin','editor']"`) } } -} +} diff --git a/src/main.js b/src/main.js index 8a1775c..f408818 100644 --- a/src/main.js +++ b/src/main.js @@ -31,6 +31,9 @@ import adaptive from './directive/el-table' import vueqr from 'vue-qr' import JSONView from 'vue-json-viewer' import { checkPermission } from './utils/permission' + +import Cookies from 'js-cookie' + Vue.use(JSONView) Vue.use(permission) @@ -49,7 +52,10 @@ Vue.use(CellGroup) Vue.use(Cell) Vue.use(Col) -Vue.use(ElementUI, { locale }) +Vue.use(ElementUI, { + locale, + size: Cookies.get('size') || 'small' // set element-ui default size +}) // 全局的常量 Vue.prototype.checkPermission = checkPermission diff --git a/src/styles/index.scss b/src/styles/index.scss index 748f8c8..70734c3 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -87,7 +87,45 @@ a:hover { } .app-container { - padding: 5px 20px; + padding: 20px 20px 5px 20px; +} + + +.components-container { + margin: 30px 50px; + position: relative; +} + +.filter-container { + padding-bottom: 10px; + + .filter-item { + display: inline-block; + vertical-align: middle; + margin-bottom: 10px; + } +} + +.head-container { + padding-bottom: 10px; + .filter-item { + display: inline-block; + vertical-align: middle; + margin: 0 3px 10px 0; + } + .el-button+.el-button { + margin-left: 0 !important; + } + .el-select__caret.el-input__icon.el-icon-arrow-up{ + line-height: 30.5px; + } + .date-item { + display: inline-block; + vertical-align: middle; + margin-bottom: 10px; + height: 30.5px; + width: 223px !important; + } } fieldset { diff --git a/src/utils/apibjd.js b/src/utils/apibjd.js index c12d0e5..e6ae09d 100644 --- a/src/utils/apibjd.js +++ b/src/utils/apibjd.js @@ -1,5 +1,5 @@ import axios from 'axios' -import { Message } from 'element-ui' +import { Notification } from 'element-ui' import store from '../store' import { showLoading, hideLoading } from './apiHelper' // 创建axios实例 @@ -36,7 +36,7 @@ service.interceptors.response.use( if (res.data.returnCode === 1) { return res.data.returnData } else if (res.data.returnCode === '20011') { - Message({ + Notification({ showClose: true, message: res.returnMsg, type: 'error', @@ -49,7 +49,7 @@ service.interceptors.response.use( }) return Promise.reject('未登录') } else { - Message({ + Notification({ message: res.data.returnMsg || '请求处理异常,请稍后再试', type: 'error', duration: 3 * 1000 @@ -64,7 +64,7 @@ service.interceptors.response.use( } if (res.returnCode === 1) { return res.returnData } else if (res.returnCode === '20011') { - Message({ + Notification({ showClose: true, message: res.returnMsg, type: 'error', @@ -88,7 +88,7 @@ service.interceptors.response.use( if (res.data && res.data.constructor === String) { msg = msg ? msg + ':' + res.data : res.data } - Message({ + Notification({ message: msg, type: 'error', duration: 3 * 1000 @@ -99,8 +99,8 @@ service.interceptors.response.use( error => { hideLoading() console.error('err' + error) // for debug - Message({ - message: error.response.data.msg, + Notification({ + message: error.response.data && error.response.data.message ? error.response.data.message : error.message, type: 'error', duration: 3 * 1000 }) diff --git a/src/views/borrow/borrow.vue b/src/views/borrow/borrow.vue index e61d50c..f43289b 100644 --- a/src/views/borrow/borrow.vue +++ b/src/views/borrow/borrow.vue @@ -52,13 +52,9 @@ > @@ -97,7 +93,6 @@ + + diff --git a/src/views/user/department.vue b/src/views/user/department.vue index 001abe7..38f4a6f 100644 --- a/src/views/user/department.vue +++ b/src/views/user/department.vue @@ -26,6 +26,8 @@ highlight-current-row @row-click="onRowClick" @selection-change="handleSelectionChange" + @select="rowSelect" + @select-all="selectAll" > @@ -117,8 +119,10 @@ export default { method: 'get', params: this.listQuery }).then(data => { + data.forEach(row => { + row.isChecked = false + }) this.list = data - this.totalCount = data.total }) }, showCreate() { @@ -227,6 +231,61 @@ export default { closeDialog() { this.unAllotUserList = [] this.departmentUserList = [] + }, + /** + * 注意在获取初始数据时,所有节点(包括子节点)都增加一个isChecked 标志参数 + * + * @param selection + * @param row + */ + rowSelect(selection, row) { + if (row.children) { // 只对有子节点的行响应 + if (!row.isChecked) { // 由行数据中的元素isChecked判断当前是否被选中 + row.children.map((item) => { // 遍历所有子节点 + this.$refs.list.toggleRowSelection(item, true) // 切换该子节点选中状态 + /* + 方法名 说明 参数 + 用于多选表格,切换某一行的选中状态, row, selected + toggleRowSelection 如果使用了第二个参数,则是设置这一行 + 选中与否(selected 为 true 则选中) + */ + item.isChecked = true + }) + row.isChecked = true // 当前行isChecked标志元素切换为false + } else { + row.children.map((item) => { + this.$refs.list.toggleRowSelection(item, false) + item.isChecked = false + }) + row.isChecked = false + } + // console.log(this.multipleSelection, row); + } + }, + selectAll(selection) { + // selection 是选中的数据集合 + this.$refs.list.data.map((items) => { // 使用$ref获取注册的子组件信息,用data获取所有行,并用map函数遍历行 + if (items.children) { + if (!items.isChecked) { // 若遍历出来的行未选中 + this.$refs.list.toggleRowSelection(items, true) // 行变为选中状态 + items.isChecked = true // 更新标志参数 + items.children.map((item) => { // 遍历子节点并改变状态与标志参数 + this.$refs.list.toggleRowSelection(item, true) + item.isChecked = true + }) + } else { // 选中状态同理 + this.$refs.list.toggleRowSelection(items, false) + items.isChecked = false + items.children.map((item) => { + this.$refs.list.toggleRowSelection(item, false) + item.isChecked = false + }) + } + } else { + items.isChecked = !items.isChecked + } + }) + // console.log(this.orgs) } } } diff --git a/src/views/user/role.vue b/src/views/user/role.vue index ca604e3..012e153 100644 --- a/src/views/user/role.vue +++ b/src/views/user/role.vue @@ -10,16 +10,21 @@ - + -