Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
office
haoban-3
Commits
dc8e1702
Commit
dc8e1702
authored
Apr 20, 2021
by
陈羽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 小程序配置
parent
3795454a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
122 additions
and
32 deletions
+122
-32
app-set.vue
src/components/set/app-set.vue
+47
-19
enterpriseSet.vue
src/views/enterprise/enterpriseSet.vue
+75
-13
No files found.
src/components/set/app-set.vue
View file @
dc8e1702
...
...
@@ -11,36 +11,39 @@
import appSet from '@/components/set/app-set.vue';
-->
<
template
>
<el-dialog
:title=
"
!!editRow.materialId
? '编辑' : '新建'"
:visible
.
sync=
"dialogVisible"
width=
"600px"
:before-close=
"handleClose"
>
<el-dialog
:title=
"
editRow.type === 'edit'
? '编辑' : '新建'"
:visible
.
sync=
"dialogVisible"
width=
"600px"
:before-close=
"handleClose"
>
<div
class=
""
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"120px"
class=
"demo-ruleForm"
>
<el-form-item
label=
"小程序名称"
prop=
"appName"
>
<el-input
show-word-limit
placeholder=
"请输入小程序名称"
type=
"text"
v-model=
"ruleForm.appName"
maxlength=
"20"
></el-input>
<el-form-item
label=
"授权商户"
prop=
"enterpriseId"
>
<el-select
v-model=
"ruleForm.enterpriseId"
placeholder=
"请选择授权商户"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.enterpriseName"
:value=
"item.enterpriseId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"小程序名称"
prop=
"miniprogramName"
>
<el-input
show-word-limit
placeholder=
"请输入小程序名称"
type=
"text"
v-model=
"ruleForm.miniprogramName"
maxlength=
"20"
></el-input>
</el-form-item>
<el-form-item
label=
"AppID:"
prop=
"appId"
>
<el-input
show-word-limit
placeholder=
"请输入AppID"
type=
"text"
v-model=
"ruleForm.appId"
maxlength=
"80"
></el-input>
</el-form-item>
<template
v-if=
"type === 1"
>
<el-form-item
label=
"标题:"
prop=
"title"
>
<el-input
show-word-limit
placeholder=
"请输入标题"
type=
"text"
v-model=
"ruleForm.title"
maxlength=
"80"
></el-input>
</el-form-item>
<el-form-item
label=
" 封面:"
prop=
"pic"
>
<single-upload
uploadType=
"1"
:imgSrc
.
sync=
"ruleForm.pic
"
:field=
"''"
class=
"app-set"
:uploadLimit=
"20"
>
</single-upload>
<single-upload
uploadType=
"1"
:imgSrc
.
sync=
"ruleForm.imageUrl
"
:field=
"''"
class=
"app-set"
:uploadLimit=
"20"
>
</single-upload>
<p
style=
"margin-top: 9px;font-size: 12px;color: #909399;line-height: 17px;"
>
建议尺寸520*416,支持png、jpg、jpeg格式
</p>
</el-form-item>
</
template
>
</el-form>
</div>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"toCancel"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
{{
!!editRow.materialId
? '保存' : '新建' }}
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm('ruleForm')"
>
{{
editRow
.
type
===
'edit'
?
'保存'
:
'新建'
}}
</el-button>
</div>
</el-dialog>
</
template
>
<
script
>
import
singleUpload
from
'@/components/single-upload.vue'
;
import
{
_debounce
}
from
'@/common/js/public'
;
import
{
postRequest
}
from
'@/api/api'
;
import
{
postRequest
,
getRequest
}
from
'@/api/api'
;
import
showMsg
from
'@/common/js/showmsg'
;
import
errMsg
from
'@/common/js/error'
;
export
default
{
...
...
@@ -50,12 +53,6 @@ export default {
default
()
{
return
{};
}
},
type
:
{
type
:
Number
,
default
()
{
return
0
;
}
}
},
components
:
{
...
...
@@ -65,15 +62,18 @@ export default {
return
{
dialogVisible
:
true
,
ruleForm
:
{
app
Name
:
''
,
miniprogram
Name
:
''
,
appId
:
''
,
title
:
''
title
:
''
,
imageUrl
:
''
},
rules
:
{
appName
:
[{
required
:
true
,
message
:
'请输入小程序名称'
,
trigger
:
'blur'
}],
enterpriseId
:
[{
required
:
true
,
message
:
'请选择授权商户'
,
trigger
:
'blur'
}],
miniprogramName
:
[{
required
:
true
,
message
:
'请输入小程序名称'
,
trigger
:
'blur'
}],
appId
:
[{
required
:
true
,
message
:
'请输入AppID'
,
trigger
:
'blur'
}],
title
:
[{
required
:
true
,
message
:
'请输入标题'
,
trigger
:
'blur'
}]
}
},
options
:
[]
};
},
methods
:
{
...
...
@@ -91,14 +91,22 @@ export default {
const
that
=
this
;
that
.
$refs
[
formName
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
$confirm
(
'是否确认提交?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
that
.
postSave
();
})
.
catch
(()
=>
{});
}
});
},
300
),
postSave
()
{
const
that
=
this
;
const
data
=
{
...
that
.
ruleForm
};
postRequest
(
'/haoban-manage3-web/'
,
data
)
postRequest
(
'/haoban-manage3-web/
save-miniprogram-setting
'
,
data
)
.
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
)
{
...
...
@@ -117,6 +125,25 @@ export default {
message
:
error
.
message
});
});
},
getTableList
(
val
)
{
const
that
=
this
;
let
para
=
{};
getRequest
(
'/haoban-manage3-web/wx-enterprise-list'
,
para
)
.
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
)
{
that
.
options
=
resData
.
result
||
[];
return
false
;
}
errMsg
.
errorMsg
(
resData
);
})
.
catch
(
function
(
error
)
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
error
.
message
});
});
}
},
watch
:
{
...
...
@@ -131,6 +158,7 @@ export default {
},
mounted
()
{
const
that
=
this
;
that
.
getTableList
();
if
(
Object
.
keys
(
that
.
editRow
).
length
)
{
that
.
$nextTick
(()
=>
{
that
.
ruleForm
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
editRow
));
...
...
src/views/enterprise/enterpriseSet.vue
View file @
dc8e1702
...
...
@@ -127,18 +127,15 @@
<div
class=
"company-title m-b-20 m-t-30"
><span
class=
"color-303133 font-14 font-w-600"
>
小程序添加
</span></div>
<div
class=
"company-info-body"
>
<div
class=
"table-cell m-t-10"
>
<el-table
class=
"no-empty-icon-table"
ref=
"multipleTable"
:data=
"
t
ableData"
tooltip-effect=
"dark"
:style=
"{ width: '100%', minHeight: tableH }"
>
<el-table
class=
"no-empty-icon-table"
ref=
"multipleTable"
:data=
"
appT
ableData"
tooltip-effect=
"dark"
:style=
"{ width: '100%', minHeight: tableH }"
>
<el-table-column
label=
"小程序名称"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
secret
Name
||
'--'
}}
</
template
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
miniprogram
Name
||
'--'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
""
label=
"AppID"
width=
"239"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
enterpriseName
||
'--'
}}
</span>
<span>
{{
scope
.
row
.
appId
||
'--'
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
""
label=
"类型"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
enterpriseName
||
'--'
}}
</
template
>
</el-table-column>
<el-table-column
prop=
""
label=
"最近编辑时间"
show-overflow-tooltip
>
<
template
slot-scope=
"scope"
>
<div
class=
"line-18"
>
{{
scope
.
row
.
updateTime
|
timeStampToYmd
}}
</div>
...
...
@@ -146,15 +143,18 @@
</
template
>
</el-table-column>
<el-table-column
prop=
""
label=
"操作"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"toEdit(scope.$index, scope.row)"
>
编辑
</el-button><el-button
type=
"text"
@
click=
"toDel(scope.$index, scope.row)"
>
删除
</el-button>
</
template
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
@
click=
"toAppEdit(scope.$index, scope.row)"
>
编辑
</el-button>
<!--
<el-button
type=
"text"
@
click=
"toAppDel(scope.$index, scope.row)"
>
删除
</el-button>
-->
</
template
>
</el-table-column>
</el-table>
<
div
class=
"text-center add-cell cursor-pointer"
@
click=
"addApp"
><span
class=
"el-icon-plus font-14 color-2f54eb add-cell-txt"
></span><span
class=
"font-14 color-2f54eb p-l-5 add-cell-txt"
>
新建
</span><span
class=
"font-12 color-c0c4cc p-l-20"
>
最多添加10个
</span></div
>
<
!-- <div class="text-center add-cell cursor-pointer" @click="addApp"><span class="el-icon-plus font-14 color-2f54eb add-cell-txt"></span><span class="font-14 color-2f54eb p-l-5 add-cell-txt">新建</span></div> --
>
</div>
</div>
</div>
<secret-set
v-if=
"addShow"
:editRow=
"editRow"
@
closeText=
"closeText"
@
submitText=
"submitText"
></secret-set>
<app-set
v-if=
"addAppShow"
:type=
"appSetType"
@
closeText=
"closeAppText"
@
submitText=
"submitAppText"
></app-set>
<app-set
v-if=
"addAppShow"
:
editRow=
"appEditRow"
:
type=
"appSetType"
@
closeText=
"closeAppText"
@
submitText=
"submitAppText"
></app-set>
</div>
</template>
<
script
>
...
...
@@ -209,10 +209,12 @@ export default {
showContactError
:
false
,
showHaobanError
:
false
,
tableData
:
[],
appTableData
:
[],
addShow
:
false
,
addAppShow
:
false
,
appSetType
:
0
,
editRow
:
{},
appEditRow
:
{},
// 企微好友
wxShow
:
false
,
wxDate
:
''
...
...
@@ -295,7 +297,7 @@ export default {
addApp
()
{
const
that
=
this
;
that
.
addAppShow
=
true
;
that
.
editRow
=
{};
that
.
editRow
=
{
type
:
'add'
};
},
/**
* 编辑
...
...
@@ -305,6 +307,11 @@ export default {
that
.
addShow
=
true
;
that
.
editRow
=
row
;
},
toAppEdit
(
index
,
row
)
{
const
that
=
this
;
that
.
addAppShow
=
true
;
that
.
appEditRow
=
Object
.
assign
({},
row
,
{
type
:
'edit'
});
},
closeText
()
{
const
that
=
this
;
that
.
addShow
=
false
;
...
...
@@ -313,7 +320,7 @@ export default {
closeAppText
()
{
const
that
=
this
;
that
.
addAppShow
=
false
;
that
.
e
ditRow
=
{};
that
.
appE
ditRow
=
{};
},
submitText
()
{
const
that
=
this
;
...
...
@@ -324,8 +331,8 @@ export default {
submitAppText
()
{
const
that
=
this
;
that
.
addAppShow
=
false
;
that
.
e
ditRow
=
{};
// that.getSecret
Data();
that
.
appE
ditRow
=
{};
that
.
getApp
Data
();
},
/**
* 删除
...
...
@@ -343,6 +350,19 @@ export default {
})
.
catch
(()
=>
{});
},
toAppDel
(
index
,
row
)
{
const
that
=
this
;
that
.
$confirm
(
'确定删除当前小程序?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
})
.
then
(()
=>
{
that
.
postAppDel
(
index
,
row
);
})
.
catch
(()
=>
{});
},
postDel
(
index
,
row
)
{
const
that
=
this
;
let
para
=
{
...
...
@@ -366,6 +386,29 @@ export default {
});
});
},
postAppDel
(
index
,
row
)
{
const
that
=
this
;
let
para
=
{
id
:
row
.
miniprogramSettingId
};
postRequest
(
'/haoban-manage3-web/del-miniprogram-setting'
,
para
)
.
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
)
{
showMsg
.
showmsg
(
'删除成功'
,
'success'
);
that
.
getAppData
();
return
;
}
that
.
getAppData
();
errMsg
.
errorMsg
(
resData
);
})
.
catch
(
function
(
error
)
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
error
.
message
});
});
},
/**
* 保存secret
*/
...
...
@@ -530,6 +573,24 @@ export default {
message
:
error
.
message
});
});
},
getAppData
()
{
const
that
=
this
;
getRequest
(
'/haoban-manage3-web/list-miniprogram-setting'
,
{})
.
then
(
res
=>
{
let
resData
=
res
.
data
;
if
(
resData
.
errorCode
==
1
)
{
that
.
appTableData
=
resData
.
result
;
return
;
}
errMsg
.
errorMsg
(
resData
);
})
.
catch
(
function
(
error
)
{
that
.
$message
.
error
({
duration
:
1000
,
message
:
error
.
message
});
});
}
},
watch
:
{},
...
...
@@ -537,6 +598,7 @@ export default {
const
that
=
this
;
that
.
$emit
(
'showTab'
,
1
);
document
.
documentElement
.
style
.
backgroundColor
=
'#f0f2f5'
;
that
.
getAppData
();
that
.
getData
();
that
.
getSecretData
();
that
.
getTipData
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment