2025-07-09 17:32:09 +08:00
< template >
< div class = "p-2" >
<!-- 查询区域 -- >
< div class = "jeecg-basic-table-form-container" >
< a -form ref = "formRef" @keyup.enter.native ="searchQuery" :model ="queryParam" :label-col ="labelCol"
: wrapper - col = "wrapperCol" >
< a -row :gutter ="24" >
2025-08-07 16:02:25 +08:00
< a -col :lg ="6" >
2025-07-09 17:32:09 +08:00
< a -form -item name = "instructionTagId" >
< template # label > < span title = "分类标签" > 分类标签 < / span > < / template >
2025-08-07 16:02:25 +08:00
< j -dict -select -tag v -model :value ="queryParam.instructionTagId"
: dictCode = "`nu_config_service_instruction_tag,instruction_name,id,del_flag = 0 and iz_enabled = 0 order by sort asc`"
: orgCode = "queryParam.dataSourceCode" : ignoreDisabled = "true" placeholder = "请选分类标签" allowClear / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :lg ="6" >
< a -form -item name = "categoryId" >
< template # label > < span title = "服务类别" > 服务类别 < / span > < / template >
< j -dict -select -tag type = "list" v -model :value ="queryParam.categoryId" :orgCode ="queryParam.dataSourceCode"
: dictCode = "`nu_config_service_category,category_name,id,del_flag = 0 and iz_enabled = 0 and instruction_id = '${queryParam.instructionTagId || ''}' order by sort asc`"
: ignoreDisabled = "true" placeholder = "请选择服务类别" allow - clear / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :lg ="6" >
< a -form -item name = "typeId" >
< template # label > < span title = "服务类型" > 服务类型 < / span > < / template >
< j -dict -select -tag type = "list" v -model :value ="queryParam.typeId" :orgCode ="queryParam.dataSourceCode"
: dictCode = "`nu_config_service_type,type_name,id,del_flag = 0 and iz_enabled = 0 and category_id = '${queryParam.categoryId || ''}' order by sort asc`"
placeholder = "请选择服务类型" : ignoreDisabled = "true" allowClear / >
< / a - f o r m - i t e m >
< / a - c o l >
2025-07-09 17:32:09 +08:00
< a -col :lg ="6" >
< a -form -item name = "directiveName" >
< template # label > < span title = "服务指令" > 服务指令 < / span > < / template >
< JInput v -model :value ="queryParam.directiveName" placeholder = "请输入服务指令名称" allowClear / >
< / a - f o r m - i t e m >
< / a - c o l >
2025-08-07 16:02:25 +08:00
< a -col :lg ="6" >
< a -form -item name = "cycleType" >
< template # label > < span title = "周期类型" > 周期类型 < / span > < / template >
< j -dict -select -tag type = "list" v -model :value ="queryParam.cycleType" :orgCode ="queryParam.dataSourceCode"
dictCode = "period_type" placeholder = "请选择周期类型" : ignoreDisabled = "true" allowClear / >
< / a - f o r m - i t e m >
< / a - c o l >
2025-07-09 17:32:09 +08:00
<!-- < a -col :lg ="6" >
< a -form -item name = "bodyTags" >
< template # label > < span title = "体型标签" > 体型标签 < / span > < / template >
< j -dict -select -tag type = 'list' v -model :value ="queryParam.bodyTags"
2025-08-07 16:02:25 +08:00
: dictCode = "`nu_config_body_tag,tag_name,id,del_flag = '0' and iz_enabled = 0 order by sort asc`" : ignoreDisabled = "true"
2025-07-09 17:32:09 +08:00
placeholder = "请选择体型标签" allowClear / >
< / a - f o r m - i t e m >
< / a - c o l >
< a -col :lg ="6" >
< a -form -item name = "emotionTags" >
< template # label > < span title = "情绪标签" > 情绪标签 < / span > < / template >
< j -dict -select -tag type = "list" v -model :value ="queryParam.emotionTags"
2025-08-07 16:02:25 +08:00
: dictCode = "`nu_config_emotion_tag,tag_name,id,del_flag = '0' and iz_enabled = 0 order by sort asc`" : ignoreDisabled = "true"
2025-07-09 17:32:09 +08:00
placeholder = "请选择情绪标签" allowClear / >
< / a - f o r m - i t e m >
< / a - c o l > - - >
2025-07-29 09:09:15 +08:00
<!-- < a -col :lg ="6" >
2025-07-09 17:32:09 +08:00
< a -form -item name = "izEnabled" >
< template # label > < span title = "是否启用" > 是否启用 < / span > < / template >
< j -dict -select -tag type = 'list' v -model :value ="queryParam.izEnabled" dictCode = "iz_enabled"
: ignoreDisabled = "true" placeholder = "请选择是否启用" allowClear / >
< / a - f o r m - i t e m >
2025-07-29 09:09:15 +08:00
< / a - c o l > - - >
2025-07-09 17:32:09 +08:00
< a -col :xl ="6" :lg ="7" :md ="8" :sm ="24" >
< span style = "float: left; overflow: hidden" class = "table-page-search-submitButtons" >
< a -col :lg ="6" >
< a -button type = "primary" preIcon = "ant-design:search-outlined" @click ="searchQuery" > 查询 < / a -button >
< a -button type = "primary" preIcon = "ant-design:reload-outlined" @click ="searchReset"
style = "margin-left: 8px" > 重置 < / a - b u t t o n >
< / a - c o l >
< / span >
< / a - c o l >
< / a - r o w >
< / a - f o r m >
< / div >
<!-- 引用表格 -- >
< BasicTable @register ="registerTable" >
<!-- 插槽 : table标题 -- >
< template # tableTitle >
< / template >
< template v -slot : bodyCell = "{ column, record, index, text }" >
< template v-if ="column.dataIndex === 'bodyTagList'" >
< span : title = "text.map((item) => item.tagName).join('、')" > { { text . map ( ( item ) =>
item . tagName ) . join ( '、' ) } } < / span >
< / template >
< template v-if ="column.dataIndex === 'emotionTagList'" >
< span : title = "text.map((item) => item.tagName).join('、')" > { { text . map ( ( item ) =>
item . tagName ) . join ( '、' ) } } < / span >
< / template >
< / template >
< / BasicTable >
< / div >
< / template >
< script lang = "ts" name = "serviceDirective-configServiceDirective" setup >
import { ref , reactive , onMounted } from 'vue' ;
import { BasicTable , TableAction } from '/@/components/Table' ;
import { useListPage } from '/@/hooks/system/useListPage' ;
import { columns , superQuerySchema } from './ConfigServiceDirective.data' ;
2025-07-23 17:29:11 +08:00
import { listByDS } from './ConfigServiceDirective.api' ;
2025-07-09 17:32:09 +08:00
import { useUserStore } from '/@/store/modules/user' ;
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue" ;
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue' ;
import { cloneDeep } from "lodash-es" ;
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils' ;
const formRef = ref ( ) ;
const queryParam = reactive < any > ( { } ) ;
const toggleSearchStatus = ref < boolean > ( false ) ;
const registerModal = ref ( ) ;
const userStore = useUserStore ( ) ;
//注册table数据
const { prefixCls , tableContext , onExportXls , onImportXls } = useListPage ( {
tableProps : {
title : '服务指令' ,
2025-07-23 17:29:11 +08:00
api : listByDS ,
2025-07-09 17:32:09 +08:00
columns ,
canResize : false ,
useSearchForm : false ,
showIndexColumn : true ,
showActionColumn : false ,
immediate : false ,
pagination : {
current : 1 ,
pageSize : 10 ,
pageSizeOptions : [ '10' , '20' , '50' , '100' ] ,
} ,
beforeFetch : async ( params ) => {
2025-07-29 09:09:15 +08:00
queryParam . izEnabled = '0'
2025-07-09 17:32:09 +08:00
return Object . assign ( params , queryParam ) ;
} ,
actionColumn : {
width : 160 ,
fixed : 'right' ,
} ,
} ,
} ) ;
const [ registerTable , { reload , collapseAll , updateTableDataRecord , findTableDataRecord , getDataSource } , { rowSelection , selectedRowKeys } ] = tableContext ;
const labelCol = reactive ( {
xs : 24 ,
sm : 6 ,
xl : 6 ,
xxl : 6
} ) ;
const wrapperCol = reactive ( {
xs : 24 ,
sm : 18 ,
} ) ;
/ * *
* 查询
* /
function searchQuery ( ) {
reload ( ) ;
}
/ * *
* 重置
* /
function searchReset ( ) {
formRef . value . resetFields ( ) ;
selectedRowKeys . value = [ ] ;
//刷新数据
reload ( ) ;
}
2025-07-23 17:29:11 +08:00
function init ( record ) {
queryParam . dataSourceCode = record . orgCode ;
reload ( ) ;
2025-07-09 17:32:09 +08:00
}
2025-07-23 17:29:11 +08:00
defineExpose ( {
init ,
} ) ;
2025-07-09 17:32:09 +08:00
< / script >
< style lang = "less" scoped >
. jeecg - basic - table - form - container {
padding : 0 ;
. table - page - search - submitButtons {
display : block ;
margin - bottom : 24 px ;
white - space : nowrap ;
}
. query - group - cust {
min - width : 100 px ! important ;
}
. query - group - split - cust {
width : 30 px ;
display : inline - block ;
text - align : center
}
. ant - form - item : not ( . ant - form - item - with - help ) {
margin - bottom : 16 px ;
height : 32 px ;
}
: deep ( . ant - picker ) ,
: deep ( . ant - input - number ) {
width : 100 % ;
}
}
audio : : - webkit - media - controls - timeline {
display : none ;
}
audio : : - webkit - media - controls - current - time - display ,
audio : : - webkit - media - controls - time - remaining - display {
display : none ;
}
. btnPrivate {
height : 34 px ;
margin - left : 4 px ;
}
< / style >