Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -0,0 +1,420 @@
|
||||
<!-- 配置管理 - 链接管理 -->
|
||||
<template>
|
||||
<div id="post-manage">
|
||||
<!-- 头部操作按钮-->
|
||||
<div class="action-bar">
|
||||
<el-button type="primary"
|
||||
class="common-button-primary add-button"
|
||||
@click="addLink"
|
||||
v-btn-permission="'980cb239683de9e29ee5335cec98e5b4'"
|
||||
size="mini">新增</el-button>
|
||||
<!-- <el-button type="primary"-->
|
||||
<!-- class="common-button-primary add-button"-->
|
||||
<!-- @click="linkOrder"-->
|
||||
<!-- v-btn-permission="'779665b2e4bb20fc480cf9372a100f69'"-->
|
||||
<!-- size="mini">顺序调整</el-button>-->
|
||||
<el-button type="primary"
|
||||
class="common-button-primary add-button"
|
||||
@click="deleteAllLink"
|
||||
v-btn-permission="'779665b2e4bb20fc480cf9372a100f69'"
|
||||
size="mini">删除</el-button>
|
||||
</div>
|
||||
<!-- 表格-->
|
||||
<div class="content">
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="linkList"
|
||||
tooltip-effect="dark"
|
||||
border
|
||||
style="width: 100%; flex: auto;"
|
||||
class="drag-table"
|
||||
height="100%"
|
||||
:header-cell-style="{background: '#E8E8E8', color: '#333333', fontSize: '16px',
|
||||
fontWeight: 'bold', height: '48px'}"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="链接名称"
|
||||
width="220px">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="url"
|
||||
label="链接">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="orderBy"
|
||||
label="序号"
|
||||
sortable
|
||||
width="170px">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
width="50px">
|
||||
<template slot-scope="scope">
|
||||
<div @click.stop style="display: inline-block">
|
||||
<el-dropdown trigger="click" @command="handleCommand">
|
||||
<i class="iconfont"></i>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-btn-permission="'0fbb849e244e07433a90180fb314ad10'" :command="[scope.row, '删除']">删除</el-dropdown-item>
|
||||
<el-dropdown-item v-btn-permission="'fa0846d977aeef07e9cb7faf648f8f7f'" :command="[scope.row, '编辑']">编辑</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<loading :loading="Loading">加载中...</loading>
|
||||
<!-- 新增链接弹窗-->
|
||||
<el-dialog
|
||||
:title="dialogTitle"
|
||||
:visible.sync="modalshowflag"
|
||||
:wrapperClosable="false"
|
||||
size="800px"
|
||||
@close="resetForm"
|
||||
>
|
||||
<el-form
|
||||
ref="sarStandardsInfoForm"
|
||||
:model="sarStandardsInfoEO"
|
||||
:rules="sarStandardsInfoRules"
|
||||
class="label-input-form"
|
||||
>
|
||||
<el-form-item label="链接名称" prop="name" label-width="150px" class="add-form-item">
|
||||
<el-input v-model="sarStandardsInfoEO.name"
|
||||
placeholder="请输入链接名称"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接" prop="url" label-width="150px" class="add-form-item">
|
||||
<el-input v-model="sarStandardsInfoEO.url"
|
||||
placeholder="请输入链接"
|
||||
clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="demo-drawer-footer">
|
||||
<el-button class="common-button-default" size="mini" icon="el-icon-close" @click="resetForm">取消</el-button>
|
||||
<el-button type="primary" size="mini" class="common-button-primary" icon="el-icon-check" @click="submit">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "linkManage",
|
||||
data () {
|
||||
return {
|
||||
editId: '',
|
||||
type: '', // 1为新增 2为编辑
|
||||
dialogTitle: '',
|
||||
submitLoading: false,
|
||||
selectList: [],
|
||||
data: [],
|
||||
Loading: false,
|
||||
modalshowflag: false,
|
||||
sarStandardsInfoEO: {
|
||||
name: '',
|
||||
url: '',
|
||||
// orderBy: ''
|
||||
},
|
||||
//新增链接未输入时提示
|
||||
sarStandardsInfoRules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入链接名称', trigger: 'blur' }
|
||||
],
|
||||
url: [
|
||||
{ required: true, message: '请输入链接', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
|
||||
modalRole: false,
|
||||
props: {
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
},
|
||||
|
||||
linkList: [
|
||||
{
|
||||
url: 'http://www.sac.gov.cn/',
|
||||
name: '国家标准化管理委员会',
|
||||
orderBy: '01'
|
||||
},
|
||||
{
|
||||
url: 'http://std.samr.gov.cn/',
|
||||
name: '全国标准公共服务平台',
|
||||
orderBy: '02'
|
||||
},
|
||||
{
|
||||
url: 'http://www.gb688.cn/bzgk/gb/gbMainQuery%E5%9B%BD%E5%AE%B6%E6%A0%87%E5%87%86%E5%85%A8%E6%96%87%E5%85%AC%E5%BC%80',
|
||||
name: '国家标准全文公开',
|
||||
orderBy: '03'
|
||||
},
|
||||
{
|
||||
url: 'http://www.catarc.org.cn/',
|
||||
name: '全国汽车标准化技术委员会',
|
||||
orderBy: '04'
|
||||
},
|
||||
{
|
||||
url: 'http://jtst.mot.gov.cn/news/',
|
||||
name: '交通运输标准化信息平台',
|
||||
orderBy: '05'
|
||||
},
|
||||
{
|
||||
url: 'https://www.miit.gov.cn/index.html',
|
||||
name: '中华人民共和国工业和信息化部',
|
||||
orderBy: '06'
|
||||
},
|
||||
{
|
||||
url: 'http://www.miit-eidc.org.cn/',
|
||||
name: '工信部装备工业发展中心',
|
||||
orderBy: '07'
|
||||
},
|
||||
{
|
||||
url: 'http://www.mee.gov.cn/',
|
||||
name: '中华人民共和国生态环境部',
|
||||
orderBy: '08'
|
||||
},
|
||||
{
|
||||
url: 'http://sthjj.beijing.gov.cn/',
|
||||
name: '北京市生态环境局',
|
||||
orderBy: '09'
|
||||
},
|
||||
{
|
||||
url: 'http://www.tmri.cn/',
|
||||
name: '公安部交通管理科学研究院',
|
||||
orderBy: '10'
|
||||
},
|
||||
{
|
||||
url: 'http://www.tbt-sps.gov.cn/page/cwtoz/Indexquery.action',
|
||||
name: '中国WTO/TBT-SPS通报资讯网',
|
||||
orderBy: '11'
|
||||
},
|
||||
{
|
||||
url: 'http://www.samr.gov.cn/',
|
||||
name: '国家市场监督管理总局',
|
||||
orderBy: '12'
|
||||
},
|
||||
{
|
||||
url: 'http://www.caam.org.cn/',
|
||||
name: '中国汽车工业协会',
|
||||
orderBy: '13'
|
||||
},
|
||||
{
|
||||
url: 'http://www.sae-china.org/',
|
||||
name: '汽车工程学会',
|
||||
orderBy: '14'
|
||||
},
|
||||
{
|
||||
url: 'http://csae.sae-china.org/',
|
||||
name: 'CSAE汽车工程学会标准',
|
||||
orderBy: '15'
|
||||
},
|
||||
{
|
||||
url: 'http://www.ttbz.org.cn/',
|
||||
name: '全国团体标准信息平台',
|
||||
orderBy: '16'
|
||||
},
|
||||
{
|
||||
url: 'http://www.autoinfo.org.cn/',
|
||||
name: '中国汽车工业信息网',
|
||||
orderBy: '17'
|
||||
},
|
||||
{
|
||||
url: 'http://cv.ce.cn/',
|
||||
name: '中国商用车辆网',
|
||||
orderBy: '18'
|
||||
},
|
||||
{
|
||||
url: 'http://www.cnspv.cn/',
|
||||
name: '中国专用汽车网',
|
||||
orderBy: '19'
|
||||
},
|
||||
{
|
||||
url: 'http://scjgj.beijing.gov.cn/bsfw/bmfw/bzhzl/',
|
||||
name: '北京市市场监督管理局',
|
||||
orderBy: '20'
|
||||
},
|
||||
{
|
||||
url: 'http://www.unece.org/',
|
||||
name: '欧盟经济委员会',
|
||||
orderBy: '21'
|
||||
},
|
||||
{
|
||||
url: 'https://eur-lex.europa.eu',
|
||||
name: '欧盟',
|
||||
orderBy: '22'
|
||||
},
|
||||
{
|
||||
url: 'http://ec.europa.eu',
|
||||
name: '欧共体',
|
||||
orderBy: '23'
|
||||
},
|
||||
{
|
||||
url: 'https://www.iso.org',
|
||||
name: 'ISO',
|
||||
orderBy: '24'
|
||||
},
|
||||
{
|
||||
url: 'https://www.interregs.net/',
|
||||
name: 'InterRegs',
|
||||
orderBy: '25'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//头部新增按钮
|
||||
addLink () {
|
||||
this.type = 1
|
||||
this.dialogTitle = '新增链接'
|
||||
this.modalshowflag = true
|
||||
},
|
||||
|
||||
// //头部顺序调整按钮
|
||||
// linkOrder () {
|
||||
// this.$http.post('sarUrl/tsUrl/order',{
|
||||
// urlId: this.sarStandardsInfoEO.url
|
||||
// })
|
||||
// },
|
||||
|
||||
//头部删除按钮
|
||||
deleteAllLink(row) {
|
||||
if (this.selectList.length === 0) {
|
||||
this.$message.warning('请选择要删除的链接')
|
||||
} else {
|
||||
this.modalRole = true
|
||||
// this.nodeList = this.selectList[0].idList
|
||||
this.$http.delete('sarUrl/tsUrl/deleteBatch', {
|
||||
id: this.selectList.id
|
||||
}, {}, res => {
|
||||
if (res.ok) {
|
||||
this.$message.success('删除成功')
|
||||
this.getLink()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
//弹窗关闭操作
|
||||
resetForm () {
|
||||
this.$refs['sarStandardsInfoForm'].resetFields();
|
||||
this.modalshowflag = false
|
||||
},
|
||||
|
||||
//弹窗确认操作
|
||||
submit () {
|
||||
this.$refs['sarStandardsInfoForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.type === 1) {
|
||||
this.$http.post('sarUrl/tsUrl/add', {
|
||||
name: this.sarStandardsInfoEO.name,
|
||||
url: this.sarStandardsInfoEO.url,
|
||||
}, {
|
||||
_this: this,
|
||||
loading: 'Loading'
|
||||
}, res=> {
|
||||
if (res.ok) {
|
||||
this.$message.success('新增成功')
|
||||
this.modalshowflag = false
|
||||
this.getLink()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$http.put('sarUrl/tsUrl/edit', {
|
||||
id: this.editId,
|
||||
name: this.sarStandardsInfoEO.name,
|
||||
url: this.sarStandardsInfoEO.url,
|
||||
}, {
|
||||
_this: this,
|
||||
loading: 'Loading'
|
||||
}, res=> {
|
||||
if (res.ok) {
|
||||
this.$message.success('修改成功')
|
||||
this.modalshowflag = false
|
||||
this.getLink()
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//表格中操作列
|
||||
handleCommand (command) {
|
||||
switch (command[1]) {
|
||||
case '删除':
|
||||
this.deleteLink(command[0])
|
||||
break
|
||||
case '编辑':
|
||||
this.editLink(command[0])
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
//表格中操作列删除操作弹窗
|
||||
deleteLink (row) {
|
||||
this.$http.delete('sarUrl/tsUrl/delete', {
|
||||
id: row.id
|
||||
}, {}, res => {
|
||||
if (res.ok) {
|
||||
this.$message.success('删除成功')
|
||||
this.getLink()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
//表格中操作列编辑操作弹窗
|
||||
editLink (row) {
|
||||
this.type = 2
|
||||
this.editId = row.id
|
||||
this.sarStandardsInfoEO.name = row.name
|
||||
this.sarStandardsInfoEO.url = row.url
|
||||
this.sarStandardsInfoEO.orderBy = row.orderBy
|
||||
this.dialogTitle = '修改链接'
|
||||
this.modalshowflag = true
|
||||
},
|
||||
|
||||
//多选框选择
|
||||
handleSelectionChange (val) {
|
||||
this.selectList = val
|
||||
},
|
||||
|
||||
// 获取链接数据
|
||||
getLink () {
|
||||
this.$http.get('sarUrl/tsUrl', {}, {
|
||||
_this: this,
|
||||
loading: 'Loading'
|
||||
}, res=> {
|
||||
this.data = res.data
|
||||
console.log(data);
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getLink();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '~@/assets/styles/mixins';
|
||||
#post-manage {
|
||||
height: 100%;
|
||||
.content {
|
||||
height: calc(~'100% - 53px')
|
||||
}
|
||||
.filter-tree {
|
||||
height: calc(~'100% - 50px')
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user