Commit 146db3e9 authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 8f87ce01 f28c5af8
<template> <template>
<div> <div>
<Input v-model="newName" placeholder="请选择上传文件"> <Input v-model="newName" placeholder="请选择上传文件" v-if="inputShow">
<Button v-if="view" icon="ios-eye" slot="prepend" @click="downFile(newName)"> </Button> <Button
<Button type="primary" icon="ios-cloud-upload-outline" slot="append" @click="handler">上传</Button> v-if="view"
icon="ios-eye"
slot="prepend"
@click="downFile(newName)"
>
</Button>
<Button
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
</Input> </Input>
<Button
v-else
type="primary"
icon="ios-cloud-upload-outline"
slot="append"
@click="handler"
>上传</Button
>
<Upload <Upload
v-model="name" v-model="name"
:action="postUrl" :action="postUrl"
...@@ -18,8 +38,9 @@ ...@@ -18,8 +38,9 @@
:files="files" :files="files"
:on-progress="onProgress" :on-progress="onProgress"
> >
<Button v-show="1==2" type="primary" ref="upload">上传</Button> <Button v-show="1 == 2" type="primary" ref="upload">上传</Button>
</Upload> </Upload>
<Progress :percent="per" :stroke-width="5" v-show="vshowPro" /> <Progress :percent="per" :stroke-width="5" v-show="vshowPro" />
</div> </div>
</template> </template>
...@@ -29,10 +50,11 @@ export default { ...@@ -29,10 +50,11 @@ export default {
name: "inputFile", name: "inputFile",
model: { model: {
prop: "value", prop: "value",
event: "on-change" event: "on-change",
}, },
data() { data() {
return { return {
inputShow: true,
file: null, file: null,
name: this.value, name: this.value,
downUrl: fileUrlDown, downUrl: fileUrlDown,
...@@ -48,7 +70,7 @@ export default { ...@@ -48,7 +70,7 @@ export default {
newName: "", newName: "",
newPath: "", newPath: "",
per: 0, per: 0,
vshowPro: false vshowPro: false,
}; };
}, },
created() {}, created() {},
...@@ -56,20 +78,20 @@ export default { ...@@ -56,20 +78,20 @@ export default {
value: [String, Number, Array, Object], value: [String, Number, Array, Object],
maxSize: { maxSize: {
type: Number, type: Number,
default: 10240 default: 10240,
}, },
files: { files: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
parms: { parms: {
type: String, type: String,
default: "" default: "",
}, },
showButton: { showButton: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
methods: { methods: {
onProgress(event, file, fileList) { onProgress(event, file, fileList) {
...@@ -138,7 +160,7 @@ export default { ...@@ -138,7 +160,7 @@ export default {
"jpg", "jpg",
"gif", "gif",
"zip", "zip",
"rar" "rar",
]; ];
} }
return this.formatList; return this.formatList;
...@@ -156,7 +178,7 @@ export default { ...@@ -156,7 +178,7 @@ export default {
window.open(this.fileUrlPath, "_blank"); window.open(this.fileUrlPath, "_blank");
} }
} }
} },
}, },
mounted() { mounted() {
this.formatL(); this.formatL();
...@@ -165,15 +187,15 @@ export default { ...@@ -165,15 +187,15 @@ export default {
nativeInputValue() { nativeInputValue() {
return this.value === null || this.value === undefined ? "" : this.value; return this.value === null || this.value === undefined ? "" : this.value;
}, },
view(){ view() {
return true return true;
} },
}, },
watch: { watch: {
value(v) { value(v) {
this.name = v; this.name = v;
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -1773,6 +1773,7 @@ export default { ...@@ -1773,6 +1773,7 @@ export default {
miji:"密级", miji:"密级",
status:'状态', status:'状态',
filePath:'上传文件', filePath:'上传文件',
img:'上传图片',
field:'字段', field:'字段',
dataType:'数据类型', dataType:'数据类型',
dataLength:'数据长度', dataLength:'数据长度',
......
...@@ -144,6 +144,7 @@ export default { ...@@ -144,6 +144,7 @@ export default {
if (this.eid > 0) { if (this.eid > 0) {
this.load(this.eid); this.load(this.eid);
} }
this.parms.eid = this.$u.guid();
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -192,6 +193,13 @@ export default { ...@@ -192,6 +193,13 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.productUrlList = this.parms.eid;
} else {
this.entity.productUrl = "";
this.entity.productUrlList = "";
}
Api.update(this.entity) Api.update(this.entity)
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
......
...@@ -437,7 +437,7 @@ export default { ...@@ -437,7 +437,7 @@ export default {
.product-m { .product-m {
.body-card { .body-card {
border: 1px solid rgba(38, 128, 235, 1); border: 1px solid rgba(38, 128, 235, 1);
margin: 10px; margin: 8px 0;
border-radius: 4px; border-radius: 4px;
.title-i { .title-i {
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
</Col>--> </Col>-->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary> <Dictionary
code="word_classification_type"
v-model="entity.type"
></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> --> <!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem> </FormItem>
</Col> </Col>
...@@ -29,12 +32,19 @@ ...@@ -29,12 +32,19 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary> <Dictionary
code="word_classification_status"
v-model="entity.status"
></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> --> <!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if="row.id"> <FormItem
:label="l('inheritCategoryId')"
prop="inheritCategoryId"
v-if="row.id"
>
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> --> <!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit"> <RadioGroup v-model="inherit">
<Radio label="1"></Radio> <Radio label="1"></Radio>
...@@ -59,34 +69,41 @@ ...@@ -59,34 +69,41 @@
<Input v-model="entity.templateId"></Input> <Input v-model="entity.templateId"></Input>
</FormItem> </FormItem>
</Col>--> </Col>-->
<Col :span="24"> <Col :span="24" v-if="inherit==0">
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border> <Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <div v-if="row.fieldType == 1 || row.fieldType == 2">
{{ row.title }}
</div>
<Input <Input
v-model="row.title" v-model="row.title"
placeholder="请输入名称" placeholder="请输入名称"
@on-blur="setRow(row,index)" @on-blur="setRow(row, index)"
v-if="row.fieldType==3" v-if="row.fieldType == 3"
/> />
</template> </template>
<template slot-scope="{ row, index }" slot="note"> <template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> --> <!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select <Select
v-if="row.dataType==3" v-if="row.dataType == 3"
v-model="row.note" v-model="row.note"
clearable clearable
transfer transfer
@on-change="setRow(row,index)" @on-change="setRow(row, index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option
> >
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select> </Select>
<span v-else>{{row.note}}</span> <span v-else>{{ row.note }}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="dataType"> <template slot-scope="{ row, index }" slot="dataType">
<Dictionary <Dictionary
@on-change="setRow(row,index)" @on-change="setRow(row, index)"
v-model="row.dataType" v-model="row.dataType"
code="materail.category.dataType" code="materail.category.dataType"
type="select" type="select"
...@@ -96,8 +113,8 @@ ...@@ -96,8 +113,8 @@
</template> </template>
<template slot-scope="{ row, index }" slot="unitName"> <template slot-scope="{ row, index }" slot="unitName">
<Dictionary <Dictionary
v-if="row.dataType==1||row.dataType==2" v-if="row.dataType == 1 || row.dataType == 2"
@on-change="setRow(row,index)" @on-change="setRow(row, index)"
v-model="row.unitName" v-model="row.unitName"
code="material.main.unitName" code="material.main.unitName"
type="select" type="select"
...@@ -107,17 +124,30 @@ ...@@ -107,17 +124,30 @@
></Dictionary> ></Dictionary>
</template> </template>
<template slot-scope="{ row, index }" slot="required"> <template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox> <Checkbox
v-model="row.required"
@on-change="setRow(row, index)"
></Checkbox>
</template> </template>
<template slot-scope="{ row, index }" slot="isUnique"> <template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox> <Checkbox
v-model="row.isUnique"
@on-change="setRow(row, index)"
></Checkbox>
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a> <a
@click="remove(index, row)"
style="color: #ff7a8b"
v-if="row.fieldType > 1"
>删除</a
>
</template> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> <Button type="dashed" long @click="addNew" class="mt10"
>新增属性</Button
>
</Col> </Col>
<Col :span="24" class="tr mt10"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
...@@ -181,6 +211,19 @@ export default { ...@@ -181,6 +211,19 @@ export default {
action: 1, action: 1,
add: 0, //新增标识 add: 0, //新增标识
}, },
{
field: "secret",
title: "密级",
note: "",
dataType: 3,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{ {
field: "name", field: "name",
title: "标题", title: "标题",
...@@ -198,7 +241,7 @@ export default { ...@@ -198,7 +241,7 @@ export default {
field: "description", field: "description",
title: "文档详细说明", title: "文档详细说明",
note: "", note: "",
dataType: 0, dataType: 8,
unitName: "", unitName: "",
required: true, required: true,
isunique: false, isunique: false,
......
...@@ -14,7 +14,10 @@ ...@@ -14,7 +14,10 @@
</Col>--> </Col>-->
<Col :span="12"> <Col :span="12">
<FormItem :label="l('type')" prop="type"> <FormItem :label="l('type')" prop="type">
<Dictionary code="word_classification_type" v-model="entity.type"></Dictionary> <Dictionary
code="word_classification_type"
v-model="entity.type"
></Dictionary>
<!-- <InputNumber v-model="entity.type"></InputNumber> --> <!-- <InputNumber v-model="entity.type"></InputNumber> -->
</FormItem> </FormItem>
</Col> </Col>
...@@ -30,12 +33,19 @@ ...@@ -30,12 +33,19 @@
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('status')" prop="status"> <FormItem :label="l('status')" prop="status">
<Dictionary code="word_classification_status" v-model="entity.status"></Dictionary> <Dictionary
code="word_classification_status"
v-model="entity.status"
></Dictionary>
<!-- <InputNumber v-model="entity.status"></InputNumber> --> <!-- <InputNumber v-model="entity.status"></InputNumber> -->
</FormItem> </FormItem>
</Col> </Col>
<Col :span="12"> <Col :span="12">
<FormItem :label="l('inheritCategoryId')" prop="inheritCategoryId" v-if='entity.upId!=0'> <FormItem
:label="l('inheritCategoryId')"
prop="inheritCategoryId"
v-if="entity.upId != 0"
>
<!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> --> <!-- <Checkbox v-model="entity.inheritCategoryId"></Checkbox> -->
<RadioGroup v-model="inherit"> <RadioGroup v-model="inherit">
<Radio label="1"></Radio> <Radio label="1"></Radio>
...@@ -60,34 +70,41 @@ ...@@ -60,34 +70,41 @@
<Input v-model="entity.templateId"></Input> <Input v-model="entity.templateId"></Input>
</FormItem> </FormItem>
</Col>--> </Col>-->
<Col :span="24"> <Col :span="24" v-if="inherit==0">
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
<Table :columns="columns" :data="checkList" border> <Table :columns="columns" :data="checkList" border>
<template slot-scope="{ row, index }" slot="title"> <template slot-scope="{ row, index }" slot="title">
<div v-if="row.fieldType==1||row.fieldType==2">{{row.title}}</div> <div v-if="row.fieldType == 1 || row.fieldType == 2">
{{ row.title }}
</div>
<Input <Input
v-model="row.title" v-model="row.title"
placeholder="请输入名称" placeholder="请输入名称"
@on-blur="setRow(row,index)" @on-blur="setRow(row, index)"
v-if="row.fieldType==3" v-if="row.fieldType == 3"
/> />
</template> </template>
<template slot-scope="{ row, index }" slot="note"> <template slot-scope="{ row, index }" slot="note">
<!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> --> <!-- <Input v-if="row.dataType==3" v-model="row.note" placeholder="请输入字典编码" @on-blur="setRow(row,index)" /> -->
<Select <Select
v-if="row.dataType==3" v-if="row.dataType == 3"
v-model="row.note" v-model="row.note"
clearable clearable
transfer transfer
@on-change="setRow(row,index)" @on-change="setRow(row, index)"
>
<Option
v-for="item in codeList"
:value="item.code"
:key="item.code"
>{{ item.name }}</Option
> >
<Option v-for="item in codeList" :value="item.code" :key="item.code">{{ item.name }}</Option>
</Select> </Select>
<span v-else>{{row.note}}</span> <span v-else>{{ row.note }}</span>
</template> </template>
<template slot-scope="{ row, index }" slot="dataType"> <template slot-scope="{ row, index }" slot="dataType">
<Dictionary <Dictionary
@on-change="setRow(row,index)" @on-change="setRow(row, index)"
v-model="row.dataType" v-model="row.dataType"
code="materail.category.dataType" code="materail.category.dataType"
type="select" type="select"
...@@ -97,8 +114,8 @@ ...@@ -97,8 +114,8 @@
</template> </template>
<template slot-scope="{ row, index }" slot="unitName"> <template slot-scope="{ row, index }" slot="unitName">
<Dictionary <Dictionary
v-if="row.dataType==1||row.dataType==2" v-if="row.dataType == 1 || row.dataType == 2"
@on-change="setRow(row,index)" @on-change="setRow(row, index)"
v-model="row.unitName" v-model="row.unitName"
code="material.main.unitName" code="material.main.unitName"
type="select" type="select"
...@@ -108,17 +125,30 @@ ...@@ -108,17 +125,30 @@
></Dictionary> ></Dictionary>
</template> </template>
<template slot-scope="{ row, index }" slot="required"> <template slot-scope="{ row, index }" slot="required">
<Checkbox v-model="row.required" @on-change="setRow(row,index)"></Checkbox> <Checkbox
v-model="row.required"
@on-change="setRow(row, index)"
></Checkbox>
</template> </template>
<template slot-scope="{ row, index }" slot="isUnique"> <template slot-scope="{ row, index }" slot="isUnique">
<Checkbox v-model="row.isUnique" @on-change="setRow(row,index)"></Checkbox> <Checkbox
v-model="row.isUnique"
@on-change="setRow(row, index)"
></Checkbox>
</template> </template>
<template slot-scope="{ row, index }" slot="action"> <template slot-scope="{ row, index }" slot="action">
<a @click="remove(index,row)" style="color:#FF7A8B" v-if="row.fieldType>1">删除</a> <a
@click="remove(index, row)"
style="color: #ff7a8b"
v-if="row.fieldType > 1"
>删除</a
>
</template> </template>
</Table> </Table>
<Button type="dashed" long @click="addNew" class="mt10">新增属性</Button> <Button type="dashed" long @click="addNew" class="mt10"
>新增属性</Button
>
</Col> </Col>
<Col :span="24" class="tr mt10"> <Col :span="24" class="tr mt10">
<FormItem> <FormItem>
...@@ -168,6 +198,19 @@ export default { ...@@ -168,6 +198,19 @@ export default {
action: 1, action: 1,
add: 0, //新增标识 add: 0, //新增标识
}, },
{
field: "secret",
title: "密级",
note: "",
dataType: 3,
unitName: "",
required: true,
isunique: false,
fieldType: 1,
categoryId: 0,
action: 1,
add: 0, //新增标识
},
{ {
field: "name", field: "name",
title: "标题", title: "标题",
...@@ -185,7 +228,7 @@ export default { ...@@ -185,7 +228,7 @@ export default {
field: "description", field: "description",
title: "文档详细说明", title: "文档详细说明",
note: "", note: "",
dataType: 0, dataType: 8,
unitName: "", unitName: "",
required: true, required: true,
isunique: false, isunique: false,
......
<template> <template>
<div> <div>
<div class="mb10 pt5"> <div class="mb10 pt5">
<Input v-model.trim="searchValue" placeholder="请输入库位名称" clearable style="width: 240px" /> <Input
v-model.trim="searchValue"
placeholder="请输入库位名称"
clearable
style="width: 240px"
/>
<Button type="primary" class @click="handleSearch">查询</Button> <Button type="primary" class @click="handleSearch">查询</Button>
<div class="fr"> <div class="fr">
<Button type="primary" @click="add()">新增分类</Button> <Button type="primary" @click="add()">新增分类</Button>
...@@ -10,7 +15,13 @@ ...@@ -10,7 +15,13 @@
<TreeGrid :columns="columns" :items="treeData"></TreeGrid> <TreeGrid :columns="columns" :items="treeData"></TreeGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal v-model="modal" :title="title" width="1200" footer-hide>
<component :is="detail" :eid="curId" @on-close="cancel" @on-ok="ok" :row="row" /> <component
:is="detail"
:eid="curId"
@on-close="cancel"
@on-ok="ok"
:row="row"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -53,34 +64,21 @@ export default { ...@@ -53,34 +64,21 @@ export default {
easy: true, easy: true,
high: true, high: true,
}, },
{
key: "creationTime",
title: this.l("creationTime"),
width: 180,
align: "center",
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "center",
render: (h, params) => {
if (params.row.creatorUserId) {
return h("User", {
props: {
value: params.row.creatorUserId,
},
});
}
},
},
{ key: "level", title: this.l("level"), align: "center", high: true }, // {
{ // key: "level",
key: "totalDocument", // title: this.l("level"),
title: this.l("totalDocument"), // align: "center",
align: "center", // high: true,
width: 160, // hide: true,
}, // },
// {
// key: "totalDocument",
// title: this.l("totalDocument"),
// align: "center",
// width: 160,
// hide: true,
// },
// { // {
// key: "tenantId", // key: "tenantId",
// title: this.l("tenantId"), // title: this.l("tenantId"),
...@@ -101,6 +99,7 @@ export default { ...@@ -101,6 +99,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
width: 300,
}, },
{ {
key: "englishName", key: "englishName",
...@@ -116,21 +115,44 @@ export default { ...@@ -116,21 +115,44 @@ export default {
high: true, high: true,
code: "word_classification_status", code: "word_classification_status",
}, },
// {
// key: "inheritCategoryId",
// title: this.l("inheritCategoryId"),
// align: "center",
// high: true,
// hide: true,
// render: (h, params) => {
// return h("div", [
// h("span", params.row.inheritCategoryId == 0 ? "否" : "是"),
// ]);
// },
// },
{ {
key: "inheritCategoryId", key: "description",
title: this.l("inheritCategoryId"), title: this.l("description"),
align: "left",
width: 200,
},
{
key: "creatorUserId",
title: this.l("creatorUserId"),
align: "center", align: "center",
high: true,
render: (h, params) => { render: (h, params) => {
return h("div", [ if (params.row.creatorUserId) {
h("span", params.row.inheritCategoryId == 0 ? "否" : "是"), return h("User", {
]); props: {
value: params.row.creatorUserId,
},
});
}
}, },
}, },
{ {
key: "description", key: "creationTime",
title: this.l("description"), title: this.l("creationTime"),
align: "left", width: 200,
align: "center",
}, },
{ {
title: "操作", title: "操作",
...@@ -225,7 +247,7 @@ export default { ...@@ -225,7 +247,7 @@ export default {
}, },
add() { add() {
this.curId = 0; this.curId = 0;
this.row.id = ''; this.row.id = "";
this.title = "新增"; this.title = "新增";
this.detail = () => import("./add"); this.detail = () => import("./add");
this.modal = true; this.modal = true;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -12,7 +12,11 @@ ...@@ -12,7 +12,11 @@
@click="toggle" @click="toggle"
title="展开/合并" title="展开/合并"
></Button> ></Button>
<Button icon="md-refresh" title="刷新" @click="loadTree()"></Button> <Button
icon="md-refresh"
title="刷新"
@click="loadTree()"
></Button>
<Button icon="md-rewind" title="收起" @click="hide"></Button> <Button icon="md-rewind" title="收起" @click="hide"></Button>
</ButtonGroup> </ButtonGroup>
</div> </div>
...@@ -22,7 +26,12 @@ ...@@ -22,7 +26,12 @@
</div> </div>
<div class="fg"> <div class="fg">
<div class="tree"> <div class="tree">
<Tree :data="data" ref="tree" @on-select-change="change" :render="renderContent"></Tree> <Tree
:data="data"
ref="tree"
@on-select-change="change"
:render="renderContent"
></Tree>
</div> </div>
</div> </div>
</div> </div>
...@@ -32,8 +41,8 @@ ...@@ -32,8 +41,8 @@
<Icon type="ios-arrow-forward" size="24" /> <Icon type="ios-arrow-forward" size="24" />
</a> </a>
</div> </div>
<Content :class="!showMenu?'con_bord':''"> <Content :class="!showMenu ? 'con_bord' : ''">
<Word ref="dataTable" :treeId='treeId'/> <Word ref="dataTable" :treeId="treeId" :addShow="addShow" :ids="ids" />
</Content> </Content>
</Layout> </Layout>
</div> </div>
...@@ -58,7 +67,9 @@ export default { ...@@ -58,7 +67,9 @@ export default {
model8: "", model8: "",
keys: "", keys: "",
expand: false, expand: false,
treeId:0, treeId: 0,
addShow: false,
ids: [],
}; };
}, },
mounted() { mounted() {
...@@ -131,13 +142,28 @@ export default { ...@@ -131,13 +142,28 @@ export default {
change(a, b) { change(a, b) {
// console.log(a) // console.log(a)
console.log(b); console.log(b);
if (b.children.length == 0) {
this.treeId = b.id; this.treeId = b.id;
this.$refs.dataTable.$refs.grid.reload(this.easySearch); // if (b.children.length == 0) { //判断最底层才能添加文档
} else { // this.addShow = true;
this.treeId = 0; // this.$refs.dataTable.$refs.grid.reload(this.easySearch);
// } else {
// this.addShow = false;
// }
let ids = [];
ids.push(b.value);
if (b.children) {
addId(b.children);
function addId(data) {
data.map((u) => {
ids.push(u.value);
if (u.children) {
addId(u.children);
}
});
}
} }
alert(this.treeId ) // console.log(ids)
this.ids = ids;
}, },
renderContent(h, { root, node, data }) { renderContent(h, { root, node, data }) {
return h( return h(
......
<template>
<div class=".detail-document">
<div class="body-document">
<h4>详细信息</h4>
<Row>
<Col span="20">
<div class="new-detail detail-d">
<Row>
<Filed v-for="li in fileds" :key="li.field" :span="li.span" :name="li.title+':'">
<State v-if="li.dataType==3" :code="li.note" :value="entity[li.field]" />
<div v-else-if="li.dataType==8">{{entity[li.field]}}</div>
<div v-else-if="li.dataType==5" v-html="entity[li.field]"></div>
<DTSpan v-else-if="li.dataType==4" :value="entity[li.field]" />
<span v-else>{{entity[li.field]}}</span>
<State
v-if="li.unitName&&(li.dataType==1||li.dataType==2)"
:code="li.note"
:value="entity[li.field]"
/>
</Filed>
</Row>
<Row class="filed-d">
<Filed :span="12" :name="l('creationTime')+':'">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')+':'">
<User :value="entity.creatorUserId" />
</Filed>
<Filed :span="12" :name="l('status')+':'">{{entity.status==0?'草稿':'送审'}}</Filed>
<Filed :span="24" :name="l('filePath')+':'">
<files ref="refFile" :parms="parms" :showList="false" />
</Filed>
</Row>
</div>
</Col>
<Col span="4" class="dcm-right">
<div class="img-touxiang">
<img :src="downUrl+avatorPath" v-if="avatorPath" />
<img src="@/assets/images/files_header.png" v-else width="100%" height="100%" />
</div>
</Col>
</Row>
</div>
</div>
</template>
<script>
import Api from "./api";
export default {
name: "Add",
data() {
return {
avatorPath: "",
downUrl: fileUrlDown,
entity: {},
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
},
fileds: [],
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: ["eid", "treeId"],
mounted() {
this.initFiled();
this.parms.eid = this.$u.guid();
},
methods: {
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.parms.eid = r.result.filePath;
this.avatorPath = r.result.img;
this.$emit("on-load");
});
},
initFiled() {
Api.listbyid({
categoryId: this.treeId,
}).then((r) => {
if (r.result) {
let result = [];
result = r.result.definie.concat(r.result.inherit);
console.log(result);
this.fileds = result.filter(function (item) {
item.span = 6;
if (item.dataType > 4) {
item.span = 24;
}
delete item["id"];
// return item.fieldType != 1;
return item;
});
this.fileds.map((u) => {
let v = "";
if (u.dataType == 1 || u.dataType == 2) {
v = 0;
}
this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
}
if (this.eid) {
this.load(this.eid);
}
});
},
handleClose() {
this.$emit("on-close");
},
l(key) {
key = "document_property_definition" + "." + key;
return this.$t(key);
},
},
watch: {
eid(v) {
if (v > 0) {
this.load(v);
}
},
},
};
</script>
<style lang="less">
.top-title {
// margin: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
position: relative;
border-radius: 5px;
}
.body-document {
margin-top: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
h4 {
height: 50px;
line-height: 50px;
background: #515a6e;
padding: 0 10px;
color: #f5f6fa;
border-radius: 5px 5px 0 0;
}
.img-touxiang {
width: 230px;
height: 230px;
float: right;
margin-top: 10px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
}
.detail-d {
padding-left: 20px;
.filed-d {
border-top: 1px solid #e0e0e0;
}
}
}
.detail-document {
background-color: #f5f7f9 !important;
}
</style>
\ No newline at end of file
This diff is collapsed.
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