规范主键和删除appid后的问题

This commit is contained in:
xierz 2020-11-19 18:21:27 +08:00
parent 37e957123f
commit 1e6a055a29
3 changed files with 91 additions and 18 deletions

View File

@ -180,7 +180,7 @@
:readonly="false" :readonly="false"
:style="{width: '100%'}" :style="{width: '100%'}"
:clearable="true" :clearable="true"
placeholder="默认拼音根据名称生成"> placeholder="默认拼音根据名称生成,含有特殊字符请手动输入">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -325,19 +325,17 @@
categoryTitle: [{ categoryTitle: [{
"required": true, "required": true,
"message": "请选择栏目管理名称" "message": "请选择栏目管理名称"
}, {
"pattern": /^[^[!@#$%^&*()_+-/~?@#¥%…&*()——+—?》《:“‘’]+$/,
"message": "栏目管理名称格式不匹配"
}], }],
categoryListUrl: [{ categoryListUrl: [{
"required": true, "required": true,
"message": "请选择列表模板" "message": "请选择列表模板"
}], }],
categoryPinyin:[ categoryPinyin:[{
{ validator: validatorCategoryPinyin, trigger: 'blur'
validator: validatorCategoryPinyin, trigger: 'blur' }, {
} "pattern": /^[^[!@#$"'%^&*()_+-/~?@#¥%…&*()——+—?》《:“‘’]+$/,
], "message": "栏目管理名称格式不匹配"
}],
// 内容模板 // 内容模板
categoryUrl: [{ categoryUrl: [{
"required": true, "required": true,
@ -374,10 +372,40 @@
} }
} }
}); });
} },
'form.categoryTitle': function (n) {
var regu = "[[!@'\"#$%^&*()_+-/~?@#¥%…&*()——+—?》《:“‘’]";
if (this.regularCheck(regu, n)) {
this.rules.categoryPinyin = [{
"validator": this.validatorCategoryPinyin, trigger: 'blur'
},{
"required": true,
"message": "请输入栏目拼音名称"
}, {
"pattern": /^[^[!@#$"'%^&*()_+-/~?@#¥%…&*()——+—?》《:“‘’]+$/,
"message": "栏目管理名称格式不匹配"
}];
}else {
this.rules.categoryPinyin = [{
"validator": this.validatorCategoryPinyin, trigger: 'blur'
}, {
"pattern": /^[^[!@#$"'%^&*()_+-/~?@#¥%…&*()——+—?》《:“‘’]+$/,
"message": "栏目管理名称格式不匹配"
}];
}
},
}, },
computed: {}, computed: {},
methods: { methods: {
//正则校验regu 正则表达式str被校验的字段符合返回true否则false
regularCheck: function(regu, str) {
var re = new RegExp(regu);
if (re.test(str)) {
return true;
}else{
return false;
}
},
getTree: function () { getTree: function () {
var that = this; var that = this;
ms.http.get(ms.manager + "/cms/category/list.do", { ms.http.get(ms.manager + "/cms/category/list.do", {

View File

@ -31,13 +31,16 @@
{{emptyText}} {{emptyText}}
</template> </template>
<el-table-column type="selection" width="40"></el-table-column> <el-table-column type="selection" width="40"></el-table-column>
<el-table-column label="编号" width="220" prop="id"> <el-table-column label="编号" width="220" prop="id" show-overflow-tooltip>
<template slot='header'>编号 <template slot='header'>编号
<el-popover placement="top-start" title="提示" trigger="hover" > <el-popover placement="top-start" title="提示" trigger="hover" >
<a href="http://doc.mingsoft.net/plugs-cms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank">${'$'}{field.id}</a> <a href="http://doc.mingsoft.net/plugs-cms/biao-qian/lan-mu-lie-biao-ms-channel.html" target="_blank">${'$'}{field.id}</a>
<i class="el-icon-question" slot="reference"></i> <i class="el-icon-question" slot="reference"></i>
</el-popover> </el-popover>
</template> </template>
<template slot-scope="scope">
<span style="cursor: pointer" class="copyBtn" :data-clipboard-text="scope.row.id" @click="copyContent(true)">{{scope.row.id}}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column label="标题" align="left" prop="categoryTitle"> <el-table-column label="标题" align="left" prop="categoryTitle">
</el-table-column> </el-table-column>
@ -47,7 +50,7 @@
</el-table-column> </el-table-column>
<el-table-column label="链接地址" align="left" prop="categoryPath" show-overflow-tooltip> <el-table-column label="链接地址" align="left" prop="categoryPath" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<span style="cursor: pointer" class="copyBtn" :data-clipboard-text="'${'$'}{ms:global.url}'+scope.row.categoryPath+'/index.html'" @click="copyUrl">{{"{ms:global.url/}"+scope.row.categoryPath+"/index.html"}}</span> <span style="cursor: pointer" class="copyBtn" :data-clipboard-text="'${'$'}{ms:global.url}'+scope.row.categoryPath+'/index.html'" @click="copyContent">{{"{ms:global.url/}"+scope.row.categoryPath+"/index.html"}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="列表地址" align="left" prop="categoryListUrl" show-overflow-tooltip> <el-table-column label="列表地址" align="left" prop="categoryListUrl" show-overflow-tooltip>
@ -61,6 +64,11 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.categoryType == '2'?scope.row.categoryUrl:''}} {{scope.row.categoryType == '2'?scope.row.categoryUrl:''}}
</template> </template>
</el-table-column>
<el-table-column label="栏目属性" align="left" prop="categoryFlag" show-overflow-tooltip>
<template slot-scope="scope">
{{getDictLabel(scope.row.categoryFlag)}}
</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="150" align="center"> <el-table-column label="操作" width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -95,6 +103,7 @@
//加载状态 //加载状态
emptyText: '', emptyText: '',
//提示文字 //提示文字
categoryFlagOptions: [],
manager: ms.manager, manager: ms.manager,
loadState: false, loadState: false,
categoryTypeOptions: [{ categoryTypeOptions: [{
@ -134,6 +143,21 @@
} }
}, },
methods: { methods: {
//根据字典数据值获取字典标签名
getDictLabel: function (v) {
var that = this;
v = v.split(",");
var labels = [];
v.forEach(function (item) {
for (var key in that.categoryFlagOptions) {
if (item == that.categoryFlagOptions[key].dictValue) {
labels.push(that.categoryFlagOptions[key].dictLabel);
break;
}
}
});
return labels.toString();
},
//查询列表 //查询列表
list: function () { list: function () {
var that = this; var that = this;
@ -166,13 +190,17 @@
} }
}, 500); }, 500);
}, },
copyUrl: function () { copyContent: function (id) {
var msg = "链接地址已保存到剪切板";
if (id == true) {
msg = "编号已保存到剪切板";
}
var clipboard = new ClipboardJS('.copyBtn'); var clipboard = new ClipboardJS('.copyBtn');
var self = this; var self = this;
clipboard.on('success', function (e) { clipboard.on('success', function (e) {
self.$notify({ self.$notify({
title: '提示', title: '提示',
message: "链接地址已保存到剪切板", message: msg,
type: 'success' type: 'success'
}); });
clipboard.destroy(); clipboard.destroy();
@ -217,6 +245,21 @@
}); });
}); });
}, },
//获取categoryFlag数据源
categoryFlagOptionsGet: function () {
var that = this;
ms.http.get(ms.base + '/mdiy/dict/list.do', {
dictType: '栏目属性',
pageSize: 99999
}).then(function (res) {
if(res.result){
res = res.data;
that.categoryFlagOptions = res.rows;
}
}).catch(function (err) {
console.log(err);
});
},
//表格数据转换 //表格数据转换
categoryTypeFormat: function (row, column, cellValue, index) { categoryTypeFormat: function (row, column, cellValue, index) {
var value = ""; var value = "";
@ -249,6 +292,7 @@
created: function () { created: function () {
/* this.categoryListUrlOptionsGet(); /* this.categoryListUrlOptionsGet();
this.categoryUrlOptionsGet();*/ this.categoryUrlOptionsGet();*/
this.categoryFlagOptionsGet();
this.list(); this.list();
} }
}); });

View File

@ -91,6 +91,7 @@
start-placeholder="" start-placeholder=""
end-placeholder="" end-placeholder=""
:readonly="false" :readonly="false"
:disabled="false" :disabled="false"
:editable="true" :editable="true"
:clearable="true" :clearable="true"
@ -303,7 +304,9 @@
// 关键字 // 关键字
contentKeyword: '', contentKeyword: '',
// 文章内容 // 文章内容
contentDetails: '' contentDetails: '',
contentDatetime: ms.util.date.fmt(Date.now(),"yyyy-MM-dd hh:mm:ss"),
}, },
contentTypeOptions: [], contentTypeOptions: [],
categoryIdOptions: [], categoryIdOptions: [],
@ -607,6 +610,7 @@
created: function () { created: function () {
this.contentCategoryIdOptionsGet(); this.contentCategoryIdOptionsGet();
this.contentTypeOptionsGet(); this.contentTypeOptionsGet();
this.form.id = ms.util.getParameter("id"); this.form.id = ms.util.getParameter("id");
if (ms.util.getParameter("categoryId") != 'undefined' && ms.util.getParameter("categoryId") != 'null') { if (ms.util.getParameter("categoryId") != 'undefined' && ms.util.getParameter("categoryId") != 'null') {
this.form.contentCategoryId = ms.util.getParameter("categoryId"); this.form.contentCategoryId = ms.util.getParameter("categoryId");
@ -615,9 +619,6 @@
if (this.form.id) { if (this.form.id) {
this.get(this.form.id); this.get(this.form.id);
}else{
//当前时间
this.form.contentDatetime = ms.util.date.fmt(Date.now(),"yyyy-MM-dd hh:mm:ss")
} }
if (this.type) { if (this.type) {