DNC产品结构树合并至MDC,已初步完成页面布局,现正在完善各个功能弹窗逻辑
| | |
| | | new Vue({ |
| | | router, |
| | | store, |
| | | beforeCreate() { |
| | | Vue.prototype.$bus = new Vue() |
| | | }, |
| | | mounted () { |
| | | store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true)) |
| | | store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme)) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <a-row type="flex" :gutter="16"> |
| | | <a-col :md="5"> |
| | | <ProductStructureTree/> |
| | | </a-col> |
| | | <a-col :md="19"> |
| | | <ProductStructureMain/> |
| | | </a-col> |
| | | </a-row> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProductStructureTree from '../common/ProductStructureTree' |
| | | import ProductStructureMain from './modules/ProductStructure/ProductStructureMain' |
| | | |
| | | export default { |
| | | name: 'ProductStructure', |
| | | components: { |
| | | ProductStructureTree, |
| | | ProductStructureMain |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-card-body { |
| | | padding: 8px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="é¨ä»¶åç§°">{{currentLevelDetails.componentName}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¨ä»¶ä»£å·">{{currentLevelDetails.componentCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¨ä»¶åå· ">{{currentLevelDetails.componentModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç©æç¼ç ">{{currentLevelDetails.materielCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="ææ">{{currentLevelDetails.materielDesp}}</a-descriptions-item> |
| | | <a-descriptions-item label="è§æ ¼ ">{{currentLevelDetails.componentScale}}</a-descriptions-item> |
| | | <a-descriptions-item label="è£
é
ç±»å">{{currentLevelDetails.assembleType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç产类å">{{currentLevelDetails.produceType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å¤çç±»å ">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç»æç±»å ">{{currentLevelDetails.structureType}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" :span="2">{{currentLevelDetails.componentWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createUser_dicText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateUser_dicText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ComponentInfo', |
| | | components: {}, |
| | | props: { |
| | | currentLevelDetails: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <ComponentModalForm ref="realForm" @ok="submitCallback"/> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import ComponentModalForm from './ComponentModalForm.vue' |
| | | |
| | | export default { |
| | | name: 'ComponentModal', |
| | | components: { |
| | | ComponentModalForm |
| | | }, |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | width: 700, |
| | | visible: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æ·»å å½å产åé¨ä»¶ |
| | | * @param modalTitle |
| | | */ |
| | | handleProductAddChild(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ·»å å½åé¨ä»¶çåé¨ä»¶ |
| | | * @param modalTitle |
| | | */ |
| | | handleComponentAdd(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | |
| | | handleComponentEdit(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(this.currentTreeNodeInfo.entity) |
| | | }) |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | console.log('methodName', methodName) |
| | | console.log('modalTitle', modalTitle) |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="é¨ä»¶åç§°" prop="componentName"> |
| | | <a-input v-model="model.componentName" placeholder="请è¾å
¥é¨ä»¶åç§°"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="代å·" prop="componentCode"> |
| | | <a-input v-model="model.componentCode" placeholder="请è¾å
¥ä»£å·"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="é¨ä»¶åå·"> |
| | | <a-input v-model="model.componentModel" placeholder="请è¾å
¥é¨ä»¶åå·"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="è§æ ¼"> |
| | | <a-input v-model="model.productName" placeholder="请è¾å
¥è§æ ¼"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="è£
é
ç±»å" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.assembleType" placeholder="请è¾å
¥è£
é
ç±»å"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="éé"> |
| | | <a-input v-model="model.componentWeight" placeholder="请è¾å
¥éé"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç©æç¼ç "> |
| | | <a-input v-model="model.materielCode" placeholder="请è¾å
¥ç©æç¼ç "></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç»æç±»å"> |
| | | <a-input v-model="model.structureType" placeholder="请è¾å
¥ç»æç±»å"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å¤çç±»å"> |
| | | <a-input v-model="model.processType" placeholder="请è¾å
¥å¤çç±»å"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="ç产类å"> |
| | | <a-input v-model="model.produceType" placeholder="请è¾å
¥ç产类å"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="æè¿°" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-textarea v-model="model.description" placeholder="请è¾å
¥æè¿°"></a-textarea> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'ComponentModalForm', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 14 } |
| | | }, |
| | | labelColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 4 } |
| | | }, |
| | | wrapperColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 19 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | componentName: [ |
| | | { required: true, message: '请è¾å
¥é¨ä»¶åç§°!' } |
| | | ], |
| | | componentCode: [ |
| | | { required: true, message: '请è¾å
¥ä»£å·!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcPartProcessInfo/add', |
| | | edit: '/mdc/mdcPartProcessInfo/edit' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.modelDefault) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | console.log('model', this.model) |
| | | this.visible = true |
| | | }, |
| | | |
| | | submitForm() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl = '' |
| | | let method = 'post' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="ææ¡£åç§°">{{currentLevelDetails.docName}}</a-descriptions-item> |
| | | <a-descriptions-item label="代ç çæ¬">{{currentLevelDetails.docAlias}}</a-descriptions-item> |
| | | <a-descriptions-item label="设å¤ç¼å· ">{{currentLevelDetails.docCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="ææ¡£åç¼">{{currentLevelDetails.docSuffix}}</a-descriptions-item> |
| | | <a-descriptions-item label="ææ¡£ç¶æ">{{currentLevelDetails.docStatus}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç³»ç»æå®çæ¬">{{currentLevelDetails.publishVersion}}</a-descriptions-item> |
| | | <a-descriptions-item label="åºåºç¶æ">{{currentLevelDetails.pullStatus}}</a-descriptions-item> |
| | | <a-descriptions-item label="åºåºäºº" :span="2">{{currentLevelDetails.pullUser}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'DocumentInfo', |
| | | components: {}, |
| | | props: { |
| | | currentLevelDetails: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false"> |
| | | |
| | | </a-table> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'DocumentVersionTableList', |
| | | mixins: [JeecgListMixin], |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { title: 'æä»¶åç§°', dataIndex: 'fileName', align: 'center' }, |
| | | { title: 'çæ¬å·', dataIndex: 'docVersion', align: 'center' }, |
| | | { title: 'æä»¶å¤§å°', dataIndex: 'fileSize', align: 'center' } |
| | | ], |
| | | url: { |
| | | list: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" |
| | | :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId"> |
| | | |
| | | </a-table> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'NcDocumentTableList', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { title: 'æä»¶åç§°', dataIndex: 'docName', align: 'center' }, |
| | | { title: '代ç çæ¬', dataIndex: 'docAlias', align: 'center' }, |
| | | { title: 'åºåºç¶æ', dataIndex: 'pullStatus', align: 'center' }, |
| | | { title: 'ç¶ æ', dataIndex: 'docStatus', align: 'center' }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center' }, |
| | | { title: 'ä¸ä¼ æ¶é´', dataIndex: 'createTime', align: 'center' } |
| | | ], |
| | | dataSource: [ |
| | | { |
| | | 'docId': '1876099281127645185', |
| | | 'docName': 'avatar2.jpg', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'jpg', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876099281458995202', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 10:51:40', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114720452943873', |
| | | 'docName': 'color.less', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'less', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114720582967297', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:01', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114736512933889', |
| | | 'docName': 'index.html', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'html', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114736705871874', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:05', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114746621206529', |
| | | 'docName': 'logo.png', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'png', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114746818338818', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:07', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114758923100161', |
| | | 'docName': 'lxzn.png', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'png', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114759111843842', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:10', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1876114776241381377', |
| | | 'docName': 'v2.js', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'js', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1876114776438513666', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2025-01-06 11:53:14', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 5, |
| | | 'attributionId': '1868504592315248641', |
| | | 'classificationId': '1257965381181095938', |
| | | 'syncStatus': null |
| | | } |
| | | ], |
| | | url: { |
| | | list: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.$emit('handleTableContextMenuOpen', { ...record, param: 'document' }) |
| | | }, |
| | | click: () => { |
| | | this.$bus.$emit('sendCurrentLevelInfo', record) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" |
| | | :scroll="{y:189}" :customRow="customRow" :size="size"> |
| | | |
| | | </a-table> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'OtherDocumentTableList', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { title: 'æä»¶åç§°', dataIndex: 'docName', align: 'center' }, |
| | | { title: '设å¤ç¼å·', dataIndex: 'docCode', align: 'center' }, |
| | | { title: 'åºåºç¶æ', dataIndex: 'pullStatus', align: 'center' }, |
| | | { title: 'ç¶ æ', dataIndex: 'docStatus', align: 'center' }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center' }, |
| | | { title: 'ä¸ä¼ æ¶é´', dataIndex: 'createTime', align: 'center' } |
| | | ], |
| | | dataSource: [ |
| | | { |
| | | 'docId': '1868943615190044674', |
| | | 'docName': 'æµè¯.nc', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'nc', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1868943615454285825', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2024-12-17 16:57:36', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 1, |
| | | 'attributionId': '1326377675659276290', |
| | | 'classificationId': '1257965467827027969', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1868946627732103170', |
| | | 'docName': 'nacos-config.sh', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'sh', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1868946628004732930', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2024-12-17 17:09:34', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 1, |
| | | 'attributionId': '1326377675659276290', |
| | | 'classificationId': '1257965467827027969', |
| | | 'syncStatus': null |
| | | }, |
| | | { |
| | | 'docId': '1868947564353740801', |
| | | 'docName': 'dir.sql', |
| | | 'docAlias': null, |
| | | 'docCode': null, |
| | | 'docSuffix': 'sql', |
| | | 'docStatus': 1, |
| | | 'publishFileId': '1868947564487958530', |
| | | 'publishVersion': 'a.1', |
| | | 'description': null, |
| | | 'createTime': '2024-12-17 17:13:17', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null, |
| | | 'docClassCode': null, |
| | | 'pullStatus': 1, |
| | | 'pullUser': null, |
| | | 'attributionType': 1, |
| | | 'attributionId': '1326377675659276290', |
| | | 'classificationId': '1257965467827027969', |
| | | 'syncStatus': null |
| | | } |
| | | ], |
| | | url: { |
| | | list: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.$emit('handleTableContextMenuOpen', { ...record, param: 'document' }) |
| | | }, |
| | | click: () => { |
| | | this.$bus.$emit('sendCurrentLevelInfo', record) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false"> |
| | | |
| | | </a-table> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'UseDocumentEquipmentTableList', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { title: '设å¤åç§°', dataIndex: 'deviceName', align: 'center' }, |
| | | { title: '设å¤ç¼å·', dataIndex: 'deviceNo', align: 'center' }, |
| | | { title: '设å¤åå·', dataIndex: 'deviceModel', align: 'center' }, |
| | | { title: 'æå±é¨é¨', dataIndex: 'departName', align: 'center' }, |
| | | { title: '设å¤åç»', dataIndex: 'groupName', align: 'center' }, |
| | | { title: 'æ§å¶ç³»ç»', dataIndex: 'controlSystem', align: 'center' } |
| | | ], |
| | | url: { |
| | | list: '' |
| | | } |
| | | } |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="é¶ä»¶åç§°">{{currentLevelDetails.partsName}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¶ä»¶ä»£å·">{{currentLevelDetails.partsCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¶ä»¶åå· ">{{currentLevelDetails.partsModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç©æç¼ç ">{{currentLevelDetails.materielCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="ææ">{{currentLevelDetails.materielDesp}}</a-descriptions-item> |
| | | <a-descriptions-item label="è§æ ¼ ">{{currentLevelDetails.partsScale}}</a-descriptions-item> |
| | | <a-descriptions-item label="è£
é
ç±»å">{{currentLevelDetails.assembleType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç产类å">{{currentLevelDetails.produceType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å¤çç±»å ">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç»æç±»å ">{{currentLevelDetails.structureType}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" :span="2">{{currentLevelDetails.partsWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createUser_dicText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateUser_dicText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'PartInfo', |
| | | components: {}, |
| | | props: { |
| | | currentLevelDetails: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="å·¥åºåç§°">{{currentLevelDetails.processName|isValueNull}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºå·">{{currentLevelDetails.processCode|isValueNull}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥èºç¼å· ">{{currentLevelDetails.craftNo|isValueNull}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºç±»å">{{currentLevelDetails.processType|isValueNull}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤åå·">{{currentLevelDetails.processingEquipmentModel|isValueNull}} |
| | | </a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç±»å">{{currentLevelDetails.processingEquipmentOs|isValueNull}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç¼å·">{{currentLevelDetails.processingEquipmentCode|isValueNull}} |
| | | </a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
ç¼å·">{{currentLevelDetails.assembleStep|isValueNull}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§° ">{{currentLevelDetails.assembleName|isValueNull}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description|isValueNull}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ProcessInfo', |
| | | components: {}, |
| | | props: { |
| | | currentLevelDetails: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | filters: { |
| | | isValueNull(value) { |
| | | return !value || value == null ? '' : value |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <ProcessModalForm ref="realForm" @ok="submitCallback"/> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProcessModalForm from './ProcessModalForm.vue' |
| | | |
| | | export default { |
| | | name: 'ProcessModal', |
| | | components: { |
| | | ProcessModalForm |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | width: 700, |
| | | visible: false |
| | | } |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | edit(record) { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(record) |
| | | }) |
| | | }, |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.visible = false |
| | | }, |
| | | handleCancel() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥åºå·" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processCode"> |
| | | <a-input v-model="model.processCode" placeholder="请è¾å
¥å·¥åºå·"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥åºåç§°" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processName"> |
| | | <a-input v-model="model.processName" placeholder="请è¾å
¥å·¥åºåç§°"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="å 工设å¤ç¼å·" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-select v-model="model.processingEquipmentCode" placeholder="è¯·éæ©å 工设å¤ç¼å·"></a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥èºç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.craftNo" placeholder="请è¾å
¥å·¥èºç¼å·"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥èºè§ç¨çæ¬" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.craftVersion" placeholder="请è¾å
¥å·¥èºè§ç¨çæ¬"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥åºç±»å" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.processType" placeholder="请è¾å
¥å·¥åºç±»å"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥åºæè¿°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.description" placeholder="请è¾å
¥å·¥åºæè¿°"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥è£
ç¼å·" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.assembleStep" placeholder="请è¾å
¥å·¥è£
ç¼å·"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="å·¥è£
åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.assembleName" placeholder="请è¾å
¥å·¥è£
åç§°"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | |
| | | <select-device-drawer ref="selectDeviceDrawer" @selectFinished="selectOK" :title="'éæ©è®¾å¤'"/> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import SelectDeviceDrawer from '@/views/system/modules/SelectDeviceDrawer' |
| | | |
| | | export default { |
| | | name: 'ProcessModalForm', |
| | | components: { SelectDeviceDrawer }, |
| | | data() { |
| | | return { |
| | | model: { |
| | | passCount: 0 |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 14 } |
| | | }, |
| | | labelColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 4 } |
| | | }, |
| | | wrapperColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 19 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | equipmentIds: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤!' } |
| | | ], |
| | | partId: [ |
| | | { required: true, message: '请è¾å
¥é¶ä»¶å·!' } |
| | | ], |
| | | standardProcessLong: [ |
| | | { required: true, message: '请è¾å
¥æ åå 工工æ¶(min)!' } |
| | | ], |
| | | processCount: [ |
| | | { required: true, message: '请è¾å
¥å å·¥é¶ä»¶æ°é!' } |
| | | ], |
| | | passCount: [ |
| | | { required: true, message: '请è¾å
¥åæ ¼é¶ä»¶æ°é!' } |
| | | ], |
| | | theDate: [ |
| | | { required: true, message: 'è¯·éæ©æ¥æ!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcPartProcessInfo/add', |
| | | edit: '/mdc/mdcPartProcessInfo/edit' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.modelDefault) |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, { equipmentIds: record.equipmentId }, record) |
| | | console.log('model', this.model) |
| | | this.visible = true |
| | | }, |
| | | inputNumberChange() { |
| | | if (this.model.standardProcessLong && this.model.processCount) { |
| | | this.model.totalProcessLong = this.model.standardProcessLong * this.model.processCount |
| | | } |
| | | }, |
| | | submitForm() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl = '' |
| | | let method = 'post' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | deviceSearch() { |
| | | this.$refs.selectDeviceDrawer.visible = true |
| | | this.$refs.selectDeviceDrawer.selectedRowKeys = [] |
| | | this.$refs.selectDeviceDrawer.selectedRows = [] |
| | | this.$refs.selectDeviceDrawer.checkedKeys = this.model.equipmentIds ? this.model.equipmentIds.split(',') : [] |
| | | }, |
| | | /** |
| | | * 鿩已æè®¾å¤åç¹å»ç¡®å®æ¶è§¦å |
| | | * @param data 已鿩çè®¾å¤ |
| | | */ |
| | | selectOK(data) { |
| | | this.$set(this.model, 'equipmentIds', data.join(',')) |
| | | if (this.model.equipmentIds) this.$refs.form.clearValidate('equipmentIds') |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" |
| | | :scroll="{y:227}" :customRow="customRow" :size="size" rowKey="processId"> |
| | | |
| | | </a-table> |
| | | |
| | | <ProcessModal ref="modalForm" @ok="modalFormOk"/> |
| | | |
| | | <ImportFileModal ref="importFileModal"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import ProcessModal from './ProcessModal' |
| | | import ImportFileModal from '../../../../common/ImportFileModal' |
| | | |
| | | export default { |
| | | name: 'ProcessTableList', |
| | | components: { ImportFileModal, ProcessModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: 'å·¥åºå·', |
| | | dataIndex: 'processCode', |
| | | align: 'center', |
| | | sorter: (a, b) => a.processNo - b.processNo, |
| | | sortDirections: ['descend', 'ascend'] |
| | | }, |
| | | { |
| | | title: 'å·¥åºç¼å·', |
| | | dataIndex: 'craftNo', |
| | | align: 'center', |
| | | sorter: (a, b) => a.processId - b.processId, |
| | | sortDirections: ['descend', 'ascend'] |
| | | }, |
| | | { |
| | | title: 'å·¥åºåç§°', |
| | | dataIndex: 'processName', |
| | | align: 'center', |
| | | sorter: (a, b) => a.processName.length - b.processName.length, |
| | | sortDirections: ['descend', 'ascend'] |
| | | } |
| | | ], |
| | | dataSource: [ |
| | | { |
| | | 'processId': '1327516286572163080', |
| | | 'productId': '1326377675659276290', |
| | | 'componentId': '1327516286505054210', |
| | | 'partsId': null, |
| | | 'processName': null, |
| | | 'processCode': '1', |
| | | 'craftNo': null, |
| | | 'craftVersion': null, |
| | | 'processType': null, |
| | | 'processingEquipmentModel': null, |
| | | 'processingEquipmentCode': null, |
| | | 'assembleStep': null, |
| | | 'assembleName': null, |
| | | 'description': null |
| | | }, |
| | | { |
| | | 'processId': '1701841077007798274', |
| | | 'productId': '1326377675659276290', |
| | | 'componentId': '1327516286505054210', |
| | | 'partsId': null, |
| | | 'processName': '2113', |
| | | 'processCode': '111', |
| | | 'craftNo': '', |
| | | 'craftVersion': '', |
| | | 'processType': 0, |
| | | 'processingEquipmentModel': '', |
| | | 'processingEquipmentCode': '', |
| | | 'assembleStep': '', |
| | | 'assembleName': '', |
| | | 'description': '' |
| | | }, |
| | | { |
| | | 'processId': '1875082575626289153', |
| | | 'productId': '1326377675659276290', |
| | | 'componentId': '1327516286505054210', |
| | | 'partsId': null, |
| | | 'processName': '333', |
| | | 'processCode': '3213', |
| | | 'craftNo': '', |
| | | 'craftVersion': '', |
| | | 'processType': 0, |
| | | 'processingEquipmentModel': '', |
| | | 'processingEquipmentCode': '', |
| | | 'assembleStep': '', |
| | | 'assembleName': '', |
| | | 'description': '' |
| | | }, |
| | | { |
| | | 'processId': '1875082597210177537', |
| | | 'productId': '1326377675659276290', |
| | | 'componentId': '1327516286505054210', |
| | | 'partsId': null, |
| | | 'processName': '123', |
| | | 'processCode': 'sd', |
| | | 'craftNo': '', |
| | | 'craftVersion': '', |
| | | 'processType': 0, |
| | | 'processingEquipmentModel': '', |
| | | 'processingEquipmentCode': '', |
| | | 'assembleStep': '', |
| | | 'assembleName': '', |
| | | 'description': '' |
| | | }, |
| | | { |
| | | 'processId': '1875082616835325954', |
| | | 'productId': '1326377675659276290', |
| | | 'componentId': '1327516286505054210', |
| | | 'partsId': null, |
| | | 'processName': 'dadas', |
| | | 'processCode': 'sadsa', |
| | | 'craftNo': '', |
| | | 'craftVersion': '', |
| | | 'processType': 0, |
| | | 'processingEquipmentModel': '', |
| | | 'processingEquipmentCode': '', |
| | | 'assembleStep': '', |
| | | 'assembleName': '', |
| | | 'description': '' |
| | | }, |
| | | { |
| | | 'processId': '1875082638553432066', |
| | | 'productId': '1326377675659276290', |
| | | 'componentId': '1327516286505054210', |
| | | 'partsId': null, |
| | | 'processName': '1213', |
| | | 'processCode': 'das', |
| | | 'craftNo': '', |
| | | 'craftVersion': '', |
| | | 'processType': 0, |
| | | 'processingEquipmentModel': '', |
| | | 'processingEquipmentCode': '', |
| | | 'assembleStep': '', |
| | | 'assembleName': '', |
| | | 'description': '' |
| | | }, |
| | | { |
| | | 'processId': '1875082668072943617', |
| | | 'productId': '1326377675659276290', |
| | | 'componentId': '1327516286505054210', |
| | | 'partsId': null, |
| | | 'processName': 'zxccz', |
| | | 'processCode': 'asdasda', |
| | | 'craftNo': '', |
| | | 'craftVersion': '', |
| | | 'processType': 0, |
| | | 'processingEquipmentModel': '', |
| | | 'processingEquipmentCode': '', |
| | | 'assembleStep': '', |
| | | 'assembleName': '', |
| | | 'description': '' |
| | | } |
| | | ], |
| | | currentRowInfo: {}, |
| | | url: { |
| | | list: '', |
| | | add: '', |
| | | edit: '', |
| | | delete: '' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('menuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * èªå®ä¹è¡¨æ ¼è¡åè½ |
| | | * @param record è¡¨æ ¼è¡ä¿¡æ¯ |
| | | * @returns {{on: {contextmenu: on.contextmenu, click: on.click}}} è¿åäºä»¶æ¹æ³å¯¹è±¡ |
| | | */ |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRowInfo = Object.assign({}, record) |
| | | this.$emit('handleTableContextMenuOpen', { objectId: record.processId, param: 'process' }) |
| | | }, |
| | | click: () => { |
| | | this.$bus.$emit('sendCurrentLevelInfo', record) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»å建工åºèåæ¶è§¦å |
| | | * @param modalTitle |
| | | */ |
| | | handleProcessAdd(modalTitle) { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = modalTitle |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»ç¼è¾å·¥åºèåæ¶è§¦å |
| | | * @param modalTitle |
| | | */ |
| | | handleProcessEdit(modalTitle) { |
| | | this.$refs.modalForm.edit(this.currentRowInfo) |
| | | this.$refs.modalForm.title = modalTitle |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»å 餿¶è§¦å |
| | | */ |
| | | handleProcessDelete() { |
| | | this.$confirm({ |
| | | title: 'æç¤º', |
| | | content: '确认å 餿¤æ¡è®°å½åï¼', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | this.handleDelete(this.currentRowInfo.processId) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleProcessImport(modalTitle) { |
| | | this.$refs.importFileModal.visible = true |
| | | this.$refs.importFileModal.title = modalTitle |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, level, modalTitle }) { |
| | | if (level === 'process') this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ProcessStepInfo', |
| | | components: {}, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="产ååç§°">{{currentLevelDetails.productName}}</a-descriptions-item> |
| | | <a-descriptions-item label="产ååå·">{{currentLevelDetails.productModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="产å代ç ">{{currentLevelDetails.productNo}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createUser_dicText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateUser_dicText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ProductInfo', |
| | | components: {}, |
| | | props: { |
| | | currentLevelDetails: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <ProductModalForm ref="realForm" @ok="submitCallback"/> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProductModalForm from './ProductModalForm.vue' |
| | | |
| | | export default { |
| | | name: 'ProductModal', |
| | | components: { |
| | | ProductModalForm |
| | | }, |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | width: 500, |
| | | visible: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | handleProductAdd(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.add() |
| | | }) |
| | | }, |
| | | handleProductEdit(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.$refs.realForm.edit(this.currentTreeNodeInfo.entity) |
| | | }) |
| | | }, |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | submitCallback() { |
| | | this.$emit('ok') |
| | | this.visible = false |
| | | }, |
| | | handleCancel() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelColLong" |
| | | :wrapperCol="wrapperColLong"> |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="产ååç§°" prop="productName"> |
| | | <a-input v-model="model.productName" placeholder="请è¾å
¥äº§ååç§°"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="产å代å·" prop="productNo"> |
| | | <a-input v-model="model.productNo" placeholder="请è¾å
¥äº§å代å·"></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="产ååå·"> |
| | | <a-textarea v-model="model.productModel" placeholder="请è¾å
¥äº§ååå·"></a-textarea> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'ProductModalForm', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 14 } |
| | | }, |
| | | labelColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 4 } |
| | | }, |
| | | wrapperColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 19 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | productName: [ |
| | | { required: true, message: '请è¾å
¥äº§ååç§°!' } |
| | | ], |
| | | productNo: [ |
| | | { required: true, message: '请è¾å
¥äº§å代å·!' } |
| | | ], |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcPartProcessInfo/add', |
| | | edit: '/mdc/mdcPartProcessInfo/edit' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled() { |
| | | return this.disabled |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.modelDefault) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | console.log('model', this.model) |
| | | this.visible = true |
| | | }, |
| | | |
| | | submitForm() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl = '' |
| | | let method = 'post' |
| | | if (!this.model.id) { |
| | | httpUrl += this.url.add |
| | | } else { |
| | | httpUrl += this.url.edit |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="height: 100%;max-height: 748px"> |
| | | <!--产åç»ææ å³ä¾§é¡¶é¨åºå--> |
| | | <div style="height: 45%;overflow: hidden"> |
| | | <ProductStructureMainTop :size="tabContainerSize"/> |
| | | </div> |
| | | |
| | | <!--产åç»ææ å³ä¾§åºé¨åºå--> |
| | | <div style="height: 55%;overflow: hidden"> |
| | | <ProductStructureMainBottom :size="tabContainerSize"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProductStructureMainTop from './ProductStructureMainTop' |
| | | import ProductStructureMainBottom from './ProductStructureMainBottom' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMain', |
| | | components: { |
| | | ProductStructureMainTop, |
| | | ProductStructureMainBottom |
| | | }, |
| | | data() { |
| | | return { |
| | | tabContainerSize: 'small' |
| | | } |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-tabs style="height: 100%" v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0"> |
| | | <a-tab-pane :key="1" tab="产å屿§" v-if="currentLevelInfo.type===1"> |
| | | <ProductInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="1" tab="é¨ä»¶å±æ§" v-if="currentLevelInfo.type===2"> |
| | | <ComponentInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="1" tab="é¶ä»¶å±æ§" v-if="currentLevelInfo.type===3"> |
| | | <PartInfo :currentLevelDetails="currentLevelInfo.entity" :size="descriptionsContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="1" tab="å·¥åºå±æ§" v-if="currentLevelInfo.hasOwnProperty('processType')"> |
| | | <ProcessInfo :currentLevelDetails="currentLevelInfo" :size="descriptionsContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <template v-if="currentLevelInfo.hasOwnProperty('attributionType')"> |
| | | <a-tab-pane :key="1" tab="ææ¡£å±æ§"> |
| | | <DocumentInfo :currentLevelDetails="currentLevelInfo" :size="descriptionsContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="2" tab="é¢è§"> |
| | | |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="3" tab="ææ¡£çæ¬"> |
| | | <DocumentVersionTableList/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="4" tab="使ç¨è®¾å¤" v-if="currentLevelInfo.attributionType===5"> |
| | | <UseDocumentEquipmentTableList/> |
| | | </a-tab-pane> |
| | | </template> |
| | | </a-tabs> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProductInfo from './Product/ProductInfo' |
| | | import ComponentInfo from './Component/ComponentInfo' |
| | | import PartInfo from './Part/PartInfo' |
| | | import ProcessInfo from './Process/ProcessInfo' |
| | | import DocumentInfo from './Document/DocumentInfo' |
| | | import DocumentVersionTableList from './Document/DocumentVersionTableList' |
| | | import UseDocumentEquipmentTableList from './Document/UseDocumentEquipmentTableList' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMainBottom', |
| | | components: { |
| | | UseDocumentEquipmentTableList, |
| | | DocumentVersionTableList, |
| | | DocumentInfo, |
| | | ProcessInfo, |
| | | PartInfo, |
| | | ProductInfo, |
| | | ComponentInfo |
| | | }, |
| | | data() { |
| | | return { |
| | | activeTabKey: 1, |
| | | descriptionsContainerSize: 'small', |
| | | currentLevelInfo: {} |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentLevelInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentLevelInfo) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä»¥åè¡¨æ ¼ä¼ æ¥çå½åé䏿ç¹å»çé¡¹ä¿¡æ¯ |
| | | * @param levelInfo |
| | | */ |
| | | receiveCurrentLevelInfo(levelInfo) { |
| | | this.currentLevelInfo = levelInfo |
| | | if (levelInfo.attributionType) this.activeTabKey = 1 |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /deep/ .ant-tabs-content { |
| | | height: calc(100% - 65px); |
| | | } |
| | | |
| | | /deep/ .ant-tabs-tabpane { |
| | | overflow: auto; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()" |
| | | v-if="Object.keys(currentTreeNodeInfo).length!==0"> |
| | | <a-tab-pane :key="1" tab="NCææ¡£" v-if="currentTreeNodeInfo.type!==1"> |
| | | <NcDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="2" tab="å
¶ä»ææ¡£"> |
| | | <OtherDocumentTableList @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <TableContextMenu :currentTableRowInfo="currentTableRowInfo" ref="tableContextMenuRef"/> |
| | | </a-tabs> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProcessTableList from './Process/ProcessTableList' |
| | | import NcDocumentTableList from './Document/NcDocumentTableList' |
| | | import OtherDocumentTableList from './Document/OtherDocumentTableList' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMainTop', |
| | | components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList, ProcessTableList }, |
| | | data() { |
| | | return { |
| | | activeTabKey: '1', |
| | | tableContainerSize: 'small', |
| | | currentTableRowInfo: {}, |
| | | currentTreeNodeInfo: {} |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleTableContextMenuOpen(record) { |
| | | this.currentTableRowInfo = Object.assign({}, record) |
| | | this.$refs.tableContextMenuRef.currentMenuLevel = record.param |
| | | this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.tableContextMenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶ |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | if (treeNodeInfo.type !== 1) this.activeTabKey = 1 |
| | | else this.activeTabKey = 2 |
| | | }, |
| | | |
| | | /** |
| | | * æ§å¶å³é®èåç¹å»å
³é |
| | | */ |
| | | handleMenuClose() { |
| | | this.$refs.tableContextMenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleMenuClose) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /deep/ .ant-table-tbody .ant-table-row { |
| | | cursor: pointer; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal :title="title" :visible="visible" @cancel="handleModalClose" :maskClosable="false"> |
| | | <a-upload :multiple="true" :file-list="fileList" :remove="handleRemove" :before-upload="beforeUpload"> |
| | | <a-button type="primary"> |
| | | <a-icon type="import"/> |
| | | éåæä»¶ |
| | | </a-button> |
| | | </a-upload> |
| | | |
| | | <div style="margin-top: 16px">已鿩{{fileList.length}}个æä»¶</div> |
| | | |
| | | <template slot="footer"> |
| | | <a-button @click="handleModalClose">åæ¶</a-button> |
| | | <a-button |
| | | id="custom-upload-button" |
| | | type="primary" |
| | | :disabled="fileList.length === 0" |
| | | :loading="uploading" |
| | | @click="handleUpload" |
| | | > |
| | | {{ uploading ? 'ä¸ä¼ ä¸...' : 'ä¸ä¼ è³æå¡å¨' }} |
| | | </a-button> |
| | | </template> |
| | | |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ImportFileModal', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | title: '', |
| | | fileList: [], |
| | | uploading: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | handleImport(modalTitle) { |
| | | this.handleModalOpen(modalTitle) |
| | | }, |
| | | |
| | | handleRemove(file) { |
| | | const index = this.fileList.indexOf(file) |
| | | const newFileList = this.fileList.slice() |
| | | newFileList.splice(index, 1) |
| | | this.fileList = newFileList |
| | | }, |
| | | |
| | | beforeUpload(file) { |
| | | this.fileList = [...this.fileList, file] |
| | | return false |
| | | }, |
| | | |
| | | handleUpload() { |
| | | const { fileList } = this |
| | | const formData = new FormData() |
| | | fileList.forEach(file => { |
| | | formData.append('files[]', file) |
| | | }) |
| | | this.uploading = true |
| | | |
| | | // You can use any AJAX library you like |
| | | request({ |
| | | url: 'https://www.mocky.io/v2/5cc8019d300000980a055e76', |
| | | method: 'post', |
| | | processData: false, |
| | | data: formData, |
| | | success: () => { |
| | | this.fileList = [] |
| | | this.uploading = false |
| | | this.$message.success('upload successfully.') |
| | | }, |
| | | error: () => { |
| | | this.uploading = false |
| | | this.$message.error('upload failed.') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ§å¶æä»¶ä¸ä¼ çªå£å¼å¯å¹¶è®¾ç½®çªå£æ é¢ |
| | | * @param modalTitle çªå£æ é¢ |
| | | */ |
| | | handleModalOpen(modalTitle) { |
| | | this.title = modalTitle |
| | | this.visible = true |
| | | }, |
| | | |
| | | /** |
| | | * æ§å¶æä»¶ä¸ä¼ çªå£å
³éå¹¶æ¸
空æä»¶å表 |
| | | */ |
| | | handleModalClose() { |
| | | this.visible = false |
| | | this.fileList = [] |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-btn-primary#custom-upload-button { |
| | | color: #fff; |
| | | background-color: #67C23A; |
| | | border-color: #67C23A; |
| | | |
| | | &[disabled] { |
| | | color: rgba(0, 0, 0, 0.25); |
| | | background-color: #f5f5f5; |
| | | border-color: #d9d9d9; |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native="e=>e.preventDefault()"> |
| | | <a-spin :spinning="loading"> |
| | | <div style="display: flex;flex-direction: column;height: 100%"> |
| | | |
| | | <div style="display: flex"> |
| | | <a-input placeholder="è¾å
¥å
³é®åè¿è¡æç´¢" allowClear v-model="searchInput" |
| | | @change="handleSearchInputChange"/> |
| | | <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="expandedKeys = allTreeKeys">å±å¼ææ</a-menu-item> |
| | | <a-menu-item key="2" @click="expandedKeys = ['-1']">åå¹¶ææ</a-menu-item> |
| | | <a-menu-item key="3" @click="queryTreeData">å·æ°</a-menu-item> |
| | | </a-menu> |
| | | <a-button> |
| | | <a-icon type="bars"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | <a-button type="primary" @click="$refs.productModalFormRef.handleProductAdd('æ·»å 产å')"> |
| | | <a-icon type="plus"></a-icon> |
| | | 产å |
| | | </a-button> |
| | | </div> |
| | | |
| | | <!--产åç»ææ --> |
| | | <div style="flex: 1;overflow:auto;margin-top: 10px"> |
| | | <a-tree ref="tree" show-icon :checkStrictly="checkStrictly" :expandedKeys.sync="expandedKeys" |
| | | :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent" |
| | | @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick"> |
| | | <template slot="title" slot-scope="{ label, parentId, entity, key:treeKey,type}"> |
| | | <ProductStructureTreeContextMenu ref="contextMenuRef" |
| | | :treeParams="{label,treeKey,searchValue,type,entity}"/> |
| | | </template> |
| | | |
| | | <a-icon slot="switcherIcon" type="down"/> |
| | | <a-icon slot="product" type="shopping"/> |
| | | <a-icon slot="component" type="camera"/> |
| | | <a-icon slot="part" type="hdd"/> |
| | | </a-tree> |
| | | </div> |
| | | </div> |
| | | </a-spin> |
| | | |
| | | <!--产åå¼¹çª--> |
| | | <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected"/> |
| | | <!--é¶ä»¶å¼¹çª--> |
| | | <ComponentModal :currentTreeNodeInfo="rightClickSelected"/> |
| | | <!--导å
¥æä»¶å
Œ
±å¼¹çª--> |
| | | <ImportFileModal/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { deleteAction } from '@/api/manage' |
| | | import { mapActions } from 'vuex' |
| | | import ProductStructureTreeContextMenu from './modules/ProductStructureTree/ProductStructureTreeContextMenu' |
| | | import ProductModal from '../base/modules/ProductStructure/Product/ProductModal' |
| | | import ImportFileModal from './ImportFileModal' |
| | | import ComponentModal from '../base/modules/ProductStructure/Component/ComponentModal' |
| | | |
| | | export default { |
| | | name: 'ProductStructureTree', |
| | | components: { |
| | | ComponentModal, |
| | | ImportFileModal, |
| | | ProductModal, |
| | | ProductStructureTreeContextMenu |
| | | }, |
| | | data() { |
| | | return { |
| | | searchInput: '', |
| | | cardLoading: false, |
| | | loading: false, |
| | | treeDataSource: [], |
| | | selectedKeys: [], |
| | | expandedKeys: [], |
| | | searchValue: '', |
| | | dataList: [], |
| | | autoExpandParent: true, |
| | | checkStrictly: true, |
| | | allTreeKeys: [], |
| | | currentSelected: {}, |
| | | rightClickSelected: {}, |
| | | url: { |
| | | delete: '' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.queryTreeData() |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | ...mapActions(['QueryProduction']), |
| | | |
| | | queryTreeData() { |
| | | this.loading = true |
| | | this.cardLoading = true |
| | | this.QueryProduction().then(res => { |
| | | if (res.success) { |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | // this.treeDataSource = res.result |
| | | this.treeDataSource = [ |
| | | { |
| | | 'id': '1869253349344432129', |
| | | 'label': '[让å¤äºº]æµè¯', |
| | | 'iconClass': '', |
| | | 'parentId': '1869253349344432129', |
| | | 'children': [ |
| | | { |
| | | 'id': '1869254044432879617', |
| | | 'label': '[378]qgwqg', |
| | | 'iconClass': '', |
| | | 'parentId': '1869253349344432129', |
| | | 'children': [ |
| | | { |
| | | 'id': '1869260302133137410', |
| | | 'label': '[ggjuk]è°è°å»', |
| | | 'iconClass': '', |
| | | 'parentId': '1869254044432879617', |
| | | 'children': [ |
| | | { |
| | | 'id': '1869294654070075393', |
| | | 'label': '[8989]qwfq', |
| | | 'iconClass': '', |
| | | 'parentId': '1869260302133137410', |
| | | 'children': null, |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1869294654070075393', |
| | | 'parentId': '1869260302133137410', |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': 'qwfq', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 3, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': '8989', |
| | | 'componentStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2024-12-18 16:12:30', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | }, |
| | | { |
| | | 'id': '1869294701801254913', |
| | | 'label': '[888]7878', |
| | | 'iconClass': '', |
| | | 'parentId': '1869260302133137410', |
| | | 'children': null, |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1869294701801254913', |
| | | 'parentId': '1869260302133137410', |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': '7878', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 3, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': '888', |
| | | 'componentStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2024-12-18 16:12:41', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | }, |
| | | { |
| | | 'id': '1869294780935188482', |
| | | 'label': '[6855]ww', |
| | | 'iconClass': '', |
| | | 'parentId': '1869260302133137410', |
| | | 'children': null, |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1869294780935188482', |
| | | 'parentId': '1869260302133137410', |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': 'ww', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 3, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': '6855', |
| | | 'componentStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2024-12-18 16:13:00', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | }, |
| | | { |
| | | 'id': '1876199480437153794', |
| | | 'label': '[354]zzzzzzzzzzzzzzzzz', |
| | | 'iconClass': '', |
| | | 'parentId': '1869260302133137410', |
| | | 'children': null, |
| | | 'type': 3, |
| | | 'entity': { |
| | | 'partsId': '1876199480437153794', |
| | | 'partsName': 'zzzzzzzzzzzzzzzzz', |
| | | 'productId': '1869253349344432129', |
| | | 'componentId': '1869260302133137410', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'partsModel': '', |
| | | 'partsScale': '', |
| | | 'partsWeight': null, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'partsCode': '354', |
| | | 'partsStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2025-01-06 17:29:49', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869260302133137410' |
| | | } |
| | | ], |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1869260302133137410', |
| | | 'parentId': '1869254044432879617', |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': 'è°è°å»', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 2, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': 'ggjuk', |
| | | 'componentStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2024-12-18 13:56:00', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | } |
| | | ], |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1869254044432879617', |
| | | 'parentId': null, |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': 'qgwqg', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 1, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': '378', |
| | | 'componentStatus': 1, |
| | | 'description': '88', |
| | | 'createTime': '2022-12-18 13:32:48', |
| | | 'updateTime': '2024-12-18 13:32:48', |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '1254966905669160962' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | }, |
| | | { |
| | | 'id': '1869253419041181697', |
| | | 'label': '[876]为å
¨å½åäºç»', |
| | | 'iconClass': '', |
| | | 'parentId': '1869253349344432129', |
| | | 'children': null, |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1869253419041181697', |
| | | 'parentId': null, |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': '为å
¨å½åäºç»', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '56', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 1, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': '876', |
| | | 'componentStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2024-12-18 13:28:39', |
| | | 'updateTime': '2024-12-18 14:03:55', |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '1254966905669160962' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | }, |
| | | { |
| | | 'id': '1869294861876867073', |
| | | 'label': '[777]he', |
| | | 'iconClass': '', |
| | | 'parentId': '1869253349344432129', |
| | | 'children': [ |
| | | { |
| | | 'id': '1876087437913108481', |
| | | 'label': '[ddd]åç»´æ¤', |
| | | 'iconClass': '', |
| | | 'parentId': '1869294861876867073', |
| | | 'children': null, |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1876087437913108481', |
| | | 'parentId': '1869294861876867073', |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': 'åç»´æ¤', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 2, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': 'ddd', |
| | | 'componentStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2025-01-06 10:04:36', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | } |
| | | ], |
| | | 'type': 2, |
| | | 'entity': { |
| | | 'componentId': '1869294861876867073', |
| | | 'parentId': null, |
| | | 'productId': '1869253349344432129', |
| | | 'componentName': 'he', |
| | | 'materielCode': '', |
| | | 'materielDesp': '', |
| | | 'componentModel': '', |
| | | 'componentScale': '', |
| | | 'componentWeight': null, |
| | | 'rankLevel': 1, |
| | | 'assembleType': null, |
| | | 'produceType': null, |
| | | 'processType': null, |
| | | 'structureType': null, |
| | | 'componentCode': '777', |
| | | 'componentStatus': 1, |
| | | 'description': '', |
| | | 'createTime': '2024-12-18 16:13:20', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': '' |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': '1869253349344432129' |
| | | } |
| | | ], |
| | | 'type': 1, |
| | | 'entity': { |
| | | 'productId': '1869253349344432129', |
| | | 'productNo': '让å¤äºº', |
| | | 'productModel': '', |
| | | 'productName': 'æµè¯', |
| | | 'productStatus': 1, |
| | | 'createTime': '2024-12-18 13:28:22', |
| | | 'updateTime': null, |
| | | 'createUser': '1254966905669160962', |
| | | 'updateUser': null |
| | | }, |
| | | 'leaf': false, |
| | | 'rfield': null |
| | | } |
| | | ] |
| | | this.generateList(this.treeDataSource) |
| | | // this.expandedKeys = this.allTreeKeys |
| | | this.expandedKeys = [this.treeDataSource[0].id] |
| | | console.log('treeDataSource', this.treeDataSource) |
| | | } else { |
| | | this.$message.warn(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | this.cardLoading = false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹é䏿¶è§¦å |
| | | * @param selectedKeys éä¸èç¹key |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeSelect(selectedKeys, { node }) { |
| | | let record = node.dataRef |
| | | this.currentSelected = Object.assign({}, record) |
| | | this.selectedKeys = selectedKeys |
| | | // åå³ä¾§ç¶çº§ç»ä»¶åéå½åé䏿 èç¹ä¿¡æ¯ |
| | | this.$bus.$emit('sendCurrentTreeNodeInfo', this.currentSelected) |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å³é®åå»èç¹æ¶è§¦å |
| | | * @param event äºä»¶å¯¹è±¡ |
| | | * @param node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeRightClick({ event, node }) { |
| | | const record = node.dataRef |
| | | this.rightClickSelected = Object.assign({}, record) |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å³é®åå»èåä¸å 餿鮿¶è§¦å |
| | | */ |
| | | handleDelete() { |
| | | this.$confirm({ |
| | | title: 'æç¤º', |
| | | content: '确认å 餿¤æ¡è®°å½åï¼', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | console.log('this.rightClickSelected.id', this.rightClickSelected.id) |
| | | if (!this.url.delete) { |
| | | this.$message.error('请设置url.delete屿§!') |
| | | return |
| | | } |
| | | const that = this |
| | | deleteAction(that.url.delete, { id: this.rightClickSelected.id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.queryTreeData() |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å±å¼åå¹¶æ¶è§¦å |
| | | * @param expandedKeys å±å¼é¡¹key |
| | | */ |
| | | handleTreeExpand(expandedKeys) { |
| | | this.expandedKeys = expandedKeys |
| | | this.autoExpandParent = false |
| | | }, |
| | | |
| | | /* è¾å
¥æ¥è¯¢å
容ååæ¶è§¦å */ |
| | | handleSearchInputChange() { |
| | | let search = this.searchInput |
| | | let expandedKeys = this.dataList |
| | | .map(item => { |
| | | if (item.title != null) { |
| | | if (item.title.indexOf(search) > -1) { |
| | | return this.getParentKey(item.key, this.treeDataSource) |
| | | } |
| | | return null |
| | | } |
| | | }) |
| | | .filter((item, i, self) => item && self.indexOf(item) === i) |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: search, |
| | | autoExpandParent: true |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾è¾å
¥é¡¹çç¶çº§key |
| | | * @param key å项key |
| | | * @param tree å项 |
| | | */ |
| | | getParentKey(key, tree) { |
| | | let parentKey |
| | | for (let i = 0; i < tree.length; i++) { |
| | | const node = tree[i] |
| | | if (node.children) { |
| | | if (node.children.some(item => item.key === key)) { |
| | | parentKey = node.key |
| | | } else if ( |
| | | this.getParentKey(key, node.children)) { |
| | | parentKey = this.getParentKey(key, node.children) |
| | | } |
| | | } |
| | | } |
| | | return parentKey |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾æææ èç¹key |
| | | * @param data |
| | | */ |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | data[i].key = data[i].id |
| | | const node = data[i] |
| | | const key = node.id |
| | | const title = node.label |
| | | this.dataList.push({ key, title }) |
| | | this.allTreeKeys.push(key) |
| | | this.setTreeNodeIcon(node) |
| | | if (node.children) this.generateList(node.children) |
| | | } |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | }, |
| | | |
| | | /** |
| | | * 设置æ èç¹å¾æ |
| | | * @param treeNode |
| | | */ |
| | | setTreeNodeIcon(treeNode) { |
| | | switch (treeNode.type) { |
| | | case 1: |
| | | treeNode.slots = { icon: 'product' } |
| | | break |
| | | case 2: |
| | | treeNode.slots = { icon: 'component' } |
| | | break |
| | | case 3: |
| | | treeNode.slots = { icon: 'part' } |
| | | break |
| | | default: |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | /deep/ .ant-card-body { |
| | | padding: 0 12px 0 0; |
| | | } |
| | | |
| | | /deep/ .ant-card-body, /deep/ .ant-spin-nested-loading, /deep/ .ant-spin-container { |
| | | height: 100%; |
| | | } |
| | | |
| | | /deep/ .ant-tree-node-content-wrapper { |
| | | width: calc(100% - 24px); |
| | | } |
| | | |
| | | /deep/ .ant-tree-title, .ant-tree-title .ant-dropdown-trigger { |
| | | display: inline-block; |
| | | width: calc(100% - 24px) !important; |
| | | } |
| | | |
| | | .tree_con { |
| | | overflow: hidden; |
| | | } |
| | | |
| | | @media screen and (min-width: 1920px) { |
| | | .tree_con { |
| | | height: 748px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1680px) and (max-width: 1920px) { |
| | | .tree_con { |
| | | height: 748px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1400px) and (max-width: 1680px) { |
| | | .tree_con { |
| | | height: 600px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (min-width: 1280px) and (max-width: 1400px) { |
| | | .tree_con { |
| | | height: 501px !important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (max-width: 1280px) { |
| | | .tree_con { |
| | | height: 501px !important; |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-menu :style="menuStyle" @click="menuItemClick" v-if="menuVisible" mode="vertical"> |
| | | <template v-for="menuItem in defaultContextMenuList[currentMenuLevel]"> |
| | | <a-menu-item :key="menuItem.code" v-if="menuItem.show&&menuItem.subMenu.length===0"> |
| | | <a-icon :type="menuItem.icon"/> |
| | | {{menuItem.label}} |
| | | </a-menu-item> |
| | | |
| | | <a-sub-menu v-if="menuItem.subMenu.length>0"> |
| | | <span slot="title"><a-icon :type="menuItem.icon"/><span>{{menuItem.label}}</span></span> |
| | | |
| | | <a-menu-item v-for="subMenuItem in menuItem.subMenu" :key="subMenuItem.code" v-if="subMenuItem.show" |
| | | style="height: 32px;line-height: 32px"> |
| | | <a-icon :type="subMenuItem.icon"/> |
| | | {{subMenuItem.label}} |
| | | </a-menu-item> |
| | | </a-sub-menu> |
| | | </template> |
| | | </a-menu> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'TableContextMenu', |
| | | components: {}, |
| | | props: { |
| | | currentTableRowInfo: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | menuVisible: false, |
| | | menuStyle: { |
| | | position: 'fixed', |
| | | top: 0, |
| | | left: 0, |
| | | border: '1px solid #eee', |
| | | boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)', |
| | | zIndex: 999 |
| | | }, |
| | | currentMenuLevel: '', |
| | | defaultContextMenuList: { |
| | | //ææ¡£ |
| | | document: [ |
| | | { show: true, label: 'ç¼è¾ææ¡£ä¿¡æ¯', code: 'document_edit', subMenu: [], icon: 'edit' }, |
| | | { show: true, label: 'ææ´¾å°è®¾å¤', code: 'document_assign', subMenu: [], icon: 'cluster' }, |
| | | { show: false, label: '导åºNCç¨åº', code: 'document_export', subMenu: [], icon: 'export' }, |
| | | { show: true, label: '导å
¥NCç¨åº', code: 'document_import', subMenu: [], icon: 'import' }, |
| | | { show: true, label: 'ä¸è½½', code: 'document_download', subMenu: [], icon: 'download' }, |
| | | { show: true, label: 'å é¤', code: 'document_delete', subMenu: [], icon: 'delete' }, |
| | | { show: true, label: 'æ¹éå é¤', code: 'document_batch_remove', subMenu: [], icon: 'delete' }, |
| | | { |
| | | show: true, |
| | | label: 'çå½å¨æ', |
| | | subMenu: [ |
| | | { show: true, label: 'åºåº', code: 'document_pull', icon: 'export' }, |
| | | { show: true, label: 'åæ¶åºåº', code: 'document_cancel_pull', icon: 'stop' }, |
| | | { show: true, label: 'å
¥åº', code: 'document_push', icon: 'import' }, |
| | | { show: true, label: 'åå¸', code: 'document_publish', icon: 'flag' }, |
| | | { show: true, label: 'éæ°åå¸', code: 'document_republish', icon: 'reload' }, |
| | | { show: true, label: '彿¡£', code: 'document_pigeonhole', icon: 'database' } |
| | | ], |
| | | icon: 'delete' |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | menuItemClick({ item, key }) { |
| | | // process_add => handleProcessAdd 触å对åºç»ä»¶äºä»¶ |
| | | const methodName = 'handle' + key.split('_').map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | const modalTitle = this.defaultContextMenuList[this.currentMenuLevel].find(item => item.code === key).label |
| | | console.log('key', key) |
| | | this.$bus.$emit('menuItemMethodTrigger', { level: this.currentMenuLevel, methodName, modalTitle }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /deep/ .ant-menu-item { |
| | | height: 32px; |
| | | line-height: 32px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-dropdown :trigger="['contextmenu']"> |
| | | <span v-if="treeParams.label.indexOf(treeParams.searchValue) > -1">{{ treeParams.label.substr(0, treeParams.label.indexOf(treeParams.searchValue)) }}<span |
| | | class="replaceSearch">{{ treeParams.searchValue }}</span>{{ treeParams.label.substr(treeParams.label.indexOf(treeParams.searchValue) + treeParams.searchValue.length) }}</span> |
| | | <span v-else>{{ treeParams.label }}</span> |
| | | <template #overlay> |
| | | <a-menu @click="({ key: menuKey }) => onContextMenuClick(treeParams.treeKey, menuKey)" |
| | | @contextmenu="event=>event.preventDefault()"> |
| | | <template v-for="item in defaultContextMenuList[getCurrentMenuLevel]"> |
| | | <a-menu-item :key="item.code" v-if="item.show"> |
| | | <a-icon :type="item.icon"/> |
| | | {{item.label}} |
| | | </a-menu-item> |
| | | </template> |
| | | </a-menu> |
| | | </template> |
| | | </a-dropdown> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ProductStructureTreeContextMenu', |
| | | components: {}, |
| | | props: { |
| | | treeParams: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | defaultContextMenuList: { |
| | | //产å |
| | | product: [ |
| | | { show: true, label: 'æ·»å 产å', code: 'product_add', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'æ·»å é¨ä»¶', code: 'product_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'ç¼è¾äº§åä¿¡æ¯', code: 'product_edit', icon: 'edit', isCommonMethod: false }, |
| | | { show: false, label: 'å¯¼åºææ¡£', code: 'product_export', icon: 'export', isCommonMethod: true }, |
| | | { show: true, label: '导å
¥å
¶ä»ææ¡£', code: 'product_import', icon: 'import', isCommonMethod: true }, |
| | | { show: true, label: 'å é¤', code: 'product_delete', icon: 'delete', isCommonMethod: true }, |
| | | { show: true, label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¨ä»¶ |
| | | component: [ |
| | | { show: true, label: 'æ·»å åé¨ä»¶', code: 'component_add', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'æ·»å é¶ä»¶', code: 'component_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'å建工åº', code: 'component_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'ç¼è¾é¨ä»¶ä¿¡æ¯', code: 'component_edit', icon: 'edit', isCommonMethod: false }, |
| | | { show: false, label: 'å¯¼åºææ¡£', code: 'component_export', icon: 'export', isCommonMethod: true }, |
| | | { show: true, label: '导å
¥å
¶ä»ææ¡£', code: 'component_import', icon: 'import', isCommonMethod: true }, |
| | | { show: true, label: 'å é¤', code: 'component_delete', icon: 'delete', isCommonMethod: true }, |
| | | { show: true, label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¶ä»¶ |
| | | part: [ |
| | | { show: true, label: 'æ·»å é¶ä»¶', code: 'parts_add', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'å建工åº', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'ç¼è¾é¶ä»¶ä¿¡æ¯', code: 'parts_edit', icon: 'edit', isCommonMethod: false }, |
| | | { show: false, label: 'å¯¼åºææ¡£', code: 'parts_export', icon: 'export', isCommonMethod: true }, |
| | | { show: true, label: '导å
¥å
¶ä»ææ¡£', code: 'parts_import', icon: 'import', isCommonMethod: true }, |
| | | { show: true, label: 'å é¤', code: 'parts_delete', icon: 'delete', isCommonMethod: true }, |
| | | { show: true, label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥åº |
| | | process: [ |
| | | { show: true, label: 'å建工åº', code: 'process_add', icon: 'plus', isCommonMethod: false }, |
| | | { show: true, label: 'ç¼è¾å·¥åºä¿¡æ¯', code: 'process_edit', icon: 'edit', isCommonMethod: false }, |
| | | { show: true, label: 'å é¤', code: 'process_delete', icon: 'delete', isCommonMethod: true }, |
| | | { show: false, label: '导åºNCç¨åº', code: 'process_export', icon: 'import', isCommonMethod: true }, |
| | | { show: true, label: '导å
¥NCç¨åº', code: 'process_import', icon: 'export', isCommonMethod: true } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | getCurrentMenuLevel() { |
| | | switch (this.treeParams.type) { |
| | | case 1: |
| | | return 'product' |
| | | case 2: |
| | | return 'component' |
| | | case 3: |
| | | return 'part' |
| | | case 4: |
| | | return 'process' |
| | | case 5: |
| | | return 'processStep' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | onContextMenuClick(treeKey, menuKey) { |
| | | const level = this.getCurrentMenuLevel |
| | | const menuKeyArray = menuKey.split('_') |
| | | const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod |
| | | // product_add => handleAdd 触å对åºç»ä»¶äºä»¶ |
| | | let methodName |
| | | // 夿æ¯å¦ä¸ºå
Œ
±æ¹æ³ï¼å¦æä¸ºå
Œ
±æ¹æ³åæªå䏿屿§product/component/part/processçåæ®µ |
| | | if (isCommonMethod) { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('') |
| | | } else { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | } |
| | | console.log('methodName------------------------------------', methodName) |
| | | const modalTitle = this.defaultContextMenuList[level].find(item => item.code === menuKey).label |
| | | this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | } |
| | | |
| | | </style> |