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: "description",
title: this.l("description"),
align: "left",
width: 200,
},
{ {
key: "inheritCategoryId", key: "creatorUserId",
title: this.l("inheritCategoryId"), 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;
......
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="120"> <div>
<Row> <Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Col v-for="li in fileds" :key="li.field" :span="li.span"> <Row>
<FormItem :label="li.title" :prop="li.name"> <Col span="18">
<Input v-if="li.dataType==0" v-model="entity[li.field]" :disabled="li.field=='code'"></Input> <Row>
<InputNumber <Col v-for="li in fileds" :key="li.field" :span="li.span">
v-if="li.dataType==1||li.dataType==2" <FormItem :label="li.title" :prop="li.name">
v-model="entity[li.field]" <Input
class="w100" v-if="li.dataType == 0"
></InputNumber> v-model="entity[li.field]"
<Dictionary v-if="li.dataType==3" v-model="entity[li.field]" :code="li.note"></Dictionary> :disabled="li.field == 'code'"
<Input v-if="li.dataType==5" type="textarea" v-model="entity[li.filed]"></Input> :placeholder="
<DatePicker li.field == 'code' ? '保存后编号将自动生成' : ''
v-if="li.dataType==4" "
v-model="entity[li.field]" ></Input>
type="date" <InputNumber
:placeholder="'选择'+li.title" v-if="li.dataType == 1 || li.dataType == 2"
></DatePicker> v-model="entity[li.field]"
<InputFile v-if="li.dataType==6" v-model="entity[li.field]"></InputFile> class="w100"
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> --> ></InputNumber>
<InputFile v-if="li.dataType==7" v-model="entity[li.field]"></InputFile> <Dictionary
<Input v-if="li.dataType==8" type="textarea" v-model="entity[li.field]"></Input> v-if="li.dataType == 3"
<state v-model="entity[li.field]"
v-if="li.unitName&&(li.dataType==1||li.dataType==2)" :code="li.note"
:value="li.unitName" ></Dictionary>
code="material.main.unitName" <Input
type="tag" v-if="li.dataType == 5"
></state> type="textarea"
</FormItem> v-model="entity[li.filed]"
</Col> ></Input>
</Row> <DatePicker
<!-- <div> v-if="li.dataType == 4"
v-model="entity[li.field]"
type="date"
:placeholder="'选择' + li.title"
></DatePicker>
<InputFile
v-if="li.dataType == 6"
v-model="entity[li.field]"
></InputFile>
<!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
<InputFile
v-if="li.dataType == 7"
v-model="entity[li.field]"
></InputFile>
<Input
v-if="li.dataType == 8"
type="textarea"
v-model="entity[li.field]"
></Input>
<state
v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
</Row>
<!-- <div>
<Divider orientation="left">扩展属性</Divider> <Divider orientation="left">扩展属性</Divider>
</div>--> </div>-->
<Row> <Row>
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('title')" prop="title"> <FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input> <Input v-model="entity.title"></Input>
</FormItem> </FormItem>
</Col>--> </Col>-->
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('field')" prop="field"> <FormItem :label="l('field')" prop="field">
<Input v-model="entity.field"></Input> <Input v-model="entity.field"></Input>
</FormItem> </FormItem>
...@@ -48,8 +76,8 @@ ...@@ -48,8 +76,8 @@
<FormItem :label="l('dataType')" prop="dataType"> <FormItem :label="l('dataType')" prop="dataType">
<InputNumber v-model="entity.dataType"></InputNumber> <InputNumber v-model="entity.dataType"></InputNumber>
</FormItem> </FormItem>
</Col>--> </Col>-->
<!-- <Col :span="12"> <!-- <Col :span="12">
<FormItem :label="l('dataLength')" prop="dataLength"> <FormItem :label="l('dataLength')" prop="dataLength">
<InputNumber v-model="entity.dataLength"></InputNumber> <InputNumber v-model="entity.dataLength"></InputNumber>
</FormItem> </FormItem>
...@@ -58,15 +86,9 @@ ...@@ -58,15 +86,9 @@
<FormItem :label="l('dictionaryId')" prop="dictionaryId"> <FormItem :label="l('dictionaryId')" prop="dictionaryId">
<InputNumber v-model="entity.dictionaryId"></InputNumber> <InputNumber v-model="entity.dictionaryId"></InputNumber>
</FormItem> </FormItem>
</Col>--> </Col>-->
<Col :span="24"> <!-- <Col :span="12">
<FormItem :label="l('filePath')" prop="filePath">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<!-- <Col :span="12">
<FormItem :label="l('unitName')" prop="unitName"> <FormItem :label="l('unitName')" prop="unitName">
<Input v-model="entity.unitName"></Input> <Input v-model="entity.unitName"></Input>
</FormItem> </FormItem>
...@@ -140,40 +162,86 @@ ...@@ -140,40 +162,86 @@
<FormItem :label="l('codeRuleId')" prop="codeRuleId"> <FormItem :label="l('codeRuleId')" prop="codeRuleId">
<InputNumber v-model="entity.codeRuleId"></InputNumber> <InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem> </FormItem>
</Col>--> </Col>-->
<Col :span="24">
<Col :span="12"> <FormItem :label="l('filePath')" prop="filePath">
<FormItem :label="l('status')" prop="status"> <!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<RadioGroup v-model="entity.status"> <files ref="refFile" :parms="parms" files />
<Radio label="0">草稿</Radio> </FormItem>
<Radio label="1">送审</Radio> </Col>
</RadioGroup> <Col :span="12">
</FormItem> <FormItem :label="l('status')" prop="status">
</Col> <Dictionary
<!-- <Col :span="24"> code="word.document.status"
<div v-html="entity"></div> v-model="entity.status"
</Col>--> ></Dictionary>
<Col :span="24" style="text-align: right;"> <!-- <RadioGroup v-model="entity.status">
<FormItem> <Radio label="0">草稿</Radio>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button> <Radio label="1">送审</Radio>
<Button @click="handleClose" class="ml20">取消</Button> </RadioGroup> -->
</FormItem> </FormItem>
</Col> </Col>
</Row> </Row>
</Form> </Col>
<Col span="6">
<FormItem :label="l('img')" prop="img">
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
/>
</FormItem>
<div class="img-touxiang">
<img
:src="avatorPath"
v-if="imgName"
@click="imgUrl"
class="img1"
/>
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
<Row>
<Col :span="24" style="text-align: right">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>
</Row>
</Form>
<!-- <Modal v-model="modal" title="文档送审" footer-hide fullscreen :mask-closable="false">
<Submit :isId="isId" ref="submit" @on-close="close"></Submit>
</Modal>-->
</div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
// import Submit from "./submit";
export default { export default {
name: "Add", name: "Add",
components: {
// Submit,
},
data() { data() {
return { return {
disabled: false, // modal: false,
isId: "",
imgName: "",
avatorPath: "",
fileds: [], //扩展属性 fileds: [], //扩展属性
entity: { entity: {
creatorUserId: this.$store.state.userInfo.userId, creatorUserId: this.$store.state.userInfo.userId,
status: "0", status: "",
categoryId: this.treeId, categoryId: this.treeId,
img: "",
// title: "", // title: "",
// field: "", // field: "",
// dataType: null, // dataType: null,
...@@ -199,6 +267,7 @@ export default { ...@@ -199,6 +267,7 @@ export default {
rules: { rules: {
name: [{ required: true, message: "必填", trigger: "blur" }], name: [{ required: true, message: "必填", trigger: "blur" }],
}, },
parmsName: "app=material&eid=1&name=document",
parms: { parms: {
app: "material", app: "material",
eid: null, eid: null,
...@@ -210,32 +279,26 @@ export default { ...@@ -210,32 +279,26 @@ export default {
props: { props: {
v: Object, v: Object,
treeId: Number, treeId: Number,
eid: Number, eid: String,
}, },
created() {},
mounted() { mounted() {
this.initFiled(); this.initFiled();
this.parms.eid = this.$u.guid(); this.parms.eid = this.$u.guid();
this.$refs.refFile.intFiles(); this.$refs.refmovieFile1.inputShow = false;
}, },
methods: { methods: {
imgUrl() {
window.open(this.avatorPath, "_blank");
},
initFiled() { initFiled() {
// let conditions = [
// {
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: this.eid,
// },
// ];
Api.listbyid({ Api.listbyid({
categoryId: this.treeId, categoryId: this.treeId,
// sortBy: "id",
// isDesc: false,
}).then((r) => { }).then((r) => {
if (r.result) { if (r.result) {
let result = []; let result = [];
result = r.result.definie.concat(r.result.inherit); result = r.result.definie.concat(r.result.inherit);
console.log(result) console.log(result);
this.fileds = result.filter(function (item) { this.fileds = result.filter(function (item) {
item.span = 12; item.span = 12;
if (item.dataType > 4) { if (item.dataType > 4) {
...@@ -254,11 +317,17 @@ export default { ...@@ -254,11 +317,17 @@ export default {
this.$set(this.entity, u.filed, v); this.$set(this.entity, u.filed, v);
}); });
} }
if (this.eid) {
this.load(this.eid);
}
}); });
}, },
handleSubmit() { handleSubmit() {
this.$refs.form.validate((v) => { this.$refs.form.validate((v) => {
if (v) { if (v) {
if (this.entity.id) {
delete this.entity.id;
}
if (this.$refs.refFile.nameList.length > 0) { if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePath = this.parms.eid; this.entity.filePath = this.parms.eid;
} else { } else {
...@@ -267,6 +336,12 @@ export default { ...@@ -267,6 +336,12 @@ export default {
Api.create(this.entity) Api.create(this.entity)
.then((r) => { .then((r) => {
if (r.success) { if (r.success) {
// if (this.entity.status == 1) {
// this.modal = true;
// this.isId = r.result.id;
// } else {
// this.modal = false;
// }
this.$Message.success("保存成功"); this.$Message.success("保存成功");
this.$emit("on-ok"); this.$emit("on-ok");
} else { } else {
...@@ -283,26 +358,53 @@ export default { ...@@ -283,26 +358,53 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
// load(v) { load(v) {
// Api.get({ id: v }).then((r) => { Api.get({ id: v }).then((r) => {
// this.entity = r.result; this.entity = r.result;
// this.entity.id = 0; this.avatorPath = fileUrlDown + r.result.img;
// }); this.imgName = r.result.img;
// }, this.entity.status = r.result.status;
if (r.result.filePath && r.result.filePath != "") {
this.parms.eid = r.result.filePath;
} else {
this.parms.eid = this.$u.guid();
}
this.entity.filePath = this.parms.eid;
});
},
l(key) { l(key) {
key = "document_property_definition" + "." + key; key = "document_property_definition" + "." + key;
return this.$t(key); return this.$t(key);
}, },
}, },
watch: { watch: {
// v() { eid(v) {
// this.entity = this.$u.clone(this.v); if (v) {
// }, this.load(v);
// eid(v) { }
// if (v > 0) { },
// this.load(v); imgName(newName, oldName) {
// } console.log(newName);
// }, const imgPathsArr = JSON.parse(newName);
this.entity.img = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
},
}, },
}; };
</script> </script>
\ No newline at end of file <style lang="less">
.img-touxiang {
width: 230px;
height: 230px;
margin-left: 58px;
margin-top: -35px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
.img1 {
cursor: pointer;
}
}
</style>
\ No newline at end of file
<template> <template>
<div class="detail"> <div class=".detail-document">
<div class="top-title">
<div class="new-detail row-left">
<Row> <Row>
<Filed :span="12" :name="l('title')">{{entity.title}}</Filed> <Filed :span="12" :name="l('creationTime') + ':'">{{
<Filed :span="12" :name="l('field')">{{entity.field}}</Filed> entity.creationTime
<Filed :span="12" :name="l('dataType')">{{entity.dataType}}</Filed> }}</Filed>
<Filed :span="12" :name="l('dataLength')">{{entity.dataLength}}</Filed> <Filed :span="12" :name="l('creatorUserId') + ':'">
<Filed :span="12" :name="l('dictionaryId')">{{entity.dictionaryId}}</Filed> <User :value="entity.creatorUserId" />
<Filed :span="12" :name="l('note')">{{entity.note}}</Filed> </Filed>
<Filed :span="12" :name="l('unitName')">{{entity.unitName}}</Filed> <Filed :span="12" :name="l('status') + ':'">
<Filed :span="12" :name="l('tag')">{{entity.tag}}</Filed> <state code="word.document.status" :value="entity.status" />
<Filed :span="12" :name="l('categoryId')">{{entity.categoryId}}</Filed> </Filed>
<Filed :span="12" :name="l('required')">{{entity.required}}</Filed>
<Filed :span="12" :name="l('isUnique')">{{entity.isUnique}}</Filed>
<Filed :span="12" :name="l('fieldType')">{{entity.fieldType}}</Filed>
<Filed :span="12" :name="l('creationTime')">{{entity.creationTime}}</Filed>
<Filed :span="12" :name="l('creatorUserId')">{{entity.creatorUserId}}</Filed>
<Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed>
<Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('dictionaryCode')">{{entity.dictionaryCode}}</Filed>
<Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</Filed>
</Row> </Row>
</div>
<ul>
<li>
<a @click="edit"> <Icon type="md-create" />&nbsp;编辑 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="ios-log-in" />&nbsp;移动 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a @click="copy"> <Icon type="ios-photos" />&nbsp;克隆 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="md-download" />&nbsp;下载 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="ios-link" />&nbsp;引用 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="md-checkmark-circle" />&nbsp;使用 </a>
&nbsp;
<span>|</span>
</li>
<li>
<a> <Icon type="ios-alert-outline" />版本 </a>
</li>
</ul>
</div>
<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>
<Filed :span="24" :name="l('filePath') + ':'" class="filed-d">
<files ref="refFile" :parms="parms" :showList="false" />
</Filed>
<!-- <Filed :span="12" :name="l('field')">{{entity.field}}</Filed>
<Filed :span="12" :name="l('dataType')">{{entity.dataType}}</Filed>
<Filed :span="12" :name="l('dataLength')">{{entity.dataLength}}</Filed>
<Filed :span="12" :name="l('dictionaryId')">{{entity.dictionaryId}}</Filed>
<Filed :span="12" :name="l('note')">{{entity.note}}</Filed>
<Filed :span="12" :name="l('unitName')">{{entity.unitName}}</Filed>
<Filed :span="12" :name="l('tag')">{{entity.tag}}</Filed>-->
<!-- <Filed :span="12" :name="l('categoryId')">{{entity.categoryId}}</Filed> -->
<!-- <Filed :span="12" :name="l('required')">{{entity.required}}</Filed>
<Filed :span="12" :name="l('isUnique')">{{entity.isUnique}}</Filed>-->
<!-- <Filed :span="12" :name="l('fieldType')">{{entity.fieldType}}</Filed> -->
<!-- <Filed :span="12" :name="l('lastModificationTime')">{{entity.lastModificationTime}}</Filed> -->
<!-- <Filed :span="12" :name="l('lastModifierUserId')">{{entity.lastModifierUserId}}</Filed>
<Filed :span="12" :name="l('isDeleted')">{{entity.isDeleted}}</Filed>
<Filed :span="12" :name="l('deletionTime')">{{entity.deletionTime}}</Filed>
<Filed :span="12" :name="l('deleterUserId')">{{entity.deleterUserId}}</Filed>
<Filed :span="12" :name="l('dictionaryCode')">{{entity.dictionaryCode}}</Filed>
<Filed :span="12" :name="l('codeRuleId')">{{entity.codeRuleId}}</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>
<Modal
v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
>
<component
:is="detail"
:eid="curId"
:treeId="treeId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal>
</div>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Add', name: "Add",
data() { data() {
return { return {
entity: {}, modal: false,
rules: { title: "新增",
name: [{ required: true, message: '必填', trigger: 'blur' }], detail: null,
code: [{ required: true, message: '必填', trigger: 'blur' }] curId: this.eid,
} 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"];
props: { // return item.fieldType != 1;
eid: Number return item;
}, });
mounted() { this.fileds.map((u) => {
if (this.eid > 0) { let v = "";
this.load(this.eid); if (u.dataType == 1 || u.dataType == 2) {
} v = 0;
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
this.$emit('on-load')
})
},
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);
}
} }
this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
} }
if (this.eid) {
this.load(this.eid);
}
});
},
handleClose() {
this.$emit("on-close");
},
edit() {
this.curId = this.eid;
this.title = "编辑";
this.detail = () => import("./edit");
this.modal = true;
},
copy() {
this.curId = this.eid;
this.title = "克隆";
this.detail = () => import("./add");
this.modal = true;
},
ok() {
this.modal = false;
this.$emit("on-ok");
},
cancel() {
this.modal = false;
},
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;
.row-left {
width: 1000px;
}
ul {
display: -webkit-inline-box;
display: inline-box;
position: absolute;
bottom: 5px;
right: 0px;
li {
width: 70px;
span {
color: #e0e0e0;
}
}
}
}
.body-document {
margin-top: 10px;
background: #fff;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15);
border-radius: 8px;
height: 80vh;
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;
} }
</script> }
\ No newline at end of file }
.detail-document {
background-color: #f5f7f9 !important;
}
</style>
\ No newline at end of file
<template> <template>
<Form ref="form" :model="entity" :rules="rules" :label-width="90"> <Form ref="form" :model="entity" :rules="rules" :label-width="120">
<Row>
<Col span="18">
<Row> <Row>
<Col :span="12"><FormItem :label="l('title')" prop="title"> <Input v-model="entity.title"> </Input> <Col v-for="li in fileds" :key="li.field" :span="li.span">
</FormItem></Col> <FormItem :label="li.title" :prop="li.name">
<Col :span="12"><FormItem :label="l('field')" prop="field"> <Input v-model="entity.field"> </Input> <Input
</FormItem></Col> v-if="li.dataType == 0"
<Col :span="12"><FormItem :label="l('dataType')" prop="dataType"> <InputNumber v-model="entity.dataType"></InputNumber> v-model="entity[li.field]"
</FormItem></Col> :disabled="li.field == 'code'"
<Col :span="12"><FormItem :label="l('dataLength')" prop="dataLength"> <InputNumber v-model="entity.dataLength"></InputNumber> ></Input>
</FormItem></Col> <InputNumber
<Col :span="12"><FormItem :label="l('dictionaryId')" prop="dictionaryId"> <InputNumber v-model="entity.dictionaryId"></InputNumber> v-if="li.dataType == 1 || li.dataType == 2"
</FormItem></Col> v-model="entity[li.field]"
<Col :span="12"><FormItem :label="l('note')" prop="note"> <Input v-model="entity.note"> </Input> class="w100"
</FormItem></Col> ></InputNumber>
<Col :span="12"><FormItem :label="l('unitName')" prop="unitName"> <Input v-model="entity.unitName"> </Input> <Dictionary
</FormItem></Col> v-if="li.dataType == 3"
<Col :span="12"><FormItem :label="l('tag')" prop="tag"> <Input v-model="entity.tag"> </Input> v-model="entity[li.field]"
</FormItem></Col> :code="li.note"
<Col :span="12"><FormItem :label="l('categoryId')" prop="categoryId"> <InputNumber v-model="entity.categoryId"></InputNumber> ></Dictionary>
</FormItem></Col> <Input
<Col :span="12"><FormItem :label="l('required')" prop="required"> <InputNumber v-model="entity.required"></InputNumber> v-if="li.dataType == 5"
</FormItem></Col> type="textarea"
<Col :span="12"><FormItem :label="l('isUnique')" prop="isUnique"> <InputNumber v-model="entity.isUnique"></InputNumber> v-model="entity[li.filed]"
</FormItem></Col> ></Input>
<Col :span="12"><FormItem :label="l('fieldType')" prop="fieldType"> <Input v-model="entity.fieldType"> </Input> <DatePicker
</FormItem></Col> v-if="li.dataType == 4"
<Col :span="12"><FormItem :label="l('creationTime')" prop="creationTime"> <DatePicker type="date" v-model="entity.creationTime"></DatePicker> v-model="entity[li.field]"
</FormItem></Col> type="date"
<Col :span="12"><FormItem :label="l('creatorUserId')" prop="creatorUserId"> <InputNumber v-model="entity.creatorUserId"></InputNumber> :placeholder="'选择' + li.title"
</FormItem></Col> ></DatePicker>
<Col :span="12"><FormItem :label="l('lastModificationTime')" prop="lastModificationTime"> <DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker> <InputFile
</FormItem></Col> v-if="li.dataType == 6"
<Col :span="12"><FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId"> <InputNumber v-model="entity.lastModifierUserId"></InputNumber> v-model="entity[li.field]"
</FormItem></Col> ></InputFile>
<Col :span="12"><FormItem :label="l('isDeleted')" prop="isDeleted"> <InputNumber v-model="entity.isDeleted"></InputNumber> <!-- <files ref="refFile" :parms="parms" fileFormat :Photos="true" @clickItem="clickData" /> -->
</FormItem></Col> <InputFile
<Col :span="12"><FormItem :label="l('deletionTime')" prop="deletionTime"> <DatePicker type="date" v-model="entity.deletionTime"></DatePicker> v-if="li.dataType == 7"
</FormItem></Col> v-model="entity[li.field]"
<Col :span="12"><FormItem :label="l('deleterUserId')" prop="deleterUserId"> <InputNumber v-model="entity.deleterUserId"></InputNumber> ></InputFile>
</FormItem></Col> <Input
<Col :span="12"><FormItem :label="l('dictionaryCode')" prop="dictionaryCode"> <Input v-model="entity.dictionaryCode"> </Input> v-if="li.dataType == 8"
</FormItem></Col> type="textarea"
<Col :span="12"><FormItem :label="l('codeRuleId')" prop="codeRuleId"> <InputNumber v-model="entity.codeRuleId"></InputNumber> v-model="entity[li.field]"
</FormItem></Col> ></Input>
<state
v-if="li.unitName && (li.dataType == 1 || li.dataType == 2)"
:value="li.unitName"
code="material.main.unitName"
type="tag"
></state>
</FormItem>
</Col>
</Row> </Row>
<Row>
<!-- <Col :span="12">
<FormItem :label="l('title')" prop="title">
<Input v-model="entity.title"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('field')" prop="field">
<Input v-model="entity.field"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dataType')" prop="dataType">
<InputNumber v-model="entity.dataType"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dataLength')" prop="dataLength">
<InputNumber v-model="entity.dataLength"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dictionaryId')" prop="dictionaryId">
<InputNumber v-model="entity.dictionaryId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('note')" prop="note">
<Input v-model="entity.note"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('unitName')" prop="unitName">
<Input v-model="entity.unitName"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('tag')" prop="tag">
<Input v-model="entity.tag"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('categoryId')" prop="categoryId">
<InputNumber v-model="entity.categoryId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('required')" prop="required">
<InputNumber v-model="entity.required"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isUnique')" prop="isUnique">
<InputNumber v-model="entity.isUnique"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('fieldType')" prop="fieldType">
<Input v-model="entity.fieldType"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creationTime')" prop="creationTime">
<DatePicker type="date" v-model="entity.creationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('creatorUserId')" prop="creatorUserId">
<InputNumber v-model="entity.creatorUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModificationTime')" prop="lastModificationTime">
<DatePicker type="date" v-model="entity.lastModificationTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('lastModifierUserId')" prop="lastModifierUserId">
<InputNumber v-model="entity.lastModifierUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('isDeleted')" prop="isDeleted">
<InputNumber v-model="entity.isDeleted"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deletionTime')" prop="deletionTime">
<DatePicker type="date" v-model="entity.deletionTime"></DatePicker>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('deleterUserId')" prop="deleterUserId">
<InputNumber v-model="entity.deleterUserId"></InputNumber>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('dictionaryCode')" prop="dictionaryCode">
<Input v-model="entity.dictionaryCode"></Input>
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('codeRuleId')" prop="codeRuleId">
<InputNumber v-model="entity.codeRuleId"></InputNumber>
</FormItem>
</Col>-->
<Col :span="24">
<FormItem :label="l('filePath')" prop="filePath">
<!-- <Input v-model="entity.template" type="textarea" :rows="5"></Input> -->
<files ref="refFile" :parms="parms" files />
</FormItem>
</Col>
<Col :span="12">
<FormItem :label="l('status')" prop="status">
<Dictionary
code="word.document.status"
v-model="entity.status"
></Dictionary>
</FormItem>
</Col>
<!-- <Col :span="24" style="text-align: right;">
<FormItem>
<Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button>
</FormItem>
</Col>-->
</Row>
</Col>
<Col span="6">
<FormItem :label="l('img')" prop="img">
<inputFile
class="tphoto"
ref="refmovieFile1"
v-model="imgName"
:parms="parmsName"
/>
</FormItem>
<div class="img-touxiang">
<img :src="avatorPath" v-if="imgName" @click="imgUrl" class="img1" />
<img
src="@/assets/images/files_header.png"
v-else
width="100%"
height="100%"
/>
</div>
</Col>
</Row>
<Row>
<Col :span="24" style="text-align: right">
<FormItem> <FormItem>
<Button type="primary" @click="handleSubmit" :disabled="disabled">保存</Button> <Button type="primary" @click="handleSubmit" v-noClick>保存</Button>
<Button @click="handleClose" class="ml20">取消</Button> <Button @click="handleClose" class="ml20">取消</Button>
</FormItem> </FormItem>
</Form> </Col>
</Row>
</Form>
</template> </template>
<script> <script>
import Api from './api' import Api from "./api";
export default { export default {
name: 'Edit', name: "Edit",
data() { data() {
return { return {
disabled: false, imgName: "",
entity: { avatorPath: "",
}, entity: {},
rules: { rules: {
name: [{ required: true, message: '必填', trigger: 'blur' }] name: [{ required: true, message: "必填", trigger: "blur" }],
} },
fileds: [], //扩展属性
parmsName: "app=material&eid=1&name=document",
parms: {
app: "material",
eid: null,
name: "",
field: "",
},
};
},
props: ["eid", "treeId"],
mounted() {
this.initFiled();
this.parms.eid = this.$u.guid();
this.$refs.refmovieFile1.inputShow = false;
},
methods: {
imgUrl() {
window.open(this.avatorPath, "_blank");
},
initFiled() {
// let conditions = [
// {
// conditionalType: "Equal",
// fieldName: "categoryId",
// fieldValue: this.eid,
// },
// ];
Api.listbyid({
categoryId: this.treeId,
// sortBy: "id",
// isDesc: false,
}).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 = 12;
if (item.dataType > 4) {
item.span = 24;
} }
}, delete item["id"];
props: { // return item.fieldType != 1;
eid: Number return item;
}, });
mounted() { this.fileds.map((u) => {
if (this.eid > 0) { let v = "";
this.load(this.eid); if (u.dataType == 1 || u.dataType == 2) {
} v = 0;
},
methods: {
load(v) {
Api.get({ id: v }).then(r => {
this.entity = r.result;
})
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
this.disabled = true;
Api.update(this.entity).then((r) => {
this.disabled = false;
if (r.success) {
this.$Message.success('保存成功')
this.$emit('on-ok')
} else {
this.$Message.error('保存失败')
}
}).catch(err => {
this.disabled = false;
this.$Message.error('保存失败')
console.warn(err)
})
}
})
},
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);
}
} }
this.entity[u.field] = "";
this.$set(this.entity, u.filed, v);
});
} }
} if (this.eid) {
</script> this.load(this.eid);
\ No newline at end of file }
});
},
load(v) {
Api.get({ id: v }).then((r) => {
this.entity = r.result;
this.avatorPath = fileUrlDown + r.result.img;
this.imgName = r.result.img;
this.entity.status = r.result.status ;
if (r.result.filePath && r.result.filePath != "") {
this.parms.eid = r.result.filePath;
} else {
this.parms.eid = this.$u.guid();
}
this.entity.filePath = this.parms.eid;
});
},
handleSubmit() {
this.$refs.form.validate((v) => {
if (v) {
if (this.$refs.refFile.nameList.length > 0) {
this.entity.filePath = this.parms.eid;
} else {
this.entity.filePath = "";
}
Api.update(this.entity)
.then((r) => {
if (r.success) {
this.$Message.success("保存成功");
this.$emit("on-ok");
} else {
this.$Message.error("保存失败");
}
})
.catch((err) => {
this.$Message.error("保存失败");
console.warn(err);
});
}
});
},
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);
}
},
imgName(newName, oldName) {
const imgPathsArr = JSON.parse(newName);
this.entity.img = imgPathsArr[0].filePath;
this.avatorPath = fileUrlDown + imgPathsArr[0].filePath;
},
},
};
</script>
<style lang="less">
.img-touxiang {
width: 230px;
height: 230px;
margin-left: 58px;
margin-top: -35px;
img {
width: 100%;
height: 100%;
border-radius: 5px;
}
.img1 {
cursor: pointer;
}
}
</style>
\ No newline at end of file
...@@ -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; // if (b.children.length == 0) { //判断最底层才能添加文档
this.$refs.dataTable.$refs.grid.reload(this.easySearch); // this.addShow = true;
} else { // this.$refs.dataTable.$refs.grid.reload(this.easySearch);
this.treeId = 0; // } 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
...@@ -9,12 +9,14 @@ ...@@ -9,12 +9,14 @@
:type="typeInfo" :type="typeInfo"
:span="6" :span="6"
:lazy="true" :lazy="true"
exportTitle="文档管理"
> >
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入关键字引用的文档名称/文档名称" v-model="easySearch.keys.value" /> <Input
placeholder="请输入关键字引用的文档名称/文档名称"
v-model="easySearch.keys.value"
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
...@@ -26,47 +28,79 @@ ...@@ -26,47 +28,79 @@
</template> </template>
<template slot="buttons"> <template slot="buttons">
<Button type="primary" @click="add">新增</Button> <Button type="primary" @click="add">新增</Button>
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button> <Button
<Button @click="openModalIm">导入</Button> :icon="iconInfo"
shape="circle"
:title="titleInfo"
@click="changeShwo"
></Button>
</template> </template>
<template slot="card" slot-scope="{row}"> <template slot="card" slot-scope="{ row }">
<div class="body-card"> <div class="body-card">
<Row class="title-i"> <Row class="title-i">
<Col :span="12"> <Col :span="12">
<Ellipsis :text="row.name" :length="12" tooltip /> <Ellipsis :text="row.name" :length="12" tooltip />
</Col> </Col>
<Col :span="12" class="btn-click">{{row.code}}</Col> <Col :span="12" class="btn-click">{{ row.code }}</Col>
</Row> </Row>
<Row class="row-down" :gutter="10"> <Row class="row-down" :gutter="10">
<Col span="7"> <Col span="7">
<div class="img-i"> <div class="img-i">
<img :src="downUrl+'/' +row.filePath" v-if="row.filePath" /> <img :src="downUrl + row.img" v-if="row.img" />
<!-- onerror="this.src='/imgicon/chan_Pin.png'" --> <!-- onerror="this.src='/imgicon/chan_Pin.png'" -->
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" /> <img
src="@/assets/imgicon/chan_Pin.png"
v-else
width="100%"
height="100%"
/>
</div> </div>
</Col> </Col>
<Col span="17" class="c"> <Col span="17">
<div>版本:{{row.version}}</div> <div class="c">
<div>文档详细说明:{{row.description}}</div> <div>版本:{{ row.version }}</div>
<div>
状态:
<state code="word.document.status" :value="row.status" />
</div>
<!-- <div>
创建人:
<User :value="row.creatorUserId" />
</div>-->
<p class="a-icon"> <div class="shuo-ming">
<a @click="edit(row)"> <span>文档说明:</span>
<Icon type="md-create" />编辑 <Ellipsis :text="row.description" :length="12" tooltip />
</a>&nbsp; </div>
<a @click="remove(row)"> </div>
<Icon type="ios-trash" />删除
</a>&nbsp; <div class="a-icon">
<a @click="view(row)"> <a @click="edit(row.id)"> <Icon type="md-create" />编辑 </a
<Icon type="md-document" />详情 >&nbsp;
</a> <a @click="remove(row.id)"> <Icon type="ios-trash" />删除 </a
</p> >&nbsp;
<a @click="view(row.id)"> <Icon type="md-document" />详情 </a>
</div>
</Col> </Col>
</Row> </Row>
</div> </div>
</template> </template>
</DataGrid> </DataGrid>
<Modal v-model="modal" :title="title" width="1200" footer-hide> <Modal
<component :is="detail" :eid="curId" :treeId="treeId" @on-close="cancel" @on-ok="ok" /> v-model="modal"
:title="title"
width="1200"
footer-hide
:mask-closable="false"
:fullscreen="fullscreen"
>
<component
:is="detail"
:eid="curId"
:treeId="treeId"
@on-close="cancel"
@on-ok="ok"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
...@@ -76,11 +110,12 @@ export default { ...@@ -76,11 +110,12 @@ export default {
data() { data() {
return { return {
action: Api.index, action: Api.index,
fullscreen: false,
easySearch: { easySearch: {
keys: { op: "refName,name", value: null }, keys: { op: "refName,name", value: null },
categoryId: { categoryId: {
op: "In", op: "In",
value: this.treeId, value: this.ids,
}, },
}, },
modal: false, modal: false,
...@@ -96,68 +131,34 @@ export default { ...@@ -96,68 +131,34 @@ export default {
align: "left", align: "left",
high: true, high: true,
}, },
{ key: "name", title: this.l("title"), align: "left", high: true },
{ {
key: "title", key: "creationTime",
title: this.l("title"), title: this.l("creationTime"),
align: "left",
easy: true,
high: true,
},
{ key: "field", title: this.l("field"), align: "left", high: true },
{
key: "dataType",
title: this.l("dataType"),
align: "left",
high: true,
},
{
key: "dataLength",
title: this.l("dataLength"),
align: "left",
high: true,
},
{
key: "dictionaryId",
title: this.l("dictionaryId"),
align: "left",
high: true,
},
{ key: "note", title: this.l("note"), align: "left", high: true },
{
key: "unitName",
title: this.l("unitName"),
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
}, },
{ key: "tag", title: this.l("tag"), align: "left", high: true },
{
key: "categoryId",
title: this.l("categoryId"),
align: "left",
high: true,
},
{ {
key: "required", key: "code",
title: this.l("required"), title: this.l("name"),
align: "left", align: "left",
high: true, high: true,
}, },
{ {
key: "isUnique", key: "status",
title: this.l("isUnique"), title: this.l("status"),
align: "left",
high: true,
},
{
key: "fieldType",
title: this.l("fieldType"),
align: "left", align: "left",
high: true, high: true,
render: (h, params) => {
return h("div", [
h("span", params.row.status == 0 ? "草稿" : "送审"),
]);
},
}, },
{ {
key: "creationTime", key: "version",
title: this.l("creationTime"), title: this.l("revision"),
align: "left", align: "left",
high: true, high: true,
}, },
...@@ -166,49 +167,7 @@ export default { ...@@ -166,49 +167,7 @@ export default {
title: this.l("creatorUserId"), title: this.l("creatorUserId"),
align: "left", align: "left",
high: true, high: true,
}, type: "user",
{
key: "lastModificationTime",
title: this.l("lastModificationTime"),
align: "left",
high: true,
},
{
key: "lastModifierUserId",
title: this.l("lastModifierUserId"),
align: "left",
high: true,
},
{
key: "isDeleted",
title: this.l("isDeleted"),
align: "left",
high: true,
},
{
key: "deletionTime",
title: this.l("deletionTime"),
align: "left",
high: true,
},
{
key: "deleterUserId",
title: this.l("deleterUserId"),
align: "left",
high: true,
},
{
key: "dictionaryCode",
title: this.l("dictionaryCode"),
align: "left",
easy: true,
high: true,
},
{
key: "codeRuleId",
title: this.l("codeRuleId"),
align: "left",
high: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -255,6 +214,8 @@ export default { ...@@ -255,6 +214,8 @@ export default {
}, },
props: { props: {
treeId: Number, treeId: Number,
addShow: Boolean,
ids: Array,
}, },
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
...@@ -273,15 +234,6 @@ export default { ...@@ -273,15 +234,6 @@ export default {
this.titleInfo = "卡片模式"; this.titleInfo = "卡片模式";
} }
}, },
//批量导入start
//导入功能
openModalIm() {
if (this.parent.id) {
this.ModalIm = true;
} else {
this.$Message.error("请先选择文档分类");
}
},
ok() { ok() {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
this.modal = false; this.modal = false;
...@@ -291,29 +243,36 @@ export default { ...@@ -291,29 +243,36 @@ export default {
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
}, },
add() { add() {
this.curId = 0; if (this.treeId == 0) {
this.title = "新增"; this.$Message.error("请在分类下添加文档");
this.detail = () => import("./add"); } else {
this.modal = true; // if (this.addShow == false) { //判断最底层才能添加文档
}, // this.$Message.error("请在分类最子集新增文档");
copy(id) { // } else {
this.curId = id; this.fullscreen = false;
this.title = "克隆"; this.curId = 0;
this.detail = () => import("./add"); this.title = "新增";
this.modal = true; this.detail = () => import("./add");
this.modal = true;
// }
}
}, },
view(id) { view(id) {
this.fullscreen = true;
this.curId = id; this.curId = id;
this.title = "详情"; this.title = "详情";
this.detail = () => import("./detail"); this.detail = () => import("./detail");
this.modal = true; this.modal = true;
}, },
edit(id) { edit(id) {
this.fullscreen = false;
this.curId = id; this.curId = id;
this.title = "编辑"; this.title = "编辑";
this.detail = () => import("./edit"); this.detail = () => import("./edit");
this.modal = true; this.modal = true;
}, },
remove(id) { remove(id) {
Api.delete(id).then((r) => { Api.delete(id).then((r) => {
if (r.success) { if (r.success) {
...@@ -347,11 +306,23 @@ export default { ...@@ -347,11 +306,23 @@ export default {
}, },
}, },
watch: { watch: {
treeId(v) { // treeId(v) {
if (v != 0) { // alert(v)
this.easySearch.categoryId.value = v; // if (v != 0) {
// // this.easySearch.categoryId.value = v;
// this.$refs.grid.reload(this.easySearch);
// }
// },
ids: {
handler(newName, oldName) {
// console.log("ovo", newName, oldName);
// console.log(newName);
this.easySearch.categoryId.value = newName;
this.$refs.grid.reload(this.easySearch); this.$refs.grid.reload(this.easySearch);
} },
// immediate: true,
deep: true,
}, },
}, },
}; };
...@@ -360,7 +331,7 @@ export default { ...@@ -360,7 +331,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: 5px 0;
border-radius: 4px; border-radius: 4px;
.title-i { .title-i {
...@@ -375,28 +346,27 @@ export default { ...@@ -375,28 +346,27 @@ export default {
text-align: right; text-align: right;
} }
} }
.row-down { .row-down {
padding: 10px; padding: 10px;
height: 110px;
.img-i { .img-i {
width: 90px; width: 90px;
background: #eee; background: #eee;
height: 90px; height: 90px;
margin-right: 15px;
// overflow: hidden;
img { img {
width: 90px; width: 90px;
height: 90px; height: 90px;
} }
} }
.c {
.c div { padding-left: 8px;
margin-bottom: 14px; div {
margin-left: 10px; height: 18px;
}
}
.shuo-ming {
display: -webkit-inline-box;
} }
.a-icon { .a-icon {
text-align: right; text-align: right;
} }
......
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