Commit 2f127339 authored by 何虹's avatar 何虹 💬

升级控件

parent dbc2e6d7
......@@ -16,89 +16,94 @@
>
<el-table-column v-if='false' type="selection" width="55" fixed="left"></el-table-column>
<el-table-column type="index" fixed="left" label="索引" ></el-table-column>
<el-table-column prop="label" label="标题" fixed="left">
<el-table-column prop="label" label="标题" fixed="left">
<template slot-scope="scope">
<el-input clearable v-model="scope.row.label" size='mini'></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.label" size='mini'></el-input>
</template>
</el-table-column>
<el-table-column prop='lineNumber' label='行号' width='80' v-if="controlType!='queryArea'">
<el-table-column prop="prop" label="字段" width="150" fixed="left">
<template slot-scope="scope">
<el-input disabled clearable v-model="scope.row.prop" size='mini'></el-input>
</template>
</el-table-column>
<el-table-column v-if="isEditZone" prop='lineNumber' label='行号' min-width='80'>
<template slot-scope="scope">
<el-input clearable v-model="scope.row.lineNumber" size='mini'></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.lineNumber" size='mini'></el-input>
</template>
</el-table-column>
<el-table-column prop='lineSerialNumber' label='列号' width='80' v-if='controlType!=="queryArea"'>
<el-table-column v-if="isEditZone" prop='lineSerialNumber' label='列号' min-width='80'>
<template slot-scope="scope">
<el-input clearable v-model="scope.row.lineSerialNumber" size='mini'></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.lineSerialNumber" size='mini'></el-input>
</template>
</el-table-column>
<el-table-column prop="columnWidth" label="列宽" width='120' v-if='controlType!=="queryArea"'>
<el-table-column v-if='isEditZone' prop="columnWidth" label="列宽" min-width='120'>
<template slot-scope="scope">
<el-input clearable v-model="scope.row.columnWidth" size='mini'></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.columnWidth" size='mini'></el-input>
</template>
</el-table-column>
<el-table-column prop="labelWidth" label="label宽" width='120'>
<el-table-column prop="labelWidth" label="label宽" min-width='120'>
<template slot-scope="scope">
<el-input clearable v-model="scope.row.labelWidth" size='mini' placeholder="120"></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.labelWidth" size='mini' placeholder="120"></el-input>
</template>
</el-table-column>
<el-table-column prop="width" label="控件宽" width='120'>
<el-table-column prop="width" label="控件宽" min-width='120'>
<template slot-scope="scope">
<el-input clearable v-model="scope.row.width" size='mini' placeholder="173"></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.width" size='mini' placeholder="173"></el-input>
</template>
</el-table-column>
<el-table-column prop="rowspan" label="跨行" v-if='controlType!=="queryArea"' width='80'>
<template slot-scope="scope">
<el-input clearable v-model="scope.row.rowspan" size='mini'></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.rowspan" size='mini'></el-input>
</template>
</el-table-column>
<el-table-column prop="colspan" label="跨列" v-if='controlType!=="queryArea"' width='80'>
<el-table-column v-if='isEditZone' prop="colspan" label="跨列" min-width='80'>
<template slot-scope="scope">
<el-input clearable v-model="scope.row.colspan" size='mini'></el-input>
<el-input :disabled='isUserSet' clearable v-model="scope.row.colspan" size='mini'></el-input>
</template>
</el-table-column>
<el-table-column prop='isHide' label='隐藏控件' width='100'>
<el-table-column prop='isHide' label='隐藏控件' min-width='100'>
<template slot-scope="scope">
<el-switch
v-if='isBoolean(scope.row.isHide)'
:disabled='isDisabled(scope.row,"isHide")'
:disabled='isDisabled(scope.row,"isHide")||isUserEdit'
v-model="scope.row.isHide"
/>
<span v-else-if="isAction(scope.row.isHide)">{{'action:'+scope.row.isHide}}</span>
</template>
</el-table-column>
<el-table-column prop='isHide' label='隐藏label' width='100'>
<el-table-column prop='isHide' label='隐藏label' min-width='100'>
<template slot-scope="scope">
<el-switch v-model="scope.row.isHideLabel">
<el-switch :disabled='isUserEdit' v-model="scope.row.isHideLabel">
</el-switch>
</template>
</el-table-column>
<el-table-column prop='isRequired' label='必填' width='70'>
<el-table-column prop='isRequired' label='必填' min-width='70'>
<template slot-scope="scope">
<el-switch
v-if='isBoolean(scope.row.isRequired)'
:disabled='isDisabled(scope.row,"isRequired")'
:disabled='isDisabled(scope.row,"isRequired")||isUserSet'
v-model="scope.row.isRequired"
/>
<span v-else-if="isAction(scope.row.isRequired)">{{'action:'+scope.row.isRequired}}</span>
</template>
</el-table-column>
<el-table-column v-if='false' prop='isDisabled' label='只读' width='70'>
<el-table-column v-if='false' prop='isDisabled' label='只读' min-width='70'>
<template slot-scope="scope">
<el-switch
v-if='isBoolean(scope.row.isDisabled)'
:disabled='isDisabled(scope.row,"isDisabled")'
:disabled='isDisabled(scope.row,"isDisabled")||isUserSet'
v-model="scope.row.isDisabled"
/>
<span v-else-if="isAction(scope.row.isDisabled)">{{'action:'+scope.row.isDisabled}}</span>
</template>
</el-table-column>
<el-table-column prop='isMoreSearch' label='更多搜索' width='100' v-if='controlType=="queryArea"'>
<el-table-column v-if='isQueryZone' prop='isMoreSearch' label='更多搜索' min-width='100'>
<template slot-scope="scope">
<el-switch v-model="scope.row.isMoreSearch">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width='120' fixed="right">
<el-table-column v-if='isQueryZone' label="操作" min-width='120' fixed="right">
<template slot-scope="scope">
<el-button class="handleBut" size='mini' @click="upGoAsync(scope.$index)">上移</el-button>
<el-button class="handleBut" size='mini' @click="downGoAsync(scope.$index)">下移</el-button>
......@@ -150,6 +155,29 @@ export default {
return list
}
},
// 用户配置编辑区域禁用
isUserEdit() {
return this.isEditZone && this.isUserSet
},
// 查询+可用
isQueryAdminZoneUsable: function() {
return this.controlType === 'queryArea'
},
isQueryZone: function() {
return this.controlType === 'queryArea'
},
isEditZone: function() {
return this.controlType !== 'queryArea'
},
isAdminEditZone: function() {
return this.isAdminSet && this.controlType !== 'queryArea'
},
isUserSet: function() {
return this.configRole !== '0'
},
isAdminSet: function() {
return this.configRole === '0'
},
configType: function() {
return this.configRole === '0' ? '0' : '1'
},
......
// 折线图和柱状图原始配置和数据
const initLineBar = {
const hsLineBar = {
config: {
isTransverse: false,
'title': {
......@@ -30,11 +30,11 @@ const initLineBar = {
}
},
'data': [
'DKN1',
'DKN2',
'DKN3',
'DKN4',
'DKN5'
'五车间',
'六车间',
'七车间',
'八车间',
'九车间'
]
},
'yAxis': [
......@@ -125,7 +125,7 @@ const initLineBar = {
},
{
'name': '完成数',
'type': 'bar',
type: 'line',
'yAxisIndex': 0,
'barWidth': '12',
'data': [],
......@@ -166,51 +166,6 @@ const initLineBar = {
'fontSize': 12
},
'xData': []
},
{
'name': 'G04',
'type': 'bar',
'yAxisIndex': 0,
'barWidth': '12',
'stack': '这个值相同的话 就会叠加',
'data': [],
'itemStyle': {
'color': {
'x': 0,
'y': 0,
'x2': 0,
'y2': 1,
'type': 'linear',
'global': false,
'colorStops': [
{
'offset': 0,
'color': '#436EEE'
},
{
'offset': 1,
'color': '#8B2252'
}
]
},
'barBorderRadius': [
10,
10,
0,
0
],
'hsColor': [
'#4fcee4',
'#ab5ee2'
]
},
'label': {
'show': true,
'position': 'top',
'color': '#8888b0',
'fontSize': 12
},
'xData': []
}
]
},
......@@ -2506,7 +2461,7 @@ const hsButton = {
}
}
const mockData = {
hsLineBar: initLineBar,
hsLineBar: hsLineBar,
hsPie: initPie,
hsRadar: initRadar,
hsSelectPlus: hsSelectPlus,
......
......@@ -47,12 +47,28 @@
>
<template slot-scope="scope">
<el-input
:disabled='isUserSet'
size='mini'
v-model="scope.row.label"
clearable
> </el-input>
</template>
</el-table-column>
<el-table-column
prop="prop"
label="字段"
width="150"
fixed="left"
>
<template slot-scope="scope">
<el-input
disabled
clearable
v-model="scope.row.prop"
size='mini'
></el-input>
</template>
</el-table-column>
<el-table-column
prop='topTitle'
label='一级标题'
......@@ -61,6 +77,7 @@
>
<template slot-scope="scope">
<el-input
:disabled='isUserSet'
size='mini'
v-model="scope.row.topTitle"
clearable
......@@ -91,7 +108,7 @@
/>
</template>
</el-table-column>
<el-table-column
<el-table-column
prop='summarizing'
label='是否汇总'
>
......@@ -115,7 +132,7 @@
</el-table-column>
<el-table-column
v-if='false'
v-if='false'
prop='isDisabled'
label='只读'
width='70'
......@@ -137,7 +154,7 @@
<template slot-scope="scope">
<el-switch
v-if='isBoolean(scope.row.isRequired)'
:disabled='isDisabled(scope.row,"isRequired")'
:disabled='isDisabled(scope.row,"isRequired")||isUserSet'
v-model="scope.row.isRequired"
/>
<span v-else-if="isAction(scope.row.isRequired)">{{'action:'+scope.row.isRequired}}</span>
......@@ -217,6 +234,12 @@ export default {
return list
}
},
isUserSet: function() {
return this.configRole !== '0'
},
isAdminSet: function() {
return this.configRole === '0'
},
// 0 系统配置 1 用户配置
configType: function() {
return this.configRole === '0' ? '0' : '1'
......@@ -227,9 +250,7 @@ export default {
return this.configRole === '0' ? '0' : userInfo.user_id
},
getDialogTitle: function() {
return this.configRole === '0'
? '表格设置(系统)'
: '表格设置(用户)'
return this.configRole === '0' ? '表格设置(系统)' : '表格设置(用户)'
}
},
data() {
......@@ -352,7 +373,7 @@ export default {
}
},
methods: {
isBooleanDisabled() {
isBooleanDisabled(row, prop) {
const isBoolean = this.isBoolean(row[prop])
const isDisabeld = this.isDisabled(row, prop)
return isBoolean && isDisabeld
......
......@@ -67,7 +67,6 @@
</el-dialog>
</template>
<script>
import elementUiMinins from '../../ucClass/elementUiMinins'
import left from './left'
import 'codemirror/theme/ambiance.css'
import 'codemirror/lib/codemirror.css'
......@@ -80,7 +79,6 @@ require('codemirror/addon/edit/matchbrackets')
require('codemirror/addon/selection/active-line')
require('codemirror/addon/hint/show-hint')
export default {
mixins: [elementUiMinins],
name: 'hs-action-set',
components: { left },
props: {
......
......@@ -210,25 +210,11 @@ export default {
} else if (buttonList) {
tempList = buttonList
}
const user_info = sessionStorage['user_info']
if (user_info) {
const user_info_json = JSON.parse(user_info)
const { is_admin } = user_info_json
if (!is_admin || is_admin === 0) {
// 不是管理员的情况下隐藏页面设置和action设置
tempList = tempList.filter(
item =>
item.click !== '$setAction' && item.click !== '$setPageConfig'
)
}
} else {
if (self !== top && location.hostname !== '0.0.0.0') {
tempList = tempList.filter(
item =>
item.click !== '$setAction' && item.click !== '$setPageConfig'
)
}
const { dev } = this.getConfigRight() // 非dev权限的隐藏页面配置和action
if (!dev) {
tempList = tempList.filter(
item => item.click !== '$setAction' && item.click !== '$setPageConfig'
)
}
return tempList.filter(item => this.showItem(item))
}
......
......@@ -53,10 +53,9 @@ export default {
) { return true }
} else {
// 这是在本地开发时使用没有user_info时
const hostname=location.hostname
if (top === self && (hostname === '0.0.0.0'||hostname==='localhost')) return true
if (top !== self && (hostname !== '0.0.0.0'||hostname !== 'localhost')) return false
const hostname = location.hostname
if (top === self && (hostname === '0.0.0.0' || hostname === 'localhost')) return true
if (top !== self && (hostname !== '0.0.0.0' || hostname !== 'localhost')) return false
}
},
boxEventMouse(event) {
......
......@@ -13,9 +13,9 @@
</div>
</template>
<script>
import commonboxUc from './commonboxUc.js'
import awakeDrive from '../../ucClass/awakeDrive'
export default {
mixins: [commonboxUc],
mixins: [awakeDrive],
props: {
elInfo: {}
},
......
......@@ -42,9 +42,7 @@
</template>
<script>
import elementUiMinins from '../../ucClass/elementUiMinins'
export default {
mixins: [elementUiMinins],
name: 'hs-dialog-dyncform',
data() {
return {
......
......@@ -27,9 +27,7 @@
</el-dialog>
</template>
<script>
import elementUiMinins from '../../ucClass/elementUiMinins'
export default {
mixins: [elementUiMinins],
name: 'hs-dialog-rejact-prompt-textarea',
data() {
return {
......
......@@ -50,9 +50,7 @@
</template>
<script>
import elementUiMinins from '../../ucClass/elementUiMinins'
export default {
mixins: [elementUiMinins],
name: 'hs-dialog-table',
data() {
return {
......
......@@ -26,10 +26,9 @@
</div>
</template>
<script>
import ucComponent from '../../ucClass/uc_component'
import elementUiMinins from '../../ucClass/elementUiMinins'
import awakeDrive from '../../ucClass/awakeDrive'
export default {
mixins: [ucComponent, elementUiMinins],
mixins: [awakeDrive],
name: 'hs-dialog',
props: {
visible: {},
......
......@@ -104,26 +104,26 @@ export default {
},
computed: {
contextmenuItems: function() {
const isDev = this.getIsDev()
const isAdmin = this.getIsAdmin()
const { user, admin, dev } = this.getConfigRight()
console.log(this.controlType)
const list = [
{
label: '配置(用户)',
isShow: false,
isShow: user,
onClick: () => {
this.userSysSet('1')
}
},
{
label: '配置(系统)',
isShow: isAdmin,
isShow: admin,
onClick: () => {
this.userSysSet('0')
}
},
{
label: '配置(开发)',
isShow: isDev,
isShow: dev,
onClick: () => {
this.devSet()
}
......@@ -185,29 +185,6 @@ export default {
) { return false }
}
},
getIsDev() {
const user_info = sessionStorage['user_info']
if (user_info) {
const user_info_json = JSON.parse(user_info)
const { systemSysDevDb } = user_info_json
if (
systemSysDevDb === true ||
systemSysDevDb === '1' ||
systemSysDevDb === 1
) { return true }
} else {
// 这是在本地开发时使用没有user_info时
const hostname = location.hostname
if (
top === self &&
(hostname === '0.0.0.0' || hostname === 'localhost')
) { return true }
if (
top !== self &&
(hostname !== '0.0.0.0' || hostname !== 'localhost')
) { return false }
}
},
onContextmenu(event) {
this.$contextmenu({
items: this.contextmenuItems,
......
......@@ -16,7 +16,7 @@
{{item.label}}
</label>
<div
class="el-form-item__label"
class="el-form-item__label controlItem"
:style="{width:item.width+'px','height':item.height+'px'}"
>
<childItem
......@@ -76,4 +76,7 @@ export default {
.labelDefaultWidth {
width: 120px;
}
.controlItem{
padding: 2px 12px 2px 0;
}
</style>
......@@ -24,8 +24,7 @@
</template>
<template v-else-if="item.type==='elDatePicker'">
<el-date-picker
v-click-outside="clickoutsideDom"
@blur='blur'
v-click-outside="clickoutsideDom1"
ref='currentDom'
clearable
style="width:100%"
......@@ -428,8 +427,14 @@ export default {
}
}
}
},
mounted() {
},
methods: {
clickoutsideDom1() {
this.hidePicker()
},
clickoutsideDom() {
this.hidePicker()
},
......
......@@ -84,16 +84,10 @@
</div>
</template>
<script>
import elementUiMinins from '../../ucClass/elementUiMinins'
import asyncFormItem from './dyncFormItemComponent'
import childItem from './dyncFormItemComponentChild'
import ClickOutside from 'vue-click-outside'
export default {
mixins: [elementUiMinins],
name: 'dyncFormItemComponentQuery',
directives: {
ClickOutside
},
components: {
asyncFormItem,
childItem
......
import { EleResize } from '../../funTools/self-adaption/ezresize.js'
import echarts from 'echarts'
import * as echarts from 'echarts'
export default {
data() {
return {
......
......@@ -48,6 +48,7 @@ export default {
window.removeEventListener('message', this.handleMessage, false)
},
handleMessage(message) {
if (!message.data) return
if (message.data.type === 'popSaveData') {
this.ok(message.data.data)
} else if (message.data.type === 'isReadeyWindow') {
......
<template>
<div class="box" :style="{width:configData.width||'150px',height:configData.height||'150px'}">
<div
class="box"
:style="{width:configData.width||'150px',height:configData.height||'150px'}"
>
<template v-if='!this.value'>
<img
class="imgStyle"
:src='defaultImg'
:width="150"
:height="150"
>
</template>
<template v-else>
<img
class="imgStyle"
:src='innerValue'
:width="configData.width||150"
:height="configData.height||150"
:onerror="errorImg01"
:onerror="errorImg01"
>
<div class="icon_box">
<i
class="el-icon-close closeIcon"
@click="deleteImg"
></i>
<i
class="el-icon-upload2"
@click="upload_dialogVisible=true"
></i>
</div>
<el-dialog
</template>
<div class="icon_box">
<i
class="el-icon-close closeIcon"
@click="deleteImg"
></i>
<i
class="el-icon-upload2"
@click="upload_dialogVisible=true"
></i>
</div>
<el-dialog
top='10px'
:center='true'
title="上传"
......@@ -27,13 +41,23 @@
@close='closeImgDialog'
>
<div v-if='upload_dialogVisible'>
<img
class="imgStyle"
width="200"
height="200"
:src='dialogImgSrc'
:onerror="errorImg01"
>
<template v-if='!upload_src&&!value'>
<img
class="imgStyle"
:src='defaultImg'
:width="150"
:height="150"
>
</template>
<template v-else>
<img
class="imgStyle"
:src='dialogImgSrc'
width="200"
height="200"
:onerror="errorImg01"
>
</template>
<div class="file">
选择图片
<input
......@@ -60,7 +84,7 @@
>确 定</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
......@@ -81,7 +105,7 @@ export default {
return this.value
} else {
const appCode =
(this.configData && this.configData.appCode) || this.appCode
(this.configData && this.configData.appCode) || this.appCode
const userInfo = this.getUserInfo()
const tenant = userInfo.tenant || ''
const src = `FILE_RESOURCE_PROXY/file/${appCode}/${this.value}?tenant_code=${tenant}`
......@@ -105,11 +129,11 @@ export default {
accept: 'image/*',
width: 200,
height: 200
}
},
defaultImg: require('./default.png')
}
},
methods: {
closeImgDialog() {
this.upload_src = ''
},
......@@ -155,7 +179,8 @@ export default {
const res_data = res && res.data
if (Array.isArray(res_data) && res_data.length) {
const file_result = res_data[0]
if (file_result.Sucess === false) { // fileResouce 出错会抛出错误,但是code是200,所以要再次判断结果
if (file_result.Sucess === false) {
// fileResouce 出错会抛出错误,但是code是200,所以要再次判断结果
this.$message.error(file_result.Error)
return
}
......@@ -176,7 +201,7 @@ export default {
}
</script>
<style scoped>
.box{
.box {
display: flex;
flex-direction: column;
}
......@@ -223,7 +248,7 @@ export default {
display: flex;
justify-content: flex-end;
}
.imgStyle{
.imgStyle {
border: 1px solid #c1c1c1;
}
</style>
......@@ -6,6 +6,7 @@
>{{configData.title}}</div>
<div class="inputCurr">
<el-input-number
ref='currentRef'
@focus="selectContent($event)"
:size='configData.size'
@keyup.enter.native="submitInput"
......@@ -101,13 +102,20 @@ export default {
this.execAction(changeed, value)
},
submitInput(val) {
const { entered } = this.configData
const { entered, enterToNextRow } = this.configData
this.execAction(entered, val, this.elInfo)
this.$emit('enterInput', this.innerValue, this.elInfo)
// 判断一下配置 中如果有配置enter 换行到下一行 则发出 enterNextToRow
if (enterToNextRow) {
this.$emit('enterToNextRow', this.innerValue)
}
},
getNumber(num) {
if (num === undefined) return
return Number(num)
},
focus() {
this.$refs.currentRef.focus()
}
}
}
......
......@@ -12,7 +12,6 @@
:size='configData.size'
@clear='clear'
@keyup.enter.native="submitInput"
@input='inputFun'
@change='changeFun'
@blur="inputBlur"
......@@ -212,9 +211,13 @@ export default {
}
},
submitInput(val) {
const { entered } = this.configData
const { entered, enterToNextRow } = this.configData
this.execAction(entered, val, this.elInfo)
this.$emit('enterInput', this.innerValue, this.elInfo)
// 判断一下配置 中如果有配置enter 换行到下一行 则发出 enterNextToRow
if (enterToNextRow) {
this.$emit('enterToNextRow', this.innerValue)
}
}
}
}
......
......@@ -14,10 +14,13 @@ class DataTool {
const { name } = item
// 按照x轴(xData)的顺序进行取值
const sdata = gp[name]
if (!sdata) return
const list = []
xData.forEach(x => {
const targetX = sdata.find(sx => sx.sName === x)
list.push(targetX.dValue)
if (targetX) {
list.push(targetX.dValue)
}
})
item.data = list
})
......
import { EleResize } from '../../funTools/self-adaption/ezresize.js'
import echarts from 'echarts'
import * as echarts from 'echarts'
export default {
data() {
return {
......@@ -30,6 +30,7 @@ export default {
},
offEchartsListener(id, handle) {
const dom = document.getElementById(id)
if (!dom) return
EleResize.on(dom, handle)
}
}
......
......@@ -13,12 +13,11 @@
</template>
<script>
import mockData from '../../common/initDbConfigDataJson'
import ucComponent from '../../ucClass/uc_component'
import awakeDrive from '../../ucClass/awakeDrive'
import echartResize from './echartResize'
import _ from 'lodash'
import DataTool from './dataTool'
export default {
mixins: [ucComponent, echartResize],
mixins: [awakeDrive, echartResize],
name: 'hs-line-bar',
props: {
elInfo: {
......@@ -27,17 +26,8 @@ export default {
return {}
}
},
config:{},
data:{},
allSourceData: {
type: Object,
default() {
return {
config: {},
sourceData: []
}
}
},
config: {},
data: {},
mock: {
type: Boolean,
default: false
......@@ -45,31 +35,17 @@ export default {
echartType: {
type: String,
default: 'hsLineBar'
},
layout: {},
jsoneditorCloseAfter: {
type: Function
},
jsoneditorOpenAfter: {
type: Function
}
},
watch: {
data: {
handler: function(newVal, oldVal) {
this.$nextTick(() => {
const newVal_copy = _.cloneDeep(newVal)
if (Object.keys(this.config).length && data) {
this.drowEchart(newVal_copy)
} else {
this.initMockData()
}
})
handler() {
this.dEcharts()
},
deep: true,
immediate: true // 默认立即触发一次
immediate: true,
deep: true
}
},
data() {
return {
......@@ -86,19 +62,27 @@ export default {
}
},
mounted() {
// this.initMockData()
},
methods: {
dEcharts() {
if (this.config && Object.keys(this.config).length) {
this.generateEcharts(this.config, this.data)
} else {
this.initMockData()
}
},
initMockData() {
this.initMockLineBar(this.elInfo.el)
},
// 折线图的模拟数据
initMockLineBar(type) {
const mockData_ = mockData[type]
this.drowEchart(mockData_.config,mockData_.sourceData)
this.generateEcharts(mockData_.config, mockData_.data)
},
drowEchart(config,data) {
generateEcharts(config, data) {
this.initEachart()
const option = this.dealLine(config,data)
const option = this.dealLine(config, data)
this.draw_complate_options(option)
},
initEachart() {
......@@ -123,10 +107,10 @@ export default {
})
// 新增双击事件
},
dealLine(config,data) {
dealLine(config, data) {
const tool = new DataTool()
const { el } = this.elInfo
if (el === 'hsLine') { // 折线图
if (el === 'hsLineBar') { // 折线图
return tool.processDataLine(config, data)
} else if (el === 'hsBar') { // 柱状图
return tool.processDataBar(config, data)
......
......@@ -20,6 +20,8 @@
</template>
<template v-else-if="item.showType==='hsInput'">
<hs-input
@enterToNextRow="enterToNextRow"
@enterInput='enterEvent'
:prop='item.prop'
v-model="formParms[item.prop]"
:config='item.config'
......@@ -117,6 +119,8 @@
</template>
<template v-else-if="item.showType==='hsInputNumber'">
<hs-input-number
ref='currentRef'
@enterToNextRow="enterToNextRow"
:prop='item.prop'
v-model="formParms[item.prop]"
:config='item.config'
......@@ -256,9 +260,12 @@ export default {
},
name: 'dyncFormItemComponentChild_',
props: {
prop: {},
item: {},
formParms: {},
disabled: {}
disabled: {},
index: {},
focusRow: {}
},
watch: {
item: {
......@@ -305,6 +312,13 @@ export default {
}
},
methods: {
enterToNextRow() {
this.$emit('enterToNextRow', this.item.prop, this.index)
},
enterEvent() {
// 输入框enter事件
this.$emit('enterInput', this.item.prop, this.index)
},
hidePicker() {
// console.log(this.item.showType)
// if (this.$refs.currentDom && this.$refs.currentDom.hidePicker) {
......@@ -313,6 +327,9 @@ export default {
},
enterInput(val) {
this.$emit('enterInput', val)
},
controlFocus() {
this.$refs.currentRef.focus()
}
}
}
......
......@@ -2,9 +2,8 @@
<div
class="_hs_table"
ref='boxtable'
@contextmenu.prevent="onContextmenu"
>
<div class='titleToolbox'>
<div class='titleToolbox' @contextmenu.prevent="onContextmenu">
<div v-show="tableConfig.title">{{tableConfig.title}}</div>
<div
v-show="tableConfig.toolDirection==='row'&&tableConfig.isShowTools"
......@@ -17,6 +16,7 @@
</div>
</div>
<span
@contextmenu.prevent="onContextmenu"
v-show="!tableConfig.toolDirection||tableConfig.toolDirection==='column'&&tableConfig.isShowTools"
class="iconTool"
>
......@@ -69,15 +69,6 @@
<rowTable :rowTable='scope.row._childTable'></rowTable>
</template>
</u-table-column>
<!-- <u-table-column
v-if='tableConfig.expandChild'
:key="index"
type="expand"
>
<template slot-scope="props">
<rowTable :rowTable='props.row._childTable'></rowTable>
</template>
</u-table-column> -->
<u-table-column
v-else-if="columnItem.showType==='index'"
:key="index"
......@@ -118,6 +109,7 @@
:class="rowCellBoolean(scope.row[columnItem.prop])"
></i>
<childItem
:ref='columnItem.prop+scope.$index'
v-else
:disabled='disabled'
:editable='editable'
......@@ -125,6 +117,9 @@
:item='columnItem'
:prop="columnItem.prop"
:formParms='scope.row'
:index='scope.$index'
:focusRow='focusRow'
@enterToNextRow='enterToNextRow'
>
</childItem>
</template>
......@@ -479,7 +474,8 @@ export default {
click: 'devSet'
}
],
targetDom: null
targetDom: null,
focusRow: null
}
},
watch: {
......@@ -502,12 +498,11 @@ export default {
},
computed: {
contextmenuItems: function() {
const isDev = this.getIsDev()
const isAdmin = this.getIsAdmin()
const { user, admin, dev } = this.getConfigRight()
const list = [
{
label: '配置(用户)',
isShow: false,
isShow: user,
onClick: () => {
// this.userSysSet('1')
this.userSysTableColumnSet('1')
......@@ -515,7 +510,7 @@ export default {
},
{
label: '配置(系统)',
isShow: isAdmin,
isShow: admin,
onClick: () => {
// this.userSysSet('0')
this.userSysTableColumnSet('0')
......@@ -523,7 +518,7 @@ export default {
},
{
label: '配置(开发)',
isShow: isDev,
isShow: dev,
onClick: () => {
this.tableColumnSet()
// this.devSet()
......@@ -606,6 +601,17 @@ export default {
this.targetDom = this.$refs.boxtable
},
methods: {
enterToNextRow(prop, index) {
const p1 = prop + '' + (index + 1)
if (this.$refs[p1]) {
this.$refs[p1][0].$children[0].$children[0].$children[0].$children[0].focus()
// setTimeout(() => {
// }, 500)
this.$refs.plTable.setCurrentRow(this.tableData[index + 1])
this.emitSetCurrentRow(this.tableData[index + 1])
}
},
getSpanArr(data, spanArrConfig) {
spanArrConfig.forEach(item => {
const { calculatedColumns } = item
......@@ -673,54 +679,8 @@ export default {
}
}
},
getIsAdmin() {
const user_info = sessionStorage['user_info']
if (user_info) {
const user_info_json = JSON.parse(user_info)
const { is_admin } = user_info_json
if (is_admin === true || is_admin === '1' || is_admin === 1) return true
} else {
// 这是在本地开发时使用没有user_info时
const hostname = location.hostname
if (
top === self &&
(hostname === '0.0.0.0' || hostname === 'localhost')
) { return true }
if (
top !== self &&
(hostname !== '0.0.0.0' || hostname !== 'localhost')
) { return false }
}
},
getIsDev() {
const user_info = sessionStorage['user_info']
if (user_info) {
const user_info_json = JSON.parse(user_info)
const { systemSysDevDb } = user_info_json
if (
systemSysDevDb === true ||
systemSysDevDb === '1' ||
systemSysDevDb === 1
) {
return true
} else {
return false
}
} else {
// 这是在本地开发时使用没有user_info时
const hostname = location.hostname
if (
top === self &&
(hostname === '0.0.0.0' || hostname === 'localhost')
) { return true }
if (
top !== self &&
(hostname !== '0.0.0.0' || hostname !== 'localhost')
) { return false }
}
},
onContextmenu(event) {
event.preventDefault() // 阻止元素的默认行为
this.$contextmenu({
items: this.contextmenuItems,
event,
......@@ -803,17 +763,24 @@ export default {
'<span class="caret-wrapper"><i class="sort-caret ascending"></i><i class="sort-caret descending"></i></span>'
}
return h(
'span',
'div',
{
style: {
width: '100%',
height: '100%'
},
domProps: {
innerHTML: innerHtml
},
on: {
// click: this.ascendingClick
contextmenu: this.onContextmenu
}
},
[h('span')]
[h('div')]
)
},
test() {
},
getTableHandleColumns(row) {
const list = this.dealWithHandleColumns()
......@@ -933,20 +900,26 @@ export default {
return newList.filter(item => item.isShow)
},
handleInnerSetItem(newList) {
const { user, admin, dev } = this.getConfigRight()
// 用户配置
const target_userColumnSet = newList.find(
item => item.click === '$userTableColumnSet'
)
if (target_userColumnSet && !user) {
target_userColumnSet.isShow = false
}
// 开发配置
const isDev = this.getIsDev()
const target_devColumnSet = newList.find(
item => item.click === '$tableColumnSet'
)
if (target_devColumnSet && !isDev) {
if (target_devColumnSet && !dev) {
target_devColumnSet.isShow = false
}
// 系统配置
const isAdmin = this.getIsAdmin()
const target_sysColumnSet = newList.find(
item => item.click === '$sysTableColumnSet'
)
if (target_sysColumnSet && !isAdmin) {
if (target_sysColumnSet && !admin) {
target_sysColumnSet.isShow = false
}
},
......
......@@ -153,7 +153,7 @@ function getTableColums(colums, allColumns) {
colums.forEach(item => {
if (item.prop && item.prop.includes('*')) {
const dynamicColumns = filterDynamicColumns(allColumns, item.prop, colums)
const { showType, isDisabled, isRequired, fixed, isSort, width, control_name, elInfo, allSourceData } = item
const { showType, isDisabled, isRequired, fixed, isSort, width, control_name, elInfo, config, data } = item
dynamicColumns.forEach(fieldName => {
if (addedColumn.includes(fieldName)) {
return
......@@ -195,7 +195,8 @@ function getTableColums(colums, allColumns) {
width,
control_name,
elInfo,
allSourceData
config,
data
})
}
})
......
......@@ -393,7 +393,7 @@ export default {
<style scoped>
.selectCurr {
overflow: scroll;
overflow-x: auto;
}
.noneStyle >>> .el-input__inner {
background: inherit;
......@@ -417,4 +417,9 @@ export default {
display: flex;
justify-content: flex-end;
}
.selectCurr >>> .el-tag{
height: 25px;
padding: 0;
line-height: 25px;
}
</style>
......@@ -32,9 +32,7 @@
</el-dialog>
</template>
<script>
import elementUiMinins from '../../ucClass/elementUiMinins'
export default {
mixins:[elementUiMinins],
name: 'hs-upload-excel',
props: {
visible: {
......
import { v1 as uuidv1 } from 'uuid'
import hsrightCommon from './hsrightCommon'
export default {
data () {
mixins: [hsrightCommon],
data() {
return {
elId: '',
outBoxDom: null,
jsoneditorVisible: false
}
},
created () {
created() {
this.initElid()
},
mounted () {
mounted() {
this.initElid()
const { dev } = this.getConfigRight()
if (!dev) return
setTimeout(() => {
this.showEditJsonDialog()
}, 2000)
},
destroyed () {
destroyed() {
if (this.outBoxDom) {
this.outBoxDom.removeEventListener('mousedown', this.boxEventMouse)
this.outBoxDom = null
}
this.chart = null
},
beforeDestroy () {
beforeDestroy() {
clearInterval(this.timer)// 清除定时器
this.timer = null
if (this.chart) {
......@@ -33,20 +37,23 @@ export default {
}
},
methods: {
initElid () {
showJsonEditDialog() {
this.jsoneditorVisible = true
},
initElid() {
if (!this.elId) {
this.elId = uuidv1() // 获取随机id
}
},
boxEventMouse (event) {
boxEventMouse(event) {
const that = this
event.stopPropagation()
if (event.shiftKey && event.altKey && !event.ctrlKey) {
that.jsoneditorVisible = true
that.showJsonEditDialog()
}
},
// 弹出可编辑的弹框
showEditJsonDialog () {
showEditJsonDialog() {
this.outBoxDom = document.getElementById(this.elId)
this.outBoxDom && this.outBoxDom.addEventListener('mousedown', this.boxEventMouse)
}
......
export default {
bind(el, binding, vnode) {
el.handler = function(e) {
if (el.contains(e.target)) {
return false
}
// vnode.context[binding.expression] = false
binding.value()
}
el.stopProp = function(event) {
event.stopPropagation()
}
el.addEventListener('click', el.stopProp)
document.body.addEventListener('click', el.handler)
},
unbind(el, binding) {
el.removeEventListener('click', el.stopProp)
document.body.removeEventListener('click', el.handler)
},
install(Vue) {
Vue.directive('clickoutside', {
bind: this.bind,
unbind: this.unbind
})
}
}
import Clickoutside from './clickoutside'
import hsrightCommon from './hsrightCommon'
export default {
// mixins:[elementUiMinins],
mixins: [hsrightCommon],
directives: {
ClickOutside: Clickoutside
},
......
import {
Button,
ButtonGroup,
Dropdown,
DropdownMenu,
DropdownItem,
Dialog,
Input,
Carousel,
CarouselItem,
Cascader,
Checkbox,
CheckboxGroup,
TimePicker,
DatePicker,
Row,
Divider,
Popover,
Link,
Progress,
RadioGroup,
Radio,
Rate,
Switch,
Table,
Tabs,
TablePane,
Tag,
Tree,
Upload
} from 'element-ui'
export default {
components: {
'el-dropdown-menu': DropdownMenu,
'el-dropdown': Dropdown,
'el-dropdown-item':DropdownItem,
'el-button': Button,
'el-button-group': ButtonGroup,
'el-dialog': Dialog,
'el-input': Input,
'el-carousel': Carousel,
'el-carousel-item': CarouselItem,
'el-cascader': Cascader,
'el-checkbox': Checkbox,
'el-checkbox-group': CheckboxGroup,
'el-time-picker': TimePicker,
'el-date-picker': DatePicker,
'el-row': Row,
'el-divider': Divider,
'el-popover': Popover,
'el-link': Link,
'el-progress': Progress,
'el-radio-group': RadioGroup,
'el-radio': Radio,
'el-rate': Rate,
'el-switch': Switch,
'el-table': Table,
'el-tabs': Tabs,
'el-tab-pane': TablePane,
'el-tag': Tag,
'el-tree': Tree,
'el-upload':Upload
},
}
export default {
methods: {
getConfigRight() {
const user_info = sessionStorage['user_info']
const obj = {
user: true,
dev: true,
admin: true
}
if (user_info) {
const user_info_json = JSON.parse(user_info)
const { systemSysDevDb, show_userSet, is_admin } = user_info_json
// const props = ['systemSysDevDb', 'show_userSet', 'is_admin']
if (
systemSysDevDb === true ||
systemSysDevDb === '1' ||
systemSysDevDb === 1
) { obj.dev = true } else {
obj.dev = false
}
if (
show_userSet === true ||
show_userSet === '1' ||
show_userSet === 1 ||
show_userSet === undefined
) { obj.user = true } else {
obj.user = false
}
if (
is_admin === true ||
is_admin === '1' ||
is_admin === 1
) { obj.admin = true } else {
obj.admin = false
}
} else {
// 这是在本地开发时使用没有user_info时
const hostname = location.hostname
if (
top === self &&
(hostname === '0.0.0.0' || hostname === 'localhost')
) {
obj.dev = true
obj.user = true
obj.admin = true
}
if (
top !== self &&
(hostname !== '0.0.0.0' || hostname !== 'localhost')
) {
obj.dev = false
obj.user = false
obj.admin = false
}
}
return obj
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment