提交 82704c5c 编写于 作者: huangwensu's avatar huangwensu

组件基础信息接口联调

上级 91340a9a
......@@ -352,7 +352,7 @@ export const getFilePath = (file,fileName,folder) => {
//文件全路径(文件路径 + 文件名) 扩展名​/年/月/日/
// var filePath = ext + "/" + date.format('yyyy/MM/dd') + "/" + (isEmptyUtils(folder) ? "" : (folder + "/")) + fileName;
//var filePath = ext + "/" + "common/" + file.name.split('.')[0] + '-' + timeStamp(date) + "." + suffix;
var filePath = ext + "/" + "common/" + timeStamp(date) + "." + suffix;
var filePath = ext + "/" + "protal/project/" + timeStamp(date) + "." + suffix;
console.log('filePath==============',filePath);
return filePath;
......
......@@ -31,9 +31,9 @@ export function isvalidUsername(str) {
return reg.test(str)
}
// 2-20个中文
export function validateWord(str) {
const reg = /^[\u4e00-\u9fa5]{2,20}$/
// 2-150个中文
export function validateWord150(str) {
const reg = /^[\u4e00-\u9fa5]{2,150}$/
return reg.test(str)
}
/* 通用密码验证(数字、字母、下划线或特殊字符且长度为0-150位) */
......
......@@ -26,8 +26,8 @@
</el-form-item>
</el-col>
<el-col :span="13" style="padding:0;text-align:right;padding-right:15px;">
<el-button type="primary" size="small">查询</el-button>
<el-button type="default" size="small" style="margin-left:0;">重置</el-button>
<el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="default" size="small" @click="reseat" style="margin-left:0;">重置</el-button>
</el-col>
</el-form>
</el-row>
......@@ -45,10 +45,10 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" min-width="200">
<template slot-scope="scope">
<el-button type="primary" size="small" @click="editComponentList(scope.row)">编辑</el-button>
<el-button type="primary" size="small" @click="enable(scope.row)">启用</el-button>
<el-button type="primary" size="small">禁用</el-button>
<el-button type="primary" size="small">删除</el-button>
<el-button type="primary" v-if="scope.row.status == 1 ||scope.row.status == 2" size="small" @click="editComponentList(scope.row)">编辑</el-button>
<el-button type="primary" v-if="scope.row.status == 1 ||scope.row.status == 2" size="small" @click="enableAndDisable(scope.row,1)">启用</el-button>
<el-button type="primary" v-if="scope.row.status == 3" size="small" @click="enableAndDisable(scope.row,2)">禁用</el-button>
<el-button type="primary" v-if="scope.row.status == 1 ||scope.row.status == 2" size="small" @click="deleteComponent(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -87,7 +87,21 @@ export default {
pageNo: 1,
pageSize: 15
},
statuSelect: [],
statuSelect: [
{
label: '草稿',
value: '1'
},{
label: '未启用',
value: '2'
},{
label: '已启用',
value: '3'
},{
label: '已禁用',
value: '4'
}
],
tableData: [],
totalRows: 0,
basicRule: {
......@@ -120,19 +134,85 @@ export default {
}
})
},
// 重置
reseat() {
vm.searchParam = Object.assign({},{
name: '',
status: '',
pageNo: 1,
pageSize: 15
})
vm.search()
},
// 新建组件
createComponent() {
vm.$router.push({path: 'create-component'})
},
// 编辑
editComponentList(row) {
vm.$router.push({path: 'create-component',query: {id:row.id,status: row.status}})
},
handleSizeChange() {
// 启用(禁用)
enableAndDisable(row,flag) {
let req = null
let text = ''
if(flag == 1) { // 启用
req = {
id: row.id,
status: 3
}
text = '组件一经启用,将无法进行修改,确定启用吗?'
}else if(flag == 2) { // 禁用
req = {
id: row.id,
status: 4
}
text = '确定禁用吗?'
}
vm.$confirm(text, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
vm.GET('portalComponent/disableOrStart',req).then((res) => {
if(res.code == "000000") {
vm.$message({
type: 'success',
message: '操作成功!'
});
vm.search()
}
}).catch(function (error) {
vm.$message.error(error);
});
}).catch(() => {
vm.$message({
type: 'info',
message: '已取消'
});
});
},
handleCurrentChange() {
// 删除
deleteComponent(row) {
vm.GET('portalComponent/deleteComponentById',{id: row.id}).then((res) => {
if(res.code == "000000") {
vm.$message({
type: 'success',
message: '删除成功!'
});
vm.search()
}
}).catch(function (error) {
vm.$message.error(error);
});
},
handleSizeChange(value) {
vm.searchParam.pageSize = value
vm.search()
},
handleCurrentChange(value) {
vm.searchParam.pageNo = value
vm.search()
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册