|
@@ -121,10 +121,11 @@
|
|
|
</el-button>
|
|
|
</HcTooltip>
|
|
|
<HcTooltip keys="data-query-resign-title">
|
|
|
- <el-button
|
|
|
+ <el-button
|
|
|
+
|
|
|
:disabled="tableCheckedKeys.length <= 0"
|
|
|
- :loading="resignTitleLoading" hc-btn
|
|
|
- color="#3F9EFF" style="color: white;" @click="resignTitleClick"
|
|
|
+ hc-btn
|
|
|
+ color="#3F9EFF" style="color: white;" :loading="ruleModalSaveLoad" @click="resignTitleClick"
|
|
|
>
|
|
|
<HcIcon name="restart" />
|
|
|
<span>重置题名</span>
|
|
@@ -294,6 +295,76 @@
|
|
|
</el-radio-group>
|
|
|
</div>
|
|
|
</hc-new-dialog>
|
|
|
+
|
|
|
+ <!-- 重置文件题名弹窗 -->
|
|
|
+ <hc-new-dialog v-model="resignTitleModal" title="重置题名" widths="38rem" :loading="resignTitleSaveLoad" @save="resignTitleSave">
|
|
|
+ <div>
|
|
|
+ 是否更改题名规则:
|
|
|
+ <el-button type="primary" hc-btn size="small" @click="changeRuleClick">规则更改</el-button>
|
|
|
+ </div>
|
|
|
+ </hc-new-dialog>
|
|
|
+ <!-- 规则修改弹窗 -->
|
|
|
+ <hc-new-dialog v-model="ruleModal" title="更改重置题名题名规则" widths="88rem" :loading="ruleModalSaveLoad" @close="ruleModalClose" @save="ruleModalSave">
|
|
|
+ <template #header>
|
|
|
+ <div class="flex flex-col">
|
|
|
+ <div class="mb-4 text-18px">
|
|
|
+ <span>更改重置题名题名规则</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex justify-between justify-items-center text-orange">
|
|
|
+ <p>* 单条修改在表单下拉框选择规则,批量修改在右侧选规则点击【设置】统一更新所有规则</p>
|
|
|
+ <p>* “修改后”仅为展示,【确认】后才会刷新文件题名</p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <div>批量设置:</div>
|
|
|
+ <el-select
|
|
|
+ v-model="setValue"
|
|
|
+ placeholder="请选择"
|
|
|
+
|
|
|
+ multiple
|
|
|
+ clearable
|
|
|
+ class="custom-select flex-1"
|
|
|
+
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in nodeTypeData"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <el-button type="primary" hc-btn size="small" class="ml-2" @click="batchSetRule">设置</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="position: relative; height: 440px" class="mt-2">
|
|
|
+ <hc-table :column="ruleTableColumn" :datas="ruleTableData">
|
|
|
+ <template #rule="{ row }">
|
|
|
+ <div class="flex items-center">
|
|
|
+ <span class="text-red">*</span>
|
|
|
+ <el-select
|
|
|
+ v-model="row.rule"
|
|
|
+ placeholder="请选择"
|
|
|
+ multiple
|
|
|
+ clearable
|
|
|
+ class="custom-select"
|
|
|
+ :popper-append-to-body="false"
|
|
|
+ @change="ruleChange(row)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in nodeTypeData"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </hc-table>
|
|
|
+ </div>
|
|
|
+ </hc-new-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -308,6 +379,7 @@ import { toPdfPage } from '~uti/btn-auth'
|
|
|
import wbsApi from '~api/data-fill/wbs'
|
|
|
import website from '~src/config'
|
|
|
import { getDictionaryData } from '~uti/tools'
|
|
|
+import { getDictionary } from '~api/other'
|
|
|
//变量
|
|
|
const useAppState = useAppStore()
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
@@ -316,7 +388,7 @@ const projectInfo = ref(useAppState.getProjectInfo)
|
|
|
const contractInfo = ref(useAppState.getContractInfo)
|
|
|
const isCollapse = ref(useAppState.getCollapse)
|
|
|
const isLayout = ref(useAppState.isLayout)
|
|
|
-
|
|
|
+const isTemplateType = ref(useAppState.contractInfo?.templateType === 2)
|
|
|
//变量
|
|
|
const wbstree = ref(null)
|
|
|
const wbstreeKey = ref(Math.random())
|
|
@@ -656,16 +728,7 @@ const tableSelectionChange = (rows) => {
|
|
|
|
|
|
//名称被点击
|
|
|
const tableRowName = (row) => {
|
|
|
- //如果 evisaPdfUrl 不为空,使用evisaPdfUrl,反之使用pdfUrl
|
|
|
- // if (row['evisaPdfUrl']) {
|
|
|
- // toPdfPage(row['evisaPdfUrl'])
|
|
|
- // //window.open(row['evisaPdfUrl'], '_blank')
|
|
|
- // } else if (row['pdfUrl']) {
|
|
|
- // toPdfPage(row['pdfUrl'])
|
|
|
- // //window.open(row['pdfUrl'], '_blank')
|
|
|
- // } else {
|
|
|
- // window.$message?.warning('文件不存在')
|
|
|
- // }
|
|
|
+
|
|
|
bussPreview(row)
|
|
|
}
|
|
|
|
|
@@ -1044,22 +1107,171 @@ const objArr = rows.map(row => ({
|
|
|
const saveAginLoading = ref(false)
|
|
|
|
|
|
//重置文件题名
|
|
|
+const resignTitleModal = ref(false)
|
|
|
const resignTitleClick = async ()=>{
|
|
|
- const rows = tableCheckedKeys.value
|
|
|
-
|
|
|
- const ids = arrToId(rows)
|
|
|
- resignTitleLoading.value = true
|
|
|
+
|
|
|
+ // resignTitleModal.value = true
|
|
|
+ if (isTemplateType.value) {
|
|
|
+ resignTitleModal.value = true
|
|
|
+ } else {
|
|
|
+ resignTitleSave()
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+const resignTitleSave = async ()=>{
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
+ let arr = []
|
|
|
+ rows.forEach(item=>{
|
|
|
+ arr.push({
|
|
|
+ id:item.id,
|
|
|
+ nodeName:'',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ ruleModalSaveLoad.value = true
|
|
|
const { error, code, msg, data } = await queryApi.flushQueryName({
|
|
|
- ids: ids,
|
|
|
+ type:1,
|
|
|
+ list:arr,
|
|
|
+
|
|
|
})
|
|
|
//处理数据
|
|
|
- resignTitleLoading.value = false
|
|
|
+ ruleModalSaveLoad.value = false
|
|
|
if (!error && code === 200) {
|
|
|
+ window.$message?.success(msg)
|
|
|
+ resignTitleModal.value = false
|
|
|
+
|
|
|
getTableData().then()
|
|
|
+ } else {
|
|
|
+ window.$message?.error(msg || '操作失败')
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+const resignTitleSaveLoad = ref(false)
|
|
|
+
|
|
|
+//规则更改
|
|
|
+const changeRuleClick = ()=>{
|
|
|
+ getWbsNodeTypeApi().then()
|
|
|
+ ruleModal.value = true
|
|
|
+ ruleTableData.value = []
|
|
|
+ tableCheckedKeys.value.forEach((ele)=>{
|
|
|
+ ruleTableData.value.push({
|
|
|
+ name:ele.name,
|
|
|
+ wbsId:ele.wbsId,
|
|
|
+ id:ele.id,
|
|
|
+ rule:'',
|
|
|
+ nodeName:'',
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+const ruleModal = ref(false)
|
|
|
+const ruleModalSaveLoad = ref(false)
|
|
|
+const ruleModalClose = ()=>{
|
|
|
+ ruleModal.value = false
|
|
|
+ setValue.value = []
|
|
|
+}
|
|
|
+const ruleModalSave = async ()=>{
|
|
|
+ let isCanSave = ruleTableData.value.every(row => row.rule && row.rule.length > 0)
|
|
|
+ if (!isCanSave) {
|
|
|
+ window.$message.warning('请选择题名规规则')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let arr = []
|
|
|
+ ruleTableData.value.forEach(item=>{
|
|
|
+ arr.push({
|
|
|
+ id:item.id,
|
|
|
+ nodeName:item.nodeName,
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ ruleModalSaveLoad.value = true
|
|
|
+ const { error, code, msg, data } = await queryApi.flushQueryName({
|
|
|
+ type:2,
|
|
|
+ list:arr,
|
|
|
+
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ ruleModalSaveLoad.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message?.success(msg)
|
|
|
+ getTableData().then()
|
|
|
+ ruleModalClose()
|
|
|
+ resignTitleModal.value = false
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-const resignTitleLoading = ref(false)
|
|
|
+const setValue = ref('')
|
|
|
+
|
|
|
+const ruleTableColumn = ref([
|
|
|
+ { key: 'name', name: '文件题名' },
|
|
|
+ { key: 'nodeName', name: '修改后' },
|
|
|
+ { key: 'rule', name: '题名规则' },
|
|
|
+])
|
|
|
+const ruleTableData = ref([])
|
|
|
+const batchSetRule = ()=>{
|
|
|
+ ruleTableData.value.forEach(async (ele)=>{
|
|
|
+ ele.rule = setValue.value
|
|
|
+ let str = ''
|
|
|
+ if (ele.rule.length > 0) {
|
|
|
+ str = ele.rule.join('-')
|
|
|
+ }
|
|
|
+ ele.nodeName = await getRuleValue(ele.wbsId, str)
|
|
|
+ setValue.value = ''
|
|
|
+
|
|
|
+ })
|
|
|
+}
|
|
|
+const ruleChange = async (ele)=>{
|
|
|
+ let str = ''
|
|
|
+ if (ele.rule.length > 0) {
|
|
|
+ str = ele.rule.join('-')
|
|
|
+ }
|
|
|
+
|
|
|
+ ele.nodeName = await getRuleValue(ele.wbsId, str)
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+const getRuleLoad = ref(false)
|
|
|
+const getRuleValue = async (wbsId, param) => {
|
|
|
+ if (!param) {
|
|
|
+ window.$message?.warning('请选择题名规则')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ getRuleLoad.value = true
|
|
|
+ const { error, code, msg, data } = await queryApi.previewNodeName({
|
|
|
+ wbsId:wbsId,
|
|
|
+ param:param,
|
|
|
+
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ getRuleLoad.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ return data || ''
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+//获取节点类型
|
|
|
+const nodeTypeData = ref([])
|
|
|
+const getWbsNodeTypeApi = async () => {
|
|
|
+ const { data } = await getDictionary({
|
|
|
+ code: 'name_rule',
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ let newArr = []
|
|
|
+ const newData = getArrValue(data)
|
|
|
+ for (let i = 0; i < newData.length; i++) {
|
|
|
+ if (newData[i]['dictKey'] !== 'C0') {
|
|
|
+ newArr.push({
|
|
|
+ label: newData[i]['dictValue'],
|
|
|
+ value:newData[i]['dictKey'],
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ nodeTypeData.value = newArr
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -1067,6 +1279,9 @@ const resignTitleLoading = ref(false)
|
|
|
.iscusor {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+.bg-primary-color {
|
|
|
+ background-color: var(--el-color-primary) ;
|
|
|
+}
|
|
|
</style>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -1089,4 +1304,17 @@ const resignTitleLoading = ref(false)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.custom-select{
|
|
|
+ .el-select__wrapper {
|
|
|
+ height: 32px;
|
|
|
+ overflow-y: hidden;
|
|
|
+ }
|
|
|
+ .el-select__selection.is-near {
|
|
|
+ height: 32px;
|
|
|
+ overflow-y: hidden;
|
|
|
+ overflow-x: hidden;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|