|
|
@ -16,13 +16,14 @@ |
|
|
|
:editParams="editParams" |
|
|
|
:editElseRules="editElseRules" |
|
|
|
:editBtnName="(item) => (!item.latitude ? '待完善' : '修改')" |
|
|
|
idName="icDangerousChemicalsId" |
|
|
|
idName="articleId" |
|
|
|
></base-page> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import basePage from "@/views/modules/cpts/base/index"; |
|
|
|
import { getItemByIdInCascader } from "@/utils/cascader"; |
|
|
|
|
|
|
|
export default { |
|
|
|
props: {}, |
|
|
@ -32,43 +33,78 @@ export default { |
|
|
|
searchParams: [ |
|
|
|
{ field: "活动标题", keyName: "name", type: "input" }, |
|
|
|
{ |
|
|
|
field: "分类", |
|
|
|
keyName: "category", |
|
|
|
field: "标签", |
|
|
|
keyName: "tagIds", |
|
|
|
type: "select", |
|
|
|
optionUrl: "/gov/org/coverage/dict-select-list/dangerous_chemicals", |
|
|
|
multiple: true, |
|
|
|
optionUrl: "/gov/voice/tag/taglist", |
|
|
|
optionUrlParams: {}, |
|
|
|
optionList: [], |
|
|
|
optionCook(list) { |
|
|
|
return list.map((item) => ({ |
|
|
|
label: item.tagName, |
|
|
|
value: item.tagId, |
|
|
|
})); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "状态", |
|
|
|
keyName: "status", |
|
|
|
keyName: "statusFlag", |
|
|
|
value: "", |
|
|
|
type: "select", |
|
|
|
optionUrl: "", |
|
|
|
optionUrlParams: {}, |
|
|
|
optionList: [ |
|
|
|
{ |
|
|
|
label: "全部", |
|
|
|
value: "0", |
|
|
|
value: "", |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已发布", |
|
|
|
value: "1", |
|
|
|
value: "published", |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已下线", |
|
|
|
value: "2", |
|
|
|
value: "offline", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "发布范围", |
|
|
|
keyName: "dangerType", |
|
|
|
type: "select", |
|
|
|
optionUrl: "/sys/dict/data/dictlist", |
|
|
|
keyName: "publishRangeIds", |
|
|
|
type: "cascader", |
|
|
|
optionUrl: "/gov/org/customeragency/agencygridtree", |
|
|
|
optionUrlParams: { |
|
|
|
dictType: "ic_danger_type", |
|
|
|
agencyId: this.$store.state.user.agencyId, |
|
|
|
}, |
|
|
|
optionList: [], |
|
|
|
optionProps: { |
|
|
|
multiple: false, |
|
|
|
value: "agencyId", |
|
|
|
label: "agencyName", |
|
|
|
children: "subAgencyList", |
|
|
|
checkStrictly: true, |
|
|
|
}, |
|
|
|
optionCook(obj) { |
|
|
|
return [obj]; |
|
|
|
}, |
|
|
|
supKeys: ["publishRangeId", "publishRangeType"], |
|
|
|
supValues: ["", ""], |
|
|
|
handleChangeFn(vals, item) { |
|
|
|
const { optionList } = item; |
|
|
|
if (vals.length > 0) { |
|
|
|
item["supValues"][0] = vals[vals.length - 1]; |
|
|
|
item["supValues"][1] = getItemByIdInCascader( |
|
|
|
optionList, |
|
|
|
vals, |
|
|
|
"agencyId", |
|
|
|
"subAgencyList" |
|
|
|
)[vals.length - 1]["level"]; |
|
|
|
} else { |
|
|
|
item["supValues"][0] = ""; |
|
|
|
item["supValues"][1] = ""; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "发布时间", |
|
|
@ -81,34 +117,43 @@ export default { |
|
|
|
|
|
|
|
tableParams: [ |
|
|
|
{ field: "序号", keyName: "", type: "no" }, |
|
|
|
{ field: "企业名称", keyName: "name", type: "text" }, |
|
|
|
{ field: "企业类别", keyName: "categoryName", type: "text" }, |
|
|
|
{ field: "周边安全间距", keyName: "safeDistanceName", type: "text" }, |
|
|
|
{ field: "危化品种类", keyName: "dangerTypeName", type: "text" }, |
|
|
|
{ field: "经营地址", keyName: "address", type: "text" }, |
|
|
|
{ field: "负责人", keyName: "principalName", type: "text" }, |
|
|
|
{ field: "联系电话", keyName: "principalMobile", type: "text" }, |
|
|
|
{ field: "备注", keyName: "remark", type: "text" }, |
|
|
|
{ field: "活动标题", keyName: "title", type: "text" }, |
|
|
|
{ |
|
|
|
field: "标签", |
|
|
|
keyName: "tagNameList", |
|
|
|
type: "array", |
|
|
|
arrayDiv: "、", |
|
|
|
}, |
|
|
|
{ field: "状态", keyName: "statusFlag", type: "text" }, |
|
|
|
{ field: "发布单位", keyName: "publisherName", type: "text" }, |
|
|
|
{ field: "发布时间", keyName: "publishDate", type: "text" }, |
|
|
|
{ |
|
|
|
field: "发布范围", |
|
|
|
keyName: "publishRangeDesc", |
|
|
|
type: "array", |
|
|
|
arrayDiv: "、", |
|
|
|
}, |
|
|
|
{ field: "置顶", keyName: "isTopName", type: "text" }, |
|
|
|
], |
|
|
|
tableUrl: "/gov/org/icDangerousChemicals/list", |
|
|
|
mubanUrl: "/gov/org/icDangerousChemicals/download", |
|
|
|
importUrl: "/gov/org/icDangerousChemicals/import", |
|
|
|
exportUrl: "/gov/org/icDangerousChemicals/export", |
|
|
|
tableUrl: "/gov/voice/article/articleListV2", |
|
|
|
mubanUrl: "", |
|
|
|
importUrl: "", |
|
|
|
exportUrl: "", |
|
|
|
|
|
|
|
addUrl: "/gov/org/icDangerousChemicals/add", |
|
|
|
editUrl: "/gov/org/icDangerousChemicals/edit", |
|
|
|
infoUrl: "/gov/org/icDangerousChemicals/detail", |
|
|
|
delUrl: "/gov/org/icDangerousChemicals/del", |
|
|
|
addUrl: "/gov/voice/article/addOrSaveDraft", |
|
|
|
editUrl: "", |
|
|
|
infoUrl: "/gov/voice/article/detailV2", |
|
|
|
delUrl: "", |
|
|
|
editAuth(item) { |
|
|
|
return item.agencyId == this.$store.state.user.agencyId; |
|
|
|
return false; |
|
|
|
}, |
|
|
|
delAuth(item) { |
|
|
|
return item.agencyId == this.$store.state.user.agencyId; |
|
|
|
return false; |
|
|
|
}, |
|
|
|
|
|
|
|
editParams: [ |
|
|
|
{ |
|
|
|
field: "企业名称", |
|
|
|
field: "文章标题", |
|
|
|
keyName: "name", |
|
|
|
type: "input", |
|
|
|
maxlength: 50, |
|
|
@ -116,82 +161,105 @@ export default { |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "企业名称不能为空", |
|
|
|
message: "文章标题不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "企业分类", |
|
|
|
field: "封面图片", |
|
|
|
keyName: "category", |
|
|
|
type: "select", |
|
|
|
optionUrl: "/gov/org/coverage/dict-select-list/dangerous_chemicals", |
|
|
|
type: "upload", |
|
|
|
limit: 1, |
|
|
|
editDisabled: true, |
|
|
|
rules: [], |
|
|
|
beforeImgUpload(file, item, that) { |
|
|
|
console.log(file); |
|
|
|
const isLt1M = file.size / 1024 / 1024 < 10; |
|
|
|
const srcType = file.type; |
|
|
|
|
|
|
|
if (!isLt1M) { |
|
|
|
that.$message.error("上传文件大小不能超过 10MB!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
if (srcType.indexOf("image") == -1) { |
|
|
|
that.$message.error("仅限图片格式"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "发布范围", |
|
|
|
keyName: "publishRangeIds", |
|
|
|
type: "cascader", |
|
|
|
optionUrl: "/gov/org/customeragency/agencygridtree", |
|
|
|
optionUrlParams: { |
|
|
|
// dictType: "ic_service_type", |
|
|
|
agencyId: this.$store.state.user.agencyId, |
|
|
|
}, |
|
|
|
optionList: [], |
|
|
|
editDisabled: true, |
|
|
|
rules: [ |
|
|
|
{ required: true, message: "企业分类不能为空", trigger: "blur" }, |
|
|
|
], |
|
|
|
optionProps: { |
|
|
|
multiple: false, |
|
|
|
value: "agencyId", |
|
|
|
label: "agencyName", |
|
|
|
children: "subAgencyList", |
|
|
|
checkStrictly: true, |
|
|
|
}, |
|
|
|
optionCook(obj) { |
|
|
|
return [obj]; |
|
|
|
}, |
|
|
|
supKeys: ["publishRangeId", "publishRangeType"], |
|
|
|
supValues: ["", ""], |
|
|
|
handleChangeFn(vals, item) { |
|
|
|
const { optionList } = item; |
|
|
|
if (vals.length > 0) { |
|
|
|
item["supValues"][0] = vals[vals.length - 1]; |
|
|
|
item["supValues"][1] = getItemByIdInCascader( |
|
|
|
optionList, |
|
|
|
vals, |
|
|
|
"agencyId", |
|
|
|
"subAgencyList" |
|
|
|
)[vals.length - 1]["level"]; |
|
|
|
} else { |
|
|
|
item["supValues"][0] = ""; |
|
|
|
item["supValues"][1] = ""; |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "周边安全间距", |
|
|
|
keyName: "safeDistance", |
|
|
|
type: "number", |
|
|
|
precision: 2, |
|
|
|
step: 0.01, |
|
|
|
min: 0, |
|
|
|
max: 1000000000, |
|
|
|
unitName: "公里", |
|
|
|
field: "发布时间", |
|
|
|
keyName: "principalName", |
|
|
|
type: "date", |
|
|
|
maxlength: 50, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "危化品种类", |
|
|
|
keyName: "dangerType", |
|
|
|
field: "文章标签", |
|
|
|
keyName: "tagIds", |
|
|
|
type: "select", |
|
|
|
optionUrl: "/sys/dict/data/dictlist", |
|
|
|
optionUrlParams: { |
|
|
|
dictType: "ic_danger_type", |
|
|
|
}, |
|
|
|
multiple: true, |
|
|
|
optionUrl: "/gov/voice/tag/taglist", |
|
|
|
optionUrlParams: {}, |
|
|
|
optionList: [], |
|
|
|
editDisabled: true, |
|
|
|
optionCook(list) { |
|
|
|
return list.map((item) => ({ |
|
|
|
label: item.tagName, |
|
|
|
value: item.tagId, |
|
|
|
})); |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "负责人", |
|
|
|
keyName: "principalName", |
|
|
|
type: "input", |
|
|
|
maxlength: 50, |
|
|
|
field: "内容", |
|
|
|
keyName: "content", |
|
|
|
type: "rich-text", |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "联系电话", |
|
|
|
field: "置顶", |
|
|
|
keyName: "principalMobile", |
|
|
|
type: "input", |
|
|
|
maxlength: 50, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: "经营地址", |
|
|
|
keyName: "address", |
|
|
|
type: "address", |
|
|
|
maxlength: 50, |
|
|
|
supKeys: ["longitude", "latitude"], |
|
|
|
supValues: ["", ""], |
|
|
|
rules: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: "经营地址坐标不能为空", |
|
|
|
trigger: "blur", |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ field: "备注", keyName: "remark", type: "textarea" }, |
|
|
|
], |
|
|
|
editElseRules: { |
|
|
|
longitude: { |
|
|
|
type: "number", |
|
|
|
required: true, |
|
|
|
message: "请拖动地图选择坐标点", |
|
|
|
}, |
|
|
|
}, |
|
|
|
editElseRules: {}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
components: { basePage }, |
|
|
|