Commit 85f331e3 authored by 赵啸非's avatar 赵啸非

修改js文件

parent 0dbaf26b
......@@ -158,7 +158,6 @@ export default {
formatterYES(row, column, val) {
const content = formatter(this.tableData, column, val);
console.log("content",content)
if (content) {
if (val == '0') {
return <el-tag type={'danger'} size='mini'>{content}</el-tag>
......@@ -197,7 +196,7 @@ export default {
formatters(row, column, val) {
if (val) {
return (
val.split(',').map(v => { return formatter(this.tableData, column, v) }).join(",")
val.split(',').map(v => formatter(this.tableData, column, v) ).join(",")
)
}
return '--'
......
......@@ -9,8 +9,11 @@
*/
const formatter = (tableData, column, val) => {
const key = column.property;
console.log(val);
val = val ? val : "--";
if(val===null||val===undefined){
val="--"
}
if (tableData.dict && tableData.dict[key]) {
const dict = tableData.dict[key];
return dict[val] || val;
......
......@@ -55,12 +55,6 @@
},
data() {
return {
/** 子表列元素 */
columnSet:[
{label: "产品名称", prop: "productName"},
{label: "问题", prop: "question"},
{label: "常见问题回答", prop: "answer"},
],
config: {
search: [
],
......@@ -70,15 +64,15 @@
{label: "产品名称", prop: "productName"},
{label: "产品分类", prop: "categoryIds",formatter: this.formatters},
{label: "产品分类", prop: "categoryId",formatter: this.formatters},
{label: "所属企业", prop: "companyIds",formatter: this.formatters},
{label: "所属企业", prop: "companyId",formatter: this.formatters},
{label: "产品介绍", prop: "productIntroduction" , width: 120},
{label: "产品介绍", prop: "productIntroduction" , width: 500},
{label: "发布时间", prop: "publishTime", formatter: this.formatterDate},
{label: "热门", prop: "hot",formatter: this.formatterYES},
{label: "热门", prop: "hot",formatter: this.formatterYES, width: 50},
{label: "最近更新时间", prop: "updateTime", formatter: this.formatterDate},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment