¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <basic-container> |
| | | <div class="testbox"> |
| | | <div style="margin-top: 10px;display: flex;flex-wrap: wrap;width: 100%;"> |
| | | <el-button plain size="small" type="primary" @click="addvisible=true">å¢å |
| | | </el-button> |
| | | <FormTemplateDialog |
| | | :codeClassifyOid="this.codeClassifyOid" |
| | | :codeRuleOid="this.codeRuleOid" |
| | | :disabledProp="disabledProp" |
| | | :templateOid="templateOid" |
| | | type="add" |
| | | :visible.sync="addvisible" |
| | | @submit="AddSumbit" |
| | | > |
| | | </FormTemplateDialog> |
| | | <el-button plain size="small" type="primary" @click="editHandler">ç¼è¾ |
| | | </el-button> |
| | | <FormTemplateDialog |
| | | :codeClassifyOid="this.codeClassifyOid" |
| | | :codeRuleOid="this.codeRuleOid" |
| | | :disabledProp="disabledProp" |
| | | :rowOid="rowOid" |
| | | :templateOid="templateOid" |
| | | type="edit" |
| | | :title="'ä¿®æ¹ç¼ç ä¿¡æ¯'" |
| | | :visible.sync="editvisible" |
| | | @submit="EditSumbit" |
| | | ></FormTemplateDialog> |
| | | <el-button plain size="small" type="primary">æ¹é导å
¥ç³è¯·</el-button> |
| | | <el-button plain size="small" type="primary">å岿°æ®å¯¼å
¥</el-button> |
| | | <el-button plain size="small" type="primary">æ¹éç³è¯·ç¼ç </el-button> |
| | | <el-button plain size="small" type="primary">æ¹éåå¸</el-button> |
| | | <el-button plain size="small" type="primary">æ¥çæµç¨åå²</el-button> |
| | | <el-button plain size="small" type="primary">å é¤</el-button> |
| | | <el-button plain size="small" type="primary" @click="setHandler">åå¸</el-button> |
| | | <set-personnel :visible.sync="visibleFlow" :parameter="this.parameter" |
| | | ></set-personnel> |
| | | <el-button plain size="small" type="primary" @click="DataChange">æ°æ®æ´æ¹</el-button> |
| | | <FormTemplateDialog |
| | | :codeClassifyOid="this.codeClassifyOid" |
| | | :codeRuleOid="this.codeRuleOid" |
| | | :disabledProp="disabledProp" |
| | | :rowOid="rowOid" |
| | | :templateOid="templateOid" |
| | | :type="edit" |
| | | :title="'å·²å叿°æ®æ´æ¹'" |
| | | :visible.sync="DataVisible" |
| | | ></FormTemplateDialog> |
| | | <el-button plain size="small" type="primary" @click="huishouHandler">åæ¶</el-button> |
| | | <el-button plain size="small" type="primary" @click="openD">å¯¼åº |
| | | <integration-transfer :data="transferData" :props="transferProps" |
| | | :visible.sync="dialogPush" @save="handelTransferSave"></integration-transfer> |
| | | </el-button> |
| | | <el-button plain size="small" type="primary" @click="findHandler">æ¥è¯¢ |
| | | <advanced-query :options="this.options" :visible.sync="findvisible" |
| | | @echoContion="echoContion"></advanced-query> |
| | | </el-button> |
| | | <el-button plain size="small" type="primary" @click="similarHandler">ç¸ä¼¼é¡¹æ¥è¯¢</el-button> |
| | | <ResembleQueryDialog |
| | | :visible.sync="similarVisible" |
| | | :templateOid="templateOid" |
| | | :codeClassifyOid="codeClassifyOid" |
| | | :rowOid="rowOid" |
| | | :codeRuleOid="this.codeRuleOid" |
| | | ></ResembleQueryDialog> |
| | | <el-button plain size="small" style="margin-left: 1px;margin-top:10px" type="primary">å·æ°</el-button> |
| | | <el-input placeholder="请è¾å
¥å
³é®åæå车æ¥è¯¢" size="small" |
| | | style="width: 180px;margin-left: 5px;margin-top:10px"></el-input> |
| | | </div> |
| | | <el-row style="height: 700px;width: 100%"> |
| | | <el-table v-loading="isLoading" :data="tableData" max-height="700" style="" @cell-click="handleCellClick" |
| | | @selection-change="handleSelectionChange" @sort-change="sortChange" v-if="tableData.length != 0"> |
| | | <el-table-column |
| | | fixed |
| | | type="selection" |
| | | width="55"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | fixed |
| | | label="åºå·" |
| | | type="index" |
| | | width="55"> |
| | | </el-table-column> |
| | | <!-- <div>--> |
| | | <el-table-column v-for="(item,index) in this.tableHeadFindData" :key="item.id" :label="item.label" :prop="item.prop" :sortable="item.sortable" > |
| | | <!-- ç¼è¾åå±ç¤ºé»è¾ --> |
| | | <!-- <template slot-scope="{ row }">--> |
| | | <!-- <el-input v-if="editingRow === row && editShow== item.prop" v-model="row[item.prop]" @blur="saveRow"></el-input>--> |
| | | <!-- <span v-else>{{row[item.prop]}}</span>--> |
| | | <!-- <el-switch--> |
| | | <!-- v-if="editShow === 'true'"--> |
| | | <!-- v-model="row[item.prop]"--> |
| | | <!-- active-color="#13ce66"--> |
| | | <!-- inactive-color="#ff4949">--> |
| | | <!-- </el-switch>--> |
| | | <!-- </template>--> |
| | | </el-table-column> |
| | | <!-- </div>--> |
| | | </el-table> |
| | | </el-row> |
| | | </div> |
| | | <div class="block" style="display: flex;justify-content: flex-end"> |
| | | <el-pagination |
| | | :current-page="page.currentPage" |
| | | :page-size="page.pageSizes" |
| | | :page-sizes="page.pageSizes" |
| | | :total="page.total" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | </div> |
| | | </basic-container> |
| | | </template> |
| | | <script> |
| | | import {MasterTable, TableData,FindData} from "@/api/GetItem"; |
| | | import {listCodeAttributeByClassId} from '@/api/integration/integration.js' |
| | | import integrationTransfer from '@/views/integration/integrationTransfer' |
| | | import SetPersonnel from '@/components/template/SetPersonnel' |
| | | import ResembleQueryDialog from "@/components/FormTemplate/ResembleQueryDialog.vue"; |
| | | export default { |
| | | components: { |
| | | integrationTransfer, |
| | | SetPersonnel, |
| | | ResembleQueryDialog |
| | | }, |
| | | name: "Crud.vue", |
| | | props: { |
| | | page: { |
| | | type: Object, |
| | | default: () => { |
| | | return {} |
| | | } |
| | | }, |
| | | codeClassifyOid: { |
| | | type: String, |
| | | default: "" |
| | | }, |
| | | coderuleoid: { |
| | | type: String, |
| | | default: "" |
| | | }, |
| | | tableDataArray: { |
| | | type: Array, |
| | | }, |
| | | total: { |
| | | type: String, |
| | | default: "" |
| | | }, |
| | | templateOid: { |
| | | type: String, |
| | | default:'' |
| | | }, |
| | | tableHeadDataFateher: { |
| | | type: Array, |
| | | }, |
| | | isLoading: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | tableHeadFindData:{ |
| | | type:Array, |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | //ç¸ä¼¼é¡¹æ¥è¯¢ |
| | | similarVisible:false, |
| | | //åå¸ |
| | | parameter:{ |
| | | ids:[], |
| | | code:'', |
| | | type:'PUBLIC', |
| | | template:'模æ¿template' |
| | | }, |
| | | visibleFlow: false, |
| | | transferData: [], |
| | | transferProps: { |
| | | key: 'oid', |
| | | label: 'name' |
| | | }, |
| | | tableHeadFindDatas:[], |
| | | addvisible: false, |
| | | editvisible: false, |
| | | findvisible: false, |
| | | dialogPush: false, |
| | | rowOid: '', |
| | | disabledProp: ["id"], |
| | | editingRow: null, |
| | | editShow: "", |
| | | editAttr: "", |
| | | data: [], |
| | | options: {}, |
| | | option: { |
| | | column: [] |
| | | }, |
| | | List: [], |
| | | columnType: { |
| | | text: "input", |
| | | combox: "select", |
| | | truefalse: "switch", |
| | | number: "number", |
| | | datetime: "datetime", |
| | | }, |
| | | tableData: [], |
| | | DataVisible:false, |
| | | tableHeadData: [], |
| | | items: {}, |
| | | seniorQueryColumns: [], |
| | | selectRow: [] |
| | | } |
| | | }, |
| | | computed: {}, |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | }, |
| | | activated() { |
| | | this.doLayout() |
| | | }, |
| | | watch: { |
| | | codeClassifyOid: { |
| | | handler(newval, oldval) { |
| | | this.codeClassifyOid = newval; |
| | | |
| | | }, |
| | | deep: true |
| | | }, |
| | | tableDataArray: { |
| | | handler(newval, oldval) { |
| | | this.tableData = newval; |
| | | } |
| | | }, |
| | | tableHeadFindData:{ |
| | | handler(newval, oldval) { |
| | | this.tableHeadFindDatas = newval; |
| | | } |
| | | }, |
| | | total: { |
| | | handler(newval, oldval) { |
| | | this.page.total = newval; |
| | | } |
| | | }, |
| | | templateOid:{ |
| | | handler(newval,oldval) { |
| | | this.parameter.code=newval; |
| | | }, |
| | | deep:true |
| | | } |
| | | }, |
| | | methods: { |
| | | setHandler() { |
| | | |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ°æ®') |
| | | } else { |
| | | this.visibleFlow = true; |
| | | } |
| | | }, |
| | | openD() { |
| | | this.dialogPush = true; |
| | | this.getListCodeByClassId() |
| | | }, |
| | | async getListCodeByClassId() { |
| | | this.transferData = [] |
| | | const response = await listCodeAttributeByClassId({codeClassifyId: this.codeClassifyOid}) |
| | | if (response.status === 200) { |
| | | const data = response.data.data |
| | | this.transferData = data |
| | | } |
| | | }, |
| | | rend() { |
| | | this.tableData = this.tableHeadData |
| | | }, |
| | | handleSizeChange(val) { |
| | | this.isLoading = true; |
| | | setTimeout(() => { |
| | | this.page.pageSize = val |
| | | this.$emit('pageSize', val) |
| | | this.CrudRend() |
| | | }, 3000); |
| | | |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.isLoading = true; |
| | | setTimeout(() => { |
| | | this.page.currentPage = val |
| | | this.$emit('currentPage', val) |
| | | this.CrudRend() |
| | | }, 3000); |
| | | }, |
| | | // çå¬åå
æ ¼ç¹å»äºä»¶å¹¶å卿£å¨ç¼è¾çè¡ |
| | | handleCellClick(row, column) { |
| | | this.editingRow = row; |
| | | this.editShow = column.property; |
| | | this.rowOid = row.oid |
| | | }, |
| | | //å é¤ |
| | | enumDeleteRow(row) { |
| | | this.tableData.splice(row, 1) |
| | | }, |
| | | // å°æ£å¨ç¼è¾çè¡çç¶æå为 null ï¼å³éåºç¼è¾ç¶æ |
| | | saveRow() { |
| | | this.editingRow = null; |
| | | }, |
| | | doLayout() { |
| | | this.$nextTick(() => { |
| | | this.$refs.crud.doLayout(); |
| | | }); |
| | | }, |
| | | //è¡¨æ ¼å¤´æ¸²æ |
| | | CrudHeaderRend() { |
| | | if (this.codeClassifyOid != "") { |
| | | MasterTable({ |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | functionId: 5, |
| | | }).then(res => { |
| | | this.options = res.data.tableDefineVO.seniorQueryColumns |
| | | this.List = res.data.tableDefineVO.cols[0]; |
| | | this.List.forEach(item => { |
| | | let columnItem = { |
| | | label: item.title, |
| | | prop: item.field, |
| | | type: this.columnType[item.type], |
| | | sortable: item.sort, |
| | | width: item.minWidth |
| | | }; |
| | | this.option.column.push(columnItem); |
| | | this.option.column = this.tableHeadData; |
| | | this.templateOid = res.data.tableDefineVO.oid |
| | | this.$emit('templateOid', this.templateOid) |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | //è¡¨æ ¼æ°æ® |
| | | CrudRend() { |
| | | TableData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | }).then(res => { |
| | | this.page.total = res.data.total; |
| | | this.data = res.data.data; |
| | | this.tableData = res.data.data; |
| | | }) |
| | | }, |
| | | // æåº |
| | | sortChange(val) { |
| | | this.isLoading = true; |
| | | let order = "" |
| | | if (val.order == "ascending") { |
| | | order = "asc"; |
| | | } else { |
| | | order = "desc"; |
| | | } |
| | | TableData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | order: order, |
| | | sort: val.prop, |
| | | page: this.page.currentPage, |
| | | limit: this.page.pageSize, |
| | | }).then(res => { |
| | | setTimeout(() => { |
| | | this.data = res.data.data; |
| | | this.isLoading = false; |
| | | }, 100); |
| | | }) |
| | | }, |
| | | //å页巿° |
| | | async onLoad(val) { |
| | | console.log('å页', this.templateOid) |
| | | await TableData({ |
| | | templateOid: this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | page: val.currentPage, |
| | | limit: val.pageSize, |
| | | }).then(res => { |
| | | this.data = res.data.data; |
| | | }) |
| | | }, |
| | | //å¤é |
| | | handleSelectionChange(row) { |
| | | if(this.row){ |
| | | this.rowOid = row[0].oid; |
| | | }else { |
| | | this.rowOid='' |
| | | } |
| | | this.selectRow = row; |
| | | console.log(row) |
| | | row.forEach(item=>{ |
| | | this.parameter.ids.push(item.oid) |
| | | console.log( this.parameter.ids) |
| | | }) |
| | | }, |
| | | //ç¼è¾ |
| | | editHandler() { |
| | | console.log('row',this.rowOid) |
| | | console.log('temp',this.templateOid) |
| | | console.log('code',this.codeClassifyOid) |
| | | console.log('rule',this.coderuleoid) |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ°æ®') |
| | | } else if (this.selectRow.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ°æ®') |
| | | } else if (this.selectRow[0].lcstatus != 'Editing') { |
| | | this.$message.warning('ç¼ç ç¶æä¸æ¯âç¼è¾ä¸â,ä¸å¯ç¼è¾') |
| | | } else { |
| | | this.editvisible = true |
| | | } |
| | | }, |
| | | //é«çº§æ¥è¯¢æé® |
| | | findHandler(){ |
| | | this.findvisible=true; |
| | | console.log(this.options) |
| | | }, |
| | | // é«çº§æ¥è¯¢ |
| | | echoContion(val) { |
| | | console.log(val) |
| | | FindData({templateOid:this.templateOid, |
| | | codeClassifyOid: this.codeClassifyOid, |
| | | ...val |
| | | }).then(res=>{ |
| | | console.log(res) |
| | | }) |
| | | }, |
| | | //ç¸ä¼¼é¡¹æ¥è¯¢ |
| | | similarHandler(){ |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ°æ®') |
| | | } else if (this.selectRow.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ°æ®') |
| | | } else { |
| | | this.similarVisible=true; |
| | | } |
| | | |
| | | }, |
| | | //æ°æ®æ´æ¹ |
| | | DataChange(){ |
| | | if (this.selectRow.length <= 0) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡æ°æ®') |
| | | } else if (this.selectRow.length > 1) { |
| | | this.$message.warning('åªè½éæ©ä¸æ¡æ°æ®') |
| | | } else if (this.selectRow[0].lcstatus != 'Released') { |
| | | this.$message.warning('åªæç¶æä¸ºå·²åå¸çæ°æ®æè½è¿è¡æ°æ®æ´æ¹') |
| | | } else { |
| | | this.DataVisible = true |
| | | } |
| | | }, |
| | | //å¢å ä¿å |
| | | AddSumbit(val){ |
| | | console.log(val) |
| | | this.addvisible=false |
| | | }, |
| | | EditSumbit(val){ |
| | | console.log(val) |
| | | this.editvisible=false |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .testbox { |
| | | .el-table--scrollable-x .el-table__body-wrapper { |
| | | overflow: auto !important; |
| | | } |
| | | |
| | | .el-table__fixed-right-patch { |
| | | background-color: #f5f7fa !important; |
| | | } |
| | | } |
| | | </style> |