Commit 4345db1b by 温丽香

参数,数据,应用模块完成

1 parent d178de9b
Pipeline #3872 passed
in 1 minute 54 seconds
......@@ -25,3 +25,4 @@ const APPID = '/appid'
export const getApp = data => axios(GET, FRONT + APPID + '/query_list', data)
export const deleteApp = data => axios(GET, FRONT + APPID + '/delete', data)
export const setApp = data => axios(GET, FRONT + APPID + '/set', data)
export const addApp = data => axios(POST, FRONT + APPID + '/add', data)
......@@ -56,6 +56,9 @@ Axios.interceptors.response.use(res => {
store.commit('removeAxiosCancelArr', index)
}
})
if (res && res.data && res.data.code !== 0) {
notificationError('提示', res.data.msg)
}
return res
}, error => {
error.response && error.response.data && notificationError('提示', error.response.data.message)
......
......@@ -4,6 +4,10 @@
<span class="title">{{'应用中心'}}</span>
</div>
<div class="page-content">
<div class="content-header">
<st-button type="primary" id="btn" @click="showDialog = true">
<i class="iconfont icon-tianjia"></i><span class="text">{{'申请应用'}}</span></st-button>
</div>
<div class="table-list">
<div class="list-content">
<st-table
......@@ -28,17 +32,51 @@
</div>
</div>
</div>
<st-dialog
:show.sync="showDialog"
class="update-dialog"
@dismiss="cancelSubmit"
>
<div slot="header" class="popup-header">{{'申请应用'}}</div>
<div slot="body" class="popup-body">
<st-form
label-width="90px"
ref="form"
:model="form">
<st-form-item :label="'appId:'"><st-input v-model="form.appid"></st-input></st-form-item>
<st-form-item :label="'secret:'"><st-input v-model="form.secret"></st-input></st-form-item>
<st-form-item
:label="'说明:'">
<st-input
type="textarea"
placeholder="请输入应用描述"
v-model="form.description"
maxlength="100"
show-word-limit
>
</st-input>
</st-form-item>
</st-form>
</div>
<div slot="footer" class="popup-footer flex right">
<st-button @click="cancelSubmit">{{$t('public.cancel')}}</st-button>
<st-button type="primary" @click="submit">{{'确定'}}</st-button>
</div>
</st-dialog>
</div>
</template>
<script>
import { getApp, deleteApp, setApp } from '@/axios'
import { getApp, deleteApp, setApp, addApp } from '@/axios'
import Dialog from '@/helpers/dialog'
import browserStorage from '@/services/local-storage'
export default {
data() {
return {
showSecret: '',
loadingStatus: false,
form: {},
showDialog: false,
definitions: [
{
label: 'APPID',
......@@ -85,6 +123,20 @@ export default {
}
this.loadingStatus = false
},
cancelSubmit() {
this.form = {}
this.showDialog = false
},
async submit() {
const userInfo = JSON.parse(browserStorage.getItem('user'))
const res = await addApp({ ...this.form, creater: userInfo.creater })
if (res && res.data && res.data.code === 0) {
Toast.success('操作成功')
this.getData()
}
this.showDialog = false
this.form = {}
},
async handleDelete(row) {
const confirmDelete = await Dialog.confirm('提示', { message: '是否删除此应用?' })
if (!confirmDelete) return
......@@ -108,6 +160,23 @@ export default {
</script>
<style lang="sass" scoped>
.update-dialog
::v-deep input
&::placeholder
font-size: 14px
font-family: PingFangSC-Regular, PingFang SC
font-weight: 400
color:#999999
::v-deep.el-input__inner, ::v-deep.el-textarea, ::v-deep.el-textarea__inner
font-size: 14px
font-family: PingFangSC-Regular, PingFang SC
font-weight: 400
color: #333
&::placeholder
font-size: 14px
font-family: PingFangSC-Regular, PingFang SC
font-weight: 400
color:#999999
.eye-btn
margin-left: 10px
color: #409EFF
......
......@@ -72,7 +72,7 @@ export default {
definitions: [
{
label: '序号',
render: 'number'
render: 'order'
},
{
label: '名称',
......@@ -131,7 +131,10 @@ export default {
this.loadingStatus = true
const res = await getTable({ pages: this.currentPage - 1, pagesize: this.currentSize })
if (res && res.data && res.data.code === 0) {
this.tokenList = res.data.data.tables
this.tokenList = res.data.data.tables.map((item, index) => {
item.order = index + 1 + (this.currentPage - 1) * this.currentSize
return item
})
this.total = res.data.data.total
}
this.loadingStatus = false
......
......@@ -44,7 +44,7 @@
prop="description">
<st-input
type="textarea"
placeholder="请输入应用描述"
placeholder="请输入描述"
v-model="form.description"
maxlength="100"
show-word-limit
......
......@@ -12,7 +12,7 @@
<st-form-item
:label="'模板名称'+':'"
prop="name">
<st-input v-model="form.name"></st-input>
<st-input v-model="form.name" :disabled="true"></st-input>
</st-form-item>
<st-form-item
:label="'模板类型'+':'"
......@@ -44,7 +44,7 @@
prop="description">
<st-input
type="textarea"
placeholder="请输入应用描述"
placeholder="请输入描述"
v-model="form.description"
maxlength="100"
show-word-limit
......
......@@ -60,6 +60,7 @@
list: twoList,
total: twoTotal,
}"
:empty-text="parentLevel ? '暂无数据' : '未选择一级参数模板'"
:outerLoading="loadingTwo">
<div slot="operate" slot-scope="row">
<span class="operate" @click="$router.push({ path: '/params/detail', query: { name: row.name } })">详情</span>
......@@ -138,7 +139,7 @@ export default {
},
async getTwoData() {
this.loadingTwo = true
const twoLevel = await getParameter({ base: 0, parent: this.parentLevel, pages: this.twoCurrentPage - 1, pagesize: 10 })
const twoLevel = await getParameter({ parent: this.parentLevel, pages: this.twoCurrentPage - 1, pagesize: 10 })
if (twoLevel && twoLevel.data && twoLevel.data.code === 0) {
this.twoList = twoLevel.data.parameters.datas
this.twoTotal = twoLevel.data.parameters.total
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!