Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
3092a12b
Link Wechat
项目概览
仟微科技
/
Link Wechat
通知
48
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Link Wechat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3092a12b
编写于
10月 28, 2020
作者:
[
[zmy2771345724]
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
2020-10-28-曾明洋 第一次提交 素材管理模块
上级
96e71c76
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
1067 addition
and
502 deletion
+1067
-502
linkwe-ui/src/api/zmyApi/sucai-guanli/all.js
linkwe-ui/src/api/zmyApi/sucai-guanli/all.js
+26
-0
linkwe-ui/src/components/zmyComponents/ZmyTree.vue
linkwe-ui/src/components/zmyComponents/ZmyTree.vue
+124
-0
linkwe-ui/src/components/zmyComponents/zmyDialog.vue
linkwe-ui/src/components/zmyComponents/zmyDialog.vue
+209
-0
linkwe-ui/src/components/zmyComponents/zmyTable.vue
linkwe-ui/src/components/zmyComponents/zmyTable.vue
+359
-0
linkwe-ui/src/router/index.js
linkwe-ui/src/router/index.js
+50
-50
linkwe-ui/src/utils/zmyUtils.js
linkwe-ui/src/utils/zmyUtils.js
+81
-0
linkwe-ui/src/views/material/text.vue
linkwe-ui/src/views/material/text.vue
+218
-452
未找到文件。
linkwe-ui/src/api/zmyApi/sucai-guanli/all.js
0 → 100644
浏览文件 @
3092a12b
import
request
from
'
@/utils/request
'
import
axios
from
'
axios
'
export
function
getList
(
data
)
{
return
request
({
url
:
'
/wagesApi/listWages
'
,
method
:
'
post
'
,
data
})
}
export
function
info
(
data
)
{
return
request
({
url
:
'
/wagesApi/infoWages
'
,
method
:
'
post
'
,
data
})
}
export
function
add
(
data
)
{
return
request
({
url
:
'
/wagesApi/addWages
'
,
method
:
'
post
'
,
data
})
}
export
function
edit
(
data
)
{
return
request
({
url
:
'
/wagesApi/editWages
'
,
method
:
'
post
'
,
data
})
}
export
function
del
(
data
)
{
return
request
({
url
:
'
/wagesApi/delWages
'
,
method
:
'
post
'
,
data
})
}
export
function
doExport
(
data
)
{
return
request
({
url
:
'
/wagesApi/doExport
'
,
method
:
'
post
'
,
responseType
:
'
blob
'
,
data
})
}
export
function
doImport
(
data
)
{
return
request
({
url
:
'
/wagesApi/doImport
'
,
method
:
'
post
'
,
responseType
:
'
blob
'
,
data
})
}
export
function
getTemplate
(
data
)
{
return
request
({
url
:
'
/wagesApi/getTemplate
'
,
method
:
'
get
'
,
responseType
:
'
blob
'
,
data
})
}
linkwe-ui/src/components/zmyComponents/ZmyTree.vue
0 → 100644
浏览文件 @
3092a12b
<
template
>
<section
class=
"tree-container"
>
<el-row
v-if=
'isfilter'
class=
"search_header"
>
<el-col
:span=
"20"
>
<el-input
placeholder=
"输入关键字进行过滤"
size=
"small"
v-model=
"filterText"
></el-input>
</el-col>
<el-col
:span=
"4"
class=
"plus"
>
<i
class=
"el-icon-plus"
@
click=
"treeEvent.addParent"
></i>
</el-col>
</el-row>
<el-tree
class=
"filter-tree"
:data=
"treeData"
:props=
"treeDefaultProps"
default-expand-all
:filter-node-method=
"filterNode"
ref=
"tree"
>
<!-- style="display:flex;justify-content:space-between;" -->
<span
class=
"custom-tree-node"
slot-scope=
"
{ node, data }" >
<span>
{{
node
.
label
}}
</span>
<el-tooltip
placement=
"bottom"
popper-class=
"atooltip"
effect=
"light"
>
<i
class=
"el-icon-setting"
></i>
<div
slot=
"content"
class=
'tipContent'
>
<span>
<el-button
type=
"text"
size=
"mini"
>
<i
class=
"el-icon-edit"
@
click=
"treeEvent.edit(node,data)"
></i>
</el-button>
<el-button
type=
"text"
size=
"mini"
>
<i
class=
"el-icon-plus"
@
click=
"treeEvent.append(node,data)"
></i>
</el-button>
<el-button
type=
"text"
size=
"mini"
>
<i
class=
"el-icon-delete"
@
click=
"treeEvent.remove(node,data)"
></i>
</el-button>
</span>
</div>
</el-tooltip>
</span>
</el-tree>
</section>
</
template
>
<
script
>
export
default
{
props
:{
isfilter
:{
type
:
Boolean
,
default
:
false
},
//是否显示过滤
treeEvent
:{
type
:
Object
,
default
:()
=>
{}},
//tree组件的所有函数事件
treeData
:{
type
:
Array
,
default
:()
=>
[]},
//tree数据
treeDefaultProps
:{
type
:
Object
,
default
:()
=>
({
children
:
'
children
'
,
label
:
'
label
'
})
},
//tree的父子节点变量定义
},
data
(){
return
{
filterText
:
''
,
}
},
watch
:{
filterText
(
val
)
{
this
.
$refs
.
tree
.
filter
(
val
);
}
},
methods
:{
filterNode
(
value
,
data
)
{
if
(
!
value
)
return
true
;
return
data
.
label
.
indexOf
(
value
)
!==
-
1
;
}
},
created
(){
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.tree-container
{
.search_header
{
padding
:
10px
0
;
/
deep
/
.el-input__inner
{
height
:
35px
;
line-height
:
35px
;
}
}
}
.plus
{
color
:
#606266
;
text-align
:
center
;
font-size
:
25px
;
height
:
35px
;
line-height
:
35px
;
}
.filter-tree
{
font-size
:
20px
;
}
/
deep
/
.el-tree-node__content
{
position
:
relative
;
}
/
deep
/
.el-tooltip
{
position
:
absolute
;
top
:
0
;
right
:
30px
;
}
/
deep
/
.el-tree-node__content
{
height
:
36px
;
line-height
:
36px
;
}
.atooltip
{
background
:
#fff
!
important
;
border
:
none
!
important
;
}
.tipContent
{
width
:
100%
;
height
:
100%
;
background
:
#fff
!
important
;
}
</
style
>
\ No newline at end of file
linkwe-ui/src/components/zmyComponents/zmyDialog.vue
0 → 100644
浏览文件 @
3092a12b
<!-- 搜索表单 -->
<
template
>
<div
class=
"ces-search"
>
<el-dialog
:title=
"title"
:visible.sync=
"dialogFormVisible"
:close-on-click-modal=
"false"
:show-close=
"false"
:width=
"dialogWidth"
>
<el-form
:size=
"size"
inline
:model=
'dialogData'
:label-width=
"dialogLabelWidth"
:rules=
"rules"
:ref=
"dialogRef"
style=
""
>
<el-form-item
v-for=
'item in dialogForm'
:label=
"item.label"
:key=
'item.prop'
:prop=
"item.prop"
:style=
"
{width:(item.width?item.width:'40%')}">
<!-- 输入框 -->
<el-input
v-if=
"item.type==='Input'"
:placeholder=
'item.placeholder'
:type=
"item.inputType || 'text'"
v-model=
"dialogData[item.prop]"
size=
"mini"
:disabled=
"item.disabled || false"
></el-input>
<!-- 输入框 -->
<el-input
v-if=
"item.type==='TextArea'"
:placeholder=
'item.placeholder'
type=
'textarea'
:rows=
"2"
v-model=
"dialogData[item.prop]"
size=
"mini"
:disabled=
"item.disabled || false"
></el-input>
<!-- 下拉框 -->
<el-select
v-if=
"item.type==='Select'"
:placeholder=
'item.placeholder'
v-model=
"dialogData[item.prop]"
size=
"mini"
@
change=
"item.change(dialogData[item.prop])"
:multiple=
"item.multiple || false"
:disabled=
"item.disabled || false"
>
<el-option
v-for=
"op in item.options"
:label=
"op.label"
:value=
"op.value"
:key=
"op.value"
></el-option>
</el-select>
<!-- 单选 -->
<el-radio-group
v-if=
"item.type==='Radio'"
v-model=
"dialogData[item.prop]"
:disabled=
"item.disabled || false"
>
<el-radio
v-for=
"ra in item.radios"
:label=
"ra.value"
:key=
"ra.value"
>
{{
ra
.
label
}}
</el-radio>
</el-radio-group>
<!-- 单选按钮 -->
<el-radio-group
v-if=
"item.type==='RadioButton'"
v-model=
"dialogData[item.prop]"
@
change=
"item.change && item.change(dialogData[item.prop])"
:disabled=
"item.disabled || false"
>
<el-radio-button
v-for=
"ra in item.radios"
:label=
"ra.value"
:key=
"ra.value"
>
{{
ra
.
label
}}
</el-radio-button>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group
v-if=
"item.type==='Checkbox'"
v-model=
"dialogData[item.prop]"
:disabled=
"item.disabled || false"
>
<el-checkbox
v-for=
"ch in item.options"
:label=
"ch.value"
:key=
"ch.value"
@
change=
"item.change(dialogData[item.prop])"
>
{{
ch
.
label
}}
</el-checkbox>
</el-checkbox-group>
<!-- 日期 -->
<el-date-picker
v-if=
"item.type==='Date'"
v-model=
"dialogData[item.prop]"
format=
"yyyy-MM-dd"
value-format=
"yyyy-MM-dd"
:disabled=
"item.disabled || false"
></el-date-picker>
<!-- 时间 -->
<el-time-select
v-if=
"item.type==='Time'"
arrow-control
value-format=
'HH:mm'
:picker-options=
"
{ start: '05:00', step: '00:05', end: '23:30'}"
v-model="dialogData[item.prop]" :disabled="item.disabled || false">
</el-time-select>
<!-- 日期时间 -->
<el-date-picker
v-if=
"item.type==='DateTime'"
type=
'datetime'
format=
"yyyy-MM-dd HH:mm:ss"
value-format=
"yyyy-MM-dd HH:mm:ss"
v-model=
"dialogData[item.prop]"
:disabled=
"item.disable && item.disable(dialogData[item.prop])"
></el-date-picker>
<!-- 滑块 -->
<!--
<el-slider
v-if=
"item.type==='Slider'"
v-model=
"dialogData[item.prop]"
></el-slider>
-->
<!-- 开关 -->
<el-switch
v-if=
"item.type==='Switch'"
v-model=
"dialogData[item.prop]"
:disabled=
"item.disabled || false"
></el-switch>
<!-- 文件 -->
<el-upload
v-if=
"item.type==='UploadFile'"
class=
"upload-demo"
:action=
"item.action"
:on-preview=
"handlePreview"
:on-success=
"item.onSuccess"
:on-remove=
"handleRemove"
:before-remove=
"beforeRemove"
multiple
:limit=
"1"
:on-exceed=
"handleExceed"
:file-list=
"item.fileList"
>
<el-button
size=
"small"
type=
"primary"
>
点击上传
</el-button>
<span
v-if=
"dialogData[item.prop]"
>
{{
dialogData
[
item
.
prop
].
slice
(
dialogData
[
item
.
prop
].
indexOf
(
'
/uploads/
'
)
+
18
)
||
''
}}
</span>
</el-upload>
<!-- 图片展示上传 -->
<el-upload
v-if=
"item.type==='UploadImg'"
class=
"avatar-uploader"
:action=
"item.action"
:show-file-list=
"false"
:on-success=
"item.onSuccess"
:before-upload=
"beforeAvatarUpload"
>
<img
v-if=
"dialogData[item.prop]"
:src=
"dialogData[item.prop]"
class=
"avatar"
>
<i
v-else
class=
"el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
<el-button
v-if=
"item.type==='Button'"
type=
"text"
@
click=
"item.change(dialogData)"
>
<i
:class=
"item.class"
>
{{
item
.
text
}}
</i></el-button>
</el-form-item>
<slot
name=
"content"
></slot>
<el-form-item
class=
"dialog-footer"
>
<el-button
v-for=
"btnItem in dialogBtns"
:key=
"btnItem.label"
:type=
"btnItem.type || 'primary'"
style=
"background-color:#2EA39D;border-color:#fff"
:size=
"btnItem.size || 'medium'"
@
click=
"btnItem.handle(dialogData)"
>
{{
btnItem
.
label
}}
</el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</
template
>
<
script
>
export
default
{
props
:{
dialogFormVisible
:{
type
:
Boolean
,
default
:
true
},
dialogLabelWidth
:{
type
:
String
,
default
:
'
100px
'
},
dialogRef
:{
type
:
String
,
default
:
'
ruleForm
'
},
dialogWidth
:{
type
:
String
,
default
:
'
60%
'
},
size
:{
type
:
String
,
default
:
'
medium
'
},
rules
:{
type
:
Object
,
default
:{}
},
dialogForm
:{
//表单框类型数组
type
:
Array
,
default
:[]
},
dialogData
:{
//表单数据
type
:
Object
,
default
:{}
},
title
:{
//表单数据
type
:
String
,
default
:
'
操作
'
},
dialogBtns
:{
type
:
Array
,
default
:[]
}
},
data
()
{
return
{
};
},
methods
:{
handleRemove
(
file
,
fileList
)
{
console
.
log
(
file
,
fileList
);
},
handlePreview
(
file
)
{
console
.
log
(
file
,
111
);
},
handleExceed
(
files
,
fileList
)
{
this
.
$message
.
warning
(
`当前限制选择 1 个文件,本次选择了
${
files
.
length
}
个文件,共选择了
${
files
.
length
+
fileList
.
length
}
个文件`
);
},
beforeRemove
(
file
,
fileList
)
{
return
this
.
$confirm
(
`确定移除
${
file
.
name
}
?`
);
},
// 图片上传限制
beforeAvatarUpload
(
file
)
{
// const isJPG = file.type === 'image/jpeg';
// const isLt2M = file.size / 1024 / 1024
<
2
;
// if (!isJPG) {
// this.$message.error('上传头像图片只能是 JPG 格式!');
// }
// if (!isLt2M) {
// this.$message.error('上传头像图片大小不能超过 2MB!');
// }
// return isJPG && isLt2M;
}
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.dialog-footer
{
padding
:
40px
0
0
0
;
width
:
100%
;
text-align
:
center
;
}
/
deep
/
.el-form-item__content
{
width
:
70%
!
important
;
}
/
deep
/
.el-date-editor.el-input
,
.el-date-editor.el-input__inner
{
width
:
100%
!
important
;
}
/
deep
/
.el-dialog__header
{
background-color
:
#2EA39D
;
text-align
:
center
;
}
/
deep
/
.el-dialog__title
{
color
:
#fff
!
important
;
font-weight
:
550
;
font-size
:
22px
;
}
/
deep
/
.el-select
{
width
:
100%
!
important
;
}
.avatar-uploader
.el-upload
{
border
:
1px
dashed
#d9d9d9
;
border-radius
:
6px
;
cursor
:
pointer
;
position
:
relative
;
overflow
:
hidden
;
}
.avatar-uploader
.el-upload
:hover
{
border-color
:
#409EFF
;
}
.avatar-uploader-icon
{
font-size
:
28px
;
color
:
#8c939d
;
width
:
100px
;
height
:
100px
;
line-height
:
100px
;
text-align
:
center
;
}
.avatar
{
width
:
100px
;
height
:
100px
;
display
:
block
;
}
</
style
>
linkwe-ui/src/components/zmyComponents/zmyTable.vue
0 → 100644
浏览文件 @
3092a12b
<
template
>
<section
class=
"ces-table-page"
>
<section
class=
"ces-search"
>
<!-- 搜索内容 -->
<el-form
:size=
"size"
inline
label-width=
"80px"
ref=
"form"
v-if=
'isSearch'
>
<el-form-item
v-for=
'item in searchForm'
:key=
'item.prop'
:prop=
"item.prop"
>
<el-input
v-if=
"item.type==='Input'"
:disabled=
"item.disabled || false"
v-model=
"searchData[item.prop]"
:placeholder=
'item.label'
size=
"mini"
></el-input>
<!-- 下拉框 -->
<el-select
v-if=
"item.type==='Select'"
:disabled=
"item.disabled || false"
:placeholder=
'item.label'
v-model=
"searchData[item.prop]"
size=
"mini"
@
change=
"item.change(searchData[item.prop])"
>
<el-option
v-for=
"op in item.options"
:label=
"op.label"
:value=
"op.value"
:key=
"op.value"
></el-option>
</el-select>
<!-- 单选 -->
<el-radio-group
v-if=
"item.type==='Radio'"
v-model=
"searchData[item.prop]"
>
<el-radio
v-for=
"ra in item.radios"
:label=
"ra.value"
:key=
"ra.value"
>
{{
ra
.
label
}}
</el-radio>
</el-radio-group>
<!-- 单选按钮 -->
<el-radio-group
v-if=
"item.type==='RadioButton'"
v-model=
"searchData[item.prop]"
@
change=
"item.change && item.change(searchData[item.prop])"
>
<el-radio-button
v-for=
"ra in item.radios"
:label=
"ra.value"
:key=
"ra.value"
>
{{
ra
.
label
}}
</el-radio-button>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group
v-if=
"item.type==='Checkbox'"
v-model=
"searchData[item.prop]"
>
<el-checkbox
v-for=
"ch in item.checkboxs"
:label=
"ch.value"
:key=
"ch.value"
>
{{
ch
.
label
}}
</el-checkbox>
</el-checkbox-group>
<!-- 日期valueFormat对于周 不能用 -->
<el-date-picker
v-if=
"item.type==='Date'"
:type=
"item.dateType || 'date'"
:placeholder=
'item.label'
:format=
"item.format|| 'yyyy-MM-dd'"
:value-format=
"item.valueFormat|| 'yyyy-MM-dd'"
v-model=
"searchData[item.prop]"
></el-date-picker>
<!-- 时间 -->
<el-time-select
v-if=
"item.type==='Time'"
v-model=
"searchData[item.prop]"
:picker-options=
"
{ start: '08:30', step: '00:15', end: '18:30' }">
</el-time-select>
<!-- 日期时间 -->
<el-date-picker
v-if=
"item.type==='DateTime'"
type=
'datetime'
v-model=
"searchData[item.prop]"
:disabled=
"item.disable && item.disable(searchData[item.prop])"
></el-date-picker>
<!-- 滑块 -->
<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]"
></el-switch>
<!-- 搜索按钮 -->
<el-button
v-if=
"item.type==='search'"
:size=
"size || item.size"
type=
"danger"
@
click=
"item.handle(that)"
>
查询
</el-button>
</el-form-item>
</el-form>
<!-- 表格操作按钮 -->
<div
class=
"ces-handle"
v-if=
'isButton'
>
<el-button
v-for=
'item in searchBtns'
:key=
'item.label'
:size=
"size || item.size"
:type=
"item.type"
:icon=
'item.icon'
@
click=
"item.handle(that)"
>
{{
item
.
label
}}
</el-button>
<!-- 导入 -->
<el-upload
v-if=
'isImport'
class=
"improt"
ref=
"upload"
:on-success=
"importSuccess"
:action=
"importUrl"
:show-file-list=
"false"
:auto-upload=
"true"
:data=
'importData'
>
<el-button
type=
"warning"
slot=
"trigger"
>
导入
</el-button>
</el-upload>
</div>
</section>
<!-- 数据表格 -->
<section
class=
"ces-table"
v-if=
'isTable'
>
<el-table
:header-cell-style=
"
{height: '60px',padding: '0','font-size': '12px',color: '#8590a6'}"
:row-style="{'font-size': '12px',color: '#212121'}"
align='center'
stripe fit
:data='tableData'
:size='size'
height="100%"
style="width: 100%"
:border='isBorder'
@select='select'
@select-all='selectAll'
v-loading='loading'
:defaultSelections='defaultSelections'
ref="cesTable">
<el-table-column
v-if=
"isSelection"
type=
"selection"
align=
"center"
></el-table-column>
<el-table-column
v-if=
"isIndex"
type=
"index"
:label=
"indexLabel"
align=
"center"
width=
"80"
></el-table-column>
<!-- 数据栏 -->
<el-table-column
v-for=
"(item) in tableCols"
:key=
"item.id"
:prop=
"item.prop"
:label=
"item.label"
:width=
"item.width"
:align=
"'center'||item.align"
:render-header=
"item.require?renderHeader:null"
>
<template
slot-scope=
"scope"
>
<!-- 按钮-->
<template
v-if=
"item.type === 'Button'"
>
<el-button
v-for=
"btnItem in item.btnList"
:key=
"btnItem.label"
type=
"text"
@
click=
"btnItem.handle(that,scope.row)"
>
<i
:class=
"btnItem.class"
>
{{
btnItem
.
label
||
btnItem
.
textEvent
(
that
,
scope
.
row
)
}}
</i>
</el-button>
<!--
<el-switch
v-if=
"isSwitch"
v-model=
"scope.row.switch"
@
change=
'item.switchHandle'
>
</el-switch>
-->
</
template
>
<el-input
v-if=
"item.type==='input'"
v-model=
"scope.row[item.prop]"
:type=
"item.inputType||'text'"
@
blur=
'($event)=> item.submit($event,scope.row)'
@
input=
'($event)=> item.handle($event,scope.row)'
></el-input>
<!-- html -->
<span
v-if=
"item.type==='html'"
v-html=
"item.html(scope.row)"
></span>
<!-- 下拉框 -->
<el-select
v-if=
"item.type==='select'"
v-model=
"scope.row[item.prop]"
:size=
"size || btn.size"
:props=
"item.props"
:disabled=
"item.isDisabled && item.isDisabled(scope.row)"
@
change=
'item.change && item.change(that,scope.row)'
>
<el-option
v-for=
"op in item.options"
:label=
"op.label"
:value=
"op.value"
:key=
"op.value"
></el-option>
</el-select>
<!-- 单选 -->
<el-radio-group
v-if=
"item.type==='radio'"
v-model=
"scope.row[item.prop]"
:disabled=
"item.isDisabled && item.isDisabled(scope.row)"
:size=
"size || btn.size"
@
change=
'item.change && item.change(that,scope.row)'
>
<el-radio
v-for=
"ra in item.radios"
:label=
"ra.value"
:key=
"ra.value"
>
{{ra.label}}
</el-radio>
</el-radio-group>
<!-- 复选框 -->
<el-checkbox-group
v-if=
"item.type==='checkbox'"
v-model=
"scope.row[item.prop]"
:disabled=
"item.isDisabled && item.isDisabled(scope.row)"
:size=
"size || btn.size"
@
change=
'item.change && item.change(that,scope.row)'
>
<el-checkbox
v-for=
"ra in item.checkboxs"
:label=
"ra.value"
:key=
'ra.value'
>
{{ra.label}}
</el-checkbox>
</el-checkbox-group>
<!-- 评价 -->
<el-rate
v-if=
"item.type==='rate'"
v-model=
"scope.row[item.prop]"
:disabled=
"item.isDisabled && item.isDisabled(scope.row)"
:size=
"size || btn.size"
@
change=
'item.change && item.change(scope.row)'
></el-rate>
<!-- 开关 -->
<el-switch
v-if=
"item.type==='switch'"
v-model=
"scope.row[item.prop]"
:size=
"size || btn.size"
:active-value=
'item.values&&item.values[0]'
:inactive-value=
'item.values&&item.values[1]'
:disabled=
"item.isDisabled && item.isDisabled(scope.row)"
@
change=
'item.change && item.change(scope.row)'
></el-switch>
<!-- 图像 -->
<img
v-if=
"item.type==='image'"
:src=
"scope.row[item.prop]"
@
click=
"item.handle && item.handle(scope.row)"
/>
<!-- 滑块 -->
<el-slider
v-if=
"item.type==='slider'"
v-model=
"scope.row[item.prop]"
:disabled=
"item.isDisabled && item.isDisabled(scope.row)"
:size=
"size || btn.size"
@
change=
'item.change && item.change(scope.row)'
></el-slider>
<!-- <el-input v-if="item.type='input'" v-model="scope.row[item.prop]" :type="item.inputType||'text'" @blur='item.blurEvent(row)'></el-input> -->
<!-- 默认 -->
<span
v-if=
"!item.type"
@
click=
"item.handle(scope.row)"
:style=
"item.itemStyle && item.itemStyle(scope.row)"
:size=
"size || btn.size"
:class=
"item.itemClass && item.item.itemClass(scope.row)"
>
{{(item.formatter
&&
item.formatter(scope.row)) || scope.row[item.prop]}}
</span>
<a
v-if=
"item.type == 'a'"
style=
"color:blue"
:href=
'scope.row[item.prop]'
target=
"_blank"
>
{{scope.row[item.prop] ==null ?'未上传附件':'附件下载'}}
</a>
</template>
</el-table-column>
</el-table>
</section>
<!-- 分页 -->
<slot
name=
"mid"
></slot>
<section
class=
"ces-pagination"
v-if=
'isPagination'
>
<el-pagination
style=
'display: flex;justify-content: center;height: 100%;align-items: center;padding: 20px 0 20px 0;'
@
current-change=
"handleCurrentChange"
@
size-change=
"handleSizeChange"
background
layout=
"total,sizes ,prev, pager, next, jumper"
:page-size=
"tablePage.offset"
:current-page.sync=
"tablePage.page"
:total=
"tablePage.total"
></el-pagination>
</section>
<!--弹窗 -->
</section>
</template>
<
script
>
export
default
{
props
:{
that
:
{
type
:
Object
,
default
:
this
},
// 表格型号:mini,medium,small
size
:{
type
:
String
,
default
:
'
medium
'
},
isBorder
:{
type
:
Boolean
,
default
:
true
},
loading
:{
type
:
Boolean
,
default
:
false
},
// 表格操作
isButton
:{
type
:
Boolean
,
default
:
false
},
isImport
:{
type
:
Boolean
,
default
:
false
},
importUrl
:{
type
:
String
,
default
:
''
},
importData
:{
type
:
Object
,
default
:()
=>
({})},
isSearch
:{
type
:
Boolean
,
default
:
false
},
searchBtns
:{
type
:
Array
,
default
:()
=>
[]},
// 表格数据
tableData
:{
type
:
Array
,
default
:()
=>
[]},
// 表格列配置
tableCols
:{
type
:
Array
,
default
:()
=>
[]},
// 是否显示表格复选框
isSelection
:{
type
:
Boolean
,
default
:
false
},
defaultSelections
:{
type
:[
Array
,
Object
],
default
:()
=>
null
},
// 是否显示表格索引
isIndex
:{
type
:
Boolean
,
default
:
false
},
indexLabel
:
{
type
:
String
,
default
:
'
序号
'
},
// 是否显示分页
isPagination
:{
type
:
Boolean
,
default
:
true
},
// 分页数据
tablePage
:{
type
:
Object
,
default
:()
=>
({
offset
:
10
,
page
:
1
,
total
:
0
})},
searchForm
:{
type
:
Array
,
default
:()
=>
[]},
// searchHandle:{ type:Array, default:()=>[] },
searchData
:{
type
:
Object
,
default
:()
=>
{}},
labelWidth
:{
type
:
String
,
default
:
'
100px
'
},
isTable
:{
type
:
Boolean
,
default
:
true
},
},
data
(){
return
{
options
:{
nianciOption
:[]}
}
},
watch
:{
'
defaultSelections
'
(
val
)
{
this
.
$nextTick
(
function
(){
if
(
Array
.
isArray
(
val
)){
val
.
forEach
(
row
=>
{
this
.
$refs
.
cesTable
.
toggleRowSelection
(
row
)
})
}
else
{
this
.
$refs
.
cesTable
.
toggleRowSelection
(
val
)
}
})
}
},
methods
:{
niancichange
(
value
){
console
.
log
(
this
.
searchData
)
},
// 表格勾选
select
(
rows
,
row
){
this
.
$emit
(
'
select
'
,
rows
,
row
);
},
// 全选
selectAll
(
rows
){
this
.
$emit
(
'
select-all
'
,
rows
)
},
//
handleCurrentChange
(
val
){
console
.
log
(
val
)
this
.
tablePage
.
page
=
val
;
this
.
$emit
(
'
currentchange
'
,
val
);
},
handleSizeChange
(
val
)
{
console
.
log
(
val
)
this
.
tablePage
.
offset
=
val
;
this
.
$emit
(
'
sizechange
'
,
val
);
},
importSuccess
(
res
,
listData
)
{
console
.
log
(
res
,
listData
,
"
打印上传后的结果
"
);
const
h
=
this
.
$createElement
;
const
newDatas
=
[]
if
(
res
.
code
==
1
){
res
.
data
.
forEach
(
el
=>
{
newDatas
.
push
(
h
(
'
p
'
,
null
,
el
.
name
+
'
-
'
+
el
.
msg
))
})
}
return
res
.
code
==
1
?
this
.
$notify
(
{
title
:
res
.
msg
,
dangerouslyUseHTMLString
:
true
,
message
:
h
(
'
div
'
,
null
,
newDatas
),
duration
:
5000
},
setTimeout
(()
=>
{
location
.
reload
()
},
2000
)
)
:
this
.
$message
.
error
(
'
上传失败,原因:
'
+
res
.
msg
);
},
renderHeader
(
h
,
obj
)
{
return
h
(
'
span
'
,{
class
:
'
ces-table-require
'
},
obj
.
column
.
label
)
},
},
created
(){
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.ces-search
{
padding
:
10px
0
20px
0
;
display
:
flex
;
justify-content
:
space-between
;
button
{
// margin:2px 0;
color
:
#FFFFFF
;
background-color
:
#1890ff
;
border-color
:
#1890ff
;
border
:none
;
}
.ces-handle
{
display
:
flex
;
justify-content
:
flex-end
;
button
{
margin
:
0
10px
0
0
;
background-color
:
#1890ff
;
border-color
:
#1890ff
;
border
:none
;
}
}
/
deep
/
.el-input__inner
{
height
:
35px
;
}
}
.
ces-table-require
:
:
before
{
content
:
'*'
;
color
:
F4483E
;
}
.el-table__row
td
{
text-align
:
center
!
important
;
}
.has-gutter
tr
th
{
text-align
:
center
!
important
;
}
.el-table__body-wrapper
{
height
:
500px
!
important
;
}
/
deep
/
.el-table__body
,
.el-table__footer
,
.el-table__header
{
table-layout
:
unset
!
important
;
}
/
deep
/
.el-table__header
{
table-layout
:
unset
!
important
;
}
/
deep
/
.el-form-item
{
margin
:
0
10px
0
0
;
width
:
120px
!
important
;
}
/
deep
/
.el-date-editor.el-input
{
width
:
120px
!
important
;
}
/
deep
/
.el-input--suffix
.el-input__inner
{
padding-left
:
10px
;
}
/
deep
/
.el-input__prefix
{
display
:
none
;
}
/
deep
/
.el-table__body-wrapper
{
height
:
auto
!
important
;
}
.improt
{
button
{
padding
:
9px
15px
!
important
;}}
</
style
>
\ No newline at end of file
linkwe-ui/src/router/index.js
浏览文件 @
3092a12b
...
...
@@ -181,56 +181,56 @@ export const constantRoutes = [
// },
// ]
// },
//
{
//
path: '/material',
//
component: Layout,
//
redirect: '/material/text',
//
meta: { title: '素材中心', icon: 'material' },
//
children: [
//
{
//
path: 'text',
//
name: 'MaterialText',
//
component: (resolve) => require(['@/views/material/text'], resolve),
//
meta: { title: '文本', icon: '' }
//
},
//
{
//
path: 'image',
//
name: 'MaterialImage',
//
component: (resolve) => require(['@/views/material/image'], resolve),
//
meta: { title: '图片', icon: '' }
//
},
//
{
//
path: 'web',
//
name: 'MaterialWeb',
//
component: (resolve) => require(['@/views/material/web'], resolve),
//
meta: { title: '网页', icon: '' }
//
},
//
{
//
path: 'audio',
//
name: 'MaterialAudio',
//
component: (resolve) => require(['@/views/material/audio'], resolve),
//
meta: { title: '语音', icon: '' }
//
},
//
{
//
path: 'video',
//
name: 'MaterialVideo',
//
component: (resolve) => require(['@/views/material/video'], resolve),
//
meta: { title: '视频', icon: '' }
//
},
//
{
//
path: 'file',
//
name: 'MaterialFile',
//
component: (resolve) => require(['@/views/material/file'], resolve),
//
meta: { title: '文件', icon: '' }
//
},
//
{
//
path: 'applet',
//
name: 'MaterialApplet',
//
component: (resolve) => require(['@/views/material/applet'], resolve),
//
meta: { title: '小程序', icon: '' }
//
},
//
]
//
},
{
path
:
'
/material
'
,
component
:
Layout
,
redirect
:
'
/material/text
'
,
meta
:
{
title
:
'
素材中心
'
,
icon
:
'
material
'
},
children
:
[
{
path
:
'
text
'
,
name
:
'
MaterialText
'
,
component
:
(
resolve
)
=>
require
([
'
@/views/material/text
'
],
resolve
),
meta
:
{
title
:
'
文本
'
,
icon
:
''
}
},
{
path
:
'
image
'
,
name
:
'
MaterialImage
'
,
component
:
(
resolve
)
=>
require
([
'
@/views/material/image
'
],
resolve
),
meta
:
{
title
:
'
图片
'
,
icon
:
''
}
},
{
path
:
'
web
'
,
name
:
'
MaterialWeb
'
,
component
:
(
resolve
)
=>
require
([
'
@/views/material/web
'
],
resolve
),
meta
:
{
title
:
'
网页
'
,
icon
:
''
}
},
{
path
:
'
audio
'
,
name
:
'
MaterialAudio
'
,
component
:
(
resolve
)
=>
require
([
'
@/views/material/audio
'
],
resolve
),
meta
:
{
title
:
'
语音
'
,
icon
:
''
}
},
{
path
:
'
video
'
,
name
:
'
MaterialVideo
'
,
component
:
(
resolve
)
=>
require
([
'
@/views/material/video
'
],
resolve
),
meta
:
{
title
:
'
视频
'
,
icon
:
''
}
},
{
path
:
'
file
'
,
name
:
'
MaterialFile
'
,
component
:
(
resolve
)
=>
require
([
'
@/views/material/file
'
],
resolve
),
meta
:
{
title
:
'
文件
'
,
icon
:
''
}
},
{
path
:
'
applet
'
,
name
:
'
MaterialApplet
'
,
component
:
(
resolve
)
=>
require
([
'
@/views/material/applet
'
],
resolve
),
meta
:
{
title
:
'
小程序
'
,
icon
:
''
}
},
]
},
// {
// path: '/appTool',
// component: Layout,
...
...
linkwe-ui/src/utils/zmyUtils.js
0 → 100644
浏览文件 @
3092a12b
// 对象克隆
export
function
clone
(
obj
)
{
var
o
;
// 如果 他是对象object的话 , 因为null,object,array 也是'object';
if
(
typeof
obj
===
'
object
'
)
{
// 如果 他是空的话
if
(
obj
===
null
)
{
o
=
null
;
}
else
{
// 如果 他是数组arr的话
if
(
obj
instanceof
Array
)
{
o
=
[];
for
(
var
i
=
0
,
len
=
obj
.
length
;
i
<
len
;
i
++
)
{
o
.
push
(
clone
(
obj
[
i
]));
}
}
// 如果 他是对象object的话
else
{
o
=
{};
for
(
var
j
in
obj
)
{
o
[
j
]
=
clone
(
obj
[
j
]);
}
}
}
}
else
{
o
=
obj
;
}
return
o
;
};
//判断obj是否有空值---校验 arr为不检验的参数
export
function
isEmpty
(
obj
,
arr
){
if
(
!
arr
){
arr
=
[]}
console
.
log
(
arr
,
arr
.
length
)
let
flag
=
true
;
for
(
var
key
in
obj
){
//遍历对象的所有属性,包括原型链上的所有属性
if
(
obj
.
hasOwnProperty
(
key
)){
//判断是否是对象自身的属性,而不包含继承自原型链上的属性
if
(
arr
.
indexOf
(
key
)
!=
-
1
){
}
else
if
(
!
obj
[
key
]){
flag
=
false
;
}
}
}
return
flag
};
//obj为初始化的对象 arr为obj内不必初始化的值
export
function
initObj
(
obj
,
arr
){
let
flag
=
true
;
for
(
var
key
in
obj
){
if
(
obj
.
hasOwnProperty
(
key
)){
if
(
arr
&&
arr
.
indexOf
(
key
)
!=
-
1
){
}
else
{
obj
[
key
]
=
''
;
}
}
}
return
obj
};
// newObj为待复制的对象 copyobj为给newobj赋值的obj
export
function
objCopy
(
newObj
,
copyObj
){
for
(
var
key
in
copyObj
){
//遍历对象的所有属性,包括原型链上的所有属性
if
(
copyObj
.
hasOwnProperty
(
key
)){
//判断是否是对象自身的属性,而不包含继承自原型链上的属性
for
(
var
newkey
in
newObj
){
if
(
newObj
.
hasOwnProperty
(
newkey
)){
if
(
key
==
newkey
){
newObj
[
newkey
]
=
copyObj
[
key
]
}
}
}
}
}
return
newObj
};
linkwe-ui/src/views/material/text.vue
浏览文件 @
3092a12b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录