用户列表修改
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-08-26 13:13:09 +08:00
parent 9cdfb65a7b
commit 4fedec105f
15 changed files with 524 additions and 420 deletions

View File

@ -1,158 +1,68 @@
<!-- 搜索表单 -->
<template>
<div class="base-search-form">
<el-form :size="size" :inline="true" :label-width="labelWidth">
<el-form-item
v-for="item in searchForm"
:key="item.prop"
:label="item.label"
>
<el-form :inline="true" :label-width="labelWidth">
<el-form-item v-for="item in searchForm" :key="item.prop" :label="item.label">
<!-- 输入框 -->
<el-input
v-if="item.type === 'Input'"
v-model="searchData[item.prop]"
:placeholder="item.placeholder"
size="mini"
:style="{ width: item.width }"
:readonly="item.readonly"
clearable
/>
<el-input v-if="item.type === 'Input'" v-model="searchData[item.prop]" :placeholder="item.placeholder"
size="mini" clearable :style="{ width: item.width }" :readonly="item.readonly" />
<!-- 下拉框 -->
<el-select
v-if="item.type === 'Select'"
v-model="searchData[item.prop]"
:placeholder="item.placeholder"
size="mini"
clearable
:style="{ width: item.width }"
@change="item.change && item.change(that, searchData[item.prop])"
>
<el-option
v-for="op in item.options"
:key="op[item.props['label']]"
:label="op[item.props['label']]"
:value="op[item.props['value']]"
/>
<el-select v-if="item.type === 'Select'" v-model="searchData[item.prop]" :placeholder="item.placeholder"
size="mini" clearable :style="{ width: item.width }"
@change="item.change && item.change(that, searchData[item.prop])">
<el-option v-for="op in item.options" :key="op[item.props['label']]" :label="op[item.props['label']]"
:value="op[item.props['value']]" />
</el-select>
<el-select
v-if="item.type === 'Select2'"
v-model="searchData[item.prop]"
:placeholder="item.placeholder"
size="mini"
clearable
:style="{ width: item.width }"
@change="item.change && item.change(that, searchData[item.prop])"
>
<el-option
v-for="(key, value) of item.options"
:key="key"
:label="key"
:value="value"
/>
<el-select v-if="item.type === 'Select2'" v-model="searchData[item.prop]" :placeholder="item.placeholder"
size="mini" clearable :style="{ width: item.width }"
@change="item.change && item.change(that, searchData[item.prop])">
<el-option v-for="(key, value) of item.options" :key="key" :label="key" :value="value" />
</el-select>
<!-- 单选 -->
<el-radio-group
v-if="item.type === 'Radio'"
v-model="searchData[item.prop]"
:style="{ width: item.width }"
>
<el-radio
v-for="ra in item.radios"
:key="ra.value"
:label="ra.value"
>{{ ra.label }}</el-radio
>
<el-radio-group v-if="item.type === 'Radio'" v-model="searchData[item.prop]" :style="{ width: item.width }">
<el-radio v-for="ra in item.radios" :key="ra.value" :label="ra.value">{{ ra.label }}</el-radio>
</el-radio-group>
<!-- 单选按钮 -->
<el-radio-group
v-if="item.type === 'RadioButton'"
v-model="searchData[item.prop]"
:style="{ width: item.width }"
@change="item.change && item.change(searchData[item.prop])"
>
<el-radio-button
v-for="ra in item.radios"
:key="ra.value"
:label="ra.value"
>{{ ra.label }}</el-radio-button
>
<el-radio-group v-if="item.type === 'RadioButton'" v-model="searchData[item.prop]"
:style="{ width: item.width }" @change="item.change && item.change(searchData[item.prop])">
<el-radio-button v-for="ra in item.radios" :key="ra.value" :label="ra.value">{{ ra.label }}</el-radio-button>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group
v-if="item.type === 'Checkbox'"
v-model="searchData[item.prop]"
:style="{ width: item.width }"
>
<el-checkbox
v-for="ch in item.checkboxs"
:key="ch.value"
:label="ch.value"
>{{ ch.label }}</el-checkbox
>
<el-checkbox-group v-if="item.type === 'Checkbox'" v-model="searchData[item.prop]"
:style="{ width: item.width }">
<el-checkbox v-for="ch in item.checkboxs" :key="ch.value" :label="ch.value">{{ ch.label }}</el-checkbox>
</el-checkbox-group>
<!-- 日期 -->
<el-date-picker
v-if="item.type === 'Date'"
v-model="searchData[item.prop]"
:placeholder="item.placeholder"
:style="{ width: item.width }"
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
:picker-options="item.pickerOption"
clearable
/>
<el-date-picker v-if="item.type === 'Date'" v-model="searchData[item.prop]" :placeholder="item.placeholder"
:style="{ width: item.width }" value-format="yyyy-MM-dd" format="yyyy-MM-dd"
:picker-options="item.pickerOption" clearable />
<!-- 时间 -->
<el-time-select
v-if="item.type === 'Time'"
v-model="searchData[item.prop]"
:placeholder="item.placeholder"
type=""
:style="{ width: item.width }"
clearable
/>
<el-time-select v-if="item.type === 'Time'" v-model="searchData[item.prop]" :placeholder="item.placeholder"
type="" :style="{ width: item.width }" clearable />
<!-- 日期时间 -->
<el-date-picker
v-if="item.type === 'DateTime'"
v-model="searchData[item.prop]"
:placeholder="item.placeholder"
type="datetime"
:disabled="item.disable && item.disable(searchData[item.prop])"
:style="{ width: item.width }"
clearable
/>
<el-date-picker v-if="item.type === 'DateTime'" v-model="searchData[item.prop]" :placeholder="item.placeholder"
type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
:disabled="item.disable && item.disable(searchData[item.prop])" :style="{ width: item.width }" clearable />
<!-- 日期时间段 -->
<el-date-picker
v-if="item.type === 'Daterange'"
v-model="searchData[item.prop]"
type="datetimerange"
range-separator="-"
:start-placeholder="$t('trials:uploadClinicalData:table:beginDate')"
:end-placeholder="$t('trials:uploadClinicalData:table:endDate')"
:style="{ width: item.width }"
clearable
/>
<el-date-picker v-if="item.type === 'Daterange'" v-model="searchData[item.prop]" type="datetimerange"
:default-time="['00:00:00', '23:59:59']" :range-separator="$t('baseForm:daterange:rangeSeparator')"
:start-placeholder="$t('baseForm:daterange:startPlaceholder')"
:end-placeholder="$t('baseForm:daterange:startendPlaceholder')" value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss" :style="{ width: item.width }" clearable />
<!-- 滑块 -->
<!-- <el-slider v-if="item.type==='Slider'" v-model="searchData[item.prop]"></el-slider> -->
<!-- 开关 -->
<el-switch
v-if="item.type === 'Switch'"
v-model="searchData[item.prop]"
:style="{ width: item.width }"
/>
<el-switch v-if="item.type === 'Switch'" v-model="searchData[item.prop]" :style="{ width: item.width }" />
<!-- 具名slot -->
<slot v-if="item.type === 'Custom'" :name="item.slot" />
</el-form-item>
<el-form-item v-for="item in searchHandle" :key="item.label">
<slot v-if="item.slot" :name="item.slot" />
<el-button
v-else
:type="item.type"
:size="item.size || size"
:icon="item.icon || ''"
@click="handleClick(item.emitKey)"
>{{ item.label }}</el-button
>
</el-form-item>
<div style="display: inline-block;width: fit-content;">
<el-form-item v-for="item in searchHandle" :key="item.label">
<slot v-if="item.slot" :name="item.slot" />
<el-button v-else :type="item.type" :icon="item.icon || ''" @click="handleClick(item.emitKey)">{{ item.label
}}</el-button>
</el-form-item>
</div>
</el-form>
</div>
</template>
@ -170,11 +80,11 @@ export default {
},
labelWidth: {
type: String,
default: "",
default: '',
},
size: {
type: String,
default: "mini",
default: 'mini',
},
searchForm: {
type: Array,
@ -186,16 +96,16 @@ export default {
},
searchData: {
type: Object,
default: () => {},
default: () => { },
},
},
methods: {
handleClick(emitKey) {
// emit
this.$emit(`${emitKey}`);
this.$emit(`${emitKey}`)
},
},
};
}
</script>
<style lang="scss">
.base-search-form {

View File

@ -1,29 +1,31 @@
<template>
<el-row>
<el-col class="m-b-10" :span="24">
<el-table
v-adaptive="{bottomOffset}"
:data="list"
:height="tableHeight"
v-bind="$attrs"
stripe
:highlight-current-row="highlightCurrentRow"
@selection-change="handleSelectionChange"
@sort-change="sortByColumn"
@select="handleSelect"
@cell-dblclick="celldblclick"
>
<el-table v-adaptive="{ bottomOffset }" :data="list" height="100" v-bind="$attrs" stripe
:highlight-current-row="highlightCurrentRow" @selection-change="handleSelectionChange"
@sort-change="sortByColumn" @select="handleSelect" @cell-dblclick="celldblclick">
<template v-for="(column, index) in columns">
<slot name="front-slot" />
<el-table-column v-if="column.type === 'tip'" :key="index" width="35">
<template slot-scope="scope">
<span v-if="column.slot">
<!-- 具名slot -->
<slot v-if="column.slot" :name="column.slot" :scope="scope" />
</span>
</template>
</el-table-column>
<!-- 序号 -->
<el-table-column v-if="column.type === 'selection'" :key="index" type="selection" width="55" />
<el-table-column v-else-if="column.type === 'selection'" :key="index" type="selection" width="55" />
<!-- 复选框 -->
<el-table-column v-else-if="column.type === 'index'" :key="index" type="index" width="50" />
<!-- 具体内容 -->
<el-table-column v-else :key="index" align="left" :label="column.label" :width="column.width" :min-width="column.minWidth" :show-overflow-tooltip="column.showOverflowTooltip || false" :sortable="column.sortable || false" :prop="column.prop">
<el-table-column v-else :key="index" align="left" :label="column.label" :width="column.width"
:min-width="column.minWidth" :show-overflow-tooltip="column.showOverflowTooltip || false"
:sortable="column.sortable || false" :prop="column.prop" :fixed="column.fixed">
<template slot-scope="scope">
<!-- 仅仅显示文字 -->
<span v-if="!column.hidden"> <!-- hiddentrue slot-->
<span v-if="!column.hidden">
<!-- 如果hidden为true的时候 那么当前格可以不显示可以选择显示自定义的slot-->
<!-- 操作按钮 -->
<span v-if="column.type === 'operate'">
<!-- <a v-for="(operate, i) in column.operates" :key="i" href="javascript:void(0)" class="operate-button" @click="handleClick(operate, scope.row)">
@ -31,7 +33,11 @@
&nbsp;&nbsp;
</a> -->
<span v-for="(operate, i) in column.operates" :key="i">
<el-button :size="operate.size || 'mini'" :type="operate.type || 'primary'" style="margin-right:5px;" @click="handleClick(operate, scope.row)">{{ operate.name }}</el-button>
<el-button :type="operate.type || 'primary'" v-if="
(operate.show && scope.row[operate.show]) ||
!operate.show
" style="margin-right: 5px" @click="handleClick(operate, scope.row)">{{ operate.name
}}</el-button>
</span>
</span>
<span v-else>
@ -52,7 +58,8 @@
</el-col>
<!-- 分页部分 -->
<el-col v-if="!hiddenPage" :span="24" class="page">
<pagination :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize" @pagination="pagination" />
<pagination :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
@pagination="pagination" />
</el-col>
</el-row>
</template>
@ -96,45 +103,44 @@ export default {
//
list: {
type: Array,
default: () => []
default: () => [],
},
// columns
columns: {
type: Array,
required: true,
default: () => []
default: () => [],
},
// is hidden page for table
hiddenPage: {
type: Boolean,
default: false
default: false,
},
bottomOffset: {
type: Number,
default: 45
default: 45,
},
searchData: {
type: Object,
default: () => {}
default: () => { },
},
total: {
type: Number,
default: 0
default: 0,
},
highlightCurrentRow: {
type: Boolean,
default: false
}
default: false,
},
},
data() {
return {
}
return {}
},
computed: {
tableHeight() {
return 100
}
return '100'
},
},
methods: {
//
@ -157,12 +163,12 @@ export default {
},
pagination() {
this.$emit('getList')
}
}
},
},
}
</script>
<style lang="scss" scoped>
.page{
.page {
padding-top: 3px;
text-align: right;
}

View File

@ -9,16 +9,16 @@ const doResize = async (el, binding, vnode) => {
const { componentInstance: $table } = await vnode
// 获取调用传递过来的数据
const { value } = binding
if (value && value.notAdaptive) return;
// 获取距底部距离(用于展示页码等信息)
const bottomOffset = (value && value.bottomOffset) || 40
if (!$table) return
// 计算列表高度并设置
const height = window.innerHeight - el.getBoundingClientRect().top - bottomOffset
// $table.layout.setMaxHeight(height) bodyHeight
// $table.layout.setMaxHeight(height)
$table.layout.setHeight(height)
// $table.bodyWrapper.style.cssText = `height:${$table.layout.bodyHeight - 20}px`
// $table.maxHeight = height
let timer = setTimeout(() => { $table.doLayout(); timer = null; }, 500)
$table.doLayout()
}
export default {

View File

@ -10,7 +10,7 @@ const dialogDrag = Vue.directive('dialogDrag', {
dragDom.style.cssText += ';top:0px;'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const sty = (function() {
const sty = (function () {
if (window.document.currentStyle) {
return (dom, attr) => dom.currentStyle[attr]
} else {
@ -47,8 +47,10 @@ const dialogDrag = Vue.directive('dialogDrag', {
styL = +styL.replace(/\px/g, '')
styT = +styT.replace(/\px/g, '')
}
const oldMousemove = document.onmousemove
document.onmousemove = function(e) {
document.onmousemove = function (e) {
oldMousemove(e)
// 通过事件委托,计算移动的距离
let left = e.clientX - disX
const top = e.clientY - disY
@ -70,8 +72,8 @@ const dialogDrag = Vue.directive('dialogDrag', {
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
}
document.onmouseup = function(e) {
document.onmousemove = null
document.onmouseup = function (e) {
document.onmousemove = oldMousemove
document.onmouseup = null
}
}

View File

@ -47,3 +47,7 @@
.el-range-separator {
box-sizing: content-box;
}
.el-select-dropdown__wrap {
max-height: 350px;
}

View File

@ -9,7 +9,7 @@ body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
// font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
// font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
// "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
@ -52,6 +52,7 @@ a:hover {
div:focus {
outline: none;
}
body .el-table th.gutter {
display: table-cell !important;
}
@ -66,6 +67,13 @@ body .el-table th.gutter {
height: 0;
}
}
.text-ellipsis {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.el-loading-mask {
background-color: rgba(255, 255, 255, 0.5);
}
@ -80,6 +88,7 @@ body .el-table th.gutter {
.table-container {
height: calc(100% - 100px);
}
// .pagination-container{
// text-align: right;
// }
@ -92,10 +101,12 @@ body .el-table th.gutter {
border-left: 3px solid #0fc8e0;
font-size: 13px;
margin-bottom: 10px;
p {
margin: 0;
padding-left: 5px;
}
.add {
position: absolute;
right: 10px;
@ -104,9 +115,11 @@ body .el-table th.gutter {
margin-top: -15px;
}
}
.el-dialog__body {
padding: 0 10px;
}
.el-date-editor.el-input,
.el-date-editor.el-input__inner,
.el-select {
@ -114,167 +127,234 @@ body .el-table th.gutter {
}
}
}
.data-list {
display: flex;
flex-direction: column;
flex: 1;
.toolbar {
display: flex;
}
.data-table {
flex: 1;
padding: 5px 0px;
}
.pagination {
height: 32px;
text-align: right;
}
}
.is-fullscreen{
.el-dialog__headerbtn{
top:10px;
.is-fullscreen {
.el-dialog__headerbtn {
top: 10px;
font-size: 30px;
}
.el-dialog__body{
.el-dialog__body {
margin-top: 15px;
height: calc(100% - 70px);
padding: 0 20px;
.base-modal-body{
.base-modal-body {
padding: 10px 20px;
height: 100%;
overflow-y: auto;
}
}
.el-dialog__footer{
.el-dialog__footer {
padding: 10px;
}
.link-breadcrumb{
.link-breadcrumb {
cursor: pointer;
color: #428bca;
}
}
.base-dialog-wrapper{
.el-dialog__header{
.base-dialog-wrapper {
.el-dialog__header {
padding: 15px;
}
.base-dialog-body{
.base-dialog-body {
border: 1px solid #e0e0e0;
padding:10px;
max-height:600px;
padding: 10px;
max-height: 600px;
overflow-y: auto;
}
.base-dialog-footer{
text-align:right;
margin-top:10px;
.base-dialog-footer {
text-align: right;
margin-top: 10px;
}
.el-dialog__body{
padding:10px;
.el-dialog__body {
padding: 10px;
}
.el-dialog__footer{
padding: 10px;
.el-dialog__footer {
padding: 10px;
}
}
.el-descriptions{
box-sizing:border-box;
font-size:14px;
color:#303133
.el-descriptions {
box-sizing: border-box;
font-size: 14px;
color: #303133
}
.el-descriptions__header{
display:flex;
justify-content:space-between;
align-items:center;
margin-bottom:20px
.el-descriptions__header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px
}
.el-descriptions__title{
font-size:16px;
font-weight:700
.el-descriptions__title {
font-size: 16px;
font-weight: 700
}
.el-descriptions__body{
color:#606266;
background-color:#fff
.el-descriptions__body {
color: #606266;
background-color: #fff
}
.el-descriptions__body .el-descriptions__table{
border-collapse:collapse;
width:100%;
table-layout:fixed
.el-descriptions__body .el-descriptions__table {
border-collapse: collapse;
width: 100%;
table-layout: fixed
}
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell{
box-sizing:border-box;
text-align:left;
font-weight:400;
line-height:1.5
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
box-sizing: border-box;
text-align: left;
font-weight: 400;
line-height: 1.5
}
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-left{
text-align:left
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-left {
text-align: left
}
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-center{
text-align:center
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-center {
text-align: center
}
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-right{
text-align:right
.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-right {
text-align: right
}
.el-descriptions .is-bordered{
table-layout:auto
.el-descriptions .is-bordered {
table-layout: auto
}
.el-descriptions .is-bordered .el-descriptions-item__cell{
border:1px solid #ebeef5;
padding:12px 10px
.el-descriptions .is-bordered .el-descriptions-item__cell {
border: 1px solid #ebeef5;
padding: 12px 10px
}
.el-descriptions :not(.is-bordered) .el-descriptions-item__cell{
padding-bottom:12px
.el-descriptions :not(.is-bordered) .el-descriptions-item__cell {
padding-bottom: 12px
}
.el-descriptions--medium.is-bordered .el-descriptions-item__cell{
padding:10px
.el-descriptions--medium.is-bordered .el-descriptions-item__cell {
padding: 10px
}
.el-descriptions--medium:not(.is-bordered) .el-descriptions-item__cell{
padding-bottom:10px
.el-descriptions--medium:not(.is-bordered) .el-descriptions-item__cell {
padding-bottom: 10px
}
.el-descriptions--small{
font-size:12px
.el-descriptions--small {
font-size: 12px
}
.el-descriptions--small.is-bordered .el-descriptions-item__cell{
padding:8px 10px
.el-descriptions--small.is-bordered .el-descriptions-item__cell {
padding: 8px 10px
}
.el-descriptions--small:not(.is-bordered) .el-descriptions-item__cell{
padding-bottom:8px
.el-descriptions--small:not(.is-bordered) .el-descriptions-item__cell {
padding-bottom: 8px
}
.el-descriptions--mini{
font-size:12px
.el-descriptions--mini {
font-size: 12px
}
.el-descriptions--mini.is-bordered .el-descriptions-item__cell{
padding:6px 10px
.el-descriptions--mini.is-bordered .el-descriptions-item__cell {
padding: 6px 10px
}
.el-descriptions--mini:not(.is-bordered) .el-descriptions-item__cell{
padding-bottom:6px
.el-descriptions--mini:not(.is-bordered) .el-descriptions-item__cell {
padding-bottom: 6px
}
.el-descriptions-item{
vertical-align:top
.el-descriptions-item {
vertical-align: top
}
.el-descriptions-item__container{
display:flex
.el-descriptions-item__container {
display: flex
}
.el-descriptions-item__container .el-descriptions-item__content,.el-descriptions-item__container .el-descriptions-item__label{
display:inline-flex;
align-items:baseline
.el-descriptions-item__container .el-descriptions-item__content,
.el-descriptions-item__container .el-descriptions-item__label {
display: inline-flex;
align-items: baseline
}
.el-descriptions-item__container .el-descriptions-item__content{
flex:1
.el-descriptions-item__container .el-descriptions-item__content {
flex: 1
}
.el-descriptions-item__label.has-colon:after{
content:":";
position:relative;
top:-.5px
.el-descriptions-item__label.has-colon:after {
content: ":";
position: relative;
top: -.5px
}
.el-descriptions-item__label.is-bordered-label{
font-weight:700;
color:#909399;
background:#fafafa
.el-descriptions-item__label.is-bordered-label {
font-weight: 700;
color: #909399;
background: #fafafa
}
.el-descriptions-item__label:not(.is-bordered-label){
margin-right:10px
.el-descriptions-item__label:not(.is-bordered-label) {
margin-right: 10px
}
.el-descriptions-item__content{
word-break:break-word;
overflow-wrap:break-word
.el-descriptions-item__content {
word-break: break-word;
overflow-wrap: break-word
}
.feedBack-box {
.el-dialog__wrapper {
z-index: 3999 !important;
}
}
.feedBack-select-box {
z-index: 4000 !important;
}
.feedBack-box-modal {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: .5;
background: #000;
z-index: 3999;
}
.el-message-box__wrapper {
z-index: 9999 !important;
}

View File

@ -1,13 +1,14 @@
$menuText:#909399;
$menuActiveText:#606266;
$subMenuActiveText:#5a5c5f;
$menuText: #909399;
$menuActiveText: #606266;
$subMenuActiveText: #5a5c5f;
$menuBg:#ebebeb;
$menuHover:#dfdede;
$menuBg: #ebebeb;
$menuHover: #dfdede;
$subMenuBg:#e4e4e4;
$subMenuHover:#dfdede;
$subMenuBg: #e4e4e4;
$subMenuHover: #dfdede;
$sideBarWidth: 200px;
#app {
.main-container {
@ -71,13 +72,17 @@ $sideBarWidth: 200px;
border: none;
height: 100%;
width: 100% !important;
background-color: $menuBg;
}
// menu hover
.submenu-title-noDropdown,
.el-submenu__title {
color: $menuText !important;
&:hover {
background-color: $menuHover !important;
color: $menuActiveText !important;
}
}
@ -85,15 +90,36 @@ $sideBarWidth: 200px;
color: $subMenuActiveText !important;
}
& .nest-menu .el-submenu>.el-submenu__title,
& .el-submenu .el-menu-item {
.el-menu-item {
color: $menuText !important;
}
.el-menu-item:focus,
.el-menu-item:hover {
background-color: $subMenuBg !important;
color: $menuActiveText !important;
}
.el-submenu .el-menu-item {
min-width: $sideBarWidth !important;
background-color: $subMenuBg !important;
&:hover {
background-color: $subMenuHover !important;
}
}
// &.nest-menu .el-submenu>.el-submenu__title,
// &.el-submenu .el-menu-item {
// min-width: $sideBarWidth !important;
// background-color: $subMenuBg !important;
// &:hover {
// background-color: $subMenuHover !important;
// }
// }
}
.hideSidebar {

View File

@ -1,13 +1,13 @@
// sidebar
$menuText:#909399;
$menuActiveText:#606266;
$subMenuActiveText:#5a5c5f;
$menuText: #909399;
$menuActiveText: #606266;
$subMenuActiveText: #5a5c5f;
$menuBg:#ebebeb;
$menuHover:#dfdede;
$menuBg: #ebebeb;
$menuHover: #dfdede;
$subMenuBg:#e4e4e4;
$subMenuHover:#dfdede;
$subMenuBg: #e4e4e4;
$subMenuHover: #dfdede;
// sidebar 绿
// $menuText:rgb(206, 203, 203);

View File

@ -8,7 +8,7 @@ Vue.directive('dialogDrag', {
dragDom.style.cssText += ';top:0px;'
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
const sty = (function() {
const sty = (function () {
if (window.document.currentStyle) {
return (dom, attr) => dom.currentStyle[attr]
} else {
@ -40,8 +40,9 @@ Vue.directive('dialogDrag', {
styL = +styL.replace(/\px/g, '')
styT = +styT.replace(/\px/g, '')
}
document.onmousemove = function(e) {
const oldMousemove = document.onmousemove
document.onmousemove = function (e) {
oldMousemove(e)
// 通过事件委托,计算移动的距离
let left = e.clientX - disX
let top = e.clientY - disY
@ -62,8 +63,8 @@ Vue.directive('dialogDrag', {
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;`
}
document.onmouseup = function(e) {
document.onmousemove = null
document.onmouseup = function (e) {
document.onmousemove = oldMousemove
document.onmouseup = null
}
return false

View File

@ -3,6 +3,7 @@ async function queryWindowManagement() {
}
async function getPermission() {
const permission = await queryWindowManagement();
console.log(permission.state, 'permission.state')
if (permission.state === "granted") { // 已经授权
return true
} else if (permission.state === "prompt") { // 询问是否授权

View File

@ -7,8 +7,19 @@
<base-table v-loading="loading" :columns="columns" :list="users" :search-data="searchData" :total="total"
@getList="getList" @editCb="handleEditUser" @deleteCb="handleDeleteUser" @sortByColumn="sortByColumn">
<!-- 选择自定义slot -->
<template slot="tip-slot" slot-scope="{ scope }">
<i v-if="
diffTime(scope.row.LastLoginTime) >= 90 &&
diffTime(scope.row.LastChangePassWordTime) >= 90
" class="el-icon-warning" style="color: #f56c6c"
:title="$t('system:userlist:tip:overTimeAndoverTimePassWord')" />
<i v-else-if="diffTime(scope.row.LastLoginTime) >= 90" class="el-icon-warning" style="color: #f56c6c"
:title="$t('system:userlist:tip:overTime')" />
<i v-else-if="diffTime(scope.row.LastChangePassWordTime) >= 90" class="el-icon-warning" style="color: #f56c6c"
:title="$t('system:userlist:tip:overTimePassWord')" />
</template>
<template slot="genderSlot" slot-scope="{ scope }">
{{ scope.row.Sex ? "Male" : "Female" }}
{{ scope.row.Sex ? 'Male' : 'Female' }}
</template>
<template slot="UserTypeSlot" slot-scope="{ scope }">
{{
@ -21,27 +32,27 @@
}}
</template>
<template slot="roleSlot" slot-scope="{ scope }">
{{scope.row.RoleNameList.map((role) => role.RoleName).join(",")}}
{{scope.row.RoleNameList.map((role) => role.RoleName).join(', ')}}
</template>
<template slot="isZhiZhunSlot" slot-scope="{ scope }">
{{
scope.row.IsZhiZhun
? $t("system:userlist:table:InternalOrExternal:Internal")
: $t("system:userlist:table:InternalOrExternal:External")
? $t('system:userlist:table:InternalOrExternal:Internal')
: $t('system:userlist:table:InternalOrExternal:External')
}}
</template>
<template slot="isTestUserSlot" slot-scope="{ scope }">
{{
scope.row.IsTestUser
? $t("system:userlist:table:IsTestUser:Yes")
: $t("system:userlist:table:IsTestUser:No")
? $t('system:userlist:table:IsTestUser:Yes')
: $t('system:userlist:table:IsTestUser:No')
}}
</template>
<template slot="statusSlot" slot-scope="{ scope }">
{{
scope.row.Status
? $t("system:userlist:table:Status:Enable")
: $t("system:userlist:table:Status:Disable")
? $t('system:userlist:table:Status:Enable')
: $t('system:userlist:table:Status:Disable')
}}
</template>
</base-table>
@ -54,7 +65,7 @@ import BoxContent from "@/components/BoxContent";
import SearchForm from "@/components/BaseForm/search-form";
import BaseTable from "@/components/BaseTable";
import tableMixins from "@/mixins/table";
import moment from 'moment'
//
//
const searchDataDefault = () => {
@ -83,215 +94,275 @@ export default {
return {
searchData: searchDataDefault(),
columns: [
{ type: "index" },
{ type: 'tip', slot: 'tip-slot' },
{ type: 'index' },
{
prop: "UserCode",
label: this.$t("system:userlist:table:S/N"),
prop: 'UserCode',
label: this.$t('system:userlist:table:S/N'),
width: 100,
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: "UserName",
label: this.$t("system:userlist:table:UserName"),
prop: 'UserName',
label: this.$t('system:userlist:table:UserName'),
minWidth: 100,
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: "RealName",
label: this.$t("system:userlist:table:RealName"),
prop: 'FullName',
label: this.$t('system:userlist:table:RealName'),
minWidth: 120,
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
// {
// prop: 'Sex',
// label: this.$t('system:userlist:table:Gender'),
// hidden: true,
// slot: 'genderSlot',
// minWidth: 100,
// sortable: 'custom',
// showOverflowTooltip: true
// },
{
prop: "Sex",
label: this.$t("system:userlist:table:Gender"),
hidden: true,
slot: "genderSlot",
minWidth: 100,
sortable: "custom",
showOverflowTooltip: true,
},
{
prop: "Phone",
label: this.$t("system:userlist:table:Phone"),
prop: 'Phone',
label: this.$t('system:userlist:table:Phone'),
minWidth: 120,
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: "EMail",
label: this.$t("system:userlist:table:Email"),
prop: 'EMail',
label: this.$t('system:userlist:table:Email'),
minWidth: 150,
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: "OrganizationName",
label: this.$t("system:userlist:table:Organization"),
prop: 'OrganizationName',
label: this.$t('system:userlist:table:Organization'),
minWidth: 130,
showOverflowTooltip: true,
},
{
prop: "UserType",
label: this.$t("system:userlist:table:UserType"),
prop: 'UserType',
label: this.$t('system:userlist:table:UserType'),
minWidth: 100,
slot: 'UserTypeSlot',
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: "IsZhiZhun",
label: this.$t("system:userlist:table:InternalOrExternal"),
prop: 'IsZhiZhun',
label: this.$t('system:userlist:table:InternalOrExternal'),
hidden: true,
slot: "isZhiZhunSlot",
slot: 'isZhiZhunSlot',
minWidth: 140,
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: "Status",
label: this.$t("system:userlist:table:Status"),
prop: 'IsTestUser',
label: this.$t('system:userlist:table:IsTestUser'),
hidden: true,
slot: "statusSlot",
minWidth: 100,
sortable: "custom",
slot: 'isTestUserSlot',
minWidth: 120,
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: "CreateTime",
label: this.$t("system:userlist:table:createTime"),
prop: 'Status',
label: this.$t('system:userlist:table:Status'),
hidden: true,
slot: 'statusSlot',
minWidth: 100,
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: 'LastLoginTime',
label: this.$t('system:userlist:table:LastLoginTime'),
minWidth: 200,
sortable: "custom",
sortable: 'custom',
showOverflowTooltip: true,
},
{
type: "operate",
label: this.$t("common:action:action"),
prop: 'LastChangePassWordTime',
label: this.$t('system:userlist:table:LastChangePassWordTime'),
minWidth: 250,
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: 'CreateTime',
label: this.$t('system:userlist:table:createTime'),
minWidth: 200,
sortable: 'custom',
showOverflowTooltip: true,
},
{
type: 'operate',
label: this.$t('common:action:action'),
minWidth: 100,
fixed: 'right',
operates: [
{
name: this.$t("common:button:edit"),
type: "primary",
emitKey: "editCb",
name: this.$t('common:button:edit'),
type: 'text',
emitKey: 'editCb',
},
// {
// name: this.$t("common:button:delete"),
// type: "danger",
// emitKey: "deleteCb",
// name: this.$t('common:button:delete'),
// type: 'danger',
// emitKey: 'deleteCb',
// },
],
},
],
searchForm: [
{
type: "Input",
label: this.$t("system:userlist:label:UserName"),
prop: "UserName",
width: "120px",
placeholder: "",
type: 'Input',
label: this.$t('system:userlist:label:UserName'),
prop: 'UserName',
width: '120px',
placeholder: '',
},
{
type: "Input",
label: this.$t("system:userlist:label:RealName"),
prop: "RealName",
width: "120px",
placeholder: "",
type: 'Input',
label: this.$t('system:userlist:label:RealName'),
prop: 'RealName',
width: '120px',
placeholder: '',
},
{
type: "Input",
label: this.$t("system:userlist:label:Phone"),
prop: "Phone",
width: "120px",
placeholder: "",
type: 'Input',
label: this.$t('system:userlist:label:Phone'),
prop: 'Phone',
width: '120px',
placeholder: '',
},
{
type: "Input",
label: this.$t("system:userlist:label:EMail"),
prop: "EMail",
width: "120px",
placeholder: "",
type: 'Input',
label: this.$t('system:userlist:label:EMail'),
prop: 'EMail',
width: '120px',
placeholder: '',
},
{
type: "Input",
label: this.$t("system:userlist:label:Organization"),
prop: "OrganizationName",
width: "120px",
placeholder: "",
type: 'Input',
label: this.$t('system:userlist:label:Organization'),
prop: 'OrganizationName',
width: '120px',
placeholder: '',
},
{
type: "Select",
label: this.$t("system:userlist:label:InternalOrExternal"),
prop: "IsZhiZhun",
width: "150px",
type: 'Select',
label: this.$t('system:userlist:label:InternalOrExternal'),
prop: 'IsZhiZhun',
width: '100px',
options: [
{
label: this.$t(
"system:userlist:label:InternalOrExternal:Internal"
'system:userlist:label:InternalOrExternal:Internal'
),
value: true,
},
{
label: this.$t(
"system:userlist:label:InternalOrExternal:External"
'system:userlist:label:InternalOrExternal:External'
),
value: false,
},
],
props: { label: "label", value: "value" },
change: (scope) => "",
placeholder: "",
props: { label: 'label', value: 'value' },
change: (scope) => '',
placeholder: '',
},
{
type: "Select",
label: this.$t("system:userlist:label:Status"),
prop: "UserState",
width: "150px",
type: 'Select',
label: this.$t('system:userlist:label:IsTestUser'),
prop: 'IsTestUser',
width: '100px',
options: [
{ label: this.$t("system:userlist:label:Status:Enable"), value: 1 },
{
label: this.$t("system:userlist:label:Status:Disable"),
label: this.$t('system:userlist:label:IsTestUser:Yes'),
value: true,
},
{
label: this.$t('system:userlist:label:IsTestUser:No'),
value: false,
},
],
props: { label: 'label', value: 'value' },
change: (scope) => '',
placeholder: '',
},
{
type: 'Select',
label: this.$t('system:userlist:label:Status'),
prop: 'UserState',
width: '100px',
options: [
{ label: this.$t('system:userlist:label:Status:Enable'), value: 1 },
{
label: this.$t('system:userlist:label:Status:Disable'),
value: 0,
},
],
props: { label: "label", value: "value" },
change: (scope) => "",
placeholder: "",
props: { label: 'label', value: 'value' },
change: (scope) => '',
placeholder: '',
},
{
type: "Select",
label: this.$t("system:userlist:label:UserType"),
prop: "UserType",
width: "150px",
type: 'Select',
label: this.$t('system:userlist:label:UserType'),
prop: 'UserType',
width: '100px',
options: [], //
props: { label: "UserType", value: "Id" }, //
placeholder: "",
props: { label: 'UserType', value: 'Id' }, //
placeholder: '',
},
{
type: "Daterange",
label: this.$t("system:userlist:label:CreateTime"),
prop: "CreateTimeArr",
width: "400px",
placeholder: "",
type: 'Daterange',
label: this.$t('system:userlist:label:LastLoginTime'),
prop: 'LastLoginTimeArr',
width: '400px',
placeholder: '',
},
{
type: 'Daterange',
label: this.$t('system:userlist:label:LastChangePassWordTime'),
prop: 'LastChangePassWordTimeArr',
width: '400px',
placeholder: '',
},
{
type: 'Daterange',
label: this.$t('system:userlist:label:CreateTime'),
prop: 'CreateTimeArr',
width: '400px',
placeholder: '',
},
],
searchHandle: [
{
label: this.$t("common:button:reset"),
type: "primary",
emitKey: "reset",
label: this.$t('common:button:search'),
type: 'primary',
emitKey: 'search',
icon: 'el-icon-search',
},
{
label: this.$t("common:button:search"),
type: "primary",
emitKey: "search",
label: this.$t('common:button:reset'),
type: 'primary',
emitKey: 'reset',
icon: 'el-icon-refresh-left',
},
{
label: this.$t("common:button:new"),
type: "primary",
emitKey: "new",
label: this.$t('common:button:new'),
type: 'primary',
emitKey: 'new',
},
],
userTypeOptions: [],
@ -305,6 +376,9 @@ export default {
this.getInfo();
},
methods: {
diffTime(time) {
return moment(new Date()).diff(time, 'days')
},
//
getList() {
this.loading = true;

View File

@ -271,7 +271,7 @@ export default {
this.form.UserTypeEnum = selectedUserType[0].UserTypeEnum;
}
this.form.TrialId = this.$route.query.trialId
console.log(this.form, 'this.form')
// console.log(this.form, 'this.form')
addUser(this.form, true)
.then((res) => {
this.btnLoading = false;

View File

@ -51,7 +51,7 @@
<el-table-column type="selection" width="50" :selectable="handleSelectable" />
<el-table-column type="index" width="50" />
<!-- 姓名 -->
<el-table-column prop="UserRealName" :label="$t('trials:staff:table:name')" show-overflow-tooltip
<el-table-column prop="FullName" :label="$t('trials:staff:table:name')" show-overflow-tooltip
sortable="custom" min-width="100" />
<!-- 用户名 -->
<el-table-column prop="UserName" :label="$t('trials:staff:table:uid')" show-overflow-tooltip sortable="custom"